@dendelion/paper-camp 0.23.2 → 0.25.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-SD_x9Z5F.js → index-15mPrQq0.js} +2 -2
- package/dist/app/assets/{index-SD_x9Z5F.js.map → index-15mPrQq0.js.map} +1 -1
- package/dist/app/assets/{index-DG2ri3IF.js → index-81fEepOO.js} +3 -3
- package/dist/app/assets/{index-DG2ri3IF.js.map → index-81fEepOO.js.map} +1 -1
- package/dist/app/assets/{index-mmzETz6G.js → index-BBvcyiG4.js} +3 -3
- package/dist/app/assets/{index-mmzETz6G.js.map → index-BBvcyiG4.js.map} +1 -1
- package/dist/app/assets/index-BJqS77OS.js +2 -0
- package/dist/app/assets/{index-Do4T60UL.js.map → index-BJqS77OS.js.map} +1 -1
- package/dist/app/assets/index-BVj9hjpY.js +2 -0
- package/dist/app/assets/{index-DxehIB14.js.map → index-BVj9hjpY.js.map} +1 -1
- package/dist/app/assets/index-CbsAL0YR.js +2 -0
- package/dist/app/assets/{index-DePKcR5b.js.map → index-CbsAL0YR.js.map} +1 -1
- package/dist/app/assets/index-DdZYRgzN.js +2 -0
- package/dist/app/assets/index-DdZYRgzN.js.map +1 -0
- package/dist/app/assets/index-cCrMJylm.js +3 -0
- package/dist/app/assets/index-cCrMJylm.js.map +1 -0
- package/dist/app/assets/main-CpTKYLW_.js +425 -0
- package/dist/app/assets/main-CpTKYLW_.js.map +1 -0
- package/dist/app/assets/main-iyjvjZKW.css +1 -0
- package/dist/app/assets/{sidebar-section-RSOrdZKe.js → sidebar-section-DsDt34HB.js} +2 -2
- package/dist/app/assets/{sidebar-section-RSOrdZKe.js.map → sidebar-section-DsDt34HB.js.map} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/app/toolbar.js +3176 -3113
- package/dist/app/toolbar.js.map +1 -1
- package/dist/chunks/dev-port.BHJn90Pm.js +52 -0
- package/dist/chunks/dev-port.BHJn90Pm.js.map +1 -0
- package/dist/chunks/{phase-progress.DvktSTIz.js → machine-registry.BdaWfuyz.js} +1450 -1350
- package/dist/chunks/machine-registry.BdaWfuyz.js.map +1 -0
- package/dist/cli/index.js +8284 -7777
- package/dist/cli/index.js.map +1 -1
- package/dist/core/desk-discovery/evidence.d.ts +21 -0
- package/dist/core/desk-discovery/evidence.d.ts.map +1 -0
- package/dist/core/desk-discovery/evidence.test.d.ts +2 -0
- package/dist/core/desk-discovery/evidence.test.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 +123 -114
- package/dist/core/machine-registry/index.d.ts +2 -0
- package/dist/core/machine-registry/index.d.ts.map +1 -0
- package/dist/core/machine-registry/machine-registry.d.ts +39 -0
- package/dist/core/machine-registry/machine-registry.d.ts.map +1 -0
- package/dist/core/machine-registry/machine-registry.test.d.ts +2 -0
- package/dist/core/machine-registry/machine-registry.test.d.ts.map +1 -0
- package/dist/core/parse/schemas.d.ts +8 -0
- package/dist/core/parse/schemas.d.ts.map +1 -1
- package/dist/core/tailnet.d.ts +14 -0
- package/dist/core/tailnet.d.ts.map +1 -0
- package/dist/core/tailnet.test.d.ts +2 -0
- package/dist/core/tailnet.test.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +19 -17
- package/dist/types/index.js.map +1 -1
- package/dist/vite/index.js +44 -51
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/proxy.d.ts +2 -1
- package/dist/vite/proxy.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/app/assets/index-BHPCJror.js +0 -3
- package/dist/app/assets/index-BHPCJror.js.map +0 -1
- package/dist/app/assets/index-D_2SBGCS.js +0 -2
- package/dist/app/assets/index-D_2SBGCS.js.map +0 -1
- package/dist/app/assets/index-DePKcR5b.js +0 -2
- package/dist/app/assets/index-Do4T60UL.js +0 -2
- package/dist/app/assets/index-DxehIB14.js +0 -2
- package/dist/app/assets/main-DiplEwD3.js +0 -425
- package/dist/app/assets/main-DiplEwD3.js.map +0 -1
- package/dist/app/assets/main-DoJre3S-.css +0 -1
- package/dist/chunks/dev-port.DgdJE2bY.js +0 -43
- package/dist/chunks/dev-port.DgdJE2bY.js.map +0 -1
- package/dist/chunks/phase-progress.DvktSTIz.js.map +0 -1
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-15mPrQq0.js","assets/sidebar-section-DsDt34HB.js","assets/index-DdZYRgzN.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 nd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U1={exports:{}},hf={},W1={exports:{}},ue={};/**
|
|
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 Yl=Symbol.for("react.element"),uA=Symbol.for("react.portal"),dA=Symbol.for("react.fragment"),fA=Symbol.for("react.strict_mode"),hA=Symbol.for("react.profiler"),pA=Symbol.for("react.provider"),mA=Symbol.for("react.context"),gA=Symbol.for("react.forward_ref"),yA=Symbol.for("react.suspense"),xA=Symbol.for("react.memo"),vA=Symbol.for("react.lazy"),qv=Symbol.iterator;function bA(e){return e===null||typeof e!="object"?null:(e=qv&&e[qv]||e["@@iterator"],typeof e=="function"?e:null)}var K1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H1=Object.assign,G1={};function Qo(e,t,n){this.props=e,this.context=t,this.refs=G1,this.updater=n||K1}Qo.prototype.isReactComponent={};Qo.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")};Qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Z1(){}Z1.prototype=Qo.prototype;function fy(e,t,n){this.props=e,this.context=t,this.refs=G1,this.updater=n||K1}var hy=fy.prototype=new Z1;hy.constructor=fy;H1(hy,Qo.prototype);hy.isPureReactComponent=!0;var Yv=Array.isArray,q1=Object.prototype.hasOwnProperty,py={current:null},Y1={key:!0,ref:!0,__self:!0,__source:!0};function J1(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)q1.call(t,r)&&!Y1.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:Yl,type:e,key:i,ref:o,props:s,_owner:py.current}}function wA(e,t){return{$$typeof:Yl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function my(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yl}function kA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Jv=/\/+/g;function xh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kA(""+e.key):t.toString(36)}function Su(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 Yl:case uA:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+xh(o,0):r,Yv(s)?(n="",e!=null&&(n=e.replace(Jv,"$&/")+"/"),Su(s,t,n,"",function(c){return c})):s!=null&&(my(s)&&(s=wA(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Jv,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Yv(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+xh(i,a);o+=Su(i,t,n,l,s)}else if(l=bA(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+xh(i,a++),o+=Su(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 Pc(e,t,n){if(e==null)return e;var r=[],s=0;return Su(e,r,"","",function(i){return t.call(n,i,s++)}),r}function _A(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 $t={current:null},Cu={transition:null},SA={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:Cu,ReactCurrentOwner:py};function Q1(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:Pc,forEach:function(e,t,n){Pc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Pc(e,function(){t++}),t},toArray:function(e){return Pc(e,function(t){return t})||[]},only:function(e){if(!my(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ue.Component=Qo;ue.Fragment=dA;ue.Profiler=hA;ue.PureComponent=fy;ue.StrictMode=fA;ue.Suspense=yA;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SA;ue.act=Q1;ue.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=H1({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=py.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)q1.call(t,l)&&!Y1.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:Yl,type:e.type,key:s,ref:i,props:r,_owner:o}};ue.createContext=function(e){return e={$$typeof:mA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pA,_context:e},e.Consumer=e};ue.createElement=J1;ue.createFactory=function(e){var t=J1.bind(null,e);return t.type=e,t};ue.createRef=function(){return{current:null}};ue.forwardRef=function(e){return{$$typeof:gA,render:e}};ue.isValidElement=my;ue.lazy=function(e){return{$$typeof:vA,_payload:{_status:-1,_result:e},_init:_A}};ue.memo=function(e,t){return{$$typeof:xA,type:e,compare:t===void 0?null:t}};ue.startTransition=function(e){var t=Cu.transition;Cu.transition={};try{e()}finally{Cu.transition=t}};ue.unstable_act=Q1;ue.useCallback=function(e,t){return $t.current.useCallback(e,t)};ue.useContext=function(e){return $t.current.useContext(e)};ue.useDebugValue=function(){};ue.useDeferredValue=function(e){return $t.current.useDeferredValue(e)};ue.useEffect=function(e,t){return $t.current.useEffect(e,t)};ue.useId=function(){return $t.current.useId()};ue.useImperativeHandle=function(e,t,n){return $t.current.useImperativeHandle(e,t,n)};ue.useInsertionEffect=function(e,t){return $t.current.useInsertionEffect(e,t)};ue.useLayoutEffect=function(e,t){return $t.current.useLayoutEffect(e,t)};ue.useMemo=function(e,t){return $t.current.useMemo(e,t)};ue.useReducer=function(e,t,n){return $t.current.useReducer(e,t,n)};ue.useRef=function(e){return $t.current.useRef(e)};ue.useState=function(e){return $t.current.useState(e)};ue.useSyncExternalStore=function(e,t,n){return $t.current.useSyncExternalStore(e,t,n)};ue.useTransition=function(){return $t.current.useTransition()};ue.version="18.3.1";W1.exports=ue;var k=W1.exports;const Ro=ff(k);/**
|
|
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 CA=k,jA=Symbol.for("react.element"),EA=Symbol.for("react.fragment"),PA=Object.prototype.hasOwnProperty,TA=CA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,NA={key:!0,ref:!0,__self:!0,__source:!0};function X1(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)PA.call(t,r)&&!NA.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:jA,type:e,key:i,ref:o,props:s,_owner:TA.current}}hf.Fragment=EA;hf.jsx=X1;hf.jsxs=X1;U1.exports=hf;var d=U1.exports,eS={exports:{}},pn={},tS={exports:{}},nS={};/**
|
|
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(O,V){var C=O.length;O.push(V);e:for(;0<C;){var U=C-1>>>1,Q=O[U];if(0<s(Q,V))O[U]=V,O[C]=Q,C=U;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var V=O[0],C=O.pop();if(C!==V){O[0]=C;e:for(var U=0,Q=O.length,A=Q>>>1;U<A;){var me=2*(U+1)-1,ke=O[me],ve=me+1,Xt=O[ve];if(0>s(ke,C))ve<Q&&0>s(Xt,ke)?(O[U]=Xt,O[ve]=C,U=ve):(O[U]=ke,O[me]=C,U=me);else if(ve<Q&&0>s(Xt,C))O[U]=Xt,O[ve]=C,U=ve;else break e}}return V}function s(O,V){var C=O.sortIndex-V.sortIndex;return C!==0?C:O.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,h=3,p=!1,m=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=O)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function w(O){if(g=!1,b(O),!m)if(n(l)!==null)m=!0,$(_);else{var V=n(c);V!==null&&D(w,V.startTime-O)}}function _(O,V){m=!1,g&&(g=!1,y(E),E=-1),p=!0;var C=h;try{for(b(V),f=n(l);f!==null&&(!(f.expirationTime>V)||O&&!N());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var Q=U(f.expirationTime<=V);V=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(l)&&r(l),b(V)}else r(l);f=n(l)}if(f!==null)var A=!0;else{var me=n(c);me!==null&&D(w,me.startTime-V),A=!1}return A}finally{f=null,h=C,p=!1}}var S=!1,j=null,E=-1,T=5,P=-1;function N(){return!(e.unstable_now()-P<T)}function R(){if(j!==null){var O=e.unstable_now();P=O;var V=!0;try{V=j(!0,O)}finally{V?L():(S=!1,j=null)}}else S=!1}var L;if(typeof v=="function")L=function(){v(R)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,z=I.port2;I.port1.onmessage=R,L=function(){z.postMessage(null)}}else L=function(){x(R,0)};function $(O){j=O,S||(S=!0,L())}function D(O,V){E=x(function(){O(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,$(_))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var C=h;h=V;try{return O()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,V){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var C=h;h=O;try{return V()}finally{h=C}},e.unstable_scheduleCallback=function(O,V,C){var U=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?U+C:U):C=U,O){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,O={id:u++,callback:V,priorityLevel:O,startTime:C,expirationTime:Q,sortIndex:-1},C>U?(O.sortIndex=C,t(c,O),n(l)===null&&O===n(c)&&(g?(y(E),E=-1):g=!0,D(w,C-U))):(O.sortIndex=Q,t(l,O),m||p||(m=!0,$(_))),O},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(O){var V=h;return function(){var C=h;h=V;try{return O.apply(this,arguments)}finally{h=C}}}})(nS);tS.exports=nS;var IA=tS.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 AA=k,fn=IA;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rS=new Set,yl={};function Pi(e,t){Lo(e,t),Lo(e+"Capture",t)}function Lo(e,t){for(yl[e]=t,e=0;e<t.length;e++)rS.add(t[e])}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rm=Object.prototype.hasOwnProperty,RA=/^[: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]*$/,Qv={},Xv={};function LA(e){return rm.call(Xv,e)?!0:rm.call(Qv,e)?!1:RA.test(e)?Xv[e]=!0:(Qv[e]=!0,!1)}function MA(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 $A(e,t,n,r){if(t===null||typeof t>"u"||MA(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 Dt(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 yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yt[e]=new Dt(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){yt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var gy=/[\-:]([a-z])/g;function yy(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(gy,yy);yt[t]=new Dt(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(gy,yy);yt[t]=new Dt(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(gy,yy);yt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});yt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function xy(e,t,n,r){var s=yt.hasOwnProperty(t)?yt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($A(t,n,s,r)&&(n=null),r||s===null?LA(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 Wr=AA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tc=Symbol.for("react.element"),Xi=Symbol.for("react.portal"),eo=Symbol.for("react.fragment"),vy=Symbol.for("react.strict_mode"),sm=Symbol.for("react.profiler"),sS=Symbol.for("react.provider"),iS=Symbol.for("react.context"),by=Symbol.for("react.forward_ref"),im=Symbol.for("react.suspense"),om=Symbol.for("react.suspense_list"),wy=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),oS=Symbol.for("react.offscreen"),e0=Symbol.iterator;function ba(e){return e===null||typeof e!="object"?null:(e=e0&&e[e0]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,vh;function Ba(e){if(vh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);vh=t&&t[1]||""}return`
|
|
35
|
+
`+vh+e}var bh=!1;function wh(e,t){if(!e||bh)return"";bh=!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{bh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ba(e):""}function DA(e){switch(e.tag){case 5:return Ba(e.type);case 16:return Ba("Lazy");case 13:return Ba("Suspense");case 19:return Ba("SuspenseList");case 0:case 2:case 15:return e=wh(e.type,!1),e;case 11:return e=wh(e.type.render,!1),e;case 1:return e=wh(e.type,!0),e;default:return""}}function am(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 eo:return"Fragment";case Xi:return"Portal";case sm:return"Profiler";case vy:return"StrictMode";case im:return"Suspense";case om:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iS:return(e.displayName||"Context")+".Consumer";case sS:return(e._context.displayName||"Context")+".Provider";case by:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wy:return t=e.displayName||null,t!==null?t:am(e.type)||"Memo";case is:t=e._payload,e=e._init;try{return am(e(t))}catch{}}return null}function OA(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 am(t);case 8:return t===vy?"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 Ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function aS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zA(e){var t=aS(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 Nc(e){e._valueTracker||(e._valueTracker=zA(e))}function lS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=aS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function rd(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 lm(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function t0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ns(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 cS(e,t){t=t.checked,t!=null&&xy(e,"checked",t,!1)}function cm(e,t){cS(e,t);var n=Ns(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")?um(e,t.type,n):t.hasOwnProperty("defaultValue")&&um(e,t.type,Ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function n0(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 um(e,t,n){(t!=="number"||rd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Va=Array.isArray;function bo(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=""+Ns(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 dm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function r0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Va(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ns(n)}}function uS(e,t){var n=Ns(t.value),r=Ns(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 s0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function dS(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 fm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?dS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ic,fS=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(Ic=Ic||document.createElement("div"),Ic.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ic.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ya={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},FA=["Webkit","ms","Moz","O"];Object.keys(Ya).forEach(function(e){FA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ya[t]=Ya[e]})});function hS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ya.hasOwnProperty(e)&&Ya[e]?(""+t).trim():t+"px"}function pS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=hS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var BA=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hm(e,t){if(t){if(BA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function pm(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 mm=null;function ky(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gm=null,wo=null,ko=null;function i0(e){if(e=Xl(e)){if(typeof gm!="function")throw Error(W(280));var t=e.stateNode;t&&(t=xf(t),gm(e.stateNode,e.type,t))}}function mS(e){wo?ko?ko.push(e):ko=[e]:wo=e}function gS(){if(wo){var e=wo,t=ko;if(ko=wo=null,i0(e),t)for(e=0;e<t.length;e++)i0(t[e])}}function yS(e,t){return e(t)}function xS(){}var kh=!1;function vS(e,t,n){if(kh)return e(t,n);kh=!0;try{return yS(e,t,n)}finally{kh=!1,(wo!==null||ko!==null)&&(xS(),gS())}}function vl(e,t){var n=e.stateNode;if(n===null)return null;var r=xf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var ym=!1;if(Fr)try{var wa={};Object.defineProperty(wa,"passive",{get:function(){ym=!0}}),window.addEventListener("test",wa,wa),window.removeEventListener("test",wa,wa)}catch{ym=!1}function VA(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 Ja=!1,sd=null,id=!1,xm=null,UA={onError:function(e){Ja=!0,sd=e}};function WA(e,t,n,r,s,i,o,a,l){Ja=!1,sd=null,VA.apply(UA,arguments)}function KA(e,t,n,r,s,i,o,a,l){if(WA.apply(this,arguments),Ja){if(Ja){var c=sd;Ja=!1,sd=null}else throw Error(W(198));id||(id=!0,xm=c)}}function Ti(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 bS(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 o0(e){if(Ti(e)!==e)throw Error(W(188))}function HA(e){var t=e.alternate;if(!t){if(t=Ti(e),t===null)throw Error(W(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 o0(s),e;if(i===r)return o0(s),t;i=i.sibling}throw Error(W(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(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function wS(e){return e=HA(e),e!==null?kS(e):null}function kS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=kS(e);if(t!==null)return t;e=e.sibling}return null}var _S=fn.unstable_scheduleCallback,a0=fn.unstable_cancelCallback,GA=fn.unstable_shouldYield,ZA=fn.unstable_requestPaint,Ke=fn.unstable_now,qA=fn.unstable_getCurrentPriorityLevel,_y=fn.unstable_ImmediatePriority,SS=fn.unstable_UserBlockingPriority,od=fn.unstable_NormalPriority,YA=fn.unstable_LowPriority,CS=fn.unstable_IdlePriority,pf=null,mr=null;function JA(e){if(mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(pf,e,void 0,(e.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:e2,QA=Math.log,XA=Math.LN2;function e2(e){return e>>>=0,e===0?32:31-(QA(e)/XA|0)|0}var Ac=64,Rc=4194304;function Ua(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 ad(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=Ua(a):(i&=o,i!==0&&(r=Ua(i)))}else o=n&~s,o!==0?r=Ua(o):i!==0&&(r=Ua(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-qn(t),s=1<<n,r|=e[n],t&=~s;return r}function t2(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 n2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-qn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=t2(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function vm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function jS(){var e=Ac;return Ac<<=1,!(Ac&4194240)&&(Ac=64),e}function _h(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qn(t),e[t]=n}function r2(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-qn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Sy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var xe=0;function ES(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var PS,Cy,TS,NS,IS,bm=!1,Lc=[],xs=null,vs=null,bs=null,bl=new Map,wl=new Map,cs=[],s2="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 l0(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":bl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(t.pointerId)}}function ka(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=Xl(t),t!==null&&Cy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function i2(e,t,n,r,s){switch(t){case"focusin":return xs=ka(xs,e,t,n,r,s),!0;case"dragenter":return vs=ka(vs,e,t,n,r,s),!0;case"mouseover":return bs=ka(bs,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return bl.set(i,ka(bl.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,wl.set(i,ka(wl.get(i)||null,e,t,n,r,s)),!0}return!1}function AS(e){var t=si(e.target);if(t!==null){var n=Ti(t);if(n!==null){if(t=n.tag,t===13){if(t=bS(n),t!==null){e.blockedOn=t,IS(e.priority,function(){TS(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 ju(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mm=r,n.target.dispatchEvent(r),mm=null}else return t=Xl(n),t!==null&&Cy(t),e.blockedOn=n,!1;t.shift()}return!0}function c0(e,t,n){ju(e)&&n.delete(t)}function o2(){bm=!1,xs!==null&&ju(xs)&&(xs=null),vs!==null&&ju(vs)&&(vs=null),bs!==null&&ju(bs)&&(bs=null),bl.forEach(c0),wl.forEach(c0)}function _a(e,t){e.blockedOn===t&&(e.blockedOn=null,bm||(bm=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,o2)))}function kl(e){function t(s){return _a(s,e)}if(0<Lc.length){_a(Lc[0],e);for(var n=1;n<Lc.length;n++){var r=Lc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&_a(xs,e),vs!==null&&_a(vs,e),bs!==null&&_a(bs,e),bl.forEach(t),wl.forEach(t),n=0;n<cs.length;n++)r=cs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cs.length&&(n=cs[0],n.blockedOn===null);)AS(n),n.blockedOn===null&&cs.shift()}var _o=Wr.ReactCurrentBatchConfig,ld=!0;function a2(e,t,n,r){var s=xe,i=_o.transition;_o.transition=null;try{xe=1,jy(e,t,n,r)}finally{xe=s,_o.transition=i}}function l2(e,t,n,r){var s=xe,i=_o.transition;_o.transition=null;try{xe=4,jy(e,t,n,r)}finally{xe=s,_o.transition=i}}function jy(e,t,n,r){if(ld){var s=wm(e,t,n,r);if(s===null)Rh(e,t,r,cd,n),l0(e,r);else if(i2(s,e,t,n,r))r.stopPropagation();else if(l0(e,r),t&4&&-1<s2.indexOf(e)){for(;s!==null;){var i=Xl(s);if(i!==null&&PS(i),i=wm(e,t,n,r),i===null&&Rh(e,t,r,cd,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Rh(e,t,r,null,n)}}var cd=null;function wm(e,t,n,r){if(cd=null,e=ky(r),e=si(e),e!==null)if(t=Ti(e),t===null)e=null;else if(n=t.tag,n===13){if(e=bS(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 cd=e,null}function RS(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(qA()){case _y:return 1;case SS:return 4;case od:case YA:return 16;case CS:return 536870912;default:return 16}default:return 16}}var ds=null,Ey=null,Eu=null;function LS(){if(Eu)return Eu;var e,t=Ey,n=t.length,r,s="value"in ds?ds.value:ds.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 Eu=s.slice(e,1<r?1-r:void 0)}function Pu(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 Mc(){return!0}function u0(){return!1}function mn(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)?Mc:u0,this.isPropagationStopped=u0,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Mc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mc)},persist:function(){},isPersistent:Mc}),t}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Py=mn(Xo),Ql=ze({},Xo,{view:0,detail:0}),c2=mn(Ql),Sh,Ch,Sa,mf=ze({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ty,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!==Sa&&(Sa&&e.type==="mousemove"?(Sh=e.screenX-Sa.screenX,Ch=e.screenY-Sa.screenY):Ch=Sh=0,Sa=e),Sh)},movementY:function(e){return"movementY"in e?e.movementY:Ch}}),d0=mn(mf),u2=ze({},mf,{dataTransfer:0}),d2=mn(u2),f2=ze({},Ql,{relatedTarget:0}),jh=mn(f2),h2=ze({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),p2=mn(h2),m2=ze({},Xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),g2=mn(m2),y2=ze({},Xo,{data:0}),f0=mn(y2),x2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v2={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"},b2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=b2[e])?!!t[e]:!1}function Ty(){return w2}var k2=ze({},Ql,{key:function(e){if(e.key){var t=x2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Pu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?v2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ty,charCode:function(e){return e.type==="keypress"?Pu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_2=mn(k2),S2=ze({},mf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),h0=mn(S2),C2=ze({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ty}),j2=mn(C2),E2=ze({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),P2=mn(E2),T2=ze({},mf,{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}),N2=mn(T2),I2=[9,13,27,32],Ny=Fr&&"CompositionEvent"in window,Qa=null;Fr&&"documentMode"in document&&(Qa=document.documentMode);var A2=Fr&&"TextEvent"in window&&!Qa,MS=Fr&&(!Ny||Qa&&8<Qa&&11>=Qa),p0=" ",m0=!1;function $S(e,t){switch(e){case"keyup":return I2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function R2(e,t){switch(e){case"compositionend":return DS(t);case"keypress":return t.which!==32?null:(m0=!0,p0);case"textInput":return e=t.data,e===p0&&m0?null:e;default:return null}}function L2(e,t){if(to)return e==="compositionend"||!Ny&&$S(e,t)?(e=LS(),Eu=Ey=ds=null,to=!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 MS&&t.locale!=="ko"?null:t.data;default:return null}}var M2={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 g0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!M2[e.type]:t==="textarea"}function OS(e,t,n,r){mS(r),t=ud(t,"onChange"),0<t.length&&(n=new Py("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xa=null,_l=null;function $2(e){qS(e,0)}function gf(e){var t=so(e);if(lS(t))return e}function D2(e,t){if(e==="change")return t}var zS=!1;if(Fr){var Eh;if(Fr){var Ph="oninput"in document;if(!Ph){var y0=document.createElement("div");y0.setAttribute("oninput","return;"),Ph=typeof y0.oninput=="function"}Eh=Ph}else Eh=!1;zS=Eh&&(!document.documentMode||9<document.documentMode)}function x0(){Xa&&(Xa.detachEvent("onpropertychange",FS),_l=Xa=null)}function FS(e){if(e.propertyName==="value"&&gf(_l)){var t=[];OS(t,_l,e,ky(e)),vS($2,t)}}function O2(e,t,n){e==="focusin"?(x0(),Xa=t,_l=n,Xa.attachEvent("onpropertychange",FS)):e==="focusout"&&x0()}function z2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gf(_l)}function F2(e,t){if(e==="click")return gf(t)}function B2(e,t){if(e==="input"||e==="change")return gf(t)}function V2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:V2;function Sl(e,t){if(Qn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!rm.call(t,s)||!Qn(e[s],t[s]))return!1}return!0}function v0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function b0(e,t){var n=v0(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=v0(n)}}function BS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?BS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function VS(){for(var e=window,t=rd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=rd(e.document)}return t}function Iy(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 U2(e){var t=VS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&BS(n.ownerDocument.documentElement,n)){if(r!==null&&Iy(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=b0(n,i);var o=b0(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 W2=Fr&&"documentMode"in document&&11>=document.documentMode,no=null,km=null,el=null,_m=!1;function w0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_m||no==null||no!==rd(r)||(r=no,"selectionStart"in r&&Iy(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}),el&&Sl(el,r)||(el=r,r=ud(km,"onSelect"),0<r.length&&(t=new Py("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function $c(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:$c("Animation","AnimationEnd"),animationiteration:$c("Animation","AnimationIteration"),animationstart:$c("Animation","AnimationStart"),transitionend:$c("Transition","TransitionEnd")},Th={},US={};Fr&&(US=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function yf(e){if(Th[e])return Th[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in US)return Th[e]=t[n];return e}var WS=yf("animationend"),KS=yf("animationiteration"),HS=yf("animationstart"),GS=yf("transitionend"),ZS=new Map,k0="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 $s(e,t){ZS.set(e,t),Pi(t,[e])}for(var Nh=0;Nh<k0.length;Nh++){var Ih=k0[Nh],K2=Ih.toLowerCase(),H2=Ih[0].toUpperCase()+Ih.slice(1);$s(K2,"on"+H2)}$s(WS,"onAnimationEnd");$s(KS,"onAnimationIteration");$s(HS,"onAnimationStart");$s("dblclick","onDoubleClick");$s("focusin","onFocus");$s("focusout","onBlur");$s(GS,"onTransitionEnd");Lo("onMouseEnter",["mouseout","mouseover"]);Lo("onMouseLeave",["mouseout","mouseover"]);Lo("onPointerEnter",["pointerout","pointerover"]);Lo("onPointerLeave",["pointerout","pointerover"]);Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wa="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(" "),G2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wa));function _0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,KA(r,t,void 0,e),e.currentTarget=null}function qS(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;_0(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;_0(s,a,c),i=l}}}if(id)throw e=xm,id=!1,xm=null,e}function Ae(e,t){var n=t[Pm];n===void 0&&(n=t[Pm]=new Set);var r=e+"__bubble";n.has(r)||(YS(t,e,2,!1),n.add(r))}function Ah(e,t,n){var r=0;t&&(r|=4),YS(n,e,r,t)}var Dc="_reactListening"+Math.random().toString(36).slice(2);function Cl(e){if(!e[Dc]){e[Dc]=!0,rS.forEach(function(n){n!=="selectionchange"&&(G2.has(n)||Ah(n,!1,e),Ah(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dc]||(t[Dc]=!0,Ah("selectionchange",!1,t))}}function YS(e,t,n,r){switch(RS(t)){case 1:var s=a2;break;case 4:s=l2;break;default:s=jy}n=s.bind(null,t,n,e),s=void 0,!ym||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 Rh(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=si(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}vS(function(){var c=i,u=ky(n),f=[];e:{var h=ZS.get(e);if(h!==void 0){var p=Py,m=e;switch(e){case"keypress":if(Pu(n)===0)break e;case"keydown":case"keyup":p=_2;break;case"focusin":m="focus",p=jh;break;case"focusout":m="blur",p=jh;break;case"beforeblur":case"afterblur":p=jh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=d0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=d2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=j2;break;case WS:case KS:case HS:p=p2;break;case GS:p=P2;break;case"scroll":p=c2;break;case"wheel":p=N2;break;case"copy":case"cut":case"paste":p=g2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=h0}var g=(t&4)!==0,x=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var v=c,b;v!==null;){b=v;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,y!==null&&(w=vl(v,y),w!=null&&g.push(jl(v,w,b)))),x)break;v=v.return}0<g.length&&(h=new p(h,m,null,n,u),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==mm&&(m=n.relatedTarget||n.fromElement)&&(si(m)||m[Br]))break e;if((p||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?si(m):null,m!==null&&(x=Ti(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=d0,w="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=h0,w="onPointerLeave",y="onPointerEnter",v="pointer"),x=p==null?h:so(p),b=m==null?h:so(m),h=new g(w,v+"leave",p,n,u),h.target=x,h.relatedTarget=b,w=null,si(u)===c&&(g=new g(y,v+"enter",m,n,u),g.target=b,g.relatedTarget=x,w=g),x=w,p&&m)t:{for(g=p,y=m,v=0,b=g;b;b=Fi(b))v++;for(b=0,w=y;w;w=Fi(w))b++;for(;0<v-b;)g=Fi(g),v--;for(;0<b-v;)y=Fi(y),b--;for(;v--;){if(g===y||y!==null&&g===y.alternate)break t;g=Fi(g),y=Fi(y)}g=null}else g=null;p!==null&&S0(f,h,p,g,!1),m!==null&&x!==null&&S0(f,x,m,g,!0)}}e:{if(h=c?so(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=D2;else if(g0(h))if(zS)_=B2;else{_=z2;var S=O2}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=F2);if(_&&(_=_(e,c))){OS(f,_,n,u);break e}S&&S(e,h,c),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&um(h,"number",h.value)}switch(S=c?so(c):window,e){case"focusin":(g0(S)||S.contentEditable==="true")&&(no=S,km=c,el=null);break;case"focusout":el=km=no=null;break;case"mousedown":_m=!0;break;case"contextmenu":case"mouseup":case"dragend":_m=!1,w0(f,n,u);break;case"selectionchange":if(W2)break;case"keydown":case"keyup":w0(f,n,u)}var j;if(Ny)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else to?$S(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(MS&&n.locale!=="ko"&&(to||E!=="onCompositionStart"?E==="onCompositionEnd"&&to&&(j=LS()):(ds=u,Ey="value"in ds?ds.value:ds.textContent,to=!0)),S=ud(c,E),0<S.length&&(E=new f0(E,e,null,n,u),f.push({event:E,listeners:S}),j?E.data=j:(j=DS(n),j!==null&&(E.data=j)))),(j=A2?R2(e,n):L2(e,n))&&(c=ud(c,"onBeforeInput"),0<c.length&&(u=new f0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=j))}qS(f,t)})}function jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ud(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=vl(e,n),i!=null&&r.unshift(jl(e,i,s)),i=vl(e,t),i!=null&&r.push(jl(e,i,s))),e=e.return}return r}function Fi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function S0(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=vl(n,i),l!=null&&o.unshift(jl(n,l,a))):s||(l=vl(n,i),l!=null&&o.push(jl(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Z2=/\r\n?/g,q2=/\u0000|\uFFFD/g;function C0(e){return(typeof e=="string"?e:""+e).replace(Z2,`
|
|
39
|
+
`).replace(q2,"")}function Oc(e,t,n){if(t=C0(t),C0(e)!==t&&n)throw Error(W(425))}function dd(){}var Sm=null,Cm=null;function jm(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 Em=typeof setTimeout=="function"?setTimeout:void 0,Y2=typeof clearTimeout=="function"?clearTimeout:void 0,j0=typeof Promise=="function"?Promise:void 0,J2=typeof queueMicrotask=="function"?queueMicrotask:typeof j0<"u"?function(e){return j0.resolve(null).then(e).catch(Q2)}:Em;function Q2(e){setTimeout(function(){throw e})}function Lh(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),kl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);kl(t)}function ws(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 E0(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 ea=Math.random().toString(36).slice(2),hr="__reactFiber$"+ea,El="__reactProps$"+ea,Br="__reactContainer$"+ea,Pm="__reactEvents$"+ea,X2="__reactListeners$"+ea,eR="__reactHandles$"+ea;function si(e){var t=e[hr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Br]||n[hr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=E0(e);e!==null;){if(n=e[hr])return n;e=E0(e)}return t}e=n,n=e.parentNode}return null}function Xl(e){return e=e[hr]||e[Br],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function so(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function xf(e){return e[El]||null}var Tm=[],io=-1;function Ds(e){return{current:e}}function Re(e){0>io||(e.current=Tm[io],Tm[io]=null,io--)}function Pe(e,t){io++,Tm[io]=e.current,e.current=t}var Is={},Ct=Ds(Is),Wt=Ds(!1),bi=Is;function Mo(e,t){var n=e.type.contextTypes;if(!n)return Is;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Kt(e){return e=e.childContextTypes,e!=null}function fd(){Re(Wt),Re(Ct)}function P0(e,t,n){if(Ct.current!==Is)throw Error(W(168));Pe(Ct,t),Pe(Wt,n)}function JS(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(W(108,OA(e)||"Unknown",s));return ze({},n,r)}function hd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Is,bi=Ct.current,Pe(Ct,e),Pe(Wt,Wt.current),!0}function T0(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=JS(e,t,bi),r.__reactInternalMemoizedMergedChildContext=e,Re(Wt),Re(Ct),Pe(Ct,e)):Re(Wt),Pe(Wt,n)}var Nr=null,vf=!1,Mh=!1;function QS(e){Nr===null?Nr=[e]:Nr.push(e)}function tR(e){vf=!0,QS(e)}function Os(){if(!Mh&&Nr!==null){Mh=!0;var e=0,t=xe;try{var n=Nr;for(xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Nr=null,vf=!1}catch(s){throw Nr!==null&&(Nr=Nr.slice(e+1)),_S(_y,Os),s}finally{xe=t,Mh=!1}}return null}var oo=[],ao=0,pd=null,md=0,_n=[],Sn=0,wi=null,Lr=1,Mr="";function Qs(e,t){oo[ao++]=md,oo[ao++]=pd,pd=e,md=t}function XS(e,t,n){_n[Sn++]=Lr,_n[Sn++]=Mr,_n[Sn++]=wi,wi=e;var r=Lr;e=Mr;var s=32-qn(r)-1;r&=~(1<<s),n+=1;var i=32-qn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Lr=1<<32-qn(t)+s|n<<s|r,Mr=i+e}else Lr=1<<i|n<<s|r,Mr=e}function Ay(e){e.return!==null&&(Qs(e,1),XS(e,1,0))}function Ry(e){for(;e===pd;)pd=oo[--ao],oo[ao]=null,md=oo[--ao],oo[ao]=null;for(;e===wi;)wi=_n[--Sn],_n[Sn]=null,Mr=_n[--Sn],_n[Sn]=null,Lr=_n[--Sn],_n[Sn]=null}var cn=null,an=null,Me=!1,Zn=null;function eC(e,t){var n=En(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 N0(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,cn=e,an=ws(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cn=e,an=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wi!==null?{id:Lr,overflow:Mr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cn=e,an=null,!0):!1;default:return!1}}function Nm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Im(e){if(Me){var t=an;if(t){var n=t;if(!N0(e,t)){if(Nm(e))throw Error(W(418));t=ws(n.nextSibling);var r=cn;t&&N0(e,t)?eC(r,n):(e.flags=e.flags&-4097|2,Me=!1,cn=e)}}else{if(Nm(e))throw Error(W(418));e.flags=e.flags&-4097|2,Me=!1,cn=e}}}function I0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cn=e}function zc(e){if(e!==cn)return!1;if(!Me)return I0(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jm(e.type,e.memoizedProps)),t&&(t=an)){if(Nm(e))throw tC(),Error(W(418));for(;t;)eC(e,t),t=ws(t.nextSibling)}if(I0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){an=ws(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}an=null}}else an=cn?ws(e.stateNode.nextSibling):null;return!0}function tC(){for(var e=an;e;)e=ws(e.nextSibling)}function $o(){an=cn=null,Me=!1}function Ly(e){Zn===null?Zn=[e]:Zn.push(e)}var nR=Wr.ReactCurrentBatchConfig;function Ca(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var r=n.stateNode}if(!r)throw Error(W(147,e));var 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(W(284));if(!n._owner)throw Error(W(290,e))}return e}function Fc(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function A0(e){var t=e._init;return t(e._payload)}function nC(e){function t(y,v){if(e){var b=y.deletions;b===null?(y.deletions=[v],y.flags|=16):b.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function s(y,v){return y=Cs(y,v),y.index=0,y.sibling=null,y}function i(y,v,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<v?(y.flags|=2,v):b):(y.flags|=2,v)):(y.flags|=1048576,v)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,v,b,w){return v===null||v.tag!==6?(v=Vh(b,y.mode,w),v.return=y,v):(v=s(v,b),v.return=y,v)}function l(y,v,b,w){var _=b.type;return _===eo?u(y,v,b.props.children,w,b.key):v!==null&&(v.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&A0(_)===v.type)?(w=s(v,b.props),w.ref=Ca(y,v,b),w.return=y,w):(w=Mu(b.type,b.key,b.props,null,y.mode,w),w.ref=Ca(y,v,b),w.return=y,w)}function c(y,v,b,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Uh(b,y.mode,w),v.return=y,v):(v=s(v,b.children||[]),v.return=y,v)}function u(y,v,b,w,_){return v===null||v.tag!==7?(v=hi(b,y.mode,w,_),v.return=y,v):(v=s(v,b),v.return=y,v)}function f(y,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Vh(""+v,y.mode,b),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tc:return b=Mu(v.type,v.key,v.props,null,y.mode,b),b.ref=Ca(y,null,v),b.return=y,b;case Xi:return v=Uh(v,y.mode,b),v.return=y,v;case is:var w=v._init;return f(y,w(v._payload),b)}if(Va(v)||ba(v))return v=hi(v,y.mode,b,null),v.return=y,v;Fc(y,v)}return null}function h(y,v,b,w){var _=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:a(y,v,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Tc:return b.key===_?l(y,v,b,w):null;case Xi:return b.key===_?c(y,v,b,w):null;case is:return _=b._init,h(y,v,_(b._payload),w)}if(Va(b)||ba(b))return _!==null?null:u(y,v,b,w,null);Fc(y,b)}return null}function p(y,v,b,w,_){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(b)||null,a(v,y,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Tc:return y=y.get(w.key===null?b:w.key)||null,l(v,y,w,_);case Xi:return y=y.get(w.key===null?b:w.key)||null,c(v,y,w,_);case is:var S=w._init;return p(y,v,b,S(w._payload),_)}if(Va(w)||ba(w))return y=y.get(b)||null,u(v,y,w,_,null);Fc(v,w)}return null}function m(y,v,b,w){for(var _=null,S=null,j=v,E=v=0,T=null;j!==null&&E<b.length;E++){j.index>E?(T=j,j=null):T=j.sibling;var P=h(y,j,b[E],w);if(P===null){j===null&&(j=T);break}e&&j&&P.alternate===null&&t(y,j),v=i(P,v,E),S===null?_=P:S.sibling=P,S=P,j=T}if(E===b.length)return n(y,j),Me&&Qs(y,E),_;if(j===null){for(;E<b.length;E++)j=f(y,b[E],w),j!==null&&(v=i(j,v,E),S===null?_=j:S.sibling=j,S=j);return Me&&Qs(y,E),_}for(j=r(y,j);E<b.length;E++)T=p(j,y,E,b[E],w),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?E:T.key),v=i(T,v,E),S===null?_=T:S.sibling=T,S=T);return e&&j.forEach(function(N){return t(y,N)}),Me&&Qs(y,E),_}function g(y,v,b,w){var _=ba(b);if(typeof _!="function")throw Error(W(150));if(b=_.call(b),b==null)throw Error(W(151));for(var S=_=null,j=v,E=v=0,T=null,P=b.next();j!==null&&!P.done;E++,P=b.next()){j.index>E?(T=j,j=null):T=j.sibling;var N=h(y,j,P.value,w);if(N===null){j===null&&(j=T);break}e&&j&&N.alternate===null&&t(y,j),v=i(N,v,E),S===null?_=N:S.sibling=N,S=N,j=T}if(P.done)return n(y,j),Me&&Qs(y,E),_;if(j===null){for(;!P.done;E++,P=b.next())P=f(y,P.value,w),P!==null&&(v=i(P,v,E),S===null?_=P:S.sibling=P,S=P);return Me&&Qs(y,E),_}for(j=r(y,j);!P.done;E++,P=b.next())P=p(j,y,E,P.value,w),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?E:P.key),v=i(P,v,E),S===null?_=P:S.sibling=P,S=P);return e&&j.forEach(function(R){return t(y,R)}),Me&&Qs(y,E),_}function x(y,v,b,w){if(typeof b=="object"&&b!==null&&b.type===eo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Tc:e:{for(var _=b.key,S=v;S!==null;){if(S.key===_){if(_=b.type,_===eo){if(S.tag===7){n(y,S.sibling),v=s(S,b.props.children),v.return=y,y=v;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&A0(_)===S.type){n(y,S.sibling),v=s(S,b.props),v.ref=Ca(y,S,b),v.return=y,y=v;break e}n(y,S);break}else t(y,S);S=S.sibling}b.type===eo?(v=hi(b.props.children,y.mode,w,b.key),v.return=y,y=v):(w=Mu(b.type,b.key,b.props,null,y.mode,w),w.ref=Ca(y,v,b),w.return=y,y=w)}return o(y);case Xi:e:{for(S=b.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(y,v.sibling),v=s(v,b.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=Uh(b,y.mode,w),v.return=y,y=v}return o(y);case is:return S=b._init,x(y,v,S(b._payload),w)}if(Va(b))return m(y,v,b,w);if(ba(b))return g(y,v,b,w);Fc(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(y,v.sibling),v=s(v,b),v.return=y,y=v):(n(y,v),v=Vh(b,y.mode,w),v.return=y,y=v),o(y)):n(y,v)}return x}var Do=nC(!0),rC=nC(!1),gd=Ds(null),yd=null,lo=null,My=null;function $y(){My=lo=yd=null}function Dy(e){var t=gd.current;Re(gd),e._currentValue=t}function Am(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 So(e,t){yd=e,My=lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vt=!0),e.firstContext=null)}function Rn(e){var t=e._currentValue;if(My!==e)if(e={context:e,memoizedValue:t,next:null},lo===null){if(yd===null)throw Error(W(308));lo=e,yd.dependencies={lanes:0,firstContext:e}}else lo=lo.next=e;return t}var ii=null;function Oy(e){ii===null?ii=[e]:ii.push(e)}function sC(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Oy(t)):(n.next=s.next,s.next=n),t.interleaved=n,Vr(e,r)}function Vr(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 os=!1;function zy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iC(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 Dr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ks(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Vr(e,n)}return s=r.interleaved,s===null?(t.next=t,Oy(r)):(t.next=s.next,s.next=t),r.interleaved=t,Vr(e,n)}function Tu(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,Sy(e,n)}}function R0(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 xd(e,t,n,r){var s=e.updateQueue;os=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,u=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(h=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=ze({},f,h);break e;case 2:os=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);_i|=o,e.lanes=o,e.memoizedState=f}}function L0(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(W(191,s));s.call(r)}}}var ec={},gr=Ds(ec),Pl=Ds(ec),Tl=Ds(ec);function oi(e){if(e===ec)throw Error(W(174));return e}function Fy(e,t){switch(Pe(Tl,t),Pe(Pl,e),Pe(gr,ec),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fm(t,e)}Re(gr),Pe(gr,t)}function Oo(){Re(gr),Re(Pl),Re(Tl)}function oC(e){oi(Tl.current);var t=oi(gr.current),n=fm(t,e.type);t!==n&&(Pe(Pl,e),Pe(gr,n))}function By(e){Pl.current===e&&(Re(gr),Re(Pl))}var De=Ds(0);function vd(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 $h=[];function Vy(){for(var e=0;e<$h.length;e++)$h[e]._workInProgressVersionPrimary=null;$h.length=0}var Nu=Wr.ReactCurrentDispatcher,Dh=Wr.ReactCurrentBatchConfig,ki=0,Oe=null,ot=null,ut=null,bd=!1,tl=!1,Nl=0,rR=0;function vt(){throw Error(W(321))}function Uy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qn(e[n],t[n]))return!1;return!0}function Wy(e,t,n,r,s,i){if(ki=i,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nu.current=e===null||e.memoizedState===null?aR:lR,e=n(r,s),tl){i=0;do{if(tl=!1,Nl=0,25<=i)throw Error(W(301));i+=1,ut=ot=null,t.updateQueue=null,Nu.current=cR,e=n(r,s)}while(tl)}if(Nu.current=wd,t=ot!==null&&ot.next!==null,ki=0,ut=ot=Oe=null,bd=!1,t)throw Error(W(300));return e}function Ky(){var e=Nl!==0;return Nl=0,e}function ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Oe.memoizedState=ut=e:ut=ut.next=e,ut}function Ln(){if(ot===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=ut===null?Oe.memoizedState:ut.next;if(t!==null)ut=t,ot=e;else{if(e===null)throw Error(W(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},ut===null?Oe.memoizedState=ut=e:ut=ut.next=e}return ut}function Il(e,t){return typeof t=="function"?t(e):t}function Oh(e){var t=Ln(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=ot,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((ki&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,Oe.lanes|=u,_i|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Qn(r,t.memoizedState)||(Vt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Oe.lanes|=i,_i|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function zh(e){var t=Ln(),n=t.queue;if(n===null)throw Error(W(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);Qn(i,t.memoizedState)||(Vt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function aC(){}function lC(e,t){var n=Oe,r=Ln(),s=t(),i=!Qn(r.memoizedState,s);if(i&&(r.memoizedState=s,Vt=!0),r=r.queue,Hy(dC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,Al(9,uC.bind(null,n,r,s,t),void 0,null),dt===null)throw Error(W(349));ki&30||cC(n,t,s)}return s}function cC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function uC(e,t,n,r){t.value=n,t.getSnapshot=r,fC(t)&&hC(e)}function dC(e,t,n){return n(function(){fC(t)&&hC(e)})}function fC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qn(e,n)}catch{return!0}}function hC(e){var t=Vr(e,1);t!==null&&Yn(t,e,1,-1)}function M0(e){var t=ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Il,lastRenderedState:e},t.queue=e,e=e.dispatch=oR.bind(null,Oe,e),[t.memoizedState,e]}function Al(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.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 pC(){return Ln().memoizedState}function Iu(e,t,n,r){var s=ar();Oe.flags|=e,s.memoizedState=Al(1|t,n,void 0,r===void 0?null:r)}function bf(e,t,n,r){var s=Ln();r=r===void 0?null:r;var i=void 0;if(ot!==null){var o=ot.memoizedState;if(i=o.destroy,r!==null&&Uy(r,o.deps)){s.memoizedState=Al(t,n,i,r);return}}Oe.flags|=e,s.memoizedState=Al(1|t,n,i,r)}function $0(e,t){return Iu(8390656,8,e,t)}function Hy(e,t){return bf(2048,8,e,t)}function mC(e,t){return bf(4,2,e,t)}function gC(e,t){return bf(4,4,e,t)}function yC(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 xC(e,t,n){return n=n!=null?n.concat([e]):null,bf(4,4,yC.bind(null,t,e),n)}function Gy(){}function vC(e,t){var n=Ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Uy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bC(e,t){var n=Ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Uy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wC(e,t,n){return ki&21?(Qn(n,t)||(n=jS(),Oe.lanes|=n,_i|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vt=!0),e.memoizedState=n)}function sR(e,t){var n=xe;xe=n!==0&&4>n?n:4,e(!0);var r=Dh.transition;Dh.transition={};try{e(!1),t()}finally{xe=n,Dh.transition=r}}function kC(){return Ln().memoizedState}function iR(e,t,n){var r=Ss(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_C(e))SC(t,n);else if(n=sC(e,t,n,r),n!==null){var s=Lt();Yn(n,e,r,s),CC(n,t,r)}}function oR(e,t,n){var r=Ss(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_C(e))SC(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,Qn(a,o)){var l=t.interleaved;l===null?(s.next=s,Oy(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=sC(e,t,s,r),n!==null&&(s=Lt(),Yn(n,e,r,s),CC(n,t,r))}}function _C(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function SC(e,t){tl=bd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function CC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sy(e,n)}}var wd={readContext:Rn,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},aR={readContext:Rn,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:$0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Iu(4194308,4,yC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Iu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Iu(4,2,e,t)},useMemo:function(e,t){var n=ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ar();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=iR.bind(null,Oe,e),[r.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:M0,useDebugValue:Gy,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=M0(!1),t=e[0];return e=sR.bind(null,e[1]),ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Oe,s=ar();if(Me){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),dt===null)throw Error(W(349));ki&30||cC(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,$0(dC.bind(null,r,i,e),[e]),r.flags|=2048,Al(9,uC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ar(),t=dt.identifierPrefix;if(Me){var n=Mr,r=Lr;n=(r&~(1<<32-qn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Nl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=rR++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},lR={readContext:Rn,useCallback:vC,useContext:Rn,useEffect:Hy,useImperativeHandle:xC,useInsertionEffect:mC,useLayoutEffect:gC,useMemo:bC,useReducer:Oh,useRef:pC,useState:function(){return Oh(Il)},useDebugValue:Gy,useDeferredValue:function(e){var t=Ln();return wC(t,ot.memoizedState,e)},useTransition:function(){var e=Oh(Il)[0],t=Ln().memoizedState;return[e,t]},useMutableSource:aC,useSyncExternalStore:lC,useId:kC,unstable_isNewReconciler:!1},cR={readContext:Rn,useCallback:vC,useContext:Rn,useEffect:Hy,useImperativeHandle:xC,useInsertionEffect:mC,useLayoutEffect:gC,useMemo:bC,useReducer:zh,useRef:pC,useState:function(){return zh(Il)},useDebugValue:Gy,useDeferredValue:function(e){var t=Ln();return ot===null?t.memoizedState=e:wC(t,ot.memoizedState,e)},useTransition:function(){var e=zh(Il)[0],t=Ln().memoizedState;return[e,t]},useMutableSource:aC,useSyncExternalStore:lC,useId:kC,unstable_isNewReconciler:!1};function Hn(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Rm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wf={isMounted:function(e){return(e=e._reactInternals)?Ti(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=Dr(r,s);i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,s),t!==null&&(Yn(t,e,s,r),Tu(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=Dr(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,s),t!==null&&(Yn(t,e,s,r),Tu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lt(),r=Ss(e),s=Dr(n,r);s.tag=2,t!=null&&(s.callback=t),t=ks(e,s,r),t!==null&&(Yn(t,e,r,n),Tu(t,e,r))}};function D0(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?!Sl(n,r)||!Sl(s,i):!0}function jC(e,t,n){var r=!1,s=Is,i=t.contextType;return typeof i=="object"&&i!==null?i=Rn(i):(s=Kt(t)?bi:Ct.current,r=t.contextTypes,i=(r=r!=null)?Mo(e,s):Is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function O0(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&&wf.enqueueReplaceState(t,t.state,null)}function Lm(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},zy(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Rn(i):(i=Kt(t)?bi:Ct.current,s.context=Mo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Rm(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&&wf.enqueueReplaceState(s,s.state,null),xd(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function zo(e,t){try{var n="",r=t;do n+=DA(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 Fh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Mm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var uR=typeof WeakMap=="function"?WeakMap:Map;function EC(e,t,n){n=Dr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_d||(_d=!0,Km=r),Mm(e,t)},n}function PC(e,t,n){n=Dr(-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(){Mm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Mm(e,t),typeof r!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function z0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new uR;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=SR.bind(null,e,t,n),t.then(e,e))}function F0(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 B0(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=Dr(-1,1),t.tag=2,ks(n,t,1))),n.lanes|=1),e)}var dR=Wr.ReactCurrentOwner,Vt=!1;function Tt(e,t,n,r){t.child=e===null?rC(t,null,n,r):Do(t,e.child,n,r)}function V0(e,t,n,r,s){n=n.render;var i=t.ref;return So(t,s),r=Wy(e,t,n,r,i,s),n=Ky(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ur(e,t,s)):(Me&&n&&Ay(t),t.flags|=1,Tt(e,t,r,s),t.child)}function U0(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!tx(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,TC(e,t,i,r,s)):(e=Mu(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:Sl,n(o,r)&&e.ref===t.ref)return Ur(e,t,s)}return t.flags|=1,e=Cs(i,r),e.ref=t.ref,e.return=t,t.child=e}function TC(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Sl(i,r)&&e.ref===t.ref)if(Vt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Vt=!0);else return t.lanes=e.lanes,Ur(e,t,s)}return $m(e,t,n,r,s)}function NC(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},Pe(uo,on),on|=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,Pe(uo,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(uo,on),on|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(uo,on),on|=r;return Tt(e,t,s,n),t.child}function IC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $m(e,t,n,r,s){var i=Kt(n)?bi:Ct.current;return i=Mo(t,i),So(t,s),n=Wy(e,t,n,r,i,s),r=Ky(),e!==null&&!Vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ur(e,t,s)):(Me&&r&&Ay(t),t.flags|=1,Tt(e,t,n,s),t.child)}function W0(e,t,n,r,s){if(Kt(n)){var i=!0;hd(t)}else i=!1;if(So(t,s),t.stateNode===null)Au(e,t),jC(t,n,r),Lm(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rn(c):(c=Kt(n)?bi:Ct.current,c=Mo(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)&&O0(t,o,r,c),os=!1;var h=t.memoizedState;o.state=h,xd(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Wt.current||os?(typeof u=="function"&&(Rm(t,n,u,r),l=t.memoizedState),(a=os||D0(t,n,a,r,h,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,iC(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Hn(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rn(l):(l=Kt(n)?bi:Ct.current,l=Mo(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&O0(t,o,r,l),os=!1,h=t.memoizedState,o.state=h,xd(t,r,o,s);var m=t.memoizedState;a!==f||h!==m||Wt.current||os?(typeof p=="function"&&(Rm(t,n,p,r),m=t.memoizedState),(c=os||D0(t,n,c,r,h,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Dm(e,t,n,r,i,s)}function Dm(e,t,n,r,s,i){IC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&T0(t,n,!1),Ur(e,t,i);r=t.stateNode,dR.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Do(t,e.child,null,i),t.child=Do(t,null,a,i)):Tt(e,t,a,i),t.memoizedState=r.state,s&&T0(t,n,!0),t.child}function AC(e){var t=e.stateNode;t.pendingContext?P0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&P0(e,t.context,!1),Fy(e,t.containerInfo)}function K0(e,t,n,r,s){return $o(),Ly(s),t.flags|=256,Tt(e,t,n,r),t.child}var Om={dehydrated:null,treeContext:null,retryLane:0};function zm(e){return{baseLanes:e,cachePool:null,transitions:null}}function RC(e,t,n){var r=t.pendingProps,s=De.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),Pe(De,s&1),e===null)return Im(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=Sf(o,r,0,null),e=hi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=zm(n),t.memoizedState=Om,e):Zy(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return fR(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=Cs(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Cs(a,i):(i=hi(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?zm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Om,r}return i=e.child,e=i.sibling,r=Cs(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 Zy(e,t){return t=Sf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bc(e,t,n,r){return r!==null&&Ly(r),Do(t,e.child,null,n),e=Zy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fR(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Fh(Error(W(422))),Bc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Sf({mode:"visible",children:r.children},s,0,null),i=hi(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Do(t,e.child,null,o),t.child.memoizedState=zm(o),t.memoizedState=Om,i);if(!(t.mode&1))return Bc(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(W(419)),r=Fh(i,r,void 0),Bc(e,t,o,r)}if(a=(o&e.childLanes)!==0,Vt||a){if(r=dt,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,Vr(e,s),Yn(r,e,s,-1))}return ex(),r=Fh(Error(W(421))),Bc(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=CR.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,an=ws(s.nextSibling),cn=t,Me=!0,Zn=null,e!==null&&(_n[Sn++]=Lr,_n[Sn++]=Mr,_n[Sn++]=wi,Lr=e.id,Mr=e.overflow,wi=t),t=Zy(t,r.children),t.flags|=4096,t)}function H0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Am(e.return,t,n)}function Bh(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 LC(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Tt(e,t,r.children,n),r=De.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&H0(e,n,t);else if(e.tag===19)H0(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(Pe(De,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&&vd(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Bh(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&&vd(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Bh(t,!0,n,null,i);break;case"together":Bh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Au(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ur(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_i|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=Cs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hR(e,t,n){switch(t.tag){case 3:AC(t),$o();break;case 5:oC(t);break;case 1:Kt(t.type)&&hd(t);break;case 4:Fy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pe(gd,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(De,De.current&1),t.flags|=128,null):n&t.child.childLanes?RC(e,t,n):(Pe(De,De.current&1),e=Ur(e,t,n),e!==null?e.sibling:null);Pe(De,De.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return LC(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pe(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,NC(e,t,n)}return Ur(e,t,n)}var MC,Fm,$C,DC;MC=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}};Fm=function(){};$C=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,oi(gr.current);var i=null;switch(n){case"input":s=lm(e,s),r=lm(e,r),i=[];break;case"select":s=ze({},s,{value:void 0}),r=ze({},r,{value:void 0}),i=[];break;case"textarea":s=dm(e,s),r=dm(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=dd)}hm(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"&&(yl.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"&&(yl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ae("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)}};DC=function(e,t,n,r){n!==r&&(t.flags|=4)};function ja(e,t){if(!Me)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 bt(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 pR(e,t,n){var r=t.pendingProps;switch(Ry(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return Kt(t.type)&&fd(),bt(t),null;case 3:return r=t.stateNode,Oo(),Re(Wt),Re(Ct),Vy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(zc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zn!==null&&(Zm(Zn),Zn=null))),Fm(e,t),bt(t),null;case 5:By(t);var s=oi(Tl.current);if(n=t.type,e!==null&&t.stateNode!=null)$C(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return bt(t),null}if(e=oi(gr.current),zc(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[hr]=t,r[El]=i,e=(t.mode&1)!==0,n){case"dialog":Ae("cancel",r),Ae("close",r);break;case"iframe":case"object":case"embed":Ae("load",r);break;case"video":case"audio":for(s=0;s<Wa.length;s++)Ae(Wa[s],r);break;case"source":Ae("error",r);break;case"img":case"image":case"link":Ae("error",r),Ae("load",r);break;case"details":Ae("toggle",r);break;case"input":t0(r,i),Ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ae("invalid",r);break;case"textarea":r0(r,i),Ae("invalid",r)}hm(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&&Oc(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Oc(r.textContent,a,e),s=["children",""+a]):yl.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ae("scroll",r)}switch(n){case"input":Nc(r),n0(r,i,!0);break;case"textarea":Nc(r),s0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=dd)}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=dS(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[hr]=t,e[El]=r,MC(e,t,!1,!1),t.stateNode=e;e:{switch(o=pm(n,r),n){case"dialog":Ae("cancel",e),Ae("close",e),s=r;break;case"iframe":case"object":case"embed":Ae("load",e),s=r;break;case"video":case"audio":for(s=0;s<Wa.length;s++)Ae(Wa[s],e);s=r;break;case"source":Ae("error",e),s=r;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),s=r;break;case"details":Ae("toggle",e),s=r;break;case"input":t0(e,r),s=lm(e,r),Ae("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ze({},r,{value:void 0}),Ae("invalid",e);break;case"textarea":r0(e,r),s=dm(e,r),Ae("invalid",e);break;default:s=r}hm(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?pS(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&fS(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&xl(e,l):typeof l=="number"&&xl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(yl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ae("scroll",e):l!=null&&xy(e,i,l,o))}switch(n){case"input":Nc(e),n0(e,r,!1);break;case"textarea":Nc(e),s0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ns(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?bo(e,!!r.multiple,i,!1):r.defaultValue!=null&&bo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=dd)}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 bt(t),null;case 6:if(e&&t.stateNode!=null)DC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=oi(Tl.current),oi(gr.current),zc(t)){if(r=t.stateNode,n=t.memoizedProps,r[hr]=t,(i=r.nodeValue!==n)&&(e=cn,e!==null))switch(e.tag){case 3:Oc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Oc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[hr]=t,t.stateNode=r}return bt(t),null;case 13:if(Re(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&an!==null&&t.mode&1&&!(t.flags&128))tC(),$o(),t.flags|=98560,i=!1;else if(i=zc(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[hr]=t}else $o(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bt(t),i=!1}else Zn!==null&&(Zm(Zn),Zn=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||De.current&1?at===0&&(at=3):ex())),t.updateQueue!==null&&(t.flags|=4),bt(t),null);case 4:return Oo(),Fm(e,t),e===null&&Cl(t.stateNode.containerInfo),bt(t),null;case 10:return Dy(t.type._context),bt(t),null;case 17:return Kt(t.type)&&fd(),bt(t),null;case 19:if(Re(De),i=t.memoizedState,i===null)return bt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ja(i,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vd(e),o!==null){for(t.flags|=128,ja(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 Pe(De,De.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ke()>Fo&&(t.flags|=128,r=!0,ja(i,!1),t.lanes=4194304)}else{if(!r)if(e=vd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ja(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Me)return bt(t),null}else 2*Ke()-i.renderingStartTime>Fo&&n!==1073741824&&(t.flags|=128,r=!0,ja(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=Ke(),t.sibling=null,n=De.current,Pe(De,r?n&1|2:n&1),t):(bt(t),null);case 22:case 23:return Xy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function mR(e,t){switch(Ry(t),t.tag){case 1:return Kt(t.type)&&fd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oo(),Re(Wt),Re(Ct),Vy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return By(t),null;case 13:if(Re(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));$o()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(De),null;case 4:return Oo(),null;case 10:return Dy(t.type._context),null;case 22:case 23:return Xy(),null;case 24:return null;default:return null}}var Vc=!1,kt=!1,gR=typeof WeakSet=="function"?WeakSet:Set,Z=null;function co(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(e,t,r)}else n.current=null}function Bm(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var G0=!1;function yR(e,t){if(Sm=ld,e=VS(),Iy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cm={focusedElem:e,selectionRange:n},ld=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Hn(t.type,g),x);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(w){Ue(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return m=G0,G0=!1,m}function nl(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&&Bm(t,n,i)}s=s.next}while(s!==r)}}function kf(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 Vm(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 OC(e){var t=e.alternate;t!==null&&(e.alternate=null,OC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hr],delete t[El],delete t[Pm],delete t[X2],delete t[eR])),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 zC(e){return e.tag===5||e.tag===3||e.tag===4}function Z0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zC(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 Um(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=dd));else if(r!==4&&(e=e.child,e!==null))for(Um(e,t,n),e=e.sibling;e!==null;)Um(e,t,n),e=e.sibling}function Wm(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(Wm(e,t,n),e=e.sibling;e!==null;)Wm(e,t,n),e=e.sibling}var ft=null,Gn=!1;function Gr(e,t,n){for(n=n.child;n!==null;)FC(e,t,n),n=n.sibling}function FC(e,t,n){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(pf,n)}catch{}switch(n.tag){case 5:kt||co(n,t);case 6:var r=ft,s=Gn;ft=null,Gr(e,t,n),ft=r,Gn=s,ft!==null&&(Gn?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(Gn?(e=ft,n=n.stateNode,e.nodeType===8?Lh(e.parentNode,n):e.nodeType===1&&Lh(e,n),kl(e)):Lh(ft,n.stateNode));break;case 4:r=ft,s=Gn,ft=n.stateNode.containerInfo,Gn=!0,Gr(e,t,n),ft=r,Gn=s;break;case 0:case 11:case 14:case 15:if(!kt&&(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)&&Bm(n,t,o),s=s.next}while(s!==r)}Gr(e,t,n);break;case 1:if(!kt&&(co(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ue(n,t,a)}Gr(e,t,n);break;case 21:Gr(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,Gr(e,t,n),kt=r):Gr(e,t,n);break;default:Gr(e,t,n)}}function q0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gR),t.forEach(function(r){var s=jR.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function zn(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:ft=a.stateNode,Gn=!1;break e;case 3:ft=a.stateNode.containerInfo,Gn=!0;break e;case 4:ft=a.stateNode.containerInfo,Gn=!0;break e}a=a.return}if(ft===null)throw Error(W(160));FC(i,o,s),ft=null,Gn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Ue(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)BC(t,e),t=t.sibling}function BC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zn(t,e),rr(e),r&4){try{nl(3,e,e.return),kf(3,e)}catch(g){Ue(e,e.return,g)}try{nl(5,e,e.return)}catch(g){Ue(e,e.return,g)}}break;case 1:zn(t,e),rr(e),r&512&&n!==null&&co(n,n.return);break;case 5:if(zn(t,e),rr(e),r&512&&n!==null&&co(n,n.return),e.flags&32){var s=e.stateNode;try{xl(s,"")}catch(g){Ue(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&cS(s,i),pm(a,o);var c=pm(a,i);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?pS(s,f):u==="dangerouslySetInnerHTML"?fS(s,f):u==="children"?xl(s,f):xy(s,u,f,c)}switch(a){case"input":cm(s,i);break;case"textarea":uS(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?bo(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?bo(s,!!i.multiple,i.defaultValue,!0):bo(s,!!i.multiple,i.multiple?[]:"",!1))}s[El]=i}catch(g){Ue(e,e.return,g)}}break;case 6:if(zn(t,e),rr(e),r&4){if(e.stateNode===null)throw Error(W(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Ue(e,e.return,g)}}break;case 3:if(zn(t,e),rr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kl(t.containerInfo)}catch(g){Ue(e,e.return,g)}break;case 4:zn(t,e),rr(e);break;case 13:zn(t,e),rr(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Jy=Ke())),r&4&&q0(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(kt=(c=kt)||u,zn(t,e),kt=c):zn(t,e),rr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(Z=e,u=e.child;u!==null;){for(f=Z=u;Z!==null;){switch(h=Z,p=h.child,h.tag){case 0:case 11:case 14:case 15:nl(4,h,h.return);break;case 1:co(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Ue(r,n,g)}}break;case 5:co(h,h.return);break;case 22:if(h.memoizedState!==null){J0(f);continue}}p!==null?(p.return=h,Z=p):J0(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=hS("display",o))}catch(g){Ue(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Ue(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:zn(t,e),rr(e),r&4&&q0(e);break;case 21:break;default:zn(t,e),rr(e)}}function rr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(zC(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(xl(s,""),r.flags&=-33);var i=Z0(e);Wm(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Z0(e);Um(e,a,o);break;default:throw Error(W(161))}}catch(l){Ue(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xR(e,t,n){Z=e,VC(e)}function VC(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var s=Z,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Vc;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||kt;a=Vc;var c=kt;if(Vc=o,(kt=l)&&!c)for(Z=s;Z!==null;)o=Z,l=o.child,o.tag===22&&o.memoizedState!==null?Q0(s):l!==null?(l.return=o,Z=l):Q0(s);for(;i!==null;)Z=i,VC(i),i=i.sibling;Z=s,Vc=a,kt=c}Y0(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Z=i):Y0(e)}}function Y0(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kt||kf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Hn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&L0(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}L0(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&&kl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}kt||t.flags&512&&Vm(t)}catch(h){Ue(t,t.return,h)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function J0(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Q0(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kf(4,t)}catch(l){Ue(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Ue(t,s,l)}}var i=t.return;try{Vm(t)}catch(l){Ue(t,i,l)}break;case 5:var o=t.return;try{Vm(t)}catch(l){Ue(t,o,l)}}}catch(l){Ue(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var vR=Math.ceil,kd=Wr.ReactCurrentDispatcher,qy=Wr.ReactCurrentOwner,Nn=Wr.ReactCurrentBatchConfig,he=0,dt=null,rt=null,gt=0,on=0,uo=Ds(0),at=0,Rl=null,_i=0,_f=0,Yy=0,rl=null,Bt=null,Jy=0,Fo=1/0,Tr=null,_d=!1,Km=null,_s=null,Uc=!1,fs=null,Sd=0,sl=0,Hm=null,Ru=-1,Lu=0;function Lt(){return he&6?Ke():Ru!==-1?Ru:Ru=Ke()}function Ss(e){return e.mode&1?he&2&>!==0?gt&-gt:nR.transition!==null?(Lu===0&&(Lu=jS()),Lu):(e=xe,e!==0||(e=window.event,e=e===void 0?16:RS(e.type)),e):1}function Yn(e,t,n,r){if(50<sl)throw sl=0,Hm=null,Error(W(185));Jl(e,n,r),(!(he&2)||e!==dt)&&(e===dt&&(!(he&2)&&(_f|=n),at===4&&us(e,gt)),Ht(e,r),n===1&&he===0&&!(t.mode&1)&&(Fo=Ke()+500,vf&&Os()))}function Ht(e,t){var n=e.callbackNode;n2(e,t);var r=ad(e,e===dt?gt:0);if(r===0)n!==null&&a0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&a0(n),t===1)e.tag===0?tR(X0.bind(null,e)):QS(X0.bind(null,e)),J2(function(){!(he&6)&&Os()}),n=null;else{switch(ES(r)){case 1:n=_y;break;case 4:n=SS;break;case 16:n=od;break;case 536870912:n=CS;break;default:n=od}n=YC(n,UC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function UC(e,t){if(Ru=-1,Lu=0,he&6)throw Error(W(327));var n=e.callbackNode;if(Co()&&e.callbackNode!==n)return null;var r=ad(e,e===dt?gt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Cd(e,r);else{t=r;var s=he;he|=2;var i=KC();(dt!==e||gt!==t)&&(Tr=null,Fo=Ke()+500,fi(e,t));do try{kR();break}catch(a){WC(e,a)}while(!0);$y(),kd.current=i,he=s,rt!==null?t=0:(dt=null,gt=0,t=at)}if(t!==0){if(t===2&&(s=vm(e),s!==0&&(r=s,t=Gm(e,s))),t===1)throw n=Rl,fi(e,0),us(e,r),Ht(e,Ke()),n;if(t===6)us(e,r);else{if(s=e.current.alternate,!(r&30)&&!bR(s)&&(t=Cd(e,r),t===2&&(i=vm(e),i!==0&&(r=i,t=Gm(e,i))),t===1))throw n=Rl,fi(e,0),us(e,r),Ht(e,Ke()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:Xs(e,Bt,Tr);break;case 3:if(us(e,r),(r&130023424)===r&&(t=Jy+500-Ke(),10<t)){if(ad(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Lt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Em(Xs.bind(null,e,Bt,Tr),t);break}Xs(e,Bt,Tr);break;case 4:if(us(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-qn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Ke()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vR(r/1960))-r,10<r){e.timeoutHandle=Em(Xs.bind(null,e,Bt,Tr),r);break}Xs(e,Bt,Tr);break;case 5:Xs(e,Bt,Tr);break;default:throw Error(W(329))}}}return Ht(e,Ke()),e.callbackNode===n?UC.bind(null,e):null}function Gm(e,t){var n=rl;return e.current.memoizedState.isDehydrated&&(fi(e,t).flags|=256),e=Cd(e,t),e!==2&&(t=Bt,Bt=n,t!==null&&Zm(t)),e}function Zm(e){Bt===null?Bt=e:Bt.push.apply(Bt,e)}function bR(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(!Qn(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 us(e,t){for(t&=~Yy,t&=~_f,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qn(t),r=1<<n;e[n]=-1,t&=~r}}function X0(e){if(he&6)throw Error(W(327));Co();var t=ad(e,0);if(!(t&1))return Ht(e,Ke()),null;var n=Cd(e,t);if(e.tag!==0&&n===2){var r=vm(e);r!==0&&(t=r,n=Gm(e,r))}if(n===1)throw n=Rl,fi(e,0),us(e,t),Ht(e,Ke()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Xs(e,Bt,Tr),Ht(e,Ke()),null}function Qy(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(Fo=Ke()+500,vf&&Os())}}function Si(e){fs!==null&&fs.tag===0&&!(he&6)&&Co();var t=he;he|=1;var n=Nn.transition,r=xe;try{if(Nn.transition=null,xe=1,e)return e()}finally{xe=r,Nn.transition=n,he=t,!(he&6)&&Os()}}function Xy(){on=uo.current,Re(uo)}function fi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Y2(n)),rt!==null)for(n=rt.return;n!==null;){var r=n;switch(Ry(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fd();break;case 3:Oo(),Re(Wt),Re(Ct),Vy();break;case 5:By(r);break;case 4:Oo();break;case 13:Re(De);break;case 19:Re(De);break;case 10:Dy(r.type._context);break;case 22:case 23:Xy()}n=n.return}if(dt=e,rt=e=Cs(e.current,null),gt=on=t,at=0,Rl=null,Yy=_f=_i=0,Bt=rl=null,ii!==null){for(t=0;t<ii.length;t++)if(n=ii[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}ii=null}return e}function WC(e,t){do{var n=rt;try{if($y(),Nu.current=wd,bd){for(var r=Oe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}bd=!1}if(ki=0,ut=ot=Oe=null,tl=!1,Nl=0,qy.current=null,n===null||n.return===null){at=1,Rl=t,rt=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=gt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=F0(o);if(p!==null){p.flags&=-257,B0(p,o,a,i,t),p.mode&1&&z0(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){z0(i,c,t),ex();break e}l=Error(W(426))}}else if(Me&&a.mode&1){var x=F0(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),B0(x,o,a,i,t),Ly(zo(l,a));break e}}i=l=zo(l,a),at!==4&&(at=2),rl===null?rl=[i]:rl.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=EC(i,l,t);R0(i,y);break e;case 1:a=l;var v=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(_s===null||!_s.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=PC(i,a,t);R0(i,w);break e}}i=i.return}while(i!==null)}GC(n)}catch(_){t=_,rt===n&&n!==null&&(rt=n=n.return);continue}break}while(!0)}function KC(){var e=kd.current;return kd.current=wd,e===null?wd:e}function ex(){(at===0||at===3||at===2)&&(at=4),dt===null||!(_i&268435455)&&!(_f&268435455)||us(dt,gt)}function Cd(e,t){var n=he;he|=2;var r=KC();(dt!==e||gt!==t)&&(Tr=null,fi(e,t));do try{wR();break}catch(s){WC(e,s)}while(!0);if($y(),he=n,kd.current=r,rt!==null)throw Error(W(261));return dt=null,gt=0,at}function wR(){for(;rt!==null;)HC(rt)}function kR(){for(;rt!==null&&!GA();)HC(rt)}function HC(e){var t=qC(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?GC(e):rt=t,qy.current=null}function GC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mR(n,t),n!==null){n.flags&=32767,rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,rt=null;return}}else if(n=pR(n,t,on),n!==null){rt=n;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);at===0&&(at=5)}function Xs(e,t,n){var r=xe,s=Nn.transition;try{Nn.transition=null,xe=1,_R(e,t,n,r)}finally{Nn.transition=s,xe=r}return null}function _R(e,t,n,r){do Co();while(fs!==null);if(he&6)throw Error(W(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(W(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(r2(e,i),e===dt&&(rt=dt=null,gt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Uc||(Uc=!0,YC(od,function(){return Co(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Nn.transition,Nn.transition=null;var o=xe;xe=1;var a=he;he|=4,qy.current=null,yR(e,n),BC(n,e),U2(Cm),ld=!!Sm,Cm=Sm=null,e.current=n,xR(n),ZA(),he=a,xe=o,Nn.transition=i}else e.current=n;if(Uc&&(Uc=!1,fs=e,Sd=s),i=e.pendingLanes,i===0&&(_s=null),JA(n.stateNode),Ht(e,Ke()),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(_d)throw _d=!1,e=Km,Km=null,e;return Sd&1&&e.tag!==0&&Co(),i=e.pendingLanes,i&1?e===Hm?sl++:(sl=0,Hm=e):sl=0,Os(),null}function Co(){if(fs!==null){var e=ES(Sd),t=Nn.transition,n=xe;try{if(Nn.transition=null,xe=16>e?16:e,fs===null)var r=!1;else{if(e=fs,fs=null,Sd=0,he&6)throw Error(W(331));var s=he;for(he|=4,Z=e.current;Z!==null;){var i=Z,o=i.child;if(Z.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var u=Z;switch(u.tag){case 0:case 11:case 15:nl(8,u,i)}var f=u.child;if(f!==null)f.return=u,Z=f;else for(;Z!==null;){u=Z;var h=u.sibling,p=u.return;if(OC(u),u===c){Z=null;break}if(h!==null){h.return=p,Z=h;break}Z=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}Z=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Z=o;else e:for(;Z!==null;){if(i=Z,i.flags&2048)switch(i.tag){case 0:case 11:case 15:nl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Z=y;break e}Z=i.return}}var v=e.current;for(Z=v;Z!==null;){o=Z;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,Z=b;else e:for(o=v;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:kf(9,a)}}catch(_){Ue(a,a.return,_)}if(a===o){Z=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,Z=w;break e}Z=a.return}}if(he=s,Os(),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(pf,e)}catch{}r=!0}return r}finally{xe=n,Nn.transition=t}}return!1}function eb(e,t,n){t=zo(n,t),t=EC(e,t,1),e=ks(e,t,1),t=Lt(),e!==null&&(Jl(e,1,t),Ht(e,t))}function Ue(e,t,n){if(e.tag===3)eb(e,e,n);else for(;t!==null;){if(t.tag===3){eb(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(_s===null||!_s.has(r))){e=zo(n,e),e=PC(t,e,1),t=ks(t,e,1),e=Lt(),t!==null&&(Jl(t,1,e),Ht(t,e));break}}t=t.return}}function SR(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Lt(),e.pingedLanes|=e.suspendedLanes&n,dt===e&&(gt&n)===n&&(at===4||at===3&&(gt&130023424)===gt&&500>Ke()-Jy?fi(e,0):Yy|=n),Ht(e,t)}function ZC(e,t){t===0&&(e.mode&1?(t=Rc,Rc<<=1,!(Rc&130023424)&&(Rc=4194304)):t=1);var n=Lt();e=Vr(e,t),e!==null&&(Jl(e,t,n),Ht(e,n))}function CR(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ZC(e,n)}function jR(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(W(314))}r!==null&&r.delete(t),ZC(e,n)}var qC;qC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wt.current)Vt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vt=!1,hR(e,t,n);Vt=!!(e.flags&131072)}else Vt=!1,Me&&t.flags&1048576&&XS(t,md,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Au(e,t),e=t.pendingProps;var s=Mo(t,Ct.current);So(t,n),s=Wy(null,t,r,e,s,n);var i=Ky();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Kt(r)?(i=!0,hd(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,zy(t),s.updater=wf,t.stateNode=s,s._reactInternals=t,Lm(t,r,e,n),t=Dm(null,t,r,!0,i,n)):(t.tag=0,Me&&i&&Ay(t),Tt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Au(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=PR(r),e=Hn(r,e),s){case 0:t=$m(null,t,r,e,n);break e;case 1:t=W0(null,t,r,e,n);break e;case 11:t=V0(null,t,r,e,n);break e;case 14:t=U0(null,t,r,Hn(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Hn(r,s),$m(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Hn(r,s),W0(e,t,r,s,n);case 3:e:{if(AC(t),e===null)throw Error(W(387));r=t.pendingProps,i=t.memoizedState,s=i.element,iC(e,t),xd(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=zo(Error(W(423)),t),t=K0(e,t,r,n,s);break e}else if(r!==s){s=zo(Error(W(424)),t),t=K0(e,t,r,n,s);break e}else for(an=ws(t.stateNode.containerInfo.firstChild),cn=t,Me=!0,Zn=null,n=rC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($o(),r===s){t=Ur(e,t,n);break e}Tt(e,t,r,n)}t=t.child}return t;case 5:return oC(t),e===null&&Im(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,jm(r,s)?o=null:i!==null&&jm(r,i)&&(t.flags|=32),IC(e,t),Tt(e,t,o,n),t.child;case 6:return e===null&&Im(t),null;case 13:return RC(e,t,n);case 4:return Fy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Do(t,null,r,n):Tt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Hn(r,s),V0(e,t,r,s,n);case 7:return Tt(e,t,t.pendingProps,n),t.child;case 8:return Tt(e,t,t.pendingProps.children,n),t.child;case 12:return Tt(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,Pe(gd,r._currentValue),r._currentValue=o,i!==null)if(Qn(i.value,o)){if(i.children===s.children&&!Wt.current){t=Ur(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=Dr(-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),Am(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(W(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Am(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}Tt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,So(t,n),s=Rn(s),r=r(s),t.flags|=1,Tt(e,t,r,n),t.child;case 14:return r=t.type,s=Hn(r,t.pendingProps),s=Hn(r.type,s),U0(e,t,r,s,n);case 15:return TC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Hn(r,s),Au(e,t),t.tag=1,Kt(r)?(e=!0,hd(t)):e=!1,So(t,n),jC(t,r,s),Lm(t,r,s,n),Dm(null,t,r,!0,e,n);case 19:return LC(e,t,n);case 22:return NC(e,t,n)}throw Error(W(156,t.tag))};function YC(e,t){return _S(e,t)}function ER(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 En(e,t,n,r){return new ER(e,t,n,r)}function tx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function PR(e){if(typeof e=="function")return tx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===by)return 11;if(e===wy)return 14}return 2}function Cs(e,t){var n=e.alternate;return n===null?(n=En(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 Mu(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")tx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case eo:return hi(n.children,s,i,t);case vy:o=8,s|=8;break;case sm:return e=En(12,n,t,s|2),e.elementType=sm,e.lanes=i,e;case im:return e=En(13,n,t,s),e.elementType=im,e.lanes=i,e;case om:return e=En(19,n,t,s),e.elementType=om,e.lanes=i,e;case oS:return Sf(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case sS:o=10;break e;case iS:o=9;break e;case by:o=11;break e;case wy:o=14;break e;case is:o=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=En(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function hi(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function Sf(e,t,n,r){return e=En(22,e,r,t),e.elementType=oS,e.lanes=n,e.stateNode={isHidden:!1},e}function Vh(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Uh(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function TR(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=_h(0),this.expirationTimes=_h(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_h(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function nx(e,t,n,r,s,i,o,a,l){return e=new TR(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=En(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zy(i),e}function NR(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function JC(e){if(!e)return Is;e=e._reactInternals;e:{if(Ti(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(Kt(n))return JS(e,n,t)}return t}function QC(e,t,n,r,s,i,o,a,l){return e=nx(n,r,!0,e,s,i,o,a,l),e.context=JC(null),n=e.current,r=Lt(),s=Ss(n),i=Dr(r,s),i.callback=t??null,ks(n,i,s),e.current.lanes=s,Jl(e,s,r),Ht(e,r),e}function Cf(e,t,n,r){var s=t.current,i=Lt(),o=Ss(s);return n=JC(n),t.context===null?t.context=n:t.pendingContext=n,t=Dr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ks(s,t,o),e!==null&&(Yn(e,s,o,i),Tu(e,s,o)),o}function jd(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 tb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rx(e,t){tb(e,t),(e=e.alternate)&&tb(e,t)}function IR(){return null}var XC=typeof reportError=="function"?reportError:function(e){console.error(e)};function sx(e){this._internalRoot=e}jf.prototype.render=sx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));Cf(e,t,null,null)};jf.prototype.unmount=sx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Si(function(){Cf(null,e,null,null)}),t[Br]=null}};function jf(e){this._internalRoot=e}jf.prototype.unstable_scheduleHydration=function(e){if(e){var t=NS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cs.length&&t!==0&&t<cs[n].priority;n++);cs.splice(n,0,e),n===0&&AS(e)}};function ix(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ef(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function nb(){}function AR(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=jd(o);i.call(c)}}var o=QC(t,r,e,0,null,!1,!1,"",nb);return e._reactRootContainer=o,e[Br]=o.current,Cl(e.nodeType===8?e.parentNode:e),Si(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=jd(l);a.call(c)}}var l=nx(e,0,!1,null,null,!1,!1,"",nb);return e._reactRootContainer=l,e[Br]=l.current,Cl(e.nodeType===8?e.parentNode:e),Si(function(){Cf(t,l,n,r)}),l}function Pf(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=jd(o);a.call(l)}}Cf(t,o,e,s)}else o=AR(n,t,e,s,r);return jd(o)}PS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ua(t.pendingLanes);n!==0&&(Sy(t,n|1),Ht(t,Ke()),!(he&6)&&(Fo=Ke()+500,Os()))}break;case 13:Si(function(){var r=Vr(e,1);if(r!==null){var s=Lt();Yn(r,e,1,s)}}),rx(e,1)}};Cy=function(e){if(e.tag===13){var t=Vr(e,134217728);if(t!==null){var n=Lt();Yn(t,e,134217728,n)}rx(e,134217728)}};TS=function(e){if(e.tag===13){var t=Ss(e),n=Vr(e,t);if(n!==null){var r=Lt();Yn(n,e,t,r)}rx(e,t)}};NS=function(){return xe};IS=function(e,t){var n=xe;try{return xe=e,t()}finally{xe=n}};gm=function(e,t,n){switch(t){case"input":if(cm(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=xf(r);if(!s)throw Error(W(90));lS(r),cm(r,s)}}}break;case"textarea":uS(e,n);break;case"select":t=n.value,t!=null&&bo(e,!!n.multiple,t,!1)}};yS=Qy;xS=Si;var RR={usingClientEntryPoint:!1,Events:[Xl,so,xf,mS,gS,Qy]},Ea={findFiberByHostInstance:si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},LR={bundleType:Ea.bundleType,version:Ea.version,rendererPackageName:Ea.rendererPackageName,rendererConfig:Ea.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Wr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wS(e),e===null?null:e.stateNode},findFiberByHostInstance:Ea.findFiberByHostInstance||IR,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 Wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wc.isDisabled&&Wc.supportsFiber)try{pf=Wc.inject(LR),mr=Wc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RR;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ix(t))throw Error(W(200));return NR(e,t,null,n)};pn.createRoot=function(e,t){if(!ix(e))throw Error(W(299));var n=!1,r="",s=XC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=nx(e,1,!1,null,null,n,!1,r,s),e[Br]=t.current,Cl(e.nodeType===8?e.parentNode:e),new sx(t)};pn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=wS(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return Si(e)};pn.hydrate=function(e,t,n){if(!Ef(t))throw Error(W(200));return Pf(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!ix(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=XC;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=QC(t,null,e,1,n??null,s,!1,i,o),e[Br]=t.current,Cl(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 jf(t)};pn.render=function(e,t,n){if(!Ef(t))throw Error(W(200));return Pf(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!Ef(e))throw Error(W(40));return e._reactRootContainer?(Si(function(){Pf(null,null,e,!1,function(){e._reactRootContainer=null,e[Br]=null})}),!0):!1};pn.unstable_batchedUpdates=Qy;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ef(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return Pf(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function ej(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ej)}catch(e){console.error(e)}}ej(),eS.exports=pn;var Ni=eS.exports,tj,rb=Ni;tj=rb.createRoot,rb.hydrateRoot;var Ka=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Wh(e){const t=k.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function MR(e,t,n={},r={}){k.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 $R(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}const nj=!1;function Ll(e){return e[e.length-1]}function DR(e){return typeof e=="function"}function hs(e,t){return DR(e)?e(t):e}const OR=Object.prototype.hasOwnProperty,sb=Object.prototype.propertyIsEnumerable,zR=()=>Object.create(null),Hs=(e,t)=>ps(e,t,zR);function ps(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=ab(e)&&ab(s);if(!i&&!(Bo(e)&&Bo(s)))return s;const o=i?e:ib(e);if(!o)return s;const a=i?s:ib(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let f=0;for(let h=0;h<c;h++){const p=i?h:a[h],m=e[p],g=s[p];if(m===g){u[p]=m,(i?h<l:OR.call(e,p))&&f++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[p]=g;continue}const x=ps(m,g,n,r+1);u[p]=x,x===m&&f++}return l===c&&f===l?e:u}function ib(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!sb.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(!sb.call(e,s))return!1;r.push(s)}return r}function Bo(e){if(!ob(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ob(n)||!n.hasOwnProperty("isPrototypeOf"))}function ob(e){return Object.prototype.toString.call(e)==="[object Object]"}function ab(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pi(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(!pi(e[r],t[r],n))return!1;return!0}if(Bo(e)&&Bo(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)&&!pi(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||!pi(e[o],t[o],n)))return!1;return s===i}return!1}function Vo(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 Ml(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function FR(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function lb(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 FR(t)}const BR=["http:","https:","mailto:","tel:"];function Ed(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Pa(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+=lb(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+lb(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function VR(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function UR(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 Or(){throw new Error("Invariant failed")}function $l(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 ms=4,rj=5;function WR(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 ox(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=WR(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 Tf(e,t,n,r,s,i,o){var l,c,u,f,h,p,m,g,x,y,v,b,w;o==null||o(n);let a=r;{const _=n.fullPath??n.from,S=_.length,j=((l=n.options)==null?void 0:l.caseSensitive)??e,E=!!((u=(c=n.options)==null?void 0:c.params)!=null&&u.parse&&((h=(f=n.options)==null?void 0:f.skipRouteOnParseError)!=null&&h.params));for(;a<S;){const P=ox(_,a,t);let N;const R=a,L=P[5];switch(a=L+1,i++,P[0]){case 0:{const I=_.substring(P[2],P[3]);if(j){const z=(p=s.static)==null?void 0:p.get(I);if(z)N=z;else{s.static??(s.static=new Map);const $=ai(n.fullPath??n.from);$.parent=s,$.depth=i,N=$,s.static.set(I,$)}}else{const z=I.toLowerCase(),$=(m=s.staticInsensitive)==null?void 0:m.get(z);if($)N=$;else{s.staticInsensitive??(s.staticInsensitive=new Map);const D=ai(n.fullPath??n.from);D.parent=s,D.depth=i,N=D,s.staticInsensitive.set(z,D)}}break}case 1:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=!E&&((g=s.dynamic)==null?void 0:g.find(C=>!C.skipOnParamError&&C.caseSensitive===$&&C.prefix===D&&C.suffix===O));if(V)N=V;else{const C=Hh(1,n.fullPath??n.from,$,D,O);N=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=!E&&((x=s.optional)==null?void 0:x.find(C=>!C.skipOnParamError&&C.caseSensitive===$&&C.prefix===D&&C.suffix===O));if(V)N=V;else{const C=Hh(3,n.fullPath??n.from,$,D,O);N=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const I=_.substring(R,P[1]),z=_.substring(P[4],L),$=j&&!!(I||z),D=I?$?I:I.toLowerCase():void 0,O=z?$?z:z.toLowerCase():void 0,V=Hh(2,n.fullPath??n.from,$,D,O);N=V,V.parent=s,V.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push(V)}}s=N}if(E&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const P=ai(n.fullPath??n.from);P.kind=rj,P.parent=s,i++,P.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(P),s=P}const T=(n.path||!n.children)&&!n.isRoot;if(T&&_.endsWith("/")){const P=ai(n.fullPath??n.from);P.kind=ms,P.parent=s,i++,P.depth=i,s.index=P,s=P}s.parse=((v=(y=n.options)==null?void 0:y.params)==null?void 0:v.parse)??null,s.skipOnParamError=E,s.parsingPriority=((w=(b=n.options)==null?void 0:b.skipRouteOnParseError)==null?void 0:w.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Tf(e,t,_,a,s,i,o)}function Kh(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 as(e){var t,n,r;if(e.pathless)for(const s of e.pathless)as(s);if(e.static)for(const s of e.static.values())as(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())as(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Kh);for(const s of e.dynamic)as(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(Kh);for(const s of e.optional)as(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(Kh);for(const s of e.wildcard)as(s)}}function ai(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 Hh(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 KR(e,t){const n=ai("/"),r=new Uint16Array(6);for(const s of e)Tf(!1,r,s,1,n,0);as(n),t.masksTree=n,t.flatCache=$l(1e3)}function HR(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=ax(e,t.masksTree);return t.flatCache.set(e,r),r}function GR(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=ai("/"),Tf(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),ax(r,o,n)}function ZR(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=ax(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=JR(i.route)),t.matchCache.set(r,i),i}function qR(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function YR(e,t=!1,n){const r=ai(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return Tf(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Or(),i[l.id]=l,a!==0&&l.path){const c=qR(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),as(r),{processedTree:{segmentTree:r,singleCache:$l(1e3),matchCache:$l(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function ax(e,t,n=!1){const r=e.split("/"),s=XR(e,r,t,n);if(!s)return null;const[i]=sj(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function sj(e,t,n){var u,f,h,p,m,g,x,y,v,b;const r=QR(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((f=n.extract)==null?void 0:f.node)??0,l=((h=n.extract)==null?void 0:h.path)??0,c=((p=n.extract)==null?void 0:p.segment)??0;for(;a<r.length;o++,a++,l++,c++){const w=r[a];if(w.kind===ms)break;if(w.kind===rj){c--,o--,l--;continue}const _=t[o],S=l;if(_&&(l+=_.length),w.kind===1){s??(s=n.node.fullPath.split("/"));const j=s[c],E=((m=w.prefix)==null?void 0:m.length)??0;if(j.charCodeAt(E)===123){const T=((g=w.suffix)==null?void 0:g.length)??0,P=j.substring(E+2,j.length-T-1),N=_.substring(E,_.length-T);i[P]=decodeURIComponent(N)}else{const T=j.substring(1);i[T]=decodeURIComponent(_)}}else if(w.kind===3){if(n.skipped&1<<a){o--,l=S-1;continue}s??(s=n.node.fullPath.split("/"));const j=s[c],E=((x=w.prefix)==null?void 0:x.length)??0,T=((y=w.suffix)==null?void 0:y.length)??0,P=j.substring(E+3,j.length-T-1),N=w.suffix||w.prefix?_.substring(E,_.length-T):_;N&&(i[P]=decodeURIComponent(N))}else if(w.kind===2){const j=w,E=e.substring(S+(((v=j.prefix)==null?void 0:v.length)??0),e.length-(((b=j.suffix)==null?void 0:b.length)??0)),T=decodeURIComponent(E);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function JR(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function QR(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function XR(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Ll(t),i=s&&e!=="/",o=t.length-(s?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,c=null;for(;a.length;){const u=a.pop(),{node:f,index:h,skipped:p,depth:m,statics:g,dynamics:x,optionals:y}=u;let{extract:v,rawParams:b,parsedParams:w}=u;if(f.kind===2&&f.route&&!Hc(c,u))continue;if(f.skipOnParamError){if(!cb(e,t,u))continue;b=u.rawParams,v=u.extract,w=u.parsedParams}r&&f.route&&f.kind!==ms&&Hc(l,u)&&(l=u);const _=h===o;if(_&&(f.route&&(!i||f.kind===ms||f.kind===2)&&Hc(c,u)&&(c=u),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const S=_?void 0:t[h];let j;if(_&&f.index){const E={node:f.index,index:h,skipped:p,depth:m+1,statics:g,dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w};let T=!0;if(f.index.skipOnParamError&&(cb(e,t,E)||(T=!1)),T){if(!x&&!y&&!p&&eL(g,o))return E;Hc(c,E)&&(c=E)}}if(f.wildcard)for(let E=f.wildcard.length-1;E>=0;E--){const T=f.wildcard[E],{prefix:P,suffix:N}=T;if(!(P&&(_||!(T.caseSensitive?S:j??(j=S.toLowerCase())).startsWith(P)))){if(N){if(_)continue;const R=t.slice(h).join("/").slice(-N.length);if((T.caseSensitive?R:R.toLowerCase())!==N)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:g,dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w})}}if(f.optional){const E=p|1<<m,T=m+1;for(let P=f.optional.length-1;P>=0;P--){const N=f.optional[P];a.push({node:N,index:h,skipped:E,depth:T,statics:g,dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w})}if(!_)for(let P=f.optional.length-1;P>=0;P--){const N=f.optional[P],{prefix:R,suffix:L}=N;if(R||L){const I=N.caseSensitive?S:j??(j=S.toLowerCase());if(R&&!I.startsWith(R)||L&&!I.endsWith(L))continue}a.push({node:N,index:h+1,skipped:p,depth:T,statics:g,dynamics:x,optionals:y+Kc(o,h),extract:v,rawParams:b,parsedParams:w})}}if(!_&&f.dynamic&&S)for(let E=f.dynamic.length-1;E>=0;E--){const T=f.dynamic[E],{prefix:P,suffix:N}=T;if(P||N){const R=T.caseSensitive?S:j??(j=S.toLowerCase());if(P&&!R.startsWith(P)||N&&!R.endsWith(N))continue}a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g,dynamics:x+Kc(o,h),optionals:y,extract:v,rawParams:b,parsedParams:w})}if(!_&&f.staticInsensitive){const E=f.staticInsensitive.get(j??(j=S.toLowerCase()));E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Kc(o,h),dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w})}if(!_&&f.static){const E=f.static.get(S);E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Kc(o,h),dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w})}if(f.pathless){const E=m+1;for(let T=f.pathless.length-1;T>=0;T--){const P=f.pathless[T];a.push({node:P,index:h,skipped:p,depth:E,statics:g,dynamics:x,optionals:y,extract:v,rawParams:b,parsedParams:w})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const f=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(f),l}return null}function Kc(e,t){return 2**(e-t-1)}function eL(e,t){return e===2**(t-1)-1}function cb(e,t,n){try{const[r,s]=sj(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 Hc(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===ms)>(e.node.kind===ms)||t.node.kind===ms==(e.node.kind===ms)&&t.depth>e.depth))):!0}function $u(e){return lx(e.filter(t=>t!==void 0).join("/"))}function lx(e){return e.replace(/\/{2,}/g,"/")}function ij(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function js(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function oj(e){return js(ij(e))}function Pd(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function tL(e,t,n){return Pd(e,n)===Pd(t,n)}function nL({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&&Ll(a)==="";)a.pop();const f=t.split("/");for(let h=0,p=f.length;h<p;h++){const m=f[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(Ll(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let f=0;f<a.length;f++){f>0&&(c+="/");const h=a[f];if(!h)continue;l=ox(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),x=h.substring(l[4],m),y=h.substring(l[2],l[3]);p===1?c+=g||x?`${g}{$${y}}${x}`:`$${y}`:p===2?c+=g||x?`${g}{$}${x}`:"$":c+=`${g}{-$${y}}${x}`}c=lx(c);const u=c||"/";return o&&r&&r.set(o,u),u}function rL(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 Gh(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=>db(s,n)).join("/"):db(r,n)}function ub({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=ox(e,u,l);const f=l[5];if(a=f+1,u===f)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,f);continue}if(h===2){const p=t._splat;i._splat=p,i["*"]=p;const m=e.substring(u,l[1]),g=e.substring(l[4],f);if(!p){s=!0,(m||g)&&(c+="/"+m+g);continue}const x=Gh("_splat",t,n);c+="/"+m+x+g;continue}if(h===1){const p=e.substring(l[2],l[3]);!s&&!(p in t)&&(s=!0),i[p]=t[p];const m=e.substring(u,l[1]),g=e.substring(l[4],f),x=Gh(p,t,n)??"undefined";c+="/"+m+x+g;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const g=e.substring(u,l[1]),x=e.substring(l[4],f),y=Gh(p,t,n)??"";c+="/"+g+y+x;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function db(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 sL(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const iL="tsr-scroll-restoration-v1_3";function oL(){const e=sL();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Bo(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=hs(r,t)||t},persist:()=>{try{e.setItem(iL,JSON.stringify(t))}catch{}}}}const fb=oL(),aL=e=>e.state.__TSR_key||e.href;function lL(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 Gc=!1;const Ta="window",hb="data-scroll-restoration-id";function cL(e,t){if(!fb)return;const n=fb;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Gc=!1;const r=e.options.getScrollRestorationKey||aL,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(Gc||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(Ta,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;s.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},o=a=>{var c;if(!e.isScrollRestoring||!a||s.size===0||!n)return;const l=(c=n.state)[a]||(c[a]={});for(const[u,f]of s){let h;if(u===Ta)h=Ta;else if(u.isConnected){const p=u.getAttribute(hb);h=p?`[${hb}="${p}"]`:lL(u)}h&&(l[h]=f)}};document.addEventListener("scroll",i,!0),e.subscribe("onBeforeLoad",a=>{o(a.fromLocation?r(a.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{var f;const l=r(a.toLocation),c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Gc=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const g=h[m];if(!Bo(g))continue;const{scrollX:x,scrollY:y}=g;if(!(!Number.isFinite(x)||!Number.isFinite(y))){if(m===Ta)window.scrollTo({top:y,left:x,behavior:c}),p=!0;else if(m){let v;try{v=document.querySelector(m)}catch{continue}v&&(v.scrollLeft=x,v.scrollTop=y,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const g=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(g){const x=document.getElementById(m);x&&x.scrollIntoView(g)}}else{const g={top:0,left:0,behavior:c};if(window.scrollTo(g),u)for(const x of u){if(x===Ta)continue;const y=typeof x=="function"?x():document.querySelector(x);y&&y.scrollTo(g)}}}}finally{Gc=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function uL(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 Zh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function dL(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]=Zh(s):Array.isArray(i)?i.push(Zh(s)):n[r]=[i,Zh(s)]}return n}const fL=pL(JSON.parse),hL=mL(JSON.stringify,JSON.parse);function pL(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=dL(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function mL(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=uL(s,r);return i?`?${i}`:""}}const mi="__root__";function aj(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 Ut(e){return e instanceof Response&&!!e.options}function gL(e){return{input:({url:t})=>{for(const n of e)t=qm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=lj(e[n],t);return t}}}function yL(e){const t=oj(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=$u(["/",t,o.pathname]),o)}}function qm(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 lj(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 xL(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:i}=t,o=new Map,a=new Map,l=new Map,c=n(e.status),u=n(e.loadedAt),f=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),g=n(e.statusCode),x=n(e.redirect),y=n([]),v=n([]),b=n([]),w=r(()=>qh(o,y.get())),_=r(()=>qh(a,v.get())),S=r(()=>qh(l,b.get())),j=r(()=>y.get()[0]),E=r(()=>y.get().some(D=>{var O;return((O=o.get(D))==null?void 0:O.get().status)==="pending"})),T=r(()=>{var D;return{locationHref:p.get().href,resolvedLocationHref:(D=m.get())==null?void 0:D.href,status:c.get()}}),P=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:f.get(),isTransitioning:h.get(),matches:w.get(),location:p.get(),resolvedLocation:m.get(),statusCode:g.get(),redirect:x.get()})),N=$l(64);function R(D){let O=N.get(D);return O||(O=r(()=>{const V=y.get();for(const C of V){const U=o.get(C);if(U&&U.routeId===D)return U.get()}}),N.set(D,O)),O}const L={status:c,loadedAt:u,isLoading:f,isTransitioning:h,location:p,resolvedLocation:m,statusCode:g,redirect:x,matchesId:y,pendingIds:v,cachedIds:b,matches:w,pendingMatches:_,cachedMatches:S,firstId:j,hasPending:E,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:P,getRouteMatchStore:R,setMatches:I,setPending:z,setCached:$};I(e.matches),i==null||i(L);function I(D){Yh(D,o,y,n,s)}function z(D){Yh(D,a,v,n,s)}function $(D){Yh(D,l,b,n,s)}return L}function qh(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Yh(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)}UR(n.get(),i)||n.set(i)})}const Ym=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},vL=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Nf=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),gi=(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},pb=(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},gs=(e,t,n)=>{var r,s,i;if(!(!Ut(n)&&!St(n)))throw Ut(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:Ut(n)?"redirected":St(n)?"notFound":o.status==="pending"?"success":o.status,context:gi(e,t.index),isFetching:!1,error:n})),St(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),Ut(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},cj=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},mb=(e,t,n)=>{const r=gi(e,n);e.updateMatch(t,s=>({...s,context:r}))},Na=(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),gs(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,gs(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&&!Ut(n)&&!St(n)&&(e.serialError??(e.serialError=n))},uj=(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&&!Nf(e,t)&&(n.options.loader||n.options.beforeLoad||fj(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{Ym(e)},s);r._nonReactive.pendingTimeout=o}},bL=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;uj(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&gs(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},wL=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Vo(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&Na(e,n,o,"PARSE_PARAMS"),a&&Na(e,n,a,"VALIDATE_SEARCH"),uj(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,w=>({...w,isFetching:"beforeLoad",fetchCount:w.fetchCount+1,abortController:l})))},f=()=>{var w;(w=s._nonReactive.beforeLoadPromise)==null||w.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}s._nonReactive.beforeLoadPromise=Vo();const h={...gi(e,n,!1),...s.__routeContext},{search:p,params:m,cause:g}=s,x=Nf(e,t),y={search:p,abortController:l,params:m,preload:x,context:h,location:e.location,navigate:w=>e.router.navigate({...w,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:x?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=w=>{if(w===void 0){e.router.batch(()=>{u(),f()});return}(Ut(w)||St(w))&&(u(),Na(e,n,w,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:w})),f()})};let b;try{if(b=r.options.beforeLoad(y),Ml(b))return u(),b.catch(w=>{Na(e,n,w,"BEFORE_LOAD")}).then(v)}catch(w){u(),Na(e,n,w,"BEFORE_LOAD")}v(b)},kL=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>wL(e,n,t,s),a=()=>{if(cj(e,n))return;const l=bL(e,n,s);return Ml(l)?l.then(o):o()};return i()},_L=(e,t,n)=>{var i,o,a,l,c,u;const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(o=(i=n.options).head)==null?void 0:o.call(i,s),(l=(a=n.options).scripts)==null?void 0:l.call(a,s),(u=(c=n.options).headers)==null?void 0:u.call(c,s)]).then(([f,h,p])=>({meta:f==null?void 0:f.meta,links:f==null?void 0:f.links,headScripts:f==null?void 0:f.scripts,headers:p,scripts:h,styles:f==null?void 0:f.styles}))},dj=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=gi(e,r),f=Nf(e,n);return{params:o,deps:a,preload:!!f,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},gb=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(nj??e.router.isServer)||u.ssr===!0)&&Dl(s);const f=s.options.loader,h=typeof f=="function"?f:f==null?void 0:f.handler,p=h==null?void 0:h(dj(e,t,n,r,s)),m=!!h&&Ml(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,x=>({...x,isFetching:"loader"})),h){const x=m?await p:p;gs(e,e.router.getMatch(n),x),x!==void 0&&e.updateMatch(n,y=>({...y,loaderData:x}))}s._lazyPromise&&await s._lazyPromise;const g=u._nonReactive.minPendingPromise;g&&await g,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,x=>({...x,error:void 0,context:gi(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let h=f;if((h==null?void 0:h.name)==="AbortError"){if(u.abortController.signal.aborted){(i=u._nonReactive.loaderPromise)==null||i.resolve(),u._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:gi(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,St(f)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),gs(e,e.router.getMatch(n),f);try{(c=(l=s.options).onError)==null||c.call(l,f)}catch(m){h=m,gs(e,e.router.getMatch(n),m)}!Ut(h)&&!St(h)&&await Dl(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:gi(e,r),status:"error",isFetching:!1}))}}catch(u){const f=e.router.getMatch(n);f&&(f._nonReactive.loaderPromise=void 0),gs(e,f,u)}},SL=async(e,t,n)=>{var p,m,g,x;async function r(y,v,b,w,_){const S=Date.now()-v.updatedAt,j=y?_.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:_.options.staleTime??e.router.options.defaultStaleTime??0,E=_.options.shouldReload,T=typeof E=="function"?E(dj(e,t,s,n,_)):E,{status:P,invalid:N}=w,R=S>=j&&(!!e.forceStaleReload||w.cause==="enter"||b!==void 0&&b!==w.id);o=P==="success"&&(N||(T??R)),y&&_.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var L,I;try{await gb(e,t,s,n,_);const z=e.router.getMatch(s);(L=z._nonReactive.loaderPromise)==null||L.resolve(),(I=z._nonReactive.loadPromise)==null||I.resolve(),z._nonReactive.loaderPromise=void 0,z._nonReactive.loadPromise=void 0}catch(z){Ut(z)&&await e.router.navigate(z.options)}})()):P!=="success"||o?await gb(e,t,s,n,_):mb(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(cj(e,s)){if(!e.router.getMatch(s))return e.matches[n];mb(e,s,n)}else{const y=e.router.getMatch(s),v=e.router.stores.matchesId.get()[n],b=((p=v&&e.router.stores.matchStores.get(v)||null)==null?void 0:p.routeId)===i?v:(m=e.router.stores.matches.get().find(_=>_.routeId===i))==null?void 0:m.id,w=Nf(e,s);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&u)return y;await y._nonReactive.loaderPromise;const _=e.router.getMatch(s),S=_._nonReactive.error||_.error;S&&gs(e,_,S),_.status==="pending"&&await r(w,y,b,_,l)}else{const _=w&&!e.router.stores.matchStores.has(s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=Vo(),_!==S.preload&&e.updateMatch(s,j=>({...j,preload:_})),await r(w,y,b,S,l)}}const f=e.router.getMatch(s);a||((g=f._nonReactive.loaderPromise)==null||g.resolve(),(x=f._nonReactive.loadPromise)==null||x.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(s,y=>({...y,isFetching:h,invalid:!1})),e.router.getMatch(s)):f};async function yb(e){var h,p;const t=e,n=[];vL(t.router)&&Ym(t);let r;for(let m=0;m<t.matches.length;m++){try{const g=kL(t,m);Ml(g)&&await g}catch(g){if(Ut(g))throw g;if(St(g))r=g;else if(!t.preload)throw g;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?pb(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(SL(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const g of m){if(g.status!=="rejected")continue;const x=g.reason;if(Ut(x))throw x;St(x)?a??(a=x):l??(l=x)}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=pb(t,c);m===void 0&&Or();const g=t.matches[m],x=t.router.looseRoutesById[g.routeId],y=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!x.options.notFoundComponent&&y&&(x.options.notFoundComponent=y),c.routeId=g.routeId;const v=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,b=>({...b,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await Dl(x,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Dl(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:g,routeId:x}=t.matches[m],y=t.router.looseRoutesById[x];try{const v=_L(t,g,y);if(v){const b=await v;t.updateMatch(g,w=>({...w,...b}))}}catch(v){console.error(`Error executing head for route ${x}:`,v)}}const f=Ym(t);if(Ml(f)&&await f,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function xb(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 Dl(e,t=Du){!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===Du?(()=>{if(e._componentsPromise===void 0){const r=xb(e,Du);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():xb(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function fj(e){var t;for(const n of Du)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Du=["component","errorComponent","pendingComponent","notFoundComponent"];var Es="__TSR_index",vb="popstate",bb="beforeunload";function CL(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:o}))},s=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},i=async({task:o,navigateOpts:a,...l})=>{var f,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((f=e.getBlockers)==null?void 0:f.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=Td(l.path,l.state);if(await p.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){(h=e.onBlocked)==null||h.call(e);return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,a,l)=>{const c=t.state[Es];a=wb(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[Es];a=wb(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[Es]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,f;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(f=e.setBlockers)==null||f.call(e,c.filter(h=>h!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:r}}function wb(e,t){t||(t={});const n=cx();return{...t,key:n,__TSR_key:n,[Es]:e}}function jL(e){var E,T;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=P=>s=P,a=P=>P,l=()=>Td(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((E=t.history.state)!=null&&E.__TSR_key)&&!((T=t.history.state)!=null&&T.key)){const P=cx();t.history.replaceState({[Es]:0,key:P,__TSR_key:P},"")}let c=l(),u,f=!1,h=!1,p=!1,m=!1;const g=()=>c;let x,y;const v=()=>{x&&(j._ignoreSubscribers=!0,(x.isPush?t.history.pushState:t.history.replaceState)(x.state,"",x.href),j._ignoreSubscribers=!1,x=void 0,y=void 0,u=void 0)},b=(P,N,R)=>{const L=a(N);y||(u=c),c=Td(N,R),x={href:L,state:R,isPush:(x==null?void 0:x.isPush)||P==="push"},y||(y=Promise.resolve().then(()=>v()))},w=P=>{c=l(),j.notify({type:P})},_=async()=>{if(h){h=!1;return}const P=l(),N=P.state[Es]-c.state[Es],R=N===1,L=N===-1,I=!R&&!L||f;f=!1;const z=I?"GO":L?"BACK":"FORWARD",$=I?{type:"GO",index:N}:{type:L?"BACK":"FORWARD"};if(p)p=!1;else{const D=i();if(typeof document<"u"&&D.length){for(const O of D)if(await O.blockerFn({currentLocation:c,nextLocation:P,action:z})){h=!0,t.history.go(1),j.notify($);return}}}c=l(),j.notify($)},S=P=>{if(m){m=!1;return}let N=!1;const R=i();if(typeof document<"u"&&R.length)for(const L of R){const I=L.enableBeforeUnload??!0;if(I===!0){N=!0;break}if(typeof I=="function"&&I()===!0){N=!0;break}}if(N)return P.preventDefault(),P.returnValue=""},j=CL({getLocation:g,getLength:()=>t.history.length,pushState:(P,N)=>b("push",P,N),replaceState:(P,N)=>b("replace",P,N),back:P=>(P&&(p=!0),m=!0,t.history.back()),forward:P=>{P&&(p=!0),m=!0,t.history.forward()},go:P=>{f=!0,t.history.go(P)},createHref:P=>a(P),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(bb,S,{capture:!0}),t.removeEventListener(vb,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(bb,S,{capture:!0}),t.addEventListener(vb,_),t.history.pushState=function(...P){const N=n.apply(t.history,P);return j._ignoreSubscribers||w("PUSH"),N},t.history.replaceState=function(...P){const N=r.apply(t.history,P);return j._ignoreSubscribers||w("REPLACE"),N},j}function EL(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Td(e,t){const n=EL(e),r=n.indexOf("#"),s=n.indexOf("?"),i=cx();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||{[Es]:0,key:i,__TSR_key:i}}}function cx(){return(Math.random()+1).toString(36).substring(7)}function jo(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 PL=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=rL(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=jL()),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=$l(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=xL(NL(this.latestLocation),f),cL(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const f=[],h=oj(l);h&&h!=="/"&&f.push(yL({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:gL(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=YR(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&KR(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:l,search:c,hash:u,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const y=this.options.parseSearch(c),v=this.options.stringifySearch(y);return{href:l+v+u,publicHref:l+v+u,pathname:Pa(l).path,external:!1,searchStr:v,search:Hs(r==null?void 0:r.search,y),hash:Pa(u.slice(1)).path,state:ps(r==null?void 0:r.state,h)}}const p=new URL(f,this.origin),m=qm(this.rewrite,p),g=this.options.parseSearch(m.search),x=this.options.stringifySearch(g);return m.search=x,{href:m.href.replace(m.origin,""),publicHref:f,pathname:Pa(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:x,search:Hs(r==null?void 0:r.search,g),hash:Pa(m.hash.slice(1)).path,state:ps(r==null?void 0:r.state,h)}},i=s(n),{__tempLocation:o,__tempKey:a}=i.state;if(o&&(!a||a===this.tempLocationKey)){const l=s(o);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>nL({base:n,to:lx(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=>IL({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var s;if(this.stores.pendingMatchStores.has(n))return;const r=(s=this.stores.matchStores.get(n))==null?void 0:s.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(i={})=>{var P,N;const o=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);i.from;const l=i.unsafeRelative==="path"?o.pathname:i.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,f=Object.assign(Object.create(null),a.params),h=i.to?this.resolvePathWithBase(c,`${i.to}`):this.resolvePathWithBase(c,"."),p=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?f:Object.assign(f,hs(i.params,f)),m=this.getMatchedRoutes(h);let g=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]),Object.keys(p).length>0)for(const R of g){const L=((P=R.options.params)==null?void 0:P.stringify)??R.options.stringifyParams;if(L)try{Object.assign(p,L(p))}catch{}}const x=n.leaveParams?h:Pa(ub({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=u;if(n._includeValidateSearch&&((N=this.options.search)!=null&&N.strict)){const R={};g.forEach(L=>{if(L.options.validateSearch)try{Object.assign(R,Ou(L.options.validateSearch,{...R,...y}))}catch{}}),y=R}y=AL({search:y,dest:i,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),y=Hs(u,y);const v=this.options.stringifySearch(y),b=i.hash===!0?o.hash:i.hash?hs(i.hash,o.hash):void 0,w=b?`#${b}`:"";let _=i.state===!0?o.state:i.state?hs(i.state,o.state):{};_=ps(o.state,_);const S=`${x}${v}${w}`;let j,E,T=!1;if(this.rewrite){const R=new URL(S,this.origin),L=lj(this.rewrite,R);j=R.href.replace(R.origin,""),L.origin!==this.origin?(E=L.href,T=!0):E=L.pathname+L.search+L.hash}else j=VR(S),E=j;return{publicHref:E,href:j,pathname:x,search:y,searchStr:v,state:_,hash:b??"",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=HR(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:f,params:h,...p}=u.route,m=h===!1||h===null?Object.create(null):(h??!0)===!0?c:Object.assign(c,hs(h,c));o={from:n.from,...p,params:m},l=r(o)}}}return l&&(a.maskedLocation=l),a};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{s.state[u]=this.latestLocation.state[u]});const c=pi(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=js(this.latestLocation.href)===js(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Vo(()=>{a==null||a.resolve(),a=void 0}),o&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=s;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[s.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:o,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,h=Td(a,{__TSR_index:n?f:f+1}),p=new URL(h.pathname,this.origin);l.to=qm(this.rewrite,p).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:i,...o})=>{var l,c;let a=!1;if(s)try{new URL(`${s}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!s){const f=this.buildLocation({to:n,...o});s=s??f.publicHref,i=i??f.publicHref}const u=!a&&i?i:s;if(Ed(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const f=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of f)if(h!=null&&h.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...o,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(i=>i.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,s,i;const o=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(l=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const u=this.latestLocation,f=jo(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await yb({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 x,y;let h=null,p=null,m=null,g=null;this.batch(()=>{const v=this.stores.pendingMatches.get(),b=v.length,w=this.stores.matches.get();h=b?w.filter(j=>!this.stores.pendingMatchStores.has(j.id)):null;const _=new Set;for(const j of this.stores.pendingMatchStores.values())j.routeId&&_.add(j.routeId);const S=new Set;for(const j of this.stores.matchStores.values())j.routeId&&S.add(j.routeId);p=b?w.filter(j=>!_.has(j.routeId)):null,m=b?v.filter(j=>!S.has(j.routeId)):null,g=b?v.filter(j=>S.has(j.routeId)):w,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),b&&(this.stores.setMatches(v),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(j=>j.status!=="error"&&j.status!=="notFound"&&j.status!=="redirected")]),this.clearExpiredCache())});for(const[v,b]of[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(v)for(const w of v)(y=(x=this.looseRoutesById[w.routeId].options)[b])==null||y.call(x,w)})})}})}catch(u){Ut(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):St(u)&&(s=u);const f=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,o=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(jo(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&&Ed(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=Dl,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 yb({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(Ut(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=GR(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!pi(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?pi(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??hL,parseSearch:e.parseSearch??fL,protocolAllowlist:e.protocolAllowlist??BR}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var f,h;const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s,parsedParams:i}=n;let{matchedRoutes:o}=n,a=!1;(r?r.path!=="/"&&s["**"]:js(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?LL(this.options.notFoundMode,o):void 0,c=new Array(o.length),u=new Map;for(const p of this.stores.matchStores.values())p.routeId&&u.set(p.routeId,p.get());for(let p=0;p<o.length;p++){const m=o[p],g=c[p-1];let x,y,v;{const z=(g==null?void 0:g.search)??e.search,$=(g==null?void 0:g._strictSearch)??void 0;try{const D=Ou(m.options.validateSearch,{...z})??void 0;x={...z,...D},y={...$,...D},v=void 0}catch(D){let O=D;if(D instanceof Nd||(O=new Nd(D.message,{cause:D})),t!=null&&t.throwOnError)throw O;x=z,y={},v=O}}const b=((h=(f=m.options).loaderDeps)==null?void 0:h.call(f,{search:x}))??"",w=b?JSON.stringify(b):"",{interpolatedPath:_,usedParams:S}=ub({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),j=m.id+_+w,E=this.getMatch(j),T=u.get(m.id),P=(E==null?void 0:E._strictParams)??S;let N;if(!E)try{kb(m,S,i,P)}catch(z){if(St(z)||Ut(z)?N=z:N=new TL(z.message,{cause:z}),t!=null&&t.throwOnError)throw N}Object.assign(s,P);const R=T?"stay":"enter";let L;if(E)L={...E,cause:R,params:(T==null?void 0:T.params)??s,_strictParams:P,search:Hs(T?T.search:E.search,x),_strictSearch:y};else{const z=m.options.loader||m.options.beforeLoad||m.lazyFn||fj(m)?"pending":"success";L={id:j,ssr:m.options.ssr,index:p,routeId:m.id,params:(T==null?void 0:T.params)??s,_strictParams:P,pathname:_,updatedAt:Date.now(),search:T?Hs(T.search,x):x,_strictSearch:y,searchError:void 0,status:z,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Vo()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:R,loaderDeps:T?ps(T.loaderDeps,b):b,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||(L.globalNotFound=l===m.id),L.searchError=v;const I=this.getParentContext(g);L.context={...I,...L.__routeContext,...L.__beforeLoadContext},c[p]=L}for(let p=0;p<c.length;p++){const m=c[p],g=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),y=u.get(m.routeId);if(m.params=y?Hs(y.params,s):s,!x){const v=c[p-1],b=this.getParentContext(v);if(g.options.context){const w={deps:m.loaderDeps,params:m.params,context:b??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:g.id};m.__routeContext=g.options.context(w)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=Ll(t),i={...e.search};for(const f of t)try{Object.assign(i,Ou(f.options.validateSearch,i))}catch{}const o=Ll(this.stores.matchesId.get()),a=o&&((u=this.stores.matchStores.get(o))==null?void 0:u.get()),l=a&&a.routeId===s.id&&a.pathname===e.pathname;let c;if(l)c=a.params;else{const f=Object.assign(Object.create(null),n);for(const h of t)try{kb(h,n,r??{},f)}catch{}c=f}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Nd=class extends Error{},TL=class extends Error{};function NL(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ou(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Nd("Async validation not supported");if(n.issues)throw new Nd(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 IL({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=js(e);let i,o;const a=ZR(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 AL({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return RL(n)(e,t,r??!1)}function RL(e){var s;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)(s=i.options.search)!=null&&s.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:a,next:l})=>{let c=a;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(c=i.options.preSearchFilters.reduce((f,h)=>h(f),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((f,h)=>h(f),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:a,next:l})=>{const c=l(a);if(!t._includeValidateSearch)return c;try{return{...c,...Ou(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:hs(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 LL(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 mi}function kb(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 ML="Error preloading route! ☝️";var hj=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=mi:this.parentRoute||Or();let s=r?mi:n==null?void 0:n.path;s&&s!=="/"&&(s=ij(s));const i=(n==null?void 0:n.id)||s;let o=r?mi:$u([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=$u(["/",o]));const a=o==="__root__"?"/":$u([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=js(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=>aj({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.")}},$L=class extends hj{constructor(e){super(e)}};function DL(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 ux(e){const t=e.errorComponent??dx;return d.jsx(OL,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?k.createElement(t,{error:n,reset:r}):e.children})}var OL=class extends k.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 dx({error:e}){const[t,n]=k.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 zL({children:e,fallback:t=null}){return pj()?d.jsx(Ro.Fragment,{children:e}):d.jsx(Ro.Fragment,{children:t})}function pj(){return Ro.useSyncExternalStore(FL,()=>!0,()=>!1)}function FL(){return()=>{}}var mj=k.createContext(null);function gn(e){return k.useContext(mj)}var If=k.createContext(void 0),BL=k.createContext(void 0),Le=(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))(Le||{});function VL({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,f){const h=u.depsTail;if(h!==void 0&&h.dep===c)return;const p=h!==void 0?h.nextDep:u.deps;if(p!==void 0&&p.dep===c){p.version=f,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===f&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:f,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=g),h!==void 0?h.nextDep=g:u.deps=g,m!==void 0?m.nextSub=g:c.subs=g}function s(c,u=c.sub){const f=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,g=c.prevSub;return p!==void 0?p.prevDep=h:u.depsTail=h,h!==void 0?h.nextDep=p:u.deps=p,m!==void 0?m.prevSub=g:f.subsTail=g,g!==void 0?g.nextSub=m:(f.subs=m)===void 0&&n(f),p}function i(c){let u=c.nextSub,f;e:do{const h=c.sub;let p=h.flags;if(p&60?p&12?p&4?!(p&48)&&l(c,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&t(h),p&1){const m=h.subs;if(m!==void 0){const g=(c=m).nextSub;g!==void 0&&(f={value:u,prev:f},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;f!==void 0;)if(c=f.value,f=f.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let f,h=0,p=!1;e:do{const m=c.dep,g=m.flags;if(u.flags&16)p=!0;else if((g&17)===17){if(e(m)){const x=m.subs;x.nextSub!==void 0&&a(x),p=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(f={value:c,prev:f}),c=m.deps,u=m,++h;continue}if(!p){const x=c.nextDep;if(x!==void 0){c=x;continue}}for(;h--;){const x=u.subs,y=x.nextSub!==void 0;if(y?(c=f.value,f=f.prev):c=x,p){if(e(u)){y&&a(x),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const v=c.nextDep;if(v!==void 0){c=v;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,f=u.flags;(f&48)===32&&(u.flags=f|16,(f&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let f=u.depsTail;for(;f!==void 0;){if(f===c)return!0;f=f.prevDep}return!1}}function UL(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 Jm=[];let zu=0;const{link:_b,unlink:WL,propagate:KL,checkDirty:gj,shallowPropagate:Sb}=VL({update(e){return e._update()},notify(e){Jm[Qm++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,Id(e))}});let Zc=0,Qm=0,dr,Xm=0;function yj(e){try{++Xm,e()}finally{--Xm||xj()}}function Id(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=WL(n,e)}function xj(){if(!(Xm>0)){for(;Zc<Qm;){const e=Jm[Zc];Jm[Zc++]=void 0,e.notify()}Zc=0,Qm=0}}function Cb(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?Le.None:Le.Mutable,get(){return dr!==void 0&&_b(s,dr,zu),s._snapshot},subscribe(i){const o=UL(i),a={current:!1},l=HL(()=>{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=dr,a=(t==null?void 0:t.compare)??Object.is;if(n)dr=s,++zu,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=Le.Mutable|Le.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{dr=o,n&&(s.flags&=~Le.RecursedCheck),Id(s)}}};return n?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const i=s.flags;if(i&Le.Dirty||i&Le.Pending&&gj(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&Sb(o)}}else i&Le.Pending&&(s.flags=i&~Le.Pending);return dr!==void 0&&_b(s,dr,zu),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(KL(o),Sb(o),xj())}},s}function HL(e){const t=()=>{const r=dr;dr=n,++zu,n.depsTail=void 0,n.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{dr=r,n.flags&=~Le.RecursedCheck,Id(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Le.Watching|Le.RecursedCheck,notify(){const r=this.flags;r&Le.Dirty||r&Le.Pending&&gj(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,Id(this)}};return t(),n}var vj={exports:{}},bj={},wj={exports:{}},kj={};/**
|
|
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 Uo=k;function GL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ZL=typeof Object.is=="function"?Object.is:GL,qL=Uo.useState,YL=Uo.useEffect,JL=Uo.useLayoutEffect,QL=Uo.useDebugValue;function XL(e,t){var n=t(),r=qL({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return JL(function(){s.value=n,s.getSnapshot=t,Jh(s)&&i({inst:s})},[e,n,t]),YL(function(){return Jh(s)&&i({inst:s}),e(function(){Jh(s)&&i({inst:s})})},[e]),QL(n),n}function Jh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ZL(e,n)}catch{return!0}}function eM(e,t){return t()}var tM=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eM:XL;kj.useSyncExternalStore=Uo.useSyncExternalStore!==void 0?Uo.useSyncExternalStore:tM;wj.exports=kj;var nM=wj.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 Af=k,rM=nM;function sM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iM=typeof Object.is=="function"?Object.is:sM,oM=rM.useSyncExternalStore,aM=Af.useRef,lM=Af.useEffect,cM=Af.useMemo,uM=Af.useDebugValue;bj.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=aM(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cM(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,iM(u,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(u=p,m):(u=p,f=g)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,s]);var a=oM(e,i[0],i[1]);return lM(function(){o.hasValue=!0,o.value=a},[a]),uM(a),a};vj.exports=bj;var _j=vj.exports;const dM=ff(_j);function fM(e,t){return e===t}function Zt(e,t,n=fM){const r=k.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=k.useCallback(()=>e==null?void 0:e.get(),[e]);return _j.useSyncExternalStoreWithSelector(r,s,s,t,n)}var hM={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ii(e){const t=gn(),n=k.useContext(e.from?BL:If),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=k.useRef(void 0);return Zt(s??hM,o=>{if((e.shouldThrow??!0)&&!o&&Or(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=ps(i.current,a);return i.current=l,l}return a})}function Sj(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Cj(e){const{select:t,...n}=e;return Ii({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ai(e){return Ii({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 fx(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function lt(e){const t=gn();return k.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function jj(e){return Ii({...e,select:t=>e.select?e.select(t.context):t.context})}function pM(e,t){const n=gn(),r=$R(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:f,replace:h,startTransition:p,resetScroll:m,viewTransition:g,children:x,target:y,disabled:v,style:b,className:w,onClick:_,onBlur:S,onFocus:j,onMouseEnter:E,onMouseLeave:T,onTouchStart:P,ignoreBlocker:N,params:R,search:L,hash:I,state:z,mask:$,reloadDocument:D,unsafeRelative:O,from:V,_fromLocation:C,...U}=e,Q=pj(),A=k.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),me=Zt(n.stores.location,be=>be,(be,F)=>be.href===F.href),ke=k.useMemo(()=>{const be={_fromLocation:me,...A};return n.buildLocation(be)},[n,me,A]),ve=ke.maskedLocation?ke.maskedLocation.publicHref:ke.publicHref,Xt=ke.maskedLocation?ke.maskedLocation.external:ke.external,ct=k.useMemo(()=>bM(ve,Xt,n.history,v),[v,Xt,ve,n.history]),vn=k.useMemo(()=>{if(ct!=null&&ct.external)return Ed(ct.href,n.protocolAllowlist)?void 0:ct.href;if(!wM(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Ed(a,n.protocolAllowlist)?void 0:a}catch{}},[a,ct,n.protocolAllowlist]),tr=k.useMemo(()=>{if(vn)return!1;if(o!=null&&o.exact){if(!tL(me.pathname,ke.pathname,n.basepath))return!1}else{const be=Pd(me.pathname,n.basepath),F=Pd(ke.pathname,n.basepath);if(!(be.startsWith(F)&&(be.length===F.length||be[F.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!pi(me.search,ke.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&me.hash===ke.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,me,vn,Q,ke.hash,ke.pathname,ke.search,n.basepath]),kr=tr?hs(s,{})??mM:Qh,Di=tr?Qh:hs(i,{})??Qh,_c=[w,kr.className,Di.className].filter(Boolean).join(" "),Sc=(b||kr.style||Di.style)&&{...b,...kr.style,...Di.style},[Cc,ga]=k.useState(!1),ya=k.useRef(!1),Hr=e.reloadDocument||vn?!1:l??n.options.defaultPreload,Oi=c??n.options.defaultPreloadDelay??0,nr=k.useCallback(()=>{n.preloadRoute({...A,_builtLocation:ke}).catch(be=>{console.warn(be),console.warn(ML)})},[n,A,ke]);MR(r,k.useCallback(be=>{be!=null&&be.isIntersecting&&nr()},[nr]),vM,{disabled:!!v||Hr!=="viewport"}),k.useEffect(()=>{ya.current||!v&&Hr==="render"&&(nr(),ya.current=!0)},[v,nr,Hr]);const gh=be=>{const F=be.currentTarget.getAttribute("target"),G=y!==void 0?y:F;if(!v&&!kM(be)&&!be.defaultPrevented&&(!G||G==="_self")&&be.button===0){be.preventDefault(),Ni.flushSync(()=>{ga(!0)});const ie=n.subscribe("onResolved",()=>{ie(),ga(!1)});n.navigate({...A,replace:h,resetScroll:m,hashScrollIntoView:f,startTransition:p,viewTransition:g,ignoreBlocker:N})}};if(vn)return{...U,ref:r,href:vn,...x&&{children:x},...y&&{target:y},...v&&{disabled:v},...b&&{style:b},...w&&{className:w},..._&&{onClick:_},...S&&{onBlur:S},...j&&{onFocus:j},...E&&{onMouseEnter:E},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const jc=be=>{if(v||Hr!=="intent")return;if(!Oi){nr();return}const F=be.currentTarget;if(Ia.has(F))return;const G=setTimeout(()=>{Ia.delete(F),nr()},Oi);Ia.set(F,G)},yh=be=>{v||Hr!=="intent"||nr()},Ec=be=>{if(v||!Hr||!Oi)return;const F=be.currentTarget,G=Ia.get(F);G&&(clearTimeout(G),Ia.delete(F))};return{...U,...kr,...Di,href:ct==null?void 0:ct.href,ref:r,onClick:Bi([_,gh]),onBlur:Bi([S,Ec]),onFocus:Bi([j,jc]),onMouseEnter:Bi([E,jc]),onMouseLeave:Bi([T,Ec]),onTouchStart:Bi([P,yh]),disabled:!!v,target:y,...Sc&&{style:Sc},..._c&&{className:_c},...v&&gM,...tr&&yM,...Q&&Cc&&xM}}var Qh={},mM={className:"active"},gM={role:"link","aria-disabled":!0},yM={"data-status":"active","aria-current":"page"},xM={"data-transitioning":"transitioning"},Ia=new WeakMap,vM={rootMargin:"100px"},Bi=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function bM(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function wM(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Ej=k.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=pM(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return k.createElement("a",l,o)}return k.createElement(n,i,o)});function kM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var _M=class extends hj{constructor(e){super(e),this.useMatch=t=>Ii({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jj({...t,from:this.id}),this.useSearch=t=>fx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ai({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Cj({...t,from:this.id}),this.useLoaderData=t=>Sj({...t,from:this.id}),this.useNavigate=()=>lt({from:this.fullPath}),this.Link=Ro.forwardRef((t,n)=>d.jsx(Ej,{ref:n,from:this.fullPath,...t}))}};function Ot(e){return new _M(e)}var SM=class extends $L{constructor(e){super(e),this.useMatch=t=>Ii({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>jj({...t,from:this.id}),this.useSearch=t=>fx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ai({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Cj({...t,from:this.id}),this.useLoaderData=t=>Sj({...t,from:this.id}),this.useNavigate=()=>lt({from:this.fullPath}),this.Link=Ro.forwardRef((t,n)=>d.jsx(Ej,{ref:n,from:this.fullPath,...t}))}};function CM(e){return new SM(e)}function jM(e){const t=gn(),n=`not-found-${Zt(t.stores.location,r=>r.pathname)}-${Zt(t.stores.status,r=>r)}`;return d.jsx(ux,{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 EM(){return d.jsx("p",{children:"Not Found"})}function qi(e){return d.jsx(d.Fragment,{children:e.children})}function Pj(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(EM,{})}function PM(e){return null}function TM(){return PM(gn()),null}var Tj=k.memo(function({matchId:t}){const n=gn(),r=n.stores.matchStores.get(t);r||Or();const s=Zt(n.stores.loadedAt,o=>o),i=Zt(r,o=>o);return d.jsx(NM,{router:n,matchId:t,resetKey:s,matchState:k.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 NM({router:e,matchId:t,resetKey:n,matchState:r}){var m,g;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?d.jsx(i,{}):null,a=s.options.errorComponent??e.options.defaultErrorComponent,l=s.options.onCatch??e.options.defaultOnCatch,c=s.isRoot?s.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):s.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",f=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((g=s.options.errorComponent)==null?void 0:g.preload)||u))?k.Suspense:qi,h=a?ux:qi,p=c?jM:qi;return d.jsxs(s.isRoot?s.options.shellComponent??qi:qi,{children:[d.jsx(If.Provider,{value:t,children:d.jsx(f,{fallback:o,children:d.jsx(h,{getResetKey:()=>n,errorComponent:a||dx,onCatch:(x,y)=>{if(St(x))throw x.routeId??(x.routeId=r.routeId),x;l==null||l(x,y)},children:d.jsx(p,{fallback:x=>{if(x.routeId??(x.routeId=r.routeId),!c||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!s.isRoot)throw x;return k.createElement(c,x)},children:u||r._displayPending?d.jsx(zL,{fallback:o,children:d.jsx(jb,{matchId:t})}):d.jsx(jb,{matchId:t})})})})}),r.parentRouteId===mi?d.jsxs(d.Fragment,{children:[d.jsx(IM,{resetKey:n}),e.options.scrollRestoration&&nj?d.jsx(TM,{}):null]}):null]})}function IM({resetKey:e}){const t=gn(),n=k.useRef(void 0);return Ka(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...jo(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var jb=k.memo(function({matchId:t}){const n=gn(),r=(u,f)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[f])??u._nonReactive[f]},s=n.stores.matchStores.get(t);s||Or();const i=Zt(s,u=>u),o=i.routeId,a=n.routesById[o],l=k.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=k.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?d.jsx(u,{},l):d.jsx(eg,{})},[l,a.options.component,n.options.defaultComponent]);if(i._displayPending)throw r(i,"displayPendingPromise");if(i._forcePending)throw r(i,"minPendingPromise");if(i.status==="pending"){const u=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(u){const f=n.getMatch(i.id);if(f&&!f._nonReactive.minPendingPromise){const h=Vo();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return St(i.error)||Or(),Pj(n,a,i.error);if(i.status==="redirected")throw Ut(i.error)||Or(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),eg=k.memo(function(){const t=gn(),n=k.useContext(If);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=Zt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=Zt(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||Or(),Pj(t,o,void 0);if(!i)return null;const l=d.jsx(Tj,{matchId:i});return r===mi?d.jsx(k.Suspense,{fallback:a,children:l}):l});function AM(){const e=gn(),t=k.useRef({router:e,mounted:!1}),[n,r]=k.useState(!1),s=Zt(e.stores.isLoading,f=>f),i=Zt(e.stores.hasPending,f=>f),o=Wh(s),a=s||n||i,l=Wh(a),c=s||i,u=Wh(c);return e.startTransition=f=>{r(!0),k.startTransition(()=>{f(),r(!1)})},k.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return js(e.latestLocation.publicHref)!==js(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),Ka(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Ka(()=>{o&&!s&&e.emit({type:"onLoad",...jo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),Ka(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...jo(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),Ka(()=>{if(l&&!a){const f=jo(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),yj(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&DL(e)}},[a,l,e]),null}function RM(){const e=gn(),t=e.routesById[mi].options.pendingComponent??e.options.defaultPendingComponent,n=t?d.jsx(t,{}):null,r=d.jsxs(typeof document<"u"&&e.ssr?qi:k.Suspense,{fallback:n,children:[d.jsx(AM,{}),d.jsx(LM,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:r}):r}function LM(){const e=gn(),t=Zt(e.stores.firstId,s=>s),n=Zt(e.stores.loadedAt,s=>s),r=t?d.jsx(Tj,{matchId:t}):null;return d.jsx(If.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:d.jsx(ux,{getResetKey:()=>n,errorComponent:dx,onCatch:void 0,children:r})})}var MM=e=>({createMutableStore:Cb,createReadonlyStore:Cb,batch:yj}),$M=e=>new DM(e),DM=class extends PL{constructor(e){super(e,MM)}};function OM({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(mj.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:r}):r}function zM({router:e,...t}){return d.jsx(OM,{router:e,...t,children:d.jsx(RM,{})})}function Eb(e){const t=gn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=k.useRef(void 0);return Zt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=ps(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const FM="modulepreload",BM=function(e){return"/"+e},Pb={},$n=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=BM(l),l in Pb)return;Pb[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":FM,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}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 Nj(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=Nj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function VM(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Nj(e))&&(r&&(r+=" "),r+=t);return r}const hx="-",UM=e=>{const t=KM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(hx);return a[0]===""&&a.length!==1&&a.shift(),Ij(a,t)||WM(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Ij=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Ij(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(hx);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Tb=/^\[(.+)\]$/,WM=e=>{if(Tb.test(e)){const t=Tb.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},KM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GM(Object.entries(e.classGroups),n).forEach(([i,o])=>{tg(o,r,i,t)}),r},tg=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Nb(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(HM(s)){tg(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{tg(o,Nb(t,i),n,r)})})},Nb=(e,t)=>{let n=e;return t.split(hx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},HM=e=>e.isThemeGetter,GM=(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,ZM=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)}}},Aj="!",qM=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 x=0;x<a.length;x++){let y=a[x];if(c===0){if(y===s&&(r||a.slice(x,x+i)===t)){l.push(a.slice(u,x)),u=x+i;continue}if(y==="/"){f=x;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Aj),m=p?h.substring(1):h,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},YM=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},JM=e=>({cache:ZM(e.cacheSize),parseClassName:qM(e),...UM(e)}),QM=/\s+/,XM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(QM);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let m=!!p,g=r(m?h.substring(0,p):h);if(!g){if(!m){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}m=!1}const x=YM(u).join(":"),y=f?x+Aj:x,v=y+g;if(i.includes(v))continue;i.push(v);const b=s(g,m);for(let w=0;w<b.length;++w){const _=b[w];i.push(y+_)}a=c+(a.length>0?" "+a:a)}return a};function e$(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Rj(t))&&(r&&(r+=" "),r+=n);return r}const Rj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Rj(e[r]))&&(n&&(n+=" "),n+=t);return n};function t$(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,f)=>f(u),e());return n=JM(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=XM(l,n);return s(l,u),u}return function(){return i(e$.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Lj=/^\[(?:([a-z-]+):)?(.+)\]$/i,n$=/^\d+\/\d+$/,r$=new Set(["px","full","screen"]),s$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i$=/\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$/,o$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,l$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>Eo(e)||r$.has(e)||n$.test(e),Zr=e=>ta(e,"length",g$),Eo=e=>!!e&&!Number.isNaN(Number(e)),Xh=e=>ta(e,"number",Eo),Aa=e=>!!e&&Number.isInteger(Number(e)),c$=e=>e.endsWith("%")&&Eo(e.slice(0,-1)),le=e=>Lj.test(e),qr=e=>s$.test(e),u$=new Set(["length","size","percentage"]),d$=e=>ta(e,u$,Mj),f$=e=>ta(e,"position",Mj),h$=new Set(["image","url"]),p$=e=>ta(e,h$,x$),m$=e=>ta(e,"",y$),Ra=()=>!0,ta=(e,t,n)=>{const r=Lj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},g$=e=>i$.test(e)&&!o$.test(e),Mj=()=>!1,y$=e=>a$.test(e),x$=e=>l$.test(e),v$=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),r=Ie("brightness"),s=Ie("borderColor"),i=Ie("borderRadius"),o=Ie("borderSpacing"),a=Ie("borderWidth"),l=Ie("contrast"),c=Ie("grayscale"),u=Ie("hueRotate"),f=Ie("invert"),h=Ie("gap"),p=Ie("gradientColorStops"),m=Ie("gradientColorStopPositions"),g=Ie("inset"),x=Ie("margin"),y=Ie("opacity"),v=Ie("padding"),b=Ie("saturate"),w=Ie("scale"),_=Ie("sepia"),S=Ie("skew"),j=Ie("space"),E=Ie("translate"),T=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",le,t],R=()=>[le,t],L=()=>["",Cr,Zr],I=()=>["auto",Eo,le],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",le],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Eo,le];return{cacheSize:500,separator:":",theme:{colors:[Ra],spacing:[Cr,Zr],blur:["none","",qr,le],brightness:U(),borderColor:[e],borderRadius:["none","","full",qr,le],borderSpacing:R(),borderWidth:L(),contrast:U(),grayscale:V(),hueRotate:U(),invert:V(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[c$,Zr],inset:N(),margin:N(),opacity:U(),padding:R(),saturate:U(),scale:U(),sepia:V(),skew:U(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[qr]}],"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:[...z(),le]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Aa,le]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Aa,le]}],"grid-cols":[{"grid-cols":[Ra]}],"col-start-end":[{col:["auto",{span:["full",Aa,le]},le]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ra]}],"row-start-end":[{row:["auto",{span:[Aa,le]},le]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[qr]},qr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qr,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xh]}],"font-family":[{font:[Ra]}],"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",le]}],"line-clamp":[{"line-clamp":["none",Eo,Xh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Cr,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Cr,Zr]}],"underline-offset":[{"underline-offset":["auto",Cr,le]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],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",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),f$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",d$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},p$]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:$()}],"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:["",...$()]}],"outline-offset":[{"outline-offset":[Cr,le]}],"outline-w":[{outline:[Cr,Zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Cr,Zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qr,m$]}],"shadow-color":[{shadow:[Ra]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",qr,le]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",le]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Aa,le]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],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",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Cr,Zr,Xh]}],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"]}}},b$=t$(v$);function ep(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 w$(e,t){return e[0]===t[0]&&e[1]===t[1]}function k$(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)ep(c,a,s);const l=function(c,u,f){const h=[];for(const v of c){const b=[...v];w$(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&h.push(b)}const p=[];u=Math.max(u,.1);const m=[];for(const v of h)for(let b=0;b<v.length-1;b++){const w=v[b],_=v[b+1];if(w[1]!==_[1]){const S=Math.min(w[1],_[1]);m.push({ymin:S,ymax:Math.max(w[1],_[1]),x:S===w[1]?w[0]:_[0],islope:(_[0]-w[0])/(_[1]-w[1])})}}if(m.sort((v,b)=>v.ymin<b.ymin?-1:v.ymin>b.ymin?1:v.x<b.x?-1:v.x>b.x?1:v.ymax===b.ymax?0:(v.ymax-b.ymax)/Math.abs(v.ymax-b.ymax)),!m.length)return p;let g=[],x=m[0].ymin,y=0;for(;g.length||m.length;){if(m.length){let v=-1;for(let b=0;b<m.length&&!(m[b].ymin>x);b++)v=b;m.splice(0,v+1).forEach(b=>{g.push({s:x,edge:b})})}if(g=g.filter(v=>!(v.edge.ymax<=x)),g.sort((v,b)=>v.edge.x===b.edge.x?0:(v.edge.x-b.edge.x)/Math.abs(v.edge.x-b.edge.x)),(f!==1||y%u==0)&&g.length>1)for(let v=0;v<g.length;v+=2){const b=v+1;if(b>=g.length)break;const w=g[v].edge,_=g[b].edge;p.push([[Math.round(w.x),x],[Math.round(_.x),x]])}x+=f,g.forEach(v=>{v.edge.x=v.edge.x+f*v.edge.islope}),y++}return p}(o,i,r);if(s){for(const c of o)ep(c,a,-s);(function(c,u,f){const h=[];c.forEach(p=>h.push(...p)),ep(h,u,f)})(l,a,-s)}return l}function tc(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),k$(e,s,r,i||1)}class px{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=tc(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 Rf(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 _$ extends px{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=tc(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)Rf([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 S$ extends px{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 C${constructor(t){this.helper=t}fillPolygons(t,n){const r=tc(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=Rf(a),c=l/s,u=Math.ceil(c)-1,f=l-u*s,h=(a[0][0]+a[1][0])/2-s/4,p=Math.min(a[0][1],a[1][1]);for(let m=0;m<u;m++){const g=p+f+m*s,x=h-o+2*Math.random()*o,y=g-o+2*Math.random()*o,v=this.helper.ellipse(x,y,i,i,n);r.push(...v.ops)}}return{type:"fillSketch",ops:r}}}class j${constructor(t){this.helper=t}fillPolygons(t,n){const r=tc(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=Rf(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],f=o[1];u[0]>f[0]&&(u=o[1],f=o[0]);const h=Math.atan((f[1]-u[1])/(f[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),g=m+r,x=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],y=[u[0]+g*Math.cos(h)+c*Math.cos(h),u[1]+g*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],n))}}),i}}class E${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=tc(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=Rf(i),a=Math.round(o/(2*n));let l=i[0],c=i[1];l[0]>c[0]&&(l=i[1],c=i[0]);const u=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let f=0;f<a;f++){const h=2*f*n,p=2*(f+1)*n,m=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],x=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],y=[g[0]+m*Math.cos(u+Math.PI/4),g[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],r),...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}}),s}}const zt={};class P${constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const T$=0,tp=1,Ib=2,qc={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 np(e,t){return e.type===t}function mx(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:T$,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:tp,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Ib,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!np(i,Ib);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return mx("M0,0"+e);s++,o=qc[i.text],r=i.text}else np(i,tp)?o=qc[r]:(s++,o=qc[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(!np(c,tp))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof qc[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 $j(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 Dj(e){const t=[];let n="",r=0,s=0,i=0,o=0,a=0,l=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,s]=u,[i,o]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],s=u[5],a=u[2],l=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,s]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,s]});break;case"V":s=u[0],t.push({key:"L",data:[r,s]});break;case"S":{let f=0,h=0;n==="C"||n==="S"?(f=r+(r-a),h=s+(s-l)):(f=r,h=s),t.push({key:"C",data:[f,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[f,h]=u;let p=0,m=0;n==="Q"||n==="T"?(p=r+(r-a),m=s+(s-l)):(p=r,m=s);const g=r+2*(p-r)/3,x=s+2*(m-s)/3,y=f+2*(p-f)/3,v=h+2*(m-h)/3;t.push({key:"C",data:[g,x,y,v,f,h]}),a=p,l=m,r=f,s=h;break}case"Q":{const[f,h,p,m]=u,g=r+2*(f-r)/3,x=s+2*(h-s)/3,y=p+2*(f-p)/3,v=m+2*(h-m)/3;t.push({key:"C",data:[g,x,y,v,p,m]}),a=f,l=h,r=p,s=m;break}case"A":{const f=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],g=u[4],x=u[5],y=u[6];f===0||h===0?(t.push({key:"C",data:[r,s,x,y,x,y]}),r=x,s=y):(r!==x||s!==y)&&(Oj(r,s,x,y,f,h,p,m,g).forEach(function(v){t.push({key:"C",data:v})}),r=x,s=y);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function La(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Oj(e,t,n,r,s,i,o,a,l,c){const u=(f=o,Math.PI*f/180);var f;let h=[],p=0,m=0,g=0,x=0;if(c)[p,m,g,x]=c;else{[e,t]=La(e,t,-u),[n,r]=La(n,r,-u);const L=(e-n)/2,I=(t-r)/2;let z=L*L/(s*s)+I*I/(i*i);z>1&&(z=Math.sqrt(z),s*=z,i*=z);const $=s*s,D=i*i,O=$*D-$*I*I-D*L*L,V=$*I*I+D*L*L,C=(a===l?-1:1)*Math.sqrt(Math.abs(O/V));g=C*s*I/i+(e+n)/2,x=C*-i*L/s+(t+r)/2,p=Math.asin(parseFloat(((t-x)/i).toFixed(9))),m=Math.asin(parseFloat(((r-x)/i).toFixed(9))),e<g&&(p=Math.PI-p),n<g&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let y=m-p;if(Math.abs(y)>120*Math.PI/180){const L=m,I=n,z=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Oj(n=g+s*Math.cos(m),r=x+i*Math.sin(m),I,z,s,i,o,0,l,[m,L,g,x])}y=m-p;const v=Math.cos(p),b=Math.sin(p),w=Math.cos(m),_=Math.sin(m),S=Math.tan(y/4),j=4/3*s*S,E=4/3*i*S,T=[e,t],P=[e+j*b,t-E*v],N=[n+j*_,r-E*w],R=[n,r];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,N,R].concat(h);{h=[P,N,R].concat(h);const L=[];for(let I=0;I<h.length;I+=3){const z=La(h[I][0],h[I][1],u),$=La(h[I+1][0],h[I+1][1],u),D=La(h[I+2][0],h[I+2][1],u);L.push([z[0],z[1],$[0],$[1],D[0],D[1]])}return L}}const N$={randOffset:function(e,t){return te(e,t)},randOffsetWithRange:function(e,t,n){return Ad(e,t,n)},ellipse:function(e,t,n,r,s){const i=Fj(n,r,s);return ng(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return As(e,t,n,r,s,!0)}};function zj(e,t,n,r,s){return{type:"path",ops:As(e,t,n,r,s)}}function Fu(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...As(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...As(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?zj(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function I$(e,t,n,r,s){return function(i,o){return Fu(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Ab(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=Yc(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Yc(n[0],1.5*(1+.22*t.roughness),Mb(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=Yc(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Yc(o,1.5*(1+.22*t.roughness),Mb(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 Fj(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+=te(o*l,n),a+=te(a*l,n),{increment:i,rx:o,ry:a}}function ng(e,t,n,r){const[s,i]=$b(r.increment,e,t,r.rx,r.ry,1,r.increment*Ad(.1,Ad(.4,1,n),n),n);let o=Rd(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=$b(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Rd(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function Rb(e,t,n,r,s,i,o,a,l){const c=e,u=t;let f=Math.abs(n/2),h=Math.abs(r/2);f+=te(.01*f,l),h+=te(.01*h,l);let p=s,m=i;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);const g=2*Math.PI/l.curveStepCount,x=Math.min(g/2,(m-p)/2),y=Db(x,c,u,f,h,p,m,1,l);if(!l.disableMultiStroke){const v=Db(x,c,u,f,h,p,m,1.5,l);y.push(...v)}return o&&(a?y.push(...As(c,u,c+f*Math.cos(p),u+h*Math.sin(p),l),...As(c,u,c+f*Math.cos(m),u+h*Math.sin(m),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+f*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:y}}function Lb(e,t){const n=Dj($j(mx(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(...As(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[l,c,u,f,h,p]=a;r.push(...A$(l,c,u,f,h,p,i,t)),i=[h,p];break}case"Z":r.push(...As(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function rp(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]+te(s,t),r[0][1]+te(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+te(s,t),r[o][1]+te(s,t)]})}}return{type:"fillPath",ops:n}}function Vi(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!zt[s])switch(s){case"zigzag":zt[s]||(zt[s]=new _$(r));break;case"cross-hatch":zt[s]||(zt[s]=new S$(r));break;case"dots":zt[s]||(zt[s]=new C$(r));break;case"dashed":zt[s]||(zt[s]=new j$(r));break;case"zigzag-line":zt[s]||(zt[s]=new E$(r));break;default:s="hachure",zt[s]||(zt[s]=new px(r))}return zt[s]}(t,N$).fillPolygons(e,t)}function Mb(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Bj(e){return e.randomizer||(e.randomizer=new P$(e.seed||0)),e.randomizer.next()}function Ad(e,t,n,r=1){return n.roughness*r*(Bj(n)*(t-e)+e)}function te(e,t,n=1){return Ad(-e,e,t,n)}function As(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=rg(e,t,n,r,s,!0,!1);if(o)return a;const l=rg(e,t,n,r,s,!0,!0);return a.concat(l)}function rg(e,t,n,r,s,i,o){const a=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let u=s.maxRandomnessOffset||0;u*u*100>a&&(u=l/10);const f=u/2,h=.2+.2*Bj(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=te(p,s,c),m=te(m,s,c);const g=[],x=()=>te(f,s,c),y=()=>te(u,s,c),v=s.preserveVertices;return o?g.push({op:"move",data:[e+(v?0:x()),t+(v?0:x())]}):g.push({op:"move",data:[e+(v?0:te(u,s,c)),t+(v?0:te(u,s,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*h+x(),m+t+(r-t)*h+x(),p+e+2*(n-e)*h+x(),m+t+2*(r-t)*h+x(),n+(v?0:x()),r+(v?0:x())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*h+y(),m+t+(r-t)*h+y(),p+e+2*(n-e)*h+y(),m+t+2*(r-t)*h+y(),n+(v?0:y()),r+(v?0:y())]}),g}function Yc(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+te(t,n),e[0][1]+te(t,n)]),r.push([e[0][0]+te(t,n),e[0][1]+te(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+te(t,n),e[s][1]+te(t,n)]),s===e.length-1&&r.push([e[s][0]+te(t,n),e[s][1]+te(t,n)]);return Rd(r,null,n)}function Rd(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(...rg(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function $b(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=te(.5,a)-Math.PI/2;c.push([te(i,a)+t+.9*r*Math.cos(u-e),te(i,a)+n+.9*s*Math.sin(u-e)]);const f=2*Math.PI+u-.01;for(let h=u;h<f;h+=e){const p=[te(i,a)+t+r*Math.cos(h),te(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([te(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),te(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([te(i,a)+t+.98*r*Math.cos(u+o),te(i,a)+n+.98*s*Math.sin(u+o)]),c.push([te(i,a)+t+.9*r*Math.cos(u+.5*o),te(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function Db(e,t,n,r,s,i,o,a,l){const c=i+te(.1,l),u=[];u.push([te(a,l)+t+.9*r*Math.cos(c-e),te(a,l)+n+.9*s*Math.sin(c-e)]);for(let f=c;f<=o;f+=e)u.push([te(a,l)+t+r*Math.cos(f),te(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)]),Rd(u,null,l)}function A$(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const f=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<f;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:te(c[0],a)),o[1]+(h?0:te(c[0],a))]}),u=h?[s,i]:[s+te(c[p],a),i+te(c[p],a)],l.push({op:"bcurveTo",data:[e+te(c[p],a),t+te(c[p],a),n+te(c[p],a),r+te(c[p],a),u[0],u[1]]});return l}function Ma(e){return[...e]}function Ob(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(Ma(e[0]),Ma(e[1]),Ma(e[2]),Ma(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(Ma(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 Bu(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function R$(e,t,n){const r=Bu(t,n);if(r===0)return Bu(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)),Bu(e,ei(t,n,s))}function ei(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function sg(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],f=a[l+2],h=a[l+3];let p=3*u[0]-2*c[0]-h[0];p*=p;let m=3*u[1]-2*c[1]-h[1];m*=m;let g=3*f[0]-2*h[0]-c[0];g*=g;let x=3*f[1]-2*h[1]-c[1];return x*=x,p<g&&(p=g),m<x&&(m=x),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Bu(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],f=e[t+3],h=ei(l,c,.5),p=ei(c,u,.5),m=ei(u,f,.5),g=ei(h,p,.5),x=ei(p,m,.5),y=ei(g,x,.5);sg([l,h,g,y],0,n,s),sg([y,x,m,f],0,n,s)}var i,o;return s}function L$(e,t){return Ld(e,0,e.length,t)}function Ld(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=R$(e[u],o,a);f>l&&(l=f,c=u)}return Math.sqrt(l)>r?(Ld(e,t,c+1,r,i),Ld(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function sp(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)sg(e,3*i,t,r);return n&&n>0?Ld(r,0,r.length,n):r}const tn="none";let Md=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",[zj(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=I$(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(rp([c],o)):a.push(Vi([c],o))}return o.stroke!==tn&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Fj(r,s,o),c=ng(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=ng(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Vi([c.estimatedPoints],o));return o.stroke!==tn&&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",[Fu(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],f=Rb(t,n,r,s,i,o,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const h=Object.assign({},c);h.disableMultiStroke=!0;const p=Rb(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,g,x,y,v){const b=h,w=p;let _=Math.abs(m/2),S=Math.abs(g/2);_+=te(.01*_,v),S+=te(.01*S,v);let j=x,E=y;for(;j<0;)j+=2*Math.PI,E+=2*Math.PI;E-j>2*Math.PI&&(j=0,E=2*Math.PI);const T=(E-j)/v.curveStepCount,P=[];for(let N=j;N<=E;N+=T)P.push([b+_*Math.cos(N),w+S*Math.sin(N)]);return P.push([b+_*Math.cos(E),w+S*Math.sin(E)]),P.push([b,w]),Vi([P],v)}(t,n,r,s,i,o,c));return c.stroke!==tn&&u.push(f),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Ab(t,r);if(r.fill&&r.fill!==tn)if(r.fillStyle==="solid"){const o=Ab(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(...sp(Ob([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...sp(Ob(c),10,(1+r.roughness)/2))}o.length&&s.push(Vi([o],r))}return r.stroke!==tn&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Fu(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(rp([t],r)):s.push(Vi([t],r))),r.stroke!==tn&&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!==tn,o=r.stroke!==tn,a=!!(r.simplification&&r.simplification<1),l=function(u,f,h){const p=Dj($j(mx(u))),m=[];let g=[],x=[0,0],y=[];const v=()=>{y.length>=4&&g.push(...sp(y,f)),y=[]},b=()=>{v(),g.length&&(m.push(g),g=[])};for(const{key:_,data:S}of p)switch(_){case"M":b(),x=[S[0],S[1]],g.push(x);break;case"L":v(),g.push([S[0],S[1]]);break;case"C":if(!y.length){const j=g.length?g[g.length-1]:x;y.push([j[0],j[1]])}y.push([S[0],S[1]]),y.push([S[2],S[3]]),y.push([S[4],S[5]]);break;case"Z":v(),g.push([x[0],x[1]])}if(b(),!h)return m;const w=[];for(const _ of m){const S=L$(_,h);S.length&&w.push(S)}return w}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Lb(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Lb(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(rp(l,r));else s.push(Vi(l,r));return o&&(a?l.forEach(u=>{s.push(Fu(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:tn};break;case"fillPath":o={d:this.opsToPath(i),stroke:tn,strokeWidth:0,fill:r.fill||tn};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||tn,strokeWidth:r,fill:tn}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},M$=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Md(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 Jc="http://www.w3.org/2000/svg";class $${constructor(t,n){this.svg=t,this.gen=new Md(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(Jc,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(Jc,"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(Jc,"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(Jc,"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 D$={canvas:(e,t)=>new M$(e,t),svg:(e,t)=>new $$(e,t),generator:e=>new Md(e),newSeed:()=>Md.newSeed()};const gx=k.createContext({});function yx(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const O$=typeof window<"u",Vj=O$?k.useLayoutEffect:k.useEffect,Lf=k.createContext(null);function xx(e,t){e.indexOf(t)===-1&&e.push(t)}function $d(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const xr=(e,t,n)=>n>t?t:n<e?e:n;let vx=()=>{};const Rs={},Uj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wj=e=>typeof e=="object"&&e!==null,Kj=e=>/^0[^.\s]+$/u.test(e);function Hj(e){let t;return()=>(t===void 0&&(t=e()),t)}const In=e=>e,nc=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Ol=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class bx{constructor(){this.subscriptions=[]}add(t){return xx(this.subscriptions,t),()=>$d(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 un=e=>e*1e3,Pn=e=>e/1e3,Gj=(e,t)=>t?e*(1e3/t):0,Zj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,z$=1e-7,F$=12;function B$(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Zj(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>z$&&++a<F$);return o}function rc(e,t,n,r){if(e===t&&n===r)return In;const s=i=>B$(i,0,1,e,n);return i=>i===0||i===1?i:Zj(s(i),t,r)}const qj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yj=e=>t=>1-e(1-t),Jj=rc(.33,1.53,.69,.99),wx=Yj(Jj),Qj=qj(wx),Xj=e=>e>=1?1:(e*=2)<1?.5*wx(e):.5*(2-Math.pow(2,-10*(e-1))),kx=e=>1-Math.sin(Math.acos(e)),eE=Yj(kx),tE=qj(kx),V$=rc(.42,0,1,1),U$=rc(0,0,.58,1),nE=rc(.42,0,.58,1),W$=e=>Array.isArray(e)&&typeof e[0]!="number",rE=e=>Array.isArray(e)&&typeof e[0]=="number",K$={linear:In,easeIn:V$,easeInOut:nE,easeOut:U$,circIn:kx,circInOut:tE,circOut:eE,backIn:wx,backInOut:Qj,backOut:Jj,anticipate:Xj},H$=e=>typeof e=="string",zb=e=>{if(rE(e)){vx(e.length===4);const[t,n,r,s]=e;return rc(t,n,r,s)}else if(H$(e))return K$[e];return e},Qc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function G$(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,h=!1)=>{const m=h&&s?n:r;return f&&o.add(u),m.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const Z$=40;function sE(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Qc.reduce((b,w)=>(b[w]=G$(i),b),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:h,render:p,postRender:m}=o,g=()=>{const b=Rs.useManualTiming,w=b?s.timestamp:performance.now();n=!1,b||(s.delta=r?1e3/60:Math.max(Math.min(w-s.timestamp,Z$),1)),s.timestamp=w,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Qc.reduce((b,w)=>{const _=o[w];return b[w]=(S,j=!1,E=!1)=>(n||x(),_.schedule(S,j,E)),b},{}),cancel:b=>{for(let w=0;w<Qc.length;w++)o[Qc[w]].cancel(b)},state:s,steps:o}}const{schedule:je,cancel:Ls,state:ht,steps:ip}=sE(typeof requestAnimationFrame<"u"?requestAnimationFrame:In,!0);let Vu;function q$(){Vu=void 0}const At={now:()=>(Vu===void 0&&At.set(ht.isProcessing||Rs.useManualTiming?ht.timestamp:performance.now()),Vu),set:e=>{Vu=e,queueMicrotask(q$)}},iE=e=>t=>typeof t=="string"&&t.startsWith(e),oE=iE("--"),Y$=iE("var(--"),_x=e=>Y$(e)?J$.test(e.split("/*")[0].trim()):!1,J$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fb(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const na={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zl={...na,transform:e=>xr(0,1,e)},Xc={...na,default:1},il=e=>Math.round(e*1e5)/1e5,Sx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Q$(e){return e==null}const X$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Cx=(e,t)=>n=>!!(typeof n=="string"&&X$.test(n)&&n.startsWith(e)||t&&!Q$(n)&&Object.prototype.hasOwnProperty.call(n,t)),aE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Sx);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eD=e=>xr(0,255,e),op={...na,transform:e=>Math.round(eD(e))},li={test:Cx("rgb","red"),parse:aE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+op.transform(e)+", "+op.transform(t)+", "+op.transform(n)+", "+il(zl.transform(r))+")"};function tD(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 ig={test:Cx("#"),parse:tD,transform:li.transform},sc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pr=sc("deg"),yr=sc("%"),q=sc("px"),nD=sc("vh"),rD=sc("vw"),Bb={...yr,parse:e=>yr.parse(e)/100,transform:e=>yr.transform(e*100)},fo={test:Cx("hsl","hue"),parse:aE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+yr.transform(il(t))+", "+yr.transform(il(n))+", "+il(zl.transform(r))+")"},tt={test:e=>li.test(e)||ig.test(e)||fo.test(e),parse:e=>li.test(e)?li.parse(e):fo.test(e)?fo.parse(e):ig.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?li.transform(e):fo.transform(e),getAnimatableNone:e=>{const t=tt.parse(e);return t.alpha=0,tt.transform(t)}},sD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iD(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Sx))==null?void 0:t.length)||0)+(((n=e.match(sD))==null?void 0:n.length)||0)>0}const lE="number",cE="color",oD="var",aD="var(",Vb="${}",lD=/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 Wo(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(lD,l=>(tt.test(l)?(r.color.push(i),s.push(cE),n.push(tt.parse(l))):l.startsWith(aD)?(r.var.push(i),s.push(oD),n.push(l)):(r.number.push(i),s.push(lE),n.push(parseFloat(l))),++i,Vb)).split(Vb);return{values:n,split:a,indexes:r,types:s}}function cD(e){return Wo(e).values}function uE({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===lE?s+=il(r[i]):o===cE?s+=tt.transform(r[i]):s+=r[i]}return s}}function uD(e){return uE(Wo(e))}const dD=e=>typeof e=="number"?0:tt.test(e)?tt.getAnimatableNone(e):e,fD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:dD(e);function hD(e){const t=Wo(e);return uE(t)(t.values.map((r,s)=>fD(r,t.split[s])))}const Jn={test:iD,parse:cD,createTransformer:uD,getAnimatableNone:hD};function ap(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 pD({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=ap(l,a,e+1/3),i=ap(l,a,e),o=ap(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Dd(e,t){return n=>n>0?t:e}const Ce=(e,t,n)=>e+(t-e)*n,lp=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},mD=[ig,li,fo],gD=e=>mD.find(t=>t.test(e));function Ub(e){const t=gD(e);if(!t)return!1;let n=t.parse(e);return t===fo&&(n=pD(n)),n}const Wb=(e,t)=>{const n=Ub(e),r=Ub(t);if(!n||!r)return Dd(e,t);const s={...n};return i=>(s.red=lp(n.red,r.red,i),s.green=lp(n.green,r.green,i),s.blue=lp(n.blue,r.blue,i),s.alpha=Ce(n.alpha,r.alpha,i),li.transform(s))},og=new Set(["none","hidden"]);function yD(e,t){return og.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function xD(e,t){return n=>Ce(e,t,n)}function jx(e){return typeof e=="number"?xD:typeof e=="string"?_x(e)?Dd:tt.test(e)?Wb:wD:Array.isArray(e)?dE:typeof e=="object"?tt.test(e)?Wb:vD:Dd}function dE(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>jx(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function vD(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=jx(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function bD(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 wD=(e,t)=>{const n=Jn.createTransformer(t),r=Wo(e),s=Wo(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?og.has(e)&&!s.values.length||og.has(t)&&!r.values.length?yD(e,t):nc(dE(bD(r,s),s.values),n):Dd(e,t)};function fE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):jx(e)(e,t)}const kD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>je.update(t,n),stop:()=>Ls(t),now:()=>ht.isProcessing?ht.timestamp:At.now()}},hE=(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)})`},Od=2e4;function Ex(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Od;)t+=n,r=e.next(t);return t>=Od?1/0:t}function _D(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Ex(r),Od);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Pn(s)}}const Ve={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 ag(e,t){return e*Math.sqrt(1-t*t)}const SD=12;function CD(e,t,n){let r=n;for(let s=1;s<SD;s++)r=r-e(r)/t(r);return r}const cp=.001;function jD({duration:e=Ve.duration,bounce:t=Ve.bounce,velocity:n=Ve.velocity,mass:r=Ve.mass}){let s,i,o=1-t;o=xr(Ve.minDamping,Ve.maxDamping,o),e=xr(Ve.minDuration,Ve.maxDuration,Pn(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,p=ag(c,o),m=Math.exp(-f);return cp-h/p*m},i=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),g=ag(Math.pow(c,2),o);return(-s(c)+cp>0?-1:1)*((h-p)*m)/g}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-cp+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=CD(s,i,a);if(e=un(e),isNaN(l))return{stiffness:Ve.stiffness,damping:Ve.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const ED=["duration","bounce"],PD=["stiffness","damping","mass"];function Kb(e,t){return t.some(n=>e[n]!==void 0)}function TD(e){let t={velocity:Ve.velocity,stiffness:Ve.stiffness,damping:Ve.damping,mass:Ve.mass,isResolvedFromDuration:!1,...e};if(!Kb(e,PD)&&Kb(e,ED))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ve.mass,stiffness:s,damping:i}}else{const n=jD({...e,velocity:0});t={...t,...n,mass:Ve.mass},t.isResolvedFromDuration=!0}return t}function zd(e=Ve.visualDuration,t=Ve.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=TD({...n,velocity:-Pn(n.velocity||0)}),m=h||0,g=c/(2*Math.sqrt(l*u)),x=o-i,y=Pn(Math.sqrt(l/u)),v=Math.abs(x)<5;r||(r=v?Ve.restSpeed.granular:Ve.restSpeed.default),s||(s=v?Ve.restDelta.granular:Ve.restDelta.default);let b,w,_,S,j,E;if(g<1)_=ag(y,g),S=(m+g*y*x)/_,b=P=>{const N=Math.exp(-g*y*P);return o-N*(S*Math.sin(_*P)+x*Math.cos(_*P))},j=g*y*S+x*_,E=g*y*x-S*_,w=P=>Math.exp(-g*y*P)*(j*Math.sin(_*P)+E*Math.cos(_*P));else if(g===1){b=N=>o-Math.exp(-y*N)*(x+(m+y*x)*N);const P=m+y*x;w=N=>Math.exp(-y*N)*(y*P*N-m)}else{const P=y*Math.sqrt(g*g-1);b=I=>{const z=Math.exp(-g*y*I),$=Math.min(P*I,300);return o-z*((m+g*y*x)*Math.sinh($)+P*x*Math.cosh($))/P};const N=(m+g*y*x)/P,R=g*y*N-x*P,L=g*y*x-N*P;w=I=>{const z=Math.exp(-g*y*I),$=Math.min(P*I,300);return z*(R*Math.sinh($)+L*Math.cosh($))}}const T={calculatedDuration:p&&f||null,velocity:P=>un(w(P)),next:P=>{if(!p&&g<1){const R=Math.exp(-g*y*P),L=Math.sin(_*P),I=Math.cos(_*P),z=o-R*(S*L+x*I),$=un(R*(j*L+E*I));return a.done=Math.abs($)<=r&&Math.abs(o-z)<=s,a.value=a.done?o:z,a}const N=b(P);if(p)a.done=P>=f;else{const R=un(w(P));a.done=Math.abs(R)<=r&&Math.abs(o-N)<=s}return a.value=a.done?o:N,a},toString:()=>{const P=Math.min(Ex(T),Od),N=hE(R=>T.next(P*R).value,P,30);return P+"ms "+N},toTransition:()=>{}};return T}zd.applyToOptions=e=>{const t=_D(e,100,zd);return e.ease=t.ease,e.duration=un(t.duration),e.type="keyframes",e};const ND=5;function pE(e,t,n){const r=Math.max(t-ND,0);return Gj(n-e(r),t-r)}function lg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=E=>a!==void 0&&E<a||l!==void 0&&E>l,m=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let g=n*t;const x=f+g,y=o===void 0?x:o(x);y!==x&&(g=y-f);const v=E=>-g*Math.exp(-E/r),b=E=>y+v(E),w=E=>{const T=v(E),P=b(E);h.done=Math.abs(T)<=c,h.value=h.done?y:P};let _,S;const j=E=>{p(h.value)&&(_=E,S=zd({keyframes:[h.value,m(h.value)],velocity:pE(b,E,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return j(0),{calculatedDuration:null,next:E=>{let T=!1;return!S&&_===void 0&&(T=!0,w(E),j(E)),_!==void 0&&E>=_?S.next(E-_):(!T&&w(E),h)}}}function ID(e,t,n){const r=[],s=n||Rs.mix||fE,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]||In:t;a=nc(l,a)}r.push(a)}return r}function AD(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(vx(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=ID(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Ol(e[f],e[f+1],u);return a[f](h)};return n?u=>c(xr(e[0],e[i-1],u)):c}function RD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Ol(0,t,r);e.push(Ce(n,1,s))}}function LD(e){const t=[0];return RD(t,e.length-1),t}function MD(e,t){return e.map(n=>n*t)}function $D(e,t){return e.map(()=>t||nE).splice(0,e.length-1)}function ol({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=W$(r)?r.map(zb):zb(r),i={done:!1,value:t[0]},o=MD(n&&n.length===t.length?n:LD(t),e),a=AD(o,t,{ease:Array.isArray(s)?s:$D(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const DD=e=>e!==null;function Mf(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(DD),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const OD={decay:lg,inertia:lg,tween:ol,keyframes:ol,spring:zd};function mE(e){typeof e.type=="string"&&(e.type=OD[e.type])}class Px{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 zD=e=>e/100;class Fd extends Px{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!==At.now()&&this.tick(At.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;mE(t);const{type:n=ol,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||ol;l!==ol&&typeof a[0]!="number"&&(this.mixKeyframes=nc(zD,fE(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=Ex(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let b=this.currentTime,w=r;if(f){const E=Math.min(this.currentTime,s)/a;let T=Math.floor(E),P=E%1;!P&&E>=1&&(P=1),P===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(h==="reverse"?(P=1-P,p&&(P-=p/a)):h==="mirror"&&(w=o)),b=xr(0,1,P)*a}let _;v?(this.delayState.value=u[0],_=this.delayState):_=w.next(b),i&&!v&&(_.value=i(_.value));let{done:S}=_;!v&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return j&&m!==lg&&(_.value=Mf(u,this.options,x,this.speed)),g&&g(_.value),j&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Pn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Pn(t)}get time(){return Pn(this.currentTime)}set time(t){t=un(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 pE(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(At.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Pn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=kD,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(At.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 FD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ci=e=>e*180/Math.PI,cg=e=>{const t=ci(Math.atan2(e[1],e[0]));return ug(t)},BD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:cg,rotateZ:cg,skewX:e=>ci(Math.atan(e[1])),skewY:e=>ci(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ug=e=>(e=e%360,e<0&&(e+=360),e),Hb=cg,Gb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),VD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gb,scaleY:Zb,scale:e=>(Gb(e)+Zb(e))/2,rotateX:e=>ug(ci(Math.atan2(e[6],e[5]))),rotateY:e=>ug(ci(Math.atan2(-e[2],e[0]))),rotateZ:Hb,rotate:Hb,skewX:e=>ci(Math.atan(e[4])),skewY:e=>ci(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dg(e){return e.includes("scale")?1:0}function fg(e,t){if(!e||e==="none")return dg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=VD,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=BD,s=a}if(!s)return dg(t);const i=r[t],o=s[1].split(",").map(WD);return typeof i=="function"?i(o):o[i]}const UD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return fg(n,t)};function WD(e){return parseFloat(e.trim())}const ra=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sa=new Set([...ra,"pathRotation"]),qb=e=>e===na||e===q,KD=new Set(["x","y","z"]),HD=ra.filter(e=>!KD.has(e));function GD(e){const t=[];return HD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ys={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})=>fg(t,"x"),y:(e,{transform:t})=>fg(t,"y")};ys.translateX=ys.x;ys.translateY=ys.y;const yi=new Set;let hg=!1,pg=!1,mg=!1;function gE(){if(pg){const e=Array.from(yi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=GD(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)})}pg=!1,hg=!1,yi.forEach(e=>e.complete(mg)),yi.clear()}function yE(){yi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pg=!0)})}function ZD(){mg=!0,yE(),gE(),mg=!1}class Tx{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?(yi.add(this),hg||(hg=!0,je.read(yE),je.resolveKeyframes(gE))):(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])}FD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yi.delete(this)}cancel(){this.state==="scheduled"&&(yi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qD=e=>e.startsWith("--");function xE(e,t,n){qD(t)?e.style.setProperty(t,n):e.style[t]=n}const YD={};function vE(e,t){const n=Hj(e);return()=>YD[t]??n()}const JD=vE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bE=vE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ha=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ha([0,.65,.55,1]),circOut:Ha([.55,0,1,.45]),backIn:Ha([.31,.01,.66,-.59]),backOut:Ha([.33,1.53,.69,.99])};function wE(e,t){if(e)return typeof e=="function"?bE()?hE(e,t):"ease-out":rE(e)?Ha(e):Array.isArray(e)?e.map(n=>wE(n,t)||Yb.easeOut):Yb[e]}function QD(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=wE(a,s);Array.isArray(f)&&(u.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function kE(e){return typeof e=="function"&&"applyToOptions"in e}function XD({type:e,...t}){return kE(e)&&bE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class _E extends Px{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,vx(typeof t.type!="string");const c=XD(t);this.animation=QD(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Mf(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),xE(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 Pn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Pn(t)}get time(){return Pn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=un(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&&JD()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),In):s(this)}}const SE={anticipate:Xj,backInOut:Qj,circInOut:tE};function eO(e){return e in SE}function tO(e){typeof e.ease=="string"&&eO(e.ease)&&(e.ease=SE[e.ease])}const up=10;class nO extends _E{constructor(t){tO(t),mE(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 Fd({...o,autoplay:!1}),l=Math.max(up,At.now()-this.startTime),c=xr(0,up,l-up),u=a.sample(l).value,{name:f}=this.options;i&&f&&xE(i,f,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Jb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Jn.test(e)||e==="0")&&!e.startsWith("url("));function rO(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 sO(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=Jb(s,t),a=Jb(i,t);return!o||!a?!1:rO(e)||(n==="spring"||kE(n))&&r}function gg(e){e.duration=0,e.type="keyframes"}const CE=new Set(["opacity","clipPath","filter","transform"]),iO=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function oO(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&iO.test(e[t]))return!0;return!1}const aO=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),lO=Hj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cO(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 lO()&&n&&(CE.has(n)||aO.has(n)&&oO(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const uO=40;class dO extends Px{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){var m;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=At.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:u,...f},p=(u==null?void 0:u.KeyframeResolver)||Tx;this.keyframeResolver=new p(a,(g,x,y)=>this.onKeyframesResolved(g,x,h,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,v;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=At.now();let f=!0;sO(t,i,o,a)||(f=!1,(Rs.instantAnimations||!l)&&(u==null||u(Mf(t,r,n))),t[0]=t[t.length-1],gg(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>uO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!c&&cO(p),g=(v=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:v.current;let x;if(m)try{x=new nO({...p,element:g})}catch{x=new Fd(p)}else x=new Fd(p);x.finished.then(()=>{this.notifyFinished()}).catch(In),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),ZD()),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 jE(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 Qb=30,fO=e=>!isNaN(parseFloat(e));class hO{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=At.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=At.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=fO(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 bx);const r=this.events[t].add(n);return t==="change"?()=>{r(),je.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=At.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Qb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Qb);return Gj(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 Ko(e,t){return new hO(e,t)}function EE(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Nx(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?EE(n,e):n}const pO={type:"spring",stiffness:500,damping:25,restSpeed:10},mO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),gO={type:"keyframes",duration:.8},yO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},xO=(e,{keyframes:t})=>t.length>2?gO:sa.has(e)?e.startsWith("scale")?mO(t[1]):pO:yO,vO=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function bO(e){for(const t in e)if(!vO.has(t))return!0;return!1}const Ix=(e,t,n,r={},s,i)=>o=>{const a=Nx(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-un(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};bO(a)||Object.assign(u,xO(e,u)),u.duration&&(u.duration=un(u.duration)),u.repeatDelay&&(u.repeatDelay=un(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gg(u),u.delay===0&&(f=!0)),(Rs.instantAnimations||Rs.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(f=!0,gg(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const h=Mf(u.keyframes,a);if(h!==void 0){je.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Fd(u):new dO(u)},wO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kO(e){const t=wO.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function PE(e,t,n=1){const[r,s]=kO(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Uj(o)?parseFloat(o):o}return _x(s)?PE(s,t,n+1):s}function Xb(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ax(e,t,n,r){if(typeof t=="function"){const[s,i]=Xb(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]=Xb(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function xi(e,t,n){const r=e.getProps();return Ax(r,t,n!==void 0?n:r.custom,e)}const TE=new Set(["width","height","top","left","right","bottom",...ra]),yg=e=>Array.isArray(e);function _O(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ko(n))}function SO(e){return yg(e)?e[e.length-1]||0:e}function CO(e,t){const n=xi(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=SO(i[o]);_O(e,o,a)}}const pt=e=>!!(e&&e.getVelocity);function jO(e){return!!(pt(e)&&e.add)}function xg(e,t){const n=e.getValue("willChange");if(jO(n))return n.add(t);if(!n&&Rs.WillChange){const r=new Rs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Rx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const EO="framerAppearId",NE="data-"+Rx(EO);function IE(e){return e.props[NE]}function PO({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function AE(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?EE(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,f);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),x=a[m];if(x===void 0||h&&PO(h,m))continue;const y={delay:n,...Nx(i||{},m)};u&&(y.skipAnimations=!0);const v=g.get();if(v!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===v&&!y.velocity){je.update(()=>g.set(x));continue}let b=!1;if(window.MotionHandoffAnimation){const S=IE(e);if(S){const j=window.MotionHandoffAnimation(S,m,je);j!==null&&(y.startTime=j,b=!0)}}xg(e,m);const w=c??e.shouldReduceMotion;g.start(Ix(m,g,x,w&&TE.has(m)?{type:!1}:y,e,b));const _=g.animation;_&&f.push(_)}if(o){const m=()=>je.update(()=>{o&&CO(e,o)});f.length?Promise.all(f).then(m):m()}return f}function vg(e,t,n={}){var l;const r=xi(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(AE(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return TO(e,t,c,u,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function TO(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(vg(l,t,{...o,delay:n+(typeof r=="function"?0:r)+jE(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function NO(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>vg(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=vg(e,t,n);else{const s=typeof t=="function"?xi(e,t,n.custom):t;r=Promise.all(AE(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const IO={test:e=>e==="auto",parse:e=>e},RE=e=>t=>t.test(e),LE=[na,q,yr,Pr,rD,nD,IO],ew=e=>LE.find(RE(e));function AO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Kj(e):!0}const RO=new Set(["brightness","contrast","saturate","opacity"]);function LO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Sx)||[];if(!r)return e;const s=n.replace(r,"");let i=RO.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const MO=/\b([a-z-]*)\(.*?\)/gu,bg={...Jn,getAnimatableNone:e=>{const t=e.match(MO);return t?t.map(LO).join(" "):e}},wg={...Jn,getAnimatableNone:e=>{const t=Jn.parse(e);return Jn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},tw={...na,transform:Math.round},$O={rotate:Pr,pathRotation:Pr,rotateX:Pr,rotateY:Pr,rotateZ:Pr,scale:Xc,scaleX:Xc,scaleY:Xc,scaleZ:Xc,skew:Pr,skewX:Pr,skewY:Pr,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:zl,originX:Bb,originY:Bb,originZ:q},Bd={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,...$O,zIndex:tw,fillOpacity:zl,strokeOpacity:zl,numOctaves:tw},DO={...Bd,color:tt,backgroundColor:tt,outlineColor:tt,fill:tt,stroke:tt,borderColor:tt,borderTopColor:tt,borderRightColor:tt,borderBottomColor:tt,borderLeftColor:tt,filter:bg,WebkitFilter:bg,mask:wg,WebkitMask:wg},ME=e=>DO[e],OO=new Set([bg,wg]);function $E(e,t){let n=ME(e);return OO.has(n)||(n=Jn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const zO=new Set(["auto","none","0"]);function FO(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!zO.has(i)&&Wo(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=$E(n,s)}class BO extends Tx{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(),_x(f))){const h=PE(f,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!TE.has(r)||t.length!==2)return;const[s,i]=t,o=ew(s),a=ew(i),l=Fb(s),c=Fb(i);if(l!==c&&ys[r]){this.needsMeasurement=!0;return}if(o!==a)if(qb(o)&&qb(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else ys[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||AO(t[s]))&&r.push(s);r.length&&FO(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=ys[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]=ys[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 DE(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 kg=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uu(e){return Wj(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Lx}=sE(queueMicrotask,!1),Kn={x:!1,y:!1};function OE(){return Kn.x||Kn.y}function VO(e){return e==="x"||e==="y"?Kn[e]?null:(Kn[e]=!0,()=>{Kn[e]=!1}):Kn.x||Kn.y?null:(Kn.x=Kn.y=!0,()=>{Kn.x=Kn.y=!1})}function zE(e,t){const n=DE(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function UO(e){return!(e.pointerType==="touch"||OE())}function WO(e,t,n={}){const[r,s,i]=zE(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},f=x=>{c&&(c(x),c=void 0),u()},h=x=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(x))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=x=>{if(x.pointerType!=="touch"){if(a){l=!0;return}f(x)}},g=x=>{if(!UO(x))return;l=!1;const y=t(o,x);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const FE=(e,t)=>t?e===t?!0:FE(e,t.parentElement):!1,Mx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,KO=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HO(e){return KO.has(e.tagName)||e.isContentEditable===!0}const GO=new Set(["INPUT","SELECT","TEXTAREA"]);function ZO(e){return GO.has(e.tagName)||e.isContentEditable===!0}const Wu=new WeakSet;function nw(e){return t=>{t.key==="Enter"&&e(t)}}function dp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qO=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=nw(()=>{if(Wu.has(n))return;dp(n,"down");const s=nw(()=>{dp(n,"up")}),i=()=>dp(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 rw(e){return Mx(e)&&!OE()}const sw=new WeakSet;function YO(e,t,n={}){const[r,s,i]=zE(e,n),o=a=>{const l=a.currentTarget;if(!rw(a)||sw.has(a))return;Wu.add(l),n.stopPropagation&&sw.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Wu.has(l)&&Wu.delete(l),rw(p)&&typeof c=="function"&&c(p,{success:m})},f=p=>{u(p,l===window||l===document||n.useGlobalTarget||FE(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Uu(a)&&(a.addEventListener("focus",c=>qO(c,s)),!HO(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function $x(e){return Wj(e)&&"ownerSVGElement"in e}const Ku=new WeakMap;let rs;const BE=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:$x(r)&&"getBBox"in r?r.getBBox()[t]:r[n],JO=BE("inline","width","offsetWidth"),QO=BE("block","height","offsetHeight");function XO({target:e,borderBoxSize:t}){var n;(n=Ku.get(e))==null||n.forEach(r=>{r(e,{get width(){return JO(e,t)},get height(){return QO(e,t)}})})}function ez(e){e.forEach(XO)}function tz(){typeof ResizeObserver>"u"||(rs=new ResizeObserver(ez))}function nz(e,t){rs||tz();const n=DE(e);return n.forEach(r=>{let s=Ku.get(r);s||(s=new Set,Ku.set(r,s)),s.add(t),rs==null||rs.observe(r)}),()=>{n.forEach(r=>{const s=Ku.get(r);s==null||s.delete(t),s!=null&&s.size||rs==null||rs.unobserve(r)})}}const Hu=new Set;let ho;function rz(){ho=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hu.forEach(t=>t(e))},window.addEventListener("resize",ho)}function sz(e){return Hu.add(e),ho||rz(),()=>{Hu.delete(e),!Hu.size&&typeof ho=="function"&&(window.removeEventListener("resize",ho),ho=void 0)}}function iw(e,t){return typeof e=="function"?sz(e):nz(e,t)}function iz(e){return $x(e)&&e.tagName==="svg"}const oz=[...LE,tt,Jn],az=e=>oz.find(RE(e)),ow=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:ow(),y:ow()}),aw=()=>({min:0,max:0}),it=()=>({x:aw(),y:aw()}),lz=new WeakMap;function $f(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fl(e){return typeof e=="string"||Array.isArray(e)}const Dx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ox=["initial",...Dx];function Df(e){return $f(e.animate)||Ox.some(t=>Fl(e[t]))}function VE(e){return!!(Df(e)||e.variants)}function cz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(pt(s))e.addValue(r,s);else if(pt(i))e.addValue(r,Ko(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,Ko(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vd={current:null},zx={current:!1},uz=typeof window<"u";function UE(){if(zx.current=!0,!!uz)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Vd.current=e.matches;e.addEventListener("change",t),t()}else Vd.current=!1}const lw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ud={};function WE(e){Ud=e}function dz(){return Ud}class fz{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=Tx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=At.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,je.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=Df(n),this.isVariantNode=VE(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&pt(m)&&m.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,lz.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:(zx.current||UE(),this.shouldReduceMotion=Vd.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(),Ls(this.notifyUpdate),Ls(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&&CE.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,f=new _E({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:un(u)}),h=o(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=sa.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&je.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 Ud){const n=Ud[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):it()}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<lw.length;r++){const s=lw[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=cz(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ko(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"&&(Uj(r)||Kj(r))?r=parseFloat(r):!az(r)&&Jn.test(n)&&(r=$E(t,n)),this.setBaseTarget(t,pt(r)?r.get():r)),pt(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=Ax(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&&!pt(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 bx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Lx.render(this.render)}}class KE extends fz{constructor(){super(...arguments),this.KeyframeResolver=BO}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;pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class zs{constructor(t){this.isMounted=!1,this.node=t}update(){}}function HE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function hz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pz(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 fp(e){return e===void 0||e===1}function _g({scale:e,scaleX:t,scaleY:n}){return!fp(e)||!fp(t)||!fp(n)}function ti(e){return _g(e)||GE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function GE(e){return cw(e.x)||cw(e.y)}function cw(e){return e&&e!=="0%"}function Wd(e,t,n){const r=e-n,s=t*r;return n+s}function uw(e,t,n,r,s){return s!==void 0&&(e=Wd(e,s,r)),Wd(e,n,r)+t}function Sg(e,t=0,n=1,r,s){e.min=uw(e.min,t,n,r,s),e.max=uw(e.max,t,n,r,s)}function ZE(e,{x:t,y:n}){Sg(e.x,t.translate,t.scale,t.originPoint),Sg(e.y,n.translate,n.scale,n.originPoint)}const dw=.999999999999,fw=1.0000000000001;function mz(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&&(fr(e.x,-i.scroll.offset.x),fr(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ZE(e,o)),r&&ti(i.latestValues)&&Gu(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<fw&&t.x>dw&&(t.x=1),t.y<fw&&t.y>dw&&(t.y=1)}function fr(e,t){e.min+=t,e.max+=t}function hw(e,t,n,r,s=.5){const i=Ce(e.min,e.max,s);Sg(e,t,n,i,r)}function pw(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Gu(e,t,n){const r=n??e;hw(e.x,pw(t.x,r.x),t.scaleX,t.scale,t.originX),hw(e.y,pw(t.y,r.y),t.scaleY,t.scale,t.originY)}function qE(e,t){return HE(pz(e.getBoundingClientRect(),t))}function gz(e,t,n){const r=qE(e,n),{scroll:s}=t;return s&&(fr(r.x,s.offset.x),fr(r.y,s.offset.y)),r}const yz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xz=ra.length;function vz(e,t,n){let r="",s=!0;for(let o=0;o<xz;o++){const a=ra[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=kg(l,Bd[a]);if(!c){s=!1;const f=yz[a]||a;r+=`${f}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${kg(i,Bd.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Fx(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(sa.has(l)){o=!0;continue}else if(oE(l)){s[l]=c;continue}else{const u=kg(c,Bd[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=vz(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 YE(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 mw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $a={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=mw(e,t.target.x),r=mw(e,t.target.y);return`${n}% ${r}%`}},bz={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Jn.parse(e);if(s.length>5)return r;const i=Jn.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=Ce(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Cg={borderRadius:{...$a,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$a,borderTopRightRadius:$a,borderBottomLeftRadius:$a,borderBottomRightRadius:$a,boxShadow:bz};function JE(e,{layout:t,layoutId:n}){return sa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cg[e]||e==="opacity")}function Bx(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)(pt(r[a])||s&&pt(s[a])||JE(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function wz(e){return window.getComputedStyle(e)}class kz extends KE{constructor(){super(...arguments),this.type="html",this.renderInstance=YE}readValueFromInstance(t,n){var r;if(sa.has(n))return(r=this.projection)!=null&&r.isProjecting?dg(n):UD(t,n);{const s=wz(t),i=(oE(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return qE(t,n)}build(t,n,r){Fx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Bx(t,n,r)}}const _z={offset:"stroke-dashoffset",array:"stroke-dasharray"},Sz={offset:"strokeDashoffset",array:"strokeDasharray"};function Cz(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?_z:Sz;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const jz=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function QE(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Fx(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const p of jz)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Cz(f,s,i,o,!1)}const XE=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"]),eP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ez(e,t,n,r){YE(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(XE.has(s)?s:Rx(s),t.attrs[s])}function tP(e,t,n){const r=Bx(e,t,n);for(const s in e)if(pt(e[s])||pt(t[s])){const i=ra.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class Pz extends KE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(sa.has(n)){const r=ME(n);return r&&r.default||0}return n=XE.has(n)?n:Rx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return tP(t,n,r)}build(t,n,r){QE(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Ez(t,n,r,s)}mount(t){this.isSVGTag=eP(t.tagName),super.mount(t)}}const Tz=Ox.length;function nP(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?nP(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Tz;n++){const r=Ox[n],s=e.props[r];(Fl(s)||s===!1)&&(t[r]=s)}return t}function rP(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 Nz=[...Dx].reverse(),Iz=Dx.length;function Az(e){return t=>Promise.all(t.map(({animation:n,options:r})=>NO(e,n,r)))}function Rz(e){let t=Az(e),n=gw(),r=!0,s=!1;const i=c=>(u,f)=>{var p;const h=xi(e,f,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...x}=h;u={...u,...x,...g}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,f=nP(e.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let y=0;y<Iz;y++){const v=Nz[y],b=n[v],w=u[v]!==void 0?u[v]:f[v],_=Fl(w),S=v===c?b.isActive:null;S===!1&&(g=y);let j=w===f[v]&&w!==u[v]&&_;if(j&&(r||s)&&e.manuallyAnimateOnMount&&(j=!1),b.protectedKeys={...m},!b.isActive&&S===null||!w&&!b.prevProp||$f(w)||typeof w=="boolean")continue;if(v==="exit"&&b.isActive&&S!==!0){b.prevResolvedValues&&(m={...m,...b.prevResolvedValues});continue}const E=Lz(b.prevProp,w);let T=E||v===c&&b.isActive&&!j&&_||y>g&&_,P=!1;const N=Array.isArray(w)?w:[w];let R=N.reduce(i(v),{});S===!1&&(R={});const{prevResolvedValues:L={}}=b,I={...L,...R},z=O=>{T=!0,p.has(O)&&(P=!0,p.delete(O)),b.needsAnimating[O]=!0;const V=e.getValue(O);V&&(V.liveStyle=!1)};for(const O in I){const V=R[O],C=L[O];if(m.hasOwnProperty(O))continue;let U=!1;yg(V)&&yg(C)?U=!rP(V,C)||E:U=V!==C,U?V!=null?z(O):p.add(O):V!==void 0&&p.has(O)?z(O):b.protectedKeys[O]=!0}b.prevProp=w,b.prevResolvedValues=R,b.isActive&&(m={...m,...R}),(r||s)&&e.blockInitialAnimation&&(T=!1);const $=j&&E;T&&(!$||P)&&h.push(...N.map(O=>{const V={type:v};if(typeof O=="string"&&(r||s)&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,U=xi(C,O);if(C.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};V.delay=jE(C.enteringChildren,e,Q)}}return{animation:O,options:V}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const v=xi(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(y.transition=v.transition)}p.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),y[v]=b??null}),h.push({animation:y})}let x=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?t(h):Promise.resolve()}function l(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=gw(),s=!0}}}function Lz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rP(t,e):!1}function Gs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gw(){return{animate:Gs(!0),whileInView:Gs(),whileHover:Gs(),whileTap:Gs(),whileDrag:Gs(),whileFocus:Gs(),exit:Gs()}}function jg(e,t){e.min=t.min,e.max=t.max}function Fn(e,t){jg(e.x,t.x),jg(e.y,t.y)}function yw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const sP=1e-4,Mz=1-sP,$z=1+sP,iP=.01,Dz=0-iP,Oz=0+iP;function Rt(e){return e.max-e.min}function zz(e,t,n){return Math.abs(e-t)<=n}function xw(e,t,n,r=.5){e.origin=r,e.originPoint=Ce(t.min,t.max,e.origin),e.scale=Rt(n)/Rt(t),e.translate=Ce(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Mz&&e.scale<=$z||isNaN(e.scale))&&(e.scale=1),(e.translate>=Dz&&e.translate<=Oz||isNaN(e.translate))&&(e.translate=0)}function al(e,t,n,r){xw(e.x,t.x,n.x,r?r.originX:void 0),xw(e.y,t.y,n.y,r?r.originY:void 0)}function vw(e,t,n,r=0){const s=r?Ce(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+Rt(t)}function Fz(e,t,n,r){vw(e.x,t.x,n.x,r==null?void 0:r.x),vw(e.y,t.y,n.y,r==null?void 0:r.y)}function bw(e,t,n,r=0){const s=r?Ce(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+Rt(t)}function Kd(e,t,n,r){bw(e.x,t.x,n.x,r==null?void 0:r.x),bw(e.y,t.y,n.y,r==null?void 0:r.y)}function ww(e,t,n,r,s){return e-=t,e=Wd(e,1/n,r),s!==void 0&&(e=Wd(e,1/s,r)),e}function Bz(e,t=0,n=1,r=.5,s,i=e,o=e){if(yr.test(t)&&(t=parseFloat(t),t=Ce(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ce(i.min,i.max,r);e===i&&(a-=t),e.min=ww(e.min,t,n,a,s),e.max=ww(e.max,t,n,a,s)}function kw(e,t,[n,r,s],i,o){Bz(e,t[n],t[r],t[s],t.scale,i,o)}const Vz=["x","scaleX","originX"],Uz=["y","scaleY","originY"];function _w(e,t,n,r){kw(e.x,t,Vz,n?n.x:void 0,r?r.x:void 0),kw(e.y,t,Uz,n?n.y:void 0,r?r.y:void 0)}function Sw(e){return e.translate===0&&e.scale===1}function oP(e){return Sw(e.x)&&Sw(e.y)}function Cw(e,t){return e.min===t.min&&e.max===t.max}function Wz(e,t){return Cw(e.x,t.x)&&Cw(e.y,t.y)}function jw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aP(e,t){return jw(e.x,t.x)&&jw(e.y,t.y)}function Ew(e){return Rt(e.x)/Rt(e.y)}function Pw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lr(e){return[e("x"),e("y")]}function Kz(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,pathRotation:f,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const lP=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Hz=lP.length,Tw=e=>typeof e=="string"?parseFloat(e):e,Nw=e=>typeof e=="number"||q.test(e);function Gz(e,t,n,r,s,i){s?(e.opacity=Ce(0,n.opacity??1,Zz(r)),e.opacityExit=Ce(t.opacity??1,0,qz(r))):i&&(e.opacity=Ce(t.opacity??1,n.opacity??1,r));for(let o=0;o<Hz;o++){const a=lP[o];let l=Iw(t,a),c=Iw(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Nw(l)===Nw(c)?(e[a]=Math.max(Ce(Tw(l),Tw(c),r),0),(yr.test(c)||yr.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ce(t.rotate||0,n.rotate||0,r))}function Iw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Zz=cP(0,.5,eE),qz=cP(.5,.95,In);function cP(e,t,n){return r=>r<e?0:r>t?1:n(Ol(e,t,r))}function Yz(e,t,n){const r=pt(e)?e:Ko(e);return r.start(Ix("",r,t,n)),r.animation}function Bl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Jz=(e,t)=>e.depth-t.depth;class Qz{constructor(){this.children=[],this.isDirty=!1}add(t){xx(this.children,t),this.isDirty=!0}remove(t){$d(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Jz),this.isDirty=!1,this.children.forEach(t)}}function Xz(e,t){const n=At.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ls(r),e(i-t))};return je.setup(r,!0),()=>Ls(r)}function Zu(e){return pt(e)?e.get():e}class eF{constructor(){this.members=[]}add(t){xx(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&&($d(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if($d(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 qu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},hp=["","X","Y","Z"],tF=1e3;let nF=0;function pp(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uP(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=IE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",je,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uP(r)}function dP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=nF++,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(iF),this.nodes.forEach(dF),this.nodes.forEach(fF),this.nodes.forEach(oF)},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 Qz)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new bx),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=$x(o)&&!iz(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const h=()=>this.root.updateBlockedByResize=!1;je.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=Xz(h,250),qu.hasAnimatedSinceResize&&(qu.hasAnimatedSinceResize=!1,this.nodes.forEach(Lw)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||yF,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!aP(this.targetLayout,p),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...Nx(m,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(u,v,b.path)}else f||Lw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ls(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(hF),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&&uP(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(lF),this.nodes.forEach(Aw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(cF),this.nodes.forEach(uF),this.nodes.forEach(rF),this.nodes.forEach(sF)):this.nodes.forEach(Rw),this.clearAllSnapshots();const a=At.now();ht.delta=xr(0,1e3/60,a-ht.timestamp),ht.timestamp=a,ht.isProcessing=!0,ip.update.process(ht),ip.preRender.process(ht),ip.render.process(ht),ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Lx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(aF),this.sharedNodes.forEach(pF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Rt(this.snapshot.measuredBox.x)&&!Rt(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=it()),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&&!oP(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ti(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)),xF(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return it();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(vF))){const{scroll:u}=this.root;u&&(fr(a.x,u.offset.x),fr(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=it();if(Fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Fn(a,o),fr(a.x,f.offset.x),fr(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var u,f;const c=l||it();Fn(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(fr(c.x,-p.scroll.offset.x),fr(c.y,-p.scroll.offset.y)),ti(p.latestValues)&&Gu(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return ti(this.latestValues)&&Gu(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=it();Fn(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ti(u.latestValues))continue;let f;u.instance&&(_g(u.latestValues)&&u.updateSnapshot(),f=it(),Fn(f,u.measurePageBox())),_w(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,f)}return ti(this.latestValues)&&_w(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!==ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ht.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Fz(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Fn(this.target,this.layout.layoutBox),ZE(this.target,this.targetDelta)):Fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_g(this.parent.latestValues)||GE(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=it(),this.relativeTargetOrigin=it(),Kd(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),Fn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ht.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;Fn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;mz(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=it());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yw(this.prevProjectionDelta.x,this.projectionDelta.x),yw(this.prevProjectionDelta.y,this.projectionDelta.y)),al(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Pw(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},f={...this.latestValues},h=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=it(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=m!==g,y=this.getStack(),v=!y||y.members.length<=1,b=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(gF));this.animationProgress=0;let w;const _=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=S=>{const j=S/1e3,E=_==null?void 0:_(j);E?(h.x.translate=E.x,h.x.scale=Ce(o.x.scale,1,j),h.x.origin=o.x.origin,h.x.originPoint=o.x.originPoint,h.y.translate=E.y,h.y.scale=Ce(o.y.scale,1,j),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(Mw(h.x,o.x,j),Mw(h.y,o.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),mF(this.relativeTarget,this.relativeTargetOrigin,p,j),w&&Wz(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=it()),Fn(w,this.relativeTarget)),x&&(this.animationValues=f,Gz(f,u,this.latestValues,j,b,v)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=E.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},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&&(Ls(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=je.update(()=>{qu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ko(0)),this.motionValue.jump(0,!1),this.currentAnimation=Yz(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(tF),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&&fP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||it();const f=Rt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Rt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Fn(a,l),Gu(a,u),al(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new eF),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&&pp("z",o,c,this.animationValues);for(let u=0;u<hp.length;u++)pp(`rotate${hp[u]}`,o,c,this.animationValues),pp(`skew${hp[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=Zu(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=Zu(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ti(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Kz(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),o.transform=f;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Cg){if(u[m]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:y}=Cg[m],v=f==="none"?u[m]:g(u[m],c);if(x){const b=x.length;for(let w=0;w<b;w++)o[x[w]]=v}else y?this.options.visualElement.renderState.vars[m]=v:o[m]=v}this.options.layoutId&&(o.pointerEvents=c===this?Zu(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(Aw),this.root.sharedNodes.clear()}}}function rF(e){e.updateLayout()}function sF(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")lr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";jg(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else fP(i,t.layoutBox,r)&&lr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=po();al(a,r,t.layoutBox);const l=po();o?al(l,e.applyTransform(s,!0),t.measuredBox):al(l,r,t.layoutBox);const c=!oP(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=e.options.layoutAnchor||void 0,g=it();Kd(g,t.layoutBox,h.layoutBox,m);const x=it();Kd(x,r,p.layoutBox,m),aP(g,x)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function iF(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 oF(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function aF(e){e.clearSnapshot()}function Aw(e){e.clearMeasurements()}function lF(e){e.isLayoutDirty=!0,e.updateLayout()}function Rw(e){e.isLayoutDirty=!1}function cF(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function uF(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Lw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function dF(e){e.resolveTargetDelta()}function fF(e){e.calcProjection()}function hF(e){e.resetSkewAndRotation()}function pF(e){e.removeLeadSnapshot()}function Mw(e,t,n){e.translate=Ce(t.translate,0,n),e.scale=Ce(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $w(e,t,n,r){e.min=Ce(t.min,n.min,r),e.max=Ce(t.max,n.max,r)}function mF(e,t,n,r){$w(e.x,t.x,n.x,r),$w(e.y,t.y,n.y,r)}function gF(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const yF={duration:.45,ease:[.4,0,.1,1]},Dw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ow=Dw("applewebkit/")&&!Dw("chrome/")?Math.round:In;function zw(e){e.min=Ow(e.min),e.max=Ow(e.max)}function xF(e){zw(e.x),zw(e.y)}function fP(e,t,n){return e==="position"||e==="preserve-aspect"&&!zz(Ew(t),Ew(n),.2)}function vF(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const bF=dP({attachResizeListener:(e,t)=>Bl(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}),mp={current:void 0},hP=dP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!mp.current){const e=new bF({});e.mount(window),e.setOptions({layoutScroll:!0}),mp.current=e}return mp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vx=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Fw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wF(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Fw(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():Fw(e[s],null)}}}}function kF(...e){return k.useCallback(wF(...e),e)}class _F extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Uu(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Uu(r)&&r.offsetWidth||0,i=Uu(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 SF({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=k.useId(),a=k.useRef(null),l=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=k.useContext(Vx),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=kF(a,u);return k.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:x,right:y,bottom:v,direction:b}=l.current;if(t||i===!1||!a.current||!p||!m)return;const w=b==="rtl",_=n==="left"?w?`right: ${y}`:`left: ${x}`:w?`left: ${x}`:`right: ${y}`,S=r==="bottom"?`bottom: ${v}`:`top: ${g}`;a.current.dataset.motionPopId=o;const j=document.createElement("style");c&&(j.nonce=c);const E=s??document.head;return E.appendChild(j),j.sheet&&j.sheet.insertRule(`
|
|
58
|
+
[data-motion-pop-id="${o}"] {
|
|
59
|
+
position: absolute !important;
|
|
60
|
+
width: ${p}px !important;
|
|
61
|
+
height: ${m}px !important;
|
|
62
|
+
${_}px !important;
|
|
63
|
+
${S}px !important;
|
|
64
|
+
}
|
|
65
|
+
`),()=>{var T;(T=a.current)==null||T.removeAttribute("data-motion-pop-id"),E.contains(j)&&E.removeChild(j)}},[t]),d.jsx(_F,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:k.cloneElement(e,{ref:f})})}const CF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=yx(jF),f=k.useId();let h=!0,p=k.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),k.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),k.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=d.jsx(SF,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),d.jsx(Lf.Provider,{value:p,children:e})};function jF(){return new Map}function pP(e=!0){const t=k.useContext(Lf);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=k.useId();k.useEffect(()=>{if(e)return s(i)},[e]);const o=k.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const eu=e=>e.key||"";function Bw(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const EF=({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]=pP(o),h=k.useMemo(()=>Bw(e),[e]),p=o&&!u?[]:h.map(eu),m=k.useRef(!0),g=k.useRef(h),x=yx(()=>new Map),y=k.useRef(new Set),[v,b]=k.useState(h),[w,_]=k.useState(h);Vj(()=>{m.current=!1,g.current=h;for(let E=0;E<w.length;E++){const T=eu(w[E]);p.includes(T)?(x.delete(T),y.current.delete(T)):x.get(T)!==!0&&x.set(T,!1)}},[w,p.length,p.join("-")]);const S=[];if(h!==v){let E=[...h];for(let T=0;T<w.length;T++){const P=w[T],N=eu(P);p.includes(N)||(E.splice(T,0,P),S.push(P))}return i==="wait"&&S.length&&(E=S),_(Bw(E)),b(h),null}const{forceRender:j}=k.useContext(gx);return d.jsx(d.Fragment,{children:w.map(E=>{const T=eu(E),P=o&&!u?!1:h===w||p.includes(T),N=()=>{if(y.current.has(T))return;if(x.has(T))y.current.add(T),x.set(T,!0);else return;let R=!0;x.forEach(L=>{L||(R=!1)}),R&&(j==null||j(),_(g.current),o&&(f==null||f()),r&&r())};return d.jsx(CF,{isPresent:P,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:P?void 0:N,anchorX:a,anchorY:l,children:E},T)})})},mP=k.createContext({strict:!1}),Vw={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 Uw=!1;function PF(){if(Uw)return;const e={};for(const t in Vw)e[t]={isEnabled:n=>Vw[t].some(r=>!!n[r])};WE(e),Uw=!0}function gP(){return PF(),dz()}function TF(e){const t=gP();for(const n in e)t[n]={...t[n],...e[n]};WE(t)}const NF=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 Hd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||NF.has(e)}let yP=e=>!Hd(e);function IF(e){typeof e=="function"&&(yP=t=>t.startsWith("on")?!Hd(t):e(t))}try{IF(require("@emotion/is-prop-valid").default)}catch{}function AF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||pt(e[s])||(yP(s)||n===!0&&Hd(s)||!t&&!Hd(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Of=k.createContext({});function RF(e,t){if(Df(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fl(n)?n:void 0,animate:Fl(r)?r:void 0}}return e.inherit!==!1?t:{}}function LF(e){const{initial:t,animate:n}=RF(e,k.useContext(Of));return k.useMemo(()=>({initial:t,animate:n}),[Ww(t),Ww(n)])}function Ww(e){return Array.isArray(e)?e.join(" "):e}const Ux=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xP(e,t,n){for(const r in t)!pt(t[r])&&!JE(r,n)&&(e[r]=t[r])}function MF({transformTemplate:e},t){return k.useMemo(()=>{const n=Ux();return Fx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $F(e,t){const n=e.style||{},r={};return xP(r,n,e),Object.assign(r,MF(e,t)),r}function DF(e,t){const n={},r=$F(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 vP=()=>({...Ux(),attrs:{}});function OF(e,t,n,r){const s=k.useMemo(()=>{const i=vP();return QE(i,t,eP(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};xP(i,e.style,e),s.style={...i,...s.style}}return s}const zF=["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 Wx(e){return typeof e!="string"||e.includes("-")?!1:!!(zF.indexOf(e)>-1||/[A-Z]/u.test(e))}function FF(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Wx(e)?OF:DF)(t,r,s,e),c=AF(t,typeof e=="string",i),u=e!==k.Fragment?{...c,...l,ref:n}:{},{children:f}=t,h=k.useMemo(()=>pt(f)?f.get():f,[f]);return k.createElement(e,{...u,children:h})}function BF({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:VF(n,r,s,e),renderState:t()}}function VF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Zu(i[h]);let{initial:o,animate:a}=e;const l=Df(e),c=VE(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"&&!$f(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=Ax(e,h[p]);if(m){const{transitionEnd:g,transition:x,...y}=m;for(const v in y){let b=y[v];if(Array.isArray(b)){const w=u?b.length-1:0;b=b[w]}b!==null&&(s[v]=b)}for(const v in g)s[v]=g[v]}}}return s}const bP=e=>(t,n)=>{const r=k.useContext(Of),s=k.useContext(Lf),i=()=>BF(e,t,r,s);return n?i():yx(i)},UF=bP({scrapeMotionValuesFromProps:Bx,createRenderState:Ux}),WF=bP({scrapeMotionValuesFromProps:tP,createRenderState:vP}),KF=Symbol.for("motionComponentSymbol");function HF(e,t,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const s=k.useRef(null);return k.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 wP=k.createContext({});function Yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function GF(e,t,n,r,s,i){var b,w;const{visualElement:o}=k.useContext(Of),a=k.useContext(mP),l=k.useContext(Lf),c=k.useContext(Vx),u=c.reducedMotion,f=c.skipAnimations,h=k.useRef(null),p=k.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=k.useContext(wP);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&ZF(h.current,n,s,g);const x=k.useRef(!1);k.useInsertionEffect(()=>{m&&x.current&&m.update(n,l)});const y=n[NE],v=k.useRef(!!y&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,y))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,y)));return Vj(()=>{p.current=!0,m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),k.useEffect(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)==null||_.call(window,y)}),v.current=!1),m.enteringChildren=void 0)}),m}function ZF(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:kP(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function kP(e){if(e)return e.options.allowProjection!==!1?e.projection:kP(e.parent)}function gp(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&TF(r);const i=n?n==="svg":Wx(e),o=i?WF:UF;function a(c,u){let f;const h={...k.useContext(Vx),...c,layoutId:qF(c)},{isStatic:p}=h,m=LF(c),g=o(c,p);if(!p&&typeof window<"u"){YF();const x=JF(h);f=x.MeasureLayout,m.visualElement=GF(e,g,h,s,x.ProjectionNode,i)}return d.jsxs(Of.Provider,{value:m,children:[f&&m.visualElement?d.jsx(f,{visualElement:m.visualElement,...h}):null,FF(e,c,HF(g,m.visualElement,u),g,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=k.forwardRef(a);return l[KF]=e,l}function qF({layoutId:e}){const t=k.useContext(gx).id;return t&&e!==void 0?t+"-"+e:e}function YF(e,t){k.useContext(mP).strict}function JF(e){const t=gP(),{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 QF(e,t){if(typeof Proxy>"u")return gp;const n=new Map,r=(i,o)=>gp(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,gp(o,void 0,e,t)),n.get(o))})}const XF=(e,t)=>t.isSVG??Wx(e)?new Pz(t):new kz(t,{allowProjection:e!==k.Fragment});class e3 extends zs{constructor(t){super(t),t.animationState||(t.animationState=Rz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$f(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 t3=0;class n3 extends zs{constructor(){super(...arguments),this.id=t3++,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=xi(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const r3={animation:{Feature:e3},exit:{Feature:n3}};function ic(e){return{point:{x:e.pageX,y:e.pageY}}}const s3=e=>t=>Mx(t)&&e(t,ic(t));function ll(e,t,n,r){return Bl(e,t,s3(n),r)}const _P=({current:e})=>e?e.ownerDocument.defaultView:null,Kw=(e,t)=>Math.abs(e-t);function i3(e,t){const n=Kw(e.x,t.x),r=Kw(e.y,t.y);return Math.sqrt(n**2+r**2)}const Hw=new Set(["auto","scroll"]);class SP{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=tu(this.lastRawMoveEventInfo,this.transformPagePoint));const p=yp(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=i3(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:x}=p,{timestamp:y}=ht;this.history.push({...x,timestamp:y});const{onStart:v,onMove:b}=this.handlers;m||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=tu(m,this.transformPagePoint),je.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:x,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=yp(p.type==="pointercancel"?this.lastMoveEventInfo:tu(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),x&&x(p,v)},!Mx(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=ic(t),c=tu(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=ht;this.history=[{...u,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,yp(c,this.history)),this.removeListeners=nc(ll(this.contextWindow,"pointermove",this.handlePointerMove),ll(this.contextWindow,"pointerup",this.handlePointerUp),ll(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Hw.has(r.overflowX)||Hw.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),je.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ls(this.updatePoint)}}function tu(e,t){return t?{point:t(e.point)}:e}function Gw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yp({point:e},t){return{point:e,delta:Gw(e,CP(t)),offset:Gw(e,o3(t)),velocity:a3(t,.1)}}function o3(e){return e[0]}function CP(e){return e[e.length-1]}function a3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=CP(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>un(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>un(t)*2&&(r=e[1]);const i=Pn(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 l3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ce(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ce(n,e,r.max):Math.min(e,n)),e}function Zw(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 c3(e,{top:t,left:n,bottom:r,right:s}){return{x:Zw(e.x,n,s),y:Zw(e.y,t,r)}}function qw(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 u3(e,t){return{x:qw(e.x,t.x),y:qw(e.y,t.y)}}function d3(e,t){let n=.5;const r=Rt(e),s=Rt(t);return s>r?n=Ol(t.min,t.max-r,e.min):r>s&&(n=Ol(e.min,e.max-s,t.min)),xr(0,1,n)}function f3(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 Eg=.35;function h3(e=Eg){return e===!1?e=0:e===!0&&(e=Eg),{x:Yw(e,"left","right"),y:Yw(e,"top","bottom")}}function Yw(e,t,n){return{min:Jw(e,t),max:Jw(e,n)}}function Jw(e,t){return typeof e=="number"?e:e[t]||0}const p3=new WeakMap;class m3{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=it(),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(ic(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VO(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lr(y=>{let v=this.getAxisMotionValue(y).get()||0;if(yr.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[y];w&&(v=Rt(w)*(parseFloat(v)/100))}}this.originPoint[y]=v}),g&&je.update(()=>g(f,h),!1,!0),xg(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=y3(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),x&&je.update(()=>x(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new SP(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:_P(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&&je.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||!nu(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=l3(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&&Yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=c3(r.layoutBox,t):this.constraints=!1,this.elastic=h3(n),s!==this.constraints&&!Yi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&lr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=f3(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Yi(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=gz(r,s.root,this.visualElement.getTransformPagePoint());let o=u3(s.layout.layoutBox,i);if(n){const a=n(hz(o));this.hasMutatedConstraints=!!a,a&&(o=HE(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=lr(u=>{if(!nu(u,n,this.currentDirection))return;let f=l&&l[u]||{};(o===!0||o===u)&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xg(this.visualElement,t),r.start(Ix(t,r,0,n,this.visualElement,!1))}stopAnimation(){lr(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){lr(n=>{const{drag:r}=this.getProps();if(!nu(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]-Ce(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Yi(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};lr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=d3({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(),lr(o=>{if(!nu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ce(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;p3.set(this.visualElement,this);const t=this.visualElement.current,n=ll(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&ZO(h);u&&f&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Yi(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=g3(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),je.read(s);const a=Bl(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(lr(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Eg,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Qw(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function g3(e,t,n){const r=iw(e,Qw(n)),s=iw(t,Qw(n));return()=>{r(),s()}}function nu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function y3(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class x3 extends zs{constructor(t){super(t),this.removeGroupControls=In,this.removeListeners=In,this.controls=new m3(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||In}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 xp=e=>(t,n)=>{e&&je.update(()=>e(t,n),!1,!0)};class v3 extends zs{constructor(){super(...arguments),this.removePointerDownListener=In}onPointerDown(t){this.session=new SP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_P(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:xp(t),onStart:xp(n),onMove:xp(r),onEnd:(i,o)=>{delete this.session,s&&je.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=ll(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 vp=!1;class b3 extends k.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),vp&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),qu.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}),vp=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||je.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(),Lx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;vp=!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 jP(e){const[t,n]=pP(),r=k.useContext(gx);return d.jsx(b3,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(wP),isPresent:t,safeToRemove:n})}const w3={pan:{Feature:v3},drag:{Feature:x3,ProjectionNode:hP,MeasureLayout:jP}};function Xw(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&&je.postRender(()=>i(t,ic(t)))}class k3 extends zs{mount(){const{current:t}=this.node;t&&(this.unmount=WO(t,(n,r)=>(Xw(this.node,r,"Start"),s=>Xw(this.node,s,"End"))))}unmount(){}}class _3 extends zs{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=nc(Bl(this.node.current,"focus",()=>this.onFocus()),Bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ek(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&&je.postRender(()=>i(t,ic(t)))}class S3 extends zs{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=YO(t,(s,i)=>(ek(this.node,i,"Start"),(o,{success:a})=>ek(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Pg=new WeakMap,bp=new WeakMap,C3=e=>{const t=Pg.get(e.target);t&&t(e)},j3=e=>{e.forEach(C3)};function E3({root:e,...t}){const n=e||document;bp.has(n)||bp.set(n,{});const r=bp.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(j3,{root:e,...t})),r[s]}function P3(e,t,n){const r=E3(t);return Pg.set(e,n),r.observe(e),()=>{Pg.delete(e),r.unobserve(e)}}const T3={some:0,all:1};class N3 extends zs{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:T3[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};this.stopObserver=P3(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(I3(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function I3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const A3={inView:{Feature:N3},tap:{Feature:S3},focus:{Feature:_3},hover:{Feature:k3}},R3={layout:{ProjectionNode:hP,MeasureLayout:jP}},L3={...r3,...A3,...w3,...R3},tk=QF(L3,XF);function M3(){!zx.current&&UE();const[e]=k.useState(Vd.current);return e}function zf(e,t){const n=k.useRef(t);n.current=t,k.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const wp={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},ne={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 wt(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 $3={4:"1rem"};function X(...e){return b$(VM(e))}const D3={height:32,lineHeight:"32px",padding:"0 16px"},O3={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")`},z3={white:ne.bgBase,paper:ne.bgSurface,speckle:ne.bgSurface,parchment:ne.bgElevated,canvas:ne.canvasBase,kraft:ne.canvas300,chalkboard:ne.chalkboardBg},nk={white:ne.bgElevated,paper:ne.bgElevated,speckle:ne.bgElevated,parchment:ne.canvasBase,canvas:ne.canvas300,kraft:ne.canvasDark,chalkboard:ne.chalkboardBg},F3={base:ne.bgBase,surface:ne.bgSurface,elevated:ne.bgElevated,canvas:ne.canvasBase,canvasDark:ne.canvasDark,blue:ne.washBlue,green:ne.washGreen,amber:ne.washAmber,rose:ne.washRose,slate:ne.washSlate},B3={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function Kx(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=O3[n],o=t.fill?F3[t.fill]:t.shade?nk[n]:z3[n],a=B3[s],l={"--pui-texture-shade":nk[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 Ho(e){return Kx(e)}function ia(e,t="paper"){if(e!==!1)return Ho(e===!0?t:e)}function V3(e){const t=Bf((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 Ff(l)}function U3(e,t){const n=Bf(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const f=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(f)*h,y:o+Math.sin(f)*h})}return Ff(c)}function W3(e){const t=Bf((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,f=l.ax+(l.bx-l.ax)*u,h=l.ay+(l.by-l.ay)*u,p=l.bx-l.ax,m=l.by-l.ay,g=Math.sqrt(p*p+m*m)||1,x=-m/g,y=p/g,v=(t()-.5)*i*2;o.push({x:f+x*v,y:h+y*v})}return Ff(o)}function K3(e,t){const n=Bf(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const f=(u+.5)/s,h=c.ax+(c.bx-c.ax)*f,p=c.ay+(c.by-c.ay)*f,m=c.bx-c.ax,g=c.by-c.ay,x=Math.sqrt(m*m+g*g)||1,y=-g/x,v=m/x,b=(n()-.5)*o*2;a.push({x:h+y*b,y:p+v*b})}return Ff(a)}function Ff(e){const t=e.length;if(t<3)return"";let n=`M ${Yr(e[0].x)} ${Yr(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 ${Yr(l)} ${Yr(c)}, ${Yr(u)} ${Yr(f)}, ${Yr(o.x)} ${Yr(o.y)}`}return n+=" Z",n}function Yr(e){return e.toFixed(2)}function Bf(e){let t=typeof e=="string"?H3(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function H3(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 Vf(){const e=k.useId();return k.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 oa(e){const t=Vf();return k.useMemo(()=>({blob:V3({seed:t,wobble:e}),ring:U3(t,e)}),[t,e])}const G3="button-module__button___Z331g",Z3="button-module__blobBg___QQFzf",q3="button-module__blobFill___XwLjV",Y3="button-module__blobRing___567UW",J3="button-module__isActive___FXNSJ",Q3="button-module__primary___ppbyq",X3="button-module__secondary___esy5L",eB="button-module__ghost___NisA0",tB="button-module__danger___Wnvuq",nB="button-module__chalkboard___d3Nqb",rB="button-module__tiny___8ZZ7A",sB="button-module__small___u7y8a",iB="button-module__medium___HBIAj",oB="button-module__large___RPzNy",aB="button-module__fullWidth___H0P0F",lB="button-module__iconLeft___s60SZ",cB="button-module__iconRight___75eFu",uB="button-module__label___pXAyM",bn={button:G3,blobBg:Z3,blobFill:q3,blobRing:Y3,isActive:J3,primary:Q3,secondary:X3,ghost:eB,danger:tB,chalkboard:nB,tiny:rB,small:sB,medium:iB,large:oB,fullWidth:aB,iconLeft:lB,iconRight:cB,label:uB},ee=k.forwardRef(function({variant:e="primary",surface:t="paper",size:n="medium",icon:r,iconRight:s,fullWidth:i=!1,wobble:o=.5,isActive:a=!1,children:l,className:c,...u},f){const h=oa(o);return d.jsxs("button",{ref:f,type:"button",className:X(bn.button,bn[e],bn[n],t==="chalkboard"&&bn.chalkboard,a&&bn.isActive,i&&bn.fullWidth,c),...u,children:[d.jsxs("svg",{className:bn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:h.blob,className:bn.blobFill}),d.jsx("path",{d:h.ring,className:bn.blobRing})]}),r&&d.jsx("span",{className:bn.iconLeft,children:r}),d.jsx("span",{className:bn.label,children:l}),s&&d.jsx("span",{className:bn.iconRight,children:s})]})});function Hx(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const et=D$.generator(),dB="sketch-border-module__svg___whV4x",fB="sketch-border-module__behind___lgdYV",hB="sketch-border-module__stroke___vAm-v",pB="sketch-border-module__fill___zlpd6",ru={svg:dB,behind:fB,stroke:hB,fill:pB},mB=1.2,gB=.7;function qt({shape:e="rect",radius:t=9,roughness:n=1.2,bowing:r=1,strokeWidth:s=1,inset:i=2,fill:o=!1,clip:a=!1,smooth:l=!1,straight:c=!0,strokeInset:u=!0,className:f}){const[h]=k.useState(Math.random),p=k.useRef(null),[m,g]=k.useState(null);k.useEffect(()=>{var v;const b=(v=p.current)==null?void 0:v.parentElement;if(!b)return;const w=new ResizeObserver(()=>{const _=b.offsetWidth,S=b.offsetHeight;g(j=>j&&j.width===_&&j.height===S?j:{width:_,height:S})});return w.observe(b),()=>w.disconnect()},[]);const{parts:x,clipPath:y}=k.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const v=Math.max(1,Math.round(h*1e6)),b=v,w=v*2654435761%2147483647,_=T=>et.toPaths(et.path(T,{seed:b,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(P=>!P.fill||P.fill==="none").map(P=>({d:P.d,filled:!1}));if(l){const T={seed:b,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},P=R=>et.toPaths(R).filter(L=>!L.fill||L.fill==="none").map(L=>({d:L.d,filled:!1}));if(a){const R=su(e,m,i,t,Zs(w),n*1.1),L=u?rk(s,n):0,I=L?su(e,m,i+L,t,Zs(w),n*1.1):R;return{parts:P(et.path(I,{...T,preserveVertices:!0})),clipPath:R}}const N=e==="circle"?et.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):et.path(kp(m,i,t,Zs(b)),{...T,preserveVertices:!0});return{parts:P(N),clipPath:null}}if(a){if(c){const R=kp(m,i,t,Zs(w)),L=et.toPaths(et.path(R,{seed:b,roughness:mB,bowing:gB,preserveVertices:!0,strokeWidth:s})).filter(I=>!I.fill||I.fill==="none").map(I=>({d:I.d,filled:!1}));return{parts:L.length?L:[{d:R,filled:!1}],clipPath:R}}const T=su(e,m,i,t,Zs(w),n*1.1),P=u?rk(s,n):0,N=P?su(e,m,i+P,t,Zs(w),n*1.1):T;return{parts:_(N),clipPath:T}}const S=(T,P)=>{const N=P?{fill:"#000",fillStyle:"solid"}:{},R=e==="circle"?et.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...N}):et.path(kp(m,i,t,Zs(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...N});return et.toPaths(R)},j=o?S(w,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],E=S(b,!1).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));return{parts:[...j,...E],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return k.useEffect(()=>{var v;const b=(v=p.current)==null?void 0:v.parentElement;if(b)return y?b.style.setProperty("--sketch-clip",`path("${y}")`):b.style.removeProperty("--sketch-clip"),()=>{b.style.removeProperty("--sketch-clip")}},[y]),d.jsx("svg",{ref:p,className:X(ru.svg,o&&ru.behind,f),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:x==null?void 0:x.map((v,b)=>v.filled?d.jsx("path",{className:ru.fill,d:v.d},`f-${b}`):d.jsx("path",{className:ru.stroke,d:v.d,strokeWidth:s},`s-${b}`))})}function rk(e,t){return e/2+t*1.5}function Zs(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function su(e,t,n,r,s,i){const o=t.width-n*2,a=t.height-n*2,l=t.width/2,c=t.height/2,u=()=>(s()-.5)*i*2,f=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;f.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,g=(v,b,w)=>{for(const _ of[0,45,90]){const S=(w+_)*Math.PI/180;f.push({x:v+Math.cos(S)*h+u(),y:b+Math.sin(S)*h+u()})}},x=(v,b,w,_)=>{const S=Math.hypot(w-v,_-b),j=Math.min(12,Math.max(1,Math.round(S/160)));for(let E=1;E<=j;E++){const T=E/(j+1);f.push({x:v+(w-v)*T+u(),y:b+(_-b)*T+u()})}};g(p+h,m+h,180),x(p+h,m,p+o-h,m),g(p+o-h,m+h,270),x(p+o,m+h,p+o,m+a-h),g(p+o-h,m+a-h,0),x(p+o-h,m+a,p+h,m+a),g(p+h,m+a-h,90),x(p,m+a-h,p,m+h);const y=3;return sk([...f.slice(y),...f.slice(0,y)])}return sk(f)}function sk(e){const t=e.length;if(t<3)return"";const n=(s,i)=>Math.max(.001,Math.hypot(i.x-s.x,i.y-s.y)**.5);let r=`M ${e[0].x.toFixed(2)} ${e[0].y.toFixed(2)}`;for(let s=0;s<t;s++){const i=e[(s-1+t)%t],o=e[s],a=e[(s+1)%t],l=e[(s+2)%t],c=n(i,o),u=n(o,a),f=n(a,l),h=a.x-o.x+u*((o.x-i.x)/c-(a.x-i.x)/(c+u)),p=a.y-o.y+u*((o.y-i.y)/c-(a.y-i.y)/(c+u)),m=a.x-o.x+u*((l.x-a.x)/f-(l.x-o.x)/(u+f)),g=a.y-o.y+u*((l.y-a.y)/f-(l.y-o.y)/(u+f)),x=o.x+h/3,y=o.y+p/3,v=a.x-m/3,b=a.y-g/3;r+=` C ${x.toFixed(2)} ${y.toFixed(2)}, ${v.toFixed(2)} ${b.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function kp(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return yB(t,t,e.width-t*2,e.height-t*2,s)}function yB(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${Ee(e+o)} ${Ee(t)}`,`L ${Ee(e+n-a)} ${Ee(t)}`,`Q ${Ee(e+n)} ${Ee(t)} ${Ee(e+n)} ${Ee(t+a)}`,`L ${Ee(e+n)} ${Ee(t+r-l)}`,`Q ${Ee(e+n)} ${Ee(t+r)} ${Ee(e+n-l)} ${Ee(t+r)}`,`L ${Ee(e+c)} ${Ee(t+r)}`,`Q ${Ee(e)} ${Ee(t+r)} ${Ee(e)} ${Ee(t+r-c)}`,`L ${Ee(e)} ${Ee(t+o)}`,`Q ${Ee(e)} ${Ee(t)} ${Ee(e+o)} ${Ee(t)}`,"Z"].join(" ")}function Ee(e){return e.toFixed(2)}const Yt={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}},xB="page-module__page___-uHnG",vB="page-module__outlined___Wwtyg",bB="page-module__surface___sWfI6",wB="page-module__flat___HlOaY",kB="page-module__withAccent___lsv-m",_B="page-module__accentBlue___XxbMV",SB="page-module__accentGreen___Ne6Q8",CB="page-module__accentAmber___kLAwa",jB="page-module__accentRose___O9ZbZ",EB="page-module__accentSlate___xCB66",Ji={page:xB,outlined:vB,surface:bB,flat:wB,withAccent:kB,accentBlue:_B,accentGreen:SB,accentAmber:CB,accentRose:jB,accentSlate:EB},PB=Hx(Ji),TB={all:14,top:14,none:2};function Gx({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=ia(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return d.jsxs("div",{className:X(Ji.page,a&&Ji.outlined,s&&Ji.withAccent,s&&PB[i],!l&&Ji.flat,t),style:n,children:[d.jsx(qt,{clip:!0,...Yt.surface,radius:TB[o],straight:!l}),d.jsx("div",{className:Ji.surface,style:c,children:e})]})}const NB="layout-module__layout___O1aWi",IB="layout-module__header___I-kxe",AB="layout-module__headerLeft___JChJQ",RB="layout-module__headerTitles___aqSUG",LB="layout-module__headerTitle___wvr39",MB="layout-module__headerSubtitle___6f5BD",$B="layout-module__headerActions___adC12",DB="layout-module__mobileToggle___4WpVG",OB="layout-module__body___tywNf",zB="layout-module__mobileOverlay___tzbBC",FB="layout-module__sidebar___8VKGq",BB="layout-module__sidebarOpen___47rtr",VB="layout-module__sidebarInner___tq2X6",UB="layout-module__logoArea___RLnC0",WB="layout-module__logoText___pAmfV",KB="layout-module__nav___FxcrZ",HB="layout-module__main___9z7bu",GB="layout-module__navIslandFixed___H4TwP",ZB="layout-module__content___jL-VB",qB="layout-module__contentWithPage___vVdfN",YB="layout-module__footer___LyakU",JB="layout-module__footerText___8BYxc",Be={layout:NB,header:IB,headerLeft:AB,headerTitles:RB,headerTitle:LB,headerSubtitle:MB,headerActions:$B,mobileToggle:DB,body:OB,mobileOverlay:zB,sidebar:FB,sidebarOpen:BB,sidebarInner:VB,logoArea:UB,logoText:WB,nav:KB,main:HB,navIslandFixed:GB,content:ZB,contentWithPage:qB,footer:YB,footerText:JB};function QB(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"}:Ho(e)}function EP({children:e,showHeader:t=!0,showFooter:n=!1,showSidebar:r=!0,showPage:s=!0,background:i="paper",title:o,subtitle:a,headerActions:l,headerHeight:c,headerTexture:u,navigationItems:f=[],activeItemId:h,onNavigate:p,logo:m,footerContent:g,navigationIsland:x,style:y,bleedBottom:v=!0,routeKey:b,stackOpen:w}){const[_,S]=k.useState(!1),j=M3();zf(_,()=>S(!1));const E=QB(i),T=r&&f.length>0,P=c!==void 0||u!==void 0?{...u!==void 0?Ho(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return d.jsxs("div",{className:Be.layout,style:{...E,...y},children:[t&&d.jsxs("header",{className:Be.header,style:P,children:[d.jsxs("div",{className:Be.headerLeft,children:[T&&d.jsx("button",{type:"button",className:Be.mobileToggle,onClick:()=>S(!0),"aria-label":"Open navigation",children:d.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),d.jsxs("div",{className:Be.headerTitles,children:[o&&d.jsx("h1",{className:Be.headerTitle,children:o}),a&&d.jsx("span",{className:Be.headerSubtitle,children:a})]})]}),l&&d.jsx("div",{className:Be.headerActions,children:l})]}),d.jsxs("div",{className:Be.body,children:[_&&d.jsx("button",{type:"button",className:Be.mobileOverlay,onClick:()=>S(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&d.jsx("aside",{className:X(Be.sidebar,_&&Be.sidebarOpen),children:d.jsxs("div",{className:Be.sidebarInner,children:[d.jsx("div",{className:Be.logoArea,children:m||d.jsx("span",{className:Be.logoText,children:"Paper UI"})}),d.jsx("nav",{className:Be.nav,"aria-label":"Main navigation",children:f.map(N=>{const R=N.id===h;return d.jsx(ee,{variant:"ghost",size:"small",isActive:R,onClick:()=>{p==null||p(N),S(!1)},"aria-current":R?"page":void 0,icon:N.icon,style:D3,children:N.label},N.id)})})]})}),d.jsx("div",{className:Be.main,children:d.jsx("main",{className:s?Be.contentWithPage:Be.content,style:v?{paddingBottom:0}:void 0,children:(()=>{const N=b!==void 0?d.jsx(EF,{mode:"wait",children:d.jsx(tk.div,{initial:j?void 0:{opacity:0,y:8},animate:{opacity:1,y:0},exit:j?void 0:{opacity:0,y:-8},transition:{duration:.2,ease:"easeOut"},style:{height:"100%"},children:e},b)}):e;return s?d.jsx(Gx,{rounded:v?"top":"all",style:v&&x?{paddingBottom:`calc(${wp.navIslandBottom} + ${wp.navIslandHeight} + ${$3[4]})`}:void 0,children:N}):N})()})})]}),x&&d.jsx("div",{className:Be.navIslandFixed,children:w!==void 0?d.jsx(tk.div,{animate:{x:w?`-${wp.stackPanelWidth/2}px`:0},transition:{duration:j?0:.3,ease:[.4,0,.2,1]},children:x}):x}),n&&d.jsx("footer",{className:Be.footer,children:g||d.jsx("p",{className:Be.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const XB="checkbox-module__wrapper___uLYMI",e4="checkbox-module__blobFill___mPJSR",t4="checkbox-module__input___Ptgt7",n4="checkbox-module__blobBg___bw3sn",r4="checkbox-module__labelLeft___-vAmH",s4="checkbox-module__box___yAh-r",i4="checkbox-module__checkmark___tTyBz",o4="checkbox-module__indeterminateLine___IosI-",a4="checkbox-module__boxWrapper___byjoS",l4="checkbox-module__icon___RO-yn",c4="checkbox-module__labelText___bAnLr",u4="checkbox-module__chalkboard___sv6SL",nn={wrapper:XB,blobFill:e4,input:t4,blobBg:n4,labelLeft:r4,box:s4,checkmark:i4,indeterminateLine:o4,boxWrapper:a4,icon:l4,labelText:c4,chalkboard:u4},PP=k.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=k.useId(),h=l??f,p=oa(r),m=k.useRef(null);return k.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),d.jsxs("label",{className:X(nn.wrapper,t==="left"&&nn.labelLeft,s==="chalkboard"&&nn.chalkboard,i),htmlFor:h,children:[d.jsxs("span",{className:nn.boxWrapper,children:[d.jsx("input",{ref:g=>{m.current=g,typeof u=="function"?u(g):u&&(u.current=g)},id:h,type:"checkbox",className:nn.input,checked:o,onChange:a,...c}),d.jsx("svg",{className:nn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:p.blob,className:nn.blobFill})}),d.jsxs("span",{className:nn.box,"aria-hidden":"true",children:[d.jsx(qt,{smooth:!0,...Yt.control}),n?d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:nn.icon,children:d.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:nn.indeterminateLine})}):d.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:nn.icon,children:d.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:nn.checkmark})})]})]}),e&&d.jsx("span",{className:nn.labelText,children:e})]})}),d4="icon-button-module__iconButton___avg6i",f4="icon-button-module__blobBg___466Vy",h4="icon-button-module__blobFill___FTN1g",p4="icon-button-module__blobRing___hRdQb",m4="icon-button-module__isActive___XlvtM",g4="icon-button-module__icon___h204x",y4="icon-button-module__ghost___Wbxog",x4="icon-button-module__danger___p0Xz5",v4="icon-button-module__tiny___4WYvA",b4="icon-button-module__small___bPnCU",w4="icon-button-module__medium___nOxPf",k4="icon-button-module__large___UBU5z",_4="icon-button-module__chalkboard___mi0sQ",jr={iconButton:d4,blobBg:f4,blobFill:h4,blobRing:p4,isActive:m4,icon:g4,default:"icon-button-module__default___9frNR",ghost:y4,danger:x4,tiny:v4,small:b4,medium:w4,large:k4,chalkboard:_4},st=k.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=oa(i);return d.jsxs("button",{ref:c,type:"button",className:X(jr.iconButton,jr[t],n==="chalkboard"&&jr.chalkboard,jr[r],o&&jr.isActive,a),"aria-label":s,title:s,...l,children:[d.jsxs("svg",{className:jr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:u.blob,className:jr.blobFill}),d.jsx("path",{d:u.ring,className:jr.blobRing})]}),d.jsx("span",{className:jr.icon,children:e})]})}),S4="stamp-module__stamp___5qaNY",C4="stamp-module__small___BBlBg",j4="stamp-module__medium___HG2YD",E4="stamp-module__large___aUT0I",P4="stamp-module__blobBg___Mdrdd",T4="stamp-module__blobFill___QyCeB",N4="stamp-module__blobRing___EUDx7",I4="stamp-module__dot___qZyCR",A4="stamp-module__label___T89iH",R4="stamp-module__chalkboard___syI4T",Jr={stamp:S4,small:C4,medium:j4,large:E4,blobBg:P4,blobFill:T4,blobRing:N4,dot:I4,label:A4,chalkboard:R4},_p={neutral:{fill:wt(ne.accentSlate,.14),text:ne.accentSlateDark,ring:wt(ne.accentSlateDark,.35)},info:{fill:wt(ne.accentBlue,.14),text:ne.accentBlueDark,ring:wt(ne.accentBlueDark,.35)},success:{fill:wt(ne.accentGreen,.16),text:ne.accentGreenDark,ring:wt(ne.accentGreenDark,.35)},warning:{fill:wt(ne.accentAmber,.16),text:ne.accentAmberDark,ring:wt(ne.accentAmberDark,.4)},error:{fill:wt(ne.accentRose,.16),text:ne.accentRoseDark,ring:wt(ne.accentRoseDark,.35)}},ik={fill:wt(ne.chalkboardBorderBase,.1),ring:wt(ne.chalkboardBorderBase,.35)};function re({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=oa(o),u=a==="chalkboard",f=n?u?ik.ring:_p[n].ring:void 0,h=s??(n?u?ik.fill:_p[n].fill:"transparent"),p=i??(n&&!u?_p[n].text:void 0);return d.jsxs("span",{className:X(Jr.stamp,Jr[t],u&&Jr.chalkboard,l),style:p?{color:p}:void 0,children:[d.jsxs("svg",{className:Jr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:Jr.blobFill,style:{fill:h}}),f&&d.jsx("path",{d:c.ring,className:Jr.blobRing,style:{stroke:f}})]}),r&&d.jsx("span",{className:Jr.dot,"aria-hidden":"true"}),d.jsx("span",{className:Jr.label,children:e})]})}const L4="copy-button-module__copyButton___-hTo4",M4="copy-button-module__dark___O45N-",$4="copy-button-module__chalkboard___hW4aw",D4="copy-button-module__copied___XlHFr",iu={copyButton:L4,dark:M4,chalkboard:$4,copied:D4};function Gd({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=k.useState(!1),a=k.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:X(iu.copyButton,t==="dark"&&iu.dark,n==="chalkboard"&&iu.chalkboard,i&&iu.copied,r),...s,children:i?"Copied!":"Copy"})}const O4="code-block-module__codeBlock___dq28o",z4="code-block-module__header___42Fek",F4="code-block-module__relative___oO-zy",B4="code-block-module__copyOverlay___PjAuq",V4="code-block-module__pre___zXzLZ",U4="code-block-module__chalkboard___bdo9J",W4="code-block-module__chalkboardHeader___3RiVd",K4="code-block-module__chalkboardPre___iRBFR",Qr={codeBlock:O4,header:z4,relative:F4,copyOverlay:B4,pre:V4,chalkboard:U4,chalkboardHeader:W4,chalkboardPre:K4};function jae({code:e,filename:t,surface:n="paper"}){return d.jsxs("div",{className:X(Qr.codeBlock,n==="chalkboard"&&Qr.chalkboard),children:[t&&d.jsxs("div",{className:X(Qr.header,n==="chalkboard"&&Qr.chalkboardHeader),children:[d.jsx("span",{children:t}),d.jsx(Gd,{text:e,variant:"light",surface:n})]}),!t&&d.jsx("div",{className:Qr.relative,children:d.jsx("div",{className:Qr.copyOverlay,children:d.jsx(Gd,{text:e,variant:"dark",surface:n})})}),d.jsx("pre",{className:X(Qr.pre,n==="chalkboard"&&Qr.chalkboardPre),children:d.jsx("code",{children:e})})]})}function Go({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 TP({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 NP({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 H4({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 IP({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 AP({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 G4="table-module__tableFrame___KP-90",Z4="table-module__tableWrapper___gc3Y3",q4="table-module__toolbar___zhCel",Y4="table-module__toolbarTitle___D8oH-",J4="table-module__panelFooter___lCCKo",Q4="table-module__compact___mG-2Y",X4="table-module__toolbarActions___EX6qS",e5="table-module__search___zIBk2",t5="table-module__searchIcon___ayhK8",n5="table-module__searchInput___PqsEG",r5="table-module__tableScroll___1gvc4",s5="table-module__table___tdU5g",i5="table-module__th___GQbKk",o5="table-module__td___WktB5",a5="table-module__footerCell___bM-jv",l5="table-module__tr___xeZno",c5="table-module__expandTh___uxkR4",u5="table-module__expandTd___VoBRC",d5="table-module__expandIcon___8V45X",f5="table-module__expandable___R7o2l",h5="table-module__footerRow___ik1DH",p5="table-module__expandedRow___1TbTQ",m5="table-module__expandedCell___sKAaD",g5="table-module__boardScroll___Y1yqm",y5="table-module__board___kFAI-",x5="table-module__boardColumn___-W9bP",v5="table-module__boardColumnHeader___kY3Fj",b5="table-module__accentBlue___PEJ1V",w5="table-module__accentGreen___wJ53r",k5="table-module__accentAmber___Iezjv",_5="table-module__accentRose___W8zxc",S5="table-module__accentSlate___oUZCX",C5="table-module__boardColumnLabel___JBEed",j5="table-module__boardColumnCount___Pkpiq",E5="table-module__boardColumnBody___uAgRF",P5="table-module__boardRow___C1P60",T5="table-module__boardEmpty___IKv2W",N5="table-module__chalkboardFrame___xB3N5",I5="table-module__chalkboardWrapper___KjY5r",A5="table-module__chalkboard___v0m3A",ce={tableFrame:G4,tableWrapper:Z4,toolbar:q4,toolbarTitle:Y4,panelFooter:J4,compact:Q4,toolbarActions:X4,search:e5,searchIcon:t5,searchInput:n5,tableScroll:r5,table:s5,th:i5,td:o5,footerCell:a5,tr:l5,expandTh:c5,expandTd:u5,expandIcon:d5,expandable:f5,footerRow:h5,expandedRow:p5,expandedCell:m5,boardScroll:g5,board:y5,boardColumn:x5,boardColumnHeader:v5,accentBlue:b5,accentGreen:w5,accentAmber:k5,accentRose:_5,accentSlate:S5,boardColumnLabel:C5,boardColumnCount:j5,boardColumnBody:E5,boardRow:P5,boardEmpty:T5,chalkboardFrame:N5,chalkboardWrapper:I5,chalkboard:A5},R5=Hx(ce);function L5({data:e=[],columns:t=[],board:n,surface:r="paper",texture:s=!0,toolbar:i,expandable:o,showExpandColumn:a=!0,rowKey:l,rowClassName:c,rowTexture:u,rowFooter:f,hideHeader:h=!1,density:p="comfortable",panelFooter:m,className:g}){const x=ia(s,r==="chalkboard"?"chalkboard":"paper"),y=!!i,[v,b]=k.useState(new Set),w=j=>{b(E=>{const T=new Set(E);return T.has(j)?T.delete(j):T.add(j),T})},_=!!(o&&a),S=_?t.length+1:t.length;return d.jsxs("div",{className:X(ce.tableFrame,r==="chalkboard"&&ce.chalkboardFrame,g),children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsxs("div",{className:X(ce.tableWrapper,r==="chalkboard"&&ce.chalkboardWrapper,p==="compact"&&ce.compact),style:x,children:[y&&d.jsxs("div",{className:ce.toolbar,children:[i.title&&d.jsx("div",{className:ce.toolbarTitle,children:i.title}),i.search&&d.jsxs("div",{className:ce.search,children:[d.jsx(M5,{className:ce.searchIcon}),d.jsx("input",{type:"text",className:ce.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:j=>{var E,T;return(T=(E=i.search)==null?void 0:E.onChange)==null?void 0:T.call(E,j.target.value)}}),d.jsx(qt,{fill:!0,...Yt.field})]}),i.actions&&d.jsx("div",{className:ce.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?d.jsx("div",{className:ce.boardScroll,children:d.jsx("div",{className:ce.board,children:n.map(j=>d.jsxs("div",{className:ce.boardColumn,children:[d.jsxs("div",{className:X(ce.boardColumnHeader,r==="chalkboard"&&ce.chalkboard,j.accent&&R5[j.accent]),children:[d.jsx("span",{className:ce.boardColumnLabel,children:j.label}),d.jsx("span",{className:ce.boardColumnCount,children:j.items.length})]}),d.jsx("div",{className:ce.boardColumnBody,children:j.items.length===0?d.jsx("div",{className:ce.boardEmpty,children:j.emptyLabel??"empty"}):j.items.map((E,T)=>d.jsx("div",{className:X(ce.boardRow,r==="chalkboard"&&ce.chalkboard),children:j.renderItem(E,T,r)},j.getKey?j.getKey(E,T):T))})]},j.key))})}):d.jsx("div",{className:ce.tableScroll,children:d.jsxs("table",{className:X(ce.table,r==="chalkboard"&&ce.chalkboard,p==="compact"&&ce.compact),children:[d.jsxs("colgroup",{children:[_&&d.jsx("col",{style:{width:"48px"}}),t.map(j=>d.jsx("col",{style:j.width?{width:`${j.width*32}px`}:void 0},j.key))]}),!h&&d.jsx("thead",{children:d.jsxs("tr",{children:[_&&d.jsx("th",{className:X(ce.th,ce.expandTh),"aria-label":"Expand"}),t.map(j=>d.jsx("th",{className:ce.th,style:j.align?{textAlign:j.align}:void 0,children:j.header},j.key))]})}),d.jsx("tbody",{children:e.map((j,E)=>{const T=l?l(j,E):E,P=o==null?void 0:o.render(j,E,r),N=f==null?void 0:f(j,E,r),R=!!P,L=R&&v.has(T),I=u==null?void 0:u(j,E);return d.jsxs(k.Fragment,{children:[d.jsxs("tr",{className:X(ce.tr,R&&ce.expandable,c==null?void 0:c(j,E)),style:I?Ho(I):void 0,onClick:()=>R&&w(T),children:[_&&d.jsx("td",{className:X(ce.td,ce.expandTd),children:R&&d.jsx("button",{type:"button",className:ce.expandIcon,"aria-expanded":L,"aria-label":L?"Collapse row":"Expand row",onClick:z=>{z.stopPropagation(),w(T)},children:d.jsx(AP,{size:14})})}),t.map(z=>d.jsx("td",{className:ce.td,style:z.align?{textAlign:z.align}:void 0,children:z.cell(j,E,r)},z.key))]}),N&&d.jsx("tr",{className:ce.footerRow,style:I?Ho(I):void 0,children:d.jsx("td",{colSpan:S,className:ce.footerCell,children:N})}),L&&d.jsx("tr",{className:ce.expandedRow,children:d.jsx("td",{colSpan:S,className:ce.expandedCell,children:P})})]},T)})})]})}),m&&d.jsx("div",{className:ce.panelFooter,children:m})]})]})}function M5({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 $5="card-module__borderLayer___WSpJq",D5="card-module__elevated___uhWj9",O5="card-module__textureLayer___Kcofz",z5="card-module__flat___KnG5z",F5="card-module__small___HXUTr",B5="card-module__withAccent___2t7bV",V5="card-module__accentBlue___a1KIq",U5="card-module__accentGreen___RNWoA",W5="card-module__accentAmber___uMhom",K5="card-module__accentRose___VPI3t",H5="card-module__accentSlate___-l4jE",G5="card-module__chalkboard___bQ48O",ss={borderLayer:$5,default:"card-module__default___glPy-",elevated:D5,textureLayer:O5,flat:z5,small:F5,withAccent:B5,accentBlue:V5,accentGreen:U5,accentAmber:W5,accentRose:K5,accentSlate:H5,chalkboard:G5},Z5=Hx(ss);function ye({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:Kx({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return d.jsxs("div",{className:X(ss.borderLayer,ss[t],n==="chalkboard"&&ss.chalkboard,ss[r],a&&ss.withAccent,a&&Z5[l],!c&&ss.flat,u),children:[d.jsx(qt,{clip:!0,...Yt.surface,straight:!c}),d.jsx("div",{className:ss.textureLayer,style:f,children:e})]})}const q5="input-module__wrapper___xaEw6",Y5="input-module__label___lu7R1",J5="input-module__field___khFpX",Q5="input-module__input___h7K-F",X5="input-module__small___SkByh",eV="input-module__medium___0QPuV",tV="input-module__large___zGwRu",nV="input-module__error___QDqga",rV="input-module__disabled___K-5hi",sV="input-module__helperText___njeLH",iV="input-module__helperError___qDBpD",oV="input-module__chalkboard___Xh-5s",sr={wrapper:q5,label:Y5,field:J5,input:Q5,small:X5,medium:eV,large:tV,error:nV,disabled:rV,helperText:sV,helperError:iV,chalkboard:oV},nt=k.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=k.useId(),u=o??c;return d.jsxs("div",{className:X(sr.wrapper,s==="chalkboard"&&sr.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:sr.label,children:e}),d.jsxs("span",{className:X(sr.field,sr[r],n&&sr.error,a.disabled&&sr.disabled),children:[d.jsx("input",{ref:l,id:u,className:sr.input,...a}),d.jsx(qt,{fill:!0,...Yt.field})]}),t&&d.jsx("span",{className:X(sr.helperText,n&&sr.helperError),children:t})]})}),aV="select-module__wrapper___Hc5F3",lV="select-module__label___ay-3s",cV="select-module__nativeSelect___UA2d-",uV="select-module__trigger___xMYHi",dV="select-module__open___w3mbZ",fV="select-module__triggerLabel___ihpER",hV="select-module__placeholder___0VOFP",pV="select-module__small___iU9W9",mV="select-module__chevron___0dCTg",gV="select-module__medium___B-XBN",yV="select-module__large___iII2c",xV="select-module__chevronOpen___cFOYe",vV="select-module__error___P5RBk",bV="select-module__dropdown___Q-uK3",wV="select-module__slideDown___sT374",kV="select-module__options___HmrQ0",_V="select-module__option___vNnue",SV="select-module__optionDisabled___ex2zq",CV="select-module__optionSelected___tAFjn",jV="select-module__optionHighlighted___zYQLq",EV="select-module__helperText___r5gyn",PV="select-module__helperError___ydSPT",TV="select-module__chalkboard___sXBw8",We={wrapper:aV,label:lV,nativeSelect:cV,trigger:uV,open:dV,triggerLabel:fV,placeholder:hV,small:pV,chevron:mV,medium:gV,large:yV,chevronOpen:xV,error:vV,dropdown:bV,slideDown:wV,options:kV,option:_V,optionDisabled:SV,optionSelected:CV,optionHighlighted:jV,helperText:EV,helperError:PV,chalkboard:TV};function NV({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",options:i,placeholder:o,value:a,defaultValue:l,onChange:c,name:u,disabled:f=!1,width:h,texture:p=!1,className:m}){const g=k.useId(),[x,y]=k.useState(!1),[v,b]=k.useState(-1),[w,_]=k.useState(l??""),[S,j]=k.useState(null),E=k.useRef(null),T=k.useRef(null),P=a!==void 0,N=P?a:w,R=i.find(C=>C.value===N),L=(R==null?void 0:R.label)??o??"Select...",I=k.useCallback(()=>{if(f)return;y(!0);const C=i.findIndex(U=>U.value===N);b(C>=0?C:0)},[f,i,N]),z=k.useCallback(()=>{y(!1),b(-1)},[]),$=k.useCallback(C=>{var U;C.disabled||(P||_(C.value),c==null||c(C.value),z(),(U=E.current)==null||U.focus())},[P,c,z]),D=k.useCallback(C=>{if(!f)switch(C.key){case"Enter":case" ":C.preventDefault(),x&&v>=0?$(i[v]):I();break;case"Escape":C.preventDefault(),x&&z();break;case"ArrowDown":C.preventDefault(),x?b(U=>{let Q=U+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:U}):I();break;case"ArrowUp":C.preventDefault(),x?b(U=>{let Q=U-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:U}):I();break;case"Home":if(C.preventDefault(),x){let U=0;for(;U<i.length&&i[U].disabled;)U++;U<i.length&&b(U)}break;case"End":if(C.preventDefault(),x){let U=i.length-1;for(;U>=0&&i[U].disabled;)U--;U>=0&&b(U)}break;case"Tab":x&&z();break}},[f,x,v,i,I,z,$]);k.useEffect(()=>{if(!x)return;const C=U=>{var Q,A;const me=U.target;(Q=E.current)!=null&&Q.contains(me)||(A=T.current)!=null&&A.contains(me)||z()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[x,z]),k.useEffect(()=>{if(!x||v<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${v}"]`);C==null||C.scrollIntoView({block:"nearest"})},[x,v]),k.useEffect(()=>{if(!x){j(null);return}const C=()=>{if(!E.current)return;const U=E.current.getBoundingClientRect();if(U.bottom<0||U.top>window.innerHeight){z();return}j(U)};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)}},[x,z]);const O=ia(p),V=O?{"--sketch-fill":O.backgroundColor}:void 0;return d.jsxs("div",{className:X(We.wrapper,s==="chalkboard"&&We.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&d.jsx("label",{htmlFor:g,className:We.label,children:e}),d.jsxs("select",{id:g,name:u,className:We.nativeSelect,value:N,onChange:C=>c==null?void 0:c(C.target.value),disabled:f,"aria-hidden":"true",tabIndex:-1,children:[o&&d.jsx("option",{value:"",children:o}),i.map(C=>d.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),d.jsxs("button",{ref:E,type:"button",role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-controls":x?`${g}-listbox`:void 0,"aria-activedescendant":x&&v>=0?`${g}-option-${v}`:void 0,className:X(We.trigger,We[r],n&&We.error,x&&We.open,f&&We.disabled),onClick:()=>x?z():I(),onKeyDown:D,disabled:f,children:[d.jsx("span",{className:X(We.triggerLabel,!R&&We.placeholder),children:L}),d.jsx(IV,{className:X(We.chevron,x&&We.chevronOpen)}),d.jsx(qt,{fill:!0,...Yt.field})]}),x&&S&&Ni.createPortal(d.jsxs("div",{ref:T,id:`${g}-listbox`,role:"listbox",tabIndex:-1,className:We.dropdown,style:{...V,position:"fixed",top:S.bottom+6,left:S.left,width:S.width},onKeyDown:C=>{var U;C.key==="Escape"&&(C.preventDefault(),z(),(U=E.current)==null||U.focus())},children:[d.jsx(qt,{fill:!0,...Yt.surface}),d.jsx("div",{className:We.options,children:i.map((C,U)=>d.jsx("div",{id:`${g}-option-${U}`,role:"option","aria-selected":C.value===N,tabIndex:-1,"data-option-index":U,className:X(We.option,C.value===N&&We.optionSelected,U===v&&We.optionHighlighted,C.disabled&&We.optionDisabled),onClick:Q=>{Q.stopPropagation(),$(C)},onMouseEnter:()=>b(U),children:C.label},C.value))})]}),document.body),t&&d.jsx("span",{className:X(We.helperText,n&&We.helperError),children:t})]})}function IV({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 RP({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 AV="alert-module__alert___j7ZRS",RV="alert-module__surface___IaVgU",LV="alert-module__iconWrapper___kLoxT",MV="alert-module__message___klR2U",$V="alert-module__dismiss___f2uoG",DV="alert-module__info___PBo1l",OV="alert-module__success___AVBKS",zV="alert-module__warning___zkMaJ",FV="alert-module__error___cxg96",BV="alert-module__chalkboard___7pgWk",qs={alert:AV,surface:RV,iconWrapper:LV,message:MV,dismiss:$V,info:DV,success:OV,warning:zV,error:FV,chalkboard:BV};function LP({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:X(qs.alert,qs[t],a&&qs.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:qs.surface,style:a?void 0:ia(r)}),d.jsx("span",{className:qs.iconWrapper,children:d.jsx(RP,{variant:t})}),d.jsx("div",{className:qs.message,children:e}),s&&d.jsx("button",{type:"button",className:qs.dismiss,onClick:i,"aria-label":"Dismiss alert",children:d.jsx(Go,{size:16})})]})}const VV="modal-module__overlay___a52Ni",UV="modal-module__fadeIn___5OWd5",WV="modal-module__backdrop___RS4yj",KV="modal-module__modal___ZioOV",HV="modal-module__slideUp___vfFrm",GV="modal-module__small___hcxwF",ZV="modal-module__medium___mjbM5",qV="modal-module__large___1dzyf",YV="modal-module__header___iP09B",JV="modal-module__title___nj06m",QV="modal-module__close___gQou9",XV="modal-module__body___Y-EdA",e6="modal-module__chalkboard___qY8qo",Er={overlay:VV,fadeIn:UV,backdrop:WV,modal:KV,slideUp:HV,small:GV,medium:ZV,large:qV,header:YV,title:JV,close:QV,body:XV,chalkboard:e6},t6='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Fs({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=k.useId(),c=k.useRef(null),u=k.useRef(null);if(zf(e,t),k.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=g=>{var x;if(g.key!=="Tab")return;const y=(x=c.current)==null?void 0:x.querySelectorAll(t6);if(!y||y.length===0){g.preventDefault();return}const v=y[0],b=y[y.length-1];g.shiftKey&&document.activeElement===v?(g.preventDefault(),b.focus()):!g.shiftKey&&document.activeElement===b&&(g.preventDefault(),v.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var g,x;document.removeEventListener("keydown",p),document.body.style.overflow=m,(x=(g=u.current)==null?void 0:g.focus)==null||x.call(g)}},[e]),!e||typeof document>"u")return null;const f=ia(o);return Ni.createPortal(d.jsxs("div",{className:Er.overlay,children:[d.jsx("button",{type:"button",className:Er.backdrop,"aria-label":"Close modal",onClick:t}),d.jsxs("div",{ref:c,className:X(Er.modal,Er[s],i==="chalkboard"&&Er.chalkboard,a),style:f,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[d.jsxs("div",{className:Er.header,children:[n&&d.jsx("h2",{id:l,className:Er.title,children:n}),d.jsx("button",{type:"button",className:Er.close,onClick:t,"aria-label":"Close modal",children:d.jsx(Go,{size:18})})]}),d.jsx("div",{className:Er.body,children:r})]})]}),document.body)}const n6="textarea-module__wrapper___NbiNO",r6="textarea-module__label___ejhyZ",s6="textarea-module__field___KluQf",i6="textarea-module__textarea___0y-7v",o6="textarea-module__resizeGrip___lONlE",a6="textarea-module__small___yPyr8",l6="textarea-module__medium___ezQxA",c6="textarea-module__large___xfeKi",u6="textarea-module__error___EkXKJ",d6="textarea-module__disabled___9CKbb",f6="textarea-module__helperText___l1sPh",h6="textarea-module__helperError___VfTLy",p6="textarea-module__chalkboard___zZ0X0",Bn={wrapper:n6,label:r6,field:s6,textarea:i6,resizeGrip:o6,small:a6,medium:l6,large:c6,error:u6,disabled:d6,helperText:f6,helperError:h6,chalkboard:p6},m6=48,Zx=k.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=k.useId(),u=o??c,f=k.useRef(null),h=k.useCallback(m=>{f.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=k.useCallback(m=>{const g=f.current;if(!g)return;m.preventDefault();const x=m.clientY,y=g.offsetHeight,v=w=>{g.style.height=`${Math.max(m6,y+w.clientY-x)}px`},b=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",b)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",b)},[]);return d.jsxs("div",{className:X(Bn.wrapper,s==="chalkboard"&&Bn.chalkboard,i),children:[e&&d.jsx("label",{htmlFor:u,className:Bn.label,children:e}),d.jsxs("span",{className:X(Bn.field,Bn[r],n&&Bn.error,a.disabled&&Bn.disabled),children:[d.jsx("textarea",{ref:h,id:u,className:Bn.textarea,...a}),d.jsx(qt,{fill:!0,...Yt.field}),!a.disabled&&d.jsx("span",{className:Bn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:d.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[d.jsx("path",{d:"M11 4.5 L4.5 11"}),d.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&d.jsx("span",{className:X(Bn.helperText,n&&Bn.helperError),children:t})]})}),g6="progress-module__track___a5BMO",y6="progress-module__svg___3U0-E",ok={track:g6,svg:y6},Sp=300,Xr=1;function x6({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(Vf()*1e6)),c=a?wt(ne.chalkboardBorderBase,.16):wt(ne.textPrimary,.12),u=n??(a?ne.chalkboardChalk:ne.textSecondary),f=k.useMemo(()=>et.toPaths(et.rectangle(Xr,Xr,Sp-Xr*2,r-Xr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(Sp-Xr*2),0),p=k.useMemo(()=>h>0?et.toPaths(et.rectangle(Xr,Xr,h,r-Xr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return d.jsx("div",{className:X(ok.track,i),style:{height:r,borderRadius:r/2},children:d.jsxs("svg",{className:ok.svg,viewBox:`0 0 ${Sp} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[f.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g)),p.map((m,g)=>d.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g))]})})}function v6(e){const t=Vf();return k.useMemo(()=>({blob:W3({seed:t,wobble:e}),ring:K3(t,e)}),[t,e])}const b6="list-item-module__listItem___-tw9O",w6="list-item-module__clickable___GLJmd",k6="list-item-module__blobBg___O3Mzh",_6="list-item-module__blobFill___dXHk1",S6="list-item-module__blobRing___S9mas",C6="list-item-module__active___UsL8O",j6="list-item-module__small___9dphK",E6="list-item-module__medium___yGZCr",P6="list-item-module__icon___2b4wU",T6="list-item-module__label___SIzJ4",N6="list-item-module__action___qGh0-",I6="list-item-module__chalkboard___qpWuM",wn={listItem:b6,static:"list-item-module__static___qtEX6",clickable:w6,blobBg:k6,blobFill:_6,blobRing:S6,active:C6,small:j6,medium:E6,icon:P6,label:T6,action:N6,chalkboard:I6};function It({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=v6(s),u=!!l.onClick;return d.jsxs("button",{type:"button",className:X(wn.listItem,wn[r],u&&wn.clickable,!u&&!e&&wn.static,e&&wn.active,i==="chalkboard"&&wn.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[d.jsxs("svg",{className:wn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:c.blob,className:wn.blobFill}),d.jsx("path",{d:c.ring,className:wn.blobRing})]}),t&&d.jsx("span",{className:wn.icon,children:t}),d.jsx("span",{className:wn.label,children:o}),n&&d.jsx("span",{className:wn.action,children:n})]})}const A6="accordion-module__accordion___mqGl-",R6="accordion-module__header___mLfbd",L6="accordion-module__icon___Z90NR",M6="accordion-module__title___HusgG",$6="accordion-module__content___1K0td",D6="accordion-module__chalkboard___am8r4",O6="accordion-module__expanded___836xG",Ys={accordion:A6,header:R6,icon:L6,title:M6,content:$6,chalkboard:D6,expanded:O6};function Eae({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return d.jsxs("div",{className:X(Ys.accordion,n&&Ys.expanded,s==="chalkboard"&&Ys.chalkboard,i),children:[d.jsxs("button",{type:"button",className:Ys.header,onClick:r,"aria-expanded":n,children:[d.jsx("span",{className:Ys.icon,"aria-hidden":"true",children:d.jsx(AP,{size:14})}),d.jsx("span",{className:Ys.title,children:e})]}),n&&d.jsx("div",{className:Ys.content,children:t})]})}const z6="icon-module__icon___2vrJz",F6="icon-module__blobBg___ENPYJ",B6="icon-module__blobFill___IPbwQ",V6="icon-module__blobRing___1awqV",U6="icon-module__content___TaZR6",W6="icon-module__small___Xp--F",K6="icon-module__medium___tCjMB",H6="icon-module__large___vBtP7",Ui={icon:z6,blobBg:F6,blobFill:B6,blobRing:V6,content:U6,small:W6,medium:K6,large:H6},G6={small:20,medium:24,large:28};function Z6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=oa(n),o=G6[t];return d.jsxs("span",{className:X(Ui.icon,Ui[t],s),children:[d.jsxs("svg",{className:Ui.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[d.jsx("path",{d:i.blob,className:Ui.blobFill,style:r?{fill:r}:void 0}),d.jsx("path",{d:i.ring,className:Ui.blobRing})]}),d.jsx("span",{className:Ui.content,style:{width:o,height:o},children:e})]})}const q6="radio-module__wrapper___BB05E",Y6="radio-module__blobFill___p5BX4",J6="radio-module__labelLeft___ijB93",Q6="radio-module__input___M2nFJ",X6="radio-module__box___H7ofS",eU="radio-module__dot___jVJ-d",tU="radio-module__boxWrapper___Y3qis",nU="radio-module__blobBg___IR-M5",rU="radio-module__labelText___I-nu3",sU="radio-module__chalkboard___IIBqI",ir={wrapper:q6,blobFill:Y6,labelLeft:J6,input:Q6,box:X6,dot:eU,boxWrapper:tU,blobBg:nU,labelText:rU,chalkboard:sU};k.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=k.useId(),f=a??u,h=oa(n);return d.jsxs("label",{className:X(ir.wrapper,t==="left"&&ir.labelLeft,r==="chalkboard"&&ir.chalkboard,s),htmlFor:f,children:[d.jsxs("span",{className:ir.boxWrapper,children:[d.jsx("input",{ref:c,id:f,type:"radio",className:ir.input,checked:i,onChange:o,...l}),d.jsx("svg",{className:ir.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:d.jsx("path",{d:h.blob,className:ir.blobFill})}),d.jsxs("span",{className:ir.box,"aria-hidden":"true",children:[d.jsx(qt,{smooth:!0,shape:"circle",...Yt.control}),d.jsx("span",{className:ir.dot})]})]}),e&&d.jsx("span",{className:ir.labelText,children:e})]})});const iU="switch-module__wrapper___5-2P1",oU="switch-module__labelLeft___WlT-N",aU="switch-module__input___YKZRj",lU="switch-module__track___QNvnO",cU="switch-module__thumb___cunvF",uU="switch-module__small___WPIxc",dU="switch-module__medium___yPulW",fU="switch-module__large___VlKV1",hU="switch-module__labelText___9Qg39",pU="switch-module__chalkboard___qKTMz",es={wrapper:iU,labelLeft:oU,input:aU,track:lU,thumb:cU,small:uU,medium:dU,large:fU,labelText:hU,chalkboard:pU},Zd=k.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=k.useId(),f=a??u;return d.jsxs("label",{className:X(es.wrapper,es[n],t==="left"&&es.labelLeft,r==="chalkboard"&&es.chalkboard,s),htmlFor:f,children:[d.jsx("input",{ref:c,id:f,type:"checkbox",className:es.input,checked:i,onChange:o,...l}),d.jsxs("span",{className:es.track,"aria-hidden":"true",children:[d.jsx(qt,{...Yt.pill}),d.jsx("span",{className:es.thumb})]}),e&&d.jsx("span",{className:es.labelText,children:e})]})}),mU="spinner-module__spinner___FDTk2",gU="spinner-module__chalkboard___DLE1z",yU="spinner-module__svg___JnCWN",xU="spinner-module__track___xbnbo",vU="spinner-module__head___j5dWe",Da={spinner:mU,chalkboard:gU,svg:yU,track:xU,head:vU},bU={small:18,medium:28,large:40},ak=25,wU=18,lk=et.toPaths(et.circle(ak,ak,wU*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function wr({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=bU[e];return d.jsx("span",{className:X(Da.spinner,r==="chalkboard"&&Da.chalkboard,s),role:"status","aria-label":n,children:d.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:Da.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[d.jsx("path",{className:Da.track,d:lk,fill:"none",pathLength:100,strokeLinecap:"round"}),d.jsx("path",{className:Da.head,d:lk,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const kU="skeleton-module__skeleton___HCSvg",_U="skeleton-module__pulse___6eCq1",SU="skeleton-module__svg___OzxGp",CU="skeleton-module__text___v17Nv",jU="skeleton-module__rect___wqIJy",EU="skeleton-module__circle___RCmyR",Cp={skeleton:kU,pulse:_U,svg:SU,text:CU,rect:jU,circle:EU},ck={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Wi=2;function sn({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Vf()*1e6)),l=o?wt(ne.chalkboardBorderBase,.16):wt(ne.textPrimary,.09),c=k.useMemo(()=>{const[,,u,f]=ck[e],h=e==="circle"?et.ellipse(u/2,f/2,u-Wi*2,f-Wi*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):et.rectangle(Wi,Wi,u-Wi*2,f-Wi*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return et.toPaths(h)},[e,a,l]);return d.jsx("span",{className:X(Cp.skeleton,Cp[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:d.jsx("svg",{className:Cp.svg,viewBox:ck[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 PU="divider-module__horizontal___tP3rG",TU="divider-module__line___KnBes",NU="divider-module__label___WiUwZ",IU="divider-module__vertical___wBSrT",AU="divider-module__chalkboard___gXTde",Ki={horizontal:PU,line:TU,label:NU,vertical:IU,chalkboard:AU};function Zo({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Ki.chalkboard;return e==="vertical"?d.jsx("span",{className:X(Ki.vertical,s,r),role:"separator","aria-orientation":"vertical"}):d.jsxs("div",{className:X(Ki.horizontal,s,r),role:"separator",children:[d.jsx("span",{className:Ki.line}),t!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Ki.label,children:t}),d.jsx("span",{className:Ki.line})]})]})}const RU="tooltip-module__wrapper___XeVNe",LU="tooltip-module__tooltip___e-rkz",MU="tooltip-module__tooltipIn___CZbRw",$U="tooltip-module__top___78WWU",DU="tooltip-module__bottom___Irl3O",OU="tooltip-module__left___C1Ec4",zU="tooltip-module__right___oUA-Z",FU="tooltip-module__chalkboard___Um6dx",ou={wrapper:RU,tooltip:LU,tooltipIn:MU,top:$U,bottom:DU,left:OU,right:zU,chalkboard:FU},au=8,lu=8,BU=typeof window>"u"?k.useEffect:k.useLayoutEffect;function VU(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+au,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-au-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+au;break;default:r=e.top-au-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,lu),window.innerWidth-n.width-lu),r=Math.min(Math.max(r,lu),window.innerHeight-n.height-lu),{top:r,left:s}}function ge({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=k.useId(),[a,l]=k.useState(!1),[c,u]=k.useState(!1),[f,h]=k.useState(!1),[p,m]=k.useState(null),[g,x]=k.useState(null),y=k.useRef(null),v=k.useRef(null),b=k.useRef(),w=!s&&!!e&&!f&&(a||c),_=()=>{clearTimeout(b.current),b.current=setTimeout(()=>l(!0),r)},S=()=>{clearTimeout(b.current),l(!1),h(!1)},j=()=>{h(!1),u(!0)},E=()=>{u(!1),h(!1)};zf(w,()=>h(!0)),k.useEffect(()=>{if(!w){m(null);return}const P=()=>{y.current&&m(y.current.getBoundingClientRect())};return P(),window.addEventListener("scroll",P,{capture:!0,passive:!0}),window.addEventListener("resize",P,{passive:!0}),()=>{window.removeEventListener("scroll",P,{capture:!0}),window.removeEventListener("resize",P)}},[w]),BU(()=>{if(!w){x(null);return}const P=v.current;P&&x({width:P.offsetWidth,height:P.offsetHeight})},[w,e,n]),k.useEffect(()=>()=>clearTimeout(b.current),[]);const T=t.props;return d.jsxs("span",{ref:y,className:ou.wrapper,onMouseEnter:_,onMouseLeave:S,onFocus:j,onBlur:E,children:[k.cloneElement(t,{"aria-describedby":w?o:T["aria-describedby"]}),w&&p&&typeof document<"u"&&Ni.createPortal(d.jsx("span",{ref:v,id:o,role:"tooltip",className:X(ou.tooltip,ou[n],i==="chalkboard"&&ou.chalkboard),style:g?{position:"fixed",...VU(p,n,g)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const UU="toast-module__stack___hDi0s",WU="toast-module__topLeft___Luw-F",KU="toast-module__topCenter___N1DwF",HU="toast-module__topRight___Dtgau",GU="toast-module__bottomLeft___Eb2lo",ZU="toast-module__bottomCenter___gs-Yb",qU="toast-module__bottomRight___-0e2j",YU="toast-module__item___RFjtm",JU="toast-module__toastIn___9m9iN",QU="toast-module__card___ZCvJS",XU="toast-module__surface___mfMl0",e8="toast-module__iconWrapper___lnjcC",t8="toast-module__content___AlliM",n8="toast-module__title___1Oqh8",r8="toast-module__description___eiUSB",s8="toast-module__dismiss___tUGx4",i8="toast-module__info___Nh8S9",o8="toast-module__success___hlKLc",a8="toast-module__warning___XUMJt",l8="toast-module__error___pSFFC",c8="toast-module__chalkboard___c49gt",kn={stack:UU,topLeft:WU,topCenter:KU,topRight:HU,bottomLeft:GU,bottomCenter:ZU,bottomRight:qU,item:YU,toastIn:JU,card:QU,surface:XU,iconWrapper:e8,content:t8,title:n8,description:r8,dismiss:s8,info:i8,success:o8,warning:a8,error:l8,chalkboard:c8};function u8({record:e,surface:t="paper",onDismiss:n}){const r=k.useRef(e.duration),s=k.useRef(0),i=k.useRef(),o=k.useCallback(f=>{clearTimeout(i.current),!(f<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),f))},[n,e.id]);k.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:kn.item,onMouseEnter:a,onMouseLeave:l,children:d.jsxs("div",{className:X(kn.card,kn[e.variant],c&&kn.chalkboard),role:u,children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:kn.surface,style:c?void 0:ia("kraft")}),d.jsx("span",{className:kn.iconWrapper,children:d.jsx(RP,{variant:e.variant})}),d.jsxs("div",{className:kn.content,children:[e.title&&d.jsx("div",{className:kn.title,children:e.title}),d.jsx("div",{className:kn.description,children:e.description})]}),d.jsx("button",{type:"button",className:kn.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:d.jsx(Go,{size:16})})]})})}const MP=k.createContext(null);function d8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function uk({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=k.useState([]),o=k.useRef(0),a=k.useCallback(u=>{i(f=>f.filter(h=>h.id!==u))},[]),l=k.useCallback(u=>{o.current+=1;const f=`toast-${o.current}`;return i(h=>[...h,{id:f,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),f},[r]),c=t.startsWith("top")?[...s].reverse():s;return d.jsxs(MP.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ni.createPortal(d.jsx("div",{className:X(kn.stack,kn[d8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>d.jsx(u8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function Ye(){const e=k.useContext(MP);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const f8="breadcrumb-module__breadcrumb___r-ILp",h8="breadcrumb-module__list___V3YFy",p8="breadcrumb-module__item___dDwYf",m8="breadcrumb-module__link___CHC9k",g8="breadcrumb-module__linkButton___XoMW-",y8="breadcrumb-module__current___dprI9",x8="breadcrumb-module__separator___uLhtn",v8="breadcrumb-module__chalkboard___COJpw",or={breadcrumb:f8,list:h8,item:p8,link:m8,linkButton:g8,current:y8,static:"breadcrumb-module__static___affaf",separator:x8,chalkboard:v8};function b8({items:e,surface:t="paper",className:n}){return d.jsx("nav",{"aria-label":"Breadcrumb",className:X(or.breadcrumb,t==="chalkboard"&&or.chalkboard,n),children:d.jsx("ol",{className:or.list,children:e.map((r,s)=>{const i=s===e.length-1;return d.jsxs("li",{className:or.item,children:[i?d.jsx("span",{className:or.current,"aria-current":"page",children:r.label}):r.href?d.jsx("a",{href:r.href,className:or.link,onClick:r.onClick,children:r.label}):r.onClick?d.jsx("button",{type:"button",className:X(or.link,or.linkButton),onClick:r.onClick,children:r.label}):d.jsx("span",{className:or.static,children:r.label}),!i&&d.jsx(w8,{className:or.separator})]},r.id)})})})}function w8({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 k8="menu-module__wrapper___WCtoy",_8="menu-module__menu___i40Wj",S8="menu-module__surface___SJbaB",C8="menu-module__list___YjCfD",j8="menu-module__item___aqcgg",E8="menu-module__icon___1qUvA",P8="menu-module__label___MtQMh",T8="menu-module__danger___p9oZo",N8="menu-module__itemDisabled___HByLP",I8="menu-module__separator___g2uay",A8="menu-module__chalkboard___5jIwI",Vn={wrapper:k8,menu:_8,surface:S8,list:C8,item:j8,icon:E8,label:P8,danger:T8,itemDisabled:N8,separator:I8,chalkboard:A8},R8=6;function L8(e){return"type"in e&&e.type==="separator"}function qx({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=k.useId(),[o,a]=k.useState(!1),[l,c]=k.useState(null),u=k.useRef(null),f=k.useRef(null),h=k.useCallback(()=>{var y,v;(v=(y=u.current)==null?void 0:y.querySelector("button, a, [tabindex]"))==null||v.focus()},[]),p=k.useCallback(()=>a(!1),[]);zf(o,()=>{p(),h()}),k.useEffect(()=>{if(!o)return;const y=v=>{var b,w;const _=v.target;(b=u.current)!=null&&b.contains(_)||(w=f.current)!=null&&w.contains(_)||p()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,p]),k.useEffect(()=>{if(!o){c(null);return}const y=()=>{u.current&&c(u.current.getBoundingClientRect())};return y(),document.addEventListener("scroll",y,{capture:!0,passive:!0}),window.addEventListener("resize",y,{passive:!0}),()=>{document.removeEventListener("scroll",y,{capture:!0}),window.removeEventListener("resize",y)}},[o]),k.useEffect(()=>{var y,v;!o||!l||(v=(y=f.current)==null?void 0:y.querySelector('[role="menuitem"]:not(:disabled)'))==null||v.focus()},[o,l]);const m=y=>{var v,b,w,_,S;const j=Array.from(((v=f.current)==null?void 0:v.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(j.length===0)return;const E=j.indexOf(document.activeElement);switch(y.key){case"ArrowDown":y.preventDefault(),(b=j[(E+1)%j.length])==null||b.focus();break;case"ArrowUp":y.preventDefault(),(w=j[(E-1+j.length)%j.length])==null||w.focus();break;case"Home":y.preventDefault(),(_=j[0])==null||_.focus();break;case"End":y.preventDefault(),(S=j[j.length-1])==null||S.focus();break;case"Tab":p();break}},g=y=>{var v;y.disabled||(p(),h(),(v=y.onSelect)==null||v.call(y))},x=e.props;return d.jsxs("span",{ref:u,className:Vn.wrapper,children:[k.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:y=>{var v;(v=x.onClick)==null||v.call(x,y),a(b=>!b)}}),o&&l&&typeof document<"u"&&Ni.createPortal(d.jsxs("div",{ref:f,id:i,role:"menu",className:X(Vn.menu,r==="chalkboard"&&Vn.chalkboard,s),style:{position:"fixed",top:l.bottom+R8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[d.jsx(qt,{clip:!0,...Yt.surface}),d.jsx("div",{className:Vn.surface}),d.jsx("div",{className:Vn.list,children:t.map(y=>L8(y)?d.jsx("div",{role:"separator",className:Vn.separator},y.id):d.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:y.disabled,className:X(Vn.item,y.danger&&Vn.danger,y.disabled&&Vn.itemDisabled),onClick:()=>g(y),children:[y.icon&&d.jsx("span",{className:Vn.icon,children:y.icon}),d.jsx("span",{className:Vn.label,children:y.label})]},y.id))})]}),document.body)]})}const $P=({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"})]}),M8=({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"})]}),$8=({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"})]}),DP=({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"})]}),OP=({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"})]}),zP=({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"})]}),D8=({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"})]}),O8=({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"})}),z8=({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"})}),F8=({size:e=12})=>d.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m7 4 6 6-6 6"})}),B8=({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"})]}),dk=({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"})]}),V8=({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"})}),FP=({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"})]}),Yx=({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"})]}),Pae=({size:e=14})=>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:"m3 12 4 4 7-8"}),d.jsx("path",{d:"m11 15 2 2 8-9"})]}),U8=({state:e,filesEmpty:t})=>d.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&d.jsx(LP,{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 min-w-[140px]",children:d.jsx(nt,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:n=>e.setCommitTitle(n.currentTarget.value)})}),d.jsx(st,{icon:d.jsx($P,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]}),W8="x-pairing-token",K8=["idea","planned","in-progress","review","done","dropped"],oc=["claude-code","opencode"],H8={"claude-code":"Claude Code",opencode:"OpenCode"},Tae={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},Nae={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"},codeReview:{agent:"claude-code",model:"opus",effort:"high"},deskDiscovery:{agent:"claude-code"}};function Iae(e,t){return e.agent===t.agent&&(e.model??"")===(t.model??"")}const G8="/api/machine/projects";let BP="",Tg=null;function Z8(e){BP=e}function q8(e){Tg=e}function K(e){return`${BP}${e}`}function J(e,t={}){if(!Tg)return fetch(e,t);const n=new Headers(t.headers);return n.set(W8,Tg),fetch(e,{...t,headers:n})}const yn=45e3;async function Xn(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const Y8=async()=>{const e=await J(K("/api/git/status"),{signal:AbortSignal.timeout(yn)});return await Xn(e,"Failed to load git status"),e.json()},J8=async()=>{const e=await J(K("/api/git/diff"),{signal:AbortSignal.timeout(yn)});return await Xn(e,"Failed to load diff"),(await e.json()).files},Q8=async e=>{const t=await J(K(`/api/git/stash-diff?index=${e}`),{signal:AbortSignal.timeout(yn)});return await Xn(t,"Failed to load stash diff"),(await t.json()).patch},Ng=async(e,t,n)=>{const r=await J(K("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n}),signal:AbortSignal.timeout(yn)});await Xn(r,"Commit failed")},X8=async e=>{const t=await J(K("/api/git/stage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(yn)});await Xn(t,"Stage failed")},Aae=async e=>{const t=await J(K("/api/git/unstage"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:AbortSignal.timeout(yn)});await Xn(t,"Unstage failed")},e9=async()=>{const e=await J(K("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(yn)});await Xn(e,"Push failed")},VP=async e=>{const t=await J(K("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Xn(t,"Failed to suggest a commit message"),t.json()},t9=async()=>{const e=await J(K("/api/git/sync"),{method:"POST",signal:AbortSignal.timeout(yn)});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 Xn(e,"Sync failed"),{ok:!0}},n9=async()=>{const e=await J(K("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(yn)});await Xn(e,"Pull failed")},r9=async()=>{const e=await J(K("/api/git/fix-divergence"),{method:"POST",signal:AbortSignal.timeout(yn)});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 Xn(e,"Fix failed"),{ok:!0}},s9=async e=>{const t=await J(K("/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})`}}},i9=async e=>{const t=await J(K("/api/git/complete-idea"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(yn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to complete idea");return{branch:n.branch,remoteDeleted:n.remoteDeleted,needsAttention:n.needsAttention}},o9=async e=>{const t=await J(K("/api/git/verify-direct-completion"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(yn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to verify completion");return{ready:n.ready,missing:n.missing}},a9=async e=>{const t=await J(K("/api/git/branch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e}),signal:AbortSignal.timeout(yn)}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return{branch:n.branch,warning:n.warning}},l9={},fk=e=>{let t;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(l9?"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},c9=e=>e?fk(e):fk,UP={},{useDebugValue:u9}=Ro,{useSyncExternalStoreWithSelector:d9}=dM;let hk=!1;const f9=e=>e;function h9(e,t=f9,n){(UP?"production":void 0)!=="production"&&n&&!hk&&(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"),hk=!0);const r=d9(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return u9(r),r}const p9=e=>{(UP?"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"?c9(e):e,n=(r,s)=>h9(t,r,s);return Object.assign(n,t),n},m9=e=>p9,WP=async()=>{const e=await fetch(K("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},g9=async e=>{try{const t=await fetch(`${e}/api/capabilities`);return t.ok?(await t.json()).version??null:null}catch{return null}},y9=async()=>{const e=await fetch(K("/api/agent/auth-status"));return e.ok?await e.json():null},Rae=async()=>{try{const e=await fetch(K("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},x9=async(e=!1)=>{try{const t=await fetch(K(`/api/tailnet/peers${e?"?refresh=1":""}`));return t.ok?(await t.json()).peers:null}catch{return null}},v9=async e=>{try{const t=await fetch(`${e}${G8}`);return t.ok?(await t.json()).projects:null}catch{return null}},Lae=async e=>{try{const t=await fetch(K(`/api/connections/connect?id=${encodeURIComponent(e)}`),{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},qd=async()=>{try{const e=await fetch(K("/api/config"));return e.ok?e.json():null}catch{return null}},b9=async e=>{try{const t=await fetch(K("/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}}},w9=async()=>{try{const e=await fetch(K("/api/desk/discover"),{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),t=await e.json().catch(()=>null);return e.ok?{ok:!0,proposal:t==null?void 0:t.proposal}:{ok:!1,error:t==null?void 0:t.error}}catch(e){return{ok:!1,error:e.message}}},k9=async()=>{try{const e=await fetch(K("/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}},Mae=async e=>{try{return(await fetch(K("/api/icon"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},KP=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),_9=async e=>{try{const t=await fetch(`${e}/api/package-name`);return t.ok?t.json():null}catch{return null}},S9=async()=>{try{const e=await fetch(K("/api/package-name"));return e.ok?e.json():null}catch{return null}},xn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},C9=async()=>(await J(K("/api/agent/status"))).json(),j9=async()=>(await J(K("/api/agent/reconcile-queue"))).json(),E9=async(e,t)=>{const n=await J(K("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await xn(n)},P9=async(e,t)=>{const n=await J(K("/api/agent/launch-audit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await xn(n)},T9=async(e,t)=>{const n=await J(K("/api/agent/launch-reconcile"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await xn(n)},N9=async(e,t)=>{const n=await J(K("/api/agent/launch-draft"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await xn(n)},I9=async(e,t)=>{const n=await J(K("/api/agent/launch-extend"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await xn(n)},A9=async e=>{const t=await J(K("/api/agent/launch-suggest"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await xn(t)},R9=async()=>{const e=await J(K("/api/agent/launch-reconcile-all"),{method:"POST"});await xn(e)},L9=async e=>{const t=await J(K("/api/agent/launch-draft-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})});await xn(t)},M9=async e=>{const t=await J(K("/api/agent/launch-run-all"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await xn(t)},$9=async e=>{const t=await J(K("/api/agent/launch-fix-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await xn(t)},D9=async e=>{const t=await J(K("/api/agent/launch-pr-review"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await xn(t)},O9=async(e,t,n,r)=>{const s=await J(K("/api/agent/issue-fix"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e,title:t,reason:n,output:r})});await xn(s)},$ae=async e=>{const t=await J(K("/api/agent/promote-issue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issue:e})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)??`Failed to promote issue (${t.status})`);return n},z9=async e=>{try{const t=await fetch(K(`/api/agent/pr-review-status?planId=${encodeURIComponent(e)}`));return t.ok?t.json():null}catch{return null}},F9=async(e,t,n)=>{const r=await J(K("/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},pk=async(e,t,n,r)=>{const s=await J(K("/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})`)}},B9=async e=>{const t=await J(K("/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},V9=async(e,t)=>{const n=await J(K("/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},U9=async e=>{const t=await J(K("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await xn(t,"Stop failed")},W9=async()=>(await J(K("/api/agent/login-relay/start"),{method:"POST"})).json(),K9=async()=>(await J(K("/api/agent/login-relay/status"))).json(),H9=async()=>{await J(K("/api/agent/login-relay/cancel"),{method:"POST"})},G9=async()=>{const e=await J(K("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},HP=async e=>{const t=await J(K(`/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 _t(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 Un(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let Z9=0;const mk=()=>`preview-${++Z9}`;function q9(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:_t(e,y9,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await C9(),r=t().agentStatus;if(e({agentStatus:n}),n.some(u=>{if(u.taskKind!=="issue-fix"||u.status!=="done"&&u.status!=="error")return!1;const f=r.find(h=>h.id===u.id);return f&&f.status!=="done"&&f.status!=="error"})&&t().loadTaskLog(),n.find(u=>{var h;if(u.status!=="done"||u.taskKind!=="run-all"&&u.taskKind!=="phase")return!1;const f=r.find(p=>p.id===u.id);if(!f||f.status==="done"||f.status==="error")return!1;if(u.taskKind==="phase"){const p=(h=t().plans)==null?void 0:h.entries.find(m=>m.id===u.planId);if(!p||u.phaseIndex!==p.phases.length-1)return!1}return!0})){t().runConsistencyCheck();for(const u of["lint","test"])HP(u).catch(()=>{})}const o=t().pendingReconcile,a=o?n.find(u=>u.taskKind==="reconcile"&&u.planId===o.planId):void 0;o&&a&&(a.status==="done"?(await t().loadPlans(),e(u=>({reconcileQueue:[...u.reconcileQueue,{...o,previewId:mk()}],pendingReconcile:null}))):a.status==="error"&&e({pendingReconcile:null}));const l=n.find(u=>u.taskKind==="batch-reconcile"||u.taskKind==="batch-draft"),c=(l==null?void 0:l.taskKind)==="batch-draft"?l.status==="done"||l.status==="error":(l==null?void 0:l.status)==="done";if(l&&c&&!t().batchReconcileConsumed){if(l.taskKind==="batch-reconcile"){const u=await j9();u&&u.length>0&&(await t().loadPlans(),e(f=>({reconcileQueue:[...f.reconcileQueue,...u.map(h=>({planId:h.planId,before:h.before,previewId:mk()}))]})))}else await t().loadPlans();e({batchReconcileConsumed:!0})}}catch{}},launchAgent:Un(t,E9),launchPlanAudit:Un(t,P9),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 T9(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:Un(t,N9),launchIdeaExtend:Un(t,I9),launchBatchReconcile:Un(t,async()=>{e({batchReconcileConsumed:!1}),await R9()}),launchBatchDraft:Un(t,async n=>{e({batchReconcileConsumed:!1}),await L9(n)}),launchSuggestIdeas:Un(t,A9),launchRunAll:Un(t,M9),launchFixReview:Un(t,$9),launchPrReview:Un(t,D9),launchIssueFix:Un(t,O9),stopAgent:async n=>{try{await U9(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await W9();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:_t(e,K9,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await H9()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}function Y9(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:_t(e,J8,n=>({diffFiles:n,diffLoadFailed:!1}),()=>({diffLoadFailed:!0})),activeDiffPath:null,setActiveDiffPath:n=>{t().activeDiffPath!==n&&e({activeDiffPath:n})},manuallyExpandedDiffPaths:new Set,manuallyCollapsedDiffPaths:new Set,setDiffCollapsed:(n,r)=>{e(s=>{const i=new Set(s.manuallyExpandedDiffPaths),o=new Set(s.manuallyCollapsedDiffPaths);return r?(o.add(n),i.delete(n)):(i.add(n),o.delete(n)),{manuallyExpandedDiffPaths:i,manuallyCollapsedDiffPaths:o}})},expandDiffPath:n=>t().setDiffCollapsed(n,!1)}}const J9=async()=>(await fetch(K("/api/tasks"))).json(),Dae=async e=>{const t=await fetch(K(`/api/tasks/output?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},Q9=async()=>(await fetch(K("/api/suggestions"))).json(),X9=async e=>{const t=await fetch(K("/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()},eW=async e=>{const t=await fetch(K("/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)}},tW=async()=>(await fetch(K("/api/docs"))).json(),GP=async()=>{const e=await fetch(K("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},nW=async(e,t,n,r)=>{const s=await fetch(K("/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()},Oae=async(e,t,n)=>{const r=await fetch(K("/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)}},zae=async(e,t,n)=>{const r=await fetch(K("/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)}},rW=async()=>(await fetch(K("/api/consistency"))).json(),sW=async()=>(await fetch(K("/api/doctor"))).json(),iW=45e3,ZP=async()=>(await fetch(K("/api/ideas"),{signal:AbortSignal.timeout(iW)})).json(),oW=async()=>(await fetch(K("/api/archivable-ideas"))).json(),aW=async e=>{const t=await fetch(K("/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},qP=async e=>{const t=await fetch(K("/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},lW=async e=>{const t=await fetch(K("/api/tickets"),{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 ticket");return n.id},cW=async(e,t)=>{const n=await fetch(K("/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},uW=async()=>{const e=await fetch(K("/api/ideas/prioritise"),{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},dW=async()=>{const e=await fetch(K("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},fW=async e=>{const t=await fetch(K("/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}`)},hW=async()=>{const e=await fetch(K("/api/parked-questions"));if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},pW=45e3,YP=async()=>(await fetch(K("/api/plans"),{signal:AbortSignal.timeout(pW)})).json(),mW=async(e,t)=>{const n=await fetch(K(`/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})`)}},gW=async()=>{const e=await J(K("/api/releases"));if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},Fae=async e=>{const t=await J(K(`/api/release-notes?version=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function yW(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await tW();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 gW();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}const Jx="papercamp:github-corpus";function JP(){try{const e=localStorage.getItem(Jx);if(!e)return null;const t=JSON.parse(e);return!t.token||!t.owner||!t.repo?null:{token:t.token,owner:t.owner,repo:t.repo}}catch{return null}}function QP(e){try{localStorage.setItem(Jx,JSON.stringify(e))}catch{}}function xW(){try{localStorage.removeItem(Jx)}catch{}}function vW(e){return{githubConfig:JP(),setGithubConfig:t=>{QP(t),e({githubConfig:t})},clearGithubConfig:()=>{xW(),e({githubConfig:null})}}}function bW(e){return e.archived===!0||e.status==="done"}function wW(e){const t=e.phases.length>0&&e.phases.every(r=>r.done),n=(e.fixes??[]).every(r=>r.done);return t&&n}function kW(e,t,n,r=!1){return e.kind==="note"||e.status==="dropped"?e.status:e.archived?"done":n?e.status==="review"||e.status==="done"?e.status:r&&e.phases.length>0?wW(e)?"review":"in-progress":e.phases.length>0?"planned":"idea":e.status??(e.phases.length>0?"planned":"idea")}function _W(e,t,n){return e.kind==="note"||e.kind==="board"||e.status==="dropped"||e.archived?!1:!n}function SW(e=[],t=[],n=[],r=[]){const s=[...e.map(o=>({kind:"log",date:o.date,text:o.text})),...t.map(o=>({kind:"clarification",date:o.date,text:o.text})),...r.map(o=>({kind:"review",date:o.date,text:o.text}))].sort((o,a)=>o.date.localeCompare(a.date)),i=n.map(o=>({kind:o.kind??"note",text:o.anchor.kind==="phase"?`[phase ${o.anchor.index}] ${o.prose}`:o.prose,state:o.state}));return[...s,...i]}function Qx(e,t){return e.filter(n=>n.kind===t).map(n=>({date:n.date??"",text:n.text}))}function XP(e=[]){return Qx(e,"log")}function CW(e=[]){return Qx(e,"clarification")}function jW(e=[]){return Qx(e,"review")}function EW(e=[]){return e.filter(t=>t.kind==="note"||t.kind==="decision"||t.kind==="question").map(t=>({anchor:{kind:"body"},prose:t.text,state:t.state??"open",kind:t.kind}))}function PW(e,t,n){return[...(e??[]).filter(r=>!t.includes(r.kind)),...n]}function eT(e,t,n=!1,r=!1){return{title:e.title,status:kW(e,t,n,r),statusFallback:_W(e,t,n),kind:e.type,entityKind:e.kind==="note"?void 0:e.kind,id:e.id,idea:e.idea,agent:e.agent,created:e.created,updated:e.updated,audited:e.audited,auditedHash:e.auditedHash,released:e.released,tags:e.tags,subject:e.subject,order:e.order,issueSource:e.issueSource,body:e.body,phases:e.phases,fixes:e.fixes,log:XP(e.thread),clarifications:CW(e.thread),notes:EW(e.thread),review:jW(e.thread),thread:e.thread,archived:e.archived,pr:t}}function TW(e){return{id:e.id,title:e.title,body:e.body,kind:"note",status:e.status,subject:e.subject,order:e.order,created:e.created,log:XP(e.thread)}}const Xx=Symbol.for("yaml.alias"),Ig=Symbol.for("yaml.document"),Ps=Symbol.for("yaml.map"),tT=Symbol.for("yaml.pair"),vr=Symbol.for("yaml.scalar"),aa=Symbol.for("yaml.seq"),Mn=Symbol.for("yaml.node.type"),la=e=>!!e&&typeof e=="object"&&e[Mn]===Xx,ac=e=>!!e&&typeof e=="object"&&e[Mn]===Ig,lc=e=>!!e&&typeof e=="object"&&e[Mn]===Ps,qe=e=>!!e&&typeof e=="object"&&e[Mn]===tT,Ne=e=>!!e&&typeof e=="object"&&e[Mn]===vr,cc=e=>!!e&&typeof e=="object"&&e[Mn]===aa;function He(e){if(e&&typeof e=="object")switch(e[Mn]){case Ps:case aa:return!0}return!1}function Ze(e){if(e&&typeof e=="object")switch(e[Mn]){case Xx:case Ps:case vr:case aa:return!0}return!1}const nT=e=>(Ne(e)||He(e))&&!!e.anchor,ni=Symbol("break visit"),NW=Symbol("skip children"),cl=Symbol("remove node");function ca(e,t){const n=IW(t);ac(e)?mo(null,e.contents,n,Object.freeze([e]))===cl&&(e.contents=null):mo(null,e,n,Object.freeze([]))}ca.BREAK=ni;ca.SKIP=NW;ca.REMOVE=cl;function mo(e,t,n,r){const s=AW(e,t,n,r);if(Ze(s)||qe(s))return RW(e,r,s),mo(e,s,n,r);if(typeof s!="symbol"){if(He(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const o=mo(i,t.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===ni)return ni;o===cl&&(t.items.splice(i,1),i-=1)}}}else if(qe(t)){r=Object.freeze(r.concat(t));const i=mo("key",t.key,n,r);if(i===ni)return ni;i===cl&&(t.key=null);const o=mo("value",t.value,n,r);if(o===ni)return ni;o===cl&&(t.value=null)}}return s}function IW(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function AW(e,t,n,r){var s,i,o,a,l;if(typeof n=="function")return n(e,t,r);if(lc(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(cc(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,r);if(qe(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,r);if(Ne(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,r);if(la(t))return(l=n.Alias)==null?void 0:l.call(n,e,t,r)}function RW(e,t,n){const r=t[t.length-1];if(He(r))r.items[e]=n;else if(qe(r))e==="key"?r.key=n:r.value=n;else if(ac(r))r.contents=n;else{const s=la(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const LW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},MW=e=>e.replace(/[!,[\]{}]/g,t=>LW[t]);class Nt{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Nt.defaultYaml,t),this.tags=Object.assign({},Nt.defaultTags,n)}clone(){const t=new Nt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Nt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Nt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Nt.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Nt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Nt.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+MW(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&Ze(t.contents)){const i={};ca(t.contents,(o,a)=>{Ze(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
|
|
66
|
+
`)}}Nt.defaultYaml={explicit:!1,version:"1.2"};Nt.defaultTags={"!!":"tag:yaml.org,2002:"};function rT(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function sT(e){const t=new Set;return ca(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function iT(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function $W(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=sT(e));const o=iT(t,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Ne(o.node)||He(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function go(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=go(e,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=go(e,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=go(e,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=go(e,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return e.call(t,n,r)}function An(e,t,n){if(Array.isArray(e))return e.map((r,s)=>An(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!nT(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class ev{constructor(t){Object.defineProperty(this,Mn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!ac(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=An(this,"",o);if(typeof s=="function")for(const{count:l,res:c}of o.anchors.values())s(c,l);return typeof i=="function"?go(i,{"":a},"",a):a}}class tv extends ev{constructor(t){super(Xx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],ca(t,{Node:(i,o)=>{(la(o)||nT(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(An(o,null,n),a=r.get(o)),(a==null?void 0:a.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Yu(s,o,r)),a.count*a.aliasCount>i)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(rT(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function Yu(e,t,n){if(la(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(He(t)){let r=0;for(const s of t.items){const i=Yu(e,s,n);i>r&&(r=i)}return r}else if(qe(t)){const r=Yu(e,t.key,n),s=Yu(e,t.value,n);return Math.max(r,s)}return 1}const oT=e=>!e||typeof e!="function"&&typeof e!="object";class ae extends ev{constructor(t){super(vr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:An(this.value,t,n)}toString(){return String(this.value)}}ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";const DW="tag:yaml.org,2002:";function OW(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function Vl(e,t,n){var f,h,p;if(ac(e)&&(e=e.contents),Ze(e))return e;if(qe(e)){const m=(h=(f=n.schema[Ps]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let l;if(r&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=s(e)),new tv(l.anchor);l={anchor:null,node:null},a.set(e,l)}t!=null&&t.startsWith("!!")&&(t=DW+t.slice(2));let c=OW(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new ae(e);return l&&(l.node=m),m}c=e instanceof Map?o[Ps]:Symbol.iterator in Object(e)?o[aa]:o[Ps]}i&&(i(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,e,n):typeof((p=c==null?void 0:c.nodeClass)==null?void 0:p.from)=="function"?c.nodeClass.from(n.schema,e,n):new ae(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Yd(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Vl(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ga=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class aT extends ev{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Ze(r)||qe(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ga(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(He(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Yd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(He(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&Ne(i)?i.value:i:He(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!qe(n))return!1;const r=n.value;return r==null||t&&Ne(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return He(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(He(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Yd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const zW=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function $r(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ui=(e,t,n)=>e.endsWith(`
|
|
67
|
+
`)?$r(n,t):n.includes(`
|
|
68
|
+
`)?`
|
|
69
|
+
`+$r(n,t):(e.endsWith(" ")?"":" ")+n,lT="flow",Ag="block",Ju="quoted";function Uf(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const l=Math.max(1+i,1+s-t.length);if(e.length<=l)return e;const c=[],u={};let f=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?c.push(0):f=s-r);let h,p,m=!1,g=-1,x=-1,y=-1;n===Ag&&(g=gk(e,g,t.length),g!==-1&&(f=g+l));for(let b;b=e[g+=1];){if(n===Ju&&b==="\\"){switch(x=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(b===`
|
|
70
|
+
`)n===Ag&&(g=gk(e,g,t.length)),f=g+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==`
|
|
71
|
+
`&&p!==" "){const w=e[g+1];w&&w!==" "&&w!==`
|
|
72
|
+
`&&w!==" "&&(h=g)}if(g>=f)if(h)c.push(h),f=h+l,h=void 0;else if(n===Ju){for(;p===" "||p===" ";)p=b,b=e[g+=1],m=!0;const w=g>y+1?g-2:x-1;if(u[w])return e;c.push(w),u[w]=!0,f=w+l,h=void 0}else m=!0}p=b}if(m&&a&&a(),c.length===0)return e;o&&o();let v=e.slice(0,c[0]);for(let b=0;b<c.length;++b){const w=c[b],_=c[b+1]||e.length;w===0?v=`
|
|
73
|
+
${t}${e.slice(0,_)}`:(n===Ju&&u[w]&&(v+=`${e[w]}\\`),v+=`
|
|
74
|
+
${t}${e.slice(w+1,_)}`)}return v}function gk(e,t,n){let r=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
75
|
+
`);r=t,s=t+1,i=e[s]}return r}const Wf=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Kf=e=>/^(%|---|\.\.\.)/m.test(e);function FW(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(e[i]===`
|
|
76
|
+
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function ul(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Kf(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
|
|
77
|
+
|
|
78
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
|
|
79
|
+
`,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,r?o:Uf(o,i,Ju,Wf(t,!1))}function Rg(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
80
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return ul(e,t);const n=t.indent||(Kf(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
81
|
+
${n}`)+"'";return t.implicitKey?r:Uf(r,n,lT,Wf(t,!1))}function yo(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=ul;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Rg:i&&!s?r=ul:r=n?Rg:ul}return r(e,t)}let Lg;try{Lg=new RegExp(`(^|(?<!
|
|
82
|
+
))
|
|
83
|
+
+(?!
|
|
84
|
+
|$)`,"g")}catch{Lg=/\n+(?!\n|$)/g}function Qu({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:l}=r.options;if(!o||/\n[\t ]+$/.test(n))return yo(n,r);const c=r.indent||(r.forceBlockIndent||Kf(n)?" ":""),u=o==="literal"?!0:o==="folded"||t===ae.BLOCK_FOLDED?!1:t===ae.BLOCK_LITERAL?!0:!FW(n,l,c.length);if(!n)return u?`|
|
|
85
|
+
`:`>
|
|
86
|
+
`;let f,h;for(h=n.length;h>0;--h){const _=n[h-1];if(_!==`
|
|
87
|
+
`&&_!==" "&&_!==" ")break}let p=n.substring(h);const m=p.indexOf(`
|
|
88
|
+
`);m===-1?f="-":n===p||m!==p.length-1?(f="+",i&&i()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
89
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Lg,`$&${c}`));let g=!1,x,y=-1;for(x=0;x<n.length;++x){const _=n[x];if(_===" ")g=!0;else if(_===`
|
|
90
|
+
`)y=x;else break}let v=n.substring(0,y<x?y+1:x);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let w=(g?c?"2":"1":"")+f;if(e&&(w+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){const _=n.replace(/\n+/g,`
|
|
91
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let S=!1;const j=Wf(r,!0);o!=="folded"&&t!==ae.BLOCK_FOLDED&&(j.onOverflow=()=>{S=!0});const E=Uf(`${v}${_}${p}`,c,Ag,j);if(!S)return`>${w}
|
|
92
|
+
${c}${E}`}return n=n.replace(/\n+/g,`$&${c}`),`|${w}
|
|
93
|
+
${c}${v}${n}${p}`}function BW(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&i.includes(`
|
|
94
|
+
`)||u&&/[[\]{},]/.test(i))return yo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
95
|
+
`)?yo(i,t):Qu(e,t,n,r);if(!a&&!u&&s!==ae.PLAIN&&i.includes(`
|
|
96
|
+
`))return Qu(e,t,n,r);if(Kf(i)){if(l==="")return t.forceBlockIndent=!0,Qu(e,t,n,r);if(a&&l===c)return yo(i,t)}const f=i.replace(/\n+/g,`$&
|
|
97
|
+
${l}`);if(o){const h=g=>{var x;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((x=g.test)==null?void 0:x.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return yo(i,t)}return a?f:Uf(f,l,lT,Wf(t,!1))}function nv(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ae.QUOTE_DOUBLE);const l=u=>{switch(u){case ae.BLOCK_FOLDED:case ae.BLOCK_LITERAL:return s||i?yo(o.value,t):Qu(o,t,n,r);case ae.QUOTE_DOUBLE:return ul(o.value,t);case ae.QUOTE_SINGLE:return Rg(o.value,t);case ae.PLAIN:return BW(o,t,n,r);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:f}=t.options,h=s&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function cT(e,t){const n=Object.assign({blockQuote:!0,commentString:zW,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function VW(e,t){var s;if(t.tag){const i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n,r;if(Ne(t)){r=t.value;let i=e.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,r)});if(i.length>1){const o=i.filter(a=>a.test);o.length>0&&(i=o)}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function UW(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Ne(e)||He(e))&&e.anchor;i&&rT(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function qo(e,t,n,r){var l;if(qe(e))return e.toString(t,n,r);if(la(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=Ze(e)?e:t.doc.createNode(e,{onTagObj:c=>s=c});s??(s=VW(t.doc.schema.tags,i));const o=UW(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,t,n,r):Ne(i)?nv(i,t,n,r):i.toString(t,n,r);return o?Ne(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
98
|
+
${t.indent}${a}`:a}function WW({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n;let h=Ze(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(He(e)||!Ze(e)&&typeof e=="object"){const j="With simple keys, collection cannot be used as a key value";throw new Error(j)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||He(e)||(Ne(e)?e.type===ae.BLOCK_FOLDED||e.type===ae.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:a+l});let m=!1,g=!1,x=qo(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&x.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),x===""?"?":p?`? ${x}`:x}else if(i&&!f||t==null&&p)return x=`? ${x}`,h&&!m?x+=ui(x,n.indent,c(h)):g&&s&&s(),x;m&&(h=null),p?(h&&(x+=ui(x,n.indent,c(h))),x=`? ${x}
|
|
99
|
+
${a}:`):(x=`${x}:`,h&&(x+=ui(x,n.indent,c(h))));let y,v,b;Ze(t)?(y=!!t.spaceBefore,v=t.commentBefore,b=t.comment):(y=!1,v=null,b=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!h&&Ne(t)&&(n.indentAtStart=x.length+1),g=!1,!u&&l.length>=2&&!n.inFlow&&!p&&cc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const _=qo(t,n,()=>w=!0,()=>g=!0);let S=" ";if(h||y||v){if(S=y?`
|
|
100
|
+
`:"",v){const j=c(v);S+=`
|
|
101
|
+
${$r(j,n.indent)}`}_===""&&!n.inFlow?S===`
|
|
102
|
+
`&&b&&(S=`
|
|
103
|
+
|
|
104
|
+
`):S+=`
|
|
105
|
+
${n.indent}`}else if(!p&&He(t)){const j=_[0],E=_.indexOf(`
|
|
106
|
+
`),T=E!==-1,P=n.inFlow??t.flow??t.items.length===0;if(T||!P){let N=!1;if(T&&(j==="&"||j==="!")){let R=_.indexOf(" ");j==="&"&&R!==-1&&R<E&&_[R+1]==="!"&&(R=_.indexOf(" ",R+1)),(R===-1||E<R)&&(N=!0)}N||(S=`
|
|
107
|
+
${n.indent}`)}}else(_===""||_[0]===`
|
|
108
|
+
`)&&(S="");return x+=S+_,n.inFlow?w&&r&&r():b&&!w?x+=ui(x,n.indent,c(b)):g&&s&&s(),x}function uT(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const cu="<<",zr={identify:e=>e===cu||typeof e=="symbol"&&e.description===cu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ae(Symbol(cu)),{addToJSMap:dT}),stringify:()=>cu},KW=(e,t)=>(zr.identify(t)||Ne(t)&&(!t.type||t.type===ae.PLAIN)&&zr.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===zr.tag&&n.default));function dT(e,t,n){const r=fT(e,n);if(cc(r))for(const s of r.items)jp(e,t,s);else if(Array.isArray(r))for(const s of r)jp(e,t,s);else jp(e,t,r)}function jp(e,t,n){const r=fT(e,n);if(!lc(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,o]of s)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function fT(e,t){return e&&la(t)?t.resolve(e.doc,e):t}function hT(e,t,{key:n,value:r}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(KW(e,n))dT(e,t,r);else{const s=An(n,"",e);if(t instanceof Map)t.set(s,An(r,s,e));else if(t instanceof Set)t.add(s);else{const i=HW(n,s,e),o=An(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function HW(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const r=cT(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),uT(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function rv(e,t,n){const r=Vl(e,void 0,n),s=Vl(t,void 0,n);return new Mt(r,s)}class Mt{constructor(t,n=null){Object.defineProperty(this,Mn,{value:tT}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Ze(n)&&(n=n.clone(t)),Ze(r)&&(r=r.clone(t)),new Mt(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return hT(n,r,this)}toString(t,n,r){return t!=null&&t.doc?WW(this,t,n,r):JSON.stringify(this)}}function pT(e,t,n){return(t.inFlow??e.flow?ZW:GW)(e,t,n)}function GW({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;m<t.length;++m){const g=t[m];let x=null;if(Ze(g))!f&&g.spaceBefore&&h.push(""),Jd(n,h,g.commentBefore,f),g.comment&&(x=g.comment);else if(qe(g)){const v=Ze(g.key)?g.key:null;v&&(!f&&v.spaceBefore&&h.push(""),Jd(n,h,v.commentBefore,f))}f=!1;let y=qo(g,u,()=>x=null,()=>f=!0);x&&(y+=ui(y,i,c(x))),f&&x&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;m<h.length;++m){const g=h[m];p+=g?`
|
|
109
|
+
${l}${g}`:`
|
|
110
|
+
`}}return e?(p+=`
|
|
111
|
+
`+$r(c(e),l),a&&a()):f&&o&&o(),p}function ZW({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const l=Object.assign({},t,{indent:r,inFlow:!0,type:null});let c=!1,u=0;const f=[];for(let m=0;m<e.length;++m){const g=e[m];let x=null;if(Ze(g))g.spaceBefore&&f.push(""),Jd(t,f,g.commentBefore,!1),g.comment&&(x=g.comment);else if(qe(g)){const v=Ze(g.key)?g.key:null;v&&(v.spaceBefore&&f.push(""),Jd(t,f,v.commentBefore,!1),v.comment&&(c=!0));const b=Ze(g.value)?g.value:null;b?(b.comment&&(x=b.comment),b.commentBefore&&(c=!0)):g.value==null&&(v!=null&&v.comment)&&(x=v.comment)}x&&(c=!0);let y=qo(g,l,()=>x=null);c||(c=f.length>u||y.includes(`
|
|
112
|
+
`)),m<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=f.reduce((v,b)=>v+b.length+2,2)+(y.length+2)>t.options.lineWidth)),c&&(y+=",")),x&&(y+=ui(y,r,a(x))),f.push(y),u=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!c){const m=f.reduce((g,x)=>g+x.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const g of f)m+=g?`
|
|
113
|
+
${i}${s}${g}`:`
|
|
114
|
+
`;return`${m}
|
|
115
|
+
${s}${p}`}else return`${h}${o}${f.join(" ")}${o}${p}`}function Jd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=$r(t(r),e);n.push(i.trimStart())}}function di(e,t){const n=Ne(t)?t.value:t;for(const r of e)if(qe(r)&&(r.key===t||r.key===n||Ne(r.key)&&r.key.value===n))return r}class jn extends aT{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(t),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||s)&&o.items.push(rv(l,c,r))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let r;qe(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Mt(t,t==null?void 0:t.value):r=new Mt(t.key,t.value);const s=di(this.items,r.key),i=(o=this.schema)==null?void 0:o.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Ne(s.value)&&oT(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const a=this.items.findIndex(l=>i(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){const n=di(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=di(this.items,t),s=r==null?void 0:r.value;return(!n&&Ne(s)?s.value:s)??void 0}has(t){return!!di(this.items,t)}set(t,n){this.add(new Mt(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)hT(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!qe(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),pT(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const ua={collection:"map",default:!0,nodeClass:jn,tag:"tag:yaml.org,2002:map",resolve(e,t){return lc(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>jn.from(e,t,n)};class Ci extends aT{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(aa,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=uu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=uu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Ne(s)?s.value:s}has(t){const n=uu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=uu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Ne(s)&&oT(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(An(i,String(s++),n));return r}toString(t,n,r){return t?pT(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}i.items.push(Vl(a,void 0,r))}}return i}}function uu(e){let t=Ne(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const da={collection:"seq",default:!0,nodeClass:Ci,tag:"tag:yaml.org,2002:seq",resolve(e,t){return cc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ci.from(e,t,n)},Hf={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),nv(e,t,n,r)}},Gf={identify:e=>e==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ae(null),stringify:({source:e},t)=>typeof e=="string"&&Gf.test.test(e)?e:t.options.nullStr},sv={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&sv.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function er({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=t-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const mT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:er},gT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():er(e)}},yT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ae(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:er},Zf=e=>typeof e=="bigint"||Number.isInteger(e),iv=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function xT(e,t,n){const{value:r}=e;return Zf(r)&&r>=0?n+r.toString(t):er(e)}const vT={identify:e=>Zf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>iv(e,2,8,n),stringify:e=>xT(e,8,"0o")},bT={identify:Zf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>iv(e,0,10,n),stringify:er},wT={identify:e=>Zf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>iv(e,2,16,n),stringify:e=>xT(e,16,"0x")},qW=[ua,da,Hf,Gf,sv,vT,bT,wT,mT,gT,yT];function yk(e){return typeof e=="bigint"||Number.isInteger(e)}const du=({value:e})=>JSON.stringify(e),YW=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:du},{identify:e=>e==null,createNode:()=>new ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:du},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:du},{identify:yk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>yk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:du}],JW={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},QW=[ua,da].concat(YW,JW),ov={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ae.BLOCK_LITERAL),t!==ae.QUOTE_DOUBLE){const l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=l)u[f]=a.substr(h,l);a=u.join(t===ae.BLOCK_LITERAL?`
|
|
116
|
+
`:" ")}return nv({comment:e,type:t,value:a},r,s,i)}};function kT(e,t){if(cc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qe(r)){if(lc(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Mt(new ae(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
117
|
+
${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
118
|
+
${i.comment}`:r.comment}r=s}e.items[n]=qe(r)?r:new Mt(r)}}else t("Expected a sequence for this tag");return e}function _T(e,t,n){const{replacer:r}=n,s=new Ci(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(rv(a,l,n))}return s}const av={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:kT,createNode:_T};class Po extends Ci{constructor(){super(),this.add=jn.prototype.add.bind(this),this.delete=jn.prototype.delete.bind(this),this.get=jn.prototype.get.bind(this),this.has=jn.prototype.has.bind(this),this.set=jn.prototype.set.bind(this),this.tag=Po.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(qe(s)?(i=An(s.key,"",n),o=An(s.value,i,n)):i=An(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(t,n,r){const s=_T(t,n,r),i=new this;return i.items=s.items,i}}Po.tag="tag:yaml.org,2002:omap";const lv={collection:"seq",identify:e=>e instanceof Map,nodeClass:Po,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=kT(e,t),r=[];for(const{key:s}of n.items)Ne(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Po,n)},createNode:(e,t,n)=>Po.from(e,t,n)};function ST({value:e,source:t},n){return t&&(e?CT:jT).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const CT={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ae(!0),stringify:ST},jT={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ae(!1),stringify:ST},XW={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:er},eK={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():er(e)}},tK={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ae(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:er},uc=e=>typeof e=="bigint"||Number.isInteger(e);function qf(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const i=parseInt(e,n);return s==="-"?-1*i:i}function cv(e,t,n){const{value:r}=e;if(uc(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return er(e)}const nK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>qf(e,2,2,n),stringify:e=>cv(e,2,"0b")},rK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>qf(e,1,8,n),stringify:e=>cv(e,8,"0")},sK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>qf(e,0,10,n),stringify:er},iK={identify:uc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>qf(e,2,16,n),stringify:e=>cv(e,16,"0x")};class To extends jn{constructor(t){super(t),this.tag=To.tag}add(t){let n;qe(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Mt(t.key,null):n=new Mt(t,null),di(this.items,n.key)||this.items.push(n)}get(t,n){const r=di(this.items,t);return!n&&qe(r)?Ne(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=di(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Mt(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(rv(o,null,r));return i}}To.tag="tag:yaml.org,2002:set";const uv={collection:"map",identify:e=>e instanceof Set,nodeClass:To,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>To.from(e,t,n),resolve(e,t){if(lc(e)){if(e.hasAllNullValues(!0))return Object.assign(new To,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function dv(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function ET(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return er(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const PT={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>dv(e,n),stringify:ET},TT={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>dv(e,!1),stringify:ET},Yf={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Yf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,s,i||0,o||0,a||0,l);const u=t[8];if(u&&u!=="Z"){let f=dv(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},xk=[ua,da,Hf,Gf,CT,jT,nK,rK,sK,iK,XW,eK,tK,ov,zr,lv,av,uv,PT,TT,Yf],vk=new Map([["core",qW],["failsafe",[ua,da,Hf]],["json",QW],["yaml11",xk],["yaml-1.1",xk]]),bk={binary:ov,bool:sv,float:yT,floatExp:gT,floatNaN:mT,floatTime:TT,int:bT,intHex:wT,intOct:vT,intTime:PT,map:ua,merge:zr,null:Gf,omap:lv,pairs:av,seq:da,set:uv,timestamp:Yf},oK={"tag:yaml.org,2002:binary":ov,"tag:yaml.org,2002:merge":zr,"tag:yaml.org,2002:omap":lv,"tag:yaml.org,2002:pairs":av,"tag:yaml.org,2002:set":uv,"tag:yaml.org,2002:timestamp":Yf};function Ep(e,t,n){const r=vk.get(t);if(r&&!e)return n&&!r.includes(zr)?r.concat(zr):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(vk.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(zr)),s.reduce((i,o)=>{const a=typeof o=="string"?bk[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(bk).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}const aK=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let lK=class NT{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Ep(t,"compat"):t?Ep(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?oK:{},this.tags=Ep(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Ps,{value:ua}),Object.defineProperty(this,vr,{value:Hf}),Object.defineProperty(this,aa,{value:da}),this.sortMapEntries=typeof o=="function"?o:o===!0?aK:null}clone(){const t=Object.create(NT.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function cK(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=cT(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=i(e.commentBefore);n.unshift($r(c,""))}let o=!1,a=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push($r(f,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let u=qo(e.contents,s,()=>a=null,c);a&&(u+=ui(u,"",i(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(qo(e.contents,s));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=i(e.comment);c.includes(`
|
|
119
|
+
`)?(n.push("..."),n.push($r(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push($r(i(c),"")))}return n.join(`
|
|
120
|
+
`)+`
|
|
121
|
+
`}class dc{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Mn,{value:Ig});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Nt({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(dc.prototype,{[Mn]:{value:Ig}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ze(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Hi(this.contents)&&this.contents.add(t)}addIn(t,n){Hi(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=sT(this);t.anchor=!n||r.has(n)?iT(n||"a",r):n}return new tv(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const x=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=n.filter(x).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=$W(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:p},g=Vl(t,u,m);return a&&He(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Mt(s,i)}delete(t){return Hi(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ga(t)?this.contents==null?!1:(this.contents=null,!0):Hi(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return He(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ga(t)?!n&&Ne(this.contents)?this.contents.value:this.contents:He(this.contents)?this.contents.getIn(t,n):void 0}has(t){return He(this.contents)?this.contents.has(t):!1}hasIn(t){return Ga(t)?this.contents!==void 0:He(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Yd(this.schema,[t],n):Hi(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ga(t)?this.contents=n:this.contents==null?this.contents=Yd(this.schema,Array.from(t),n):Hi(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Nt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Nt({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new lK(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=An(this.contents,n??"",a);if(typeof i=="function")for(const{count:c,res:u}of a.anchors.values())i(u,c);return typeof o=="function"?go(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return cK(this,t)}}function Hi(e){if(He(e))return!0;throw new Error("Expected a YAML collection as document contents")}class IT extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Za extends IT{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class uK extends IT{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const wk=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
122
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];(l==null?void 0:l.line)===r&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-i)));const c=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
123
|
+
|
|
124
|
+
${o}
|
|
125
|
+
${c}
|
|
126
|
+
`}};function Yo(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",h="",p=!1,m=!1,g=null,x=null,y=null,v=null,b=null,w=null,_=null;for(const E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&i(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(c&&E.type!=="comment"&&E.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||i(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=E.source.substring(1)||" ";f?f+=h+T:f=T,h="",c=!1;break}case"newline":c?f?f+=E.source:(!w||n!=="seq-item-ind")&&(l=!0):h+=E.source,c=!0,p=!0,(x||y)&&(v=E),u=!0;break;case"anchor":x&&i(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&i(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),x=E,_??(_=E.offset),c=!1,u=!1,m=!0;break;case"tag":{y&&i(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,_??(_=E.offset),c=!1,u=!1,m=!0;break}case n:(x||y)&&i(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),w&&i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),w=E,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){b&&i(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=E,c=!1,u=!1;break}default:i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,u=!1}const S=e[e.length-1],j=S?S.offset+S.source.length:s;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:w,spaceBefore:l,comment:f,hasNewline:p,anchor:x,tag:y,newlineAfterProp:v,end:j,start:_??j}}function Ul(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
127
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Ul(t.key)||Ul(t.value))return!0}return!1;default:return!0}}function Mg(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ul(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function AT(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Ne(i)&&Ne(o)&&i.value===o.value;return t.some(i=>s(i.key,n))}const kk="All mapping items must start at the same column";function dK({composeNode:e,composeEmptyNode:t},n,r,s,i){var u;const o=(i==null?void 0:i.nodeClass)??jn,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(const f of r.items){const{start:h,key:p,sep:m,value:g}=f,x=Yo(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!x.found;if(y){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&s(l,"BAD_INDENT",kk)),!x.anchor&&!x.tag&&!m){c=x.end,x.comment&&(a.comment?a.comment+=`
|
|
128
|
+
`+x.comment:a.comment=x.comment);continue}(x.newlineAfterProp||Ul(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=x.found)==null?void 0:u.indent)!==r.indent&&s(l,"BAD_INDENT",kk);n.atKey=!0;const v=x.end,b=p?e(n,p,x,s):t(n,v,h,null,x,s);n.schema.compat&&Mg(r.indent,p,s),n.atKey=!1,AT(n,a.items,b)&&s(v,"DUPLICATE_KEY","Map keys must be unique");const w=Yo(m??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=w.end,w.found){y&&((g==null?void 0:g.type)==="block-map"&&!w.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&x.start<w.found.offset-1024&&s(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const _=g?e(n,g,w,s):t(n,l,m,null,w,s);n.schema.compat&&Mg(r.indent,g,s),l=_.range[2];const S=new Mt(b,_);n.options.keepSourceTokens&&(S.srcToken=f),a.items.push(S)}else{y&&s(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(b.comment?b.comment+=`
|
|
129
|
+
`+w.comment:b.comment=w.comment);const _=new Mt(b);n.options.keepSourceTokens&&(_.srcToken=f),a.items.push(_)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}function fK({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=(i==null?void 0:i.nodeClass)??Ci,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=r.offset,c=null;for(const{start:u,value:f}of r.items){const h=Yo(u,{indicator:"seq-item-ind",next:f,offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)(f==null?void 0:f.type)==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}const p=f?e(n,f,h,s):t(n,h.end,u,null,h,s);n.schema.compat&&Mg(r.indent,f,s),l=p.range[2],a.items.push(p)}return a.range=[r.offset,l,c??l],a}function fc(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=l.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=l),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:s,offset:t}}const Pp="Block collections are not allowed within flow collections",Tp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function hK({composeNode:e,composeEmptyNode:t},n,r,s,i){var x;const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(o?jn:Ci),c=new l(n.schema);c.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let y=0;y<r.items.length;++y){const v=r.items[y],{start:b,key:w,sep:_,value:S}=v,j=Yo(b,{flow:a,indicator:"explicit-key-ind",next:w??(_==null?void 0:_[0]),offset:f,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!_&&!S){y===0&&j.comma?s(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<r.items.length-1&&s(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),j.comment&&(c.comment?c.comment+=`
|
|
130
|
+
`+j.comment:c.comment=j.comment),f=j.end;continue}!o&&n.options.strict&&Ul(w)&&s(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)j.comma&&s(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(j.comma||s(j.start,"MISSING_CHAR",`Missing , between ${a} items`),j.comment){let E="";e:for(const T of b)switch(T.type){case"comma":case"space":break;case"comment":E=T.source.substring(1);break e;default:break e}if(E){let T=c.items[c.items.length-1];qe(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
131
|
+
`+E:T.comment=E,j.comment=j.comment.substring(E.length+1)}}if(!o&&!_&&!j.found){const E=S?e(n,S,j,s):t(n,j.end,_,null,j,s);c.items.push(E),f=E.range[2],Tp(S)&&s(E.range,"BLOCK_IN_FLOW",Pp)}else{n.atKey=!0;const E=j.end,T=w?e(n,w,j,s):t(n,E,b,null,j,s);Tp(w)&&s(T.range,"BLOCK_IN_FLOW",Pp),n.atKey=!1;const P=Yo(_??[],{flow:a,indicator:"map-value-ind",next:S,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(P.found){if(!o&&!j.found&&n.options.strict){if(_)for(const L of _){if(L===P.found)break;if(L.type==="newline"){s(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.start<P.found.offset-1024&&s(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&((x=S.source)==null?void 0:x[0])===":"?s(S,"MISSING_CHAR",`Missing space after : in ${a}`):s(P.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const N=S?e(n,S,P,s):P.found?t(n,P.end,_,null,P,s):null;N?Tp(S)&&s(N.range,"BLOCK_IN_FLOW",Pp):P.comment&&(T.comment?T.comment+=`
|
|
132
|
+
`+P.comment:T.comment=P.comment);const R=new Mt(T,N);if(n.options.keepSourceTokens&&(R.srcToken=v),o){const L=c;AT(n,L.items,T)&&s(E,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(R)}else{const L=new jn(n.schema);L.flow=!0,L.items.push(R);const I=(N??T).range;L.range=[T.range[0],I[1],I[2]],c.items.push(L)}f=N?N.range[2]:P.end}}const h=o?"}":"]",[p,...m]=r.end;let g=f;if((p==null?void 0:p.source)===h)g=p.offset+p.source.length;else{const y=a[0].toUpperCase()+a.substring(1),v=u?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;s(f,u?"MISSING_CHAR":"BAD_INDENT",v),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){const y=fc(m,g,n.options.strict,s);y.comment&&(c.comment?c.comment+=`
|
|
133
|
+
`+y.comment:c.comment=y.comment),c.range=[r.offset,g,y.offset]}else c.range=[r.offset,g,g];return c}function Np(e,t,n,r,s,i){const o=n.type==="block-map"?dK(e,t,n,r,i):n.type==="block-seq"?fK(e,t,n,r,i):hK(e,t,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function pK(e,t,n,r,s){var h;const i=r.tag,o=i?t.directives.tagName(i.source,p=>s(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offset<g.offset)&&s(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===jn.tagName&&a==="map"||o===Ci.tagName&&a==="seq")return Np(e,t,n,s,o);let l=t.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!l){const p=t.schema.knownTags[o];if((p==null?void 0:p.collection)===a)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Np(e,t,n,s,o)}const c=Np(e,t,n,s,o,l),u=((h=l.resolve)==null?void 0:h.call(l,c,p=>s(i,"TAG_RESOLVE_FAILED",p),t.options))??c,f=Ze(u)?u:new ae(u);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function mK(e,t,n){const r=t.offset,s=gK(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ae.BLOCK_FOLDED:ae.BLOCK_LITERAL,o=t.source?yK(t.source):[];let a=o.length;for(let g=o.length-1;g>=0;--g){const x=o[g][1];if(x===""||x==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&o.length>0?`
|
|
134
|
+
`.repeat(Math.max(1,o.length-1)):"";let x=r+s.length;return t.source&&(x+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,x,x]}}let l=t.indent+s.indent,c=t.offset+s.length,u=0;for(let g=0;g<a;++g){const[x,y]=o[g];if(y===""||y==="\r")s.indent===0&&x.length>l&&(l=x.length);else{x.length<l&&n(c+x.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=x.length),u=g,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=x.length+y.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>l&&(a=g+1);let f="",h="",p=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(l)+`
|
|
135
|
+
`;for(let g=u;g<a;++g){let[x,y]=o[g];c+=x.length+y.length+1;const v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&x.length<l){const w=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(v?2:1),"BAD_INDENT",w),x=""}i===ae.BLOCK_LITERAL?(f+=h+x.slice(l)+y,h=`
|
|
136
|
+
`):x.length>l||y[0]===" "?(h===" "?h=`
|
|
137
|
+
`:!p&&h===`
|
|
138
|
+
`&&(h=`
|
|
139
|
+
|
|
140
|
+
`),f+=h+x.slice(l)+y,h=`
|
|
141
|
+
`,p=!0):y===""?h===`
|
|
142
|
+
`?f+=`
|
|
143
|
+
`:h=`
|
|
144
|
+
`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)f+=`
|
|
145
|
+
`+o[g][0].slice(l);f[f.length-1]!==`
|
|
146
|
+
`&&(f+=`
|
|
147
|
+
`);break;default:f+=`
|
|
148
|
+
`}const m=r+s.length+t.source.length;return{value:f,type:i,comment:s.comment,range:[r,m,m]}}function gK({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",l=-1;for(let h=1;h<s.length;++h){const p=s[h];if(!a&&(p==="-"||p==="+"))a=p;else{const m=Number(p);!o&&m?o=m:l===-1&&(l=e+h)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,u="",f=s.length;for(let h=1;h<t.length;++h){const p=t[h];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":n&&!c&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{const m=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",m);const g=p.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:f}}function yK(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)i.push([t[o],t[o+1]]);return i}function xK(e,t,n){const{offset:r,type:s,source:i,end:o}=e;let a,l;const c=(h,p,m)=>n(r+h,p,m);switch(s){case"scalar":a=ae.PLAIN,l=vK(i,c);break;case"single-quoted-scalar":a=ae.QUOTE_SINGLE,l=bK(i,c);break;case"double-quoted-scalar":a=ae.QUOTE_DOUBLE,l=wK(i,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const u=r+i.length,f=fc(o,u,t,n);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function vK(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),RT(e)}function bK(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),RT(e.slice(1,-1)).replace(/''/g,"'")}function RT(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
149
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
150
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?i===`
|
|
151
|
+
`?s+=i:i=`
|
|
152
|
+
`:(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+((r==null?void 0:r[1])??"")}function wK(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
|
|
153
|
+
`))if(s===`
|
|
154
|
+
`){const{fold:i,offset:o}=kK(e,r);n+=i,r=o}else if(s==="\\"){let i=e[++r];const o=_K[i];if(o)n+=o;else if(i===`
|
|
155
|
+
`)for(i=e[r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="\r"&&e[r+1]===`
|
|
156
|
+
`)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const a=i==="x"?2:i==="u"?4:8;n+=SK(e,r+1,a,t),r+=a}else{const a=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const i=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
157
|
+
`&&!(o==="\r"&&e[r+2]===`
|
|
158
|
+
`)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function kK(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
159
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
160
|
+
`);)r===`
|
|
161
|
+
`&&(n+=`
|
|
162
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const _K={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
163
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function SK(e,t,n,r){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function LT(e,t,n,r){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?mK(e,t,r):xK(t,e.options.strict,r),l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[vr]:l?c=CK(e.schema,s,l,n,r):t.type==="scalar"?c=jK(e,s,t,r):c=e.schema[vr];let u;try{const f=c.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);u=Ne(f)?f:new ae(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),u=new ae(s)}return u.range=a,u.source=s,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function CK(e,t,n,r,s){var a;if(n==="!")return e[vr];const i=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((a=l.test)!=null&&a.test(t))return l;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[vr])}function jK({atKey:e,directives:t,schema:n},r,s,i){const o=n.tags.find(a=>{var l;return(a.default===!0||e&&a.default==="key")&&((l=a.test)==null?void 0:l.test(r))})||n[vr];if(n.compat){const a=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(r))})??n[vr];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}function EK(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const PK={composeNode:MT,composeEmptyNode:fv};function MT(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n;let c,u=!0;switch(t.type){case"alias":c=TK(e,t,r),(a||l)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=LT(e,t,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=pK(PK,e,t,n,r),a&&(c.anchor=a.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=fv(e,t.offset,void 0,null,n,r)),a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Ne(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function fv(e,t,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:EK(t,n,r),indent:-1,source:""},f=LT(e,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function TK({options:e},{offset:t,source:n,end:r},s){const i=new tv(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=fc(r,o,e.strict,s);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}function NK(e,t,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:t},e),l=new dc(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Yo(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?MT(c,s,u,o):fv(c,u.end,r,null,u,o);const f=l.contents.range[2],h=fc(i,f,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function Oa(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function _k(e){var s;let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const o=e[i];switch(o[0]){case"#":t+=(t===""?"":r?`
|
|
164
|
+
|
|
165
|
+
`:`
|
|
166
|
+
`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class IK{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=Oa(n);i?this.warnings.push(new uK(o,r,s)):this.errors.push(new Za(o,r,s))},this.directives=new Nt({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=_k(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
167
|
+
${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(He(i)&&!i.flow&&i.items.length>0){let o=i.items[0];qe(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
168
|
+
${a}`:r}else{const o=i.commentBefore;i.commentBefore=o?`${r}
|
|
169
|
+
${o}`:r}}if(n){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_k(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const i=Oa(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=NK(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Za(Oa(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Za(Oa(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=fc(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
170
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Za(Oa(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new dc(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const $T="\uFEFF",DT="",OT="",$g="";function AK(e){switch(e){case $T:return"byte-order-mark";case DT:return"doc-mode";case OT:return"flow-error-end";case $g:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
171
|
+
`:case`\r
|
|
172
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Wn(e){switch(e){case void 0:case" ":case`
|
|
173
|
+
`:case"\r":case" ":return!0;default:return!1}}const Sk=new Set("0123456789ABCDEFabcdef"),RK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fu=new Set(",[]{}"),LK=new Set(` ,[]{}
|
|
174
|
+
\r `),Ip=e=>!e||LK.has(e);class MK{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
175
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
176
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
|
|
177
|
+
`||!s&&!this.atEnd)return t+r+1}return n===`
|
|
178
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Wn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
179
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===$T&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const i=t[r-1];if(i===" "||i===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield DT,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Wn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Wn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Wn(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ip),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&Wn(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield OT,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ip),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Wn(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
180
|
+
`,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
181
|
+
`,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Wn(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
|
|
182
|
+
`:t=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
183
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
|
|
184
|
+
`,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
185
|
+
`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
186
|
+
`&&i>=this.pos&&i+1+n>a)t=i;else break}while(!0);return yield $g,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(Wn(i)||t&&fu.has(i))break;n=r}else if(Wn(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
187
|
+
`?(r+=1,s=`
|
|
188
|
+
`,i=this.buffer[r+1]):n=r),i==="#"||t&&fu.has(i))break;if(s===`
|
|
189
|
+
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&fu.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield $g,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Ip),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(Wn(r)||n&&fu.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Wn(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(RK.has(n))n=this.buffer[++t];else if(n==="%"&&Sk.has(this.buffer[t+1])&&Sk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
190
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
191
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class $K{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<t?n=i+1:r=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function ls(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Ck(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function zT(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Gi(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Qd(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function jk(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ls(t.start,"explicit-key-ind")&&!ls(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,zT(t.value)?t.value.end?Qd(t.value.end,t.sep):t.value.end=t.sep:Qd(t.start,t.sep),delete t.sep)}class DK{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new MK,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=AK(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&jk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Ck(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Ck(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=hu(this.peek(2)),r=Gi(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
192
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
193
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Qd(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(i&&n.sep&&!n.value){const a=[];for(let l=0;l<n.sep.length;++l){const c=n.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ls(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(zT(n.key)&&!ls(n.sep,"newline")){const a=Gi(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ls(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=Gi(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:o,key:null,sep:[this.sourceToken]}):ls(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);i||n.value?(t.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ls(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Qd(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ls(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=hu(r),i=Gi(s);jk(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
194
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
195
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=hu(t),r=Gi(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=hu(t),r=Gi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function OK(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new $K||null,prettyErrors:t}}function zK(e,t={}){const{lineCounter:n,prettyErrors:r}=OK(t),s=new DK(n==null?void 0:n.addNewLine),i=new IK(t);let o=null;for(const a of i.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Za(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(wk(e,n)),o.warnings.forEach(wk(e,n))),o}function FK(e,t,n){let r;const s=zK(e,n);if(!s)return null;if(s.warnings.forEach(i=>uT(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function BK(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return ac(e)&&!r?e.toString(n):new dc(e,r,n).toString(n)}function Ek(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Jf(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 VK(e){const t=e.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(!t||!t[1]&&!t[2]&&!t[3])return null;const n=Number(t[1]??0),r=Number(t[2]??0),s=Number(t[3]??0);return(n*3600+r*60+s)*1e3}function Rr(e){return e>=1e6?`${Ek(e/1e6,1)}M`:e>=1e3?`${Ek(e/1e3,1)}k`:`${Math.round(e)}`}function Pk(e){const t=e.match(/^([\d.]+)([kM]?)$/);if(!t)return 0;const n=Number(t[1]);return Number.isFinite(n)?t[2]==="M"?Math.round(n*1e6):t[2]==="k"?Math.round(n*1e3):Math.round(n):0}function UK(e){return`${Rr(e.inputTokens+e.outputTokens)} tokens · ${Jf(e.durationMs)}${e.attempts>1?` ×${e.attempts}`:""}${e.model?` · ${e.model}`:""}`}function WK(e){const t=[Jf(e.durationMs),`${Rr(e.inputTokens)} in`,`${Rr(e.outputTokens)} out`];return e.model&&t.push(e.model),e.attempts>1&&t.push(`×${e.attempts}`),t.join(" · ")}function KK(e){const t=e.split("·").map(s=>s.trim()).filter(Boolean);if(t.length===0)return;const n=VK(t[0]);if(n===null)return;const r={durationMs:n,inputTokens:0,outputTokens:0,attempts:1};for(const s of t.slice(1)){const i=s.match(/^(.+)\s+in$/),o=s.match(/^(.+)\s+out$/),a=s.match(/^×(\d+)$/);i?r.inputTokens=Pk(i[1]):o?r.outputTokens=Pk(o[1]):a?r.attempts=Number(a[1]):r.model=s}return r}function HK(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 FT=/^#{2,3}\s+/,Xd=/^[-*]\s+\[([ xX])\]\s+(.*)$/,GK=/^\[(review|manual|issue)\]\s+(.*)$/,ZK=/^run:\s*(.+)$/,Tk=/^-\s+(\d{4}-\d{2}-\d{2}):\s*(.*)$/,qK=/^\[(?:phase:(\d+)|body)\]\s+(?:\[(decision|question)\]\s+)?(.*)$/,Nk=/^-\s+\[([ xX])\]\s+(?:(\d{4}-\d{2}-\d{2})\s+)?\[(log|clarification|review|note|decision|question|chat)\]\s+(\[agent\]\s+)?(.*)$/,YK=["note","decision","question"];function hv(e,t,n,r){const s=[];let i=t;for(;i<n;){const o=e[i];if(o.trim()===""||!/^\s/.test(o))break;const a=o.trimStart();if(r.test(a)||FT.test(a))break;s.push(a),i++}return{text:s.join(" "),next:i}}function pv(e,t){return t?`${e.trim()} ${t}`:e.trim()}function BT(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Xd);if(i){const o=i[1].toLowerCase()==="x",a=i[2].trim(),l=a.match(GK),c=l?l[2].trim():a,u=l?l[1]:void 0,f=[];let h;for(s++;s<n;){const p=e[s];if(p.trim()===""||Xd.test(p)||FT.test(p))break;if(/^\s/.test(p)){const m=p.trimStart(),g=m.match(ZK),x=g?KK(g[1]):void 0;x?h=x:f.push(m),s++}else break}r.push({done:o,text:c,description:f.length>0?f.join(`
|
|
196
|
+
`):void 0,source:u,run:h})}else s++}return r}function mv(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Tk);if(!i){s++;continue}const o=hv(e,s+1,n,Tk);r.push({date:i[1],text:pv(i[2],o.text)}),s=o.next}return r}function VT(e,t){const n=[e];for(const r of t){const s=r.source?`[${r.source}] ${r.text}`:r.text;if(n.push(`- [${r.done?"x":" "}] ${s}`),r.description)for(const i of r.description.split(`
|
|
197
|
+
`))n.push(` ${i}`);r.run&&n.push(` run: ${WK(r.run)}`)}return n}function gv(e,t){return[e,...t.map(n=>`- ${n.date}: ${n.text}`)]}function JK(e){return e.kind==="phase"?`[phase:${e.index}]`:"[body]"}function QK(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Xd),o=i?i[2].trim().match(qK):null;if(!i||!o){s++;continue}const a=o[1]?{kind:"phase",index:Number(o[1])}:{kind:"body"},l=o[2],c=hv(e,s+1,n,Xd);r.push({anchor:a,prose:pv(o[3],c.text),state:i[1].toLowerCase()==="x"?"resolved":"open",...l?{kind:l}:{}}),s=c.next}return r}function XK(e){const t=["### Notes"];for(const n of e){const r=n.kind&&n.kind!=="note"?`[${n.kind}] `:"";t.push(`- [${n.state==="resolved"?"x":" "}] ${JK(n.anchor)} ${r}${n.prose}`)}return t}const UT={headingRe:/^#{2,3}\s+Phases\s*$/i,parseEntries:BT,formatLines:e=>VT("### Phases",e)},WT={headingRe:/^#{2,3}\s+Fixes\s*$/i,parseEntries:BT,formatLines:e=>VT("### Fixes",e)},eH={headingRe:/^#{2,3}\s+Log\s*$/i,parseEntries:mv,formatLines:e=>gv("### Log",e)},tH={headingRe:/^#{2,3}\s+Clarifications\s*$/i,parseEntries:mv,formatLines:e=>gv("### Clarifications",e)},nH={headingRe:/^#{2,3}\s+Notes\s*$/i,parseEntries:QK,formatLines:XK},rH={headingRe:/^#{2,3}\s+Review\s*$/i,parseEntries:mv,formatLines:e=>gv("### Review",e)};function sH(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Nk);if(!i){s++;continue}const o=i[3],a=hv(e,s+1,n,Nk),l={kind:o,text:pv(i[5],a.text)};i[2]&&(l.date=i[2]),i[4]&&(l.from="agent"),YK.includes(o)&&(l.state=i[1].toLowerCase()==="x"?"resolved":"open"),r.push(l),s=a.next}return r}function iH(e){const t=["### Thread"];for(const n of e){const r=n.state?n.state==="resolved":!0,s=n.date?`${n.date} `:"",i=n.from==="agent"?"[agent] ":"";t.push(`- [${r?"x":" "}] ${s}[${n.kind}] ${i}${n.text}`)}return t}const KT={headingRe:/^#{2,3}\s+Thread\s*$/i,parseEntries:sH,formatLines:iH};var Ik;function B(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=o.prototype,u=Object.keys(c);for(let f=0;f<u.length;f++){const h=u[f];h in a||(a[h]=c[h].bind(a))}}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var l;const c=n!=null&&n.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var l,c;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(c=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class No extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class HT extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ik=globalThis).__zod_globalConfig??(Ik.__zod_globalConfig={});const yv=globalThis.__zod_globalConfig;function ji(e){return yv}function GT(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function Dg(e,t){return typeof t=="bigint"?t.toString():t}function xv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vv(e){return e==null}function bv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function oH(e,t){const n=e/t,r=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}const Ak=Symbol("evaluating");function we(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ak)return r===void 0&&(r=Ak,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ri(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Bs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Rk(e){return JSON.stringify(e)}function aH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ZT="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ef(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const lH=xv(()=>{var e;if(yv.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Wl(e){if(ef(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ef(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function qT(e){return Wl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const cH=new Set(["string","number","symbol"]);function Qf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vs(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Y(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function uH(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const dH={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fH(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Bs(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Ri(this,"shape",o),o},checks:[]});return Vs(e,i)}function hH(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Bs(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Ri(this,"shape",o),o},checks:[]});return Vs(e,i)}function pH(e,t){if(!Wl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Bs(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Ri(this,"shape",i),i}});return Vs(e,s)}function mH(e,t){if(!Wl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Bs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Ri(this,"shape",r),r}});return Vs(e,n)}function gH(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Bs(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Ri(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Vs(e,n)}function yH(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Bs(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Ri(this,"shape",l),l},checks:[]});return Vs(t,o)}function xH(e,t,n){const r=Bs(t._zod.def,{get shape(){const s=t._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new e({type:"nonoptional",innerType:s[o]});return Ri(this,"shape",i),i}});return Vs(t,r)}function xo(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function vH(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function YT(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function pu(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ei(e,t,n){var l,c,u,f,h,p;const r=e.message?e.message:pu((u=(c=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:c.error)==null?void 0:u.call(c,e))??pu((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??pu((h=n.customError)==null?void 0:h.call(n,e))??pu((p=n.localeError)==null?void 0:p.call(n,e))??"Invalid input",{inst:s,continue:i,input:o,...a}=e;return a.path??(a.path=[]),a.message=r,t!=null&&t.reportInput&&(a.input=o),a}function wv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kl(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const JT=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Dg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},QT=B("$ZodError",JT),XT=B("$ZodError",JT,{Parent:Error});function bH(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function wH(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const a=[...i,...o.path];if(a.length===0)n._errors.push(t(o));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(e),n}const kv=e=>(t,n,r,s)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new No;if(o.issues.length){const a=new((s==null?void 0:s.Err)??e)(o.issues.map(l=>Ei(l,i,ji())));throw ZT(a,s==null?void 0:s.callee),a}return o.value},_v=e=>async(t,n,r,s)=>{const i=r?{...r,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((s==null?void 0:s.Err)??e)(o.issues.map(l=>Ei(l,i,ji())));throw ZT(a,s==null?void 0:s.callee),a}return o.value},Xf=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new No;return i.issues.length?{success:!1,error:new(e??QT)(i.issues.map(o=>Ei(o,s,ji())))}:{success:!0,data:i.value}},kH=Xf(XT),eh=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>Ei(o,s,ji())))}:{success:!0,data:i.value}},_H=eh(XT),SH=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return kv(e)(t,n,s)},CH=e=>(t,n,r)=>kv(e)(t,n,r),jH=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return _v(e)(t,n,s)},EH=e=>async(t,n,r)=>_v(e)(t,n,r),PH=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Xf(e)(t,n,s)},TH=e=>(t,n,r)=>Xf(e)(t,n,r),NH=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return eh(e)(t,n,s)},IH=e=>async(t,n,r)=>eh(e)(t,n,r),AH=/^[cC][0-9a-z]{6,}$/,RH=/^[0-9a-z]+$/,LH=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,MH=/^[0-9a-vA-V]{20}$/,$H=/^[A-Za-z0-9]{27}$/,DH=/^[a-zA-Z0-9_-]{21}$/,OH=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zH=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Lk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,FH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function VH(){return new RegExp(BH,"u")}const UH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WH=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,KH=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,HH=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GH=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,eN=/^[A-Za-z0-9_-]*$/,ZH=/^https?$/,qH=/^\+[1-9]\d{6,14}$/,tN="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",YH=new RegExp(`^${tN}$`);function nN(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function JH(e){return new RegExp(`^${nN(e)}$`)}function QH(e){const t=nN({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${tN}T(?:${r})$`)}const XH=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eG=/^-?\d+$/,tG=/^-?\d+(?:\.\d+)?$/,nG=/^(?:true|false)$/i,rG=/^[^A-Z]*$/,sG=/^[^a-z]*$/,Jt=B("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rN={number:"number",bigint:"bigint",object:"date"},sN=B("$ZodCheckLessThan",(e,t)=>{Jt.init(e,t);const n=rN[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iN=B("$ZodCheckGreaterThan",(e,t)=>{Jt.init(e,t);const n=rN[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iG=B("$ZodCheckMultipleOf",(e,t)=>{Jt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):oH(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),oG=B("$ZodCheckNumberFormat",(e,t)=>{var o;Jt.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=dH[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=s,l.maximum=i,n&&(l.pattern=eG)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<s&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),aG=B("$ZodCheckMaxLength",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!vv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=wv(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),lG=B("$ZodCheckMinLength",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!vv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=wv(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),cG=B("$ZodCheckLengthEquals",(e,t)=>{var n;Jt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!vv(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=wv(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),th=B("$ZodCheckStringFormat",(e,t)=>{var n,r;Jt.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uG=B("$ZodCheckRegex",(e,t)=>{th.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),dG=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rG),th.init(e,t)}),fG=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=sG),th.init(e,t)}),hG=B("$ZodCheckIncludes",(e,t)=>{Jt.init(e,t);const n=Qf(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),pG=B("$ZodCheckStartsWith",(e,t)=>{Jt.init(e,t);const n=new RegExp(`^${Qf(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),mG=B("$ZodCheckEndsWith",(e,t)=>{Jt.init(e,t);const n=new RegExp(`.*${Qf(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),gG=B("$ZodCheckOverwrite",(e,t)=>{Jt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yG{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
198
|
+
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,s.join(`
|
|
199
|
+
`))}}const xG={major:4,minor:4,patch:3},Je=B("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xG;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const o of i._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,l,c)=>{let u=xo(a),f;for(const h of l){if(h._zod.def.when){if(vH(a)||!h._zod.def.when(a))continue}else if(u)continue;const p=a.issues.length,m=h._zod.check(a);if(m instanceof Promise&&(c==null?void 0:c.async)===!1)throw new No;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(u||(u=xo(a,p)))});else{if(a.issues.length===p)continue;u||(u=xo(a,p))}}return f?f.then(()=>a):a},o=(a,l,c)=>{if(xo(a))return a.aborted=!0,a;const u=i(l,r,c);if(u instanceof Promise){if(c.async===!1)throw new No;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(f=>o(f,a,l)):o(u,a,l)}const c=e._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new No;return c.then(u=>i(u,r,l))}return i(c,r,l)}}we(e,"~standard",()=>({validate:i=>{var o;try{const a=kH(e,i);return a.success?{value:a.data}:{issues:(o=a.error)==null?void 0:o.issues}}catch{return _H(e,i).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),Sv=B("$ZodString",(e,t)=>{var n;Je.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??XH(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=B("$ZodStringFormat",(e,t)=>{th.init(e,t),Sv.init(e,t)}),vG=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zH),$e.init(e,t)}),bG=B("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Lk(r))}else t.pattern??(t.pattern=Lk());$e.init(e,t)}),wG=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=FH),$e.init(e,t)}),kG=B("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=n=>{var r;try{const s=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===ZH.source&&!/^https?:\/\//i.test(s)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),_G=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=VH()),$e.init(e,t)}),SG=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=DH),$e.init(e,t)}),CG=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=AH),$e.init(e,t)}),jG=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=RH),$e.init(e,t)}),EG=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=LH),$e.init(e,t)}),PG=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=MH),$e.init(e,t)}),TG=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$H),$e.init(e,t)}),NG=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=QH(t)),$e.init(e,t)}),IG=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YH),$e.init(e,t)}),AG=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=JH(t)),$e.init(e,t)}),RG=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=OH),$e.init(e,t)}),LG=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=UH),$e.init(e,t),e._zod.bag.format="ipv4"}),MG=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=WH),$e.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$G=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=KH),$e.init(e,t)}),DG=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=HH),$e.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function oN(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const OG=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=GH),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{oN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function zG(e){if(!eN.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return oN(n)}const FG=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=eN),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{zG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),BG=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qH),$e.init(e,t)});function VG(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const UG=B("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=n=>{VG(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),aN=B("$ZodNumber",(e,t)=>{Je.init(e,t),e._zod.pattern=e._zod.bag.pattern??tG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),WG=B("$ZodNumberFormat",(e,t)=>{oG.init(e,t),aN.init(e,t)}),KG=B("$ZodBoolean",(e,t)=>{Je.init(e,t),e._zod.pattern=nG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),HG=B("$ZodUnknown",(e,t)=>{Je.init(e,t),e._zod.parse=n=>n}),GG=B("$ZodNever",(e,t)=>{Je.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Mk(e,t,n){e.issues.length&&t.issues.push(...YT(n,e.issues)),t.value[n]=e.value}const ZG=B("$ZodArray",(e,t)=>{Je.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(c=>Mk(c,n,o))):Mk(l,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function tf(e,t,n,r,s,i){const o=n in r;if(e.issues.length){if(s&&i&&!o)return;t.issues.push(...YT(n,e.issues))}if(!o&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function lN(e){var r,s,i,o;const t=Object.keys(e.shape);for(const a of t)if(!((o=(i=(s=(r=e.shape)==null?void 0:r[a])==null?void 0:s._zod)==null?void 0:i.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=uH(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cN(e,t,n,r,s,i){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,u=l.optin==="optional",f=l.optout==="optional";for(const h in t){if(h==="__proto__"||a.has(h))continue;if(c==="never"){o.push(h);continue}const p=l.run({value:t[h],issues:[]},r);p instanceof Promise?e.push(p.then(m=>tf(m,n,h,t,u,f))):tf(p,n,h,t,u,f)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const qG=B("$ZodObject",(e,t)=>{Je.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=xv(()=>lN(t));we(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const f of u.values)l[c].add(f)}}return l});const s=ef,i=t.catchall;let o;e._zod.parse=(a,l)=>{o??(o=r.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],f=o.shape;for(const h of o.keys){const p=f[h],m=p._zod.optin==="optional",g=p._zod.optout==="optional",x=p._zod.run({value:c[h],issues:[]},l);x instanceof Promise?u.push(x.then(y=>tf(y,a,h,c,m,g))):tf(x,a,h,c,m,g)}return i?cN(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),YG=B("$ZodObjectJIT",(e,t)=>{qG.init(e,t);const n=e._zod.parse,r=xv(()=>lN(t)),s=h=>{var b,w;const p=new yG(["shape","payload","ctx"]),m=r.value,g=_=>{const S=Rk(_);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const x=Object.create(null);let y=0;for(const _ of m.keys)x[_]=`key_${y++}`;p.write("const newResult = {};");for(const _ of m.keys){const S=x[_],j=Rk(_),E=h[_],T=((b=E==null?void 0:E._zod)==null?void 0:b.optin)==="optional",P=((w=E==null?void 0:E._zod)==null?void 0:w.optout)==="optional";p.write(`const ${S} = ${g(_)};`),T&&P?p.write(`
|
|
200
|
+
if (${S}.issues.length) {
|
|
201
|
+
if (${j} in input) {
|
|
202
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
203
|
+
...iss,
|
|
204
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
205
|
+
})));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (${S}.value === undefined) {
|
|
210
|
+
if (${j} in input) {
|
|
211
|
+
newResult[${j}] = undefined;
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
newResult[${j}] = ${S}.value;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
`):T?p.write(`
|
|
218
|
+
if (${S}.issues.length) {
|
|
219
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
220
|
+
...iss,
|
|
221
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
222
|
+
})));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (${S}.value === undefined) {
|
|
226
|
+
if (${j} in input) {
|
|
227
|
+
newResult[${j}] = undefined;
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
newResult[${j}] = ${S}.value;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
`):p.write(`
|
|
234
|
+
const ${S}_present = ${j} in input;
|
|
235
|
+
if (${S}.issues.length) {
|
|
236
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
237
|
+
...iss,
|
|
238
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
239
|
+
})));
|
|
240
|
+
}
|
|
241
|
+
if (!${S}_present && !${S}.issues.length) {
|
|
242
|
+
payload.issues.push({
|
|
243
|
+
code: "invalid_type",
|
|
244
|
+
expected: "nonoptional",
|
|
245
|
+
input: undefined,
|
|
246
|
+
path: [${j}]
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (${S}_present) {
|
|
251
|
+
if (${S}.value === undefined) {
|
|
252
|
+
newResult[${j}] = undefined;
|
|
253
|
+
} else {
|
|
254
|
+
newResult[${j}] = ${S}.value;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(_,S)=>v(h,_,S)};let i;const o=ef,a=!yv.jitless,c=a&&lH.value,u=t.catchall;let f;e._zod.parse=(h,p)=>{f??(f=r.value);const m=h.value;return o(m)?a&&c&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(i||(i=s(t.shape)),h=i(h,p),u?cN([],m,h,p,f,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function $k(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!xo(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>Ei(o,r,ji())))}),t)}const JG=B("$ZodUnion",(e,t)=>{Je.init(e,t),we(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),we(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),we(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),we(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>bv(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const a of t.options){const l=a._zod.run({value:r.value,issues:[]},s);if(l instanceof Promise)o.push(l),i=!0;else{if(l.issues.length===0)return l;o.push(l)}}return i?Promise.all(o).then(a=>$k(a,r,e,s)):$k(o,r,e,s)}}),QG=B("$ZodIntersection",(e,t)=>{Je.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([l,c])=>Dk(n,l,c)):Dk(n,i,o)}});function Og(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wl(e)&&Wl(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=Og(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=Og(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dk(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),xo(e))return e;const o=Og(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const XG=B("$ZodEnum",(e,t)=>{Je.init(e,t);const n=GT(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>cH.has(typeof s)).map(s=>typeof s=="string"?Qf(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),e7=B("$ZodTransform",(e,t)=>{Je.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HT(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new No;return n.value=s,n.fallback=!0,n}});function Ok(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const uN=B("$ZodOptional",(e,t)=>{Je.init(e,t),e._zod.optin="optional",e._zod.optout="optional",we(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),we(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${bv(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Ok(o,s)):Ok(i,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),t7=B("$ZodExactOptional",(e,t)=>{uN.init(e,t),we(e._zod,"values",()=>t.innerType._zod.values),we(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),n7=B("$ZodNullable",(e,t)=>{Je.init(e,t),we(e._zod,"optin",()=>t.innerType._zod.optin),we(e._zod,"optout",()=>t.innerType._zod.optout),we(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${bv(n.source)}|null)$`):void 0}),we(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),r7=B("$ZodDefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",we(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>zk(i,t)):zk(s,t)}});function zk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const s7=B("$ZodPrefault",(e,t)=>{Je.init(e,t),e._zod.optin="optional",we(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),i7=B("$ZodNonOptional",(e,t)=>{Je.init(e,t),we(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Fk(i,e)):Fk(s,e)}});function Fk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const o7=B("$ZodCatch",(e,t)=>{Je.init(e,t),e._zod.optin="optional",we(e._zod,"optout",()=>t.innerType._zod.optout),we(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Ei(o,r,ji()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Ei(i,r,ji()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),dN=B("$ZodPipe",(e,t)=>{Je.init(e,t),we(e._zod,"values",()=>t.in._zod.values),we(e._zod,"optin",()=>t.in._zod.optin),we(e._zod,"optout",()=>t.out._zod.optout),we(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>mu(o,t.in,r)):mu(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>mu(i,t.out,r)):mu(s,t.out,r)}});function mu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const a7=B("$ZodPreprocess",(e,t)=>{dN.init(e,t)}),l7=B("$ZodReadonly",(e,t)=>{Je.init(e,t),we(e._zod,"propValues",()=>t.innerType._zod.propValues),we(e._zod,"values",()=>t.innerType._zod.values),we(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),we(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(Bk):Bk(s)}});function Bk(e){return e.value=Object.freeze(e.value),e}const c7=B("$ZodCustom",(e,t)=>{Jt.init(e,t),Je.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Vk(i,n,r,e));Vk(s,n,r,e)}});function Vk(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Kl(s))}}var Uk;class u7{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function d7(){return new u7}(Uk=globalThis).__zod_globalRegistry??(Uk.__zod_globalRegistry=d7());const qa=globalThis.__zod_globalRegistry;function f7(e,t){return new e({type:"string",...Y(t)})}function h7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Y(t)})}function Wk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Y(t)})}function p7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(t)})}function m7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(t)})}function g7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(t)})}function y7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(t)})}function x7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Y(t)})}function v7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(t)})}function b7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(t)})}function w7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(t)})}function k7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(t)})}function _7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(t)})}function S7(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Y(t)})}function C7(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(t)})}function j7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(t)})}function E7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(t)})}function P7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(t)})}function T7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(t)})}function N7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Y(t)})}function I7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(t)})}function A7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Y(t)})}function R7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(t)})}function L7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(t)})}function M7(e,t){return new e({type:"string",format:"date",check:"string_format",...Y(t)})}function $7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Y(t)})}function D7(e,t){return new e({type:"string",format:"duration",check:"string_format",...Y(t)})}function O7(e,t){return new e({type:"number",checks:[],...Y(t)})}function z7(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Y(t)})}function F7(e,t){return new e({type:"boolean",...Y(t)})}function B7(e){return new e({type:"unknown"})}function V7(e,t){return new e({type:"never",...Y(t)})}function Kk(e,t){return new sN({check:"less_than",...Y(t),value:e,inclusive:!1})}function Ap(e,t){return new sN({check:"less_than",...Y(t),value:e,inclusive:!0})}function Hk(e,t){return new iN({check:"greater_than",...Y(t),value:e,inclusive:!1})}function Rp(e,t){return new iN({check:"greater_than",...Y(t),value:e,inclusive:!0})}function Gk(e,t){return new iG({check:"multiple_of",...Y(t),value:e})}function fN(e,t){return new aG({check:"max_length",...Y(t),maximum:e})}function nf(e,t){return new lG({check:"min_length",...Y(t),minimum:e})}function hN(e,t){return new cG({check:"length_equals",...Y(t),length:e})}function U7(e,t){return new uG({check:"string_format",format:"regex",...Y(t),pattern:e})}function W7(e){return new dG({check:"string_format",format:"lowercase",...Y(e)})}function K7(e){return new fG({check:"string_format",format:"uppercase",...Y(e)})}function H7(e,t){return new hG({check:"string_format",format:"includes",...Y(t),includes:e})}function G7(e,t){return new pG({check:"string_format",format:"starts_with",...Y(t),prefix:e})}function Z7(e,t){return new mG({check:"string_format",format:"ends_with",...Y(t),suffix:e})}function fa(e){return new gG({check:"overwrite",tx:e})}function q7(e){return fa(t=>t.normalize(e))}function Y7(){return fa(e=>e.trim())}function J7(){return fa(e=>e.toLowerCase())}function Q7(){return fa(e=>e.toUpperCase())}function X7(){return fa(e=>aH(e))}function eZ(e,t,n){return new e({type:"array",element:t,...Y(n)})}function tZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Y(n)})}function nZ(e,t){const n=rZ(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Kl(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Kl(i))}},e(r.value,r)),t);return n}function rZ(e,t){const n=new Jt({check:"custom",...Y(t)});return n._zod.check=e,n}function pN(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??qa,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function xt(e,t,n={path:[],schemaPath:[]}){var u,f;var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=(f=(u=e._zod).toJSONSchema)==null?void 0:f.call(u);if(a)o.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const m=o.schema,g=t.processors[s.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);g(e,t,m,h)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),xt(p,t,h),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&Pt(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function mN(e,t){var o,a,l,c;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of e.seen.entries()){const f=(o=e.metadataRegistry.get(u[0]))==null?void 0:o.id;if(f){const h=r.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,u[0])}}const s=u=>{var g;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=(g=e.external.registry.get(u[0]))==null?void 0:g.id,y=e.external.uri??(b=>b);if(x)return{ref:y(x)};const v=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=v,{defId:v,ref:`${y("__shared")}#/${f}/${v}`}}if(u[1]===n)return{ref:"#"};const p=`#/${f}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:p+m}},i=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:p}=s(u);f.def={...f.schema},p&&(f.defId=p);const m=f.schema;for(const g in m)delete m[g];m.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${(a=f.cycle)==null?void 0:a.join("/")}/<root>
|
|
259
|
+
|
|
260
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){i(u);continue}if(e.external){const p=(l=e.external.registry.get(u[0]))==null?void 0:l.id;if(t!==u[0]&&p){i(u);continue}}if((c=e.metadataRegistry.get(u[0]))==null?void 0:c.id){i(u);continue}if(f.cycle){i(u);continue}if(f.count>1&&e.reused==="ref"){i(u);continue}}}function gN(e,t){var a,l,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=f=>{const h=e.seen.get(f);if(h.ref===null)return;const p=h.def??h.schema,m={...p},g=h.ref;if(h.ref=null,g){r(g);const y=e.seen.get(g),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):Object.assign(p,v),Object.assign(p,m),f._zod.parent===g)for(const w in p)w==="$ref"||w==="allOf"||w in m||delete p[w];if(v.$ref&&y.def)for(const w in p)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(p[w])===JSON.stringify(y.def[w])&&delete p[w]}const x=f._zod.parent;if(x&&x!==g){r(x);const y=e.seen.get(x);if(y!=null&&y.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const v in p)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(p[v])===JSON.stringify(y.def[v])&&delete p[v]}e.override({zodSchema:f,jsonSchema:p,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())r(f[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const f=(l=e.external.registry.get(t))==null?void 0:l.id;if(!f)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(f)}Object.assign(s,n.def??n.schema);const i=(c=e.metadataRegistry.get(t))==null?void 0:c.id;i!==void 0&&s.id===i&&delete s.id;const o=((u=e.external)==null?void 0:u.defs)??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,o[h.defId]=h.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const f=JSON.parse(JSON.stringify(s));return Object.defineProperty(f,"~standard",{value:{...t["~standard"],jsonSchema:{input:rf(t,"input",e.processors),output:rf(t,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function Pt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Pt(r.element,n);if(r.type==="set")return Pt(r.valueType,n);if(r.type==="lazy")return Pt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Pt(r.innerType,n);if(r.type==="intersection")return Pt(r.left,n)||Pt(r.right,n);if(r.type==="record"||r.type==="map")return Pt(r.keyType,n)||Pt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Pt(r.in,n)||Pt(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Pt(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Pt(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Pt(s,n))return!0;return!!(r.rest&&Pt(r.rest,n))}return!1}const sZ=(e,t={})=>n=>{const r=pN({...n,processors:t});return xt(e,r),mN(r,e),gN(r,e)},rf=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=pN({...s??{},target:i,io:t,processors:n});return xt(e,o),mN(o,e),gN(o,e)},iZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oZ=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=iZ[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},aZ=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";f?p?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof i=="number"&&(s.minimum=i),h?p?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof l=="number"&&(s.multipleOf=l)},lZ=(e,t,n,r)=>{n.type="boolean"},cZ=(e,t,n,r)=>{n.not={}},uZ=(e,t,n,r)=>{},dZ=(e,t,n,r)=>{const s=e._zod.def,i=GT(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},fZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pZ=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=xt(i.element,t,{...r,path:[...r.path,"items"]})},mZ=(e,t,n,r)=>{var c;const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const u in o)s.properties[u]=xt(o[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{const f=i.shape[u]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(s.required=Array.from(l)),((c=i.catchall)==null?void 0:c._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=xt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},gZ=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,l)=>xt(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=o:n.anyOf=o},yZ=(e,t,n,r)=>{const s=e._zod.def,i=xt(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=xt(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=l},xZ=(e,t,n,r)=>{const s=e._zod.def,i=xt(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},vZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},bZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},wZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},kZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},_Z=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;xt(o,t,r);const a=t.seen.get(e);a.ref=o},SZ=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},yN=(e,t,n,r)=>{const s=e._zod.def;xt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},CZ=B("ZodISODateTime",(e,t)=>{NG.init(e,t),Fe.init(e,t)});function jZ(e){return L7(CZ,e)}const EZ=B("ZodISODate",(e,t)=>{IG.init(e,t),Fe.init(e,t)});function PZ(e){return M7(EZ,e)}const TZ=B("ZodISOTime",(e,t)=>{AG.init(e,t),Fe.init(e,t)});function NZ(e){return $7(TZ,e)}const IZ=B("ZodISODuration",(e,t)=>{RG.init(e,t),Fe.init(e,t)});function AZ(e){return D7(IZ,e)}const RZ=(e,t)=>{QT.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>wH(e,n)},flatten:{value:n=>bH(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Dg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Dg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Dn=B("ZodError",RZ,{Parent:Error}),LZ=kv(Dn),MZ=_v(Dn),$Z=Xf(Dn),DZ=eh(Dn),OZ=SH(Dn),zZ=CH(Dn),FZ=jH(Dn),BZ=EH(Dn),VZ=PH(Dn),UZ=TH(Dn),WZ=NH(Dn),KZ=IH(Dn),Zk=new WeakMap;function hc(e,t,n){const r=Object.getPrototypeOf(e);let s=Zk.get(r);if(s||(s=new Set,Zk.set(r,s)),!s.has(t)){s.add(t);for(const i in n){const o=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Qe=B("ZodType",(e,t)=>(Je.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rf(e,"input"),output:rf(e,"output")}}),e.toJSONSchema=sZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>LZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$Z(e,n,r),e.parseAsync=async(n,r)=>MZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>DZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>OZ(e,n,r),e.decode=(n,r)=>zZ(e,n,r),e.encodeAsync=async(n,r)=>FZ(e,n,r),e.decodeAsync=async(n,r)=>BZ(e,n,r),e.safeEncode=(n,r)=>VZ(e,n,r),e.safeDecode=(n,r)=>UZ(e,n,r),e.safeEncodeAsync=async(n,r)=>WZ(e,n,r),e.safeDecodeAsync=async(n,r)=>KZ(e,n,r),hc(e,"ZodType",{check(...n){const r=this.def;return this.clone(Bs(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Vs(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check($q(n,r))},superRefine(n,r){return this.check(Dq(n,r))},overwrite(n){return this.check(fa(n))},optional(){return Qk(this)},exactOptional(){return _q(this)},nullable(){return Xk(this)},nullish(){return Qk(Xk(this))},nonoptional(n){return Tq(this,n)},array(){return Hl(this)},or(n){return xq([this,n])},and(n){return bq(this,n)},transform(n){return e_(this,wN(n))},default(n){return jq(this,n)},prefault(n){return Pq(this,n)},catch(n){return Iq(this,n)},pipe(n){return e_(this,n)},readonly(){return Lq(this)},describe(n){const r=this.clone();return qa.add(r,{description:n}),r},meta(...n){if(n.length===0)return qa.get(this);const r=this.clone();return qa.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=qa.get(e))==null?void 0:n.description},configurable:!0}),e)),xN=B("_ZodString",(e,t)=>{Sv.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>oZ(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,hc(e,"_ZodString",{regex(...r){return this.check(U7(...r))},includes(...r){return this.check(H7(...r))},startsWith(...r){return this.check(G7(...r))},endsWith(...r){return this.check(Z7(...r))},min(...r){return this.check(nf(...r))},max(...r){return this.check(fN(...r))},length(...r){return this.check(hN(...r))},nonempty(...r){return this.check(nf(1,...r))},lowercase(r){return this.check(W7(r))},uppercase(r){return this.check(K7(r))},trim(){return this.check(Y7())},normalize(...r){return this.check(q7(...r))},toLowerCase(){return this.check(J7())},toUpperCase(){return this.check(Q7())},slugify(){return this.check(X7())}})}),HZ=B("ZodString",(e,t)=>{Sv.init(e,t),xN.init(e,t),e.email=n=>e.check(h7(GZ,n)),e.url=n=>e.check(x7(ZZ,n)),e.jwt=n=>e.check(R7(cq,n)),e.emoji=n=>e.check(v7(qZ,n)),e.guid=n=>e.check(Wk(qk,n)),e.uuid=n=>e.check(p7(gu,n)),e.uuidv4=n=>e.check(m7(gu,n)),e.uuidv6=n=>e.check(g7(gu,n)),e.uuidv7=n=>e.check(y7(gu,n)),e.nanoid=n=>e.check(b7(YZ,n)),e.guid=n=>e.check(Wk(qk,n)),e.cuid=n=>e.check(w7(JZ,n)),e.cuid2=n=>e.check(k7(QZ,n)),e.ulid=n=>e.check(_7(XZ,n)),e.base64=n=>e.check(N7(oq,n)),e.base64url=n=>e.check(I7(aq,n)),e.xid=n=>e.check(S7(eq,n)),e.ksuid=n=>e.check(C7(tq,n)),e.ipv4=n=>e.check(j7(nq,n)),e.ipv6=n=>e.check(E7(rq,n)),e.cidrv4=n=>e.check(P7(sq,n)),e.cidrv6=n=>e.check(T7(iq,n)),e.e164=n=>e.check(A7(lq,n)),e.datetime=n=>e.check(jZ(n)),e.date=n=>e.check(PZ(n)),e.time=n=>e.check(NZ(n)),e.duration=n=>e.check(AZ(n))});function fe(e){return f7(HZ,e)}const Fe=B("ZodStringFormat",(e,t)=>{$e.init(e,t),xN.init(e,t)}),GZ=B("ZodEmail",(e,t)=>{wG.init(e,t),Fe.init(e,t)}),qk=B("ZodGUID",(e,t)=>{vG.init(e,t),Fe.init(e,t)}),gu=B("ZodUUID",(e,t)=>{bG.init(e,t),Fe.init(e,t)}),ZZ=B("ZodURL",(e,t)=>{kG.init(e,t),Fe.init(e,t)}),qZ=B("ZodEmoji",(e,t)=>{_G.init(e,t),Fe.init(e,t)}),YZ=B("ZodNanoID",(e,t)=>{SG.init(e,t),Fe.init(e,t)}),JZ=B("ZodCUID",(e,t)=>{CG.init(e,t),Fe.init(e,t)}),QZ=B("ZodCUID2",(e,t)=>{jG.init(e,t),Fe.init(e,t)}),XZ=B("ZodULID",(e,t)=>{EG.init(e,t),Fe.init(e,t)}),eq=B("ZodXID",(e,t)=>{PG.init(e,t),Fe.init(e,t)}),tq=B("ZodKSUID",(e,t)=>{TG.init(e,t),Fe.init(e,t)}),nq=B("ZodIPv4",(e,t)=>{LG.init(e,t),Fe.init(e,t)}),rq=B("ZodIPv6",(e,t)=>{MG.init(e,t),Fe.init(e,t)}),sq=B("ZodCIDRv4",(e,t)=>{$G.init(e,t),Fe.init(e,t)}),iq=B("ZodCIDRv6",(e,t)=>{DG.init(e,t),Fe.init(e,t)}),oq=B("ZodBase64",(e,t)=>{OG.init(e,t),Fe.init(e,t)}),aq=B("ZodBase64URL",(e,t)=>{FG.init(e,t),Fe.init(e,t)}),lq=B("ZodE164",(e,t)=>{BG.init(e,t),Fe.init(e,t)}),cq=B("ZodJWT",(e,t)=>{UG.init(e,t),Fe.init(e,t)}),vN=B("ZodNumber",(e,t)=>{aN.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>aZ(e,r,s),hc(e,"ZodNumber",{gt(r,s){return this.check(Hk(r,s))},gte(r,s){return this.check(Rp(r,s))},min(r,s){return this.check(Rp(r,s))},lt(r,s){return this.check(Kk(r,s))},lte(r,s){return this.check(Ap(r,s))},max(r,s){return this.check(Ap(r,s))},int(r){return this.check(Yk(r))},safe(r){return this.check(Yk(r))},positive(r){return this.check(Hk(0,r))},nonnegative(r){return this.check(Rp(0,r))},negative(r){return this.check(Kk(0,r))},nonpositive(r){return this.check(Ap(0,r))},multipleOf(r,s){return this.check(Gk(r,s))},step(r,s){return this.check(Gk(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function cr(e){return O7(vN,e)}const uq=B("ZodNumberFormat",(e,t)=>{WG.init(e,t),vN.init(e,t)});function Yk(e){return z7(uq,e)}const dq=B("ZodBoolean",(e,t)=>{KG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lZ(e,n,r)});function bN(e){return F7(dq,e)}const fq=B("ZodUnknown",(e,t)=>{HG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>uZ()});function Jk(){return B7(fq)}const hq=B("ZodNever",(e,t)=>{GG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cZ(e,n,r)});function pq(e){return V7(hq,e)}const mq=B("ZodArray",(e,t)=>{ZG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>pZ(e,n,r,s),e.element=t.element,hc(e,"ZodArray",{min(n,r){return this.check(nf(n,r))},nonempty(n){return this.check(nf(1,n))},max(n,r){return this.check(fN(n,r))},length(n,r){return this.check(hN(n,r))},unwrap(){return this.element}})});function Hl(e,t){return eZ(mq,e,t)}const gq=B("ZodObject",(e,t)=>{YG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>mZ(e,n,r,s),we(e,"shape",()=>t.shape),hc(e,"ZodObject",{keyof(){return mt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Jk()})},loose(){return this.clone({...this._zod.def,catchall:Jk()})},strict(){return this.clone({...this._zod.def,catchall:pq()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return pH(this,n)},safeExtend(n){return mH(this,n)},merge(n){return gH(this,n)},pick(n){return fH(this,n)},omit(n){return hH(this,n)},partial(...n){return yH(kN,this,n[0])},required(...n){return xH(_N,this,n[0])}})});function dn(e,t){const n={type:"object",shape:e??{},...Y(t)};return new gq(n)}const yq=B("ZodUnion",(e,t)=>{JG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gZ(e,n,r,s),e.options=t.options});function xq(e,t){return new yq({type:"union",options:e,...Y(t)})}const vq=B("ZodIntersection",(e,t)=>{QG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yZ(e,n,r,s)});function bq(e,t){return new vq({type:"intersection",left:e,right:t})}const zg=B("ZodEnum",(e,t)=>{XG.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(r,s,i)=>dZ(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new zg({...t,checks:[],...Y(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new zg({...t,checks:[],...Y(s),entries:i})}});function mt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new zg({type:"enum",entries:n,...Y(t)})}const wq=B("ZodTransform",(e,t)=>{e7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>hZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new HT(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Kl(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Kl(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function wN(e){return new wq({type:"transform",transform:e})}const kN=B("ZodOptional",(e,t)=>{uN.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Qk(e){return new kN({type:"optional",innerType:e})}const kq=B("ZodExactOptional",(e,t)=>{t7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function _q(e){return new kq({type:"optional",innerType:e})}const Sq=B("ZodNullable",(e,t)=>{n7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>xZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Xk(e){return new Sq({type:"nullable",innerType:e})}const Cq=B("ZodDefault",(e,t)=>{r7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jq(e,t){return new Cq({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():qT(t)}})}const Eq=B("ZodPrefault",(e,t)=>{s7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>wZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Pq(e,t){return new Eq({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():qT(t)}})}const _N=B("ZodNonOptional",(e,t)=>{i7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>vZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Tq(e,t){return new _N({type:"nonoptional",innerType:e,...Y(t)})}const Nq=B("ZodCatch",(e,t)=>{o7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>kZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iq(e,t){return new Nq({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const SN=B("ZodPipe",(e,t)=>{dN.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_Z(e,n,r,s),e.in=t.in,e.out=t.out});function e_(e,t){return new SN({type:"pipe",in:e,out:t})}const Aq=B("ZodPreprocess",(e,t)=>{SN.init(e,t),a7.init(e,t)}),Rq=B("ZodReadonly",(e,t)=>{l7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>SZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Lq(e){return new Rq({type:"readonly",innerType:e})}const Mq=B("ZodCustom",(e,t)=>{c7.init(e,t),Qe.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fZ(e,n)});function $q(e,t={}){return tZ(Mq,e,t)}function Dq(e,t){return nZ(e,t)}function Oq(e,t){return new Aq({type:"pipe",in:wN(e),out:t})}const Js=Oq(e=>typeof e=="string"?{agent:e}:e,dn({agent:mt(oc),model:fe().optional(),effort:fe().optional()})),Ts=fe().regex(/^\d{4}-\d{2}-\d{2}$/,"expected YYYY-MM-DD");dn({status:mt(["idea","planned","in-progress","review","done","dropped"]),kind:mt(["feat","fix","chore","docs","refactor"]).optional(),id:fe().optional(),idea:fe().optional(),agent:mt(oc).optional(),created:Ts,updated:Ts.optional(),tags:fe().optional()});dn({id:fe().describe("Permanent plan ID, e.g. FEAT-24"),title:fe().describe('Human-readable plan name, e.g. "Plan storage architecture"'),kind:mt(["feat","fix","chore","docs","refactor"]).describe("Plan kind matching Conventional Commits types"),status:mt(["idea","planned","in-progress","review","done","dropped"]).describe("Current lifecycle status"),idea:fe().optional().describe("IDEA-N backlink if this plan grew out of an idea"),agent:mt(oc).optional().describe("Per-plan agent override"),created:Ts.describe("Creation date (YYYY-MM-DD)"),updated:Ts.optional().describe("Last significant update date (YYYY-MM-DD)"),audited:Ts.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),"audited-hash":fe().optional().describe("Content hash of the plan at last audit, used to detect edits regardless of mtime"),tags:Hl(fe()).optional().describe("Tagging categories")}).passthrough();dn({id:fe().describe("Permanent idea ID, e.g. IDEA-20"),title:fe().describe("Short idea headline (3-6 words)"),kind:mt(["idea","note"]).optional().describe('"note" for ideas that never need a plan; omitted means a plan-bearing idea'),status:mt(["open","done","dropped"]).optional().describe("Manual lifecycle, valid only on notes — plan-bearing ideas carry no status")}).passthrough().refine(e=>e.status===void 0||e.kind==="note",{message:"status is only valid on ideas with kind: note",path:["status"]});const CN=dn({id:fe().describe("Permanent lifetime entity ID, e.g. IDEA-45 — never changes"),title:fe().describe("Human-readable entity name"),type:mt(["feat","fix","chore","docs","refactor"]).optional().describe("Work classification (Conventional Commits values) driving commit types and branch prefixes; usually set once a plan is drafted"),kind:mt(["note","fix","board","ticket"]).optional().describe('"note" marks an entity that never grows phases; "fix" is a follow-up entity linked to a done/archived parent via `idea`; "board" decomposes into "ticket" children instead of phases; "ticket" is a full entity linked back to its board via `idea`; omitted for normal ideas'),status:mt(["idea","planned","in-progress","review","done","dropped","open"]).optional().describe("Stored override, no longer the source of truth: most lifecycle states derive from phases/branch/PR. Only dropped, a planless idea/note being closed, or the offline fallback need this set."),agent:mt(oc).optional().describe("Per-entity agent override"),created:Ts.describe("Creation date (YYYY-MM-DD)"),updated:Ts.optional().describe("Last significant update date (YYYY-MM-DD)"),audited:Ts.optional().describe("Date of last successful convergence audit (YYYY-MM-DD)"),"audited-hash":fe().optional().describe("Content hash of the entity at last audit, used to detect edits regardless of mtime"),released:fe().optional().describe("Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train"),tags:Hl(fe()).optional().describe("Tagging categories"),idea:fe().optional().describe("IDEA-N backlink to the parent this fix addresses; required when kind: fix"),subject:fe().optional().describe('Subject group name; absent renders as the virtual "No subject" group'),order:cr().int().optional().describe("Run order; absent means unordered, sorting after ordered entries"),issueSource:fe().optional().describe("sourceKind:sourceKey of the Issue (IDEA-192) this entity was promoted from, if any")}).passthrough(),zq=new Set(Object.keys(CN.shape)),Fq=CN.refine(e=>e.kind!=="note"||e.status===void 0||["open","done","dropped"].includes(e.status),{message:"a note entity must use status open, done, or dropped",path:["status"]}).refine(e=>e.kind==="note"||e.status!=="open",{message:"status open is only valid on entities with kind: note",path:["status"]}).refine(e=>e.kind!=="fix"||e.idea!==void 0,{message:"a kind: fix entity requires an idea: link to its parent",path:["idea"]}).refine(e=>e.kind!=="ticket"||e.idea!==void 0,{message:"a kind: ticket entity requires an idea: link to its board",path:["idea"]}),Bq=dn({name:fe(),cmd:fe(),port:cr().int().positive().optional(),healthcheck:fe().optional()}),Vq=dn({name:fe(),cmd:fe()}),Uq=dn({repo:fe(),branch:fe().optional(),releasePlease:bN().optional()}),Wq=dn({services:Hl(Bq).optional(),checks:Hl(Vq).optional(),ci:Uq.optional()});dn({version:cr().int().describe("Corpus format version (see CORPUS_FORMAT_VERSION), not the package version"),projectName:fe(),initializedAt:fe(),nextId:dn({idea:cr().optional(),ticket:cr().optional(),feat:cr().optional(),fix:cr().optional(),chore:cr().optional(),docs:cr().optional(),refactor:cr().optional()}).optional(),defaultAgent:mt(oc).optional(),defaultAgents:dn({phase:Js,planDraft:Js,ideaExtend:Js,commitSuggest:Js,feedback:Js,codeReview:Js,deskDiscovery:Js}).optional(),desk:Wq.optional()});dn({id:fe(),kind:mt(["completed","reply"]),entityId:fe(),entityTitle:fe(),text:fe(),date:fe(),read:bN(),outcome:mt(["done","error"]).optional()});const Kq=/^#{2,3}\s+/;function Fg(e,t){const n=e.split(`
|
|
261
|
+
`),r=n.findIndex(a=>t.headingRe.test(a));if(r===-1)return{body:e,entries:[]};let s=n.length;for(let a=r+1;a<n.length;a++)if(Kq.test(n[a])){s=a;break}const i=t.parseEntries(n,r+1,s);return{body:[...n.slice(0,r),...n.slice(s)].join(`
|
|
262
|
+
`).trim(),entries:i}}const t_={phases:UT,log:eH,clarifications:tH,notes:nH,review:rH};function Hq(e){const t={phases:[],log:[],clarifications:[],notes:[],review:[]};let n=e;for(const r of Object.keys(t_)){const s=Fg(n,t_[r]);n=s.body,t[r]=s.entries}return{body:n,...t}}const Gq=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n)?/;function Zq(e,t){const n=[],r=e.match(Gq);if(!r)return{data:null,body:e.trim(),warnings:n};const s=r[1],i=e.slice(r[0].length).trim();let o;try{o=FK(s)}catch(l){return n.push({title:"(frontmatter)",message:`Invalid YAML frontmatter: ${l.message}`}),{data:null,body:i,warnings:n}}if(typeof o!="object"||o===null||Array.isArray(o))return n.push({title:"(frontmatter)",message:"YAML frontmatter did not produce an object"}),{data:null,body:i,warnings:n};const a=t.safeParse(o);if(!a.success){const l=o.id;return n.push({title:l??"(frontmatter)",message:a.error.issues.map(c=>c.message).join("; ")}),{data:null,body:i,warnings:n}}return{data:a.data,body:i,warnings:n}}function qq(e,t){const n=Object.fromEntries(Object.entries(e).filter(([r])=>!t.has(r)));return Object.keys(n).length>0?n:void 0}function Yq(e){const t=[],{data:n,body:r,warnings:s}=Zq(e,Fq);if(t.push(...s),!n)return{entries:[],warnings:t};const{body:i,phases:o,log:a,clarifications:l,notes:c,review:u}=Hq(r),{body:f,entries:h}=Fg(i,WT),{body:p,entries:m}=Fg(f,KT),g=[...m,...SW(a,l,c,u)];n.kind==="note"&&o.length>0&&t.push({title:n.title,message:"note entities must not carry a Phases section — kept, but fix the file"});const x=qq(n,zq);return{entries:[{id:n.id,title:n.title,type:n.type,kind:n.kind,status:n.status,idea:n.idea,agent:n.agent,created:n.created,updated:n.updated,audited:n.audited,auditedHash:n["audited-hash"],released:n.released,tags:n.tags??[],subject:n.subject,order:n.order,issueSource:n.issueSource,body:p,phases:o,...h.length>0&&{fixes:h},...g.length>0&&{thread:g},...x&&{unknownFrontmatter:x}}],warnings:t}}const Jq=new Set(["planned","in-progress","review"]);function n_(e){return Jq.has(e.status??"")}function Qq(e,t,n){const r=new Map(t.filter(s=>s.id!==void 0).map(s=>[s.id,s.status]));return e.filter(s=>s.kind!=="note"&&s.kind!=="board").map(s=>{const i=n==null?void 0:n(s.id);return{id:s.id,title:s.title,created:s.created,status:i?i.value:r.get(s.id)??s.status}})}function Xq(e,t,n){const r=new Map(t.map(l=>[l.id,l])),s=new Set,i=[];for(const l of e){if(s.has(l.id))continue;const c=r.get(l.id);c===void 0||!n_(c)||(s.add(c.id),i.push(c))}const o=t.filter(l=>n_(l)&&!s.has(l.id)).sort((l,c)=>l.created.localeCompare(c.created)),a=[...i,...o];if(n){const l=a.findIndex(c=>c.id===n.id);if(l!==-1){const[c]=a.splice(l,1),u=Math.min(Math.max(Math.round(n.order),1),a.length+1);a.splice(u-1,0,c)}}return a.map(l=>({id:l.id,title:l.title}))}const Bg=" — ";function jN(e){return e.split(`
|
|
263
|
+
`).map(t=>t.trim()).filter(t=>t.length>0).map(t=>{const n=t.indexOf(Bg);return n===-1?{id:t,title:""}:{id:t.slice(0,n).trim(),title:t.slice(n+Bg.length).trim()}})}function eY(e){return e.length===0?"":`${e.map(t=>`${t.id}${Bg}${t.title}`).join(`
|
|
264
|
+
`)}
|
|
265
|
+
`}function tY(e,t){for(const{entries:n,section:r}of t)n&&n.length>0&&e.push(r.formatLines(n).join(`
|
|
266
|
+
`))}function Vg(){return new Date().toISOString().slice(0,10)}function nY(e){return`---
|
|
267
|
+
${BK(e).trimEnd()}
|
|
268
|
+
---`}function EN(e){const t={id:e.id,title:e.title};e.type&&(t.type=e.type),e.kind&&(t.kind=e.kind),e.status&&(t.status=e.status),e.idea&&(t.idea=e.idea),t.created=e.created,e.agent&&(t.agent=e.agent),e.updated&&(t.updated=e.updated),e.audited&&(t.audited=e.audited),e.auditedHash&&(t["audited-hash"]=e.auditedHash),e.released&&(t.released=e.released),e.tags&&e.tags.length>0&&(t.tags=e.tags),e.subject&&(t.subject=e.subject),e.order!==void 0&&(t.order=e.order),e.issueSource&&(t.issueSource=e.issueSource);for(const r of Object.keys(e.unknownFrontmatter??{}).sort())t[r]=e.unknownFrontmatter[r];const n=[nY(t)];return e.body&&n.push(e.body),tY(n,[{entries:e.phases,section:UT},{entries:e.fixes,section:WT},{entries:e.thread,section:KT}]),n.join(`
|
|
269
|
+
|
|
270
|
+
`).trimEnd()}const rY="https://api.github.com";class Cv extends Error{constructor(t,n){super(t),this.status=n,this.name="GithubApiError"}}function sY(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n)}function iY(e){const t=atob(e.replace(/\s/g,"")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}async function nh(e,t,n){const r=await fetch(`${rY}/repos/${e.owner}/${e.repo}${t}`,{...n,headers:{Authorization:`Bearer ${e.token}`,Accept:"application/vnd.github+json",...n!=null&&n.body?{"Content-Type":"application/json"}:{},...n==null?void 0:n.headers}});if(r.status===404)return null;if(!r.ok){const s=await r.json().catch(()=>null);throw new Cv((s==null?void 0:s.message)??`GitHub API error (${r.status})`,r.status)}return r.json()}const rh=e=>`/contents/${e.split("/").map(encodeURIComponent).join("/")}`;async function pc(e,t){const n=await nh(e,rh(t));return!n||Array.isArray(n)?null:{content:iY(n.content),sha:n.sha}}async function oY(e,t){const n=await nh(e,rh(t));return Array.isArray(n)?n.map(r=>({name:r.name,type:r.type})):[]}async function Gl(e,t,n,r,s){return{sha:(await nh(e,rh(t),{method:"PUT",body:JSON.stringify({message:r,content:sY(n),...s&&{sha:s}})})).content.sha}}async function aY(e,t,n,r){await nh(e,rh(t),{method:"DELETE",body:JSON.stringify({message:r,sha:n})})}const sf="papercamp/ideas",PN="papercamp/config.json",Ug="papercamp/run-order.md";async function r_(e,t,n){const r=(await oY(e,t)).filter(i=>i.type==="file"&&i.name.endsWith(".md")&&i.name!=="index.md");return(await Promise.all(r.map(async i=>{const o=`${t}/${i.name}`,a=await pc(e,o);if(!a)return null;const l=Yq(a.content).entries[0];return l?{entry:{...l,archived:n},path:o,sha:a.sha}:null}))).filter(i=>i!==null)}async function lY(e){const t=await pc(e,Ug);return new Map(jN((t==null?void 0:t.content)??"").map((n,r)=>[n.id,r+1]))}async function jv(e){const[t,n,r]=await Promise.all([r_(e,sf,!1),r_(e,`${sf}/archive`,!0),lY(e)]);return[...t,...n].map(s=>({...s,entry:{...s.entry,storedOrder:s.entry.order,order:r.get(s.entry.id)??s.entry.order}}))}async function cY(e){return{entries:(await jv(e)).filter(n=>n.entry.kind==="note").map(n=>TW(n.entry)),warnings:[]}}async function uY(e){return{entries:(await jv(e)).filter(n=>n.entry.kind!=="note").map(n=>eT(n.entry,void 0,!1,!1)),warnings:[],resolved:!1}}async function dY(e){const t=await pc(e,PN);if(!t)throw new Error("papercamp/config.json not found in this repo");return{file:JSON.parse(t.content),sha:t.sha}}let s_=Promise.resolve();async function fY(e,t){const n=s_.then(async()=>{var u;const{file:r,sha:s}=await dY(e),i=r.nextId??{},o=i.idea??1,a=`IDEA-${o}`;await Gl(e,PN,JSON.stringify({...r,nextId:{...i,idea:o+1}},null,2),`chore(papercamp): mint ${a}`,s);const l=t.kind==="note",c=EN({id:a,title:t.title.trim(),kind:l?"note":t.kind==="board"?"board":void 0,status:l?"open":"idea",created:Vg(),body:(u=t.content)==null?void 0:u.trim()});return await Gl(e,`${sf}/${a}.md`,`${c}
|
|
271
|
+
`,`feat(papercamp): draft ${a}`),a});return s_=n.catch(()=>{}),n}function hY(e,t,n){return e.find(r=>r.entry.title===t||r.entry.id===t)}async function i_(e,t,n,r){const s=EN({id:n.id,title:n.title,type:n.type,kind:n.kind,status:n.status,idea:n.idea,agent:n.agent,created:n.created,updated:n.updated,audited:n.audited,auditedHash:n.auditedHash,released:n.released,tags:n.tags,subject:n.subject,order:n.storedOrder??n.order,issueSource:n.issueSource,body:n.body,phases:n.phases,fixes:n.fixes,thread:n.thread,unknownFrontmatter:n.unknownFrontmatter});await Gl(e,t.path,`${s}
|
|
272
|
+
`,r,t.sha)}async function pY(e,t,n,r){const s=Qq(t.map(l=>l.entry),t.filter(l=>l.entry.kind!=="note").map(l=>eT(l.entry,void 0,!1,!1))),i=await pc(e,Ug),o=jN((i==null?void 0:i.content)??""),a=eY(Xq(o,s,r));await Gl(e,Ug,a,`chore(papercamp): reorder queue after ${n}`,i==null?void 0:i.sha)}async function mY(e,t,n){var a,l,c;const r=await jv(e),s=hY(r,t);if(!s)throw new Error("entity not found");if(bW(s.entry)){const u=(((a=n.phases)==null?void 0:a.length)??0)>s.entry.phases.length,f=(((l=n.fixes)==null?void 0:l.length)??0)>(((c=s.entry.fixes)==null?void 0:c.length)??0),h=n.status!==void 0&&n.status!==null&&n.status!=="done"&&n.status!=="dropped";if(u||f||h||n.body!==void 0)throw new Error("a done/archived entity is read-only — new work spawns its own fix entity")}let i=s.entry.thread;n.thread!==void 0&&(i=n.thread),n.log!==void 0&&(i=PW(i,["log"],n.log.map(u=>({kind:"log",date:u.date,text:u.text}))));const o={...s.entry,...n.body!==void 0&&{body:n.body},...n.status!==void 0&&{status:n.status??void 0},...n.phases!==void 0&&{phases:n.phases},...n.fixes!==void 0&&{fixes:n.fixes},...i!==s.entry.thread&&{thread:i},...n.agent!==void 0&&{agent:n.agent??void 0},...n.subject!==void 0&&{subject:n.subject??void 0},order:s.entry.kind==="note"?n.order!==void 0?n.order??void 0:s.entry.order:void 0,updated:Vg()};if(n.status==="in-progress")for(const u of r)u.entry.id!==s.entry.id&&u.entry.kind!=="note"&&u.entry.status==="in-progress"&&await i_(e,u,{...u.entry,status:"planned",updated:Vg()},`chore(papercamp): demote ${u.entry.id}`);if(await i_(e,s,o,`chore(papercamp): update ${s.entry.id}`),s.entry.kind!=="note"&&(n.order!==void 0||n.status!==void 0)){const u=typeof n.order=="number"?{id:s.entry.id,order:n.order}:void 0,f=r.map(h=>h.entry.id===s.entry.id?{...h,entry:o}:h);await pY(e,f,s.entry.id,u)}if(n.status==="dropped"){const u=await pc(e,s.path);u&&(await Gl(e,`${sf}/archive/${s.entry.id}.md`,u.content,`chore(papercamp): archive ${s.entry.id}`),await aY(e,s.path,u.sha,`chore(papercamp): archive ${s.entry.id}`))}}function gY(e,t){return{ideaEntries:[],loadIdeas:_t(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?cY(r):ZP()},n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:_t(e,oW,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await aW(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function yY(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:_t(e,dW,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 fW(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function xY(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:_t(e,hW,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const sh=(e,t)=>e.kind==="phase"&&!e.item.done&&(t==null?void 0:t.index)===e.index,Wg=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`},TN=e=>{const t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),s=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?`as of ${s}`:`as of ${t.toLocaleDateString()} ${s}`},NN=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)}},IN=e=>NN(e.phases),o_=e=>{var t;return((t=IN(e))==null?void 0:t.pct)??null},vY=e=>NN([...e.phases,...e.fixes??[]]),bY=(e,t)=>{const n=vY(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}},ih=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,wY=(e,t)=>e?t.find(n=>n.planId===e&&n.taskKind==="pr-review"&&n.status!=="done"&&n.status!=="error"):void 0,kY=e=>{var t;return(t=[...e??[]].reverse().find(n=>n.kind==="review"))==null?void 0:t.text},oh=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:ih(e.id,t)?"in-progress":e.status,_Y=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&(e.entityKind==="board"?e.status==="review":e.phases.length>0&&e.phases.every(t=>t.done))&&(e.fixes??[]).every(t=>t.done),SY=e=>e.phases.some(t=>t.done),CY=(e,t)=>{const n=[];return e.phases.length>0&&e.phases.every(r=>r.done)||n.push("open phases"),(e.fixes??[]).every(r=>r.done)||n.push("open fixes"),e.pr?e.pr.reviewDecision==="changes-requested"&&n.push("requested changes"):n.push("an open PR"),t!==!0&&n.push("CI"),{ready:n.length===0,missing:n}};function Lp(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 jY(a)}function jY(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 EY=["in-progress","review","planned","idea"],PY=["open"],Ev={statuses:EY,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:PY,subject:null,groupBySubject:!0},a_={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},yu=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},l_=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},c_=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Mp=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},u_=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Xu=(e,t)=>t===null||e===t,d_=e=>e.status==="in-progress"||e.status==="review"?0:1,AN=(e,t,n,r="asc")=>{const s=d_(e)-d_(t);if(s!==0)return s;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:l_(e)-l_(t);const i=(()=>{switch(n){case"status":{const o=a_[e.status]-a_[t.status];return o!==0?o:yu(t)-yu(e)}case"updated":return yu(t)-yu(e);case"title":return e.title.localeCompare(t.title);case"id":return c_(e)-c_(t);case"progress":return(o_(t)??-1)-(o_(e)??-1);default:return 0}})();return r==="desc"?-i:i},Kg=(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},dl=(e,t=Ev)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=Kg(e.filter(a=>u_(a,n)&&Mp(a,t.search)&&Xu(a.subject,t.subject)),a=>[a.status]);for(const a of K8)s[a]??(s[a]=0);const i=Kg(e.filter(a=>r.has(a.status)&&Mp(a,t.search)&&Xu(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&u_(a,n)&&Mp(a,t.search)&&Xu(a.subject,t.subject)).sort((a,l)=>AN(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},TY=["open","done","dropped"],NY={open:"idea",done:"done",dropped:"dropped"},f_=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},IY=e=>e.type==="plan"?e.plan.subject:e.type==="fix"?e.fix.subject:e.idea.subject,AY=e=>e.type==="plan"?e.plan.order:e.type==="fix"?e.fix.order:e.idea.order,RY=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.type==="fix"?e.fix.updated??e.fix.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},h_=(e,t)=>e.reduce((n,r)=>{const s=AY(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),p_=e=>e.reduce((t,n)=>Math.max(t,RY(n)),0),LY=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=IY(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=h_(l.rows,t),f=h_(c.rows,t);return u!==void 0&&f!==void 0?i*(u-f):u!==void 0?-1:f!==void 0?1:p_(c.rows)-p_(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},m_=e=>e.type==="plan"?e.plan:e.type==="fix"?e.fix:{title:e.idea.title,id:e.idea.id??void 0,status:NY[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order},MY=(e,t,n=Ev)=>{const r=e.filter(m=>m.entityKind!=="ticket"),s=new Map(r.map(m=>[m.id,m.subject])),i=r.map(m=>m.entityKind==="fix"?{...m,subject:m.idea&&s.get(m.idea)||void 0}:m),o=i.filter(m=>m.entityKind==="fix"),a=i.filter(m=>m.entityKind!=="fix"),{statusCounts:l,tagCounts:c}=dl(i,n),u=t.filter(m=>m.kind==="note"),f=new Set(n.noteStatuses),h=Kg(u.filter(m=>f_(m,n.search)),m=>[m.status??"open"]);for(const m of TY)h[m]??(h[m]=0);const p=dl(a,n).rows.map(m=>({type:"plan",plan:m}));p.push(...dl(o,n).rows.map(m=>({type:"fix",fix:m})));for(const m of u)f.has(m.status??"open")&&f_(m,n.search)&&Xu(m.subject,n.subject)&&p.push({type:"note",idea:m});return p.sort((m,g)=>AN(m_(m),m_(g),n.sortKey,n.sortDirection)),{rows:p,statusCounts:l,tagCounts:c,noteStatusCounts:h}},$Y=.2,DY=5,RN=3,LN=2,MN=1,OY=RN+LN+MN,zY=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"]),xu=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!zY.has(n));return new Set(t)},$p=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function FY(e,t,n={}){const{threshold:r=$Y,limit:s=DY}=n,i=xu(e);if(i.size===0)return[];const o=[];for(const a of t){const l=xu(a.title),c=xu(a.body),u=xu((a.tags??[]).join(" ")),h=($p(i,l)*RN+$p(i,u)*LN+$p(i,c)*MN)/(i.size*OY);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const BY=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}`},VY=(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=[BY(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},UY=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)=>VY(r,s))},WY=e=>`Fix the failing "${e}" check`,KY=({cmd:e,output:t})=>`The command was \`${e}\`.
|
|
273
|
+
|
|
274
|
+
Output from the last run:
|
|
275
|
+
|
|
276
|
+
${t||"(no output captured)"}`,HY=(e,t)=>{const n=i=>t.find(o=>o.name===i),r=n("lint"),s=n("test");return[{name:"Quality",results:r?[r]:[]},{name:"Tests",results:s?[s]:[]},{name:"Consistency",results:[e.consistency]}]},GY=(e,t)=>HY(e,t).flatMap(({name:n,results:r})=>{const s=r.filter(o=>o.status==="fail");if(s.length===0)return[];const i=s.map(KY).join(`
|
|
277
|
+
|
|
278
|
+
`);return[{done:!1,text:WY(n),description:`Fix the failing "${n}" check in this repo.
|
|
279
|
+
|
|
280
|
+
${i}`}]}),ZY=(e,t,n)=>{const r=new Map(GY(t,n).map(i=>[i.text,i]));return[...e.map(i=>{const o=r.get(i.text);return o?(r.delete(i.text),o):i}),...r.values()]},qY=/^[a-z]+\([a-z-]+\):\s+/,YY=e=>e.replace(qY,""),JY=(e,t)=>[...e,{done:!0,text:YY(t),source:"manual"}],$N="papercamp/",QY=e=>e.length>0&&e.every(t=>t.startsWith($N)),XY=e=>`${$N}ideas/${e}.md`,eJ=14*24*60*60*1e3;function mc(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.storedAt>eJ?(localStorage.removeItem(e),null):n.value}catch{return null}}function gc(e,t){try{const n={value:t,storedAt:Date.now()};localStorage.setItem(e,JSON.stringify(n))}catch{}}function Pv(e){try{localStorage.removeItem(e)}catch{}}function tJ(e){return`feedback-draft:${e.id??e.title}`}const DN="plan-filters",ON="detail-view";function nJ(){return mc(DN)??Ev}function rJ(){return mc(ON)??"details"}function ts(e){return gc(DN,e),e}function sJ(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:_t(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?uY(r):YP()},n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:nJ(),togglePlanStatus:n=>e(r=>({planFilters:ts({...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]})})),togglePlanTag:n=>e(r=>({planFilters:ts({...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]})})),toggleNoteStatus:n=>e(r=>({planFilters:ts({...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]})})),setPlanSearch:n=>e(r=>({planFilters:ts({...r.planFilters,search:n})})),setSubjectFilter:n=>e(r=>({planFilters:ts({...r.planFilters,subject:n})})),setPlanSortKey:n=>e(r=>({planFilters:ts({...r.planFilters,sortKey:n,groupBySubject:!1})})),togglePlanSortDirection:()=>e(n=>({planFilters:ts({...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc",groupBySubject:!1})})),toggleGroupBySubject:()=>e(n=>({planFilters:ts({...n.planFilters,groupBySubject:!n.planFilters.groupBySubject})})),detailView:rJ(),setDetailView:n=>{gc(ON,n),e({detailView:n})}}}const iJ={horizons:[],statuses:[]},oJ=e=>[...new Set(e.links.map(t=>t.status))],zN=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),FN=(e,t)=>t.length===0||t.includes(e),Bae=(e,t)=>e.horizons.filter(n=>FN(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>zN(r,t.statuses))})),Vae=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>zN(r,t.statuses)).length])),Uae=(e,t)=>{const n={};for(const r of e.horizons)if(FN(r.title,t.horizons))for(const s of r.items)for(const i of oJ(s))n[i]=(n[i]??0)+1;return n};function aJ(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:_t(e,GP,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:iJ,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 lJ="data-paper-camp-mount";function cJ(e){return(e==null?void 0:e.getAttribute(lJ))??""}const Li=typeof document>"u"?"":cJ(document.getElementById("root")),of="paper-camp.projects",Zl="paper-camp.activeProjectId",uJ="paper-camp.runtimes",dJ="paper-camp.activeRuntimeUrl",fJ="paper-camp.hubRepos";function Ms(e){return e.kind==="runtime"?e.runtimeUrl:`${e.owner}/${e.repo}`}function Hg(e){if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}function BN(e){const t=e.indexOf("/");return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function VN(e){if(e.getItem(of)!==null)return;const t=Hg(e.getItem(uJ)),n=Hg(e.getItem(fJ));if(t.length===0&&n.length===0)return;const r=[...t.map(i=>({kind:"runtime",runtimeUrl:i.runtimeUrl,pairingToken:i.pairingToken,label:i.label})),...n.map(i=>{const[o,a]=BN(i);return{kind:"github",owner:o,repo:a}})];e.setItem(of,JSON.stringify(r));const s=e.getItem(dJ);s&&e.setItem(Zl,s)}function ha(e){return e?(VN(e),Hg(e.getItem(of))):[]}function ah(e,t){e==null||e.setItem(of,JSON.stringify(t))}function Gg(e){return ha(e)}function hJ(e){return e?(VN(e),e.getItem(Zl)):null}function pJ(e,t){var o;const n=ha(t),r=(o=n.find(a=>a.kind==="runtime"&&a.runtimeUrl===e.runtimeUrl))==null?void 0:o.label,s={kind:"runtime",runtimeUrl:e.runtimeUrl,pairingToken:e.pairingToken,label:r},i=n.filter(a=>!(a.kind==="runtime"&&a.runtimeUrl===e.runtimeUrl));return i.push(s),ah(t,i),s}function mJ(e,t){const[n,r]=BN(e),s=ha(t),i=s.find(a=>a.kind==="github"&&a.owner===n&&a.repo===r);if(i)return i;const o={kind:"github",owner:n,repo:r};return ah(t,[...s,o]),o}function gJ(e,t){const n=ha(t).filter(r=>Ms(r)!==e);ah(t,n),(t==null?void 0:t.getItem(Zl))===e&&t.removeItem(Zl)}function yJ(e,t,n){const r=ha(n),s=r.findIndex(a=>Ms(a)===e);if(s===-1)return null;const i=t.trim(),o={...r[s],label:i===""?void 0:i};return r[s]=o,ah(n,r),o}function UN(e,t){const n=ha(t).find(r=>Ms(r)===e);return n?(t==null||t.setItem(Zl,e),n):null}const xJ="runtime",vJ="token";function g_(e){return e.kind==="runtime"}function bJ(e){return{runtimeUrl:e.runtimeUrl,pairingToken:e.pairingToken,label:e.label}}function wJ(e){const t=new URLSearchParams((e==null?void 0:e.search)??"");return{runtimeUrl:t.get(xJ)??"",pairingToken:t.get(vJ)}}function kJ(e,t){pJ(t,e),UN(t.runtimeUrl,e)}function _J(e,t){const n=wJ(e);if(n.runtimeUrl)return kJ(t,n),n;const r=hJ(t),s=r?Gg(t).find(i=>g_(i)&&i.runtimeUrl===r):null;return s&&g_(s)?bJ(s):{runtimeUrl:"",pairingToken:null}}const WN=_J(typeof window>"u"?null:window.location,typeof window>"u"?null:window.localStorage),y_=!!Li,x_=!!WN.runtimeUrl,SJ=15e3,v_=2,CJ=1500,jJ=e=>new Promise(t=>setTimeout(t,e));async function EJ(){for(let e=0;e<=v_;e++){try{if((await fetch(K("/api/package-name"),{signal:AbortSignal.timeout(SJ)})).ok)return!0}catch{}e<v_&&await jJ(CJ)}return!1}function PJ(e){return{runtimeReachable:y_,runtimeChecking:x_,checkRuntimeReachable:_t(e,async()=>y_?!0:x_?EJ():!1,t=>({runtimeReachable:t}),()=>({runtimeReachable:!1}),"runtimeChecking")}}const TJ=async()=>(await J(K("/api/status"))).json(),NJ=async()=>{await J(K("/api/status/check?name=consistency"),{method:"POST"})},IJ=async()=>{const e=await J(K("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function AJ(e,t){return{status:null,refreshing:!1,loadStatus:_t(e,TJ,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await IJ().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadDoctor(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runConsistencyCheck:async()=>{try{await NJ()}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 VP(i);return await Ng(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:_t(e,rW,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:_t(e,sW,n=>({doctor:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,gitStashes:[],loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a,stashes:l}=await Y8();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a,gitStashes:l}),!0}catch{return!1}},capabilities:[],loadCapabilities:_t(e,WP,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function RJ(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:_t(e,Q9,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await X9(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await eW(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await nW(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await uW();return await t().refreshAll(),n}}}function LJ(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:_t(e,J9,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const M=m9()((e,t)=>({...sJ(e,t),...aJ(e),...gY(e,t),...RJ(e,t),...LJ(e),...yW(e,t),...AJ(e,t),...q9(e,t),...Y9(e,t),...xY(e),...yY(e,t),...PJ(e),...vW(e)})),lh=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Kr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),KN=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},MJ=e=>e.capabilities.filter(t=>t.status!=="ok").length,$J=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},DJ=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null},OJ=({children:e,onClick:t})=>d.jsx("button",{type:"button",onClick:t,className:"bg-transparent border-none p-0 text-watercolor-amber-dark cursor-pointer underline [font:inherit]",children:e}),zJ=e=>e<=0?"today":e===1?"1 day ago":`${e} days ago`,FJ="A sync pop failed and left work parked here. Recover with `git restore --source=origin/main --staged --worktree .` then `git merge --ff-only`.",BJ=({entry:e})=>{const[t,n]=k.useState(null),[r,s]=k.useState(!1),[i,o]=k.useState(null),[a,l]=k.useState(!1),c=async()=>{if(a){l(!1);return}if(l(!0),!(t!==null||r)){s(!0),o(null);try{n(await Q8(e.index))}catch(u){o(u.message)}finally{s(!1)}}};return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs(OJ,{onClick:c,children:[e.branch,": ",e.message," · ",zJ(e.ageDays)]}),a&&d.jsx("pre",{className:"m-0 max-h-64 overflow-auto whitespace-pre-wrap font-mono text-2xs opacity-80",children:r?"Loading…":i??t})]})},VJ=()=>{const e=M(s=>s.gitStashes),[t,n]=k.useState(!1);if(e.length===0)return null;const r=e.some(s=>s.own);return d.jsxs("div",{children:[d.jsx("button",{type:"button",onClick:()=>n(s=>!s),className:"inline-flex bg-none bg-transparent border-none p-0 cursor-pointer","aria-expanded":t,children:d.jsxs(re,{size:"small",variant:r?"warning":"neutral",children:[e.length," stash",e.length===1?"":"es"]})}),t&&d.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r&&d.jsx("p",{className:"m-0 text-2xs opacity-80",children:FJ}),e.map(s=>d.jsx(BJ,{entry:s},s.index))]})]})};function Ge(e){const t=e.split(`
|
|
281
|
+
`).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}function vu(e,t){const{toast:n}=Ye(),r=M(o=>o.activeGitAction),s=M(o=>o.setActiveGitAction),i=k.useCallback(async o=>{if(!M.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Ge(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function UJ(){const e=M(_=>_.loadGitStatus),t=M(_=>_.loadPlans),n=M(_=>_.loadIdeas),r=M(_=>_.loadDiffFiles),s=M(_=>_.activeGitAction!==null),{toast:i,dismiss:o}=Ye(),a=()=>Promise.all([e(),t(),n(),r()]),[l,c]=vu("push","Push failed"),[u,f]=vu("sync","Sync failed"),[h,p]=vu("pull","Pull failed"),[m,g]=vu("fix-divergence","Fix failed"),x=k.useCallback((_,S)=>{if(S.recovering)return i({title:`${_} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:j,message:E}=S,T=i({title:`${_} hit a conflict`,description:d.jsxs("div",{className:"flex flex-col items-start gap-2",children:[d.jsx("span",{children:Ge(E)}),d.jsx(ee,{size:"small",onClick:async()=>{const P=await s9(j).catch(N=>({ok:!1,error:Ge(N.message)}));P.ok&&o(T),i({title:P.ok?"Resolving conflict":"Could not start the agent",description:P.ok?"Handed off to the agent — see Stack for progress":P.error??"The agent did not start.",variant:P.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[i,o]);return{pushing:l,syncing:u,pulling:h,fixingDivergence:m,gitActionBusy:s,handlePush:()=>c(async()=>{await e9(),await Promise.all([e(),r()])}),handleSync:()=>f(async()=>{const _=await t9();if(!_.ok){if(x("Sync",_)){await e();return}throw new Error(_.message)}await a()}),handlePull:()=>p(async()=>{await n9(),await a()}),handleFixDivergence:()=>g(async()=>{const _=await r9();if(!_.ok){if(x("Fix",_)){await e();return}throw new Error(_.message)}await a()})}}const WJ=()=>{const e=M(c=>c.gitAhead),t=M(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=UJ();return d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[d.jsx(ge,{content:t==="clean-on-main"?"Already on clean main":void 0,children:d.jsx(ee,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx(DP,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),d.jsx(ee,{size:"small",className:"whitespace-nowrap",icon:d.jsx(M8,{size:14}),disabled:i||e===0,onClick:o,children:n?"Pushing…":e>0?`Push (${e})`:"Push"}),d.jsx(ee,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:d.jsx($8,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})};function KJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const HJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZJ={};function b_(e,t){return(ZJ.jsx?GJ:HJ).test(e)}const qJ=/[ \t\n\f\r]/g;function YJ(e){return typeof e=="object"?e.type==="text"?w_(e.value):!1:w_(e)}function w_(e){return e.replace(qJ,"")===""}class yc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yc.prototype.normal={};yc.prototype.property={};yc.prototype.space=void 0;function HN(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new yc(n,r,t)}function Zg(e){return e.toLowerCase()}class Qt{constructor(t,n){this.attribute=n,this.property=t}}Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0;let JJ=0;const oe=Mi(),Xe=Mi(),qg=Mi(),H=Mi(),Se=Mi(),vi=Mi(),rn=Mi();function Mi(){return 2**++JJ}const Yg=Object.freeze(Object.defineProperty({__proto__:null,boolean:oe,booleanish:Xe,commaOrSpaceSeparated:rn,commaSeparated:vi,number:H,overloadedBoolean:qg,spaceSeparated:Se},Symbol.toStringTag,{value:"Module"})),Dp=Object.keys(Yg);class Tv extends Qt{constructor(t,n,r,s){let i=-1;if(super(t,n),k_(this,"space",s),typeof r=="number")for(;++i<Dp.length;){const o=Dp[i];k_(this,Dp[i],(r&Yg[o])===Yg[o])}}}Tv.prototype.defined=!0;function k_(e,t,n){n&&(e[t]=n)}function pa(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Tv(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Zg(r)]=r,n[Zg(i.attribute)]=r}return new yc(t,n,e.space)}const GN=pa({properties:{ariaActiveDescendant:null,ariaAtomic:Xe,ariaAutoComplete:null,ariaBusy:Xe,ariaChecked:Xe,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:Xe,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:Xe,ariaFlowTo:Se,ariaGrabbed:Xe,ariaHasPopup:null,ariaHidden:Xe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:H,ariaLive:null,ariaModal:Xe,ariaMultiLine:Xe,ariaMultiSelectable:Xe,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Xe,ariaReadOnly:Xe,ariaRelevant:null,ariaRequired:Xe,ariaRoleDescription:Se,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Xe,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ZN(e,t){return t in e?e[t]:t}function qN(e,t){return ZN(e,t.toLowerCase())}const QJ=pa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vi,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:oe,allowPaymentRequest:oe,allowUserMedia:oe,alpha:oe,alt:null,as:null,async:oe,autoCapitalize:null,autoComplete:Se,autoFocus:oe,autoPlay:oe,blocking:Se,capture:null,charSet:null,checked:oe,cite:null,className:Se,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Xe,controls:oe,controlsList:Se,coords:H|vi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oe,defer:oe,dir:null,dirName:null,disabled:oe,download:qg,draggable:Xe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oe,formTarget:null,headers:Se,height:H,hidden:qg,high:H,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:oe,inputMode:null,integrity:null,is:null,isMap:oe,itemId:null,itemProp:Se,itemRef:Se,itemScope:oe,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oe,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:oe,muted:oe,name:null,nonce:null,noModule:oe,noValidate:oe,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:oe,optimum:H,pattern:null,ping:Se,placeholder:null,playsInline:oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oe,referrerPolicy:null,rel:Se,required:oe,reversed:oe,rows:H,rowSpan:H,sandbox:Se,scope:null,scoped:oe,seamless:oe,selected:oe,shadowRootClonable:oe,shadowRootCustomElementRegistry:oe,shadowRootDelegatesFocus:oe,shadowRootMode:null,shadowRootSerializable:oe,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Xe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:oe,useMap:null,value:Xe,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Se,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oe,declare:oe,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:oe,noHref:oe,noShade:oe,noWrap:oe,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Xe,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:oe,disablePictureInPicture:oe,disableRemotePlayback:oe,exportParts:vi,part:Se,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:qN}),XJ=pa({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:rn,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Se,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vi,g2:vi,glyphName:vi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Se,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rn,rev:rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rn,requiredFeatures:rn,requiredFonts:rn,requiredFormats:rn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rn,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ZN}),YN=pa({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()}}),JN=pa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qN}),QN=pa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),eQ={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"},tQ=/[A-Z]/g,__=/-[a-z]/g,nQ=/^data[-\w.:]+$/i;function rQ(e,t){const n=Zg(t);let r=t,s=Qt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&nQ.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(__,iQ);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!__.test(i)){let o=i.replace(tQ,sQ);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Tv}return new s(r,t)}function sQ(e){return"-"+e.toLowerCase()}function iQ(e){return e.charAt(1).toUpperCase()}const oQ=HN([GN,QJ,YN,JN,QN],"html"),Nv=HN([GN,XJ,YN,JN,QN],"svg");function aQ(e){return e.join(" ").trim()}var Iv={},S_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,lQ=/\n/g,cQ=/^\s*/,uQ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dQ=/^:\s*/,fQ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,hQ=/^[;\s]*/,pQ=/^\s+|\s+$/g,mQ=`
|
|
282
|
+
`,C_="/",j_="*",ri="",gQ="comment",yQ="declaration";function xQ(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var g=m.match(lQ);g&&(n+=g.length);var x=m.lastIndexOf(mQ);r=~x?m.length-x:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(m){var g=m.exec(e);if(g){var x=g[0];return s(x),e=e.slice(x.length),g}}function c(){l(cQ)}function u(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(C_!=e.charAt(0)||j_!=e.charAt(1))){for(var g=2;ri!=e.charAt(g)&&(j_!=e.charAt(g)||C_!=e.charAt(g+1));)++g;if(g+=2,ri===e.charAt(g-1))return a("End of comment missing");var x=e.slice(2,g-2);return r+=2,s(x),e=e.slice(g),r+=2,m({type:gQ,comment:x})}}function h(){var m=i(),g=l(uQ);if(g){if(f(),!l(dQ))return a("property missing ':'");var x=l(fQ),y=m({type:yQ,property:E_(g[0].replace(S_,ri)),value:x?E_(x[0].replace(S_,ri)):ri});return l(hQ),y}}function p(){var m=[];u(m);for(var g;g=h();)g!==!1&&(m.push(g),u(m));return m}return c(),p()}function E_(e){return e?e.replace(pQ,ri):ri}var vQ=xQ,bQ=nd&&nd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Iv,"__esModule",{value:!0});Iv.default=kQ;const wQ=bQ(vQ);function kQ(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,wQ.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 ch={};Object.defineProperty(ch,"__esModule",{value:!0});ch.camelCase=void 0;var _Q=/^--[a-zA-Z0-9_-]+$/,SQ=/-([a-z])/g,CQ=/^[^-]+$/,jQ=/^-(webkit|moz|ms|o|khtml)-/,EQ=/^-(ms)-/,PQ=function(e){return!e||CQ.test(e)||_Q.test(e)},TQ=function(e,t){return t.toUpperCase()},P_=function(e,t){return"".concat(t,"-")},NQ=function(e,t){return t===void 0&&(t={}),PQ(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(EQ,P_):e=e.replace(jQ,P_),e.replace(SQ,TQ))};ch.camelCase=NQ;var IQ=nd&&nd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},AQ=IQ(Iv),RQ=ch;function Jg(e,t){var n={};return!e||typeof e!="string"||(0,AQ.default)(e,function(r,s){r&&s&&(n[(0,RQ.camelCase)(r,t)]=s)}),n}Jg.default=Jg;var LQ=Jg;const MQ=ff(LQ),XN=eI("end"),Av=eI("start");function eI(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 $Q(e){const t=Av(e),n=XN(e);if(t&&n)return{start:t,end:n}}function fl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T_(e.position):"start"in e||"end"in e?T_(e):"line"in e||"column"in e?Qg(e):""}function Qg(e){return N_(e&&e.line)+":"+N_(e&&e.column)}function T_(e){return Qg(e&&e.start)+"-"+Qg(e&&e.end)}function N_(e){return e&&typeof e=="number"?e:1}class jt 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=fl(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}}jt.prototype.file="";jt.prototype.name="";jt.prototype.reason="";jt.prototype.message="";jt.prototype.stack="";jt.prototype.column=void 0;jt.prototype.line=void 0;jt.prototype.ancestors=void 0;jt.prototype.cause=void 0;jt.prototype.fatal=void 0;jt.prototype.place=void 0;jt.prototype.ruleId=void 0;jt.prototype.source=void 0;const Rv={}.hasOwnProperty,DQ=new Map,OQ=/[A-Z]/g,zQ=new Set(["table","tbody","thead","tfoot","tr"]),FQ=new Set(["td","th"]),tI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function BQ(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=qQ(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=ZQ(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"?Nv:oQ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=nI(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function nI(e,t,n){if(t.type==="element")return VQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return UQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return KQ(e,t,n);if(t.type==="mdxjsEsm")return WQ(e,t);if(t.type==="root")return HQ(e,t,n);if(t.type==="text")return GQ(e,t)}function VQ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Nv,e.schema=s),e.ancestors.push(t);const i=sI(e,t.tagName,!1),o=YQ(e,t);let a=Mv(e,t);return zQ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!YJ(l):!0})),rI(e,o,i,t),Lv(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function UQ(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)}ql(e,t.position)}function WQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ql(e,t.position)}function KQ(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Nv,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:sI(e,t.name,!0),o=JQ(e,t),a=Mv(e,t);return rI(e,o,i,t),Lv(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function HQ(e,t,n){const r={};return Lv(r,Mv(e,t)),e.create(t,e.Fragment,r,n)}function GQ(e,t){return t.value}function rI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ZQ(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 qQ(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=Av(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 YQ(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Rv.call(t.properties,s)){const i=QQ(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&FQ.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 JQ(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 ql(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 ql(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Mv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:DQ;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=nI(e,i,o);a!==void 0&&n.push(a)}return n}function QQ(e,t,n){const r=rQ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?KJ(n):aQ(n)),r.property==="style"){let s=typeof n=="object"?n:XQ(e,String(n));return e.stylePropertyNameCase==="css"&&(s=eX(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?eQ[r.property]||r.property:r.attribute,n]}}function XQ(e,t){try{return MQ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new jt("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=tI+"#cannot-parse-style-attribute",s}}function sI(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=b_(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=b_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Rv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);ql(e)}function ql(e,t){const n=new jt("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=tI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eX(e){const t={};let n;for(n in e)Rv.call(e,n)&&(t[tX(n)]=e[n]);return t}function tX(e){let t=e.replace(OQ,nX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nX(e){return"-"+e.toLowerCase()}const Op={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"]},rX={};function sX(e,t){const n=rX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return iI(e,r,s)}function iI(e,t,n){if(iX(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 I_(e.children,t,n)}return Array.isArray(e)?I_(e,t,n):""}function I_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=iI(e[s],t,n);return r.join("")}function iX(e){return!!(e&&typeof e=="object")}const A_=document.createElement("i");function $v(e){const t="&"+e+";";A_.innerHTML=t;const n=A_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function br(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 Cn(e,t){return e.length>0?(br(e,e.length,0,t),e):t}const R_={}.hasOwnProperty;function oX(e){const t={};let n=-1;for(;++n<e.length;)aX(t,e[n]);return t}function aX(e,t){let n;for(n in t){const s=(R_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){R_.call(s,o)||(s[o]=[]);const a=i[o];lX(s[o],Array.isArray(a)?a:a?[a]:[])}}}function lX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);br(e,0,0,r)}function oI(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 Io(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pr=Us(/[A-Za-z]/),ln=Us(/[\dA-Za-z]/),cX=Us(/[#-'*+\--9=?A-Z^-~]/);function Xg(e){return e!==null&&(e<32||e===127)}const ey=Us(/\d/),uX=Us(/[\dA-Fa-f]/),dX=Us(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Gt(e){return e!==null&&(e<0||e===32)}function pe(e){return e===-2||e===-1||e===32}const fX=Us(new RegExp("\\p{P}|\\p{S}","u")),hX=Us(/\s/);function Us(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ma(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&ln(e.charCodeAt(n+1))&&ln(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 Te(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return pe(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const pX={tokenize:mX};function mX(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"),Te(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 se(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const gX={tokenize:yX},L_={tokenize:xX};function yX(e){const t=this,n=[];let r=0,s,i,o;return a;function a(b){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&v();const w=t.events.length;let _=w,S;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){S=t.events[_][1].end;break}y(r);let j=w;for(;j<t.events.length;)t.events[j][1].end={...S},j++;return br(t.events,_+1,0,t.events.slice(w)),t.events.length=j,c(b)}return a(b)}function c(b){if(r===n.length){if(!s)return h(b);if(s.currentConstruct&&s.currentConstruct.concrete)return m(b);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(L_,u,f)(b)}function u(b){return s&&v(),y(r),h(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(L_,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){s&&v(),y(0),e.consume(b);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(b)}function g(b){if(b===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(b);return}return se(b)?(e.consume(b),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),g)}function x(b,w){const _=t.sliceStream(b);if(w&&_.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(_),t.parser.lazy[b.start.line]){let S=s.events.length;for(;S--;)if(s.events[S][1].start.offset<o&&(!s.events[S][1].end||s.events[S][1].end.offset>o))return;const j=t.events.length;let E=j,T,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(T){P=t.events[E][1].end;break}T=!0}for(y(r),S=j;S<t.events.length;)t.events[S][1].end={...P},S++;br(t.events,E+1,0,t.events.slice(j)),t.events.length=S}}function y(b){let w=n.length;for(;w-- >b;){const _=n[w];t.containerState=_[1],_[0].exit.call(t,e)}n.length=b}function v(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function xX(e,t,n){return Te(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function M_(e){if(e===null||Gt(e)||hX(e))return 1;if(fX(e))return 2}function Dv(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 ty={name:"attention",resolveAll:vX,tokenize:bX};function vX(e,t){let n=-1,r,s,i,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};$_(f,-l),$_(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Cn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Cn(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Cn(c,Dv(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Cn(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=Cn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,br(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 bX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=M_(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=M_(l),f=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(s||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function $_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wX={name:"autolink",tokenize:kX};function kX(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return pr(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||ln(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||ln(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Xg(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):cX(p)?(e.consume(p),c):n(p)}function u(p){return ln(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||ln(p))&&r++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const uh={partial:!0,tokenize:_X};function _X(e,t,n){return r;function r(i){return pe(i)?Te(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||se(i)?t(i):n(i)}}const aI={continuation:{tokenize:CX},exit:jX,name:"blockQuote",tokenize:SX};function SX(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 pe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function CX(e,t,n){const r=this;return s;function s(o){return pe(o)?Te(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(aI,t,n)(o)}}function jX(e){e.exit("blockQuote")}const lI={name:"characterEscape",tokenize:EX};function EX(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 dX(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const cI={name:"characterReference",tokenize:PX};function PX(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=ln,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=uX,u):(e.enter("characterReferenceValue"),i=7,o=ey,u(f))}function u(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return o===ln&&!$v(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),u):n(f)}}const D_={partial:!0,tokenize:NX},O_={concrete:!0,name:"codeFenced",tokenize:TX};function TX(e,t,n){const r=this,s={partial:!0,tokenize:_};let i=0,o=0,a;return l;function l(S){return c(S)}function c(S){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===a?(o++,e.consume(S),u):o<3?n(S):(e.exit("codeFencedFenceSequence"),pe(S)?Te(e,f,"whitespace")(S):f(S))}function f(S){return S===null||se(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(D_,g,w)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||se(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):pe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Te(e,p,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function p(S){return S===null||se(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||se(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),m)}function g(S){return e.attempt(s,w,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return i>0&&pe(S)?Te(e,v,"linePrefix",i+1)(S):v(S)}function v(S){return S===null||se(S)?e.check(D_,g,w)(S):(e.enter("codeFlowValue"),b(S))}function b(S){return S===null||se(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),b)}function w(S){return e.exit("codeFenced"),t(S)}function _(S,j,E){let T=0;return P;function P(z){return S.enter("lineEnding"),S.consume(z),S.exit("lineEnding"),N}function N(z){return S.enter("codeFencedFence"),pe(z)?Te(S,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):R(z)}function R(z){return z===a?(S.enter("codeFencedFenceSequence"),L(z)):E(z)}function L(z){return z===a?(T++,S.consume(z),L):T>=o?(S.exit("codeFencedFenceSequence"),pe(z)?Te(S,I,"whitespace")(z):I(z)):E(z)}function I(z){return z===null||se(z)?(S.exit("codeFencedFence"),j(z)):E(z)}}}function NX(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 zp={name:"codeIndented",tokenize:AX},IX={partial:!0,tokenize:RX};function AX(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),Te(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):se(c)?e.attempt(IX,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function RX(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Te(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):se(o)?s(o):n(o)}}const LX={name:"codeText",previous:$X,resolve:MX,tokenize:DX};function MX(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 $X(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DX(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)):se(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||se(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 OX{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&&za(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),za(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),za(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);za(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);za(this.left,n.reverse())}}}function za(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 uI(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new OX(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,zX(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 br(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function zX(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,f,h=-1,p=n,m=0,g=0;const x=[g];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(g=h+1,x.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const y=a.slice(x[h],x[h+1]),v=i.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const FX={resolve:VX,tokenize:UX},BX={partial:!0,tokenize:WX};function VX(e){return uI(e),e}function UX(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):se(a)?e.check(BX,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 WX(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Te(e,i,"linePrefix")}function i(o){if(o===null||se(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 dI(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||Xg(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||Gt(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||Xg(y)?n(y):(e.consume(y),y===92?x:g)}function x(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function fI(e,t,n,r,s,i){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):se(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||se(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!pe(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function hI(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===o?(e.exit(i),l(o)):h===null?n(h):se(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Te(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||se(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===o||h===92?(e.consume(h),u):u(h)}}function hl(e,t){let n;return r;function r(s){return se(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):pe(s)?Te(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const KX={name:"definition",tokenize:GX},HX={partial:!0,tokenize:ZX};function GX(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return fI.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=Io(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Gt(p)?hl(e,c)(p):c(p)}function c(p){return dI(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(HX,f,f)(p)}function f(p){return pe(p)?Te(e,h,"whitespace")(p):h(p)}function h(p){return p===null||se(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function ZX(e,t,n){return r;function r(a){return Gt(a)?hl(e,s)(a):n(a)}function s(a){return hI(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return pe(a)?Te(e,o,"whitespace")(a):o(a)}function o(a){return a===null||se(a)?t(a):n(a)}}const qX={name:"hardBreakEscape",tokenize:YX};function YX(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return se(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const JX={name:"headingAtx",resolve:QX,tokenize:XX};function QX(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"},br(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function XX(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||Gt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||se(u)?(e.exit("atxHeading"),t(u)):pe(u)?Te(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||Gt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const eee=["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"],z_=["pre","script","style","textarea"],tee={concrete:!0,name:"htmlFlow",resolveTo:see,tokenize:iee},nee={partial:!0,tokenize:aee},ree={partial:!0,tokenize:oee};function see(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 iee(e,t,n){const r=this;let s,i,o,a,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),i=!0,g):A===63?(e.consume(A),s=3,r.interrupt?t:C):pr(A)?(e.consume(A),o=String.fromCharCode(A),x):n(A)}function h(A){return A===45?(e.consume(A),s=2,p):A===91?(e.consume(A),s=5,a=0,m):pr(A)?(e.consume(A),s=4,r.interrupt?t:C):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:C):n(A)}function m(A){const me="CDATA[";return A===me.charCodeAt(a++)?(e.consume(A),a===me.length?r.interrupt?t:R:m):n(A)}function g(A){return pr(A)?(e.consume(A),o=String.fromCharCode(A),x):n(A)}function x(A){if(A===null||A===47||A===62||Gt(A)){const me=A===47,ke=o.toLowerCase();return!me&&!i&&z_.includes(ke)?(s=1,r.interrupt?t(A):R(A)):eee.includes(o.toLowerCase())?(s=6,me?(e.consume(A),y):r.interrupt?t(A):R(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):i?v(A):b(A))}return A===45||ln(A)?(e.consume(A),o+=String.fromCharCode(A),x):n(A)}function y(A){return A===62?(e.consume(A),r.interrupt?t:R):n(A)}function v(A){return pe(A)?(e.consume(A),v):P(A)}function b(A){return A===47?(e.consume(A),P):A===58||A===95||pr(A)?(e.consume(A),w):pe(A)?(e.consume(A),b):P(A)}function w(A){return A===45||A===46||A===58||A===95||ln(A)?(e.consume(A),w):_(A)}function _(A){return A===61?(e.consume(A),S):pe(A)?(e.consume(A),_):b(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,j):pe(A)?(e.consume(A),S):E(A)}function j(A){return A===l?(e.consume(A),l=null,T):A===null||se(A)?n(A):(e.consume(A),j)}function E(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Gt(A)?_(A):(e.consume(A),E)}function T(A){return A===47||A===62||pe(A)?b(A):n(A)}function P(A){return A===62?(e.consume(A),N):n(A)}function N(A){return A===null||se(A)?R(A):pe(A)?(e.consume(A),N):n(A)}function R(A){return A===45&&s===2?(e.consume(A),$):A===60&&s===1?(e.consume(A),D):A===62&&s===4?(e.consume(A),U):A===63&&s===3?(e.consume(A),C):A===93&&s===5?(e.consume(A),V):se(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(nee,Q,L)(A)):A===null||se(A)?(e.exit("htmlFlowData"),L(A)):(e.consume(A),R)}function L(A){return e.check(ree,I,Q)(A)}function I(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),z}function z(A){return A===null||se(A)?L(A):(e.enter("htmlFlowData"),R(A))}function $(A){return A===45?(e.consume(A),C):R(A)}function D(A){return A===47?(e.consume(A),o="",O):R(A)}function O(A){if(A===62){const me=o.toLowerCase();return z_.includes(me)?(e.consume(A),U):R(A)}return pr(A)&&o.length<8?(e.consume(A),o+=String.fromCharCode(A),O):R(A)}function V(A){return A===93?(e.consume(A),C):R(A)}function C(A){return A===62?(e.consume(A),U):A===45&&s===2?(e.consume(A),C):R(A)}function U(A){return A===null||se(A)?(e.exit("htmlFlowData"),Q(A)):(e.consume(A),U)}function Q(A){return e.exit("htmlFlow"),t(A)}}function oee(e,t,n){const r=this;return s;function s(o){return se(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 aee(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(uh,t,n)}}const lee={name:"htmlText",tokenize:cee};function cee(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),_):C===63?(e.consume(C),b):pr(C)?(e.consume(C),E):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):pr(C)?(e.consume(C),v):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),h):se(C)?(o=f,D(C)):(e.consume(C),f)}function h(C){return C===45?(e.consume(C),p):f(C)}function p(C){return C===62?$(C):C===45?h(C):f(C)}function m(C){const U="CDATA[";return C===U.charCodeAt(i++)?(e.consume(C),i===U.length?g:m):n(C)}function g(C){return C===null?n(C):C===93?(e.consume(C),x):se(C)?(o=g,D(C)):(e.consume(C),g)}function x(C){return C===93?(e.consume(C),y):g(C)}function y(C){return C===62?$(C):C===93?(e.consume(C),y):g(C)}function v(C){return C===null||C===62?$(C):se(C)?(o=v,D(C)):(e.consume(C),v)}function b(C){return C===null?n(C):C===63?(e.consume(C),w):se(C)?(o=b,D(C)):(e.consume(C),b)}function w(C){return C===62?$(C):b(C)}function _(C){return pr(C)?(e.consume(C),S):n(C)}function S(C){return C===45||ln(C)?(e.consume(C),S):j(C)}function j(C){return se(C)?(o=j,D(C)):pe(C)?(e.consume(C),j):$(C)}function E(C){return C===45||ln(C)?(e.consume(C),E):C===47||C===62||Gt(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),$):C===58||C===95||pr(C)?(e.consume(C),P):se(C)?(o=T,D(C)):pe(C)?(e.consume(C),T):$(C)}function P(C){return C===45||C===46||C===58||C===95||ln(C)?(e.consume(C),P):N(C)}function N(C){return C===61?(e.consume(C),R):se(C)?(o=N,D(C)):pe(C)?(e.consume(C),N):T(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,L):se(C)?(o=R,D(C)):pe(C)?(e.consume(C),R):(e.consume(C),I)}function L(C){return C===s?(e.consume(C),s=void 0,z):C===null?n(C):se(C)?(o=L,D(C)):(e.consume(C),L)}function I(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Gt(C)?T(C):(e.consume(C),I)}function z(C){return C===47||C===62||Gt(C)?T(C):n(C)}function $(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function D(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),O}function O(C){return pe(C)?Te(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):V(C)}function V(C){return e.enter("htmlTextData"),o(C)}}const Ov={name:"labelEnd",resolveAll:hee,resolveTo:pee,tokenize:mee},uee={tokenize:gee},dee={tokenize:yee},fee={tokenize:xee};function hee(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&&br(e,0,e.length,n),e}function pee(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=Cn(a,e.slice(i+1,i+r+3)),a=Cn(a,[["enter",u,t]]),a=Cn(a,Dv(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Cn(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Cn(a,e.slice(o+1)),a=Cn(a,[["exit",l,t]]),br(e,i,e.length,a),e}function mee(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?f(h):(o=r.parser.defined.includes(Io(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(uee,u,o?u:f)(h):h===91?e.attempt(dee,u,o?c:f)(h):o?u(h):f(h)}function c(h){return e.attempt(fee,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function gee(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 Gt(f)?hl(e,i)(f):i(f)}function i(f){return f===41?u(f):dI(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return Gt(f)?hl(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?hI(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Gt(f)?hl(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 yee(e,t,n){const r=this;return s;function s(a){return fI.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Io(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function xee(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 vee={name:"labelStartImage",resolveAll:Ov.resolveAll,tokenize:bee};function bee(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 wee={name:"labelStartLink",resolveAll:Ov.resolveAll,tokenize:kee};function kee(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 Fp={name:"lineEnding",tokenize:_ee};function _ee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Te(e,t,"linePrefix")}}const ed={name:"thematicBreak",tokenize:See};function See(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||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),pe(c)?Te(e,a,"whitespace")(c):a(c))}}const Ft={continuation:{tokenize:Pee},exit:Nee,name:"list",tokenize:Eee},Cee={partial:!0,tokenize:Iee},jee={partial:!0,tokenize:Tee};function Eee(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ey(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ed,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return ey(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(uh,r.interrupt?n:u,e.attempt(Cee,h,f))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return pe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Pee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uh,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Te(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!pe(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(jee,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Te(e,e.attempt(Ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Tee(e,t,n){const r=this;return Te(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 Nee(e){e.exit(this.containerState.type)}function Iee(e,t,n){const r=this;return Te(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!pe(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const F_={name:"setextUnderline",resolveTo:Aee,tokenize:Ree};function Aee(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 Ree(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"),pe(c)?Te(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Lee={tokenize:Mee};function Mee(e){const t=this,n=e.attempt(uh,r,e.attempt(this.parser.constructs.flowInitial,s,Te(e,e.attempt(this.parser.constructs.flow,s,e.attempt(FX,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 $ee={resolveAll:mI()},Dee=pI("string"),Oee=pI("text");function pI(e){return{resolveAll:mI(e==="text"?zee:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=s[u];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function mI(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 zee(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 Fee={42:Ft,43:Ft,45:Ft,48:Ft,49:Ft,50:Ft,51:Ft,52:Ft,53:Ft,54:Ft,55:Ft,56:Ft,57:Ft,62:aI},Bee={91:KX},Vee={[-2]:zp,[-1]:zp,32:zp},Uee={35:JX,42:ed,45:[F_,ed],60:tee,61:F_,95:ed,96:O_,126:O_},Wee={38:cI,92:lI},Kee={[-5]:Fp,[-4]:Fp,[-3]:Fp,33:vee,38:cI,42:ty,60:[wX,lee],91:wee,92:[qX,lI],93:Ov,95:ty,96:LX},Hee={null:[ty,$ee]},Gee={null:[42,95]},Zee={null:[]},qee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Gee,contentInitial:Bee,disable:Zee,document:Fee,flow:Uee,flowInitial:Vee,insideSpan:Hee,string:Wee,text:Kee},Symbol.toStringTag,{value:"Module"}));function Yee(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:j(_),check:j(S),consume:v,enter:b,exit:w,interrupt:j(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(N){return o=Cn(o,N),x(),o[o.length-1]!==null?[]:(E(t,0),c.events=Dv(i,c.events,c),c.events)}function h(N,R){return Qee(p(N),R)}function p(N){return Jee(o,N)}function m(){const{_bufferIndex:N,_index:R,line:L,column:I,offset:z}=r;return{_bufferIndex:N,_index:R,line:L,column:I,offset:z}}function g(N){s[N.line]=N.column,P()}function x(){let N;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex));else y(R)}}function y(N){u=u(N)}function v(N){se(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,P()):N!==-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=N}function b(N,R){const L=R||{};return L.type=N,L.start=m(),c.events.push(["enter",L,c]),a.push(L),L}function w(N){const R=a.pop();return R.end=m(),c.events.push(["exit",R,c]),R}function _(N,R){E(N,R.from)}function S(N,R){R.restore()}function j(N,R){return L;function L(I,z,$){let D,O,V,C;return Array.isArray(I)?Q(I):"tokenize"in I?Q([I]):U(I);function U(ve){return Xt;function Xt(ct){const vn=ct!==null&&ve[ct],tr=ct!==null&&ve.null,kr=[...Array.isArray(vn)?vn:vn?[vn]:[],...Array.isArray(tr)?tr:tr?[tr]:[]];return Q(kr)(ct)}}function Q(ve){return D=ve,O=0,ve.length===0?$:A(ve[O])}function A(ve){return Xt;function Xt(ct){return C=T(),V=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?ke():ve.tokenize.call(R?Object.assign(Object.create(c),R):c,l,me,ke)(ct)}}function me(ve){return N(V,C),z}function ke(ve){return C.restore(),++O<D.length?A(D[O]):$}}}function E(N,R){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&br(c.events,R,c.events.length-R,N.resolve(c.events.slice(R),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function T(){const N=m(),R=c.previous,L=c.currentConstruct,I=c.events.length,z=Array.from(a);return{from:I,restore:$};function $(){r=N,c.previous=R,c.currentConstruct=L,c.events.length=I,a=z,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Jee(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 Qee(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=`
|
|
283
|
+
`;break}case-3:{o=`\r
|
|
284
|
+
`;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 Xee(e){const r={constructs:oX([qee,...(e||{}).extensions||[]]),content:s(pX),defined:[],document:s(gX),flow:s(Lee),lazy:{},string:s(Dee),text:s(Oee)};return r;function s(i){return o;function o(a){return Yee(r,i,a)}}}function ete(e){for(;!uI(e););return e}const B_=/[\0\t\n\r]/g;function tte(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(B_.lastIndex=f,c=B_.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(f);break}if(p===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(i.slice(f,h)),e+=h-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const nte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rte(e){return e.replace(nte,ste)}function ste(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return oI(n.slice(i?2:1),i?16:10)}return $v(n)||e}const gI={}.hasOwnProperty;function ite(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ote(n)(ete(Xee(n).document().write(tte()(e,t,!0))))}function ote(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Oi),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(Cc),blockQuote:i(tr),characterEscape:T,characterReference:T,codeFenced:i(kr),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(kr,o),codeText:i(Di,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(_c),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Sc),hardBreakEscape:i(ga),hardBreakTrailing:i(ga),htmlFlow:i(ya,o),htmlFlowData:T,htmlText:i(ya,o),htmlTextData:T,image:i(Hr),label:o,link:i(Oi),listItem:i(gh),listItemValue:h,listOrdered:i(nr,f),listUnordered:i(nr),paragraph:i(jc),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Cc),strong:i(yh),thematicBreak:i(be)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:vn,autolinkProtocol:ct,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:ve,characterReference:Xt,codeFenced:l(x),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:l(y),codeText:l(z),codeTextData:P,data:P,definition:l(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(L),htmlFlowData:P,htmlText:l(I),htmlTextData:P,image:l(D),label:V,labelText:O,lineEnding:N,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:me,resourceDestinationString:C,resourceTitleString:U,resource:Q,setextHeading:l(E),setextHeadingLineSequence:j,setextHeadingText:S,strong:l(),thematicBreak:l()}};yI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let G={type:"root",children:[]};const ie={stack:[G],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},de=[];let _e=-1;for(;++_e<F.length;)if(F[_e][1].type==="listOrdered"||F[_e][1].type==="listUnordered")if(F[_e][0]==="enter")de.push(_e);else{const On=de.pop();_e=s(F,On,_e)}for(_e=-1;++_e<F.length;){const On=t[F[_e][0]];gI.call(On,F[_e][1].type)&&On[F[_e][1].type].call(Object.assign({sliceSerialize:F[_e][2].sliceSerialize},ie),F[_e][1])}if(ie.tokenStack.length>0){const On=ie.tokenStack[ie.tokenStack.length-1];(On[1]||V_).call(ie,void 0,On[0])}for(G.position={start:ns(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:ns(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)G=t.transforms[_e](G)||G;return G}function s(F,G,ie){let de=G-1,_e=-1,On=!1,Ks,_r,xa,va;for(;++de<=ie;){const en=F[de];switch(en[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{en[0]==="enter"?_e++:_e--,va=void 0;break}case"lineEndingBlank":{en[0]==="enter"&&(Ks&&!va&&!_e&&!xa&&(xa=de),va=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:va=void 0}if(!_e&&en[0]==="enter"&&en[1].type==="listItemPrefix"||_e===-1&&en[0]==="exit"&&(en[1].type==="listUnordered"||en[1].type==="listOrdered")){if(Ks){let zi=de;for(_r=void 0;zi--;){const Sr=F[zi];if(Sr[1].type==="lineEnding"||Sr[1].type==="lineEndingBlank"){if(Sr[0]==="exit")continue;_r&&(F[_r][1].type="lineEndingBlank",On=!0),Sr[1].type="lineEnding",_r=zi}else if(!(Sr[1].type==="linePrefix"||Sr[1].type==="blockQuotePrefix"||Sr[1].type==="blockQuotePrefixWhitespace"||Sr[1].type==="blockQuoteMarker"||Sr[1].type==="listItemIndent"))break}xa&&(!_r||xa<_r)&&(Ks._spread=!0),Ks.end=Object.assign({},_r?F[_r][1].start:en[1].end),F.splice(_r||de,0,["exit",Ks,en[2]]),de++,ie++}if(en[1].type==="listItemPrefix"){const zi={type:"listItem",_spread:!1,start:Object.assign({},en[1].start),end:void 0};Ks=zi,F.splice(de,0,["enter",zi,en[2]]),de++,ie++,xa=void 0,va=!0}}}return F[G][1]._spread=On,ie}function i(F,G){return ie;function ie(de){a.call(this,F(de),de),G&&G.call(this,de)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(F,G,ie){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([G,ie||void 0]),F.position={start:ns(G.start),end:void 0}}function l(F){return G;function G(ie){F&&F.call(this,ie),c.call(this,ie)}}function c(F,G){const ie=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==F.type&&(G?G.call(this,F,de[0]):(de[1]||V_).call(this,F,de[0]));else throw new Error("Cannot close `"+F.type+"` ("+fl({start:F.start,end:F.end})+"): it’s not open");ie.position.end=ns(F.end)}function u(){return sX(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(F){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function p(){const F=this.resume(),G=this.stack[this.stack.length-1];G.lang=F}function m(){const F=this.resume(),G=this.stack[this.stack.length-1];G.meta=F}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F.replace(/(\r?\n|\r)$/g,"")}function v(F){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.label=G,ie.identifier=Io(this.sliceSerialize(F)).toLowerCase()}function b(){const F=this.resume(),G=this.stack[this.stack.length-1];G.title=F}function w(){const F=this.resume(),G=this.stack[this.stack.length-1];G.url=F}function _(F){const G=this.stack[this.stack.length-1];if(!G.depth){const ie=this.sliceSerialize(F).length;G.depth=ie}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function j(F){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(F){const ie=this.stack[this.stack.length-1].children;let de=ie[ie.length-1];(!de||de.type!=="text")&&(de=Ec(),de.position={start:ns(F.start),end:void 0},ie.push(de)),this.stack.push(de)}function P(F){const G=this.stack.pop();G.value+=this.sliceSerialize(F),G.position.end=ns(F.end)}function N(F){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=G.children[G.children.length-1];ie.position.end=ns(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(T.call(this,F),P.call(this,F))}function R(){this.data.atHardBreak=!0}function L(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function I(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function z(){const F=this.resume(),G=this.stack[this.stack.length-1];G.value=F}function $(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=G,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function D(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=G,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function O(F){const G=this.sliceSerialize(F),ie=this.stack[this.stack.length-2];ie.label=rte(G),ie.identifier=Io(G).toLowerCase()}function V(){const F=this.stack[this.stack.length-1],G=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const de=F.children;ie.children=de}else ie.alt=G}function C(){const F=this.resume(),G=this.stack[this.stack.length-1];G.url=F}function U(){const F=this.resume(),G=this.stack[this.stack.length-1];G.title=F}function Q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function me(F){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.label=G,ie.identifier=Io(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function ke(F){this.data.characterReferenceType=F.type}function ve(F){const G=this.sliceSerialize(F),ie=this.data.characterReferenceType;let de;ie?(de=oI(G,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=$v(G);const _e=this.stack[this.stack.length-1];_e.value+=de}function Xt(F){const G=this.stack.pop();G.position.end=ns(F.end)}function ct(F){P.call(this,F);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(F)}function vn(F){P.call(this,F);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(F)}function tr(){return{type:"blockquote",children:[]}}function kr(){return{type:"code",lang:null,meta:null,value:""}}function Di(){return{type:"inlineCode",value:""}}function _c(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Sc(){return{type:"emphasis",children:[]}}function Cc(){return{type:"heading",depth:0,children:[]}}function ga(){return{type:"break"}}function ya(){return{type:"html",value:""}}function Hr(){return{type:"image",title:null,url:"",alt:null}}function Oi(){return{type:"link",title:null,url:"",children:[]}}function nr(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function gh(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function jc(){return{type:"paragraph",children:[]}}function yh(){return{type:"strong",children:[]}}function Ec(){return{type:"text",value:""}}function be(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function yI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?yI(e,r):ate(e,r)}}function ate(e,t){let n;for(n in t)if(gI.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 V_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fl({start:t.start,end:t.end})+") is still open")}function lte(e){const t=this;t.parser=n;function n(r){return ite(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function cte(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 ute(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
285
|
+
`}]}function dte(e,t){const n=t.value?t.value+`
|
|
286
|
+
`:"",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 fte(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hte(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pte(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ma(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 mte(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 gte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xI(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 yte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xI(e,t);const s={src:ma(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 xte(e,t){const n={src:ma(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 vte(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 bte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xI(e,t);const s={href:ma(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 wte(e,t){const n={href:ma(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 kte(e,t,n){const r=e.all(t),s=n?_te(n):vI(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:`
|
|
287
|
+
`}),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:`
|
|
288
|
+
`});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function _te(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=vI(n[r])}return t}function vI(e){const t=e.spread;return t??e.children.length>1}function Ste(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 Cte(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jte(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ete(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pte(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=Av(t.children[1]),l=XN(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 Tte(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Nte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const U_=9,W_=32;function Ite(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(K_(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(K_(t.slice(s),s>0,!1)),i.join("")}function K_(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===U_||i===W_;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===U_||i===W_;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Ate(e,t){const n={type:"text",value:Ite(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Rte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Lte={blockquote:cte,break:ute,code:dte,delete:fte,emphasis:hte,footnoteReference:pte,heading:mte,html:gte,imageReference:yte,image:xte,inlineCode:vte,linkReference:bte,link:wte,listItem:kte,list:Ste,paragraph:Cte,root:jte,strong:Ete,table:Pte,tableCell:Nte,tableRow:Tte,text:Ate,thematicBreak:Rte,toml:bu,yaml:bu,definition:bu,footnoteDefinition:bu};function bu(){}const bI=-1,dh=0,pl=1,af=2,zv=3,Fv=4,Bv=5,Vv=6,wI=7,kI=8,Mte=typeof self=="object"?self:globalThis,H_=(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 Mte[e](t)},$te=(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 dh:case bI:return n(o,s);case pl:{const a=n([],s);for(const l of o)a.push(r(l));return a}case af:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case zv:return n(new Date(o),s);case Fv:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case Bv:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case Vv:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case wI:{const{name:a,message:l}=o;return n(H_(a,l),s)}case kI: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(H_(i,o),s)};return r},G_=e=>$te(new Map,e)(0),Zi="",{toString:Dte}={},{keys:Ote}=Object,Fa=e=>{const t=typeof e;if(t!=="object"||!e)return[dh,t];const n=Dte.call(e).slice(8,-1);switch(n){case"Array":return[pl,Zi];case"Object":return[af,Zi];case"Date":return[zv,Zi];case"RegExp":return[Fv,Zi];case"Map":return[Bv,Zi];case"Set":return[Vv,Zi];case"DataView":return[pl,n]}return n.includes("Array")?[pl,n]:n.includes("Error")?[wI,n]:[af,n]},wu=([e,t])=>e===dh&&(t==="function"||t==="symbol"),zte=(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]=Fa(o);switch(a){case dh:{let u=o;switch(l){case"bigint":a=kI,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([bI],o)}return s([a,u],o)}case pl:{if(l){let h=o;return l==="DataView"?h=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(o)),s([l,[...h]],o)}const u=[],f=s([a,u],o);for(const h of o)u.push(i(h));return f}case af:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],f=s([a,u],o);for(const h of Ote(o))(e||!wu(Fa(o[h])))&&u.push([i(h),i(o[h])]);return f}case zv:return s([a,o.toISOString()],o);case Fv:{const{source:u,flags:f}=o;return s([a,{source:u,flags:f}],o)}case Bv:{const u=[],f=s([a,u],o);for(const[h,p]of o)(e||!(wu(Fa(h))||wu(Fa(p))))&&u.push([i(h),i(p)]);return f}case Vv:{const u=[],f=s([a,u],o);for(const h of o)(e||!wu(Fa(h)))&&u.push(i(h));return f}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},Z_=(e,{json:t,lossy:n}={})=>{const r=[];return zte(!(t||n),!!t,new Map,r)(e),r},lf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?G_(Z_(e,t)):structuredClone(e):(e,t)=>G_(Z_(e,t));function Fte(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 Bte(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Vte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Fte,r=e.options.footnoteBackLabel||Bte,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),h=ma(f.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(f);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...m)}else u.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...lf(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
289
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
290
|
+
`}]}}const _I=function(e){if(e==null)return Hte;if(typeof e=="function")return fh(e);if(typeof e=="object")return Array.isArray(e)?Ute(e):Wte(e);if(typeof e=="string")return Kte(e);throw new Error("Expected function, string, or object as test")};function Ute(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=_I(e[n]);return fh(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function Wte(e){const t=e;return fh(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function Kte(e){return fh(t);function t(n){return n&&n.type===e}}function fh(e){return t;function t(n,r,s){return!!(Gte(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Hte(){return!0}function Gte(e){return e!==null&&typeof e=="object"&&"type"in e}const SI=[],Zte=!0,q_=!1,qte="skip";function Yte(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=_I(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=SI,m,g,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=Jte(n(l,u)),p[0]===q_))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==qte)for(g=(r?y.children.length:-1)+o,x=u.concat(y);g>-1&&g<y.children.length;){const v=y.children[g];if(m=a(v,g,x)(),m[0]===q_)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Jte(e){return Array.isArray(e)?e:typeof e=="number"?[Zte,e]:e==null?SI:[e]}function CI(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),Yte(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 ny={}.hasOwnProperty,Qte={};function Xte(e,t){const n=t||Qte,r=new Map,s=new Map,i=new Map,o={...Lte,...n.handlers},a={all:c,applyData:tne,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:ene,wrap:rne};return CI(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:s,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),a;function l(u,f){const h=u.type,p=a.handlers[h];if(ny.call(a.handlers,h)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...x}=u,y=lf(x);return y.children=a.all(u),y}return lf(u)}return(a.options.unknownHandler||nne)(a,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const m=a.one(h[p],u);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Y_(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=Y_(g.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function ene(e,t){e.position&&(t.position=$Q(e))}function tne(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,lf(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function nne(e,t){const n=t.data||{},r="value"in t&&!(ny.call(n,"hProperties")||ny.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 rne(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
291
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
292
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
293
|
+
`}),n}function Y_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function J_(e,t){const n=Xte(e,t),r=n.one(e,void 0),s=Vte(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
294
|
+
`},s),i}function sne(e,t){return e&&"run"in e?async function(n,r){const s=J_(n,{file:r,...t});await e.run(s,r)}:function(n,r){return J_(n,{file:r,...e||t})}}function Q_(e){if(e)throw e}var td=Object.prototype.hasOwnProperty,jI=Object.prototype.toString,X_=Object.defineProperty,e1=Object.getOwnPropertyDescriptor,t1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):jI.call(t)==="[object Array]"},n1=function(t){if(!t||jI.call(t)!=="[object Object]")return!1;var n=td.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&td.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||td.call(t,s)},r1=function(t,n){X_&&n.name==="__proto__"?X_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},s1=function(t,n){if(n==="__proto__")if(td.call(t,n)){if(e1)return e1(t,n).value}else return;return t[n]},ine=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=s1(a,n),s=s1(t,n),a!==s&&(u&&s&&(n1(s)||(i=t1(s)))?(i?(i=!1,o=r&&t1(r)?r:[]):o=r&&n1(r)?r:{},r1(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&r1(a,{name:n,newValue:s}));return a};const Bp=ff(ine);function ry(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 one(){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?ane(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 ane(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 ur={basename:lne,dirname:cne,extname:une,join:dne,sep:"/"};function lne(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xc(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 cne(e){if(xc(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 une(e){xc(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 dne(...e){let t=-1,n;for(;++t<e.length;)xc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fne(n)}function fne(e){xc(e);const t=e.codePointAt(0)===47;let n=hne(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hne(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 xc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pne={cwd:mne};function mne(){return"/"}function sy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gne(e){if(typeof e=="string")e=new URL(e);else if(!sy(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 yne(e)}function yne(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 Vp=["history","path","basename","stem","extname","dirname"];class EI{constructor(t){let n;t?sy(t)?n={path:t}:typeof t=="string"||xne(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pne.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vp.length;){const i=Vp[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)Vp.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ur.basename(this.path):void 0}set basename(t){Wp(t,"basename"),Up(t,"basename"),this.path=ur.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ur.dirname(this.path):void 0}set dirname(t){i1(this.basename,"dirname"),this.path=ur.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ur.extname(this.path):void 0}set extname(t){if(Up(t,"extname"),i1(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=ur.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sy(t)&&(t=gne(t)),Wp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ur.basename(this.path,this.extname):void 0}set stem(t){Wp(t,"stem"),Up(t,"stem"),this.path=ur.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 jt(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 Up(e,t){if(e&&e.includes(ur.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ur.sep+"`")}function Wp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function i1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function xne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vne=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},bne={}.hasOwnProperty;class Uv extends vne{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=one()}copy(){const t=new Uv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Bp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gp("data",this.frozen),this.namespace[t]=n,this):bne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gp("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=ku(t),r=this.parser||this.Parser;return Kp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Kp("process",this.parser||this.Parser),Hp("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=ku(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const p=f,m=r.stringify(p,h);_ne(m)?h.value=m:h.result=m,c(u,h)});function c(u,f){u||!f?o(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Kp("processSync",this.parser||this.Parser),Hp("processSync",this.compiler||this.Compiler),this.process(t,s),a1("processSync","process",n),r;function s(i,o){n=!0,Q_(i),r=o}}run(t,n,r){o1(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=ku(n);s.run(t,l,c);function c(u,f,h){const p=f||t;u?a(u):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),a1("runSync","run",r),s;function i(o,a){Q_(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=ku(n),s=this.compiler||this.Compiler;return Hp("stringify",s),o1(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Gp("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=Bp(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];ry(g)&&ry(p)&&(p=Bp(!0,g,p)),r[h]=[c,p,...m]}}}}const wne=new Uv().freeze();function Kp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gp(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 o1(e){if(!ry(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function a1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ku(e){return kne(e)?e:new EI(e)}function kne(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _ne(e){return typeof e=="string"||Sne(e)}function Sne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",l1=[],c1={allowDangerousHtml:!0},jne=/^(https?|ircs?|mailto|xmpp)$/i,Ene=[{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 Pne(e){const t=Tne(e),n=Nne(e);return Ine(t.runSync(t.parse(n),n),e)}function Tne(e){const t=e.rehypePlugins||l1,n=e.remarkPlugins||l1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...c1}:c1;return wne().use(lte).use(n).use(sne,r).use(t)}function Nne(e){const t=e.children||"",n=new EI;return typeof t=="string"&&(n.value=t),n}function Ine(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||Ane;for(const u of Ene)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Cne+u.id,void 0);return CI(e,c),BQ(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,f,h){if(u.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:u.value},f;if(u.type==="element"){let p;for(p in Op)if(Object.hasOwn(Op,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=Op[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=l(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(u,f,h)),p&&h&&typeof f=="number")return a&&u.children?h.children.splice(f,1,...u.children):h.children.splice(f,1),f}}}function Ane(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||jne.test(e.slice(0,t))?e:""}const Zp=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,Rne={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:Zp("text-lg"),children:e}),h2:({children:e})=>d.jsx("h2",{className:Zp("text-[1.3rem]"),children:e}),h3:({children:e})=>d.jsx("h3",{className:Zp("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})},PI=({children:e})=>d.jsx(Pne,{components:Rne,children:e}),Wv=1e3,Lne=3e4;let Tn=null,vo=null,ml=Wv;const gl=new Set;function Mne(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of gl)n(t)}function $ne(){ml=Wv}function Dne(){Tn==null||Tn.close(),Tn=null,gl.size!==0&&(vo=setTimeout(()=>{vo=null,TI()},ml),ml=Math.min(ml*2,Lne))}function TI(){Tn=new EventSource(K("/api/activity/stream")),Tn.onmessage=Mne,Tn.onopen=$ne,Tn.onerror=Dne}function vc(e){return gl.add(e),!Tn&&!vo&&TI(),()=>{gl.delete(e),!(gl.size>0)&&(vo&&(clearTimeout(vo),vo=null),Tn&&(Tn.close(),Tn=null),ml=Wv)}}function bc(){const[e,t]=k.useState([]),n=k.useCallback(async()=>{try{t(await G9())}catch{}},[]);k.useEffect(()=>{n()},[n]),k.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=vc(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=k.useCallback(async s=>{await HP(s),await n()},[n]);return{checks:e,run:r}}function One(e,t,n){const r=k.useRef(null);k.useEffect(()=>{r.current&&(r.current.inert=!e)},[e]),k.useEffect(()=>{if(!e||t)return;const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,t,n]);const s=M(f=>f.consistency),i=M(f=>f.doctor),o=M(f=>f.agentStatus);k.useEffect(()=>{const{loadStatus:f,loadConsistency:h,loadDoctor:p,loadGitStatus:m,loadAgentStatus:g,loadArchivableIdeas:x}=M.getState();f(),h(),p(),m(),g(),x()},[]),k.useEffect(()=>{const f=()=>{M.getState().loadPlans(),M.getState().loadGitStatus()};return window.addEventListener("focus",f),()=>window.removeEventListener("focus",f)},[]),k.useEffect(()=>{const f={},h=(m,g,x)=>{f[m]&&clearTimeout(f[m]),f[m]=setTimeout(g,x)},p=vc(m=>{if(m.type==="status"){h("status",()=>M.getState().loadStatus(),80);return}if(m.type==="agent"){h("agent",()=>M.getState().loadAgentStatus(),120);return}m.message==="changed"&&h("activity",()=>{const{loadPlans:g,loadSuggestions:x,loadStatus:y,loadConsistency:v,loadDoctor:b,loadGitStatus:w,loadAgentStatus:_,loadArchivableIdeas:S}=M.getState();g(),x(),y(),v(),b(),w(),_(),S()},250)});return()=>{for(const m of Object.values(f))m&&clearTimeout(m);p()}},[]);const{checks:a}=bc(),l=s.length>0,c=a.some(f=>f.status==="fail")||l||i.errorCount>0,u=o.some(f=>f.status==="running"||f.status==="starting"||f.status==="stopping");return{panelRef:r,anyChecksFailing:c,agentActive:u}}const Ao={accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",chalkPass:"#2d5a3b",chalkPassText:"#b5d6b5",chalkFail:"#5a2d2d",chalkFailText:"#d6a0a0",chalkRunning:"#5a4a2d",chalkRunningText:"#d6c4a0"},NI="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",hh="text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",Ir={pass:Ao.chalkPass,fail:Ao.chalkFail,running:Ao.chalkRunning},Ar={pass:Ao.chalkPassText,fail:Ao.chalkFailText,running:Ao.chalkRunningText},iy=({tooltip:e,onClick:t,disabled:n,disabledCursor:r="not-allowed",ariaExpanded:s,fillColor:i,textColor:o,variant:a,children:l})=>d.jsx(ge,{content:e,surface:"chalkboard",children:d.jsx("button",{type:"button",className:`inline-flex border-none bg-transparent bg-none p-0 ${n?r==="default"?"cursor-default":"cursor-not-allowed":"cursor-pointer enabled:hover:-translate-y-px enabled:hover:brightness-[1.15]"}`,onClick:t,disabled:n,"aria-expanded":s,children:d.jsx(re,{surface:"chalkboard",size:"small",fillColor:i,textColor:o,variant:a,children:l})})}),zne=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),II=e=>{if(!e)return"";const t=new Date(e),n=t.toLocaleTimeString();return zne(t,new Date)?n:`${t.toLocaleDateString()} ${n}`},Fne=1,Bne="h-[4.625rem]",Vne="basis-[6.625rem]",Une=e=>{var t,n;switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?`phase ${e.phaseIndex+1}`:"";case"audit":return"audit";case"batch-reconcile":return"batch reconcile";case"batch-draft":return"batch draft";case"reconcile":return"reconcile";case"fix-review":return"fixing review comments";case"draft":return"drafting";case"extend":return"extending";case"commit-suggest":return"suggesting commit message";case"overlap-check":return"checking overlap";case"sync":return"syncing to main";case"resolve-conflict":return"resolving conflict";case"run-all":return"run all phases";case"pr-review":{const r=(n=(t=e.prReviewUrl)==null?void 0:t.match(/\/pull\/(\d+)/))==null?void 0:n[1];return r?`reviewing PR #${r}`:"reviewing PR"}default:return""}},Wne=e=>{const t=Une(e);return!t||t.toLowerCase()===e.planTitle.trim().toLowerCase()?"":` — ${t}`},u1={starting:Ir.running,running:Ir.running,stopping:Ir.running,done:Ir.pass,error:Ir.fail,superseded:Ir.running},d1={starting:Ar.running,running:Ar.running,stopping:Ar.running,done:Ar.pass,error:Ar.fail,superseded:Ar.running},Kne=({task:e,onStop:t})=>{const n=lt(),{toast:r}=Ye(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async o=>{o.stopPropagation();try{await t(e.id)}catch(a){r({title:"Failed to stop agent",description:Ge(a.message),variant:"error"})}};return d.jsx(ye,{surface:"chalkboard",size:"small",className:`stack-task-card ${Bne}`,children:d.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:o=>{o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())},className:"flex h-full min-w-0 cursor-pointer flex-col justify-center gap-1 rounded-[10px]",children:[d.jsxs("span",{className:"block min-w-[6ch] overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,Wne(e)]}),d.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[d.jsxs("span",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-2xs text-desk-text-muted",children:[H8[e.agentId]," · ",II(e.startedAt)]}),d.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?d.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:d.jsx(re,{surface:"chalkboard",size:"small",fillColor:u1.error,textColor:d1.error,children:"stopped — agent signed out"})}):d.jsx(re,{surface:"chalkboard",size:"small",fillColor:u1[e.status],textColor:d1[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&d.jsx(st,{icon:d.jsx(Go,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})]})})},Hne=()=>{const e=M(i=>i.agentStatus),t=M(i=>i.stopAgent),n=lt(),r=e.slice(0,Fne),s=e.length-r.length;return d.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-[var(--pc-stack-pad)]",children:[d.jsx("h3",{className:`${NI} m-0`,children:"Agent"}),d.jsxs("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${Vne} ${r.length>0?"justify-start":"justify-center"}`,children:[r.length>0?r.map(i=>d.jsx(Kne,{task:i,onStop:t},i.id)):d.jsx(ye,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})}),s>0&&d.jsxs("button",{type:"button",onClick:()=>n({to:"/tasks"}),className:"shrink-0 cursor-pointer border-none bg-transparent p-0 text-left text-xs text-desk-text-muted underline",children:[s," more…"]})]})]})},AI=({label:e="Refresh data",refreshingLabel:t="Refreshing…",surface:n}={})=>{const r=M(l=>l.refreshAll),s=M(l=>l.refreshing),i=M(l=>{var c;return((c=l.status)==null?void 0:c.prFetchedAt)??null}),{toast:o}=Ye(),a=async()=>{if(s)return;const l=await r();l.ok?o({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):o({title:"Couldn't refresh",description:l.error??"The read failed — is the dev server running?",variant:"error"})};return d.jsxs("span",{className:"inline-flex items-center gap-2",children:[i!=null&&d.jsx("span",{className:`text-xs whitespace-nowrap ${n==="chalkboard"?"text-desk-text-muted":"opacity-[0.45]"}`,children:TN(i)}),d.jsx(st,{icon:d.jsx("span",{className:"inline-flex",children:d.jsx(OP,{size:16})}),label:s?t:e,size:"small",variant:"ghost",surface:n,disabled:s,onClick:a})]})},f1=e=>`${e.cmd}`,h1=e=>`${e.cmd}`,p1=e=>`${e.repo}|${e.branch??""}|${e.releasePlease?"1":"0"}`,Gne=(e,t)=>e.name===t.name&&e.cmd===t.cmd&&(e.port??null)===(t.port??null)&&(e.healthcheck??null)===(t.healthcheck??null),Zne=(e,t)=>e.name===t.name&&e.cmd===t.cmd;function qne(e,t){const n=(e==null?void 0:e.services)??[],r=t.services??[],s=(e==null?void 0:e.checks)??[],i=t.checks??[],o=e==null?void 0:e.ci,a=t.ci,l=[],c=new Map(r.map(g=>[f1(g),g])),u=new Map(n.map(g=>[f1(g),g]));for(const[g,x]of c){const y=u.get(g);y?Gne(y,x)||l.push({kind:"changed",before:y,after:x}):l.push({kind:"added",service:x})}for(const[g,x]of u)c.has(g)||l.push({kind:"removed",service:x});const f=[],h=new Map(i.map(g=>[h1(g),g])),p=new Map(s.map(g=>[h1(g),g]));for(const[g,x]of h){const y=p.get(g);y?Zne(y,x)||f.push({kind:"changed",before:y,after:x}):f.push({kind:"added",check:x})}for(const[g,x]of p)h.has(g)||f.push({kind:"removed",check:x});let m=null;return o&&a?p1(o)!==p1(a)&&(m={kind:"changed",before:o,after:a}):o&&!a?m={kind:"removed",ci:o}:!o&&a&&(m={kind:"added",ci:a}),{services:l,checks:f,ci:m}}const Yne=()=>{const[e,t]=k.useState(null),[n,r]=k.useState(null),[s,i]=k.useState(!1),[o,a]=k.useState(!1),{toast:l}=Ye(),c=k.useCallback(async()=>{const m=await qd();t((m==null?void 0:m.desk)??null),a(!0)},[]);k.useEffect(()=>{c()},[c]);const u=async()=>{i(!0);try{const m=await w9();if(!m.ok||!m.proposal){l({title:"Discovery failed",description:m.error??"No proposal returned.",variant:"error"});return}o||await c(),r(m.proposal)}finally{i(!1)}},f=()=>r(null),h=async m=>{const{ok:g,error:x}=await b9({desk:m});if(!g)throw l({title:"Failed to save",description:x,variant:"error"}),new Error(x??"failed to save desk config");const y=await qd();t((y==null?void 0:y.desk)??null),a(!0),r(null),l({title:"Desk config applied",variant:"success"})},p=n?qne(e??null,n):null;return{configLoaded:o,current:e,proposal:n,diff:p,discovering:s,startDiscovery:u,cancelProposal:f,applyProposal:h,reloadCurrent:c}},Jne=["repo-docs","release-notes"],Qne=["subjects","setup","merge-policy","desk"];function cf(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}const Xne=/^\d+$/;function oy(e,t,n="IDEA"){if(Xne.test(t)){const s=e.find(i=>{var o;return((o=i.id)==null?void 0:o.toUpperCase())===`${n}-${t}`.toUpperCase()});if(s)return s}const r=t.toUpperCase();return e.find(s=>{var i;return((i=s.id)==null?void 0:i.toUpperCase())===r})??e.find(s=>!s.id&&s.title===t)??null}function RI(e,t){return cf(e)??encodeURIComponent(t)}function $i(e){var r;const t=(r=e.id)!=null&&r.startsWith("TICKET-")?cf(e.id):null,n=cf(e.idea);return e.entityKind==="ticket"&&t&&n?{to:"/ideas/$ideaId/tickets/$ticketId",params:{ideaId:n,ticketId:t}}:{to:"/ideas/$ideaId",params:{ideaId:RI(e.id,e.title)}}}function ph(){const{planId:e,ideaId:t,ticketId:n}=Ai({strict:!1}),r=M(i=>i.plans);if(!r)return null;if(typeof n=="string")return oy(r.entries,decodeURIComponent(n),"TICKET");const s=typeof t=="string"?t:e;return typeof s!="string"?null:oy(r.entries,decodeURIComponent(s))}function LI(){const{ideaId:e}=Ai({strict:!1}),t=M(n=>n.ideaEntries);return typeof e!="string"?null:oy(t,decodeURIComponent(e))}function ere(){const{section:e}=Ai({strict:!1});return Jne.includes(e)?e:null}function Wae(){const{section:e}=Ai({strict:!1});return Qne.includes(e)?e:null}function tre(){const e=ere(),t=M(r=>r.activeDocTitle),n=M(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}function MI(){const e=lt(),t=M(n=>n.plans);return(n,r)=>{const s=((t==null?void 0:t.entries)??[]).find(i=>n?i.id===n:i.title===r);e($i(s??{id:n,title:r}))}}const nre=()=>{const[e,t]=k.useState(null),[n,r]=k.useState(null),[s,i]=k.useState(!0);return k.useEffect(()=>{let o=!1;return i(!0),Promise.all([S9().then(a=>{!o&&a&&t(KP(a))}),k9().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},rre=250;function sre(e,t,n={}){const{debounceMs:r=rre,...s}=n,[i,o]=k.useState(e);k.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return k.useMemo(()=>FY(i,t,{threshold:a,limit:l}),[i,t,a,l])}const $I=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState(!0);return k.useEffect(()=>{let o=!1;return qd().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},DI="Checks",ire={...Ir,stale:void 0},ore={...Ar,stale:void 0},m1=e=>e.errorCount>0?"fail":e.warningCount>0?"running":"pass",are=e=>`Fix the failing "${e.name}" check in this repo. The command was \`${e.cmd}\`.
|
|
295
|
+
|
|
296
|
+
Output from the last run:
|
|
297
|
+
|
|
298
|
+
${e.output||"(no output captured)"}`,lre=({check:e,onRun:t})=>{const n=e.status==="running",r=II(e.lastRun);return d.jsxs(iy,{tooltip:r?`${e.cmd} — last run ${r}. Click to run.`:`${e.cmd} — click to run.`,onClick:()=>t(e.name),disabled:n,fillColor:ire[e.status],textColor:ore[e.status],variant:e.status==="stale"?"neutral":void 0,children:[e.name,d.jsx("span",{className:n?"visible":"invisible",children:"…"})]})},cre=({finding:e})=>d.jsxs("div",{className:"font-mono text-2xs opacity-70",children:[e.file,":",e.line," — ",e.message]}),ure=({issue:e,linkedPlan:t,onNavigate:n})=>d.jsx("div",{className:"font-mono text-2xs opacity-70",children:t?d.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:e.message}):d.jsx("span",{className:"text-left",children:e.message})}),dre=()=>{const{checks:e,run:t}=bc(),n=M(x=>x.doctor),r=M(x=>x.consistency),s=M(x=>x.plans),i=lt(),o=e.find(x=>x.status==="fail"),[a,l]=k.useState(!1),[c,u]=k.useState(!1),[f,h]=k.useState(!1),p=n.findings.length>0,m=r.length>0,g=k.useCallback(x=>x.planId?s==null?void 0:s.entries.find(y=>y.id===x.planId):void 0,[s==null?void 0:s.entries]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${hh} m-0`,children:DI}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.map(x=>d.jsx(lre,{check:x,onRun:t},x.name)),d.jsx(iy,{tooltip:p?`${n.errorCount} error(s), ${n.warningCount} warning(s) — click to show.`:"Corpus doctor — no findings.",onClick:()=>u(x=>!x),disabled:!p,disabledCursor:"default",ariaExpanded:p?c:void 0,fillColor:Ir[m1(n)],textColor:Ar[m1(n)],children:"doctor"}),d.jsx(iy,{tooltip:m?"Plan/idea doc findings — orphan subjects & title style. Click to show.":"Plan/idea docs — no findings.",onClick:()=>h(x=>!x),disabled:!m,disabledCursor:"default",ariaExpanded:m?f:void 0,fillColor:Ir[m?"fail":"pass"],textColor:Ar[m?"fail":"pass"],children:"docs"})]}),o&&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 ",o.name," check failed."]}),d.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",d.jsx(Gd,{text:are(o),surface:"chalkboard"}),o.output&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("button",{type:"button",onClick:()=>l(x=>!x),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-desk-chalk","aria-expanded":a,children:a?"Hide output":"Show output"})]})]}),a&&o.output&&d.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap text-left font-mono text-2xs opacity-70",children:o.output})]}),c&&p&&d.jsx("div",{className:"flex flex-col gap-1",children:n.findings.map(x=>d.jsx(cre,{finding:x},`${x.file}:${x.line}:${x.rule}`))}),f&&m&&d.jsx("div",{className:"flex flex-col gap-1",children:r.map((x,y)=>{const v=g(x);return d.jsx(ure,{issue:x,linkedPlan:v,onNavigate:()=>v&&i($i(v))},`${x.kind}-${x.title}-${y}`)})})]})]})},fre=async()=>{try{const e=await J(K("/api/ci"));return e.ok?e.json():null}catch{return null}};function hre(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),s=k.useCallback(async()=>{try{t(await fre())}finally{r(!1)}},[]);return k.useEffect(()=>{s()},[s]),{ci:e,loading:n,refresh:s}}const OI="CI & release",pre={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"},qp="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",mre=({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 ${pre[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},gre=()=>{const{ci:e,loading:t,refresh:n}=hre(),r=M(o=>o.refreshing),s=k.useRef(!1);k.useEffect(()=>{s.current&&!r&&n(),s.current=r},[r,n]);const i=()=>{var a;if(!e)return d.jsx(ye,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:t?"Checking CI…":"No CI source declared."})});const o=`https://github.com/${e.repo}/actions`;return e.available?d.jsx(ye,{surface:"chalkboard",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(l=>d.jsx(mre,{run:l},l.workflow)):d.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),d.jsxs("div",{className:"font-mono text-2xs text-desk-text-muted",children:["Released ",e.releasedVersion??"—"," · Queued ",((a=e.releasePr)==null?void 0:a.version)??"none"]}),d.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&d.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:qp,children:["Release PR #",e.releasePr.number]}),d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:qp,children:"Open Actions"})]})]})}):d.jsx(ye,{surface:"chalkboard",size:"small",children:d.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",d.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:qp,children:"open Actions"})]})})};return d.jsxs("div",{children:[d.jsx("h4",{className:`${hh} m-0`,children:OI}),i()]})},g1=e=>e==="added"?{variant:"success",label:"new"}:e==="changed"?{variant:"info",label:"changed"}:e==="removed"?{variant:"error",label:"will remove"}:{variant:"neutral",label:"kept"};function yre(e,t){const n=(e==null?void 0:e.services)??[],r=t.services??[],s=new Set(r.map(o=>o.cmd)),i=[];for(const o of r){const a=n.find(c=>c.cmd===o.cmd),l=a?JSON.stringify(a)===JSON.stringify(o)?"kept":"changed":"added";i.push({...o,rowKey:crypto.randomUUID(),status:l})}for(const o of n)s.has(o.cmd)||i.push({...o,rowKey:crypto.randomUUID(),status:"removed"});return{rows:i}}function xre(e,t){const n=(e==null?void 0:e.checks)??[],r=t.checks??[],s=new Set(r.map(o=>o.cmd)),i=[];for(const o of r){const a=n.find(c=>c.cmd===o.cmd),l=a?JSON.stringify(a)===JSON.stringify(o)?"kept":"changed":"added";i.push({...o,rowKey:crypto.randomUUID(),status:l})}for(const o of n)s.has(o.cmd)||i.push({...o,rowKey:crypto.randomUUID(),status:"removed"});return{rows:i}}const vre=({current:e,proposal:t,diff:n,onApply:r,onCancel:s})=>{var R,L;const[i,o]=k.useState(()=>yre(e,t).rows),[a,l]=k.useState(()=>xre(e,t).rows),[c,u]=k.useState(t.ci),[f,h]=k.useState(!1),[p,m]=k.useState(),g=(I,z)=>o($=>$.map(D=>D.rowKey===I?{...D,...z}:D)),x=I=>o(z=>z.filter($=>$.rowKey!==I)),y=I=>o(z=>z.map($=>$.rowKey===I?{...$,status:"kept"}:$)),v=()=>o(I=>[...I,{rowKey:crypto.randomUUID(),name:"",cmd:"",status:"added"}]),b=(I,z)=>l($=>$.map(D=>D.rowKey===I?{...D,...z}:D)),w=I=>l(z=>z.filter($=>$.rowKey!==I)),_=I=>l(z=>z.map($=>$.rowKey===I?{...$,status:"kept"}:$)),S=()=>{e!=null&&e.ci&&u(e.ci)},j=()=>l(I=>[...I,{rowKey:crypto.randomUUID(),name:"",cmd:"",status:"added"}]),E=i.filter(I=>I.status!=="removed"&&I.name.trim()!==""&&I.cmd.trim()!=="").map(({rowKey:I,status:z,...$})=>$),T=a.filter(I=>I.status!=="removed"&&I.name.trim()!==""&&I.cmd.trim()!=="").map(({rowKey:I,status:z,...$})=>$),P=async()=>{h(!0),m(void 0);try{await r({services:E.length>0?E:void 0,checks:T.length>0?T:void 0,ci:c!=null&&c.repo.trim()?c:void 0})}catch(I){m(I.message),h(!1)}},N=(((R=e==null?void 0:e.services)==null?void 0:R.length)??0)>0||(((L=e==null?void 0:e.checks)==null?void 0:L.length)??0)>0;return d.jsx(Fs,{open:!0,onClose:f?()=>{}:s,size:"large",title:N?"Re-scan proposal":"Desk discovery proposal",children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsx("p",{className:"text-sm m-0 opacity-70",children:N?"The discovery agent produced the proposal below against your current desk config. Edit anything you want to keep, then apply — removals happen only when you leave them in the list and apply.":"The discovery agent scanned the project and produced the desk block below. Edit anything you want to keep, then apply."}),d.jsxs(y1,{title:"Services",summary:d.jsxs(d.Fragment,{children:[n.services.filter(I=>I.kind==="added").length>0&&d.jsxs(re,{size:"small",variant:"success",children:["+",n.services.filter(I=>I.kind==="added").length," new"]}),n.services.filter(I=>I.kind==="changed").length>0&&d.jsxs(re,{size:"small",variant:"info",children:["~",n.services.filter(I=>I.kind==="changed").length," changed"]}),n.services.filter(I=>I.kind==="removed").length>0&&d.jsxs(re,{size:"small",variant:"error",children:["-",n.services.filter(I=>I.kind==="removed").length," to remove"]})]}),onAdd:v,children:[i.length===0&&d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No services in the proposal."}),i.map((I,z)=>{const $=g1(I.status);return d.jsxs("div",{className:I.status==="removed"?"opacity-60":"",children:[d.jsxs("div",{className:"flex items-end gap-3 pb-2 pt-2",children:[d.jsx(re,{size:"small",variant:$.variant,children:$.label}),d.jsx(nt,{size:"small",label:"Name",value:I.name,onChange:D=>g(I.rowKey,{name:D.target.value})}),d.jsx(nt,{size:"small",label:"Command",value:I.cmd,onChange:D=>g(I.rowKey,{cmd:D.target.value})}),d.jsx(nt,{size:"small",type:"number",label:"Port",className:"w-[100px]",value:I.port??"",onChange:D=>g(I.rowKey,{port:D.target.value?Number(D.target.value):void 0})}),d.jsx(nt,{size:"small",label:"Healthcheck URL",value:I.healthcheck??"",onChange:D=>g(I.rowKey,{healthcheck:D.target.value||void 0})}),d.jsx(st,{icon:I.status==="removed"?d.jsx(x1,{size:16}):d.jsx(Go,{size:16}),variant:I.status==="removed"?"default":"danger",size:"small",onClick:()=>I.status==="removed"?y(I.rowKey):x(I.rowKey),label:I.status==="removed"?`Keep ${I.name||"service"}`:`Remove ${I.name||"service"}`})]}),z<i.length-1&&d.jsx(Zo,{})]},I.rowKey)})]}),d.jsxs(y1,{title:"Checks",summary:d.jsxs(d.Fragment,{children:[n.checks.filter(I=>I.kind==="added").length>0&&d.jsxs(re,{size:"small",variant:"success",children:["+",n.checks.filter(I=>I.kind==="added").length," new"]}),n.checks.filter(I=>I.kind==="changed").length>0&&d.jsxs(re,{size:"small",variant:"info",children:["~",n.checks.filter(I=>I.kind==="changed").length," changed"]}),n.checks.filter(I=>I.kind==="removed").length>0&&d.jsxs(re,{size:"small",variant:"error",children:["-",n.checks.filter(I=>I.kind==="removed").length," to remove"]})]}),onAdd:j,children:[a.length===0&&d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No checks in the proposal."}),a.map((I,z)=>{const $=g1(I.status);return d.jsxs("div",{className:I.status==="removed"?"opacity-60":"",children:[d.jsxs("div",{className:"flex items-end gap-3 pb-2 pt-2",children:[d.jsx(re,{size:"small",variant:$.variant,children:$.label}),d.jsx(nt,{size:"small",label:"Name",value:I.name,onChange:D=>b(I.rowKey,{name:D.target.value})}),d.jsx(nt,{size:"small",label:"Command",value:I.cmd,onChange:D=>b(I.rowKey,{cmd:D.target.value})}),d.jsx(st,{icon:I.status==="removed"?d.jsx(x1,{size:16}):d.jsx(Go,{size:16}),variant:I.status==="removed"?"default":"danger",size:"small",onClick:()=>I.status==="removed"?_(I.rowKey):w(I.rowKey),label:I.status==="removed"?`Keep ${I.name||"check"}`:`Remove ${I.name||"check"}`})]}),z<a.length-1&&d.jsx(Zo,{})]},I.rowKey)})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"m-0 text-sm font-semibold",children:"CI"}),n.ci&&d.jsx(re,{size:"small",variant:n.ci.kind==="added"?"success":n.ci.kind==="changed"?"info":"error",children:n.ci.kind==="added"?"new":n.ci.kind==="changed"?"changed":"to remove"})]}),!c&&d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("p",{className:"opacity-[0.45] text-sm m-0",children:"No CI in the proposal."}),(e==null?void 0:e.ci)&&d.jsx(ee,{size:"small",variant:"ghost",onClick:S,children:"Keep current CI"})]}),c&&d.jsxs("div",{className:"flex flex-col gap-3 pb-2 pt-2",children:[d.jsxs("div",{className:"flex items-end gap-3",children:[d.jsx(nt,{size:"small",label:"Repo (owner/name)",value:c.repo,onChange:I=>u({...c,repo:I.target.value})}),d.jsx(nt,{size:"small",label:"Branch",value:c.branch??"",onChange:I=>u({...c,branch:I.target.value||void 0})})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm",children:"Release Please"}),d.jsx(Zd,{checked:c.releasePlease??!1,onChange:I=>u({...c,releasePlease:I.target.checked})})]})]})]}),p&&d.jsxs("p",{className:"text-sm m-0 opacity-80",children:["Failed to apply: ",p]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{variant:"secondary",size:"small",onClick:s,disabled:f,children:"Cancel"}),d.jsx(ee,{size:"small",onClick:P,disabled:f,children:f?"Applying…":"Apply"})]})]})})},y1=({title:e,summary:t,onAdd:n,children:r})=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"m-0 text-sm font-semibold",children:e}),d.jsx("div",{className:"flex items-center gap-1",children:t})]}),d.jsx(ee,{size:"small",variant:"ghost",onClick:n,children:"+ Add"})]}),r]}),x1=({size:e=16})=>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("path",{d:"M3 7v6h6"}),d.jsx("path",{d:"M21 17a9 9 0 0 0-15-6.7L3 13"})]}),zI=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},bre=async()=>{const e=await J(K("/api/services"));return e.ok?(await e.json()).services??[]:[]},wre=async e=>{const t=await J(K(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await zI(t,"Failed to start service")},kre=async e=>{const t=await J(K(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await zI(t,"Failed to stop service")},_re=async e=>{const t=await J(K(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function Sre(){const[e,t]=k.useState([]),[n,r]=k.useState(!0),s=k.useCallback(async()=>{try{t(await bre())}catch{}finally{r(!1)}},[]);k.useEffect(()=>{s()},[s]),k.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=vc(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=k.useCallback(async a=>{await wre(a),await s()},[s]),o=k.useCallback(async a=>{await kre(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const Cre=1500,FI="Services",jre=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",Ere=({service:e})=>{const t=e.status==="running"?`running · ${e.health}`:e.status;return d.jsx("span",{role:"img","aria-label":t,className:`h-2 w-2 shrink-0 rounded-full ${jre(e)}`,title:t})},Pre=({name:e,running:t})=>{const[n,r]=k.useState(""),s=k.useRef(null);return k.useEffect(()=>{let i=!1;const o=async()=>{const l=await _re(e);i||r(l)};o();const a=t?setInterval(o,Cre):void 0;return()=>{i=!0,a&&clearInterval(a)}},[e,t]),k.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."})},Tre=({service:e,onStart:t,onStop:n})=>{const{toast:r}=Ye(),[s,i]=k.useState(!1),[o,a]=k.useState(!1),l=e.status==="running"||e.status==="stopping",c=e.pid!==null,u=async()=>{if(!s){i(!0);try{await(l?n:t)(e.name)}catch(f){r({title:l?"Failed to stop service":"Failed to start service",description:f.message,variant:"error"})}finally{i(!1)}}};return d.jsxs(ye,{surface:"chalkboard",size:"small",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>a(f=>!f),"aria-expanded":o,className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[d.jsx("span",{className:`shrink-0 text-desk-text-muted transition-transform ${o?"rotate-90":""}`,children:d.jsx(F8,{})}),d.jsx(Ere,{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(wr,{size:"small",surface:"chalkboard",label:"Working"}):!l||c?d.jsx(st,{icon:l?d.jsx(z8,{}):d.jsx(O8,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:u}):null})]}),o&&d.jsx(Pre,{name:e.name,running:l})]})},Nre=()=>{const{services:e,start:t,stop:n}=Sre(),r=k.useCallback(i=>t(i),[t]),s=k.useCallback(i=>n(i),[n]);return d.jsxs("div",{children:[d.jsx("h4",{className:`${hh} m-0`,children:FI}),d.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>d.jsx(Tre,{service:i,onStart:r,onStop:s},i.name)):d.jsx(ye,{surface:"chalkboard",size:"small",children:d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},Ire=[FI,DI,OI],Are=()=>d.jsx("div",{className:"flex flex-col gap-4","aria-hidden":"true",children:Ire.map(e=>d.jsxs("div",{children:[d.jsx("div",{className:hh,children:e}),d.jsx(sn,{variant:"rect",width:"100%",height:28,surface:"chalkboard"})]},e))}),Rre=({discovering:e,onDiscover:t})=>d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3",children:[d.jsx("p",{className:"m-0 text-center text-xs text-desk-text-muted",children:"Desk isn't configured — scan the project for one-click checks and long-running services."}),d.jsx(ee,{size:"small",surface:"chalkboard",onClick:t,disabled:e,children:e?d.jsxs(d.Fragment,{children:[d.jsx(wr,{size:"small",surface:"chalkboard",label:"Discovering"})," Discovering…"]}):"Discover from project"})]}),Lre=()=>{const{configLoaded:e,current:t,proposal:n,diff:r,discovering:s,startDiscovery:i,cancelProposal:o,applyProposal:a}=Yne();return d.jsxs(d.Fragment,{children:[d.jsx(Zo,{surface:"chalkboard"}),d.jsxs("div",{className:"flex flex-1 flex-col p-[var(--pc-stack-pad)]",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[d.jsx("h3",{className:`${NI} m-0`,children:"Desk"}),d.jsx(AI,{label:"Fetch from GitHub",refreshingLabel:"Fetching…",surface:"chalkboard"})]}),e?t?d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(Nre,{}),d.jsx(dre,{}),d.jsx(gre,{})]}):d.jsx(Rre,{discovering:s,onDiscover:i}):d.jsx(Are,{})]}),n&&r&&d.jsx(vre,{current:t,proposal:n,diff:r,onApply:a,onCancel:o})]})},Mre=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,{panelRef:s,anyChecksFailing:i,agentActive:o}=One(r,n,t);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(st,{icon:o?d.jsx(wr,{size:"small",surface:"chalkboard",label:"Agent running"}):i?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:o?"Open stack panel — agent running":i?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${o?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":i?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})}),d.jsxs("aside",{ref:s,"aria-label":"Stack",className:"fixed inset-y-0 right-0 z-[300] flex w-[min(var(--pc-stack-width),100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",style:{transform:r?"translateX(0)":"translateX(100%)"},children:[d.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between px-[var(--pc-stack-pad)]",children:[d.jsx("h2",{className:"m-0 font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&d.jsx(st,{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(Zo,{surface:"chalkboard"}),d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[d.jsx(Hne,{}),d.jsx(Lre,{})]})]})]})},v1=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=nre();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(Z6,{icon:d.jsx(H4,{}),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"})]})},$re=()=>{const e=lt();return Li!==""?d.jsx(v1,{size:"sm"}):d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx(v1,{size:"sm"}),d.jsx(ee,{variant:"ghost",size:"small",className:"font-handwritten !text-sm opacity-70",onClick:()=>e({to:"/projects"}),children:"Back to projects"})]})},Dre=()=>{const e=M(l=>l.setGithubConfig),[t,n]=k.useState(""),[r,s]=k.useState(""),[i,o]=k.useState(""),a=t.trim()!==""&&r.trim()!==""&&i.trim()!=="";return d.jsxs(ye,{size:"small",texture:"kraft",className:"mt-4 w-full max-w-sm text-left",children:[d.jsxs("p",{className:"m-0 mb-3 text-sm opacity-[0.65]",children:["No runtime reachable — paste a"," ",d.jsx("a",{href:"https://github.com/settings/personal-access-tokens/new",target:"_blank",rel:"noopener noreferrer",children:"fine-grained token"})," ","scoped to this repo to read and write the corpus directly."]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(nt,{size:"small",label:"Owner",value:t,onChange:l=>n(l.target.value)}),d.jsx(nt,{size:"small",label:"Repo",value:r,onChange:l=>s(l.target.value)}),d.jsx(nt,{size:"small",type:"password",label:"Token",value:i,onChange:l=>o(l.target.value)})]}),d.jsx(ee,{size:"small",className:"mt-3",disabled:!a,onClick:()=>e({owner:t.trim(),repo:r.trim(),token:i.trim()}),children:"Save"})]})},Ore=({layer:e})=>d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 py-24 text-center",children:[d.jsx("p",{className:"font-handwritten text-lg",children:e==="corpus"?"This needs the runtime or a GitHub token":"This needs the runtime"}),d.jsx("p",{className:"max-w-sm text-sm opacity-60",children:e==="corpus"?"Connect the project's runtime, or go plan-only below.":"Connect the project's runtime to use this — it owns the filesystem, git and the agent."}),e==="corpus"&&d.jsx(Dre,{})]}),zre=()=>{const[e,t]=k.useState(null);return k.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},Fre=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=k.useRef(null);return k.useEffect(()=>{if(!n)return;const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,r]),k.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.jsxs("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:"shrink-0 h-8"}),d.jsx("div",{className:"flex-1 overflow-y-auto relative",children:d.jsx("div",{children:t},e)})]})]})};function Bre(){const e=M(u=>u.agentStatus),t=M(u=>u.gitStatus),n=M(u=>u.gitBranch),r=M(u=>u.gitAhead),s=M(MJ),i=M($J),o=M(DJ),a=M(u=>{var f;return((f=u.notifications)==null?void 0:f.filter(h=>h.kind==="question"||!h.read).length)??0}),l=lt(),c=e.find(u=>u.status==="running"||u.status==="starting"||u.status==="stopping");return{gitBranch:n,gitAhead:r,changedFileCount:(t==null?void 0:t.length)??0,agentActive:c!==void 0,activeTaskStatus:c==null?void 0:c.status,agentNotSignedIn:i,capabilityGapCount:s,rateLimit:o,unreadNotificationCount:a,onOpenSetup:()=>l({to:"/settings/$section",params:{section:"setup"}}),onOpenGit:()=>l({to:"/git"}),onOpenNotifications:()=>l({to:"/inbox"})}}function Yp(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function Vre(e){return e<1e12?e*1e3:e}function Ure(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(Vre(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const Wre="flex items-center gap-3 h-8 px-4 border-b border-black/[0.08] text-xs shrink-0 box-border overflow-x-auto overflow-y-hidden whitespace-nowrap",Kre="flex items-center gap-3 shrink-0",Hre="flex items-center gap-1",Gre="opacity-50",Zre="text-[var(--pui-text-primary)]",b1="opacity-60",qre="flex-1",w1="flex items-center gap-2 shrink-0",k1="bg-transparent border-none p-0 cursor-pointer",Yre="relative inline-flex",Jre="absolute -top-1 -right-1 pointer-events-none",Qre=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:f,trailing:h})=>d.jsxs("div",{className:Wre,style:Ho("kraft"),children:[d.jsxs("div",{className:Kre,children:[d.jsxs("span",{className:Hre,children:[d.jsx("span",{className:Gre,children:d.jsx(dk,{size:12})}),d.jsx("code",{className:Zre,children:e??"no branch"})]}),t>0&&d.jsxs("span",{className:b1,children:["↑",t]}),d.jsx("span",{className:b1,children:n>0?`${n} changed`:"clean"}),r&&d.jsx(wr,{size:"small",label:`Agent ${s}…`}),i&&d.jsx(ge,{content:"Sign in from Settings → Connections so agent tasks can run",children:d.jsx("button",{type:"button",onClick:c,className:k1,children:d.jsx(re,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&d.jsx(ge,{content:"Some features are disabled — open Setup to fix",children:d.jsx("button",{type:"button",onClick:c,className:k1,children:d.jsxs(re,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&Yp(a.status)!=="allowed"&&d.jsx(ge,{content:Ure(a),children:d.jsx(re,{size:"small",variant:Yp(a.status)==="rejected"?"error":"warning",children:Yp(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),d.jsx("div",{className:qre}),h&&d.jsx("div",{className:w1,children:h}),d.jsxs("div",{className:w1,children:[d.jsx(ge,{content:"Git",children:d.jsx(st,{variant:"ghost",size:"small",icon:d.jsx(dk,{}),label:"Git",onClick:u})}),d.jsx(ge,{content:"Notifications",children:d.jsxs("span",{className:Yre,children:[d.jsx(st,{variant:"ghost",size:"small",icon:d.jsx(B8,{}),label:"Notifications",onClick:f}),l>0&&d.jsx("span",{className:Jre,children:d.jsx(re,{size:"small",variant:"warning",children:l})})]})})]})]}),Xre=()=>{const e=Bre();return d.jsx(Qre,{...e})},ese=()=>{const e=lt(),t=ph(),n=LI(),r=M(l=>l.plans),s=tre(),i=M(l=>l.activeDocTitle),o=M(l=>l.activeReleaseVersion),a=(()=>{if(t){const c=t.entityKind==="ticket"&&t.idea?((r==null?void 0:r.entries)??[]).find(u=>u.id===t.idea):void 0;return[{id:"plans",label:"Plans",onClick:()=>e({to:"/"})},...c?[{id:"board",label:c.title,onClick:()=>e($i(c))}]:[],{id:"plan",label:t.title}]}if(n)return[{id:"plans",label:"Plans",onClick:()=>e({to:"/"})},{id:"idea",label:n.title}];const l=s==="repo-docs"?i:s==="release-notes"?o:null;return l?[{id:"docs",label:"Docs",onClick:()=>e({to:"/docs"})},{id:"doc",label:l}]:null})();return a?d.jsx("div",{className:"-mt-6 mb-3",children:d.jsx(b8,{className:"font-handwritten !text-xs min-w-0",items:a})}):null},BI=({children:e,className:t=""})=>d.jsx("h1",{className:`text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1] ${t}`,children:e}),tse=({children:e})=>d.jsx(EP,{background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:d.jsx("div",{className:"h-full overflow-y-auto px-6 py-16",children:d.jsxs(Gx,{texture:{texture:"parchment"},className:"m-auto w-full max-w-3xl",children:[d.jsx(BI,{children:"Paper Camp"}),e]})})});function nse(e,t,n){return e!==""||t!==""||n}async function rse(e,t){if(e!=="")return!1;try{const n=await t("/api/capabilities");return n.ok?(await n.json(),!0):!1}catch{return!1}}function VI(e,t){return`${e}?runtime=${encodeURIComponent(t)}`}function sse(e){try{return new URL(e).host}catch{return e}}function ise(e,t){return`${e}/p/${t}`}function ose(e,t){const n=new Set(t);return e.filter(r=>!n.has(r.runtimeUrl))}async function ase(){const e=await J(K("/api/github/device-code"),{method:"POST"});if(!e.ok)throw new Error("Could not reach GitHub.");return e.json()}async function lse(e){return(await J(K("/api/github/device-token"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e})})).json()}const Kv="papercamp:github-hub-token";function UI(){try{return localStorage.getItem(Kv)}catch{return null}}function _1(e){try{localStorage.setItem(Kv,e)}catch{}}function S1(){try{localStorage.removeItem(Kv)}catch{}}const cse="https://api.github.com";async function WI(e,t){const n=await fetch(`${cse}${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json"}});if(!n.ok){const r=await n.json().catch(()=>null);throw new Cv((r==null?void 0:r.message)??`GitHub API error (${n.status})`,n.status)}return n.json()}async function use(e){const t=await WI(e,"/user");return{login:t.login,avatarUrl:t.avatar_url}}async function dse(e){const t=[];for(let n=1;;n++){const r=await WI(e,`/user/repos?per_page=100&affiliation=owner,collaborator&page=${n}`);if(!Array.isArray(r)||r.length===0||(t.push(...r.map(s=>s.full_name)),r.length<100))break}return t}async function Jp(e){const[t,n]=await Promise.all([use(e),dse(e)]);return{identity:t,repoNames:n}}function C1(e){return e instanceof Cv?e.message:"Could not reach GitHub."}function fse(){const[e,t]=k.useState(""),[n,r]=k.useState(null),[s,i]=k.useState(!1),[o,a]=k.useState(null),[l,c]=k.useState(null),[u,f]=k.useState(!1),h=k.useRef(null);k.useEffect(()=>{const v=UI();v&&(i(!0),Jp(v).then(b=>r(b)).catch(()=>{S1(),a("That token no longer works — reconnect below.")}).finally(()=>i(!1)))},[]);const p=()=>{const v=e.trim();v!==""&&(i(!0),a(null),Jp(v).then(b=>{_1(v),r(b),t(""),c(null)}).catch(b=>a(C1(b))).finally(()=>i(!1)))},m=()=>{S1(),r(null),a(null)},g=async(v,b)=>{if(await new Promise(_=>setTimeout(_,b*1e3)),h.current!==v)return;const w=await lse(v);if(h.current===v){if(w.access_token){h.current=null,_1(w.access_token);try{r(await Jp(w.access_token))}catch(_){a(C1(_))}c(null);return}if(w.error==="authorization_pending"){await g(v,b);return}if(w.error==="slow_down"){await g(v,w.interval??b+5);return}h.current=null,c(null),a(w.error_description??"GitHub sign-in did not complete.")}};return{connection:n,loading:s,error:o,deviceFlow:l,deviceFlowLoading:u,token:e,setToken:t,connectWithToken:p,disconnect:m,signIn:()=>{f(!0),a(null),ase().then(v=>{h.current=v.device_code,window.open(v.verification_uri,"_blank","noopener,noreferrer"),c({userCode:v.user_code,deviceCode:v.device_code,verificationUri:v.verification_uri}),g(v.device_code,v.interval)}).catch(()=>a("Could not reach GitHub.")).finally(()=>f(!1))},cancelDeviceFlow:()=>{h.current=null,c(null),a(null)}}}function hse(e){return e.trim().replace(/\/+$/,"")}function pse(){const[e,t]=k.useState(""),[n,r]=k.useState(""),[s,i]=k.useState(null),[o,a]=k.useState(!1),[l,c]=k.useState(null);return{machineUrl:e,setMachineUrl:h=>{t(h),i(null),c(null)},connectedUrl:n,projects:s,loading:o,error:l,connect:()=>{const h=hse(e);h!==""&&(a(!0),c(null),v9(h).then(p=>{if(!p||p.length===0){c("No projects found there — is paper-camp daemon running on that address?");return}r(h),i(p)}).finally(()=>a(!1)))}}}const Qi=typeof window>"u"?null:window.localStorage;function mse(e){if(UN(Ms(e),Qi),e.kind==="github"){const t=UI();t&&QP({token:t,owner:e.owner,repo:e.repo})}window.location.assign(Li||"/")}function gse(){const[e,t]=k.useState(()=>Gg(Qi)),n=()=>t(Gg(Qi));return{projects:e,addGithubEntry:r=>{mJ(r,Qi),n()},renameEntry:(r,s)=>{yJ(r,s,Qi),n()},removeEntry:r=>{gJ(r,Qi),n()},openEntry:r=>{const s=e.find(i=>Ms(i)===r);s&&mse(s)}}}const yse="0.25.0",KI=yse,xse={name:null,reachable:!1,remoteVersion:null,versionSkew:!1};function vse(e){const[t,n]=k.useState({}),r=e.map(s=>s.runtimeUrl).join(`
|
|
299
|
+
`);return k.useEffect(()=>{let s=!1;const i=r===""?[]:r.split(`
|
|
300
|
+
`);return Promise.all(i.map(async o=>{const[a,l]=await Promise.all([_9(o),g9(o)]),c=l===null?xse:{name:a?KP(a):null,reachable:!0,remoteVersion:l,versionSkew:l!==KI};return[o,c]})).then(o=>{s||n(Object.fromEntries(o))}),()=>{s=!0}},[r]),t}function bse(){const[e,t]=k.useState([]),[n,r]=k.useState(!0),s=k.useCallback(i=>{r(!0),x9(i).then(o=>t(o??[])).finally(()=>r(!1))},[]);return k.useEffect(()=>{s(!1)},[s]),{peers:e,loading:n,refresh:()=>s(!0)}}function wse(e,t){window.location.assign(VI(window.location.pathname,ise(e,t)))}const kse=()=>{const{machineUrl:e,setMachineUrl:t,connectedUrl:n,projects:r,loading:s,error:i,connect:o}=pse();return d.jsxs(ye,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Connect to a machine"}),d.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Paste the address of a machine running ",d.jsx("code",{children:"paper-camp daemon"})," this browser can reach — its LAN or tailnet address from another machine. ",d.jsx("code",{children:"localhost"})," only works on the machine running it."]}),d.jsx(nt,{size:"small",label:"Machine URL",placeholder:"http://localhost:4333",value:e,onChange:a=>t(a.target.value)}),r?d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:r.map(a=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>wse(n,a.slug),children:d.jsx("span",{className:"truncate",children:a.name})},a.slug))}):d.jsxs(d.Fragment,{children:[i&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:i}),d.jsx(ee,{size:"small",disabled:e.trim()===""||s,onClick:o,children:s?"Connecting…":"Connect"})]})]})},_se="https://github.com/settings/personal-access-tokens/new",Sse=({token:e,onTokenChange:t,loading:n,onConnect:r})=>d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Mint a"," ",d.jsx("a",{href:_se,target:"_blank",rel:"noopener noreferrer",children:"fine-grained token"})," ","scoped to the repositories you want, then paste it in."]}),d.jsx(nt,{size:"small",type:"password",label:"Token",value:e,onChange:s=>t(s.target.value)}),d.jsx(ee,{size:"small",variant:"secondary",disabled:e.trim()===""||n,onClick:r,children:n?"Connecting…":"Connect"})]}),Cse=({state:e,error:t,onCancel:n,token:r,onTokenChange:s,tokenLoading:i,onTokenConnect:o})=>{const[a,l]=k.useState(!1);return d.jsxs(ye,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Sign in with GitHub"}),d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Enter this code on the GitHub tab that just opened:"}),d.jsxs("p",{className:"m-0 flex items-center gap-2 text-lg font-semibold tracking-widest",children:[e.userCode,d.jsx(Gd,{text:e.userCode})]}),t&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:t}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(ee,{size:"small",variant:"secondary",onClick:n,children:"Cancel"}),!a&&d.jsx(ee,{size:"small",variant:"ghost",onClick:()=>l(!0),children:"Paste a token instead"})]}),a&&d.jsx(Sse,{token:r,onTokenChange:s,loading:i,onConnect:o})]})};function jse({repoName:e}){const t=e.indexOf("/");return t===-1?d.jsx("span",{className:"block truncate",title:e,children:e}):d.jsxs("span",{className:"flex min-w-0 items-center",title:e,children:[d.jsx("span",{className:"min-w-0 truncate",children:e.slice(0,t)}),d.jsx("span",{className:"shrink-0",children:e.slice(t)})]})}const Ese=({connection:e,chosenRepoNames:t,onDisconnect:n,onAddRepo:r})=>{const[s,i]=k.useState(""),o=new Set(t),a=s.trim().toLowerCase(),l=e.repoNames.filter(c=>!o.has(c)&&c.toLowerCase().includes(a));return d.jsxs(ye,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("p",{className:"m-0 min-w-0 truncate font-semibold",title:`Connected as ${e.identity.login}`,children:["Connected as ",e.identity.login]}),d.jsx(ee,{size:"small",variant:"secondary",className:"shrink-0",onClick:n,children:"Disconnect"})]}),d.jsx(nt,{type:"search",size:"small",placeholder:"Search repositories…","aria-label":"Search repositories",value:s,onChange:c=>i(c.target.value)}),d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:l.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:e.repoNames.length===0?"This token reaches no repositories yet.":"No matching repositories."}):l.map(c=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>r(c),children:d.jsx(jse,{repoName:c})},c))})]})},Pse=({chosenRepoNames:e,onAddRepo:t})=>{const{connection:n,loading:r,error:s,deviceFlow:i,deviceFlowLoading:o,token:a,setToken:l,connectWithToken:c,disconnect:u,signIn:f,cancelDeviceFlow:h}=fse();return n?d.jsx(Ese,{connection:n,chosenRepoNames:e,onDisconnect:u,onAddRepo:t}):i?d.jsx(Cse,{state:i,error:s,onCancel:h,token:a,onTokenChange:l,tokenLoading:r,onTokenConnect:c}):d.jsxs(ye,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Connect GitHub"}),d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Sign in to browse and plan against your repositories."}),d.jsx(ee,{size:"small",disabled:o,onClick:f,children:o?"Starting…":"Sign in with GitHub"}),s&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:s})]})};function Tse(e){window.location.assign(VI(window.location.pathname,e.runtimeUrl))}const Nse=({chosenRuntimeUrls:e})=>{const{peers:t,loading:n,refresh:r}=bse();if(t.length===0)return null;const s=ose(t,e);return d.jsxs(ye,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Tailnet"}),d.jsx(st,{icon:d.jsx(OP,{size:16}),label:n?"Refreshing…":"Refresh",size:"small",variant:"ghost",disabled:n,onClick:r})]}),s.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Every discovered runtime is already added."}):d.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:s.map(i=>d.jsx(It,{size:"small",className:"min-w-0",onClick:()=>Tse(i),children:d.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5 text-left",children:[d.jsx("span",{className:"truncate",children:i.dnsName}),i.version&&d.jsxs("span",{className:"font-handwritten text-2xs opacity-60",children:["v",i.version]})]})},i.runtimeUrl))})]})},Ise=({projects:e,onAddRepo:t})=>d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Add a project"}),d.jsx(Pse,{chosenRepoNames:e.filter(n=>n.kind==="github").map(Ms),onAddRepo:t}),d.jsx(Nse,{chosenRuntimeUrls:e.filter(n=>n.kind==="runtime").map(Ms)}),d.jsx(kse,{})]}),Ase=({open:e,currentLabel:t,onClose:n,onSubmit:r})=>{const[s,i]=k.useState(t);return d.jsx(Fs,{open:e,onClose:()=>{n(),i(t)},title:"Rename project",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(nt,{label:"Name",value:s,onChange:o=>i(o.target.value),placeholder:"Project name",autoFocus:!0}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:n,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:()=>r(s),children:"Save"})]})]})})},Rse=({projectName:e,currentLabel:t,onRename:n,onRemove:r})=>{const[s,i]=k.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(qx,{align:"end",trigger:d.jsx(st,{variant:"ghost",size:"small",className:"shrink-0",label:`${e} actions`,icon:d.jsx("span",{"aria-hidden":"true",children:"···"}),onClick:o=>o.stopPropagation()}),items:[{id:"rename",label:"Rename",onSelect:()=>i(!0)},{id:"remove",label:"Remove",danger:!0,onSelect:r}]}),d.jsx(Ase,{open:s,currentLabel:t,onClose:()=>i(!1),onSubmit:o=>{n(o),i(!1)}})]})};function Lse(e){return e.kind==="runtime"?sse(e.runtimeUrl):`${e.owner}/${e.repo}`}function Mse(e,t){return e.label?e.label:e.kind==="runtime"?t:e.repo}function $se({entry:e,status:t}){return e.kind==="github"?d.jsx(re,{size:"small",variant:"info",children:"Plan-only"}):t?t.reachable?t.versionSkew?d.jsx(ge,{content:`Runtime is on ${t.remoteVersion}, this client is on ${KI}`,children:d.jsx(re,{size:"small",variant:"warning",children:"Version mismatch"})}):d.jsx(re,{size:"small",variant:"success",children:"Can execute"}):d.jsx(re,{size:"small",variant:"info",children:"Plan-only"}):d.jsx(re,{size:"small",variant:"neutral",children:"Checking…"})}const Dse=({entry:e,status:t,onOpen:n,onRename:r,onRemove:s})=>{const i=Lse(e),o=Mse(e,(t==null?void 0:t.name)??null);return d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(It,{size:"medium",className:"min-w-0 flex-1",onClick:n,action:d.jsx($se,{entry:e,status:t}),children:o?d.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5 text-left",children:[d.jsx("span",{className:"break-words",children:o}),d.jsx("span",{className:"break-words font-handwritten text-2xs opacity-60",children:i})]}):d.jsx("span",{className:"block break-words text-left",children:i})}),d.jsx(Rse,{projectName:o??i,currentLabel:e.label??"",onRename:r,onRemove:s})]})};function Ose(e){return e.kind==="runtime"}const zse=({projects:e,onOpen:t,onRename:n,onRemove:r})=>{const s=vse(e.filter(Ose));return d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("p",{className:"m-0 font-semibold",children:"Projects"}),e.length===0?d.jsx("p",{className:"m-0 text-sm opacity-70",children:"Nothing here yet — add a project from the right."}):d.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{const o=Ms(i);return d.jsx(Dse,{entry:i,status:i.kind==="runtime"?s[i.runtimeUrl]:void 0,onOpen:()=>t(o),onRename:a=>n(o,a),onRemove:()=>r(o)},o)})})]})},Fse=()=>{const{projects:e,addGithubEntry:t,renameEntry:n,removeEntry:r,openEntry:s}=gse();return d.jsxs("div",{className:"flex flex-col gap-6 md:flex-row md:items-stretch",children:[d.jsx("div",{className:"min-w-0 md:flex-1",children:d.jsx(zse,{projects:e,onOpen:s,onRename:n,onRemove:r})}),d.jsx(Zo,{orientation:"horizontal",className:"md:hidden"}),d.jsx(Zo,{orientation:"vertical",className:"hidden md:block"}),d.jsx("div",{className:"min-w-0 md:flex-1",children:d.jsx(Ise,{projects:e,onAddRepo:t})})]})},j1=(e,t)=>{var n;return((n=e.find(r=>r.name===t))==null?void 0:n.status)??"stale"};function HI(e,t){var n;return{qualityStatus:j1(t,"lint"),testStatus:j1(t,"test"),consistencyStatus:((n=e==null?void 0:e.consistency)==null?void 0:n.status)??"stale"}}const Bse=()=>{const e=M(g=>g.status),t=M(g=>g.runConsistencyCheck),{checks:n,run:r}=bc(),s=M(g=>g.consistency),i=M(g=>g.plans),o=lt(),[a,l]=k.useState(!1),{qualityStatus:c,testStatus:u,consistencyStatus:f}=k.useMemo(()=>HI(e,n),[e,n]),h=c==="running"||u==="running"||f==="running",p=s.length>0,m=k.useCallback(g=>g.planId?i==null?void 0:i.entries.find(x=>x.id===g.planId):void 0,[i==null?void 0:i.entries]);return{qualityStatus:c,testStatus:u,consistencyStatus:f,anyRunning:h,hasDocIssues:p,consistency:s,docsExpanded:a,setDocsExpanded:l,navigate:o,runDeskCheck:r,runConsistencyCheck:t,linkedPlanFor:m}},Qp=new Map,E1=new Map,Vse=e=>`commit-draft:${e}`;function Use(e,t){const{formKey:n,suggestedTitle:r,matchesSuggestionTask:s,beforeCommit:i}=t,o=M(N=>N.agentStatus),a=M(N=>N.loadGitStatus),l=M(N=>N.loadDiffFiles),c=M(N=>N.commitInFlight),u=M(N=>N.setCommitInFlight),{toast:f}=Ye(),[h,p]=k.useState(""),[m,g]=k.useState(""),[x,y]=k.useState(!1),[v,b]=k.useState(!1),[w,_]=k.useState(null),S=k.useMemo(()=>e.map(N=>N.path),[e]),j=k.useMemo(()=>e.filter(N=>N.staged).length,[e]);k.useEffect(()=>{r&&!h&&p(r)},[r,h]);const E=Vse(n);k.useEffect(()=>{const N=mc(E);p((N==null?void 0:N.title)??""),g((N==null?void 0:N.message)??"")},[E]),k.useEffect(()=>{!h&&!m||gc(E,{title:h,message:m})},[E,h,m]),k.useEffect(()=>{const N=Qp.get(n)??Date.now();Qp.set(n,N);const R=E1.get(n)??new Set,L=o.find(I=>s(I)&&I.suggestedCommit&&!R.has(I.id)&&(I.lastStreamAt??0)>N);L!=null&&L.suggestedCommit&&(R.add(L.id),E1.set(n,R),p(L.suggestedCommit.title),g(L.suggestedCommit.message))},[o,n,s]);const T=k.useCallback(async()=>{if(!h.trim()||c)return;y(!0),u(!0);let N;try{const R=i?await i(h.trim()):void 0;N=R==null?void 0:R.onFailure;const L=R==null?void 0:R.extraPath;if(j>0)L&&await X8(L),await Ng([],h.trim(),m.trim()||void 0);else{const I=L&&!S.includes(L)?[...S,L]:S;await Ng(I,h.trim(),m.trim()||void 0)}p(""),g(""),Qp.set(n,Date.now()),Pv(E),await Promise.all([a(),l()])}catch(R){N&&await N(),f({title:"Commit failed",description:Ge(R.message),variant:"error"}),await Promise.all([a(),l()])}finally{y(!1),u(!1)}},[h,m,S,j,a,l,c,u,f,n,E,i]),P=k.useCallback(async()=>{if(S.length!==0){b(!0),_(null);try{const N=await VP(S);p(N.title),g(N.message)}catch(N){_(N.message)}finally{b(!1)}}},[S]);return{commitTitle:h,setCommitTitle:p,commitMessage:m,setCommitMessage:g,committing:x,commitInFlight:c,stagedCount:j,suggesting:v,suggestError:w,setSuggestError:_,handleCommit:T,handleSuggestFromChanges:P}}const wc=()=>{const e=M(a=>a.loadPlans),t=M(a=>a.runtimeReachable),n=M(a=>a.githubConfig),{toast:r}=Ye(),[s,i]=k.useState(!1);return{patch:async(a,l,c)=>{i(!0);try{return!t&&n?await mY(n,a,l):await mW(a,l),await e(),!0}catch(u){return r({title:(c==null?void 0:c.errorTitle)??"Update failed",description:u.message,variant:"error"}),!1}finally{i(!1)}},updating:s}},Wse=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function Kse(e){var r;if(e.phases.length>0&&e.phases.every(s=>s.done))return{title:""};const t=((r=e.tags)==null?void 0:r.find(s=>Wse.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const Hse=(e,t)=>{const n=M(x=>x.status),{checks:r}=bc(),s=M(lh),i=M(x=>x.launchRunAll),{patch:o}=wc(),[a,l]=k.useState(!1),{title:c}=k.useMemo(()=>Kse(e),[e]),u=k.useMemo(()=>t.map(x=>x.path),[t]),f=k.useCallback(async x=>{if(!e.id||QY(u))return{};const y=e.id;return await o(e.title,{phases:JY(e.phases,x)})?{extraPath:XY(y),onFailure:async()=>{await o(e.title,{phases:e.phases})}}:{}},[e,u,o]),h=k.useCallback(x=>x.planId===e.id,[e.id]),p=Use(t,{formKey:e.id??"__plan-draft__",suggestedTitle:c,matchesSuggestionTask:h,beforeCommit:f}),m=!!e.id&&!s,g=k.useCallback(async()=>{if(!e.id||!n||a||s)return;const x=e.id;l(!0);try{const y=ZY(e.fixes??[],n,r);await o(e.title,{fixes:y})&&await i(x)}finally{l(!1)}},[e,a,s,n,r,o,i]);return{...p,canFix:m,fixing:a,handleFix:g}},Gse=3*6e4,Zse=(e,t)=>{const n=M(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;k.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{B9(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},Gse);return()=>clearTimeout(o)},[t,i,s,n])},qse=e=>{const t=M(a=>a.loadPlans),{toast:n}=Ye(),[r,s]=k.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await pk(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:Ge(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await qP(l);return await pk(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:Ge(c.message),variant:"error"}),!1}finally{s(null)}}}};function Yse(e,t){const[n,r]=k.useState(""),[s,i]=k.useState(null),[o,a]=k.useState(null),l=e.thread??[],{promotingIndex:c,promoteToDurable:u,promoteToIdea:f}=qse(e);Zse(e,!0);const h=tJ(e);return k.useEffect(()=>{r(mc(h)??"")},[h]),k.useEffect(()=>{n&&gc(h,n)},[h,n]),{thread:l,input:n,setInput:r,pending:s,promotingIndex:c,ideaPromptIndex:o,handleSend:async()=>{const y=n.trim();y&&(i(y),r(""),await t(y)?Pv(h):r(v=>v||y),i(null))},handlePromote:(y,v)=>{v==="idea"?a(y):u(y,v)},handlePromoteToIdea:async y=>{o!==null&&await f(o,y)&&a(null)},closeIdeaPrompt:()=>a(null)}}const Jse=()=>{const e=M(T=>T.plans),t=M(T=>T.plansError),n=M(T=>T.ideaEntries),r=M(T=>T.suggestions),s=M(T=>T.setDetailView),i=M(T=>T.planFilters),o=M(T=>T.setSubjectFilter),a=M(T=>T.dismissSuggestion),l=ph(),c=LI(),{planId:u,ideaId:f}=Ai({strict:!1}),h=lt(),p=MI(),{toast:m}=Ye(),{subject:g}=fx({strict:!1});k.useEffect(()=>{o(g??null)},[g,o]);const x=u??f,y=k.useRef(x);k.useEffect(()=>{y.current!==x&&s("details"),y.current=x},[x,s]);const v=()=>{h({to:"/"})},b=T=>{var N;const P=(N=e==null?void 0:e.entries.find(R=>R.title===T))==null?void 0:N.id;p(P,T)},w=T=>{var N;const P=(N=n.find(R=>R.title===T))==null?void 0:N.id;h({to:"/ideas/$ideaId",params:{ideaId:RI(P,T)}})},_=T=>{p(T.id,T.title)},[S,j]=k.useState(null);return{plans:e,plansError:t,ideaEntries:n,suggestions:r,planFilters:i,activePlan:l,activeIdea:c,planId:u,ideaId:f,openSuggestion:S,setOpenSuggestion:j,handleBack:v,handleOpenPlan:b,handleOpenIdea:w,handleOpenArchivable:_,handleDismissSuggestion:async T=>{try{await a(T)}catch(P){m({title:"Failed to dismiss suggestion",description:P.message,variant:"error"})}}}},ay=.95,Qse=3e4,ly={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function Xse(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 eie(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=Xse(t),r={};for(const s of["implement","verify"]){const i=ly[s].to-ly[s].from;r[s]=n*i/ay}return r}function tie({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=ly[e],o=Math.min(i.from,ay),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+Qse),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),ay)}const nie=new Set(["starting","running","stopping"]),rie=1e3;function sie(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&nie.has(e.status),[r,s]=k.useState(()=>Date.now());return k.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),rie);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:tie({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:eie(t)})}}const iie=(e,{reload:t,notify:n})=>{const[r,s]=k.useState(!1),[i,o]=k.useState(!1),[a,l]=k.useState(null);return k.useEffect(()=>{l(null)},[e.id]),{sending:r,send:async f=>{if(!e.id)return!1;s(!0),l(null);try{const h={route:window.location.pathname,focusedIdeaId:e.id,viewport:{width:window.innerWidth,height:window.innerHeight}},{error:p,undo:m}=await F9(e.id,f,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:Ge(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Ge(h.message),variant:"error"}),!1}finally{s(!1)}},undo:a,undoing:i,undoEdit:async()=>{if(!(!e.id||!a)){o(!0);try{const{error:f}=await V9(e.id,a.commitSha);if(f){n({title:"Undo failed",description:Ge(f),variant:"error"});return}l(null),await t()}catch(f){n({title:"Undo failed",description:Ge(f.message),variant:"error"})}finally{o(!1)}}}}},oie=async e=>{const t=await J(K(`/api/trail?id=${encodeURIComponent(e)}`));if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},aie=e=>{const[t,n]=k.useState(null);return k.useEffect(()=>{if(n(null),!e)return;let r=!1;return oie(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t},lie=()=>{const[e,t]=k.useState(new Set);return k.useEffect(()=>{let n=!1;return GP().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},Hv="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.",GI="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 cie(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
|
|
301
|
+
`),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
302
|
+
`):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
303
|
+
`):"(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.
|
|
304
|
+
|
|
305
|
+
Plan body: ${e.body}
|
|
306
|
+
|
|
307
|
+
Current phases:
|
|
308
|
+
${t}
|
|
309
|
+
|
|
310
|
+
Log entries (issues, bugs, and review notes recorded so far):
|
|
311
|
+
${n}
|
|
312
|
+
|
|
313
|
+
Clarifications (answered scope/design questions):
|
|
314
|
+
${r}
|
|
315
|
+
|
|
316
|
+
${Hv}
|
|
317
|
+
|
|
318
|
+
Task:
|
|
319
|
+
1. Read the plan above, then inspect the relevant code in this repo.
|
|
320
|
+
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.
|
|
321
|
+
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.
|
|
322
|
+
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.
|
|
323
|
+
|
|
324
|
+
Rules:
|
|
325
|
+
- Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
|
|
326
|
+
- Never touch the YAML frontmatter.
|
|
327
|
+
- Append only: new unchecked phases at the end of the list, plus the single Log line.`}function uie(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(`
|
|
328
|
+
`):"(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.
|
|
329
|
+
|
|
330
|
+
${t?"Plan":"Idea"} body: ${e.body}
|
|
331
|
+
|
|
332
|
+
Current phases:
|
|
333
|
+
${r}
|
|
334
|
+
|
|
335
|
+
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.
|
|
336
|
+
|
|
337
|
+
1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
|
|
338
|
+
2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
|
|
339
|
+
3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
|
|
340
|
+
|
|
341
|
+
Hard guardrails, never violate these:
|
|
342
|
+
- Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
|
|
343
|
+
- Never un-check, check, delete, or reorder any phase line, checked or unchecked.
|
|
344
|
+
- Never add or remove phases.
|
|
345
|
+
- Never touch the Log or Clarifications sections.
|
|
346
|
+
- If nothing is stale, make no edits at all.`}function die(){return{done:!1,text:"Style pass",description:"Scope yourself to only the files this plan has changed — compare against the base branch (e.g. `git diff main...HEAD --name-only`), never the wider codebase. Read docs/CODE_STYLE.md in full and apply it to those files:\n\n- Delete any comment that fails §7 — the cap is two lines and the default count is zero.\n- Move complex logic out of components into hooks/, leaving components rendering what a hook returns.\n- Sort files into the by-role folders of §4, and split a file holding more than one component.\n- Replace a literal with its design token (§2) and a hand-rolled element with its paper-ui component (§1).\n- Extract anything now written three times (§3) — into the feature's helpers/ if it is feature logic, into @/app/utils or @/app/hooks if it is not.\n- Apply §5's naming rules: every component's props are a named `{Component}Props` interface, duplicate import statements from one module merge into one, and table/list column definitions live outside the JSX.\n\nBehaviour may not change. Finish with `pnpm check-types`, `pnpm lint` and `npx vitest run` all green, and do not edit any test to accommodate a change — a test that has to change means this pass altered behaviour and went too far."}}function Gv(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.
|
|
347
|
+
|
|
348
|
+
${n}
|
|
349
|
+
|
|
350
|
+
${Hv}
|
|
351
|
+
|
|
352
|
+
Task:
|
|
353
|
+
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.
|
|
354
|
+
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.
|
|
355
|
+
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).
|
|
356
|
+
|
|
357
|
+
Keep unchanged:
|
|
358
|
+
${r}
|
|
359
|
+
|
|
360
|
+
Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function fie(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
|
|
361
|
+
`):"(none)",n=`Current idea body, in full (do not modify this):
|
|
362
|
+
${e.body}
|
|
363
|
+
|
|
364
|
+
Prior Log entries:
|
|
365
|
+
${t}`,r=`- the YAML frontmatter (id, title)
|
|
366
|
+
- the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return Gv(e,"expanding",n,r)}const ZI=`- the YAML frontmatter (id, title, status)
|
|
367
|
+
- the original body prose beneath the frontmatter`;function hie(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:
|
|
368
|
+
${e.body}`;return Gv(e,"fleshing out",t,ZI)}function Kae(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:
|
|
369
|
+
${e.body}`;return Gv(e,"fleshing out",n,ZI)}function pie(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(`
|
|
370
|
+
`):"(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.
|
|
371
|
+
|
|
372
|
+
Idea body, in full:
|
|
373
|
+
${e.body}
|
|
374
|
+
|
|
375
|
+
## What drafting adds to the file (see papercamp/about.md)
|
|
376
|
+
|
|
377
|
+
The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
|
|
378
|
+
|
|
379
|
+
1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
|
|
380
|
+
2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
|
|
381
|
+
3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
|
|
382
|
+
|
|
383
|
+
\`\`\`
|
|
384
|
+
### Phases
|
|
385
|
+
- [ ] Short phase title
|
|
386
|
+
Optional description of the phase, indented with 6 spaces.
|
|
387
|
+
\`\`\`
|
|
388
|
+
|
|
389
|
+
${Hv}
|
|
390
|
+
|
|
391
|
+
Hard rules:
|
|
392
|
+
- Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${GI} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
|
|
393
|
+
- Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
|
|
394
|
+
- Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
|
|
395
|
+
|
|
396
|
+
## Every other open (non-done) plan, for scope context
|
|
397
|
+
|
|
398
|
+
${r}
|
|
399
|
+
|
|
400
|
+
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 mie(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}
|
|
401
|
+
${s.body}`).join(`
|
|
402
|
+
|
|
403
|
+
`):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
|
|
404
|
+
`):"(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.
|
|
405
|
+
|
|
406
|
+
Existing ideas (do not repeat anything already covered here):
|
|
407
|
+
${n}
|
|
408
|
+
|
|
409
|
+
Existing suggestions already in the holding pen (do not repeat these either):
|
|
410
|
+
${r}
|
|
411
|
+
|
|
412
|
+
Task:
|
|
413
|
+
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.
|
|
414
|
+
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. ${GI} Keep the description to a single physical line (no literal line breaks).
|
|
415
|
+
3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
|
|
416
|
+
|
|
417
|
+
Rules:
|
|
418
|
+
- Append only — never modify, reorder, or delete any existing line in suggestions.md.
|
|
419
|
+
- Never create papercamp/ideas/ files — a suggestion is not an idea until a human promotes it.
|
|
420
|
+
- Never touch any other file in the repo.`}const qI={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},kc={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},hn={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"}},YI={open:"Open",done:"Done",dropped:"Dropped"},uf={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"}},gie={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},P1={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"}},yie={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},T1={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"}},N1=({pr:e,reviewing:t})=>{const n=M(s=>{var i;return((i=s.status)==null?void 0:i.prFetchedAt)??null}),r=d.jsx(re,{size:"small",fillColor:P1[e.state].fill,textColor:P1[e.state].text,children:d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(V8,{}),"#",e.number," ",gie[e.state]]})});return d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"no-underline inline-flex",children:n!=null?d.jsx(ge,{content:`Fetched from GitHub ${TN(n)}`,children:r}):r}),t&&d.jsx(wr,{size:"small",label:`Reviewing PR #${e.number}`})]})},xie=e=>{const{subjects:t,loading:n,available:r}=$I(),s=lie(),i=lt(),o=M(g=>g.planFilters.sortKey),a=M(g=>g.planFilters.sortDirection),l=M(g=>g.planFilters.groupBySubject),c=M(g=>g.setPlanSortKey),u=M(g=>g.togglePlanSortDirection),f=g=>{g===o?u():c(g)},h=LY(e,a,n||!r?void 0:t),p=l&&h.length>1;return{roadmapItemNames:s,navigate:i,sortKey:o,sortDirection:a,handleSort:f,groups:h,showSubjectHeaders:p,sortReflectsRows:!p}};function JI(){const[e,t]=k.useState("idle"),[n,r]=k.useState(null),s=k.useRef(null),i=k.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=k.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 QI=({idea:e,otherPlans:t,className:n=""})=>{const r=M(h=>h.launchPlanDraft),s=M(Kr),{state:i,errorMessage:o,run:a}=JI(),{toast:l}=Ye(),c=()=>{const h=e.id;h&&a(async()=>{try{await r(h,pie(e,t))}catch(p){throw l({title:"Draft failed",description:Ge(p.message),variant:"error"}),p}})},u=i==="loading"?"Drafting…":i==="success"?"Draft sent!":i==="error"?"Draft failed":"Draft plan",f=i==="error"?o??"Draft failed":e.id?s?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(ge,{content:f,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:c,disabled:i==="loading"||!e.id||!s,className:`${i==="error"?"text-watercolor-rose-dark":"text-ink-500"} ${n}`,children:u})})},vie=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=k.useRef(null),[s,i]=k.useState(!1),[o,a]=k.useState(!1);return k.useLayoutEffect(()=>i(!1),[n]),k.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"})]})},bie=({count:e})=>{const t=lt();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"]})},wie={pass:"success",fail:"error",running:"warning",stale:"neutral"},Xp=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>d.jsx(ge,{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(re,{size:"small",variant:wie[t],children:[e,d.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),kie=()=>{const{qualityStatus:e,testStatus:t,consistencyStatus:n,anyRunning:r,hasDocIssues:s,consistency:i,docsExpanded:o,setDocsExpanded:a,navigate:l,runDeskCheck:c,runConsistencyCheck:u,linkedPlanFor:f}=Bse();return d.jsx("div",{className:"flex flex-col items-center gap-2",children:d.jsxs("div",{className:"flex flex-wrap items-start justify-center gap-2",children:[d.jsx(Xp,{label:"Quality",status:e,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:r,onClick:()=>c("lint")}),d.jsx(Xp,{label:"Tests",status:t,title:"Unit tests (Vitest). Click to run.",anyRunning:r,onClick:()=>c("test")}),d.jsx(Xp,{label:"Consistency",status:n,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:r,onClick:()=>u()}),d.jsxs("div",{children:[d.jsx(ge,{content:s?"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 ${s?"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:!s,"aria-expanded":s?o:void 0,"aria-controls":"deliver-doc-findings",onClick:()=>{s&&a(h=>!h)},children:d.jsx(re,{size:"small",variant:s?"error":"success",children:"Docs"})})}),o&&s&&d.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:i.map((h,p)=>{const m=f(h);return d.jsx("div",{className:"font-mono text-2xs opacity-70",children:m?d.jsx("button",{type:"button",onClick:()=>l($i(m)),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}-${p}`)})})]}),d.jsx(VJ,{})]})})},I1=({label:e,disabled:t,onClick:n})=>d.jsx(ee,{size:"small",disabled:t,onClick:n,children:e}),_ie=({state:e,filesEmpty:t})=>{const n=M(u=>u.status),{checks:r}=bc(),{qualityStatus:s,testStatus:i,consistencyStatus:o}=k.useMemo(()=>HI(n,r),[n,r]);if(s==="fail"||i==="fail"||o==="fail"){const u=e.fixing?"Fixing…":"Fix";return d.jsx(I1,{label:u,disabled:!e.canFix||e.fixing,onClick:e.handleFix})}const l=e.committing||e.commitInFlight,c=l?"Committing…":e.stagedCount>0?`Commit ${e.stagedCount} staged`:"Commit";return d.jsx(I1,{label:c,disabled:t||!e.commitTitle.trim()||l,onClick:e.handleCommit})},Sie=()=>{const e=M(t=>t.gitAhead);return d.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:e>0?`All changes committed — ${e} commit${e===1?"":"s"} ready to push.`:"No changed files."}),d.jsx(WJ,{})]})},Cie={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},jie=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>d.jsx(d.Fragment,{children:e.map((o,a)=>{const l=Cie[o.kind],c=o.from==="agent",u=a===e.length-1,f=[{id:"decision",label:"Promote to decision",icon:d.jsx(NP,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:d.jsx(Yx,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:d.jsx(TP,{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(ye,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:d.jsx(vie,{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(re,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&d.jsx(ge,{content:"Revert this run's plan edit",children:d.jsx(ee,{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(re,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?d.jsx(wr,{size:"small",label:"Promoting…"}):d.jsx(qx,{align:"end",trigger:d.jsx(st,{icon:d.jsx(zP,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:f}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),Eie=({planId:e,phaseIndex:t,disabled:n})=>{const r=M(u=>u.launchAgent),s=M(Kr),{toast:i}=Ye(),[o,a]=k.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:Ge(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(st,{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"})},Pie=({row:e,runningFill:t,updating:n,onTogglePhase:r,onToggleFix:s})=>sh(e,t)?d.jsx(wr,{size:"small"}):d.jsx(PP,{checked:e.item.done,onChange:()=>e.kind==="phase"?r(e.index):s(e.index),disabled:n}),Tie=({row:e,runningFill:t})=>d.jsxs("span",{className:`inline-flex min-w-0 max-w-full items-center gap-2 ${e.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[d.jsx("span",{title:e.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:e.item.text}),sh(e,t)&&d.jsxs("span",{className:"text-xs opacity-[0.55]",children:[Math.round(((t==null?void 0:t.fraction)??0)*100),"%"]}),e.kind==="phase"&&e.item.source==="review"&&d.jsx(re,{size:"small",fillColor:hn.review.fill,textColor:hn.review.text,children:"review"}),e.kind==="phase"&&e.item.source==="manual"&&d.jsx(re,{size:"small",variant:"neutral",children:"manual"}),e.kind==="fix"&&d.jsx(re,{size:"small",variant:"warning",children:"fix"})]}),Nie=({row:e,runningFill:t,agentBusy:n,planId:r})=>{if(sh(e,t))return null;if(e.item.done){const s=e.item.run;return s?d.jsx("div",{className:"flex w-full justify-end [container-type:inline-size]",children:d.jsx(re,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[d.jsxs("span",{children:[Rr(s.inputTokens+s.outputTokens)," tokens"]}),d.jsxs("span",{className:"run-meta-full",children:[" ","· ",Jf(s.durationMs),s.attempts>1&&` ×${s.attempts}`,s.model&&` · ${s.model}`]})]})})}):null}return e.kind!=="phase"?null:d.jsx("div",{className:"flex justify-end",children:d.jsx(Eie,{planId:r,phaseIndex:e.index,disabled:n})})},Ws=({id:e})=>e?d.jsx(re,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,XI=({pct:e,color:t,height:n=6})=>d.jsx(x6,{value:e,color:t,height:n}),A1=({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(re,{size:"small",fillColor:T1[t].fill,textColor:T1[t].text,children:yie[t]}),!!n&&d.jsxs(re,{size:"small",fillColor:hn["in-progress"].fill,textColor:hn["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},R1={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},L1={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},_u=({reached:e,label:t,tooltip:n,href:r})=>{const s=d.jsx(re,{size:"small",fillColor:e?R1.fill:L1.fill,textColor:e?R1.text:L1.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(ge,{content:n,children:i}):i},em=()=>d.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),M1=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function Iie(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const Aie=({trail:e,released:t,reviewing:n,reviewNote:r})=>{var u,f;const{taskRuns:s,commits:i,pr:o,releaseLine:a}=e,l=a.data?Iie(a.data):void 0,c=t?`Released ${t}`:l?`Released ${l.hash}`:"Release";return d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(_u,{reached:s.reached,label:s.data?M1(s.data.length,"task run"):"Tasks",tooltip:(u=s.data)==null?void 0:u.map(h=>h.taskKind).join(", ")}),d.jsx(em,{}),d.jsx(_u,{reached:i.reached,label:i.data?M1(i.data.length,"commit"):"Commits",tooltip:(f=i.data)==null?void 0:f.join(`
|
|
421
|
+
`)}),d.jsx(em,{}),o.data?r&&!n?d.jsx(ge,{content:r,children:d.jsxs("span",{className:"inline-flex items-center gap-2",children:[d.jsx(N1,{pr:o.data,reviewing:n}),d.jsx(A1,{pr:o.data})]})}):d.jsxs(d.Fragment,{children:[d.jsx(N1,{pr:o.data,reviewing:n}),!n&&d.jsx(A1,{pr:o.data})]}):d.jsx(_u,{reached:!1,label:"PR"}),d.jsx(em,{}),d.jsx(_u,{reached:a.reached||!!t,label:c,tooltip:a.data,href:l==null?void 0:l.url})]})},eA=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=k.useState(""),[o,a]=k.useState(""),[l,c]=k.useState(!1),[u,f]=k.useState(!1),[h,p]=k.useState(!1),[m,g]=k.useState(null),[x,y]=k.useState(null),[v,b]=k.useState(!1),[w,_]=k.useState(null),[S,j]=k.useState(null),E=M(D=>{var O;return((O=D.plans)==null?void 0:O.entries)??[]}),{patch:T}=wc();lt();const P=MI(),N=sre(s,E.map(D=>({id:D.id,title:D.title,body:D.body,tags:D.tags,log:D.log})));k.useEffect(()=>{e&&(i(""),a(r??""),c(!1),f(!1),p(!1),g(null),b(!1),_(null),j(null))},[e,r]);const R=(D,O)=>{t(),P(D,O)},L=async()=>{const D=`${s.trim()}${o.trim()?`
|
|
422
|
+
|
|
423
|
+
${o.trim()}`:""}`;if(D){b(!0),j(null),_(null);try{const O=E.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));_(await cW(D,O))}catch(O){j(O.message)}finally{b(!1)}}},I=D=>{const O=E.find(V=>V.id===D);O&&R(O.id,O.title)},z=async(D,O,V)=>{y(D);const U={date:new Date().toISOString().slice(0,10),text:s.trim()},Q=await T(O,{log:[...V??[],U]},{errorTitle:"Extend failed"});y(null),Q&&t()},$=async D=>{if(D.preventDefault(),!(!s.trim()||h)){g(null),p(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":u?"board":void 0}),t()}catch(O){g(O.message)}finally{p(!1)}}};return d.jsx(Fs,{open:e,onClose:t,title:"New idea",size:"small",children:d.jsxs("form",{onSubmit:$,className:"flex flex-col gap-4",children:[d.jsx(nt,{label:"Title",value:s,onChange:D=>i(D.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:h,autoFocus:!0,required:!0}),N.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"}),N.map(({candidate:D})=>{const O={id:D.id??null,title:D.title,body:D.body,log:D.log},V=E.filter(C=>C.id!==D.id);return d.jsx(ye,{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(Ws,{id:D.id}),d.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:D.title})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",size:"small",onClick:()=>R(D.id,D.title),children:"Open it"}),d.jsx(ee,{type:"button",variant:"ghost",size:"small",disabled:!D.id||!s.trim()||x!==null,onClick:()=>D.id&&z(D.id,D.title,D.log),children:x===D.id?"Extending…":"Extend it instead"}),d.jsx(QI,{idea:O,otherPlans:V})]})]})},D.id??D.title)})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("div",{children:d.jsx(ee,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||v,onClick:L,children:v?"Checking overlap…":"Check overlap"})}),S&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:S}),w&&d.jsx(ye,{size:"small",texture:"canvas",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("span",{className:"font-semibold",children:w.verdict==="new"?"Looks genuinely new":w.verdict==="extend"?`Extends ${w.targetId??"an existing idea"}`:`Belongs inside ${w.targetId??"an existing idea"}`}),d.jsx("span",{className:"text-sm opacity-80",children:w.reasoning}),w.targetId&&d.jsx("div",{className:"flex justify-end",children:d.jsx(ee,{type:"button",variant:"ghost",size:"small",onClick:()=>I(w.targetId),children:"Open it"})})]})})]}),d.jsx(Zx,{label:"Description",value:o,onChange:D=>a(D.target.value),placeholder:"Optional details…",disabled:h,rows:4}),d.jsx(Zd,{label:"Just a note (no plan needed)",checked:l,onChange:D=>{c(D.target.checked),D.target.checked&&f(!1)},disabled:h}),d.jsx(Zd,{label:"Board (decomposes into tickets instead of phases)",checked:u,onChange:D=>{f(D.target.checked),D.target.checked&&c(!1)},disabled:h}),m&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:m}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:t,disabled:h,children:"Cancel"}),d.jsx(ee,{type:"submit",variant:"primary",disabled:!s.trim()||h,children:"Add"})]})]})})},Rie=({open:e,onClose:t,onConfirm:n})=>{const r=M(m=>{var g;return((g=m.plans)==null?void 0:g.entries)??[]}),[s,i]=k.useState([]),[o,a]=k.useState(new Set),[l,c]=k.useState(!1),[u,f]=k.useState(null);k.useEffect(()=>{if(e){const m=r.filter(g=>!!g.id&&g.phases.length===0&&g.status==="idea");i(m),a(new Set(m.map(g=>g.id))),c(!1),f(null)}},[e]);const h=m=>{a(g=>{const x=new Set(g);return x.has(m)?x.delete(m):x.add(m),x})},p=async()=>{c(!0),f(null);try{await n([...o]),t()}catch(m){f(m.message)}finally{c(!1)}};return d.jsx(Fs,{open:e,onClose:t,title:"Draft all",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"m-0 opacity-80",children:[s.length," undrafted idea",s.length===1?"":"s"," will be turned into a plan."]}),s.length>0&&d.jsx("div",{className:"flex max-h-[16rem] flex-col gap-2 overflow-y-auto",children:s.map(m=>d.jsx(PP,{label:m.title,checked:o.has(m.id),onChange:()=>h(m.id)},m.id))}),u&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:u}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:p,disabled:l||o.size===0,children:l?"Starting…":`Draft ${o.size}`})]})]})})},Lie=({suggestion:e,onClose:t})=>{const n=M(u=>u.promoteSuggestion),r=M(u=>u.launchIdeaExtend),[s,i]=k.useState(!1),[o,a]=k.useState(null),{toast:l}=Ye();k.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),f=M.getState().ideaEntries.find(h=>h.id===u);if(f)try{await r(u,hie(f))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Ge(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return d.jsx(Fs,{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(ee,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},tm=({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}`)})}),$1=e=>d.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),Mie=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=k.useState(!1),[a,l]=k.useState(!1),c=e.body!==t.body,u=e.phases.map((m,g)=>({phase:m,before:t.phases[g],index:g})).filter(({phase:m,before:g})=>g!==void 0&&(m.text!==g.text||(m.description??"")!==(g.description??""))),f=i||a,h=async()=>{if(!f){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return d.jsx(Fs,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:f?()=>{}:h,children:d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:['The reconcile agent proposed the rewrite below for "',e.title,'". Approve to keep it, or discard to revert to the prior wording.']}),!c&&u.length===0&&d.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&d.jsxs("div",{children:[$1("Body"),d.jsx("p",{className:"text-base m-0 leading-normal",children:d.jsx(tm,{tokens:Lp(t.body,e.body)})})]}),u.length>0&&d.jsxs("div",{children:[$1("Phases"),d.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:g,index:x})=>d.jsxs("div",{className:"text-sm leading-normal",children:[d.jsx(tm,{tokens:Lp(g.text,m.text)}),(m.description||g.description)&&d.jsx("div",{className:"opacity-[0.85] mt-1",children:d.jsx(tm,{tokens:Lp(g.description??"",m.description??"")})})]},x))})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{variant:"danger",size:"small",onClick:h,disabled:f,children:"Discard"}),d.jsx(ee,{variant:"primary",size:"small",onClick:p,disabled:f,children:"Approve"})]})]})})},mh=({order:e,done:t,running:n,status:r,fallback:s})=>d.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?d.jsx(wr,{size:"small",label:"Agent running"}):t?d.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?s?d.jsx(ge,{content:"Queue position based on a status guess — GitHub's PR state couldn't be resolved",children:d.jsx(re,{size:"small",variant:"warning",dot:!0,children:d.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})})}):d.jsx(re,{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(FP,{size:14})}):null}),Jo="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",tA=({plans:e,activePlanTitle:t,onOpen:n})=>{const r=Jo,s=M(i=>i.agentStatus);return d.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{var l;const o=IN(i),a=oh(i,s);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(mh,{order:i.order,done:i.status==="done",status:i.status,running:!!ih(i.id,s),fallback:i.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(i.title):void 0,onKeyDown:n?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n(i.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${i.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(ye,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:r,children:[d.jsx(Ws,{id:i.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:i.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:i.updated?Wg(i.updated):Wg(i.created)}),o?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(XI,{pct:o.pct,color:qI[a]})}),d.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[o.done,"/",o.total]})]}):d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(re,{size:"small",fillColor:hn[a].fill,textColor:hn[a].text,children:kc[a]}),i.statusFallback&&d.jsx(ge,{content:"GitHub's PR state couldn't be resolved — this status is a guess from local data",children:d.jsx(re,{size:"small",variant:"warning",dot:!0,children:"Guess"})}),((l=i.pr)==null?void 0:l.state)==="merged"&&d.jsx(ge,{content:`Merged in #${i.pr.number}`,children:d.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:d.jsx(DP,{size:14})})})]})]})})})]},i.title)})})},$ie=({onOpen:e})=>{const t=M(m=>m.archivableIdeas),n=M(m=>m.archiveIdeas),r=M(m=>m.planFilters.search),[s,i]=k.useState(null),[o,a]=k.useState(!1),{toast:l}=Ye(),c=r.trim().toLowerCase(),u=c?t.filter(m=>m.title.toLowerCase().includes(c)):t,f=k.useCallback(async m=>{try{await n(m)}catch(g){l({title:"Archive failed",description:g.message,variant:"error"})}},[n,l]),h=k.useCallback(async m=>{i(m.id);try{await f([m.id])}finally{i(null)}},[f]),p=k.useCallback(async()=>{a(!0);try{await f(u.map(m=>m.id))}finally{a(!1)}},[f,u]);return u.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 (",u.length,")"]}),d.jsx(ee,{variant:"ghost",size:"small",disabled:o||s!==null,onClick:p,children:o?"Archiving…":"Archive all"})]}),d.jsx("div",{className:"flex flex-col gap-1",children:u.map(m=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(mh,{done:!0}),d.jsx("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(m):void 0,onKeyDown:e?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),e(m))}:void 0,className:`${e?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0`,children:d.jsx(ye,{size:"small",texture:"canvas",shade:!0,className:"plan-row-card",children:d.jsxs("div",{className:Jo,children:[d.jsx(Ws,{id:m.id}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:m.title}),d.jsx("span",{className:"max-lg:hidden text-sm opacity-30",children:"—"}),d.jsx("span",{className:"text-sm opacity-30",children:"—"}),d.jsx(ee,{variant:"ghost",size:"small",className:"archive-row-action",disabled:s===m.id||o,onClick:g=>{g.stopPropagation(),h(m)},onKeyDown:g=>g.stopPropagation(),children:s===m.id?"Archiving…":"Archive"})]})})})]},m.id))})]})},Die="font-display-luminari text-sm font-semibold opacity-[0.65]",Oie=({clarifications:e})=>e.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${Die} 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}`))})]}),zie=({plan:e})=>{const t=M(i=>i.gitStatus),n=k.useMemo(()=>(t==null?void 0:t.map(i=>({path:i.path,staged:i.staged})))??[],[t]),r=Hse(e,n),s=n.length>0;return d.jsxs("div",{className:"flex min-h-[7rem] flex-col items-center justify-center gap-3",children:[d.jsx(kie,{}),s?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-full max-w-md",children:d.jsx(U8,{state:r,filesEmpty:!1})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[d.jsx(bie,{count:n.length}),d.jsx(_ie,{state:r,filesEmpty:!1})]})]}):d.jsx(Sie,{})]})},Fie="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]",Bie=({onAdd:e,disabled:t,entityId:n})=>{const[r,s]=k.useState(!1),[i,o]=k.useState(""),[a,l]=k.useState(null),[c,u]=k.useState(!1),f=`review-phases-draft:${n}`;k.useEffect(()=>{o(mc(f)??"")},[f]),k.useEffect(()=>{i&&gc(f,i)},[f,i]);const h=()=>{s(!1),o(""),l(null),Pv(f)},p=async()=>{let m;try{m=UY(i)}catch(g){l(g instanceof Error?g.message:"Could not parse findings");return}u(!0),l(null);try{await e(m),h()}finally{u(!1)}};return d.jsxs(d.Fragment,{children:[d.jsx(ge,{content:"Add code-review findings as phases",children:d.jsx(st,{variant:"ghost",size:"small",onClick:()=>s(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:d.jsx(IP,{size:16})})}),d.jsx(Fs,{open:r,onClose:h,title:"Add code-review findings",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",d.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),d.jsx(Zx,{value:i,onChange:m=>o(m.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:c}),a&&d.jsxs(LP,{variant:"warning",children:["Could not add phases — ",a]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:h,disabled:c,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:p,disabled:c||!i.trim(),children:"Add phases"})]})]})})]})},Vie=({onAdd:e,disabled:t})=>{const[n,r]=k.useState(!1),[s,i]=k.useState(""),[o,a]=k.useState(!1),[l,c]=k.useState(null),u=()=>{r(!1),i(""),c(null)},f=async()=>{if(s.trim()){a(!0),c(null);try{await e(s.trim()),u()}catch(h){c(h.message)}finally{a(!1)}}};return d.jsxs(d.Fragment,{children:[d.jsx(ge,{content:"Add a ticket to this board",children:d.jsx(st,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add a ticket to this board",icon:d.jsx(IP,{size:16})})}),d.jsx(Fs,{open:n,onClose:u,title:"Add ticket",size:"small",children:d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx(nt,{label:"Title",value:s,onChange:h=>i(h.target.value),placeholder:"Ticket title…",disabled:o,autoFocus:!0,required:!0}),l&&d.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:l}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ee,{type:"button",variant:"ghost",onClick:u,disabled:o,children:"Cancel"}),d.jsx(ee,{type:"button",variant:"primary",onClick:f,disabled:o||!s.trim(),children:"Add"})]})]})})]})},Uie=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanAudit),r=M(Kr),[s,i]=k.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,cie(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(ge,{content:a,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})};function nA(e){const[t,n]=k.useState(null),r=k.useCallback(async()=>{n(e?await z9(e):null)},[e]);return k.useEffect(()=>{r()},[r]),k.useEffect(()=>{let s;const i=vc(o=>{o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(r,250))});return()=>{s&&clearTimeout(s),i()}},[r]),t}const Wie=({plan:e,disabled:t})=>{const n=M(u=>u.refreshAll),[r,s]=k.useState(!1),{toast:i}=Ye(),o=nA(e.id),a=CY(e,o==null?void 0:o.ciGreen),l=async()=>{if(e.id){s(!0);try{const u=await i9(e.id);u.needsAttention?i({title:"Merged — main needs manual sync",description:Ge(u.needsAttention),variant:"error"}):i({title:"Idea complete",description:`${e.id} merged — main is up to date`,variant:"success"}),await n()}catch(u){i({title:"Complete failed",description:Ge(u.message),variant:"error"})}finally{s(!1)}}},c=t||r||!e.id||!a.ready;return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:l,disabled:c,className:`pc-row text-xs ${c?"opacity-50":""}`,children:r?"Completing…":"Complete idea"}),!a.ready&&a.missing.length>0&&d.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:["Waiting on ",a.missing.join(", ")]})]})},Kie=({plan:e,disabled:t})=>{const n=M(c=>c.gitBranch),r=M(c=>c.loadGitStatus),[s,i]=k.useState(!1),{toast:o}=Ye(),a=async()=>{if(e.id){i(!0);try{const{branch:c,warning:u}=await a9(e.id);o({title:"Branch ready",description:`Now on ${c}`,variant:"success"}),u&&o({title:"Stale fork",description:u,variant:"warning"}),await r()}catch(c){o({title:"Branch failed",description:Ge(c.message),variant:"error"})}finally{i(!1)}}},l=t||s||!e.id;return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(ge,{content:e.id?`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`:void 0,children:d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-ink-500",children:"⎇"}),onClick:a,disabled:l,className:`pc-row text-xs ${l?"opacity-50":""}`,children:s?"Switching…":"Create branch"})}),d.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:[d.jsx("code",{children:n??"unknown"})," — not this plan's branch"]})]})},rA=({idea:e,compact:t})=>{const n=M(h=>h.launchIdeaExtend),r=M(Kr),{state:s,errorMessage:i,run:o}=JI(),{toast:a}=Ye(),l=e.id,c=()=>{l&&o(async()=>{const h=M.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,fie(h))}catch(p){throw a({title:"Extension failed",description:Ge(p.message),variant:"error"}),p}})},u=s==="loading"?"Extending…":s==="success"?t?"Sent!":"Extension sent!":s==="error"?"Extension failed":t?"Extend":"Extend with AI",f=s==="error"?i??"Extension failed":l?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return d.jsx(ge,{content:f,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},Hie=({plan:e,disabled:t})=>{const n=M(u=>u.launchFixReview),r=M(Kr),s=M(KN),[i,o]=k.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(ge,{content:c,children:d.jsx(It,{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"})})},Gie=()=>{const e=M(o=>o.loadIdeas),t=M(o=>o.runtimeReachable),n=M(o=>o.githubConfig),[r,s]=k.useState(!1),i=async o=>{!t&&n?await fY(n,o):await qP(o),await e(),s(!1)};return d.jsxs(d.Fragment,{children:[d.jsx(ee,{icon:d.jsx(TP,{size:16}),size:"small",onClick:()=>s(!0),children:"New idea"}),d.jsx(eA,{open:r,onClose:()=>s(!1),onAdd:i})]})},Zie=({plan:e,disabled:t})=>{const n=M(m=>m.launchPrReview),r=M(Kr),s=M(KN),[i,o]=k.useState(!1),a=nA(e.id),l=async()=>{if(e.id){o(!0);try{await n(e.id)}catch(m){alert(m.message)}finally{o(!1)}}},c=t||i||!e.id||!r||!s,u=e.id?s?r?void 0:"No agent CLI found — set up in Settings":"GitHub CLI needs authentication — set up in Settings":"Plan needs an ID before an agent can run",f=!!(a!=null&&a.lastReviewedSha&&a.headSha&&a.lastReviewedSha===a.headSha),h=i?"Starting…":f?`Review again — last reviewed at ${((a==null?void 0:a.lastReviewedSha)??"").slice(0,7)}`:"Review PR",p=[a&&!a.ready&&"draft",(a==null?void 0:a.ciGreen)===!1&&"CI not green"].filter(Boolean);return d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(ge,{content:u,children:d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-blue-dark",children:"◎"}),onClick:l,disabled:c,className:`text-xs leading-4 py-2 ${c?"opacity-50":""}`,children:h})}),p.length>0&&d.jsx("div",{className:"text-2xs text-ink-300 px-2",children:p.join(" · ")})]})},qie=({plan:e,disabled:t})=>{const n=M(l=>l.launchPlanReconcile),r=M(Kr),[s,i]=k.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,uie(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(ge,{content:a,children:d.jsx(ee,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},Yie=({plan:e,disabled:t})=>{const n=M(c=>c.launchRunAll),r=M(Kr),[s,i]=k.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(ge,{content:l,children:d.jsx(It,{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"})})},Jie=({plan:e,onAdd:t,disabled:n})=>{const[r,s]=k.useState(!1),i=async()=>{s(!0);try{await t([die()])}finally{s(!1)}};return d.jsx(ge,{content:"Append a style pass against docs/CODE_STYLE.md as a phase",children:d.jsx(ee,{variant:"ghost",size:"small",onClick:i,disabled:n||r||!SY(e),children:"Style pass"})})},Qie=()=>{const e=M(w=>w.launchSuggestIdeas),t=M(w=>w.launchBatchReconcile),n=M(w=>w.launchBatchDraft),r=M(w=>w.launchPrioritise),s=M(w=>w.refreshAll),i=M(w=>w.ideaEntries),o=M(w=>w.suggestions),a=M(lh),l=M(Kr),{toast:c}=Ye(),[u,f]=k.useState(null),[h,p]=k.useState(!1),m=async()=>{f("suggest");try{await e(mie(i,o))}catch(w){c({title:"Failed to launch",description:Ge(w.message),variant:"error"})}finally{f(null)}},g=async()=>{f("reconcile");try{await t()}catch(w){c({title:"Failed to launch",description:Ge(w.message),variant:"error"})}finally{f(null)}},x=async w=>{f("draft-all");try{await n(w)}finally{f(null)}},y=async()=>{f("prioritise");try{const w=await r(),_=w.moved.length-w.annotated.length;c({title:w.moved.length>0?"Queue reordered":"Already in order",description:_>0?`${_} of ${w.moved.length} ideas could not be annotated`:w.why.join(`
|
|
424
|
+
`)||void 0,variant:_>0?"warning":"success"})}catch(w){c({title:"Failed to prioritise",description:Ge(w.message),variant:"error"}),await s()}finally{f(null)}},v=u!==null||a,b=[{id:"suggest-ideas",label:u==="suggest"?"Starting…":"Suggest ideas",icon:d.jsx($P,{size:16}),disabled:v||!l,onSelect:m},{id:"reconcile-all",label:u==="reconcile"?"Starting…":"Reconcile all",icon:d.jsx(NP,{size:16}),disabled:v||!l,onSelect:g},{id:"draft-all",label:"Draft all",icon:d.jsx(Yx,{size:16}),disabled:v||!l,onSelect:()=>p(!0)},{id:"prioritise",label:u==="prioritise"?"Prioritising…":"Prioritise queue",icon:d.jsx(D8,{size:16}),disabled:v||!l,onSelect:y}];return d.jsxs(d.Fragment,{children:[d.jsx(qx,{align:"end",trigger:d.jsx(st,{icon:d.jsx(zP,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:b}),d.jsx(Rie,{open:h,onClose:()=>p(!1),onConfirm:x})]})},Xie="font-display-luminari text-sm font-semibold opacity-[0.65]",eoe=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var x;const{thread:o,input:a,setInput:l,pending:c,promotingIndex:u,ideaPromptIndex:f,handleSend:h,handlePromote:p,handlePromoteToIdea:m,closeIdeaPrompt:g}=Yse(e,n);return d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:`${Xie} mb-3`,children:"Feedback"}),d.jsxs(ye,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[d.jsx("div",{className:"flex flex-col gap-3 mb-4",children:o.length>0||c?d.jsxs(d.Fragment,{children:[d.jsx(jie,{messages:o,undo:r,undoing:s,onUndo:i,onPromote:p,promotingIndex:u}),c&&d.jsx("div",{className:"flex flex-col gap-1 items-end",children:d.jsx("div",{className:"max-w-[85%]",children:d.jsx(ye,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:c})})}),t&&d.jsx("div",{className:"flex flex-col gap-1 items-start",children:d.jsx(ye,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:d.jsx(wr,{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(Zx,{value:a,onChange:y=>l(y.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(ee,{size:"small",onClick:h,disabled:t||!a.trim(),children:"Send"})})]})]}),d.jsx(eA,{open:f!==null,onClose:g,onAdd:m,initialContent:f!==null?(x=o[f])==null?void 0:x.text:void 0})]})},toe="font-display-luminari text-sm font-semibold opacity-[0.65]",noe=({plan:e,otherPlans:t})=>{const n=lt(),r=t.filter(s=>s.entityKind==="fix"&&s.idea===e.id);return r.length===0?null:d.jsxs("div",{className:"mb-5",children:[d.jsx("h3",{className:`${toe} mb-3`,children:"Fixes"}),d.jsx("div",{className:"flex flex-col gap-2 mb-3",children:r.map(s=>d.jsxs("button",{type:"button",onClick:()=>n($i(s)),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left text-sm",children:[d.jsx(Ws,{id:s.id}),d.jsx("span",{className:"flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),d.jsx(re,{size:"small",fillColor:hn[s.status].fill,textColor:hn[s.status].text,children:kc[s.status]})]},s.title))})]})},roe=({plan:e,otherPlans:t})=>{const n=lt(),r=e.entityKind==="ticket";if(!r&&e.entityKind!=="fix"||!e.idea)return null;const s=e.idea,i=t.find(o=>o.id===s);return d.jsx("div",{className:"mb-3",children:d.jsxs("button",{type:"button",onClick:()=>n($i(i??{id:s,title:s})),className:"flex items-center gap-2 bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left",children:[d.jsx(re,{size:"small",variant:r?"info":"warning",children:r?"ticket":"fix"}),d.jsxs("span",{className:"text-sm opacity-70",children:[r?"On board":"Fixes"," ",d.jsx("span",{className:"font-mono",children:s}),i&&` — ${i.title}`]})]})})},soe="font-display-luminari text-sm font-semibold opacity-[0.65]",ioe=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddPhases:a,ideaView:l,otherPlans:c,deliverPanel:u})=>{const f=M(g=>g.launchRunAll),h=e.fixes??[],p=h.some(g=>!g.done),m=[...e.phases.map((g,x)=>({kind:"phase",item:g,index:x})),...h.map((g,x)=>({kind:"fix",item:g,index:x}))];return d.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:d.jsx(L5,{data:m,toolbar:{title:d.jsx("h3",{className:`${soe} m-0`,children:"Phases"}),actions:d.jsxs(d.Fragment,{children:[t&&d.jsx(wr,{size:"small",label:"Audit running…"}),m.length===0&&d.jsx(rA,{idea:l}),m.length>0&&(e.status==="review"||e.status==="done")&&d.jsx(Uie,{plan:e}),m.length>0&&e.status!=="done"&&d.jsx(qie,{plan:e}),m.length>0&&d.jsx(Bie,{onAdd:a,disabled:s,entityId:e.id??e.title}),m.length>0&&d.jsx(Jie,{plan:e,onAdd:a,disabled:s}),e.id&&p&&d.jsx(ge,{content:"Run the open fixes with an agent",children:d.jsx(ee,{size:"small",onClick:()=>e.id&&f(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:m.length===0?d.jsx("div",{className:"flex justify-center py-6",children:d.jsx(QI,{idea:l,otherPlans:c,className:"font-handwritten !text-base underline"})}):u,columns:[{key:"checkbox",header:"",cell:g=>d.jsx(Pie,{row:g,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o}),width:1},{key:"title",header:"Title",cell:g=>d.jsx(Tie,{row:g,runningFill:r})},{key:"actions",header:"",align:"end",width:6,cell:g=>d.jsx(Nie,{row:g,runningFill:r,agentBusy:n,planId:e.id})}],expandable:{render:g=>{const x=g.item.run?UK(g.item.run):null;return!g.item.description&&!x?null:d.jsxs("div",{className:"flex flex-col gap-1",children:[g.item.description&&d.jsx("span",{children:g.item.description}),x&&d.jsx("span",{className:"font-mono text-3xs opacity-[0.7]",children:x})]})}},hideHeader:!0,density:"compact",showExpandColumn:!1,rowTexture:g=>{if(g.kind==="fix")return"kraft";if(g.kind==="phase"&&g.item.done)return"canvas"},rowClassName:g=>{if(sh(g,r))return"phase-running-row";if(g.kind==="phase"&&g.item.source==="review")return"bg-[rgba(155,122,181,0.08)]"},className:"phase-table-phone"})})},ooe="font-display-luminari text-sm font-semibold opacity-[0.65]",aoe=({plan:e})=>e.body?d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:`${ooe} mb-2`,children:"Description"}),d.jsx("div",{className:"opacity-[0.85]",children:d.jsx(PI,{children:e.body})})]}):null,loe=({rollup:e})=>e.runs===0?null:d.jsx("span",{className:"shrink-0",children:d.jsx(ge,{content:`${Rr(e.inputTokens)} in · ${Rr(e.outputTokens)} out · cache ${Rr(e.cacheCreationTokens)} write · ${Rr(e.cacheReadTokens)} read`,children:d.jsx(re,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:d.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[Rr(e.inputTokens+e.outputTokens)," tokens ·"," ",Jf(e.durationMs)," · ",e.runs," ",e.runs===1?"run":"runs"]})})})}),coe=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:d.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-min",children:[e!==null&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 min-w-16",children:d.jsx(XI,{pct:e.pct,color:t})}),d.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0 font-handwritten",children:[Math.round(e.pct),"%"]})]}),d.jsx(loe,{rollup:n})]}),uoe="font-display-luminari text-sm font-semibold opacity-[0.65]",doe=({plan:e,otherPlans:t})=>{const n=lt(),r=M(a=>a.loadPlans),s=t.filter(a=>a.entityKind==="ticket"&&a.idea===e.id).sort((a,l)=>(a.order??Number.POSITIVE_INFINITY)-(l.order??Number.POSITIVE_INFINITY)),i=a=>{const l=s.find(c=>c.title===a);l&&n($i(l))},o=async a=>{e.id&&(await lW({boardId:e.id,title:a}),await r())};return d.jsxs("div",{className:"mb-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h3",{className:`${uoe} m-0`,children:"Tickets"}),d.jsx(Vie,{onAdd:o,disabled:!e.id})]}),s.length>0?d.jsx(tA,{plans:s,onOpen:i}):d.jsx("p",{className:"text-sm m-0 opacity-50",children:"No tickets yet — add one to start the decomposition."})]})},foe=({planId:e,released:t,reviewing:n,reviewNote:r})=>{const s=aie(e);return e?d.jsx("div",{className:"text-xs opacity-80 shrink-0",children:s?d.jsx(Aie,{trail:s,released:t,reviewing:n,reviewNote:r}):d.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:d.jsx(sn,{variant:"text",height:32})})}):null},hoe=({plan:e})=>{const t=M(L=>L.plans),n=M(L=>L.loadPlans),{toast:r}=Ye(),{patch:s,updating:i}=wc(),o=M(L=>L.agentStatus),a=M(lh),l=M(L=>L.detailView),c=M(L=>L.taskLog),u=M(L=>L.loadTaskLog),f=ih(e.id,o),h=!!wY(e.id,o),p=kY(e.thread),m=sie(f,c),g=k.useMemo(()=>HK(c,e.id),[c,e.id]),x=(f==null?void 0:f.taskKind)==="audit",y=bY(e,(m==null?void 0:m.fraction)??0);e.phases.length>0;const v=l==="feedback",b={id:e.id??null,title:e.title,body:e.body,log:e.log},w=((t==null?void 0:t.entries)??[]).filter(L=>L.id!==e.id);k.useEffect(()=>{u()},[u]);const _=async L=>{const I=e.phases.map(($,D)=>D===L?{...$,done:!$.done}:$);I.every($=>$.done)&&e.status==="in-progress"?await s(e.title,{phases:I,status:"review"}):await s(e.title,{phases:I})},S=async L=>{await s(e.title,{phases:[...e.phases,...L]})},j=async L=>{const I=(e.fixes??[]).map(($,D)=>D===L?{...$,done:!$.done}:$);I.every($=>$.done)&&e.status==="in-progress"?await s(e.title,{fixes:I,status:"review"}):await s(e.title,{fixes:I})},{sending:E,send:T,undo:P,undoing:N,undoEdit:R}=iie(e,{reload:n,notify:r});return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2",children:[d.jsxs("h2",{className:`${Fie} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[d.jsx(Ws,{id:e.id}),e.title]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-handwritten",children:[d.jsxs("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:[d.jsx("span",{className:"max-[480px]:hidden",children:e.updated?"updated ":"created "}),Wg(e.updated??e.created)]}),d.jsx(AI,{})]})]}),d.jsx(roe,{plan:e,otherPlans:w}),d.jsxs("div",{className:"flex items-center gap-x-4 gap-y-1 flex-wrap mb-3",children:[d.jsx(foe,{planId:e.id,released:e.released,reviewing:h,reviewNote:p}),!v&&d.jsx(coe,{progress:y,color:qI[oh(e,o)],rollup:g})]}),v?d.jsx(eoe,{plan:e,updating:E,onSend:T,undo:P,undoing:N,onUndo:R}):d.jsxs(d.Fragment,{children:[e.entityKind==="board"?d.jsx(doe,{plan:e,otherPlans:w}):d.jsx(ioe,{plan:e,auditRunning:x,agentBusy:a,runningFill:m,updating:i,onTogglePhase:_,onToggleFix:j,onAddPhases:S,ideaView:b,otherPlans:w,deliverPanel:d.jsx(zie,{plan:e})}),d.jsx(noe,{plan:e,otherPlans:w}),d.jsx(Oie,{clarifications:e.clarifications??[]}),d.jsx(aoe,{plan:e})]})]})},poe="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",D1="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",moe="font-handwritten text-xs font-semibold opacity-55 leading-none",O1=`${poe} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,goe=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],sA="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",iA="overflow-hidden text-ellipsis whitespace-nowrap",yoe=()=>{const e=M(n=>n.planFilters.groupBySubject),t=M(n=>n.toggleGroupBySubject);return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:moe,children:"Group by subject"}),d.jsx(Zd,{size:"small",checked:e,onChange:t,"aria-label":"Group by subject"})]})},xoe=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=Jo,{roadmapItemNames:i,navigate:o,sortKey:a,sortDirection:l,handleSort:c,groups:u,showSubjectHeaders:f,sortReflectsRows:h}=xie(e),p=m=>m.type==="plan"?d.jsx(tA,{plans:[m.plan],activePlanTitle:t,onOpen:n},m.plan.title):m.type==="note"?d.jsx(voe,{row:m,onOpen:r},m.idea.title):d.jsx(woe,{row:m,activePlanTitle:t,onOpen:n},m.fix.title);return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":h&&a==="order"?l==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:O1,"aria-label":"Sort by run order",onClick:()=>c("order"),children:["#",a==="order"&&(l==="asc"?"▲":"▼")]})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(ye,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsx("div",{className:s,children:goe.map(({key:m,label:g})=>{const x=m===a;return d.jsx("span",{role:"columnheader",className:m==="updated"?"max-lg:hidden":void 0,"aria-sort":h&&x?l==="asc"?"ascending":"descending":void 0,children:d.jsxs("button",{type:"button",className:O1,onClick:()=>c(m),children:[g,x&&(l==="asc"?" ▲":" ▼")]})},m)})})})})]}),f?u.map(m=>{const g=m.subject;return d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"flex items-baseline gap-2",children:g&&i.has(g)?d.jsx("button",{type:"button",className:`${D1} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>o({to:"/roadmap",search:{item:g}}),children:g}):d.jsx("div",{className:D1,children:g??"No subject"})}),m.rows.map(x=>p(x))]},g??"__no-subject__")}):e.map(m=>p(m))]})},voe=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return d.jsxs("div",{className:"flex items-center",children:[d.jsx(mh,{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(ye,{size:"small",texture:"canvas",className:"plan-row-card",children:d.jsxs("div",{className:Jo,children:[n.id?d.jsx(Ws,{id:n.id}):d.jsx("span",{}),d.jsxs("span",{className:`${sA} [cursor:inherit]`,children:[d.jsx(Yx,{}),d.jsx("span",{className:iA,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(re,{size:"small",fillColor:uf[r].fill,textColor:uf[r].text,children:YI[r]})]})})})]})},boe="grid grid-cols-[76px_minmax(0,1fr)_112px] gap-2.5 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",woe=({row:e,activePlanTitle:t,onOpen:n})=>{const r=M(o=>o.agentStatus),s=e.fix,i=oh(s,r);return d.jsxs("div",{className:"flex items-center",children:[d.jsx(mh,{order:s.order,done:s.status==="done",status:s.status,running:!!ih(s.id,r),fallback:s.statusFallback}),d.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(s.title):void 0,onKeyDown:n?o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(s.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${s.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:d.jsx(ye,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:boe,children:[d.jsx(Ws,{id:s.id}),d.jsxs("span",{className:`${sA} [cursor:inherit]`,children:[d.jsx(re,{size:"small",variant:"warning",children:"fix"}),d.jsx("span",{className:iA,children:s.title}),s.idea&&d.jsxs("span",{className:"text-xs opacity-45 whitespace-nowrap font-mono",children:["→ ",s.idea]})]}),d.jsx(re,{size:"small",fillColor:hn[i].fill,textColor:hn[i].text,children:kc[i]})]})})})]})},koe=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=k.useRef(null);return k.useEffect(()=>{var o;if(!t)return;const i=(o=s.current)==null?void 0:o.querySelector(".plan-row-highlighted");i==null||i.scrollIntoView({behavior:"smooth",block:"center"})},[t]),d.jsx("div",{ref:s,children:e.length>0?d.jsx(xoe,{rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r}):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."})})},_oe=({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(Ws,{id:e.id??void 0}),e.title,e.status&&d.jsx(re,{size:"small",fillColor:uf[e.status].fill,textColor:uf[e.status].text,children:YI[e.status]})]}),d.jsx(PI,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),d.jsx("div",{className:"mt-6",children:d.jsx(rA,{idea:e})})]}),Soe=e=>{const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null},nm="__no-subject__",z1="pc-row-label font-handwritten text-xs font-semibold opacity-[0.45]",Coe=()=>{var O,V;const e=ph(),t=M(lh),n=M(C=>C.agentStatus),r=M(C=>C.gitBranch),{patch:s,updating:i}=wc(),{subjects:o,available:a}=$I(),l=M(C=>C.detailView),c=M(C=>C.setDetailView),u=M(C=>C.archiveIdeas),{toast:f}=Ye(),[h,p]=k.useState(""),[m,g]=k.useState(!1);if(k.useEffect(()=>{p((e==null?void 0:e.order)!==void 0?String(e==null?void 0:e.order):"")},[e==null?void 0:e.order]),!e)return null;const x=oh(e,n),y=e.status==="in-progress",v=e.status==="review",b=e.status==="dropped",w=e.status==="done",_=e.phases.some(C=>!C.done),S=(e.status==="planned"||y)&&_,j=_Y(e),E=e.id!==void 0&&Soe(r)===e.id,T=e.entityKind!=="board"&&(e.status==="planned"||y||v)&&!E,P=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),N=((O=e.pr)==null?void 0:O.state)==="open"||((V=e.pr)==null?void 0:V.state)==="draft",R=a&&e.subject&&!o.includes(e.subject)?e.subject:void 0,L=C=>s(e.title,C),I=async()=>{if(e.id){g(!0);try{await u([e.id])}catch(C){f({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},z=async()=>{if(e.id){g(!0);try{if(e.entityKind!=="board"){const C=await o9(e.id);if(!C.ready){f({title:"Not ready to complete idea",description:`Waiting on ${C.missing.join(", ")}`,variant:"error"});return}}await u([e.id])}catch(C){f({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},$=y||v||e.status==="planned",D=async()=>{const C=h.trim(),U=Number(C);if(C===""||!Number.isInteger(U)||U<1){p(e.order!==void 0?String(e.order):"");return}U!==e.order&&await L({order:U})};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{children:d.jsxs("div",{className:"flex flex-col",children:[d.jsx(It,{size:"small",active:l==="details",onClick:()=>c("details"),className:"pc-row text-xs",children:"Details"}),d.jsx(It,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"pc-row text-xs",children:"Feedback"})]})}),d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(re,{size:"small",fillColor:hn[x].fill,textColor:hn[x].text,children:kc[x]})}),d.jsxs("div",{children:[d.jsx("div",{className:z1,children:"Subject"}),d.jsx("div",{className:"h-[32px] flex items-center",children:d.jsx(NV,{className:"w-full",size:"small",value:e.subject??nm,onChange:C=>L({subject:C===nm?null:C}),disabled:i||!a,options:[{value:nm,label:"No subject"},...R?[{value:R,label:`${R} (orphan)`}]:[],...!a&&e.subject&&!R?[{value:e.subject,label:e.subject}]:[],...o.map(C=>({value:C,label:C}))]})})]}),$&&d.jsxs("div",{className:"flex items-center justify-between h-[64px]",children:[d.jsx("div",{className:z1,children:"Order"}),d.jsx(nt,{type:"number",size:"small","aria-label":"Run order",min:1,value:h,onChange:C=>p(C.target.value),onBlur:D,disabled:i,className:"w-20"})]}),d.jsx(ye,{size:"small",texture:"kraft",children:d.jsxs("div",{className:"flex flex-col",children:[T&&d.jsx(Kie,{plan:e,disabled:t||i}),S&&d.jsx(Yie,{plan:e,disabled:t||i}),P&&d.jsx(Hie,{plan:e,disabled:t||i}),N&&d.jsx(Zie,{plan:e,disabled:t||i}),v&&e.pr&&d.jsx(Wie,{plan:e,disabled:t||i}),w&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:I,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),j&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:z,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Completing…":"Complete idea"}),!w&&d.jsx(It,{size:"small",icon:d.jsx("span",{className:b?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:b?"↺":"⊘"}),onClick:()=>L({status:b?null:"dropped"}),disabled:i,className:`pc-row text-xs ${i?"opacity-50":""}`,children:b?"Reopen plan":"Mark dropped"})]})})]})},joe=["in-progress","review","planned","idea","done","dropped"],Eoe=()=>{const e=M(h=>h.plans),t=ph(),n=M(h=>h.planFilters),r=M(h=>h.togglePlanStatus),s=M(h=>h.setPlanSearch),i=M(h=>h.setSubjectFilter),o=lt();if(!e||t)return null;const{statusCounts:a}=dl(e.entries,n),{statusCounts:l}=dl(e.entries),c=new Set(n.statuses),u=joe.filter(h=>l[h]>0);return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{className:"h-[64px] flex items-center",children:d.jsx(nt,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:h=>s(h.target.value)})}),n.subject!==null&&d.jsxs("div",{className:"flex items-center gap-2 h-[32px]","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:"bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",children:"Clear"})]}),d.jsx("div",{children:d.jsx("div",{className:"flex flex-col",children:u.map(h=>{const p=c.has(h);return d.jsx(It,{size:"small",active:p,onClick:()=>r(h),className:"pc-row text-xs",icon:d.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:hn[h].text}}),action:d.jsx("span",{className:"text-2xs text-ink-500",children:a[h]}),children:kc[h]},h)})})})]})},F1=({showGroupingToggle:e=!1})=>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"}),e&&d.jsx(yoe,{}),d.jsx(Gie,{}),d.jsx(Qie,{})]}),Poe=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],Toe=()=>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(ye,{size:"small",texture:"kraft",className:"plan-row-card",children:d.jsxs("div",{className:Jo,children:[d.jsx(sn,{variant:"text",width:28}),d.jsx(sn,{variant:"text",width:44}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(sn,{variant:"text",width:56})}),d.jsx(sn,{variant:"text",width:64}),d.jsx(sn,{variant:"text",width:48})]})})})]}),Poe.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(sn,{variant:"text",width:16})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(ye,{size:"small",className:"plan-row-card",children:d.jsxs("div",{className:Jo,children:[d.jsx(sn,{variant:"rect",width:44,height:18}),d.jsx(sn,{variant:"text",width:e.title}),d.jsx("span",{className:"max-lg:hidden",children:d.jsx(sn,{variant:"text",width:52})}),d.jsx(sn,{variant:"rect",width:80,height:8}),d.jsx(sn,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),Noe=()=>{const e=M(u=>u.reconcileQueue),t=M(u=>u.removeFromReconcileQueue),n=M(u=>u.plans),{patch:r}=wc(),{toast:s}=Ye(),i=k.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(k.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),k.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(Mie,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},Ioe=({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(ye,{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(FP,{}),d.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),d.jsx(st,{icon:d.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),Zv=()=>{const{plans:e,plansError:t,ideaEntries:n,suggestions:r,planFilters:s,activePlan:i,activeIdea:o,planId:a,ideaId:l,openSuggestion:c,setOpenSuggestion:u,handleOpenPlan:f,handleOpenIdea:h,handleOpenArchivable:p,handleDismissSuggestion:m}=Jse();if(t)return d.jsxs("div",{children:[d.jsx(BI,{children:"Plans"}),d.jsxs(ye,{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 a||l?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(F1,{}),d.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),d.jsx(Toe,{})]});const{rows:g}=MY(e.entries,n,s);return d.jsxs(d.Fragment,{children:[d.jsx(Noe,{}),i?d.jsx("div",{children:d.jsx(hoe,{plan:i})}):o?d.jsx("div",{children:d.jsx(_oe,{idea:o})}):d.jsxs("div",{children:[d.jsx(F1,{showGroupingToggle:e.entries.length>0}),e.warnings.length>0&&d.jsxs(ye,{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(x=>d.jsxs("li",{children:[x.title,": ",x.message]},x.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(koe,{rows:g,activePlanTitle:null,onOpenPlan:f,onOpenIdea:h}),d.jsx($ie,{onOpen:p}),d.jsx(Ioe,{suggestions:r,onOpen:u,onDismiss:m}),d.jsx(Lie,{suggestion:c,onClose:()=>u(null)})]})]})},cy="/projects",Aoe=[cy],uy=[{id:"plans",label:"Plans",path:"/"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"issues",label:"Issues",path:"/issues"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],B1=({item:e})=>d.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),V1=()=>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"})}),Roe=224,Loe=480,Moe=495,$oe=Roe+Moe+Loe,Doe=`(min-width: ${$oe}px)`;function Ooe(e,t,n={githubConfigured:!1}){return e===void 0||e==="client"||e==="corpus"&&n.githubConfigured?"ready":t.checking?"checking":t.reachable?"ready":"unreachable"}function zoe(e){const[t,n]=k.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return k.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}function Foe(e){return e.filter(t=>t.kind!=="question")}function Boe(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function Voe(){const e=M(r=>r.notifications),t=M(r=>r.loadNotifications),n=k.useRef(null);k.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),k.useEffect(()=>{if(!e)return;const r=Foe(e),s=Boe(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]),k.useEffect(()=>{let r;const s=vc(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const oA="stack-open";function Uoe(){try{return localStorage.getItem(oA)==="true"}catch{return!1}}function Woe(e){try{localStorage.setItem(oA,String(e))}catch{}}function Koe(){var z;const e=lt(),t=Eb({select:$=>$.location.pathname}),n=M($=>$.loadPlans),r=M($=>$.loadIdeas),s=M($=>$.loadSuggestions),i=M($=>$.loadCapabilities),o=M($=>$.loadAgentAuthStatus),a=M($=>$.loadParkedQuestions),l=M($=>$.loadNotifications),c=M($=>$.setActiveDocTitle),u=M($=>$.checkRuntimeReachable),f=M($=>$.runtimeReachable),h=M($=>$.runtimeChecking),p=M($=>$.githubConfig),m=Eb({select:$=>{var D;return(D=$.matches.at(-1))==null?void 0:D.staticData.layer}}),g=Ooe(m,{reachable:f,checking:h},{githubConfigured:p!==null}),x=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),y=t==="/docs"||t.startsWith("/docs/"),v=t==="/settings"||t.startsWith("/settings/"),b=t==="/roadmap",w=t==="/git",_=x?"plans":y?"docs":v?"settings":(z=uy.find($=>$.path===t))==null?void 0:z.id,S=x||y||v||b||w,j=x?"plans":y?"docs":v?"settings":b?"roadmap":"git",[E,T]=k.useState(Uoe),[P,N]=k.useState(!1),R=zoe(Doe),L=k.useRef(!1);Voe(),k.useEffect(()=>{s(),i(),o(),a(),l(),u()},[s,i,o,a,l,u]),k.useEffect(()=>{h||(n(),r())},[h,n,r]),k.useEffect(()=>{L.current||t!=="/"||(L.current=!0,Promise.all([qd(),WP()]).then(([$,D])=>{if(!($!=null&&$.setupDismissed)&&D!==null&&!D.every(O=>O.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([ZP(),YP()]).then(([O,V])=>{O.entries.length>1||V.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),k.useEffect(()=>{N(!1)},[t]);const I=()=>{const $=!E;Woe($),T($)};return{navigate:e,pathname:t,activeLayer:m,readiness:g,activeId:_,hasSidebar:S,sidebarAreaKey:j,isPlansArea:x,isDocsArea:y,isSettingsArea:v,isRoadmapArea:b,isGitArea:w,isInHub:Aoe.includes(t),stackOpen:E,toggleStack:I,isLarge:R,mobileSidebarOpen:P,openMobileSidebar:()=>N(!0),closeMobileSidebar:()=>N(!1)}}const Hoe=k.lazy(()=>$n(()=>import("./index-15mPrQq0.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsSidebar}))),Goe=k.lazy(()=>$n(()=>import("./index-DdZYRgzN.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsSidebar}))),Zoe=k.lazy(()=>$n(()=>import("./index-BBvcyiG4.js"),[]).then(e=>({default:e.RoadmapSidebar}))),qoe=k.lazy(()=>$n(()=>import("./index-81fEepOO.js"),[]).then(e=>({default:e.GitFileList}))),Yoe=()=>{const{navigate:e,activeLayer:t,readiness:n,activeId:r,hasSidebar:s,sidebarAreaKey:i,isPlansArea:o,isDocsArea:a,isSettingsArea:l,isRoadmapArea:c,isGitArea:u,isInHub:f,stackOpen:h,toggleStack:p,isLarge:m,mobileSidebarOpen:g,openMobileSidebar:x,closeMobileSidebar:y}=Koe();return f?d.jsx(uk,{position:"bottom-left",children:d.jsx(tse,{children:d.jsx(eg,{})})}):d.jsxs(uk,{position:"bottom-left",children:[d.jsxs("div",{className:"h-screen box-border flex flex-col",children:[d.jsxs("div",{className:"shrink-0 min-[1199px]:pr-[var(--pc-stack-width)]",children:[d.jsx(zre,{}),d.jsxs("header",{className:"pc-app-header flex items-center gap-3 h-[var(--pc-header-h)] max-[480px]:hidden",style:Kx({texture:"parchment",shade:!0}),children:[s&&d.jsx(st,{variant:"ghost",size:"small",className:"lg:hidden",label:"Open sidebar",onClick:x,icon:d.jsx(V1,{})}),d.jsx($re,{}),d.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 ml-auto",children:uy.map(v=>d.jsx(ee,{variant:"ghost",size:"small",isActive:v.id===r,onClick:()=>e({to:v.path}),"aria-current":v.id===r?"page":void 0,children:d.jsx(B1,{item:v})},v.id))})]}),d.jsx(Xre,{})]}),d.jsx(EP,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"paper"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,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)]",children:d.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full min-h-full",children:[s&&d.jsxs(Fre,{routeKey:i,mobileOpen:g,onMobileClose:y,children:[o&&d.jsxs(d.Fragment,{children:[d.jsx(Eoe,{}),d.jsx(Coe,{})]}),a&&d.jsx(k.Suspense,{fallback:null,children:d.jsx(Hoe,{})}),l&&d.jsx(k.Suspense,{fallback:null,children:d.jsx(Goe,{})}),c&&d.jsx(k.Suspense,{fallback:null,children:d.jsx(Zoe,{})}),u&&d.jsx(k.Suspense,{fallback:null,children:d.jsx(qoe,{})})]}),d.jsx("div",{className:"relative flex flex-col min-w-0 flex-[1_1_0%]",children:d.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:d.jsx(Gx,{texture:{texture:"paper"},rounded:"none",className:"pc-page w-full max-w-none",children:n==="unreachable"?d.jsx(Ore,{layer:t}):n==="checking"?null:d.jsxs(k.Suspense,{fallback:null,children:[d.jsx(ese,{}),d.jsx(eg,{})]})})})})]})})})})]}),d.jsx(Mre,{open:h,pinned:m,onToggle:p}),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:[s&&d.jsx(st,{variant:"ghost",size:"small",label:"Open sidebar",onClick:x,icon:d.jsx(V1,{}),className:"min-h-11"}),uy.map(v=>d.jsx(ee,{variant:"ghost",size:"small",isActive:v.id===r,onClick:()=>e({to:v.path}),"aria-current":v.id===r?"page":void 0,className:"min-h-11",children:d.jsx(B1,{item:v})},v.id))]})]})},aA=k.lazy(()=>$n(()=>import("./index-15mPrQq0.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsPage}))),lA=k.lazy(()=>$n(()=>import("./index-DdZYRgzN.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsPage}))),Joe=k.lazy(()=>$n(()=>import("./index-cCrMJylm.js"),[]).then(e=>({default:e.TasksPage}))),Qoe=k.lazy(()=>$n(()=>import("./index-BBvcyiG4.js"),[]).then(e=>({default:e.RoadmapPage}))),Xoe=k.lazy(()=>$n(()=>import("./index-CbsAL0YR.js"),[]).then(e=>({default:e.StatsPage}))),eae=k.lazy(()=>$n(()=>import("./index-81fEepOO.js"),[]).then(e=>({default:e.GitPage}))),tae=k.lazy(()=>$n(()=>import("./index-BVj9hjpY.js"),[]).then(e=>({default:e.InboxPage}))),nae=k.lazy(()=>$n(()=>import("./index-BJqS77OS.js"),[]).then(e=>({default:e.IssuesPage}))),Et=CM({component:Yoe}),rae=Ot({getParentRoute:()=>Et,path:"/projects",component:Fse,staticData:{layer:"client"}}),sae=Ot({getParentRoute:()=>Et,path:"/",component:Zv,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0}),staticData:{layer:"corpus"}}),iae=Ot({getParentRoute:()=>Et,path:"/plans/$planId",beforeLoad:({params:e})=>{throw aj({to:"/ideas/$ideaId",params:{ideaId:cf(e.planId)??e.planId}})}}),oae=Ot({getParentRoute:()=>Et,path:"/ideas/$ideaId",component:Zv,staticData:{layer:"corpus"}}),aae=Ot({getParentRoute:()=>Et,path:"/ideas/$ideaId/tickets/$ticketId",component:Zv,staticData:{layer:"corpus"}}),lae=Ot({getParentRoute:()=>Et,path:"/docs",component:aA,staticData:{layer:"runtime"}}),cae=Ot({getParentRoute:()=>Et,path:"/docs/$section",component:aA,staticData:{layer:"runtime"}}),uae=Ot({getParentRoute:()=>Et,path:"/settings",component:lA,staticData:{layer:"runtime"}}),dae=Ot({getParentRoute:()=>Et,path:"/settings/$section",component:lA,staticData:{layer:"runtime"}}),fae=Ot({getParentRoute:()=>Et,path:"/roadmap",component:Qoe,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0}),staticData:{layer:"runtime"}}),hae=Ot({getParentRoute:()=>Et,path:"/inbox",component:tae,staticData:{layer:"runtime"}}),pae=Ot({getParentRoute:()=>Et,path:"/stats",component:Xoe,staticData:{layer:"runtime"}}),mae=Ot({getParentRoute:()=>Et,path:"/git",component:eae,staticData:{layer:"runtime"}}),gae=Ot({getParentRoute:()=>Et,path:"/tasks",component:Joe,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0}),staticData:{layer:"runtime"}}),yae=Ot({getParentRoute:()=>Et,path:"/issues",component:nae,staticData:{layer:"runtime"}}),xae=Et.addChildren([sae,rae,iae,oae,aae,lae,cae,uae,dae,gae,yae,fae,pae,hae,mae]),vae=$M({routeTree:xae,basepath:Li||"/"}),{runtimeUrl:df,pairingToken:dy}=WN;Z8(df||Li);q8(dy);const bae=15e3;async function wae(){!df||!dy||await fetch(K("/api/pair"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:dy}),signal:AbortSignal.timeout(bae)}).catch(()=>{})}const cA=document.getElementById("root");if(!cA)throw new Error("#root element not found");async function kae(){return nse(Li,df,JP()!==null)?!0:rse(df,e=>J(K(e)))}wae().then(kae).catch(()=>!1).then(e=>{!e&&!window.location.pathname.startsWith(cy)&&window.history.replaceState(null,"",`${Li}${cy}`),tj(cA).render(d.jsx(k.StrictMode,{children:d.jsx(zM,{router:vae})}))});export{ge as $,Tae as A,st as B,Ye as C,Nae as D,Go as E,Zd as F,wr as G,IP as H,vre as I,ee as J,Ao as K,Wae as L,PI as M,fx as N,Dae as O,BI as P,MI as Q,ye as R,Bae as S,zae as T,Vae as U,Uae as V,Fs as W,Oae as X,Kae as Y,Ge as Z,N1 as _,lt as a,kc as a0,hn as a1,lie as a2,K8 as a3,Yp as a4,Vre as a5,Jf as a6,x6 as a7,Rr as a8,bc as a9,HI as aa,Use as ab,X8 as ac,Aae as ad,vc as ae,Eae as af,Pae as ag,PP as ah,U8 as ai,WJ as aj,VJ as ak,Ws as al,iie as am,mc as an,gc as ao,jie as ap,Zx as aq,Pv as ar,bW as as,$ae as at,tre as b,K as c,Fie as d,LP as e,Fae as f,re as g,Yne as h,nt as i,d as j,qd as k,nre as l,Mae as m,Iae as n,Rae as o,It as p,Lae as q,k as r,b9 as s,jae as t,M as u,$I as v,Zo as w,NV as x,oc as y,H8 as z};
|
|
425
|
+
//# sourceMappingURL=main-CpTKYLW_.js.map
|