@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.
Files changed (71) hide show
  1. package/dist/app/assets/{index-SD_x9Z5F.js → index-15mPrQq0.js} +2 -2
  2. package/dist/app/assets/{index-SD_x9Z5F.js.map → index-15mPrQq0.js.map} +1 -1
  3. package/dist/app/assets/{index-DG2ri3IF.js → index-81fEepOO.js} +3 -3
  4. package/dist/app/assets/{index-DG2ri3IF.js.map → index-81fEepOO.js.map} +1 -1
  5. package/dist/app/assets/{index-mmzETz6G.js → index-BBvcyiG4.js} +3 -3
  6. package/dist/app/assets/{index-mmzETz6G.js.map → index-BBvcyiG4.js.map} +1 -1
  7. package/dist/app/assets/index-BJqS77OS.js +2 -0
  8. package/dist/app/assets/{index-Do4T60UL.js.map → index-BJqS77OS.js.map} +1 -1
  9. package/dist/app/assets/index-BVj9hjpY.js +2 -0
  10. package/dist/app/assets/{index-DxehIB14.js.map → index-BVj9hjpY.js.map} +1 -1
  11. package/dist/app/assets/index-CbsAL0YR.js +2 -0
  12. package/dist/app/assets/{index-DePKcR5b.js.map → index-CbsAL0YR.js.map} +1 -1
  13. package/dist/app/assets/index-DdZYRgzN.js +2 -0
  14. package/dist/app/assets/index-DdZYRgzN.js.map +1 -0
  15. package/dist/app/assets/index-cCrMJylm.js +3 -0
  16. package/dist/app/assets/index-cCrMJylm.js.map +1 -0
  17. package/dist/app/assets/main-CpTKYLW_.js +425 -0
  18. package/dist/app/assets/main-CpTKYLW_.js.map +1 -0
  19. package/dist/app/assets/main-iyjvjZKW.css +1 -0
  20. package/dist/app/assets/{sidebar-section-RSOrdZKe.js → sidebar-section-DsDt34HB.js} +2 -2
  21. package/dist/app/assets/{sidebar-section-RSOrdZKe.js.map → sidebar-section-DsDt34HB.js.map} +1 -1
  22. package/dist/app/index.html +2 -2
  23. package/dist/app/toolbar.js +3176 -3113
  24. package/dist/app/toolbar.js.map +1 -1
  25. package/dist/chunks/dev-port.BHJn90Pm.js +52 -0
  26. package/dist/chunks/dev-port.BHJn90Pm.js.map +1 -0
  27. package/dist/chunks/{phase-progress.DvktSTIz.js → machine-registry.BdaWfuyz.js} +1450 -1350
  28. package/dist/chunks/machine-registry.BdaWfuyz.js.map +1 -0
  29. package/dist/cli/index.js +8284 -7777
  30. package/dist/cli/index.js.map +1 -1
  31. package/dist/core/desk-discovery/evidence.d.ts +21 -0
  32. package/dist/core/desk-discovery/evidence.d.ts.map +1 -0
  33. package/dist/core/desk-discovery/evidence.test.d.ts +2 -0
  34. package/dist/core/desk-discovery/evidence.test.d.ts.map +1 -0
  35. package/dist/core/index.d.ts +1 -0
  36. package/dist/core/index.d.ts.map +1 -1
  37. package/dist/core/index.js +123 -114
  38. package/dist/core/machine-registry/index.d.ts +2 -0
  39. package/dist/core/machine-registry/index.d.ts.map +1 -0
  40. package/dist/core/machine-registry/machine-registry.d.ts +39 -0
  41. package/dist/core/machine-registry/machine-registry.d.ts.map +1 -0
  42. package/dist/core/machine-registry/machine-registry.test.d.ts +2 -0
  43. package/dist/core/machine-registry/machine-registry.test.d.ts.map +1 -0
  44. package/dist/core/parse/schemas.d.ts +8 -0
  45. package/dist/core/parse/schemas.d.ts.map +1 -1
  46. package/dist/core/tailnet.d.ts +14 -0
  47. package/dist/core/tailnet.d.ts.map +1 -0
  48. package/dist/core/tailnet.test.d.ts +2 -0
  49. package/dist/core/tailnet.test.d.ts.map +1 -0
  50. package/dist/types/index.d.ts +17 -1
  51. package/dist/types/index.d.ts.map +1 -1
  52. package/dist/types/index.js +19 -17
  53. package/dist/types/index.js.map +1 -1
  54. package/dist/vite/index.js +44 -51
  55. package/dist/vite/index.js.map +1 -1
  56. package/dist/vite/proxy.d.ts +2 -1
  57. package/dist/vite/proxy.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/dist/app/assets/index-BHPCJror.js +0 -3
  60. package/dist/app/assets/index-BHPCJror.js.map +0 -1
  61. package/dist/app/assets/index-D_2SBGCS.js +0 -2
  62. package/dist/app/assets/index-D_2SBGCS.js.map +0 -1
  63. package/dist/app/assets/index-DePKcR5b.js +0 -2
  64. package/dist/app/assets/index-Do4T60UL.js +0 -2
  65. package/dist/app/assets/index-DxehIB14.js +0 -2
  66. package/dist/app/assets/main-DiplEwD3.js +0 -425
  67. package/dist/app/assets/main-DiplEwD3.js.map +0 -1
  68. package/dist/app/assets/main-DoJre3S-.css +0 -1
  69. package/dist/chunks/dev-port.DgdJE2bY.js +0 -43
  70. package/dist/chunks/dev-port.DgdJE2bY.js.map +0 -1
  71. package/dist/chunks/phase-progress.DvktSTIz.js.map +0 -1
@@ -1,425 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-SD_x9Z5F.js","assets/sidebar-section-RSOrdZKe.js","assets/index-D_2SBGCS.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 td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D1={exports:{}},cf={},O1={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 ql=Symbol.for("react.element"),rA=Symbol.for("react.portal"),sA=Symbol.for("react.fragment"),iA=Symbol.for("react.strict_mode"),oA=Symbol.for("react.profiler"),aA=Symbol.for("react.provider"),lA=Symbol.for("react.context"),cA=Symbol.for("react.forward_ref"),uA=Symbol.for("react.suspense"),dA=Symbol.for("react.memo"),fA=Symbol.for("react.lazy"),Jv=Symbol.iterator;function hA(e){return e===null||typeof e!="object"?null:(e=Jv&&e[Jv]||e["@@iterator"],typeof e=="function"?e:null)}var z1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F1=Object.assign,B1={};function Zo(e,t,n){this.props=e,this.context=t,this.refs=B1,this.updater=n||z1}Zo.prototype.isReactComponent={};Zo.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")};Zo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function V1(){}V1.prototype=Zo.prototype;function cy(e,t,n){this.props=e,this.context=t,this.refs=B1,this.updater=n||z1}var uy=cy.prototype=new V1;uy.constructor=cy;F1(uy,Zo.prototype);uy.isPureReactComponent=!0;var Qv=Array.isArray,U1=Object.prototype.hasOwnProperty,dy={current:null},W1={key:!0,ref:!0,__self:!0,__source:!0};function H1(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)U1.call(t,r)&&!W1.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:ql,type:e,key:i,ref:o,props:s,_owner:dy.current}}function pA(e,t){return{$$typeof:ql,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function fy(e){return typeof e=="object"&&e!==null&&e.$$typeof===ql}function mA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Xv=/\/+/g;function ph(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mA(""+e.key):t.toString(36)}function _u(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 ql:case rA:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+ph(o,0):r,Qv(s)?(n="",e!=null&&(n=e.replace(Xv,"$&/")+"/"),_u(s,t,n,"",function(c){return c})):s!=null&&(fy(s)&&(s=pA(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Xv,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Qv(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+ph(i,a);o+=_u(i,t,n,l,s)}else if(l=hA(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+ph(i,a++),o+=_u(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 Ec(e,t,n){if(e==null)return e;var r=[],s=0;return _u(e,r,"","",function(i){return t.call(n,i,s++)}),r}function gA(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},Su={transition:null},yA={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:Su,ReactCurrentOwner:dy};function K1(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:Ec,forEach:function(e,t,n){Ec(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ec(e,function(){t++}),t},toArray:function(e){return Ec(e,function(t){return t})||[]},only:function(e){if(!fy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ue.Component=Zo;ue.Fragment=sA;ue.Profiler=oA;ue.PureComponent=cy;ue.StrictMode=iA;ue.Suspense=uA;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yA;ue.act=K1;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=F1({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=dy.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)U1.call(t,l)&&!W1.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:ql,type:e.type,key:s,ref:i,props:r,_owner:o}};ue.createContext=function(e){return e={$$typeof:lA,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aA,_context:e},e.Consumer=e};ue.createElement=H1;ue.createFactory=function(e){var t=H1.bind(null,e);return t.type=e,t};ue.createRef=function(){return{current:null}};ue.forwardRef=function(e){return{$$typeof:cA,render:e}};ue.isValidElement=fy;ue.lazy=function(e){return{$$typeof:fA,_payload:{_status:-1,_result:e},_init:gA}};ue.memo=function(e,t){return{$$typeof:dA,type:e,compare:t===void 0?null:t}};ue.startTransition=function(e){var t=Su.transition;Su.transition={};try{e()}finally{Su.transition=t}};ue.unstable_act=K1;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";O1.exports=ue;var k=O1.exports;const Io=lf(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 xA=k,vA=Symbol.for("react.element"),wA=Symbol.for("react.fragment"),bA=Object.prototype.hasOwnProperty,kA=xA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_A={key:!0,ref:!0,__self:!0,__source:!0};function G1(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)bA.call(t,r)&&!_A.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:vA,type:e,key:i,ref:o,props:s,_owner:kA.current}}cf.Fragment=wA;cf.jsx=G1;cf.jsxs=G1;D1.exports=cf;var f=D1.exports,Z1={exports:{}},pn={},q1={exports:{}},Y1={};/**
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(M,V){var C=M.length;M.push(V);e:for(;0<C;){var U=C-1>>>1,Q=M[U];if(0<s(Q,V))M[U]=V,M[C]=Q,C=U;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var V=M[0],C=M.pop();if(C!==V){M[0]=C;e:for(var U=0,Q=M.length,I=Q>>>1;U<I;){var ge=2*(U+1)-1,ke=M[ge],ve=ge+1,Qt=M[ve];if(0>s(ke,C))ve<Q&&0>s(Qt,ke)?(M[U]=Qt,M[ve]=C,U=ve):(M[U]=ke,M[ge]=C,U=ge);else if(ve<Q&&0>s(Qt,C))M[U]=Qt,M[ve]=C,U=ve;else break e}}return V}function s(M,V){var C=M.sortIndex-V.sortIndex;return C!==0?C:M.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,d=null,h=3,p=!1,m=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=M)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function b(M){if(g=!1,w(M),!m)if(n(l)!==null)m=!0,F(_);else{var V=n(c);V!==null&&O(b,V.startTime-M)}}function _(M,V){m=!1,g&&(g=!1,y(E),E=-1),p=!0;var C=h;try{for(w(V),d=n(l);d!==null&&(!(d.expirationTime>V)||M&&!N());){var U=d.callback;if(typeof U=="function"){d.callback=null,h=d.priorityLevel;var Q=U(d.expirationTime<=V);V=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&r(l),w(V)}else r(l);d=n(l)}if(d!==null)var I=!0;else{var ge=n(c);ge!==null&&O(b,ge.startTime-V),I=!1}return I}finally{d=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 A(){if(j!==null){var M=e.unstable_now();P=M;var V=!0;try{V=j(!0,M)}finally{V?R():(S=!1,j=null)}}else S=!1}var R;if(typeof x=="function")R=function(){x(A)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,D=$.port2;$.port1.onmessage=A,R=function(){D.postMessage(null)}}else R=function(){v(A,0)};function F(M){j=M,S||(S=!0,R())}function O(M,V){E=v(function(){M(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(M){M.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,F(_))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var C=h;h=V;try{return M()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,V){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var C=h;h=M;try{return V()}finally{h=C}},e.unstable_scheduleCallback=function(M,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,M){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,M={id:u++,callback:V,priorityLevel:M,startTime:C,expirationTime:Q,sortIndex:-1},C>U?(M.sortIndex=C,t(c,M),n(l)===null&&M===n(c)&&(g?(y(E),E=-1):g=!0,O(b,C-U))):(M.sortIndex=Q,t(l,M),m||p||(m=!0,F(_))),M},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(M){var V=h;return function(){var C=h;h=V;try{return M.apply(this,arguments)}finally{h=C}}}})(Y1);q1.exports=Y1;var SA=q1.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 CA=k,fn=SA;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 J1=new Set,ml={};function Ci(e,t){Ao(e,t),Ao(e+"Capture",t)}function Ao(e,t){for(ml[e]=t,e=0;e<t.length;e++)J1.add(t[e])}var zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),em=Object.prototype.hasOwnProperty,jA=/^[: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]*$/,e0={},t0={};function EA(e){return em.call(t0,e)?!0:em.call(e0,e)?!1:jA.test(e)?t0[e]=!0:(e0[e]=!0,!1)}function PA(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 TA(e,t,n,r){if(t===null||typeof t>"u"||PA(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 vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vt[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];vt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){vt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vt[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){vt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){vt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){vt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){vt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){vt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var hy=/[\-:]([a-z])/g;function py(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(hy,py);vt[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(hy,py);vt[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(hy,py);vt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){vt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});vt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){vt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function my(e,t,n,r){var s=vt.hasOwnProperty(t)?vt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(TA(t,n,s,r)&&(n=null),r||s===null?EA(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 Ur=CA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pc=Symbol.for("react.element"),Ji=Symbol.for("react.portal"),Qi=Symbol.for("react.fragment"),gy=Symbol.for("react.strict_mode"),tm=Symbol.for("react.profiler"),Q1=Symbol.for("react.provider"),X1=Symbol.for("react.context"),yy=Symbol.for("react.forward_ref"),nm=Symbol.for("react.suspense"),rm=Symbol.for("react.suspense_list"),xy=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),eS=Symbol.for("react.offscreen"),n0=Symbol.iterator;function xa(e){return e===null||typeof e!="object"?null:(e=n0&&e[n0]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,mh;function za(e){if(mh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mh=t&&t[1]||""}return`
35
- `+mh+e}var gh=!1;function yh(e,t){if(!e||gh)return"";gh=!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{gh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?za(e):""}function NA(e){switch(e.tag){case 5:return za(e.type);case 16:return za("Lazy");case 13:return za("Suspense");case 19:return za("SuspenseList");case 0:case 2:case 15:return e=yh(e.type,!1),e;case 11:return e=yh(e.type.render,!1),e;case 1:return e=yh(e.type,!0),e;default:return""}}function sm(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 Qi:return"Fragment";case Ji:return"Portal";case tm:return"Profiler";case gy:return"StrictMode";case nm:return"Suspense";case rm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X1:return(e.displayName||"Context")+".Consumer";case Q1:return(e._context.displayName||"Context")+".Provider";case yy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xy:return t=e.displayName||null,t!==null?t:sm(e.type)||"Memo";case is:t=e._payload,e=e._init;try{return sm(e(t))}catch{}}return null}function IA(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 sm(t);case 8:return t===gy?"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 tS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function AA(e){var t=tS(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 Tc(e){e._valueTracker||(e._valueTracker=AA(e))}function nS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function nd(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 im(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function r0(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 rS(e,t){t=t.checked,t!=null&&my(e,"checked",t,!1)}function om(e,t){rS(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")?am(e,t.type,n):t.hasOwnProperty("defaultValue")&&am(e,t.type,Ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function s0(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 am(e,t,n){(t!=="number"||nd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fa=Array.isArray;function xo(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 lm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function i0(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(Fa(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 sS(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 o0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function iS(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 cm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?iS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Nc,oS=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(Nc=Nc||document.createElement("div"),Nc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Za={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},RA=["Webkit","ms","Moz","O"];Object.keys(Za).forEach(function(e){RA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Za[t]=Za[e]})});function aS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Za.hasOwnProperty(e)&&Za[e]?(""+t).trim():t+"px"}function lS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=aS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var LA=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 um(e,t){if(t){if(LA[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 dm(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 fm=null;function vy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hm=null,vo=null,wo=null;function a0(e){if(e=Ql(e)){if(typeof hm!="function")throw Error(W(280));var t=e.stateNode;t&&(t=pf(t),hm(e.stateNode,e.type,t))}}function cS(e){vo?wo?wo.push(e):wo=[e]:vo=e}function uS(){if(vo){var e=vo,t=wo;if(wo=vo=null,a0(e),t)for(e=0;e<t.length;e++)a0(t[e])}}function dS(e,t){return e(t)}function fS(){}var xh=!1;function hS(e,t,n){if(xh)return e(t,n);xh=!0;try{return dS(e,t,n)}finally{xh=!1,(vo!==null||wo!==null)&&(fS(),uS())}}function yl(e,t){var n=e.stateNode;if(n===null)return null;var r=pf(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 pm=!1;if(zr)try{var va={};Object.defineProperty(va,"passive",{get:function(){pm=!0}}),window.addEventListener("test",va,va),window.removeEventListener("test",va,va)}catch{pm=!1}function MA(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 qa=!1,rd=null,sd=!1,mm=null,$A={onError:function(e){qa=!0,rd=e}};function DA(e,t,n,r,s,i,o,a,l){qa=!1,rd=null,MA.apply($A,arguments)}function OA(e,t,n,r,s,i,o,a,l){if(DA.apply(this,arguments),qa){if(qa){var c=rd;qa=!1,rd=null}else throw Error(W(198));sd||(sd=!0,mm=c)}}function ji(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 pS(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 l0(e){if(ji(e)!==e)throw Error(W(188))}function zA(e){var t=e.alternate;if(!t){if(t=ji(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 l0(s),e;if(i===r)return l0(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 mS(e){return e=zA(e),e!==null?gS(e):null}function gS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gS(e);if(t!==null)return t;e=e.sibling}return null}var yS=fn.unstable_scheduleCallback,c0=fn.unstable_cancelCallback,FA=fn.unstable_shouldYield,BA=fn.unstable_requestPaint,He=fn.unstable_now,VA=fn.unstable_getCurrentPriorityLevel,wy=fn.unstable_ImmediatePriority,xS=fn.unstable_UserBlockingPriority,id=fn.unstable_NormalPriority,UA=fn.unstable_LowPriority,vS=fn.unstable_IdlePriority,uf=null,mr=null;function WA(e){if(mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(uf,e,void 0,(e.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:GA,HA=Math.log,KA=Math.LN2;function GA(e){return e>>>=0,e===0?32:31-(HA(e)/KA|0)|0}var Ic=64,Ac=4194304;function Ba(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 od(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=Ba(a):(i&=o,i!==0&&(r=Ba(i)))}else o=n&~s,o!==0?r=Ba(o):i!==0&&(r=Ba(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 ZA(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 qA(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]=ZA(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function gm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function wS(){var e=Ic;return Ic<<=1,!(Ic&4194240)&&(Ic=64),e}function vh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yl(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 YA(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 by(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 bS(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var kS,ky,_S,SS,CS,ym=!1,Rc=[],xs=null,vs=null,ws=null,xl=new Map,vl=new Map,cs=[],JA="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 u0(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":xl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vl.delete(t.pointerId)}}function wa(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=Ql(t),t!==null&&ky(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function QA(e,t,n,r,s){switch(t){case"focusin":return xs=wa(xs,e,t,n,r,s),!0;case"dragenter":return vs=wa(vs,e,t,n,r,s),!0;case"mouseover":return ws=wa(ws,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return xl.set(i,wa(xl.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,vl.set(i,wa(vl.get(i)||null,e,t,n,r,s)),!0}return!1}function jS(e){var t=ti(e.target);if(t!==null){var n=ji(t);if(n!==null){if(t=n.tag,t===13){if(t=pS(n),t!==null){e.blockedOn=t,CS(e.priority,function(){_S(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 Cu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fm=r,n.target.dispatchEvent(r),fm=null}else return t=Ql(n),t!==null&&ky(t),e.blockedOn=n,!1;t.shift()}return!0}function d0(e,t,n){Cu(e)&&n.delete(t)}function XA(){ym=!1,xs!==null&&Cu(xs)&&(xs=null),vs!==null&&Cu(vs)&&(vs=null),ws!==null&&Cu(ws)&&(ws=null),xl.forEach(d0),vl.forEach(d0)}function ba(e,t){e.blockedOn===t&&(e.blockedOn=null,ym||(ym=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,XA)))}function wl(e){function t(s){return ba(s,e)}if(0<Rc.length){ba(Rc[0],e);for(var n=1;n<Rc.length;n++){var r=Rc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&ba(xs,e),vs!==null&&ba(vs,e),ws!==null&&ba(ws,e),xl.forEach(t),vl.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);)jS(n),n.blockedOn===null&&cs.shift()}var bo=Ur.ReactCurrentBatchConfig,ad=!0;function e2(e,t,n,r){var s=xe,i=bo.transition;bo.transition=null;try{xe=1,_y(e,t,n,r)}finally{xe=s,bo.transition=i}}function t2(e,t,n,r){var s=xe,i=bo.transition;bo.transition=null;try{xe=4,_y(e,t,n,r)}finally{xe=s,bo.transition=i}}function _y(e,t,n,r){if(ad){var s=xm(e,t,n,r);if(s===null)Th(e,t,r,ld,n),u0(e,r);else if(QA(s,e,t,n,r))r.stopPropagation();else if(u0(e,r),t&4&&-1<JA.indexOf(e)){for(;s!==null;){var i=Ql(s);if(i!==null&&kS(i),i=xm(e,t,n,r),i===null&&Th(e,t,r,ld,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Th(e,t,r,null,n)}}var ld=null;function xm(e,t,n,r){if(ld=null,e=vy(r),e=ti(e),e!==null)if(t=ji(e),t===null)e=null;else if(n=t.tag,n===13){if(e=pS(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 ld=e,null}function ES(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(VA()){case wy:return 1;case xS:return 4;case id:case UA:return 16;case vS:return 536870912;default:return 16}default:return 16}}var ds=null,Sy=null,ju=null;function PS(){if(ju)return ju;var e,t=Sy,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 ju=s.slice(e,1<r?1-r:void 0)}function Eu(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 Lc(){return!0}function f0(){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)?Lc:f0,this.isPropagationStopped=f0,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=Lc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Lc)},persist:function(){},isPersistent:Lc}),t}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cy=mn(qo),Jl=ze({},qo,{view:0,detail:0}),n2=mn(Jl),wh,bh,ka,df=ze({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jy,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!==ka&&(ka&&e.type==="mousemove"?(wh=e.screenX-ka.screenX,bh=e.screenY-ka.screenY):bh=wh=0,ka=e),wh)},movementY:function(e){return"movementY"in e?e.movementY:bh}}),h0=mn(df),r2=ze({},df,{dataTransfer:0}),s2=mn(r2),i2=ze({},Jl,{relatedTarget:0}),kh=mn(i2),o2=ze({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),a2=mn(o2),l2=ze({},qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),c2=mn(l2),u2=ze({},qo,{data:0}),p0=mn(u2),d2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f2={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"},h2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=h2[e])?!!t[e]:!1}function jy(){return p2}var m2=ze({},Jl,{key:function(e){if(e.key){var t=d2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?f2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jy,charCode:function(e){return e.type==="keypress"?Eu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),g2=mn(m2),y2=ze({},df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m0=mn(y2),x2=ze({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jy}),v2=mn(x2),w2=ze({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),b2=mn(w2),k2=ze({},df,{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}),_2=mn(k2),S2=[9,13,27,32],Ey=zr&&"CompositionEvent"in window,Ya=null;zr&&"documentMode"in document&&(Ya=document.documentMode);var C2=zr&&"TextEvent"in window&&!Ya,TS=zr&&(!Ey||Ya&&8<Ya&&11>=Ya),g0=" ",y0=!1;function NS(e,t){switch(e){case"keyup":return S2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xi=!1;function j2(e,t){switch(e){case"compositionend":return IS(t);case"keypress":return t.which!==32?null:(y0=!0,g0);case"textInput":return e=t.data,e===g0&&y0?null:e;default:return null}}function E2(e,t){if(Xi)return e==="compositionend"||!Ey&&NS(e,t)?(e=PS(),ju=Sy=ds=null,Xi=!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 TS&&t.locale!=="ko"?null:t.data;default:return null}}var P2={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 x0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!P2[e.type]:t==="textarea"}function AS(e,t,n,r){cS(r),t=cd(t,"onChange"),0<t.length&&(n=new Cy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ja=null,bl=null;function T2(e){US(e,0)}function ff(e){var t=no(e);if(nS(t))return e}function N2(e,t){if(e==="change")return t}var RS=!1;if(zr){var _h;if(zr){var Sh="oninput"in document;if(!Sh){var v0=document.createElement("div");v0.setAttribute("oninput","return;"),Sh=typeof v0.oninput=="function"}_h=Sh}else _h=!1;RS=_h&&(!document.documentMode||9<document.documentMode)}function w0(){Ja&&(Ja.detachEvent("onpropertychange",LS),bl=Ja=null)}function LS(e){if(e.propertyName==="value"&&ff(bl)){var t=[];AS(t,bl,e,vy(e)),hS(T2,t)}}function I2(e,t,n){e==="focusin"?(w0(),Ja=t,bl=n,Ja.attachEvent("onpropertychange",LS)):e==="focusout"&&w0()}function A2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ff(bl)}function R2(e,t){if(e==="click")return ff(t)}function L2(e,t){if(e==="input"||e==="change")return ff(t)}function M2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:M2;function kl(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(!em.call(t,s)||!Qn(e[s],t[s]))return!1}return!0}function b0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function k0(e,t){var n=b0(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=b0(n)}}function MS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?MS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $S(){for(var e=window,t=nd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nd(e.document)}return t}function Py(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 $2(e){var t=$S(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&MS(n.ownerDocument.documentElement,n)){if(r!==null&&Py(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=k0(n,i);var o=k0(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 D2=zr&&"documentMode"in document&&11>=document.documentMode,eo=null,vm=null,Qa=null,wm=!1;function _0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wm||eo==null||eo!==nd(r)||(r=eo,"selectionStart"in r&&Py(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}),Qa&&kl(Qa,r)||(Qa=r,r=cd(vm,"onSelect"),0<r.length&&(t=new Cy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=eo)))}function Mc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var to={animationend:Mc("Animation","AnimationEnd"),animationiteration:Mc("Animation","AnimationIteration"),animationstart:Mc("Animation","AnimationStart"),transitionend:Mc("Transition","TransitionEnd")},Ch={},DS={};zr&&(DS=document.createElement("div").style,"AnimationEvent"in window||(delete to.animationend.animation,delete to.animationiteration.animation,delete to.animationstart.animation),"TransitionEvent"in window||delete to.transitionend.transition);function hf(e){if(Ch[e])return Ch[e];if(!to[e])return e;var t=to[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in DS)return Ch[e]=t[n];return e}var OS=hf("animationend"),zS=hf("animationiteration"),FS=hf("animationstart"),BS=hf("transitionend"),VS=new Map,S0="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 Ms(e,t){VS.set(e,t),Ci(t,[e])}for(var jh=0;jh<S0.length;jh++){var Eh=S0[jh],O2=Eh.toLowerCase(),z2=Eh[0].toUpperCase()+Eh.slice(1);Ms(O2,"on"+z2)}Ms(OS,"onAnimationEnd");Ms(zS,"onAnimationIteration");Ms(FS,"onAnimationStart");Ms("dblclick","onDoubleClick");Ms("focusin","onFocus");Ms("focusout","onBlur");Ms(BS,"onTransitionEnd");Ao("onMouseEnter",["mouseout","mouseover"]);Ao("onMouseLeave",["mouseout","mouseover"]);Ao("onPointerEnter",["pointerout","pointerover"]);Ao("onPointerLeave",["pointerout","pointerover"]);Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Va="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(" "),F2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Va));function C0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,OA(r,t,void 0,e),e.currentTarget=null}function US(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;C0(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;C0(s,a,c),i=l}}}if(sd)throw e=mm,sd=!1,mm=null,e}function Ae(e,t){var n=t[Cm];n===void 0&&(n=t[Cm]=new Set);var r=e+"__bubble";n.has(r)||(WS(t,e,2,!1),n.add(r))}function Ph(e,t,n){var r=0;t&&(r|=4),WS(n,e,r,t)}var $c="_reactListening"+Math.random().toString(36).slice(2);function _l(e){if(!e[$c]){e[$c]=!0,J1.forEach(function(n){n!=="selectionchange"&&(F2.has(n)||Ph(n,!1,e),Ph(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$c]||(t[$c]=!0,Ph("selectionchange",!1,t))}}function WS(e,t,n,r){switch(ES(t)){case 1:var s=e2;break;case 4:s=t2;break;default:s=_y}n=s.bind(null,t,n,e),s=void 0,!pm||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 Th(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=ti(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}hS(function(){var c=i,u=vy(n),d=[];e:{var h=VS.get(e);if(h!==void 0){var p=Cy,m=e;switch(e){case"keypress":if(Eu(n)===0)break e;case"keydown":case"keyup":p=g2;break;case"focusin":m="focus",p=kh;break;case"focusout":m="blur",p=kh;break;case"beforeblur":case"afterblur":p=kh;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=h0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=s2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=v2;break;case OS:case zS:case FS:p=a2;break;case BS:p=b2;break;case"scroll":p=n2;break;case"wheel":p=_2;break;case"copy":case"cut":case"paste":p=c2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=m0}var g=(t&4)!==0,v=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=c,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=yl(x,y),b!=null&&g.push(Sl(x,b,w)))),v)break;x=x.return}0<g.length&&(h=new p(h,m,null,n,u),d.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==fm&&(m=n.relatedTarget||n.fromElement)&&(ti(m)||m[Fr]))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?ti(m):null,m!==null&&(v=ji(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=h0,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=m0,b="onPointerLeave",y="onPointerEnter",x="pointer"),v=p==null?h:no(p),w=m==null?h:no(m),h=new g(b,x+"leave",p,n,u),h.target=v,h.relatedTarget=w,b=null,ti(u)===c&&(g=new g(y,x+"enter",m,n,u),g.target=w,g.relatedTarget=v,b=g),v=b,p&&m)t:{for(g=p,y=m,x=0,w=g;w;w=Di(w))x++;for(w=0,b=y;b;b=Di(b))w++;for(;0<x-w;)g=Di(g),x--;for(;0<w-x;)y=Di(y),w--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=Di(g),y=Di(y)}g=null}else g=null;p!==null&&j0(d,h,p,g,!1),m!==null&&v!==null&&j0(d,v,m,g,!0)}}e:{if(h=c?no(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=N2;else if(x0(h))if(RS)_=L2;else{_=A2;var S=I2}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=R2);if(_&&(_=_(e,c))){AS(d,_,n,u);break e}S&&S(e,h,c),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&am(h,"number",h.value)}switch(S=c?no(c):window,e){case"focusin":(x0(S)||S.contentEditable==="true")&&(eo=S,vm=c,Qa=null);break;case"focusout":Qa=vm=eo=null;break;case"mousedown":wm=!0;break;case"contextmenu":case"mouseup":case"dragend":wm=!1,_0(d,n,u);break;case"selectionchange":if(D2)break;case"keydown":case"keyup":_0(d,n,u)}var j;if(Ey)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 Xi?NS(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(TS&&n.locale!=="ko"&&(Xi||E!=="onCompositionStart"?E==="onCompositionEnd"&&Xi&&(j=PS()):(ds=u,Sy="value"in ds?ds.value:ds.textContent,Xi=!0)),S=cd(c,E),0<S.length&&(E=new p0(E,e,null,n,u),d.push({event:E,listeners:S}),j?E.data=j:(j=IS(n),j!==null&&(E.data=j)))),(j=C2?j2(e,n):E2(e,n))&&(c=cd(c,"onBeforeInput"),0<c.length&&(u=new p0("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=j))}US(d,t)})}function Sl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cd(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=yl(e,n),i!=null&&r.unshift(Sl(e,i,s)),i=yl(e,t),i!=null&&r.push(Sl(e,i,s))),e=e.return}return r}function Di(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function j0(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=yl(n,i),l!=null&&o.unshift(Sl(n,l,a))):s||(l=yl(n,i),l!=null&&o.push(Sl(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var B2=/\r\n?/g,V2=/\u0000|\uFFFD/g;function E0(e){return(typeof e=="string"?e:""+e).replace(B2,`
39
- `).replace(V2,"")}function Dc(e,t,n){if(t=E0(t),E0(e)!==t&&n)throw Error(W(425))}function ud(){}var bm=null,km=null;function _m(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 Sm=typeof setTimeout=="function"?setTimeout:void 0,U2=typeof clearTimeout=="function"?clearTimeout:void 0,P0=typeof Promise=="function"?Promise:void 0,W2=typeof queueMicrotask=="function"?queueMicrotask:typeof P0<"u"?function(e){return P0.resolve(null).then(e).catch(H2)}:Sm;function H2(e){setTimeout(function(){throw e})}function Nh(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),wl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);wl(t)}function bs(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 T0(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 Yo=Math.random().toString(36).slice(2),hr="__reactFiber$"+Yo,Cl="__reactProps$"+Yo,Fr="__reactContainer$"+Yo,Cm="__reactEvents$"+Yo,K2="__reactListeners$"+Yo,G2="__reactHandles$"+Yo;function ti(e){var t=e[hr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fr]||n[hr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=T0(e);e!==null;){if(n=e[hr])return n;e=T0(e)}return t}e=n,n=e.parentNode}return null}function Ql(e){return e=e[hr]||e[Fr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function no(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function pf(e){return e[Cl]||null}var jm=[],ro=-1;function $s(e){return{current:e}}function Re(e){0>ro||(e.current=jm[ro],jm[ro]=null,ro--)}function Pe(e,t){ro++,jm[ro]=e.current,e.current=t}var Is={},Et=$s(Is),Ut=$s(!1),yi=Is;function Ro(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 Wt(e){return e=e.childContextTypes,e!=null}function dd(){Re(Ut),Re(Et)}function N0(e,t,n){if(Et.current!==Is)throw Error(W(168));Pe(Et,t),Pe(Ut,n)}function HS(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,IA(e)||"Unknown",s));return ze({},n,r)}function fd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Is,yi=Et.current,Pe(Et,e),Pe(Ut,Ut.current),!0}function I0(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=HS(e,t,yi),r.__reactInternalMemoizedMergedChildContext=e,Re(Ut),Re(Et),Pe(Et,e)):Re(Ut),Pe(Ut,n)}var Tr=null,mf=!1,Ih=!1;function KS(e){Tr===null?Tr=[e]:Tr.push(e)}function Z2(e){mf=!0,KS(e)}function Ds(){if(!Ih&&Tr!==null){Ih=!0;var e=0,t=xe;try{var n=Tr;for(xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Tr=null,mf=!1}catch(s){throw Tr!==null&&(Tr=Tr.slice(e+1)),yS(wy,Ds),s}finally{xe=t,Ih=!1}}return null}var so=[],io=0,hd=null,pd=0,_n=[],Sn=0,xi=null,Rr=1,Lr="";function qs(e,t){so[io++]=pd,so[io++]=hd,hd=e,pd=t}function GS(e,t,n){_n[Sn++]=Rr,_n[Sn++]=Lr,_n[Sn++]=xi,xi=e;var r=Rr;e=Lr;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,Rr=1<<32-qn(t)+s|n<<s|r,Lr=i+e}else Rr=1<<i|n<<s|r,Lr=e}function Ty(e){e.return!==null&&(qs(e,1),GS(e,1,0))}function Ny(e){for(;e===hd;)hd=so[--io],so[io]=null,pd=so[--io],so[io]=null;for(;e===xi;)xi=_n[--Sn],_n[Sn]=null,Lr=_n[--Sn],_n[Sn]=null,Rr=_n[--Sn],_n[Sn]=null}var ln=null,on=null,Me=!1,Zn=null;function ZS(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 A0(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,ln=e,on=bs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ln=e,on=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xi!==null?{id:Rr,overflow:Lr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ln=e,on=null,!0):!1;default:return!1}}function Em(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pm(e){if(Me){var t=on;if(t){var n=t;if(!A0(e,t)){if(Em(e))throw Error(W(418));t=bs(n.nextSibling);var r=ln;t&&A0(e,t)?ZS(r,n):(e.flags=e.flags&-4097|2,Me=!1,ln=e)}}else{if(Em(e))throw Error(W(418));e.flags=e.flags&-4097|2,Me=!1,ln=e}}}function R0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ln=e}function Oc(e){if(e!==ln)return!1;if(!Me)return R0(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_m(e.type,e.memoizedProps)),t&&(t=on)){if(Em(e))throw qS(),Error(W(418));for(;t;)ZS(e,t),t=bs(t.nextSibling)}if(R0(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){on=bs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}on=null}}else on=ln?bs(e.stateNode.nextSibling):null;return!0}function qS(){for(var e=on;e;)e=bs(e.nextSibling)}function Lo(){on=ln=null,Me=!1}function Iy(e){Zn===null?Zn=[e]:Zn.push(e)}var q2=Ur.ReactCurrentBatchConfig;function _a(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 zc(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function L0(e){var t=e._init;return t(e._payload)}function YS(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function s(y,x){return y=Cs(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,x,w,b){return x===null||x.tag!==6?(x=Oh(w,y.mode,b),x.return=y,x):(x=s(x,w),x.return=y,x)}function l(y,x,w,b){var _=w.type;return _===Qi?u(y,x,w.props.children,b,w.key):x!==null&&(x.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&L0(_)===x.type)?(b=s(x,w.props),b.ref=_a(y,x,w),b.return=y,b):(b=Lu(w.type,w.key,w.props,null,y.mode,b),b.ref=_a(y,x,w),b.return=y,b)}function c(y,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=zh(w,y.mode,b),x.return=y,x):(x=s(x,w.children||[]),x.return=y,x)}function u(y,x,w,b,_){return x===null||x.tag!==7?(x=ui(w,y.mode,b,_),x.return=y,x):(x=s(x,w),x.return=y,x)}function d(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Oh(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Pc:return w=Lu(x.type,x.key,x.props,null,y.mode,w),w.ref=_a(y,null,x),w.return=y,w;case Ji:return x=zh(x,y.mode,w),x.return=y,x;case is:var b=x._init;return d(y,b(x._payload),w)}if(Fa(x)||xa(x))return x=ui(x,y.mode,w,null),x.return=y,x;zc(y,x)}return null}function h(y,x,w,b){var _=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:a(y,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Pc:return w.key===_?l(y,x,w,b):null;case Ji:return w.key===_?c(y,x,w,b):null;case is:return _=w._init,h(y,x,_(w._payload),b)}if(Fa(w)||xa(w))return _!==null?null:u(y,x,w,b,null);zc(y,w)}return null}function p(y,x,w,b,_){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,a(x,y,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Pc:return y=y.get(b.key===null?w:b.key)||null,l(x,y,b,_);case Ji:return y=y.get(b.key===null?w:b.key)||null,c(x,y,b,_);case is:var S=b._init;return p(y,x,w,S(b._payload),_)}if(Fa(b)||xa(b))return y=y.get(w)||null,u(x,y,b,_,null);zc(x,b)}return null}function m(y,x,w,b){for(var _=null,S=null,j=x,E=x=0,T=null;j!==null&&E<w.length;E++){j.index>E?(T=j,j=null):T=j.sibling;var P=h(y,j,w[E],b);if(P===null){j===null&&(j=T);break}e&&j&&P.alternate===null&&t(y,j),x=i(P,x,E),S===null?_=P:S.sibling=P,S=P,j=T}if(E===w.length)return n(y,j),Me&&qs(y,E),_;if(j===null){for(;E<w.length;E++)j=d(y,w[E],b),j!==null&&(x=i(j,x,E),S===null?_=j:S.sibling=j,S=j);return Me&&qs(y,E),_}for(j=r(y,j);E<w.length;E++)T=p(j,y,E,w[E],b),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?E:T.key),x=i(T,x,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,x,w,b){var _=xa(w);if(typeof _!="function")throw Error(W(150));if(w=_.call(w),w==null)throw Error(W(151));for(var S=_=null,j=x,E=x=0,T=null,P=w.next();j!==null&&!P.done;E++,P=w.next()){j.index>E?(T=j,j=null):T=j.sibling;var N=h(y,j,P.value,b);if(N===null){j===null&&(j=T);break}e&&j&&N.alternate===null&&t(y,j),x=i(N,x,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=w.next())P=d(y,P.value,b),P!==null&&(x=i(P,x,E),S===null?_=P:S.sibling=P,S=P);return Me&&qs(y,E),_}for(j=r(y,j);!P.done;E++,P=w.next())P=p(j,y,E,P.value,b),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?E:P.key),x=i(P,x,E),S===null?_=P:S.sibling=P,S=P);return e&&j.forEach(function(A){return t(y,A)}),Me&&qs(y,E),_}function v(y,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Qi&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Pc:e:{for(var _=w.key,S=x;S!==null;){if(S.key===_){if(_=w.type,_===Qi){if(S.tag===7){n(y,S.sibling),x=s(S,w.props.children),x.return=y,y=x;break e}}else if(S.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===is&&L0(_)===S.type){n(y,S.sibling),x=s(S,w.props),x.ref=_a(y,S,w),x.return=y,y=x;break e}n(y,S);break}else t(y,S);S=S.sibling}w.type===Qi?(x=ui(w.props.children,y.mode,b,w.key),x.return=y,y=x):(b=Lu(w.type,w.key,w.props,null,y.mode,b),b.ref=_a(y,x,w),b.return=y,y=b)}return o(y);case Ji:e:{for(S=w.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(y,x.sibling),x=s(x,w.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=zh(w,y.mode,b),x.return=y,y=x}return o(y);case is:return S=w._init,v(y,x,S(w._payload),b)}if(Fa(w))return m(y,x,w,b);if(xa(w))return g(y,x,w,b);zc(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(y,x.sibling),x=s(x,w),x.return=y,y=x):(n(y,x),x=Oh(w,y.mode,b),x.return=y,y=x),o(y)):n(y,x)}return v}var Mo=YS(!0),JS=YS(!1),md=$s(null),gd=null,oo=null,Ay=null;function Ry(){Ay=oo=gd=null}function Ly(e){var t=md.current;Re(md),e._currentValue=t}function Tm(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 ko(e,t){gd=e,Ay=oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bt=!0),e.firstContext=null)}function Rn(e){var t=e._currentValue;if(Ay!==e)if(e={context:e,memoizedValue:t,next:null},oo===null){if(gd===null)throw Error(W(308));oo=e,gd.dependencies={lanes:0,firstContext:e}}else oo=oo.next=e;return t}var ni=null;function My(e){ni===null?ni=[e]:ni.push(e)}function QS(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,My(t)):(n.next=s.next,s.next=n),t.interleaved=n,Br(e,r)}function Br(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 $y(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function XS(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 $r(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,Br(e,n)}return s=r.interleaved,s===null?(t.next=t,My(r)):(t.next=s.next,s.next=t),r.interleaved=t,Br(e,n)}function Pu(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,by(e,n)}}function M0(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 yd(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 d=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"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=ze({},d,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=d):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=d),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);wi|=o,e.lanes=o,e.memoizedState=d}}function $0(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 Xl={},gr=$s(Xl),jl=$s(Xl),El=$s(Xl);function ri(e){if(e===Xl)throw Error(W(174));return e}function Dy(e,t){switch(Pe(El,t),Pe(jl,e),Pe(gr,Xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=cm(t,e)}Re(gr),Pe(gr,t)}function $o(){Re(gr),Re(jl),Re(El)}function eC(e){ri(El.current);var t=ri(gr.current),n=cm(t,e.type);t!==n&&(Pe(jl,e),Pe(gr,n))}function Oy(e){jl.current===e&&(Re(gr),Re(jl))}var De=$s(0);function xd(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 Ah=[];function zy(){for(var e=0;e<Ah.length;e++)Ah[e]._workInProgressVersionPrimary=null;Ah.length=0}var Tu=Ur.ReactCurrentDispatcher,Rh=Ur.ReactCurrentBatchConfig,vi=0,Oe=null,it=null,ct=null,vd=!1,Xa=!1,Pl=0,Y2=0;function bt(){throw Error(W(321))}function Fy(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 By(e,t,n,r,s,i){if(vi=i,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Tu.current=e===null||e.memoizedState===null?eR:tR,e=n(r,s),Xa){i=0;do{if(Xa=!1,Pl=0,25<=i)throw Error(W(301));i+=1,ct=it=null,t.updateQueue=null,Tu.current=nR,e=n(r,s)}while(Xa)}if(Tu.current=wd,t=it!==null&&it.next!==null,vi=0,ct=it=Oe=null,vd=!1,t)throw Error(W(300));return e}function Vy(){var e=Pl!==0;return Pl=0,e}function ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?Oe.memoizedState=ct=e:ct=ct.next=e,ct}function Ln(){if(it===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=ct===null?Oe.memoizedState:ct.next;if(t!==null)ct=t,it=e;else{if(e===null)throw Error(W(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},ct===null?Oe.memoizedState=ct=e:ct=ct.next=e}return ct}function Tl(e,t){return typeof t=="function"?t(e):t}function Lh(e){var t=Ln(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=it,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((vi&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 d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,Oe.lanes|=u,wi|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Qn(r,t.memoizedState)||(Bt=!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,wi|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mh(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)||(Bt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function tC(){}function nC(e,t){var n=Oe,r=Ln(),s=t(),i=!Qn(r.memoizedState,s);if(i&&(r.memoizedState=s,Bt=!0),r=r.queue,Uy(iC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,Nl(9,sC.bind(null,n,r,s,t),void 0,null),ut===null)throw Error(W(349));vi&30||rC(n,t,s)}return s}function rC(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 sC(e,t,n,r){t.value=n,t.getSnapshot=r,oC(t)&&aC(e)}function iC(e,t,n){return n(function(){oC(t)&&aC(e)})}function oC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qn(e,n)}catch{return!0}}function aC(e){var t=Br(e,1);t!==null&&Yn(t,e,1,-1)}function D0(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:Tl,lastRenderedState:e},t.queue=e,e=e.dispatch=X2.bind(null,Oe,e),[t.memoizedState,e]}function Nl(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 lC(){return Ln().memoizedState}function Nu(e,t,n,r){var s=ar();Oe.flags|=e,s.memoizedState=Nl(1|t,n,void 0,r===void 0?null:r)}function gf(e,t,n,r){var s=Ln();r=r===void 0?null:r;var i=void 0;if(it!==null){var o=it.memoizedState;if(i=o.destroy,r!==null&&Fy(r,o.deps)){s.memoizedState=Nl(t,n,i,r);return}}Oe.flags|=e,s.memoizedState=Nl(1|t,n,i,r)}function O0(e,t){return Nu(8390656,8,e,t)}function Uy(e,t){return gf(2048,8,e,t)}function cC(e,t){return gf(4,2,e,t)}function uC(e,t){return gf(4,4,e,t)}function dC(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 fC(e,t,n){return n=n!=null?n.concat([e]):null,gf(4,4,dC.bind(null,t,e),n)}function Wy(){}function hC(e,t){var n=Ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pC(e,t){var n=Ln();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mC(e,t,n){return vi&21?(Qn(n,t)||(n=wS(),Oe.lanes|=n,wi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bt=!0),e.memoizedState=n)}function J2(e,t){var n=xe;xe=n!==0&&4>n?n:4,e(!0);var r=Rh.transition;Rh.transition={};try{e(!1),t()}finally{xe=n,Rh.transition=r}}function gC(){return Ln().memoizedState}function Q2(e,t,n){var r=Ss(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yC(e))xC(t,n);else if(n=QS(e,t,n,r),n!==null){var s=Lt();Yn(n,e,r,s),vC(n,t,r)}}function X2(e,t,n){var r=Ss(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yC(e))xC(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,My(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=QS(e,t,s,r),n!==null&&(s=Lt(),Yn(n,e,r,s),vC(n,t,r))}}function yC(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function xC(e,t){Xa=vd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,by(e,n)}}var wd={readContext:Rn,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},eR={readContext:Rn,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:Rn,useEffect:O0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nu(4194308,4,dC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nu(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=Q2.bind(null,Oe,e),[r.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:D0,useDebugValue:Wy,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=D0(!1),t=e[0];return e=J2.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(),ut===null)throw Error(W(349));vi&30||rC(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,O0(iC.bind(null,r,i,e),[e]),r.flags|=2048,Nl(9,sC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ar(),t=ut.identifierPrefix;if(Me){var n=Lr,r=Rr;n=(r&~(1<<32-qn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Pl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Y2++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tR={readContext:Rn,useCallback:hC,useContext:Rn,useEffect:Uy,useImperativeHandle:fC,useInsertionEffect:cC,useLayoutEffect:uC,useMemo:pC,useReducer:Lh,useRef:lC,useState:function(){return Lh(Tl)},useDebugValue:Wy,useDeferredValue:function(e){var t=Ln();return mC(t,it.memoizedState,e)},useTransition:function(){var e=Lh(Tl)[0],t=Ln().memoizedState;return[e,t]},useMutableSource:tC,useSyncExternalStore:nC,useId:gC,unstable_isNewReconciler:!1},nR={readContext:Rn,useCallback:hC,useContext:Rn,useEffect:Uy,useImperativeHandle:fC,useInsertionEffect:cC,useLayoutEffect:uC,useMemo:pC,useReducer:Mh,useRef:lC,useState:function(){return Mh(Tl)},useDebugValue:Wy,useDeferredValue:function(e){var t=Ln();return it===null?t.memoizedState=e:mC(t,it.memoizedState,e)},useTransition:function(){var e=Mh(Tl)[0],t=Ln().memoizedState;return[e,t]},useMutableSource:tC,useSyncExternalStore:nC,useId:gC,unstable_isNewReconciler:!1};function Kn(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 Nm(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 yf={isMounted:function(e){return(e=e._reactInternals)?ji(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=$r(r,s);i.payload=t,n!=null&&(i.callback=n),t=ks(e,i,s),t!==null&&(Yn(t,e,s,r),Pu(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lt(),s=Ss(e),i=$r(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),Pu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lt(),r=Ss(e),s=$r(n,r);s.tag=2,t!=null&&(s.callback=t),t=ks(e,s,r),t!==null&&(Yn(t,e,r,n),Pu(t,e,r))}};function z0(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?!kl(n,r)||!kl(s,i):!0}function wC(e,t,n){var r=!1,s=Is,i=t.contextType;return typeof i=="object"&&i!==null?i=Rn(i):(s=Wt(t)?yi:Et.current,r=t.contextTypes,i=(r=r!=null)?Ro(e,s):Is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=yf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function F0(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&&yf.enqueueReplaceState(t,t.state,null)}function Im(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},$y(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Rn(i):(i=Wt(t)?yi:Et.current,s.context=Ro(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Nm(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&&yf.enqueueReplaceState(s,s.state,null),yd(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Do(e,t){try{var n="",r=t;do n+=NA(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 $h(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Am(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rR=typeof WeakMap=="function"?WeakMap:Map;function bC(e,t,n){n=$r(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){kd||(kd=!0,Vm=r),Am(e,t)},n}function kC(e,t,n){n=$r(-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(){Am(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Am(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 B0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rR;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=yR.bind(null,e,t,n),t.then(e,e))}function V0(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 U0(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=$r(-1,1),t.tag=2,ks(n,t,1))),n.lanes|=1),e)}var sR=Ur.ReactCurrentOwner,Bt=!1;function Nt(e,t,n,r){t.child=e===null?JS(t,null,n,r):Mo(t,e.child,n,r)}function W0(e,t,n,r,s){n=n.render;var i=t.ref;return ko(t,s),r=By(e,t,n,r,i,s),n=Vy(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vr(e,t,s)):(Me&&n&&Ty(t),t.flags|=1,Nt(e,t,r,s),t.child)}function H0(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Qy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,_C(e,t,i,r,s)):(e=Lu(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:kl,n(o,r)&&e.ref===t.ref)return Vr(e,t,s)}return t.flags|=1,e=Cs(i,r),e.ref=t.ref,e.return=t,t.child=e}function _C(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(kl(i,r)&&e.ref===t.ref)if(Bt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Bt=!0);else return t.lanes=e.lanes,Vr(e,t,s)}return Rm(e,t,n,r,s)}function SC(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(lo,sn),sn|=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(lo,sn),sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(lo,sn),sn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(lo,sn),sn|=r;return Nt(e,t,s,n),t.child}function CC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Rm(e,t,n,r,s){var i=Wt(n)?yi:Et.current;return i=Ro(t,i),ko(t,s),n=By(e,t,n,r,i,s),r=Vy(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vr(e,t,s)):(Me&&r&&Ty(t),t.flags|=1,Nt(e,t,n,s),t.child)}function K0(e,t,n,r,s){if(Wt(n)){var i=!0;fd(t)}else i=!1;if(ko(t,s),t.stateNode===null)Iu(e,t),wC(t,n,r),Im(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=Wt(n)?yi:Et.current,c=Ro(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&F0(t,o,r,c),os=!1;var h=t.memoizedState;o.state=h,yd(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Ut.current||os?(typeof u=="function"&&(Nm(t,n,u,r),l=t.memoizedState),(a=os||z0(t,n,a,r,h,l,c))?(d||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,XS(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Kn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rn(l):(l=Wt(n)?yi:Et.current,l=Ro(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&F0(t,o,r,l),os=!1,h=t.memoizedState,o.state=h,yd(t,r,o,s);var m=t.memoizedState;a!==d||h!==m||Ut.current||os?(typeof p=="function"&&(Nm(t,n,p,r),m=t.memoizedState),(c=os||z0(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 Lm(e,t,n,r,i,s)}function Lm(e,t,n,r,s,i){CC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&I0(t,n,!1),Vr(e,t,i);r=t.stateNode,sR.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Mo(t,e.child,null,i),t.child=Mo(t,null,a,i)):Nt(e,t,a,i),t.memoizedState=r.state,s&&I0(t,n,!0),t.child}function jC(e){var t=e.stateNode;t.pendingContext?N0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&N0(e,t.context,!1),Dy(e,t.containerInfo)}function G0(e,t,n,r,s){return Lo(),Iy(s),t.flags|=256,Nt(e,t,n,r),t.child}var Mm={dehydrated:null,treeContext:null,retryLane:0};function $m(e){return{baseLanes:e,cachePool:null,transitions:null}}function EC(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 Pm(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=wf(o,r,0,null),e=ui(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=$m(n),t.memoizedState=Mm,e):Hy(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return iR(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=ui(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?$m(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Mm,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 Hy(e,t){return t=wf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fc(e,t,n,r){return r!==null&&Iy(r),Mo(t,e.child,null,n),e=Hy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function iR(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=$h(Error(W(422))),Fc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=wf({mode:"visible",children:r.children},s,0,null),i=ui(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Mo(t,e.child,null,o),t.child.memoizedState=$m(o),t.memoizedState=Mm,i);if(!(t.mode&1))return Fc(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=$h(i,r,void 0),Fc(e,t,o,r)}if(a=(o&e.childLanes)!==0,Bt||a){if(r=ut,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,Br(e,s),Yn(r,e,s,-1))}return Jy(),r=$h(Error(W(421))),Fc(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=xR.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,on=bs(s.nextSibling),ln=t,Me=!0,Zn=null,e!==null&&(_n[Sn++]=Rr,_n[Sn++]=Lr,_n[Sn++]=xi,Rr=e.id,Lr=e.overflow,xi=t),t=Hy(t,r.children),t.flags|=4096,t)}function Z0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tm(e.return,t,n)}function Dh(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 PC(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Nt(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&&Z0(e,n,t);else if(e.tag===19)Z0(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&&xd(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Dh(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&&xd(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Dh(t,!0,n,null,i);break;case"together":Dh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Iu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),wi|=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 oR(e,t,n){switch(t.tag){case 3:jC(t),Lo();break;case 5:eC(t);break;case 1:Wt(t.type)&&fd(t);break;case 4:Dy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pe(md,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?EC(e,t,n):(Pe(De,De.current&1),e=Vr(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 PC(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,SC(e,t,n)}return Vr(e,t,n)}var TC,Dm,NC,IC;TC=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}};Dm=function(){};NC=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ri(gr.current);var i=null;switch(n){case"input":s=im(e,s),r=im(e,r),i=[];break;case"select":s=ze({},s,{value:void 0}),r=ze({},r,{value:void 0}),i=[];break;case"textarea":s=lm(e,s),r=lm(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ud)}um(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"&&(ml.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"&&(ml.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)}};IC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Sa(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 kt(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 aR(e,t,n){var r=t.pendingProps;switch(Ny(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(t),null;case 1:return Wt(t.type)&&dd(),kt(t),null;case 3:return r=t.stateNode,$o(),Re(Ut),Re(Et),zy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Oc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zn!==null&&(Hm(Zn),Zn=null))),Dm(e,t),kt(t),null;case 5:Oy(t);var s=ri(El.current);if(n=t.type,e!==null&&t.stateNode!=null)NC(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 kt(t),null}if(e=ri(gr.current),Oc(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[hr]=t,r[Cl]=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<Va.length;s++)Ae(Va[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":r0(r,i),Ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ae("invalid",r);break;case"textarea":i0(r,i),Ae("invalid",r)}um(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&&Dc(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Dc(r.textContent,a,e),s=["children",""+a]):ml.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ae("scroll",r)}switch(n){case"input":Tc(r),s0(r,i,!0);break;case"textarea":Tc(r),o0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ud)}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=iS(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[Cl]=r,TC(e,t,!1,!1),t.stateNode=e;e:{switch(o=dm(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<Va.length;s++)Ae(Va[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":r0(e,r),s=im(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":i0(e,r),s=lm(e,r),Ae("invalid",e);break;default:s=r}um(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?lS(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&oS(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&gl(e,l):typeof l=="number"&&gl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ml.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ae("scroll",e):l!=null&&my(e,i,l,o))}switch(n){case"input":Tc(e),s0(e,r,!1);break;case"textarea":Tc(e),o0(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?xo(e,!!r.multiple,i,!1):r.defaultValue!=null&&xo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ud)}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 kt(t),null;case 6:if(e&&t.stateNode!=null)IC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=ri(El.current),ri(gr.current),Oc(t)){if(r=t.stateNode,n=t.memoizedProps,r[hr]=t,(i=r.nodeValue!==n)&&(e=ln,e!==null))switch(e.tag){case 3:Dc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Dc(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 kt(t),null;case 13:if(Re(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&on!==null&&t.mode&1&&!(t.flags&128))qS(),Lo(),t.flags|=98560,i=!1;else if(i=Oc(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 Lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;kt(t),i=!1}else Zn!==null&&(Hm(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?ot===0&&(ot=3):Jy())),t.updateQueue!==null&&(t.flags|=4),kt(t),null);case 4:return $o(),Dm(e,t),e===null&&_l(t.stateNode.containerInfo),kt(t),null;case 10:return Ly(t.type._context),kt(t),null;case 17:return Wt(t.type)&&dd(),kt(t),null;case 19:if(Re(De),i=t.memoizedState,i===null)return kt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Sa(i,!1);else{if(ot!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xd(e),o!==null){for(t.flags|=128,Sa(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&&He()>Oo&&(t.flags|=128,r=!0,Sa(i,!1),t.lanes=4194304)}else{if(!r)if(e=xd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Me)return kt(t),null}else 2*He()-i.renderingStartTime>Oo&&n!==1073741824&&(t.flags|=128,r=!0,Sa(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=He(),t.sibling=null,n=De.current,Pe(De,r?n&1|2:n&1),t):(kt(t),null);case 22:case 23:return Yy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?sn&1073741824&&(kt(t),t.subtreeFlags&6&&(t.flags|=8192)):kt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function lR(e,t){switch(Ny(t),t.tag){case 1:return Wt(t.type)&&dd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $o(),Re(Ut),Re(Et),zy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Oy(t),null;case 13:if(Re(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(De),null;case 4:return $o(),null;case 10:return Ly(t.type._context),null;case 22:case 23:return Yy(),null;case 24:return null;default:return null}}var Bc=!1,St=!1,cR=typeof WeakSet=="function"?WeakSet:Set,Z=null;function ao(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 Om(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var q0=!1;function uR(e,t){if(bm=ad,e=$S(),Py(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,d=e,h=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(km={focusedElem:e,selectionRange:n},ad=!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,v=m.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Kn(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(b){Ue(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return m=q0,q0=!1,m}function el(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&&Om(t,n,i)}s=s.next}while(s!==r)}}function xf(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 zm(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 AC(e){var t=e.alternate;t!==null&&(e.alternate=null,AC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hr],delete t[Cl],delete t[Cm],delete t[K2],delete t[G2])),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 RC(e){return e.tag===5||e.tag===3||e.tag===4}function Y0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RC(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 Fm(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=ud));else if(r!==4&&(e=e.child,e!==null))for(Fm(e,t,n),e=e.sibling;e!==null;)Fm(e,t,n),e=e.sibling}function Bm(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(Bm(e,t,n),e=e.sibling;e!==null;)Bm(e,t,n),e=e.sibling}var ht=null,Gn=!1;function Gr(e,t,n){for(n=n.child;n!==null;)LC(e,t,n),n=n.sibling}function LC(e,t,n){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(uf,n)}catch{}switch(n.tag){case 5:St||ao(n,t);case 6:var r=ht,s=Gn;ht=null,Gr(e,t,n),ht=r,Gn=s,ht!==null&&(Gn?(e=ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ht.removeChild(n.stateNode));break;case 18:ht!==null&&(Gn?(e=ht,n=n.stateNode,e.nodeType===8?Nh(e.parentNode,n):e.nodeType===1&&Nh(e,n),wl(e)):Nh(ht,n.stateNode));break;case 4:r=ht,s=Gn,ht=n.stateNode.containerInfo,Gn=!0,Gr(e,t,n),ht=r,Gn=s;break;case 0:case 11:case 14:case 15:if(!St&&(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)&&Om(n,t,o),s=s.next}while(s!==r)}Gr(e,t,n);break;case 1:if(!St&&(ao(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?(St=(r=St)||n.memoizedState!==null,Gr(e,t,n),St=r):Gr(e,t,n);break;default:Gr(e,t,n)}}function J0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cR),t.forEach(function(r){var s=vR.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:ht=a.stateNode,Gn=!1;break e;case 3:ht=a.stateNode.containerInfo,Gn=!0;break e;case 4:ht=a.stateNode.containerInfo,Gn=!0;break e}a=a.return}if(ht===null)throw Error(W(160));LC(i,o,s),ht=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;)MC(t,e),t=t.sibling}function MC(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{el(3,e,e.return),xf(3,e)}catch(g){Ue(e,e.return,g)}try{el(5,e,e.return)}catch(g){Ue(e,e.return,g)}}break;case 1:zn(t,e),rr(e),r&512&&n!==null&&ao(n,n.return);break;case 5:if(zn(t,e),rr(e),r&512&&n!==null&&ao(n,n.return),e.flags&32){var s=e.stateNode;try{gl(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&&rS(s,i),dm(a,o);var c=dm(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?lS(s,d):u==="dangerouslySetInnerHTML"?oS(s,d):u==="children"?gl(s,d):my(s,u,d,c)}switch(a){case"input":om(s,i);break;case"textarea":sS(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?xo(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?xo(s,!!i.multiple,i.defaultValue,!0):xo(s,!!i.multiple,i.multiple?[]:"",!1))}s[Cl]=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{wl(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||(Zy=He())),r&4&&J0(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(St=(c=St)||u,zn(t,e),St=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(d=Z=u;Z!==null;){switch(h=Z,p=h.child,h.tag){case 0:case 11:case 14:case 15:el(4,h,h.return);break;case 1:ao(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:ao(h,h.return);break;case 22:if(h.memoizedState!==null){X0(d);continue}}p!==null?(p.return=h,Z=p):X0(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=aS("display",o))}catch(g){Ue(e,e.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Ue(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:zn(t,e),rr(e),r&4&&J0(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(RC(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&&(gl(s,""),r.flags&=-33);var i=Y0(e);Bm(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Y0(e);Fm(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 dR(e,t,n){Z=e,$C(e)}function $C(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||Bc;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||St;a=Bc;var c=St;if(Bc=o,(St=l)&&!c)for(Z=s;Z!==null;)o=Z,l=o.child,o.tag===22&&o.memoizedState!==null?ew(s):l!==null?(l.return=o,Z=l):ew(s);for(;i!==null;)Z=i,$C(i),i=i.sibling;Z=s,Bc=a,St=c}Q0(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Z=i):Q0(e)}}function Q0(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:St||xf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!St)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Kn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&$0(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}$0(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 d=u.dehydrated;d!==null&&wl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}St||t.flags&512&&zm(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 X0(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 ew(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xf(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{zm(t)}catch(l){Ue(t,i,l)}break;case 5:var o=t.return;try{zm(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 fR=Math.ceil,bd=Ur.ReactCurrentDispatcher,Ky=Ur.ReactCurrentOwner,Nn=Ur.ReactCurrentBatchConfig,he=0,ut=null,tt=null,xt=0,sn=0,lo=$s(0),ot=0,Il=null,wi=0,vf=0,Gy=0,tl=null,Ft=null,Zy=0,Oo=1/0,Pr=null,kd=!1,Vm=null,_s=null,Vc=!1,fs=null,_d=0,nl=0,Um=null,Au=-1,Ru=0;function Lt(){return he&6?He():Au!==-1?Au:Au=He()}function Ss(e){return e.mode&1?he&2&&xt!==0?xt&-xt:q2.transition!==null?(Ru===0&&(Ru=wS()),Ru):(e=xe,e!==0||(e=window.event,e=e===void 0?16:ES(e.type)),e):1}function Yn(e,t,n,r){if(50<nl)throw nl=0,Um=null,Error(W(185));Yl(e,n,r),(!(he&2)||e!==ut)&&(e===ut&&(!(he&2)&&(vf|=n),ot===4&&us(e,xt)),Ht(e,r),n===1&&he===0&&!(t.mode&1)&&(Oo=He()+500,mf&&Ds()))}function Ht(e,t){var n=e.callbackNode;qA(e,t);var r=od(e,e===ut?xt:0);if(r===0)n!==null&&c0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&c0(n),t===1)e.tag===0?Z2(tw.bind(null,e)):KS(tw.bind(null,e)),W2(function(){!(he&6)&&Ds()}),n=null;else{switch(bS(r)){case 1:n=wy;break;case 4:n=xS;break;case 16:n=id;break;case 536870912:n=vS;break;default:n=id}n=WC(n,DC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function DC(e,t){if(Au=-1,Ru=0,he&6)throw Error(W(327));var n=e.callbackNode;if(_o()&&e.callbackNode!==n)return null;var r=od(e,e===ut?xt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Sd(e,r);else{t=r;var s=he;he|=2;var i=zC();(ut!==e||xt!==t)&&(Pr=null,Oo=He()+500,ci(e,t));do try{mR();break}catch(a){OC(e,a)}while(!0);Ry(),bd.current=i,he=s,tt!==null?t=0:(ut=null,xt=0,t=ot)}if(t!==0){if(t===2&&(s=gm(e),s!==0&&(r=s,t=Wm(e,s))),t===1)throw n=Il,ci(e,0),us(e,r),Ht(e,He()),n;if(t===6)us(e,r);else{if(s=e.current.alternate,!(r&30)&&!hR(s)&&(t=Sd(e,r),t===2&&(i=gm(e),i!==0&&(r=i,t=Wm(e,i))),t===1))throw n=Il,ci(e,0),us(e,r),Ht(e,He()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:Ys(e,Ft,Pr);break;case 3:if(us(e,r),(r&130023424)===r&&(t=Zy+500-He(),10<t)){if(od(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Lt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Sm(Ys.bind(null,e,Ft,Pr),t);break}Ys(e,Ft,Pr);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=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fR(r/1960))-r,10<r){e.timeoutHandle=Sm(Ys.bind(null,e,Ft,Pr),r);break}Ys(e,Ft,Pr);break;case 5:Ys(e,Ft,Pr);break;default:throw Error(W(329))}}}return Ht(e,He()),e.callbackNode===n?DC.bind(null,e):null}function Wm(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(ci(e,t).flags|=256),e=Sd(e,t),e!==2&&(t=Ft,Ft=n,t!==null&&Hm(t)),e}function Hm(e){Ft===null?Ft=e:Ft.push.apply(Ft,e)}function hR(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&=~Gy,t&=~vf,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 tw(e){if(he&6)throw Error(W(327));_o();var t=od(e,0);if(!(t&1))return Ht(e,He()),null;var n=Sd(e,t);if(e.tag!==0&&n===2){var r=gm(e);r!==0&&(t=r,n=Wm(e,r))}if(n===1)throw n=Il,ci(e,0),us(e,t),Ht(e,He()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ys(e,Ft,Pr),Ht(e,He()),null}function qy(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(Oo=He()+500,mf&&Ds())}}function bi(e){fs!==null&&fs.tag===0&&!(he&6)&&_o();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)&&Ds()}}function Yy(){sn=lo.current,Re(lo)}function ci(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,U2(n)),tt!==null)for(n=tt.return;n!==null;){var r=n;switch(Ny(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dd();break;case 3:$o(),Re(Ut),Re(Et),zy();break;case 5:Oy(r);break;case 4:$o();break;case 13:Re(De);break;case 19:Re(De);break;case 10:Ly(r.type._context);break;case 22:case 23:Yy()}n=n.return}if(ut=e,tt=e=Cs(e.current,null),xt=sn=t,ot=0,Il=null,Gy=vf=wi=0,Ft=tl=null,ni!==null){for(t=0;t<ni.length;t++)if(n=ni[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}ni=null}return e}function OC(e,t){do{var n=tt;try{if(Ry(),Tu.current=wd,vd){for(var r=Oe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}vd=!1}if(vi=0,ct=it=Oe=null,Xa=!1,Pl=0,Ky.current=null,n===null||n.return===null){ot=1,Il=t,tt=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=xt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===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=V0(o);if(p!==null){p.flags&=-257,U0(p,o,a,i,t),p.mode&1&&B0(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)){B0(i,c,t),Jy();break e}l=Error(W(426))}}else if(Me&&a.mode&1){var v=V0(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),U0(v,o,a,i,t),Iy(Do(l,a));break e}}i=l=Do(l,a),ot!==4&&(ot=2),tl===null?tl=[i]:tl.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=bC(i,l,t);M0(i,y);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(_s===null||!_s.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=kC(i,a,t);M0(i,b);break e}}i=i.return}while(i!==null)}BC(n)}catch(_){t=_,tt===n&&n!==null&&(tt=n=n.return);continue}break}while(!0)}function zC(){var e=bd.current;return bd.current=wd,e===null?wd:e}function Jy(){(ot===0||ot===3||ot===2)&&(ot=4),ut===null||!(wi&268435455)&&!(vf&268435455)||us(ut,xt)}function Sd(e,t){var n=he;he|=2;var r=zC();(ut!==e||xt!==t)&&(Pr=null,ci(e,t));do try{pR();break}catch(s){OC(e,s)}while(!0);if(Ry(),he=n,bd.current=r,tt!==null)throw Error(W(261));return ut=null,xt=0,ot}function pR(){for(;tt!==null;)FC(tt)}function mR(){for(;tt!==null&&!FA();)FC(tt)}function FC(e){var t=UC(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?BC(e):tt=t,Ky.current=null}function BC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lR(n,t),n!==null){n.flags&=32767,tt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ot=6,tt=null;return}}else if(n=aR(n,t,sn),n!==null){tt=n;return}if(t=t.sibling,t!==null){tt=t;return}tt=t=e}while(t!==null);ot===0&&(ot=5)}function Ys(e,t,n){var r=xe,s=Nn.transition;try{Nn.transition=null,xe=1,gR(e,t,n,r)}finally{Nn.transition=s,xe=r}return null}function gR(e,t,n,r){do _o();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(YA(e,i),e===ut&&(tt=ut=null,xt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vc||(Vc=!0,WC(id,function(){return _o(),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,Ky.current=null,uR(e,n),MC(n,e),$2(km),ad=!!bm,km=bm=null,e.current=n,dR(n),BA(),he=a,xe=o,Nn.transition=i}else e.current=n;if(Vc&&(Vc=!1,fs=e,_d=s),i=e.pendingLanes,i===0&&(_s=null),WA(n.stateNode),Ht(e,He()),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(kd)throw kd=!1,e=Vm,Vm=null,e;return _d&1&&e.tag!==0&&_o(),i=e.pendingLanes,i&1?e===Um?nl++:(nl=0,Um=e):nl=0,Ds(),null}function _o(){if(fs!==null){var e=bS(_d),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,_d=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:el(8,u,i)}var d=u.child;if(d!==null)d.return=u,Z=d;else for(;Z!==null;){u=Z;var h=u.sibling,p=u.return;if(AC(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 v=g.sibling;g.sibling=null,g=v}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:el(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Z=y;break e}Z=i.return}}var x=e.current;for(Z=x;Z!==null;){o=Z;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,Z=w;else e:for(o=x;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:xf(9,a)}}catch(_){Ue(a,a.return,_)}if(a===o){Z=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,Z=b;break e}Z=a.return}}if(he=s,Ds(),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(uf,e)}catch{}r=!0}return r}finally{xe=n,Nn.transition=t}}return!1}function nw(e,t,n){t=Do(n,t),t=bC(e,t,1),e=ks(e,t,1),t=Lt(),e!==null&&(Yl(e,1,t),Ht(e,t))}function Ue(e,t,n){if(e.tag===3)nw(e,e,n);else for(;t!==null;){if(t.tag===3){nw(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=Do(n,e),e=kC(t,e,1),t=ks(t,e,1),e=Lt(),t!==null&&(Yl(t,1,e),Ht(t,e));break}}t=t.return}}function yR(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Lt(),e.pingedLanes|=e.suspendedLanes&n,ut===e&&(xt&n)===n&&(ot===4||ot===3&&(xt&130023424)===xt&&500>He()-Zy?ci(e,0):Gy|=n),Ht(e,t)}function VC(e,t){t===0&&(e.mode&1?(t=Ac,Ac<<=1,!(Ac&130023424)&&(Ac=4194304)):t=1);var n=Lt();e=Br(e,t),e!==null&&(Yl(e,t,n),Ht(e,n))}function xR(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VC(e,n)}function vR(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),VC(e,n)}var UC;UC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ut.current)Bt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bt=!1,oR(e,t,n);Bt=!!(e.flags&131072)}else Bt=!1,Me&&t.flags&1048576&&GS(t,pd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Iu(e,t),e=t.pendingProps;var s=Ro(t,Et.current);ko(t,n),s=By(null,t,r,e,s,n);var i=Vy();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,Wt(r)?(i=!0,fd(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$y(t),s.updater=yf,t.stateNode=s,s._reactInternals=t,Im(t,r,e,n),t=Lm(null,t,r,!0,i,n)):(t.tag=0,Me&&i&&Ty(t),Nt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Iu(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=bR(r),e=Kn(r,e),s){case 0:t=Rm(null,t,r,e,n);break e;case 1:t=K0(null,t,r,e,n);break e;case 11:t=W0(null,t,r,e,n);break e;case 14:t=H0(null,t,r,Kn(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:Kn(r,s),Rm(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kn(r,s),K0(e,t,r,s,n);case 3:e:{if(jC(t),e===null)throw Error(W(387));r=t.pendingProps,i=t.memoizedState,s=i.element,XS(e,t),yd(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=Do(Error(W(423)),t),t=G0(e,t,r,n,s);break e}else if(r!==s){s=Do(Error(W(424)),t),t=G0(e,t,r,n,s);break e}else for(on=bs(t.stateNode.containerInfo.firstChild),ln=t,Me=!0,Zn=null,n=JS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Lo(),r===s){t=Vr(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return eC(t),e===null&&Pm(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,_m(r,s)?o=null:i!==null&&_m(r,i)&&(t.flags|=32),CC(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&Pm(t),null;case 13:return EC(e,t,n);case 4:return Dy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mo(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kn(r,s),W0(e,t,r,s,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(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(md,r._currentValue),r._currentValue=o,i!==null)if(Qn(i.value,o)){if(i.children===s.children&&!Ut.current){t=Vr(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=$r(-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),Tm(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),Tm(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}Nt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ko(t,n),s=Rn(s),r=r(s),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,s=Kn(r,t.pendingProps),s=Kn(r.type,s),H0(e,t,r,s,n);case 15:return _C(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kn(r,s),Iu(e,t),t.tag=1,Wt(r)?(e=!0,fd(t)):e=!1,ko(t,n),wC(t,r,s),Im(t,r,s,n),Lm(null,t,r,!0,e,n);case 19:return PC(e,t,n);case 22:return SC(e,t,n)}throw Error(W(156,t.tag))};function WC(e,t){return yS(e,t)}function wR(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 wR(e,t,n,r)}function Qy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bR(e){if(typeof e=="function")return Qy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yy)return 11;if(e===xy)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 Lu(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Qy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Qi:return ui(n.children,s,i,t);case gy:o=8,s|=8;break;case tm:return e=En(12,n,t,s|2),e.elementType=tm,e.lanes=i,e;case nm:return e=En(13,n,t,s),e.elementType=nm,e.lanes=i,e;case rm:return e=En(19,n,t,s),e.elementType=rm,e.lanes=i,e;case eS:return wf(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q1:o=10;break e;case X1:o=9;break e;case yy:o=11;break e;case xy: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 ui(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function wf(e,t,n,r){return e=En(22,e,r,t),e.elementType=eS,e.lanes=n,e.stateNode={isHidden:!1},e}function Oh(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function zh(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 kR(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=vh(0),this.expirationTimes=vh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vh(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xy(e,t,n,r,s,i,o,a,l){return e=new kR(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},$y(i),e}function _R(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ji,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function HC(e){if(!e)return Is;e=e._reactInternals;e:{if(ji(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(Wt(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(Wt(n))return HS(e,n,t)}return t}function KC(e,t,n,r,s,i,o,a,l){return e=Xy(n,r,!0,e,s,i,o,a,l),e.context=HC(null),n=e.current,r=Lt(),s=Ss(n),i=$r(r,s),i.callback=t??null,ks(n,i,s),e.current.lanes=s,Yl(e,s,r),Ht(e,r),e}function bf(e,t,n,r){var s=t.current,i=Lt(),o=Ss(s);return n=HC(n),t.context===null?t.context=n:t.pendingContext=n,t=$r(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),Pu(e,s,o)),o}function Cd(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 rw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ex(e,t){rw(e,t),(e=e.alternate)&&rw(e,t)}function SR(){return null}var GC=typeof reportError=="function"?reportError:function(e){console.error(e)};function tx(e){this._internalRoot=e}kf.prototype.render=tx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));bf(e,t,null,null)};kf.prototype.unmount=tx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bi(function(){bf(null,e,null,null)}),t[Fr]=null}};function kf(e){this._internalRoot=e}kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=SS();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&&jS(e)}};function nx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sw(){}function CR(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Cd(o);i.call(c)}}var o=KC(t,r,e,0,null,!1,!1,"",sw);return e._reactRootContainer=o,e[Fr]=o.current,_l(e.nodeType===8?e.parentNode:e),bi(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Cd(l);a.call(c)}}var l=Xy(e,0,!1,null,null,!1,!1,"",sw);return e._reactRootContainer=l,e[Fr]=l.current,_l(e.nodeType===8?e.parentNode:e),bi(function(){bf(t,l,n,r)}),l}function Sf(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=Cd(o);a.call(l)}}bf(t,o,e,s)}else o=CR(n,t,e,s,r);return Cd(o)}kS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ba(t.pendingLanes);n!==0&&(by(t,n|1),Ht(t,He()),!(he&6)&&(Oo=He()+500,Ds()))}break;case 13:bi(function(){var r=Br(e,1);if(r!==null){var s=Lt();Yn(r,e,1,s)}}),ex(e,1)}};ky=function(e){if(e.tag===13){var t=Br(e,134217728);if(t!==null){var n=Lt();Yn(t,e,134217728,n)}ex(e,134217728)}};_S=function(e){if(e.tag===13){var t=Ss(e),n=Br(e,t);if(n!==null){var r=Lt();Yn(n,e,t,r)}ex(e,t)}};SS=function(){return xe};CS=function(e,t){var n=xe;try{return xe=e,t()}finally{xe=n}};hm=function(e,t,n){switch(t){case"input":if(om(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=pf(r);if(!s)throw Error(W(90));nS(r),om(r,s)}}}break;case"textarea":sS(e,n);break;case"select":t=n.value,t!=null&&xo(e,!!n.multiple,t,!1)}};dS=qy;fS=bi;var jR={usingClientEntryPoint:!1,Events:[Ql,no,pf,cS,uS,qy]},Ca={findFiberByHostInstance:ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ER={bundleType:Ca.bundleType,version:Ca.version,rendererPackageName:Ca.rendererPackageName,rendererConfig:Ca.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mS(e),e===null?null:e.stateNode},findFiberByHostInstance:Ca.findFiberByHostInstance||SR,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 Uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uc.isDisabled&&Uc.supportsFiber)try{uf=Uc.inject(ER),mr=Uc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jR;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nx(t))throw Error(W(200));return _R(e,t,null,n)};pn.createRoot=function(e,t){if(!nx(e))throw Error(W(299));var n=!1,r="",s=GC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Xy(e,1,!1,null,null,n,!1,r,s),e[Fr]=t.current,_l(e.nodeType===8?e.parentNode:e),new tx(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=mS(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return bi(e)};pn.hydrate=function(e,t,n){if(!_f(t))throw Error(W(200));return Sf(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!nx(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=GC;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=KC(t,null,e,1,n??null,s,!1,i,o),e[Fr]=t.current,_l(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 kf(t)};pn.render=function(e,t,n){if(!_f(t))throw Error(W(200));return Sf(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!_f(e))throw Error(W(40));return e._reactRootContainer?(bi(function(){Sf(null,null,e,!1,function(){e._reactRootContainer=null,e[Fr]=null})}),!0):!1};pn.unstable_batchedUpdates=qy;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_f(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return Sf(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function ZC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ZC)}catch(e){console.error(e)}}ZC(),Z1.exports=pn;var Ei=Z1.exports,qC,iw=Ei;qC=iw.createRoot,iw.hydrateRoot;var Ua=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Fh(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 PR(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 TR(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}const YC=!1;function Al(e){return e[e.length-1]}function NR(e){return typeof e=="function"}function hs(e,t){return NR(e)?e(t):e}const IR=Object.prototype.hasOwnProperty,ow=Object.prototype.propertyIsEnumerable,AR=()=>Object.create(null),Ws=(e,t)=>ps(e,t,AR);function ps(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=cw(e)&&cw(s);if(!i&&!(zo(e)&&zo(s)))return s;const o=i?e:aw(e);if(!o)return s;const a=i?s:aw(s);if(!a)return s;const l=o.length,c=a.length,u=i?new Array(c):n();let d=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:IR.call(e,p))&&d++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){u[p]=g;continue}const v=ps(m,g,n,r+1);u[p]=v,v===m&&d++}return l===c&&d===l?e:u}function aw(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!ow.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(!ow.call(e,s))return!1;r.push(s)}return r}function zo(e){if(!lw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!lw(n)||!n.hasOwnProperty("isPrototypeOf"))}function lw(e){return Object.prototype.toString.call(e)==="[object Object]"}function cw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function di(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(!di(e[r],t[r],n))return!1;return!0}if(zo(e)&&zo(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)&&!di(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||!di(e[o],t[o],n)))return!1;return s===i}return!1}function Fo(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 Rl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function RR(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function uw(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 RR(t)}const LR=["http:","https:","mailto:","tel:"];function jd(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ja(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+=uw(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+uw(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function MR(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function $R(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 Dr(){throw new Error("Invariant failed")}function Ll(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,JC=5;function DR(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 rx(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=DR(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,d=l;if(u<d)return n[0]=3,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=s,n}}else if(c===36){const u=a+1,d=a+2;return d===l?(n[0]=2,n[1]=t+a,n[2]=t+u,n[3]=t+d,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+d,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 Cf(e,t,n,r,s,i,o){var l,c,u,d,h,p,m,g,v,y,x,w,b;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=(d=n.options)==null?void 0:d.skipRouteOnParseError)!=null&&h.params));for(;a<S;){const P=rx(_,a,t);let N;const A=a,R=P[5];switch(a=R+1,i++,P[0]){case 0:{const $=_.substring(P[2],P[3]);if(j){const D=(p=s.static)==null?void 0:p.get($);if(D)N=D;else{s.static??(s.static=new Map);const F=si(n.fullPath??n.from);F.parent=s,F.depth=i,N=F,s.static.set($,F)}}else{const D=$.toLowerCase(),F=(m=s.staticInsensitive)==null?void 0:m.get(D);if(F)N=F;else{s.staticInsensitive??(s.staticInsensitive=new Map);const O=si(n.fullPath??n.from);O.parent=s,O.depth=i,N=O,s.staticInsensitive.set(D,O)}}break}case 1:{const $=_.substring(A,P[1]),D=_.substring(P[4],R),F=j&&!!($||D),O=$?F?$:$.toLowerCase():void 0,M=D?F?D:D.toLowerCase():void 0,V=!E&&((g=s.dynamic)==null?void 0:g.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===O&&C.suffix===M));if(V)N=V;else{const C=Vh(1,n.fullPath??n.from,F,O,M);N=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const $=_.substring(A,P[1]),D=_.substring(P[4],R),F=j&&!!($||D),O=$?F?$:$.toLowerCase():void 0,M=D?F?D:D.toLowerCase():void 0,V=!E&&((v=s.optional)==null?void 0:v.find(C=>!C.skipOnParamError&&C.caseSensitive===F&&C.prefix===O&&C.suffix===M));if(V)N=V;else{const C=Vh(3,n.fullPath??n.from,F,O,M);N=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const $=_.substring(A,P[1]),D=_.substring(P[4],R),F=j&&!!($||D),O=$?F?$:$.toLowerCase():void 0,M=D?F?D:D.toLowerCase():void 0,V=Vh(2,n.fullPath??n.from,F,O,M);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=si(n.fullPath??n.from);P.kind=JC,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=si(n.fullPath??n.from);P.kind=ms,P.parent=s,i++,P.depth=i,s.index=P,s=P}s.parse=((x=(y=n.options)==null?void 0:y.params)==null?void 0:x.parse)??null,s.skipOnParamError=E,s.parsingPriority=((b=(w=n.options)==null?void 0:w.skipRouteOnParseError)==null?void 0:b.priority)??0,T&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Cf(e,t,_,a,s,i,o)}function Bh(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(Bh);for(const s of e.dynamic)as(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(Bh);for(const s of e.optional)as(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(Bh);for(const s of e.wildcard)as(s)}}function si(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 Vh(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 OR(e,t){const n=si("/"),r=new Uint16Array(6);for(const s of e)Cf(!1,r,s,1,n,0);as(n),t.masksTree=n,t.flatCache=Ll(1e3)}function zR(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=sx(e,t.masksTree);return t.flatCache.set(e,r),r}function FR(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=si("/"),Cf(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),sx(r,o,n)}function BR(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=sx(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=WR(i.route)),t.matchCache.set(r,i),i}function VR(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function UR(e,t=!1,n){const r=si(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return Cf(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Dr(),i[l.id]=l,a!==0&&l.path){const c=VR(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),as(r),{processedTree:{segmentTree:r,singleCache:Ll(1e3),matchCache:Ll(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function sx(e,t,n=!1){const r=e.split("/"),s=KR(e,r,t,n);if(!s)return null;const[i]=QC(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function QC(e,t,n){var u,d,h,p,m,g,v,y,x,w;const r=HR(n.node);let s=null;const i=Object.create(null);let o=((u=n.extract)==null?void 0:u.part)??0,a=((d=n.extract)==null?void 0:d.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 b=r[a];if(b.kind===ms)break;if(b.kind===JC){c--,o--,l--;continue}const _=t[o],S=l;if(_&&(l+=_.length),b.kind===1){s??(s=n.node.fullPath.split("/"));const j=s[c],E=((m=b.prefix)==null?void 0:m.length)??0;if(j.charCodeAt(E)===123){const T=((g=b.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(b.kind===3){if(n.skipped&1<<a){o--,l=S-1;continue}s??(s=n.node.fullPath.split("/"));const j=s[c],E=((v=b.prefix)==null?void 0:v.length)??0,T=((y=b.suffix)==null?void 0:y.length)??0,P=j.substring(E+3,j.length-T-1),N=b.suffix||b.prefix?_.substring(E,_.length-T):_;N&&(i[P]=decodeURIComponent(N))}else if(b.kind===2){const j=b,E=e.substring(S+(((x=j.prefix)==null?void 0:x.length)??0),e.length-(((w=j.suffix)==null?void 0:w.length)??0)),T=decodeURIComponent(E);i["*"]=T,i._splat=T;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function WR(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function HR(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function KR(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!Al(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:d,index:h,skipped:p,depth:m,statics:g,dynamics:v,optionals:y}=u;let{extract:x,rawParams:w,parsedParams:b}=u;if(d.kind===2&&d.route&&!Hc(c,u))continue;if(d.skipOnParamError){if(!dw(e,t,u))continue;w=u.rawParams,x=u.extract,b=u.parsedParams}r&&d.route&&d.kind!==ms&&Hc(l,u)&&(l=u);const _=h===o;if(_&&(d.route&&(!i||d.kind===ms||d.kind===2)&&Hc(c,u)&&(c=u),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const S=_?void 0:t[h];let j;if(_&&d.index){const E={node:d.index,index:h,skipped:p,depth:m+1,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b};let T=!0;if(d.index.skipOnParamError&&(dw(e,t,E)||(T=!1)),T){if(!v&&!y&&!p&&GR(g,o))return E;Hc(c,E)&&(c=E)}}if(d.wildcard)for(let E=d.wildcard.length-1;E>=0;E--){const T=d.wildcard[E],{prefix:P,suffix:N}=T;if(!(P&&(_||!(T.caseSensitive?S:j??(j=S.toLowerCase())).startsWith(P)))){if(N){if(_)continue;const A=t.slice(h).join("/").slice(-N.length);if((T.caseSensitive?A:A.toLowerCase())!==N)continue}a.push({node:T,index:o,skipped:p,depth:m+1,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b})}}if(d.optional){const E=p|1<<m,T=m+1;for(let P=d.optional.length-1;P>=0;P--){const N=d.optional[P];a.push({node:N,index:h,skipped:E,depth:T,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b})}if(!_)for(let P=d.optional.length-1;P>=0;P--){const N=d.optional[P],{prefix:A,suffix:R}=N;if(A||R){const $=N.caseSensitive?S:j??(j=S.toLowerCase());if(A&&!$.startsWith(A)||R&&!$.endsWith(R))continue}a.push({node:N,index:h+1,skipped:p,depth:T,statics:g,dynamics:v,optionals:y+Wc(o,h),extract:x,rawParams:w,parsedParams:b})}}if(!_&&d.dynamic&&S)for(let E=d.dynamic.length-1;E>=0;E--){const T=d.dynamic[E],{prefix:P,suffix:N}=T;if(P||N){const A=T.caseSensitive?S:j??(j=S.toLowerCase());if(P&&!A.startsWith(P)||N&&!A.endsWith(N))continue}a.push({node:T,index:h+1,skipped:p,depth:m+1,statics:g,dynamics:v+Wc(o,h),optionals:y,extract:x,rawParams:w,parsedParams:b})}if(!_&&d.staticInsensitive){const E=d.staticInsensitive.get(j??(j=S.toLowerCase()));E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Wc(o,h),dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b})}if(!_&&d.static){const E=d.static.get(S);E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:g+Wc(o,h),dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b})}if(d.pathless){const E=m+1;for(let T=d.pathless.length-1;T>=0;T--){const P=d.pathless[T];a.push({node:P,index:h,skipped:p,depth:E,statics:g,dynamics:v,optionals:y,extract:x,rawParams:w,parsedParams:b})}}}if(c)return c;if(r&&l){let u=l.index;for(let h=0;h<l.index;h++)u+=t[h].length;const d=u===e.length?"/":e.slice(u);return l.rawParams??(l.rawParams=Object.create(null)),l.rawParams["**"]=decodeURIComponent(d),l}return null}function Wc(e,t){return 2**(e-t-1)}function GR(e,t){return e===2**(t-1)-1}function dw(e,t,n){try{const[r,s]=QC(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 Mu(e){return ix(e.filter(t=>t!==void 0).join("/"))}function ix(e){return e.replace(/\/{2,}/g,"/")}function XC(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 ej(e){return js(XC(e))}function Ed(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function ZR(e,t,n){return Ed(e,n)===Ed(t,n)}function qR({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 d=r.get(o);if(d)return d}let a;if(i)a=e.split("/");else if(s)a=t.split("/");else{for(a=e.split("/");a.length>1&&Al(a)==="";)a.pop();const d=t.split("/");for(let h=0,p=d.length;h<p;h++){const m=d[h];m===""?h?h===p-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(Al(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,c="";for(let d=0;d<a.length;d++){d>0&&(c+="/");const h=a[d];if(!h)continue;l=rx(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],g=h.substring(0,l[1]),v=h.substring(l[4],m),y=h.substring(l[2],l[3]);p===1?c+=g||v?`${g}{$${y}}${v}`:`$${y}`:p===2?c+=g||v?`${g}{$}${v}`:"$":c+=`${g}{-$${y}}${v}`}c=ix(c);const u=c||"/";return o&&r&&r.set(o,u),u}function YR(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 Uh(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=>hw(s,n)).join("/"):hw(r,n)}function fw({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=rx(e,u,l);const d=l[5];if(a=d+1,u===d)continue;const h=l[0];if(h===0){c+="/"+e.substring(u,d);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],d);if(!p){s=!0,(m||g)&&(c+="/"+m+g);continue}const v=Uh("_splat",t,n);c+="/"+m+v+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],d),v=Uh(p,t,n)??"undefined";c+="/"+m+v+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]),v=e.substring(l[4],d),y=Uh(p,t,n)??"";c+="/"+g+y+v;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function hw(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function jt(e){return(e==null?void 0:e.isNotFound)===!0}function JR(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const QR="tsr-scroll-restoration-v1_3";function XR(){const e=JR();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");zo(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=hs(r,t)||t},persist:()=>{try{e.setItem(QR,JSON.stringify(t))}catch{}}}}const pw=XR(),eL=e=>e.state.__TSR_key||e.href;function tL(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 Kc=!1;const Ea="window",mw="data-scroll-restoration-id";function nL(e,t){if(!pw)return;const n=pw;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Kc=!1;const r=e.options.getScrollRestorationKey||eL,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(Kc||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(Ea,{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,d]of s){let h;if(u===Ea)h=Ea;else if(u.isConnected){const p=u.getAttribute(mw);h=p?`[${mw}="${p}"]`:tL(u)}h&&(l[h]=d)}};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 d;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}))){Kc=!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(!zo(g))continue;const{scrollX:v,scrollY:y}=g;if(!(!Number.isFinite(v)||!Number.isFinite(y))){if(m===Ea)window.scrollTo({top:y,left:v,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=v,x.scrollTop=y,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const g=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(g){const v=document.getElementById(m);v&&v.scrollIntoView(g)}}else{const g={top:0,left:0,behavior:c};if(window.scrollTo(g),u)for(const v of u){if(v===Ea)continue;const y=typeof v=="function"?v():document.querySelector(v);y&&y.scrollTo(g)}}}}finally{Kc=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function rL(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 Wh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function sL(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]=Wh(s):Array.isArray(i)?i.push(Wh(s)):n[r]=[i,Wh(s)]}return n}const iL=aL(JSON.parse),oL=lL(JSON.stringify,JSON.parse);function aL(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=sL(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function lL(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=rL(s,r);return i?`?${i}`:""}}const fi="__root__";function tj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Vt(e){return e instanceof Response&&!!e.options}function cL(e){return{input:({url:t})=>{for(const n of e)t=Km(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=nj(e[n],t);return t}}}function uL(e){const t=ej(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=Mu(["/",t,o.pathname]),o)}}function Km(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 nj(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 dL(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),d=n(e.isLoading),h=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),g=n(e.statusCode),v=n(e.redirect),y=n([]),x=n([]),w=n([]),b=r(()=>Hh(o,y.get())),_=r(()=>Hh(a,x.get())),S=r(()=>Hh(l,w.get())),j=r(()=>y.get()[0]),E=r(()=>y.get().some(O=>{var M;return((M=o.get(O))==null?void 0:M.get().status)==="pending"})),T=r(()=>{var O;return{locationHref:p.get().href,resolvedLocationHref:(O=m.get())==null?void 0:O.href,status:c.get()}}),P=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:h.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:g.get(),redirect:v.get()})),N=Ll(64);function A(O){let M=N.get(O);return M||(M=r(()=>{const V=y.get();for(const C of V){const U=o.get(C);if(U&&U.routeId===O)return U.get()}}),N.set(O,M)),M}const R={status:c,loadedAt:u,isLoading:d,isTransitioning:h,location:p,resolvedLocation:m,statusCode:g,redirect:v,matchesId:y,pendingIds:x,cachedIds:w,matches:b,pendingMatches:_,cachedMatches:S,firstId:j,hasPending:E,matchRouteDeps:T,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:P,getRouteMatchStore:A,setMatches:$,setPending:D,setCached:F};$(e.matches),i==null||i(R);function $(O){Kh(O,o,y,n,s)}function D(O){Kh(O,a,x,n,s)}function F(O){Kh(O,l,w,n,s)}return R}function Hh(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function Kh(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)}$R(n.get(),i)||n.set(i)})}const Gm=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},fL=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),jf=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),hi=(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},gw=(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(!(!Vt(n)&&!jt(n)))throw Vt(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((r=t._nonReactive.beforeLoadPromise)==null||r.resolve(),(s=t._nonReactive.loaderPromise)==null||s.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:Vt(n)?"redirected":jt(n)?"notFound":o.status==="pending"?"success":o.status,context:hi(e,t.index),isFetching:!1,error:n})),jt(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),Vt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},rj=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},yw=(e,t,n)=>{const r=hi(e,n);e.updateMatch(t,s=>({...s,context:r}))},Pa=(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,d;return(u=c._nonReactive.beforeLoadPromise)==null||u.resolve(),c._nonReactive.beforeLoadPromise=void 0,(d=c._nonReactive.loadPromise)==null||d.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!Vt(n)&&!jt(n)&&(e.serialError??(e.serialError=n))},sj=(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&&!jf(e,t)&&(n.options.loader||n.options.beforeLoad||oj(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{Gm(e)},s);r._nonReactive.pendingTimeout=o}},hL=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;sj(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()},pL=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Fo(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&Pa(e,n,o,"PARSE_PARAMS"),a&&Pa(e,n,a,"VALIDATE_SEARCH"),sj(e,t,r,s);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,b=>({...b,isFetching:"beforeLoad",fetchCount:b.fetchCount+1,abortController:l})))},d=()=>{var b;(b=s._nonReactive.beforeLoadPromise)==null||b.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Fo();const h={...hi(e,n,!1),...s.__routeContext},{search:p,params:m,cause:g}=s,v=jf(e,t),y={search:p,abortController:l,params:m,preload:v,context:h,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=b=>{if(b===void 0){e.router.batch(()=>{u(),d()});return}(Vt(b)||jt(b))&&(u(),Pa(e,n,b,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,_=>({..._,__beforeLoadContext:b})),d()})};let w;try{if(w=r.options.beforeLoad(y),Rl(w))return u(),w.catch(b=>{Pa(e,n,b,"BEFORE_LOAD")}).then(x)}catch(b){u(),Pa(e,n,b,"BEFORE_LOAD")}x(w)},mL=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>pL(e,n,t,s),a=()=>{if(rj(e,n))return;const l=hL(e,n,s);return Rl(l)?l.then(o):o()};return i()},gL=(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(([d,h,p])=>({meta:d==null?void 0:d.meta,links:d==null?void 0:d.links,headScripts:d==null?void 0:d.scripts,headers:p,scripts:h,styles:d==null?void 0:d.styles}))},ij=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=hi(e,r),d=jf(e,n);return{params:o,deps:a,preload:!!d,parentMatchPromise:i,abortController:l,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":c,route:s,...e.router.options.additionalContext}},xw=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(YC??e.router.isServer)||u.ssr===!0)&&Ml(s);const d=s.options.loader,h=typeof d=="function"?d:d==null?void 0:d.handler,p=h==null?void 0:h(ij(e,t,n,r,s)),m=!!h&&Rl(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,v=>({...v,isFetching:"loader"})),h){const v=m?await p:p;gs(e,e.router.getMatch(n),v),v!==void 0&&e.updateMatch(n,y=>({...y,loaderData:v}))}s._lazyPromise&&await s._lazyPromise;const g=u._nonReactive.minPendingPromise;g&&await g,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,v=>({...v,error:void 0,context:hi(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let h=d;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:hi(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,jt(d)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),gs(e,e.router.getMatch(n),d);try{(c=(l=s.options).onError)==null||c.call(l,d)}catch(m){h=m,gs(e,e.router.getMatch(n),m)}!Vt(h)&&!jt(h)&&await Ml(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:hi(e,r),status:"error",isFetching:!1}))}}catch(u){const d=e.router.getMatch(n);d&&(d._nonReactive.loaderPromise=void 0),gs(e,d,u)}},yL=async(e,t,n)=>{var p,m,g,v;async function r(y,x,w,b,_){const S=Date.now()-x.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(ij(e,t,s,n,_)):E,{status:P,invalid:N}=b,A=S>=j&&(!!e.forceStaleReload||b.cause==="enter"||w!==void 0&&w!==b.id);o=P==="success"&&(N||(T??A)),y&&_.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var R,$;try{await xw(e,t,s,n,_);const D=e.router.getMatch(s);(R=D._nonReactive.loaderPromise)==null||R.resolve(),($=D._nonReactive.loadPromise)==null||$.resolve(),D._nonReactive.loaderPromise=void 0,D._nonReactive.loadPromise=void 0}catch(D){Vt(D)&&await e.router.navigate(D.options)}})()):P!=="success"||o?await xw(e,t,s,n,_):yw(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(rj(e,s)){if(!e.router.getMatch(s))return e.matches[n];yw(e,s,n)}else{const y=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],w=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(_=>_.routeId===i))==null?void 0:m.id,b=jf(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(b,y,w,_,l)}else{const _=b&&!e.router.stores.matchStores.has(s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=Fo(),_!==S.preload&&e.updateMatch(s,j=>({...j,preload:_})),await r(b,y,w,S,l)}}const d=e.router.getMatch(s);a||((g=d._nonReactive.loaderPromise)==null||g.resolve(),(v=d._nonReactive.loadPromise)==null||v.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,a||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=a?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,y=>({...y,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function vw(e){var h,p;const t=e,n=[];fL(t.router)&&Gm(t);let r;for(let m=0;m<t.matches.length;m++){try{const g=mL(t,m);Rl(g)&&await g}catch(g){if(Vt(g))throw g;if(jt(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?gw(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(yL(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 v=g.reason;if(Vt(v))throw v;jt(v)?a??(a=v):l??(l=v)}if(l!==void 0)throw l}const c=a??(r&&!t.preload?r:void 0);let u=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!c&&r&&t.preload)return t.matches;if(c){const m=gw(t,c);m===void 0&&Dr();const g=t.matches[m],v=t.router.looseRoutesById[g.routeId],y=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!v.options.notFoundComponent&&y&&(v.options.notFoundComponent=y),c.routeId=g.routeId;const x=g.routeId===t.router.routeTree.id;t.updateMatch(g.id,w=>({...w,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await Ml(v,["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 Ml(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:g,routeId:v}=t.matches[m],y=t.router.looseRoutesById[v];try{const x=gL(t,g,y);if(x){const w=await x;t.updateMatch(g,b=>({...b,...w}))}}catch(x){console.error(`Error executing head for route ${v}:`,x)}}const d=Gm(t);if(Rl(d)&&await d,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function ww(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 Ml(e,t=$u){!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===$u?(()=>{if(e._componentsPromise===void 0){const r=ww(e,$u);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ww(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function oj(e){var t;for(const n of $u)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const $u=["component","errorComponent","pendingComponent","notFoundComponent"];var Es="__TSR_index",bw="popstate",kw="beforeunload";function xL(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 d,h;if((a==null?void 0:a.ignoreBlocker)??!1){o();return}const c=((d=e.getBlockers)==null?void 0:d.call(e))??[],u=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&u)for(const p of c){const m=Pd(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=_w(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=_w(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,d;const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];(d=e.setBlockers)==null||d.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 _w(e,t){t||(t={});const n=ox();return{...t,key:n,__TSR_key:n,[Es]:e}}function vL(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=()=>Pd(`${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=ox();t.history.replaceState({[Es]:0,key:P,__TSR_key:P},"")}let c=l(),u,d=!1,h=!1,p=!1,m=!1;const g=()=>c;let v,y;const x=()=>{v&&(j._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),j._ignoreSubscribers=!1,v=void 0,y=void 0,u=void 0)},w=(P,N,A)=>{const R=a(N);y||(u=c),c=Pd(N,A),v={href:R,state:A,isPush:(v==null?void 0:v.isPush)||P==="push"},y||(y=Promise.resolve().then(()=>x()))},b=P=>{c=l(),j.notify({type:P})},_=async()=>{if(h){h=!1;return}const P=l(),N=P.state[Es]-c.state[Es],A=N===1,R=N===-1,$=!A&&!R||d;d=!1;const D=$?"GO":R?"BACK":"FORWARD",F=$?{type:"GO",index:N}:{type:R?"BACK":"FORWARD"};if(p)p=!1;else{const O=i();if(typeof document<"u"&&O.length){for(const M of O)if(await M.blockerFn({currentLocation:c,nextLocation:P,action:D})){h=!0,t.history.go(1),j.notify(F);return}}}c=l(),j.notify(F)},S=P=>{if(m){m=!1;return}let N=!1;const A=i();if(typeof document<"u"&&A.length)for(const R of A){const $=R.enableBeforeUnload??!0;if($===!0){N=!0;break}if(typeof $=="function"&&$()===!0){N=!0;break}}if(N)return P.preventDefault(),P.returnValue=""},j=xL({getLocation:g,getLength:()=>t.history.length,pushState:(P,N)=>w("push",P,N),replaceState:(P,N)=>w("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=>{d=!0,t.history.go(P)},createHref:P=>a(P),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(kw,S,{capture:!0}),t.removeEventListener(bw,_)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(kw,S,{capture:!0}),t.addEventListener(bw,_),t.history.pushState=function(...P){const N=n.apply(t.history,P);return j._ignoreSubscribers||b("PUSH"),N},t.history.replaceState=function(...P){const N=r.apply(t.history,P);return j._ignoreSubscribers||b("REPLACE"),N},j}function wL(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Pd(e,t){const n=wL(e),r=n.indexOf("#"),s=n.indexOf("?"),i=ox();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 ox(){return(Math.random()+1).toString(36).substring(7)}function So(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 bL=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=YR(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=vL()),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 d;this.resolvePathCache=Ll(1e3),d=this.buildRouteTree(),this.setRoutes(d)}if(!this.stores&&this.latestLocation){const d=this.getStoreConfig(this);this.batch=d.batch,this.stores=dL(_L(this.latestLocation),d),nL(this)}let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==l||o!==c){this.basepath=l;const d=[],h=ej(l);h&&h!=="/"&&d.push(uL({basepath:l})),c&&d.push(c),this.rewrite=d.length===0?void 0:d.length===1?d[0]:cL(d),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=UR(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&OR(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:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const y=this.options.parseSearch(c),x=this.options.stringifySearch(y);return{href:l+x+u,publicHref:l+x+u,pathname:ja(l).path,external:!1,searchStr:x,search:Ws(r==null?void 0:r.search,y),hash:ja(u.slice(1)).path,state:ps(r==null?void 0:r.state,h)}}const p=new URL(d,this.origin),m=Km(this.rewrite,p),g=this.options.parseSearch(m.search),v=this.options.stringifySearch(g);return m.search=v,{href:m.href.replace(m.origin,""),publicHref:d,pathname:ja(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:v,search:Ws(r==null?void 0:r.search,g),hash:ja(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)=>qR({base:n,to:ix(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=>SL({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,d=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?d:Object.assign(d,hs(i.params,d)),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 A of g){const R=((P=A.options.params)==null?void 0:P.stringify)??A.options.stringifyParams;if(R)try{Object.assign(p,R(p))}catch{}}const v=n.leaveParams?h:ja(fw({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 A={};g.forEach(R=>{if(R.options.validateSearch)try{Object.assign(A,Du(R.options.validateSearch,{...A,...y}))}catch{}}),y=A}y=CL({search:y,dest:i,destRoutes:g,_includeValidateSearch:n._includeValidateSearch}),y=Ws(u,y);const x=this.options.stringifySearch(y),w=i.hash===!0?o.hash:i.hash?hs(i.hash,o.hash):void 0,b=w?`#${w}`:"";let _=i.state===!0?o.state:i.state?hs(i.state,o.state):{};_=ps(o.state,_);const S=`${v}${x}${b}`;let j,E,T=!1;if(this.rewrite){const A=new URL(S,this.origin),R=nj(this.rewrite,A);j=A.href.replace(A.origin,""),R.origin!==this.origin?(E=R.href,T=!0):E=R.pathname+R.search+R.hash}else j=MR(S),E=j;return{publicHref:E,href:j,pathname:v,search:y,searchStr:x,state:_,hash:w??"",external:T,unmaskOnReload:i.unmaskOnReload}},s=(i={},o)=>{const a=r(i);let l=o?r(o):void 0;if(!l){const c=Object.create(null);if(this.options.routeMasks){const u=zR(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:d,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=di(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=Fo(()=>{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 d=this.history.location.state.__TSR_index,h=Pd(a,{__TSR_index:n?d:d+1}),p=new URL(h.pathname,this.origin);l.to=Km(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 d=this.buildLocation({to:n,...o});s=s??d.publicHref,i=i??d.publicHref}const u=!a&&i?i:s;if(jd(u,this.protocolAllowlist))return Promise.resolve();if(!o.ignoreBlocker){const d=((c=(l=this.history).getBlockers)==null?void 0:c.call(l))??[];for(const h of d)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,d=So(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await vw({router:this,sync:n==null?void 0:n.sync,forceStaleReload:o.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var v,y;let h=null,p=null,m=null,g=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),w=x.length,b=this.stores.matches.get();h=w?b.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=w?b.filter(j=>!_.has(j.routeId)):null,m=w?x.filter(j=>!S.has(j.routeId)):null,g=w?x.filter(j=>S.has(j.routeId)):b,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),w&&(this.stores.setMatches(x),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(j=>j.status!=="error"&&j.status!=="notFound"&&j.status!=="redirected")]),this.clearExpiredCache())});for(const[x,w]of[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]])if(x)for(const b of x)(y=(v=this.looseRoutesById[b.routeId].options)[w])==null||y.call(v,b)})})}})}catch(u){Vt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):jt(u)&&(s=u);const d=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(d),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(So(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&&jd(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=Ml,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 vw({router:this,matches:s,location:r,preload:!0,updateMatch:(l,c)=>{i.has(l)?s=s.map(u=>u.id===l?c(u):u):this.updateMatch(l,c)}}),s}catch(l){if(Vt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});jt(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=FR(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!di(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?di(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??oL,parseSearch:e.parseSearch??iL,protocolAllowlist:e.protocolAllowlist??LR}),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 d,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?EL(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 v,y,x;{const D=(g==null?void 0:g.search)??e.search,F=(g==null?void 0:g._strictSearch)??void 0;try{const O=Du(m.options.validateSearch,{...D})??void 0;v={...D,...O},y={...F,...O},x=void 0}catch(O){let M=O;if(O instanceof Td||(M=new Td(O.message,{cause:O})),t!=null&&t.throwOnError)throw M;v=D,y={},x=M}}const w=((h=(d=m.options).loaderDeps)==null?void 0:h.call(d,{search:v}))??"",b=w?JSON.stringify(w):"",{interpolatedPath:_,usedParams:S}=fw({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),j=m.id+_+b,E=this.getMatch(j),T=u.get(m.id),P=(E==null?void 0:E._strictParams)??S;let N;if(!E)try{Sw(m,S,i,P)}catch(D){if(jt(D)||Vt(D)?N=D:N=new kL(D.message,{cause:D}),t!=null&&t.throwOnError)throw N}Object.assign(s,P);const A=T?"stay":"enter";let R;if(E)R={...E,cause:A,params:(T==null?void 0:T.params)??s,_strictParams:P,search:Ws(T?T.search:E.search,v),_strictSearch:y};else{const D=m.options.loader||m.options.beforeLoad||m.lazyFn||oj(m)?"pending":"success";R={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?Ws(T.search,v):v,_strictSearch:y,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Fo()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:A,loaderDeps:T?ps(T.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(R.globalNotFound=l===m.id),R.searchError=x;const $=this.getParentContext(g);R.context={...$,...R.__routeContext,...R.__beforeLoadContext},c[p]=R}for(let p=0;p<c.length;p++){const m=c[p],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),y=u.get(m.routeId);if(m.params=y?Ws(y.params,s):s,!v){const x=c[p-1],w=this.getParentContext(x);if(g.options.context){const b={deps:m.loaderDeps,params:m.params,context:w??{},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(b)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=Al(t),i={...e.search};for(const d of t)try{Object.assign(i,Du(d.options.validateSearch,i))}catch{}const o=Al(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 d=Object.assign(Object.create(null),n);for(const h of t)try{Sw(h,n,r??{},d)}catch{}c=d}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},Td=class extends Error{},kL=class extends Error{};function _L(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Du(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Td("Async validation not supported");if(n.issues)throw new Td(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 SL({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=js(e);let i,o;const a=BR(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 CL({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return jL(n)(e,t,r??!1)}function jL(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((d,h)=>h(d),a));const u=l(c);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((d,h)=>h(d),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,...Du(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 EL(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 fi}function Sw(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 PL="Error preloading route! ☝️";var aj=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=fi:this.parentRoute||Dr();let s=r?fi:n==null?void 0:n.path;s&&s!=="/"&&(s=XC(s));const i=(n==null?void 0:n.id)||s;let o=r?fi:Mu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Mu(["/",o]));const a=o==="__root__"?"/":Mu([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=>tj({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.")}},TL=class extends aj{constructor(e){super(e)}};function NL(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 ax(e){const t=e.errorComponent??lx;return f.jsx(IL,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?k.createElement(t,{error:n,reset:r}):e.children})}var IL=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 lx({error:e}){const[t,n]=k.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.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"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function AL({children:e,fallback:t=null}){return lj()?f.jsx(Io.Fragment,{children:e}):f.jsx(Io.Fragment,{children:t})}function lj(){return Io.useSyncExternalStore(RL,()=>!0,()=>!1)}function RL(){return()=>{}}var cj=k.createContext(null);function gn(e){return k.useContext(cj)}var Ef=k.createContext(void 0),LL=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 ML({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:i,checkDirty:o,shallowPropagate:a};function r(c,u,d){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=d,u.depsTail=p;return}const m=c.subsTail;if(m!==void 0&&m.version===d&&m.sub===u)return;const g=u.depsTail=c.subsTail={version:d,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 d=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:d.subsTail=g,g!==void 0?g.nextSub=m:(d.subs=m)===void 0&&n(d),p}function i(c){let u=c.nextSub,d;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&&(d={value:u,prev:d},u=g);continue}}if((c=u)!==void 0){u=c.nextSub;continue}for(;d!==void 0;)if(c=d.value,d=d.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function o(c,u){let d,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 v=m.subs;v.nextSub!==void 0&&a(v),p=!0}}else if((g&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(d={value:c,prev:d}),c=m.deps,u=m,++h;continue}if(!p){const v=c.nextDep;if(v!==void 0){c=v;continue}}for(;h--;){const v=u.subs,y=v.nextSub!==void 0;if(y?(c=d.value,d=d.prev):c=v,p){if(e(u)){y&&a(v),u=c.sub;continue}p=!1}else u.flags&=-33;u=c.sub;const x=c.nextDep;if(x!==void 0){c=x;continue e}}return p}while(!0)}function a(c){do{const u=c.sub,d=u.flags;(d&48)===32&&(u.flags=d|16,(d&6)===2&&t(u))}while((c=c.nextSub)!==void 0)}function l(c,u){let d=u.depsTail;for(;d!==void 0;){if(d===c)return!0;d=d.prevDep}return!1}}function $L(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 Zm=[];let Ou=0;const{link:Cw,unlink:DL,propagate:OL,checkDirty:uj,shallowPropagate:jw}=ML({update(e){return e._update()},notify(e){Zm[qm++]=e,e.flags&=~Le.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Le.Mutable|Le.Dirty,Nd(e))}});let Gc=0,qm=0,dr,Ym=0;function dj(e){try{++Ym,e()}finally{--Ym||fj()}}function Nd(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=DL(n,e)}function fj(){if(!(Ym>0)){for(;Gc<qm;){const e=Zm[Gc];Zm[Gc++]=void 0,e.notify()}Gc=0,qm=0}}function Ew(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&&Cw(s,dr,Ou),s._snapshot},subscribe(i){const o=$L(i),a={current:!1},l=zL(()=>{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,++Ou,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),Nd(s)}}};return n?(s.flags=Le.Mutable|Le.Dirty,s.get=function(){const i=s.flags;if(i&Le.Dirty||i&Le.Pending&&uj(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&jw(o)}}else i&Le.Pending&&(s.flags=i&~Le.Pending);return dr!==void 0&&Cw(s,dr,Ou),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(OL(o),jw(o),fj())}},s}function zL(e){const t=()=>{const r=dr;dr=n,++Ou,n.depsTail=void 0,n.flags=Le.Watching|Le.RecursedCheck;try{return e()}finally{dr=r,n.flags&=~Le.RecursedCheck,Nd(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&&uj(this.deps,this)?t():this.flags=Le.Watching},stop(){this.flags=Le.None,this.depsTail=void 0,Nd(this)}};return t(),n}var hj={exports:{}},pj={},mj={exports:{}},gj={};/**
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 Bo=k;function FL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BL=typeof Object.is=="function"?Object.is:FL,VL=Bo.useState,UL=Bo.useEffect,WL=Bo.useLayoutEffect,HL=Bo.useDebugValue;function KL(e,t){var n=t(),r=VL({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return WL(function(){s.value=n,s.getSnapshot=t,Gh(s)&&i({inst:s})},[e,n,t]),UL(function(){return Gh(s)&&i({inst:s}),e(function(){Gh(s)&&i({inst:s})})},[e]),HL(n),n}function Gh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!BL(e,n)}catch{return!0}}function GL(e,t){return t()}var ZL=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?GL:KL;gj.useSyncExternalStore=Bo.useSyncExternalStore!==void 0?Bo.useSyncExternalStore:ZL;mj.exports=gj;var qL=mj.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 Pf=k,YL=qL;function JL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var QL=typeof Object.is=="function"?Object.is:JL,XL=YL.useSyncExternalStore,eM=Pf.useRef,tM=Pf.useEffect,nM=Pf.useMemo,rM=Pf.useDebugValue;pj.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=eM(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=nM(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 d=m}return d=p}if(m=d,QL(u,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(u=p,m):(u=p,d=g)}var c=!1,u,d,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=XL(e,i[0],i[1]);return tM(function(){o.hasValue=!0,o.value=a},[a]),rM(a),a};hj.exports=pj;var yj=hj.exports;const sM=lf(yj);function iM(e,t){return e===t}function Gt(e,t,n=iM){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 yj.useSyncExternalStoreWithSelector(r,s,s,t,n)}var oM={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Pi(e){const t=gn(),n=k.useContext(e.from?LL:Ef),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 Gt(s??oM,o=>{if((e.shouldThrow??!0)&&!o&&Dr(),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 xj(e){return Pi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function vj(e){const{select:t,...n}=e;return Pi({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Ti(e){return Pi({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 cx(e){return Pi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function nt(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 wj(e){return Pi({...e,select:t=>e.select?e.select(t.context):t.context})}function aM(e,t){const n=gn(),r=TR(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:m,viewTransition:g,children:v,target:y,disabled:x,style:w,className:b,onClick:_,onBlur:S,onFocus:j,onMouseEnter:E,onMouseLeave:T,onTouchStart:P,ignoreBlocker:N,params:A,search:R,hash:$,state:D,mask:F,reloadDocument:O,unsafeRelative:M,from:V,_fromLocation:C,...U}=e,Q=lj(),I=k.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ge=Gt(n.stores.location,we=>we,(we,z)=>we.href===z.href),ke=k.useMemo(()=>{const we={_fromLocation:ge,...I};return n.buildLocation(we)},[n,ge,I]),ve=ke.maskedLocation?ke.maskedLocation.publicHref:ke.publicHref,Qt=ke.maskedLocation?ke.maskedLocation.external:ke.external,lt=k.useMemo(()=>hM(ve,Qt,n.history,x),[x,Qt,ve,n.history]),vn=k.useMemo(()=>{if(lt!=null&&lt.external)return jd(lt.href,n.protocolAllowlist)?void 0:lt.href;if(!pM(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),jd(a,n.protocolAllowlist)?void 0:a}catch{}},[a,lt,n.protocolAllowlist]),tr=k.useMemo(()=>{if(vn)return!1;if(o!=null&&o.exact){if(!ZR(ge.pathname,ke.pathname,n.basepath))return!1}else{const we=Ed(ge.pathname,n.basepath),z=Ed(ke.pathname,n.basepath);if(!(we.startsWith(z)&&(we.length===z.length||we[z.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!di(ge.search,ke.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&ge.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,ge,vn,Q,ke.hash,ke.pathname,ke.search,n.basepath]),br=tr?hs(s,{})??lM:Zh,Li=tr?Zh:hs(i,{})??Zh,kc=[b,br.className,Li.className].filter(Boolean).join(" "),_c=(w||br.style||Li.style)&&{...w,...br.style,...Li.style},[Sc,pa]=k.useState(!1),ma=k.useRef(!1),Kr=e.reloadDocument||vn?!1:l??n.options.defaultPreload,Mi=c??n.options.defaultPreloadDelay??0,nr=k.useCallback(()=>{n.preloadRoute({...I,_builtLocation:ke}).catch(we=>{console.warn(we),console.warn(PL)})},[n,I,ke]);PR(r,k.useCallback(we=>{we!=null&&we.isIntersecting&&nr()},[nr]),fM,{disabled:!!x||Kr!=="viewport"}),k.useEffect(()=>{ma.current||!x&&Kr==="render"&&(nr(),ma.current=!0)},[x,nr,Kr]);const fh=we=>{const z=we.currentTarget.getAttribute("target"),G=y!==void 0?y:z;if(!x&&!mM(we)&&!we.defaultPrevented&&(!G||G==="_self")&&we.button===0){we.preventDefault(),Ei.flushSync(()=>{pa(!0)});const se=n.subscribe("onResolved",()=>{se(),pa(!1)});n.navigate({...I,replace:h,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:g,ignoreBlocker:N})}};if(vn)return{...U,ref:r,href:vn,...v&&{children:v},...y&&{target:y},...x&&{disabled:x},...w&&{style:w},...b&&{className:b},..._&&{onClick:_},...S&&{onBlur:S},...j&&{onFocus:j},...E&&{onMouseEnter:E},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const Cc=we=>{if(x||Kr!=="intent")return;if(!Mi){nr();return}const z=we.currentTarget;if(Ta.has(z))return;const G=setTimeout(()=>{Ta.delete(z),nr()},Mi);Ta.set(z,G)},hh=we=>{x||Kr!=="intent"||nr()},jc=we=>{if(x||!Kr||!Mi)return;const z=we.currentTarget,G=Ta.get(z);G&&(clearTimeout(G),Ta.delete(z))};return{...U,...br,...Li,href:lt==null?void 0:lt.href,ref:r,onClick:Oi([_,fh]),onBlur:Oi([S,jc]),onFocus:Oi([j,Cc]),onMouseEnter:Oi([E,Cc]),onMouseLeave:Oi([T,jc]),onTouchStart:Oi([P,hh]),disabled:!!x,target:y,..._c&&{style:_c},...kc&&{className:kc},...x&&cM,...tr&&uM,...Q&&Sc&&dM}}var Zh={},lM={className:"active"},cM={role:"link","aria-disabled":!0},uM={"data-status":"active","aria-current":"page"},dM={"data-transitioning":"transitioning"},Ta=new WeakMap,fM={rootMargin:"100px"},Oi=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function hM(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function pM(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var bj=k.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=aM(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 mM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gM=class extends aj{constructor(e){super(e),this.useMatch=t=>Pi({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>wj({...t,from:this.id}),this.useSearch=t=>cx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ti({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>vj({...t,from:this.id}),this.useLoaderData=t=>xj({...t,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=Io.forwardRef((t,n)=>f.jsx(bj,{ref:n,from:this.fullPath,...t}))}};function ft(e){return new gM(e)}var yM=class extends TL{constructor(e){super(e),this.useMatch=t=>Pi({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>wj({...t,from:this.id}),this.useSearch=t=>cx({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Ti({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>vj({...t,from:this.id}),this.useLoaderData=t=>xj({...t,from:this.id}),this.useNavigate=()=>nt({from:this.fullPath}),this.Link=Io.forwardRef((t,n)=>f.jsx(bj,{ref:n,from:this.fullPath,...t}))}};function xM(e){return new yM(e)}function vM(e){const t=gn(),n=`not-found-${Gt(t.stores.location,r=>r.pathname)}-${Gt(t.stores.status,r=>r)}`;return f.jsx(ax,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(jt(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(jt(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function wM(){return f.jsx("p",{children:"Not Found"})}function Gi(e){return f.jsx(f.Fragment,{children:e.children})}function kj(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(wM,{})}function bM(e){return null}function kM(){return bM(gn()),null}var _j=k.memo(function({matchId:t}){const n=gn(),r=n.stores.matchStores.get(t);r||Dr();const s=Gt(n.stores.loadedAt,o=>o),i=Gt(r,o=>o);return f.jsx(_M,{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 _M({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?f.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",d=(!s.isRoot||s.options.wrapInSuspense||u)&&(s.options.wrapInSuspense??i??(((g=s.options.errorComponent)==null?void 0:g.preload)||u))?k.Suspense:Gi,h=a?ax:Gi,p=c?vM:Gi;return f.jsxs(s.isRoot?s.options.shellComponent??Gi:Gi,{children:[f.jsx(Ef.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>n,errorComponent:a||lx,onCatch:(v,y)=>{if(jt(v))throw v.routeId??(v.routeId=r.routeId),v;l==null||l(v,y)},children:f.jsx(p,{fallback:v=>{if(v.routeId??(v.routeId=r.routeId),!c||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return k.createElement(c,v)},children:u||r._displayPending?f.jsx(AL,{fallback:o,children:f.jsx(Pw,{matchId:t})}):f.jsx(Pw,{matchId:t})})})})}),r.parentRouteId===fi?f.jsxs(f.Fragment,{children:[f.jsx(SM,{resetKey:n}),e.options.scrollRestoration&&YC?f.jsx(kM,{}):null]}):null]})}function SM({resetKey:e}){const t=gn(),n=k.useRef(void 0);return Ua(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...So(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Pw=k.memo(function({matchId:t}){const n=gn(),r=(u,d)=>{var h;return((h=n.getMatch(u.id))==null?void 0:h._nonReactive[d])??u._nonReactive[d]},s=n.stores.matchStores.get(t);s||Dr();const i=Gt(s,u=>u),o=i.routeId,a=n.routesById[o],l=k.useMemo(()=>{var d;const u=(d=n.routesById[o].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:d({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?f.jsx(u,{},l):f.jsx(Jm,{})},[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 d=n.getMatch(i.id);if(d&&!d._nonReactive.minPendingPromise){const h=Fo();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return jt(i.error)||Dr(),kj(n,a,i.error);if(i.status==="redirected")throw Vt(i.error)||Dr(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Jm=k.memo(function(){const t=gn(),n=k.useContext(Ef);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=Gt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=Gt(t.stores.matchesId,u=>u[u.findIndex(d=>d===n)+1])}const o=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return o||Dr(),kj(t,o,void 0);if(!i)return null;const l=f.jsx(_j,{matchId:i});return r===fi?f.jsx(k.Suspense,{fallback:a,children:l}):l});function CM(){const e=gn(),t=k.useRef({router:e,mounted:!1}),[n,r]=k.useState(!1),s=Gt(e.stores.isLoading,d=>d),i=Gt(e.stores.hasPending,d=>d),o=Fh(s),a=s||n||i,l=Fh(a),c=s||i,u=Fh(c);return e.startTransition=d=>{r(!0),k.startTransition(()=>{d(),r(!1)})},k.useEffect(()=>{const d=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}),()=>{d()}},[e,e.history]),Ua(()=>{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]),Ua(()=>{o&&!s&&e.emit({type:"onLoad",...So(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),Ua(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...So(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),Ua(()=>{if(l&&!a){const d=So(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),dj(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),d.hrefChanged&&NL(e)}},[a,l,e]),null}function jM(){const e=gn(),t=e.routesById[fi].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Gi:k.Suspense,{fallback:n,children:[f.jsx(CM,{}),f.jsx(EM,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function EM(){const e=gn(),t=Gt(e.stores.firstId,s=>s),n=Gt(e.stores.loadedAt,s=>s),r=t?f.jsx(_j,{matchId:t}):null;return f.jsx(Ef.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(ax,{getResetKey:()=>n,errorComponent:lx,onCatch:void 0,children:r})})}var PM=e=>({createMutableStore:Ew,createReadonlyStore:Ew,batch:dj}),TM=e=>new NM(e),NM=class extends bL{constructor(e){super(e,PM)}};function IM({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(cj.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function AM({router:e,...t}){return f.jsx(IM,{router:e,...t,children:f.jsx(jM,{})})}function Qm(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 Gt(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 RM="modulepreload",LM=function(e){return"/"+e},Tw={},$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=LM(l),l in Tw)return;Tw[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":RM,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((h,p)=>{d.addEventListener("load",h),d.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 Sj(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=Sj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function MM(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Sj(e))&&(r&&(r+=" "),r+=t);return r}const ux="-",$M=e=>{const t=OM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(ux);return a[0]===""&&a.length!==1&&a.shift(),Cj(a,t)||DM(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},Cj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Cj(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(ux);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Nw=/^\[(.+)\]$/,DM=e=>{if(Nw.test(e)){const t=Nw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},OM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return FM(Object.entries(e.classGroups),n).forEach(([i,o])=>{Xm(o,r,i,t)}),r},Xm=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Iw(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(zM(s)){Xm(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Xm(o,Iw(t,i),n,r)})})},Iw=(e,t)=>{let n=e;return t.split(ux).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zM=e=>e.isThemeGetter,FM=(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,BM=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)}}},jj="!",VM=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,d;for(let v=0;v<a.length;v++){let y=a[v];if(c===0){if(y===s&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(y==="/"){d=v;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(jj),m=p?h.substring(1):h,g=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},UM=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},WM=e=>({cache:BM(e.cacheSize),parseClassName:VM(e),...$M(e)}),HM=/\s+/,KM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(HM);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,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 v=UM(u).join(":"),y=d?v+jj:v,x=y+g;if(i.includes(x))continue;i.push(x);const w=s(g,m);for(let b=0;b<w.length;++b){const _=w[b];i.push(y+_)}a=c+(a.length>0?" "+a:a)}return a};function GM(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Ej(t))&&(r&&(r+=" "),r+=n);return r}const Ej=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ej(e[r]))&&(n&&(n+=" "),n+=t);return n};function ZM(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=WM(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=KM(l,n);return s(l,u),u}return function(){return i(GM.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Pj=/^\[(?:([a-z-]+):)?(.+)\]$/i,qM=/^\d+\/\d+$/,YM=new Set(["px","full","screen"]),JM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QM=/\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$/,XM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,e$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,t$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sr=e=>Co(e)||YM.has(e)||qM.test(e),Zr=e=>Jo(e,"length",c$),Co=e=>!!e&&!Number.isNaN(Number(e)),qh=e=>Jo(e,"number",Co),Na=e=>!!e&&Number.isInteger(Number(e)),n$=e=>e.endsWith("%")&&Co(e.slice(0,-1)),ae=e=>Pj.test(e),qr=e=>JM.test(e),r$=new Set(["length","size","percentage"]),s$=e=>Jo(e,r$,Tj),i$=e=>Jo(e,"position",Tj),o$=new Set(["image","url"]),a$=e=>Jo(e,o$,d$),l$=e=>Jo(e,"",u$),Ia=()=>!0,Jo=(e,t,n)=>{const r=Pj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},c$=e=>QM.test(e)&&!XM.test(e),Tj=()=>!1,u$=e=>e$.test(e),d$=e=>t$.test(e),f$=()=>{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"),d=Ie("invert"),h=Ie("gap"),p=Ie("gradientColorStops"),m=Ie("gradientColorStopPositions"),g=Ie("inset"),v=Ie("margin"),y=Ie("opacity"),x=Ie("padding"),w=Ie("saturate"),b=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",ae,t],A=()=>[ae,t],R=()=>["",Sr,Zr],$=()=>["auto",Co,ae],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",ae],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Co,ae];return{cacheSize:500,separator:":",theme:{colors:[Ia],spacing:[Sr,Zr],blur:["none","",qr,ae],brightness:U(),borderColor:[e],borderRadius:["none","","full",qr,ae],borderSpacing:A(),borderWidth:R(),contrast:U(),grayscale:V(),hueRotate:U(),invert:V(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[n$,Zr],inset:N(),margin:N(),opacity:U(),padding:A(),saturate:U(),scale:U(),sepia:V(),skew:U(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",ae]}],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:[...D(),ae]}],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",Na,ae]}],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",ae]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Na,ae]}],"grid-cols":[{"grid-cols":[Ia]}],"col-start-end":[{col:["auto",{span:["full",Na,ae]},ae]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Ia]}],"row-start-end":[{row:["auto",{span:[Na,ae]},ae]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ae]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[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",ae,t]}],"min-w":[{"min-w":[ae,t,"min","max","fit"]}],"max-w":[{"max-w":[ae,t,"none","full","min","max","fit","prose",{screen:[qr]},qr]}],h:[{h:[ae,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ae,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ae,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ae,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",qh]}],"font-family":[{font:[Ia]}],"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",ae]}],"line-clamp":[{"line-clamp":["none",Co,qh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Sr,ae]}],"list-image":[{"list-image":["none",ae]}],"list-style-type":[{list:["none","disc","decimal",ae]}],"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:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Sr,Zr]}],"underline-offset":[{"underline-offset":["auto",Sr,ae]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae]}],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",ae]}],"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:[...D(),i$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",s$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},a$]}],"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:[...F(),"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:F()}],"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:["",...F()]}],"outline-offset":[{"outline-offset":[Sr,ae]}],"outline-w":[{outline:[Sr,Zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Sr,Zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qr,l$]}],"shadow-color":[{shadow:[Ia]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",qr,ae]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],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":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"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",ae]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",ae]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Na,ae]}],"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",ae]}],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",ae]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ae]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Sr,Zr,qh]}],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"]}}},h$=ZM(f$);function Yh(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 p$(e,t){return e[0]===t[0]&&e[1]===t[1]}function m$(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)Yh(c,a,s);const l=function(c,u,d){const h=[];for(const x of c){const w=[...x];p$(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&h.push(w)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let w=0;w<x.length-1;w++){const b=x[w],_=x[w+1];if(b[1]!==_[1]){const S=Math.min(b[1],_[1]);m.push({ymin:S,ymax:Math.max(b[1],_[1]),x:S===b[1]?b[0]:_[0],islope:(_[0]-b[0])/(_[1]-b[1])})}}if(m.sort((x,w)=>x.ymin<w.ymin?-1:x.ymin>w.ymin?1:x.x<w.x?-1:x.x>w.x?1:x.ymax===w.ymax?0:(x.ymax-w.ymax)/Math.abs(x.ymax-w.ymax)),!m.length)return p;let g=[],v=m[0].ymin,y=0;for(;g.length||m.length;){if(m.length){let x=-1;for(let w=0;w<m.length&&!(m[w].ymin>v);w++)x=w;m.splice(0,x+1).forEach(w=>{g.push({s:v,edge:w})})}if(g=g.filter(x=>!(x.edge.ymax<=v)),g.sort((x,w)=>x.edge.x===w.edge.x?0:(x.edge.x-w.edge.x)/Math.abs(x.edge.x-w.edge.x)),(d!==1||y%u==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const w=x+1;if(w>=g.length)break;const b=g[x].edge,_=g[w].edge;p.push([[Math.round(b.x),v],[Math.round(_.x),v]])}v+=d,g.forEach(x=>{x.edge.x=x.edge.x+d*x.edge.islope}),y++}return p}(o,i,r);if(s){for(const c of o)Yh(c,a,-s);(function(c,u,d){const h=[];c.forEach(p=>h.push(...p)),Yh(h,u,d)})(l,a,-s)}return l}function ec(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),m$(e,s,r,i||1)}class dx{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=ec(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 Tf(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 g$ extends dx{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=ec(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)Tf([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 y$ extends dx{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 x${constructor(t){this.helper=t}fillPolygons(t,n){const r=ec(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=Tf(a),c=l/s,u=Math.ceil(c)-1,d=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+d+m*s,v=h-o+2*Math.random()*o,y=g-o+2*Math.random()*o,x=this.helper.ellipse(v,y,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class v${constructor(t){this.helper=t}fillPolygons(t,n){const r=ec(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=Tf(o),l=Math.floor(a/(r+s)),c=(a+s-l*(r+s))/2;let u=o[0],d=o[1];u[0]>d[0]&&(u=o[1],d=o[0]);const h=Math.atan((d[1]-u[1])/(d[0]-u[0]));for(let p=0;p<l;p++){const m=p*(r+s),g=m+r,v=[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(v[0],v[1],y[0],y[1],n))}}),i}}class w${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=ec(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=Tf(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 d=0;d<a;d++){const h=2*d*n,p=2*(d+1)*n,m=Math.sqrt(2*Math.pow(n,2)),g=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],v=[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],v[0],v[1],r))}}),s}}const Ot={};class b${constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const k$=0,Jh=1,Aw=2,Zc={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 Qh(e,t){return e.type===t}function fx(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:k$,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:Jh,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Aw,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Qh(i,Aw);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return fx("M0,0"+e);s++,o=Zc[i.text],r=i.text}else Qh(i,Jh)?o=Zc[r]:(s++,o=Zc[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(!Qh(c,Jh))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof Zc[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 Nj(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 Ij(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 d=0,h=0;n==="C"||n==="S"?(d=r+(r-a),h=s+(s-l)):(d=r,h=s),t.push({key:"C",data:[d,h,...u]}),a=u[0],l=u[1],r=u[2],s=u[3];break}case"T":{const[d,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,v=s+2*(m-s)/3,y=d+2*(p-d)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[g,v,y,x,d,h]}),a=p,l=m,r=d,s=h;break}case"Q":{const[d,h,p,m]=u,g=r+2*(d-r)/3,v=s+2*(h-s)/3,y=p+2*(d-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[g,v,y,x,p,m]}),a=d,l=h,r=p,s=m;break}case"A":{const d=Math.abs(u[0]),h=Math.abs(u[1]),p=u[2],m=u[3],g=u[4],v=u[5],y=u[6];d===0||h===0?(t.push({key:"C",data:[r,s,v,y,v,y]}),r=v,s=y):(r!==v||s!==y)&&(Aj(r,s,v,y,d,h,p,m,g).forEach(function(x){t.push({key:"C",data:x})}),r=v,s=y);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function Aa(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Aj(e,t,n,r,s,i,o,a,l,c){const u=(d=o,Math.PI*d/180);var d;let h=[],p=0,m=0,g=0,v=0;if(c)[p,m,g,v]=c;else{[e,t]=Aa(e,t,-u),[n,r]=Aa(n,r,-u);const R=(e-n)/2,$=(t-r)/2;let D=R*R/(s*s)+$*$/(i*i);D>1&&(D=Math.sqrt(D),s*=D,i*=D);const F=s*s,O=i*i,M=F*O-F*$*$-O*R*R,V=F*$*$+O*R*R,C=(a===l?-1:1)*Math.sqrt(Math.abs(M/V));g=C*s*$/i+(e+n)/2,v=C*-i*R/s+(t+r)/2,p=Math.asin(parseFloat(((t-v)/i).toFixed(9))),m=Math.asin(parseFloat(((r-v)/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 R=m,$=n,D=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Aj(n=g+s*Math.cos(m),r=v+i*Math.sin(m),$,D,s,i,o,0,l,[m,R,g,v])}y=m-p;const x=Math.cos(p),w=Math.sin(p),b=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*w,t-E*x],N=[n+j*_,r-E*b],A=[n,r];if(P[0]=2*T[0]-P[0],P[1]=2*T[1]-P[1],c)return[P,N,A].concat(h);{h=[P,N,A].concat(h);const R=[];for(let $=0;$<h.length;$+=3){const D=Aa(h[$][0],h[$][1],u),F=Aa(h[$+1][0],h[$+1][1],u),O=Aa(h[$+2][0],h[$+2][1],u);R.push([D[0],D[1],F[0],F[1],O[0],O[1]])}return R}}const _$={randOffset:function(e,t){return ee(e,t)},randOffsetWithRange:function(e,t,n){return Id(e,t,n)},ellipse:function(e,t,n,r,s){const i=Lj(n,r,s);return eg(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return As(e,t,n,r,s,!0)}};function Rj(e,t,n,r,s){return{type:"path",ops:As(e,t,n,r,s)}}function zu(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?Rj(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function S$(e,t,n,r,s){return function(i,o){return zu(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Rw(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=qc(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:qc(n[0],1.5*(1+.22*t.roughness),$w(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=qc(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:qc(o,1.5*(1+.22*t.roughness),$w(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 Lj(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+=ee(o*l,n),a+=ee(a*l,n),{increment:i,rx:o,ry:a}}function eg(e,t,n,r){const[s,i]=Dw(r.increment,e,t,r.rx,r.ry,1,r.increment*Id(.1,Id(.4,1,n),n),n);let o=Ad(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=Dw(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Ad(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function Lw(e,t,n,r,s,i,o,a,l){const c=e,u=t;let d=Math.abs(n/2),h=Math.abs(r/2);d+=ee(.01*d,l),h+=ee(.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,v=Math.min(g/2,(m-p)/2),y=Ow(v,c,u,d,h,p,m,1,l);if(!l.disableMultiStroke){const x=Ow(v,c,u,d,h,p,m,1.5,l);y.push(...x)}return o&&(a?y.push(...As(c,u,c+d*Math.cos(p),u+h*Math.sin(p),l),...As(c,u,c+d*Math.cos(m),u+h*Math.sin(m),l)):y.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:y}}function Mw(e,t){const n=Ij(Nj(fx(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,d,h,p]=a;r.push(...C$(l,c,u,d,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 Xh(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]+ee(s,t),r[0][1]+ee(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+ee(s,t),r[o][1]+ee(s,t)]})}}return{type:"fillPath",ops:n}}function zi(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!Ot[s])switch(s){case"zigzag":Ot[s]||(Ot[s]=new g$(r));break;case"cross-hatch":Ot[s]||(Ot[s]=new y$(r));break;case"dots":Ot[s]||(Ot[s]=new x$(r));break;case"dashed":Ot[s]||(Ot[s]=new v$(r));break;case"zigzag-line":Ot[s]||(Ot[s]=new w$(r));break;default:s="hachure",Ot[s]||(Ot[s]=new dx(r))}return Ot[s]}(t,_$).fillPolygons(e,t)}function $w(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Mj(e){return e.randomizer||(e.randomizer=new b$(e.seed||0)),e.randomizer.next()}function Id(e,t,n,r=1){return n.roughness*r*(Mj(n)*(t-e)+e)}function ee(e,t,n=1){return Id(-e,e,t,n)}function As(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=tg(e,t,n,r,s,!0,!1);if(o)return a;const l=tg(e,t,n,r,s,!0,!0);return a.concat(l)}function tg(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 d=u/2,h=.2+.2*Mj(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=ee(p,s,c),m=ee(m,s,c);const g=[],v=()=>ee(d,s,c),y=()=>ee(u,s,c),x=s.preserveVertices;return o?g.push({op:"move",data:[e+(x?0:v()),t+(x?0:v())]}):g.push({op:"move",data:[e+(x?0:ee(u,s,c)),t+(x?0:ee(u,s,c))]}),o?g.push({op:"bcurveTo",data:[p+e+(n-e)*h+v(),m+t+(r-t)*h+v(),p+e+2*(n-e)*h+v(),m+t+2*(r-t)*h+v(),n+(x?0:v()),r+(x?0:v())]}):g.push({op:"bcurveTo",data:[p+e+(n-e)*h+y(),m+t+(r-t)*h+y(),p+e+2*(n-e)*h+y(),m+t+2*(r-t)*h+y(),n+(x?0:y()),r+(x?0:y())]}),g}function qc(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+ee(t,n),e[0][1]+ee(t,n)]),r.push([e[0][0]+ee(t,n),e[0][1]+ee(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+ee(t,n),e[s][1]+ee(t,n)]),s===e.length-1&&r.push([e[s][0]+ee(t,n),e[s][1]+ee(t,n)]);return Ad(r,null,n)}function Ad(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(...tg(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function Dw(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 d=[t+r*Math.cos(u),n+s*Math.sin(u)];l.push(d),c.push(d)}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=ee(.5,a)-Math.PI/2;c.push([ee(i,a)+t+.9*r*Math.cos(u-e),ee(i,a)+n+.9*s*Math.sin(u-e)]);const d=2*Math.PI+u-.01;for(let h=u;h<d;h+=e){const p=[ee(i,a)+t+r*Math.cos(h),ee(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([ee(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),ee(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([ee(i,a)+t+.98*r*Math.cos(u+o),ee(i,a)+n+.98*s*Math.sin(u+o)]),c.push([ee(i,a)+t+.9*r*Math.cos(u+.5*o),ee(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function Ow(e,t,n,r,s,i,o,a,l){const c=i+ee(.1,l),u=[];u.push([ee(a,l)+t+.9*r*Math.cos(c-e),ee(a,l)+n+.9*s*Math.sin(c-e)]);for(let d=c;d<=o;d+=e)u.push([ee(a,l)+t+r*Math.cos(d),ee(a,l)+n+s*Math.sin(d)]);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)]),Ad(u,null,l)}function C$(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const d=a.disableMultiStroke?1:2,h=a.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(h?0:ee(c[0],a)),o[1]+(h?0:ee(c[0],a))]}),u=h?[s,i]:[s+ee(c[p],a),i+ee(c[p],a)],l.push({op:"bcurveTo",data:[e+ee(c[p],a),t+ee(c[p],a),n+ee(c[p],a),r+ee(c[p],a),u[0],u[1]]});return l}function Ra(e){return[...e]}function zw(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(Ra(e[0]),Ra(e[1]),Ra(e[2]),Ra(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(Ra(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 Fu(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function j$(e,t,n){const r=Fu(t,n);if(r===0)return Fu(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)),Fu(e,Js(t,n,s))}function Js(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ng(e,t,n,r){const s=r||[];if(function(a,l){const c=a[l+0],u=a[l+1],d=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*d[0]-2*h[0]-c[0];g*=g;let v=3*d[1]-2*h[1]-c[1];return v*=v,p<g&&(p=g),m<v&&(m=v),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Fu(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],d=e[t+3],h=Js(l,c,.5),p=Js(c,u,.5),m=Js(u,d,.5),g=Js(h,p,.5),v=Js(p,m,.5),y=Js(g,v,.5);ng([l,h,g,y],0,n,s),ng([y,v,m,d],0,n,s)}var i,o;return s}function E$(e,t){return Rd(e,0,e.length,t)}function Rd(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 d=j$(e[u],o,a);d>l&&(l=d,c=u)}return Math.sqrt(l)>r?(Rd(e,t,c+1,r,i),Rd(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function ep(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)ng(e,3*i,t,r);return n&&n>0?Rd(r,0,r.length,n):r}const en="none";let Ld=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",[Rj(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=S$(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(Xh([c],o)):a.push(zi([c],o))}return o.stroke!==en&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Lj(r,s,o),c=eg(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=eg(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(zi([c.estimatedPoints],o));return o.stroke!==en&&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",[zu(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],d=Lw(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=Lw(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,g,v,y,x){const w=h,b=p;let _=Math.abs(m/2),S=Math.abs(g/2);_+=ee(.01*_,x),S+=ee(.01*S,x);let j=v,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)/x.curveStepCount,P=[];for(let N=j;N<=E;N+=T)P.push([w+_*Math.cos(N),b+S*Math.sin(N)]);return P.push([w+_*Math.cos(E),b+S*Math.sin(E)]),P.push([w,b]),zi([P],x)}(t,n,r,s,i,o,c));return c.stroke!==en&&u.push(d),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Rw(t,r);if(r.fill&&r.fill!==en)if(r.fillStyle==="solid"){const o=Rw(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(...ep(zw([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...ep(zw(c),10,(1+r.roughness)/2))}o.length&&s.push(zi([o],r))}return r.stroke!==en&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=zu(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Xh([t],r)):s.push(zi([t],r))),r.stroke!==en&&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!==en,o=r.stroke!==en,a=!!(r.simplification&&r.simplification<1),l=function(u,d,h){const p=Ij(Nj(fx(u))),m=[];let g=[],v=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...ep(y,d)),y=[]},w=()=>{x(),g.length&&(m.push(g),g=[])};for(const{key:_,data:S}of p)switch(_){case"M":w(),v=[S[0],S[1]],g.push(v);break;case"L":x(),g.push([S[0],S[1]]);break;case"C":if(!y.length){const j=g.length?g[g.length-1]:v;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":x(),g.push([v[0],v[1]])}if(w(),!h)return m;const b=[];for(const _ of m){const S=E$(_,h);S.length&&b.push(S)}return b}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Mw(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Mw(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(Xh(l,r));else s.push(zi(l,r));return o&&(a?l.forEach(u=>{s.push(zu(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:en};break;case"fillPath":o={d:this.opsToPath(i),stroke:en,strokeWidth:0,fill:r.fill||en};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||en,strokeWidth:r,fill:en}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},P$=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ld(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 Yc="http://www.w3.org/2000/svg";class T${constructor(t,n){this.svg=t,this.gen=new Ld(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(Yc,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(Yc,"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(Yc,"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(Yc,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",s+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o)}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o)}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o)}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}var N$={canvas:(e,t)=>new P$(e,t),svg:(e,t)=>new T$(e,t),generator:e=>new Ld(e),newSeed:()=>Ld.newSeed()};const hx=k.createContext({});function px(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const I$=typeof window<"u",$j=I$?k.useLayoutEffect:k.useEffect,Nf=k.createContext(null);function mx(e,t){e.indexOf(t)===-1&&e.push(t)}function Md(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 gx=()=>{};const Rs={},Dj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Oj=e=>typeof e=="object"&&e!==null,zj=e=>/^0[^.\s]+$/u.test(e);function Fj(e){let t;return()=>(t===void 0&&(t=e()),t)}const In=e=>e,tc=(...e)=>e.reduce((t,n)=>r=>n(t(r))),$l=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class yx{constructor(){this.subscriptions=[]}add(t){return mx(this.subscriptions,t),()=>Md(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 cn=e=>e*1e3,Pn=e=>e/1e3,Bj=(e,t)=>t?e*(1e3/t):0,Vj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,A$=1e-7,R$=12;function L$(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Vj(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>A$&&++a<R$);return o}function nc(e,t,n,r){if(e===t&&n===r)return In;const s=i=>L$(i,0,1,e,n);return i=>i===0||i===1?i:Vj(s(i),t,r)}const Uj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Wj=e=>t=>1-e(1-t),Hj=nc(.33,1.53,.69,.99),xx=Wj(Hj),Kj=Uj(xx),Gj=e=>e>=1?1:(e*=2)<1?.5*xx(e):.5*(2-Math.pow(2,-10*(e-1))),vx=e=>1-Math.sin(Math.acos(e)),Zj=Wj(vx),qj=Uj(vx),M$=nc(.42,0,1,1),$$=nc(0,0,.58,1),Yj=nc(.42,0,.58,1),D$=e=>Array.isArray(e)&&typeof e[0]!="number",Jj=e=>Array.isArray(e)&&typeof e[0]=="number",O$={linear:In,easeIn:M$,easeInOut:Yj,easeOut:$$,circIn:vx,circInOut:qj,circOut:Zj,backIn:xx,backInOut:Kj,backOut:Hj,anticipate:Gj},z$=e=>typeof e=="string",Fw=e=>{if(Jj(e)){gx(e.length===4);const[t,n,r,s]=e;return nc(t,n,r,s)}else if(z$(e))return O$[e];return e},Jc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function F$(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,d=!1,h=!1)=>{const m=h&&s?n:r;return d&&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 d=n;n=r,r=d,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const B$=40;function Qj(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Jc.reduce((w,b)=>(w[b]=F$(i),w),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:m}=o,g=()=>{const w=Rs.useManualTiming,b=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,B$),1)),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Jc.reduce((w,b)=>{const _=o[b];return w[b]=(S,j=!1,E=!1)=>(n||v(),_.schedule(S,j,E)),w},{}),cancel:w=>{for(let b=0;b<Jc.length;b++)o[Jc[b]].cancel(w)},state:s,steps:o}}const{schedule:je,cancel:Ls,state:pt,steps:tp}=Qj(typeof requestAnimationFrame<"u"?requestAnimationFrame:In,!0);let Bu;function V$(){Bu=void 0}const At={now:()=>(Bu===void 0&&At.set(pt.isProcessing||Rs.useManualTiming?pt.timestamp:performance.now()),Bu),set:e=>{Bu=e,queueMicrotask(V$)}},Xj=e=>t=>typeof t=="string"&&t.startsWith(e),eE=Xj("--"),U$=Xj("var(--"),wx=e=>U$(e)?W$.test(e.split("/*")[0].trim()):!1,W$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Bw(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Qo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Dl={...Qo,transform:e=>xr(0,1,e)},Qc={...Qo,default:1},rl=e=>Math.round(e*1e5)/1e5,bx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function H$(e){return e==null}const K$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kx=(e,t)=>n=>!!(typeof n=="string"&&K$.test(n)&&n.startsWith(e)||t&&!H$(n)&&Object.prototype.hasOwnProperty.call(n,t)),tE=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(bx);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},G$=e=>xr(0,255,e),np={...Qo,transform:e=>Math.round(G$(e))},ii={test:kx("rgb","red"),parse:tE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+np.transform(e)+", "+np.transform(t)+", "+np.transform(n)+", "+rl(Dl.transform(r))+")"};function Z$(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 rg={test:kx("#"),parse:Z$,transform:ii.transform},rc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Er=rc("deg"),yr=rc("%"),q=rc("px"),q$=rc("vh"),Y$=rc("vw"),Vw={...yr,parse:e=>yr.parse(e)/100,transform:e=>yr.transform(e*100)},co={test:kx("hsl","hue"),parse:tE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+yr.transform(rl(t))+", "+yr.transform(rl(n))+", "+rl(Dl.transform(r))+")"},et={test:e=>ii.test(e)||rg.test(e)||co.test(e),parse:e=>ii.test(e)?ii.parse(e):co.test(e)?co.parse(e):rg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ii.transform(e):co.transform(e),getAnimatableNone:e=>{const t=et.parse(e);return t.alpha=0,et.transform(t)}},J$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Q$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bx))==null?void 0:t.length)||0)+(((n=e.match(J$))==null?void 0:n.length)||0)>0}const nE="number",rE="color",X$="var",eD="var(",Uw="${}",tD=/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 Vo(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(tD,l=>(et.test(l)?(r.color.push(i),s.push(rE),n.push(et.parse(l))):l.startsWith(eD)?(r.var.push(i),s.push(X$),n.push(l)):(r.number.push(i),s.push(nE),n.push(parseFloat(l))),++i,Uw)).split(Uw);return{values:n,split:a,indexes:r,types:s}}function nD(e){return Vo(e).values}function sE({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===nE?s+=rl(r[i]):o===rE?s+=et.transform(r[i]):s+=r[i]}return s}}function rD(e){return sE(Vo(e))}const sD=e=>typeof e=="number"?0:et.test(e)?et.getAnimatableNone(e):e,iD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:sD(e);function oD(e){const t=Vo(e);return sE(t)(t.values.map((r,s)=>iD(r,t.split[s])))}const Jn={test:Q$,parse:nD,createTransformer:rD,getAnimatableNone:oD};function rp(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 aD({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=rp(l,a,e+1/3),i=rp(l,a,e),o=rp(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function $d(e,t){return n=>n>0?t:e}const Ce=(e,t,n)=>e+(t-e)*n,sp=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},lD=[rg,ii,co],cD=e=>lD.find(t=>t.test(e));function Ww(e){const t=cD(e);if(!t)return!1;let n=t.parse(e);return t===co&&(n=aD(n)),n}const Hw=(e,t)=>{const n=Ww(e),r=Ww(t);if(!n||!r)return $d(e,t);const s={...n};return i=>(s.red=sp(n.red,r.red,i),s.green=sp(n.green,r.green,i),s.blue=sp(n.blue,r.blue,i),s.alpha=Ce(n.alpha,r.alpha,i),ii.transform(s))},sg=new Set(["none","hidden"]);function uD(e,t){return sg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function dD(e,t){return n=>Ce(e,t,n)}function _x(e){return typeof e=="number"?dD:typeof e=="string"?wx(e)?$d:et.test(e)?Hw:pD:Array.isArray(e)?iE:typeof e=="object"?et.test(e)?Hw:fD:$d}function iE(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>_x(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function fD(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=_x(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function hD(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 pD=(e,t)=>{const n=Jn.createTransformer(t),r=Vo(e),s=Vo(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?sg.has(e)&&!s.values.length||sg.has(t)&&!r.values.length?uD(e,t):tc(iE(hD(r,s),s.values),n):$d(e,t)};function oE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):_x(e)(e,t)}const mD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>je.update(t,n),stop:()=>Ls(t),now:()=>pt.isProcessing?pt.timestamp:At.now()}},aE=(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)})`},Dd=2e4;function Sx(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Dd;)t+=n,r=e.next(t);return t>=Dd?1/0:t}function gD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Sx(r),Dd);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 ig(e,t){return e*Math.sqrt(1-t*t)}const yD=12;function xD(e,t,n){let r=n;for(let s=1;s<yD;s++)r=r-e(r)/t(r);return r}const ip=.001;function vD({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,d=u*e,h=u-n,p=ig(c,o),m=Math.exp(-d);return ip-h/p*m},i=c=>{const d=c*o*e,h=d*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-d),g=ig(Math.pow(c,2),o);return(-s(c)+ip>0?-1:1)*((h-p)*m)/g}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-ip+u*d},i=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=xD(s,i,a);if(e=cn(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 wD=["duration","bounce"],bD=["stiffness","damping","mass"];function Kw(e,t){return t.some(n=>e[n]!==void 0)}function kD(e){let t={velocity:Ve.velocity,stiffness:Ve.stiffness,damping:Ve.damping,mass:Ve.mass,isResolvedFromDuration:!1,...e};if(!Kw(e,bD)&&Kw(e,wD))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=vD({...e,velocity:0});t={...t,...n,mass:Ve.mass},t.isResolvedFromDuration=!0}return t}function Od(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:d,velocity:h,isResolvedFromDuration:p}=kD({...n,velocity:-Pn(n.velocity||0)}),m=h||0,g=c/(2*Math.sqrt(l*u)),v=o-i,y=Pn(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?Ve.restSpeed.granular:Ve.restSpeed.default),s||(s=x?Ve.restDelta.granular:Ve.restDelta.default);let w,b,_,S,j,E;if(g<1)_=ig(y,g),S=(m+g*y*v)/_,w=P=>{const N=Math.exp(-g*y*P);return o-N*(S*Math.sin(_*P)+v*Math.cos(_*P))},j=g*y*S+v*_,E=g*y*v-S*_,b=P=>Math.exp(-g*y*P)*(j*Math.sin(_*P)+E*Math.cos(_*P));else if(g===1){w=N=>o-Math.exp(-y*N)*(v+(m+y*v)*N);const P=m+y*v;b=N=>Math.exp(-y*N)*(y*P*N-m)}else{const P=y*Math.sqrt(g*g-1);w=$=>{const D=Math.exp(-g*y*$),F=Math.min(P*$,300);return o-D*((m+g*y*v)*Math.sinh(F)+P*v*Math.cosh(F))/P};const N=(m+g*y*v)/P,A=g*y*N-v*P,R=g*y*v-N*P;b=$=>{const D=Math.exp(-g*y*$),F=Math.min(P*$,300);return D*(A*Math.sinh(F)+R*Math.cosh(F))}}const T={calculatedDuration:p&&d||null,velocity:P=>cn(b(P)),next:P=>{if(!p&&g<1){const A=Math.exp(-g*y*P),R=Math.sin(_*P),$=Math.cos(_*P),D=o-A*(S*R+v*$),F=cn(A*(j*R+E*$));return a.done=Math.abs(F)<=r&&Math.abs(o-D)<=s,a.value=a.done?o:D,a}const N=w(P);if(p)a.done=P>=d;else{const A=cn(b(P));a.done=Math.abs(A)<=r&&Math.abs(o-N)<=s}return a.value=a.done?o:N,a},toString:()=>{const P=Math.min(Sx(T),Dd),N=aE(A=>T.next(P*A).value,P,30);return P+"ms "+N},toTransition:()=>{}};return T}Od.applyToOptions=e=>{const t=gD(e,100,Od);return e.ease=t.ease,e.duration=cn(t.duration),e.type="keyframes",e};const _D=5;function lE(e,t,n){const r=Math.max(t-_D,0);return Bj(n-e(r),t-r)}function og({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 d=e[0],h={done:!1,value:d},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 v=d+g,y=o===void 0?v:o(v);y!==v&&(g=y-d);const x=E=>-g*Math.exp(-E/r),w=E=>y+x(E),b=E=>{const T=x(E),P=w(E);h.done=Math.abs(T)<=c,h.value=h.done?y:P};let _,S;const j=E=>{p(h.value)&&(_=E,S=Od({keyframes:[h.value,m(h.value)],velocity:lE(w,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,b(E),j(E)),_!==void 0&&E>=_?S.next(E-_):(!T&&b(E),h)}}}function SD(e,t,n){const r=[],s=n||Rs.mix||oE,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=tc(l,a)}r.push(a)}return r}function CD(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(gx(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=SD(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=$l(e[d],e[d+1],u);return a[d](h)};return n?u=>c(xr(e[0],e[i-1],u)):c}function jD(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=$l(0,t,r);e.push(Ce(n,1,s))}}function ED(e){const t=[0];return jD(t,e.length-1),t}function PD(e,t){return e.map(n=>n*t)}function TD(e,t){return e.map(()=>t||Yj).splice(0,e.length-1)}function sl({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=D$(r)?r.map(Fw):Fw(r),i={done:!1,value:t[0]},o=PD(n&&n.length===t.length?n:ED(t),e),a=CD(o,t,{ease:Array.isArray(s)?s:TD(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const ND=e=>e!==null;function If(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(ND),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const ID={decay:og,inertia:og,tween:sl,keyframes:sl,spring:Od};function cE(e){typeof e.type=="string"&&(e.type=ID[e.type])}class Cx{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 AD=e=>e/100;class zd extends Cx{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;cE(t);const{type:n=sl,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||sl;l!==sl&&typeof a[0]!="number"&&(this.mixKeyframes=tc(AD,oE(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=Sx(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:d,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,b=r;if(d){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,d+1),!!(T%2)&&(h==="reverse"?(P=1-P,p&&(P-=p/a)):h==="mirror"&&(b=o)),w=xr(0,1,P)*a}let _;x?(this.delayState.value=u[0],_=this.delayState):_=b.next(w),i&&!x&&(_.value=i(_.value));let{done:S}=_;!x&&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!==og&&(_.value=If(u,this.options,v,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=cn(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 lE(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=mD,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 RD(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const oi=e=>e*180/Math.PI,ag=e=>{const t=oi(Math.atan2(e[1],e[0]));return lg(t)},LD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ag,rotateZ:ag,skewX:e=>oi(Math.atan(e[1])),skewY:e=>oi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},lg=e=>(e=e%360,e<0&&(e+=360),e),Gw=ag,Zw=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),MD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zw,scaleY:qw,scale:e=>(Zw(e)+qw(e))/2,rotateX:e=>lg(oi(Math.atan2(e[6],e[5]))),rotateY:e=>lg(oi(Math.atan2(-e[2],e[0]))),rotateZ:Gw,rotate:Gw,skewX:e=>oi(Math.atan(e[4])),skewY:e=>oi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cg(e){return e.includes("scale")?1:0}function ug(e,t){if(!e||e==="none")return cg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=MD,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=LD,s=a}if(!s)return cg(t);const i=r[t],o=s[1].split(",").map(DD);return typeof i=="function"?i(o):o[i]}const $D=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ug(n,t)};function DD(e){return parseFloat(e.trim())}const Xo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ea=new Set([...Xo,"pathRotation"]),Yw=e=>e===Qo||e===q,OD=new Set(["x","y","z"]),zD=Xo.filter(e=>!OD.has(e));function FD(e){const t=[];return zD.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})=>ug(t,"x"),y:(e,{transform:t})=>ug(t,"y")};ys.translateX=ys.x;ys.translateY=ys.y;const pi=new Set;let dg=!1,fg=!1,hg=!1;function uE(){if(fg){const e=Array.from(pi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=FD(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)})}fg=!1,dg=!1,pi.forEach(e=>e.complete(hg)),pi.clear()}function dE(){pi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fg=!0)})}function BD(){hg=!0,dE(),uE(),hg=!1}class jx{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?(pi.add(this),dg||(dg=!0,je.read(dE),je.resolveKeyframes(uE))):(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])}RD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),pi.delete(this)}cancel(){this.state==="scheduled"&&(pi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const VD=e=>e.startsWith("--");function fE(e,t,n){VD(t)?e.style.setProperty(t,n):e.style[t]=n}const UD={};function hE(e,t){const n=Fj(e);return()=>UD[t]??n()}const WD=hE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pE=hE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wa=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Jw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wa([0,.65,.55,1]),circOut:Wa([.55,0,1,.45]),backIn:Wa([.31,.01,.66,-.59]),backOut:Wa([.33,1.53,.69,.99])};function mE(e,t){if(e)return typeof e=="function"?pE()?aE(e,t):"ease-out":Jj(e)?Wa(e):Array.isArray(e)?e.map(n=>mE(n,t)||Jw.easeOut):Jw[e]}function HD(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 d=mE(a,s);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(u,h)}function gE(e){return typeof e=="function"&&"applyToOptions"in e}function KD({type:e,...t}){return gE(e)&&pE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yE extends Cx{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,gx(typeof t.type!="string");const c=KD(t);this.animation=HD(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=If(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),fE(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=cn(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&&WD()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),In):s(this)}}const xE={anticipate:Gj,backInOut:Kj,circInOut:qj};function GD(e){return e in xE}function ZD(e){typeof e.ease=="string"&&GD(e.ease)&&(e.ease=xE[e.ease])}const op=10;class qD extends yE{constructor(t){ZD(t),cE(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 zd({...o,autoplay:!1}),l=Math.max(op,At.now()-this.startTime),c=xr(0,op,l-op),u=a.sample(l).value,{name:d}=this.options;i&&d&&fE(i,d,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Qw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Jn.test(e)||e==="0")&&!e.startsWith("url("));function YD(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 JD(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=Qw(s,t),a=Qw(i,t);return!o||!a?!1:YD(e)||(n==="spring"||gE(n))&&r}function pg(e){e.duration=0,e.type="keyframes"}const vE=new Set(["opacity","clipPath","filter","transform"]),QD=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function XD(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&QD.test(e[t]))return!0;return!1}const eO=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),tO=Fj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function nO(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return tO()&&n&&(vE.has(n)||eO.has(n)&&XD(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const rO=40;class sO extends Cx{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,...d}){var m;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.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,...d},p=(u==null?void 0:u.KeyframeResolver)||jx;this.keyframeResolver=new p(a,(g,v,y)=>this.onKeyframesResolved(g,v,h,!y),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=At.now();let d=!0;JD(t,i,o,a)||(d=!1,(Rs.instantAnimations||!l)&&(u==null||u(If(t,r,n))),t[0]=t[t.length-1],pg(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>rO?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=d&&!c&&nO(p),g=(x=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:x.current;let v;if(m)try{v=new qD({...p,element:g})}catch{v=new zd(p)}else v=new zd(p);v.finished.then(()=>{this.notifyFinished()}).catch(In),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),BD()),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 wE(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 Xw=30,iO=e=>!isNaN(parseFloat(e));class oO{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=iO(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 yx);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>Xw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xw);return Bj(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 Uo(e,t){return new oO(e,t)}function bE(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Ex(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?bE(n,e):n}const aO={type:"spring",stiffness:500,damping:25,restSpeed:10},lO=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cO={type:"keyframes",duration:.8},uO={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dO=(e,{keyframes:t})=>t.length>2?cO:ea.has(e)?e.startsWith("scale")?lO(t[1]):aO:uO,fO=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function hO(e){for(const t in e)if(!fO.has(t))return!0;return!1}const Px=(e,t,n,r={},s,i)=>o=>{const a=Ex(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-cn(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};hO(a)||Object.assign(u,dO(e,u)),u.duration&&(u.duration=cn(u.duration)),u.repeatDelay&&(u.repeatDelay=cn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pg(u),u.delay===0&&(d=!0)),(Rs.instantAnimations||Rs.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(d=!0,pg(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const h=If(u.keyframes,a);if(h!==void 0){je.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new zd(u):new sO(u)},pO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mO(e){const t=pO.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function kE(e,t,n=1){const[r,s]=mO(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Dj(o)?parseFloat(o):o}return wx(s)?kE(s,t,n+1):s}function eb(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tx(e,t,n,r){if(typeof t=="function"){const[s,i]=eb(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]=eb(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function mi(e,t,n){const r=e.getProps();return Tx(r,t,n!==void 0?n:r.custom,e)}const _E=new Set(["width","height","top","left","right","bottom",...Xo]),mg=e=>Array.isArray(e);function gO(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Uo(n))}function yO(e){return mg(e)?e[e.length-1]||0:e}function xO(e,t){const n=mi(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=yO(i[o]);gO(e,o,a)}}const gt=e=>!!(e&&e.getVelocity);function vO(e){return!!(gt(e)&&e.add)}function gg(e,t){const n=e.getValue("willChange");if(vO(n))return n.add(t);if(!n&&Rs.WillChange){const r=new Rs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Nx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const wO="framerAppearId",SE="data-"+Nx(wO);function CE(e){return e.props[SE]}function bO({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function jE(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?bE(i,l):l;const c=i==null?void 0:i.reduceMotion,u=i==null?void 0:i.skipAnimations;r&&(i=r);const d=[],h=s&&e.animationState&&e.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(e,a,i,n,d);for(const m in a){const g=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||h&&bO(h,m))continue;const y={delay:n,...Ex(i||{},m)};u&&(y.skipAnimations=!0);const x=g.get();if(x!==void 0&&!g.isAnimating()&&!Array.isArray(v)&&v===x&&!y.velocity){je.update(()=>g.set(v));continue}let w=!1;if(window.MotionHandoffAnimation){const S=CE(e);if(S){const j=window.MotionHandoffAnimation(S,m,je);j!==null&&(y.startTime=j,w=!0)}}gg(e,m);const b=c??e.shouldReduceMotion;g.start(Px(m,g,v,b&&_E.has(m)?{type:!1}:y,e,w));const _=g.animation;_&&d.push(_)}if(o){const m=()=>je.update(()=>{o&&xO(e,o)});d.length?Promise.all(d).then(m):m()}return d}function yg(e,t,n={}){var l;const r=mi(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(jE(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return kO(e,t,c,u,d,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 kO(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(yg(l,t,{...o,delay:n+(typeof r=="function"?0:r)+wE(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function _O(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>yg(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=yg(e,t,n);else{const s=typeof t=="function"?mi(e,t,n.custom):t;r=Promise.all(jE(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const SO={test:e=>e==="auto",parse:e=>e},EE=e=>t=>t.test(e),PE=[Qo,q,yr,Er,Y$,q$,SO],tb=e=>PE.find(EE(e));function CO(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zj(e):!0}const jO=new Set(["brightness","contrast","saturate","opacity"]);function EO(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(bx)||[];if(!r)return e;const s=n.replace(r,"");let i=jO.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const PO=/\b([a-z-]*)\(.*?\)/gu,xg={...Jn,getAnimatableNone:e=>{const t=e.match(PO);return t?t.map(EO).join(" "):e}},vg={...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))}},nb={...Qo,transform:Math.round},TO={rotate:Er,pathRotation:Er,rotateX:Er,rotateY:Er,rotateZ:Er,scale:Qc,scaleX:Qc,scaleY:Qc,scaleZ:Qc,skew:Er,skewX:Er,skewY:Er,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Dl,originX:Vw,originY:Vw,originZ:q},Fd={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,...TO,zIndex:nb,fillOpacity:Dl,strokeOpacity:Dl,numOctaves:nb},NO={...Fd,color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,filter:xg,WebkitFilter:xg,mask:vg,WebkitMask:vg},TE=e=>NO[e],IO=new Set([xg,vg]);function NE(e,t){let n=TE(e);return IO.has(n)||(n=Jn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const AO=new Set(["auto","none","0"]);function RO(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!AO.has(i)&&Vo(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=NE(n,s)}class LO extends jx{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 d=t[u];if(typeof d=="string"&&(d=d.trim(),wx(d))){const h=kE(d,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!_E.has(r)||t.length!==2)return;const[s,i]=t,o=tb(s),a=tb(i),l=Bw(s),c=Bw(i);if(l!==c&&ys[r]){this.needsMeasurement=!0;return}if(o!==a)if(Yw(o)&&Yw(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}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||CO(t[s]))&&r.push(s);r.length&&RO(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 IE(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 wg=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Vu(e){return Oj(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Ix}=Qj(queueMicrotask,!1),Hn={x:!1,y:!1};function AE(){return Hn.x||Hn.y}function MO(e){return e==="x"||e==="y"?Hn[e]?null:(Hn[e]=!0,()=>{Hn[e]=!1}):Hn.x||Hn.y?null:(Hn.x=Hn.y=!0,()=>{Hn.x=Hn.y=!1})}function RE(e,t){const n=IE(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function $O(e){return!(e.pointerType==="touch"||AE())}function DO(e,t,n={}){const[r,s,i]=RE(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},d=v=>{c&&(c(v),c=void 0),u()},h=v=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(v))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=v=>{if(v.pointerType!=="touch"){if(a){l=!0;return}d(v)}},g=v=>{if(!$O(v))return;l=!1;const y=t(o,v);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const LE=(e,t)=>t?e===t?!0:LE(e,t.parentElement):!1,Ax=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,OO=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zO(e){return OO.has(e.tagName)||e.isContentEditable===!0}const FO=new Set(["INPUT","SELECT","TEXTAREA"]);function BO(e){return FO.has(e.tagName)||e.isContentEditable===!0}const Uu=new WeakSet;function rb(e){return t=>{t.key==="Enter"&&e(t)}}function ap(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VO=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rb(()=>{if(Uu.has(n))return;ap(n,"down");const s=rb(()=>{ap(n,"up")}),i=()=>ap(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 sb(e){return Ax(e)&&!AE()}const ib=new WeakSet;function UO(e,t,n={}){const[r,s,i]=RE(e,n),o=a=>{const l=a.currentTarget;if(!sb(a)||ib.has(a))return;Uu.add(l),n.stopPropagation&&ib.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),Uu.has(l)&&Uu.delete(l),sb(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||LE(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Vu(a)&&(a.addEventListener("focus",c=>VO(c,s)),!zO(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Rx(e){return Oj(e)&&"ownerSVGElement"in e}const Wu=new WeakMap;let rs;const ME=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Rx(r)&&"getBBox"in r?r.getBBox()[t]:r[n],WO=ME("inline","width","offsetWidth"),HO=ME("block","height","offsetHeight");function KO({target:e,borderBoxSize:t}){var n;(n=Wu.get(e))==null||n.forEach(r=>{r(e,{get width(){return WO(e,t)},get height(){return HO(e,t)}})})}function GO(e){e.forEach(KO)}function ZO(){typeof ResizeObserver>"u"||(rs=new ResizeObserver(GO))}function qO(e,t){rs||ZO();const n=IE(e);return n.forEach(r=>{let s=Wu.get(r);s||(s=new Set,Wu.set(r,s)),s.add(t),rs==null||rs.observe(r)}),()=>{n.forEach(r=>{const s=Wu.get(r);s==null||s.delete(t),s!=null&&s.size||rs==null||rs.unobserve(r)})}}const Hu=new Set;let uo;function YO(){uo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hu.forEach(t=>t(e))},window.addEventListener("resize",uo)}function JO(e){return Hu.add(e),uo||YO(),()=>{Hu.delete(e),!Hu.size&&typeof uo=="function"&&(window.removeEventListener("resize",uo),uo=void 0)}}function ob(e,t){return typeof e=="function"?JO(e):qO(e,t)}function QO(e){return Rx(e)&&e.tagName==="svg"}const XO=[...PE,et,Jn],ez=e=>XO.find(EE(e)),ab=()=>({translate:0,scale:1,origin:0,originPoint:0}),fo=()=>({x:ab(),y:ab()}),lb=()=>({min:0,max:0}),st=()=>({x:lb(),y:lb()}),tz=new WeakMap;function Af(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ol(e){return typeof e=="string"||Array.isArray(e)}const Lx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Mx=["initial",...Lx];function Rf(e){return Af(e.animate)||Mx.some(t=>Ol(e[t]))}function $E(e){return!!(Rf(e)||e.variants)}function nz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(gt(s))e.addValue(r,s);else if(gt(i))e.addValue(r,Uo(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,Uo(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bd={current:null},$x={current:!1},rz=typeof window<"u";function DE(){if($x.current=!0,!!rz)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bd.current=e.matches;e.addEventListener("change",t),t()}else Bd.current=!1}const cb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Vd={};function OE(e){Vd=e}function sz(){return Vd}class iz{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=jx,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=Rf(n),this.isVariantNode=$E(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];c[p]!==void 0&&gt(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,tz.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:($x.current||DE(),this.shouldReduceMotion=Bd.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&&vE.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,d=new yE({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:cn(u)}),h=o(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const r=ea.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 Vd){const n=Vd[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):st()}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<cb.length;r++){const s=cb[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=nz(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=Uo(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"&&(Dj(r)||zj(r))?r=parseFloat(r):!ez(r)&&Jn.test(n)&&(r=NE(t,n)),this.setBaseTarget(t,gt(r)?r.get():r)),gt(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=Tx(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&&!gt(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 yx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ix.render(this.render)}}class zE extends iz{constructor(){super(...arguments),this.KeyframeResolver=LO}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;gt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Os{constructor(t){this.isMounted=!1,this.node=t}update(){}}function FE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function az(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 lp(e){return e===void 0||e===1}function bg({scale:e,scaleX:t,scaleY:n}){return!lp(e)||!lp(t)||!lp(n)}function Qs(e){return bg(e)||BE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function BE(e){return ub(e.x)||ub(e.y)}function ub(e){return e&&e!=="0%"}function Ud(e,t,n){const r=e-n,s=t*r;return n+s}function db(e,t,n,r,s){return s!==void 0&&(e=Ud(e,s,r)),Ud(e,n,r)+t}function kg(e,t=0,n=1,r,s){e.min=db(e.min,t,n,r,s),e.max=db(e.max,t,n,r,s)}function VE(e,{x:t,y:n}){kg(e.x,t.translate,t.scale,t.originPoint),kg(e.y,n.translate,n.scale,n.originPoint)}const fb=.999999999999,hb=1.0000000000001;function lz(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,VE(e,o)),r&&Qs(i.latestValues)&&Ku(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<hb&&t.x>fb&&(t.x=1),t.y<hb&&t.y>fb&&(t.y=1)}function fr(e,t){e.min+=t,e.max+=t}function pb(e,t,n,r,s=.5){const i=Ce(e.min,e.max,s);kg(e,t,n,i,r)}function mb(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Ku(e,t,n){const r=n??e;pb(e.x,mb(t.x,r.x),t.scaleX,t.scale,t.originX),pb(e.y,mb(t.y,r.y),t.scaleY,t.scale,t.originY)}function UE(e,t){return FE(az(e.getBoundingClientRect(),t))}function cz(e,t,n){const r=UE(e,n),{scroll:s}=t;return s&&(fr(r.x,s.offset.x),fr(r.y,s.offset.y)),r}const uz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dz=Xo.length;function fz(e,t,n){let r="",s=!0;for(let o=0;o<dz;o++){const a=Xo[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=wg(l,Fd[a]);if(!c){s=!1;const d=uz[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${wg(i,Fd.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Dx(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(ea.has(l)){o=!0;continue}else if(eE(l)){s[l]=c;continue}else{const u=wg(c,Fd[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=fz(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 WE(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 gb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const La={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=gb(e,t.target.x),r=gb(e,t.target.y);return`${n}% ${r}%`}},hz={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)}},_g={borderRadius:{...La,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:La,borderTopRightRadius:La,borderBottomLeftRadius:La,borderBottomRightRadius:La,boxShadow:hz};function HE(e,{layout:t,layoutId:n}){return ea.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!_g[e]||e==="opacity")}function Ox(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)(gt(r[a])||s&&gt(s[a])||HE(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function pz(e){return window.getComputedStyle(e)}class mz extends zE{constructor(){super(...arguments),this.type="html",this.renderInstance=WE}readValueFromInstance(t,n){var r;if(ea.has(n))return(r=this.projection)!=null&&r.isProjecting?cg(n):$D(t,n);{const s=pz(t),i=(eE(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return UE(t,n)}build(t,n,r){Dx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ox(t,n,r)}}const gz={offset:"stroke-dashoffset",array:"stroke-dasharray"},yz={offset:"strokeDashoffset",array:"strokeDasharray"};function xz(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?gz:yz;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const vz=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function KE(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Dx(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox);for(const p of vz)d[p]!==void 0&&(h[p]=d[p],delete d[p]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),s!==void 0&&xz(d,s,i,o,!1)}const GE=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"]),ZE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wz(e,t,n,r){WE(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(GE.has(s)?s:Nx(s),t.attrs[s])}function qE(e,t,n){const r=Ox(e,t,n);for(const s in e)if(gt(e[s])||gt(t[s])){const i=Xo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class bz extends zE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=st}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ea.has(n)){const r=TE(n);return r&&r.default||0}return n=GE.has(n)?n:Nx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qE(t,n,r)}build(t,n,r){KE(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){wz(t,n,r,s)}mount(t){this.isSVGTag=ZE(t.tagName),super.mount(t)}}const kz=Mx.length;function YE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?YE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<kz;n++){const r=Mx[n],s=e.props[r];(Ol(s)||s===!1)&&(t[r]=s)}return t}function JE(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 _z=[...Lx].reverse(),Sz=Lx.length;function Cz(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_O(e,n,r)))}function jz(e){let t=Cz(e),n=yb(),r=!0,s=!1;const i=c=>(u,d)=>{var p;const h=mi(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:g,...v}=h;u={...u,...v,...g}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=YE(e.parent)||{},h=[],p=new Set;let m={},g=1/0;for(let y=0;y<Sz;y++){const x=_z[y],w=n[x],b=u[x]!==void 0?u[x]:d[x],_=Ol(b),S=x===c?w.isActive:null;S===!1&&(g=y);let j=b===d[x]&&b!==u[x]&&_;if(j&&(r||s)&&e.manuallyAnimateOnMount&&(j=!1),w.protectedKeys={...m},!w.isActive&&S===null||!b&&!w.prevProp||Af(b)||typeof b=="boolean")continue;if(x==="exit"&&w.isActive&&S!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const E=Ez(w.prevProp,b);let T=E||x===c&&w.isActive&&!j&&_||y>g&&_,P=!1;const N=Array.isArray(b)?b:[b];let A=N.reduce(i(x),{});S===!1&&(A={});const{prevResolvedValues:R={}}=w,$={...R,...A},D=M=>{T=!0,p.has(M)&&(P=!0,p.delete(M)),w.needsAnimating[M]=!0;const V=e.getValue(M);V&&(V.liveStyle=!1)};for(const M in $){const V=A[M],C=R[M];if(m.hasOwnProperty(M))continue;let U=!1;mg(V)&&mg(C)?U=!JE(V,C)||E:U=V!==C,U?V!=null?D(M):p.add(M):V!==void 0&&p.has(M)?D(M):w.protectedKeys[M]=!0}w.prevProp=b,w.prevResolvedValues=A,w.isActive&&(m={...m,...A}),(r||s)&&e.blockInitialAnimation&&(T=!1);const F=j&&E;T&&(!F||P)&&h.push(...N.map(M=>{const V={type:x};if(typeof M=="string"&&(r||s)&&!F&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,U=mi(C,M);if(C.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};V.delay=wE(C.enteringChildren,e,Q)}}return{animation:M,options:V}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const x=mi(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(y.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),y[x]=w??null}),h.push({animation:y})}let v=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?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 d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yb(),s=!0}}}function Ez(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JE(t,e):!1}function Hs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yb(){return{animate:Hs(!0),whileInView:Hs(),whileHover:Hs(),whileTap:Hs(),whileDrag:Hs(),whileFocus:Hs(),exit:Hs()}}function Sg(e,t){e.min=t.min,e.max=t.max}function Fn(e,t){Sg(e.x,t.x),Sg(e.y,t.y)}function xb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const QE=1e-4,Pz=1-QE,Tz=1+QE,XE=.01,Nz=0-XE,Iz=0+XE;function Rt(e){return e.max-e.min}function Az(e,t,n){return Math.abs(e-t)<=n}function vb(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>=Pz&&e.scale<=Tz||isNaN(e.scale))&&(e.scale=1),(e.translate>=Nz&&e.translate<=Iz||isNaN(e.translate))&&(e.translate=0)}function il(e,t,n,r){vb(e.x,t.x,n.x,r?r.originX:void 0),vb(e.y,t.y,n.y,r?r.originY:void 0)}function wb(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 Rz(e,t,n,r){wb(e.x,t.x,n.x,r==null?void 0:r.x),wb(e.y,t.y,n.y,r==null?void 0:r.y)}function bb(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 Wd(e,t,n,r){bb(e.x,t.x,n.x,r==null?void 0:r.x),bb(e.y,t.y,n.y,r==null?void 0:r.y)}function kb(e,t,n,r,s){return e-=t,e=Ud(e,1/n,r),s!==void 0&&(e=Ud(e,1/s,r)),e}function Lz(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=kb(e.min,t,n,a,s),e.max=kb(e.max,t,n,a,s)}function _b(e,t,[n,r,s],i,o){Lz(e,t[n],t[r],t[s],t.scale,i,o)}const Mz=["x","scaleX","originX"],$z=["y","scaleY","originY"];function Sb(e,t,n,r){_b(e.x,t,Mz,n?n.x:void 0,r?r.x:void 0),_b(e.y,t,$z,n?n.y:void 0,r?r.y:void 0)}function Cb(e){return e.translate===0&&e.scale===1}function eP(e){return Cb(e.x)&&Cb(e.y)}function jb(e,t){return e.min===t.min&&e.max===t.max}function Dz(e,t){return jb(e.x,t.x)&&jb(e.y,t.y)}function Eb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function tP(e,t){return Eb(e.x,t.x)&&Eb(e.y,t.y)}function Pb(e){return Rt(e.x)/Rt(e.y)}function Tb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lr(e){return[e("x"),e("y")]}function Oz(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:d,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotate(${d}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 nP=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],zz=nP.length,Nb=e=>typeof e=="string"?parseFloat(e):e,Ib=e=>typeof e=="number"||q.test(e);function Fz(e,t,n,r,s,i){s?(e.opacity=Ce(0,n.opacity??1,Bz(r)),e.opacityExit=Ce(t.opacity??1,0,Vz(r))):i&&(e.opacity=Ce(t.opacity??1,n.opacity??1,r));for(let o=0;o<zz;o++){const a=nP[o];let l=Ab(t,a),c=Ab(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ib(l)===Ib(c)?(e[a]=Math.max(Ce(Nb(l),Nb(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 Ab(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Bz=rP(0,.5,Zj),Vz=rP(.5,.95,In);function rP(e,t,n){return r=>r<e?0:r>t?1:n($l(e,t,r))}function Uz(e,t,n){const r=gt(e)?e:Uo(e);return r.start(Px("",r,t,n)),r.animation}function zl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Wz=(e,t)=>e.depth-t.depth;class Hz{constructor(){this.children=[],this.isDirty=!1}add(t){mx(this.children,t),this.isDirty=!0}remove(t){Md(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Wz),this.isDirty=!1,this.children.forEach(t)}}function Kz(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 Gu(e){return gt(e)?e.get():e}class Gz{constructor(){this.members=[]}add(t){mx(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&&(Md(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Md(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 Zu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},cp=["","X","Y","Z"],Zz=1e3;let qz=0;function up(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sP(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=CE(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&&sP(r)}function iP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=qz++,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(Qz),this.nodes.forEach(sF),this.nodes.forEach(iF),this.nodes.forEach(Xz)},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 Hz)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new yx),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=Rx(o)&&!QO(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,d=0;const h=()=>this.root.updateBlockedByResize=!1;je.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=Kz(h,250),Zu.hasAnimatedSinceResize&&(Zu.hasAnimatedSinceResize=!1,this.nodes.forEach(Mb)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||uF,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!tP(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Ex(m,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,x,w.path)}else d||Mb(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(oF),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&&sP(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.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(tF),this.nodes.forEach(Rb);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Lb);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nF),this.nodes.forEach(rF),this.nodes.forEach(Yz),this.nodes.forEach(Jz)):this.nodes.forEach(Lb),this.clearAllSnapshots();const a=At.now();pt.delta=xr(0,1e3/60,a-pt.timestamp),pt.timestamp=a,pt.isProcessing=!0,tp.update.process(pt),tp.preRender.process(pt),tp.render.process(pt),pt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ix.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eF),this.sharedNodes.forEach(aF)}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=st()),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&&!eP(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||Qs(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)),dF(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return st();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(fF))){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=st();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:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&Fn(a,o),fr(a.x,d.offset.x),fr(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l){var u,d;const c=l||st();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)),Qs(p.latestValues)&&Ku(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return Qs(this.latestValues)&&Ku(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(o){var l;const a=st();Fn(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Qs(u.latestValues))continue;let d;u.instance&&(bg(u.latestValues)&&u.updateSnapshot(),d=st(),Fn(d,u.measurePageBox())),Sb(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,d)}return Qs(this.latestValues)&&Sb(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!==pt.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:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=pt.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=st(),this.targetWithTransforms=st()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Rz(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),VE(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||bg(this.parent.latestValues)||BE(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=st(),this.relativeTargetOrigin=st(),Wd(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===pt.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 d=this.treeScale.x,h=this.treeScale.y;lz(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=st());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xb(this.prevProjectionDelta.x,this.projectionDelta.x),xb(this.prevProjectionDelta.y,this.projectionDelta.y)),il(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Tb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Tb(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=fo(),this.projectionDelta=fo(),this.projectionDeltaWithTransform=fo()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=fo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=st(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,v=m!==g,y=this.getStack(),x=!y||y.members.length<=1,w=!!(v&&!x&&this.options.crossfade===!0&&!this.path.some(cF));this.animationProgress=0;let b;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):($b(h.x,o.x,j),$b(h.y,o.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lF(this.relativeTarget,this.relativeTargetOrigin,p,j),b&&Dz(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=st()),Fn(b,this.relativeTarget)),v&&(this.animationValues=d,Fz(d,u,this.latestValues,j,w,x)),E&&E.rotate!==void 0&&(this.animationValues||(this.animationValues=d),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(()=>{Zu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Uo(0)),this.motionValue.jump(0,!1),this.currentAnimation=Uz(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(Zz),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&&oP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||st();const d=Rt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=Rt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Fn(a,l),Ku(a,u),il(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Gz),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&&up("z",o,c,this.animationValues);for(let u=0;u<cp.length;u++)up(`rotate${cp[u]}`,o,c,this.animationValues),up(`skew${cp[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=Gu(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=Gu(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Qs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Oz(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),o.transform=d;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 _g){if(u[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=_g[m],x=d==="none"?u[m]:g(u[m],c);if(v){const w=v.length;for(let b=0;b<w;b++)o[v[b]]=x}else y?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?Gu(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(Rb),this.root.sharedNodes.clear()}}}function Yz(e){e.updateLayout()}function Jz(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(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=Rt(h);h.min=r[d].min,h.max=h.min+p});else if(i==="x"||i==="y"){const d=i==="x"?"y":"x";Sg(o?t.measuredBox[d]:t.layoutBox[d],r[d])}else oP(i,t.layoutBox,r)&&lr(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=Rt(r[d]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=fo();il(a,r,t.layoutBox);const l=fo();o?il(l,e.applyTransform(s,!0),t.measuredBox):il(l,r,t.layoutBox);const c=!eP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const m=e.options.layoutAnchor||void 0,g=st();Wd(g,t.layoutBox,h.layoutBox,m);const v=st();Wd(v,r,p.layoutBox,m),tP(g,v)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=d)}}}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 Qz(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 Xz(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eF(e){e.clearSnapshot()}function Rb(e){e.clearMeasurements()}function tF(e){e.isLayoutDirty=!0,e.updateLayout()}function Lb(e){e.isLayoutDirty=!1}function nF(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rF(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function sF(e){e.resolveTargetDelta()}function iF(e){e.calcProjection()}function oF(e){e.resetSkewAndRotation()}function aF(e){e.removeLeadSnapshot()}function $b(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 Db(e,t,n,r){e.min=Ce(t.min,n.min,r),e.max=Ce(t.max,n.max,r)}function lF(e,t,n,r){Db(e.x,t.x,n.x,r),Db(e.y,t.y,n.y,r)}function cF(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uF={duration:.45,ease:[.4,0,.1,1]},Ob=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),zb=Ob("applewebkit/")&&!Ob("chrome/")?Math.round:In;function Fb(e){e.min=zb(e.min),e.max=zb(e.max)}function dF(e){Fb(e.x),Fb(e.y)}function oP(e,t,n){return e==="position"||e==="preserve-aspect"&&!Az(Pb(t),Pb(n),.2)}function fF(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const hF=iP({attachResizeListener:(e,t)=>zl(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}),dp={current:void 0},aP=iP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dp.current){const e=new hF({});e.mount(window),e.setOptions({layoutScroll:!0}),dp.current=e}return dp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zx=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Bb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pF(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Bb(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():Bb(e[s],null)}}}}function mF(...e){return k.useCallback(pF(...e),e)}class gF extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Vu(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Vu(r)&&r.offsetWidth||0,i=Vu(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 yF({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(zx),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=mF(a,u);return k.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:v,right:y,bottom:x,direction:w}=l.current;if(t||i===!1||!a.current||!p||!m)return;const b=w==="rtl",_=n==="left"?b?`right: ${y}`:`left: ${v}`:b?`left: ${v}`:`right: ${y}`,S=r==="bottom"?`bottom: ${x}`:`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]),f.jsx(gF,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:k.cloneElement(e,{ref:d})})}const xF=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=px(vF),d=k.useId();let h=!0,p=k.useMemo(()=>(h=!1,{id:d,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=f.jsx(yF,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),f.jsx(Nf.Provider,{value:p,children:e})};function vF(){return new Map}function lP(e=!0){const t=k.useContext(Nf);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 Xc=e=>e.key||"";function Vb(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const wF=({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,d]=lP(o),h=k.useMemo(()=>Vb(e),[e]),p=o&&!u?[]:h.map(Xc),m=k.useRef(!0),g=k.useRef(h),v=px(()=>new Map),y=k.useRef(new Set),[x,w]=k.useState(h),[b,_]=k.useState(h);$j(()=>{m.current=!1,g.current=h;for(let E=0;E<b.length;E++){const T=Xc(b[E]);p.includes(T)?(v.delete(T),y.current.delete(T)):v.get(T)!==!0&&v.set(T,!1)}},[b,p.length,p.join("-")]);const S=[];if(h!==x){let E=[...h];for(let T=0;T<b.length;T++){const P=b[T],N=Xc(P);p.includes(N)||(E.splice(T,0,P),S.push(P))}return i==="wait"&&S.length&&(E=S),_(Vb(E)),w(h),null}const{forceRender:j}=k.useContext(hx);return f.jsx(f.Fragment,{children:b.map(E=>{const T=Xc(E),P=o&&!u?!1:h===b||p.includes(T),N=()=>{if(y.current.has(T))return;if(v.has(T))y.current.add(T),v.set(T,!0);else return;let A=!0;v.forEach(R=>{R||(A=!1)}),A&&(j==null||j(),_(g.current),o&&(d==null||d()),r&&r())};return f.jsx(xF,{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)})})},cP=k.createContext({strict:!1}),Ub={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 Wb=!1;function bF(){if(Wb)return;const e={};for(const t in Ub)e[t]={isEnabled:n=>Ub[t].some(r=>!!n[r])};OE(e),Wb=!0}function uP(){return bF(),sz()}function kF(e){const t=uP();for(const n in e)t[n]={...t[n],...e[n]};OE(t)}const _F=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")||_F.has(e)}let dP=e=>!Hd(e);function SF(e){typeof e=="function"&&(dP=t=>t.startsWith("on")?!Hd(t):e(t))}try{SF(require("@emotion/is-prop-valid").default)}catch{}function CF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||gt(e[s])||(dP(s)||n===!0&&Hd(s)||!t&&!Hd(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Lf=k.createContext({});function jF(e,t){if(Rf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ol(n)?n:void 0,animate:Ol(r)?r:void 0}}return e.inherit!==!1?t:{}}function EF(e){const{initial:t,animate:n}=jF(e,k.useContext(Lf));return k.useMemo(()=>({initial:t,animate:n}),[Hb(t),Hb(n)])}function Hb(e){return Array.isArray(e)?e.join(" "):e}const Fx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fP(e,t,n){for(const r in t)!gt(t[r])&&!HE(r,n)&&(e[r]=t[r])}function PF({transformTemplate:e},t){return k.useMemo(()=>{const n=Fx();return Dx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function TF(e,t){const n=e.style||{},r={};return fP(r,n,e),Object.assign(r,PF(e,t)),r}function NF(e,t){const n={},r=TF(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 hP=()=>({...Fx(),attrs:{}});function IF(e,t,n,r){const s=k.useMemo(()=>{const i=hP();return KE(i,t,ZE(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};fP(i,e.style,e),s.style={...i,...s.style}}return s}const AF=["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 Bx(e){return typeof e!="string"||e.includes("-")?!1:!!(AF.indexOf(e)>-1||/[A-Z]/u.test(e))}function RF(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??Bx(e)?IF:NF)(t,r,s,e),c=CF(t,typeof e=="string",i),u=e!==k.Fragment?{...c,...l,ref:n}:{},{children:d}=t,h=k.useMemo(()=>gt(d)?d.get():d,[d]);return k.createElement(e,{...u,children:h})}function LF({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:MF(n,r,s,e),renderState:t()}}function MF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Gu(i[h]);let{initial:o,animate:a}=e;const l=Rf(e),c=$E(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 d=u?a:o;if(d&&typeof d!="boolean"&&!Af(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const m=Tx(e,h[p]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const x in y){let w=y[x];if(Array.isArray(w)){const b=u?w.length-1:0;w=w[b]}w!==null&&(s[x]=w)}for(const x in g)s[x]=g[x]}}}return s}const pP=e=>(t,n)=>{const r=k.useContext(Lf),s=k.useContext(Nf),i=()=>LF(e,t,r,s);return n?i():px(i)},$F=pP({scrapeMotionValuesFromProps:Ox,createRenderState:Fx}),DF=pP({scrapeMotionValuesFromProps:qE,createRenderState:hP}),OF=Symbol.for("motionComponentSymbol");function zF(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 mP=k.createContext({});function Zi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FF(e,t,n,r,s,i){var w,b;const{visualElement:o}=k.useContext(Lf),a=k.useContext(cP),l=k.useContext(Nf),c=k.useContext(zx),u=c.reducedMotion,d=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:d,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,g=k.useContext(mP);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&BF(h.current,n,s,g);const v=k.useRef(!1);k.useInsertionEffect(()=>{m&&v.current&&m.update(n,l)});const y=n[SE],x=k.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,y)));return $j(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),k.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)==null||_.call(window,y)}),x.current=!1),m.enteringChildren=void 0)}),m}function BF(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gP(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Zi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function gP(e){if(e)return e.options.allowProjection!==!1?e.projection:gP(e.parent)}function fp(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&kF(r);const i=n?n==="svg":Bx(e),o=i?DF:$F;function a(c,u){let d;const h={...k.useContext(zx),...c,layoutId:VF(c)},{isStatic:p}=h,m=EF(c),g=o(c,p);if(!p&&typeof window<"u"){UF();const v=WF(h);d=v.MeasureLayout,m.visualElement=FF(e,g,h,s,v.ProjectionNode,i)}return f.jsxs(Lf.Provider,{value:m,children:[d&&m.visualElement?f.jsx(d,{visualElement:m.visualElement,...h}):null,RF(e,c,zF(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[OF]=e,l}function VF({layoutId:e}){const t=k.useContext(hx).id;return t&&e!==void 0?t+"-"+e:e}function UF(e,t){k.useContext(cP).strict}function WF(e){const t=uP(),{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 HF(e,t){if(typeof Proxy>"u")return fp;const n=new Map,r=(i,o)=>fp(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,fp(o,void 0,e,t)),n.get(o))})}const KF=(e,t)=>t.isSVG??Bx(e)?new bz(t):new mz(t,{allowProjection:e!==k.Fragment});class GF extends Os{constructor(t){super(t),t.animationState||(t.animationState=jz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Af(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 ZF=0;class qF extends Os{constructor(){super(...arguments),this.id=ZF++,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=mi(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...d}=l;for(const h in d)(i=this.node.getValue(h))==null||i.jump(d[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 YF={animation:{Feature:GF},exit:{Feature:qF}};function sc(e){return{point:{x:e.pageX,y:e.pageY}}}const JF=e=>t=>Ax(t)&&e(t,sc(t));function ol(e,t,n,r){return zl(e,t,JF(n),r)}const yP=({current:e})=>e?e.ownerDocument.defaultView:null,Kb=(e,t)=>Math.abs(e-t);function QF(e,t){const n=Kb(e.x,t.x),r=Kb(e.y,t.y);return Math.sqrt(n**2+r**2)}const Gb=new Set(["auto","scroll"]);class xP{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=eu(this.lastRawMoveEventInfo,this.transformPagePoint));const p=hp(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=QF(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:v}=p,{timestamp:y}=pt;this.history.push({...v,timestamp:y});const{onStart:x,onMove:w}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=eu(m,this.transformPagePoint),je.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=hp(p.type==="pointercancel"?this.lastMoveEventInfo:eu(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,x),v&&v(p,x)},!Ax(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=sc(t),c=eu(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=pt;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=n;h&&h(t,hp(c,this.history)),this.removeListeners=tc(ol(this.contextWindow,"pointermove",this.handlePointerMove),ol(this.contextWindow,"pointerup",this.handlePointerUp),ol(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Gb.has(r.overflowX)||Gb.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 eu(e,t){return t?{point:t(e.point)}:e}function Zb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hp({point:e},t){return{point:e,delta:Zb(e,vP(t)),offset:Zb(e,XF(t)),velocity:e3(t,.1)}}function XF(e){return e[0]}function vP(e){return e[e.length-1]}function e3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=vP(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>cn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>cn(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 t3(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 qb(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 n3(e,{top:t,left:n,bottom:r,right:s}){return{x:qb(e.x,n,s),y:qb(e.y,t,r)}}function Yb(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 r3(e,t){return{x:Yb(e.x,t.x),y:Yb(e.y,t.y)}}function s3(e,t){let n=.5;const r=Rt(e),s=Rt(t);return s>r?n=$l(t.min,t.max-r,e.min):r>s&&(n=$l(e.min,e.max-s,t.min)),xr(0,1,n)}function i3(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 Cg=.35;function o3(e=Cg){return e===!1?e=0:e===!0&&(e=Cg),{x:Jb(e,"left","right"),y:Jb(e,"top","bottom")}}function Jb(e,t,n){return{min:Qb(e,t),max:Qb(e,n)}}function Qb(e,t){return typeof e=="number"?e:e[t]||0}const a3=new WeakMap;class l3{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=st(),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=d=>{n&&this.snapToCursor(sc(d).point),this.stopAnimation()},o=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MO(p),!this.openDragLock))return;this.latestPointerEvent=d,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 x=this.getAxisMotionValue(y).get()||0;if(yr.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[y];b&&(x=Rt(b)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&je.update(()=>g(d,h),!1,!0),gg(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=u3(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),v&&je.update(()=>v(d,h),!1,!0)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new xP(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:yP(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||!tu(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=t3(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&&Zi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=n3(r.layoutBox,t):this.constraints=!1,this.elastic=o3(n),s!==this.constraints&&!Zi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&lr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=i3(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Zi(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=cz(r,s.root,this.visualElement.getTransformPagePoint());let o=r3(s.layout.layoutBox,i);if(n){const a=n(oz(o));this.hasMutatedConstraints=!!a,a&&(o=FE(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(!tu(u,n,this.currentDirection))return;let d=l&&l[u]||{};(o===!0||o===u)&&(d={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,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return gg(this.visualElement,t),r.start(Px(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(!tu(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(!Zi(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]=s3({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(!tu(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;a3.set(this.visualElement,this);const t=this.visualElement.current,n=ol(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&BO(h);u&&d&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Zi(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=c3(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=zl(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(lr(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].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=Cg,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Xb(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function c3(e,t,n){const r=ob(e,Xb(n)),s=ob(t,Xb(n));return()=>{r(),s()}}function tu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function u3(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class d3 extends Os{constructor(t){super(t),this.removeGroupControls=In,this.removeListeners=In,this.controls=new l3(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 pp=e=>(t,n)=>{e&&je.update(()=>e(t,n),!1,!0)};class f3 extends Os{constructor(){super(...arguments),this.removePointerDownListener=In}onPointerDown(t){this.session=new xP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:pp(t),onStart:pp(n),onMove:pp(r),onEnd:(i,o)=>{delete this.session,s&&je.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=ol(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 mp=!1;class h3 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),mp&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zu.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}),mp=!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(),Ix.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;mp=!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 wP(e){const[t,n]=lP(),r=k.useContext(hx);return f.jsx(h3,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(mP),isPresent:t,safeToRemove:n})}const p3={pan:{Feature:f3},drag:{Feature:d3,ProjectionNode:aP,MeasureLayout:wP}};function ek(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,sc(t)))}class m3 extends Os{mount(){const{current:t}=this.node;t&&(this.unmount=DO(t,(n,r)=>(ek(this.node,r,"Start"),s=>ek(this.node,s,"End"))))}unmount(){}}class g3 extends Os{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=tc(zl(this.node.current,"focus",()=>this.onFocus()),zl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tk(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,sc(t)))}class y3 extends Os{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=UO(t,(s,i)=>(tk(this.node,i,"Start"),(o,{success:a})=>tk(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const jg=new WeakMap,gp=new WeakMap,x3=e=>{const t=jg.get(e.target);t&&t(e)},v3=e=>{e.forEach(x3)};function w3({root:e,...t}){const n=e||document;gp.has(n)||gp.set(n,{});const r=gp.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(v3,{root:e,...t})),r[s]}function b3(e,t,n){const r=w3(t);return jg.set(e,n),r.observe(e),()=>{jg.delete(e),r.unobserve(e)}}const k3={some:0,all:1};class _3 extends Os{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:k3[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:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(c)};this.stopObserver=b3(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(S3(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function S3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const C3={inView:{Feature:_3},tap:{Feature:y3},focus:{Feature:g3},hover:{Feature:m3}},j3={layout:{ProjectionNode:aP,MeasureLayout:wP}},E3={...YF,...C3,...p3,...j3},nk=HF(E3,KF);function P3(){!$x.current&&DE();const[e]=k.useState(Bd.current);return e}function Mf(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 yp={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},te={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 _t(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 T3={4:"1rem"};function X(...e){return h$(MM(e))}const N3={height:32,lineHeight:"32px",padding:"0 16px"},I3={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")`},A3={white:te.bgBase,paper:te.bgSurface,speckle:te.bgSurface,parchment:te.bgElevated,canvas:te.canvasBase,kraft:te.canvas300,chalkboard:te.chalkboardBg},rk={white:te.bgElevated,paper:te.bgElevated,speckle:te.bgElevated,parchment:te.canvasBase,canvas:te.canvas300,kraft:te.canvasDark,chalkboard:te.chalkboardBg},R3={base:te.bgBase,surface:te.bgSurface,elevated:te.bgElevated,canvas:te.canvasBase,canvasDark:te.canvasDark,blue:te.washBlue,green:te.washGreen,amber:te.washAmber,rose:te.washRose,slate:te.washSlate},L3={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function Vx(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=I3[n],o=t.fill?R3[t.fill]:t.shade?rk[n]:A3[n],a=L3[s],l={"--pui-texture-shade":rk[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 Wo(e){return Vx(e)}function ta(e,t="paper"){if(e!==!1)return Wo(e===!0?t:e)}function M3(e){const t=Df((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,d=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*d,y:i+Math.sin(u)*d})}return $f(l)}function $3(e,t){const n=Df(`${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 d=u/s*Math.PI*2+(n()-.5)*.15*r,h=a+(n()-.5)*l*2;c.push({x:i+Math.cos(d)*h,y:o+Math.sin(d)*h})}return $f(c)}function D3(e){const t=Df((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,d=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,v=-m/g,y=p/g,x=(t()-.5)*i*2;o.push({x:d+v*x,y:h+y*x})}return $f(o)}function O3(e,t){const n=Df(`${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 d=(u+.5)/s,h=c.ax+(c.bx-c.ax)*d,p=c.ay+(c.by-c.ay)*d,m=c.bx-c.ax,g=c.by-c.ay,v=Math.sqrt(m*m+g*g)||1,y=-g/v,x=m/v,w=(n()-.5)*o*2;a.push({x:h+y*w,y:p+x*w})}return $f(a)}function $f(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,d=o.y-(a.y-i.y)/6;n+=` C ${Yr(l)} ${Yr(c)}, ${Yr(u)} ${Yr(d)}, ${Yr(o.x)} ${Yr(o.y)}`}return n+=" Z",n}function Yr(e){return e.toFixed(2)}function Df(e){let t=typeof e=="string"?z3(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function z3(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 Of(){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 na(e){const t=Of();return k.useMemo(()=>({blob:M3({seed:t,wobble:e}),ring:$3(t,e)}),[t,e])}const F3="button-module__button___Z331g",B3="button-module__blobBg___QQFzf",V3="button-module__blobFill___XwLjV",U3="button-module__blobRing___567UW",W3="button-module__isActive___FXNSJ",H3="button-module__primary___ppbyq",K3="button-module__secondary___esy5L",G3="button-module__ghost___NisA0",Z3="button-module__danger___Wnvuq",q3="button-module__chalkboard___d3Nqb",Y3="button-module__tiny___8ZZ7A",J3="button-module__small___u7y8a",Q3="button-module__medium___HBIAj",X3="button-module__large___RPzNy",eB="button-module__fullWidth___H0P0F",tB="button-module__iconLeft___s60SZ",nB="button-module__iconRight___75eFu",rB="button-module__label___pXAyM",wn={button:F3,blobBg:B3,blobFill:V3,blobRing:U3,isActive:W3,primary:H3,secondary:K3,ghost:G3,danger:Z3,chalkboard:q3,tiny:Y3,small:J3,medium:Q3,large:X3,fullWidth:eB,iconLeft:tB,iconRight:nB,label:rB},re=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},d){const h=na(o);return f.jsxs("button",{ref:d,type:"button",className:X(wn.button,wn[e],wn[n],t==="chalkboard"&&wn.chalkboard,a&&wn.isActive,i&&wn.fullWidth,c),...u,children:[f.jsxs("svg",{className:wn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:h.blob,className:wn.blobFill}),f.jsx("path",{d:h.ring,className:wn.blobRing})]}),r&&f.jsx("span",{className:wn.iconLeft,children:r}),f.jsx("span",{className:wn.label,children:l}),s&&f.jsx("span",{className:wn.iconRight,children:s})]})});function Ux(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Xe=N$.generator(),sB="sketch-border-module__svg___whV4x",iB="sketch-border-module__behind___lgdYV",oB="sketch-border-module__stroke___vAm-v",aB="sketch-border-module__fill___zlpd6",nu={svg:sB,behind:iB,stroke:oB,fill:aB},lB=1.2,cB=.7;function Zt({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:d}){const[h]=k.useState(Math.random),p=k.useRef(null),[m,g]=k.useState(null);k.useEffect(()=>{var x;const w=(x=p.current)==null?void 0:x.parentElement;if(!w)return;const b=new ResizeObserver(()=>{const _=w.offsetWidth,S=w.offsetHeight;g(j=>j&&j.width===_&&j.height===S?j:{width:_,height:S})});return b.observe(w),()=>b.disconnect()},[]);const{parts:v,clipPath:y}=k.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),w=x,b=x*2654435761%2147483647,_=T=>Xe.toPaths(Xe.path(T,{seed:w,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(P=>!P.fill||P.fill==="none").map(P=>({d:P.d,filled:!1}));if(l){const T={seed:w,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},P=A=>Xe.toPaths(A).filter(R=>!R.fill||R.fill==="none").map(R=>({d:R.d,filled:!1}));if(a){const A=ru(e,m,i,t,Ks(b),n*1.1),R=u?sk(s,n):0,$=R?ru(e,m,i+R,t,Ks(b),n*1.1):A;return{parts:P(Xe.path($,{...T,preserveVertices:!0})),clipPath:A}}const N=e==="circle"?Xe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,T):Xe.path(xp(m,i,t,Ks(w)),{...T,preserveVertices:!0});return{parts:P(N),clipPath:null}}if(a){if(c){const A=xp(m,i,t,Ks(b)),R=Xe.toPaths(Xe.path(A,{seed:w,roughness:lB,bowing:cB,preserveVertices:!0,strokeWidth:s})).filter($=>!$.fill||$.fill==="none").map($=>({d:$.d,filled:!1}));return{parts:R.length?R:[{d:A,filled:!1}],clipPath:A}}const T=ru(e,m,i,t,Ks(b),n*1.1),P=u?sk(s,n):0,N=P?ru(e,m,i+P,t,Ks(b),n*1.1):T;return{parts:_(N),clipPath:T}}const S=(T,P)=>{const N=P?{fill:"#000",fillStyle:"solid"}:{},A=e==="circle"?Xe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:T,roughness:n,bowing:r,strokeWidth:s,...N}):Xe.path(xp(m,i,t,Ks(T)),{seed:T,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...N});return Xe.toPaths(A)},j=o?S(b,!0).filter(T=>!!T.fill&&T.fill!=="none").map(T=>({d:T.d,filled:!0})):[],E=S(w,!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 x;const w=(x=p.current)==null?void 0:x.parentElement;if(w)return y?w.style.setProperty("--sketch-clip",`path("${y}")`):w.style.removeProperty("--sketch-clip"),()=>{w.style.removeProperty("--sketch-clip")}},[y]),f.jsx("svg",{ref:p,className:X(nu.svg,o&&nu.behind,d),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:v==null?void 0:v.map((x,w)=>x.filled?f.jsx("path",{className:nu.fill,d:x.d},`f-${w}`):f.jsx("path",{className:nu.stroke,d:x.d,strokeWidth:s},`s-${w}`))})}function sk(e,t){return e/2+t*1.5}function Ks(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function ru(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,d=[];if(e==="circle")for(let h=0;h<16;h++){const p=h/16*Math.PI*2;d.push({x:l+Math.cos(p)*o/2+u(),y:c+Math.sin(p)*a/2+u()})}else{const h=Math.max(2,Math.min(r,o/2,a/2)),p=n,m=n,g=(x,w,b)=>{for(const _ of[0,45,90]){const S=(b+_)*Math.PI/180;d.push({x:x+Math.cos(S)*h+u(),y:w+Math.sin(S)*h+u()})}},v=(x,w,b,_)=>{const S=Math.hypot(b-x,_-w),j=Math.min(12,Math.max(1,Math.round(S/160)));for(let E=1;E<=j;E++){const T=E/(j+1);d.push({x:x+(b-x)*T+u(),y:w+(_-w)*T+u()})}};g(p+h,m+h,180),v(p+h,m,p+o-h,m),g(p+o-h,m+h,270),v(p+o,m+h,p+o,m+a-h),g(p+o-h,m+a-h,0),v(p+o-h,m+a,p+h,m+a),g(p+h,m+a-h,90),v(p,m+a-h,p,m+h);const y=3;return ik([...d.slice(y),...d.slice(0,y)])}return ik(d)}function ik(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),d=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)/d-(l.x-o.x)/(u+d)),g=a.y-o.y+u*((l.y-a.y)/d-(l.y-o.y)/(u+d)),v=o.x+h/3,y=o.y+p/3,x=a.x-m/3,w=a.y-g/3;r+=` C ${v.toFixed(2)} ${y.toFixed(2)}, ${x.toFixed(2)} ${w.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function xp(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return uB(t,t,e.width-t*2,e.height-t*2,s)}function uB(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 qt={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}},dB="page-module__page___-uHnG",fB="page-module__outlined___Wwtyg",hB="page-module__surface___sWfI6",pB="page-module__flat___HlOaY",mB="page-module__withAccent___lsv-m",gB="page-module__accentBlue___XxbMV",yB="page-module__accentGreen___Ne6Q8",xB="page-module__accentAmber___kLAwa",vB="page-module__accentRose___O9ZbZ",wB="page-module__accentSlate___xCB66",qi={page:dB,outlined:fB,surface:hB,flat:pB,withAccent:mB,accentBlue:gB,accentGreen:yB,accentAmber:xB,accentRose:vB,accentSlate:wB},bB=Ux(qi),kB={all:14,top:14,none:2};function Wx({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=ta(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return f.jsxs("div",{className:X(qi.page,a&&qi.outlined,s&&qi.withAccent,s&&bB[i],!l&&qi.flat,t),style:n,children:[f.jsx(Zt,{clip:!0,...qt.surface,radius:kB[o],straight:!l}),f.jsx("div",{className:qi.surface,style:c,children:e})]})}const _B="layout-module__layout___O1aWi",SB="layout-module__header___I-kxe",CB="layout-module__headerLeft___JChJQ",jB="layout-module__headerTitles___aqSUG",EB="layout-module__headerTitle___wvr39",PB="layout-module__headerSubtitle___6f5BD",TB="layout-module__headerActions___adC12",NB="layout-module__mobileToggle___4WpVG",IB="layout-module__body___tywNf",AB="layout-module__mobileOverlay___tzbBC",RB="layout-module__sidebar___8VKGq",LB="layout-module__sidebarOpen___47rtr",MB="layout-module__sidebarInner___tq2X6",$B="layout-module__logoArea___RLnC0",DB="layout-module__logoText___pAmfV",OB="layout-module__nav___FxcrZ",zB="layout-module__main___9z7bu",FB="layout-module__navIslandFixed___H4TwP",BB="layout-module__content___jL-VB",VB="layout-module__contentWithPage___vVdfN",UB="layout-module__footer___LyakU",WB="layout-module__footerText___8BYxc",Be={layout:_B,header:SB,headerLeft:CB,headerTitles:jB,headerTitle:EB,headerSubtitle:PB,headerActions:TB,mobileToggle:NB,body:IB,mobileOverlay:AB,sidebar:RB,sidebarOpen:LB,sidebarInner:MB,logoArea:$B,logoText:DB,nav:OB,main:zB,navIslandFixed:FB,content:BB,contentWithPage:VB,footer:UB,footerText:WB};function HB(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"}:Wo(e)}function bP({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:d=[],activeItemId:h,onNavigate:p,logo:m,footerContent:g,navigationIsland:v,style:y,bleedBottom:x=!0,routeKey:w,stackOpen:b}){const[_,S]=k.useState(!1),j=P3();Mf(_,()=>S(!1));const E=HB(i),T=r&&d.length>0,P=c!==void 0||u!==void 0?{...u!==void 0?Wo(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return f.jsxs("div",{className:Be.layout,style:{...E,...y},children:[t&&f.jsxs("header",{className:Be.header,style:P,children:[f.jsxs("div",{className:Be.headerLeft,children:[T&&f.jsx("button",{type:"button",className:Be.mobileToggle,onClick:()=>S(!0),"aria-label":"Open navigation",children:f.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})})}),f.jsxs("div",{className:Be.headerTitles,children:[o&&f.jsx("h1",{className:Be.headerTitle,children:o}),a&&f.jsx("span",{className:Be.headerSubtitle,children:a})]})]}),l&&f.jsx("div",{className:Be.headerActions,children:l})]}),f.jsxs("div",{className:Be.body,children:[_&&f.jsx("button",{type:"button",className:Be.mobileOverlay,onClick:()=>S(!1),"aria-label":"Close navigation",tabIndex:-1}),T&&f.jsx("aside",{className:X(Be.sidebar,_&&Be.sidebarOpen),children:f.jsxs("div",{className:Be.sidebarInner,children:[f.jsx("div",{className:Be.logoArea,children:m||f.jsx("span",{className:Be.logoText,children:"Paper UI"})}),f.jsx("nav",{className:Be.nav,"aria-label":"Main navigation",children:d.map(N=>{const A=N.id===h;return f.jsx(re,{variant:"ghost",size:"small",isActive:A,onClick:()=>{p==null||p(N),S(!1)},"aria-current":A?"page":void 0,icon:N.icon,style:N3,children:N.label},N.id)})})]})}),f.jsx("div",{className:Be.main,children:f.jsx("main",{className:s?Be.contentWithPage:Be.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const N=w!==void 0?f.jsx(wF,{mode:"wait",children:f.jsx(nk.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},w)}):e;return s?f.jsx(Wx,{rounded:x?"top":"all",style:x&&v?{paddingBottom:`calc(${yp.navIslandBottom} + ${yp.navIslandHeight} + ${T3[4]})`}:void 0,children:N}):N})()})})]}),v&&f.jsx("div",{className:Be.navIslandFixed,children:b!==void 0?f.jsx(nk.div,{animate:{x:b?`-${yp.stackPanelWidth/2}px`:0},transition:{duration:j?0:.3,ease:[.4,0,.2,1]},children:v}):v}),n&&f.jsx("footer",{className:Be.footer,children:g||f.jsx("p",{className:Be.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const KB="checkbox-module__wrapper___uLYMI",GB="checkbox-module__blobFill___mPJSR",ZB="checkbox-module__input___Ptgt7",qB="checkbox-module__blobBg___bw3sn",YB="checkbox-module__labelLeft___-vAmH",JB="checkbox-module__box___yAh-r",QB="checkbox-module__checkmark___tTyBz",XB="checkbox-module__indeterminateLine___IosI-",e4="checkbox-module__boxWrapper___byjoS",t4="checkbox-module__icon___RO-yn",n4="checkbox-module__labelText___bAnLr",r4="checkbox-module__chalkboard___sv6SL",tn={wrapper:KB,blobFill:GB,input:ZB,blobBg:qB,labelLeft:YB,box:JB,checkmark:QB,indeterminateLine:XB,boxWrapper:e4,icon:t4,labelText:n4,chalkboard:r4},kP=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 d=k.useId(),h=l??d,p=na(r),m=k.useRef(null);return k.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),f.jsxs("label",{className:X(tn.wrapper,t==="left"&&tn.labelLeft,s==="chalkboard"&&tn.chalkboard,i),htmlFor:h,children:[f.jsxs("span",{className:tn.boxWrapper,children:[f.jsx("input",{ref:g=>{m.current=g,typeof u=="function"?u(g):u&&(u.current=g)},id:h,type:"checkbox",className:tn.input,checked:o,onChange:a,...c}),f.jsx("svg",{className:tn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:p.blob,className:tn.blobFill})}),f.jsxs("span",{className:tn.box,"aria-hidden":"true",children:[f.jsx(Zt,{smooth:!0,...qt.control}),n?f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:tn.icon,children:f.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:tn.indeterminateLine})}):f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:tn.icon,children:f.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:tn.checkmark})})]})]}),e&&f.jsx("span",{className:tn.labelText,children:e})]})}),s4="icon-button-module__iconButton___avg6i",i4="icon-button-module__blobBg___466Vy",o4="icon-button-module__blobFill___FTN1g",a4="icon-button-module__blobRing___hRdQb",l4="icon-button-module__isActive___XlvtM",c4="icon-button-module__icon___h204x",u4="icon-button-module__ghost___Wbxog",d4="icon-button-module__danger___p0Xz5",f4="icon-button-module__tiny___4WYvA",h4="icon-button-module__small___bPnCU",p4="icon-button-module__medium___nOxPf",m4="icon-button-module__large___UBU5z",g4="icon-button-module__chalkboard___mi0sQ",Cr={iconButton:s4,blobBg:i4,blobFill:o4,blobRing:a4,isActive:l4,icon:c4,default:"icon-button-module__default___9frNR",ghost:u4,danger:d4,tiny:f4,small:h4,medium:p4,large:m4,chalkboard:g4},dt=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=na(i);return f.jsxs("button",{ref:c,type:"button",className:X(Cr.iconButton,Cr[t],n==="chalkboard"&&Cr.chalkboard,Cr[r],o&&Cr.isActive,a),"aria-label":s,title:s,...l,children:[f.jsxs("svg",{className:Cr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:Cr.blobFill}),f.jsx("path",{d:u.ring,className:Cr.blobRing})]}),f.jsx("span",{className:Cr.icon,children:e})]})}),y4="stamp-module__stamp___5qaNY",x4="stamp-module__small___BBlBg",v4="stamp-module__medium___HG2YD",w4="stamp-module__large___aUT0I",b4="stamp-module__blobBg___Mdrdd",k4="stamp-module__blobFill___QyCeB",_4="stamp-module__blobRing___EUDx7",S4="stamp-module__dot___qZyCR",C4="stamp-module__label___T89iH",j4="stamp-module__chalkboard___syI4T",Jr={stamp:y4,small:x4,medium:v4,large:w4,blobBg:b4,blobFill:k4,blobRing:_4,dot:S4,label:C4,chalkboard:j4},vp={neutral:{fill:_t(te.accentSlate,.14),text:te.accentSlateDark,ring:_t(te.accentSlateDark,.35)},info:{fill:_t(te.accentBlue,.14),text:te.accentBlueDark,ring:_t(te.accentBlueDark,.35)},success:{fill:_t(te.accentGreen,.16),text:te.accentGreenDark,ring:_t(te.accentGreenDark,.35)},warning:{fill:_t(te.accentAmber,.16),text:te.accentAmberDark,ring:_t(te.accentAmberDark,.4)},error:{fill:_t(te.accentRose,.16),text:te.accentRoseDark,ring:_t(te.accentRoseDark,.35)}},ok={fill:_t(te.chalkboardBorderBase,.1),ring:_t(te.chalkboardBorderBase,.35)};function ce({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=na(o),u=a==="chalkboard",d=n?u?ok.ring:vp[n].ring:void 0,h=s??(n?u?ok.fill:vp[n].fill:"transparent"),p=i??(n&&!u?vp[n].text:void 0);return f.jsxs("span",{className:X(Jr.stamp,Jr[t],u&&Jr.chalkboard,l),style:p?{color:p}:void 0,children:[f.jsxs("svg",{className:Jr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:Jr.blobFill,style:{fill:h}}),d&&f.jsx("path",{d:c.ring,className:Jr.blobRing,style:{stroke:d}})]}),r&&f.jsx("span",{className:Jr.dot,"aria-hidden":"true"}),f.jsx("span",{className:Jr.label,children:e})]})}const E4="copy-button-module__copyButton___-hTo4",P4="copy-button-module__dark___O45N-",T4="copy-button-module__chalkboard___hW4aw",N4="copy-button-module__copied___XlHFr",su={copyButton:E4,dark:P4,chalkboard:T4,copied:N4};function Kd({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 f.jsx("button",{type:"button",onClick:a,className:X(su.copyButton,t==="dark"&&su.dark,n==="chalkboard"&&su.chalkboard,i&&su.copied,r),...s,children:i?"Copied!":"Copy"})}const I4="code-block-module__codeBlock___dq28o",A4="code-block-module__header___42Fek",R4="code-block-module__relative___oO-zy",L4="code-block-module__copyOverlay___PjAuq",M4="code-block-module__pre___zXzLZ",$4="code-block-module__chalkboard___bdo9J",D4="code-block-module__chalkboardHeader___3RiVd",O4="code-block-module__chalkboardPre___iRBFR",Qr={codeBlock:I4,header:A4,relative:R4,copyOverlay:L4,pre:M4,chalkboard:$4,chalkboardHeader:D4,chalkboardPre:O4};function nae({code:e,filename:t,surface:n="paper"}){return f.jsxs("div",{className:X(Qr.codeBlock,n==="chalkboard"&&Qr.chalkboard),children:[t&&f.jsxs("div",{className:X(Qr.header,n==="chalkboard"&&Qr.chalkboardHeader),children:[f.jsx("span",{children:t}),f.jsx(Kd,{text:e,variant:"light",surface:n})]}),!t&&f.jsx("div",{className:Qr.relative,children:f.jsx("div",{className:Qr.copyOverlay,children:f.jsx(Kd,{text:e,variant:"dark",surface:n})})}),f.jsx("pre",{className:X(Qr.pre,n==="chalkboard"&&Qr.chalkboardPre),children:f.jsx("code",{children:e})})]})}function ra({size:e=16}){return f.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:[f.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _P({size:e=16}){return f.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:[f.jsx("path",{d:"M9 18h6"}),f.jsx("path",{d:"M10 22h4"}),f.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 SP({size:e=16}){return f.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:f.jsx("polyline",{points:"20 6 9 17 4 12"})})}function z4({size:e=16}){return f.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:f.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 CP({size:e=16}){return f.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:[f.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function jP({size:e=16}){return f.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:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const F4="table-module__tableFrame___KP-90",B4="table-module__tableWrapper___gc3Y3",V4="table-module__toolbar___zhCel",U4="table-module__toolbarTitle___D8oH-",W4="table-module__panelFooter___lCCKo",H4="table-module__compact___mG-2Y",K4="table-module__toolbarActions___EX6qS",G4="table-module__search___zIBk2",Z4="table-module__searchIcon___ayhK8",q4="table-module__searchInput___PqsEG",Y4="table-module__tableScroll___1gvc4",J4="table-module__table___tdU5g",Q4="table-module__th___GQbKk",X4="table-module__td___WktB5",e5="table-module__footerCell___bM-jv",t5="table-module__tr___xeZno",n5="table-module__expandTh___uxkR4",r5="table-module__expandTd___VoBRC",s5="table-module__expandIcon___8V45X",i5="table-module__expandable___R7o2l",o5="table-module__footerRow___ik1DH",a5="table-module__expandedRow___1TbTQ",l5="table-module__expandedCell___sKAaD",c5="table-module__boardScroll___Y1yqm",u5="table-module__board___kFAI-",d5="table-module__boardColumn___-W9bP",f5="table-module__boardColumnHeader___kY3Fj",h5="table-module__accentBlue___PEJ1V",p5="table-module__accentGreen___wJ53r",m5="table-module__accentAmber___Iezjv",g5="table-module__accentRose___W8zxc",y5="table-module__accentSlate___oUZCX",x5="table-module__boardColumnLabel___JBEed",v5="table-module__boardColumnCount___Pkpiq",w5="table-module__boardColumnBody___uAgRF",b5="table-module__boardRow___C1P60",k5="table-module__boardEmpty___IKv2W",_5="table-module__chalkboardFrame___xB3N5",S5="table-module__chalkboardWrapper___KjY5r",C5="table-module__chalkboard___v0m3A",le={tableFrame:F4,tableWrapper:B4,toolbar:V4,toolbarTitle:U4,panelFooter:W4,compact:H4,toolbarActions:K4,search:G4,searchIcon:Z4,searchInput:q4,tableScroll:Y4,table:J4,th:Q4,td:X4,footerCell:e5,tr:t5,expandTh:n5,expandTd:r5,expandIcon:s5,expandable:i5,footerRow:o5,expandedRow:a5,expandedCell:l5,boardScroll:c5,board:u5,boardColumn:d5,boardColumnHeader:f5,accentBlue:h5,accentGreen:p5,accentAmber:m5,accentRose:g5,accentSlate:y5,boardColumnLabel:x5,boardColumnCount:v5,boardColumnBody:w5,boardRow:b5,boardEmpty:k5,chalkboardFrame:_5,chalkboardWrapper:S5,chalkboard:C5},j5=Ux(le);function E5({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:d,hideHeader:h=!1,density:p="comfortable",panelFooter:m,className:g}){const v=ta(s,r==="chalkboard"?"chalkboard":"paper"),y=!!i,[x,w]=k.useState(new Set),b=j=>{w(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 f.jsxs("div",{className:X(le.tableFrame,r==="chalkboard"&&le.chalkboardFrame,g),children:[f.jsx(Zt,{clip:!0,...qt.surface}),f.jsxs("div",{className:X(le.tableWrapper,r==="chalkboard"&&le.chalkboardWrapper,p==="compact"&&le.compact),style:v,children:[y&&f.jsxs("div",{className:le.toolbar,children:[i.title&&f.jsx("div",{className:le.toolbarTitle,children:i.title}),i.search&&f.jsxs("div",{className:le.search,children:[f.jsx(P5,{className:le.searchIcon}),f.jsx("input",{type:"text",className:le.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)}}),f.jsx(Zt,{fill:!0,...qt.field})]}),i.actions&&f.jsx("div",{className:le.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?f.jsx("div",{className:le.boardScroll,children:f.jsx("div",{className:le.board,children:n.map(j=>f.jsxs("div",{className:le.boardColumn,children:[f.jsxs("div",{className:X(le.boardColumnHeader,r==="chalkboard"&&le.chalkboard,j.accent&&j5[j.accent]),children:[f.jsx("span",{className:le.boardColumnLabel,children:j.label}),f.jsx("span",{className:le.boardColumnCount,children:j.items.length})]}),f.jsx("div",{className:le.boardColumnBody,children:j.items.length===0?f.jsx("div",{className:le.boardEmpty,children:j.emptyLabel??"empty"}):j.items.map((E,T)=>f.jsx("div",{className:X(le.boardRow,r==="chalkboard"&&le.chalkboard),children:j.renderItem(E,T,r)},j.getKey?j.getKey(E,T):T))})]},j.key))})}):f.jsx("div",{className:le.tableScroll,children:f.jsxs("table",{className:X(le.table,r==="chalkboard"&&le.chalkboard,p==="compact"&&le.compact),children:[f.jsxs("colgroup",{children:[_&&f.jsx("col",{style:{width:"48px"}}),t.map(j=>f.jsx("col",{style:j.width?{width:`${j.width*32}px`}:void 0},j.key))]}),!h&&f.jsx("thead",{children:f.jsxs("tr",{children:[_&&f.jsx("th",{className:X(le.th,le.expandTh),"aria-label":"Expand"}),t.map(j=>f.jsx("th",{className:le.th,style:j.align?{textAlign:j.align}:void 0,children:j.header},j.key))]})}),f.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=d==null?void 0:d(j,E,r),A=!!P,R=A&&x.has(T),$=u==null?void 0:u(j,E);return f.jsxs(k.Fragment,{children:[f.jsxs("tr",{className:X(le.tr,A&&le.expandable,c==null?void 0:c(j,E)),style:$?Wo($):void 0,onClick:()=>A&&b(T),children:[_&&f.jsx("td",{className:X(le.td,le.expandTd),children:A&&f.jsx("button",{type:"button",className:le.expandIcon,"aria-expanded":R,"aria-label":R?"Collapse row":"Expand row",onClick:D=>{D.stopPropagation(),b(T)},children:f.jsx(jP,{size:14})})}),t.map(D=>f.jsx("td",{className:le.td,style:D.align?{textAlign:D.align}:void 0,children:D.cell(j,E,r)},D.key))]}),N&&f.jsx("tr",{className:le.footerRow,style:$?Wo($):void 0,children:f.jsx("td",{colSpan:S,className:le.footerCell,children:N})}),R&&f.jsx("tr",{className:le.expandedRow,children:f.jsx("td",{colSpan:S,className:le.expandedCell,children:P})})]},T)})})]})}),m&&f.jsx("div",{className:le.panelFooter,children:m})]})]})}function P5({className:e}){return f.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:[f.jsx("circle",{cx:"11",cy:"11",r:"8"}),f.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}const T5="card-module__borderLayer___WSpJq",N5="card-module__elevated___uhWj9",I5="card-module__textureLayer___Kcofz",A5="card-module__flat___KnG5z",R5="card-module__small___HXUTr",L5="card-module__withAccent___2t7bV",M5="card-module__accentBlue___a1KIq",$5="card-module__accentGreen___RNWoA",D5="card-module__accentAmber___uMhom",O5="card-module__accentRose___VPI3t",z5="card-module__accentSlate___-l4jE",F5="card-module__chalkboard___bQ48O",ss={borderLayer:T5,default:"card-module__default___glPy-",elevated:N5,textureLayer:I5,flat:A5,small:R5,withAccent:L5,accentBlue:M5,accentGreen:$5,accentAmber:D5,accentRose:O5,accentSlate:z5,chalkboard:F5},B5=Ux(ss);function pe({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 d=n==="chalkboard"||s===!1?void 0:Vx({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return f.jsxs("div",{className:X(ss.borderLayer,ss[t],n==="chalkboard"&&ss.chalkboard,ss[r],a&&ss.withAccent,a&&B5[l],!c&&ss.flat,u),children:[f.jsx(Zt,{clip:!0,...qt.surface,straight:!c}),f.jsx("div",{className:ss.textureLayer,style:d,children:e})]})}const V5="input-module__wrapper___xaEw6",U5="input-module__label___lu7R1",W5="input-module__field___khFpX",H5="input-module__input___h7K-F",K5="input-module__small___SkByh",G5="input-module__medium___0QPuV",Z5="input-module__large___zGwRu",q5="input-module__error___QDqga",Y5="input-module__disabled___K-5hi",J5="input-module__helperText___njeLH",Q5="input-module__helperError___qDBpD",X5="input-module__chalkboard___Xh-5s",sr={wrapper:V5,label:U5,field:W5,input:H5,small:K5,medium:G5,large:Z5,error:q5,disabled:Y5,helperText:J5,helperError:Q5,chalkboard:X5},un=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 f.jsxs("div",{className:X(sr.wrapper,s==="chalkboard"&&sr.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:sr.label,children:e}),f.jsxs("span",{className:X(sr.field,sr[r],n&&sr.error,a.disabled&&sr.disabled),children:[f.jsx("input",{ref:l,id:u,className:sr.input,...a}),f.jsx(Zt,{fill:!0,...qt.field})]}),t&&f.jsx("span",{className:X(sr.helperText,n&&sr.helperError),children:t})]})}),eV="select-module__wrapper___Hc5F3",tV="select-module__label___ay-3s",nV="select-module__nativeSelect___UA2d-",rV="select-module__trigger___xMYHi",sV="select-module__open___w3mbZ",iV="select-module__triggerLabel___ihpER",oV="select-module__placeholder___0VOFP",aV="select-module__small___iU9W9",lV="select-module__chevron___0dCTg",cV="select-module__medium___B-XBN",uV="select-module__large___iII2c",dV="select-module__chevronOpen___cFOYe",fV="select-module__error___P5RBk",hV="select-module__dropdown___Q-uK3",pV="select-module__slideDown___sT374",mV="select-module__options___HmrQ0",gV="select-module__option___vNnue",yV="select-module__optionDisabled___ex2zq",xV="select-module__optionSelected___tAFjn",vV="select-module__optionHighlighted___zYQLq",wV="select-module__helperText___r5gyn",bV="select-module__helperError___ydSPT",kV="select-module__chalkboard___sXBw8",We={wrapper:eV,label:tV,nativeSelect:nV,trigger:rV,open:sV,triggerLabel:iV,placeholder:oV,small:aV,chevron:lV,medium:cV,large:uV,chevronOpen:dV,error:fV,dropdown:hV,slideDown:pV,options:mV,option:gV,optionDisabled:yV,optionSelected:xV,optionHighlighted:vV,helperText:wV,helperError:bV,chalkboard:kV};function _V({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:d=!1,width:h,texture:p=!1,className:m}){const g=k.useId(),[v,y]=k.useState(!1),[x,w]=k.useState(-1),[b,_]=k.useState(l??""),[S,j]=k.useState(null),E=k.useRef(null),T=k.useRef(null),P=a!==void 0,N=P?a:b,A=i.find(C=>C.value===N),R=(A==null?void 0:A.label)??o??"Select...",$=k.useCallback(()=>{if(d)return;y(!0);const C=i.findIndex(U=>U.value===N);w(C>=0?C:0)},[d,i,N]),D=k.useCallback(()=>{y(!1),w(-1)},[]),F=k.useCallback(C=>{var U;C.disabled||(P||_(C.value),c==null||c(C.value),D(),(U=E.current)==null||U.focus())},[P,c,D]),O=k.useCallback(C=>{if(!d)switch(C.key){case"Enter":case" ":C.preventDefault(),v&&x>=0?F(i[x]):$();break;case"Escape":C.preventDefault(),v&&D();break;case"ArrowDown":C.preventDefault(),v?w(U=>{let Q=U+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:U}):$();break;case"ArrowUp":C.preventDefault(),v?w(U=>{let Q=U-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:U}):$();break;case"Home":if(C.preventDefault(),v){let U=0;for(;U<i.length&&i[U].disabled;)U++;U<i.length&&w(U)}break;case"End":if(C.preventDefault(),v){let U=i.length-1;for(;U>=0&&i[U].disabled;)U--;U>=0&&w(U)}break;case"Tab":v&&D();break}},[d,v,x,i,$,D,F]);k.useEffect(()=>{if(!v)return;const C=U=>{var Q,I;const ge=U.target;(Q=E.current)!=null&&Q.contains(ge)||(I=T.current)!=null&&I.contains(ge)||D()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[v,D]),k.useEffect(()=>{if(!v||x<0||!T.current)return;const C=T.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[v,x]),k.useEffect(()=>{if(!v){j(null);return}const C=()=>{if(!E.current)return;const U=E.current.getBoundingClientRect();if(U.bottom<0||U.top>window.innerHeight){D();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)}},[v,D]);const M=ta(p),V=M?{"--sketch-fill":M.backgroundColor}:void 0;return f.jsxs("div",{className:X(We.wrapper,s==="chalkboard"&&We.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&f.jsx("label",{htmlFor:g,className:We.label,children:e}),f.jsxs("select",{id:g,name:u,className:We.nativeSelect,value:N,onChange:C=>c==null?void 0:c(C.target.value),disabled:d,"aria-hidden":"true",tabIndex:-1,children:[o&&f.jsx("option",{value:"",children:o}),i.map(C=>f.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value))]}),f.jsxs("button",{ref:E,type:"button",role:"combobox","aria-expanded":v,"aria-haspopup":"listbox","aria-controls":v?`${g}-listbox`:void 0,"aria-activedescendant":v&&x>=0?`${g}-option-${x}`:void 0,className:X(We.trigger,We[r],n&&We.error,v&&We.open,d&&We.disabled),onClick:()=>v?D():$(),onKeyDown:O,disabled:d,children:[f.jsx("span",{className:X(We.triggerLabel,!A&&We.placeholder),children:R}),f.jsx(SV,{className:X(We.chevron,v&&We.chevronOpen)}),f.jsx(Zt,{fill:!0,...qt.field})]}),v&&S&&Ei.createPortal(f.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(),D(),(U=E.current)==null||U.focus())},children:[f.jsx(Zt,{fill:!0,...qt.surface}),f.jsx("div",{className:We.options,children:i.map((C,U)=>f.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===x&&We.optionHighlighted,C.disabled&&We.optionDisabled),onClick:Q=>{Q.stopPropagation(),F(C)},onMouseEnter:()=>w(U),children:C.label},C.value))})]}),document.body),t&&f.jsx("span",{className:X(We.helperText,n&&We.helperError),children:t})]})}function SV({className:e}){return f.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:f.jsx("polyline",{points:"6 9 12 15 18 9"})})}function EP({variant:e}){switch(e){case"info":return f.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:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),f.jsx("circle",{cx:"12",cy:"8",r:"0.5",fill:"currentColor"})]});case"success":return f.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:[f.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),f.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]});case"warning":return f.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:[f.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"}),f.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),f.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"error":return f.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:[f.jsx("circle",{cx:"12",cy:"12",r:"10"}),f.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),f.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}}const CV="alert-module__alert___j7ZRS",jV="alert-module__surface___IaVgU",EV="alert-module__iconWrapper___kLoxT",PV="alert-module__message___klR2U",TV="alert-module__dismiss___f2uoG",NV="alert-module__info___PBo1l",IV="alert-module__success___AVBKS",AV="alert-module__warning___zkMaJ",RV="alert-module__error___cxg96",LV="alert-module__chalkboard___7pgWk",Gs={alert:CV,surface:jV,iconWrapper:EV,message:PV,dismiss:TV,info:NV,success:IV,warning:AV,error:RV,chalkboard:LV};function PP({children:e,variant:t="info",surface:n="paper",texture:r="kraft",dismissible:s=!1,onDismiss:i,className:o}){const a=n==="chalkboard";return f.jsxs("div",{className:X(Gs.alert,Gs[t],a&&Gs.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[f.jsx(Zt,{clip:!0,...qt.surface}),f.jsx("div",{className:Gs.surface,style:a?void 0:ta(r)}),f.jsx("span",{className:Gs.iconWrapper,children:f.jsx(EP,{variant:t})}),f.jsx("div",{className:Gs.message,children:e}),s&&f.jsx("button",{type:"button",className:Gs.dismiss,onClick:i,"aria-label":"Dismiss alert",children:f.jsx(ra,{size:16})})]})}const MV="modal-module__overlay___a52Ni",$V="modal-module__fadeIn___5OWd5",DV="modal-module__backdrop___RS4yj",OV="modal-module__modal___ZioOV",zV="modal-module__slideUp___vfFrm",FV="modal-module__small___hcxwF",BV="modal-module__medium___mjbM5",VV="modal-module__large___1dzyf",UV="modal-module__header___iP09B",WV="modal-module__title___nj06m",HV="modal-module__close___gQou9",KV="modal-module__body___Y-EdA",GV="modal-module__chalkboard___qY8qo",jr={overlay:MV,fadeIn:$V,backdrop:DV,modal:OV,slideUp:zV,small:FV,medium:BV,large:VV,header:UV,title:WV,close:HV,body:KV,chalkboard:GV},ZV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ni({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(Mf(e,t),k.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=g=>{var v;if(g.key!=="Tab")return;const y=(v=c.current)==null?void 0:v.querySelectorAll(ZV);if(!y||y.length===0){g.preventDefault();return}const x=y[0],w=y[y.length-1];g.shiftKey&&document.activeElement===x?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var g,v;document.removeEventListener("keydown",p),document.body.style.overflow=m,(v=(g=u.current)==null?void 0:g.focus)==null||v.call(g)}},[e]),!e||typeof document>"u")return null;const d=ta(o);return Ei.createPortal(f.jsxs("div",{className:jr.overlay,children:[f.jsx("button",{type:"button",className:jr.backdrop,"aria-label":"Close modal",onClick:t}),f.jsxs("div",{ref:c,className:X(jr.modal,jr[s],i==="chalkboard"&&jr.chalkboard,a),style:d,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[f.jsxs("div",{className:jr.header,children:[n&&f.jsx("h2",{id:l,className:jr.title,children:n}),f.jsx("button",{type:"button",className:jr.close,onClick:t,"aria-label":"Close modal",children:f.jsx(ra,{size:18})})]}),f.jsx("div",{className:jr.body,children:r})]})]}),document.body)}const qV="textarea-module__wrapper___NbiNO",YV="textarea-module__label___ejhyZ",JV="textarea-module__field___KluQf",QV="textarea-module__textarea___0y-7v",XV="textarea-module__resizeGrip___lONlE",e6="textarea-module__small___yPyr8",t6="textarea-module__medium___ezQxA",n6="textarea-module__large___xfeKi",r6="textarea-module__error___EkXKJ",s6="textarea-module__disabled___9CKbb",i6="textarea-module__helperText___l1sPh",o6="textarea-module__helperError___VfTLy",a6="textarea-module__chalkboard___zZ0X0",Bn={wrapper:qV,label:YV,field:JV,textarea:QV,resizeGrip:XV,small:e6,medium:t6,large:n6,error:r6,disabled:s6,helperText:i6,helperError:o6,chalkboard:a6},l6=48,Hx=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,d=k.useRef(null),h=k.useCallback(m=>{d.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=k.useCallback(m=>{const g=d.current;if(!g)return;m.preventDefault();const v=m.clientY,y=g.offsetHeight,x=b=>{g.style.height=`${Math.max(l6,y+b.clientY-v)}px`},w=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",w)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",w)},[]);return f.jsxs("div",{className:X(Bn.wrapper,s==="chalkboard"&&Bn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:Bn.label,children:e}),f.jsxs("span",{className:X(Bn.field,Bn[r],n&&Bn.error,a.disabled&&Bn.disabled),children:[f.jsx("textarea",{ref:h,id:u,className:Bn.textarea,...a}),f.jsx(Zt,{fill:!0,...qt.field}),!a.disabled&&f.jsx("span",{className:Bn.resizeGrip,onPointerDown:p,"aria-hidden":"true",title:"Drag to resize",children:f.jsxs("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M11 4.5 L4.5 11"}),f.jsx("path",{d:"M11 8.5 L8.5 11"})]})})]}),t&&f.jsx("span",{className:X(Bn.helperText,n&&Bn.helperError),children:t})]})}),c6="progress-module__track___a5BMO",u6="progress-module__svg___3U0-E",ak={track:c6,svg:u6},wp=300,Xr=1;function d6({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(Of()*1e6)),c=a?_t(te.chalkboardBorderBase,.16):_t(te.textPrimary,.12),u=n??(a?te.chalkboardChalk:te.textSecondary),d=k.useMemo(()=>Xe.toPaths(Xe.rectangle(Xr,Xr,wp-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*(wp-Xr*2),0),p=k.useMemo(()=>h>0?Xe.toPaths(Xe.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 f.jsx("div",{className:X(ak.track,i),style:{height:r,borderRadius:r/2},children:f.jsxs("svg",{className:ak.svg,viewBox:`0 0 ${wp} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[d.map((m,g)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g)),p.map((m,g)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},g))]})})}function f6(e){const t=Of();return k.useMemo(()=>({blob:D3({seed:t,wobble:e}),ring:O3(t,e)}),[t,e])}const h6="list-item-module__listItem___-tw9O",p6="list-item-module__clickable___GLJmd",m6="list-item-module__blobBg___O3Mzh",g6="list-item-module__blobFill___dXHk1",y6="list-item-module__blobRing___S9mas",x6="list-item-module__active___UsL8O",v6="list-item-module__small___9dphK",w6="list-item-module__medium___yGZCr",b6="list-item-module__icon___2b4wU",k6="list-item-module__label___SIzJ4",_6="list-item-module__action___qGh0-",S6="list-item-module__chalkboard___qpWuM",bn={listItem:h6,static:"list-item-module__static___qtEX6",clickable:p6,blobBg:m6,blobFill:g6,blobRing:y6,active:x6,small:v6,medium:w6,icon:b6,label:k6,action:_6,chalkboard:S6};function mt({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=f6(s),u=!!l.onClick;return f.jsxs("button",{type:"button",className:X(bn.listItem,bn[r],u&&bn.clickable,!u&&!e&&bn.static,e&&bn.active,i==="chalkboard"&&bn.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[f.jsxs("svg",{className:bn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:bn.blobFill}),f.jsx("path",{d:c.ring,className:bn.blobRing})]}),t&&f.jsx("span",{className:bn.icon,children:t}),f.jsx("span",{className:bn.label,children:o}),n&&f.jsx("span",{className:bn.action,children:n})]})}const C6="accordion-module__accordion___mqGl-",j6="accordion-module__header___mLfbd",E6="accordion-module__icon___Z90NR",P6="accordion-module__title___HusgG",T6="accordion-module__content___1K0td",N6="accordion-module__chalkboard___am8r4",I6="accordion-module__expanded___836xG",Zs={accordion:C6,header:j6,icon:E6,title:P6,content:T6,chalkboard:N6,expanded:I6};function rae({title:e,children:t,expanded:n=!1,onToggle:r,surface:s="paper",className:i}){return f.jsxs("div",{className:X(Zs.accordion,n&&Zs.expanded,s==="chalkboard"&&Zs.chalkboard,i),children:[f.jsxs("button",{type:"button",className:Zs.header,onClick:r,"aria-expanded":n,children:[f.jsx("span",{className:Zs.icon,"aria-hidden":"true",children:f.jsx(jP,{size:14})}),f.jsx("span",{className:Zs.title,children:e})]}),n&&f.jsx("div",{className:Zs.content,children:t})]})}const A6="icon-module__icon___2vrJz",R6="icon-module__blobBg___ENPYJ",L6="icon-module__blobFill___IPbwQ",M6="icon-module__blobRing___1awqV",$6="icon-module__content___TaZR6",D6="icon-module__small___Xp--F",O6="icon-module__medium___tCjMB",z6="icon-module__large___vBtP7",Fi={icon:A6,blobBg:R6,blobFill:L6,blobRing:M6,content:$6,small:D6,medium:O6,large:z6},F6={small:20,medium:24,large:28};function B6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=na(n),o=F6[t];return f.jsxs("span",{className:X(Fi.icon,Fi[t],s),children:[f.jsxs("svg",{className:Fi.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:i.blob,className:Fi.blobFill,style:r?{fill:r}:void 0}),f.jsx("path",{d:i.ring,className:Fi.blobRing})]}),f.jsx("span",{className:Fi.content,style:{width:o,height:o},children:e})]})}const V6="radio-module__wrapper___BB05E",U6="radio-module__blobFill___p5BX4",W6="radio-module__labelLeft___ijB93",H6="radio-module__input___M2nFJ",K6="radio-module__box___H7ofS",G6="radio-module__dot___jVJ-d",Z6="radio-module__boxWrapper___Y3qis",q6="radio-module__blobBg___IR-M5",Y6="radio-module__labelText___I-nu3",J6="radio-module__chalkboard___IIBqI",ir={wrapper:V6,blobFill:U6,labelLeft:W6,input:H6,box:K6,dot:G6,boxWrapper:Z6,blobBg:q6,labelText:Y6,chalkboard:J6};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(),d=a??u,h=na(n);return f.jsxs("label",{className:X(ir.wrapper,t==="left"&&ir.labelLeft,r==="chalkboard"&&ir.chalkboard,s),htmlFor:d,children:[f.jsxs("span",{className:ir.boxWrapper,children:[f.jsx("input",{ref:c,id:d,type:"radio",className:ir.input,checked:i,onChange:o,...l}),f.jsx("svg",{className:ir.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:h.blob,className:ir.blobFill})}),f.jsxs("span",{className:ir.box,"aria-hidden":"true",children:[f.jsx(Zt,{smooth:!0,shape:"circle",...qt.control}),f.jsx("span",{className:ir.dot})]})]}),e&&f.jsx("span",{className:ir.labelText,children:e})]})});const Q6="switch-module__wrapper___5-2P1",X6="switch-module__labelLeft___WlT-N",eU="switch-module__input___YKZRj",tU="switch-module__track___QNvnO",nU="switch-module__thumb___cunvF",rU="switch-module__small___WPIxc",sU="switch-module__medium___yPulW",iU="switch-module__large___VlKV1",oU="switch-module__labelText___9Qg39",aU="switch-module__chalkboard___qKTMz",es={wrapper:Q6,labelLeft:X6,input:eU,track:tU,thumb:nU,small:rU,medium:sU,large:iU,labelText:oU,chalkboard:aU},Eg=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(),d=a??u;return f.jsxs("label",{className:X(es.wrapper,es[n],t==="left"&&es.labelLeft,r==="chalkboard"&&es.chalkboard,s),htmlFor:d,children:[f.jsx("input",{ref:c,id:d,type:"checkbox",className:es.input,checked:i,onChange:o,...l}),f.jsxs("span",{className:es.track,"aria-hidden":"true",children:[f.jsx(Zt,{...qt.pill}),f.jsx("span",{className:es.thumb})]}),e&&f.jsx("span",{className:es.labelText,children:e})]})}),lU="spinner-module__spinner___FDTk2",cU="spinner-module__chalkboard___DLE1z",uU="spinner-module__svg___JnCWN",dU="spinner-module__track___xbnbo",fU="spinner-module__head___j5dWe",Ma={spinner:lU,chalkboard:cU,svg:uU,track:dU,head:fU},hU={small:18,medium:28,large:40},lk=25,pU=18,ck=Xe.toPaths(Xe.circle(lk,lk,pU*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=hU[e];return f.jsx("span",{className:X(Ma.spinner,r==="chalkboard"&&Ma.chalkboard,s),role:"status","aria-label":n,children:f.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:Ma.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[f.jsx("path",{className:Ma.track,d:ck,fill:"none",pathLength:100,strokeLinecap:"round"}),f.jsx("path",{className:Ma.head,d:ck,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const mU="skeleton-module__skeleton___HCSvg",gU="skeleton-module__pulse___6eCq1",yU="skeleton-module__svg___OzxGp",xU="skeleton-module__text___v17Nv",vU="skeleton-module__rect___wqIJy",wU="skeleton-module__circle___RCmyR",bp={skeleton:mU,pulse:gU,svg:yU,text:xU,rect:vU,circle:wU},uk={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Bi=2;function rn({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Of()*1e6)),l=o?_t(te.chalkboardBorderBase,.16):_t(te.textPrimary,.09),c=k.useMemo(()=>{const[,,u,d]=uk[e],h=e==="circle"?Xe.ellipse(u/2,d/2,u-Bi*2,d-Bi*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Xe.rectangle(Bi,Bi,u-Bi*2,d-Bi*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Xe.toPaths(h)},[e,a,l]);return f.jsx("span",{className:X(bp.skeleton,bp[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:f.jsx("svg",{className:bp.svg,viewBox:uk[e].join(" "),preserveAspectRatio:"none","aria-hidden":"true",children:c.map((u,d)=>f.jsx("path",{d:u.d,stroke:u.stroke,strokeWidth:u.strokeWidth,fill:u.fill},d))})})}const bU="divider-module__horizontal___tP3rG",kU="divider-module__line___KnBes",_U="divider-module__label___WiUwZ",SU="divider-module__vertical___wBSrT",CU="divider-module__chalkboard___gXTde",Vi={horizontal:bU,line:kU,label:_U,vertical:SU,chalkboard:CU};function TP({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Vi.chalkboard;return e==="vertical"?f.jsx("span",{className:X(Vi.vertical,s,r),role:"separator","aria-orientation":"vertical"}):f.jsxs("div",{className:X(Vi.horizontal,s,r),role:"separator",children:[f.jsx("span",{className:Vi.line}),t!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:Vi.label,children:t}),f.jsx("span",{className:Vi.line})]})]})}const jU="tooltip-module__wrapper___XeVNe",EU="tooltip-module__tooltip___e-rkz",PU="tooltip-module__tooltipIn___CZbRw",TU="tooltip-module__top___78WWU",NU="tooltip-module__bottom___Irl3O",IU="tooltip-module__left___C1Ec4",AU="tooltip-module__right___oUA-Z",RU="tooltip-module__chalkboard___Um6dx",iu={wrapper:jU,tooltip:EU,tooltipIn:PU,top:TU,bottom:NU,left:IU,right:AU,chalkboard:RU},ou=8,au=8,LU=typeof window>"u"?k.useEffect:k.useLayoutEffect;function MU(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+ou,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-ou-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+ou;break;default:r=e.top-ou-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,au),window.innerWidth-n.width-au),r=Math.min(Math.max(r,au),window.innerHeight-n.height-au),{top:r,left:s}}function ye({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),[d,h]=k.useState(!1),[p,m]=k.useState(null),[g,v]=k.useState(null),y=k.useRef(null),x=k.useRef(null),w=k.useRef(),b=!s&&!!e&&!d&&(a||c),_=()=>{clearTimeout(w.current),w.current=setTimeout(()=>l(!0),r)},S=()=>{clearTimeout(w.current),l(!1),h(!1)},j=()=>{h(!1),u(!0)},E=()=>{u(!1),h(!1)};Mf(b,()=>h(!0)),k.useEffect(()=>{if(!b){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)}},[b]),LU(()=>{if(!b){v(null);return}const P=x.current;P&&v({width:P.offsetWidth,height:P.offsetHeight})},[b,e,n]),k.useEffect(()=>()=>clearTimeout(w.current),[]);const T=t.props;return f.jsxs("span",{ref:y,className:iu.wrapper,onMouseEnter:_,onMouseLeave:S,onFocus:j,onBlur:E,children:[k.cloneElement(t,{"aria-describedby":b?o:T["aria-describedby"]}),b&&p&&typeof document<"u"&&Ei.createPortal(f.jsx("span",{ref:x,id:o,role:"tooltip",className:X(iu.tooltip,iu[n],i==="chalkboard"&&iu.chalkboard),style:g?{position:"fixed",...MU(p,n,g)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const $U="toast-module__stack___hDi0s",DU="toast-module__topLeft___Luw-F",OU="toast-module__topCenter___N1DwF",zU="toast-module__topRight___Dtgau",FU="toast-module__bottomLeft___Eb2lo",BU="toast-module__bottomCenter___gs-Yb",VU="toast-module__bottomRight___-0e2j",UU="toast-module__item___RFjtm",WU="toast-module__toastIn___9m9iN",HU="toast-module__card___ZCvJS",KU="toast-module__surface___mfMl0",GU="toast-module__iconWrapper___lnjcC",ZU="toast-module__content___AlliM",qU="toast-module__title___1Oqh8",YU="toast-module__description___eiUSB",JU="toast-module__dismiss___tUGx4",QU="toast-module__info___Nh8S9",XU="toast-module__success___hlKLc",e8="toast-module__warning___XUMJt",t8="toast-module__error___pSFFC",n8="toast-module__chalkboard___c49gt",kn={stack:$U,topLeft:DU,topCenter:OU,topRight:zU,bottomLeft:FU,bottomCenter:BU,bottomRight:VU,item:UU,toastIn:WU,card:HU,surface:KU,iconWrapper:GU,content:ZU,title:qU,description:YU,dismiss:JU,info:QU,success:XU,warning:e8,error:t8,chalkboard:n8};function r8({record:e,surface:t="paper",onDismiss:n}){const r=k.useRef(e.duration),s=k.useRef(0),i=k.useRef(),o=k.useCallback(d=>{clearTimeout(i.current),!(d<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),d))},[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 f.jsx("div",{className:kn.item,onMouseEnter:a,onMouseLeave:l,children:f.jsxs("div",{className:X(kn.card,kn[e.variant],c&&kn.chalkboard),role:u,children:[f.jsx(Zt,{clip:!0,...qt.surface}),f.jsx("div",{className:kn.surface,style:c?void 0:ta("kraft")}),f.jsx("span",{className:kn.iconWrapper,children:f.jsx(EP,{variant:e.variant})}),f.jsxs("div",{className:kn.content,children:[e.title&&f.jsx("div",{className:kn.title,children:e.title}),f.jsx("div",{className:kn.description,children:e.description})]}),f.jsx("button",{type:"button",className:kn.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:f.jsx(ra,{size:16})})]})})}const NP=k.createContext(null);function s8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function dk({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(d=>d.filter(h=>h.id!==u))},[]),l=k.useCallback(u=>{o.current+=1;const d=`toast-${o.current}`;return i(h=>[...h,{id:d,title:u.title,description:u.description,variant:u.variant??"info",duration:u.duration??r}]),d},[r]),c=t.startsWith("top")?[...s].reverse():s;return f.jsxs(NP.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&Ei.createPortal(f.jsx("div",{className:X(kn.stack,kn[s8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>f.jsx(r8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function rt(){const e=k.useContext(NP);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const i8="breadcrumb-module__breadcrumb___r-ILp",o8="breadcrumb-module__list___V3YFy",a8="breadcrumb-module__item___dDwYf",l8="breadcrumb-module__link___CHC9k",c8="breadcrumb-module__linkButton___XoMW-",u8="breadcrumb-module__current___dprI9",d8="breadcrumb-module__separator___uLhtn",f8="breadcrumb-module__chalkboard___COJpw",or={breadcrumb:i8,list:o8,item:a8,link:l8,linkButton:c8,current:u8,static:"breadcrumb-module__static___affaf",separator:d8,chalkboard:f8};function h8({items:e,surface:t="paper",className:n}){return f.jsx("nav",{"aria-label":"Breadcrumb",className:X(or.breadcrumb,t==="chalkboard"&&or.chalkboard,n),children:f.jsx("ol",{className:or.list,children:e.map((r,s)=>{const i=s===e.length-1;return f.jsxs("li",{className:or.item,children:[i?f.jsx("span",{className:or.current,"aria-current":"page",children:r.label}):r.href?f.jsx("a",{href:r.href,className:or.link,onClick:r.onClick,children:r.label}):r.onClick?f.jsx("button",{type:"button",className:X(or.link,or.linkButton),onClick:r.onClick,children:r.label}):f.jsx("span",{className:or.static,children:r.label}),!i&&f.jsx(p8,{className:or.separator})]},r.id)})})})}function p8({className:e}){return f.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:f.jsx("polyline",{points:"9 18 15 12 9 6"})})}const m8="menu-module__wrapper___WCtoy",g8="menu-module__menu___i40Wj",y8="menu-module__surface___SJbaB",x8="menu-module__list___YjCfD",v8="menu-module__item___aqcgg",w8="menu-module__icon___1qUvA",b8="menu-module__label___MtQMh",k8="menu-module__danger___p9oZo",_8="menu-module__itemDisabled___HByLP",S8="menu-module__separator___g2uay",C8="menu-module__chalkboard___5jIwI",Vn={wrapper:m8,menu:g8,surface:y8,list:x8,item:v8,icon:w8,label:b8,danger:k8,itemDisabled:_8,separator:S8,chalkboard:C8},j8=6;function E8(e){return"type"in e&&e.type==="separator"}function IP({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),d=k.useRef(null),h=k.useCallback(()=>{var y,x;(x=(y=u.current)==null?void 0:y.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=k.useCallback(()=>a(!1),[]);Mf(o,()=>{p(),h()}),k.useEffect(()=>{if(!o)return;const y=x=>{var w,b;const _=x.target;(w=u.current)!=null&&w.contains(_)||(b=d.current)!=null&&b.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,x;!o||!l||(x=(y=d.current)==null?void 0:y.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=y=>{var x,w,b,_,S;const j=Array.from(((x=d.current)==null?void 0:x.querySelectorAll('[role="menuitem"]:not(:disabled)'))??[]);if(j.length===0)return;const E=j.indexOf(document.activeElement);switch(y.key){case"ArrowDown":y.preventDefault(),(w=j[(E+1)%j.length])==null||w.focus();break;case"ArrowUp":y.preventDefault(),(b=j[(E-1+j.length)%j.length])==null||b.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 x;y.disabled||(p(),h(),(x=y.onSelect)==null||x.call(y))},v=e.props;return f.jsxs("span",{ref:u,className:Vn.wrapper,children:[k.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:y=>{var x;(x=v.onClick)==null||x.call(v,y),a(w=>!w)}}),o&&l&&typeof document<"u"&&Ei.createPortal(f.jsxs("div",{ref:d,id:i,role:"menu",className:X(Vn.menu,r==="chalkboard"&&Vn.chalkboard,s),style:{position:"fixed",top:l.bottom+j8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[f.jsx(Zt,{clip:!0,...qt.surface}),f.jsx("div",{className:Vn.surface}),f.jsx("div",{className:Vn.list,children:t.map(y=>E8(y)?f.jsx("div",{role:"separator",className:Vn.separator},y.id):f.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&&f.jsx("span",{className:Vn.icon,children:y.icon}),f.jsx("span",{className:Vn.label,children:y.label})]},y.id))})]}),document.body)]})}const AP=({size:e=16})=>f.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:[f.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"}),f.jsx("path",{d:"M19 3v3"}),f.jsx("path",{d:"M20.5 4.5h-3"})]}),P8=({size:e=16})=>f.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:[f.jsx("path",{d:"M12 19V5"}),f.jsx("path",{d:"m5 12 7-7 7 7"})]}),T8=({size:e=16})=>f.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:[f.jsx("path",{d:"M12 5v14"}),f.jsx("path",{d:"m5 12 7 7 7-7"})]}),RP=({size:e=16})=>f.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:[f.jsx("circle",{cx:"18",cy:"18",r:"3"}),f.jsx("circle",{cx:"6",cy:"6",r:"3"}),f.jsx("path",{d:"M6 9v5c0 .667 3 1 6 1s6-.333 6-1V9"}),f.jsx("path",{d:"M12 17v2"})]}),N8=({size:e=16})=>f.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:[f.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),f.jsx("polyline",{points:"21 3 21 9 15 9"})]}),LP=({size:e=16})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[f.jsx("circle",{cx:"5",cy:"12",r:"2"}),f.jsx("circle",{cx:"12",cy:"12",r:"2"}),f.jsx("circle",{cx:"19",cy:"12",r:"2"})]}),I8=({size:e=16})=>f.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:[f.jsx("path",{d:"m18 4 3 3-3 3"}),f.jsx("path",{d:"M3 7h5.5a3 3 0 0 1 2.5 1.35L15 16.65A3 3 0 0 0 17.5 18H21"}),f.jsx("path",{d:"m18 20 3-3-3-3"}),f.jsx("path",{d:"M3 17h5.5a3 3 0 0 0 2.5-1.35"}),f.jsx("path",{d:"M13 8.35A3 3 0 0 1 15.5 7H21"})]}),A8=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M6 4l11 6-11 6z"})}),R8=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:f.jsx("rect",{x:"5",y:"5",width:"10",height:"10",rx:"1.5"})}),L8=({size:e=12})=>f.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:f.jsx("path",{d:"m7 4 6 6-6 6"})}),M8=({size:e=16})=>f.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:[f.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),f.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),fk=({size:e=16})=>f.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:[f.jsx("path",{d:"M6 3v12"}),f.jsx("circle",{cx:"18",cy:"6",r:"3"}),f.jsx("circle",{cx:"6",cy:"18",r:"3"}),f.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),$8=({size:e=12})=>f.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:f.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"})}),MP=({size:e=14})=>f.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:[f.jsx("title",{children:"Idea"}),f.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"})]}),Kx=({size:e=14})=>f.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:[f.jsx("title",{children:"Note"}),f.jsx("path",{d:"M15 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z"}),f.jsx("path",{d:"M15 3v6h6"})]}),sae=({size:e=14})=>f.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:[f.jsx("path",{d:"m3 12 4 4 7-8"}),f.jsx("path",{d:"m11 15 2 2 8-9"})]}),D8=({state:e,filesEmpty:t})=>f.jsxs("div",{className:"flex flex-col gap-2",children:[e.suggestError&&f.jsx(PP,{dismissible:!0,onDismiss:()=>e.setSuggestError(null),children:e.suggestError}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx("div",{className:"flex-1 min-w-[140px]",children:f.jsx(un,{size:"small",placeholder:"Commit title",value:e.commitTitle,onChange:n=>e.setCommitTitle(n.currentTarget.value)})}),f.jsx(dt,{icon:f.jsx(AP,{size:16}),size:"small",label:"Suggest title and message from the diff",disabled:t||e.suggesting,onClick:e.handleSuggestFromChanges,wobble:e.suggesting?1:0})]})]}),O8="x-pairing-token",z8=["idea","planned","in-progress","review","done","dropped"],ic=["claude-code","opencode"],F8={"claude-code":"Claude Code",opencode:"OpenCode"},iae={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},oae={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"},codeReview:{agent:"claude-code",model:"opus",effort:"high"}};function aae(e,t){return e.agent===t.agent&&(e.model??"")===(t.model??"")}let $P="",Pg=null;function B8(e){$P=e}function V8(e){Pg=e}function K(e){return`${$P}${e}`}function J(e,t={}){if(!Pg)return fetch(e,t);const n=new Headers(t.headers);return n.set(O8,Pg),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 U8=async()=>{const e=await J(K("/api/git/status"),{signal:AbortSignal.timeout(yn)});return await Xn(e,"Failed to load git status"),e.json()},W8=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},H8=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},Tg=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")},K8=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")},lae=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")},G8=async()=>{const e=await J(K("/api/git/push"),{method:"POST",signal:AbortSignal.timeout(yn)});await Xn(e,"Push failed")},DP=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()},Z8=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}},q8=async()=>{const e=await J(K("/api/git/pull"),{method:"POST",signal:AbortSignal.timeout(yn)});await Xn(e,"Pull failed")},Y8=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}},J8=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})`}}},Q8=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}},X8=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}},e9=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}},t9={},hk=e=>{let t;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const p=t;t=d??(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:()=>{(t9?"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},n9=e=>e?hk(e):hk,OP={},{useDebugValue:r9}=Io,{useSyncExternalStoreWithSelector:s9}=sM;let pk=!1;const i9=e=>e;function o9(e,t=i9,n){(OP?"production":void 0)!=="production"&&n&&!pk&&(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"),pk=!0);const r=s9(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return r9(r),r}const a9=e=>{(OP?"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"?n9(e):e,n=(r,s)=>o9(t,r,s);return Object.assign(n,t),n},l9=e=>a9,zP=async()=>{const e=await fetch(K("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},c9=async e=>{try{const t=await fetch(`${e}/api/capabilities`);return t.ok?(await t.json()).version??null:null}catch{return null}},u9=async()=>{const e=await fetch(K("/api/agent/auth-status"));return e.ok?await e.json():null},cae=async()=>{try{const e=await fetch(K("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},uae=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}},Gx=async()=>{try{const e=await fetch(K("/api/config"));return e.ok?e.json():null}catch{return null}},dae=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}}},d9=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}},fae=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}},FP=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),f9=async e=>{try{const t=await fetch(`${e}/api/package-name`);return t.ok?t.json():null}catch{return null}},h9=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)}},p9=async()=>(await J(K("/api/agent/status"))).json(),m9=async()=>(await J(K("/api/agent/reconcile-queue"))).json(),g9=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)},y9=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)},x9=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)},v9=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)},w9=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)},b9=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)},k9=async()=>{const e=await J(K("/api/agent/launch-reconcile-all"),{method:"POST"});await xn(e)},_9=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)},S9=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)},C9=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)},j9=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)},E9=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)},hae=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},P9=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}},T9=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},mk=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})`)}},N9=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},I9=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},A9=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")},R9=async()=>(await J(K("/api/agent/login-relay/start"),{method:"POST"})).json(),L9=async()=>(await J(K("/api/agent/login-relay/status"))).json(),M9=async()=>{await J(K("/api/agent/login-relay/cancel"),{method:"POST"})},$9=async()=>{const e=await J(K("/api/checks"));return e.ok?(await e.json()).checks??[]:[]},BP=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 Ct(e,t,n,r=()=>({}),s){return async()=>{s&&e({[s]:!0});try{const i=await t();e({...n(i),...s&&{[s]:!1}})}catch(i){e({...r(i),...s&&{[s]:!1}})}}}function Un(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let D9=0;const gk=()=>`preview-${++D9}`;function O9(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:Ct(e,u9,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await p9(),r=t().agentStatus;if(e({agentStatus:n}),n.some(u=>{if(u.taskKind!=="issue-fix"||u.status!=="done"&&u.status!=="error")return!1;const d=r.find(h=>h.id===u.id);return d&&d.status!=="done"&&d.status!=="error"})&&t().loadTaskLog(),n.find(u=>{var h;if(u.status!=="done"||u.taskKind!=="run-all"&&u.taskKind!=="phase")return!1;const d=r.find(p=>p.id===u.id);if(!d||d.status==="done"||d.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"])BP(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:gk()}],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 m9();u&&u.length>0&&(await t().loadPlans(),e(d=>({reconcileQueue:[...d.reconcileQueue,...u.map(h=>({planId:h.planId,before:h.before,previewId:gk()}))]})))}else await t().loadPlans();e({batchReconcileConsumed:!0})}}catch{}},launchAgent:Un(t,g9),launchPlanAudit:Un(t,y9),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 x9(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:Un(t,v9),launchIdeaExtend:Un(t,w9),launchBatchReconcile:Un(t,async()=>{e({batchReconcileConsumed:!1}),await k9()}),launchBatchDraft:Un(t,async n=>{e({batchReconcileConsumed:!1}),await _9(n)}),launchSuggestIdeas:Un(t,b9),launchRunAll:Un(t,S9),launchFixReview:Un(t,C9),launchPrReview:Un(t,j9),launchIssueFix:Un(t,E9),stopAgent:async n=>{try{await A9(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await R9();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:Ct(e,L9,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await M9()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}function z9(e,t){return{diffFiles:null,diffLoadFailed:!1,loadDiffFiles:Ct(e,W8,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 F9=async()=>(await fetch(K("/api/tasks"))).json(),B9=async e=>{try{const t=await fetch(`${e}/api/tasks`);return t.ok?(await t.json()).entries:null}catch{return null}},pae=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()},V9=async()=>(await fetch(K("/api/suggestions"))).json(),U9=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()},W9=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)}},H9=async()=>(await fetch(K("/api/docs"))).json(),VP=async()=>{const e=await fetch(K("/api/roadmap"));if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},K9=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()},mae=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)}},gae=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)}},G9=async()=>(await fetch(K("/api/consistency"))).json(),Z9=async()=>(await fetch(K("/api/doctor"))).json(),UP=45e3,WP=async()=>(await fetch(K("/api/ideas"),{signal:AbortSignal.timeout(UP)})).json(),q9=async e=>{try{const t=await fetch(`${e}/api/ideas`,{signal:AbortSignal.timeout(UP)});return t.ok?await t.json():null}catch{return null}},Y9=async()=>(await fetch(K("/api/archivable-ideas"))).json(),J9=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},HP=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},Q9=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},X9=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},eW=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},tW=async()=>{const e=await fetch(K("/api/notifications"));if(!e.ok)throw new Error(`Failed to fetch notifications: ${e.status}`);return e.json()},nW=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}`)},rW=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()},KP=45e3,GP=async()=>(await fetch(K("/api/plans"),{signal:AbortSignal.timeout(KP)})).json(),sW=async e=>{try{const t=await fetch(`${e}/api/plans`,{signal:AbortSignal.timeout(KP)});return t.ok?await t.json():null}catch{return null}},iW=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})`)}},oW=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},yae=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 aW(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await H9();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 oW();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}const Zx="papercamp:github-corpus";function lW(){try{const e=localStorage.getItem(Zx);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 cW(e){try{localStorage.setItem(Zx,JSON.stringify(e))}catch{}}function uW(){try{localStorage.removeItem(Zx)}catch{}}function dW(e){return{githubConfig:lW(),setGithubConfig:t=>{cW(t),e({githubConfig:t})},clearGithubConfig:()=>{uW(),e({githubConfig:null})}}}function fW(e){return e.archived===!0||e.status==="done"}function hW(e){const t=e.phases.length>0&&e.phases.every(r=>r.done),n=(e.fixes??[]).every(r=>r.done);return t&&n}function pW(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?hW(e)?"review":"in-progress":e.phases.length>0?"planned":"idea":e.status??(e.phases.length>0?"planned":"idea")}function mW(e,t,n){return e.kind==="note"||e.kind==="board"||e.status==="dropped"||e.archived?!1:!n}function gW(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 ZP(e=[]){return qx(e,"log")}function yW(e=[]){return qx(e,"clarification")}function xW(e=[]){return qx(e,"review")}function vW(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 wW(e,t,n){return[...(e??[]).filter(r=>!t.includes(r.kind)),...n]}function qP(e,t,n=!1,r=!1){return{title:e.title,status:pW(e,t,n,r),statusFallback:mW(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:ZP(e.thread),clarifications:yW(e.thread),notes:vW(e.thread),review:xW(e.thread),thread:e.thread,archived:e.archived,pr:t}}function bW(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:ZP(e.thread)}}const Yx=Symbol.for("yaml.alias"),Ng=Symbol.for("yaml.document"),Ps=Symbol.for("yaml.map"),YP=Symbol.for("yaml.pair"),vr=Symbol.for("yaml.scalar"),sa=Symbol.for("yaml.seq"),Mn=Symbol.for("yaml.node.type"),ia=e=>!!e&&typeof e=="object"&&e[Mn]===Yx,oc=e=>!!e&&typeof e=="object"&&e[Mn]===Ng,ac=e=>!!e&&typeof e=="object"&&e[Mn]===Ps,qe=e=>!!e&&typeof e=="object"&&e[Mn]===YP,Ne=e=>!!e&&typeof e=="object"&&e[Mn]===vr,lc=e=>!!e&&typeof e=="object"&&e[Mn]===sa;function Ke(e){if(e&&typeof e=="object")switch(e[Mn]){case Ps:case sa:return!0}return!1}function Ze(e){if(e&&typeof e=="object")switch(e[Mn]){case Yx:case Ps:case vr:case sa:return!0}return!1}const JP=e=>(Ne(e)||Ke(e))&&!!e.anchor,Xs=Symbol("break visit"),kW=Symbol("skip children"),al=Symbol("remove node");function oa(e,t){const n=_W(t);oc(e)?ho(null,e.contents,n,Object.freeze([e]))===al&&(e.contents=null):ho(null,e,n,Object.freeze([]))}oa.BREAK=Xs;oa.SKIP=kW;oa.REMOVE=al;function ho(e,t,n,r){const s=SW(e,t,n,r);if(Ze(s)||qe(s))return CW(e,r,s),ho(e,s,n,r);if(typeof s!="symbol"){if(Ke(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const o=ho(i,t.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Xs)return Xs;o===al&&(t.items.splice(i,1),i-=1)}}}else if(qe(t)){r=Object.freeze(r.concat(t));const i=ho("key",t.key,n,r);if(i===Xs)return Xs;i===al&&(t.key=null);const o=ho("value",t.value,n,r);if(o===Xs)return Xs;o===al&&(t.value=null)}}return s}function _W(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 SW(e,t,n,r){var s,i,o,a,l;if(typeof n=="function")return n(e,t,r);if(ac(t))return(s=n.Map)==null?void 0:s.call(n,e,t,r);if(lc(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(ia(t))return(l=n.Alias)==null?void 0:l.call(n,e,t,r)}function CW(e,t,n){const r=t[t.length-1];if(Ke(r))r.items[e]=n;else if(qe(r))e==="key"?r.key=n:r.value=n;else if(oc(r))r.contents=n;else{const s=ia(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const jW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},EW=e=>e.replace(/[!,[\]{}]/g,t=>jW[t]);class It{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},It.defaultYaml,t),this.tags=Object.assign({},It.defaultTags,n)}clone(){const t=new It(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new It(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:It.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},It.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:It.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},It.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+EW(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={};oa(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
- `)}}It.defaultYaml={explicit:!1,version:"1.2"};It.defaultTags={"!!":"tag:yaml.org,2002:"};function QP(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 XP(e){const t=new Set;return oa(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function eT(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function PW(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=XP(e));const o=eT(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)||Ke(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 po(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=po(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=po(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=po(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=po(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||!JP(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 Jx{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(!oc(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"?po(i,{"":a},"",a):a}}class Qx extends Jx{constructor(t){super(Yx),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=[],oa(t,{Node:(i,o)=>{(ia(o)||JP(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=qu(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(QP(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 qu(e,t,n){if(ia(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Ke(t)){let r=0;for(const s of t.items){const i=qu(e,s,n);i>r&&(r=i)}return r}else if(qe(t)){const r=qu(e,t.key,n),s=qu(e,t.value,n);return Math.max(r,s)}return 1}const tT=e=>!e||typeof e!="function"&&typeof e!="object";class oe extends Jx{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)}}oe.BLOCK_FOLDED="BLOCK_FOLDED";oe.BLOCK_LITERAL="BLOCK_LITERAL";oe.PLAIN="PLAIN";oe.QUOTE_DOUBLE="QUOTE_DOUBLE";oe.QUOTE_SINGLE="QUOTE_SINGLE";const TW="tag:yaml.org,2002:";function NW(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 Fl(e,t,n){var d,h,p;if(oc(e)&&(e=e.contents),Ze(e))return e;if(qe(e)){const m=(h=(d=n.schema[Ps]).createNode)==null?void 0:h.call(d,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 Qx(l.anchor);l={anchor:null,node:null},a.set(e,l)}t!=null&&t.startsWith("!!")&&(t=TW+t.slice(2));let c=NW(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new oe(e);return l&&(l.node=m),m}c=e instanceof Map?o[Ps]:Symbol.iterator in Object(e)?o[sa]: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 oe(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Gd(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 Fl(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 Ha=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class nT extends Jx{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(Ha(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Ke(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Gd(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(Ke(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:Ke(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 Ke(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(Ke(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Gd(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const IW=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Mr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ai=(e,t,n)=>e.endsWith(`
67
- `)?Mr(n,t):n.includes(`
68
- `)?`
69
- `+Mr(n,t):(e.endsWith(" ")?"":" ")+n,rT="flow",Ig="block",Yu="quoted";function zf(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 d=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?c.push(0):d=s-r);let h,p,m=!1,g=-1,v=-1,y=-1;n===Ig&&(g=yk(e,g,t.length),g!==-1&&(d=g+l));for(let w;w=e[g+=1];){if(n===Yu&&w==="\\"){switch(v=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(w===`
70
- `)n===Ig&&(g=yk(e,g,t.length)),d=g+t.length+l,h=void 0;else{if(w===" "&&p&&p!==" "&&p!==`
71
- `&&p!==" "){const b=e[g+1];b&&b!==" "&&b!==`
72
- `&&b!==" "&&(h=g)}if(g>=d)if(h)c.push(h),d=h+l,h=void 0;else if(n===Yu){for(;p===" "||p===" ";)p=w,w=e[g+=1],m=!0;const b=g>y+1?g-2:v-1;if(u[b])return e;c.push(b),u[b]=!0,d=b+l,h=void 0}else m=!0}p=w}if(m&&a&&a(),c.length===0)return e;o&&o();let x=e.slice(0,c[0]);for(let w=0;w<c.length;++w){const b=c[w],_=c[w+1]||e.length;b===0?x=`
73
- ${t}${e.slice(0,_)}`:(n===Yu&&u[b]&&(x+=`${e[b]}\\`),x+=`
74
- ${t}${e.slice(b+1,_)}`)}return x}function yk(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 Ff=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Bf=e=>/^(%|---|\.\.\.)/m.test(e);function AW(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 ll(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Bf(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:zf(o,i,Yu,Ff(t,!1))}function Ag(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
80
- `)||/[ \t]\n|\n[ \t]/.test(e))return ll(e,t);const n=t.indent||(Bf(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
81
- ${n}`)+"'";return t.implicitKey?r:zf(r,n,rT,Ff(t,!1))}function mo(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=ll;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Ag:i&&!s?r=ll:r=n?Ag:ll}return r(e,t)}let Rg;try{Rg=new RegExp(`(^|(?<!
82
- ))
83
- +(?!
84
- |$)`,"g")}catch{Rg=/\n+(?!\n|$)/g}function Ju({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 mo(n,r);const c=r.indent||(r.forceBlockIndent||Bf(n)?" ":""),u=o==="literal"?!0:o==="folded"||t===oe.BLOCK_FOLDED?!1:t===oe.BLOCK_LITERAL?!0:!AW(n,l,c.length);if(!n)return u?`|
85
- `:`>
86
- `;let d,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?d="-":n===p||m!==p.length-1?(d="+",i&&i()):d="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
89
- `&&(p=p.slice(0,-1)),p=p.replace(Rg,`$&${c}`));let g=!1,v,y=-1;for(v=0;v<n.length;++v){const _=n[v];if(_===" ")g=!0;else if(_===`
90
- `)y=v;else break}let x=n.substring(0,y<v?y+1:v);x&&(n=n.substring(x.length),x=x.replace(/\n+/g,`$&${c}`));let b=(g?c?"2":"1":"")+d;if(e&&(b+=" "+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=Ff(r,!0);o!=="folded"&&t!==oe.BLOCK_FOLDED&&(j.onOverflow=()=>{S=!0});const E=zf(`${x}${_}${p}`,c,Ig,j);if(!S)return`>${b}
92
- ${c}${E}`}return n=n.replace(/\n+/g,`$&${c}`),`|${b}
93
- ${c}${x}${n}${p}`}function RW(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 mo(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
95
- `)?mo(i,t):Ju(e,t,n,r);if(!a&&!u&&s!==oe.PLAIN&&i.includes(`
96
- `))return Ju(e,t,n,r);if(Bf(i)){if(l==="")return t.forceBlockIndent=!0,Ju(e,t,n,r);if(a&&l===c)return mo(i,t)}const d=i.replace(/\n+/g,`$&
97
- ${l}`);if(o){const h=g=>{var v;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((v=g.test)==null?void 0:v.test(d))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return mo(i,t)}return a?d:zf(d,l,rT,Ff(t,!1))}function Xx(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!==oe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=oe.QUOTE_DOUBLE);const l=u=>{switch(u){case oe.BLOCK_FOLDED:case oe.BLOCK_LITERAL:return s||i?mo(o.value,t):Ju(o,t,n,r);case oe.QUOTE_DOUBLE:return ll(o.value,t);case oe.QUOTE_SINGLE:return Ag(o.value,t);case oe.PLAIN:return RW(o,t,n,r);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:d}=t.options,h=s&&u||d;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function sT(e,t){const n=Object.assign({blockQuote:!0,commentString:IW,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 LW(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 MW(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Ne(e)||Ke(e))&&e.anchor;i&&QP(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 Ho(e,t,n,r){var l;if(qe(e))return e.toString(t,n,r);if(ia(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=LW(t.doc.schema.tags,i));const o=MW(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)?Xx(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 $W({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=n;let h=Ze(e)&&e.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ke(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=!d&&(!e||h&&t==null&&!n.inFlow||Ke(e)||(Ne(e)?e.type===oe.BLOCK_FOLDED||e.type===oe.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!i),indent:a+l});let m=!1,g=!1,v=Ho(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&v.length>1024){if(d)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(),v===""?"?":p?`? ${v}`:v}else if(i&&!d||t==null&&p)return v=`? ${v}`,h&&!m?v+=ai(v,n.indent,c(h)):g&&s&&s(),v;m&&(h=null),p?(h&&(v+=ai(v,n.indent,c(h))),v=`? ${v}
99
- ${a}:`):(v=`${v}:`,h&&(v+=ai(v,n.indent,c(h))));let y,x,w;Ze(t)?(y=!!t.spaceBefore,x=t.commentBefore,w=t.comment):(y=!1,x=null,w=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!h&&Ne(t)&&(n.indentAtStart=v.length+1),g=!1,!u&&l.length>=2&&!n.inFlow&&!p&&lc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1;const _=Ho(t,n,()=>b=!0,()=>g=!0);let S=" ";if(h||y||x){if(S=y?`
100
- `:"",x){const j=c(x);S+=`
101
- ${Mr(j,n.indent)}`}_===""&&!n.inFlow?S===`
102
- `&&w&&(S=`
103
-
104
- `):S+=`
105
- ${n.indent}`}else if(!p&&Ke(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 A=_.indexOf(" ");j==="&"&&A!==-1&&A<E&&_[A+1]==="!"&&(A=_.indexOf(" ",A+1)),(A===-1||E<A)&&(N=!0)}N||(S=`
107
- ${n.indent}`)}}else(_===""||_[0]===`
108
- `)&&(S="");return v+=S+_,n.inFlow?b&&r&&r():w&&!b?v+=ai(v,n.indent,c(w)):g&&s&&s(),v}function iT(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const lu="<<",Or={identify:e=>e===lu||typeof e=="symbol"&&e.description===lu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new oe(Symbol(lu)),{addToJSMap:oT}),stringify:()=>lu},DW=(e,t)=>(Or.identify(t)||Ne(t)&&(!t.type||t.type===oe.PLAIN)&&Or.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Or.tag&&n.default));function oT(e,t,n){const r=aT(e,n);if(lc(r))for(const s of r.items)kp(e,t,s);else if(Array.isArray(r))for(const s of r)kp(e,t,s);else kp(e,t,r)}function kp(e,t,n){const r=aT(e,n);if(!ac(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 aT(e,t){return e&&ia(t)?t.resolve(e.doc,e):t}function lT(e,t,{key:n,value:r}){if(Ze(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(DW(e,n))oT(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=OW(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 OW(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ze(e)&&(n!=null&&n.doc)){const r=sT(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)+'..."'),iT(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 ev(e,t,n){const r=Fl(e,void 0,n),s=Fl(t,void 0,n);return new Mt(r,s)}class Mt{constructor(t,n=null){Object.defineProperty(this,Mn,{value:YP}),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 lT(n,r,this)}toString(t,n,r){return t!=null&&t.doc?$W(this,t,n,r):JSON.stringify(this)}}function cT(e,t,n){return(t.inFlow??e.flow?FW:zW)(e,t,n)}function zW({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 d=!1;const h=[];for(let m=0;m<t.length;++m){const g=t[m];let v=null;if(Ze(g))!d&&g.spaceBefore&&h.push(""),Zd(n,h,g.commentBefore,d),g.comment&&(v=g.comment);else if(qe(g)){const x=Ze(g.key)?g.key:null;x&&(!d&&x.spaceBefore&&h.push(""),Zd(n,h,x.commentBefore,d))}d=!1;let y=Ho(g,u,()=>v=null,()=>d=!0);v&&(y+=ai(y,i,c(v))),d&&v&&(d=!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
- `+Mr(c(e),l),a&&a()):d&&o&&o(),p}function FW({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 d=[];for(let m=0;m<e.length;++m){const g=e[m];let v=null;if(Ze(g))g.spaceBefore&&d.push(""),Zd(t,d,g.commentBefore,!1),g.comment&&(v=g.comment);else if(qe(g)){const x=Ze(g.key)?g.key:null;x&&(x.spaceBefore&&d.push(""),Zd(t,d,x.commentBefore,!1),x.comment&&(c=!0));const w=Ze(g.value)?g.value:null;w?(w.comment&&(v=w.comment),w.commentBefore&&(c=!0)):g.value==null&&(x!=null&&x.comment)&&(v=x.comment)}v&&(c=!0);let y=Ho(g,l,()=>v=null);c||(c=d.length>u||y.includes(`
112
- `)),m<e.length-1?y+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=d.reduce((x,w)=>x+w.length+2,2)+(y.length+2)>t.options.lineWidth)),c&&(y+=",")),v&&(y+=ai(y,r,a(v))),d.push(y),u=d.length}const{start:h,end:p}=n;if(d.length===0)return h+p;if(!c){const m=d.reduce((g,v)=>g+v.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const g of d)m+=g?`
113
- ${i}${s}${g}`:`
114
- `;return`${m}
115
- ${s}${p}`}else return`${h}${o}${d.join(" ")}${o}${p}`}function Zd({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=Mr(t(r),e);n.push(i.trimStart())}}function li(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 nT{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(ev(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=li(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)&&tT(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=li(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=li(this.items,t),s=r==null?void 0:r.value;return(!n&&Ne(s)?s.value:s)??void 0}has(t){return!!li(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)lT(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})),cT(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const aa={collection:"map",default:!0,nodeClass:jn,tag:"tag:yaml.org,2002:map",resolve(e,t){return ac(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>jn.from(e,t,n)};class ki extends nT{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(sa,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=cu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=cu(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Ne(s)?s.value:s}has(t){const n=cu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=cu(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Ne(s)&&tT(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?cT(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(Fl(a,void 0,r))}}return i}}function cu(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 la={collection:"seq",default:!0,nodeClass:ki,tag:"tag:yaml.org,2002:seq",resolve(e,t){return lc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ki.from(e,t,n)},Vf={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),Xx(e,t,n,r)}},Uf={identify:e=>e==null,createNode:()=>new oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new oe(null),stringify:({source:e},t)=>typeof e=="string"&&Uf.test.test(e)?e:t.options.nullStr},tv={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new oe(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&tv.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 uT={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},dT={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)}},fT={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 oe(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:er},Wf=e=>typeof e=="bigint"||Number.isInteger(e),nv=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function hT(e,t,n){const{value:r}=e;return Wf(r)&&r>=0?n+r.toString(t):er(e)}const pT={identify:e=>Wf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>nv(e,2,8,n),stringify:e=>hT(e,8,"0o")},mT={identify:Wf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>nv(e,0,10,n),stringify:er},gT={identify:e=>Wf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>nv(e,2,16,n),stringify:e=>hT(e,16,"0x")},BW=[aa,la,Vf,Uf,tv,pT,mT,gT,uT,dT,fT];function xk(e){return typeof e=="bigint"||Number.isInteger(e)}const uu=({value:e})=>JSON.stringify(e),VW=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:uu},{identify:e=>e==null,createNode:()=>new oe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:uu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:uu},{identify:xk,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})=>xk(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:uu}],UW={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},WW=[aa,la].concat(VW,UW),rv={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=oe.BLOCK_LITERAL),t!==oe.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 d=0,h=0;d<c;++d,h+=l)u[d]=a.substr(h,l);a=u.join(t===oe.BLOCK_LITERAL?`
116
- `:" ")}return Xx({comment:e,type:t,value:a},r,s,i)}};function yT(e,t){if(lc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qe(r)){if(ac(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new Mt(new oe(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 xT(e,t,n){const{replacer:r}=n,s=new ki(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(ev(a,l,n))}return s}const sv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:yT,createNode:xT};class jo extends ki{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=jo.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=xT(t,n,r),i=new this;return i.items=s.items,i}}jo.tag="tag:yaml.org,2002:omap";const iv={collection:"seq",identify:e=>e instanceof Map,nodeClass:jo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=yT(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 jo,n)},createNode:(e,t,n)=>jo.from(e,t,n)};function vT({value:e,source:t},n){return t&&(e?wT:bT).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const wT={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 oe(!0),stringify:vT},bT={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 oe(!1),stringify:vT},HW={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},KW={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)}},GW={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 oe(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},cc=e=>typeof e=="bigint"||Number.isInteger(e);function Hf(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 ov(e,t,n){const{value:r}=e;if(cc(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return er(e)}const ZW={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Hf(e,2,2,n),stringify:e=>ov(e,2,"0b")},qW={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Hf(e,1,8,n),stringify:e=>ov(e,8,"0")},YW={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Hf(e,0,10,n),stringify:er},JW={identify:cc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Hf(e,2,16,n),stringify:e=>ov(e,16,"0x")};class Eo extends jn{constructor(t){super(t),this.tag=Eo.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),li(this.items,n.key)||this.items.push(n)}get(t,n){const r=li(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=li(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(ev(o,null,r));return i}}Eo.tag="tag:yaml.org,2002:set";const av={collection:"map",identify:e=>e instanceof Set,nodeClass:Eo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Eo.from(e,t,n),resolve(e,t){if(ac(e)){if(e.hasAllNullValues(!0))return Object.assign(new Eo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function lv(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 kT(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 _T={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})=>lv(e,n),stringify:kT},ST={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=>lv(e,!1),stringify:kT},Kf={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(Kf.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 d=lv(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},vk=[aa,la,Vf,Uf,wT,bT,ZW,qW,YW,JW,HW,KW,GW,rv,Or,iv,sv,av,_T,ST,Kf],wk=new Map([["core",BW],["failsafe",[aa,la,Vf]],["json",WW],["yaml11",vk],["yaml-1.1",vk]]),bk={binary:rv,bool:tv,float:fT,floatExp:dT,floatNaN:uT,floatTime:ST,int:mT,intHex:gT,intOct:pT,intTime:_T,map:aa,merge:Or,null:Uf,omap:iv,pairs:sv,seq:la,set:av,timestamp:Kf},QW={"tag:yaml.org,2002:binary":rv,"tag:yaml.org,2002:merge":Or,"tag:yaml.org,2002:omap":iv,"tag:yaml.org,2002:pairs":sv,"tag:yaml.org,2002:set":av,"tag:yaml.org,2002:timestamp":Kf};function _p(e,t,n){const r=wk.get(t);if(r&&!e)return n&&!r.includes(Or)?r.concat(Or):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(wk.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(Or)),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 XW=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let eH=class CT{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?_p(t,"compat"):t?_p(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?QW:{},this.tags=_p(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Ps,{value:aa}),Object.defineProperty(this,vr,{value:Vf}),Object.defineProperty(this,sa,{value:la}),this.sortMapEntries=typeof o=="function"?o:o===!0?XW:null}clone(){const t=Object.create(CT.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function tH(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=sT(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=i(e.commentBefore);n.unshift(Mr(c,""))}let o=!1,a=null;if(e.contents){if(Ze(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const d=i(e.contents.commentBefore);n.push(Mr(d,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let u=Ho(e.contents,s,()=>a=null,c);a&&(u+=ai(u,"",i(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Ho(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(Mr(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(Mr(i(c),"")))}return n.join(`
120
- `)+`
121
- `}class uc{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Mn,{value:Ng});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 It({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(uc.prototype,{[Mn]:{value:Ng}});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){Ui(this.contents)&&this.contents.add(t)}addIn(t,n){Ui(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=XP(this);t.anchor=!n||r.has(n)?eT(n||"a",r):n}return new Qx(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 v=x=>typeof x=="number"||x instanceof String||x instanceof Number,y=n.filter(v).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:d,setAnchors:h,sourceObjects:p}=PW(this,o||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:p},g=Fl(t,u,m);return a&&Ke(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 Ui(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ha(t)?this.contents==null?!1:(this.contents=null,!0):Ui(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ke(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ha(t)?!n&&Ne(this.contents)?this.contents.value:this.contents:Ke(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ke(this.contents)?this.contents.has(t):!1}hasIn(t){return Ha(t)?this.contents!==void 0:Ke(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Gd(this.schema,[t],n):Ui(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ha(t)?this.contents=n:this.contents==null?this.contents=Gd(this.schema,Array.from(t),n):Ui(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 It({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 It({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 eH(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"?po(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 tH(this,t)}}function Ui(e){if(Ke(e))return!0;throw new Error("Expected a YAML collection as document contents")}class jT extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ka extends jT{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class nH extends jT{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const kk=(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 Ko(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,d="",h="",p=!1,m=!1,g=null,v=null,y=null,x=null,w=null,b=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)||" ";d?d+=h+T:d=T,h="",c=!1;break}case"newline":c?d?d+=E.source:(!b||n!=="seq-item-ind")&&(l=!0):h+=E.source,c=!0,p=!0,(v||y)&&(x=E),u=!0;break;case"anchor":v&&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),v=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:(v||y)&&i(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),b&&i(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),b=E,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&i(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=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:w,found:b,spaceBefore:l,comment:d,hasNewline:p,anchor:v,tag:y,newlineAfterProp:x,end:j,start:_??j}}function Bl(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(Bl(t.key)||Bl(t.value))return!0}return!1;default:return!0}}function Lg(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Bl(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function ET(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 _k="All mapping items must start at the same column";function rH({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 d of r.items){const{start:h,key:p,sep:m,value:g}=d,v=Ko(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!v.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",_k)),!v.anchor&&!v.tag&&!m){c=v.end,v.comment&&(a.comment?a.comment+=`
128
- `+v.comment:a.comment=v.comment);continue}(v.newlineAfterProp||Bl(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=v.found)==null?void 0:u.indent)!==r.indent&&s(l,"BAD_INDENT",_k);n.atKey=!0;const x=v.end,w=p?e(n,p,v,s):t(n,x,h,null,v,s);n.schema.compat&&Lg(r.indent,p,s),n.atKey=!1,ET(n,a.items,w)&&s(x,"DUPLICATE_KEY","Map keys must be unique");const b=Ko(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=b.end,b.found){y&&((g==null?void 0:g.type)==="block-map"&&!b.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<b.found.offset-1024&&s(w.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,b,s):t(n,l,m,null,b,s);n.schema.compat&&Lg(r.indent,g,s),l=_.range[2];const S=new Mt(w,_);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}else{y&&s(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(w.comment?w.comment+=`
129
- `+b.comment:w.comment=b.comment);const _=new Mt(w);n.options.keepSourceTokens&&(_.srcToken=d),a.items.push(_)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}function sH({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=(i==null?void 0:i.nodeClass)??ki,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:d}of r.items){const h=Ko(u,{indicator:"seq-item-ind",next:d,offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||d)(d==null?void 0:d.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=d?e(n,d,h,s):t(n,h.end,u,null,h,s);n.schema.compat&&Lg(r.indent,d,s),l=p.range[2],a.items.push(p)}return a.range=[r.offset,l,c??l],a}function dc(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 Sp="Block collections are not allowed within flow collections",Cp=e=>e&&(e.type==="block-map"||e.type==="block-seq");function iH({composeNode:e,composeEmptyNode:t},n,r,s,i){var v;const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(i==null?void 0:i.nodeClass)??(o?jn:ki),c=new l(n.schema);c.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let y=0;y<r.items.length;++y){const x=r.items[y],{start:w,key:b,sep:_,value:S}=x,j=Ko(w,{flow:a,indicator:"explicit-key-ind",next:b??(_==null?void 0:_[0]),offset:d,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),d=j.end;continue}!o&&n.options.strict&&Bl(b)&&s(b,"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 w)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),d=E.range[2],Cp(S)&&s(E.range,"BLOCK_IN_FLOW",Sp)}else{n.atKey=!0;const E=j.end,T=b?e(n,b,j,s):t(n,E,w,null,j,s);Cp(b)&&s(T.range,"BLOCK_IN_FLOW",Sp),n.atKey=!1;const P=Ko(_??[],{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 R of _){if(R===P.found)break;if(R.type==="newline"){s(R,"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&&((v=S.source)==null?void 0:v[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?Cp(S)&&s(N.range,"BLOCK_IN_FLOW",Sp):P.comment&&(T.comment?T.comment+=`
132
- `+P.comment:T.comment=P.comment);const A=new Mt(T,N);if(n.options.keepSourceTokens&&(A.srcToken=x),o){const R=c;ET(n,R.items,T)&&s(E,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(A)}else{const R=new jn(n.schema);R.flow=!0,R.items.push(A);const $=(N??T).range;R.range=[T.range[0],$[1],$[2]],c.items.push(R)}d=N?N.range[2]:P.end}}const h=o?"}":"]",[p,...m]=r.end;let g=d;if((p==null?void 0:p.source)===h)g=p.offset+p.source.length;else{const y=a[0].toUpperCase()+a.substring(1),x=u?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",x),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){const y=dc(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 jp(e,t,n,r,s,i){const o=n.type==="block-map"?rH(e,t,n,r,i):n.type==="block-seq"?sH(e,t,n,r,i):iH(e,t,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function oH(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===ki.tagName&&a==="seq")return jp(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),jp(e,t,n,s,o)}const c=jp(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,d=Ze(u)?u:new oe(u);return d.range=c.range,d.tag=o,l!=null&&l.format&&(d.format=l.format),d}function aH(e,t,n){const r=t.offset,s=lH(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?oe.BLOCK_FOLDED:oe.BLOCK_LITERAL,o=t.source?cH(t.source):[];let a=o.length;for(let g=o.length-1;g>=0;--g){const v=o[g][1];if(v===""||v==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&o.length>0?`
134
- `.repeat(Math.max(1,o.length-1)):"";let v=r+s.length;return t.source&&(v+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,v,v]}}let l=t.indent+s.indent,c=t.offset+s.length,u=0;for(let g=0;g<a;++g){const[v,y]=o[g];if(y===""||y==="\r")s.indent===0&&v.length>l&&(l=v.length);else{v.length<l&&n(c+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=v.length),u=g,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=v.length+y.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>l&&(a=g+1);let d="",h="",p=!1;for(let g=0;g<u;++g)d+=o[g][0].slice(l)+`
135
- `;for(let g=u;g<a;++g){let[v,y]=o[g];c+=v.length+y.length+1;const x=y[y.length-1]==="\r";if(x&&(y=y.slice(0,-1)),y&&v.length<l){const b=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(x?2:1),"BAD_INDENT",b),v=""}i===oe.BLOCK_LITERAL?(d+=h+v.slice(l)+y,h=`
136
- `):v.length>l||y[0]===" "?(h===" "?h=`
137
- `:!p&&h===`
138
- `&&(h=`
139
-
140
- `),d+=h+v.slice(l)+y,h=`
141
- `,p=!0):y===""?h===`
142
- `?d+=`
143
- `:h=`
144
- `:(d+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)d+=`
145
- `+o[g][0].slice(l);d[d.length-1]!==`
146
- `&&(d+=`
147
- `);break;default:d+=`
148
- `}const m=r+s.length+t.source.length;return{value:d,type:i,comment:s.comment,range:[r,m,m]}}function lH({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="",d=s.length;for(let h=1;h<t.length;++h){const p=t[h];switch(p.type){case"space":c=!0;case"newline":d+=p.source.length;break;case"comment":n&&!c&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),d+=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"&&(d+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function cH(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 uH(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=oe.PLAIN,l=dH(i,c);break;case"single-quoted-scalar":a=oe.QUOTE_SINGLE,l=fH(i,c);break;case"double-quoted-scalar":a=oe.QUOTE_DOUBLE,l=hH(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,d=dc(o,u,t,n);return{value:l,type:a,comment:d.comment,range:[r,u,d.offset]}}function dH(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}`),PT(e)}function fH(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),PT(e.slice(1,-1)).replace(/''/g,"'")}function PT(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 hH(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}=pH(e,r);n+=i,r=o}else if(s==="\\"){let i=e[++r];const o=mH[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+=gH(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 pH(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 mH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
163
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gH(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 TT(e,t,n,r){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?aH(e,t,r):uH(t,e.options.strict,r),l=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[vr]:l?c=yH(e.schema,s,l,n,r):t.type==="scalar"?c=xH(e,s,t,r):c=e.schema[vr];let u;try{const d=c.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);u=Ne(d)?d:new oe(d)}catch(d){const h=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",h),u=new oe(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 yH(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 xH({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 vH(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 wH={composeNode:NT,composeEmptyNode:cv};function NT(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=bH(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=TT(e,t,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=oH(wH,e,t,n,r),a&&(c.anchor=a.source.substring(1))}catch(d){const h=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return c??(c=cv(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 cv(e,t,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:vH(t,n,r),indent:-1,source:""},d=TT(e,u,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=l),d}function bH({options:e},{offset:t,source:n,end:r},s){const i=new Qx(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=dc(r,o,e.strict,s);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}function kH(e,t,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:t},e),l=new uc(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Ko(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?NT(c,s,u,o):cv(c,u.end,r,null,u,o);const d=l.contents.range[2],h=dc(i,d,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,d,h.offset],l}function $a(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 Sk(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 _H{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=$a(n);i?this.warnings.push(new nH(o,r,s)):this.errors.push(new Ka(o,r,s))},this.directives=new It({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=Sk(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(Ke(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:Sk(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=$a(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=kH(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 Ka($a(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 Ka($a(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=dc(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 Ka($a(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 uc(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 IT="\uFEFF",AT="",RT="",Mg="";function SH(e){switch(e){case IT:return"byte-order-mark";case AT:return"doc-mode";case RT:return"flow-error-end";case Mg: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 Ck=new Set("0123456789ABCDEFabcdef"),CH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),du=new Set(",[]{}"),jH=new Set(` ,[]{}
174
- \r `),Ep=e=>!e||jH.has(e);class EH{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]===IT&&(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 AT,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(Ep),"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 RT,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(Ep),"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 Mg,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&&du.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&&du.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&&du.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Mg,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(Ep),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(Wn(r)||n&&du.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(CH.has(n))n=this.buffer[++t];else if(n==="%"&&Ck.has(this.buffer[t+1])&&Ck.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 PH{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 jk(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 LT(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 fu(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 Wi(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 Ek(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,LT(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 TH{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 EH,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=SH(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"&&Ek(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&&jk(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":{jk(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=fu(this.peek(2)),r=Wi(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(LT(n.key)&&!ls(n.sep,"newline")){const a=Wi(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=Wi(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=fu(r),i=Wi(s);Ek(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=fu(t),r=Wi(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=fu(t),r=Wi(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 NH(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new PH||null,prettyErrors:t}}function IH(e,t={}){const{lineCounter:n,prettyErrors:r}=NH(t),s=new TH(n==null?void 0:n.addNewLine),i=new _H(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 Ka(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(kk(e,n)),o.warnings.forEach(kk(e,n))),o}function AH(e,t,n){let r;const s=IH(e,n);if(!s)return null;if(s.warnings.forEach(i=>iT(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 RH(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return oc(e)&&!r?e.toString(n):new uc(e,r,n).toString(n)}function Pk(e,t){return e.toFixed(t).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Gf(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 LH(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 Ar(e){return e>=1e6?`${Pk(e/1e6,1)}M`:e>=1e3?`${Pk(e/1e3,1)}k`:`${Math.round(e)}`}function Tk(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 MH(e){return`${Ar(e.inputTokens+e.outputTokens)} tokens · ${Gf(e.durationMs)}${e.attempts>1?` ×${e.attempts}`:""}${e.model?` · ${e.model}`:""}`}function $H(e){const t=[Gf(e.durationMs),`${Ar(e.inputTokens)} in`,`${Ar(e.outputTokens)} out`];return e.model&&t.push(e.model),e.attempts>1&&t.push(`×${e.attempts}`),t.join(" · ")}function DH(e){const t=e.split("·").map(s=>s.trim()).filter(Boolean);if(t.length===0)return;const n=LH(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=Tk(i[1]):o?r.outputTokens=Tk(o[1]):a?r.attempts=Number(a[1]):r.model=s}return r}function OH(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 MT=/^#{2,3}\s+/,Yd=/^[-*]\s+\[([ xX])\]\s+(.*)$/,zH=/^\[(review|manual|issue)\]\s+(.*)$/,FH=/^run:\s*(.+)$/,Nk=/^-\s+(\d{4}-\d{2}-\d{2}):\s*(.*)$/,BH=/^\[(?:phase:(\d+)|body)\]\s+(?:\[(decision|question)\]\s+)?(.*)$/,Ik=/^-\s+\[([ xX])\]\s+(?:(\d{4}-\d{2}-\d{2})\s+)?\[(log|clarification|review|note|decision|question|chat)\]\s+(\[agent\]\s+)?(.*)$/,VH=["note","decision","question"];function uv(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)||MT.test(a))break;s.push(a),i++}return{text:s.join(" "),next:i}}function dv(e,t){return t?`${e.trim()} ${t}`:e.trim()}function $T(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Yd);if(i){const o=i[1].toLowerCase()==="x",a=i[2].trim(),l=a.match(zH),c=l?l[2].trim():a,u=l?l[1]:void 0,d=[];let h;for(s++;s<n;){const p=e[s];if(p.trim()===""||Yd.test(p)||MT.test(p))break;if(/^\s/.test(p)){const m=p.trimStart(),g=m.match(FH),v=g?DH(g[1]):void 0;v?h=v:d.push(m),s++}else break}r.push({done:o,text:c,description:d.length>0?d.join(`
196
- `):void 0,source:u,run:h})}else s++}return r}function fv(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Nk);if(!i){s++;continue}const o=uv(e,s+1,n,Nk);r.push({date:i[1],text:dv(i[2],o.text)}),s=o.next}return r}function DT(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: ${$H(r.run)}`)}return n}function hv(e,t){return[e,...t.map(n=>`- ${n.date}: ${n.text}`)]}function UH(e){return e.kind==="phase"?`[phase:${e.index}]`:"[body]"}function WH(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Yd),o=i?i[2].trim().match(BH):null;if(!i||!o){s++;continue}const a=o[1]?{kind:"phase",index:Number(o[1])}:{kind:"body"},l=o[2],c=uv(e,s+1,n,Yd);r.push({anchor:a,prose:dv(o[3],c.text),state:i[1].toLowerCase()==="x"?"resolved":"open",...l?{kind:l}:{}}),s=c.next}return r}function HH(e){const t=["### Notes"];for(const n of e){const r=n.kind&&n.kind!=="note"?`[${n.kind}] `:"";t.push(`- [${n.state==="resolved"?"x":" "}] ${UH(n.anchor)} ${r}${n.prose}`)}return t}const OT={headingRe:/^#{2,3}\s+Phases\s*$/i,parseEntries:$T,formatLines:e=>DT("### Phases",e)},zT={headingRe:/^#{2,3}\s+Fixes\s*$/i,parseEntries:$T,formatLines:e=>DT("### Fixes",e)},KH={headingRe:/^#{2,3}\s+Log\s*$/i,parseEntries:fv,formatLines:e=>hv("### Log",e)},GH={headingRe:/^#{2,3}\s+Clarifications\s*$/i,parseEntries:fv,formatLines:e=>hv("### Clarifications",e)},ZH={headingRe:/^#{2,3}\s+Notes\s*$/i,parseEntries:WH,formatLines:HH},qH={headingRe:/^#{2,3}\s+Review\s*$/i,parseEntries:fv,formatLines:e=>hv("### Review",e)};function YH(e,t,n){const r=[];let s=t;for(;s<n;){const i=e[s].match(Ik);if(!i){s++;continue}const o=i[3],a=uv(e,s+1,n,Ik),l={kind:o,text:dv(i[5],a.text)};i[2]&&(l.date=i[2]),i[4]&&(l.from="agent"),VH.includes(o)&&(l.state=i[1].toLowerCase()==="x"?"resolved":"open"),r.push(l),s=a.next}return r}function JH(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 FT={headingRe:/^#{2,3}\s+Thread\s*$/i,parseEntries:YH,formatLines:JH};var Ak;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 d=0;d<u.length;d++){const h=u[d];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 Po extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class BT extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ak=globalThis).__zod_globalConfig??(Ak.__zod_globalConfig={});const pv=globalThis.__zod_globalConfig;function _i(e){return pv}function VT(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 $g(e,t){return typeof t=="bigint"?t.toString():t}function mv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function gv(e){return e==null}function yv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function QH(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 Rk=Symbol("evaluating");function be(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Rk)return r===void 0&&(r=Rk,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ii(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Lk(e){return JSON.stringify(e)}function XH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const UT="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const eK=mv(()=>{var e;if(pv.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 Vl(e){if(Jd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Jd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function WT(e){return Vl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const tK=new Set(["string","number","symbol"]);function Zf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fs(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 nK(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const rK={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 sK(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=zs(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 Ii(this,"shape",o),o},checks:[]});return Fs(e,i)}function iK(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=zs(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 Ii(this,"shape",o),o},checks:[]});return Fs(e,i)}function oK(e,t){if(!Vl(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=zs(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Ii(this,"shape",i),i}});return Fs(e,s)}function aK(e,t){if(!Vl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Ii(this,"shape",r),r}});return Fs(e,n)}function lK(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=zs(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Ii(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Fs(e,n)}function cK(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=zs(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 Ii(this,"shape",l),l},checks:[]});return Fs(t,o)}function uK(e,t,n){const r=zs(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 Ii(this,"shape",i),i}});return Fs(t,r)}function go(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 dK(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 HT(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function hu(e){return typeof e=="string"?e:e==null?void 0:e.message}function Si(e,t,n){var l,c,u,d,h,p;const r=e.message?e.message:hu((u=(c=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:c.error)==null?void 0:u.call(c,e))??hu((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??hu((h=n.customError)==null?void 0:h.call(n,e))??hu((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 xv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ul(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const KT=(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,$g,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},GT=B("$ZodError",KT),ZT=B("$ZodError",KT,{Parent:Error});function fK(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 hK(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 vv=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 Po;if(o.issues.length){const a=new((s==null?void 0:s.Err)??e)(o.issues.map(l=>Si(l,i,_i())));throw UT(a,s==null?void 0:s.callee),a}return o.value},wv=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=>Si(l,i,_i())));throw UT(a,s==null?void 0:s.callee),a}return o.value},qf=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 Po;return i.issues.length?{success:!1,error:new(e??GT)(i.issues.map(o=>Si(o,s,_i())))}:{success:!0,data:i.value}},pK=qf(ZT),Yf=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=>Si(o,s,_i())))}:{success:!0,data:i.value}},mK=Yf(ZT),gK=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return vv(e)(t,n,s)},yK=e=>(t,n,r)=>vv(e)(t,n,r),xK=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return wv(e)(t,n,s)},vK=e=>async(t,n,r)=>wv(e)(t,n,r),wK=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return qf(e)(t,n,s)},bK=e=>(t,n,r)=>qf(e)(t,n,r),kK=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Yf(e)(t,n,s)},_K=e=>async(t,n,r)=>Yf(e)(t,n,r),SK=/^[cC][0-9a-z]{6,}$/,CK=/^[0-9a-z]+$/,jK=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,EK=/^[0-9a-vA-V]{20}$/,PK=/^[A-Za-z0-9]{27}$/,TK=/^[a-zA-Z0-9_-]{21}$/,NK=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,IK=/^([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})$/,Mk=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)$/,AK=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,RK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function LK(){return new RegExp(RK,"u")}const MK=/^(?:(?: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])$/,$K=/^(([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}|:))$/,DK=/^((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])$/,OK=/^(([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])$/,zK=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qT=/^[A-Za-z0-9_-]*$/,FK=/^https?$/,BK=/^\+[1-9]\d{6,14}$/,YT="(?:(?:\\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])))",VK=new RegExp(`^${YT}$`);function JT(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 UK(e){return new RegExp(`^${JT(e)}$`)}function WK(e){const t=JT({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(`^${YT}T(?:${r})$`)}const HK=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}$`)},KK=/^-?\d+$/,GK=/^-?\d+(?:\.\d+)?$/,ZK=/^(?:true|false)$/i,qK=/^[^A-Z]*$/,YK=/^[^a-z]*$/,Yt=B("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),QT={number:"number",bigint:"bigint",object:"date"},XT=B("$ZodCheckLessThan",(e,t)=>{Yt.init(e,t);const n=QT[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})}}),eN=B("$ZodCheckGreaterThan",(e,t)=>{Yt.init(e,t);const n=QT[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})}}),JK=B("$ZodCheckMultipleOf",(e,t)=>{Yt.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):QH(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})}}),QK=B("$ZodCheckNumberFormat",(e,t)=>{var o;Yt.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]=rK[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=KK)}),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})}}),XK=B("$ZodCheckMaxLength",(e,t)=>{var n;Yt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!gv(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=xv(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),eG=B("$ZodCheckMinLength",(e,t)=>{var n;Yt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!gv(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=xv(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),tG=B("$ZodCheckLengthEquals",(e,t)=>{var n;Yt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!gv(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=xv(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})}}),Jf=B("$ZodCheckStringFormat",(e,t)=>{var n,r;Yt.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=()=>{})}),nG=B("$ZodCheckRegex",(e,t)=>{Jf.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})}}),rG=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qK),Jf.init(e,t)}),sG=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=YK),Jf.init(e,t)}),iG=B("$ZodCheckIncludes",(e,t)=>{Yt.init(e,t);const n=Zf(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})}}),oG=B("$ZodCheckStartsWith",(e,t)=>{Yt.init(e,t);const n=new RegExp(`^${Zf(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})}}),aG=B("$ZodCheckEndsWith",(e,t)=>{Yt.init(e,t);const n=new RegExp(`.*${Zf(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})}}),lG=B("$ZodCheckOverwrite",(e,t)=>{Yt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class cG{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 uG={major:4,minor:4,patch:3},Ye=B("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uG;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=go(a),d;for(const h of l){if(h._zod.def.when){if(dK(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 Po;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(u||(u=go(a,p)))});else{if(a.issues.length===p)continue;u||(u=go(a,p))}}return d?d.then(()=>a):a},o=(a,l,c)=>{if(go(a))return a.aborted=!0,a;const u=i(l,r,c);if(u instanceof Promise){if(c.async===!1)throw new Po;return u.then(d=>e._zod.parse(d,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(d=>o(d,a,l)):o(u,a,l)}const c=e._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new Po;return c.then(u=>i(u,r,l))}return i(c,r,l)}}be(e,"~standard",()=>({validate:i=>{var o;try{const a=pK(e,i);return a.success?{value:a.data}:{issues:(o=a.error)==null?void 0:o.issues}}catch{return mK(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}))}),bv=B("$ZodString",(e,t)=>{var n;Ye.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??HK(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)=>{Jf.init(e,t),bv.init(e,t)}),dG=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=IK),$e.init(e,t)}),fG=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=Mk(r))}else t.pattern??(t.pattern=Mk());$e.init(e,t)}),hG=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=AK),$e.init(e,t)}),pG=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)===FK.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})}}}),mG=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=LK()),$e.init(e,t)}),gG=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=TK),$e.init(e,t)}),yG=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=SK),$e.init(e,t)}),xG=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=CK),$e.init(e,t)}),vG=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jK),$e.init(e,t)}),wG=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=EK),$e.init(e,t)}),bG=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=PK),$e.init(e,t)}),kG=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=WK(t)),$e.init(e,t)}),_G=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=VK),$e.init(e,t)}),SG=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=UK(t)),$e.init(e,t)}),CG=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=NK),$e.init(e,t)}),jG=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=MK),$e.init(e,t),e._zod.bag.format="ipv4"}),EG=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$K),$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})}}}),PG=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=DK),$e.init(e,t)}),TG=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=OK),$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 tN(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const NG=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=zK),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tN(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function IG(e){if(!qT.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return tN(n)}const AG=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=qT),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{IG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),RG=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=BK),$e.init(e,t)});function LG(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 MG=B("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=n=>{LG(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),nN=B("$ZodNumber",(e,t)=>{Ye.init(e,t),e._zod.pattern=e._zod.bag.pattern??GK,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}}),$G=B("$ZodNumberFormat",(e,t)=>{QK.init(e,t),nN.init(e,t)}),DG=B("$ZodBoolean",(e,t)=>{Ye.init(e,t),e._zod.pattern=ZK,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}}),OG=B("$ZodUnknown",(e,t)=>{Ye.init(e,t),e._zod.parse=n=>n}),zG=B("$ZodNever",(e,t)=>{Ye.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function $k(e,t,n){e.issues.length&&t.issues.push(...HT(n,e.issues)),t.value[n]=e.value}const FG=B("$ZodArray",(e,t)=>{Ye.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=>$k(c,n,o))):$k(l,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Qd(e,t,n,r,s,i){const o=n in r;if(e.issues.length){if(s&&i&&!o)return;t.issues.push(...HT(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 rN(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=nK(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sN(e,t,n,r,s,i){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,u=l.optin==="optional",d=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=>Qd(m,n,h,t,u,d))):Qd(p,n,h,t,u,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const BG=B("$ZodObject",(e,t)=>{Ye.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=mv(()=>rN(t));be(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 d of u.values)l[c].add(d)}}return l});const s=Jd,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=[],d=o.shape;for(const h of o.keys){const p=d[h],m=p._zod.optin==="optional",g=p._zod.optout==="optional",v=p._zod.run({value:c[h],issues:[]},l);v instanceof Promise?u.push(v.then(y=>Qd(y,a,h,c,m,g))):Qd(v,a,h,c,m,g)}return i?sN(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),VG=B("$ZodObjectJIT",(e,t)=>{BG.init(e,t);const n=e._zod.parse,r=mv(()=>rN(t)),s=h=>{var w,b;const p=new cG(["shape","payload","ctx"]),m=r.value,g=_=>{const S=Lk(_);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const _ of m.keys)v[_]=`key_${y++}`;p.write("const newResult = {};");for(const _ of m.keys){const S=v[_],j=Lk(_),E=h[_],T=((w=E==null?void 0:E._zod)==null?void 0:w.optin)==="optional",P=((b=E==null?void 0:E._zod)==null?void 0:b.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 x=p.compile();return(_,S)=>x(h,_,S)};let i;const o=Jd,a=!pv.jitless,c=a&&eK.value,u=t.catchall;let d;e._zod.parse=(h,p)=>{d??(d=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?sN([],m,h,p,d,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function Dk(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=>!go(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=>Si(o,r,_i())))}),t)}const UG=B("$ZodUnion",(e,t)=>{Ye.init(e,t),be(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),be(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),be(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),be(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=>yv(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=>Dk(a,r,e,s)):Dk(o,r,e,s)}}),WG=B("$ZodIntersection",(e,t)=>{Ye.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])=>Ok(n,l,c)):Ok(n,i,o)}});function Dg(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(Vl(e)&&Vl(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=Dg(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=Dg(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 Ok(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}),go(e))return e;const o=Dg(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 HG=B("$ZodEnum",(e,t)=>{Ye.init(e,t);const n=VT(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>tK.has(typeof s)).map(s=>typeof s=="string"?Zf(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}}),KG=B("$ZodTransform",(e,t)=>{Ye.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new BT(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 Po;return n.value=s,n.fallback=!0,n}});function zk(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const iN=B("$ZodOptional",(e,t)=>{Ye.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${yv(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=>zk(o,s)):zk(i,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),GG=B("$ZodExactOptional",(e,t)=>{iN.init(e,t),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),ZG=B("$ZodNullable",(e,t)=>{Ye.init(e,t),be(e._zod,"optin",()=>t.innerType._zod.optin),be(e._zod,"optout",()=>t.innerType._zod.optout),be(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${yv(n.source)}|null)$`):void 0}),be(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)}),qG=B("$ZodDefault",(e,t)=>{Ye.init(e,t),e._zod.optin="optional",be(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=>Fk(i,t)):Fk(s,t)}});function Fk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const YG=B("$ZodPrefault",(e,t)=>{Ye.init(e,t),e._zod.optin="optional",be(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))}),JG=B("$ZodNonOptional",(e,t)=>{Ye.init(e,t),be(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=>Bk(i,e)):Bk(s,e)}});function Bk(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 QG=B("$ZodCatch",(e,t)=>{Ye.init(e,t),e._zod.optin="optional",be(e._zod,"optout",()=>t.innerType._zod.optout),be(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=>Si(o,r,_i()))},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=>Si(i,r,_i()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),oN=B("$ZodPipe",(e,t)=>{Ye.init(e,t),be(e._zod,"values",()=>t.in._zod.values),be(e._zod,"optin",()=>t.in._zod.optin),be(e._zod,"optout",()=>t.out._zod.optout),be(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=>pu(o,t.in,r)):pu(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>pu(i,t.out,r)):pu(s,t.out,r)}});function pu(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 XG=B("$ZodPreprocess",(e,t)=>{oN.init(e,t)}),e7=B("$ZodReadonly",(e,t)=>{Ye.init(e,t),be(e._zod,"propValues",()=>t.innerType._zod.propValues),be(e._zod,"values",()=>t.innerType._zod.values),be(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),be(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(Vk):Vk(s)}});function Vk(e){return e.value=Object.freeze(e.value),e}const t7=B("$ZodCustom",(e,t)=>{Yt.init(e,t),Ye.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=>Uk(i,n,r,e));Uk(s,n,r,e)}});function Uk(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(Ul(s))}}var Wk;class n7{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 r7(){return new n7}(Wk=globalThis).__zod_globalRegistry??(Wk.__zod_globalRegistry=r7());const Ga=globalThis.__zod_globalRegistry;function s7(e,t){return new e({type:"string",...Y(t)})}function i7(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Y(t)})}function Hk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Y(t)})}function o7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(t)})}function a7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(t)})}function l7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(t)})}function c7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(t)})}function u7(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Y(t)})}function d7(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(t)})}function f7(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(t)})}function h7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(t)})}function p7(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(t)})}function m7(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(t)})}function g7(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Y(t)})}function y7(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(t)})}function x7(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(t)})}function v7(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(t)})}function w7(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(t)})}function b7(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(t)})}function k7(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Y(t)})}function _7(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(t)})}function S7(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Y(t)})}function C7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(t)})}function j7(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(t)})}function E7(e,t){return new e({type:"string",format:"date",check:"string_format",...Y(t)})}function P7(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Y(t)})}function T7(e,t){return new e({type:"string",format:"duration",check:"string_format",...Y(t)})}function N7(e,t){return new e({type:"number",checks:[],...Y(t)})}function I7(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Y(t)})}function A7(e,t){return new e({type:"boolean",...Y(t)})}function R7(e){return new e({type:"unknown"})}function L7(e,t){return new e({type:"never",...Y(t)})}function Kk(e,t){return new XT({check:"less_than",...Y(t),value:e,inclusive:!1})}function Pp(e,t){return new XT({check:"less_than",...Y(t),value:e,inclusive:!0})}function Gk(e,t){return new eN({check:"greater_than",...Y(t),value:e,inclusive:!1})}function Tp(e,t){return new eN({check:"greater_than",...Y(t),value:e,inclusive:!0})}function Zk(e,t){return new JK({check:"multiple_of",...Y(t),value:e})}function aN(e,t){return new XK({check:"max_length",...Y(t),maximum:e})}function Xd(e,t){return new eG({check:"min_length",...Y(t),minimum:e})}function lN(e,t){return new tG({check:"length_equals",...Y(t),length:e})}function M7(e,t){return new nG({check:"string_format",format:"regex",...Y(t),pattern:e})}function $7(e){return new rG({check:"string_format",format:"lowercase",...Y(e)})}function D7(e){return new sG({check:"string_format",format:"uppercase",...Y(e)})}function O7(e,t){return new iG({check:"string_format",format:"includes",...Y(t),includes:e})}function z7(e,t){return new oG({check:"string_format",format:"starts_with",...Y(t),prefix:e})}function F7(e,t){return new aG({check:"string_format",format:"ends_with",...Y(t),suffix:e})}function ca(e){return new lG({check:"overwrite",tx:e})}function B7(e){return ca(t=>t.normalize(e))}function V7(){return ca(e=>e.trim())}function U7(){return ca(e=>e.toLowerCase())}function W7(){return ca(e=>e.toUpperCase())}function H7(){return ca(e=>XH(e))}function K7(e,t,n){return new e({type:"array",element:t,...Y(n)})}function G7(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Y(n)})}function Z7(e,t){const n=q7(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ul(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(Ul(i))}},e(r.value,r)),t);return n}function q7(e,t){const n=new Yt({check:"custom",...Y(t)});return n._zod.check=e,n}function cN(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)??Ga,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 wt(e,t,n={path:[],schemaPath:[]}){var u,d;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=(d=(u=e._zod).toJSONSchema)==null?void 0:d.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),wt(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"&&Tt(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 uN(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 d=(o=e.metadataRegistry.get(u[0]))==null?void 0:o.id;if(d){const h=r.get(d);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,u[0])}}const s=u=>{var g;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(g=e.external.registry.get(u[0]))==null?void 0:g.id,y=e.external.uri??(w=>w);if(v)return{ref:y(v)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${y("__shared")}#/${d}/${x}`}}if(u[1]===n)return{ref:"#"};const p=`#/${d}/`,m=u[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:p+m}},i=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:h,defId:p}=s(u);d.def={...d.schema},p&&(d.defId=p);const m=d.schema;for(const g in m)delete m[g];m.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${(a=d.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 d=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(d.cycle){i(u);continue}if(d.count>1&&e.reused==="ref"){i(u);continue}}}function dN(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=d=>{const h=e.seen.get(d);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),x=y.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,m),d._zod.parent===g)for(const b in p)b==="$ref"||b==="allOf"||b in m||delete p[b];if(x.$ref&&y.def)for(const b in p)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(p[b])===JSON.stringify(y.def[b])&&delete p[b]}const v=d._zod.parent;if(v&&v!==g){r(v);const y=e.seen.get(v);if(y!=null&&y.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const x in p)x==="$ref"||x==="allOf"||x in y.def&&JSON.stringify(p[x])===JSON.stringify(y.def[x])&&delete p[x]}e.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[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 d=(l=e.external.registry.get(t))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}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 d of e.seen.entries()){const h=d[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 d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ef(t,"input",e.processors),output:ef(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Tt(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 Tt(r.element,n);if(r.type==="set")return Tt(r.valueType,n);if(r.type==="lazy")return Tt(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 Tt(r.innerType,n);if(r.type==="intersection")return Tt(r.left,n)||Tt(r.right,n);if(r.type==="record"||r.type==="map")return Tt(r.keyType,n)||Tt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Tt(r.in,n)||Tt(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Tt(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Tt(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Tt(s,n))return!0;return!!(r.rest&&Tt(r.rest,n))}return!1}const Y7=(e,t={})=>n=>{const r=cN({...n,processors:t});return wt(e,r),uN(r,e),dN(r,e)},ef=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=cN({...s??{},target:i,io:t,processors:n});return wt(e,o),uN(o,e),dN(o,e)},J7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Q7=(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=J7[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(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},X7=(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 d=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";d?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)},eZ=(e,t,n,r)=>{n.type="boolean"},tZ=(e,t,n,r)=>{n.not={}},nZ=(e,t,n,r)=>{},rZ=(e,t,n,r)=>{const s=e._zod.def,i=VT(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},sZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},iZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oZ=(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=wt(i.element,t,{...r,path:[...r.path,"items"]})},aZ=(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]=wt(o[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.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=wt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},lZ=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,l)=>wt(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=o:n.anyOf=o},cZ=(e,t,n,r)=>{const s=e._zod.def,i=wt(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=wt(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},uZ=(e,t,n,r)=>{const s=e._zod.def,i=wt(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"}]},dZ=(e,t,n,r)=>{const s=e._zod.def;wt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},fZ=(e,t,n,r)=>{const s=e._zod.def;wt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},hZ=(e,t,n,r)=>{const s=e._zod.def;wt(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)))},pZ=(e,t,n,r)=>{const s=e._zod.def;wt(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},mZ=(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;wt(o,t,r);const a=t.seen.get(e);a.ref=o},gZ=(e,t,n,r)=>{const s=e._zod.def;wt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},fN=(e,t,n,r)=>{const s=e._zod.def;wt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},yZ=B("ZodISODateTime",(e,t)=>{kG.init(e,t),Fe.init(e,t)});function xZ(e){return j7(yZ,e)}const vZ=B("ZodISODate",(e,t)=>{_G.init(e,t),Fe.init(e,t)});function wZ(e){return E7(vZ,e)}const bZ=B("ZodISOTime",(e,t)=>{SG.init(e,t),Fe.init(e,t)});function kZ(e){return P7(bZ,e)}const _Z=B("ZodISODuration",(e,t)=>{CG.init(e,t),Fe.init(e,t)});function SZ(e){return T7(_Z,e)}const CZ=(e,t)=>{GT.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>hK(e,n)},flatten:{value:n=>fK(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,$g,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,$g,2)}},isEmpty:{get(){return e.issues.length===0}}})},Dn=B("ZodError",CZ,{Parent:Error}),jZ=vv(Dn),EZ=wv(Dn),PZ=qf(Dn),TZ=Yf(Dn),NZ=gK(Dn),IZ=yK(Dn),AZ=xK(Dn),RZ=vK(Dn),LZ=wK(Dn),MZ=bK(Dn),$Z=kK(Dn),DZ=_K(Dn),qk=new WeakMap;function fc(e,t,n){const r=Object.getPrototypeOf(e);let s=qk.get(r);if(s||(s=new Set,qk.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 Je=B("ZodType",(e,t)=>(Ye.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ef(e,"input"),output:ef(e,"output")}}),e.toJSONSchema=Y7(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>jZ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>PZ(e,n,r),e.parseAsync=async(n,r)=>EZ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>TZ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>NZ(e,n,r),e.decode=(n,r)=>IZ(e,n,r),e.encodeAsync=async(n,r)=>AZ(e,n,r),e.decodeAsync=async(n,r)=>RZ(e,n,r),e.safeEncode=(n,r)=>LZ(e,n,r),e.safeDecode=(n,r)=>MZ(e,n,r),e.safeEncodeAsync=async(n,r)=>$Z(e,n,r),e.safeDecodeAsync=async(n,r)=>DZ(e,n,r),fc(e,"ZodType",{check(...n){const r=this.def;return this.clone(zs(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 Fs(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(Pq(n,r))},superRefine(n,r){return this.check(Tq(n,r))},overwrite(n){return this.check(ca(n))},optional(){return Xk(this)},exactOptional(){return mq(this)},nullable(){return e_(this)},nullish(){return Xk(e_(this))},nonoptional(n){return bq(this,n)},array(){return Wl(this)},or(n){return uq([this,n])},and(n){return fq(this,n)},transform(n){return t_(this,gN(n))},default(n){return xq(this,n)},prefault(n){return wq(this,n)},catch(n){return _q(this,n)},pipe(n){return t_(this,n)},readonly(){return jq(this)},describe(n){const r=this.clone();return Ga.add(r,{description:n}),r},meta(...n){if(n.length===0)return Ga.get(this);const r=this.clone();return Ga.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=Ga.get(e))==null?void 0:n.description},configurable:!0}),e)),hN=B("_ZodString",(e,t)=>{bv.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Q7(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fc(e,"_ZodString",{regex(...r){return this.check(M7(...r))},includes(...r){return this.check(O7(...r))},startsWith(...r){return this.check(z7(...r))},endsWith(...r){return this.check(F7(...r))},min(...r){return this.check(Xd(...r))},max(...r){return this.check(aN(...r))},length(...r){return this.check(lN(...r))},nonempty(...r){return this.check(Xd(1,...r))},lowercase(r){return this.check($7(r))},uppercase(r){return this.check(D7(r))},trim(){return this.check(V7())},normalize(...r){return this.check(B7(...r))},toLowerCase(){return this.check(U7())},toUpperCase(){return this.check(W7())},slugify(){return this.check(H7())}})}),OZ=B("ZodString",(e,t)=>{bv.init(e,t),hN.init(e,t),e.email=n=>e.check(i7(zZ,n)),e.url=n=>e.check(u7(FZ,n)),e.jwt=n=>e.check(C7(tq,n)),e.emoji=n=>e.check(d7(BZ,n)),e.guid=n=>e.check(Hk(Yk,n)),e.uuid=n=>e.check(o7(mu,n)),e.uuidv4=n=>e.check(a7(mu,n)),e.uuidv6=n=>e.check(l7(mu,n)),e.uuidv7=n=>e.check(c7(mu,n)),e.nanoid=n=>e.check(f7(VZ,n)),e.guid=n=>e.check(Hk(Yk,n)),e.cuid=n=>e.check(h7(UZ,n)),e.cuid2=n=>e.check(p7(WZ,n)),e.ulid=n=>e.check(m7(HZ,n)),e.base64=n=>e.check(k7(QZ,n)),e.base64url=n=>e.check(_7(XZ,n)),e.xid=n=>e.check(g7(KZ,n)),e.ksuid=n=>e.check(y7(GZ,n)),e.ipv4=n=>e.check(x7(ZZ,n)),e.ipv6=n=>e.check(v7(qZ,n)),e.cidrv4=n=>e.check(w7(YZ,n)),e.cidrv6=n=>e.check(b7(JZ,n)),e.e164=n=>e.check(S7(eq,n)),e.datetime=n=>e.check(xZ(n)),e.date=n=>e.check(wZ(n)),e.time=n=>e.check(kZ(n)),e.duration=n=>e.check(SZ(n))});function fe(e){return s7(OZ,e)}const Fe=B("ZodStringFormat",(e,t)=>{$e.init(e,t),hN.init(e,t)}),zZ=B("ZodEmail",(e,t)=>{hG.init(e,t),Fe.init(e,t)}),Yk=B("ZodGUID",(e,t)=>{dG.init(e,t),Fe.init(e,t)}),mu=B("ZodUUID",(e,t)=>{fG.init(e,t),Fe.init(e,t)}),FZ=B("ZodURL",(e,t)=>{pG.init(e,t),Fe.init(e,t)}),BZ=B("ZodEmoji",(e,t)=>{mG.init(e,t),Fe.init(e,t)}),VZ=B("ZodNanoID",(e,t)=>{gG.init(e,t),Fe.init(e,t)}),UZ=B("ZodCUID",(e,t)=>{yG.init(e,t),Fe.init(e,t)}),WZ=B("ZodCUID2",(e,t)=>{xG.init(e,t),Fe.init(e,t)}),HZ=B("ZodULID",(e,t)=>{vG.init(e,t),Fe.init(e,t)}),KZ=B("ZodXID",(e,t)=>{wG.init(e,t),Fe.init(e,t)}),GZ=B("ZodKSUID",(e,t)=>{bG.init(e,t),Fe.init(e,t)}),ZZ=B("ZodIPv4",(e,t)=>{jG.init(e,t),Fe.init(e,t)}),qZ=B("ZodIPv6",(e,t)=>{EG.init(e,t),Fe.init(e,t)}),YZ=B("ZodCIDRv4",(e,t)=>{PG.init(e,t),Fe.init(e,t)}),JZ=B("ZodCIDRv6",(e,t)=>{TG.init(e,t),Fe.init(e,t)}),QZ=B("ZodBase64",(e,t)=>{NG.init(e,t),Fe.init(e,t)}),XZ=B("ZodBase64URL",(e,t)=>{AG.init(e,t),Fe.init(e,t)}),eq=B("ZodE164",(e,t)=>{RG.init(e,t),Fe.init(e,t)}),tq=B("ZodJWT",(e,t)=>{MG.init(e,t),Fe.init(e,t)}),pN=B("ZodNumber",(e,t)=>{nN.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(r,s,i)=>X7(e,r,s),fc(e,"ZodNumber",{gt(r,s){return this.check(Gk(r,s))},gte(r,s){return this.check(Tp(r,s))},min(r,s){return this.check(Tp(r,s))},lt(r,s){return this.check(Kk(r,s))},lte(r,s){return this.check(Pp(r,s))},max(r,s){return this.check(Pp(r,s))},int(r){return this.check(Jk(r))},safe(r){return this.check(Jk(r))},positive(r){return this.check(Gk(0,r))},nonnegative(r){return this.check(Tp(0,r))},negative(r){return this.check(Kk(0,r))},nonpositive(r){return this.check(Pp(0,r))},multipleOf(r,s){return this.check(Zk(r,s))},step(r,s){return this.check(Zk(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 N7(pN,e)}const nq=B("ZodNumberFormat",(e,t)=>{$G.init(e,t),pN.init(e,t)});function Jk(e){return I7(nq,e)}const rq=B("ZodBoolean",(e,t)=>{DG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eZ(e,n,r)});function mN(e){return A7(rq,e)}const sq=B("ZodUnknown",(e,t)=>{OG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nZ()});function Qk(){return R7(sq)}const iq=B("ZodNever",(e,t)=>{zG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tZ(e,n,r)});function oq(e){return L7(iq,e)}const aq=B("ZodArray",(e,t)=>{FG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>oZ(e,n,r,s),e.element=t.element,fc(e,"ZodArray",{min(n,r){return this.check(Xd(n,r))},nonempty(n){return this.check(Xd(1,n))},max(n,r){return this.check(aN(n,r))},length(n,r){return this.check(lN(n,r))},unwrap(){return this.element}})});function Wl(e,t){return K7(aq,e,t)}const lq=B("ZodObject",(e,t)=>{VG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>aZ(e,n,r,s),be(e,"shape",()=>t.shape),fc(e,"ZodObject",{keyof(){return yt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Qk()})},loose(){return this.clone({...this._zod.def,catchall:Qk()})},strict(){return this.clone({...this._zod.def,catchall:oq()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return oK(this,n)},safeExtend(n){return aK(this,n)},merge(n){return lK(this,n)},pick(n){return sK(this,n)},omit(n){return iK(this,n)},partial(...n){return cK(yN,this,n[0])},required(...n){return uK(xN,this,n[0])}})});function dn(e,t){const n={type:"object",shape:e??{},...Y(t)};return new lq(n)}const cq=B("ZodUnion",(e,t)=>{UG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lZ(e,n,r,s),e.options=t.options});function uq(e,t){return new cq({type:"union",options:e,...Y(t)})}const dq=B("ZodIntersection",(e,t)=>{WG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cZ(e,n,r,s)});function fq(e,t){return new dq({type:"intersection",left:e,right:t})}const Og=B("ZodEnum",(e,t)=>{HG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(r,s,i)=>rZ(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 Og({...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 Og({...t,checks:[],...Y(s),entries:i})}});function yt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Og({type:"enum",entries:n,...Y(t)})}const hq=B("ZodTransform",(e,t)=>{KG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>iZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new BT(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ul(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(Ul(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 gN(e){return new hq({type:"transform",transform:e})}const yN=B("ZodOptional",(e,t)=>{iN.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Xk(e){return new yN({type:"optional",innerType:e})}const pq=B("ZodExactOptional",(e,t)=>{GG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fN(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function mq(e){return new pq({type:"optional",innerType:e})}const gq=B("ZodNullable",(e,t)=>{ZG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>uZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function e_(e){return new gq({type:"nullable",innerType:e})}const yq=B("ZodDefault",(e,t)=>{qG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>fZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xq(e,t){return new yq({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():WT(t)}})}const vq=B("ZodPrefault",(e,t)=>{YG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>hZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function wq(e,t){return new vq({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():WT(t)}})}const xN=B("ZodNonOptional",(e,t)=>{JG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>dZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function bq(e,t){return new xN({type:"nonoptional",innerType:e,...Y(t)})}const kq=B("ZodCatch",(e,t)=>{QG.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>pZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _q(e,t){return new kq({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vN=B("ZodPipe",(e,t)=>{oN.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>mZ(e,n,r,s),e.in=t.in,e.out=t.out});function t_(e,t){return new vN({type:"pipe",in:e,out:t})}const Sq=B("ZodPreprocess",(e,t)=>{vN.init(e,t),XG.init(e,t)}),Cq=B("ZodReadonly",(e,t)=>{e7.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function jq(e){return new Cq({type:"readonly",innerType:e})}const Eq=B("ZodCustom",(e,t)=>{t7.init(e,t),Je.init(e,t),e._zod.processJSONSchema=(n,r,s)=>sZ(e,n)});function Pq(e,t={}){return G7(Eq,e,t)}function Tq(e,t){return Z7(e,t)}function Nq(e,t){return new Sq({type:"pipe",in:gN(e),out:t})}const Hi=Nq(e=>typeof e=="string"?{agent:e}:e,dn({agent:yt(ic),model:fe().optional(),effort:fe().optional()})),Ts=fe().regex(/^\d{4}-\d{2}-\d{2}$/,"expected YYYY-MM-DD");dn({status:yt(["idea","planned","in-progress","review","done","dropped"]),kind:yt(["feat","fix","chore","docs","refactor"]).optional(),id:fe().optional(),idea:fe().optional(),agent:yt(ic).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:yt(["feat","fix","chore","docs","refactor"]).describe("Plan kind matching Conventional Commits types"),status:yt(["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:yt(ic).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:Wl(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:yt(["idea","note"]).optional().describe('"note" for ideas that never need a plan; omitted means a plan-bearing idea'),status:yt(["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 wN=dn({id:fe().describe("Permanent lifetime entity ID, e.g. IDEA-45 — never changes"),title:fe().describe("Human-readable entity name"),type:yt(["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:yt(["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:yt(["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:yt(ic).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:Wl(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(),Iq=new Set(Object.keys(wN.shape)),Aq=wN.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"]}),Rq=dn({name:fe(),cmd:fe(),port:cr().int().positive().optional(),healthcheck:fe().optional()}),Lq=dn({name:fe(),cmd:fe()}),Mq=dn({repo:fe(),branch:fe().optional(),releasePlease:mN().optional()}),$q=dn({services:Wl(Rq).optional(),checks:Wl(Lq).optional(),ci:Mq.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:yt(ic).optional(),defaultAgents:dn({phase:Hi,planDraft:Hi,ideaExtend:Hi,commitSuggest:Hi,feedback:Hi,codeReview:Hi}).optional(),desk:$q.optional()});dn({id:fe(),kind:yt(["completed","reply"]),entityId:fe(),entityTitle:fe(),text:fe(),date:fe(),read:mN(),outcome:yt(["done","error"]).optional()});const Dq=/^#{2,3}\s+/;function zg(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(Dq.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 n_={phases:OT,log:KH,clarifications:GH,notes:ZH,review:qH};function Oq(e){const t={phases:[],log:[],clarifications:[],notes:[],review:[]};let n=e;for(const r of Object.keys(n_)){const s=zg(n,n_[r]);n=s.body,t[r]=s.entries}return{body:n,...t}}const zq=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n)?/;function Fq(e,t){const n=[],r=e.match(zq);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=AH(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 Bq(e,t){const n=Object.fromEntries(Object.entries(e).filter(([r])=>!t.has(r)));return Object.keys(n).length>0?n:void 0}function Vq(e){const t=[],{data:n,body:r,warnings:s}=Fq(e,Aq);if(t.push(...s),!n)return{entries:[],warnings:t};const{body:i,phases:o,log:a,clarifications:l,notes:c,review:u}=Oq(r),{body:d,entries:h}=zg(i,zT),{body:p,entries:m}=zg(d,FT),g=[...m,...gW(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 v=Bq(n,Iq);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},...v&&{unknownFrontmatter:v}}],warnings:t}}const Uq=new Set(["planned","in-progress","review"]);function r_(e){return Uq.has(e.status??"")}function Wq(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 Hq(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||!r_(c)||(s.add(c.id),i.push(c))}const o=t.filter(l=>r_(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 Fg=" — ";function bN(e){return e.split(`
263
- `).map(t=>t.trim()).filter(t=>t.length>0).map(t=>{const n=t.indexOf(Fg);return n===-1?{id:t,title:""}:{id:t.slice(0,n).trim(),title:t.slice(n+Fg.length).trim()}})}function Kq(e){return e.length===0?"":`${e.map(t=>`${t.id}${Fg}${t.title}`).join(`
264
- `)}
265
- `}function Gq(e,t){for(const{entries:n,section:r}of t)n&&n.length>0&&e.push(r.formatLines(n).join(`
266
- `))}function Bg(){return new Date().toISOString().slice(0,10)}function Zq(e){return`---
267
- ${RH(e).trimEnd()}
268
- ---`}function kN(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=[Zq(t)];return e.body&&n.push(e.body),Gq(n,[{entries:e.phases,section:OT},{entries:e.fixes,section:zT},{entries:e.thread,section:FT}]),n.join(`
269
-
270
- `).trimEnd()}const qq="https://api.github.com";class kv extends Error{constructor(t,n){super(t),this.status=n,this.name="GithubApiError"}}function Yq(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n)}function Jq(e){const t=atob(e.replace(/\s/g,"")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}async function Qf(e,t,n){const r=await fetch(`${qq}/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 kv((s==null?void 0:s.message)??`GitHub API error (${r.status})`,r.status)}return r.json()}const Xf=e=>`/contents/${e.split("/").map(encodeURIComponent).join("/")}`;async function hc(e,t){const n=await Qf(e,Xf(t));return!n||Array.isArray(n)?null:{content:Jq(n.content),sha:n.sha}}async function Qq(e,t){const n=await Qf(e,Xf(t));return Array.isArray(n)?n.map(r=>({name:r.name,type:r.type})):[]}async function Hl(e,t,n,r,s){return{sha:(await Qf(e,Xf(t),{method:"PUT",body:JSON.stringify({message:r,content:Yq(n),...s&&{sha:s}})})).content.sha}}async function Xq(e,t,n,r){await Qf(e,Xf(t),{method:"DELETE",body:JSON.stringify({message:r,sha:n})})}const tf="papercamp/ideas",_N="papercamp/config.json",Vg="papercamp/run-order.md";async function s_(e,t,n){const r=(await Qq(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 hc(e,o);if(!a)return null;const l=Vq(a.content).entries[0];return l?{entry:{...l,archived:n},path:o,sha:a.sha}:null}))).filter(i=>i!==null)}async function eY(e){const t=await hc(e,Vg);return new Map(bN((t==null?void 0:t.content)??"").map((n,r)=>[n.id,r+1]))}async function _v(e){const[t,n,r]=await Promise.all([s_(e,tf,!1),s_(e,`${tf}/archive`,!0),eY(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 tY(e){return{entries:(await _v(e)).filter(n=>n.entry.kind==="note").map(n=>bW(n.entry)),warnings:[]}}async function nY(e){return{entries:(await _v(e)).filter(n=>n.entry.kind!=="note").map(n=>qP(n.entry,void 0,!1,!1)),warnings:[],resolved:!1}}async function rY(e){const t=await hc(e,_N);if(!t)throw new Error("papercamp/config.json not found in this repo");return{file:JSON.parse(t.content),sha:t.sha}}let i_=Promise.resolve();async function sY(e,t){const n=i_.then(async()=>{var u;const{file:r,sha:s}=await rY(e),i=r.nextId??{},o=i.idea??1,a=`IDEA-${o}`;await Hl(e,_N,JSON.stringify({...r,nextId:{...i,idea:o+1}},null,2),`chore(papercamp): mint ${a}`,s);const l=t.kind==="note",c=kN({id:a,title:t.title.trim(),kind:l?"note":t.kind==="board"?"board":void 0,status:l?"open":"idea",created:Bg(),body:(u=t.content)==null?void 0:u.trim()});return await Hl(e,`${tf}/${a}.md`,`${c}
271
- `,`feat(papercamp): draft ${a}`),a});return i_=n.catch(()=>{}),n}function iY(e,t,n){return e.find(r=>r.entry.title===t||r.entry.id===t)}async function o_(e,t,n,r){const s=kN({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 Hl(e,t.path,`${s}
272
- `,r,t.sha)}async function oY(e,t,n,r){const s=Wq(t.map(l=>l.entry),t.filter(l=>l.entry.kind!=="note").map(l=>qP(l.entry,void 0,!1,!1))),i=await hc(e,Vg),o=bN((i==null?void 0:i.content)??""),a=Kq(Hq(o,s,r));await Hl(e,Vg,a,`chore(papercamp): reorder queue after ${n}`,i==null?void 0:i.sha)}async function aY(e,t,n){var a,l,c;const r=await _v(e),s=iY(r,t);if(!s)throw new Error("entity not found");if(fW(s.entry)){const u=(((a=n.phases)==null?void 0:a.length)??0)>s.entry.phases.length,d=(((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||d||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=wW(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:Bg()};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 o_(e,u,{...u.entry,status:"planned",updated:Bg()},`chore(papercamp): demote ${u.entry.id}`);if(await o_(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,d=r.map(h=>h.entry.id===s.entry.id?{...h,entry:o}:h);await oY(e,d,s.entry.id,u)}if(n.status==="dropped"){const u=await hc(e,s.path);u&&(await Hl(e,`${tf}/archive/${s.entry.id}.md`,u.content,`chore(papercamp): archive ${s.entry.id}`),await Xq(e,s.path,u.sha,`chore(papercamp): archive ${s.entry.id}`))}}function lY(e,t){return{ideaEntries:[],loadIdeas:Ct(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?tY(r):WP()},n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:Ct(e,Y9,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await J9(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function cY(e,t){return{notifications:null,notificationsLoading:!1,notificationsError:null,loadNotifications:Ct(e,tW,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 nW(n)}catch(s){e({notifications:r,notificationsError:String(s)})}}}}}function uY(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:Ct(e,rW,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const eh=(e,t)=>e.kind==="phase"&&!e.item.done&&(t==null?void 0:t.index)===e.index,Ug=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`},SN=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}`},CN=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)}},jN=e=>CN(e.phases),a_=e=>{var t;return((t=jN(e))==null?void 0:t.pct)??null},dY=e=>CN([...e.phases,...e.fixes??[]]),fY=(e,t)=>{const n=dY(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}},th=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,hY=(e,t)=>e?t.find(n=>n.planId===e&&n.taskKind==="pr-review"&&n.status!=="done"&&n.status!=="error"):void 0,pY=e=>{var t;return(t=[...e??[]].reverse().find(n=>n.kind==="review"))==null?void 0:t.text},nh=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:th(e.id,t)?"in-progress":e.status,mY=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),gY=e=>e.phases.some(t=>t.done),yY=(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 Np(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 d=i-1;d>=0;d--)o[u][d]=n[u]===r[d]?o[u+1][d+1]+1:Math.max(o[u+1][d],o[u][d+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 xY(a)}function xY(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 vY=["in-progress","review","planned","idea"],wY=["open"],Sv={statuses:vY,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:wY,subject:null,groupBySubject:!0},l_={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},gu=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},c_=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},u_=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Ip=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},d_=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Qu=(e,t)=>t===null||e===t,f_=e=>e.status==="in-progress"||e.status==="review"?0:1,EN=(e,t,n,r="asc")=>{const s=f_(e)-f_(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:c_(e)-c_(t);const i=(()=>{switch(n){case"status":{const o=l_[e.status]-l_[t.status];return o!==0?o:gu(t)-gu(e)}case"updated":return gu(t)-gu(e);case"title":return e.title.localeCompare(t.title);case"id":return u_(e)-u_(t);case"progress":return(a_(t)??-1)-(a_(e)??-1);default:return 0}})();return r==="desc"?-i:i},Wg=(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},cl=(e,t=Sv)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=Wg(e.filter(a=>d_(a,n)&&Ip(a,t.search)&&Qu(a.subject,t.subject)),a=>[a.status]);for(const a of z8)s[a]??(s[a]=0);const i=Wg(e.filter(a=>r.has(a.status)&&Ip(a,t.search)&&Qu(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&d_(a,n)&&Ip(a,t.search)&&Qu(a.subject,t.subject)).sort((a,l)=>EN(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},bY=["open","done","dropped"],kY={open:"idea",done:"done",dropped:"dropped"},h_=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},_Y=e=>e.type==="plan"?e.plan.subject:e.type==="fix"?e.fix.subject:e.idea.subject,SY=e=>e.type==="plan"?e.plan.order:e.type==="fix"?e.fix.order:e.idea.order,CY=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},p_=(e,t)=>e.reduce((n,r)=>{const s=SY(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),m_=e=>e.reduce((t,n)=>Math.max(t,CY(n)),0),jY=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=_Y(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=p_(l.rows,t),d=p_(c.rows,t);return u!==void 0&&d!==void 0?i*(u-d):u!==void 0?-1:d!==void 0?1:m_(c.rows)-m_(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},g_=e=>e.type==="plan"?e.plan:e.type==="fix"?e.fix:{title:e.idea.title,id:e.idea.id??void 0,status:kY[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order},EY=(e,t,n=Sv)=>{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}=cl(i,n),u=t.filter(m=>m.kind==="note"),d=new Set(n.noteStatuses),h=Wg(u.filter(m=>h_(m,n.search)),m=>[m.status??"open"]);for(const m of bY)h[m]??(h[m]=0);const p=cl(a,n).rows.map(m=>({type:"plan",plan:m}));p.push(...cl(o,n).rows.map(m=>({type:"fix",fix:m})));for(const m of u)d.has(m.status??"open")&&h_(m,n.search)&&Qu(m.subject,n.subject)&&p.push({type:"note",idea:m});return p.sort((m,g)=>EN(g_(m),g_(g),n.sortKey,n.sortDirection)),{rows:p,statusCounts:l,tagCounts:c,noteStatusCounts:h}},PY=.2,TY=5,PN=3,TN=2,NN=1,NY=PN+TN+NN,IY=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"]),yu=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!IY.has(n));return new Set(t)},Ap=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function AY(e,t,n={}){const{threshold:r=PY,limit:s=TY}=n,i=yu(e);if(i.size===0)return[];const o=[];for(const a of t){const l=yu(a.title),c=yu(a.body),u=yu((a.tags??[]).join(" ")),h=(Ap(i,l)*PN+Ap(i,u)*TN+Ap(i,c)*NN)/(i.size*NY);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const RY=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}`},LY=(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=[RY(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},MY=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)=>LY(r,s))},$Y=e=>`Fix the failing "${e}" check`,DY=({cmd:e,output:t})=>`The command was \`${e}\`.
273
-
274
- Output from the last run:
275
-
276
- ${t||"(no output captured)"}`,OY=(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]}]},zY=(e,t)=>OY(e,t).flatMap(({name:n,results:r})=>{const s=r.filter(o=>o.status==="fail");if(s.length===0)return[];const i=s.map(DY).join(`
277
-
278
- `);return[{done:!1,text:$Y(n),description:`Fix the failing "${n}" check in this repo.
279
-
280
- ${i}`}]}),FY=(e,t,n)=>{const r=new Map(zY(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()]},BY=/^[a-z]+\([a-z-]+\):\s+/,VY=e=>e.replace(BY,""),UY=(e,t)=>[...e,{done:!0,text:VY(t),source:"manual"}],IN="papercamp/",WY=e=>e.length>0&&e.every(t=>t.startsWith(IN)),HY=e=>`${IN}ideas/${e}.md`,KY=14*24*60*60*1e3;function pc(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.storedAt>KY?(localStorage.removeItem(e),null):n.value}catch{return null}}function mc(e,t){try{const n={value:t,storedAt:Date.now()};localStorage.setItem(e,JSON.stringify(n))}catch{}}function Cv(e){try{localStorage.removeItem(e)}catch{}}function GY(e){return`feedback-draft:${e.id??e.title}`}const AN="plan-filters",RN="detail-view";function ZY(){return pc(AN)??Sv}function qY(){return pc(RN)??"details"}function ts(e){return mc(AN,e),e}function YY(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:Ct(e,()=>{const{runtimeReachable:n,githubConfig:r}=t();return!n&&r?nY(r):GP()},n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:ZY(),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:qY(),setDetailView:n=>{mc(RN,n),e({detailView:n})}}}const JY={horizons:[],statuses:[]},QY=e=>[...new Set(e.links.map(t=>t.status))],LN=(e,t)=>t.length===0||e.links.some(n=>t.includes(n.status)),MN=(e,t)=>t.length===0||t.includes(e),xae=(e,t)=>e.horizons.filter(n=>MN(n.title,t.horizons)).map(n=>({...n,items:n.items.filter(r=>LN(r,t.statuses))})),vae=(e,t)=>Object.fromEntries(e.horizons.map(n=>[n.title,n.items.filter(r=>LN(r,t.statuses)).length])),wae=(e,t)=>{const n={};for(const r of e.horizons)if(MN(r.title,t.horizons))for(const s of r.items)for(const i of QY(s))n[i]=(n[i]??0)+1;return n};function XY(e,t){return{roadmap:null,roadmapLoading:!1,roadmapError:null,loadRoadmap:Ct(e,VP,n=>({roadmap:n,roadmapError:null}),n=>({roadmapError:String(n)}),"roadmapLoading"),roadmapFilters:JY,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 eJ="runtime",tJ="token",rh="paper-camp.runtimes",Kl="paper-camp.activeRuntimeUrl";function nJ(e){const t=new URLSearchParams((e==null?void 0:e.search)??"");return{runtimeUrl:t.get(eJ)??"",pairingToken:t.get(tJ)}}function ua(e){const t=e==null?void 0:e.getItem(rh);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n:[]}function rJ(e,t){var i;const n=ua(e),r=(i=n.find(o=>o.runtimeUrl===t.runtimeUrl))==null?void 0:i.label,s=n.filter(o=>o.runtimeUrl!==t.runtimeUrl);s.push(r?{...t,label:r}:t),e==null||e.setItem(rh,JSON.stringify(s)),e==null||e.setItem(Kl,t.runtimeUrl)}function Gl(e){return ua(e)}function sJ(e,t,n){const r=ua(n),s=r.findIndex(a=>a.runtimeUrl===e);if(s===-1)return null;const i=t.trim(),o={...r[s],label:i===""?void 0:i};return r[s]=o,n==null||n.setItem(rh,JSON.stringify(r)),o}function iJ(e,t){const n=ua(t).filter(r=>r.runtimeUrl!==e);t==null||t.setItem(rh,JSON.stringify(n)),(t==null?void 0:t.getItem(Kl))===e&&t.removeItem(Kl)}function $N(e,t){const n=ua(t).find(r=>r.runtimeUrl===e);return n?(t==null||t.setItem(Kl,n.runtimeUrl),n):null}function oJ(e,t){const n=nJ(e);if(n.runtimeUrl)return rJ(t,n),n;const r=t==null?void 0:t.getItem(Kl);return(r?ua(t).find(i=>i.runtimeUrl===r):null)??{runtimeUrl:"",pairingToken:null}}const DN=oJ(typeof window>"u"?null:window.location,typeof window>"u"?null:window.localStorage),Rp=!!DN.runtimeUrl,aJ=15e3,y_=2,lJ=1500,cJ=e=>new Promise(t=>setTimeout(t,e));async function uJ(){for(let e=0;e<=y_;e++){try{if((await fetch(K("/api/package-name"),{signal:AbortSignal.timeout(aJ)})).ok)return!0}catch{}e<y_&&await cJ(lJ)}return!1}function dJ(e){return{runtimeReachable:!Rp,runtimeChecking:Rp,checkRuntimeReachable:Ct(e,async()=>Rp?uJ():!0,t=>({runtimeReachable:t}),()=>({runtimeReachable:!1}),"runtimeChecking")}}const fJ=async()=>(await J(K("/api/status"))).json(),hJ=async()=>{await J(K("/api/status/check?name=consistency"),{method:"POST"})},pJ=async()=>{const e=await J(K("/api/refresh"),{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function mJ(e,t){return{status:null,refreshing:!1,loadStatus:Ct(e,fJ,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await pJ().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 hJ()}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 DP(i);return await Tg(i,o,a||void 0),await r()?{ok:!0,title:o}:{ok:!0,title:o,warning:"Committed, but the git status refresh failed — reload to confirm"}}catch(o){return{ok:!1,error:o.message}}finally{e({commitInFlight:!1})}},consistency:[],loadConsistency:Ct(e,G9,n=>({consistency:n})),doctor:{findings:[],errorCount:0,warningCount:0},loadDoctor:Ct(e,Z9,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 U8();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a,gitStashes:l}),!0}catch{return!1}},capabilities:[],loadCapabilities:Ct(e,zP,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function gJ(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:Ct(e,V9,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await U9(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await W9(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await K9(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await eW();return await t().refreshAll(),n}}}function yJ(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:Ct(e,F9,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const L=l9()((e,t)=>({...YY(e,t),...XY(e),...lY(e,t),...gJ(e,t),...yJ(e),...aW(e,t),...mJ(e,t),...O9(e,t),...z9(e,t),...uY(e),...cY(e,t),...dJ(e),...dW(e)})),sh=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Hr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),ON=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},xJ=e=>e.capabilities.filter(t=>t.status!=="ok").length,vJ=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1},wJ=e=>{var t;return((t=e.agentStatus.find(n=>n.rateLimit))==null?void 0:t.rateLimit)??null},bJ=({children:e,onClick:t})=>f.jsx("button",{type:"button",onClick:t,className:"bg-transparent border-none p-0 text-watercolor-amber-dark cursor-pointer underline [font:inherit]",children:e}),kJ=e=>e<=0?"today":e===1?"1 day ago":`${e} days ago`,_J="A sync pop failed and left work parked here. Recover with `git restore --source=origin/main --staged --worktree .` then `git merge --ff-only`.",SJ=({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 H8(e.index))}catch(u){o(u.message)}finally{s(!1)}}};return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs(bJ,{onClick:c,children:[e.branch,": ",e.message," · ",kJ(e.ageDays)]}),a&&f.jsx("pre",{className:"m-0 max-h-64 overflow-auto whitespace-pre-wrap font-mono text-2xs opacity-80",children:r?"Loading…":i??t})]})},CJ=()=>{const e=L(s=>s.gitStashes),[t,n]=k.useState(!1);if(e.length===0)return null;const r=e.some(s=>s.own);return f.jsxs("div",{children:[f.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:f.jsxs(ce,{size:"small",variant:r?"warning":"neutral",children:[e.length," stash",e.length===1?"":"es"]})}),t&&f.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r&&f.jsx("p",{className:"m-0 text-2xs opacity-80",children:_J}),e.map(s=>f.jsx(SJ,{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 xu(e,t){const{toast:n}=rt(),r=L(o=>o.activeGitAction),s=L(o=>o.setActiveGitAction),i=k.useCallback(async o=>{if(!L.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 jJ(){const e=L(_=>_.loadGitStatus),t=L(_=>_.loadPlans),n=L(_=>_.loadIdeas),r=L(_=>_.loadDiffFiles),s=L(_=>_.activeGitAction!==null),{toast:i,dismiss:o}=rt(),a=()=>Promise.all([e(),t(),n(),r()]),[l,c]=xu("push","Push failed"),[u,d]=xu("sync","Sync failed"),[h,p]=xu("pull","Pull failed"),[m,g]=xu("fix-divergence","Fix failed"),v=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:f.jsxs("div",{className:"flex flex-col items-start gap-2",children:[f.jsx("span",{children:Ge(E)}),f.jsx(re,{size:"small",onClick:async()=>{const P=await J8(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 G8(),await Promise.all([e(),r()])}),handleSync:()=>d(async()=>{const _=await Z8();if(!_.ok){if(v("Sync",_)){await e();return}throw new Error(_.message)}await a()}),handlePull:()=>p(async()=>{await q8(),await a()}),handleFixDivergence:()=>g(async()=>{const _=await Y8();if(!_.ok){if(v("Fix",_)){await e();return}throw new Error(_.message)}await a()})}}const EJ=()=>{const e=L(c=>c.gitAhead),t=L(c=>c.gitBranchHygiene),{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=jJ();return f.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[f.jsx(ye,{content:t==="clean-on-main"?"Already on clean main":void 0,children:f.jsx(re,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:f.jsx(RP,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),f.jsx(re,{size:"small",className:"whitespace-nowrap",icon:f.jsx(P8,{size:14}),disabled:i||e===0,onClick:o,children:n?"Pushing…":e>0?`Push (${e})`:"Push"}),f.jsx(re,{size:"small",className:"whitespace-nowrap",variant:"secondary",icon:f.jsx(T8,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})};function PJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IJ={};function x_(e,t){return(IJ.jsx?NJ:TJ).test(e)}const AJ=/[ \t\n\f\r]/g;function RJ(e){return typeof e=="object"?e.type==="text"?v_(e.value):!1:v_(e)}function v_(e){return e.replace(AJ,"")===""}class gc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}gc.prototype.normal={};gc.prototype.property={};gc.prototype.space=void 0;function zN(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new gc(n,r,t)}function Hg(e){return e.toLowerCase()}class Jt{constructor(t,n){this.attribute=n,this.property=t}}Jt.prototype.attribute="";Jt.prototype.booleanish=!1;Jt.prototype.boolean=!1;Jt.prototype.commaOrSpaceSeparated=!1;Jt.prototype.commaSeparated=!1;Jt.prototype.defined=!1;Jt.prototype.mustUseProperty=!1;Jt.prototype.number=!1;Jt.prototype.overloadedBoolean=!1;Jt.prototype.property="";Jt.prototype.spaceSeparated=!1;Jt.prototype.space=void 0;let LJ=0;const ie=Ai(),Qe=Ai(),Kg=Ai(),H=Ai(),Se=Ai(),gi=Ai(),nn=Ai();function Ai(){return 2**++LJ}const Gg=Object.freeze(Object.defineProperty({__proto__:null,boolean:ie,booleanish:Qe,commaOrSpaceSeparated:nn,commaSeparated:gi,number:H,overloadedBoolean:Kg,spaceSeparated:Se},Symbol.toStringTag,{value:"Module"})),Lp=Object.keys(Gg);class jv extends Jt{constructor(t,n,r,s){let i=-1;if(super(t,n),w_(this,"space",s),typeof r=="number")for(;++i<Lp.length;){const o=Lp[i];w_(this,Lp[i],(r&Gg[o])===Gg[o])}}}jv.prototype.defined=!0;function w_(e,t,n){n&&(e[t]=n)}function da(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new jv(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Hg(r)]=r,n[Hg(i.attribute)]=r}return new gc(t,n,e.space)}const FN=da({properties:{ariaActiveDescendant:null,ariaAtomic:Qe,ariaAutoComplete:null,ariaBusy:Qe,ariaChecked:Qe,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:Qe,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:Qe,ariaFlowTo:Se,ariaGrabbed:Qe,ariaHasPopup:null,ariaHidden:Qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:H,ariaLive:null,ariaModal:Qe,ariaMultiLine:Qe,ariaMultiSelectable:Qe,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Qe,ariaReadOnly:Qe,ariaRelevant:null,ariaRequired:Qe,ariaRoleDescription:Se,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Qe,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 BN(e,t){return t in e?e[t]:t}function VN(e,t){return BN(e,t.toLowerCase())}const MJ=da({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gi,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:ie,allowPaymentRequest:ie,allowUserMedia:ie,alpha:ie,alt:null,as:null,async:ie,autoCapitalize:null,autoComplete:Se,autoFocus:ie,autoPlay:ie,blocking:Se,capture:null,charSet:null,checked:ie,cite:null,className:Se,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Qe,controls:ie,controlsList:Se,coords:H|gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ie,defer:ie,dir:null,dirName:null,disabled:ie,download:Kg,draggable:Qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ie,formTarget:null,headers:Se,height:H,hidden:Kg,high:H,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:ie,inputMode:null,integrity:null,is:null,isMap:ie,itemId:null,itemProp:Se,itemRef:Se,itemScope:ie,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ie,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:ie,muted:ie,name:null,nonce:null,noModule:ie,noValidate:ie,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:ie,optimum:H,pattern:null,ping:Se,placeholder:null,playsInline:ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ie,referrerPolicy:null,rel:Se,required:ie,reversed:ie,rows:H,rowSpan:H,sandbox:Se,scope:null,scoped:ie,seamless:ie,selected:ie,shadowRootClonable:ie,shadowRootCustomElementRegistry:ie,shadowRootDelegatesFocus:ie,shadowRootMode:null,shadowRootSerializable:ie,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Qe,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:ie,useMap:null,value:Qe,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:ie,declare:ie,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:ie,noHref:ie,noShade:ie,noWrap:ie,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Qe,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:ie,disablePictureInPicture:ie,disableRemotePlayback:ie,exportParts:gi,part:Se,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:VN}),$J=da({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:nn,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:ie,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:gi,g2:gi,glyphName:gi,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:nn,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:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,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:nn,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:nn,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:nn,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:BN}),UN=da({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()}}),WN=da({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VN}),HN=da({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DJ={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"},OJ=/[A-Z]/g,b_=/-[a-z]/g,zJ=/^data[-\w.:]+$/i;function FJ(e,t){const n=Hg(t);let r=t,s=Jt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zJ.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(b_,VJ);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!b_.test(i)){let o=i.replace(OJ,BJ);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=jv}return new s(r,t)}function BJ(e){return"-"+e.toLowerCase()}function VJ(e){return e.charAt(1).toUpperCase()}const UJ=zN([FN,MJ,UN,WN,HN],"html"),Ev=zN([FN,$J,UN,WN,HN],"svg");function WJ(e){return e.join(" ").trim()}var Pv={},k_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,HJ=/\n/g,KJ=/^\s*/,GJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ZJ=/^:\s*/,qJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YJ=/^[;\s]*/,JJ=/^\s+|\s+$/g,QJ=`
282
- `,__="/",S_="*",ei="",XJ="comment",eQ="declaration";function tQ(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(HJ);g&&(n+=g.length);var v=m.lastIndexOf(QJ);r=~v?m.length-v: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 v=g[0];return s(v),e=e.slice(v.length),g}}function c(){l(KJ)}function u(m){var g;for(m=m||[];g=d();)g!==!1&&m.push(g);return m}function d(){var m=i();if(!(__!=e.charAt(0)||S_!=e.charAt(1))){for(var g=2;ei!=e.charAt(g)&&(S_!=e.charAt(g)||__!=e.charAt(g+1));)++g;if(g+=2,ei===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,s(v),e=e.slice(g),r+=2,m({type:XJ,comment:v})}}function h(){var m=i(),g=l(GJ);if(g){if(d(),!l(ZJ))return a("property missing ':'");var v=l(qJ),y=m({type:eQ,property:C_(g[0].replace(k_,ei)),value:v?C_(v[0].replace(k_,ei)):ei});return l(YJ),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 C_(e){return e?e.replace(JJ,ei):ei}var nQ=tQ,rQ=td&&td.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pv,"__esModule",{value:!0});Pv.default=iQ;const sQ=rQ(nQ);function iQ(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,sQ.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 ih={};Object.defineProperty(ih,"__esModule",{value:!0});ih.camelCase=void 0;var oQ=/^--[a-zA-Z0-9_-]+$/,aQ=/-([a-z])/g,lQ=/^[^-]+$/,cQ=/^-(webkit|moz|ms|o|khtml)-/,uQ=/^-(ms)-/,dQ=function(e){return!e||lQ.test(e)||oQ.test(e)},fQ=function(e,t){return t.toUpperCase()},j_=function(e,t){return"".concat(t,"-")},hQ=function(e,t){return t===void 0&&(t={}),dQ(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uQ,j_):e=e.replace(cQ,j_),e.replace(aQ,fQ))};ih.camelCase=hQ;var pQ=td&&td.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mQ=pQ(Pv),gQ=ih;function Zg(e,t){var n={};return!e||typeof e!="string"||(0,mQ.default)(e,function(r,s){r&&s&&(n[(0,gQ.camelCase)(r,t)]=s)}),n}Zg.default=Zg;var yQ=Zg;const xQ=lf(yQ),KN=GN("end"),Tv=GN("start");function GN(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 vQ(e){const t=Tv(e),n=KN(e);if(t&&n)return{start:t,end:n}}function ul(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?E_(e.position):"start"in e||"end"in e?E_(e):"line"in e||"column"in e?qg(e):""}function qg(e){return P_(e&&e.line)+":"+P_(e&&e.column)}function E_(e){return qg(e&&e.start)+"-"+qg(e&&e.end)}function P_(e){return e&&typeof e=="number"?e:1}class Pt 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=ul(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}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const Nv={}.hasOwnProperty,wQ=new Map,bQ=/[A-Z]/g,kQ=new Set(["table","tbody","thead","tfoot","tr"]),_Q=new Set(["td","th"]),ZN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function SQ(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=AQ(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=IQ(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"?Ev:UJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=qN(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function qN(e,t,n){if(t.type==="element")return CQ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jQ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return PQ(e,t,n);if(t.type==="mdxjsEsm")return EQ(e,t);if(t.type==="root")return TQ(e,t,n);if(t.type==="text")return NQ(e,t)}function CQ(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ev,e.schema=s),e.ancestors.push(t);const i=JN(e,t.tagName,!1),o=RQ(e,t);let a=Av(e,t);return kQ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!RJ(l):!0})),YN(e,o,i,t),Iv(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function jQ(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)}Zl(e,t.position)}function EQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zl(e,t.position)}function PQ(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ev,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:JN(e,t.name,!0),o=LQ(e,t),a=Av(e,t);return YN(e,o,i,t),Iv(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function TQ(e,t,n){const r={};return Iv(r,Av(e,t)),e.create(t,e.Fragment,r,n)}function NQ(e,t){return t.value}function YN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Iv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function IQ(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 AQ(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=Tv(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 RQ(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Nv.call(t.properties,s)){const i=MQ(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&_Q.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 LQ(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 Zl(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 Zl(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Av(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:wQ;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=qN(e,i,o);a!==void 0&&n.push(a)}return n}function MQ(e,t,n){const r=FJ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?PJ(n):WJ(n)),r.property==="style"){let s=typeof n=="object"?n:$Q(e,String(n));return e.stylePropertyNameCase==="css"&&(s=DQ(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?DJ[r.property]||r.property:r.attribute,n]}}function $Q(e,t){try{return xQ(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Pt("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=ZN+"#cannot-parse-style-attribute",s}}function JN(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=x_(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=x_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Nv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zl(e)}function Zl(e,t){const n=new Pt("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=ZN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function DQ(e){const t={};let n;for(n in e)Nv.call(e,n)&&(t[OQ(n)]=e[n]);return t}function OQ(e){let t=e.replace(bQ,zQ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function zQ(e){return"-"+e.toLowerCase()}const Mp={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"]},FQ={};function BQ(e,t){const n=FQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return QN(e,r,s)}function QN(e,t,n){if(VQ(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 T_(e.children,t,n)}return Array.isArray(e)?T_(e,t,n):""}function T_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=QN(e[s],t,n);return r.join("")}function VQ(e){return!!(e&&typeof e=="object")}const N_=document.createElement("i");function Rv(e){const t="&"+e+";";N_.innerHTML=t;const n=N_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wr(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?(wr(e,e.length,0,t),e):t}const I_={}.hasOwnProperty;function UQ(e){const t={};let n=-1;for(;++n<e.length;)WQ(t,e[n]);return t}function WQ(e,t){let n;for(n in t){const s=(I_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){I_.call(s,o)||(s[o]=[]);const a=i[o];HQ(s[o],Array.isArray(a)?a:a?[a]:[])}}}function HQ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);wr(e,0,0,r)}function XN(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 To(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pr=Bs(/[A-Za-z]/),an=Bs(/[\dA-Za-z]/),KQ=Bs(/[#-'*+\--9=?A-Z^-~]/);function Yg(e){return e!==null&&(e<32||e===127)}const Jg=Bs(/\d/),GQ=Bs(/[\dA-Fa-f]/),ZQ=Bs(/[!-/:-@[-`{-~]/);function ne(e){return e!==null&&e<-2}function Kt(e){return e!==null&&(e<0||e===32)}function me(e){return e===-2||e===-1||e===32}const qQ=Bs(new RegExp("\\p{P}|\\p{S}","u")),YQ=Bs(/\s/);function Bs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fa(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&an(e.charCodeAt(n+1))&&an(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 me(l)?(e.enter(n),a(l)):t(l)}function a(l){return me(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const JQ={tokenize:QQ};function QQ(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 ne(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const XQ={tokenize:eX},A_={tokenize:tX};function eX(e){const t=this,n=[];let r=0,s,i,o;return a;function a(w){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const b=t.events.length;let _=b,S;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){S=t.events[_][1].end;break}y(r);let j=b;for(;j<t.events.length;)t.events[j][1].end={...S},j++;return wr(t.events,_+1,0,t.events.slice(b)),t.events.length=j,c(w)}return a(w)}function c(w){if(r===n.length){if(!s)return h(w);if(s.currentConstruct&&s.currentConstruct.concrete)return m(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(A_,u,d)(w)}function u(w){return s&&x(),y(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(A_,p,m)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){s&&x(),y(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(w)}function g(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ne(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),g)}function v(w,b){const _=t.sliceStream(w);if(b&&_.push(null),w.previous=i,i&&(i.next=w),i=w,s.defineSkip(w.start),s.write(_),t.parser.lazy[w.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++;wr(t.events,E+1,0,t.events.slice(j)),t.events.length=S}}function y(w){let b=n.length;for(;b-- >w;){const _=n[b];t.containerState=_[1],_[0].exit.call(t,e)}n.length=w}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function tX(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 R_(e){if(e===null||Kt(e)||YQ(e))return 1;if(qQ(e))return 2}function Lv(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 Qg={name:"attention",resolveAll:nX,tokenize:rX};function nX(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 d={...e[r][1].end},h={...e[n][1].start};L_(d,-l),L_(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,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,Lv(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,wr(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 rX(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=R_(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=R_(l),d=!u||u===2&&s||n.includes(l),h=!s||s===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(s||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function L_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sX={name:"autolink",tokenize:iX};function iX(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||an(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||an(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||Yg(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):KQ(p)?(e.consume(p),c):n(p)}function u(p){return an(p)?d(p):n(p)}function d(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||an(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const oh={partial:!0,tokenize:oX};function oX(e,t,n){return r;function r(i){return me(i)?Te(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||ne(i)?t(i):n(i)}}const eI={continuation:{tokenize:lX},exit:cX,name:"blockQuote",tokenize:aX};function aX(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 me(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function lX(e,t,n){const r=this;return s;function s(o){return me(o)?Te(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(eI,t,n)(o)}}function cX(e){e.exit("blockQuote")}const tI={name:"characterEscape",tokenize:uX};function uX(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 ZQ(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const nI={name:"characterReference",tokenize:dX};function dX(e,t,n){const r=this;let s=0,i,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=an,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=GQ,u):(e.enter("characterReferenceValue"),i=7,o=Jg,u(d))}function u(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===an&&!Rv(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<i?(e.consume(d),u):n(d)}}const M_={partial:!0,tokenize:hX},$_={concrete:!0,name:"codeFenced",tokenize:fX};function fX(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"),me(S)?Te(e,d,"whitespace")(S):d(S))}function d(S){return S===null||ne(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(M_,g,b)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||ne(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):me(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||ne(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||ne(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===a?n(S):(e.consume(S),m)}function g(S){return e.attempt(s,b,v)(S)}function v(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return i>0&&me(S)?Te(e,x,"linePrefix",i+1)(S):x(S)}function x(S){return S===null||ne(S)?e.check(M_,g,b)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||ne(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),w)}function b(S){return e.exit("codeFenced"),t(S)}function _(S,j,E){let T=0;return P;function P(D){return S.enter("lineEnding"),S.consume(D),S.exit("lineEnding"),N}function N(D){return S.enter("codeFencedFence"),me(D)?Te(S,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):A(D)}function A(D){return D===a?(S.enter("codeFencedFenceSequence"),R(D)):E(D)}function R(D){return D===a?(T++,S.consume(D),R):T>=o?(S.exit("codeFencedFenceSequence"),me(D)?Te(S,$,"whitespace")(D):$(D)):E(D)}function $(D){return D===null||ne(D)?(S.exit("codeFencedFence"),j(D)):E(D)}}}function hX(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 $p={name:"codeIndented",tokenize:mX},pX={partial:!0,tokenize:gX};function mX(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):ne(c)?e.attempt(pX,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ne(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function gX(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):ne(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):ne(o)?s(o):n(o)}}const yX={name:"codeText",previous:vX,resolve:xX,tokenize:wX};function xX(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 vX(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wX(e,t,n){let r=0,s,i;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),s=0,u(d)):ne(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ne(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),s++,u):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class bX{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&&Da(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),Da(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Da(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);Da(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Da(this.left,n.reverse())}}}function Da(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 rI(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new bX(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,kX(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 wr(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function kX(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,d,h=-1,p=n,m=0,g=0;const v=[g];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=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,v.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):v.pop(),h=v.length;h--;){const y=a.slice(v[h],v[h+1]),x=i.pop();l.push([x,x+y.length-1]),e.splice(x,2,y)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const _X={resolve:CX,tokenize:jX},SX={partial:!0,tokenize:EX};function CX(e){return rI(e),e}function jX(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):ne(a)?e.check(SX,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 EX(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||ne(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 sI(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(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||Yg(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||ne(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||Kt(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||Yg(y)?n(y):(e.consume(y),y===92?v:g)}function v(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function iI(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):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ne(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!me(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function oI(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):ne(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||ne(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function dl(e,t){let n;return r;function r(s){return ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):me(s)?Te(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const PX={name:"definition",tokenize:NX},TX={partial:!0,tokenize:IX};function NX(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return iI.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=To(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 Kt(p)?dl(e,c)(p):c(p)}function c(p){return sI(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(TX,d,d)(p)}function d(p){return me(p)?Te(e,h,"whitespace")(p):h(p)}function h(p){return p===null||ne(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function IX(e,t,n){return r;function r(a){return Kt(a)?dl(e,s)(a):n(a)}function s(a){return oI(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return me(a)?Te(e,o,"whitespace")(a):o(a)}function o(a){return a===null||ne(a)?t(a):n(a)}}const AX={name:"hardBreakEscape",tokenize:RX};function RX(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return ne(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const LX={name:"headingAtx",resolve:MX,tokenize:$X};function MX(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"},wr(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function $X(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||Kt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ne(u)?(e.exit("atxHeading"),t(u)):me(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||Kt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const DX=["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"],D_=["pre","script","style","textarea"],OX={concrete:!0,name:"htmlFlow",resolveTo:BX,tokenize:VX},zX={partial:!0,tokenize:WX},FX={partial:!0,tokenize:UX};function BX(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 VX(e,t,n){const r=this;let s,i,o,a,l;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),i=!0,g):I===63?(e.consume(I),s=3,r.interrupt?t:C):pr(I)?(e.consume(I),o=String.fromCharCode(I),v):n(I)}function h(I){return I===45?(e.consume(I),s=2,p):I===91?(e.consume(I),s=5,a=0,m):pr(I)?(e.consume(I),s=4,r.interrupt?t:C):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:C):n(I)}function m(I){const ge="CDATA[";return I===ge.charCodeAt(a++)?(e.consume(I),a===ge.length?r.interrupt?t:A:m):n(I)}function g(I){return pr(I)?(e.consume(I),o=String.fromCharCode(I),v):n(I)}function v(I){if(I===null||I===47||I===62||Kt(I)){const ge=I===47,ke=o.toLowerCase();return!ge&&!i&&D_.includes(ke)?(s=1,r.interrupt?t(I):A(I)):DX.includes(o.toLowerCase())?(s=6,ge?(e.consume(I),y):r.interrupt?t(I):A(I)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?x(I):w(I))}return I===45||an(I)?(e.consume(I),o+=String.fromCharCode(I),v):n(I)}function y(I){return I===62?(e.consume(I),r.interrupt?t:A):n(I)}function x(I){return me(I)?(e.consume(I),x):P(I)}function w(I){return I===47?(e.consume(I),P):I===58||I===95||pr(I)?(e.consume(I),b):me(I)?(e.consume(I),w):P(I)}function b(I){return I===45||I===46||I===58||I===95||an(I)?(e.consume(I),b):_(I)}function _(I){return I===61?(e.consume(I),S):me(I)?(e.consume(I),_):w(I)}function S(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,j):me(I)?(e.consume(I),S):E(I)}function j(I){return I===l?(e.consume(I),l=null,T):I===null||ne(I)?n(I):(e.consume(I),j)}function E(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Kt(I)?_(I):(e.consume(I),E)}function T(I){return I===47||I===62||me(I)?w(I):n(I)}function P(I){return I===62?(e.consume(I),N):n(I)}function N(I){return I===null||ne(I)?A(I):me(I)?(e.consume(I),N):n(I)}function A(I){return I===45&&s===2?(e.consume(I),F):I===60&&s===1?(e.consume(I),O):I===62&&s===4?(e.consume(I),U):I===63&&s===3?(e.consume(I),C):I===93&&s===5?(e.consume(I),V):ne(I)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(zX,Q,R)(I)):I===null||ne(I)?(e.exit("htmlFlowData"),R(I)):(e.consume(I),A)}function R(I){return e.check(FX,$,Q)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),D}function D(I){return I===null||ne(I)?R(I):(e.enter("htmlFlowData"),A(I))}function F(I){return I===45?(e.consume(I),C):A(I)}function O(I){return I===47?(e.consume(I),o="",M):A(I)}function M(I){if(I===62){const ge=o.toLowerCase();return D_.includes(ge)?(e.consume(I),U):A(I)}return pr(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),M):A(I)}function V(I){return I===93?(e.consume(I),C):A(I)}function C(I){return I===62?(e.consume(I),U):I===45&&s===2?(e.consume(I),C):A(I)}function U(I){return I===null||ne(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),U)}function Q(I){return e.exit("htmlFlow"),t(I)}}function UX(e,t,n){const r=this;return s;function s(o){return ne(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 WX(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(oh,t,n)}}const HX={name:"htmlText",tokenize:KX};function KX(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),w):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),x):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):ne(C)?(o=d,O(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?F(C):C===45?h(C):d(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),v):ne(C)?(o=g,O(C)):(e.consume(C),g)}function v(C){return C===93?(e.consume(C),y):g(C)}function y(C){return C===62?F(C):C===93?(e.consume(C),y):g(C)}function x(C){return C===null||C===62?F(C):ne(C)?(o=x,O(C)):(e.consume(C),x)}function w(C){return C===null?n(C):C===63?(e.consume(C),b):ne(C)?(o=w,O(C)):(e.consume(C),w)}function b(C){return C===62?F(C):w(C)}function _(C){return pr(C)?(e.consume(C),S):n(C)}function S(C){return C===45||an(C)?(e.consume(C),S):j(C)}function j(C){return ne(C)?(o=j,O(C)):me(C)?(e.consume(C),j):F(C)}function E(C){return C===45||an(C)?(e.consume(C),E):C===47||C===62||Kt(C)?T(C):n(C)}function T(C){return C===47?(e.consume(C),F):C===58||C===95||pr(C)?(e.consume(C),P):ne(C)?(o=T,O(C)):me(C)?(e.consume(C),T):F(C)}function P(C){return C===45||C===46||C===58||C===95||an(C)?(e.consume(C),P):N(C)}function N(C){return C===61?(e.consume(C),A):ne(C)?(o=N,O(C)):me(C)?(e.consume(C),N):T(C)}function A(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,R):ne(C)?(o=A,O(C)):me(C)?(e.consume(C),A):(e.consume(C),$)}function R(C){return C===s?(e.consume(C),s=void 0,D):C===null?n(C):ne(C)?(o=R,O(C)):(e.consume(C),R)}function $(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Kt(C)?T(C):(e.consume(C),$)}function D(C){return C===47||C===62||Kt(C)?T(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function O(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),M}function M(C){return me(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 Mv={name:"labelEnd",resolveAll:YX,resolveTo:JX,tokenize:QX},GX={tokenize:XX},ZX={tokenize:eee},qX={tokenize:tee};function YX(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&&wr(e,0,e.length,n),e}function JX(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,Lv(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]]),wr(e,i,e.length,a),e}function QX(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?d(h):(o=r.parser.defined.includes(To(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(GX,u,o?u:d)(h):h===91?e.attempt(ZX,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(qX,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function XX(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return Kt(d)?dl(e,i)(d):i(d)}function i(d){return d===41?u(d):sI(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Kt(d)?dl(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?oI(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Kt(d)?dl(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function eee(e,t,n){const r=this;return s;function s(a){return iI.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(To(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function tee(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 nee={name:"labelStartImage",resolveAll:Mv.resolveAll,tokenize:ree};function ree(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 see={name:"labelStartLink",resolveAll:Mv.resolveAll,tokenize:iee};function iee(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 Dp={name:"lineEnding",tokenize:oee};function oee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Te(e,t,"linePrefix")}}const Xu={name:"thematicBreak",tokenize:aee};function aee(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||ne(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),me(c)?Te(e,a,"whitespace")(c):a(c))}}const zt={continuation:{tokenize:dee},exit:hee,name:"list",tokenize:uee},lee={partial:!0,tokenize:pee},cee={partial:!0,tokenize:fee};function uee(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:Jg(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(Xu,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 Jg(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(oh,r.interrupt?n:u,e.attempt(lee,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return me(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 dee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oh,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||!me(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(cee,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Te(e,e.attempt(zt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fee(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 hee(e){e.exit(this.containerState.type)}function pee(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!me(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const O_={name:"setextUnderline",resolveTo:mee,tokenize:gee};function mee(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 gee(e,t,n){const r=this;let s;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(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"),me(c)?Te(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ne(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const yee={tokenize:xee};function xee(e){const t=this,n=e.attempt(oh,r,e.attempt(this.parser.constructs.flowInitial,s,Te(e,e.attempt(this.parser.constructs.flow,s,e.attempt(_X,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 vee={resolveAll:lI()},wee=aI("string"),bee=aI("text");function aI(e){return{resolveAll:lI(e==="text"?kee: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 d=s[u];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function lI(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 kee(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 _ee={42:zt,43:zt,45:zt,48:zt,49:zt,50:zt,51:zt,52:zt,53:zt,54:zt,55:zt,56:zt,57:zt,62:eI},See={91:PX},Cee={[-2]:$p,[-1]:$p,32:$p},jee={35:LX,42:Xu,45:[O_,Xu],60:OX,61:O_,95:Xu,96:$_,126:$_},Eee={38:nI,92:tI},Pee={[-5]:Dp,[-4]:Dp,[-3]:Dp,33:nee,38:nI,42:Qg,60:[sX,HX],91:see,92:[AX,tI],93:Mv,95:Qg,96:yX},Tee={null:[Qg,vee]},Nee={null:[42,95]},Iee={null:[]},Aee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nee,contentInitial:See,disable:Iee,document:_ee,flow:jee,flowInitial:Cee,insideSpan:Tee,string:Eee,text:Pee},Symbol.toStringTag,{value:"Module"}));function Ree(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:x,enter:w,exit:b,interrupt:j(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(N){return o=Cn(o,N),v(),o[o.length-1]!==null?[]:(E(t,0),c.events=Lv(i,c.events,c),c.events)}function h(N,A){return Mee(p(N),A)}function p(N){return Lee(o,N)}function m(){const{_bufferIndex:N,_index:A,line:R,column:$,offset:D}=r;return{_bufferIndex:N,_index:A,line:R,column:$,offset:D}}function g(N){s[N.line]=N.column,P()}function v(){let N;for(;r._index<o.length;){const A=o[r._index];if(typeof A=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<A.length;)y(A.charCodeAt(r._bufferIndex));else y(A)}}function y(N){u=u(N)}function x(N){ne(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 w(N,A){const R=A||{};return R.type=N,R.start=m(),c.events.push(["enter",R,c]),a.push(R),R}function b(N){const A=a.pop();return A.end=m(),c.events.push(["exit",A,c]),A}function _(N,A){E(N,A.from)}function S(N,A){A.restore()}function j(N,A){return R;function R($,D,F){let O,M,V,C;return Array.isArray($)?Q($):"tokenize"in $?Q([$]):U($);function U(ve){return Qt;function Qt(lt){const vn=lt!==null&&ve[lt],tr=lt!==null&&ve.null,br=[...Array.isArray(vn)?vn:vn?[vn]:[],...Array.isArray(tr)?tr:tr?[tr]:[]];return Q(br)(lt)}}function Q(ve){return O=ve,M=0,ve.length===0?F:I(ve[M])}function I(ve){return Qt;function Qt(lt){return C=T(),V=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?ke():ve.tokenize.call(A?Object.assign(Object.create(c),A):c,l,ge,ke)(lt)}}function ge(ve){return N(V,C),D}function ke(ve){return C.restore(),++M<O.length?I(O[M]):F}}}function E(N,A){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&wr(c.events,A,c.events.length-A,N.resolve(c.events.slice(A),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function T(){const N=m(),A=c.previous,R=c.currentConstruct,$=c.events.length,D=Array.from(a);return{from:$,restore:F};function F(){r=N,c.previous=A,c.currentConstruct=R,c.events.length=$,a=D,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Lee(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 Mee(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 $ee(e){const r={constructs:UQ([Aee,...(e||{}).extensions||[]]),content:s(JQ),defined:[],document:s(XQ),flow:s(yee),lazy:{},string:s(wee),text:s(bee)};return r;function s(i){return o;function o(a){return Ree(r,i,a)}}}function Dee(e){for(;!rI(e););return e}const z_=/[\0\t\n\r]/g;function Oee(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const l=[];let c,u,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(z_.lastIndex=d,c=z_.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),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}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const zee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fee(e){return e.replace(zee,Bee)}function Bee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return XN(n.slice(i?2:1),i?16:10)}return Rv(n)||e}const cI={}.hasOwnProperty;function Vee(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Uee(n)(Dee($ee(n).document().write(Oee()(e,t,!0))))}function Uee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Mi),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(Sc),blockQuote:i(tr),characterEscape:T,characterReference:T,codeFenced:i(br),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(br,o),codeText:i(Li,o),codeTextData:T,data:T,codeFlowValue:T,definition:i(kc),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(_c),hardBreakEscape:i(pa),hardBreakTrailing:i(pa),htmlFlow:i(ma,o),htmlFlowData:T,htmlText:i(ma,o),htmlTextData:T,image:i(Kr),label:o,link:i(Mi),listItem:i(fh),listItemValue:h,listOrdered:i(nr,d),listUnordered:i(nr),paragraph:i(Cc),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Sc),strong:i(hh),thematicBreak:i(we)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:vn,autolinkProtocol:lt,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:ve,characterReference:Qt,codeFenced:l(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:l(y),codeText:l(D),codeTextData:P,data:P,definition:l(),definitionDestinationString:b,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(R),htmlFlowData:P,htmlText:l($),htmlTextData:P,image:l(O),label:V,labelText:M,lineEnding:N,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:C,resourceTitleString:U,resource:Q,setextHeading:l(E),setextHeadingLineSequence:j,setextHeadingText:S,strong:l(),thematicBreak:l()}};uI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let G={type:"root",children:[]};const se={stack:[G],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},de=[];let _e=-1;for(;++_e<z.length;)if(z[_e][1].type==="listOrdered"||z[_e][1].type==="listUnordered")if(z[_e][0]==="enter")de.push(_e);else{const On=de.pop();_e=s(z,On,_e)}for(_e=-1;++_e<z.length;){const On=t[z[_e][0]];cI.call(On,z[_e][1].type)&&On[z[_e][1].type].call(Object.assign({sliceSerialize:z[_e][2].sliceSerialize},se),z[_e][1])}if(se.tokenStack.length>0){const On=se.tokenStack[se.tokenStack.length-1];(On[1]||F_).call(se,void 0,On[0])}for(G.position={start:ns(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:ns(z.length>0?z[z.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(z,G,se){let de=G-1,_e=-1,On=!1,Us,kr,ga,ya;for(;++de<=se;){const Xt=z[de];switch(Xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xt[0]==="enter"?_e++:_e--,ya=void 0;break}case"lineEndingBlank":{Xt[0]==="enter"&&(Us&&!ya&&!_e&&!ga&&(ga=de),ya=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ya=void 0}if(!_e&&Xt[0]==="enter"&&Xt[1].type==="listItemPrefix"||_e===-1&&Xt[0]==="exit"&&(Xt[1].type==="listUnordered"||Xt[1].type==="listOrdered")){if(Us){let $i=de;for(kr=void 0;$i--;){const _r=z[$i];if(_r[1].type==="lineEnding"||_r[1].type==="lineEndingBlank"){if(_r[0]==="exit")continue;kr&&(z[kr][1].type="lineEndingBlank",On=!0),_r[1].type="lineEnding",kr=$i}else if(!(_r[1].type==="linePrefix"||_r[1].type==="blockQuotePrefix"||_r[1].type==="blockQuotePrefixWhitespace"||_r[1].type==="blockQuoteMarker"||_r[1].type==="listItemIndent"))break}ga&&(!kr||ga<kr)&&(Us._spread=!0),Us.end=Object.assign({},kr?z[kr][1].start:Xt[1].end),z.splice(kr||de,0,["exit",Us,Xt[2]]),de++,se++}if(Xt[1].type==="listItemPrefix"){const $i={type:"listItem",_spread:!1,start:Object.assign({},Xt[1].start),end:void 0};Us=$i,z.splice(de,0,["enter",$i,Xt[2]]),de++,se++,ga=void 0,ya=!0}}}return z[G][1]._spread=On,se}function i(z,G){return se;function se(de){a.call(this,z(de),de),G&&G.call(this,de)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(z,G,se){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([G,se||void 0]),z.position={start:ns(G.start),end:void 0}}function l(z){return G;function G(se){z&&z.call(this,se),c.call(this,se)}}function c(z,G){const se=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==z.type&&(G?G.call(this,z,de[0]):(de[1]||F_).call(this,z,de[0]));else throw new Error("Cannot close `"+z.type+"` ("+ul({start:z.start,end:z.end})+"): it’s not open");se.position.end=ns(z.end)}function u(){return BQ(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(z){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function p(){const z=this.resume(),G=this.stack[this.stack.length-1];G.lang=z}function m(){const z=this.resume(),G=this.stack[this.stack.length-1];G.meta=z}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z.replace(/(\r?\n|\r)$/g,"")}function x(z){const G=this.resume(),se=this.stack[this.stack.length-1];se.label=G,se.identifier=To(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),G=this.stack[this.stack.length-1];G.title=z}function b(){const z=this.resume(),G=this.stack[this.stack.length-1];G.url=z}function _(z){const G=this.stack[this.stack.length-1];if(!G.depth){const se=this.sliceSerialize(z).length;G.depth=se}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function j(z){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function T(z){const se=this.stack[this.stack.length-1].children;let de=se[se.length-1];(!de||de.type!=="text")&&(de=jc(),de.position={start:ns(z.start),end:void 0},se.push(de)),this.stack.push(de)}function P(z){const G=this.stack.pop();G.value+=this.sliceSerialize(z),G.position.end=ns(z.end)}function N(z){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=G.children[G.children.length-1];se.position.end=ns(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(T.call(this,z),P.call(this,z))}function A(){this.data.atHardBreak=!0}function R(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function $(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function D(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function F(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=G,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function O(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=G,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function M(z){const G=this.sliceSerialize(z),se=this.stack[this.stack.length-2];se.label=Fee(G),se.identifier=To(G).toLowerCase()}function V(){const z=this.stack[this.stack.length-1],G=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const de=z.children;se.children=de}else se.alt=G}function C(){const z=this.resume(),G=this.stack[this.stack.length-1];G.url=z}function U(){const z=this.resume(),G=this.stack[this.stack.length-1];G.title=z}function Q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ge(z){const G=this.resume(),se=this.stack[this.stack.length-1];se.label=G,se.identifier=To(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function ke(z){this.data.characterReferenceType=z.type}function ve(z){const G=this.sliceSerialize(z),se=this.data.characterReferenceType;let de;se?(de=XN(G,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):de=Rv(G);const _e=this.stack[this.stack.length-1];_e.value+=de}function Qt(z){const G=this.stack.pop();G.position.end=ns(z.end)}function lt(z){P.call(this,z);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(z)}function vn(z){P.call(this,z);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(z)}function tr(){return{type:"blockquote",children:[]}}function br(){return{type:"code",lang:null,meta:null,value:""}}function Li(){return{type:"inlineCode",value:""}}function kc(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _c(){return{type:"emphasis",children:[]}}function Sc(){return{type:"heading",depth:0,children:[]}}function pa(){return{type:"break"}}function ma(){return{type:"html",value:""}}function Kr(){return{type:"image",title:null,url:"",alt:null}}function Mi(){return{type:"link",title:null,url:"",children:[]}}function nr(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function fh(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Cc(){return{type:"paragraph",children:[]}}function hh(){return{type:"strong",children:[]}}function jc(){return{type:"text",value:""}}function we(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function uI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?uI(e,r):Wee(e,r)}}function Wee(e,t){let n;for(n in t)if(cI.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 F_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ul({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ul({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ul({start:t.start,end:t.end})+") is still open")}function Hee(e){const t=this;t.parser=n;function n(r){return Vee(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Kee(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 Gee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
285
- `}]}function Zee(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 qee(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jee(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=fa(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 Qee(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 Xee(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dI(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 ete(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dI(e,t);const s={src:fa(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 tte(e,t){const n={src:fa(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 nte(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 rte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dI(e,t);const s={href:fa(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 ste(e,t){const n={href:fa(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 ite(e,t,n){const r=e.all(t),s=n?ote(n):fI(t),i={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.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 ote(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=fI(n[r])}return t}function fI(e){const t=e.spread;return t??e.children.length>1}function ate(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 lte(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cte(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ute(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dte(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=Tv(t.children[1]),l=KN(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 fte(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 d=t.children[l],h={},p=o?o[l]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,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 hte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const B_=9,V_=32;function pte(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(U_(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(U_(t.slice(s),s>0,!1)),i.join("")}function U_(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===B_||i===V_;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===B_||i===V_;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function mte(e,t){const n={type:"text",value:pte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yte={blockquote:Kee,break:Gee,code:Zee,delete:qee,emphasis:Yee,footnoteReference:Jee,heading:Qee,html:Xee,imageReference:ete,image:tte,inlineCode:nte,linkReference:rte,link:ste,listItem:ite,list:ate,paragraph:lte,root:cte,strong:ute,table:dte,tableCell:hte,tableRow:fte,text:mte,thematicBreak:gte,toml:vu,yaml:vu,definition:vu,footnoteDefinition:vu};function vu(){}const hI=-1,ah=0,fl=1,nf=2,$v=3,Dv=4,Ov=5,zv=6,pI=7,mI=8,xte=typeof self=="object"?self:globalThis,W_=(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 xte[e](t)},vte=(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 ah:case hI:return n(o,s);case fl:{const a=n([],s);for(const l of o)a.push(r(l));return a}case nf:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case $v:return n(new Date(o),s);case Dv:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case Ov:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case zv:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case pI:{const{name:a,message:l}=o;return n(W_(a,l),s)}case mI: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(W_(i,o),s)};return r},H_=e=>vte(new Map,e)(0),Ki="",{toString:wte}={},{keys:bte}=Object,Oa=e=>{const t=typeof e;if(t!=="object"||!e)return[ah,t];const n=wte.call(e).slice(8,-1);switch(n){case"Array":return[fl,Ki];case"Object":return[nf,Ki];case"Date":return[$v,Ki];case"RegExp":return[Dv,Ki];case"Map":return[Ov,Ki];case"Set":return[zv,Ki];case"DataView":return[fl,n]}return n.includes("Array")?[fl,n]:n.includes("Error")?[pI,n]:[nf,n]},wu=([e,t])=>e===ah&&(t==="function"||t==="symbol"),kte=(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]=Oa(o);switch(a){case ah:{let u=o;switch(l){case"bigint":a=mI,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([hI],o)}return s([a,u],o)}case fl:{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=[],d=s([a,u],o);for(const h of o)u.push(i(h));return d}case nf:{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=[],d=s([a,u],o);for(const h of bte(o))(e||!wu(Oa(o[h])))&&u.push([i(h),i(o[h])]);return d}case $v:return s([a,o.toISOString()],o);case Dv:{const{source:u,flags:d}=o;return s([a,{source:u,flags:d}],o)}case Ov:{const u=[],d=s([a,u],o);for(const[h,p]of o)(e||!(wu(Oa(h))||wu(Oa(p))))&&u.push([i(h),i(p)]);return d}case zv:{const u=[],d=s([a,u],o);for(const h of o)(e||!wu(Oa(h)))&&u.push(i(h));return d}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},K_=(e,{json:t,lossy:n}={})=>{const r=[];return kte(!(t||n),!!t,new Map,r)(e),r},rf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?H_(K_(e,t)):structuredClone(e):(e,t)=>H_(K_(e,t));function _te(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 Ste(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Cte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_te,r=e.options.footnoteBackLabel||Ste,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),d=String(c.identifier).toUpperCase(),h=fa(d.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(d);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const 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:{...rf(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 gI=function(e){if(e==null)return Tte;if(typeof e=="function")return lh(e);if(typeof e=="object")return Array.isArray(e)?jte(e):Ete(e);if(typeof e=="string")return Pte(e);throw new Error("Expected function, string, or object as test")};function jte(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=gI(e[n]);return lh(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function Ete(e){const t=e;return lh(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function Pte(e){return lh(t);function t(n){return n&&n.type===e}}function lh(e){return t;function t(n,r,s){return!!(Nte(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Tte(){return!0}function Nte(e){return e!==null&&typeof e=="object"&&"type"in e}const yI=[],Ite=!0,G_=!1,Ate="skip";function Rte(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=gI(s),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=yI,m,g,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=Lte(n(l,u)),p[0]===G_))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==Ate)for(g=(r?y.children.length:-1)+o,v=u.concat(y);g>-1&&g<y.children.length;){const x=y.children[g];if(m=a(x,g,v)(),m[0]===G_)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Lte(e){return Array.isArray(e)?e:typeof e=="number"?[Ite,e]:e==null?yI:[e]}function xI(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),Rte(e,i,a,s);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const Xg={}.hasOwnProperty,Mte={};function $te(e,t){const n=t||Mte,r=new Map,s=new Map,i=new Map,o={...yte,...n.handlers},a={all:c,applyData:Ote,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:Dte,wrap:Fte};return xI(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:s,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,p=a.handlers[h];if(Xg.call(a.handlers,h)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:g,...v}=u,y=rf(v);return y.children=a.all(u),y}return rf(u)}return(a.options.unknownHandler||zte)(a,u,d)}function c(u){const d=[];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=Z_(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=Z_(g.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function Dte(e,t){e.position&&(t.position=vQ(e))}function Ote(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,rf(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function zte(e,t){const n=t.data||{},r="value"in t&&!(Xg.call(n,"hProperties")||Xg.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 Fte(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 Z_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function q_(e,t){const n=$te(e,t),r=n.one(e,void 0),s=Cte(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 Bte(e,t){return e&&"run"in e?async function(n,r){const s=q_(n,{file:r,...t});await e.run(s,r)}:function(n,r){return q_(n,{file:r,...e||t})}}function Y_(e){if(e)throw e}var ed=Object.prototype.hasOwnProperty,vI=Object.prototype.toString,J_=Object.defineProperty,Q_=Object.getOwnPropertyDescriptor,X_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):vI.call(t)==="[object Array]"},e1=function(t){if(!t||vI.call(t)!=="[object Object]")return!1;var n=ed.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ed.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||ed.call(t,s)},t1=function(t,n){J_&&n.name==="__proto__"?J_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},n1=function(t,n){if(n==="__proto__")if(ed.call(t,n)){if(Q_)return Q_(t,n).value}else return;return t[n]},Vte=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=n1(a,n),s=n1(t,n),a!==s&&(u&&s&&(e1(s)||(i=X_(s)))?(i?(i=!1,o=r&&X_(r)?r:[]):o=r&&e1(r)?r:{},t1(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&t1(a,{name:n,newValue:s}));return a};const Op=lf(Vte);function ey(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 Ute(){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 d=-1;if(l){o(l);return}for(;++d<s.length;)(c[d]===null||c[d]===void 0)&&(c[d]=s[d]);s=c,u?Wte(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 Wte(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:Hte,dirname:Kte,extname:Gte,join:Zte,sep:"/"};function Hte(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yc(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 Kte(e){if(yc(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 Gte(e){yc(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 Zte(...e){let t=-1,n;for(;++t<e.length;)yc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":qte(n)}function qte(e){yc(e);const t=e.codePointAt(0)===47;let n=Yte(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Yte(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 yc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Jte={cwd:Qte};function Qte(){return"/"}function ty(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xte(e){if(typeof e=="string")e=new URL(e);else if(!ty(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 ene(e)}function ene(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 zp=["history","path","basename","stem","extname","dirname"];class wI{constructor(t){let n;t?ty(t)?n={path:t}:typeof t=="string"||tne(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Jte.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zp.length;){const i=zp[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)zp.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ur.basename(this.path):void 0}set basename(t){Bp(t,"basename"),Fp(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){r1(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(Fp(t,"extname"),r1(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){ty(t)&&(t=Xte(t)),Bp(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){Bp(t,"stem"),Fp(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 Pt(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 Fp(e,t){if(e&&e.includes(ur.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ur.sep+"`")}function Bp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function r1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nne=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},rne={}.hasOwnProperty;class Fv extends nne{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=Ute()}copy(){const t=new Fv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Op(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Wp("data",this.frozen),this.namespace[t]=n,this):rne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wp("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=bu(t),r=this.parser||this.Parser;return Vp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Vp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=bu(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const p=d,m=r.stringify(p,h);one(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?o(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Vp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(t,s),i1("processSync","process",n),r;function s(i,o){n=!0,Y_(i),r=o}}run(t,n,r){s1(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=bu(n);s.run(t,l,c);function c(u,d,h){const p=d||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),i1("runSync","run",r),s;function i(o,a){Y_(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=bu(n),s=this.compiler||this.Compiler;return Up("stringify",s),s1(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Wp("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,...d]=c;l(u,d)}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=Op(!0,s.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const g=r[h][1];ey(g)&&ey(p)&&(p=Op(!0,g,p)),r[h]=[c,p,...m]}}}}const sne=new Fv().freeze();function Vp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wp(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 s1(e){if(!ey(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function i1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bu(e){return ine(e)?e:new wI(e)}function ine(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function one(e){return typeof e=="string"||ane(e)}function ane(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",o1=[],a1={allowDangerousHtml:!0},cne=/^(https?|ircs?|mailto|xmpp)$/i,une=[{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 dne(e){const t=fne(e),n=hne(e);return pne(t.runSync(t.parse(n),n),e)}function fne(e){const t=e.rehypePlugins||o1,n=e.remarkPlugins||o1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...a1}:a1;return sne().use(Hee).use(n).use(Bte,r).use(t)}function hne(e){const t=e.children||"",n=new wI;return typeof t=="string"&&(n.value=t),n}function pne(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||mne;for(const u of une)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+lne+u.id,void 0);return xI(e,c),SQ(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in Mp)if(Object.hasOwn(Mp,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],g=Mp[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 d=="number"&&(p=!r(u,d,h)),p&&h&&typeof d=="number")return a&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function mne(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||cne.test(e.slice(0,t))?e:""}const Hp=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,gne={p:({children:e})=>f.jsx("p",{className:"mb-4",children:e}),strong:({children:e})=>f.jsx("strong",{className:"font-bold",children:e}),h1:({children:e})=>f.jsx("h1",{className:Hp("text-lg"),children:e}),h2:({children:e})=>f.jsx("h2",{className:Hp("text-[1.3rem]"),children:e}),h3:({children:e})=>f.jsx("h3",{className:Hp("text-[1.1rem]"),children:e}),a:({children:e,href:t})=>f.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-watercolor-amber-dark",children:e}),code:({children:e})=>f.jsx("code",{className:"font-mono text-[0.85em] bg-black/[6%] rounded-[3px] py-[0.1em] px-[0.35em]",children:e}),pre:({children:e})=>f.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})=>f.jsx("ul",{className:"list-disc mb-4 pl-[1.4rem]",children:e}),ol:({children:e})=>f.jsx("ol",{className:"list-decimal mb-4 pl-[1.4rem]",children:e}),li:({children:e})=>f.jsx("li",{className:"mb-[0.4rem]",children:e}),blockquote:({children:e})=>f.jsx("blockquote",{className:"mb-4 pl-4 border-l-[3px] border-solid border-black/[15%] opacity-[0.85]",children:e})},bI=({children:e})=>f.jsx(dne,{components:gne,children:e}),Bv=1e3,yne=3e4;let Tn=null,yo=null,hl=Bv;const pl=new Set;function xne(e){let t;try{t=JSON.parse(e.data)}catch{return}for(const n of pl)n(t)}function vne(){hl=Bv}function wne(){Tn==null||Tn.close(),Tn=null,pl.size!==0&&(yo=setTimeout(()=>{yo=null,kI()},hl),hl=Math.min(hl*2,yne))}function kI(){Tn=new EventSource(K("/api/activity/stream")),Tn.onmessage=xne,Tn.onopen=vne,Tn.onerror=wne}function xc(e){return pl.add(e),!Tn&&!yo&&kI(),()=>{pl.delete(e),!(pl.size>0)&&(yo&&(clearTimeout(yo),yo=null),Tn&&(Tn.close(),Tn=null),hl=Bv)}}function vc(){const[e,t]=k.useState([]),n=k.useCallback(async()=>{try{t(await $9())}catch{}},[]);k.useEffect(()=>{n()},[n]),k.useEffect(()=>{let s;const i=()=>{s&&clearTimeout(s),s=setTimeout(n,80)},o=xc(a=>{(a.type==="check"||a.message==="changed")&&i()});return()=>{s&&clearTimeout(s),o()}},[n]);const r=k.useCallback(async s=>{await BP(s),await n()},[n]);return{checks:e,run:r}}function bne(e,t,n){const r=k.useRef(null);k.useEffect(()=>{r.current&&(r.current.inert=!e)},[e]),k.useEffect(()=>{if(!e||t)return;const d=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,t,n]);const s=L(d=>d.consistency),i=L(d=>d.doctor),o=L(d=>d.agentStatus);k.useEffect(()=>{const{loadStatus:d,loadConsistency:h,loadDoctor:p,loadGitStatus:m,loadAgentStatus:g,loadArchivableIdeas:v}=L.getState();d(),h(),p(),m(),g(),v()},[]),k.useEffect(()=>{const d=()=>{L.getState().loadPlans(),L.getState().loadGitStatus()};return window.addEventListener("focus",d),()=>window.removeEventListener("focus",d)},[]),k.useEffect(()=>{const d={},h=(m,g,v)=>{d[m]&&clearTimeout(d[m]),d[m]=setTimeout(g,v)},p=xc(m=>{if(m.type==="status"){h("status",()=>L.getState().loadStatus(),80);return}if(m.type==="agent"){h("agent",()=>L.getState().loadAgentStatus(),120);return}m.message==="changed"&&h("activity",()=>{const{loadPlans:g,loadSuggestions:v,loadStatus:y,loadConsistency:x,loadDoctor:w,loadGitStatus:b,loadAgentStatus:_,loadArchivableIdeas:S}=L.getState();g(),v(),y(),x(),w(),b(),_(),S()},250)});return()=>{for(const m of Object.values(d))m&&clearTimeout(m);p()}},[]);const{checks:a}=vc(),l=s.length>0,c=a.some(d=>d.status==="fail")||l||i.errorCount>0,u=o.some(d=>d.status==="running"||d.status==="starting"||d.status==="stopping");return{panelRef:r,anyChecksFailing:c,agentActive:u}}const No={accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",chalkPass:"#2d5a3b",chalkPassText:"#b5d6b5",chalkFail:"#5a2d2d",chalkFailText:"#d6a0a0",chalkRunning:"#5a4a2d",chalkRunningText:"#d6c4a0"},_I="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",ch="text-xs font-semibold uppercase tracking-wide text-desk-text-muted mb-2",Nr={pass:No.chalkPass,fail:No.chalkFail,running:No.chalkRunning},Ir={pass:No.chalkPassText,fail:No.chalkFailText,running:No.chalkRunningText},ny=({tooltip:e,onClick:t,disabled:n,disabledCursor:r="not-allowed",ariaExpanded:s,fillColor:i,textColor:o,variant:a,children:l})=>f.jsx(ye,{content:e,surface:"chalkboard",children:f.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:f.jsx(ce,{surface:"chalkboard",size:"small",fillColor:i,textColor:o,variant:a,children:l})})}),kne=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),SI=e=>{if(!e)return"";const t=new Date(e),n=t.toLocaleTimeString();return kne(t,new Date)?n:`${t.toLocaleDateString()} ${n}`},_ne=1,Sne="h-[4.625rem]",Cne="basis-[6.625rem]",jne=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""}},Ene=e=>{const t=jne(e);return!t||t.toLowerCase()===e.planTitle.trim().toLowerCase()?"":` — ${t}`},l1={starting:Nr.running,running:Nr.running,stopping:Nr.running,done:Nr.pass,error:Nr.fail,superseded:Nr.running},c1={starting:Ir.running,running:Ir.running,stopping:Ir.running,done:Ir.pass,error:Ir.fail,superseded:Ir.running},Pne=({task:e,onStop:t})=>{const n=nt(),{toast:r}=rt(),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 f.jsx(pe,{surface:"chalkboard",size:"small",className:`stack-task-card ${Sne}`,children:f.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:[f.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,Ene(e)]}),f.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[f.jsxs("span",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-2xs text-desk-text-muted",children:[F8[e.agentId]," · ",SI(e.startedAt)]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?f.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:f.jsx(ce,{surface:"chalkboard",size:"small",fillColor:l1.error,textColor:c1.error,children:"stopped — agent signed out"})}):f.jsx(ce,{surface:"chalkboard",size:"small",fillColor:l1[e.status],textColor:c1[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&f.jsx(dt,{icon:f.jsx(ra,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})]})})},Tne=()=>{const e=L(i=>i.agentStatus),t=L(i=>i.stopAgent),n=nt(),r=e.slice(0,_ne),s=e.length-r.length;return f.jsxs("div",{className:"flex min-h-0 flex-none flex-col p-[var(--pc-stack-pad)]",children:[f.jsx("h3",{className:`${_I} m-0`,children:"Agent"}),f.jsxs("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${Cne} ${r.length>0?"justify-start":"justify-center"}`,children:[r.length>0?r.map(i=>f.jsx(Pne,{task:i,onStop:t},i.id)):f.jsx(pe,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})}),s>0&&f.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…"]})]})]})},CI=({label:e="Refresh data",refreshingLabel:t="Refreshing…",surface:n}={})=>{const r=L(l=>l.refreshAll),s=L(l=>l.refreshing),i=L(l=>{var c;return((c=l.status)==null?void 0:c.prFetchedAt)??null}),{toast:o}=rt(),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 f.jsxs("span",{className:"inline-flex items-center gap-2",children:[i!=null&&f.jsx("span",{className:`text-xs whitespace-nowrap ${n==="chalkboard"?"text-desk-text-muted":"opacity-[0.45]"}`,children:SN(i)}),f.jsx(dt,{icon:f.jsx("span",{className:"inline-flex",children:f.jsx(N8,{size:16})}),label:s?t:e,size:"small",variant:"ghost",surface:n,disabled:s,onClick:a})]})},Nne=()=>{const[e,t]=k.useState(null),[n,r]=k.useState(!0);return k.useEffect(()=>{let s=!1;return Gx().then(i=>{s||(t((i==null?void 0:i.desk)??null),r(!1))}),()=>{s=!0}},[]),{desk:e,loading:n}},Ine=["repo-docs","release-notes"],Ane=["subjects","setup","merge-policy"];function sf(e){var t;return((t=e==null?void 0:e.match(/\d+$/))==null?void 0:t[0])??null}const Rne=/^\d+$/;function ry(e,t,n="IDEA"){if(Rne.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 jI(e,t){return sf(e)??encodeURIComponent(t)}function Ri(e){var r;const t=(r=e.id)!=null&&r.startsWith("TICKET-")?sf(e.id):null,n=sf(e.idea);return e.entityKind==="ticket"&&t&&n?{to:"/ideas/$ideaId/tickets/$ticketId",params:{ideaId:n,ticketId:t}}:{to:"/ideas/$ideaId",params:{ideaId:jI(e.id,e.title)}}}function uh(){const{planId:e,ideaId:t,ticketId:n}=Ti({strict:!1}),r=L(i=>i.plans);if(!r)return null;if(typeof n=="string")return ry(r.entries,decodeURIComponent(n),"TICKET");const s=typeof t=="string"?t:e;return typeof s!="string"?null:ry(r.entries,decodeURIComponent(s))}function EI(){const{ideaId:e}=Ti({strict:!1}),t=L(n=>n.ideaEntries);return typeof e!="string"?null:ry(t,decodeURIComponent(e))}function Lne(){const{section:e}=Ti({strict:!1});return Ine.includes(e)?e:null}function bae(){const{section:e}=Ti({strict:!1});return Ane.includes(e)?e:null}function Mne(){const e=Lne(),t=L(r=>r.activeDocTitle),n=L(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}function PI(){const e=nt(),t=L(n=>n.plans);return(n,r)=>{const s=((t==null?void 0:t.entries)??[]).find(i=>n?i.id===n:i.title===r);e(Ri(s??{id:n,title:r}))}}const $ne=()=>{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([h9().then(a=>{!o&&a&&t(FP(a))}),d9().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},Dne=250;function One(e,t,n={}){const{debounceMs:r=Dne,...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(()=>AY(i,t,{threshold:a,limit:l}),[i,t,a,l])}const TI=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState(!0);return k.useEffect(()=>{let o=!1;return Gx().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},NI="Checks",zne={...Nr,stale:void 0},Fne={...Ir,stale:void 0},u1=e=>e.errorCount>0?"fail":e.warningCount>0?"running":"pass",Bne=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)"}`,Vne=({check:e,onRun:t})=>{const n=e.status==="running",r=SI(e.lastRun);return f.jsxs(ny,{tooltip:r?`${e.cmd} — last run ${r}. Click to run.`:`${e.cmd} — click to run.`,onClick:()=>t(e.name),disabled:n,fillColor:zne[e.status],textColor:Fne[e.status],variant:e.status==="stale"?"neutral":void 0,children:[e.name,f.jsx("span",{className:n?"visible":"invisible",children:"…"})]})},Une=({finding:e})=>f.jsxs("div",{className:"font-mono text-2xs opacity-70",children:[e.file,":",e.line," — ",e.message]}),Wne=({issue:e,linkedPlan:t,onNavigate:n})=>f.jsx("div",{className:"font-mono text-2xs opacity-70",children:t?f.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}):f.jsx("span",{className:"text-left",children:e.message})}),Hne=()=>{const{checks:e,run:t}=vc(),n=L(v=>v.doctor),r=L(v=>v.consistency),s=L(v=>v.plans),i=nt(),o=e.find(v=>v.status==="fail"),[a,l]=k.useState(!1),[c,u]=k.useState(!1),[d,h]=k.useState(!1),p=n.findings.length>0,m=r.length>0,g=k.useCallback(v=>v.planId?s==null?void 0:s.entries.find(y=>y.id===v.planId):void 0,[s==null?void 0:s.entries]);return f.jsxs("div",{children:[f.jsx("h4",{className:`${ch} m-0`,children:NI}),f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.map(v=>f.jsx(Vne,{check:v,onRun:t},v.name)),f.jsx(ny,{tooltip:p?`${n.errorCount} error(s), ${n.warningCount} warning(s) — click to show.`:"Corpus doctor — no findings.",onClick:()=>u(v=>!v),disabled:!p,disabledCursor:"default",ariaExpanded:p?c:void 0,fillColor:Nr[u1(n)],textColor:Ir[u1(n)],children:"doctor"}),f.jsx(ny,{tooltip:m?"Plan/idea doc findings — orphan subjects & title style. Click to show.":"Plan/idea docs — no findings.",onClick:()=>h(v=>!v),disabled:!m,disabledCursor:"default",ariaExpanded:m?d:void 0,fillColor:Nr[m?"fail":"pass"],textColor:Ir[m?"fail":"pass"],children:"docs"})]}),o&&f.jsxs("div",{className:"flex flex-col gap-1 text-center font-handwritten text-sm",children:[f.jsxs("span",{className:"text-desk-text-muted",children:["The ",o.name," check failed."]}),f.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",f.jsx(Kd,{text:Bne(o),surface:"chalkboard"}),o.output&&f.jsxs(f.Fragment,{children:[" · ",f.jsx("button",{type:"button",onClick:()=>l(v=>!v),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&&f.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&&f.jsx("div",{className:"flex flex-col gap-1",children:n.findings.map(v=>f.jsx(Une,{finding:v},`${v.file}:${v.line}:${v.rule}`))}),d&&m&&f.jsx("div",{className:"flex flex-col gap-1",children:r.map((v,y)=>{const x=g(v);return f.jsx(Wne,{issue:v,linkedPlan:x,onNavigate:()=>x&&i(Ri(x))},`${v.kind}-${v.title}-${y}`)})})]})]})},Kne=async()=>{try{const e=await J(K("/api/ci"));return e.ok?e.json():null}catch{return null}};function Gne(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),s=k.useCallback(async()=>{try{t(await Kne())}finally{r(!1)}},[]);return k.useEffect(()=>{s()},[s]),{ci:e,loading:n,refresh:s}}const II="CI & release",Zne={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"},Kp="text-desk-chalk underline decoration-desk-border hover:decoration-desk-chalk",qne=({run:e})=>{const t=f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{"aria-hidden":"true",className:`h-2 w-2 shrink-0 rounded-full ${Zne[e.status]}`}),f.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-desk-chalk",children:e.workflow}),f.jsx("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:e.status})]});return e.url?f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"no-underline",children:t}):t},Yne=()=>{const{ci:e,loading:t,refresh:n}=Gne(),r=L(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 f.jsx(pe,{surface:"chalkboard",size:"small",children:f.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?f.jsx(pe,{surface:"chalkboard",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.runs.length>0?e.runs.map(l=>f.jsx(qne,{run:l},l.workflow)):f.jsxs("span",{className:"text-xs text-desk-text-muted opacity-70",children:["No recent runs on ",e.branch,"."]}),f.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"]}),f.jsxs("div",{className:"flex flex-wrap gap-x-3 text-2xs",children:[e.releasePr&&f.jsxs("a",{href:e.releasePr.url,target:"_blank",rel:"noreferrer",className:Kp,children:["Release PR #",e.releasePr.number]}),f.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:Kp,children:"Open Actions"})]})]})}):f.jsx(pe,{surface:"chalkboard",size:"small",children:f.jsxs("p",{className:"m-0 text-center text-xs opacity-70",children:["CI status unavailable —"," ",f.jsx("a",{href:o,target:"_blank",rel:"noreferrer",className:Kp,children:"open Actions"})]})})};return f.jsxs("div",{children:[f.jsx("h4",{className:`${ch} m-0`,children:II}),i()]})},AI=async(e,t)=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error??t)}},Jne=async()=>{const e=await J(K("/api/services"));return e.ok?(await e.json()).services??[]:[]},Qne=async e=>{const t=await J(K(`/api/services/start?name=${encodeURIComponent(e)}`),{method:"POST"});await AI(t,"Failed to start service")},Xne=async e=>{const t=await J(K(`/api/services/stop?name=${encodeURIComponent(e)}`),{method:"POST"});await AI(t,"Failed to stop service")},ere=async e=>{const t=await J(K(`/api/services/logs?name=${encodeURIComponent(e)}`));return t.ok?(await t.json()).log??"":""};function tre(){const[e,t]=k.useState([]),[n,r]=k.useState(!0),s=k.useCallback(async()=>{try{t(await Jne())}catch{}finally{r(!1)}},[]);k.useEffect(()=>{s()},[s]),k.useEffect(()=>{let a;const l=()=>{a&&clearTimeout(a),a=setTimeout(s,80)},c=xc(u=>{(u.type==="service"||u.message==="changed")&&l()});return()=>{a&&clearTimeout(a),c()}},[s]);const i=k.useCallback(async a=>{await Qne(a),await s()},[s]),o=k.useCallback(async a=>{await Xne(a),await s()},[s]);return{services:e,loading:n,start:i,stop:o,refresh:s}}const nre=1500,RI="Services",rre=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",sre=({service:e})=>{const t=e.status==="running"?`running · ${e.health}`:e.status;return f.jsx("span",{role:"img","aria-label":t,className:`h-2 w-2 shrink-0 rounded-full ${rre(e)}`,title:t})},ire=({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 ere(e);i||r(l)};o();const a=t?setInterval(o,nre):void 0;return()=>{i=!0,a&&clearInterval(a)}},[e,t]),k.useEffect(()=>{const i=s.current;i&&n&&(i.scrollTop=i.scrollHeight)},[n]),f.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."})},ore=({service:e,onStart:t,onStop:n})=>{const{toast:r}=rt(),[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(d){r({title:l?"Failed to stop service":"Failed to start service",description:d.message,variant:"error"})}finally{i(!1)}}};return f.jsxs(pe,{surface:"chalkboard",size:"small",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("button",{type:"button",onClick:()=>a(d=>!d),"aria-expanded":o,className:"flex min-w-0 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",children:[f.jsx("span",{className:`shrink-0 text-desk-text-muted transition-transform ${o?"rotate-90":""}`,children:f.jsx(L8,{})}),f.jsx(sre,{service:e}),f.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&&f.jsxs("span",{className:"shrink-0 font-mono text-2xs text-desk-text-muted",children:[":",e.port]})]}),f.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s?f.jsx(Wr,{size:"small",surface:"chalkboard",label:"Working"}):!l||c?f.jsx(dt,{icon:l?f.jsx(R8,{}):f.jsx(A8,{}),surface:"chalkboard",size:"small",variant:"ghost",label:l?`Stop ${e.name}`:`Start ${e.name}`,onClick:u}):null})]}),o&&f.jsx(ire,{name:e.name,running:l})]})},are=()=>{const{services:e,start:t,stop:n}=tre(),r=k.useCallback(i=>t(i),[t]),s=k.useCallback(i=>n(i),[n]);return f.jsxs("div",{children:[f.jsx("h4",{className:`${ch} m-0`,children:RI}),f.jsx("div",{className:"flex flex-col gap-2",children:e.length>0?e.map(i=>f.jsx(ore,{service:i,onStart:r,onStop:s},i.name)):f.jsx(pe,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No services declared."})})})]})},lre=[RI,NI,II],cre=()=>f.jsx("div",{className:"flex flex-col gap-4","aria-hidden":"true",children:lre.map(e=>f.jsxs("div",{children:[f.jsx("div",{className:ch,children:e}),f.jsx(rn,{variant:"rect",width:"100%",height:28,surface:"chalkboard"})]},e))}),ure=()=>f.jsx("div",{className:"flex flex-1 items-center justify-center",children:f.jsxs("p",{className:"m-0 text-center text-xs text-desk-text-muted",children:["Desk isn't configured — add ",f.jsx("code",{children:"desk"})," to ",f.jsx("code",{children:"papercamp/config.json"}),"."]})}),dre=()=>{const{desk:e,loading:t}=Nne();return f.jsxs(f.Fragment,{children:[f.jsx(TP,{surface:"chalkboard"}),f.jsxs("div",{className:"flex flex-1 flex-col p-[var(--pc-stack-pad)]",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[f.jsx("h3",{className:`${_I} m-0`,children:"Desk"}),f.jsx(CI,{label:"Fetch from GitHub",refreshingLabel:"Fetching…",surface:"chalkboard"})]}),t?f.jsx(cre,{}):e?f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx(are,{}),f.jsx(Hne,{}),f.jsx(Yne,{})]}):f.jsx(ure,{})]})]})},fre=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,{panelRef:s,anyChecksFailing:i,agentActive:o}=bne(r,n,t);return f.jsxs(f.Fragment,{children:[!r&&f.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:f.jsx(dt,{icon:o?f.jsx(Wr,{size:"small",surface:"chalkboard",label:"Agent running"}):i?f.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)]"}):f.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)]":""}`})}),f.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:[f.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between px-[var(--pc-stack-pad)]",children:[f.jsx("h2",{className:"m-0 font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&f.jsx(dt,{icon:f.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"})]}),f.jsx(TP,{surface:"chalkboard"}),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[f.jsx(Tne,{}),f.jsx(dre,{})]})]})]})},d1=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=$ne();return f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n?f.jsx("img",{src:n,alt:"",className:`object-contain shrink-0 ${e==="sm"?"w-[18px] h-[18px]":"w-[20px] h-[20px]"}`}):f.jsx(B6,{icon:f.jsx(z4,{}),size:"small"}),f.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"})]})},hre="data-paper-camp-mount";function pre(e){return(e==null?void 0:e.getAttribute(hre))??""}const ha=typeof document>"u"?"":pre(document.getElementById("root")),mre=()=>{const e=nt();return ha!==""?f.jsx(d1,{size:"sm"}):f.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[f.jsx(d1,{size:"sm"}),f.jsx(re,{variant:"ghost",size:"small",className:"font-handwritten !text-sm opacity-70",onClick:()=>e({to:"/projects"}),children:"Back to projects"})]})},gre=()=>{const e=L(l=>l.setGithubConfig),[t,n]=k.useState(""),[r,s]=k.useState(""),[i,o]=k.useState(""),a=t.trim()!==""&&r.trim()!==""&&i.trim()!=="";return f.jsxs(pe,{size:"small",texture:"kraft",className:"mt-4 w-full max-w-sm text-left",children:[f.jsxs("p",{className:"m-0 mb-3 text-sm opacity-[0.65]",children:["No runtime reachable — paste a"," ",f.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."]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(un,{size:"small",label:"Owner",value:t,onChange:l=>n(l.target.value)}),f.jsx(un,{size:"small",label:"Repo",value:r,onChange:l=>s(l.target.value)}),f.jsx(un,{size:"small",type:"password",label:"Token",value:i,onChange:l=>o(l.target.value)})]}),f.jsx(re,{size:"small",className:"mt-3",disabled:!a,onClick:()=>e({owner:t.trim(),repo:r.trim(),token:i.trim()}),children:"Save"})]})},yre=({layer:e})=>f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 py-24 text-center",children:[f.jsx("p",{className:"font-handwritten text-lg",children:e==="corpus"?"This needs the runtime or a GitHub token":"This needs the runtime"}),f.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"&&f.jsx(gre,{})]}),xre=()=>{const[e,t]=k.useState(null);return k.useEffect(()=>{},[]),e?f.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},vre=({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]),f.jsxs(f.Fragment,{children:[n&&f.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}),f.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:[f.jsx("div",{className:"shrink-0 h-8"}),f.jsx("div",{className:"flex-1 overflow-y-auto relative",children:f.jsx("div",{children:t},e)})]})]})};function wre(){const e=L(u=>u.agentStatus),t=L(u=>u.gitStatus),n=L(u=>u.gitBranch),r=L(u=>u.gitAhead),s=L(xJ),i=L(vJ),o=L(wJ),a=L(u=>{var d;return((d=u.notifications)==null?void 0:d.filter(h=>h.kind==="question"||!h.read).length)??0}),l=nt(),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 Gp(e){return e==="allowed"?"allowed":/reject|block|exceed|denied/i.test(e)?"rejected":"warning"}function bre(e){return e<1e12?e*1e3:e}function kre(e){const t=[`Claude usage: ${e.status}`];return e.rateLimitType&&t.push(e.rateLimitType),e.resetsAt!==void 0&&t.push(`resets ${new Date(bre(e.resetsAt)).toLocaleTimeString()}`),e.overage&&t.push("overage on"),t.join(" · ")}const _re="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",Sre="flex items-center gap-3 shrink-0",Cre="flex items-center gap-1",jre="opacity-50",Ere="text-[var(--pui-text-primary)]",f1="opacity-60",Pre="flex-1",h1="flex items-center gap-2 shrink-0",p1="bg-transparent border-none p-0 cursor-pointer",Tre="relative inline-flex",Nre="absolute -top-1 -right-1 pointer-events-none",Ire=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,rateLimit:a,unreadNotificationCount:l,onOpenSetup:c,onOpenGit:u,onOpenNotifications:d,trailing:h})=>f.jsxs("div",{className:_re,style:Wo("kraft"),children:[f.jsxs("div",{className:Sre,children:[f.jsxs("span",{className:Cre,children:[f.jsx("span",{className:jre,children:f.jsx(fk,{size:12})}),f.jsx("code",{className:Ere,children:e??"no branch"})]}),t>0&&f.jsxs("span",{className:f1,children:["↑",t]}),f.jsx("span",{className:f1,children:n>0?`${n} changed`:"clean"}),r&&f.jsx(Wr,{size:"small",label:`Agent ${s}…`}),i&&f.jsx(ye,{content:"Sign in from Settings → Connections so agent tasks can run",children:f.jsx("button",{type:"button",onClick:c,className:p1,children:f.jsx(ce,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&f.jsx(ye,{content:"Some features are disabled — open Setup to fix",children:f.jsx("button",{type:"button",onClick:c,className:p1,children:f.jsxs(ce,{size:"small",variant:"warning",children:["Setup (",o,")"]})})}),a&&Gp(a.status)!=="allowed"&&f.jsx(ye,{content:kre(a),children:f.jsx(ce,{size:"small",variant:Gp(a.status)==="rejected"?"error":"warning",children:Gp(a.status)==="rejected"?"Claude limit reached":"Claude usage warning"})})]}),f.jsx("div",{className:Pre}),h&&f.jsx("div",{className:h1,children:h}),f.jsxs("div",{className:h1,children:[f.jsx(ye,{content:"Git",children:f.jsx(dt,{variant:"ghost",size:"small",icon:f.jsx(fk,{}),label:"Git",onClick:u})}),f.jsx(ye,{content:"Notifications",children:f.jsxs("span",{className:Tre,children:[f.jsx(dt,{variant:"ghost",size:"small",icon:f.jsx(M8,{}),label:"Notifications",onClick:d}),l>0&&f.jsx("span",{className:Nre,children:f.jsx(ce,{size:"small",variant:"warning",children:l})})]})})]})]}),Are=()=>{const e=wre();return f.jsx(Ire,{...e})},Rre=()=>{const e=nt(),t=uh(),n=EI(),r=L(l=>l.plans),s=Mne(),i=L(l=>l.activeDocTitle),o=L(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(Ri(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?f.jsx("div",{className:"-mt-6 mb-3",children:f.jsx(h8,{className:"font-handwritten !text-xs min-w-0",items:a})}):null},LI=({children:e,className:t=""})=>f.jsx("h1",{className:`text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1] ${t}`,children:e}),Lre=[{path:"/projects",label:"Projects"},{path:"/projects/reviews",label:"In review"},{path:"/projects/activity",label:"Agent activity"},{path:"/projects/ideas",label:"Ideas"}],Mre=({children:e})=>{const t=nt(),n=Qm({select:r=>r.location.pathname});return f.jsx(bP,{background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:f.jsx("div",{className:"h-full overflow-y-auto px-6 py-16",children:f.jsxs(Wx,{texture:{texture:"parchment"},className:"m-auto w-full max-w-lg",children:[f.jsx(LI,{children:"Paper Camp"}),f.jsx("nav",{"aria-label":"Hub navigation",className:"flex flex-wrap gap-1 mb-4",children:Lre.map(r=>f.jsx(re,{variant:"ghost",size:"small",isActive:n===r.path,onClick:()=>t({to:r.path}),"aria-current":n===r.path?"page":void 0,children:r.label},r.path))}),e]})})})};async function Vv(e,t){return(await Promise.all(e.map(async r=>{const s=await t(r.runtimeUrl);return s===null?null:{runtime:r,data:s}}))).filter(r=>r!==null)}function Uv(e,t){$N(e,window.localStorage),window.location.assign(t)}function $re(e,t){return e!==""||t!==""}async function Dre(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 Ore(e,t){return`${e}?runtime=${encodeURIComponent(t)}`}function Yi(e){try{return new URL(e).host}catch{return e}}function Wv(e){return e.label??Yi(e.runtimeUrl)}const zre=24*60*60*1e3;function Fre(){const[e,t]=k.useState([]),[n,r]=k.useState(!0);return k.useEffect(()=>{let s=!1;r(!0);const i=Gl(window.localStorage),o=Date.now()-zre;return Vv(i,B9).then(a=>{if(s)return;const l=a.flatMap(c=>c.data.map(u=>({runtime:c.runtime,data:u}))).filter(c=>new Date(c.data.startedAt).getTime()>=o).sort((c,u)=>u.data.startedAt.localeCompare(c.data.startedAt));t(l),r(!1)}),()=>{s=!0}},[]),{rows:e,loading:n}}function Bre(){const[e,t]=k.useState([]),[n,r]=k.useState(!0);return k.useEffect(()=>{let s=!1;r(!0);const i=Gl(window.localStorage);return Vv(i,q9).then(o=>{s||(t(o.flatMap(a=>a.data.entries.map(l=>({runtime:a.runtime,data:l})))),r(!1))}),()=>{s=!0}},[]),{rows:e,loading:n}}function Vre(){const[e,t]=k.useState([]),[n,r]=k.useState(!0);return k.useEffect(()=>{let s=!1;r(!0);const i=Gl(window.localStorage);return Vv(i,sW).then(o=>{s||(t(o.flatMap(a=>a.data.entries.filter(l=>l.status==="review"&&!!l.id).map(l=>({runtime:a.runtime,data:l})))),r(!1))}),()=>{s=!0}},[]),{rows:e,loading:n}}const Ure="0.23.2",MI=Ure,Wre={name:null,reachable:!1,remoteVersion:null,versionSkew:!1};function Hre(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([f9(o),c9(o)]),c=l===null?Wre:{name:a?FP(a):null,reachable:!0,remoteVersion:l,versionSkew:l!==MI};return[o,c]})).then(o=>{s||n(Object.fromEntries(o))}),()=>{s=!0}},[r]),t}const Kre={done:"success",error:"error",superseded:"neutral"},Gre=()=>{const{rows:e,loading:t}=Fre();return f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Agent activity, last 24 hours"}),t?f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Checking every registered project…"}):e.length===0?f.jsx("p",{className:"m-0 text-sm opacity-70",children:"No agent runs in the last 24 hours."}):f.jsx("div",{className:"flex flex-col gap-1",children:e.map(({runtime:n,data:r})=>f.jsx(mt,{size:"small",onClick:()=>{r.planId&&Uv(n.runtimeUrl,`/ideas/${r.planId}`)},action:f.jsx(ce,{size:"small",variant:Kre[r.outcome],children:r.outcome}),children:f.jsxs("span",{className:"flex flex-col gap-0.5 text-left",children:[f.jsx("span",{children:r.planTitle}),f.jsx("span",{className:"font-handwritten text-2xs opacity-60",children:Wv(n)})]})},`${n.runtimeUrl}:${r.id}`))})]})},Zre=({runtimeUrl:e,currentLabel:t,onRenamed:n})=>{const[r,s]=k.useState(!1),[i,o]=k.useState(t),a=()=>{s(!1),o(t)},l=()=>{sJ(e,i,window.localStorage),s(!1),n()};return f.jsxs(f.Fragment,{children:[f.jsx(re,{type:"button",variant:"ghost",size:"small",className:"shrink-0",onClick:c=>{c.stopPropagation(),s(!0)},children:"Rename"}),f.jsx(Ni,{open:r,onClose:a,title:"Rename project",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx(un,{label:"Name",value:i,onChange:c=>o(c.target.value),placeholder:"Project name",autoFocus:!0}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:a,children:"Cancel"}),f.jsx(re,{type:"button",variant:"primary",onClick:l,children:"Save"})]})]})})]})},$I=()=>{const[e,t]=k.useState(""),n=e.trim();return f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Add a project by URL"}),f.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Paste the address of a running ",f.jsx("code",{children:"paper-camp dev"})," this browser can reach — its LAN or tailnet address from another machine. ",f.jsx("code",{children:"localhost"})," only works on the machine running it."]}),f.jsx(un,{size:"small",label:"Runtime URL",placeholder:"http://localhost:3333",value:e,onChange:r=>t(r.target.value)}),f.jsx(re,{size:"small",disabled:n==="",onClick:()=>window.location.assign(Ore(window.location.pathname,n)),children:"Connect"})]})};async function qre(){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 Yre(e){return(await J(K("/api/github/device-token"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e})})).json()}const Hv="papercamp:github-hub-token";function Jre(){try{return localStorage.getItem(Hv)}catch{return null}}function m1(e){try{localStorage.setItem(Hv,e)}catch{}}function g1(){try{localStorage.removeItem(Hv)}catch{}}const Qre="https://api.github.com";async function DI(e,t){const n=await fetch(`${Qre}${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json"}});if(!n.ok){const r=await n.json().catch(()=>null);throw new kv((r==null?void 0:r.message)??`GitHub API error (${n.status})`,n.status)}return n.json()}async function Xre(e){const t=await DI(e,"/user");return{login:t.login,avatarUrl:t.avatar_url}}async function ese(e){const t=[];for(let n=1;;n++){const r=await DI(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}const Kv="paper-camp.hubRepos";function Gv(e){const t=e==null?void 0:e.getItem(Kv);if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n:[]}function tse(e){return Gv(e)}function nse(e,t){const n=Gv(t),r=n.includes(e)?n:[...n,e];return t==null||t.setItem(Kv,JSON.stringify(r)),r}function rse(e,t){const n=Gv(t).filter(r=>r!==e);return t==null||t.setItem(Kv,JSON.stringify(n)),n}const sse="https://github.com/settings/personal-access-tokens/new";async function Zp(e){const[t,n]=await Promise.all([Xre(e),ese(e)]);return{identity:t,repoNames:n}}function y1(e){return e instanceof kv?e.message:"Could not reach GitHub."}const ise=({state:e,error:t,onCancel:n})=>f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Sign in with GitHub"}),f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Enter this code on the GitHub tab that just opened:"}),f.jsxs("p",{className:"m-0 flex items-center gap-2 text-lg font-semibold tracking-widest",children:[e.userCode,f.jsx(Kd,{text:e.userCode})]}),t&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:t}),f.jsx(re,{size:"small",variant:"secondary",onClick:n,children:"Cancel"})]});function x1({repoName:e}){const t=e.indexOf("/");return t===-1?f.jsx("span",{className:"block truncate",title:e,children:e}):f.jsxs("span",{className:"flex min-w-0 items-center",title:e,children:[f.jsx("span",{className:"min-w-0 truncate",children:e.slice(0,t)}),f.jsx("span",{className:"shrink-0",children:e.slice(t)})]})}const ose=({connection:e,onDisconnect:t})=>{const[n,r]=k.useState(()=>tse(window.localStorage)),[s,i]=k.useState(""),o=new Set(n),a=s.trim().toLowerCase(),l=e.repoNames.filter(c=>!o.has(c)&&c.toLowerCase().includes(a));return f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("p",{className:"m-0 min-w-0 truncate font-semibold",title:`Connected as ${e.identity.login}`,children:["Connected as ",e.identity.login]}),f.jsx(re,{size:"small",variant:"secondary",className:"shrink-0",onClick:t,children:"Disconnect"})]}),n.length>0&&f.jsx("div",{className:"flex flex-col gap-1",children:n.map(c=>f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(mt,{size:"small",className:"min-w-0 flex-1",children:f.jsx(x1,{repoName:c})}),f.jsx(dt,{variant:"danger",size:"small",className:"shrink-0","aria-label":`Remove ${c}`,icon:f.jsx(ra,{size:14}),onClick:()=>r(rse(c,window.localStorage))})]},c))}),f.jsx(un,{type:"search",size:"small",placeholder:"Search repositories…","aria-label":"Search repositories",value:s,onChange:c=>i(c.target.value)}),f.jsx("div",{className:"flex max-h-[160px] flex-col gap-1 overflow-y-auto",children:l.length===0?f.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=>f.jsx(mt,{size:"small",className:"min-w-0",onClick:()=>r(nse(c,window.localStorage)),children:f.jsx(x1,{repoName:c})},c))})]})},OI=()=>{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,d]=k.useState(!1),h=k.useRef(null);k.useEffect(()=>{const x=Jre();x&&(i(!0),Zp(x).then(w=>r(w)).catch(()=>{g1(),a("That token no longer works — reconnect below.")}).finally(()=>i(!1)))},[]);const p=()=>{const x=e.trim();x!==""&&(i(!0),a(null),Zp(x).then(w=>{m1(x),r(w),t("")}).catch(w=>a(y1(w))).finally(()=>i(!1)))},m=()=>{g1(),r(null),a(null)},g=async(x,w)=>{if(await new Promise(_=>setTimeout(_,w*1e3)),h.current!==x)return;const b=await Yre(x);if(h.current===x){if(b.access_token){h.current=null,m1(b.access_token);try{r(await Zp(b.access_token))}catch(_){a(y1(_))}c(null);return}if(b.error==="authorization_pending"){await g(x,w);return}if(b.error==="slow_down"){await g(x,b.interval??w+5);return}h.current=null,c(null),a(b.error_description??"GitHub sign-in did not complete.")}},v=()=>{d(!0),a(null),qre().then(x=>{h.current=x.device_code,window.open(x.verification_uri,"_blank","noopener,noreferrer"),c({userCode:x.user_code,deviceCode:x.device_code,verificationUri:x.verification_uri}),g(x.device_code,x.interval)}).catch(()=>a("Could not reach GitHub.")).finally(()=>d(!1))},y=()=>{h.current=null,c(null),a(null)};return n?f.jsx(ose,{connection:n,onDisconnect:m}):l?f.jsx(ise,{state:l,error:o,onCancel:y}):f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-1 flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Connect GitHub"}),f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Sign in to browse and plan against your repositories."}),f.jsx(re,{size:"small",disabled:u,onClick:v,children:u?"Starting…":"Sign in with GitHub"}),f.jsxs("p",{className:"m-0 text-sm opacity-70",children:["Or mint a"," ",f.jsx("a",{href:sse,target:"_blank",rel:"noopener noreferrer",children:"fine-grained token"})," ","scoped to the repositories you want to browse and plan, then paste it in."]}),f.jsx(un,{size:"small",type:"password",label:"Token",value:e,onChange:x=>t(x.target.value)}),o&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),f.jsx(re,{size:"small",variant:"secondary",disabled:e.trim()===""||s,onClick:p,children:s?"Connecting…":"Connect"})]})};function ase(e){$N(e,window.localStorage),window.location.assign(ha||"/")}function lse({status:e}){return e?e.reachable?e.versionSkew?f.jsx(ye,{content:`Runtime is on ${e.remoteVersion}, this client is on ${MI}`,children:f.jsx(ce,{size:"small",variant:"warning",children:"Version mismatch"})}):f.jsx(ce,{size:"small",variant:"success",children:"Can execute"}):f.jsx(ce,{size:"small",variant:"info",children:"Plan-only"}):f.jsx(ce,{size:"small",variant:"neutral",children:"Checking…"})}const cse=({runtimes:e,onChange:t})=>{const n=Hre(e);return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Projects"}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>{const s=n[r.runtimeUrl],i=r.label??(s==null?void 0:s.name);return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(mt,{size:"small",className:"min-w-0 flex-1",onClick:()=>ase(r.runtimeUrl),action:f.jsx(lse,{status:s}),children:i?f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5 text-left",children:[f.jsx("span",{className:"truncate",title:i,children:i}),f.jsx("span",{className:"truncate font-handwritten text-2xs opacity-60",title:Yi(r.runtimeUrl),children:Yi(r.runtimeUrl)})]}):f.jsx("span",{className:"block truncate",title:Yi(r.runtimeUrl),children:Yi(r.runtimeUrl)})}),f.jsx(Zre,{runtimeUrl:r.runtimeUrl,currentLabel:r.label??(s==null?void 0:s.name)??"",onRenamed:t}),f.jsx(dt,{variant:"danger",size:"small",className:"shrink-0","aria-label":`Remove ${i??Yi(r.runtimeUrl)}`,icon:f.jsx(ra,{size:14}),onClick:o=>{o.stopPropagation(),iJ(r.runtimeUrl,window.localStorage),t()}})]},r.runtimeUrl)})})]}),f.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row",children:[f.jsx(OI,{}),f.jsx($I,{})]})]})},use=()=>f.jsxs("div",{className:"flex flex-col gap-6",children:[f.jsx("p",{className:"m-0 text-center text-sm opacity-70",children:"Nothing is open yet — connect GitHub, or add a project by its runtime URL."}),f.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row",children:[f.jsx(OI,{}),f.jsx($I,{})]})]}),v1=typeof window>"u"?null:window.localStorage,dse=()=>{const[e,t]=k.useState(()=>Gl(v1));return e.length===0?f.jsx(use,{}):f.jsx(cse,{runtimes:e,onChange:()=>t(Gl(v1))})},fse=()=>{const{rows:e,loading:t}=Bre(),[n,r]=k.useState(""),s=k.useMemo(()=>{const i=n.trim().toLowerCase();return i===""?e:e.filter(({data:o})=>o.title.toLowerCase().includes(i))},[e,n]);return f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Ideas"}),f.jsx(un,{size:"small",label:"Search",placeholder:"Search every registered project's ideas…",value:n,onChange:i=>r(i.target.value)}),t?f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Checking every registered project…"}):s.length===0?f.jsx("p",{className:"m-0 text-sm opacity-70",children:e.length===0?"No ideas found across your registered projects.":"No matches."}):f.jsx("div",{className:"flex flex-col gap-1",children:s.map(({runtime:i,data:o})=>f.jsx(mt,{size:"small",onClick:()=>{o.id&&Uv(i.runtimeUrl,`/ideas/${o.id}`)},action:f.jsx(ce,{size:"small",variant:"neutral",children:Wv(i)}),children:o.title},`${i.runtimeUrl}:${o.id??o.title}`))})]})},hse=()=>{const{rows:e,loading:t}=Vre();return f.jsxs(pe,{size:"small",texture:"kraft",className:"flex flex-col gap-2 text-left",children:[f.jsx("p",{className:"m-0 font-semibold",children:"In review"}),t?f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Checking every registered project…"}):e.length===0?f.jsx("p",{className:"m-0 text-sm opacity-70",children:"Nothing in review across your registered projects."}):f.jsx("div",{className:"flex flex-col gap-1",children:e.map(({runtime:n,data:r})=>f.jsx(mt,{size:"small",onClick:()=>Uv(n.runtimeUrl,`/ideas/${r.id}`),action:f.jsx(ce,{size:"small",variant:"info",children:Wv(n)}),children:r.title},`${n.runtimeUrl}:${r.id}`))})]})},w1=(e,t)=>{var n;return((n=e.find(r=>r.name===t))==null?void 0:n.status)??"stale"};function zI(e,t){var n;return{qualityStatus:w1(t,"lint"),testStatus:w1(t,"test"),consistencyStatus:((n=e==null?void 0:e.consistency)==null?void 0:n.status)??"stale"}}const pse=()=>{const e=L(g=>g.status),t=L(g=>g.runConsistencyCheck),{checks:n,run:r}=vc(),s=L(g=>g.consistency),i=L(g=>g.plans),o=nt(),[a,l]=k.useState(!1),{qualityStatus:c,testStatus:u,consistencyStatus:d}=k.useMemo(()=>zI(e,n),[e,n]),h=c==="running"||u==="running"||d==="running",p=s.length>0,m=k.useCallback(g=>g.planId?i==null?void 0:i.entries.find(v=>v.id===g.planId):void 0,[i==null?void 0:i.entries]);return{qualityStatus:c,testStatus:u,consistencyStatus:d,anyRunning:h,hasDocIssues:p,consistency:s,docsExpanded:a,setDocsExpanded:l,navigate:o,runDeskCheck:r,runConsistencyCheck:t,linkedPlanFor:m}},qp=new Map,b1=new Map,mse=e=>`commit-draft:${e}`;function gse(e,t){const{formKey:n,suggestedTitle:r,matchesSuggestionTask:s,beforeCommit:i}=t,o=L(N=>N.agentStatus),a=L(N=>N.loadGitStatus),l=L(N=>N.loadDiffFiles),c=L(N=>N.commitInFlight),u=L(N=>N.setCommitInFlight),{toast:d}=rt(),[h,p]=k.useState(""),[m,g]=k.useState(""),[v,y]=k.useState(!1),[x,w]=k.useState(!1),[b,_]=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=mse(n);k.useEffect(()=>{const N=pc(E);p((N==null?void 0:N.title)??""),g((N==null?void 0:N.message)??"")},[E]),k.useEffect(()=>{!h&&!m||mc(E,{title:h,message:m})},[E,h,m]),k.useEffect(()=>{const N=qp.get(n)??Date.now();qp.set(n,N);const A=b1.get(n)??new Set,R=o.find($=>s($)&&$.suggestedCommit&&!A.has($.id)&&($.lastStreamAt??0)>N);R!=null&&R.suggestedCommit&&(A.add(R.id),b1.set(n,A),p(R.suggestedCommit.title),g(R.suggestedCommit.message))},[o,n,s]);const T=k.useCallback(async()=>{if(!h.trim()||c)return;y(!0),u(!0);let N;try{const A=i?await i(h.trim()):void 0;N=A==null?void 0:A.onFailure;const R=A==null?void 0:A.extraPath;if(j>0)R&&await K8(R),await Tg([],h.trim(),m.trim()||void 0);else{const $=R&&!S.includes(R)?[...S,R]:S;await Tg($,h.trim(),m.trim()||void 0)}p(""),g(""),qp.set(n,Date.now()),Cv(E),await Promise.all([a(),l()])}catch(A){N&&await N(),d({title:"Commit failed",description:Ge(A.message),variant:"error"}),await Promise.all([a(),l()])}finally{y(!1),u(!1)}},[h,m,S,j,a,l,c,u,d,n,E,i]),P=k.useCallback(async()=>{if(S.length!==0){w(!0),_(null);try{const N=await DP(S);p(N.title),g(N.message)}catch(N){_(N.message)}finally{w(!1)}}},[S]);return{commitTitle:h,setCommitTitle:p,commitMessage:m,setCommitMessage:g,committing:v,commitInFlight:c,stagedCount:j,suggesting:x,suggestError:b,setSuggestError:_,handleCommit:T,handleSuggestFromChanges:P}}const wc=()=>{const e=L(a=>a.loadPlans),t=L(a=>a.runtimeReachable),n=L(a=>a.githubConfig),{toast:r}=rt(),[s,i]=k.useState(!1);return{patch:async(a,l,c)=>{i(!0);try{return!t&&n?await aY(n,a,l):await iW(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}},yse=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function xse(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=>yse.includes(s)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const vse=(e,t)=>{const n=L(v=>v.status),{checks:r}=vc(),s=L(sh),i=L(v=>v.launchRunAll),{patch:o}=wc(),[a,l]=k.useState(!1),{title:c}=k.useMemo(()=>xse(e),[e]),u=k.useMemo(()=>t.map(v=>v.path),[t]),d=k.useCallback(async v=>{if(!e.id||WY(u))return{};const y=e.id;return await o(e.title,{phases:UY(e.phases,v)})?{extraPath:HY(y),onFailure:async()=>{await o(e.title,{phases:e.phases})}}:{}},[e,u,o]),h=k.useCallback(v=>v.planId===e.id,[e.id]),p=gse(t,{formKey:e.id??"__plan-draft__",suggestedTitle:c,matchesSuggestionTask:h,beforeCommit:d}),m=!!e.id&&!s,g=k.useCallback(async()=>{if(!e.id||!n||a||s)return;const v=e.id;l(!0);try{const y=FY(e.fixes??[],n,r);await o(e.title,{fixes:y})&&await i(v)}finally{l(!1)}},[e,a,s,n,r,o,i]);return{...p,canFix:m,fixing:a,handleFix:g}},wse=3*6e4,bse=(e,t)=>{const n=L(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(()=>{N9(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},wse);return()=>clearTimeout(o)},[t,i,s,n])},kse=e=>{const t=L(a=>a.loadPlans),{toast:n}=rt(),[r,s]=k.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await mk(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 HP(l);return await mk(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 _se(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:d}=kse(e);bse(e,!0);const h=GY(e);return k.useEffect(()=>{r(pc(h)??"")},[h]),k.useEffect(()=>{n&&mc(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)?Cv(h):r(x=>x||y),i(null))},handlePromote:(y,x)=>{x==="idea"?a(y):u(y,x)},handlePromoteToIdea:async y=>{o!==null&&await d(o,y)&&a(null)},closeIdeaPrompt:()=>a(null)}}const Sse=()=>{const e=L(T=>T.plans),t=L(T=>T.plansError),n=L(T=>T.ideaEntries),r=L(T=>T.suggestions),s=L(T=>T.setDetailView),i=L(T=>T.planFilters),o=L(T=>T.setSubjectFilter),a=L(T=>T.dismissSuggestion),l=uh(),c=EI(),{planId:u,ideaId:d}=Ti({strict:!1}),h=nt(),p=PI(),{toast:m}=rt(),{subject:g}=cx({strict:!1});k.useEffect(()=>{o(g??null)},[g,o]);const v=u??d,y=k.useRef(v);k.useEffect(()=>{y.current!==v&&s("details"),y.current=v},[v,s]);const x=()=>{h({to:"/"})},w=T=>{var N;const P=(N=e==null?void 0:e.entries.find(A=>A.title===T))==null?void 0:N.id;p(P,T)},b=T=>{var N;const P=(N=n.find(A=>A.title===T))==null?void 0:N.id;h({to:"/ideas/$ideaId",params:{ideaId:jI(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:d,openSuggestion:S,setOpenSuggestion:j,handleBack:x,handleOpenPlan:w,handleOpenIdea:b,handleOpenArchivable:_,handleDismissSuggestion:async T=>{try{await a(T)}catch(P){m({title:"Failed to dismiss suggestion",description:P.message,variant:"error"})}}}},sy=.95,Cse=3e4,iy={implement:{from:0,to:.6},verify:{from:.6,to:.9},checkbox:{from:.95,to:.95}};function jse(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 Ese(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=jse(t),r={};for(const s of["implement","verify"]){const i=iy[s].to-iy[s].from;r[s]=n*i/sy}return r}function Pse({anchor:e,anchorEnteredAt:t,lastStreamAt:n,now:r,medians:s}){if(!e)return 0;const i=iy[e],o=Math.min(i.from,sy),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+Cse),c=Math.min(1,Math.max(0,l-t)/a);return Math.min(i.from+c*(i.to-i.from),sy)}const Tse=new Set(["starting","running","stopping"]),Nse=1e3;function Ise(e,t){const n=e!==void 0&&e.phaseIndex!==void 0&&Tse.has(e.status),[r,s]=k.useState(()=>Date.now());return k.useEffect(()=>{if(!n)return;const i=setInterval(()=>s(Date.now()),Nse);return()=>clearInterval(i)},[n]),!n||(e==null?void 0:e.phaseIndex)===void 0?null:{index:e.phaseIndex,fraction:Pse({anchor:e.phaseAnchor,anchorEnteredAt:e.anchorEnteredAt,lastStreamAt:e.lastStreamAt,now:r,medians:Ese(t)})}}const Ase=(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 d=>{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 T9(e.id,d,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:d}=await I9(e.id,a.commitSha);if(d){n({title:"Undo failed",description:Ge(d),variant:"error"});return}l(null),await t()}catch(d){n({title:"Undo failed",description:Ge(d.message),variant:"error"})}finally{o(!1)}}}}},Rse=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()},Lse=e=>{const[t,n]=k.useState(null);return k.useEffect(()=>{if(n(null),!e)return;let r=!1;return Rse(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t},Mse=()=>{const[e,t]=k.useState(new Set);return k.useEffect(()=>{let n=!1;return VP().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},Zv="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.",FI="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 $se(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
- ${Zv}
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 Dse(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 Ose(){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 qv(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
- ${Zv}
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 zse(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 qv(e,"expanding",n,r)}const BI=`- the YAML frontmatter (id, title, status)
367
- - the original body prose beneath the frontmatter`;function Fse(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 qv(e,"fleshing out",t,BI)}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 qv(e,"fleshing out",n,BI)}function Bse(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
- ${Zv}
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. (${FI} 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 Vse(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. ${FI} 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 VI={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},bc={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"}},UI={open:"Open",done:"Done",dropped:"Dropped"},of={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"}},Use={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},k1={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"}},Wse={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},_1={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"}},S1=({pr:e,reviewing:t})=>{const n=L(s=>{var i;return((i=s.status)==null?void 0:i.prFetchedAt)??null}),r=f.jsx(ce,{size:"small",fillColor:k1[e.state].fill,textColor:k1[e.state].text,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx($8,{}),"#",e.number," ",Use[e.state]]})});return f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"no-underline inline-flex",children:n!=null?f.jsx(ye,{content:`Fetched from GitHub ${SN(n)}`,children:r}):r}),t&&f.jsx(Wr,{size:"small",label:`Reviewing PR #${e.number}`})]})},Hse=e=>{const{subjects:t,loading:n,available:r}=TI(),s=Mse(),i=nt(),o=L(g=>g.planFilters.sortKey),a=L(g=>g.planFilters.sortDirection),l=L(g=>g.planFilters.groupBySubject),c=L(g=>g.setPlanSortKey),u=L(g=>g.togglePlanSortDirection),d=g=>{g===o?u():c(g)},h=jY(e,a,n||!r?void 0:t),p=l&&h.length>1;return{roadmapItemNames:s,navigate:i,sortKey:o,sortDirection:a,handleSort:d,groups:h,showSubjectHeaders:p,sortReflectsRows:!p}};function WI(){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 HI=({idea:e,otherPlans:t,className:n=""})=>{const r=L(h=>h.launchPlanDraft),s=L(Hr),{state:i,errorMessage:o,run:a}=WI(),{toast:l}=rt(),c=()=>{const h=e.id;h&&a(async()=>{try{await r(h,Bse(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",d=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 f.jsx(ye,{content:d,children:f.jsx(re,{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})})},Kse=({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]),f.jsxs("div",{children:[f.jsx("div",{ref:r,className:s?void 0:`line-clamp-[${t}]`,children:e}),o&&f.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"})]})},Gse=({count:e})=>{const t=nt();return f.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"]})},Zse={pass:"success",fail:"error",running:"warning",stale:"neutral"},Yp=({label:e,status:t,title:n,anyRunning:r,onClick:s})=>f.jsx(ye,{content:n,children:f.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:f.jsxs(ce,{size:"small",variant:Zse[t],children:[e,f.jsx("span",{className:t==="running"?"visible":"invisible",children:"…"})]})})}),qse=()=>{const{qualityStatus:e,testStatus:t,consistencyStatus:n,anyRunning:r,hasDocIssues:s,consistency:i,docsExpanded:o,setDocsExpanded:a,navigate:l,runDeskCheck:c,runConsistencyCheck:u,linkedPlanFor:d}=pse();return f.jsx("div",{className:"flex flex-col items-center gap-2",children:f.jsxs("div",{className:"flex flex-wrap items-start justify-center gap-2",children:[f.jsx(Yp,{label:"Quality",status:e,title:"Code style & formatting (Biome lint + format). Click to run.",anyRunning:r,onClick:()=>c("lint")}),f.jsx(Yp,{label:"Tests",status:t,title:"Unit tests (Vitest). Click to run.",anyRunning:r,onClick:()=>c("test")}),f.jsx(Yp,{label:"Consistency",status:n,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",anyRunning:r,onClick:()=>u()}),f.jsxs("div",{children:[f.jsx(ye,{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:f.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:f.jsx(ce,{size:"small",variant:s?"error":"success",children:"Docs"})})}),o&&s&&f.jsx("div",{id:"deliver-doc-findings",className:"mt-2 flex flex-col gap-2",children:i.map((h,p)=>{const m=d(h);return f.jsx("div",{className:"font-mono text-2xs opacity-70",children:m?f.jsx("button",{type:"button",onClick:()=>l(Ri(m)),className:"bg-none bg-transparent border-none p-0 underline cursor-pointer [font:inherit] text-left",children:h.message}):f.jsx("span",{className:"text-left",children:h.message})},`${h.kind}-${h.title}-${p}`)})})]}),f.jsx(CJ,{})]})})},C1=({label:e,disabled:t,onClick:n})=>f.jsx(re,{size:"small",disabled:t,onClick:n,children:e}),Yse=({state:e,filesEmpty:t})=>{const n=L(u=>u.status),{checks:r}=vc(),{qualityStatus:s,testStatus:i,consistencyStatus:o}=k.useMemo(()=>zI(n,r),[n,r]);if(s==="fail"||i==="fail"||o==="fail"){const u=e.fixing?"Fixing…":"Fix";return f.jsx(C1,{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 f.jsx(C1,{label:c,disabled:t||!e.commitTitle.trim()||l,onClick:e.handleCommit})},Jse=()=>{const e=L(t=>t.gitAhead);return f.jsxs("div",{className:"flex flex-col items-center gap-3",children:[f.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."}),f.jsx(EJ,{})]})},Qse={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},Xse=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>f.jsx(f.Fragment,{children:e.map((o,a)=>{const l=Qse[o.kind],c=o.from==="agent",u=a===e.length-1,d=[{id:"decision",label:"Promote to decision",icon:f.jsx(SP,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:f.jsx(Kx,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:f.jsx(_P,{size:16}),onSelect:()=>s==null?void 0:s(a,"idea")}];return f.jsxs("div",{className:`flex flex-col gap-1 ${c?"items-start":"items-end"}`,children:[f.jsx("div",{className:"max-w-[85%]",children:f.jsx(pe,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:f.jsx(Kse,{collapsedLines:o.kind==="chat"?1:3,resetKey:`${o.kind}-${o.date??""}-${a}`,children:o.text})})}),f.jsxs("div",{className:"flex items-center gap-2",children:[c&&f.jsx(ce,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&f.jsx(ye,{content:"Revert this run's plan edit",children:f.jsx(re,{size:"small",variant:"ghost",onClick:r,disabled:n,children:n?"Undoing…":"Undo"})}),o.date&&f.jsx("span",{className:"text-sm font-semibold opacity-[0.45]",children:o.date}),l&&f.jsx(ce,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?f.jsx(Wr,{size:"small",label:"Promoting…"}):f.jsx(IP,{align:"end",trigger:f.jsx(dt,{icon:f.jsx(LP,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:d}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),eie=({planId:e,phaseIndex:t,disabled:n})=>{const r=L(u=>u.launchAgent),s=L(Hr),{toast:i}=rt(),[o,a]=k.useState(!1),l=async u=>{if(u.stopPropagation(),!!e){a(!0);try{await r(e,t)}catch(d){i({title:"Failed to start agent",description:Ge(d.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 f.jsx(dt,{icon:f.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"})},tie=({row:e,runningFill:t,updating:n,onTogglePhase:r,onToggleFix:s})=>eh(e,t)?f.jsx(Wr,{size:"small"}):f.jsx(kP,{checked:e.item.done,onChange:()=>e.kind==="phase"?r(e.index):s(e.index),disabled:n}),nie=({row:e,runningFill:t})=>f.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:[f.jsx("span",{title:e.item.text,className:"overflow-hidden text-ellipsis whitespace-nowrap font-handwritten text-base leading-tight",children:e.item.text}),eh(e,t)&&f.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"&&f.jsx(ce,{size:"small",fillColor:hn.review.fill,textColor:hn.review.text,children:"review"}),e.kind==="phase"&&e.item.source==="manual"&&f.jsx(ce,{size:"small",variant:"neutral",children:"manual"}),e.kind==="fix"&&f.jsx(ce,{size:"small",variant:"warning",children:"fix"})]}),rie=({row:e,runningFill:t,agentBusy:n,planId:r})=>{if(eh(e,t))return null;if(e.item.done){const s=e.item.run;return s?f.jsx("div",{className:"flex w-full justify-end [container-type:inline-size]",children:f.jsx(ce,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:f.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[f.jsxs("span",{children:[Ar(s.inputTokens+s.outputTokens)," tokens"]}),f.jsxs("span",{className:"run-meta-full",children:[" ","· ",Gf(s.durationMs),s.attempts>1&&` ×${s.attempts}`,s.model&&` · ${s.model}`]})]})})}):null}return e.kind!=="phase"?null:f.jsx("div",{className:"flex justify-end",children:f.jsx(eie,{planId:r,phaseIndex:e.index,disabled:n})})},Vs=({id:e})=>e?f.jsx(ce,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,KI=({pct:e,color:t,height:n=6})=>f.jsx(d6,{value:e,color:t,height:n}),j1=({pr:e})=>{const{reviewDecision:t,unresolvedThreadCount:n,hasNewCommentsSincePush:r}=e;return!t&&!n?null:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[t&&f.jsx(ce,{size:"small",fillColor:_1[t].fill,textColor:_1[t].text,children:Wse[t]}),!!n&&f.jsxs(ce,{size:"small",fillColor:hn["in-progress"].fill,textColor:hn["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},E1={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},P1={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},ku=({reached:e,label:t,tooltip:n,href:r})=>{const s=f.jsx(ce,{size:"small",fillColor:e?E1.fill:P1.fill,textColor:e?E1.text:P1.text,children:t}),i=r?f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",onClick:o=>o.stopPropagation(),className:"no-underline inline-flex",children:s}):s;return n?f.jsx(ye,{content:n,children:i}):i},Jp=()=>f.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),T1=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function sie(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const iie=({trail:e,released:t,reviewing:n,reviewNote:r})=>{var u,d;const{taskRuns:s,commits:i,pr:o,releaseLine:a}=e,l=a.data?sie(a.data):void 0,c=t?`Released ${t}`:l?`Released ${l.hash}`:"Release";return f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(ku,{reached:s.reached,label:s.data?T1(s.data.length,"task run"):"Tasks",tooltip:(u=s.data)==null?void 0:u.map(h=>h.taskKind).join(", ")}),f.jsx(Jp,{}),f.jsx(ku,{reached:i.reached,label:i.data?T1(i.data.length,"commit"):"Commits",tooltip:(d=i.data)==null?void 0:d.join(`
421
- `)}),f.jsx(Jp,{}),o.data?r&&!n?f.jsx(ye,{content:r,children:f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(S1,{pr:o.data,reviewing:n}),f.jsx(j1,{pr:o.data})]})}):f.jsxs(f.Fragment,{children:[f.jsx(S1,{pr:o.data,reviewing:n}),!n&&f.jsx(j1,{pr:o.data})]}):f.jsx(ku,{reached:!1,label:"PR"}),f.jsx(Jp,{}),f.jsx(ku,{reached:a.reached||!!t,label:c,tooltip:a.data,href:l==null?void 0:l.url})]})},GI=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=k.useState(""),[o,a]=k.useState(""),[l,c]=k.useState(!1),[u,d]=k.useState(!1),[h,p]=k.useState(!1),[m,g]=k.useState(null),[v,y]=k.useState(null),[x,w]=k.useState(!1),[b,_]=k.useState(null),[S,j]=k.useState(null),E=L(O=>{var M;return((M=O.plans)==null?void 0:M.entries)??[]}),{patch:T}=wc();nt();const P=PI(),N=One(s,E.map(O=>({id:O.id,title:O.title,body:O.body,tags:O.tags,log:O.log})));k.useEffect(()=>{e&&(i(""),a(r??""),c(!1),d(!1),p(!1),g(null),w(!1),_(null),j(null))},[e,r]);const A=(O,M)=>{t(),P(O,M)},R=async()=>{const O=`${s.trim()}${o.trim()?`
422
-
423
- ${o.trim()}`:""}`;if(O){w(!0),j(null),_(null);try{const M=E.map(V=>({id:V.id,title:V.title,body:V.body,tags:V.tags}));_(await X9(O,M))}catch(M){j(M.message)}finally{w(!1)}}},$=O=>{const M=E.find(V=>V.id===O);M&&A(M.id,M.title)},D=async(O,M,V)=>{y(O);const U={date:new Date().toISOString().slice(0,10),text:s.trim()},Q=await T(M,{log:[...V??[],U]},{errorTitle:"Extend failed"});y(null),Q&&t()},F=async O=>{if(O.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(M){g(M.message)}finally{p(!1)}}};return f.jsx(Ni,{open:e,onClose:t,title:"New idea",size:"small",children:f.jsxs("form",{onSubmit:F,className:"flex flex-col gap-4",children:[f.jsx(un,{label:"Title",value:s,onChange:O=>i(O.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&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"text-sm opacity-60 font-semibold",children:"Similar ideas"}),N.map(({candidate:O})=>{const M={id:O.id??null,title:O.title,body:O.body,log:O.log},V=E.filter(C=>C.id!==O.id);return f.jsx(pe,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Vs,{id:O.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:O.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",size:"small",onClick:()=>A(O.id,O.title),children:"Open it"}),f.jsx(re,{type:"button",variant:"ghost",size:"small",disabled:!O.id||!s.trim()||v!==null,onClick:()=>O.id&&D(O.id,O.title,O.log),children:v===O.id?"Extending…":"Extend it instead"}),f.jsx(HI,{idea:M,otherPlans:V})]})]})},O.id??O.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(re,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||x,onClick:R,children:x?"Checking overlap…":"Check overlap"})}),S&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:S}),b&&f.jsx(pe,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:b.verdict==="new"?"Looks genuinely new":b.verdict==="extend"?`Extends ${b.targetId??"an existing idea"}`:`Belongs inside ${b.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:b.reasoning}),b.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(re,{type:"button",variant:"ghost",size:"small",onClick:()=>$(b.targetId),children:"Open it"})})]})})]}),f.jsx(Hx,{label:"Description",value:o,onChange:O=>a(O.target.value),placeholder:"Optional details…",disabled:h,rows:4}),f.jsx(Eg,{label:"Just a note (no plan needed)",checked:l,onChange:O=>{c(O.target.checked),O.target.checked&&d(!1)},disabled:h}),f.jsx(Eg,{label:"Board (decomposes into tickets instead of phases)",checked:u,onChange:O=>{d(O.target.checked),O.target.checked&&c(!1)},disabled:h}),m&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:m}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:t,disabled:h,children:"Cancel"}),f.jsx(re,{type:"submit",variant:"primary",disabled:!s.trim()||h,children:"Add"})]})]})})},oie=({open:e,onClose:t,onConfirm:n})=>{const r=L(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,d]=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),d(null)}},[e]);const h=m=>{a(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},p=async()=>{c(!0),d(null);try{await n([...o]),t()}catch(m){d(m.message)}finally{c(!1)}};return f.jsx(Ni,{open:e,onClose:t,title:"Draft all",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.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&&f.jsx("div",{className:"flex max-h-[16rem] flex-col gap-2 overflow-y-auto",children:s.map(m=>f.jsx(kP,{label:m.title,checked:o.has(m.id),onChange:()=>h(m.id)},m.id))}),u&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:u}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Cancel"}),f.jsx(re,{type:"button",variant:"primary",onClick:p,disabled:l||o.size===0,children:l?"Starting…":`Draft ${o.size}`})]})]})})},aie=({suggestion:e,onClose:t})=>{const n=L(u=>u.promoteSuggestion),r=L(u=>u.launchIdeaExtend),[s,i]=k.useState(!1),[o,a]=k.useState(null),{toast:l}=rt();k.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),d=L.getState().ideaEntries.find(h=>h.id===u);if(d)try{await r(u,Fse(d))}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 f.jsx(Ni,{open:e!==null,onClose:t,title:(e==null?void 0:e.title)??"",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx("p",{className:"m-0 opacity-80",children:e==null?void 0:e.description}),o&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),f.jsx(re,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},Qp=({tokens:e})=>f.jsx(f.Fragment,{children:e.map((t,n)=>{if(t.type==="same")return f.jsx("span",{children:t.text},`${t.type}-${n}`);const r=t.type==="added";return f.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}`)})}),N1=e=>f.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),lie=({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??""))),d=i||a,h=async()=>{if(!d){o(!0);try{await r()}finally{o(!1)}}},p=async()=>{l(!0);try{await n()}finally{l(!1)}};return f.jsx(Ni,{open:!0,title:s?`Review reconcile changes (${s.index} of ${s.total})`:"Review reconcile changes",size:"large",onClose:d?()=>{}:h,children:f.jsxs("div",{className:"flex flex-col gap-5",children:[f.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&&f.jsx("p",{className:"text-sm m-0 opacity-60",children:"No wording changed."}),c&&f.jsxs("div",{children:[N1("Body"),f.jsx("p",{className:"text-base m-0 leading-normal",children:f.jsx(Qp,{tokens:Np(t.body,e.body)})})]}),u.length>0&&f.jsxs("div",{children:[N1("Phases"),f.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:g,index:v})=>f.jsxs("div",{className:"text-sm leading-normal",children:[f.jsx(Qp,{tokens:Np(g.text,m.text)}),(m.description||g.description)&&f.jsx("div",{className:"opacity-[0.85] mt-1",children:f.jsx(Qp,{tokens:Np(g.description??"",m.description??"")})})]},v))})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{variant:"danger",size:"small",onClick:h,disabled:d,children:"Discard"}),f.jsx(re,{variant:"primary",size:"small",onClick:p,disabled:d,children:"Approve"})]})]})})},dh=({order:e,done:t,running:n,status:r,fallback:s})=>f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?f.jsx(Wr,{size:"small",label:"Agent running"}):t?f.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?s?f.jsx(ye,{content:"Queue position based on a status guess — GitHub's PR state couldn't be resolved",children:f.jsx(ce,{size:"small",variant:"warning",dot:!0,children:f.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})})}):f.jsx(ce,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:f.jsx("span",{className:"font-handwritten text-xs leading-none",children:e})}):r==="idea"?f.jsx("span",{"aria-label":"Backlog — not planned yet",className:"inline-flex text-ink-300",children:f.jsx(MP,{size:14})}):null}),Go="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",ZI=({plans:e,activePlanTitle:t,onOpen:n})=>{const r=Go,s=L(i=>i.agentStatus);return f.jsx("div",{className:"flex flex-col gap-1",children:e.map(i=>{var l;const o=jN(i),a=nh(i,s);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(dh,{order:i.order,done:i.status==="done",status:i.status,running:!!th(i.id,s),fallback:i.statusFallback}),f.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:f.jsx(pe,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:r,children:[f.jsx(Vs,{id:i.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:i.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:i.updated?Ug(i.updated):Ug(i.created)}),o?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(KI,{pct:o.pct,color:VI[a]})}),f.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[o.done,"/",o.total]})]}):f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(ce,{size:"small",fillColor:hn[a].fill,textColor:hn[a].text,children:bc[a]}),i.statusFallback&&f.jsx(ye,{content:"GitHub's PR state couldn't be resolved — this status is a guess from local data",children:f.jsx(ce,{size:"small",variant:"warning",dot:!0,children:"Guess"})}),((l=i.pr)==null?void 0:l.state)==="merged"&&f.jsx(ye,{content:`Merged in #${i.pr.number}`,children:f.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:f.jsx(RP,{size:14})})})]})]})})})]},i.title)})})},cie=({onOpen:e})=>{const t=L(m=>m.archivableIdeas),n=L(m=>m.archiveIdeas),r=L(m=>m.planFilters.search),[s,i]=k.useState(null),[o,a]=k.useState(!1),{toast:l}=rt(),c=r.trim().toLowerCase(),u=c?t.filter(m=>m.title.toLowerCase().includes(c)):t,d=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 d([m.id])}finally{i(null)}},[d]),p=k.useCallback(async()=>{a(!0);try{await d(u.map(m=>m.id))}finally{a(!1)}},[d,u]);return u.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[f.jsxs("h2",{className:"text-sm m-0 opacity-60",children:["Ready to archive (",u.length,")"]}),f.jsx(re,{variant:"ghost",size:"small",disabled:o||s!==null,onClick:p,children:o?"Archiving…":"Archive all"})]}),f.jsx("div",{className:"flex flex-col gap-1",children:u.map(m=>f.jsxs("div",{className:"flex items-center",children:[f.jsx(dh,{done:!0}),f.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:f.jsx(pe,{size:"small",texture:"canvas",shade:!0,className:"plan-row-card",children:f.jsxs("div",{className:Go,children:[f.jsx(Vs,{id:m.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:m.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-30",children:"—"}),f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsx(re,{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))})]})},uie="font-display-luminari text-sm font-semibold opacity-[0.65]",die=({clarifications:e})=>e.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${uie} mb-3`,children:"Clarifications"}),f.jsx("div",{className:"flex flex-col gap-2 mb-3",children:e.map((t,n)=>f.jsx("div",{className:"text-sm flex items-start justify-between gap-3 opacity-75",children:f.jsxs("span",{children:[f.jsx("span",{className:"font-semibold mr-2",children:t.date}),t.text]})},`clar-${t.date}-${n}`))})]}),fie=({plan:e})=>{const t=L(i=>i.gitStatus),n=k.useMemo(()=>(t==null?void 0:t.map(i=>({path:i.path,staged:i.staged})))??[],[t]),r=vse(e,n),s=n.length>0;return f.jsxs("div",{className:"flex min-h-[7rem] flex-col items-center justify-center gap-3",children:[f.jsx(qse,{}),s?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"w-full max-w-md",children:f.jsx(D8,{state:r,filesEmpty:!1})}),f.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[f.jsx(Gse,{count:n.length}),f.jsx(Yse,{state:r,filesEmpty:!1})]})]}):f.jsx(Jse,{})]})},hie="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]",pie=({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),d=`review-phases-draft:${n}`;k.useEffect(()=>{o(pc(d)??"")},[d]),k.useEffect(()=>{i&&mc(d,i)},[d,i]);const h=()=>{s(!1),o(""),l(null),Cv(d)},p=async()=>{let m;try{m=MY(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 f.jsxs(f.Fragment,{children:[f.jsx(ye,{content:"Add code-review findings as phases",children:f.jsx(dt,{variant:"ghost",size:"small",onClick:()=>s(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:f.jsx(CP,{size:16})})}),f.jsx(Ni,{open:r,onClose:h,title:"Add code-review findings",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("p",{className:"text-sm m-0 opacity-70",children:["Paste the JSON findings from a ",f.jsx("code",{children:"/code-review"})," run. Each finding becomes a new, unchecked phase on this plan."]}),f.jsx(Hx,{value:i,onChange:m=>o(m.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:c}),a&&f.jsxs(PP,{variant:"warning",children:["Could not add phases — ",a]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:h,disabled:c,children:"Cancel"}),f.jsx(re,{type:"button",variant:"primary",onClick:p,disabled:c||!i.trim(),children:"Add phases"})]})]})})]})},mie=({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)},d=async()=>{if(s.trim()){a(!0),c(null);try{await e(s.trim()),u()}catch(h){c(h.message)}finally{a(!1)}}};return f.jsxs(f.Fragment,{children:[f.jsx(ye,{content:"Add a ticket to this board",children:f.jsx(dt,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add a ticket to this board",icon:f.jsx(CP,{size:16})})}),f.jsx(Ni,{open:n,onClose:u,title:"Add ticket",size:"small",children:f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsx(un,{label:"Title",value:s,onChange:h=>i(h.target.value),placeholder:"Ticket title…",disabled:o,autoFocus:!0,required:!0}),l&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:l}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(re,{type:"button",variant:"ghost",onClick:u,disabled:o,children:"Cancel"}),f.jsx(re,{type:"button",variant:"primary",onClick:d,disabled:o||!s.trim(),children:"Add"})]})]})})]})},gie=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanAudit),r=L(Hr),[s,i]=k.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,$se(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 f.jsx(ye,{content:a,children:f.jsx(re,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})};function qI(e){const[t,n]=k.useState(null),r=k.useCallback(async()=>{n(e?await P9(e):null)},[e]);return k.useEffect(()=>{r()},[r]),k.useEffect(()=>{let s;const i=xc(o=>{o.message==="changed"&&(s&&clearTimeout(s),s=setTimeout(r,250))});return()=>{s&&clearTimeout(s),i()}},[r]),t}const yie=({plan:e,disabled:t})=>{const n=L(u=>u.refreshAll),[r,s]=k.useState(!1),{toast:i}=rt(),o=qI(e.id),a=yY(e,o==null?void 0:o.ciGreen),l=async()=>{if(e.id){s(!0);try{const u=await Q8(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 f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx(mt,{size:"small",icon:f.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&&f.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:["Waiting on ",a.missing.join(", ")]})]})},xie=({plan:e,disabled:t})=>{const n=L(c=>c.gitBranch),r=L(c=>c.loadGitStatus),[s,i]=k.useState(!1),{toast:o}=rt(),a=async()=>{if(e.id){i(!0);try{const{branch:c,warning:u}=await e9(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 f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx(ye,{content:e.id?`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`:void 0,children:f.jsx(mt,{size:"small",icon:f.jsx("span",{className:"text-ink-500",children:"⎇"}),onClick:a,disabled:l,className:`pc-row text-xs ${l?"opacity-50":""}`,children:s?"Switching…":"Create branch"})}),f.jsxs("div",{className:"text-2xs text-ink-300 px-2",children:[f.jsx("code",{children:n??"unknown"})," — not this plan's branch"]})]})},YI=({idea:e,compact:t})=>{const n=L(h=>h.launchIdeaExtend),r=L(Hr),{state:s,errorMessage:i,run:o}=WI(),{toast:a}=rt(),l=e.id,c=()=>{l&&o(async()=>{const h=L.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,zse(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",d=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 f.jsx(ye,{content:d,children:f.jsx(re,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},vie=({plan:e,disabled:t})=>{const n=L(u=>u.launchFixReview),r=L(Hr),s=L(ON),[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 f.jsx(ye,{content:c,children:f.jsx(mt,{size:"small",icon:f.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"})})},wie=()=>{const e=L(o=>o.loadIdeas),t=L(o=>o.runtimeReachable),n=L(o=>o.githubConfig),[r,s]=k.useState(!1),i=async o=>{!t&&n?await sY(n,o):await HP(o),await e(),s(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(re,{icon:f.jsx(_P,{size:16}),size:"small",onClick:()=>s(!0),children:"New idea"}),f.jsx(GI,{open:r,onClose:()=>s(!1),onAdd:i})]})},bie=({plan:e,disabled:t})=>{const n=L(m=>m.launchPrReview),r=L(Hr),s=L(ON),[i,o]=k.useState(!1),a=qI(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",d=!!(a!=null&&a.lastReviewedSha&&a.headSha&&a.lastReviewedSha===a.headSha),h=i?"Starting…":d?`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 f.jsxs("div",{className:"flex flex-col gap-0.5",children:[f.jsx(ye,{content:u,children:f.jsx(mt,{size:"small",icon:f.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&&f.jsx("div",{className:"text-2xs text-ink-300 px-2",children:p.join(" · ")})]})},kie=({plan:e,disabled:t})=>{const n=L(l=>l.launchPlanReconcile),r=L(Hr),[s,i]=k.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,Dse(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 f.jsx(ye,{content:a,children:f.jsx(re,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},_ie=({plan:e,disabled:t})=>{const n=L(c=>c.launchRunAll),r=L(Hr),[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 f.jsx(ye,{content:l,children:f.jsx(mt,{size:"small",icon:f.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"})})},Sie=({plan:e,onAdd:t,disabled:n})=>{const[r,s]=k.useState(!1),i=async()=>{s(!0);try{await t([Ose()])}finally{s(!1)}};return f.jsx(ye,{content:"Append a style pass against docs/CODE_STYLE.md as a phase",children:f.jsx(re,{variant:"ghost",size:"small",onClick:i,disabled:n||r||!gY(e),children:"Style pass"})})},Cie=()=>{const e=L(b=>b.launchSuggestIdeas),t=L(b=>b.launchBatchReconcile),n=L(b=>b.launchBatchDraft),r=L(b=>b.launchPrioritise),s=L(b=>b.refreshAll),i=L(b=>b.ideaEntries),o=L(b=>b.suggestions),a=L(sh),l=L(Hr),{toast:c}=rt(),[u,d]=k.useState(null),[h,p]=k.useState(!1),m=async()=>{d("suggest");try{await e(Vse(i,o))}catch(b){c({title:"Failed to launch",description:Ge(b.message),variant:"error"})}finally{d(null)}},g=async()=>{d("reconcile");try{await t()}catch(b){c({title:"Failed to launch",description:Ge(b.message),variant:"error"})}finally{d(null)}},v=async b=>{d("draft-all");try{await n(b)}finally{d(null)}},y=async()=>{d("prioritise");try{const b=await r(),_=b.moved.length-b.annotated.length;c({title:b.moved.length>0?"Queue reordered":"Already in order",description:_>0?`${_} of ${b.moved.length} ideas could not be annotated`:b.why.join(`
424
- `)||void 0,variant:_>0?"warning":"success"})}catch(b){c({title:"Failed to prioritise",description:Ge(b.message),variant:"error"}),await s()}finally{d(null)}},x=u!==null||a,w=[{id:"suggest-ideas",label:u==="suggest"?"Starting…":"Suggest ideas",icon:f.jsx(AP,{size:16}),disabled:x||!l,onSelect:m},{id:"reconcile-all",label:u==="reconcile"?"Starting…":"Reconcile all",icon:f.jsx(SP,{size:16}),disabled:x||!l,onSelect:g},{id:"draft-all",label:"Draft all",icon:f.jsx(Kx,{size:16}),disabled:x||!l,onSelect:()=>p(!0)},{id:"prioritise",label:u==="prioritise"?"Prioritising…":"Prioritise queue",icon:f.jsx(I8,{size:16}),disabled:x||!l,onSelect:y}];return f.jsxs(f.Fragment,{children:[f.jsx(IP,{align:"end",trigger:f.jsx(dt,{icon:f.jsx(LP,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:w}),f.jsx(oie,{open:h,onClose:()=>p(!1),onConfirm:v})]})},jie="font-display-luminari text-sm font-semibold opacity-[0.65]",Eie=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var v;const{thread:o,input:a,setInput:l,pending:c,promotingIndex:u,ideaPromptIndex:d,handleSend:h,handlePromote:p,handlePromoteToIdea:m,closeIdeaPrompt:g}=_se(e,n);return f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${jie} mb-3`,children:"Feedback"}),f.jsxs(pe,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[f.jsx("div",{className:"flex flex-col gap-3 mb-4",children:o.length>0||c?f.jsxs(f.Fragment,{children:[f.jsx(Xse,{messages:o,undo:r,undoing:s,onUndo:i,onPromote:p,promotingIndex:u}),c&&f.jsx("div",{className:"flex flex-col gap-1 items-end",children:f.jsx("div",{className:"max-w-[85%]",children:f.jsx(pe,{size:"small",surface:"paper",texture:"parchment",accent:!0,accentColor:"blue",children:c})})}),t&&f.jsx("div",{className:"flex flex-col gap-1 items-start",children:f.jsx(pe,{size:"small",surface:"paper",texture:"kraft",shade:!0,children:f.jsx(Wr,{size:"small",label:"Agent thinking…"})})})]}):f.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."})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Hx,{value:a,onChange:y=>l(y.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3}),f.jsx("div",{className:"flex justify-end items-center gap-3",children:f.jsx(re,{size:"small",onClick:h,disabled:t||!a.trim(),children:"Send"})})]})]}),f.jsx(GI,{open:d!==null,onClose:g,onAdd:m,initialContent:d!==null?(v=o[d])==null?void 0:v.text:void 0})]})},Pie="font-display-luminari text-sm font-semibold opacity-[0.65]",Tie=({plan:e,otherPlans:t})=>{const n=nt(),r=t.filter(s=>s.entityKind==="fix"&&s.idea===e.id);return r.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${Pie} mb-3`,children:"Fixes"}),f.jsx("div",{className:"flex flex-col gap-2 mb-3",children:r.map(s=>f.jsxs("button",{type:"button",onClick:()=>n(Ri(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:[f.jsx(Vs,{id:s.id}),f.jsx("span",{className:"flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),f.jsx(ce,{size:"small",fillColor:hn[s.status].fill,textColor:hn[s.status].text,children:bc[s.status]})]},s.title))})]})},Nie=({plan:e,otherPlans:t})=>{const n=nt(),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 f.jsx("div",{className:"mb-3",children:f.jsxs("button",{type:"button",onClick:()=>n(Ri(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:[f.jsx(ce,{size:"small",variant:r?"info":"warning",children:r?"ticket":"fix"}),f.jsxs("span",{className:"text-sm opacity-70",children:[r?"On board":"Fixes"," ",f.jsx("span",{className:"font-mono",children:s}),i&&` — ${i.title}`]})]})})},Iie="font-display-luminari text-sm font-semibold opacity-[0.65]",Aie=({plan:e,auditRunning:t,agentBusy:n,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o,onAddPhases:a,ideaView:l,otherPlans:c,deliverPanel:u})=>{const d=L(g=>g.launchRunAll),h=e.fixes??[],p=h.some(g=>!g.done),m=[...e.phases.map((g,v)=>({kind:"phase",item:g,index:v})),...h.map((g,v)=>({kind:"fix",item:g,index:v}))];return f.jsx("div",{className:"mb-8",style:r?{"--phase-fill":`${r.fraction*100}%`}:void 0,children:f.jsx(E5,{data:m,toolbar:{title:f.jsx("h3",{className:`${Iie} m-0`,children:"Phases"}),actions:f.jsxs(f.Fragment,{children:[t&&f.jsx(Wr,{size:"small",label:"Audit running…"}),m.length===0&&f.jsx(YI,{idea:l}),m.length>0&&(e.status==="review"||e.status==="done")&&f.jsx(gie,{plan:e}),m.length>0&&e.status!=="done"&&f.jsx(kie,{plan:e}),m.length>0&&f.jsx(pie,{onAdd:a,disabled:s,entityId:e.id??e.title}),m.length>0&&f.jsx(Sie,{plan:e,onAdd:a,disabled:s}),e.id&&p&&f.jsx(ye,{content:"Run the open fixes with an agent",children:f.jsx(re,{size:"small",onClick:()=>e.id&&d(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})},panelFooter:m.length===0?f.jsx("div",{className:"flex justify-center py-6",children:f.jsx(HI,{idea:l,otherPlans:c,className:"font-handwritten !text-base underline"})}):u,columns:[{key:"checkbox",header:"",cell:g=>f.jsx(tie,{row:g,runningFill:r,updating:s,onTogglePhase:i,onToggleFix:o}),width:1},{key:"title",header:"Title",cell:g=>f.jsx(nie,{row:g,runningFill:r})},{key:"actions",header:"",align:"end",width:6,cell:g=>f.jsx(rie,{row:g,runningFill:r,agentBusy:n,planId:e.id})}],expandable:{render:g=>{const v=g.item.run?MH(g.item.run):null;return!g.item.description&&!v?null:f.jsxs("div",{className:"flex flex-col gap-1",children:[g.item.description&&f.jsx("span",{children:g.item.description}),v&&f.jsx("span",{className:"font-mono text-3xs opacity-[0.7]",children:v})]})}},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(eh(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"})})},Rie="font-display-luminari text-sm font-semibold opacity-[0.65]",Lie=({plan:e})=>e.body?f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:`${Rie} mb-2`,children:"Description"}),f.jsx("div",{className:"opacity-[0.85]",children:f.jsx(bI,{children:e.body})})]}):null,Mie=({rollup:e})=>e.runs===0?null:f.jsx("span",{className:"shrink-0",children:f.jsx(ye,{content:`${Ar(e.inputTokens)} in · ${Ar(e.outputTokens)} out · cache ${Ar(e.cacheCreationTokens)} write · ${Ar(e.cacheReadTokens)} read`,children:f.jsx(ce,{size:"small",fillColor:"var(--pui-texture-shade)",textColor:"inherit",children:f.jsxs("span",{className:"whitespace-nowrap font-mono text-3xs font-normal opacity-[0.7]",children:[Ar(e.inputTokens+e.outputTokens)," tokens ·"," ",Gf(e.durationMs)," · ",e.runs," ",e.runs===1?"run":"runs"]})})})}),$ie=({progress:e,color:t,rollup:n})=>e===null&&n.runs===0?null:f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-min",children:[e!==null&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 min-w-16",children:f.jsx(KI,{pct:e.pct,color:t})}),f.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0 font-handwritten",children:[Math.round(e.pct),"%"]})]}),f.jsx(Mie,{rollup:n})]}),Die="font-display-luminari text-sm font-semibold opacity-[0.65]",Oie=({plan:e,otherPlans:t})=>{const n=nt(),r=L(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(Ri(l))},o=async a=>{e.id&&(await Q9({boardId:e.id,title:a}),await r())};return f.jsxs("div",{className:"mb-8",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("h3",{className:`${Die} m-0`,children:"Tickets"}),f.jsx(mie,{onAdd:o,disabled:!e.id})]}),s.length>0?f.jsx(ZI,{plans:s,onOpen:i}):f.jsx("p",{className:"text-sm m-0 opacity-50",children:"No tickets yet — add one to start the decomposition."})]})},zie=({planId:e,released:t,reviewing:n,reviewNote:r})=>{const s=Lse(e);return e?f.jsx("div",{className:"text-xs opacity-80 shrink-0",children:s?f.jsx(iie,{trail:s,released:t,reviewing:n,reviewNote:r}):f.jsx("div",{className:"max-w-xs","aria-hidden":"true",children:f.jsx(rn,{variant:"text",height:32})})}):null},Fie=({plan:e})=>{const t=L(R=>R.plans),n=L(R=>R.loadPlans),{toast:r}=rt(),{patch:s,updating:i}=wc(),o=L(R=>R.agentStatus),a=L(sh),l=L(R=>R.detailView),c=L(R=>R.taskLog),u=L(R=>R.loadTaskLog),d=th(e.id,o),h=!!hY(e.id,o),p=pY(e.thread),m=Ise(d,c),g=k.useMemo(()=>OH(c,e.id),[c,e.id]),v=(d==null?void 0:d.taskKind)==="audit",y=fY(e,(m==null?void 0:m.fraction)??0);e.phases.length>0;const x=l==="feedback",w={id:e.id??null,title:e.title,body:e.body,log:e.log},b=((t==null?void 0:t.entries)??[]).filter(R=>R.id!==e.id);k.useEffect(()=>{u()},[u]);const _=async R=>{const $=e.phases.map((F,O)=>O===R?{...F,done:!F.done}:F);$.every(F=>F.done)&&e.status==="in-progress"?await s(e.title,{phases:$,status:"review"}):await s(e.title,{phases:$})},S=async R=>{await s(e.title,{phases:[...e.phases,...R]})},j=async R=>{const $=(e.fixes??[]).map((F,O)=>O===R?{...F,done:!F.done}:F);$.every(F=>F.done)&&e.status==="in-progress"?await s(e.title,{fixes:$,status:"review"}):await s(e.title,{fixes:$})},{sending:E,send:T,undo:P,undoing:N,undoEdit:A}=Ase(e,{reload:n,notify:r});return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-2",children:[f.jsxs("h2",{className:`${hie} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[f.jsx(Vs,{id:e.id}),e.title]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-handwritten",children:[f.jsxs("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:[f.jsx("span",{className:"max-[480px]:hidden",children:e.updated?"updated ":"created "}),Ug(e.updated??e.created)]}),f.jsx(CI,{})]})]}),f.jsx(Nie,{plan:e,otherPlans:b}),f.jsxs("div",{className:"flex items-center gap-x-4 gap-y-1 flex-wrap mb-3",children:[f.jsx(zie,{planId:e.id,released:e.released,reviewing:h,reviewNote:p}),!x&&f.jsx($ie,{progress:y,color:VI[nh(e,o)],rollup:g})]}),x?f.jsx(Eie,{plan:e,updating:E,onSend:T,undo:P,undoing:N,onUndo:A}):f.jsxs(f.Fragment,{children:[e.entityKind==="board"?f.jsx(Oie,{plan:e,otherPlans:b}):f.jsx(Aie,{plan:e,auditRunning:v,agentBusy:a,runningFill:m,updating:i,onTogglePhase:_,onToggleFix:j,onAddPhases:S,ideaView:w,otherPlans:b,deliverPanel:f.jsx(fie,{plan:e})}),f.jsx(Tie,{plan:e,otherPlans:b}),f.jsx(die,{clarifications:e.clarifications??[]}),f.jsx(Lie,{plan:e})]})]})},Bie="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",I1="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",Vie="font-handwritten text-xs font-semibold opacity-55 leading-none",A1=`${Bie} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,Uie=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],JI="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",QI="overflow-hidden text-ellipsis whitespace-nowrap",Wie=()=>{const e=L(n=>n.planFilters.groupBySubject),t=L(n=>n.toggleGroupBySubject);return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:Vie,children:"Group by subject"}),f.jsx(Eg,{size:"small",checked:e,onChange:t,"aria-label":"Group by subject"})]})},Hie=({rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r})=>{const s=Go,{roadmapItemNames:i,navigate:o,sortKey:a,sortDirection:l,handleSort:c,groups:u,showSubjectHeaders:d,sortReflectsRows:h}=Hse(e),p=m=>m.type==="plan"?f.jsx(ZI,{plans:[m.plan],activePlanTitle:t,onOpen:n},m.plan.title):m.type==="note"?f.jsx(Kie,{row:m,onOpen:r},m.idea.title):f.jsx(Zie,{row:m,activePlanTitle:t,onOpen:n},m.fix.title);return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":h&&a==="order"?l==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:A1,"aria-label":"Sort by run order",onClick:()=>c("order"),children:["#",a==="order"&&(l==="asc"?"▲":"▼")]})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(pe,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsx("div",{className:s,children:Uie.map(({key:m,label:g})=>{const v=m===a;return f.jsx("span",{role:"columnheader",className:m==="updated"?"max-lg:hidden":void 0,"aria-sort":h&&v?l==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:A1,onClick:()=>c(m),children:[g,v&&(l==="asc"?" ▲":" ▼")]})},m)})})})})]}),d?u.map(m=>{const g=m.subject;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx("div",{className:"flex items-baseline gap-2",children:g&&i.has(g)?f.jsx("button",{type:"button",className:`${I1} 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}):f.jsx("div",{className:I1,children:g??"No subject"})}),m.rows.map(v=>p(v))]},g??"__no-subject__")}):e.map(m=>p(m))]})},Kie=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return f.jsxs("div",{className:"flex items-center",children:[f.jsx(dh,{order:n.order,done:r==="done",status:r}),f.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:f.jsx(pe,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:Go,children:[n.id?f.jsx(Vs,{id:n.id}):f.jsx("span",{}),f.jsxs("span",{className:`${JI} [cursor:inherit]`,children:[f.jsx(Kx,{}),f.jsx("span",{className:QI,children:n.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsx(ce,{size:"small",fillColor:of[r].fill,textColor:of[r].text,children:UI[r]})]})})})]})},Gie="grid grid-cols-[76px_minmax(0,1fr)_112px] gap-2.5 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",Zie=({row:e,activePlanTitle:t,onOpen:n})=>{const r=L(o=>o.agentStatus),s=e.fix,i=nh(s,r);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(dh,{order:s.order,done:s.status==="done",status:s.status,running:!!th(s.id,r),fallback:s.statusFallback}),f.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:f.jsx(pe,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:Gie,children:[f.jsx(Vs,{id:s.id}),f.jsxs("span",{className:`${JI} [cursor:inherit]`,children:[f.jsx(ce,{size:"small",variant:"warning",children:"fix"}),f.jsx("span",{className:QI,children:s.title}),s.idea&&f.jsxs("span",{className:"text-xs opacity-45 whitespace-nowrap font-mono",children:["→ ",s.idea]})]}),f.jsx(ce,{size:"small",fillColor:hn[i].fill,textColor:hn[i].text,children:bc[i]})]})})})]})},qie=({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]),f.jsx("div",{ref:s,children:e.length>0?f.jsx(Hie,{rows:e,activePlanTitle:t,onOpenPlan:n,onOpenIdea:r}):f.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."})})},Yie=({idea:e})=>f.jsxs("div",{className:"text-base leading-[1.7] text-ink-900",children:[f.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:[f.jsx(Vs,{id:e.id??void 0}),e.title,e.status&&f.jsx(ce,{size:"small",fillColor:of[e.status].fill,textColor:of[e.status].text,children:UI[e.status]})]}),f.jsx(bI,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),f.jsx("div",{className:"mt-6",children:f.jsx(YI,{idea:e})})]}),Jie=e=>{const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null},Xp="__no-subject__",R1="pc-row-label font-handwritten text-xs font-semibold opacity-[0.45]",Qie=()=>{var M,V;const e=uh(),t=L(sh),n=L(C=>C.agentStatus),r=L(C=>C.gitBranch),{patch:s,updating:i}=wc(),{subjects:o,available:a}=TI(),l=L(C=>C.detailView),c=L(C=>C.setDetailView),u=L(C=>C.archiveIdeas),{toast:d}=rt(),[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 v=nh(e,n),y=e.status==="in-progress",x=e.status==="review",w=e.status==="dropped",b=e.status==="done",_=e.phases.some(C=>!C.done),S=(e.status==="planned"||y)&&_,j=mY(e),E=e.id!==void 0&&Jie(r)===e.id,T=e.entityKind!=="board"&&(e.status==="planned"||y||x)&&!E,P=!!(e.pr&&(e.pr.state==="open"||e.pr.state==="draft")&&e.pr.unresolvedThreadCount),N=((M=e.pr)==null?void 0:M.state)==="open"||((V=e.pr)==null?void 0:V.state)==="draft",A=a&&e.subject&&!o.includes(e.subject)?e.subject:void 0,R=C=>s(e.title,C),$=async()=>{if(e.id){g(!0);try{await u([e.id])}catch(C){d({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},D=async()=>{if(e.id){g(!0);try{if(e.entityKind!=="board"){const C=await X8(e.id);if(!C.ready){d({title:"Not ready to complete idea",description:`Waiting on ${C.missing.join(", ")}`,variant:"error"});return}}await u([e.id])}catch(C){d({title:"Archive failed",description:C.message,variant:"error"})}finally{g(!1)}}},F=y||x||e.status==="planned",O=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 R({order:U})};return f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{children:f.jsxs("div",{className:"flex flex-col",children:[f.jsx(mt,{size:"small",active:l==="details",onClick:()=>c("details"),className:"pc-row text-xs",children:"Details"}),f.jsx(mt,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"pc-row text-xs",children:"Feedback"})]})}),f.jsx("div",{className:"h-[64px] flex items-center",children:f.jsx(ce,{size:"small",fillColor:hn[v].fill,textColor:hn[v].text,children:bc[v]})}),f.jsxs("div",{children:[f.jsx("div",{className:R1,children:"Subject"}),f.jsx("div",{className:"h-[32px] flex items-center",children:f.jsx(_V,{className:"w-full",size:"small",value:e.subject??Xp,onChange:C=>R({subject:C===Xp?null:C}),disabled:i||!a,options:[{value:Xp,label:"No subject"},...A?[{value:A,label:`${A} (orphan)`}]:[],...!a&&e.subject&&!A?[{value:e.subject,label:e.subject}]:[],...o.map(C=>({value:C,label:C}))]})})]}),F&&f.jsxs("div",{className:"flex items-center justify-between h-[64px]",children:[f.jsx("div",{className:R1,children:"Order"}),f.jsx(un,{type:"number",size:"small","aria-label":"Run order",min:1,value:h,onChange:C=>p(C.target.value),onBlur:O,disabled:i,className:"w-20"})]}),f.jsx(pe,{size:"small",children:f.jsxs("div",{className:"flex flex-col",children:[T&&f.jsx(xie,{plan:e,disabled:t||i}),S&&f.jsx(_ie,{plan:e,disabled:t||i}),P&&f.jsx(vie,{plan:e,disabled:t||i}),N&&f.jsx(bie,{plan:e,disabled:t||i}),x&&e.pr&&f.jsx(yie,{plan:e,disabled:t||i}),b&&f.jsx(mt,{size:"small",icon:f.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:$,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Archiving…":"Archive"}),j&&f.jsx(mt,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:D,disabled:m||!e.id,className:`pc-row text-xs ${m||!e.id?"opacity-50":""}`,children:m?"Completing…":"Complete idea"}),!b&&f.jsx(mt,{size:"small",icon:f.jsx("span",{className:w?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:w?"↺":"⊘"}),onClick:()=>R({status:w?null:"dropped"}),disabled:i,className:`pc-row text-xs ${i?"opacity-50":""}`,children:w?"Reopen plan":"Mark dropped"})]})})]})},Xie=["in-progress","review","planned","idea","done","dropped"],eoe=()=>{const e=L(h=>h.plans),t=uh(),n=L(h=>h.planFilters),r=L(h=>h.togglePlanStatus),s=L(h=>h.setPlanSearch),i=L(h=>h.setSubjectFilter),o=nt();if(!e||t)return null;const{statusCounts:a}=cl(e.entries,n),{statusCounts:l}=cl(e.entries),c=new Set(n.statuses),u=Xie.filter(h=>l[h]>0);return f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"h-[64px] flex items-center",children:f.jsx(un,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:h=>s(h.target.value)})}),n.subject!==null&&f.jsxs("div",{className:"flex items-center gap-2 h-[32px]","data-testid":"subject-filter-chip",children:[f.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),f.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"})]}),f.jsx("div",{children:f.jsx("div",{className:"flex flex-col",children:u.map(h=>{const p=c.has(h);return f.jsx(mt,{size:"small",active:p,onClick:()=>r(h),className:"pc-row text-xs",icon:f.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:hn[h].text}}),action:f.jsx("span",{className:"text-2xs text-ink-500",children:a[h]}),children:bc[h]},h)})})})]})},L1=({showGroupingToggle:e=!1})=>f.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[f.jsx("h1",{className:"text-4xl flex-1 font-display-luminari font-semibold text-ink-900 m-0 leading-[1.1]",children:"Plans"}),e&&f.jsx(Wie,{}),f.jsx(wie,{}),f.jsx(Cie,{})]}),toe=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],noe=()=>f.jsxs("div",{className:"flex flex-col gap-1","aria-hidden":"true",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px]"}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(pe,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:Go,children:[f.jsx(rn,{variant:"text",width:28}),f.jsx(rn,{variant:"text",width:44}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(rn,{variant:"text",width:56})}),f.jsx(rn,{variant:"text",width:64}),f.jsx(rn,{variant:"text",width:48})]})})})]}),toe.map(e=>f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:f.jsx(rn,{variant:"text",width:16})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(pe,{size:"small",className:"plan-row-card",children:f.jsxs("div",{className:Go,children:[f.jsx(rn,{variant:"rect",width:44,height:18}),f.jsx(rn,{variant:"text",width:e.title}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(rn,{variant:"text",width:52})}),f.jsx(rn,{variant:"rect",width:80,height:8}),f.jsx(rn,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),roe=()=>{const e=L(u=>u.reconcileQueue),t=L(u=>u.removeFromReconcileQueue),n=L(u=>u.plans),{patch:r}=wc(),{toast:s}=rt(),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 f.jsx(lie,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},soe=({suggestions:e,onOpen:t,onDismiss:n})=>e.length===0?null:f.jsxs("div",{className:"mt-5",children:[f.jsx("h2",{className:"text-sm mb-2 opacity-60",children:"Suggested from AI"}),f.jsx("div",{className:"flex flex-col gap-1",children:e.map(r=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(pe,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.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:[f.jsx(MP,{}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),f.jsx(dt,{icon:f.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),Yv=()=>{const{plans:e,plansError:t,ideaEntries:n,suggestions:r,planFilters:s,activePlan:i,activeIdea:o,planId:a,ideaId:l,openSuggestion:c,setOpenSuggestion:u,handleOpenPlan:d,handleOpenIdea:h,handleOpenArchivable:p,handleDismissSuggestion:m}=Sse();if(t)return f.jsxs("div",{children:[f.jsx(LI,{children:"Plans"}),f.jsxs(pe,{size:"small",accent:!0,accentColor:"rose",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Couldn't load plans.md"}),f.jsx("p",{className:"m-0 opacity-75",children:t})]})]});if(!e)return a||l?f.jsxs("div",{children:[f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading…"}),f.jsx("p",{className:"opacity-50",children:"Loading…"})]}):f.jsxs("div",{children:[f.jsx(L1,{}),f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),f.jsx(noe,{})]});const{rows:g}=EY(e.entries,n,s);return f.jsxs(f.Fragment,{children:[f.jsx(roe,{}),i?f.jsx("div",{children:f.jsx(Fie,{plan:i})}):o?f.jsx("div",{children:f.jsx(Yie,{idea:o})}):f.jsxs("div",{children:[f.jsx(L1,{showGroupingToggle:e.entries.length>0}),e.warnings.length>0&&f.jsxs(pe,{size:"small",accent:!0,accentColor:"amber",children:[f.jsx("p",{className:"m-0 font-semibold",children:"Some entries couldn't be parsed"}),f.jsx("ul",{className:"m-0 pl-5",children:e.warnings.map(v=>f.jsxs("li",{children:[v.title,": ",v.message]},v.title))})]}),e.entries.length===0?f.jsxs("p",{className:"opacity-50",children:["No ideas yet — capture one with ",f.jsx("strong",{children:"New idea"})," above, or click"," ",f.jsx("strong",{children:"Suggest ideas"})," to have an agent propose some."]}):f.jsx(qie,{rows:g,activePlanTitle:null,onOpenPlan:d,onOpenIdea:h}),f.jsx(cie,{onOpen:p}),f.jsx(soe,{suggestions:r,onOpen:u,onDismiss:m}),f.jsx(aie,{suggestion:c,onClose:()=>u(null)})]})]})},oy="/projects",ioe=[oy,"/projects/reviews","/projects/activity","/projects/ideas"],ay=[{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"}],M1=({item:e})=>f.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.label}),$1=()=>f.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:f.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",strokeLinecap:"round"})}),ooe=224,aoe=480,loe=495,coe=ooe+loe+aoe,uoe=`(min-width: ${coe}px)`;function doe(e,t,n={githubConfigured:!1}){return e===void 0||e==="client"||e==="corpus"&&n.githubConfigured?"ready":t.checking?"checking":t.reachable?"ready":"unreachable"}function foe(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 hoe(e){return e.filter(t=>t.kind!=="question")}function poe(e,t){return t?e.filter(n=>!t.has(n.id)):[]}function moe(){const e=L(r=>r.notifications),t=L(r=>r.loadNotifications),n=k.useRef(null);k.useEffect(()=>{typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission()},[]),k.useEffect(()=>{if(!e)return;const r=hoe(e),s=poe(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=xc(i=>{i.message==="changed"&&(r&&clearTimeout(r),r=setTimeout(t,250))});return()=>{r&&clearTimeout(r),s()}},[t])}const XI="stack-open";function goe(){try{return localStorage.getItem(XI)==="true"}catch{return!1}}function yoe(e){try{localStorage.setItem(XI,String(e))}catch{}}function xoe(){var D;const e=nt(),t=Qm({select:F=>F.location.pathname}),n=L(F=>F.loadPlans),r=L(F=>F.loadIdeas),s=L(F=>F.loadSuggestions),i=L(F=>F.loadCapabilities),o=L(F=>F.loadAgentAuthStatus),a=L(F=>F.loadParkedQuestions),l=L(F=>F.loadNotifications),c=L(F=>F.setActiveDocTitle),u=L(F=>F.checkRuntimeReachable),d=L(F=>F.runtimeReachable),h=L(F=>F.runtimeChecking),p=L(F=>F.githubConfig),m=Qm({select:F=>{var O;return(O=F.matches.at(-1))==null?void 0:O.staticData.layer}}),g=doe(m,{reachable:d,checking:h},{githubConfigured:p!==null}),v=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),y=t==="/docs"||t.startsWith("/docs/"),x=t==="/settings"||t.startsWith("/settings/"),w=t==="/roadmap",b=t==="/git",_=v?"plans":y?"docs":x?"settings":(D=ay.find(F=>F.path===t))==null?void 0:D.id,S=v||y||x||w||b,j=v?"plans":y?"docs":x?"settings":w?"roadmap":"git",[E,T]=k.useState(goe),[P,N]=k.useState(!1),A=foe(uoe),R=k.useRef(!1);moe(),k.useEffect(()=>{s(),i(),o(),a(),l(),u()},[s,i,o,a,l,u]),k.useEffect(()=>{h||(n(),r())},[h,n,r]),k.useEffect(()=>{R.current||t!=="/"||(R.current=!0,Promise.all([Gx(),zP()]).then(([F,O])=>{if(!(F!=null&&F.setupDismissed)&&O!==null&&!O.every(M=>M.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([WP(),GP()]).then(([M,V])=>{M.entries.length>1||V.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),k.useEffect(()=>{N(!1)},[t]);const $=()=>{const F=!E;yoe(F),T(F)};return{navigate:e,pathname:t,activeLayer:m,readiness:g,activeId:_,hasSidebar:S,sidebarAreaKey:j,isPlansArea:v,isDocsArea:y,isSettingsArea:x,isRoadmapArea:w,isGitArea:b,isInHub:ioe.includes(t),stackOpen:E,toggleStack:$,isLarge:A,mobileSidebarOpen:P,openMobileSidebar:()=>N(!0),closeMobileSidebar:()=>N(!1)}}const voe=k.lazy(()=>$n(()=>import("./index-SD_x9Z5F.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsSidebar}))),woe=k.lazy(()=>$n(()=>import("./index-D_2SBGCS.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsSidebar}))),boe=k.lazy(()=>$n(()=>import("./index-mmzETz6G.js"),[]).then(e=>({default:e.RoadmapSidebar}))),koe=k.lazy(()=>$n(()=>import("./index-DG2ri3IF.js"),[]).then(e=>({default:e.GitFileList}))),_oe=()=>{const{navigate:e,activeLayer:t,readiness:n,activeId:r,hasSidebar:s,sidebarAreaKey:i,isPlansArea:o,isDocsArea:a,isSettingsArea:l,isRoadmapArea:c,isGitArea:u,isInHub:d,stackOpen:h,toggleStack:p,isLarge:m,mobileSidebarOpen:g,openMobileSidebar:v,closeMobileSidebar:y}=xoe();return d?f.jsx(dk,{position:"bottom-left",children:f.jsx(Mre,{children:f.jsx(Jm,{})})}):f.jsxs(dk,{position:"bottom-left",children:[f.jsxs("div",{className:"h-screen box-border flex flex-col",children:[f.jsxs("div",{className:"shrink-0 min-[1199px]:pr-[var(--pc-stack-width)]",children:[f.jsx(xre,{}),f.jsxs("header",{className:"pc-app-header flex items-center gap-3 h-[var(--pc-header-h)] max-[480px]:hidden",style:Vx({texture:"parchment",shade:!0}),children:[s&&f.jsx(dt,{variant:"ghost",size:"small",className:"lg:hidden",label:"Open sidebar",onClick:v,icon:f.jsx($1,{})}),f.jsx(mre,{}),f.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 ml-auto",children:ay.map(x=>f.jsx(re,{variant:"ghost",size:"small",isActive:x.id===r,onClick:()=>e({to:x.path}),"aria-current":x.id===r?"page":void 0,children:f.jsx(M1,{item:x})},x.id))})]}),f.jsx(Are,{})]}),f.jsx(bP,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!1,showSidebar:!1,showPage:!1,bleedBottom:!0,children:f.jsx("div",{className:"flex flex-col h-full min-h-0",children:f.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:f.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&&f.jsxs(vre,{routeKey:i,mobileOpen:g,onMobileClose:y,children:[o&&f.jsxs(f.Fragment,{children:[f.jsx(eoe,{}),f.jsx(Qie,{})]}),a&&f.jsx(k.Suspense,{fallback:null,children:f.jsx(voe,{})}),l&&f.jsx(k.Suspense,{fallback:null,children:f.jsx(woe,{})}),c&&f.jsx(k.Suspense,{fallback:null,children:f.jsx(boe,{})}),u&&f.jsx(k.Suspense,{fallback:null,children:f.jsx(koe,{})})]}),f.jsx("div",{className:"relative flex flex-col min-w-0 flex-[1_1_0%]",children:f.jsx("div",{className:"flex flex-col flex-1 min-w-0",children:f.jsx(Wx,{texture:{texture:"parchment"},rounded:"none",className:"pc-page w-full max-w-none",children:n==="unreachable"?f.jsx(yre,{layer:t}):n==="checking"?null:f.jsxs(k.Suspense,{fallback:null,children:[f.jsx(Rre,{}),f.jsx(Jm,{})]})})})})]})})})})]}),f.jsx(fre,{open:h,pinned:m,onToggle:p}),f.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&&f.jsx(dt,{variant:"ghost",size:"small",label:"Open sidebar",onClick:v,icon:f.jsx($1,{}),className:"min-h-11"}),ay.map(x=>f.jsx(re,{variant:"ghost",size:"small",isActive:x.id===r,onClick:()=>e({to:x.path}),"aria-current":x.id===r?"page":void 0,className:"min-h-11",children:f.jsx(M1,{item:x})},x.id))]})]})},eA=k.lazy(()=>$n(()=>import("./index-SD_x9Z5F.js"),__vite__mapDeps([0,1])).then(e=>({default:e.DocsPage}))),tA=k.lazy(()=>$n(()=>import("./index-D_2SBGCS.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SettingsPage}))),Soe=k.lazy(()=>$n(()=>import("./index-BHPCJror.js"),[]).then(e=>({default:e.TasksPage}))),Coe=k.lazy(()=>$n(()=>import("./index-mmzETz6G.js"),[]).then(e=>({default:e.RoadmapPage}))),joe=k.lazy(()=>$n(()=>import("./index-DePKcR5b.js"),[]).then(e=>({default:e.StatsPage}))),Eoe=k.lazy(()=>$n(()=>import("./index-DG2ri3IF.js"),[]).then(e=>({default:e.GitPage}))),Poe=k.lazy(()=>$n(()=>import("./index-DxehIB14.js"),[]).then(e=>({default:e.InboxPage}))),Toe=k.lazy(()=>$n(()=>import("./index-Do4T60UL.js"),[]).then(e=>({default:e.IssuesPage}))),at=xM({component:_oe}),Noe=ft({getParentRoute:()=>at,path:"/projects",component:dse,staticData:{layer:"client"}}),Ioe=ft({getParentRoute:()=>at,path:"/projects/reviews",component:hse,staticData:{layer:"client"}}),Aoe=ft({getParentRoute:()=>at,path:"/projects/activity",component:Gre,staticData:{layer:"client"}}),Roe=ft({getParentRoute:()=>at,path:"/projects/ideas",component:fse,staticData:{layer:"client"}}),Loe=ft({getParentRoute:()=>at,path:"/",component:Yv,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0}),staticData:{layer:"corpus"}}),Moe=ft({getParentRoute:()=>at,path:"/plans/$planId",beforeLoad:({params:e})=>{throw tj({to:"/ideas/$ideaId",params:{ideaId:sf(e.planId)??e.planId}})}}),$oe=ft({getParentRoute:()=>at,path:"/ideas/$ideaId",component:Yv,staticData:{layer:"corpus"}}),Doe=ft({getParentRoute:()=>at,path:"/ideas/$ideaId/tickets/$ticketId",component:Yv,staticData:{layer:"corpus"}}),Ooe=ft({getParentRoute:()=>at,path:"/docs",component:eA,staticData:{layer:"runtime"}}),zoe=ft({getParentRoute:()=>at,path:"/docs/$section",component:eA,staticData:{layer:"runtime"}}),Foe=ft({getParentRoute:()=>at,path:"/settings",component:tA,staticData:{layer:"runtime"}}),Boe=ft({getParentRoute:()=>at,path:"/settings/$section",component:tA,staticData:{layer:"runtime"}}),Voe=ft({getParentRoute:()=>at,path:"/roadmap",component:Coe,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0}),staticData:{layer:"runtime"}}),Uoe=ft({getParentRoute:()=>at,path:"/inbox",component:Poe,staticData:{layer:"runtime"}}),Woe=ft({getParentRoute:()=>at,path:"/stats",component:joe,staticData:{layer:"runtime"}}),Hoe=ft({getParentRoute:()=>at,path:"/git",component:Eoe,staticData:{layer:"runtime"}}),Koe=ft({getParentRoute:()=>at,path:"/tasks",component:Soe,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0}),staticData:{layer:"runtime"}}),Goe=ft({getParentRoute:()=>at,path:"/issues",component:Toe,staticData:{layer:"runtime"}}),Zoe=at.addChildren([Loe,Noe,Ioe,Aoe,Roe,Moe,$oe,Doe,Ooe,zoe,Foe,Boe,Koe,Goe,Voe,Woe,Uoe,Hoe]),qoe=TM({routeTree:Zoe,basepath:ha||"/"}),{runtimeUrl:af,pairingToken:ly}=DN;B8(af||ha);V8(ly);const Yoe=15e3;async function Joe(){!af||!ly||await fetch(K("/api/pair"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:ly}),signal:AbortSignal.timeout(Yoe)}).catch(()=>{})}const nA=document.getElementById("root");if(!nA)throw new Error("#root element not found");async function Qoe(){return $re(ha,af)?!0:Dre(af,e=>J(K(e)))}Joe().then(Qoe).catch(()=>!1).then(e=>{!e&&!window.location.pathname.startsWith(oy)&&window.history.replaceState(null,"",`${ha}${oy}`),qC(nA).render(f.jsx(k.StrictMode,{children:f.jsx(AM,{router:qoe})}))});export{ye as $,iae as A,bae as B,rt as C,oae as D,cx as E,pae as F,PI as G,xae as H,gae as I,re as J,vae as K,wae as L,bI as M,Ni as N,mae as O,LI as P,kae as Q,pe as R,Ge as S,S1 as T,bc as U,hn as V,Mse as W,z8 as X,Gp as Y,bre as Z,Gf as _,nt as a,d6 as a0,Ar as a1,vc as a2,zI as a3,gse as a4,K8 as a5,lae as a6,xc as a7,rae as a8,dt as a9,sae as aa,kP as ab,Wr as ac,D8 as ad,EJ as ae,CJ as af,Vs as ag,Ase as ah,pc as ai,mc as aj,Xse as ak,Hx as al,Cv as am,fW as an,hae as ao,Mne as b,K as c,hie as d,PP as e,yae as f,ce as g,$ne as h,un as i,f as j,Gx as k,fae as l,aae as m,cae as n,uae as o,mt as p,TI as q,k as r,dae as s,nae as t,L as u,_V as v,TP as w,ic as x,F8 as y,No as z};
425
- //# sourceMappingURL=main-DiplEwD3.js.map