@dendelion/paper-camp 0.16.0 → 0.17.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 (57) hide show
  1. package/dist/app/assets/index-6xeWffZg.js +2 -0
  2. package/dist/app/assets/{index-Bz4Df_iX.js.map → index-6xeWffZg.js.map} +1 -1
  3. package/dist/app/assets/{index-CGtPCj1V.js → index-B_yczIPZ.js} +2 -2
  4. package/dist/app/assets/{index-CGtPCj1V.js.map → index-B_yczIPZ.js.map} +1 -1
  5. package/dist/app/assets/index-CASIH0vL.js +2 -0
  6. package/dist/app/assets/index-CASIH0vL.js.map +1 -0
  7. package/dist/app/assets/{index-Cm3hzD0z.js → index-CYxk5mrY.js} +2 -2
  8. package/dist/app/assets/{index-Cm3hzD0z.js.map → index-CYxk5mrY.js.map} +1 -1
  9. package/dist/app/assets/index-CjPmPsf0.js +4 -0
  10. package/dist/app/assets/index-CjPmPsf0.js.map +1 -0
  11. package/dist/app/assets/{index-Dtdlcmro.js → index-CnD1dVCC.js} +2 -2
  12. package/dist/app/assets/{index-Dtdlcmro.js.map → index-CnD1dVCC.js.map} +1 -1
  13. package/dist/app/assets/{index-BiDION9V.js → index-DLgVuxp-.js} +2 -2
  14. package/dist/app/assets/{index-BiDION9V.js.map → index-DLgVuxp-.js.map} +1 -1
  15. package/dist/app/assets/main-DR2ma6V-.js +207 -0
  16. package/dist/app/assets/main-DR2ma6V-.js.map +1 -0
  17. package/dist/app/assets/main-Ll-lvqgh.css +1 -0
  18. package/dist/app/assets/{sidebar-section-B3aJWLXB.js → sidebar-section-DKgV3XAx.js} +2 -2
  19. package/dist/app/assets/{sidebar-section-B3aJWLXB.js.map → sidebar-section-DKgV3XAx.js.map} +1 -1
  20. package/dist/app/index.html +2 -2
  21. package/dist/app/toolbar.js +1464 -1429
  22. package/dist/app/toolbar.js.map +1 -1
  23. package/dist/chunks/{parked-questions.DZYZgrSZ.js → phase-progress.DsBJvd_o.js} +1224 -1095
  24. package/dist/chunks/phase-progress.DsBJvd_o.js.map +1 -0
  25. package/dist/cli/index.js +7782 -7627
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/core/index.d.ts +1 -0
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.js +98 -91
  30. package/dist/core/phase-progress.d.ts +16 -0
  31. package/dist/core/phase-progress.d.ts.map +1 -0
  32. package/dist/core/phase-progress.test.d.ts +2 -0
  33. package/dist/core/phase-progress.test.d.ts.map +1 -0
  34. package/dist/core/phase-run.d.ts +17 -0
  35. package/dist/core/phase-run.d.ts.map +1 -0
  36. package/dist/core/phase-run.test.d.ts +2 -0
  37. package/dist/core/phase-run.test.d.ts.map +1 -0
  38. package/dist/core/rate-limit.d.ts +4 -0
  39. package/dist/core/rate-limit.d.ts.map +1 -0
  40. package/dist/core/rate-limit.test.d.ts +2 -0
  41. package/dist/core/rate-limit.test.d.ts.map +1 -0
  42. package/dist/core/sections.d.ts.map +1 -1
  43. package/dist/core/stats.d.ts +5 -1
  44. package/dist/core/stats.d.ts.map +1 -1
  45. package/dist/types/index.d.ts +59 -0
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/types/index.js.map +1 -1
  48. package/package.json +2 -1
  49. package/dist/app/assets/index-0BzPyUVh.js +0 -2
  50. package/dist/app/assets/index-0BzPyUVh.js.map +0 -1
  51. package/dist/app/assets/index-Bz4Df_iX.js +0 -2
  52. package/dist/app/assets/index-C6vBW0wx.js +0 -4
  53. package/dist/app/assets/index-C6vBW0wx.js.map +0 -1
  54. package/dist/app/assets/main-Ba3mXsWY.js +0 -207
  55. package/dist/app/assets/main-Ba3mXsWY.js.map +0 -1
  56. package/dist/app/assets/main-CIoBIAYG.css +0 -1
  57. package/dist/chunks/parked-questions.DZYZgrSZ.js.map +0 -1
@@ -1,207 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Cm3hzD0z.js","./sidebar-section-B3aJWLXB.js","./index-Dtdlcmro.js","./tokens-C3C44lLs.js","./index-CGtPCj1V.js","./index-0BzPyUVh.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Zl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B0={exports:{}},qc={},$0={exports:{}},re={};/**
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 ha=Symbol.for("react.element"),oC=Symbol.for("react.portal"),aC=Symbol.for("react.fragment"),lC=Symbol.for("react.strict_mode"),cC=Symbol.for("react.profiler"),uC=Symbol.for("react.provider"),dC=Symbol.for("react.context"),fC=Symbol.for("react.forward_ref"),hC=Symbol.for("react.suspense"),pC=Symbol.for("react.memo"),mC=Symbol.for("react.lazy"),og=Symbol.iterator;function gC(e){return e===null||typeof e!="object"?null:(e=og&&e[og]||e["@@iterator"],typeof e=="function"?e:null)}var V0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U0=Object.assign,W0={};function Mi(e,t,n){this.props=e,this.context=t,this.refs=W0,this.updater=n||V0}Mi.prototype.isReactComponent={};Mi.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")};Mi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function H0(){}H0.prototype=Mi.prototype;function Xh(e,t,n){this.props=e,this.context=t,this.refs=W0,this.updater=n||V0}var Jh=Xh.prototype=new H0;Jh.constructor=Xh;U0(Jh,Mi.prototype);Jh.isPureReactComponent=!0;var ag=Array.isArray,G0=Object.prototype.hasOwnProperty,Zh={current:null},K0={key:!0,ref:!0,__self:!0,__source:!0};function Q0(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)G0.call(t,r)&&!K0.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:ha,type:e,key:i,ref:o,props:s,_owner:Zh.current}}function yC(e,t){return{$$typeof:ha,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ep(e){return typeof e=="object"&&e!==null&&e.$$typeof===ha}function xC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lg=/\/+/g;function Fu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?xC(""+e.key):t.toString(36)}function Sl(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ha:case oC:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Fu(o,0):r,ag(s)?(n="",e!=null&&(n=e.replace(lg,"$&/")+"/"),Sl(s,t,n,"",function(c){return c})):s!=null&&(ep(s)&&(s=yC(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(lg,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",ag(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Fu(i,a);o+=Sl(i,t,n,l,s)}else if(l=gC(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Fu(i,a++),o+=Sl(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function La(e,t,n){if(e==null)return e;var r=[],s=0;return Sl(e,r,"","",function(i){return t.call(n,i,s++)}),r}function vC(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 dt={current:null},Cl={transition:null},wC={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:Cl,ReactCurrentOwner:Zh};function q0(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:La,forEach:function(e,t,n){La(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return La(e,function(){t++}),t},toArray:function(e){return La(e,function(t){return t})||[]},only:function(e){if(!ep(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Mi;re.Fragment=aC;re.Profiler=cC;re.PureComponent=Xh;re.StrictMode=lC;re.Suspense=hC;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wC;re.act=q0;re.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=U0({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Zh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)G0.call(t,l)&&!K0.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:ha,type:e.type,key:s,ref:i,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:dC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:uC,_context:e},e.Consumer=e};re.createElement=Q0;re.createFactory=function(e){var t=Q0.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:fC,render:e}};re.isValidElement=ep;re.lazy=function(e){return{$$typeof:mC,_payload:{_status:-1,_result:e},_init:vC}};re.memo=function(e,t){return{$$typeof:pC,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Cl.transition;Cl.transition={};try{e()}finally{Cl.transition=t}};re.unstable_act=q0;re.useCallback=function(e,t){return dt.current.useCallback(e,t)};re.useContext=function(e){return dt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};re.useEffect=function(e,t){return dt.current.useEffect(e,t)};re.useId=function(){return dt.current.useId()};re.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return dt.current.useMemo(e,t)};re.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};re.useRef=function(e){return dt.current.useRef(e)};re.useState=function(e){return dt.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return dt.current.useTransition()};re.version="18.3.1";$0.exports=re;var _=$0.exports;const wi=Qc(_);/**
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 bC=_,kC=Symbol.for("react.element"),_C=Symbol.for("react.fragment"),SC=Object.prototype.hasOwnProperty,CC=bC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PC={key:!0,ref:!0,__self:!0,__source:!0};function Y0(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)SC.call(t,r)&&!PC.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:kC,type:e,key:i,ref:o,props:s,_owner:CC.current}}qc.Fragment=_C;qc.jsx=Y0;qc.jsxs=Y0;B0.exports=qc;var f=B0.exports,X0={exports:{}},Ot={},J0={exports:{}},Z0={};/**
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,$){var C=M.length;M.push($);e:for(;0<C;){var V=C-1>>>1,Q=M[V];if(0<s(Q,$))M[V]=$,M[C]=Q,C=V;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var $=M[0],C=M.pop();if(C!==$){M[0]=C;e:for(var V=0,Q=M.length,I=Q>>>1;V<I;){var le=2*(V+1)-1,fe=M[le],ue=le+1,jt=M[ue];if(0>s(fe,C))ue<Q&&0>s(jt,fe)?(M[V]=jt,M[ue]=C,V=ue):(M[V]=fe,M[le]=C,V=le);else if(ue<Q&&0>s(jt,C))M[V]=jt,M[ue]=C,V=ue;else break e}}return $}function s(M,$){var C=M.sortIndex-$.sortIndex;return C!==0?C:M.id-$.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,y=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(M){for(var $=n(c);$!==null;){if($.callback===null)r(c);else if($.startTime<=M)r(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=n(c)}}function b(M){if(y=!1,v(M),!m)if(n(l)!==null)m=!0,L(S);else{var $=n(c);$!==null&&B(b,$.startTime-M)}}function S(M,$){m=!1,y&&(y=!1,g(E),E=-1),p=!0;var C=h;try{for(v($),d=n(l);d!==null&&(!(d.expirationTime>$)||M&&!N());){var V=d.callback;if(typeof V=="function"){d.callback=null,h=d.priorityLevel;var Q=V(d.expirationTime<=$);$=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&r(l),v($)}else r(l);d=n(l)}if(d!==null)var I=!0;else{var le=n(c);le!==null&&B(b,le.startTime-$),I=!1}return I}finally{d=null,h=C,p=!1}}var k=!1,j=null,E=-1,R=5,T=-1;function N(){return!(e.unstable_now()-T<R)}function A(){if(j!==null){var M=e.unstable_now();T=M;var $=!0;try{$=j(!0,M)}finally{$?O():(k=!1,j=null)}}else k=!1}var O;if(typeof x=="function")O=function(){x(A)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,P=z.port2;z.port1.onmessage=A,O=function(){P.postMessage(null)}}else O=function(){w(A,0)};function L(M){j=M,k||(k=!0,O())}function B(M,$){E=w(function(){M(e.unstable_now())},$)}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,L(S))},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"):R=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 $=3;break;default:$=h}var C=h;h=$;try{return M()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,$){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var C=h;h=M;try{return $()}finally{h=C}},e.unstable_scheduleCallback=function(M,$,C){var V=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?V+C:V):C=V,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:$,priorityLevel:M,startTime:C,expirationTime:Q,sortIndex:-1},C>V?(M.sortIndex=C,t(c,M),n(l)===null&&M===n(c)&&(y?(g(E),E=-1):y=!0,B(b,C-V))):(M.sortIndex=Q,t(l,M),m||p||(m=!0,L(S))),M},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(M){var $=h;return function(){var C=h;h=$;try{return M.apply(this,arguments)}finally{h=C}}}})(Z0);J0.exports=Z0;var jC=J0.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 EC=_,Ft=jC;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ew=new Set,$o={};function Is(e,t){bi(e,t),bi(e+"Capture",t)}function bi(e,t){for($o[e]=t,e=0;e<t.length;e++)ew.add(t[e])}var er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ff=Object.prototype.hasOwnProperty,TC=/^[: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]*$/,cg={},ug={};function RC(e){return ff.call(ug,e)?!0:ff.call(cg,e)?!1:TC.test(e)?ug[e]=!0:(cg[e]=!0,!1)}function IC(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 NC(e,t,n,r){if(t===null||typeof t>"u"||IC(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 ft(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 Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ft(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){Je[e]=new ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var tp=/[\-:]([a-z])/g;function np(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(tp,np);Je[t]=new ft(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(tp,np);Je[t]=new ft(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(tp,np);Je[t]=new ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function rp(e,t,n,r){var s=Je.hasOwnProperty(t)?Je[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(NC(t,n,s,r)&&(n=null),r||s===null?RC(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ir=EC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Da=Symbol.for("react.element"),Ys=Symbol.for("react.portal"),Xs=Symbol.for("react.fragment"),sp=Symbol.for("react.strict_mode"),hf=Symbol.for("react.profiler"),tw=Symbol.for("react.provider"),nw=Symbol.for("react.context"),ip=Symbol.for("react.forward_ref"),pf=Symbol.for("react.suspense"),mf=Symbol.for("react.suspense_list"),op=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),rw=Symbol.for("react.offscreen"),dg=Symbol.iterator;function Yi(e){return e===null||typeof e!="object"?null:(e=dg&&e[dg]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Ou;function xo(e){if(Ou===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ou=t&&t[1]||""}return`
35
- `+Ou+e}var zu=!1;function Bu(e,t){if(!e||zu)return"";zu=!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{zu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?xo(e):""}function AC(e){switch(e.tag){case 5:return xo(e.type);case 16:return xo("Lazy");case 13:return xo("Suspense");case 19:return xo("SuspenseList");case 0:case 2:case 15:return e=Bu(e.type,!1),e;case 11:return e=Bu(e.type.render,!1),e;case 1:return e=Bu(e.type,!0),e;default:return""}}function gf(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 Xs:return"Fragment";case Ys:return"Portal";case hf:return"Profiler";case sp:return"StrictMode";case pf:return"Suspense";case mf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nw:return(e.displayName||"Context")+".Consumer";case tw:return(e._context.displayName||"Context")+".Provider";case ip:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case op:return t=e.displayName||null,t!==null?t:gf(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return gf(e(t))}catch{}}return null}function MC(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 gf(t);case 8:return t===sp?"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 Vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function LC(e){var t=sw(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 Fa(e){e._valueTracker||(e._valueTracker=LC(e))}function iw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ec(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yf(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vr(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 ow(e,t){t=t.checked,t!=null&&rp(e,"checked",t,!1)}function xf(e,t){ow(e,t);var n=Vr(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")?vf(e,t.type,n):t.hasOwnProperty("defaultValue")&&vf(e,t.type,Vr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hg(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 vf(e,t,n){(t!=="number"||ec(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vo=Array.isArray;function di(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=""+Vr(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 wf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(vo(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vr(n)}}function aw(e,t){var n=Vr(t.value),r=Vr(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 mg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lw(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 bf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Oa,cw=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(Oa=Oa||document.createElement("div"),Oa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Oa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var So={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},DC=["Webkit","ms","Moz","O"];Object.keys(So).forEach(function(e){DC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),So[t]=So[e]})});function uw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||So.hasOwnProperty(e)&&So[e]?(""+t).trim():t+"px"}function dw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=uw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var FC=je({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 kf(e,t){if(t){if(FC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function _f(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 Sf=null;function ap(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cf=null,fi=null,hi=null;function gg(e){if(e=ga(e)){if(typeof Cf!="function")throw Error(U(280));var t=e.stateNode;t&&(t=eu(t),Cf(e.stateNode,e.type,t))}}function fw(e){fi?hi?hi.push(e):hi=[e]:fi=e}function hw(){if(fi){var e=fi,t=hi;if(hi=fi=null,gg(e),t)for(e=0;e<t.length;e++)gg(t[e])}}function pw(e,t){return e(t)}function mw(){}var $u=!1;function gw(e,t,n){if($u)return e(t,n);$u=!0;try{return pw(e,t,n)}finally{$u=!1,(fi!==null||hi!==null)&&(mw(),hw())}}function Uo(e,t){var n=e.stateNode;if(n===null)return null;var r=eu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(U(231,t,typeof n));return n}var Pf=!1;if(er)try{var Xi={};Object.defineProperty(Xi,"passive",{get:function(){Pf=!0}}),window.addEventListener("test",Xi,Xi),window.removeEventListener("test",Xi,Xi)}catch{Pf=!1}function OC(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 Co=!1,tc=null,nc=!1,jf=null,zC={onError:function(e){Co=!0,tc=e}};function BC(e,t,n,r,s,i,o,a,l){Co=!1,tc=null,OC.apply(zC,arguments)}function $C(e,t,n,r,s,i,o,a,l){if(BC.apply(this,arguments),Co){if(Co){var c=tc;Co=!1,tc=null}else throw Error(U(198));nc||(nc=!0,jf=c)}}function Ns(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 yw(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 yg(e){if(Ns(e)!==e)throw Error(U(188))}function VC(e){var t=e.alternate;if(!t){if(t=Ns(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return yg(s),e;if(i===r)return yg(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function xw(e){return e=VC(e),e!==null?vw(e):null}function vw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vw(e);if(t!==null)return t;e=e.sibling}return null}var ww=Ft.unstable_scheduleCallback,xg=Ft.unstable_cancelCallback,UC=Ft.unstable_shouldYield,WC=Ft.unstable_requestPaint,Me=Ft.unstable_now,HC=Ft.unstable_getCurrentPriorityLevel,lp=Ft.unstable_ImmediatePriority,bw=Ft.unstable_UserBlockingPriority,rc=Ft.unstable_NormalPriority,GC=Ft.unstable_LowPriority,kw=Ft.unstable_IdlePriority,Yc=null,Nn=null;function KC(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(Yc,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:YC,QC=Math.log,qC=Math.LN2;function YC(e){return e>>>=0,e===0?32:31-(QC(e)/qC|0)|0}var za=64,Ba=4194304;function wo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function sc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=wo(a):(i&=o,i!==0&&(r=wo(i)))}else o=n&~s,o!==0?r=wo(o):i!==0&&(r=wo(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-pn(t),s=1<<n,r|=e[n],t&=~s;return r}function XC(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 JC(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-pn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=XC(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Ef(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _w(){var e=za;return za<<=1,!(za&4194240)&&(za=64),e}function Vu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=n}function ZC(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-pn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function cp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-pn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ce=0;function Sw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Cw,up,Pw,jw,Ew,Tf=!1,$a=[],Nr=null,Ar=null,Mr=null,Wo=new Map,Ho=new Map,_r=[],eP="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 vg(e,t){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":Wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(t.pointerId)}}function Ji(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=ga(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function tP(e,t,n,r,s){switch(t){case"focusin":return Nr=Ji(Nr,e,t,n,r,s),!0;case"dragenter":return Ar=Ji(Ar,e,t,n,r,s),!0;case"mouseover":return Mr=Ji(Mr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Wo.set(i,Ji(Wo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Ho.set(i,Ji(Ho.get(i)||null,e,t,n,r,s)),!0}return!1}function Tw(e){var t=ds(e.target);if(t!==null){var n=Ns(t);if(n!==null){if(t=n.tag,t===13){if(t=yw(n),t!==null){e.blockedOn=t,Ew(e.priority,function(){Pw(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 Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sf=r,n.target.dispatchEvent(r),Sf=null}else return t=ga(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function wg(e,t,n){Pl(e)&&n.delete(t)}function nP(){Tf=!1,Nr!==null&&Pl(Nr)&&(Nr=null),Ar!==null&&Pl(Ar)&&(Ar=null),Mr!==null&&Pl(Mr)&&(Mr=null),Wo.forEach(wg),Ho.forEach(wg)}function Zi(e,t){e.blockedOn===t&&(e.blockedOn=null,Tf||(Tf=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,nP)))}function Go(e){function t(s){return Zi(s,e)}if(0<$a.length){Zi($a[0],e);for(var n=1;n<$a.length;n++){var r=$a[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Nr!==null&&Zi(Nr,e),Ar!==null&&Zi(Ar,e),Mr!==null&&Zi(Mr,e),Wo.forEach(t),Ho.forEach(t),n=0;n<_r.length;n++)r=_r[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_r.length&&(n=_r[0],n.blockedOn===null);)Tw(n),n.blockedOn===null&&_r.shift()}var pi=ir.ReactCurrentBatchConfig,ic=!0;function rP(e,t,n,r){var s=ce,i=pi.transition;pi.transition=null;try{ce=1,dp(e,t,n,r)}finally{ce=s,pi.transition=i}}function sP(e,t,n,r){var s=ce,i=pi.transition;pi.transition=null;try{ce=4,dp(e,t,n,r)}finally{ce=s,pi.transition=i}}function dp(e,t,n,r){if(ic){var s=Rf(e,t,n,r);if(s===null)Ju(e,t,r,oc,n),vg(e,r);else if(tP(s,e,t,n,r))r.stopPropagation();else if(vg(e,r),t&4&&-1<eP.indexOf(e)){for(;s!==null;){var i=ga(s);if(i!==null&&Cw(i),i=Rf(e,t,n,r),i===null&&Ju(e,t,r,oc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Ju(e,t,r,null,n)}}var oc=null;function Rf(e,t,n,r){if(oc=null,e=ap(r),e=ds(e),e!==null)if(t=Ns(e),t===null)e=null;else if(n=t.tag,n===13){if(e=yw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return oc=e,null}function Rw(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(HC()){case lp:return 1;case bw:return 4;case rc:case GC:return 16;case kw:return 536870912;default:return 16}default:return 16}}var Cr=null,fp=null,jl=null;function Iw(){if(jl)return jl;var e,t=fp,n=t.length,r,s="value"in Cr?Cr.value:Cr.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 jl=s.slice(e,1<r?1-r:void 0)}function El(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Va(){return!0}function bg(){return!1}function zt(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)?Va:bg,this.isPropagationStopped=bg,this}return je(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=Va)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Va)},persist:function(){},isPersistent:Va}),t}var Li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hp=zt(Li),ma=je({},Li,{view:0,detail:0}),iP=zt(ma),Uu,Wu,eo,Xc=je({},ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pp,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!==eo&&(eo&&e.type==="mousemove"?(Uu=e.screenX-eo.screenX,Wu=e.screenY-eo.screenY):Wu=Uu=0,eo=e),Uu)},movementY:function(e){return"movementY"in e?e.movementY:Wu}}),kg=zt(Xc),oP=je({},Xc,{dataTransfer:0}),aP=zt(oP),lP=je({},ma,{relatedTarget:0}),Hu=zt(lP),cP=je({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),uP=zt(cP),dP=je({},Li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fP=zt(dP),hP=je({},Li,{data:0}),_g=zt(hP),pP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mP={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"},gP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gP[e])?!!t[e]:!1}function pp(){return yP}var xP=je({},ma,{key:function(e){if(e.key){var t=pP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pp,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vP=zt(xP),wP=je({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sg=zt(wP),bP=je({},ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pp}),kP=zt(bP),_P=je({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),SP=zt(_P),CP=je({},Xc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),PP=zt(CP),jP=[9,13,27,32],mp=er&&"CompositionEvent"in window,Po=null;er&&"documentMode"in document&&(Po=document.documentMode);var EP=er&&"TextEvent"in window&&!Po,Nw=er&&(!mp||Po&&8<Po&&11>=Po),Cg=" ",Pg=!1;function Aw(e,t){switch(e){case"keyup":return jP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function TP(e,t){switch(e){case"compositionend":return Mw(t);case"keypress":return t.which!==32?null:(Pg=!0,Cg);case"textInput":return e=t.data,e===Cg&&Pg?null:e;default:return null}}function RP(e,t){if(Js)return e==="compositionend"||!mp&&Aw(e,t)?(e=Iw(),jl=fp=Cr=null,Js=!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 Nw&&t.locale!=="ko"?null:t.data;default:return null}}var IP={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 jg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IP[e.type]:t==="textarea"}function Lw(e,t,n,r){fw(r),t=ac(t,"onChange"),0<t.length&&(n=new hp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jo=null,Ko=null;function NP(e){Gw(e,0)}function Jc(e){var t=ti(e);if(iw(t))return e}function AP(e,t){if(e==="change")return t}var Dw=!1;if(er){var Gu;if(er){var Ku="oninput"in document;if(!Ku){var Eg=document.createElement("div");Eg.setAttribute("oninput","return;"),Ku=typeof Eg.oninput=="function"}Gu=Ku}else Gu=!1;Dw=Gu&&(!document.documentMode||9<document.documentMode)}function Tg(){jo&&(jo.detachEvent("onpropertychange",Fw),Ko=jo=null)}function Fw(e){if(e.propertyName==="value"&&Jc(Ko)){var t=[];Lw(t,Ko,e,ap(e)),gw(NP,t)}}function MP(e,t,n){e==="focusin"?(Tg(),jo=t,Ko=n,jo.attachEvent("onpropertychange",Fw)):e==="focusout"&&Tg()}function LP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jc(Ko)}function DP(e,t){if(e==="click")return Jc(t)}function FP(e,t){if(e==="input"||e==="change")return Jc(t)}function OP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:OP;function Qo(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!ff.call(t,s)||!xn(e[s],t[s]))return!1}return!0}function Rg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ig(e,t){var n=Rg(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=Rg(n)}}function Ow(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ow(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zw(){for(var e=window,t=ec();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ec(e.document)}return t}function gp(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 zP(e){var t=zw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ow(n.ownerDocument.documentElement,n)){if(r!==null&&gp(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=Ig(n,i);var o=Ig(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 BP=er&&"documentMode"in document&&11>=document.documentMode,Zs=null,If=null,Eo=null,Nf=!1;function Ng(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nf||Zs==null||Zs!==ec(r)||(r=Zs,"selectionStart"in r&&gp(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}),Eo&&Qo(Eo,r)||(Eo=r,r=ac(If,"onSelect"),0<r.length&&(t=new hp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function Ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ei={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionend:Ua("Transition","TransitionEnd")},Qu={},Bw={};er&&(Bw=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function Zc(e){if(Qu[e])return Qu[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bw)return Qu[e]=t[n];return e}var $w=Zc("animationend"),Vw=Zc("animationiteration"),Uw=Zc("animationstart"),Ww=Zc("transitionend"),Hw=new Map,Ag="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Kr(e,t){Hw.set(e,t),Is(t,[e])}for(var qu=0;qu<Ag.length;qu++){var Yu=Ag[qu],$P=Yu.toLowerCase(),VP=Yu[0].toUpperCase()+Yu.slice(1);Kr($P,"on"+VP)}Kr($w,"onAnimationEnd");Kr(Vw,"onAnimationIteration");Kr(Uw,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(Ww,"onTransitionEnd");bi("onMouseEnter",["mouseout","mouseover"]);bi("onMouseLeave",["mouseout","mouseover"]);bi("onPointerEnter",["pointerout","pointerover"]);bi("onPointerLeave",["pointerout","pointerover"]);Is("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Is("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Is("onBeforeInput",["compositionend","keypress","textInput","paste"]);Is("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Is("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Is("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="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(" "),UP=new Set("cancel close invalid load scroll toggle".split(" ").concat(bo));function Mg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$C(r,t,void 0,e),e.currentTarget=null}function Gw(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;Mg(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;Mg(s,a,c),i=l}}}if(nc)throw e=jf,nc=!1,jf=null,e}function be(e,t){var n=t[Ff];n===void 0&&(n=t[Ff]=new Set);var r=e+"__bubble";n.has(r)||(Kw(t,e,2,!1),n.add(r))}function Xu(e,t,n){var r=0;t&&(r|=4),Kw(n,e,r,t)}var Wa="_reactListening"+Math.random().toString(36).slice(2);function qo(e){if(!e[Wa]){e[Wa]=!0,ew.forEach(function(n){n!=="selectionchange"&&(UP.has(n)||Xu(n,!1,e),Xu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wa]||(t[Wa]=!0,Xu("selectionchange",!1,t))}}function Kw(e,t,n,r){switch(Rw(t)){case 1:var s=rP;break;case 4:s=sP;break;default:s=dp}n=s.bind(null,t,n,e),s=void 0,!Pf||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 Ju(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=ds(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}gw(function(){var c=i,u=ap(n),d=[];e:{var h=Hw.get(e);if(h!==void 0){var p=hp,m=e;switch(e){case"keypress":if(El(n)===0)break e;case"keydown":case"keyup":p=vP;break;case"focusin":m="focus",p=Hu;break;case"focusout":m="blur",p=Hu;break;case"beforeblur":case"afterblur":p=Hu;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=kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=aP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=kP;break;case $w:case Vw:case Uw:p=uP;break;case Ww:p=SP;break;case"scroll":p=iP;break;case"wheel":p=PP;break;case"copy":case"cut":case"paste":p=fP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Sg}var y=(t&4)!==0,w=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var x=c,v;x!==null;){v=x;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,g!==null&&(b=Uo(x,g),b!=null&&y.push(Yo(x,b,v)))),w)break;x=x.return}0<y.length&&(h=new p(h,m,null,n,u),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Sf&&(m=n.relatedTarget||n.fromElement)&&(ds(m)||m[tr]))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?ds(m):null,m!==null&&(w=Ns(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=kg,b="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Sg,b="onPointerLeave",g="onPointerEnter",x="pointer"),w=p==null?h:ti(p),v=m==null?h:ti(m),h=new y(b,x+"leave",p,n,u),h.target=w,h.relatedTarget=v,b=null,ds(u)===c&&(y=new y(g,x+"enter",m,n,u),y.target=v,y.relatedTarget=w,b=y),w=b,p&&m)t:{for(y=p,g=m,x=0,v=y;v;v=zs(v))x++;for(v=0,b=g;b;b=zs(b))v++;for(;0<x-v;)y=zs(y),x--;for(;0<v-x;)g=zs(g),v--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=zs(y),g=zs(g)}y=null}else y=null;p!==null&&Lg(d,h,p,y,!1),m!==null&&w!==null&&Lg(d,w,m,y,!0)}}e:{if(h=c?ti(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=AP;else if(jg(h))if(Dw)S=FP;else{S=LP;var k=MP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=DP);if(S&&(S=S(e,c))){Lw(d,S,n,u);break e}k&&k(e,h,c),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&vf(h,"number",h.value)}switch(k=c?ti(c):window,e){case"focusin":(jg(k)||k.contentEditable==="true")&&(Zs=k,If=c,Eo=null);break;case"focusout":Eo=If=Zs=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Ng(d,n,u);break;case"selectionchange":if(BP)break;case"keydown":case"keyup":Ng(d,n,u)}var j;if(mp)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 Js?Aw(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Nw&&n.locale!=="ko"&&(Js||E!=="onCompositionStart"?E==="onCompositionEnd"&&Js&&(j=Iw()):(Cr=u,fp="value"in Cr?Cr.value:Cr.textContent,Js=!0)),k=ac(c,E),0<k.length&&(E=new _g(E,e,null,n,u),d.push({event:E,listeners:k}),j?E.data=j:(j=Mw(n),j!==null&&(E.data=j)))),(j=EP?TP(e,n):RP(e,n))&&(c=ac(c,"onBeforeInput"),0<c.length&&(u=new _g("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=j))}Gw(d,t)})}function Yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ac(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Uo(e,n),i!=null&&r.unshift(Yo(e,i,s)),i=Uo(e,t),i!=null&&r.push(Yo(e,i,s))),e=e.return}return r}function zs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lg(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=Uo(n,i),l!=null&&o.unshift(Yo(n,l,a))):s||(l=Uo(n,i),l!=null&&o.push(Yo(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var WP=/\r\n?/g,HP=/\u0000|\uFFFD/g;function Dg(e){return(typeof e=="string"?e:""+e).replace(WP,`
39
- `).replace(HP,"")}function Ha(e,t,n){if(t=Dg(t),Dg(e)!==t&&n)throw Error(U(425))}function lc(){}var Af=null,Mf=null;function Lf(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 Df=typeof setTimeout=="function"?setTimeout:void 0,GP=typeof clearTimeout=="function"?clearTimeout:void 0,Fg=typeof Promise=="function"?Promise:void 0,KP=typeof queueMicrotask=="function"?queueMicrotask:typeof Fg<"u"?function(e){return Fg.resolve(null).then(e).catch(QP)}:Df;function QP(e){setTimeout(function(){throw e})}function Zu(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),Go(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Go(t)}function Lr(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 Og(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 Di=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Di,Xo="__reactProps$"+Di,tr="__reactContainer$"+Di,Ff="__reactEvents$"+Di,qP="__reactListeners$"+Di,YP="__reactHandles$"+Di;function ds(e){var t=e[Rn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tr]||n[Rn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Og(e);e!==null;){if(n=e[Rn])return n;e=Og(e)}return t}e=n,n=e.parentNode}return null}function ga(e){return e=e[Rn]||e[tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ti(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function eu(e){return e[Xo]||null}var Of=[],ni=-1;function Qr(e){return{current:e}}function ke(e){0>ni||(e.current=Of[ni],Of[ni]=null,ni--)}function xe(e,t){ni++,Of[ni]=e.current,e.current=t}var Ur={},it=Qr(Ur),xt=Qr(!1),Cs=Ur;function ki(e,t){var n=e.type.contextTypes;if(!n)return Ur;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 vt(e){return e=e.childContextTypes,e!=null}function cc(){ke(xt),ke(it)}function zg(e,t,n){if(it.current!==Ur)throw Error(U(168));xe(it,t),xe(xt,n)}function Qw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,MC(e)||"Unknown",s));return je({},n,r)}function uc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ur,Cs=it.current,xe(it,e),xe(xt,xt.current),!0}function Bg(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=Qw(e,t,Cs),r.__reactInternalMemoizedMergedChildContext=e,ke(xt),ke(it),xe(it,e)):ke(xt),xe(xt,n)}var Gn=null,tu=!1,ed=!1;function qw(e){Gn===null?Gn=[e]:Gn.push(e)}function XP(e){tu=!0,qw(e)}function qr(){if(!ed&&Gn!==null){ed=!0;var e=0,t=ce;try{var n=Gn;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Gn=null,tu=!1}catch(s){throw Gn!==null&&(Gn=Gn.slice(e+1)),ww(lp,qr),s}finally{ce=t,ed=!1}}return null}var ri=[],si=0,dc=null,fc=0,Gt=[],Kt=0,Ps=null,Yn=1,Xn="";function os(e,t){ri[si++]=fc,ri[si++]=dc,dc=e,fc=t}function Yw(e,t,n){Gt[Kt++]=Yn,Gt[Kt++]=Xn,Gt[Kt++]=Ps,Ps=e;var r=Yn;e=Xn;var s=32-pn(r)-1;r&=~(1<<s),n+=1;var i=32-pn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Yn=1<<32-pn(t)+s|n<<s|r,Xn=i+e}else Yn=1<<i|n<<s|r,Xn=e}function yp(e){e.return!==null&&(os(e,1),Yw(e,1,0))}function xp(e){for(;e===dc;)dc=ri[--si],ri[si]=null,fc=ri[--si],ri[si]=null;for(;e===Ps;)Ps=Gt[--Kt],Gt[Kt]=null,Xn=Gt[--Kt],Gt[Kt]=null,Yn=Gt[--Kt],Gt[Kt]=null}var Lt=null,At=null,Se=!1,hn=null;function Xw(e,t){var n=qt(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 $g(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,Lt=e,At=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,At=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ps!==null?{id:Yn,overflow:Xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Lt=e,At=null,!0):!1;default:return!1}}function zf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bf(e){if(Se){var t=At;if(t){var n=t;if(!$g(e,t)){if(zf(e))throw Error(U(418));t=Lr(n.nextSibling);var r=Lt;t&&$g(e,t)?Xw(r,n):(e.flags=e.flags&-4097|2,Se=!1,Lt=e)}}else{if(zf(e))throw Error(U(418));e.flags=e.flags&-4097|2,Se=!1,Lt=e}}}function Vg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function Ga(e){if(e!==Lt)return!1;if(!Se)return Vg(e),Se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lf(e.type,e.memoizedProps)),t&&(t=At)){if(zf(e))throw Jw(),Error(U(418));for(;t;)Xw(e,t),t=Lr(t.nextSibling)}if(Vg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){At=Lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}At=null}}else At=Lt?Lr(e.stateNode.nextSibling):null;return!0}function Jw(){for(var e=At;e;)e=Lr(e.nextSibling)}function _i(){At=Lt=null,Se=!1}function vp(e){hn===null?hn=[e]:hn.push(e)}var JP=ir.ReactCurrentBatchConfig;function to(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function Ka(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ug(e){var t=e._init;return t(e._payload)}function Zw(e){function t(g,x){if(e){var v=g.deletions;v===null?(g.deletions=[x],g.flags|=16):v.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=zr(g,x),g.index=0,g.sibling=null,g}function i(g,x,v){return g.index=v,e?(v=g.alternate,v!==null?(v=v.index,v<x?(g.flags|=2,x):v):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,v,b){return x===null||x.tag!==6?(x=ad(v,g.mode,b),x.return=g,x):(x=s(x,v),x.return=g,x)}function l(g,x,v,b){var S=v.type;return S===Xs?u(g,x,v.props.children,b,v.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Ug(S)===x.type)?(b=s(x,v.props),b.ref=to(g,x,v),b.return=g,b):(b=Ll(v.type,v.key,v.props,null,g.mode,b),b.ref=to(g,x,v),b.return=g,b)}function c(g,x,v,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=ld(v,g.mode,b),x.return=g,x):(x=s(x,v.children||[]),x.return=g,x)}function u(g,x,v,b,S){return x===null||x.tag!==7?(x=xs(v,g.mode,b,S),x.return=g,x):(x=s(x,v),x.return=g,x)}function d(g,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=ad(""+x,g.mode,v),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Da:return v=Ll(x.type,x.key,x.props,null,g.mode,v),v.ref=to(g,null,x),v.return=g,v;case Ys:return x=ld(x,g.mode,v),x.return=g,x;case wr:var b=x._init;return d(g,b(x._payload),v)}if(vo(x)||Yi(x))return x=xs(x,g.mode,v,null),x.return=g,x;Ka(g,x)}return null}function h(g,x,v,b){var S=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return S!==null?null:a(g,x,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Da:return v.key===S?l(g,x,v,b):null;case Ys:return v.key===S?c(g,x,v,b):null;case wr:return S=v._init,h(g,x,S(v._payload),b)}if(vo(v)||Yi(v))return S!==null?null:u(g,x,v,b,null);Ka(g,v)}return null}function p(g,x,v,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(v)||null,a(x,g,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Da:return g=g.get(b.key===null?v:b.key)||null,l(x,g,b,S);case Ys:return g=g.get(b.key===null?v:b.key)||null,c(x,g,b,S);case wr:var k=b._init;return p(g,x,v,k(b._payload),S)}if(vo(b)||Yi(b))return g=g.get(v)||null,u(x,g,b,S,null);Ka(x,b)}return null}function m(g,x,v,b){for(var S=null,k=null,j=x,E=x=0,R=null;j!==null&&E<v.length;E++){j.index>E?(R=j,j=null):R=j.sibling;var T=h(g,j,v[E],b);if(T===null){j===null&&(j=R);break}e&&j&&T.alternate===null&&t(g,j),x=i(T,x,E),k===null?S=T:k.sibling=T,k=T,j=R}if(E===v.length)return n(g,j),Se&&os(g,E),S;if(j===null){for(;E<v.length;E++)j=d(g,v[E],b),j!==null&&(x=i(j,x,E),k===null?S=j:k.sibling=j,k=j);return Se&&os(g,E),S}for(j=r(g,j);E<v.length;E++)R=p(j,g,E,v[E],b),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?E:R.key),x=i(R,x,E),k===null?S=R:k.sibling=R,k=R);return e&&j.forEach(function(N){return t(g,N)}),Se&&os(g,E),S}function y(g,x,v,b){var S=Yi(v);if(typeof S!="function")throw Error(U(150));if(v=S.call(v),v==null)throw Error(U(151));for(var k=S=null,j=x,E=x=0,R=null,T=v.next();j!==null&&!T.done;E++,T=v.next()){j.index>E?(R=j,j=null):R=j.sibling;var N=h(g,j,T.value,b);if(N===null){j===null&&(j=R);break}e&&j&&N.alternate===null&&t(g,j),x=i(N,x,E),k===null?S=N:k.sibling=N,k=N,j=R}if(T.done)return n(g,j),Se&&os(g,E),S;if(j===null){for(;!T.done;E++,T=v.next())T=d(g,T.value,b),T!==null&&(x=i(T,x,E),k===null?S=T:k.sibling=T,k=T);return Se&&os(g,E),S}for(j=r(g,j);!T.done;E++,T=v.next())T=p(j,g,E,T.value,b),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?E:T.key),x=i(T,x,E),k===null?S=T:k.sibling=T,k=T);return e&&j.forEach(function(A){return t(g,A)}),Se&&os(g,E),S}function w(g,x,v,b){if(typeof v=="object"&&v!==null&&v.type===Xs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Da:e:{for(var S=v.key,k=x;k!==null;){if(k.key===S){if(S=v.type,S===Xs){if(k.tag===7){n(g,k.sibling),x=s(k,v.props.children),x.return=g,g=x;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Ug(S)===k.type){n(g,k.sibling),x=s(k,v.props),x.ref=to(g,k,v),x.return=g,g=x;break e}n(g,k);break}else t(g,k);k=k.sibling}v.type===Xs?(x=xs(v.props.children,g.mode,b,v.key),x.return=g,g=x):(b=Ll(v.type,v.key,v.props,null,g.mode,b),b.ref=to(g,x,v),b.return=g,g=b)}return o(g);case Ys:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=s(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=ld(v,g.mode,b),x.return=g,g=x}return o(g);case wr:return k=v._init,w(g,x,k(v._payload),b)}if(vo(v))return m(g,x,v,b);if(Yi(v))return y(g,x,v,b);Ka(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,v),x.return=g,g=x):(n(g,x),x=ad(v,g.mode,b),x.return=g,g=x),o(g)):n(g,x)}return w}var Si=Zw(!0),e1=Zw(!1),hc=Qr(null),pc=null,ii=null,wp=null;function bp(){wp=ii=pc=null}function kp(e){var t=hc.current;ke(hc),e._currentValue=t}function $f(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 mi(e,t){pc=e,wp=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function Zt(e){var t=e._currentValue;if(wp!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(pc===null)throw Error(U(308));ii=e,pc.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var fs=null;function _p(e){fs===null?fs=[e]:fs.push(e)}function t1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,_p(t)):(n.next=s.next,s.next=n),t.interleaved=n,nr(e,r)}function nr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var br=!1;function Sp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,nr(e,n)}return s=r.interleaved,s===null?(t.next=t,_p(r)):(t.next=s.next,s.next=t),r.interleaved=t,nr(e,n)}function Tl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cp(e,n)}}function Wg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function mc(e,t,n,r){var s=e.updateQueue;br=!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,y=a;switch(h=t,p=n,y.tag){case 1:if(m=y.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=y.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=je({},d,h);break e;case 2:br=!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);Es|=o,e.lanes=o,e.memoizedState=d}}function Hg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var ya={},An=Qr(ya),Jo=Qr(ya),Zo=Qr(ya);function hs(e){if(e===ya)throw Error(U(174));return e}function Cp(e,t){switch(xe(Zo,t),xe(Jo,e),xe(An,ya),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:bf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=bf(t,e)}ke(An),xe(An,t)}function Ci(){ke(An),ke(Jo),ke(Zo)}function r1(e){hs(Zo.current);var t=hs(An.current),n=bf(t,e.type);t!==n&&(xe(Jo,e),xe(An,n))}function Pp(e){Jo.current===e&&(ke(An),ke(Jo))}var Ce=Qr(0);function gc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var td=[];function jp(){for(var e=0;e<td.length;e++)td[e]._workInProgressVersionPrimary=null;td.length=0}var Rl=ir.ReactCurrentDispatcher,nd=ir.ReactCurrentBatchConfig,js=0,Pe=null,$e=null,Ge=null,yc=!1,To=!1,ea=0,ZP=0;function et(){throw Error(U(321))}function Ep(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xn(e[n],t[n]))return!1;return!0}function Tp(e,t,n,r,s,i){if(js=i,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Rl.current=e===null||e.memoizedState===null?rj:sj,e=n(r,s),To){i=0;do{if(To=!1,ea=0,25<=i)throw Error(U(301));i+=1,Ge=$e=null,t.updateQueue=null,Rl.current=ij,e=n(r,s)}while(To)}if(Rl.current=xc,t=$e!==null&&$e.next!==null,js=0,Ge=$e=Pe=null,yc=!1,t)throw Error(U(300));return e}function Rp(){var e=ea!==0;return ea=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?Pe.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function en(){if($e===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=Ge===null?Pe.memoizedState:Ge.next;if(t!==null)Ge=t,$e=e;else{if(e===null)throw Error(U(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},Ge===null?Pe.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function ta(e,t){return typeof t=="function"?t(e):t}function rd(e){var t=en(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=$e,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((js&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,Pe.lanes|=u,Es|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,xn(r,t.memoizedState)||(gt=!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,Pe.lanes|=i,Es|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sd(e){var t=en(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);xn(i,t.memoizedState)||(gt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function s1(){}function i1(e,t){var n=Pe,r=en(),s=t(),i=!xn(r.memoizedState,s);if(i&&(r.memoizedState=s,gt=!0),r=r.queue,Ip(l1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ge!==null&&Ge.memoizedState.tag&1){if(n.flags|=2048,na(9,a1.bind(null,n,r,s,t),void 0,null),Ke===null)throw Error(U(349));js&30||o1(n,t,s)}return s}function o1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function a1(e,t,n,r){t.value=n,t.getSnapshot=r,c1(t)&&u1(e)}function l1(e,t,n){return n(function(){c1(t)&&u1(e)})}function c1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xn(e,n)}catch{return!0}}function u1(e){var t=nr(e,1);t!==null&&mn(t,e,1,-1)}function Gg(e){var t=Cn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:e},t.queue=e,e=e.dispatch=nj.bind(null,Pe,e),[t.memoizedState,e]}function na(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.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 d1(){return en().memoizedState}function Il(e,t,n,r){var s=Cn();Pe.flags|=e,s.memoizedState=na(1|t,n,void 0,r===void 0?null:r)}function nu(e,t,n,r){var s=en();r=r===void 0?null:r;var i=void 0;if($e!==null){var o=$e.memoizedState;if(i=o.destroy,r!==null&&Ep(r,o.deps)){s.memoizedState=na(t,n,i,r);return}}Pe.flags|=e,s.memoizedState=na(1|t,n,i,r)}function Kg(e,t){return Il(8390656,8,e,t)}function Ip(e,t){return nu(2048,8,e,t)}function f1(e,t){return nu(4,2,e,t)}function h1(e,t){return nu(4,4,e,t)}function p1(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 m1(e,t,n){return n=n!=null?n.concat([e]):null,nu(4,4,p1.bind(null,t,e),n)}function Np(){}function g1(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ep(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function y1(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ep(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function x1(e,t,n){return js&21?(xn(n,t)||(n=_w(),Pe.lanes|=n,Es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=n)}function ej(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=nd.transition;nd.transition={};try{e(!1),t()}finally{ce=n,nd.transition=r}}function v1(){return en().memoizedState}function tj(e,t,n){var r=Or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},w1(e))b1(t,n);else if(n=t1(e,t,n,r),n!==null){var s=ut();mn(n,e,r,s),k1(n,t,r)}}function nj(e,t,n){var r=Or(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(w1(e))b1(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,xn(a,o)){var l=t.interleaved;l===null?(s.next=s,_p(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=t1(e,t,s,r),n!==null&&(s=ut(),mn(n,e,r,s),k1(n,t,r))}}function w1(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function b1(e,t){To=yc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function k1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cp(e,n)}}var xc={readContext:Zt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},rj={readContext:Zt,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Kg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Il(4194308,4,p1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Il(4194308,4,e,t)},useInsertionEffect:function(e,t){return Il(4,2,e,t)},useMemo:function(e,t){var n=Cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cn();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=tj.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Gg,useDebugValue:Np,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Gg(!1),t=e[0];return e=ej.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pe,s=Cn();if(Se){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),Ke===null)throw Error(U(349));js&30||o1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Kg(l1.bind(null,r,i,e),[e]),r.flags|=2048,na(9,a1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cn(),t=Ke.identifierPrefix;if(Se){var n=Xn,r=Yn;n=(r&~(1<<32-pn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ea++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ZP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sj={readContext:Zt,useCallback:g1,useContext:Zt,useEffect:Ip,useImperativeHandle:m1,useInsertionEffect:f1,useLayoutEffect:h1,useMemo:y1,useReducer:rd,useRef:d1,useState:function(){return rd(ta)},useDebugValue:Np,useDeferredValue:function(e){var t=en();return x1(t,$e.memoizedState,e)},useTransition:function(){var e=rd(ta)[0],t=en().memoizedState;return[e,t]},useMutableSource:s1,useSyncExternalStore:i1,useId:v1,unstable_isNewReconciler:!1},ij={readContext:Zt,useCallback:g1,useContext:Zt,useEffect:Ip,useImperativeHandle:m1,useInsertionEffect:f1,useLayoutEffect:h1,useMemo:y1,useReducer:sd,useRef:d1,useState:function(){return sd(ta)},useDebugValue:Np,useDeferredValue:function(e){var t=en();return $e===null?t.memoizedState=e:x1(t,$e.memoizedState,e)},useTransition:function(){var e=sd(ta)[0],t=en().memoizedState;return[e,t]},useMutableSource:s1,useSyncExternalStore:i1,useId:v1,unstable_isNewReconciler:!1};function dn(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Vf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ru={isMounted:function(e){return(e=e._reactInternals)?Ns(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Jn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(mn(t,e,s,r),Tl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ut(),s=Or(e),i=Jn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Dr(e,i,s),t!==null&&(mn(t,e,s,r),Tl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ut(),r=Or(e),s=Jn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Dr(e,s,r),t!==null&&(mn(t,e,r,n),Tl(t,e,r))}};function Qg(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?!Qo(n,r)||!Qo(s,i):!0}function _1(e,t,n){var r=!1,s=Ur,i=t.contextType;return typeof i=="object"&&i!==null?i=Zt(i):(s=vt(t)?Cs:it.current,r=t.contextTypes,i=(r=r!=null)?ki(e,s):Ur),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ru,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function qg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ru.enqueueReplaceState(t,t.state,null)}function Uf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Sp(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Zt(i):(i=vt(t)?Cs:it.current,s.context=ki(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Vf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ru.enqueueReplaceState(s,s.state,null),mc(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Pi(e,t){try{var n="",r=t;do n+=AC(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 id(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oj=typeof WeakMap=="function"?WeakMap:Map;function S1(e,t,n){n=Jn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){wc||(wc=!0,eh=r),Wf(e,t)},n}function C1(e,t,n){n=Jn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Wf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Wf(e,t),typeof r!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Yg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oj;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=wj.bind(null,e,t,n),t.then(e,e))}function Xg(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 Jg(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jn(-1,1),t.tag=2,Dr(n,t,1))),n.lanes|=1),e)}var aj=ir.ReactCurrentOwner,gt=!1;function at(e,t,n,r){t.child=e===null?e1(t,null,n,r):Si(t,e.child,n,r)}function Zg(e,t,n,r,s){n=n.render;var i=t.ref;return mi(t,s),r=Tp(e,t,n,r,i,s),n=Rp(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,rr(e,t,s)):(Se&&n&&yp(t),t.flags|=1,at(e,t,r,s),t.child)}function ey(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Bp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,P1(e,t,i,r,s)):(e=Ll(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qo,n(o,r)&&e.ref===t.ref)return rr(e,t,s)}return t.flags|=1,e=zr(i,r),e.ref=t.ref,e.return=t,t.child=e}function P1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Qo(i,r)&&e.ref===t.ref)if(gt=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,rr(e,t,s)}return Hf(e,t,n,r,s)}function j1(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},xe(ai,Nt),Nt|=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,xe(ai,Nt),Nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,xe(ai,Nt),Nt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,xe(ai,Nt),Nt|=r;return at(e,t,s,n),t.child}function E1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hf(e,t,n,r,s){var i=vt(n)?Cs:it.current;return i=ki(t,i),mi(t,s),n=Tp(e,t,n,r,i,s),r=Rp(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,rr(e,t,s)):(Se&&r&&yp(t),t.flags|=1,at(e,t,n,s),t.child)}function ty(e,t,n,r,s){if(vt(n)){var i=!0;uc(t)}else i=!1;if(mi(t,s),t.stateNode===null)Nl(e,t),_1(t,n,r),Uf(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=Zt(c):(c=vt(n)?Cs:it.current,c=ki(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)&&qg(t,o,r,c),br=!1;var h=t.memoizedState;o.state=h,mc(t,r,o,s),l=t.memoizedState,a!==r||h!==l||xt.current||br?(typeof u=="function"&&(Vf(t,n,u,r),l=t.memoizedState),(a=br||Qg(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,n1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:dn(t.type,a),o.props=c,d=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zt(l):(l=vt(n)?Cs:it.current,l=ki(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)&&qg(t,o,r,l),br=!1,h=t.memoizedState,o.state=h,mc(t,r,o,s);var m=t.memoizedState;a!==d||h!==m||xt.current||br?(typeof p=="function"&&(Vf(t,n,p,r),m=t.memoizedState),(c=br||Qg(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 Gf(e,t,n,r,i,s)}function Gf(e,t,n,r,s,i){E1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Bg(t,n,!1),rr(e,t,i);r=t.stateNode,aj.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Si(t,e.child,null,i),t.child=Si(t,null,a,i)):at(e,t,a,i),t.memoizedState=r.state,s&&Bg(t,n,!0),t.child}function T1(e){var t=e.stateNode;t.pendingContext?zg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zg(e,t.context,!1),Cp(e,t.containerInfo)}function ny(e,t,n,r,s){return _i(),vp(s),t.flags|=256,at(e,t,n,r),t.child}var Kf={dehydrated:null,treeContext:null,retryLane:0};function Qf(e){return{baseLanes:e,cachePool:null,transitions:null}}function R1(e,t,n){var r=t.pendingProps,s=Ce.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),xe(Ce,s&1),e===null)return Bf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=ou(o,r,0,null),e=xs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Qf(n),t.memoizedState=Kf,e):Ap(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return lj(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=zr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zr(a,i):(i=xs(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?Qf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Kf,r}return i=e.child,e=i.sibling,r=zr(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 Ap(e,t){return t=ou({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qa(e,t,n,r){return r!==null&&vp(r),Si(t,e.child,null,n),e=Ap(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lj(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=id(Error(U(422))),Qa(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=ou({mode:"visible",children:r.children},s,0,null),i=xs(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Si(t,e.child,null,o),t.child.memoizedState=Qf(o),t.memoizedState=Kf,i);if(!(t.mode&1))return Qa(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(U(419)),r=id(i,r,void 0),Qa(e,t,o,r)}if(a=(o&e.childLanes)!==0,gt||a){if(r=Ke,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,nr(e,s),mn(r,e,s,-1))}return zp(),r=id(Error(U(421))),Qa(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=bj.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,At=Lr(s.nextSibling),Lt=t,Se=!0,hn=null,e!==null&&(Gt[Kt++]=Yn,Gt[Kt++]=Xn,Gt[Kt++]=Ps,Yn=e.id,Xn=e.overflow,Ps=t),t=Ap(t,r.children),t.flags|=4096,t)}function ry(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$f(e.return,t,n)}function od(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 I1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(at(e,t,r.children,n),r=Ce.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&&ry(e,n,t);else if(e.tag===19)ry(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(xe(Ce,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&gc(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),od(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&gc(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}od(t,!0,n,null,i);break;case"together":od(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Nl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cj(e,t,n){switch(t.tag){case 3:T1(t),_i();break;case 5:r1(t);break;case 1:vt(t.type)&&uc(t);break;case 4:Cp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;xe(hc,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(xe(Ce,Ce.current&1),t.flags|=128,null):n&t.child.childLanes?R1(e,t,n):(xe(Ce,Ce.current&1),e=rr(e,t,n),e!==null?e.sibling:null);xe(Ce,Ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return I1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),xe(Ce,Ce.current),r)break;return null;case 22:case 23:return t.lanes=0,j1(e,t,n)}return rr(e,t,n)}var N1,qf,A1,M1;N1=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}};qf=function(){};A1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,hs(An.current);var i=null;switch(n){case"input":s=yf(e,s),r=yf(e,r),i=[];break;case"select":s=je({},s,{value:void 0}),r=je({},r,{value:void 0}),i=[];break;case"textarea":s=wf(e,s),r=wf(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lc)}kf(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"&&($o.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"&&($o.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&be("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)}};M1=function(e,t,n,r){n!==r&&(t.flags|=4)};function no(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function uj(e,t,n){var r=t.pendingProps;switch(xp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return vt(t.type)&&cc(),tt(t),null;case 3:return r=t.stateNode,Ci(),ke(xt),ke(it),jp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ga(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hn!==null&&(rh(hn),hn=null))),qf(e,t),tt(t),null;case 5:Pp(t);var s=hs(Zo.current);if(n=t.type,e!==null&&t.stateNode!=null)A1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return tt(t),null}if(e=hs(An.current),Ga(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rn]=t,r[Xo]=i,e=(t.mode&1)!==0,n){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(s=0;s<bo.length;s++)be(bo[s],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":fg(r,i),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},be("invalid",r);break;case"textarea":pg(r,i),be("invalid",r)}kf(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&&Ha(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ha(r.textContent,a,e),s=["children",""+a]):$o.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&be("scroll",r)}switch(n){case"input":Fa(r),hg(r,i,!0);break;case"textarea":Fa(r),mg(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=lc)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Rn]=t,e[Xo]=r,N1(e,t,!1,!1),t.stateNode=e;e:{switch(o=_f(n,r),n){case"dialog":be("cancel",e),be("close",e),s=r;break;case"iframe":case"object":case"embed":be("load",e),s=r;break;case"video":case"audio":for(s=0;s<bo.length;s++)be(bo[s],e);s=r;break;case"source":be("error",e),s=r;break;case"img":case"image":case"link":be("error",e),be("load",e),s=r;break;case"details":be("toggle",e),s=r;break;case"input":fg(e,r),s=yf(e,r),be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=je({},r,{value:void 0}),be("invalid",e);break;case"textarea":pg(e,r),s=wf(e,r),be("invalid",e);break;default:s=r}kf(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?dw(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&cw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Vo(e,l):typeof l=="number"&&Vo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($o.hasOwnProperty(i)?l!=null&&i==="onScroll"&&be("scroll",e):l!=null&&rp(e,i,l,o))}switch(n){case"input":Fa(e),hg(e,r,!1);break;case"textarea":Fa(e),mg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?di(e,!!r.multiple,i,!1):r.defaultValue!=null&&di(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=lc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)M1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=hs(Zo.current),hs(An.current),Ga(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rn]=t,(i=r.nodeValue!==n)&&(e=Lt,e!==null))switch(e.tag){case 3:Ha(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ha(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=t,t.stateNode=r}return tt(t),null;case 13:if(ke(Ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Se&&At!==null&&t.mode&1&&!(t.flags&128))Jw(),_i(),t.flags|=98560,i=!1;else if(i=Ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Rn]=t}else _i(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else hn!==null&&(rh(hn),hn=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||Ce.current&1?Ve===0&&(Ve=3):zp())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return Ci(),qf(e,t),e===null&&qo(t.stateNode.containerInfo),tt(t),null;case 10:return kp(t.type._context),tt(t),null;case 17:return vt(t.type)&&cc(),tt(t),null;case 19:if(ke(Ce),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)no(i,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=gc(e),o!==null){for(t.flags|=128,no(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 xe(Ce,Ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&Me()>ji&&(t.flags|=128,r=!0,no(i,!1),t.lanes=4194304)}else{if(!r)if(e=gc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),no(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Se)return tt(t),null}else 2*Me()-i.renderingStartTime>ji&&n!==1073741824&&(t.flags|=128,r=!0,no(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=Me(),t.sibling=null,n=Ce.current,xe(Ce,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Op(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Nt&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function dj(e,t){switch(xp(t),t.tag){case 1:return vt(t.type)&&cc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ci(),ke(xt),ke(it),jp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pp(t),null;case 13:if(ke(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));_i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ce),null;case 4:return Ci(),null;case 10:return kp(t.type._context),null;case 22:case 23:return Op(),null;case 24:return null;default:return null}}var qa=!1,rt=!1,fj=typeof WeakSet=="function"?WeakSet:Set,G=null;function oi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Yf(e,t,n){try{n()}catch(r){Re(e,t,r)}}var sy=!1;function hj(e,t){if(Af=ic,e=zw(),gp(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(Mf={focusedElem:e,selectionRange:n},ic=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,w=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:dn(t.type,y),w);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(b){Re(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=sy,sy=!1,m}function Ro(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&&Yf(t,n,i)}s=s.next}while(s!==r)}}function su(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xf(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 L1(e){var t=e.alternate;t!==null&&(e.alternate=null,L1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[Xo],delete t[Ff],delete t[qP],delete t[YP])),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 D1(e){return e.tag===5||e.tag===3||e.tag===4}function iy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D1(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 Jf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lc));else if(r!==4&&(e=e.child,e!==null))for(Jf(e,t,n),e=e.sibling;e!==null;)Jf(e,t,n),e=e.sibling}function Zf(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(Zf(e,t,n),e=e.sibling;e!==null;)Zf(e,t,n),e=e.sibling}var Qe=null,fn=!1;function lr(e,t,n){for(n=n.child;n!==null;)F1(e,t,n),n=n.sibling}function F1(e,t,n){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(Yc,n)}catch{}switch(n.tag){case 5:rt||oi(n,t);case 6:var r=Qe,s=fn;Qe=null,lr(e,t,n),Qe=r,fn=s,Qe!==null&&(fn?(e=Qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(fn?(e=Qe,n=n.stateNode,e.nodeType===8?Zu(e.parentNode,n):e.nodeType===1&&Zu(e,n),Go(e)):Zu(Qe,n.stateNode));break;case 4:r=Qe,s=fn,Qe=n.stateNode.containerInfo,fn=!0,lr(e,t,n),Qe=r,fn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Yf(n,t,o),s=s.next}while(s!==r)}lr(e,t,n);break;case 1:if(!rt&&(oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Re(n,t,a)}lr(e,t,n);break;case 21:lr(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,lr(e,t,n),rt=r):lr(e,t,n);break;default:lr(e,t,n)}}function oy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fj),t.forEach(function(r){var s=kj.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function sn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,fn=!1;break e;case 3:Qe=a.stateNode.containerInfo,fn=!0;break e;case 4:Qe=a.stateNode.containerInfo,fn=!0;break e}a=a.return}if(Qe===null)throw Error(U(160));F1(i,o,s),Qe=null,fn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Re(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)O1(t,e),t=t.sibling}function O1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sn(t,e),bn(e),r&4){try{Ro(3,e,e.return),su(3,e)}catch(y){Re(e,e.return,y)}try{Ro(5,e,e.return)}catch(y){Re(e,e.return,y)}}break;case 1:sn(t,e),bn(e),r&512&&n!==null&&oi(n,n.return);break;case 5:if(sn(t,e),bn(e),r&512&&n!==null&&oi(n,n.return),e.flags&32){var s=e.stateNode;try{Vo(s,"")}catch(y){Re(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&ow(s,i),_f(a,o);var c=_f(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?dw(s,d):u==="dangerouslySetInnerHTML"?cw(s,d):u==="children"?Vo(s,d):rp(s,u,d,c)}switch(a){case"input":xf(s,i);break;case"textarea":aw(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?di(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?di(s,!!i.multiple,i.defaultValue,!0):di(s,!!i.multiple,i.multiple?[]:"",!1))}s[Xo]=i}catch(y){Re(e,e.return,y)}}break;case 6:if(sn(t,e),bn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Re(e,e.return,y)}}break;case 3:if(sn(t,e),bn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Go(t.containerInfo)}catch(y){Re(e,e.return,y)}break;case 4:sn(t,e),bn(e);break;case 13:sn(t,e),bn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Dp=Me())),r&4&&oy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(c=rt)||u,sn(t,e),rt=c):sn(t,e),bn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(G=e,u=e.child;u!==null;){for(d=G=u;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ro(4,h,h.return);break;case 1:oi(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(y){Re(r,n,y)}}break;case 5:oi(h,h.return);break;case 22:if(h.memoizedState!==null){ly(d);continue}}p!==null?(p.return=h,G=p):ly(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=uw("display",o))}catch(y){Re(e,e.return,y)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){Re(e,e.return,y)}}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:sn(t,e),bn(e),r&4&&oy(e);break;case 21:break;default:sn(t,e),bn(e)}}function bn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(D1(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Vo(s,""),r.flags&=-33);var i=iy(e);Zf(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=iy(e);Jf(e,a,o);break;default:throw Error(U(161))}}catch(l){Re(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pj(e,t,n){G=e,z1(e)}function z1(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var s=G,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||qa;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||rt;a=qa;var c=rt;if(qa=o,(rt=l)&&!c)for(G=s;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?cy(s):l!==null?(l.return=o,G=l):cy(s);for(;i!==null;)G=i,z1(i),i=i.sibling;G=s,qa=a,rt=c}ay(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,G=i):ay(e)}}function ay(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||su(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:dn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Hg(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}Hg(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&&Go(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}rt||t.flags&512&&Xf(t)}catch(h){Re(t,t.return,h)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function ly(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function cy(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{su(4,t)}catch(l){Re(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Re(t,s,l)}}var i=t.return;try{Xf(t)}catch(l){Re(t,i,l)}break;case 5:var o=t.return;try{Xf(t)}catch(l){Re(t,o,l)}}}catch(l){Re(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var mj=Math.ceil,vc=ir.ReactCurrentDispatcher,Mp=ir.ReactCurrentOwner,Xt=ir.ReactCurrentBatchConfig,oe=0,Ke=null,ze=null,Xe=0,Nt=0,ai=Qr(0),Ve=0,ra=null,Es=0,iu=0,Lp=0,Io=null,mt=null,Dp=0,ji=1/0,Hn=null,wc=!1,eh=null,Fr=null,Ya=!1,Pr=null,bc=0,No=0,th=null,Al=-1,Ml=0;function ut(){return oe&6?Me():Al!==-1?Al:Al=Me()}function Or(e){return e.mode&1?oe&2&&Xe!==0?Xe&-Xe:JP.transition!==null?(Ml===0&&(Ml=_w()),Ml):(e=ce,e!==0||(e=window.event,e=e===void 0?16:Rw(e.type)),e):1}function mn(e,t,n,r){if(50<No)throw No=0,th=null,Error(U(185));pa(e,n,r),(!(oe&2)||e!==Ke)&&(e===Ke&&(!(oe&2)&&(iu|=n),Ve===4&&Sr(e,Xe)),wt(e,r),n===1&&oe===0&&!(t.mode&1)&&(ji=Me()+500,tu&&qr()))}function wt(e,t){var n=e.callbackNode;JC(e,t);var r=sc(e,e===Ke?Xe:0);if(r===0)n!==null&&xg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xg(n),t===1)e.tag===0?XP(uy.bind(null,e)):qw(uy.bind(null,e)),KP(function(){!(oe&6)&&qr()}),n=null;else{switch(Sw(r)){case 1:n=lp;break;case 4:n=bw;break;case 16:n=rc;break;case 536870912:n=kw;break;default:n=rc}n=K1(n,B1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function B1(e,t){if(Al=-1,Ml=0,oe&6)throw Error(U(327));var n=e.callbackNode;if(gi()&&e.callbackNode!==n)return null;var r=sc(e,e===Ke?Xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=kc(e,r);else{t=r;var s=oe;oe|=2;var i=V1();(Ke!==e||Xe!==t)&&(Hn=null,ji=Me()+500,ys(e,t));do try{xj();break}catch(a){$1(e,a)}while(!0);bp(),vc.current=i,oe=s,ze!==null?t=0:(Ke=null,Xe=0,t=Ve)}if(t!==0){if(t===2&&(s=Ef(e),s!==0&&(r=s,t=nh(e,s))),t===1)throw n=ra,ys(e,0),Sr(e,r),wt(e,Me()),n;if(t===6)Sr(e,r);else{if(s=e.current.alternate,!(r&30)&&!gj(s)&&(t=kc(e,r),t===2&&(i=Ef(e),i!==0&&(r=i,t=nh(e,i))),t===1))throw n=ra,ys(e,0),Sr(e,r),wt(e,Me()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:as(e,mt,Hn);break;case 3:if(Sr(e,r),(r&130023424)===r&&(t=Dp+500-Me(),10<t)){if(sc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ut(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Df(as.bind(null,e,mt,Hn),t);break}as(e,mt,Hn);break;case 4:if(Sr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-pn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mj(r/1960))-r,10<r){e.timeoutHandle=Df(as.bind(null,e,mt,Hn),r);break}as(e,mt,Hn);break;case 5:as(e,mt,Hn);break;default:throw Error(U(329))}}}return wt(e,Me()),e.callbackNode===n?B1.bind(null,e):null}function nh(e,t){var n=Io;return e.current.memoizedState.isDehydrated&&(ys(e,t).flags|=256),e=kc(e,t),e!==2&&(t=mt,mt=n,t!==null&&rh(t)),e}function rh(e){mt===null?mt=e:mt.push.apply(mt,e)}function gj(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!xn(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Sr(e,t){for(t&=~Lp,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-pn(t),r=1<<n;e[n]=-1,t&=~r}}function uy(e){if(oe&6)throw Error(U(327));gi();var t=sc(e,0);if(!(t&1))return wt(e,Me()),null;var n=kc(e,t);if(e.tag!==0&&n===2){var r=Ef(e);r!==0&&(t=r,n=nh(e,r))}if(n===1)throw n=ra,ys(e,0),Sr(e,t),wt(e,Me()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,as(e,mt,Hn),wt(e,Me()),null}function Fp(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(ji=Me()+500,tu&&qr())}}function Ts(e){Pr!==null&&Pr.tag===0&&!(oe&6)&&gi();var t=oe;oe|=1;var n=Xt.transition,r=ce;try{if(Xt.transition=null,ce=1,e)return e()}finally{ce=r,Xt.transition=n,oe=t,!(oe&6)&&qr()}}function Op(){Nt=ai.current,ke(ai)}function ys(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,GP(n)),ze!==null)for(n=ze.return;n!==null;){var r=n;switch(xp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&cc();break;case 3:Ci(),ke(xt),ke(it),jp();break;case 5:Pp(r);break;case 4:Ci();break;case 13:ke(Ce);break;case 19:ke(Ce);break;case 10:kp(r.type._context);break;case 22:case 23:Op()}n=n.return}if(Ke=e,ze=e=zr(e.current,null),Xe=Nt=t,Ve=0,ra=null,Lp=iu=Es=0,mt=Io=null,fs!==null){for(t=0;t<fs.length;t++)if(n=fs[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}fs=null}return e}function $1(e,t){do{var n=ze;try{if(bp(),Rl.current=xc,yc){for(var r=Pe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}yc=!1}if(js=0,Ge=$e=Pe=null,To=!1,ea=0,Mp.current=null,n===null||n.return===null){Ve=1,ra=t,ze=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Xe,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=Xg(o);if(p!==null){p.flags&=-257,Jg(p,o,a,i,t),p.mode&1&&Yg(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var y=new Set;y.add(l),t.updateQueue=y}else m.add(l);break e}else{if(!(t&1)){Yg(i,c,t),zp();break e}l=Error(U(426))}}else if(Se&&a.mode&1){var w=Xg(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Jg(w,o,a,i,t),vp(Pi(l,a));break e}}i=l=Pi(l,a),Ve!==4&&(Ve=2),Io===null?Io=[i]:Io.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=S1(i,l,t);Wg(i,g);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Fr===null||!Fr.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=C1(i,a,t);Wg(i,b);break e}}i=i.return}while(i!==null)}W1(n)}catch(S){t=S,ze===n&&n!==null&&(ze=n=n.return);continue}break}while(!0)}function V1(){var e=vc.current;return vc.current=xc,e===null?xc:e}function zp(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),Ke===null||!(Es&268435455)&&!(iu&268435455)||Sr(Ke,Xe)}function kc(e,t){var n=oe;oe|=2;var r=V1();(Ke!==e||Xe!==t)&&(Hn=null,ys(e,t));do try{yj();break}catch(s){$1(e,s)}while(!0);if(bp(),oe=n,vc.current=r,ze!==null)throw Error(U(261));return Ke=null,Xe=0,Ve}function yj(){for(;ze!==null;)U1(ze)}function xj(){for(;ze!==null&&!UC();)U1(ze)}function U1(e){var t=G1(e.alternate,e,Nt);e.memoizedProps=e.pendingProps,t===null?W1(e):ze=t,Mp.current=null}function W1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dj(n,t),n!==null){n.flags&=32767,ze=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,ze=null;return}}else if(n=uj(n,t,Nt),n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);Ve===0&&(Ve=5)}function as(e,t,n){var r=ce,s=Xt.transition;try{Xt.transition=null,ce=1,vj(e,t,n,r)}finally{Xt.transition=s,ce=r}return null}function vj(e,t,n,r){do gi();while(Pr!==null);if(oe&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ZC(e,i),e===Ke&&(ze=Ke=null,Xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ya||(Ya=!0,K1(rc,function(){return gi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Xt.transition,Xt.transition=null;var o=ce;ce=1;var a=oe;oe|=4,Mp.current=null,hj(e,n),O1(n,e),zP(Mf),ic=!!Af,Mf=Af=null,e.current=n,pj(n),WC(),oe=a,ce=o,Xt.transition=i}else e.current=n;if(Ya&&(Ya=!1,Pr=e,bc=s),i=e.pendingLanes,i===0&&(Fr=null),KC(n.stateNode),wt(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(wc)throw wc=!1,e=eh,eh=null,e;return bc&1&&e.tag!==0&&gi(),i=e.pendingLanes,i&1?e===th?No++:(No=0,th=e):No=0,qr(),null}function gi(){if(Pr!==null){var e=Sw(bc),t=Xt.transition,n=ce;try{if(Xt.transition=null,ce=16>e?16:e,Pr===null)var r=!1;else{if(e=Pr,Pr=null,bc=0,oe&6)throw Error(U(331));var s=oe;for(oe|=4,G=e.current;G!==null;){var i=G,o=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var u=G;switch(u.tag){case 0:case 11:case 15:Ro(8,u,i)}var d=u.child;if(d!==null)d.return=u,G=d;else for(;G!==null;){u=G;var h=u.sibling,p=u.return;if(L1(u),u===c){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,G=o;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ro(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var x=e.current;for(G=x;G!==null;){o=G;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,G=v;else e:for(o=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:su(9,a)}}catch(S){Re(a,a.return,S)}if(a===o){G=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,G=b;break e}G=a.return}}if(oe=s,qr(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(Yc,e)}catch{}r=!0}return r}finally{ce=n,Xt.transition=t}}return!1}function dy(e,t,n){t=Pi(n,t),t=S1(e,t,1),e=Dr(e,t,1),t=ut(),e!==null&&(pa(e,1,t),wt(e,t))}function Re(e,t,n){if(e.tag===3)dy(e,e,n);else for(;t!==null;){if(t.tag===3){dy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fr===null||!Fr.has(r))){e=Pi(n,e),e=C1(t,e,1),t=Dr(t,e,1),e=ut(),t!==null&&(pa(t,1,e),wt(t,e));break}}t=t.return}}function wj(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ut(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(Xe&n)===n&&(Ve===4||Ve===3&&(Xe&130023424)===Xe&&500>Me()-Dp?ys(e,0):Lp|=n),wt(e,t)}function H1(e,t){t===0&&(e.mode&1?(t=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):t=1);var n=ut();e=nr(e,t),e!==null&&(pa(e,t,n),wt(e,n))}function bj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),H1(e,n)}function kj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),H1(e,n)}var G1;G1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xt.current)gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return gt=!1,cj(e,t,n);gt=!!(e.flags&131072)}else gt=!1,Se&&t.flags&1048576&&Yw(t,fc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Nl(e,t),e=t.pendingProps;var s=ki(t,it.current);mi(t,n),s=Tp(null,t,r,e,s,n);var i=Rp();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,vt(r)?(i=!0,uc(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Sp(t),s.updater=ru,t.stateNode=s,s._reactInternals=t,Uf(t,r,e,n),t=Gf(null,t,r,!0,i,n)):(t.tag=0,Se&&i&&yp(t),at(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Nl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Sj(r),e=dn(r,e),s){case 0:t=Hf(null,t,r,e,n);break e;case 1:t=ty(null,t,r,e,n);break e;case 11:t=Zg(null,t,r,e,n);break e;case 14:t=ey(null,t,r,dn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:dn(r,s),Hf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:dn(r,s),ty(e,t,r,s,n);case 3:e:{if(T1(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,s=i.element,n1(e,t),mc(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Pi(Error(U(423)),t),t=ny(e,t,r,n,s);break e}else if(r!==s){s=Pi(Error(U(424)),t),t=ny(e,t,r,n,s);break e}else for(At=Lr(t.stateNode.containerInfo.firstChild),Lt=t,Se=!0,hn=null,n=e1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_i(),r===s){t=rr(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return r1(t),e===null&&Bf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Lf(r,s)?o=null:i!==null&&Lf(r,i)&&(t.flags|=32),E1(e,t),at(e,t,o,n),t.child;case 6:return e===null&&Bf(t),null;case 13:return R1(e,t,n);case 4:return Cp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Si(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:dn(r,s),Zg(e,t,r,s,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(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,xe(hc,r._currentValue),r._currentValue=o,i!==null)if(xn(i.value,o)){if(i.children===s.children&&!xt.current){t=rr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Jn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),$f(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),$f(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}at(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,mi(t,n),s=Zt(s),r=r(s),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,s=dn(r,t.pendingProps),s=dn(r.type,s),ey(e,t,r,s,n);case 15:return P1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:dn(r,s),Nl(e,t),t.tag=1,vt(r)?(e=!0,uc(t)):e=!1,mi(t,n),_1(t,r,s),Uf(t,r,s,n),Gf(null,t,r,!0,e,n);case 19:return I1(e,t,n);case 22:return j1(e,t,n)}throw Error(U(156,t.tag))};function K1(e,t){return ww(e,t)}function _j(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 qt(e,t,n,r){return new _j(e,t,n,r)}function Bp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sj(e){if(typeof e=="function")return Bp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ip)return 11;if(e===op)return 14}return 2}function zr(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ll(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Bp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xs:return xs(n.children,s,i,t);case sp:o=8,s|=8;break;case hf:return e=qt(12,n,t,s|2),e.elementType=hf,e.lanes=i,e;case pf:return e=qt(13,n,t,s),e.elementType=pf,e.lanes=i,e;case mf:return e=qt(19,n,t,s),e.elementType=mf,e.lanes=i,e;case rw:return ou(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tw:o=10;break e;case nw:o=9;break e;case ip:o=11;break e;case op:o=14;break e;case wr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=qt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function xs(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function ou(e,t,n,r){return e=qt(22,e,r,t),e.elementType=rw,e.lanes=n,e.stateNode={isHidden:!1},e}function ad(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function ld(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cj(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=Vu(0),this.expirationTimes=Vu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $p(e,t,n,r,s,i,o,a,l){return e=new Cj(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sp(i),e}function Pj(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ys,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Q1(e){if(!e)return Ur;e=e._reactInternals;e:{if(Ns(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(vt(n))return Qw(e,n,t)}return t}function q1(e,t,n,r,s,i,o,a,l){return e=$p(n,r,!0,e,s,i,o,a,l),e.context=Q1(null),n=e.current,r=ut(),s=Or(n),i=Jn(r,s),i.callback=t??null,Dr(n,i,s),e.current.lanes=s,pa(e,s,r),wt(e,r),e}function au(e,t,n,r){var s=t.current,i=ut(),o=Or(s);return n=Q1(n),t.context===null?t.context=n:t.pendingContext=n,t=Jn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dr(s,t,o),e!==null&&(mn(e,s,o,i),Tl(e,s,o)),o}function _c(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vp(e,t){fy(e,t),(e=e.alternate)&&fy(e,t)}function jj(){return null}var Y1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Up(e){this._internalRoot=e}lu.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));au(e,t,null,null)};lu.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ts(function(){au(null,e,null,null)}),t[tr]=null}};function lu(e){this._internalRoot=e}lu.prototype.unstable_scheduleHydration=function(e){if(e){var t=jw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_r.length&&t!==0&&t<_r[n].priority;n++);_r.splice(n,0,e),n===0&&Tw(e)}};function Wp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hy(){}function Ej(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=_c(o);i.call(c)}}var o=q1(t,r,e,0,null,!1,!1,"",hy);return e._reactRootContainer=o,e[tr]=o.current,qo(e.nodeType===8?e.parentNode:e),Ts(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=_c(l);a.call(c)}}var l=$p(e,0,!1,null,null,!1,!1,"",hy);return e._reactRootContainer=l,e[tr]=l.current,qo(e.nodeType===8?e.parentNode:e),Ts(function(){au(t,l,n,r)}),l}function uu(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=_c(o);a.call(l)}}au(t,o,e,s)}else o=Ej(n,t,e,s,r);return _c(o)}Cw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wo(t.pendingLanes);n!==0&&(cp(t,n|1),wt(t,Me()),!(oe&6)&&(ji=Me()+500,qr()))}break;case 13:Ts(function(){var r=nr(e,1);if(r!==null){var s=ut();mn(r,e,1,s)}}),Vp(e,1)}};up=function(e){if(e.tag===13){var t=nr(e,134217728);if(t!==null){var n=ut();mn(t,e,134217728,n)}Vp(e,134217728)}};Pw=function(e){if(e.tag===13){var t=Or(e),n=nr(e,t);if(n!==null){var r=ut();mn(n,e,t,r)}Vp(e,t)}};jw=function(){return ce};Ew=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};Cf=function(e,t,n){switch(t){case"input":if(xf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=eu(r);if(!s)throw Error(U(90));iw(r),xf(r,s)}}}break;case"textarea":aw(e,n);break;case"select":t=n.value,t!=null&&di(e,!!n.multiple,t,!1)}};pw=Fp;mw=Ts;var Tj={usingClientEntryPoint:!1,Events:[ga,ti,eu,fw,hw,Fp]},ro={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Rj={bundleType:ro.bundleType,version:ro.version,rendererPackageName:ro.rendererPackageName,rendererConfig:ro.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=xw(e),e===null?null:e.stateNode},findFiberByHostInstance:ro.findFiberByHostInstance||jj,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 Xa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xa.isDisabled&&Xa.supportsFiber)try{Yc=Xa.inject(Rj),Nn=Xa}catch{}}Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tj;Ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wp(t))throw Error(U(200));return Pj(e,t,null,n)};Ot.createRoot=function(e,t){if(!Wp(e))throw Error(U(299));var n=!1,r="",s=Y1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=$p(e,1,!1,null,null,n,!1,r,s),e[tr]=t.current,qo(e.nodeType===8?e.parentNode:e),new Up(t)};Ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=xw(t),e=e===null?null:e.stateNode,e};Ot.flushSync=function(e){return Ts(e)};Ot.hydrate=function(e,t,n){if(!cu(t))throw Error(U(200));return uu(null,e,t,!0,n)};Ot.hydrateRoot=function(e,t,n){if(!Wp(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Y1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=q1(t,null,e,1,n??null,s,!1,i,o),e[tr]=t.current,qo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new lu(t)};Ot.render=function(e,t,n){if(!cu(t))throw Error(U(200));return uu(null,e,t,!1,n)};Ot.unmountComponentAtNode=function(e){if(!cu(e))throw Error(U(40));return e._reactRootContainer?(Ts(function(){uu(null,null,e,!1,function(){e._reactRootContainer=null,e[tr]=null})}),!0):!1};Ot.unstable_batchedUpdates=Fp;Ot.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cu(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return uu(e,t,n,!1,r)};Ot.version="18.3.1-next-f1338f8080-20240426";function X1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X1)}catch(e){console.error(e)}}X1(),X0.exports=Ot;var As=X0.exports,J1,py=As;J1=py.createRoot,py.hydrateRoot;var ko=typeof window<"u"?_.useLayoutEffect:_.useEffect;function cd(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Ij(e,t,n={},r={}){_.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 Nj(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}const Z1=!1;function sa(e){return e[e.length-1]}function Aj(e){return typeof e=="function"}function jr(e,t){return Aj(e)?e(t):e}const Mj=Object.prototype.hasOwnProperty,my=Object.prototype.propertyIsEnumerable,Lj=()=>Object.create(null),ns=(e,t)=>Er(e,t,Lj);function Er(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,i=xy(e)&&xy(s);if(!i&&!(Ei(e)&&Ei(s)))return s;const o=i?e:gy(e);if(!o)return s;const a=i?s:gy(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],y=s[p];if(m===y){u[p]=m,(i?h<l:Mj.call(e,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[p]=y;continue}const w=Er(m,y,n,r+1);u[p]=w,w===m&&d++}return l===c&&d===l?e:u}function gy(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!my.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(!my.call(e,s))return!1;r.push(s)}return r}function Ei(e){if(!yy(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!yy(n)||!n.hasOwnProperty("isPrototypeOf"))}function yy(e){return Object.prototype.toString.call(e)==="[object Object]"}function xy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vs(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(!vs(e[r],t[r],n))return!1;return!0}if(Ei(e)&&Ei(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)&&!vs(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||!vs(e[o],t[o],n)))return!1;return s===i}return!1}function Ti(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 ia(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Dj(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function vy(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 Dj(t)}const Fj=["http:","https:","mailto:","tel:"];function Sc(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function so(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+=vy(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+vy(n?e.slice(n):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function Oj(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function zj(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zn(){throw new Error("Invariant failed")}function oa(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 Tr=4,eb=5;function Bj(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 Hp(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=Bj(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 du(e,t,n,r,s,i,o){var l,c,u,d,h,p,m,y,w,g,x,v,b;o==null||o(n);let a=r;{const S=n.fullPath??n.from,k=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<k;){const T=Hp(S,a,t);let N;const A=a,O=T[5];switch(a=O+1,i++,T[0]){case 0:{const z=S.substring(T[2],T[3]);if(j){const P=(p=s.static)==null?void 0:p.get(z);if(P)N=P;else{s.static??(s.static=new Map);const L=ps(n.fullPath??n.from);L.parent=s,L.depth=i,N=L,s.static.set(z,L)}}else{const P=z.toLowerCase(),L=(m=s.staticInsensitive)==null?void 0:m.get(P);if(L)N=L;else{s.staticInsensitive??(s.staticInsensitive=new Map);const B=ps(n.fullPath??n.from);B.parent=s,B.depth=i,N=B,s.staticInsensitive.set(P,B)}}break}case 1:{const z=S.substring(A,T[1]),P=S.substring(T[4],O),L=j&&!!(z||P),B=z?L?z:z.toLowerCase():void 0,M=P?L?P:P.toLowerCase():void 0,$=!E&&((y=s.dynamic)==null?void 0:y.find(C=>!C.skipOnParamError&&C.caseSensitive===L&&C.prefix===B&&C.suffix===M));if($)N=$;else{const C=dd(1,n.fullPath??n.from,L,B,M);N=C,C.depth=i,C.parent=s,s.dynamic??(s.dynamic=[]),s.dynamic.push(C)}break}case 3:{const z=S.substring(A,T[1]),P=S.substring(T[4],O),L=j&&!!(z||P),B=z?L?z:z.toLowerCase():void 0,M=P?L?P:P.toLowerCase():void 0,$=!E&&((w=s.optional)==null?void 0:w.find(C=>!C.skipOnParamError&&C.caseSensitive===L&&C.prefix===B&&C.suffix===M));if($)N=$;else{const C=dd(3,n.fullPath??n.from,L,B,M);N=C,C.parent=s,C.depth=i,s.optional??(s.optional=[]),s.optional.push(C)}break}case 2:{const z=S.substring(A,T[1]),P=S.substring(T[4],O),L=j&&!!(z||P),B=z?L?z:z.toLowerCase():void 0,M=P?L?P:P.toLowerCase():void 0,$=dd(2,n.fullPath??n.from,L,B,M);N=$,$.parent=s,$.depth=i,s.wildcard??(s.wildcard=[]),s.wildcard.push($)}}s=N}if(E&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const T=ps(n.fullPath??n.from);T.kind=eb,T.parent=s,i++,T.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(T),s=T}const R=(n.path||!n.children)&&!n.isRoot;if(R&&S.endsWith("/")){const T=ps(n.fullPath??n.from);T.kind=Tr,T.parent=s,i++,T.depth=i,s.index=T,s=T}s.parse=((x=(g=n.options)==null?void 0:g.params)==null?void 0:x.parse)??null,s.skipOnParamError=E,s.parsingPriority=((b=(v=n.options)==null?void 0:v.skipRouteOnParseError)==null?void 0:b.priority)??0,R&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const S of n.children)du(e,t,S,a,s,i,o)}function ud(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 kr(e){var t,n,r;if(e.pathless)for(const s of e.pathless)kr(s);if(e.static)for(const s of e.static.values())kr(s);if(e.staticInsensitive)for(const s of e.staticInsensitive.values())kr(s);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(ud);for(const s of e.dynamic)kr(s)}if((n=e.optional)!=null&&n.length){e.optional.sort(ud);for(const s of e.optional)kr(s)}if((r=e.wildcard)!=null&&r.length){e.wildcard.sort(ud);for(const s of e.wildcard)kr(s)}}function ps(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 dd(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 $j(e,t){const n=ps("/"),r=new Uint16Array(6);for(const s of e)du(!1,r,s,1,n,0);kr(n),t.masksTree=n,t.flatCache=oa(1e3)}function Vj(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const r=Gp(e,t.masksTree);return t.flatCache.set(e,r),r}function Uj(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=ps("/"),du(t,new Uint16Array(6),{from:e},1,o,0),s.singleCache.set(i,o)),Gp(r,o,n)}function Wj(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=Gp(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)i=null;else throw o}return i&&(i.branch=Kj(i.route)),t.matchCache.set(r,i),i}function Hj(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Gj(e,t=!1,n){const r=ps(e.fullPath),s=new Uint16Array(6),i={},o={};let a=0;return du(t,s,e,1,r,0,l=>{if(n==null||n(l,a),l.id in i&&Zn(),i[l.id]=l,a!==0&&l.path){const c=Hj(l.fullPath);(!o[c]||l.fullPath.endsWith("/"))&&(o[c]=l)}a++}),kr(r),{processedTree:{segmentTree:r,singleCache:oa(1e3),matchCache:oa(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function Gp(e,t,n=!1){const r=e.split("/"),s=qj(e,r,t,n);if(!s)return null;const[i]=tb(e,r,s);return{route:s.node.route,rawParams:i,parsedParams:s.parsedParams}}function tb(e,t,n){var u,d,h,p,m,y,w,g,x,v;const r=Qj(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===Tr)break;if(b.kind===eb){c--,o--,l--;continue}const S=t[o],k=l;if(S&&(l+=S.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 R=((y=b.suffix)==null?void 0:y.length)??0,T=j.substring(E+2,j.length-R-1),N=S.substring(E,S.length-R);i[T]=decodeURIComponent(N)}else{const R=j.substring(1);i[R]=decodeURIComponent(S)}}else if(b.kind===3){if(n.skipped&1<<a){o--,l=k-1;continue}s??(s=n.node.fullPath.split("/"));const j=s[c],E=((w=b.prefix)==null?void 0:w.length)??0,R=((g=b.suffix)==null?void 0:g.length)??0,T=j.substring(E+3,j.length-R-1),N=b.suffix||b.prefix?S.substring(E,S.length-R):S;N&&(i[T]=decodeURIComponent(N))}else if(b.kind===2){const j=b,E=e.substring(k+(((x=j.prefix)==null?void 0:x.length)??0),e.length-(((v=j.suffix)==null?void 0:v.length)??0)),R=decodeURIComponent(E);i["*"]=R,i._splat=R;break}}return n.rawParams&&Object.assign(i,n.rawParams),[i,{part:o,node:a,path:l,segment:c}]}function Kj(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qj(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function qj(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!sa(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:y,dynamics:w,optionals:g}=u;let{extract:x,rawParams:v,parsedParams:b}=u;if(d.kind===2&&d.route&&!Za(c,u))continue;if(d.skipOnParamError){if(!wy(e,t,u))continue;v=u.rawParams,x=u.extract,b=u.parsedParams}r&&d.route&&d.kind!==Tr&&Za(l,u)&&(l=u);const S=h===o;if(S&&(d.route&&(!i||d.kind===Tr||d.kind===2)&&Za(c,u)&&(c=u),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const k=S?void 0:t[h];let j;if(S&&d.index){const E={node:d.index,index:h,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b};let R=!0;if(d.index.skipOnParamError&&(wy(e,t,E)||(R=!1)),R){if(!w&&!g&&!p&&Yj(y,o))return E;Za(c,E)&&(c=E)}}if(d.wildcard)for(let E=d.wildcard.length-1;E>=0;E--){const R=d.wildcard[E],{prefix:T,suffix:N}=R;if(!(T&&(S||!(R.caseSensitive?k:j??(j=k.toLowerCase())).startsWith(T)))){if(N){if(S)continue;const A=t.slice(h).join("/").slice(-N.length);if((R.caseSensitive?A:A.toLowerCase())!==N)continue}a.push({node:R,index:o,skipped:p,depth:m+1,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}}if(d.optional){const E=p|1<<m,R=m+1;for(let T=d.optional.length-1;T>=0;T--){const N=d.optional[T];a.push({node:N,index:h,skipped:E,depth:R,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S)for(let T=d.optional.length-1;T>=0;T--){const N=d.optional[T],{prefix:A,suffix:O}=N;if(A||O){const z=N.caseSensitive?k:j??(j=k.toLowerCase());if(A&&!z.startsWith(A)||O&&!z.endsWith(O))continue}a.push({node:N,index:h+1,skipped:p,depth:R,statics:y,dynamics:w,optionals:g+Ja(o,h),extract:x,rawParams:v,parsedParams:b})}}if(!S&&d.dynamic&&k)for(let E=d.dynamic.length-1;E>=0;E--){const R=d.dynamic[E],{prefix:T,suffix:N}=R;if(T||N){const A=R.caseSensitive?k:j??(j=k.toLowerCase());if(T&&!A.startsWith(T)||N&&!A.endsWith(N))continue}a.push({node:R,index:h+1,skipped:p,depth:m+1,statics:y,dynamics:w+Ja(o,h),optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.staticInsensitive){const E=d.staticInsensitive.get(j??(j=k.toLowerCase()));E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:y+Ja(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(!S&&d.static){const E=d.static.get(k);E&&a.push({node:E,index:h+1,skipped:p,depth:m+1,statics:y+Ja(o,h),dynamics:w,optionals:g,extract:x,rawParams:v,parsedParams:b})}if(d.pathless){const E=m+1;for(let R=d.pathless.length-1;R>=0;R--){const T=d.pathless[R];a.push({node:T,index:h,skipped:p,depth:E,statics:y,dynamics:w,optionals:g,extract:x,rawParams:v,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 Ja(e,t){return 2**(e-t-1)}function Yj(e,t){return e===2**(t-1)-1}function wy(e,t,n){try{const[r,s]=tb(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 Za(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===Tr)>(e.node.kind===Tr)||t.node.kind===Tr==(e.node.kind===Tr)&&t.depth>e.depth))):!0}function Dl(e){return Kp(e.filter(t=>t!==void 0).join("/"))}function Kp(e){return e.replace(/\/{2,}/g,"/")}function nb(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Br(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function rb(e){return Br(nb(e))}function Cc(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Xj(e,t,n){return Cc(e,n)===Cc(t,n)}function Jj({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&&sa(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&&(sa(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=Hp(h,0,l);const p=l[0];if(p===0){c+=h;continue}const m=l[5],y=h.substring(0,l[1]),w=h.substring(l[4],m),g=h.substring(l[2],l[3]);p===1?c+=y||w?`${y}{$${g}}${w}`:`$${g}`:p===2?c+=y||w?`${y}{$}${w}`:"$":c+=`${y}{-$${g}}${w}`}c=Kp(c);const u=c||"/";return o&&r&&r.set(o,u),u}function Zj(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 fd(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=>ky(s,n)).join("/"):ky(r,n)}function by({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=Hp(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]),y=e.substring(l[4],d);if(!p){s=!0,(m||y)&&(c+="/"+m+y);continue}const w=fd("_splat",t,n);c+="/"+m+w+y;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]),y=e.substring(l[4],d),w=fd(p,t,n)??"undefined";c+="/"+m+w+y;continue}if(h===3){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;i[p]=m;const y=e.substring(u,l[1]),w=e.substring(l[4],d),g=fd(p,t,n)??"";c+="/"+y+g+w;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:i,interpolatedPath:c||"/",isMissingParams:s}}function ky(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function st(e){return(e==null?void 0:e.isNotFound)===!0}function eE(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const tE="tsr-scroll-restoration-v1_3";function nE(){const e=eE();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ei(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=jr(r,t)||t},persist:()=>{try{e.setItem(tE,JSON.stringify(t))}catch{}}}}const _y=nE(),rE=e=>e.state.__TSR_key||e.href;function sE(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 el=!1;const io="window",Sy="data-scroll-restoration-id";function iE(e,t){if(!_y)return;const n=_y;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,el=!1;const r=e.options.getScrollRestorationKey||rE,s=new Map;window.history.scrollRestoration="manual";const i=a=>{if(!(el||!e.isScrollRestoring))if(a.target===document||a.target===window)s.set(io,{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===io)h=io;else if(u.isConnected){const p=u.getAttribute(Sy);h=p?`[${Sy}="${p}"]`:sE(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}))){el=!0;try{const h=e.isScrollRestoring?n.state[l]:void 0;let p=!1;if(h)for(const m in h){const y=h[m];if(!Ei(y))continue;const{scrollX:w,scrollY:g}=y;if(!(!Number.isFinite(w)||!Number.isFinite(g))){if(m===io)window.scrollTo({top:g,left:w,behavior:c}),p=!0;else if(m){let x;try{x=document.querySelector(m)}catch{continue}x&&(x.scrollLeft=w,x.scrollTop=g,p=!0)}}}if(!p){const m=e.history.location.hash.slice(1);if(m){const y=((d=window.history.state)==null?void 0:d.__hashScrollIntoViewOptions)??!0;if(y){const w=document.getElementById(m);w&&w.scrollIntoView(y)}}else{const y={top:0,left:0,behavior:c};if(window.scrollTo(y),u)for(const w of u){if(w===io)continue;const g=typeof w=="function"?w():document.querySelector(w);g&&g.scrollTo(y)}}}}finally{el=!1}e.isScrollRestoring&&n.set(h=>(h[l]||(h[l]={}),h))}})}function oE(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 hd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function aE(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]=hd(s):Array.isArray(i)?i.push(hd(s)):n[r]=[i,hd(s)]}return n}const lE=uE(JSON.parse),cE=dE(JSON.stringify,JSON.parse);function uE(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=aE(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function dE(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=oE(s,r);return i?`?${i}`:""}}const ws="__root__";function fE(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 yt(e){return e instanceof Response&&!!e.options}function hE(e){return{input:({url:t})=>{for(const n of e)t=sh(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=sb(e[n],t);return t}}}function pE(e){const t=rb(e.basepath),n=`/${t}`,r=`${n}/`,s=e.caseSensitive?n:n.toLowerCase(),i=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===s?o.pathname="/":a.startsWith(i)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=Dl(["/",t,o.pathname]),o)}}function sh(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 sb(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 mE(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),y=n(e.statusCode),w=n(e.redirect),g=n([]),x=n([]),v=n([]),b=r(()=>pd(o,g.get())),S=r(()=>pd(a,x.get())),k=r(()=>pd(l,v.get())),j=r(()=>g.get()[0]),E=r(()=>g.get().some(B=>{var M;return((M=o.get(B))==null?void 0:M.get().status)==="pending"})),R=r(()=>{var B;return{locationHref:p.get().href,resolvedLocationHref:(B=m.get())==null?void 0:B.href,status:c.get()}}),T=r(()=>({status:c.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:h.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:w.get()})),N=oa(64);function A(B){let M=N.get(B);return M||(M=r(()=>{const $=g.get();for(const C of $){const V=o.get(C);if(V&&V.routeId===B)return V.get()}}),N.set(B,M)),M}const O={status:c,loadedAt:u,isLoading:d,isTransitioning:h,location:p,resolvedLocation:m,statusCode:y,redirect:w,matchesId:g,pendingIds:x,cachedIds:v,matches:b,pendingMatches:S,cachedMatches:k,firstId:j,hasPending:E,matchRouteDeps:R,matchStores:o,pendingMatchStores:a,cachedMatchStores:l,__store:T,getRouteMatchStore:A,setMatches:z,setPending:P,setCached:L};z(e.matches),i==null||i(O);function z(B){md(B,o,g,n,s)}function P(B){md(B,a,x,n,s)}function L(B){md(B,l,v,n,s)}return O}function pd(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function md(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)}zj(n.get(),i)||n.set(i)})}const ih=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},gE=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),fu=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),bs=(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},Cy=(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},Rr=(e,t,n)=>{var r,s,i;if(!(!yt(n)&&!st(n)))throw yt(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:yt(n)?"redirected":st(n)?"notFound":o.status==="pending"?"success":o.status,context:bs(e,t.index),isFetching:!1,error:n})),st(n)&&!n.routeId&&(n.routeId=t.routeId),(i=t._nonReactive.loadPromise)==null||i.resolve()),yt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},ib=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Py=(e,t,n)=>{const r=bs(e,n);e.updateMatch(t,s=>({...s,context:r}))},oo=(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),Rr(e,e.router.getMatch(s),n);try{(l=(a=o.options).onError)==null||l.call(a,n)}catch(c){n=c,Rr(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&&!yt(n)&&!st(n)&&(e.serialError??(e.serialError=n))},ob=(e,t,n,r)=>{var i;if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!fu(e,t)&&(n.options.loader||n.options.beforeLoad||lb(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent))){const o=setTimeout(()=>{ih(e)},s);r._nonReactive.pendingTimeout=o}},yE=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ob(e,t,n,r);const s=()=>{const i=e.router.getMatch(t);i.preload&&(i.status==="redirected"||i.status==="notFound")&&Rr(e,i,i.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},xE=(e,t,n,r)=>{const s=e.router.getMatch(t);let i=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ti(()=>{i==null||i.resolve(),i=void 0});const{paramsError:o,searchError:a}=s;o&&oo(e,n,o,"PARSE_PARAMS"),a&&oo(e,n,a,"VALIDATE_SEARCH"),ob(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,S=>({...S,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}s._nonReactive.beforeLoadPromise=Ti();const h={...bs(e,n,!1),...s.__routeContext},{search:p,params:m,cause:y}=s,w=fu(e,t),g={search:p,abortController:l,params:m,preload:w,context:h,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:w?"preload":y,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},x=b=>{if(b===void 0){e.router.batch(()=>{u(),d()});return}(yt(b)||st(b))&&(u(),oo(e,n,b,"BEFORE_LOAD")),e.router.batch(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:b})),d()})};let v;try{if(v=r.options.beforeLoad(g),ia(v))return u(),v.catch(b=>{oo(e,n,b,"BEFORE_LOAD")}).then(x)}catch(b){u(),oo(e,n,b,"BEFORE_LOAD")}x(v)},vE=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],i=()=>a(),o=()=>xE(e,n,t,s),a=()=>{if(ib(e,n))return;const l=yE(e,n,s);return ia(l)?l.then(o):o()};return i()},wE=(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}))},ab=(e,t,n,r,s)=>{const i=t[r-1],{params:o,loaderDeps:a,abortController:l,cause:c}=e.router.getMatch(n),u=bs(e,r),d=fu(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}},jy=async(e,t,n,r,s)=>{var i,o,a,l,c;try{const u=e.router.getMatch(n);try{(!(Z1??e.router.isServer)||u.ssr===!0)&&aa(s);const d=s.options.loader,h=typeof d=="function"?d:d==null?void 0:d.handler,p=h==null?void 0:h(ab(e,t,n,r,s)),m=!!h&&ia(p);if((m||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||u._nonReactive.minPendingPromise)&&e.updateMatch(n,w=>({...w,isFetching:"loader"})),h){const w=m?await p:p;Rr(e,e.router.getMatch(n),w),w!==void 0&&e.updateMatch(n,g=>({...g,loaderData:w}))}s._lazyPromise&&await s._lazyPromise;const y=u._nonReactive.minPendingPromise;y&&await y,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,w=>({...w,error:void 0,context:bs(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:bs(e,r)}));return}const p=u._nonReactive.minPendingPromise;p&&await p,st(d)&&await((a=(o=s.options.notFoundComponent)==null?void 0:o.preload)==null?void 0:a.call(o)),Rr(e,e.router.getMatch(n),d);try{(c=(l=s.options).onError)==null||c.call(l,d)}catch(m){h=m,Rr(e,e.router.getMatch(n),m)}!yt(h)&&!st(h)&&await aa(s,["errorComponent"]),e.updateMatch(n,m=>({...m,error:h,context:bs(e,r),status:"error",isFetching:!1}))}}catch(u){const d=e.router.getMatch(n);d&&(d._nonReactive.loaderPromise=void 0),Rr(e,d,u)}},bE=async(e,t,n)=>{var p,m,y,w;async function r(g,x,v,b,S){const k=Date.now()-x.updatedAt,j=g?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,E=S.options.shouldReload,R=typeof E=="function"?E(ab(e,t,s,n,S)):E,{status:T,invalid:N}=b,A=k>=j&&(!!e.forceStaleReload||b.cause==="enter"||v!==void 0&&v!==b.id);o=T==="success"&&(N||(R??A)),g&&S.options.preload===!1||(o&&!e.sync&&u?(a=!0,(async()=>{var O,z;try{await jy(e,t,s,n,S);const P=e.router.getMatch(s);(O=P._nonReactive.loaderPromise)==null||O.resolve(),(z=P._nonReactive.loadPromise)==null||z.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){yt(P)&&await e.router.navigate(P.options)}})()):T!=="success"||o?await jy(e,t,s,n,S):Py(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(ib(e,s)){if(!e.router.getMatch(s))return e.matches[n];Py(e,s,n)}else{const g=e.router.getMatch(s),x=e.router.stores.matchesId.get()[n],v=((p=x&&e.router.stores.matchStores.get(x)||null)==null?void 0:p.routeId)===i?x:(m=e.router.stores.matches.get().find(S=>S.routeId===i))==null?void 0:m.id,b=fu(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&u)return g;await g._nonReactive.loaderPromise;const S=e.router.getMatch(s),k=S._nonReactive.error||S.error;k&&Rr(e,S,k),S.status==="pending"&&await r(b,g,v,S,l)}else{const S=b&&!e.router.stores.matchStores.has(s),k=e.router.getMatch(s);k._nonReactive.loaderPromise=Ti(),S!==k.preload&&e.updateMatch(s,j=>({...j,preload:S})),await r(b,g,v,k,l)}}const d=e.router.getMatch(s);a||((y=d._nonReactive.loaderPromise)==null||y.resolve(),(w=d._nonReactive.loadPromise)==null||w.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,g=>({...g,isFetching:h,invalid:!1})),e.router.getMatch(s)):d};async function Ey(e){var h,p;const t=e,n=[];gE(t.router)&&ih(t);let r;for(let m=0;m<t.matches.length;m++){try{const y=vE(t,m);ia(y)&&await y}catch(y){if(yt(y))throw y;if(st(y))r=y;else if(!t.preload)throw y;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,i=r&&!t.preload?Cy(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(bE(t,n,m));try{await Promise.all(n)}catch{const m=await Promise.allSettled(n);for(const y of m){if(y.status!=="rejected")continue;const w=y.reason;if(yt(w))throw w;st(w)?a??(a=w):l??(l=w)}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=Cy(t,c);m===void 0&&Zn();const y=t.matches[m],w=t.router.looseRoutesById[y.routeId],g=(h=t.router.options)==null?void 0:h.defaultNotFoundComponent;!w.options.notFoundComponent&&g&&(w.options.notFoundComponent=g),c.routeId=y.routeId;const x=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,v=>({...v,...x?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),u=m,await aa(w,["notFoundComponent"])}else if(!t.preload){const m=t.matches[0];m.globalNotFound||(p=t.router.getMatch(m.id))!=null&&p.globalNotFound&&t.updateMatch(m.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const m=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await aa(m,["errorComponent"])}for(let m=0;m<=u;m++){const{id:y,routeId:w}=t.matches[m],g=t.router.looseRoutesById[w];try{const x=wE(t,y,g);if(x){const v=await x;t.updateMatch(y,b=>({...b,...v}))}}catch(x){console.error(`Error executing head for route ${w}:`,x)}}const d=ih(t);if(ia(d)&&await d,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ty(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 aa(e,t=Fl){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...i}=r.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Fl?(()=>{if(e._componentsPromise===void 0){const r=Ty(e,Fl);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ty(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function lb(e){var t;for(const n of Fl)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Fl=["component","errorComponent","pendingComponent","notFoundComponent"];var $r="__TSR_index",Ry="popstate",Iy="beforeunload";function kE(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=Pc(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[$r];a=Ny(c+1,a),i({task:()=>{e.pushState(o,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[$r];a=Ny(c,a),i({task:()=>{e.replaceState(o,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{i({task:()=>{e.go(o),s({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{i({task:()=>{e.back((o==null?void 0:o.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{i({task:()=>{e.forward((o==null?void 0:o.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[$r]!==0,createHref:o=>e.createHref(o),block:o=>{var l;if(!e.setBlockers)return()=>{};const a=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...a,o]),()=>{var u,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 Ny(e,t){t||(t={});const n=Qp();return{...t,key:n,__TSR_key:n,[$r]:e}}function _E(e){var E,R;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const i=()=>s,o=T=>s=T,a=T=>T,l=()=>Pc(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!((E=t.history.state)!=null&&E.__TSR_key)&&!((R=t.history.state)!=null&&R.key)){const T=Qp();t.history.replaceState({[$r]:0,key:T,__TSR_key:T},"")}let c=l(),u,d=!1,h=!1,p=!1,m=!1;const y=()=>c;let w,g;const x=()=>{w&&(j._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),j._ignoreSubscribers=!1,w=void 0,g=void 0,u=void 0)},v=(T,N,A)=>{const O=a(N);g||(u=c),c=Pc(N,A),w={href:O,state:A,isPush:(w==null?void 0:w.isPush)||T==="push"},g||(g=Promise.resolve().then(()=>x()))},b=T=>{c=l(),j.notify({type:T})},S=async()=>{if(h){h=!1;return}const T=l(),N=T.state[$r]-c.state[$r],A=N===1,O=N===-1,z=!A&&!O||d;d=!1;const P=z?"GO":O?"BACK":"FORWARD",L=z?{type:"GO",index:N}:{type:O?"BACK":"FORWARD"};if(p)p=!1;else{const B=i();if(typeof document<"u"&&B.length){for(const M of B)if(await M.blockerFn({currentLocation:c,nextLocation:T,action:P})){h=!0,t.history.go(1),j.notify(L);return}}}c=l(),j.notify(L)},k=T=>{if(m){m=!1;return}let N=!1;const A=i();if(typeof document<"u"&&A.length)for(const O of A){const z=O.enableBeforeUnload??!0;if(z===!0){N=!0;break}if(typeof z=="function"&&z()===!0){N=!0;break}}if(N)return T.preventDefault(),T.returnValue=""},j=kE({getLocation:y,getLength:()=>t.history.length,pushState:(T,N)=>v("push",T,N),replaceState:(T,N)=>v("replace",T,N),back:T=>(T&&(p=!0),m=!0,t.history.back()),forward:T=>{T&&(p=!0),m=!0,t.history.forward()},go:T=>{d=!0,t.history.go(T)},createHref:T=>a(T),flush:x,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Iy,k,{capture:!0}),t.removeEventListener(Ry,S)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:i,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Iy,k,{capture:!0}),t.addEventListener(Ry,S),t.history.pushState=function(...T){const N=n.apply(t.history,T);return j._ignoreSubscribers||b("PUSH"),N},t.history.replaceState=function(...T){const N=r.apply(t.history,T);return j._ignoreSubscribers||b("REPLACE"),N},j}function SE(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Pc(e,t){const n=SE(e),r=n.indexOf("#"),s=n.indexOf("?"),i=Qp();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[$r]:0,key:i,__TSR_key:i}}}function Qp(){return(Math.random()+1).toString(36).substring(7)}function yi(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 CE=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=Zj(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=_E()),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=oa(1e3),d=this.buildRouteTree(),this.setRoutes(d)}if(!this.stores&&this.latestLocation){const d=this.getStoreConfig(this);this.batch=d.batch,this.stores=mE(jE(this.latestLocation),d),iE(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=rb(l);h&&h!=="/"&&d.push(pE({basepath:l})),c&&d.push(c),this.rewrite=d.length===0?void 0:d.length===1?d[0]:hE(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=Gj(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&$j(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 g=this.options.parseSearch(c),x=this.options.stringifySearch(g);return{href:l+x+u,publicHref:l+x+u,pathname:so(l).path,external:!1,searchStr:x,search:ns(r==null?void 0:r.search,g),hash:so(u.slice(1)).path,state:Er(r==null?void 0:r.state,h)}}const p=new URL(d,this.origin),m=sh(this.rewrite,p),y=this.options.parseSearch(m.search),w=this.options.stringifySearch(y);return m.search=w,{href:m.href.replace(m.origin,""),publicHref:d,pathname:so(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:w,search:ns(r==null?void 0:r.search,y),hash:so(m.hash.slice(1)).path,state:Er(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)=>Jj({base:n,to:Kp(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=>EE({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 T,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,jr(i.params,d)),m=this.getMatchedRoutes(h);let y=m.matchedRoutes;if((!m.foundRoute||m.foundRoute.path!=="/"&&m.routeParams["**"])&&this.options.notFoundRoute&&(y=[...y,this.options.notFoundRoute]),Object.keys(p).length>0)for(const A of y){const O=((T=A.options.params)==null?void 0:T.stringify)??A.options.stringifyParams;if(O)try{Object.assign(p,O(p))}catch{}}const w=n.leaveParams?h:so(by({path:h,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=u;if(n._includeValidateSearch&&((N=this.options.search)!=null&&N.strict)){const A={};y.forEach(O=>{if(O.options.validateSearch)try{Object.assign(A,Ol(O.options.validateSearch,{...A,...g}))}catch{}}),g=A}g=TE({search:g,dest:i,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),g=ns(u,g);const x=this.options.stringifySearch(g),v=i.hash===!0?o.hash:i.hash?jr(i.hash,o.hash):void 0,b=v?`#${v}`:"";let S=i.state===!0?o.state:i.state?jr(i.state,o.state):{};S=Er(o.state,S);const k=`${w}${x}${b}`;let j,E,R=!1;if(this.rewrite){const A=new URL(k,this.origin),O=sb(this.rewrite,A);j=A.href.replace(A.origin,""),O.origin!==this.origin?(E=O.href,R=!0):E=O.pathname+O.search+O.hash}else j=Oj(k),E=j;return{publicHref:E,href:j,pathname:w,search:g,searchStr:x,state:S,hash:v??"",external:R,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=Vj(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,jr(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=vs(s.state,this.latestLocation.state);return l.forEach(u=>{delete s.state[u]}),c},o=Br(this.latestLocation.href)===Br(s.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ti(()=>{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=Pc(a,{__TSR_index:n?d:d+1}),p=new URL(h.pathname,this.origin);l.to=sh(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(Sc(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=yi(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await Ey({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 w,g;let h=null,p=null,m=null,y=null;this.batch(()=>{const x=this.stores.pendingMatches.get(),v=x.length,b=this.stores.matches.get();h=v?b.filter(j=>!this.stores.pendingMatchStores.has(j.id)):null;const S=new Set;for(const j of this.stores.pendingMatchStores.values())j.routeId&&S.add(j.routeId);const k=new Set;for(const j of this.stores.matchStores.values())j.routeId&&k.add(j.routeId);p=v?b.filter(j=>!S.has(j.routeId)):null,m=v?x.filter(j=>!k.has(j.routeId)):null,y=v?x.filter(j=>k.has(j.routeId)):b,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(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,v]of[[p,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(x)for(const b of x)(g=(w=this.looseRoutesById[b.routeId].options)[v])==null||g.call(w,b)})})}})}catch(u){yt(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):st(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(yi(i,o)):r.types;if(a===!1){n();return}s={update:n,types:a}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const i=this.stores.matchStores.get(n);if(i){i.set(r);return}const o=this.stores.cachedMatchStores.get(n);if(o){const a=r(o.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(c=>c!==n)):o.set(a)}})},this.getMatch=n=>{var r,s,i;return((r=this.stores.cachedMatchStores.get(n))==null?void 0:r.get())??((s=this.stores.pendingMatchStores.get(n))==null?void 0:s.get())??((i=this.stores.matchStores.get(n))==null?void 0:i.get())},this.invalidate=n=>{const r=s=>{var i;return((i=n==null?void 0:n.filter)==null?void 0:i.call(n,s))??!0?{...s,invalid:!0,...n!=null&&n.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),i=this.getParsedLocationHref(s);n.options.href=i,n.headers.set("Location",i)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;n.options.href=i,n.headers.set("Location",i)}}catch{}if(n.options.href&&!n.options._builtLocation&&Sc(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const o=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=o};this.clearCache({filter:r})},this.loadRouteChunk=aa,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 Ey({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(yt(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});st(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},i=this.buildLocation(s);if(r!=null&&r.pending&&this.stores.status.get()!=="pending")return!1;const o=((r==null?void 0:r.pending)===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Uj(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!a||n.params&&!vs(a.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?vs(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??cE,parseSearch:e.parseSearch??lE,protocolAllowlist:e.protocolAllowlist??Fj}),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["**"]:Br(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:a=!0);const l=a?IE(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],y=c[p-1];let w,g,x;{const P=(y==null?void 0:y.search)??e.search,L=(y==null?void 0:y._strictSearch)??void 0;try{const B=Ol(m.options.validateSearch,{...P})??void 0;w={...P,...B},g={...L,...B},x=void 0}catch(B){let M=B;if(B instanceof jc||(M=new jc(B.message,{cause:B})),t!=null&&t.throwOnError)throw M;w=P,g={},x=M}}const v=((h=(d=m.options).loaderDeps)==null?void 0:h.call(d,{search:w}))??"",b=v?JSON.stringify(v):"",{interpolatedPath:S,usedParams:k}=by({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),j=m.id+S+b,E=this.getMatch(j),R=u.get(m.id),T=(E==null?void 0:E._strictParams)??k;let N;if(!E)try{Ay(m,k,i,T)}catch(P){if(st(P)||yt(P)?N=P:N=new PE(P.message,{cause:P}),t!=null&&t.throwOnError)throw N}Object.assign(s,T);const A=R?"stay":"enter";let O;if(E)O={...E,cause:A,params:(R==null?void 0:R.params)??s,_strictParams:T,search:ns(R?R.search:E.search,w),_strictSearch:g};else{const P=m.options.loader||m.options.beforeLoad||m.lazyFn||lb(m)?"pending":"success";O={id:j,ssr:m.options.ssr,index:p,routeId:m.id,params:(R==null?void 0:R.params)??s,_strictParams:T,pathname:S,updatedAt:Date.now(),search:R?ns(R.search,w):w,_strictSearch:g,searchError:void 0,status:P,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:Ti()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:A,loaderDeps:R?Er(R.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}t!=null&&t.preload||(O.globalNotFound=l===m.id),O.searchError=x;const z=this.getParentContext(y);O.context={...z,...O.__routeContext,...O.__beforeLoadContext},c[p]=O}for(let p=0;p<c.length;p++){const m=c[p],y=this.looseRoutesById[m.routeId],w=this.getMatch(m.id),g=u.get(m.routeId);if(m.params=g?ns(g.params,s):s,!w){const x=c[p-1],v=this.getParentContext(x);if(y.options.context){const b={deps:m.loaderDeps,params:m.params,context:v??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:c,routeId:y.id};m.__routeContext=y.options.context(b)??void 0}m.context={...v,...m.__routeContext,...m.__beforeLoadContext}}}return c}matchRoutesLightweight(e){var u;const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),s=sa(t),i={...e.search};for(const d of t)try{Object.assign(i,Ol(d.options.validateSearch,i))}catch{}const o=sa(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{Ay(h,n,r??{},d)}catch{}c=d}return{matchedRoutes:t,fullPath:s.fullPath,search:i,params:c}}},jc=class extends Error{},PE=class extends Error{};function jE(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ol(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new jc("Async validation not supported");if(n.issues)throw new jc(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 EE({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Br(e);let i,o;const a=Wj(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 TE({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return RE(n)(e,t,r??!1)}function RE(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,...Ol(i.options.validateSearch,c)??void 0}}catch{return c}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:jr(o.search,i):{}};t.middlewares.push(n);const r=(i,o,a)=>{if(i>=a.length)return o;const l=a[i];return l({search:o,next:u=>r(i+1,u,a)})};return function(o,a,l){return t.dest=a,t._includeValidateSearch=l,r(0,o,t.middlewares)}}function IE(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 ws}function Ay(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 NE="Error preloading route! ☝️";var cb=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=ws:this.parentRoute||Zn();let s=r?ws:n==null?void 0:n.path;s&&s!=="/"&&(s=nb(s));const i=(n==null?void 0:n.id)||s;let o=r?ws:Dl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),o!=="__root__"&&(o=Dl(["/",o]));const a=o==="__root__"?"/":Dl([this.parentRoute.fullPath,s]);this._path=s,this._id=o,this._fullPath=a,this._to=Br(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=>fE({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.")}},AE=class extends cb{constructor(e){super(e)}};function ME(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 qp(e){const t=e.errorComponent??Yp;return f.jsx(LE,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var LE=class extends _.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 Yp({error:e}){const[t,n]=_.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 DE({children:e,fallback:t=null}){return ub()?f.jsx(wi.Fragment,{children:e}):f.jsx(wi.Fragment,{children:t})}function ub(){return wi.useSyncExternalStore(FE,()=>!0,()=>!1)}function FE(){return()=>{}}var db=_.createContext(null);function Bt(e){return _.useContext(db)}var hu=_.createContext(void 0),OE=_.createContext(void 0),_e=(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))(_e||{});function zE({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 y=u.depsTail=c.subsTail={version:d,dep:c,sub:u,prevDep:h,nextDep:p,prevSub:m,nextSub:void 0};p!==void 0&&(p.prevDep=y),h!==void 0?h.nextDep=y:u.deps=y,m!==void 0?m.nextSub=y:c.subs=y}function s(c,u=c.sub){const d=c.dep,h=c.prevDep,p=c.nextDep,m=c.nextSub,y=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=y:d.subsTail=y,y!==void 0?y.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 y=(c=m).nextSub;y!==void 0&&(d={value:u,prev:d},u=y);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,y=m.flags;if(u.flags&16)p=!0;else if((y&17)===17){if(e(m)){const w=m.subs;w.nextSub!==void 0&&a(w),p=!0}}else if((y&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 w=c.nextDep;if(w!==void 0){c=w;continue}}for(;h--;){const w=u.subs,g=w.nextSub!==void 0;if(g?(c=d.value,d=d.prev):c=w,p){if(e(u)){g&&a(w),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 BE(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 oh=[];let zl=0;const{link:My,unlink:$E,propagate:VE,checkDirty:fb,shallowPropagate:Ly}=zE({update(e){return e._update()},notify(e){oh[ah++]=e,e.flags&=~_e.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=_e.Mutable|_e.Dirty,Ec(e))}});let tl=0,ah=0,En,lh=0;function hb(e){try{++lh,e()}finally{--lh||pb()}}function Ec(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=$E(n,e)}function pb(){if(!(lh>0)){for(;tl<ah;){const e=oh[tl];oh[tl++]=void 0,e.notify()}tl=0,ah=0}}function Dy(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?_e.None:_e.Mutable,get(){return En!==void 0&&My(s,En,zl),s._snapshot},subscribe(i){const o=BE(i),a={current:!1},l=UE(()=>{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=En,a=(t==null?void 0:t.compare)??Object.is;if(n)En=s,++zl,s.depsTail=void 0;else if(i===void 0)return!1;n&&(s.flags=_e.Mutable|_e.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{En=o,n&&(s.flags&=~_e.RecursedCheck),Ec(s)}}};return n?(s.flags=_e.Mutable|_e.Dirty,s.get=function(){const i=s.flags;if(i&_e.Dirty||i&_e.Pending&&fb(s.deps,s)){if(s._update()){const o=s.subs;o!==void 0&&Ly(o)}}else i&_e.Pending&&(s.flags=i&~_e.Pending);return En!==void 0&&My(s,En,zl),s._snapshot}):s.set=function(i){if(s._update(i)){const o=s.subs;o!==void 0&&(VE(o),Ly(o),pb())}},s}function UE(e){const t=()=>{const r=En;En=n,++zl,n.depsTail=void 0,n.flags=_e.Watching|_e.RecursedCheck;try{return e()}finally{En=r,n.flags&=~_e.RecursedCheck,Ec(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:_e.Watching|_e.RecursedCheck,notify(){const r=this.flags;r&_e.Dirty||r&_e.Pending&&fb(this.deps,this)?t():this.flags=_e.Watching},stop(){this.flags=_e.None,this.depsTail=void 0,Ec(this)}};return t(),n}var mb={exports:{}},gb={},yb={exports:{}},xb={};/**
42
- * @license React
43
- * use-sync-external-store-shim.production.js
44
- *
45
- * Copyright (c) Meta Platforms, Inc. and affiliates.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- */var Ri=_;function WE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HE=typeof Object.is=="function"?Object.is:WE,GE=Ri.useState,KE=Ri.useEffect,QE=Ri.useLayoutEffect,qE=Ri.useDebugValue;function YE(e,t){var n=t(),r=GE({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return QE(function(){s.value=n,s.getSnapshot=t,gd(s)&&i({inst:s})},[e,n,t]),KE(function(){return gd(s)&&i({inst:s}),e(function(){gd(s)&&i({inst:s})})},[e]),qE(n),n}function gd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HE(e,n)}catch{return!0}}function XE(e,t){return t()}var JE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?XE:YE;xb.useSyncExternalStore=Ri.useSyncExternalStore!==void 0?Ri.useSyncExternalStore:JE;yb.exports=xb;var ZE=yb.exports;/**
50
- * @license React
51
- * use-sync-external-store-shim/with-selector.production.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */var pu=_,eT=ZE;function tT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nT=typeof Object.is=="function"?Object.is:tT,rT=eT.useSyncExternalStore,sT=pu.useRef,iT=pu.useEffect,oT=pu.useMemo,aT=pu.useDebugValue;gb.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=sT(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=oT(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,nT(u,p))return m;var y=r(p);return s!==void 0&&s(m,y)?(u=p,m):(u=p,d=y)}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=rT(e,i[0],i[1]);return iT(function(){o.hasValue=!0,o.value=a},[a]),aT(a),a};mb.exports=gb;var vb=mb.exports;const lT=Qc(vb);function cT(e,t){return e===t}function kt(e,t,n=cT){const r=_.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(o);return a},[e]),s=_.useCallback(()=>e==null?void 0:e.get(),[e]);return vb.useSyncExternalStoreWithSelector(r,s,s,t,n)}var uT={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ms(e){const t=Bt(),n=_.useContext(e.from?OE:hu),r=e.from??n,s=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,i=_.useRef(void 0);return kt(s??uT,o=>{if((e.shouldThrow??!0)&&!o&&Zn(),o===void 0)return;const a=e.select?e.select(o):o;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=Er(i.current,a);return i.current=l,l}return a})}function wb(e){return Ms({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function bb(e){const{select:t,...n}=e;return Ms({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Fi(e){return Ms({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 Xp(e){return Ms({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function tn(e){const t=Bt();return _.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function kb(e){return Ms({...e,select:t=>e.select?e.select(t.context):t.context})}function dT(e,t){const n=Bt(),r=Nj(t),{activeProps:s,inactiveProps:i,activeOptions:o,to:a,preload:l,preloadDelay:c,preloadIntentProximity:u,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:m,viewTransition:y,children:w,target:g,disabled:x,style:v,className:b,onClick:S,onBlur:k,onFocus:j,onMouseEnter:E,onMouseLeave:R,onTouchStart:T,ignoreBlocker:N,params:A,search:O,hash:z,state:P,mask:L,reloadDocument:B,unsafeRelative:M,from:$,_fromLocation:C,...V}=e,Q=ub(),I=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=kt(n.stores.location,de=>de,(de,D)=>de.href===D.href),fe=_.useMemo(()=>{const de={_fromLocation:le,...I};return n.buildLocation(de)},[n,le,I]),ue=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,jt=fe.maskedLocation?fe.maskedLocation.external:fe.external,He=_.useMemo(()=>yT(ue,jt,n.history,x),[x,jt,ue,n.history]),Vt=_.useMemo(()=>{if(He!=null&&He.external)return Sc(He.href,n.protocolAllowlist)?void 0:He.href;if(!xT(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Sc(a,n.protocolAllowlist)?void 0:a}catch{}},[a,He,n.protocolAllowlist]),vn=_.useMemo(()=>{if(Vt)return!1;if(o!=null&&o.exact){if(!Xj(le.pathname,fe.pathname,n.basepath))return!1}else{const de=Cc(le.pathname,n.basepath),D=Cc(fe.pathname,n.basepath);if(!(de.startsWith(D)&&(de.length===D.length||de[D.length]==="/")))return!1}return((o==null?void 0:o.includeSearch)??!0)&&!vs(le.search,fe.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?Q&&le.hash===fe.hash:!0},[o==null?void 0:o.exact,o==null?void 0:o.explicitUndefined,o==null?void 0:o.includeHash,o==null?void 0:o.includeSearch,le,Vt,Q,fe.hash,fe.pathname,fe.search,n.basepath]),On=vn?jr(s,{})??fT:yd,Ds=vn?yd:jr(i,{})??yd,Ra=[b,On.className,Ds.className].filter(Boolean).join(" "),Ia=(v||On.style||Ds.style)&&{...v,...On.style,...Ds.style},[Na,Gi]=_.useState(!1),Ki=_.useRef(!1),ar=e.reloadDocument||Vt?!1:l??n.options.defaultPreload,Fs=c??n.options.defaultPreloadDelay??0,wn=_.useCallback(()=>{n.preloadRoute({...I,_builtLocation:fe}).catch(de=>{console.warn(de),console.warn(NE)})},[n,I,fe]);Ij(r,_.useCallback(de=>{de!=null&&de.isIntersecting&&wn()},[wn]),gT,{disabled:!!x||ar!=="viewport"}),_.useEffect(()=>{Ki.current||!x&&ar==="render"&&(wn(),Ki.current=!0)},[x,wn,ar]);const Lu=de=>{const D=de.currentTarget.getAttribute("target"),H=g!==void 0?g:D;if(!x&&!vT(de)&&!de.defaultPrevented&&(!H||H==="_self")&&de.button===0){de.preventDefault(),As.flushSync(()=>{Gi(!0)});const Z=n.subscribe("onResolved",()=>{Z(),Gi(!1)});n.navigate({...I,replace:h,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:y,ignoreBlocker:N})}};if(Vt)return{...V,ref:r,href:Vt,...w&&{children:w},...g&&{target:g},...x&&{disabled:x},...v&&{style:v},...b&&{className:b},...S&&{onClick:S},...k&&{onBlur:k},...j&&{onFocus:j},...E&&{onMouseEnter:E},...R&&{onMouseLeave:R},...T&&{onTouchStart:T}};const Aa=de=>{if(x||ar!=="intent")return;if(!Fs){wn();return}const D=de.currentTarget;if(ao.has(D))return;const H=setTimeout(()=>{ao.delete(D),wn()},Fs);ao.set(D,H)},Du=de=>{x||ar!=="intent"||wn()},Ma=de=>{if(x||!ar||!Fs)return;const D=de.currentTarget,H=ao.get(D);H&&(clearTimeout(H),ao.delete(D))};return{...V,...On,...Ds,href:He==null?void 0:He.href,ref:r,onClick:Bs([S,Lu]),onBlur:Bs([k,Ma]),onFocus:Bs([j,Aa]),onMouseEnter:Bs([E,Aa]),onMouseLeave:Bs([R,Ma]),onTouchStart:Bs([T,Du]),disabled:!!x,target:g,...Ia&&{style:Ia},...Ra&&{className:Ra},...x&&hT,...vn&&pT,...Q&&Na&&mT}}var yd={},fT={className:"active"},hT={role:"link","aria-disabled":!0},pT={"data-status":"active","aria-current":"page"},mT={"data-transitioning":"transitioning"},ao=new WeakMap,gT={rootMargin:"100px"},Bs=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function yT(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function xT(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var _b=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...i}=dT(r,t),o=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=i;return _.createElement("a",l,o)}return _.createElement(n,i,o)});function vT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var wT=class extends cb{constructor(e){super(e),this.useMatch=t=>Ms({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>kb({...t,from:this.id}),this.useSearch=t=>Xp({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Fi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>bb({...t,from:this.id}),this.useLoaderData=t=>wb({...t,from:this.id}),this.useNavigate=()=>tn({from:this.fullPath}),this.Link=wi.forwardRef((t,n)=>f.jsx(_b,{ref:n,from:this.fullPath,...t}))}};function nn(e){return new wT(e)}var bT=class extends AE{constructor(e){super(e),this.useMatch=t=>Ms({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>kb({...t,from:this.id}),this.useSearch=t=>Xp({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Fi({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>bb({...t,from:this.id}),this.useLoaderData=t=>wb({...t,from:this.id}),this.useNavigate=()=>tn({from:this.fullPath}),this.Link=wi.forwardRef((t,n)=>f.jsx(_b,{ref:n,from:this.fullPath,...t}))}};function kT(e){return new bT(e)}function _T(e){const t=Bt(),n=`not-found-${kt(t.stores.location,r=>r.pathname)}-${kt(t.stores.status,r=>r)}`;return f.jsx(qp,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(st(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(st(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function ST(){return f.jsx("p",{children:"Not Found"})}function Ks(e){return f.jsx(f.Fragment,{children:e.children})}function Sb(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(ST,{})}function CT(e){return null}function PT(){return CT(Bt()),null}var Cb=_.memo(function({matchId:t}){const n=Bt(),r=n.stores.matchStores.get(t);r||Zn();const s=kt(n.stores.loadedAt,o=>o),i=kt(r,o=>o);return f.jsx(jT,{router:n,matchId:t,resetKey:s,matchState:_.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 jT({router:e,matchId:t,resetKey:n,matchState:r}){var m,y;const s=e.routesById[r.routeId],i=s.options.pendingComponent??e.options.defaultPendingComponent,o=i?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??(((y=s.options.errorComponent)==null?void 0:y.preload)||u))?_.Suspense:Ks,h=a?qp:Ks,p=c?_T:Ks;return f.jsxs(s.isRoot?s.options.shellComponent??Ks:Ks,{children:[f.jsx(hu.Provider,{value:t,children:f.jsx(d,{fallback:o,children:f.jsx(h,{getResetKey:()=>n,errorComponent:a||Yp,onCatch:(w,g)=>{if(st(w))throw w.routeId??(w.routeId=r.routeId),w;l==null||l(w,g)},children:f.jsx(p,{fallback:w=>{if(w.routeId??(w.routeId=r.routeId),!c||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!s.isRoot)throw w;return _.createElement(c,w)},children:u||r._displayPending?f.jsx(DE,{fallback:o,children:f.jsx(Fy,{matchId:t})}):f.jsx(Fy,{matchId:t})})})})}),r.parentRouteId===ws?f.jsxs(f.Fragment,{children:[f.jsx(ET,{resetKey:n}),e.options.scrollRestoration&&Z1?f.jsx(PT,{}):null]}):null]})}function ET({resetKey:e}){const t=Bt(),n=_.useRef(void 0);return ko(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...yi(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var Fy=_.memo(function({matchId:t}){const n=Bt(),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||Zn();const i=kt(s,u=>u),o=i.routeId,a=n.routesById[o],l=_.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=_.useMemo(()=>{const u=a.options.component??n.options.defaultComponent;return u?f.jsx(u,{},l):f.jsx(Pb,{})},[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=Ti();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},u)}}throw r(i,"loadPromise")}if(i.status==="notFound")return st(i.error)||Zn(),Sb(n,a,i.error);if(i.status==="redirected")throw yt(i.error)||Zn(),r(i,"loadPromise");if(i.status==="error")throw i.error;return c}),Pb=_.memo(function(){const t=Bt(),n=_.useContext(hu);let r,s=!1,i;{const c=n?t.stores.matchStores.get(n):void 0;[r,s]=kt(c,u=>[u==null?void 0:u.routeId,(u==null?void 0:u.globalNotFound)??!1]),i=kt(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||Zn(),Sb(t,o,void 0);if(!i)return null;const l=f.jsx(Cb,{matchId:i});return r===ws?f.jsx(_.Suspense,{fallback:a,children:l}):l});function TT(){const e=Bt(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),s=kt(e.stores.isLoading,d=>d),i=kt(e.stores.hasPending,d=>d),o=cd(s),a=s||n||i,l=cd(a),c=s||i,u=cd(c);return e.startTransition=d=>{r(!0),_.startTransition(()=>{d(),r(!1)})},_.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 Br(e.latestLocation.publicHref)!==Br(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),ko(()=>{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]),ko(()=>{o&&!s&&e.emit({type:"onLoad",...yi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,s]),ko(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...yi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,u,e]),ko(()=>{if(l&&!a){const d=yi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),hb(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),d.hrefChanged&&ME(e)}},[a,l,e]),null}function RT(){const e=Bt(),t=e.routesById[ws].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?Ks:_.Suspense,{fallback:n,children:[f.jsx(TT,{}),f.jsx(IT,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function IT(){const e=Bt(),t=kt(e.stores.firstId,s=>s),n=kt(e.stores.loadedAt,s=>s),r=t?f.jsx(Cb,{matchId:t}):null;return f.jsx(hu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(qp,{getResetKey:()=>n,errorComponent:Yp,onCatch:void 0,children:r})})}var NT=e=>({createMutableStore:Dy,createReadonlyStore:Dy,batch:hb}),AT=e=>new MT(e),MT=class extends CE{constructor(e){super(e,NT)}};function LT({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(db.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function DT({router:e,...t}){return f.jsx(LT,{router:e,...t,children:f.jsx(RT,{})})}function FT(e){const t=Bt({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t,r=_.useRef(void 0);return kt(n.stores.__store,s=>{if(e!=null&&e.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Er(r.current,e.select(s));return r.current=i,i}return e.select(s)}return s})}const OT="modulepreload",zT=function(e,t){return new URL(e,t).href},Oy={},or=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=zT(c,r),c in Oy)return;Oy[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===c&&(!u||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":OT,u||(p.as="script"),p.crossOrigin="",p.href=c,l&&p.setAttribute("nonce",l),document.head.appendChild(p),u)return new Promise((m,y)=>{p.addEventListener("load",m),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};function BT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const $T=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UT={};function zy(e,t){return(UT.jsx?VT:$T).test(e)}const WT=/[ \t\n\f\r]/g;function HT(e){return typeof e=="object"?e.type==="text"?By(e.value):!1:By(e)}function By(e){return e.replace(WT,"")===""}class xa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xa.prototype.normal={};xa.prototype.property={};xa.prototype.space=void 0;function jb(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new xa(n,r,t)}function ch(e){return e.toLowerCase()}class Pt{constructor(t,n){this.attribute=n,this.property=t}}Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let GT=0;const ee=Ls(),De=Ls(),uh=Ls(),W=Ls(),pe=Ls(),ks=Ls(),It=Ls();function Ls(){return 2**++GT}const dh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:De,commaOrSpaceSeparated:It,commaSeparated:ks,number:W,overloadedBoolean:uh,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),xd=Object.keys(dh);class Jp extends Pt{constructor(t,n,r,s){let i=-1;if(super(t,n),$y(this,"space",s),typeof r=="number")for(;++i<xd.length;){const o=xd[i];$y(this,xd[i],(r&dh[o])===dh[o])}}}Jp.prototype.defined=!0;function $y(e,t,n){n&&(e[t]=n)}function Oi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Jp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ch(r)]=r,n[ch(i.attribute)]=r}return new xa(t,n,e.space)}const Eb=Oi({properties:{ariaActiveDescendant:null,ariaAtomic:De,ariaAutoComplete:null,ariaBusy:De,ariaChecked:De,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:De,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:De,ariaFlowTo:pe,ariaGrabbed:De,ariaHasPopup:null,ariaHidden:De,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:W,ariaLive:null,ariaModal:De,ariaMultiLine:De,ariaMultiSelectable:De,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:De,ariaReadOnly:De,ariaRelevant:null,ariaRequired:De,ariaRoleDescription:pe,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:De,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Tb(e,t){return t in e?e[t]:t}function Rb(e,t){return Tb(e,t.toLowerCase())}const KT=Oi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alpha:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:pe,autoFocus:ee,autoPlay:ee,blocking:pe,capture:null,charSet:null,checked:ee,cite:null,className:pe,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:De,controls:ee,controlsList:pe,coords:W|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:uh,draggable:De,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,formTarget:null,headers:pe,height:W,hidden:uh,high:W,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:pe,itemRef:pe,itemScope:ee,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:W,pattern:null,ping:pe,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:pe,required:ee,reversed:ee,rows:W,rowSpan:W,sandbox:pe,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootCustomElementRegistry:ee,shadowRootDelegatesFocus:ee,shadowRootMode:null,shadowRootSerializable:ee,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:De,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:ee,useMap:null,value:De,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:De,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ee,disablePictureInPicture:ee,disableRemotePlayback:ee,exportParts:ks,part:pe,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:Rb}),QT=Oi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:It,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:pe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ks,g2:ks,glyphName:ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:It,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:It,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:It,rev:It,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:It,requiredFeatures:It,requiredFonts:It,requiredFormats:It,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:It,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:It,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:It,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Tb}),Ib=Oi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Nb=Oi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rb}),Ab=Oi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qT={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"},YT=/[A-Z]/g,Vy=/-[a-z]/g,XT=/^data[-\w.:]+$/i;function JT(e,t){const n=ch(t);let r=t,s=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&XT.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Vy,e2);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Vy.test(i)){let o=i.replace(YT,ZT);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Jp}return new s(r,t)}function ZT(e){return"-"+e.toLowerCase()}function e2(e){return e.charAt(1).toUpperCase()}const t2=jb([Eb,KT,Ib,Nb,Ab],"html"),Zp=jb([Eb,QT,Ib,Nb,Ab],"svg");function n2(e){return e.join(" ").trim()}var em={},Uy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r2=/\n/g,s2=/^\s*/,i2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o2=/^:\s*/,a2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l2=/^[;\s]*/,c2=/^\s+|\s+$/g,u2=`
58
- `,Wy="/",Hy="*",us="",d2="comment",f2="declaration";function h2(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(m){var y=m.match(r2);y&&(n+=y.length);var w=m.lastIndexOf(u2);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),c(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var w=y[0];return s(w),e=e.slice(w.length),y}}function c(){l(s2)}function u(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=i();if(!(Wy!=e.charAt(0)||Hy!=e.charAt(1))){for(var y=2;us!=e.charAt(y)&&(Hy!=e.charAt(y)||Wy!=e.charAt(y+1));)++y;if(y+=2,us===e.charAt(y-1))return a("End of comment missing");var w=e.slice(2,y-2);return r+=2,s(w),e=e.slice(y),r+=2,m({type:d2,comment:w})}}function h(){var m=i(),y=l(i2);if(y){if(d(),!l(o2))return a("property missing ':'");var w=l(a2),g=m({type:f2,property:Gy(y[0].replace(Uy,us)),value:w?Gy(w[0].replace(Uy,us)):us});return l(l2),g}}function p(){var m=[];u(m);for(var y;y=h();)y!==!1&&(m.push(y),u(m));return m}return c(),p()}function Gy(e){return e?e.replace(c2,us):us}var p2=h2,m2=Zl&&Zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(em,"__esModule",{value:!0});em.default=y2;const g2=m2(p2);function y2(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,g2.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.camelCase=void 0;var x2=/^--[a-zA-Z0-9_-]+$/,v2=/-([a-z])/g,w2=/^[^-]+$/,b2=/^-(webkit|moz|ms|o|khtml)-/,k2=/^-(ms)-/,_2=function(e){return!e||w2.test(e)||x2.test(e)},S2=function(e,t){return t.toUpperCase()},Ky=function(e,t){return"".concat(t,"-")},C2=function(e,t){return t===void 0&&(t={}),_2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(k2,Ky):e=e.replace(b2,Ky),e.replace(v2,S2))};mu.camelCase=C2;var P2=Zl&&Zl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},j2=P2(em),E2=mu;function fh(e,t){var n={};return!e||typeof e!="string"||(0,j2.default)(e,function(r,s){r&&s&&(n[(0,E2.camelCase)(r,t)]=s)}),n}fh.default=fh;var T2=fh;const R2=Qc(T2),Mb=Lb("end"),tm=Lb("start");function Lb(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 I2(e){const t=tm(e),n=Mb(e);if(t&&n)return{start:t,end:n}}function Ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qy(e.position):"start"in e||"end"in e?Qy(e):"line"in e||"column"in e?hh(e):""}function hh(e){return qy(e&&e.line)+":"+qy(e&&e.column)}function Qy(e){return hh(e&&e.start)+"-"+hh(e&&e.end)}function qy(e){return e&&typeof e=="number"?e:1}class ot 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=Ao(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}}ot.prototype.file="";ot.prototype.name="";ot.prototype.reason="";ot.prototype.message="";ot.prototype.stack="";ot.prototype.column=void 0;ot.prototype.line=void 0;ot.prototype.ancestors=void 0;ot.prototype.cause=void 0;ot.prototype.fatal=void 0;ot.prototype.place=void 0;ot.prototype.ruleId=void 0;ot.prototype.source=void 0;const nm={}.hasOwnProperty,N2=new Map,A2=/[A-Z]/g,M2=new Set(["table","tbody","thead","tfoot","tr"]),L2=new Set(["td","th"]),Db="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function D2(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=W2(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=U2(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"?Zp:t2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Fb(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Fb(e,t,n){if(t.type==="element")return F2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return O2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return B2(e,t,n);if(t.type==="mdxjsEsm")return z2(e,t);if(t.type==="root")return $2(e,t,n);if(t.type==="text")return V2(e,t)}function F2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Zp,e.schema=s),e.ancestors.push(t);const i=zb(e,t.tagName,!1),o=H2(e,t);let a=sm(e,t);return M2.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!HT(l):!0})),Ob(e,o,i,t),rm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function O2(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)}la(e,t.position)}function z2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);la(e,t.position)}function B2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Zp,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:zb(e,t.name,!0),o=G2(e,t),a=sm(e,t);return Ob(e,o,i,t),rm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function $2(e,t,n){const r={};return rm(r,sm(e,t)),e.create(t,e.Fragment,r,n)}function V2(e,t){return t.value}function Ob(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U2(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 W2(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),l=tm(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 H2(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&nm.call(t.properties,s)){const i=K2(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&L2.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 G2(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 la(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 la(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function sm(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:N2;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=Fb(e,i,o);a!==void 0&&n.push(a)}return n}function K2(e,t,n){const r=JT(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?BT(n):n2(n)),r.property==="style"){let s=typeof n=="object"?n:Q2(e,String(n));return e.stylePropertyNameCase==="css"&&(s=q2(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?qT[r.property]||r.property:r.attribute,n]}}function Q2(e,t){try{return R2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new ot("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=Db+"#cannot-parse-style-attribute",s}}function zb(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=zy(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=zy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return nm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);la(e)}function la(e,t){const n=new ot("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=Db+"#cannot-handle-mdx-estrees-without-createevaluater",n}function q2(e){const t={};let n;for(n in e)nm.call(e,n)&&(t[Y2(n)]=e[n]);return t}function Y2(e){let t=e.replace(A2,X2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function X2(e){return"-"+e.toLowerCase()}const vd={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"]},J2={};function Z2(e,t){const n=J2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Bb(e,r,s)}function Bb(e,t,n){if(eR(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 Yy(e.children,t,n)}return Array.isArray(e)?Yy(e,t,n):""}function Yy(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Bb(e[s],t,n);return r.join("")}function eR(e){return!!(e&&typeof e=="object")}const Xy=document.createElement("i");function im(e){const t="&"+e+";";Xy.innerHTML=t;const n=Xy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ln(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 Qt(e,t){return e.length>0?(Ln(e,e.length,0,t),e):t}const Jy={}.hasOwnProperty;function tR(e){const t={};let n=-1;for(;++n<e.length;)nR(t,e[n]);return t}function nR(e,t){let n;for(n in t){const s=(Jy.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){Jy.call(s,o)||(s[o]=[]);const a=i[o];rR(s[o],Array.isArray(a)?a:a?[a]:[])}}}function rR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ln(e,0,0,r)}function $b(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 xi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Yr(/[A-Za-z]/),Mt=Yr(/[\dA-Za-z]/),sR=Yr(/[#-'*+\--9=?A-Z^-~]/);function ph(e){return e!==null&&(e<32||e===127)}const mh=Yr(/\d/),iR=Yr(/[\dA-Fa-f]/),oR=Yr(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function ae(e){return e===-2||e===-1||e===32}const aR=Yr(new RegExp("\\p{P}|\\p{S}","u")),lR=Yr(/\s/);function Yr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Mt(e.charCodeAt(n+1))&&Mt(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 ve(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return ae(l)&&i++<s?(e.consume(l),a):(e.exit(n),t(l))}}const cR={tokenize:uR};function uR(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"),ve(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 J(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const dR={tokenize:fR},Zy={tokenize:hR};function fR(e){const t=this,n=[];let r=0,s,i,o;return a;function a(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&x();const b=t.events.length;let S=b,k;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){k=t.events[S][1].end;break}g(r);let j=b;for(;j<t.events.length;)t.events[j][1].end={...k},j++;return Ln(t.events,S+1,0,t.events.slice(b)),t.events.length=j,c(v)}return a(v)}function c(v){if(r===n.length){if(!s)return h(v);if(s.currentConstruct&&s.currentConstruct.concrete)return m(v);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zy,u,d)(v)}function u(v){return s&&x(),g(r),h(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(v)}function h(v){return t.containerState={},e.attempt(Zy,p,m)(v)}function p(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function m(v){if(v===null){s&&x(),g(0),e.consume(v);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(v)}function y(v){if(v===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(v);return}return J(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(v),y)}function w(v,b){const S=t.sliceStream(v);if(b&&S.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(S),t.parser.lazy[v.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const j=t.events.length;let E=j,R,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(R){T=t.events[E][1].end;break}R=!0}for(g(r),k=j;k<t.events.length;)t.events[k][1].end={...T},k++;Ln(t.events,E+1,0,t.events.slice(j)),t.events.length=k}}function g(v){let b=n.length;for(;b-- >v;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=v}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function hR(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ex(e){if(e===null||bt(e)||lR(e))return 1;if(aR(e))return 2}function om(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 gh={name:"attention",resolveAll:pR,tokenize:mR};function pR(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};tx(d,-l),tx(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=Qt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Qt(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=Qt(c,om(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Qt(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=Qt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ln(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 mR(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ex(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=ex(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 tx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const gR={name:"autolink",tokenize:yR};function yR(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 In(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||Mt(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||Mt(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||ph(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):sR(p)?(e.consume(p),c):n(p)}function u(p){return Mt(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||Mt(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const gu={partial:!0,tokenize:xR};function xR(e,t,n){return r;function r(i){return ae(i)?ve(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||J(i)?t(i):n(i)}}const Vb={continuation:{tokenize:wR},exit:bR,name:"blockQuote",tokenize:vR};function vR(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 ae(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function wR(e,t,n){const r=this;return s;function s(o){return ae(o)?ve(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Vb,t,n)(o)}}function bR(e){e.exit("blockQuote")}const Ub={name:"characterEscape",tokenize:kR};function kR(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 oR(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Wb={name:"characterReference",tokenize:_R};function _R(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=Mt,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=iR,u):(e.enter("characterReferenceValue"),i=7,o=mh,u(d))}function u(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===Mt&&!im(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 nx={partial:!0,tokenize:CR},rx={concrete:!0,name:"codeFenced",tokenize:SR};function SR(e,t,n){const r=this,s={partial:!0,tokenize:S};let i=0,o=0,a;return l;function l(k){return c(k)}function c(k){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(k)}function u(k){return k===a?(o++,e.consume(k),u):o<3?n(k):(e.exit("codeFencedFenceSequence"),ae(k)?ve(e,d,"whitespace")(k):d(k))}function d(k){return k===null||J(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(nx,y,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||J(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):ae(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||J(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||J(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?n(k):(e.consume(k),m)}function y(k){return e.attempt(s,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return i>0&&ae(k)?ve(e,x,"linePrefix",i+1)(k):x(k)}function x(k){return k===null||J(k)?e.check(nx,y,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||J(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function S(k,j,E){let R=0;return T;function T(P){return k.enter("lineEnding"),k.consume(P),k.exit("lineEnding"),N}function N(P){return k.enter("codeFencedFence"),ae(P)?ve(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):A(P)}function A(P){return P===a?(k.enter("codeFencedFenceSequence"),O(P)):E(P)}function O(P){return P===a?(R++,k.consume(P),O):R>=o?(k.exit("codeFencedFenceSequence"),ae(P)?ve(k,z,"whitespace")(P):z(P)):E(P)}function z(P){return P===null||J(P)?(k.exit("codeFencedFence"),j(P)):E(P)}}}function CR(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 wd={name:"codeIndented",tokenize:jR},PR={partial:!0,tokenize:ER};function jR(e,t,n){const r=this;return s;function s(c){return e.enter("codeIndented"),ve(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):J(c)?e.attempt(PR,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||J(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ER(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):J(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ve(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):J(o)?s(o):n(o)}}const TR={name:"codeText",previous:IR,resolve:RR,tokenize:NR};function RR(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 IR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function NR(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)):J(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||J(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 AR{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&&lo(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),lo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lo(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);lo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lo(this.left,n.reverse())}}}function lo(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 Hb(e){const t={};let n=-1,r,s,i,o,a,l,c;const u=new AR(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,MR(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 Ln(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function MR(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,y=0;const w=[y];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&&(y=h+1,w.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=a.slice(w[h],w[h+1]),x=i.pop();l.push([x,x+g.length-1]),e.splice(x,2,g)}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 LR={resolve:FR,tokenize:OR},DR={partial:!0,tokenize:zR};function FR(e){return Hb(e),e}function OR(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):J(a)?e.check(DR,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 zR(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ve(e,i,"linePrefix")}function i(o){if(o===null||J(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 Gb(e,t,n,r,s,i,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||ph(g)?n(g):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(a),h(g)):g===null||g===60||J(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!u&&(g===null||g===41||bt(g))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,y):g===41?(e.consume(g),u--,y):g===null||g===32||g===40||ph(g)?n(g):(e.consume(g),g===92?w:y)}function w(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function Kb(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):J(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||J(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ae(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Qb(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):J(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||J(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 Mo(e,t){let n;return r;function r(s){return J(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ae(s)?ve(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const BR={name:"definition",tokenize:VR},$R={partial:!0,tokenize:UR};function VR(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return Kb.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=xi(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 bt(p)?Mo(e,c)(p):c(p)}function c(p){return Gb(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt($R,d,d)(p)}function d(p){return ae(p)?ve(e,h,"whitespace")(p):h(p)}function h(p){return p===null||J(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function UR(e,t,n){return r;function r(a){return bt(a)?Mo(e,s)(a):n(a)}function s(a){return Qb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ae(a)?ve(e,o,"whitespace")(a):o(a)}function o(a){return a===null||J(a)?t(a):n(a)}}const WR={name:"hardBreakEscape",tokenize:HR};function HR(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return J(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const GR={name:"headingAtx",resolve:KR,tokenize:QR};function KR(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"},Ln(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function QR(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||bt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||J(u)?(e.exit("atxHeading"),t(u)):ae(u)?ve(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||bt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const qR=["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"],sx=["pre","script","style","textarea"],YR={concrete:!0,name:"htmlFlow",resolveTo:ZR,tokenize:eI},XR={partial:!0,tokenize:nI},JR={partial:!0,tokenize:tI};function ZR(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 eI(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,y):I===63?(e.consume(I),s=3,r.interrupt?t:C):In(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function h(I){return I===45?(e.consume(I),s=2,p):I===91?(e.consume(I),s=5,a=0,m):In(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 le="CDATA[";return I===le.charCodeAt(a++)?(e.consume(I),a===le.length?r.interrupt?t:A:m):n(I)}function y(I){return In(I)?(e.consume(I),o=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||bt(I)){const le=I===47,fe=o.toLowerCase();return!le&&!i&&sx.includes(fe)?(s=1,r.interrupt?t(I):A(I)):qR.includes(o.toLowerCase())?(s=6,le?(e.consume(I),g):r.interrupt?t(I):A(I)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?x(I):v(I))}return I===45||Mt(I)?(e.consume(I),o+=String.fromCharCode(I),w):n(I)}function g(I){return I===62?(e.consume(I),r.interrupt?t:A):n(I)}function x(I){return ae(I)?(e.consume(I),x):T(I)}function v(I){return I===47?(e.consume(I),T):I===58||I===95||In(I)?(e.consume(I),b):ae(I)?(e.consume(I),v):T(I)}function b(I){return I===45||I===46||I===58||I===95||Mt(I)?(e.consume(I),b):S(I)}function S(I){return I===61?(e.consume(I),k):ae(I)?(e.consume(I),S):v(I)}function k(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,j):ae(I)?(e.consume(I),k):E(I)}function j(I){return I===l?(e.consume(I),l=null,R):I===null||J(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||bt(I)?S(I):(e.consume(I),E)}function R(I){return I===47||I===62||ae(I)?v(I):n(I)}function T(I){return I===62?(e.consume(I),N):n(I)}function N(I){return I===null||J(I)?A(I):ae(I)?(e.consume(I),N):n(I)}function A(I){return I===45&&s===2?(e.consume(I),L):I===60&&s===1?(e.consume(I),B):I===62&&s===4?(e.consume(I),V):I===63&&s===3?(e.consume(I),C):I===93&&s===5?(e.consume(I),$):J(I)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(XR,Q,O)(I)):I===null||J(I)?(e.exit("htmlFlowData"),O(I)):(e.consume(I),A)}function O(I){return e.check(JR,z,Q)(I)}function z(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),P}function P(I){return I===null||J(I)?O(I):(e.enter("htmlFlowData"),A(I))}function L(I){return I===45?(e.consume(I),C):A(I)}function B(I){return I===47?(e.consume(I),o="",M):A(I)}function M(I){if(I===62){const le=o.toLowerCase();return sx.includes(le)?(e.consume(I),V):A(I)}return In(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),M):A(I)}function $(I){return I===93?(e.consume(I),C):A(I)}function C(I){return I===62?(e.consume(I),V):I===45&&s===2?(e.consume(I),C):A(I)}function V(I){return I===null||J(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),V)}function Q(I){return e.exit("htmlFlow"),t(I)}}function tI(e,t,n){const r=this;return s;function s(o){return J(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 nI(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(gu,t,n)}}const rI={name:"htmlText",tokenize:sI};function sI(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),S):C===63?(e.consume(C),v):In(C)?(e.consume(C),E):n(C)}function c(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,m):In(C)?(e.consume(C),x):n(C)}function u(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):J(C)?(o=d,B(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?L(C):C===45?h(C):d(C)}function m(C){const V="CDATA[";return C===V.charCodeAt(i++)?(e.consume(C),i===V.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),w):J(C)?(o=y,B(C)):(e.consume(C),y)}function w(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?L(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?L(C):J(C)?(o=x,B(C)):(e.consume(C),x)}function v(C){return C===null?n(C):C===63?(e.consume(C),b):J(C)?(o=v,B(C)):(e.consume(C),v)}function b(C){return C===62?L(C):v(C)}function S(C){return In(C)?(e.consume(C),k):n(C)}function k(C){return C===45||Mt(C)?(e.consume(C),k):j(C)}function j(C){return J(C)?(o=j,B(C)):ae(C)?(e.consume(C),j):L(C)}function E(C){return C===45||Mt(C)?(e.consume(C),E):C===47||C===62||bt(C)?R(C):n(C)}function R(C){return C===47?(e.consume(C),L):C===58||C===95||In(C)?(e.consume(C),T):J(C)?(o=R,B(C)):ae(C)?(e.consume(C),R):L(C)}function T(C){return C===45||C===46||C===58||C===95||Mt(C)?(e.consume(C),T):N(C)}function N(C){return C===61?(e.consume(C),A):J(C)?(o=N,B(C)):ae(C)?(e.consume(C),N):R(C)}function A(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,O):J(C)?(o=A,B(C)):ae(C)?(e.consume(C),A):(e.consume(C),z)}function O(C){return C===s?(e.consume(C),s=void 0,P):C===null?n(C):J(C)?(o=O,B(C)):(e.consume(C),O)}function z(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||bt(C)?R(C):(e.consume(C),z)}function P(C){return C===47||C===62||bt(C)?R(C):n(C)}function L(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function B(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),M}function M(C){return ae(C)?ve(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):$(C)}function $(C){return e.enter("htmlTextData"),o(C)}}const am={name:"labelEnd",resolveAll:lI,resolveTo:cI,tokenize:uI},iI={tokenize:dI},oI={tokenize:fI},aI={tokenize:hI};function lI(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&&Ln(e,0,e.length,n),e}function cI(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=Qt(a,e.slice(i+1,i+r+3)),a=Qt(a,[["enter",u,t]]),a=Qt(a,om(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=Qt(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Qt(a,e.slice(o+1)),a=Qt(a,[["exit",l,t]]),Ln(e,i,e.length,a),e}function uI(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(xi(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(iI,u,o?u:d)(h):h===91?e.attempt(oI,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(aI,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function dI(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 bt(d)?Mo(e,i)(d):i(d)}function i(d){return d===41?u(d):Gb(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return bt(d)?Mo(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Qb(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return bt(d)?Mo(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 fI(e,t,n){const r=this;return s;function s(a){return Kb.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(xi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function hI(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 pI={name:"labelStartImage",resolveAll:am.resolveAll,tokenize:mI};function mI(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 gI={name:"labelStartLink",resolveAll:am.resolveAll,tokenize:yI};function yI(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 bd={name:"lineEnding",tokenize:xI};function xI(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Bl={name:"thematicBreak",tokenize:vI};function vI(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||J(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ae(c)?ve(e,a,"whitespace")(c):a(c))}}const pt={continuation:{tokenize:_I},exit:CI,name:"list",tokenize:kI},wI={partial:!0,tokenize:PI},bI={partial:!0,tokenize:SI};function kI(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:mh(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(Bl,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 mh(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(gu,r.interrupt?n:u,e.attempt(wI,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return ae(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 _I(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gu,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ae(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(bI,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function SI(e,t,n){const r=this;return ve(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 CI(e){e.exit(this.containerState.type)}function PI(e,t,n){const r=this;return ve(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!ae(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const ix={name:"setextUnderline",resolveTo:jI,tokenize:EI};function jI(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 EI(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"),ae(c)?ve(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||J(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const TI={tokenize:RI};function RI(e){const t=this,n=e.attempt(gu,r,e.attempt(this.parser.constructs.flowInitial,s,ve(e,e.attempt(this.parser.constructs.flow,s,e.attempt(LR,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 II={resolveAll:Yb()},NI=qb("string"),AI=qb("text");function qb(e){return{resolveAll:Yb(e==="text"?MI: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 Yb(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 MI(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 LI={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Vb},DI={91:BR},FI={[-2]:wd,[-1]:wd,32:wd},OI={35:GR,42:Bl,45:[ix,Bl],60:YR,61:ix,95:Bl,96:rx,126:rx},zI={38:Wb,92:Ub},BI={[-5]:bd,[-4]:bd,[-3]:bd,33:pI,38:Wb,42:gh,60:[gR,rI],91:gI,92:[WR,Ub],93:am,95:gh,96:TR},$I={null:[gh,II]},VI={null:[42,95]},UI={null:[]},WI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:VI,contentInitial:DI,disable:UI,document:LI,flow:OI,flowInitial:FI,insideSpan:$I,string:zI,text:BI},Symbol.toStringTag,{value:"Module"}));function HI(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(S),check:j(k),consume:x,enter:v,exit:b,interrupt:j(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,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=Qt(o,N),w(),o[o.length-1]!==null?[]:(E(t,0),c.events=om(i,c.events,c),c.events)}function h(N,A){return KI(p(N),A)}function p(N){return GI(o,N)}function m(){const{_bufferIndex:N,_index:A,line:O,column:z,offset:P}=r;return{_bufferIndex:N,_index:A,line:O,column:z,offset:P}}function y(N){s[N.line]=N.column,T()}function w(){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;)g(A.charCodeAt(r._bufferIndex));else g(A)}}function g(N){u=u(N)}function x(N){J(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,T()):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 v(N,A){const O=A||{};return O.type=N,O.start=m(),c.events.push(["enter",O,c]),a.push(O),O}function b(N){const A=a.pop();return A.end=m(),c.events.push(["exit",A,c]),A}function S(N,A){E(N,A.from)}function k(N,A){A.restore()}function j(N,A){return O;function O(z,P,L){let B,M,$,C;return Array.isArray(z)?Q(z):"tokenize"in z?Q([z]):V(z);function V(ue){return jt;function jt(He){const Vt=He!==null&&ue[He],vn=He!==null&&ue.null,On=[...Array.isArray(Vt)?Vt:Vt?[Vt]:[],...Array.isArray(vn)?vn:vn?[vn]:[]];return Q(On)(He)}}function Q(ue){return B=ue,M=0,ue.length===0?L:I(ue[M])}function I(ue){return jt;function jt(He){return C=R(),$=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(A?Object.assign(Object.create(c),A):c,l,le,fe)(He)}}function le(ue){return N($,C),P}function fe(ue){return C.restore(),++M<B.length?I(B[M]):L}}}function E(N,A){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&Ln(c.events,A,c.events.length-A,N.resolve(c.events.slice(A),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function R(){const N=m(),A=c.previous,O=c.currentConstruct,z=c.events.length,P=Array.from(a);return{from:z,restore:L};function L(){r=N,c.previous=A,c.currentConstruct=O,c.events.length=z,a=P,T()}}function T(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function GI(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 KI(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
59
- `;break}case-3:{o=`\r
60
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function QI(e){const r={constructs:tR([WI,...(e||{}).extensions||[]]),content:s(cR),defined:[],document:s(dR),flow:s(TI),lazy:{},string:s(NI),text:s(AI)};return r;function s(i){return o;function o(a){return HI(r,i,a)}}}function qI(e){for(;!Hb(e););return e}const ox=/[\0\t\n\r]/g;function YI(){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(ox.lastIndex=d,c=ox.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 XI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JI(e){return e.replace(XI,ZI)}function ZI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return $b(n.slice(i?2:1),i?16:10)}return im(n)||e}const Xb={}.hasOwnProperty;function eN(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),tN(n)(qI(QI(n).document().write(YI()(e,t,!0))))}function tN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Fs),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(Na),blockQuote:i(vn),characterEscape:R,characterReference:R,codeFenced:i(On),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(On,o),codeText:i(Ds,o),codeTextData:R,data:R,codeFlowValue:R,definition:i(Ra),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ia),hardBreakEscape:i(Gi),hardBreakTrailing:i(Gi),htmlFlow:i(Ki,o),htmlFlowData:R,htmlText:i(Ki,o),htmlTextData:R,image:i(ar),label:o,link:i(Fs),listItem:i(Lu),listItemValue:h,listOrdered:i(wn,d),listUnordered:i(wn),paragraph:i(Aa),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Na),strong:i(Du),thematicBreak:i(de)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:Vt,autolinkProtocol:He,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,characterReference:jt,codeFenced:l(w),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(g),codeText:l(P),codeTextData:T,data:T,definition:l(),definitionDestinationString:b,definitionLabelString:x,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(O),htmlFlowData:T,htmlText:l(z),htmlTextData:T,image:l(B),label:$,labelText:M,lineEnding:N,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:C,resourceTitleString:V,resource:Q,setextHeading:l(E),setextHeadingLineSequence:j,setextHeadingText:k,strong:l(),thematicBreak:l()}};Jb(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let H={type:"root",children:[]};const Z={stack:[H],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},se=[];let he=-1;for(;++he<D.length;)if(D[he][1].type==="listOrdered"||D[he][1].type==="listUnordered")if(D[he][0]==="enter")se.push(he);else{const rn=se.pop();he=s(D,rn,he)}for(he=-1;++he<D.length;){const rn=t[D[he][0]];Xb.call(rn,D[he][1].type)&&rn[D[he][1].type].call(Object.assign({sliceSerialize:D[he][2].sliceSerialize},Z),D[he][1])}if(Z.tokenStack.length>0){const rn=Z.tokenStack[Z.tokenStack.length-1];(rn[1]||ax).call(Z,void 0,rn[0])}for(H.position={start:cr(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:cr(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)H=t.transforms[he](H)||H;return H}function s(D,H,Z){let se=H-1,he=-1,rn=!1,ts,zn,Qi,qi;for(;++se<=Z;){const Et=D[se];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?he++:he--,qi=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(ts&&!qi&&!he&&!Qi&&(Qi=se),qi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qi=void 0}if(!he&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||he===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(ts){let Os=se;for(zn=void 0;Os--;){const Bn=D[Os];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;zn&&(D[zn][1].type="lineEndingBlank",rn=!0),Bn[1].type="lineEnding",zn=Os}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent"))break}Qi&&(!zn||Qi<zn)&&(ts._spread=!0),ts.end=Object.assign({},zn?D[zn][1].start:Et[1].end),D.splice(zn||se,0,["exit",ts,Et[2]]),se++,Z++}if(Et[1].type==="listItemPrefix"){const Os={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};ts=Os,D.splice(se,0,["enter",Os,Et[2]]),se++,Z++,Qi=void 0,qi=!0}}}return D[H][1]._spread=rn,Z}function i(D,H){return Z;function Z(se){a.call(this,D(se),se),H&&H.call(this,se)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(D,H,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([H,Z||void 0]),D.position={start:cr(H.start),end:void 0}}function l(D){return H;function H(Z){D&&D.call(this,Z),c.call(this,Z)}}function c(D,H){const Z=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(H?H.call(this,D,se[0]):(se[1]||ax).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+Ao({start:D.start,end:D.end})+"): it’s not open");Z.position.end=cr(D.end)}function u(){return Z2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function p(){const D=this.resume(),H=this.stack[this.stack.length-1];H.lang=D}function m(){const D=this.resume(),H=this.stack[this.stack.length-1];H.meta=D}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=xi(this.sliceSerialize(D)).toLowerCase()}function v(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function b(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function S(D){const H=this.stack[this.stack.length-1];if(!H.depth){const Z=this.sliceSerialize(D).length;H.depth=Z}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(D){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function R(D){const Z=this.stack[this.stack.length-1].children;let se=Z[Z.length-1];(!se||se.type!=="text")&&(se=Ma(),se.position={start:cr(D.start),end:void 0},Z.push(se)),this.stack.push(se)}function T(D){const H=this.stack.pop();H.value+=this.sliceSerialize(D),H.position.end=cr(D.end)}function N(D){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=H.children[H.children.length-1];Z.position.end=cr(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(R.call(this,D),T.call(this,D))}function A(){this.data.atHardBreak=!0}function O(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function z(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function P(){const D=this.resume(),H=this.stack[this.stack.length-1];H.value=D}function L(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function B(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=H,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function M(D){const H=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=JI(H),Z.identifier=xi(H).toLowerCase()}function $(){const D=this.stack[this.stack.length-1],H=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const se=D.children;Z.children=se}else Z.alt=H}function C(){const D=this.resume(),H=this.stack[this.stack.length-1];H.url=D}function V(){const D=this.resume(),H=this.stack[this.stack.length-1];H.title=D}function Q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function le(D){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.label=H,Z.identifier=xi(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function fe(D){this.data.characterReferenceType=D.type}function ue(D){const H=this.sliceSerialize(D),Z=this.data.characterReferenceType;let se;Z?(se=$b(H,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=im(H);const he=this.stack[this.stack.length-1];he.value+=se}function jt(D){const H=this.stack.pop();H.position.end=cr(D.end)}function He(D){T.call(this,D);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(D)}function Vt(D){T.call(this,D);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(D)}function vn(){return{type:"blockquote",children:[]}}function On(){return{type:"code",lang:null,meta:null,value:""}}function Ds(){return{type:"inlineCode",value:""}}function Ra(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ia(){return{type:"emphasis",children:[]}}function Na(){return{type:"heading",depth:0,children:[]}}function Gi(){return{type:"break"}}function Ki(){return{type:"html",value:""}}function ar(){return{type:"image",title:null,url:"",alt:null}}function Fs(){return{type:"link",title:null,url:"",children:[]}}function wn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Lu(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function Aa(){return{type:"paragraph",children:[]}}function Du(){return{type:"strong",children:[]}}function Ma(){return{type:"text",value:""}}function de(){return{type:"thematicBreak"}}}function cr(e){return{line:e.line,column:e.column,offset:e.offset}}function Jb(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Jb(e,r):nN(e,r)}}function nN(e,t){let n;for(n in t)if(Xb.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 ax(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ao({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ao({start:t.start,end:t.end})+") is still open")}function rN(e){const t=this;t.parser=n;function n(r){return eN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function sN(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 iN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
61
- `}]}function oN(e,t){const n=t.value?t.value+`
62
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function aN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cN(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=zi(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function uN(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 dN(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Zb(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 fN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zb(e,t);const s={src:zi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function hN(e,t){const n={src:zi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function pN(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 mN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zb(e,t);const s={href:zi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function gN(e,t){const n={href:zi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yN(e,t,n){const r=e.all(t),s=n?xN(n):ek(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:`
63
- `}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
64
- `});const c={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,c),e.applyData(t,c)}function xN(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=ek(n[r])}return t}function ek(e){const t=e.spread;return t??e.children.length>1}function vN(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 wN(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bN(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function kN(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _N(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=tm(t.children[1]),l=Mb(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 SN(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 CN(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lx=9,cx=32;function PN(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(ux(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(ux(t.slice(s),s>0,!1)),i.join("")}function ux(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===lx||i===cx;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===lx||i===cx;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function jN(e,t){const n={type:"text",value:PN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function EN(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TN={blockquote:sN,break:iN,code:oN,delete:aN,emphasis:lN,footnoteReference:cN,heading:uN,html:dN,imageReference:fN,image:hN,inlineCode:pN,linkReference:mN,link:gN,listItem:yN,list:vN,paragraph:wN,root:bN,strong:kN,table:_N,tableCell:CN,tableRow:SN,text:jN,thematicBreak:EN,toml:nl,yaml:nl,definition:nl,footnoteDefinition:nl};function nl(){}const tk=-1,yu=0,Lo=1,Tc=2,lm=3,cm=4,um=5,dm=6,nk=7,rk=8,RN=typeof self=="object"?self:globalThis,dx=(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 RN[e](t)},IN=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case yu:case tk:return n(o,s);case Lo:{const a=n([],s);for(const l of o)a.push(r(l));return a}case Tc:{const a=n({},s);for(const[l,c]of o)a[r(l)]=r(c);return a}case lm:return n(new Date(o),s);case cm:{const{source:a,flags:l}=o;return n(new RegExp(a,l),s)}case um:{const a=n(new Map,s);for(const[l,c]of o)a.set(r(l),r(c));return a}case dm:{const a=n(new Set,s);for(const l of o)a.add(r(l));return a}case nk:{const{name:a,message:l}=o;return n(dx(a,l),s)}case rk: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(dx(i,o),s)};return r},fx=e=>IN(new Map,e)(0),$s="",{toString:NN}={},{keys:AN}=Object,co=e=>{const t=typeof e;if(t!=="object"||!e)return[yu,t];const n=NN.call(e).slice(8,-1);switch(n){case"Array":return[Lo,$s];case"Object":return[Tc,$s];case"Date":return[lm,$s];case"RegExp":return[cm,$s];case"Map":return[um,$s];case"Set":return[dm,$s];case"DataView":return[Lo,n]}return n.includes("Array")?[Lo,n]:n.includes("Error")?[nk,n]:[Tc,n]},rl=([e,t])=>e===yu&&(t==="function"||t==="symbol"),MN=(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]=co(o);switch(a){case yu:{let u=o;switch(l){case"bigint":a=rk,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return s([tk],o)}return s([a,u],o)}case Lo:{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 Tc:{if(l)switch(l){case"BigInt":return s([l,o.toString()],o);case"Boolean":case"Number":case"String":return s([l,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],d=s([a,u],o);for(const h of AN(o))(e||!rl(co(o[h])))&&u.push([i(h),i(o[h])]);return d}case lm:return s([a,o.toISOString()],o);case cm:{const{source:u,flags:d}=o;return s([a,{source:u,flags:d}],o)}case um:{const u=[],d=s([a,u],o);for(const[h,p]of o)(e||!(rl(co(h))||rl(co(p))))&&u.push([i(h),i(p)]);return d}case dm:{const u=[],d=s([a,u],o);for(const h of o)(e||!rl(co(h)))&&u.push(i(h));return d}}const{message:c}=o;return s([a,{name:l,message:c}],o)};return i},hx=(e,{json:t,lossy:n}={})=>{const r=[];return MN(!(t||n),!!t,new Map,r)(e),r},Rc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fx(hx(e,t)):structuredClone(e):(e,t)=>fx(hx(e,t));function LN(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 DN(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FN(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||LN,r=e.options.footnoteBackLabel||DN,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=zi(d.toLowerCase());let p=0;const m=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){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 w=u[u.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const x=w.children[w.children.length-1];x&&x.type==="text"?x.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else u.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Rc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
65
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
66
- `}]}}const sk=function(e){if(e==null)return $N;if(typeof e=="function")return xu(e);if(typeof e=="object")return Array.isArray(e)?ON(e):zN(e);if(typeof e=="string")return BN(e);throw new Error("Expected function, string, or object as test")};function ON(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=sk(e[n]);return xu(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function zN(e){const t=e;return xu(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function BN(e){return xu(t);function t(n){return n&&n.type===e}}function xu(e){return t;function t(n,r,s){return!!(VN(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function $N(){return!0}function VN(e){return e!==null&&typeof e=="object"&&"type"in e}const ik=[],UN=!0,px=!1,WN="skip";function HN(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=sk(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=ik,m,y,w;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=GN(n(l,u)),p[0]===px))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==WN)for(y=(r?g.children.length:-1)+o,w=u.concat(g);y>-1&&y<g.children.length;){const x=g.children[y];if(m=a(x,y,w)(),m[0]===px)return m;y=typeof m[1]=="number"?m[1]:y+o}}return p}}}function GN(e){return Array.isArray(e)?e:typeof e=="number"?[UN,e]:e==null?ik:[e]}function ok(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),HN(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 yh={}.hasOwnProperty,KN={};function QN(e,t){const n=t||KN,r=new Map,s=new Map,i=new Map,o={...TN,...n.handlers},a={all:c,applyData:YN,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:l,options:n,patch:qN,wrap:JN};return ok(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(yh.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:y,...w}=u,g=Rc(w);return g.children=a.all(u),g}return Rc(u)}return(a.options.unknownHandler||XN)(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=mx(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=mx(y.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function qN(e,t){e.position&&(t.position=I2(e))}function YN(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,Rc(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function XN(e,t){const n=t.data||{},r="value"in t&&!(yh.call(n,"hProperties")||yh.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 JN(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
67
- `});++r<e.length;)r&&n.push({type:"text",value:`
68
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
69
- `}),n}function mx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gx(e,t){const n=QN(e,t),r=n.one(e,void 0),s=FN(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
70
- `},s),i}function ZN(e,t){return e&&"run"in e?async function(n,r){const s=gx(n,{file:r,...t});await e.run(s,r)}:function(n,r){return gx(n,{file:r,...e||t})}}function yx(e){if(e)throw e}var $l=Object.prototype.hasOwnProperty,ak=Object.prototype.toString,xx=Object.defineProperty,vx=Object.getOwnPropertyDescriptor,wx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ak.call(t)==="[object Array]"},bx=function(t){if(!t||ak.call(t)!=="[object Object]")return!1;var n=$l.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&$l.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||$l.call(t,s)},kx=function(t,n){xx&&n.name==="__proto__"?xx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},_x=function(t,n){if(n==="__proto__")if($l.call(t,n)){if(vx)return vx(t,n).value}else return;return t[n]},eA=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=_x(a,n),s=_x(t,n),a!==s&&(u&&s&&(bx(s)||(i=wx(s)))?(i?(i=!1,o=r&&wx(r)?r:[]):o=r&&bx(r)?r:{},kx(a,{name:n,newValue:e(u,o,s)})):typeof s<"u"&&kx(a,{name:n,newValue:s}));return a};const kd=Qc(eA);function xh(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 tA(){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?nA(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 nA(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return s(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Pn={basename:rA,dirname:sA,extname:iA,join:oA,sep:"/"};function rA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');va(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 sA(e){if(va(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 iA(e){va(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 oA(...e){let t=-1,n;for(;++t<e.length;)va(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aA(n)}function aA(e){va(e);const t=e.codePointAt(0)===47;let n=lA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lA(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 va(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cA={cwd:uA};function uA(){return"/"}function vh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dA(e){if(typeof e=="string")e=new URL(e);else if(!vh(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 fA(e)}function fA(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 _d=["history","path","basename","stem","extname","dirname"];class lk{constructor(t){let n;t?vh(t)?n={path:t}:typeof t=="string"||hA(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<_d.length;){const i=_d[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)_d.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Pn.basename(this.path):void 0}set basename(t){Cd(t,"basename"),Sd(t,"basename"),this.path=Pn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pn.dirname(this.path):void 0}set dirname(t){Sx(this.basename,"dirname"),this.path=Pn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pn.extname(this.path):void 0}set extname(t){if(Sd(t,"extname"),Sx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){vh(t)&&(t=dA(t)),Cd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pn.basename(this.path,this.extname):void 0}set stem(t){Cd(t,"stem"),Sd(t,"stem"),this.path=Pn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new ot(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 Sd(e,t){if(e&&e.includes(Pn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pn.sep+"`")}function Cd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Sx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pA=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},mA={}.hasOwnProperty;class fm extends pA{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=tA()}copy(){const t=new fm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(kd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ed("data",this.frozen),this.namespace[t]=n,this):mA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ed("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=sl(t),r=this.parser||this.Parser;return Pd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Pd("process",this.parser||this.Parser),jd("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=sl(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);xA(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(),Pd("processSync",this.parser||this.Parser),jd("processSync",this.compiler||this.Compiler),this.process(t,s),Px("processSync","process",n),r;function s(i,o){n=!0,yx(i),r=o}}run(t,n,r){Cx(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=sl(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),Px("runSync","run",r),s;function i(o,a){yx(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=sl(n),s=this.compiler||this.Compiler;return jd("stringify",s),Cx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Ed("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=kd(!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 y=r[h][1];xh(y)&&xh(p)&&(p=kd(!0,y,p)),r[h]=[c,p,...m]}}}}const gA=new fm().freeze();function Pd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function jd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ed(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 Cx(e){if(!xh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Px(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sl(e){return yA(e)?e:new lk(e)}function yA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xA(e){return typeof e=="string"||vA(e)}function vA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",jx=[],Ex={allowDangerousHtml:!0},bA=/^(https?|ircs?|mailto|xmpp)$/i,kA=[{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 _A(e){const t=SA(e),n=CA(e);return PA(t.runSync(t.parse(n),n),e)}function SA(e){const t=e.rehypePlugins||jx,n=e.remarkPlugins||jx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ex}:Ex;return gA().use(rN).use(n).use(ZN,r).use(t)}function CA(e){const t=e.children||"",n=new lk;return typeof t=="string"&&(n.value=t),n}function PA(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||jA;for(const u of kA)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+wA+u.id,void 0);return ok(e,c),D2(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 vd)if(Object.hasOwn(vd,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],y=vd[p];(y===null||y.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 jA(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||bA.test(e.slice(0,t))?e:""}const Td=e=>`font-display-luminari font-semibold ${e} mt-6 mb-3 leading-tight`,EA={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:Td("text-lg"),children:e}),h2:({children:e})=>f.jsx("h2",{className:Td("text-[1.3rem]"),children:e}),h3:({children:e})=>f.jsx("h3",{className:Td("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})},ck=({children:e})=>f.jsx(_A,{components:EA,children:e}),TA={},Tx=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:()=>{(TA?"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},RA=e=>e?Tx(e):Tx,uk={},{useDebugValue:IA}=wi,{useSyncExternalStoreWithSelector:NA}=lT;let Rx=!1;const AA=e=>e;function MA(e,t=AA,n){(uk?"production":void 0)!=="production"&&n&&!Rx&&(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"),Rx=!0);const r=NA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return IA(r),r}const LA=e=>{(uk?"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"?RA(e):e,n=(r,s)=>MA(t,r,s);return Object.assign(n,t),n},DA=e=>LA;let dk="";function FA(e){dk=e}function Ze(e){return`${dk}${e}`}const fk=async()=>{const e=await fetch(Ze("/api/capabilities"));return e.ok?(await e.json()).capabilities:null},OA=async()=>{const e=await fetch(Ze("/api/agent/auth-status"));return e.ok?await e.json():null},v9=async()=>{try{const e=await fetch(Ze("/api/connections"));return e.ok?(await e.json()).connections:null}catch{return null}},w9=async e=>{try{const t=await fetch(`/api/connections/connect?id=${encodeURIComponent(e)}`,{method:"POST"});return t.ok?(await t.json()).connection:null}catch{return null}},hk=async()=>{try{const e=await fetch(Ze("/api/config"));return e.ok?e.json():null}catch{return null}},b9=async e=>{try{const t=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return{ok:!0};const n=await t.json().catch(()=>null);return{ok:!1,error:n==null?void 0:n.error}}catch(t){return{ok:!1,error:t.message}}},zA=async()=>{try{const e=await fetch("/api/icon");if(!e.ok)return null;const t=await e.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.readAsDataURL(t)})}catch{return null}},k9=async e=>{try{return(await fetch("/api/icon",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUri:e})})).ok}catch{return!1}},BA=async()=>{try{const e=await fetch("/api/package-name");return e.ok?e.json():null}catch{return null}},Fn=async(e,t="Launch failed")=>{if(!e.ok){const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}},$A=async()=>(await fetch(Ze("/api/agent/status"))).json(),VA=async()=>(await fetch("/api/agent/reconcile-queue")).json(),UA=async(e,t)=>{const n=await fetch(Ze("/api/agent/launch"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,phaseIndex:t})});await Fn(n)},WA=async(e,t)=>{const n=await fetch("/api/agent/launch-audit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Fn(n)},HA=async(e,t)=>{const n=await fetch("/api/agent/launch-reconcile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e,prompt:t})});await Fn(n)},GA=async(e,t)=>{const n=await fetch("/api/agent/launch-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Fn(n)},KA=async(e,t)=>{const n=await fetch("/api/agent/launch-extend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ideaId:e,prompt:t})});await Fn(n)},QA=async e=>{const t=await fetch("/api/agent/launch-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})});await Fn(t)},qA=async()=>{const e=await fetch("/api/agent/launch-reconcile-all",{method:"POST"});await Fn(e)},YA=async e=>{const t=await fetch("/api/agent/launch-run-all",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Fn(t)},XA=async e=>{const t=await fetch("/api/agent/launch-fix-review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})});await Fn(t)},JA=async(e,t,n)=>{const r=await fetch("/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},Ix=async(e,t,n,r)=>{const s=await fetch("/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})`)}},ZA=async e=>{const t=await fetch("/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},eM=async(e,t)=>{const n=await fetch("/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},tM=async e=>{const t=await fetch(Ze("/api/agent/stop"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});await Fn(t,"Stop failed")},nM=async()=>(await fetch("/api/agent/login-relay/start",{method:"POST"})).json(),rM=async()=>(await fetch("/api/agent/login-relay/status")).json(),sM=async()=>{await fetch("/api/agent/login-relay/cancel",{method:"POST"})};function gn(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 ur(e,t){return async(...n)=>{await t(...n),await e().loadAgentStatus()}}let iM=0;const Nx=()=>`preview-${++iM}`;function oM(e,t){return{agentAuthStatus:null,loadAgentAuthStatus:gn(e,OA,n=>({agentAuthStatus:n}),()=>({agentAuthStatus:null})),agentStatus:[],loadAgentStatus:async()=>{try{const n=await $A();e({agentStatus:n});const r=t().pendingReconcile,s=r?n.find(o=>o.taskKind==="reconcile"&&o.planId===r.planId):void 0;r&&s&&(s.status==="done"?(await t().loadPlans(),e(o=>({reconcileQueue:[...o.reconcileQueue,{...r,previewId:Nx()}],pendingReconcile:null}))):s.status==="error"&&e({pendingReconcile:null}));const i=n.find(o=>o.taskKind==="batch-reconcile");if((i==null?void 0:i.status)==="done"&&!t().batchReconcileConsumed){const o=await VA();o&&o.length>0&&(await t().loadPlans(),e(a=>({reconcileQueue:[...a.reconcileQueue,...o.map(l=>({planId:l.planId,before:l.before,previewId:Nx()}))]}))),e({batchReconcileConsumed:!0})}}catch{}},launchAgent:ur(t,UA),launchPlanAudit:ur(t,WA),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 HA(n,r)}catch(o){throw e({pendingReconcile:null}),o}await t().loadAgentStatus()},launchPlanDraft:ur(t,GA),launchIdeaExtend:ur(t,KA),launchBatchReconcile:ur(t,async()=>{e({batchReconcileConsumed:!1}),await qA()}),launchSuggestIdeas:ur(t,QA),launchRunAll:ur(t,YA),launchFixReview:ur(t,XA),stopAgent:async n=>{try{await tM(n)}finally{await t().loadAgentStatus()}},loginRelay:null,startLoginRelay:async()=>{try{const n=await nM();e({loginRelay:n})}catch(n){e({loginRelay:{phase:"error",authorizeUrl:null,error:n.message}})}},loadLoginRelayStatus:gn(e,rM,n=>({loginRelay:n})),cancelLoginRelay:async()=>{try{await sM()}finally{e({loginRelay:null})}},pendingReconcile:null,reconcileQueue:[],removeFromReconcileQueue:n=>e(r=>({reconcileQueue:r.reconcileQueue.filter(s=>s.previewId!==n)})),batchReconcileConsumed:!1}}const aM=async()=>(await fetch("/api/tasks")).json(),_9=async e=>{const t=await fetch(`/api/tasks/output?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to fetch task log: ${t.status}`);return t.json()},lM=async()=>(await fetch("/api/suggestions")).json(),cM=async e=>{const t=await fetch("/api/suggestions/promote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to promote suggestion"}));throw new Error(n.error)}return t.json()},uM=async e=>{const t=await fetch("/api/suggestions/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suggestion:e})});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to dismiss suggestion"}));throw new Error(n.error)}},dM=async()=>(await fetch("/api/docs")).json(),fM=async()=>{const e=await fetch("/api/roadmap");if(!e.ok)throw new Error(`Failed to fetch roadmap: ${e.status}`);return e.json()},hM=async(e,t,n,r)=>{const s=await fetch("/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()},S9=async(e,t,n)=>{const r=await fetch("/api/roadmap/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,name:t,description:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap item"}));throw new Error(s.error)}},C9=async(e,t,n)=>{const r=await fetch("/api/roadmap/candidates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({horizonTitle:e,itemName:t,name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to add roadmap candidate"}));throw new Error(s.error)}},pM=async()=>(await fetch("/api/consistency")).json(),pk=async()=>(await fetch("/api/ideas")).json(),mM=async()=>(await fetch("/api/archivable-ideas")).json(),gM=async e=>{const t=await fetch("/api/ideas/archive",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to archive ideas");return n},mk=async e=>{const t=await fetch(Ze("/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},gk=async(e,t)=>{const n=await fetch("/api/ideas/check-overlap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,candidates:t})}),r=await n.json();if(!n.ok)throw new Error(r.error??"Failed to check overlap");return r},yM=async()=>{const e=await fetch("/api/ideas/prioritise",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(t.error??"Failed to prioritise queue");return t},xM=async()=>{const e=await fetch("/api/parked-questions");if(!e.ok)throw new Error(`Failed to fetch parked questions: ${e.status}`);return e.json()},yk=async()=>(await fetch(Ze("/api/plans"))).json(),vM=async e=>{await fetch("/api/plans",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wM=async(e,t)=>{const n=await fetch(`/api/plans?title=${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.error)??`Failed to update plan (${n.status})`)}},bM=async()=>{const e=await fetch("/api/releases");if(!e.ok)throw new Error("Failed to load releases");const{versions:t}=await e.json();return t},P9=async e=>{const t=await fetch(`/api/release-notes?version=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load release notes");return t.json()};function kM(e,t){return{repoDocs:[],repoDocsLoading:!0,loadRepoDocs:async()=>{e({repoDocsLoading:!0});try{const n=await dM();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 bM();e({releaseVersions:n,releaseVersionsLoading:!1})}catch{e({releaseVersions:[],releaseVersionsLoading:!1})}},activeReleaseVersion:null,setActiveReleaseVersion:n=>e({activeReleaseVersion:n})}}function _M(e,t){return{ideaEntries:[],loadIdeas:gn(e,pk,n=>({ideaEntries:n.entries}),()=>({ideaEntries:[]})),archivableIdeas:[],loadArchivableIdeas:gn(e,mM,n=>({archivableIdeas:n}),()=>({archivableIdeas:[]})),archiveIdeas:async n=>{await gM(n),await Promise.all([t().loadArchivableIdeas(),t().loadPlans(),t().loadIdeas()])}}}function SM(e){return{parkedQuestions:null,parkedQuestionsLoading:!1,parkedQuestionsError:null,loadParkedQuestions:gn(e,xM,t=>({parkedQuestions:t,parkedQuestionsError:null}),t=>({parkedQuestionsError:String(t)}),"parkedQuestionsLoading")}}const Ic=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`},xk=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)}},vk=e=>xk(e.phases),Ax=e=>{var t;return((t=vk(e))==null?void 0:t.pct)??null},CM=e=>xk([...e.phases,...e.fixes??[]]),hm=(e,t)=>e?t.find(n=>n.planId===e&&n.status!=="done"&&n.status!=="error"):void 0,pm=(e,t)=>e.status==="done"||e.status==="dropped"?e.status:hm(e.id,t)?"in-progress":e.status,PM=e=>!e.pr&&e.status!=="done"&&e.status!=="dropped"&&e.status!=="review"&&e.phases.length>0&&e.phases.every(t=>t.done)&&(e.fixes??[]).every(t=>t.done),jM=(e,t)=>{if(e)return e.find(n=>n.status==="in-progress"||n.status==="review")};function Rd(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 EM(a)}function EM(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 TM=["idea","planned","in-progress","review","done","dropped"],RM=["feat","fix","chore","docs","refactor"],j9=["claude-code","opencode"],IM={"claude-code":"Claude Code",opencode:"OpenCode"},E9={"claude-code":{model:["opus","sonnet","fable","haiku"],effort:["low","medium","high","xhigh","max"]},opencode:{model:null}},T9={phase:{agent:"opencode"},planDraft:{agent:"claude-code"},ideaExtend:{agent:"claude-code"},commitSuggest:{agent:"claude-code"},feedback:{agent:"claude-code",model:"sonnet",effort:"medium"}},NM=["in-progress","review","planned","idea"],AM=["open"],mm={statuses:NM,tags:[],search:"",sortKey:"order",sortDirection:"asc",noteStatuses:AM,subject:null},Mx={"in-progress":0,review:1,planned:2,idea:3,done:4,dropped:5},il=e=>{const t=new Date(e.updated??e.created).getTime();return Number.isNaN(t)?0:t},Lx=e=>{const t=new Date(e.created).getTime();return Number.isNaN(t)?0:t},Dx=e=>{var n;const t=(n=e.id)==null?void 0:n.match(/(\d+)\s*$/);return t?Number(t[1]):Number.POSITIVE_INFINITY},Id=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},Fx=(e,t)=>t.size===0?!0:e.tags.some(n=>t.has(n)),Do=(e,t)=>t===null||e===t,gm=(e,t,n,r="asc")=>{if(n==="order")return e.order!==void 0&&t.order!==void 0?(r==="desc"?-1:1)*(e.order-t.order):e.order!==void 0?-1:t.order!==void 0?1:Lx(e)-Lx(t);const s=(()=>{switch(n){case"status":{const i=Mx[e.status]-Mx[t.status];return i!==0?i:il(t)-il(e)}case"updated":return il(t)-il(e);case"title":return e.title.localeCompare(t.title);case"id":return Dx(e)-Dx(t);case"progress":return(Ax(t)??-1)-(Ax(e)??-1);default:return 0}})();return r==="desc"?-s:s},wh=(e,t)=>{const n={};for(const r of e)for(const s of t(r))n[String(s)]=(n[String(s)]??0)+1;return n},Vl=(e,t=mm)=>{const n=new Set(t.tags),r=new Set(t.statuses),s=wh(e.filter(a=>Fx(a,n)&&Id(a,t.search)&&Do(a.subject,t.subject)),a=>[a.status]);for(const a of TM)s[a]??(s[a]=0);const i=wh(e.filter(a=>r.has(a.status)&&Id(a,t.search)&&Do(a.subject,t.subject)),a=>a.tags);return{rows:e.filter(a=>r.has(a.status)&&Fx(a,n)&&Id(a,t.search)&&Do(a.subject,t.subject)).sort((a,l)=>gm(a,l,t.sortKey,t.sortDirection)),statusCounts:s,tagCounts:i}},MM=["open","done","dropped"],LM={open:"idea",done:"done",dropped:"dropped"},Nd=(e,t)=>{const n=t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n):!0},DM=e=>e.type==="plan"?e.plan.subject:e.idea.subject,FM=e=>e.type==="plan"?e.plan.order:e.idea.order,OM=e=>{const t=e.type==="plan"?e.plan.updated??e.plan.created:e.idea.created,n=new Date(t??"").getTime();return Number.isNaN(n)?0:n},Ox=(e,t)=>e.reduce((n,r)=>{const s=FM(r);return s===void 0?n:n===void 0?s:t==="desc"?Math.max(n,s):Math.min(n,s)},void 0),zx=e=>e.reduce((t,n)=>Math.max(t,OM(n)),0),zM=(e,t="asc",n)=>{var a;const r=new Map,s=[];for(const l of e){const c=DM(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=Ox(l.rows,t),d=Ox(c.rows,t);return u!==void 0&&d!==void 0?i*(u-d):u!==void 0?-1:d!==void 0?1:zx(c.rows)-zx(l.rows)});return s.length>0&&o.push({subject:null,rows:s}),o},Bx=e=>e.type==="plan"?e.plan:e.type==="note"?{title:e.idea.title,id:e.idea.id??void 0,status:LM[e.idea.status??"open"],created:e.idea.created??"",tags:[],body:e.idea.body,phases:[],order:e.idea.order}:{...(e.children.length>0?[...e.children].sort((n,r)=>gm(n,r,"status"))[0]:void 0)??{status:"idea",created:e.idea.created??"",tags:[],body:e.idea.body,phases:[]},title:e.idea.title,id:e.idea.id??void 0,order:e.idea.order},BM=(e,t,n=mm)=>{const{statusCounts:r,tagCounts:s}=Vl(e,n),i=t.filter(p=>p.kind==="note"),o=t.filter(p=>p.kind!=="note"),a=new Set(o.map(p=>p.id).filter(p=>!!p)),l=new Map,c=[];for(const p of e)if(p.idea&&a.has(p.idea)){const m=l.get(p.idea)??[];m.push(p),l.set(p.idea,m)}else c.push(p);const u=new Set(n.noteStatuses),d=wh(i.filter(p=>Nd(p,n.search)),p=>[p.status??"open"]);for(const p of MM)d[p]??(d[p]=0);const h=Vl(c,n).rows.map(p=>({type:"plan",plan:p}));for(const p of o){const m=p.id?l.get(p.id)??[]:[],y=Vl(m,n).rows;!Do(p.subject,n.subject)&&y.length===0||y.length===0&&(m.length>0||!Nd(p,n.search))||h.push({type:"idea-group",idea:p,children:y})}for(const p of i)u.has(p.status??"open")&&Nd(p,n.search)&&Do(p.subject,n.subject)&&h.push({type:"note",idea:p});return h.sort((p,m)=>gm(Bx(p),Bx(m),n.sortKey,n.sortDirection)),{rows:h,statusCounts:r,tagCounts:s,noteStatusCounts:d}},$M=.2,VM=5,wk=3,bk=2,kk=1,UM=wk+bk+kk,WM=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"]),ol=e=>{const t=e.toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>=2&&!WM.has(n));return new Set(t)},Ad=(e,t)=>{let n=0;for(const r of e)t.has(r)&&(n+=1);return n};function HM(e,t,n={}){const{threshold:r=$M,limit:s=VM}=n,i=ol(e);if(i.size===0)return[];const o=[];for(const a of t){const l=ol(a.title),c=ol(a.body),u=ol((a.tags??[]).join(" ")),h=(Ad(i,l)*wk+Ad(i,u)*bk+Ad(i,c)*kk)/(i.size*UM);h>=r&&o.push({candidate:a,score:h})}return o.sort((a,l)=>l.score-a.score),o.slice(0,s)}const GM=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}`},KM=(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=[GM(e),e.failure_scenario??e.reasoning].filter(Boolean).join(" — ");return{done:!1,text:n.trim(),description:r||void 0,source:"review"}},QM=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)=>KM(r,s))};function qM(e,t){return{plans:null,plansLoading:!1,plansError:null,loadPlans:gn(e,yk,n=>({plans:n,plansError:null}),n=>({plansError:String(n)}),"plansLoading"),planFilters:mm,togglePlanStatus:n=>e(r=>({planFilters:{...r.planFilters,statuses:r.planFilters.statuses.includes(n)?r.planFilters.statuses.filter(s=>s!==n):[...r.planFilters.statuses,n]}})),togglePlanTag:n=>e(r=>({planFilters:{...r.planFilters,tags:r.planFilters.tags.includes(n)?r.planFilters.tags.filter(s=>s!==n):[...r.planFilters.tags,n]}})),toggleNoteStatus:n=>e(r=>({planFilters:{...r.planFilters,noteStatuses:r.planFilters.noteStatuses.includes(n)?r.planFilters.noteStatuses.filter(s=>s!==n):[...r.planFilters.noteStatuses,n]}})),setPlanSearch:n=>e(r=>({planFilters:{...r.planFilters,search:n}})),setSubjectFilter:n=>e(r=>({planFilters:{...r.planFilters,subject:n}})),setPlanSortKey:n=>e(r=>({planFilters:{...r.planFilters,sortKey:n}})),togglePlanSortDirection:()=>e(n=>({planFilters:{...n.planFilters,sortDirection:n.planFilters.sortDirection==="asc"?"desc":"asc"}})),detailView:"details",setDetailView:n=>e({detailView:n})}}async function Xr(e,t){if(e.ok)return;const n=await e.json().catch(()=>({error:t}));throw new Error(n.error)}const YM=async()=>{const e=await fetch(Ze("/api/git/status"));return await Xr(e,"Failed to load git status"),e.json()},R9=async()=>{const e=await fetch(Ze("/api/git/diff"));return await Xr(e,"Failed to load diff"),(await e.json()).files},_k=async(e,t,n)=>{const r=await fetch(Ze("/api/git/commit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e,title:t,message:n})});await Xr(r,"Commit failed")},XM=async()=>{const e=await fetch(Ze("/api/git/push"),{method:"POST"});await Xr(e,"Push failed")},Sk=async e=>{const t=await fetch(Ze("/api/git/suggest-commit-message"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})});return await Xr(t,"Failed to suggest a commit message"),t.json()},JM=async()=>{const e=await fetch(Ze("/api/git/sync"),{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Sync failed"),{ok:!0}},ZM=async()=>{const e=await fetch(Ze("/api/git/pull"),{method:"POST"});await Xr(e,"Pull failed")},eL=async()=>{const e=await fetch("/api/git/fix-divergence",{method:"POST"});if(e.status===202){const t=await e.json();return t.conflictPrompt?{ok:!1,recovering:!1,conflictPrompt:t.conflictPrompt,message:t.error}:{ok:!1,recovering:t.recovering,message:t.error}}return await Xr(e,"Fix failed"),{ok:!0}},tL=async e=>{const t=await fetch("/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})`}}},nL=async e=>{const t=await fetch("/api/git/branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:e})}),n=await t.json();if(!t.ok)throw new Error(n.error??"Failed to create branch");return n.branch},rL=async()=>(await fetch(Ze("/api/status"))).json(),sL=async e=>{await fetch(`/api/status/check?name=${e}`,{method:"POST"})},iL=async()=>{await fetch("/api/status/fix",{method:"POST"})},oL=async()=>{const e=await fetch("/api/refresh",{method:"POST"});if(!e.ok)throw new Error(`Failed to drop caches: ${e.statusText}`)};function aL(e,t){return{status:null,refreshing:!1,loadStatus:gn(e,rL,n=>({status:n})),refreshAll:async()=>{e({refreshing:!0});try{await oL().catch(()=>{}),await Promise.all([t().loadPlans(),t().loadIdeas(),t().loadArchivableIdeas(),t().loadSuggestions(),t().loadStatus(),t().loadConsistency(),t().loadGitStatus(),t().loadAgentStatus(),t().loadAgentAuthStatus()]);const n=t().plansError;return n?{ok:!1,error:n}:{ok:!0}}finally{e({refreshing:!1})}},runCheck:async n=>{try{await sL(n)}catch{}},fixQuality:async()=>{try{await iL()}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 Sk(i);return await _k(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:gn(e,pM,n=>({consistency:n})),gitStatus:null,gitBranch:null,gitAhead:0,gitBehind:0,gitDiverged:!1,gitBranchHygiene:null,loadGitStatus:async()=>{try{const{branch:n,entries:r,ahead:s,behind:i,diverged:o,branchHygiene:a}=await YM();return e({gitStatus:r,gitBranch:n,gitAhead:s,gitBehind:i,gitDiverged:o,gitBranchHygiene:a}),!0}catch{return!1}},capabilities:[],loadCapabilities:gn(e,fk,n=>({capabilities:n??[]}),()=>({capabilities:[]}))}}function lL(e,t){return{suggestions:[],suggestionsLoading:!0,loadSuggestions:gn(e,lM,n=>({suggestions:n.entries}),()=>({suggestions:[]}),"suggestionsLoading"),promoteSuggestion:async n=>{const{id:r}=await cM(n);return await Promise.all([t().loadSuggestions(),t().loadPlans(),t().loadIdeas()]),r},dismissSuggestion:async n=>{await uM(n),await t().loadSuggestions()},promoteRoadmapItem:async(n,r,s,i)=>{const{id:o}=await hM(n,r,s,i);return await Promise.all([t().loadPlans(),t().loadIdeas()]),o},launchPrioritise:async()=>{const n=await yM();return await t().refreshAll(),n}}}function cL(e){return{taskLog:[],taskLogLoading:!0,loadTaskLog:gn(e,aM,t=>({taskLog:t.entries}),()=>({taskLog:[]}),"taskLogLoading")}}const F=DA()((e,t)=>({...qM(e),..._M(e,t),...lL(e,t),...cL(e),...kM(e,t),...aL(e,t),...oM(e,t),...SM(e)})),ym=e=>e.agentStatus.some(t=>t.status!=="done"&&t.status!=="error"),Jr=e=>e.capabilities.length===0||e.capabilities.some(t=>t.id.startsWith("agent:")&&t.status==="ok"),uL=e=>{const t=e.capabilities.find(n=>n.id==="gh");return t===void 0||t.status==="ok"},dL=e=>e.capabilities.filter(t=>t.status!=="ok").length,fL=e=>{var t;return((t=e.agentAuthStatus)==null?void 0:t.loggedIn)===!1};function hL(e){return e.includes("running")?"running":e.includes("fail")?"fail":e.every(t=>t==="stale")?"stale":"pass"}function Ck(e){var t,n,r,s;return{qualityStatus:hL([((t=e==null?void 0:e.lint)==null?void 0:t.status)??"stale",((n=e==null?void 0:e.format)==null?void 0:n.status)??"stale"]),testStatus:((r=e==null?void 0:e.test)==null?void 0:r.status)??"stale",consistencyStatus:((s=e==null?void 0:e.consistency)==null?void 0:s.status)??"stale"}}function Pk(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=Pk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pL(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Pk(e))&&(r&&(r+=" "),r+=t);return r}const xm="-",mL=e=>{const t=yL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(xm);return a[0]===""&&a.length!==1&&a.shift(),jk(a,t)||gL(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},jk=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?jk(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(xm);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},$x=/^\[(.+)\]$/,gL=e=>{if($x.test(e)){const t=$x.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yL=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vL(Object.entries(e.classGroups),n).forEach(([i,o])=>{bh(o,r,i,t)}),r},bh=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Vx(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(xL(s)){bh(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{bh(o,Vx(t,i),n,r)})})},Vx=(e,t)=>{let n=e;return t.split(xm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xL=e=>e.isThemeGetter,vL=(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,wL=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)}}},Ek="!",bL=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,d;for(let w=0;w<a.length;w++){let g=a[w];if(c===0){if(g===s&&(r||a.slice(w,w+i)===t)){l.push(a.slice(u,w)),u=w+i;continue}if(g==="/"){d=w;continue}}g==="["?c++:g==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(Ek),m=p?h.substring(1):h,y=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:o}):o},kL=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},_L=e=>({cache:wL(e.cacheSize),parseClassName:bL(e),...mL(e)}),SL=/\s+/,CL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(SL);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,y=r(m?h.substring(0,p):h);if(!y){if(!m){a=c+(a.length>0?" "+a:a);continue}if(y=r(h),!y){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=kL(u).join(":"),g=d?w+Ek:w,x=g+y;if(i.includes(x))continue;i.push(x);const v=s(y,m);for(let b=0;b<v.length;++b){const S=v[b];i.push(g+S)}a=c+(a.length>0?" "+a:a)}return a};function PL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Tk(t))&&(r&&(r+=" "),r+=n);return r}const Tk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Tk(e[r]))&&(n&&(n+=" "),n+=t);return n};function jL(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=_L(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=CL(l,n);return s(l,u),u}return function(){return i(PL.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Rk=/^\[(?:([a-z-]+):)?(.+)\]$/i,EL=/^\d+\/\d+$/,TL=new Set(["px","full","screen"]),RL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IL=/\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$/,NL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ML=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$n=e=>vi(e)||TL.has(e)||EL.test(e),dr=e=>Bi(e,"length",VL),vi=e=>!!e&&!Number.isNaN(Number(e)),Md=e=>Bi(e,"number",vi),uo=e=>!!e&&Number.isInteger(Number(e)),LL=e=>e.endsWith("%")&&vi(e.slice(0,-1)),ne=e=>Rk.test(e),fr=e=>RL.test(e),DL=new Set(["length","size","percentage"]),FL=e=>Bi(e,DL,Ik),OL=e=>Bi(e,"position",Ik),zL=new Set(["image","url"]),BL=e=>Bi(e,zL,WL),$L=e=>Bi(e,"",UL),fo=()=>!0,Bi=(e,t,n)=>{const r=Rk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},VL=e=>IL.test(e)&&!NL.test(e),Ik=()=>!1,UL=e=>AL.test(e),WL=e=>ML.test(e),HL=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),r=we("brightness"),s=we("borderColor"),i=we("borderRadius"),o=we("borderSpacing"),a=we("borderWidth"),l=we("contrast"),c=we("grayscale"),u=we("hueRotate"),d=we("invert"),h=we("gap"),p=we("gradientColorStops"),m=we("gradientColorStopPositions"),y=we("inset"),w=we("margin"),g=we("opacity"),x=we("padding"),v=we("saturate"),b=we("scale"),S=we("sepia"),k=we("skew"),j=we("space"),E=we("translate"),R=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ne,t],A=()=>[ne,t],O=()=>["",$n,dr],z=()=>["auto",vi,ne],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],B=()=>["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"],$=()=>["","0",ne],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[vi,ne];return{cacheSize:500,separator:":",theme:{colors:[fo],spacing:[$n,dr],blur:["none","",fr,ne],brightness:V(),borderColor:[e],borderRadius:["none","","full",fr,ne],borderSpacing:A(),borderWidth:O(),contrast:V(),grayscale:$(),hueRotate:V(),invert:$(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[LL,dr],inset:N(),margin:N(),opacity:V(),padding:A(),saturate:V(),scale:V(),sepia:$(),skew:V(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[fr]}],"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:[...P(),ne]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",uo,ne]}],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",ne]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",uo,ne]}],"grid-cols":[{"grid-cols":[fo]}],"col-start-end":[{col:["auto",{span:["full",uo,ne]},ne]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[fo]}],"row-start-end":[{row:["auto",{span:[uo,ne]},ne]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[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:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[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",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[fr]},fr]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fr,dr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Md]}],"font-family":[{font:[fo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",vi,Md]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$n,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$n,dr]}],"underline-offset":[{"underline-offset":["auto",$n,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),OL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",FL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},BL]}],"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":[g]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:L()}],"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:["",...L()]}],"outline-offset":[{"outline-offset":[$n,ne]}],"outline-w":[{outline:[$n,dr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[$n,dr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fr,$L]}],"shadow-color":[{shadow:[fo]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fr,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[S]}],"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":[g]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[uo,ne]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$n,dr,Md]}],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"]}}},GL=jL(HL);function Ld(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 KL(e,t){return e[0]===t[0]&&e[1]===t[1]}function QL(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)Ld(c,a,s);const l=function(c,u,d){const h=[];for(const x of c){const v=[...x];KL(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&h.push(v)}const p=[];u=Math.max(u,.1);const m=[];for(const x of h)for(let v=0;v<x.length-1;v++){const b=x[v],S=x[v+1];if(b[1]!==S[1]){const k=Math.min(b[1],S[1]);m.push({ymin:k,ymax:Math.max(b[1],S[1]),x:k===b[1]?b[0]:S[0],islope:(S[0]-b[0])/(S[1]-b[1])})}}if(m.sort((x,v)=>x.ymin<v.ymin?-1:x.ymin>v.ymin?1:x.x<v.x?-1:x.x>v.x?1:x.ymax===v.ymax?0:(x.ymax-v.ymax)/Math.abs(x.ymax-v.ymax)),!m.length)return p;let y=[],w=m[0].ymin,g=0;for(;y.length||m.length;){if(m.length){let x=-1;for(let v=0;v<m.length&&!(m[v].ymin>w);v++)x=v;m.splice(0,x+1).forEach(v=>{y.push({s:w,edge:v})})}if(y=y.filter(x=>!(x.edge.ymax<=w)),y.sort((x,v)=>x.edge.x===v.edge.x?0:(x.edge.x-v.edge.x)/Math.abs(x.edge.x-v.edge.x)),(d!==1||g%u==0)&&y.length>1)for(let x=0;x<y.length;x+=2){const v=x+1;if(v>=y.length)break;const b=y[x].edge,S=y[v].edge;p.push([[Math.round(b.x),w],[Math.round(S.x),w]])}w+=d,y.forEach(x=>{x.edge.x=x.edge.x+d*x.edge.islope}),g++}return p}(o,i,r);if(s){for(const c of o)Ld(c,a,-s);(function(c,u,d){const h=[];c.forEach(p=>h.push(...p)),Ld(h,u,d)})(l,a,-s)}return l}function wa(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),QL(e,s,r,i||1)}class vm{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=wa(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 vu(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 qL extends vm{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);const s=wa(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)vu([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 YL extends vm{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 XL{constructor(t){this.helper=t}fillPolygons(t,n){const r=wa(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=vu(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 y=p+d+m*s,w=h-o+2*Math.random()*o,g=y-o+2*Math.random()*o,x=this.helper.ellipse(w,g,i,i,n);r.push(...x.ops)}}return{type:"fillSketch",ops:r}}}class JL{constructor(t){this.helper=t}fillPolygons(t,n){const r=wa(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=vu(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),y=m+r,w=[u[0]+m*Math.cos(h)+c*Math.cos(h),u[1]+m*Math.sin(h)+c*Math.sin(h)],g=[u[0]+y*Math.cos(h)+c*Math.cos(h),u[1]+y*Math.sin(h)+c*Math.sin(h)];i.push(...this.helper.doubleLineOps(w[0],w[1],g[0],g[1],n))}}),i}}class ZL{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=wa(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=vu(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)),y=[l[0]+h*Math.cos(u),l[1]+h*Math.sin(u)],w=[l[0]+p*Math.cos(u),l[1]+p*Math.sin(u)],g=[y[0]+m*Math.cos(u+Math.PI/4),y[1]+m*Math.sin(u+Math.PI/4)];s.push(...this.helper.doubleLineOps(y[0],y[1],g[0],g[1],r),...this.helper.doubleLineOps(g[0],g[1],w[0],w[1],r))}}),s}}const ht={};class eD{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const tD=0,Dd=1,Ux=2,al={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 Fd(e,t){return e.type===t}function wm(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:tD,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:Dd,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return a[a.length]={type:Ux,text:""},a}(e);let r="BOD",s=0,i=n[s];for(;!Fd(i,Ux);){let o=0;const a=[];if(r==="BOD"){if(i.text!=="M"&&i.text!=="m")return wm("M0,0"+e);s++,o=al[i.text],r=i.text}else Fd(i,Dd)?o=al[r]:(s++,o=al[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(!Fd(c,Dd))throw new Error("Param not a number: "+r+","+c.text);a[a.length]=+c.text}if(typeof al[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 Nk(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 Ak(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 y=r+2*(p-r)/3,w=s+2*(m-s)/3,g=d+2*(p-d)/3,x=h+2*(m-h)/3;t.push({key:"C",data:[y,w,g,x,d,h]}),a=p,l=m,r=d,s=h;break}case"Q":{const[d,h,p,m]=u,y=r+2*(d-r)/3,w=s+2*(h-s)/3,g=p+2*(d-p)/3,x=m+2*(h-m)/3;t.push({key:"C",data:[y,w,g,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],y=u[4],w=u[5],g=u[6];d===0||h===0?(t.push({key:"C",data:[r,s,w,g,w,g]}),r=w,s=g):(r!==w||s!==g)&&(Mk(r,s,w,g,d,h,p,m,y).forEach(function(x){t.push({key:"C",data:x})}),r=w,s=g);break}case"Z":t.push({key:"Z",data:[]}),r=i,s=o}n=c}return t}function ho(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Mk(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,y=0,w=0;if(c)[p,m,y,w]=c;else{[e,t]=ho(e,t,-u),[n,r]=ho(n,r,-u);const O=(e-n)/2,z=(t-r)/2;let P=O*O/(s*s)+z*z/(i*i);P>1&&(P=Math.sqrt(P),s*=P,i*=P);const L=s*s,B=i*i,M=L*B-L*z*z-B*O*O,$=L*z*z+B*O*O,C=(a===l?-1:1)*Math.sqrt(Math.abs(M/$));y=C*s*z/i+(e+n)/2,w=C*-i*O/s+(t+r)/2,p=Math.asin(parseFloat(((t-w)/i).toFixed(9))),m=Math.asin(parseFloat(((r-w)/i).toFixed(9))),e<y&&(p=Math.PI-p),n<y&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),l&&p>m&&(p-=2*Math.PI),!l&&m>p&&(m-=2*Math.PI)}let g=m-p;if(Math.abs(g)>120*Math.PI/180){const O=m,z=n,P=r;m=l&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=Mk(n=y+s*Math.cos(m),r=w+i*Math.sin(m),z,P,s,i,o,0,l,[m,O,y,w])}g=m-p;const x=Math.cos(p),v=Math.sin(p),b=Math.cos(m),S=Math.sin(m),k=Math.tan(g/4),j=4/3*s*k,E=4/3*i*k,R=[e,t],T=[e+j*v,t-E*x],N=[n+j*S,r-E*b],A=[n,r];if(T[0]=2*R[0]-T[0],T[1]=2*R[1]-T[1],c)return[T,N,A].concat(h);{h=[T,N,A].concat(h);const O=[];for(let z=0;z<h.length;z+=3){const P=ho(h[z][0],h[z][1],u),L=ho(h[z+1][0],h[z+1][1],u),B=ho(h[z+2][0],h[z+2][1],u);O.push([P[0],P[1],L[0],L[1],B[0],B[1]])}return O}}const nD={randOffset:function(e,t){return Y(e,t)},randOffsetWithRange:function(e,t,n){return Nc(e,t,n)},ellipse:function(e,t,n,r,s){const i=Dk(n,r,s);return kh(e,t,s,i).opset},doubleLineOps:function(e,t,n,r,s){return Wr(e,t,n,r,s,!0)}};function Lk(e,t,n,r,s){return{type:"path",ops:Wr(e,t,n,r,s)}}function Ul(e,t,n){const r=(e||[]).length;if(r>2){const s=[];for(let i=0;i<r-1;i++)s.push(...Wr(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&s.push(...Wr(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:s}}return r===2?Lk(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function rD(e,t,n,r,s){return function(i,o){return Ul(i,!0,o)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],s)}function Wx(e,t){if(e.length){const n=typeof e[0][0]=="number"?[e]:e,r=ll(n[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:ll(n[0],1.5*(1+.22*t.roughness),Kx(t));for(let i=1;i<n.length;i++){const o=n[i];if(o.length){const a=ll(o,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ll(o,1.5*(1+.22*t.roughness),Kx(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 Dk(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+=Y(o*l,n),a+=Y(a*l,n),{increment:i,rx:o,ry:a}}function kh(e,t,n,r){const[s,i]=Qx(r.increment,e,t,r.rx,r.ry,1,r.increment*Nc(.1,Nc(.4,1,n),n),n);let o=Ac(s,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[a]=Qx(r.increment,e,t,r.rx,r.ry,1.5,0,n),l=Ac(a,null,n);o=o.concat(l)}return{estimatedPoints:i,opset:{type:"path",ops:o}}}function Hx(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+=Y(.01*d,l),h+=Y(.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 y=2*Math.PI/l.curveStepCount,w=Math.min(y/2,(m-p)/2),g=qx(w,c,u,d,h,p,m,1,l);if(!l.disableMultiStroke){const x=qx(w,c,u,d,h,p,m,1.5,l);g.push(...x)}return o&&(a?g.push(...Wr(c,u,c+d*Math.cos(p),u+h*Math.sin(p),l),...Wr(c,u,c+d*Math.cos(m),u+h*Math.sin(m),l)):g.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(p),u+h*Math.sin(p)]})),{type:"path",ops:g}}function Gx(e,t){const n=Ak(Nk(wm(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(...Wr(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(...sD(l,c,u,d,h,p,i,t)),i=[h,p];break}case"Z":r.push(...Wr(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]]}return{type:"path",ops:r}}function Od(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]+Y(s,t),r[0][1]+Y(s,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+Y(s,t),r[o][1]+Y(s,t)]})}}return{type:"fillPath",ops:n}}function Vs(e,t){return function(n,r){let s=n.fillStyle||"hachure";if(!ht[s])switch(s){case"zigzag":ht[s]||(ht[s]=new qL(r));break;case"cross-hatch":ht[s]||(ht[s]=new YL(r));break;case"dots":ht[s]||(ht[s]=new XL(r));break;case"dashed":ht[s]||(ht[s]=new JL(r));break;case"zigzag-line":ht[s]||(ht[s]=new ZL(r));break;default:s="hachure",ht[s]||(ht[s]=new vm(r))}return ht[s]}(t,nD).fillPolygons(e,t)}function Kx(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Fk(e){return e.randomizer||(e.randomizer=new eD(e.seed||0)),e.randomizer.next()}function Nc(e,t,n,r=1){return n.roughness*r*(Fk(n)*(t-e)+e)}function Y(e,t,n=1){return Nc(-e,e,t,n)}function Wr(e,t,n,r,s,i=!1){const o=i?s.disableMultiStrokeFill:s.disableMultiStroke,a=_h(e,t,n,r,s,!0,!1);if(o)return a;const l=_h(e,t,n,r,s,!0,!0);return a.concat(l)}function _h(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*Fk(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-n)/200;p=Y(p,s,c),m=Y(m,s,c);const y=[],w=()=>Y(d,s,c),g=()=>Y(u,s,c),x=s.preserveVertices;return o?y.push({op:"move",data:[e+(x?0:w()),t+(x?0:w())]}):y.push({op:"move",data:[e+(x?0:Y(u,s,c)),t+(x?0:Y(u,s,c))]}),o?y.push({op:"bcurveTo",data:[p+e+(n-e)*h+w(),m+t+(r-t)*h+w(),p+e+2*(n-e)*h+w(),m+t+2*(r-t)*h+w(),n+(x?0:w()),r+(x?0:w())]}):y.push({op:"bcurveTo",data:[p+e+(n-e)*h+g(),m+t+(r-t)*h+g(),p+e+2*(n-e)*h+g(),m+t+2*(r-t)*h+g(),n+(x?0:g()),r+(x?0:g())]}),y}function ll(e,t,n){if(!e.length)return[];const r=[];r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]),r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+Y(t,n),e[s][1]+Y(t,n)]),s===e.length-1&&r.push([e[s][0]+Y(t,n),e[s][1]+Y(t,n)]);return Ac(r,null,n)}function Ac(e,t,n){const r=e.length,s=[];if(r>3){const i=[],o=1-n.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<r;a++){const l=e[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*e[a+1][0]-o*e[a-1][0])/6,l[1]+(o*e[a+1][1]-o*e[a-1][1])/6],i[2]=[e[a+1][0]+(o*e[a][0]-o*e[a+2][0])/6,e[a+1][1]+(o*e[a][1]-o*e[a+2][1])/6],i[3]=[e[a+1][0],e[a+1][1]],s.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(..._h(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return s}function Qx(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=Y(.5,a)-Math.PI/2;c.push([Y(i,a)+t+.9*r*Math.cos(u-e),Y(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=[Y(i,a)+t+r*Math.cos(h),Y(i,a)+n+s*Math.sin(h)];l.push(p),c.push(p)}c.push([Y(i,a)+t+r*Math.cos(u+2*Math.PI+.5*o),Y(i,a)+n+s*Math.sin(u+2*Math.PI+.5*o)]),c.push([Y(i,a)+t+.98*r*Math.cos(u+o),Y(i,a)+n+.98*s*Math.sin(u+o)]),c.push([Y(i,a)+t+.9*r*Math.cos(u+.5*o),Y(i,a)+n+.9*s*Math.sin(u+.5*o)])}return[c,l]}function qx(e,t,n,r,s,i,o,a,l){const c=i+Y(.1,l),u=[];u.push([Y(a,l)+t+.9*r*Math.cos(c-e),Y(a,l)+n+.9*s*Math.sin(c-e)]);for(let d=c;d<=o;d+=e)u.push([Y(a,l)+t+r*Math.cos(d),Y(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)]),Ac(u,null,l)}function sD(e,t,n,r,s,i,o,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let u=[0,0];const 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:Y(c[0],a)),o[1]+(h?0:Y(c[0],a))]}),u=h?[s,i]:[s+Y(c[p],a),i+Y(c[p],a)],l.push({op:"bcurveTo",data:[e+Y(c[p],a),t+Y(c[p],a),n+Y(c[p],a),r+Y(c[p],a),u[0],u[1]]});return l}function po(e){return[...e]}function Yx(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(po(e[0]),po(e[1]),po(e[2]),po(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(po(s[0]));for(let a=1;a+2<s.length;a++){const l=s[a];i[0]=[l[0],l[1]],i[1]=[l[0]+(o*s[a+1][0]-o*s[a-1][0])/6,l[1]+(o*s[a+1][1]-o*s[a-1][1])/6],i[2]=[s[a+1][0]+(o*s[a][0]-o*s[a+2][0])/6,s[a+1][1]+(o*s[a][1]-o*s[a+2][1])/6],i[3]=[s[a+1][0],s[a+1][1]],r.push(i[1],i[2],i[3])}}return r}function Wl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function iD(e,t,n){const r=Wl(t,n);if(r===0)return Wl(e,t);let s=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),Wl(e,ls(t,n,s))}function ls(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Sh(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 y=3*d[0]-2*h[0]-c[0];y*=y;let w=3*d[1]-2*h[1]-c[1];return w*=w,p<y&&(p=y),m<w&&(m=w),p+m}(e,t)<n){const a=e[t+0];s.length?(i=s[s.length-1],o=a,Math.sqrt(Wl(i,o))>1&&s.push(a)):s.push(a),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],u=e[t+2],d=e[t+3],h=ls(l,c,.5),p=ls(c,u,.5),m=ls(u,d,.5),y=ls(h,p,.5),w=ls(p,m,.5),g=ls(y,w,.5);Sh([l,h,y,g],0,n,s),Sh([g,w,m,d],0,n,s)}var i,o;return s}function oD(e,t){return Mc(e,0,e.length,t)}function Mc(e,t,n,r,s){const i=s||[],o=e[t],a=e[n-1];let l=0,c=1;for(let u=t+1;u<n-1;++u){const d=iD(e[u],o,a);d>l&&(l=d,c=u)}return Math.sqrt(l)>r?(Mc(e,t,c+1,r,i),Mc(e,c,n,r,i)):(i.length||i.push(o),i.push(a)),i}function zd(e,t=.15,n){const r=[],s=(e.length-1)/3;for(let i=0;i<s;i++)Sh(e,3*i,t,r);return n&&n>0?Mc(r,0,r.length,n):r}const Tt="none";let Lc=class{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,s,i){const o=this._o(i);return this._d("line",[Lk(t,n,r,s,o)],o)}rectangle(t,n,r,s,i){const o=this._o(i),a=[],l=rD(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(Od([c],o)):a.push(Vs([c],o))}return o.stroke!==Tt&&a.push(l),this._d("rectangle",a,o)}ellipse(t,n,r,s,i){const o=this._o(i),a=[],l=Dk(r,s,o),c=kh(t,n,o,l);if(o.fill)if(o.fillStyle==="solid"){const u=kh(t,n,o,l).opset;u.type="fillPath",a.push(u)}else a.push(Vs([c.estimatedPoints],o));return o.stroke!==Tt&&a.push(c.opset),this._d("ellipse",a,o)}circle(t,n,r,s){const i=this.ellipse(t,n,r,r,s);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Ul(t,!1,r)],r)}arc(t,n,r,s,i,o,a=!1,l){const c=this._o(l),u=[],d=Hx(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=Hx(t,n,r,s,i,o,!0,!1,h);p.type="fillPath",u.push(p)}else u.push(function(h,p,m,y,w,g,x){const v=h,b=p;let S=Math.abs(m/2),k=Math.abs(y/2);S+=Y(.01*S,x),k+=Y(.01*k,x);let j=w,E=g;for(;j<0;)j+=2*Math.PI,E+=2*Math.PI;E-j>2*Math.PI&&(j=0,E=2*Math.PI);const R=(E-j)/x.curveStepCount,T=[];for(let N=j;N<=E;N+=R)T.push([v+S*Math.cos(N),b+k*Math.sin(N)]);return T.push([v+S*Math.cos(E),b+k*Math.sin(E)]),T.push([v,b]),Vs([T],x)}(t,n,r,s,i,o,c));return c.stroke!==Tt&&u.push(d),this._d("arc",u,c)}curve(t,n){const r=this._o(n),s=[],i=Wx(t,r);if(r.fill&&r.fill!==Tt)if(r.fillStyle==="solid"){const o=Wx(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(...zd(Yx([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):o.push(...zd(Yx(c),10,(1+r.roughness)/2))}o.length&&s.push(Vs([o],r))}return r.stroke!==Tt&&s.push(i),this._d("curve",s,r)}polygon(t,n){const r=this._o(n),s=[],i=Ul(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(Od([t],r)):s.push(Vs([t],r))),r.stroke!==Tt&&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!==Tt,o=r.stroke!==Tt,a=!!(r.simplification&&r.simplification<1),l=function(u,d,h){const p=Ak(Nk(wm(u))),m=[];let y=[],w=[0,0],g=[];const x=()=>{g.length>=4&&y.push(...zd(g,d)),g=[]},v=()=>{x(),y.length&&(m.push(y),y=[])};for(const{key:S,data:k}of p)switch(S){case"M":v(),w=[k[0],k[1]],y.push(w);break;case"L":x(),y.push([k[0],k[1]]);break;case"C":if(!g.length){const j=y.length?y[y.length-1]:w;g.push([j[0],j[1]])}g.push([k[0],k[1]]),g.push([k[2],k[3]]),g.push([k[4],k[5]]);break;case"Z":x(),y.push([w[0],w[1]])}if(v(),!h)return m;const b=[];for(const S of m){const k=oD(S,h);k.length&&b.push(k)}return b}(t,1,a?4-4*(r.simplification||1):(1+r.roughness)/2),c=Gx(t,r);if(i)if(r.fillStyle==="solid")if(l.length===1){const u=Gx(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(Od(l,r));else s.push(Vs(l,r));return o&&(a?l.forEach(u=>{s.push(Ul(u,!1,r))}):s.push(c)),this._d("path",s,r)}opsToPath(t,n){let r="";for(const s of t.ops){const i=typeof n=="number"&&n>=0?s.data.map(o=>+o.toFixed(n)):s.data;switch(s.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const i of n){let o=null;switch(i.type){case"path":o={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Tt};break;case"fillPath":o={d:this.opsToPath(i),stroke:Tt,strokeWidth:0,fill:r.fill||Tt};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||Tt,strokeWidth:r,fill:Tt}}_mergedShape(t){return t.filter((n,r)=>r===0||n.op!=="move")}},aD=class{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Lc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const o of n)switch(o.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,o,i),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,o,i,a),s.restore();break}case"fillSketch":this.fillSketch(s,o,r)}}fillSketch(t,n,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,s="nonzero"){t.beginPath();for(const i of n.ops){const o=typeof r=="number"&&r>=0?i.data.map(a=>+a.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}n.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,s,i){const o=this.gen.line(t,n,r,s,i);return this.draw(o),o}rectangle(t,n,r,s,i){const o=this.gen.rectangle(t,n,r,s,i);return this.draw(o),o}ellipse(t,n,r,s,i){const o=this.gen.ellipse(t,n,r,s,i);return this.draw(o),o}circle(t,n,r,s){const i=this.gen.circle(t,n,r,s);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,s,i,o,a=!1,l){const c=this.gen.arc(t,n,r,s,i,o,a,l);return this.draw(c),c}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}};const cl="http://www.w3.org/2000/svg";class lD{constructor(t,n){this.svg=t,this.gen=new Lc(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,i=s.createElementNS(cl,"g"),o=t.options.fixedDecimalPlaceDigits;for(const a of n){let l=null;switch(a.type){case"path":l=s.createElementNS(cl,"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(cl,"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(cl,"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 cD={canvas:(e,t)=>new aD(e,t),svg:(e,t)=>new lD(e,t),generator:e=>new Lc(e),newSeed:()=>Lc.newSeed()};const bm=_.createContext({});function km(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const uD=typeof window<"u",Ok=uD?_.useLayoutEffect:_.useEffect,wu=_.createContext(null);function _m(e,t){e.indexOf(t)===-1&&e.push(t)}function Dc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Dn=(e,t,n)=>n>t?t:n<e?e:n;let Sm=()=>{};const Hr={},zk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Bk=e=>typeof e=="object"&&e!==null,$k=e=>/^0[^.\s]+$/u.test(e);function Vk(e){let t;return()=>(t===void 0&&(t=e()),t)}const Jt=e=>e,ba=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ca=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Cm{constructor(){this.subscriptions=[]}add(t){return _m(this.subscriptions,t),()=>Dc(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Dt=e=>e*1e3,Yt=e=>e/1e3,Uk=(e,t)=>t?e*(1e3/t):0,Wk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,dD=1e-7,fD=12;function hD(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Wk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>dD&&++a<fD);return o}function ka(e,t,n,r){if(e===t&&n===r)return Jt;const s=i=>hD(i,0,1,e,n);return i=>i===0||i===1?i:Wk(s(i),t,r)}const Hk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gk=e=>t=>1-e(1-t),Kk=ka(.33,1.53,.69,.99),Pm=Gk(Kk),Qk=Hk(Pm),qk=e=>e>=1?1:(e*=2)<1?.5*Pm(e):.5*(2-Math.pow(2,-10*(e-1))),jm=e=>1-Math.sin(Math.acos(e)),Yk=Gk(jm),Xk=Hk(jm),pD=ka(.42,0,1,1),mD=ka(0,0,.58,1),Jk=ka(.42,0,.58,1),gD=e=>Array.isArray(e)&&typeof e[0]!="number",Zk=e=>Array.isArray(e)&&typeof e[0]=="number",yD={linear:Jt,easeIn:pD,easeInOut:Jk,easeOut:mD,circIn:jm,circInOut:Xk,circOut:Yk,backIn:Pm,backInOut:Qk,backOut:Kk,anticipate:qk},xD=e=>typeof e=="string",Xx=e=>{if(Zk(e)){Sm(e.length===4);const[t,n,r,s]=e;return ka(t,n,r,s)}else if(xD(e))return yD[e];return e},ul=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function vD(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 wD=40;function e_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=ul.reduce((v,b)=>(v[b]=vD(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:h,render:p,postRender:m}=o,y=()=>{const v=Hr.useManualTiming,b=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,wD),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(y))},w=()=>{n=!0,r=!0,s.isProcessing||e(y)};return{schedule:ul.reduce((v,b)=>{const S=o[b];return v[b]=(k,j=!1,E=!1)=>(n||w(),S.schedule(k,j,E)),v},{}),cancel:v=>{for(let b=0;b<ul.length;b++)o[ul[b]].cancel(v)},state:s,steps:o}}const{schedule:ge,cancel:Gr,state:qe,steps:Bd}=e_(typeof requestAnimationFrame<"u"?requestAnimationFrame:Jt,!0);let Hl;function bD(){Hl=void 0}const lt={now:()=>(Hl===void 0&&lt.set(qe.isProcessing||Hr.useManualTiming?qe.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(bD)}},t_=e=>t=>typeof t=="string"&&t.startsWith(e),n_=t_("--"),kD=t_("var(--"),Em=e=>kD(e)?_D.test(e.split("/*")[0].trim()):!1,_D=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Jx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const $i={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ua={...$i,transform:e=>Dn(0,1,e)},dl={...$i,default:1},Fo=e=>Math.round(e*1e5)/1e5,Tm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function SD(e){return e==null}const CD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rm=(e,t)=>n=>!!(typeof n=="string"&&CD.test(n)&&n.startsWith(e)||t&&!SD(n)&&Object.prototype.hasOwnProperty.call(n,t)),r_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Tm);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},PD=e=>Dn(0,255,e),$d={...$i,transform:e=>Math.round(PD(e))},ms={test:Rm("rgb","red"),parse:r_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$d.transform(e)+", "+$d.transform(t)+", "+$d.transform(n)+", "+Fo(ua.transform(r))+")"};function jD(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 Ch={test:Rm("#"),parse:jD,transform:ms.transform},_a=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wn=_a("deg"),Mn=_a("%"),K=_a("px"),ED=_a("vh"),TD=_a("vw"),Zx={...Mn,parse:e=>Mn.parse(e)/100,transform:e=>Mn.transform(e*100)},li={test:Rm("hsl","hue"),parse:r_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Mn.transform(Fo(t))+", "+Mn.transform(Fo(n))+", "+Fo(ua.transform(r))+")"},Oe={test:e=>ms.test(e)||Ch.test(e)||li.test(e),parse:e=>ms.test(e)?ms.parse(e):li.test(e)?li.parse(e):Ch.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ms.transform(e):li.transform(e),getAnimatableNone:e=>{const t=Oe.parse(e);return t.alpha=0,Oe.transform(t)}},RD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ID(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Tm))==null?void 0:t.length)||0)+(((n=e.match(RD))==null?void 0:n.length)||0)>0}const s_="number",i_="color",ND="var",AD="var(",ev="${}",MD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ii(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(MD,l=>(Oe.test(l)?(r.color.push(i),s.push(i_),n.push(Oe.parse(l))):l.startsWith(AD)?(r.var.push(i),s.push(ND),n.push(l)):(r.number.push(i),s.push(s_),n.push(parseFloat(l))),++i,ev)).split(ev);return{values:n,split:a,indexes:r,types:s}}function LD(e){return Ii(e).values}function o_({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===s_?s+=Fo(r[i]):o===i_?s+=Oe.transform(r[i]):s+=r[i]}return s}}function DD(e){return o_(Ii(e))}const FD=e=>typeof e=="number"?0:Oe.test(e)?Oe.getAnimatableNone(e):e,OD=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:FD(e);function zD(e){const t=Ii(e);return o_(t)(t.values.map((r,s)=>OD(r,t.split[s])))}const yn={test:ID,parse:LD,createTransformer:DD,getAnimatableNone:zD};function Vd(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 BD({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=Vd(l,a,e+1/3),i=Vd(l,a,e),o=Vd(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Fc(e,t){return n=>n>0?t:e}const me=(e,t,n)=>e+(t-e)*n,Ud=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},$D=[Ch,ms,li],VD=e=>$D.find(t=>t.test(e));function tv(e){const t=VD(e);if(!t)return!1;let n=t.parse(e);return t===li&&(n=BD(n)),n}const nv=(e,t)=>{const n=tv(e),r=tv(t);if(!n||!r)return Fc(e,t);const s={...n};return i=>(s.red=Ud(n.red,r.red,i),s.green=Ud(n.green,r.green,i),s.blue=Ud(n.blue,r.blue,i),s.alpha=me(n.alpha,r.alpha,i),ms.transform(s))},Ph=new Set(["none","hidden"]);function UD(e,t){return Ph.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function WD(e,t){return n=>me(e,t,n)}function Im(e){return typeof e=="number"?WD:typeof e=="string"?Em(e)?Fc:Oe.test(e)?nv:KD:Array.isArray(e)?a_:typeof e=="object"?Oe.test(e)?nv:HD:Fc}function a_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Im(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function HD(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Im(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function GD(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 KD=(e,t)=>{const n=yn.createTransformer(t),r=Ii(e),s=Ii(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ph.has(e)&&!s.values.length||Ph.has(t)&&!r.values.length?UD(e,t):ba(a_(GD(r,s),s.values),n):Fc(e,t)};function l_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?me(e,t,n):Im(e)(e,t)}const QD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>Gr(t),now:()=>qe.isProcessing?qe.timestamp:lt.now()}},c_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Oc=2e4;function Nm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Oc;)t+=n,r=e.next(t);return t>=Oc?1/0:t}function qD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Nm(r),Oc);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Yt(s)}}const Te={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 jh(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 Wd=.001;function JD({duration:e=Te.duration,bounce:t=Te.bounce,velocity:n=Te.velocity,mass:r=Te.mass}){let s,i,o=1-t;o=Dn(Te.minDamping,Te.maxDamping,o),e=Dn(Te.minDuration,Te.maxDuration,Yt(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,p=jh(c,o),m=Math.exp(-d);return Wd-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),y=jh(Math.pow(c,2),o);return(-s(c)+Wd>0?-1:1)*((h-p)*m)/y}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Wd+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=Dt(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const ZD=["duration","bounce"],e3=["stiffness","damping","mass"];function rv(e,t){return t.some(n=>e[n]!==void 0)}function t3(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!rv(e,e3)&&rv(e,ZD))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Dn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Te.mass,stiffness:s,damping:i}}else{const n=JD({...e,velocity:0});t={...t,...n,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function zc(e=Te.visualDuration,t=Te.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}=t3({...n,velocity:-Yt(n.velocity||0)}),m=h||0,y=c/(2*Math.sqrt(l*u)),w=o-i,g=Yt(Math.sqrt(l/u)),x=Math.abs(w)<5;r||(r=x?Te.restSpeed.granular:Te.restSpeed.default),s||(s=x?Te.restDelta.granular:Te.restDelta.default);let v,b,S,k,j,E;if(y<1)S=jh(g,y),k=(m+y*g*w)/S,v=T=>{const N=Math.exp(-y*g*T);return o-N*(k*Math.sin(S*T)+w*Math.cos(S*T))},j=y*g*k+w*S,E=y*g*w-k*S,b=T=>Math.exp(-y*g*T)*(j*Math.sin(S*T)+E*Math.cos(S*T));else if(y===1){v=N=>o-Math.exp(-g*N)*(w+(m+g*w)*N);const T=m+g*w;b=N=>Math.exp(-g*N)*(g*T*N-m)}else{const T=g*Math.sqrt(y*y-1);v=z=>{const P=Math.exp(-y*g*z),L=Math.min(T*z,300);return o-P*((m+y*g*w)*Math.sinh(L)+T*w*Math.cosh(L))/T};const N=(m+y*g*w)/T,A=y*g*N-w*T,O=y*g*w-N*T;b=z=>{const P=Math.exp(-y*g*z),L=Math.min(T*z,300);return P*(A*Math.sinh(L)+O*Math.cosh(L))}}const R={calculatedDuration:p&&d||null,velocity:T=>Dt(b(T)),next:T=>{if(!p&&y<1){const A=Math.exp(-y*g*T),O=Math.sin(S*T),z=Math.cos(S*T),P=o-A*(k*O+w*z),L=Dt(A*(j*O+E*z));return a.done=Math.abs(L)<=r&&Math.abs(o-P)<=s,a.value=a.done?o:P,a}const N=v(T);if(p)a.done=T>=d;else{const A=Dt(b(T));a.done=Math.abs(A)<=r&&Math.abs(o-N)<=s}return a.value=a.done?o:N,a},toString:()=>{const T=Math.min(Nm(R),Oc),N=c_(A=>R.next(T*A).value,T,30);return T+"ms "+N},toTransition:()=>{}};return R}zc.applyToOptions=e=>{const t=qD(e,100,zc);return e.ease=t.ease,e.duration=Dt(t.duration),e.type="keyframes",e};const n3=5;function u_(e,t,n){const r=Math.max(t-n3,0);return Uk(n-e(r),t-r)}function Eh({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 y=n*t;const w=d+y,g=o===void 0?w:o(w);g!==w&&(y=g-d);const x=E=>-y*Math.exp(-E/r),v=E=>g+x(E),b=E=>{const R=x(E),T=v(E);h.done=Math.abs(R)<=c,h.value=h.done?g:T};let S,k;const j=E=>{p(h.value)&&(S=E,k=zc({keyframes:[h.value,m(h.value)],velocity:u_(v,E,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return j(0),{calculatedDuration:null,next:E=>{let R=!1;return!k&&S===void 0&&(R=!0,b(E),j(E)),S!==void 0&&E>=S?k.next(E-S):(!R&&b(E),h)}}}function r3(e,t,n){const r=[],s=n||Hr.mix||l_,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]||Jt:t;a=ba(l,a)}r.push(a)}return r}function s3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Sm(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=r3(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=ca(e[d],e[d+1],u);return a[d](h)};return n?u=>c(Dn(e[0],e[i-1],u)):c}function i3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=ca(0,t,r);e.push(me(n,1,s))}}function o3(e){const t=[0];return i3(t,e.length-1),t}function a3(e,t){return e.map(n=>n*t)}function l3(e,t){return e.map(()=>t||Jk).splice(0,e.length-1)}function Oo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=gD(r)?r.map(Xx):Xx(r),i={done:!1,value:t[0]},o=a3(n&&n.length===t.length?n:o3(t),e),a=s3(o,t,{ease:Array.isArray(s)?s:l3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const c3=e=>e!==null;function bu(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(c3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const u3={decay:Eh,inertia:Eh,tween:Oo,keyframes:Oo,spring:zc};function d_(e){typeof e.type=="string"&&(e.type=u3[e.type])}class Am{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 d3=e=>e/100;class Bc extends Am{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!==lt.now()&&this.tick(lt.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;d_(t);const{type:n=Oo,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Oo;l!==Oo&&typeof a[0]!="number"&&(this.mixKeyframes=ba(d3,l_(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=Nm(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:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,b=r;if(d){const E=Math.min(this.currentTime,s)/a;let R=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(h==="reverse"?(T=1-T,p&&(T-=p/a)):h==="mirror"&&(b=o)),v=Dn(0,1,T)*a}let S;x?(this.delayState.value=u[0],S=this.delayState):S=b.next(v),i&&!x&&(S.value=i(S.value));let{done:k}=S;!x&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return j&&m!==Eh&&(S.value=bu(u,this.options,w,this.speed)),y&&y(S.value),j&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Yt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(this.currentTime)}set time(t){t=Dt(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 u_(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(lt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Yt(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=QD,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(lt.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 f3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gs=e=>e*180/Math.PI,Th=e=>{const t=gs(Math.atan2(e[1],e[0]));return Rh(t)},h3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Th,rotateZ:Th,skewX:e=>gs(Math.atan(e[1])),skewY:e=>gs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Rh=e=>(e=e%360,e<0&&(e+=360),e),sv=Th,iv=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ov=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),p3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:iv,scaleY:ov,scale:e=>(iv(e)+ov(e))/2,rotateX:e=>Rh(gs(Math.atan2(e[6],e[5]))),rotateY:e=>Rh(gs(Math.atan2(-e[2],e[0]))),rotateZ:sv,rotate:sv,skewX:e=>gs(Math.atan(e[4])),skewY:e=>gs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ih(e){return e.includes("scale")?1:0}function Nh(e,t){if(!e||e==="none")return Ih(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=p3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=h3,s=a}if(!s)return Ih(t);const i=r[t],o=s[1].split(",").map(g3);return typeof i=="function"?i(o):o[i]}const m3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Nh(n,t)};function g3(e){return parseFloat(e.trim())}const Vi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ui=new Set([...Vi,"pathRotation"]),av=e=>e===$i||e===K,y3=new Set(["x","y","z"]),x3=Vi.filter(e=>!y3.has(e));function v3(e){const t=[];return x3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ir={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})=>Nh(t,"x"),y:(e,{transform:t})=>Nh(t,"y")};Ir.translateX=Ir.x;Ir.translateY=Ir.y;const _s=new Set;let Ah=!1,Mh=!1,Lh=!1;function f_(){if(Mh){const e=Array.from(_s).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=v3(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)})}Mh=!1,Ah=!1,_s.forEach(e=>e.complete(Lh)),_s.clear()}function h_(){_s.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mh=!0)})}function w3(){Lh=!0,h_(),f_(),Lh=!1}class Mm{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?(_s.add(this),Ah||(Ah=!0,ge.read(h_),ge.resolveKeyframes(f_))):(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])}f3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_s.delete(this)}cancel(){this.state==="scheduled"&&(_s.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const b3=e=>e.startsWith("--");function p_(e,t,n){b3(t)?e.style.setProperty(t,n):e.style[t]=n}const k3={};function m_(e,t){const n=Vk(e);return()=>k3[t]??n()}const _3=m_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),g_=m_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_o=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,lv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_o([0,.65,.55,1]),circOut:_o([.55,0,1,.45]),backIn:_o([.31,.01,.66,-.59]),backOut:_o([.33,1.53,.69,.99])};function y_(e,t){if(e)return typeof e=="function"?g_()?c_(e,t):"ease-out":Zk(e)?_o(e):Array.isArray(e)?e.map(n=>y_(n,t)||lv.easeOut):lv[e]}function S3(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=y_(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 x_(e){return typeof e=="function"&&"applyToOptions"in e}function C3({type:e,...t}){return x_(e)&&g_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class v_ extends Am{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,Sm(typeof t.type!="string");const c=C3(t);this.animation=S3(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=bu(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),p_(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 Yt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Yt(t)}get time(){return Yt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Dt(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&&_3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Jt):s(this)}}const w_={anticipate:qk,backInOut:Qk,circInOut:Xk};function P3(e){return e in w_}function j3(e){typeof e.ease=="string"&&P3(e.ease)&&(e.ease=w_[e.ease])}const Hd=10;class E3 extends v_{constructor(t){j3(t),d_(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 Bc({...o,autoplay:!1}),l=Math.max(Hd,lt.now()-this.startTime),c=Dn(0,Hd,l-Hd),u=a.sample(l).value,{name:d}=this.options;i&&d&&p_(i,d,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const cv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(yn.test(e)||e==="0")&&!e.startsWith("url("));function T3(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 R3(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=cv(s,t),a=cv(i,t);return!o||!a?!1:T3(e)||(n==="spring"||x_(n))&&r}function Dh(e){e.duration=0,e.type="keyframes"}const b_=new Set(["opacity","clipPath","filter","transform"]),I3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function N3(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&I3.test(e[t]))return!0;return!1}const A3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),M3=Vk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function L3(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 M3()&&n&&(b_.has(n)||A3.has(n)&&N3(a))&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const D3=40;class F3 extends Am{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 y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=lt.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)||Mm;this.keyframeResolver=new p(a,(y,w,g)=>this.onKeyframesResolved(y,w,h,!g),l,c,u),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var g,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=lt.now();let d=!0;R3(t,i,o,a)||(d=!1,(Hr.instantAnimations||!l)&&(u==null||u(bu(t,r,n))),t[0]=t[t.length-1],Dh(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>D3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=d&&!c&&L3(p),y=(x=(g=p.motionValue)==null?void 0:g.owner)==null?void 0:x.current;let w;if(m)try{w=new E3({...p,element:y})}catch{w=new Bc(p)}else w=new Bc(p);w.finished.then(()=>{this.notifyFinished()}).catch(Jt),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),w3()),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 k_(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 uv=30,O3=e=>!isNaN(parseFloat(e));class z3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=lt.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=lt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=O3(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 Cm);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.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=lt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uv);return Uk(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 Ni(e,t){return new z3(e,t)}function __(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Lm(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?__(n,e):n}const B3={type:"spring",stiffness:500,damping:25,restSpeed:10},$3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),V3={type:"keyframes",duration:.8},U3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},W3=(e,{keyframes:t})=>t.length>2?V3:Ui.has(e)?e.startsWith("scale")?$3(t[1]):B3:U3,H3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function G3(e){for(const t in e)if(!H3.has(t))return!0;return!1}const Dm=(e,t,n,r={},s,i)=>o=>{const a=Lm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Dt(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};G3(a)||Object.assign(u,W3(e,u)),u.duration&&(u.duration=Dt(u.duration)),u.repeatDelay&&(u.repeatDelay=Dt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Dh(u),u.delay===0&&(d=!0)),(Hr.instantAnimations||Hr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(d=!0,Dh(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const h=bu(u.keyframes,a);if(h!==void 0){ge.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new Bc(u):new F3(u)},K3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Q3(e){const t=K3.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function S_(e,t,n=1){const[r,s]=Q3(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return zk(o)?parseFloat(o):o}return Em(s)?S_(s,t,n+1):s}function dv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Fm(e,t,n,r){if(typeof t=="function"){const[s,i]=dv(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]=dv(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Ss(e,t,n){const r=e.getProps();return Fm(r,t,n!==void 0?n:r.custom,e)}const C_=new Set(["width","height","top","left","right","bottom",...Vi]),Fh=e=>Array.isArray(e);function q3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ni(n))}function Y3(e){return Fh(e)?e[e.length-1]||0:e}function X3(e,t){const n=Ss(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Y3(i[o]);q3(e,o,a)}}const Ye=e=>!!(e&&e.getVelocity);function J3(e){return!!(Ye(e)&&e.add)}function Oh(e,t){const n=e.getValue("willChange");if(J3(n))return n.add(t);if(!n&&Hr.WillChange){const r=new Hr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Om(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Z3="framerAppearId",P_="data-"+Om(Z3);function j_(e){return e.props[P_]}function eF({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function E_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?__(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 y=e.getValue(m,e.latestValues[m]??null),w=a[m];if(w===void 0||h&&eF(h,m))continue;const g={delay:n,...Lm(i||{},m)};u&&(g.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===x&&!g.velocity){ge.update(()=>y.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const k=j_(e);if(k){const j=window.MotionHandoffAnimation(k,m,ge);j!==null&&(g.startTime=j,v=!0)}}Oh(e,m);const b=c??e.shouldReduceMotion;y.start(Dm(m,y,w,b&&C_.has(m)?{type:!1}:g,e,v));const S=y.animation;S&&d.push(S)}if(o){const m=()=>ge.update(()=>{o&&X3(e,o)});d.length?Promise.all(d).then(m):m()}return d}function zh(e,t,n={}){var l;const r=Ss(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(E_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return tF(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 tF(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(zh(l,t,{...o,delay:n+(typeof r=="function"?0:r)+k_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function nF(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>zh(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=zh(e,t,n);else{const s=typeof t=="function"?Ss(e,t,n.custom):t;r=Promise.all(E_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const rF={test:e=>e==="auto",parse:e=>e},T_=e=>t=>t.test(e),R_=[$i,K,Mn,Wn,TD,ED,rF],fv=e=>R_.find(T_(e));function sF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$k(e):!0}const iF=new Set(["brightness","contrast","saturate","opacity"]);function oF(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Tm)||[];if(!r)return e;const s=n.replace(r,"");let i=iF.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const aF=/\b([a-z-]*)\(.*?\)/gu,Bh={...yn,getAnimatableNone:e=>{const t=e.match(aF);return t?t.map(oF).join(" "):e}},$h={...yn,getAnimatableNone:e=>{const t=yn.parse(e);return yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},hv={...$i,transform:Math.round},lF={rotate:Wn,pathRotation:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scale:dl,scaleX:dl,scaleY:dl,scaleZ:dl,skew:Wn,skewX:Wn,skewY:Wn,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:ua,originX:Zx,originY:Zx,originZ:K},$c={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,...lF,zIndex:hv,fillOpacity:ua,strokeOpacity:ua,numOctaves:hv},cF={...$c,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:Bh,WebkitFilter:Bh,mask:$h,WebkitMask:$h},I_=e=>cF[e],uF=new Set([Bh,$h]);function N_(e,t){let n=I_(e);return uF.has(n)||(n=yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const dF=new Set(["auto","none","0"]);function fF(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!dF.has(i)&&Ii(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=N_(n,s)}class hF extends Mm{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(),Em(d))){const h=S_(d,n.current);h!==void 0&&(t[u]=h),u===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!C_.has(r)||t.length!==2)return;const[s,i]=t,o=fv(s),a=fv(i),l=Jx(s),c=Jx(i);if(l!==c&&Ir[r]){this.needsMeasurement=!0;return}if(o!==a)if(av(o)&&av(a))for(let u=0;u<t.length;u++){const d=t[u];typeof d=="string"&&(t[u]=parseFloat(d))}else Ir[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||sF(t[s]))&&r.push(s);r.length&&fF(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=Ir[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]=Ir[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 A_(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 Vh=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gl(e){return Bk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:zm}=e_(queueMicrotask,!1),un={x:!1,y:!1};function M_(){return un.x||un.y}function pF(e){return e==="x"||e==="y"?un[e]?null:(un[e]=!0,()=>{un[e]=!1}):un.x||un.y?null:(un.x=un.y=!0,()=>{un.x=un.y=!1})}function L_(e,t){const n=A_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function mF(e){return!(e.pointerType==="touch"||M_())}function gF(e,t,n={}){const[r,s,i]=L_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",m)},d=w=>{c&&(c(w),c=void 0),u()},h=w=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(w))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=w=>{if(w.pointerType!=="touch"){if(a){l=!0;return}d(w)}},y=w=>{if(!mF(w))return;l=!1;const g=t(o,w);typeof g=="function"&&(c=g,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",p,s)}),i}const D_=(e,t)=>t?e===t?!0:D_(e,t.parentElement):!1,Bm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xF(e){return yF.has(e.tagName)||e.isContentEditable===!0}const vF=new Set(["INPUT","SELECT","TEXTAREA"]);function wF(e){return vF.has(e.tagName)||e.isContentEditable===!0}const Kl=new WeakSet;function pv(e){return t=>{t.key==="Enter"&&e(t)}}function Gd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const bF=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=pv(()=>{if(Kl.has(n))return;Gd(n,"down");const s=pv(()=>{Gd(n,"up")}),i=()=>Gd(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 mv(e){return Bm(e)&&!M_()}const gv=new WeakSet;function kF(e,t,n={}){const[r,s,i]=L_(e,n),o=a=>{const l=a.currentTarget;if(!mv(a)||gv.has(a))return;Kl.add(l),n.stopPropagation&&gv.add(a);const c=t(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),Kl.has(l)&&Kl.delete(l),mv(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||D_(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),Gl(a)&&(a.addEventListener("focus",c=>bF(c,s)),!xF(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function $m(e){return Bk(e)&&"ownerSVGElement"in e}const Ql=new WeakMap;let xr;const F_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:$m(r)&&"getBBox"in r?r.getBBox()[t]:r[n],_F=F_("inline","width","offsetWidth"),SF=F_("block","height","offsetHeight");function CF({target:e,borderBoxSize:t}){var n;(n=Ql.get(e))==null||n.forEach(r=>{r(e,{get width(){return _F(e,t)},get height(){return SF(e,t)}})})}function PF(e){e.forEach(CF)}function jF(){typeof ResizeObserver>"u"||(xr=new ResizeObserver(PF))}function EF(e,t){xr||jF();const n=A_(e);return n.forEach(r=>{let s=Ql.get(r);s||(s=new Set,Ql.set(r,s)),s.add(t),xr==null||xr.observe(r)}),()=>{n.forEach(r=>{const s=Ql.get(r);s==null||s.delete(t),s!=null&&s.size||xr==null||xr.unobserve(r)})}}const ql=new Set;let ci;function TF(){ci=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ql.forEach(t=>t(e))},window.addEventListener("resize",ci)}function RF(e){return ql.add(e),ci||TF(),()=>{ql.delete(e),!ql.size&&typeof ci=="function"&&(window.removeEventListener("resize",ci),ci=void 0)}}function yv(e,t){return typeof e=="function"?RF(e):EF(e,t)}function IF(e){return $m(e)&&e.tagName==="svg"}const NF=[...R_,Oe,yn],AF=e=>NF.find(T_(e)),xv=()=>({translate:0,scale:1,origin:0,originPoint:0}),ui=()=>({x:xv(),y:xv()}),vv=()=>({min:0,max:0}),Be=()=>({x:vv(),y:vv()}),MF=new WeakMap;function ku(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function da(e){return typeof e=="string"||Array.isArray(e)}const Vm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Um=["initial",...Vm];function _u(e){return ku(e.animate)||Um.some(t=>da(e[t]))}function O_(e){return!!(_u(e)||e.variants)}function LF(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Ye(s))e.addValue(r,s);else if(Ye(i))e.addValue(r,Ni(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,Ni(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vc={current:null},Wm={current:!1},DF=typeof window<"u";function z_(){if(Wm.current=!0,!!DF)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Vc.current=e.matches;e.addEventListener("change",t),t()}else Vc.current=!1}const wv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Uc={};function B_(e){Uc=e}function FF(){return Uc}class OF{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=Mm,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=lt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ge.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=_u(n),this.isVariantNode=O_(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&&Ye(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,MF.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:(Wm.current||z_(),this.shouldReduceMotion=Vc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Gr(this.notifyUpdate),Gr(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&&b_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,d=new v_({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Dt(u)}),h=o(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const r=Ui.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Uc){const n=Uc[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Be()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<wv.length;r++){const s=wv[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=LF(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=Ni(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"&&(zk(r)||$k(r))?r=parseFloat(r):!AF(r)&&yn.test(n)&&(r=N_(t,n)),this.setBaseTarget(t,Ye(r)?r.get():r)),Ye(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=Fm(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&&!Ye(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 Cm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zm.render(this.render)}}class $_ extends OF{constructor(){super(...arguments),this.KeyframeResolver=hF}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;Ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function V_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function BF(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 Kd(e){return e===void 0||e===1}function Uh({scale:e,scaleX:t,scaleY:n}){return!Kd(e)||!Kd(t)||!Kd(n)}function cs(e){return Uh(e)||U_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function U_(e){return bv(e.x)||bv(e.y)}function bv(e){return e&&e!=="0%"}function Wc(e,t,n){const r=e-n,s=t*r;return n+s}function kv(e,t,n,r,s){return s!==void 0&&(e=Wc(e,s,r)),Wc(e,n,r)+t}function Wh(e,t=0,n=1,r,s){e.min=kv(e.min,t,n,r,s),e.max=kv(e.max,t,n,r,s)}function W_(e,{x:t,y:n}){Wh(e.x,t.translate,t.scale,t.originPoint),Wh(e.y,n.translate,n.scale,n.originPoint)}const _v=.999999999999,Sv=1.0000000000001;function $F(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&&(Tn(e.x,-i.scroll.offset.x),Tn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,W_(e,o)),r&&cs(i.latestValues)&&Yl(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<Sv&&t.x>_v&&(t.x=1),t.y<Sv&&t.y>_v&&(t.y=1)}function Tn(e,t){e.min+=t,e.max+=t}function Cv(e,t,n,r,s=.5){const i=me(e.min,e.max,s);Wh(e,t,n,i,r)}function Pv(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Yl(e,t,n){const r=n??e;Cv(e.x,Pv(t.x,r.x),t.scaleX,t.scale,t.originX),Cv(e.y,Pv(t.y,r.y),t.scaleY,t.scale,t.originY)}function H_(e,t){return V_(BF(e.getBoundingClientRect(),t))}function VF(e,t,n){const r=H_(e,n),{scroll:s}=t;return s&&(Tn(r.x,s.offset.x),Tn(r.y,s.offset.y)),r}const UF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},WF=Vi.length;function HF(e,t,n){let r="",s=!0;for(let o=0;o<WF;o++){const a=Vi[o],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const u=parseFloat(l);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Vh(l,$c[a]);if(!c){s=!1;const d=UF[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${Vh(i,$c.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Hm(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Ui.has(l)){o=!0;continue}else if(n_(l)){s[l]=c;continue}else{const u=Vh(c,$c[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=HF(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 G_(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 jv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(K.test(e))e=parseFloat(e);else return e;const n=jv(e,t.target.x),r=jv(e,t.target.y);return`${n}% ${r}%`}},GF={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=yn.parse(e);if(s.length>5)return r;const i=yn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=me(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},Hh={borderRadius:{...mo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mo,borderTopRightRadius:mo,borderBottomLeftRadius:mo,borderBottomRightRadius:mo,boxShadow:GF};function K_(e,{layout:t,layoutId:n}){return Ui.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Hh[e]||e==="opacity")}function Gm(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)(Ye(r[a])||s&&Ye(s[a])||K_(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function KF(e){return window.getComputedStyle(e)}class QF extends $_{constructor(){super(...arguments),this.type="html",this.renderInstance=G_}readValueFromInstance(t,n){var r;if(Ui.has(n))return(r=this.projection)!=null&&r.isProjecting?Ih(n):m3(t,n);{const s=KF(t),i=(n_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return H_(t,n)}build(t,n,r){Hm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Gm(t,n,r)}}const qF={offset:"stroke-dashoffset",array:"stroke-dasharray"},YF={offset:"strokeDashoffset",array:"strokeDasharray"};function XF(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?qF:YF;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const JF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Q_(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,u){if(Hm(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 JF)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&&XF(d,s,i,o,!1)}const q_=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"]),Y_=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ZF(e,t,n,r){G_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(q_.has(s)?s:Om(s),t.attrs[s])}function X_(e,t,n){const r=Gm(e,t,n);for(const s in e)if(Ye(e[s])||Ye(t[s])){const i=Vi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class eO extends $_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Be}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ui.has(n)){const r=I_(n);return r&&r.default||0}return n=q_.has(n)?n:Om(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return X_(t,n,r)}build(t,n,r){Q_(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){ZF(t,n,r,s)}mount(t){this.isSVGTag=Y_(t.tagName),super.mount(t)}}const tO=Um.length;function J_(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?J_(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<tO;n++){const r=Um[n],s=e.props[r];(da(s)||s===!1)&&(t[r]=s)}return t}function Z_(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 nO=[...Vm].reverse(),rO=Vm.length;function sO(e){return t=>Promise.all(t.map(({animation:n,options:r})=>nF(e,n,r)))}function iO(e){let t=sO(e),n=Ev(),r=!0,s=!1;const i=c=>(u,d)=>{var p;const h=Ss(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:m,transitionEnd:y,...w}=h;u={...u,...w,...y}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=J_(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let g=0;g<rO;g++){const x=nO[g],v=n[x],b=u[x]!==void 0?u[x]:d[x],S=da(b),k=x===c?v.isActive:null;k===!1&&(y=g);let j=b===d[x]&&b!==u[x]&&S;if(j&&(r||s)&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...m},!v.isActive&&k===null||!b&&!v.prevProp||ku(b)||typeof b=="boolean")continue;if(x==="exit"&&v.isActive&&k!==!0){v.prevResolvedValues&&(m={...m,...v.prevResolvedValues});continue}const E=oO(v.prevProp,b);let R=E||x===c&&v.isActive&&!j&&S||g>y&&S,T=!1;const N=Array.isArray(b)?b:[b];let A=N.reduce(i(x),{});k===!1&&(A={});const{prevResolvedValues:O={}}=v,z={...O,...A},P=M=>{R=!0,p.has(M)&&(T=!0,p.delete(M)),v.needsAnimating[M]=!0;const $=e.getValue(M);$&&($.liveStyle=!1)};for(const M in z){const $=A[M],C=O[M];if(m.hasOwnProperty(M))continue;let V=!1;Fh($)&&Fh(C)?V=!Z_($,C)||E:V=$!==C,V?$!=null?P(M):p.add(M):$!==void 0&&p.has(M)?P(M):v.protectedKeys[M]=!0}v.prevProp=b,v.prevResolvedValues=A,v.isActive&&(m={...m,...A}),(r||s)&&e.blockInitialAnimation&&(R=!1);const L=j&&E;R&&(!L||T)&&h.push(...N.map(M=>{const $={type:x};if(typeof M=="string"&&(r||s)&&!L&&e.manuallyAnimateOnMount&&e.parent){const{parent:C}=e,V=Ss(C,M);if(C.enteringChildren&&V){const{delayChildren:Q}=V.transition||{};$.delay=k_(C.enteringChildren,e,Q)}}return{animation:M,options:$}}))}if(p.size){const g={};if(typeof u.initial!="boolean"){const x=Ss(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(g.transition=x.transition)}p.forEach(x=>{const v=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),g[x]=v??null}),h.push({animation:g})}let w=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?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=Ev(),s=!0}}}function oO(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Z_(t,e):!1}function rs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ev(){return{animate:rs(!0),whileInView:rs(),whileHover:rs(),whileTap:rs(),whileDrag:rs(),whileFocus:rs(),exit:rs()}}function Gh(e,t){e.min=t.min,e.max=t.max}function on(e,t){Gh(e.x,t.x),Gh(e.y,t.y)}function Tv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const eS=1e-4,aO=1-eS,lO=1+eS,tS=.01,cO=0-tS,uO=0+tS;function ct(e){return e.max-e.min}function dO(e,t,n){return Math.abs(e-t)<=n}function Rv(e,t,n,r=.5){e.origin=r,e.originPoint=me(t.min,t.max,e.origin),e.scale=ct(n)/ct(t),e.translate=me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=aO&&e.scale<=lO||isNaN(e.scale))&&(e.scale=1),(e.translate>=cO&&e.translate<=uO||isNaN(e.translate))&&(e.translate=0)}function zo(e,t,n,r){Rv(e.x,t.x,n.x,r?r.originX:void 0),Rv(e.y,t.y,n.y,r?r.originY:void 0)}function Iv(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ct(t)}function fO(e,t,n,r){Iv(e.x,t.x,n.x,r==null?void 0:r.x),Iv(e.y,t.y,n.y,r==null?void 0:r.y)}function Nv(e,t,n,r=0){const s=r?me(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ct(t)}function Hc(e,t,n,r){Nv(e.x,t.x,n.x,r==null?void 0:r.x),Nv(e.y,t.y,n.y,r==null?void 0:r.y)}function Av(e,t,n,r,s){return e-=t,e=Wc(e,1/n,r),s!==void 0&&(e=Wc(e,1/s,r)),e}function hO(e,t=0,n=1,r=.5,s,i=e,o=e){if(Mn.test(t)&&(t=parseFloat(t),t=me(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=me(i.min,i.max,r);e===i&&(a-=t),e.min=Av(e.min,t,n,a,s),e.max=Av(e.max,t,n,a,s)}function Mv(e,t,[n,r,s],i,o){hO(e,t[n],t[r],t[s],t.scale,i,o)}const pO=["x","scaleX","originX"],mO=["y","scaleY","originY"];function Lv(e,t,n,r){Mv(e.x,t,pO,n?n.x:void 0,r?r.x:void 0),Mv(e.y,t,mO,n?n.y:void 0,r?r.y:void 0)}function Dv(e){return e.translate===0&&e.scale===1}function nS(e){return Dv(e.x)&&Dv(e.y)}function Fv(e,t){return e.min===t.min&&e.max===t.max}function gO(e,t){return Fv(e.x,t.x)&&Fv(e.y,t.y)}function Ov(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rS(e,t){return Ov(e.x,t.x)&&Ov(e.y,t.y)}function zv(e){return ct(e.x)/ct(e.y)}function Bv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function jn(e){return[e("x"),e("y")]}function yO(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:y}=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) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const sS=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],xO=sS.length,$v=e=>typeof e=="string"?parseFloat(e):e,Vv=e=>typeof e=="number"||K.test(e);function vO(e,t,n,r,s,i){s?(e.opacity=me(0,n.opacity??1,wO(r)),e.opacityExit=me(t.opacity??1,0,bO(r))):i&&(e.opacity=me(t.opacity??1,n.opacity??1,r));for(let o=0;o<xO;o++){const a=sS[o];let l=Uv(t,a),c=Uv(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Vv(l)===Vv(c)?(e[a]=Math.max(me($v(l),$v(c),r),0),(Mn.test(c)||Mn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=me(t.rotate||0,n.rotate||0,r))}function Uv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const wO=iS(0,.5,Yk),bO=iS(.5,.95,Jt);function iS(e,t,n){return r=>r<e?0:r>t?1:n(ca(e,t,r))}function kO(e,t,n){const r=Ye(e)?e:Ni(e);return r.start(Dm("",r,t,n)),r.animation}function fa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const _O=(e,t)=>e.depth-t.depth;class SO{constructor(){this.children=[],this.isDirty=!1}add(t){_m(this.children,t),this.isDirty=!0}remove(t){Dc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_O),this.isDirty=!1,this.children.forEach(t)}}function CO(e,t){const n=lt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Gr(r),e(i-t))};return ge.setup(r,!0),()=>Gr(r)}function Xl(e){return Ye(e)?e.get():e}class PO{constructor(){this.members=[]}add(t){_m(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Dc(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Dc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Jl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qd=["","X","Y","Z"],jO=1e3;let EO=0;function qd(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function oS(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=j_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&oS(r)}function aS({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=EO++,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(IO),this.nodes.forEach(FO),this.nodes.forEach(OO),this.nodes.forEach(NO)},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 SO)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Cm),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=$m(o)&&!IF(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;ge.read(()=>{d=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=CO(h,250),Jl.hasAnimatedSinceResize&&(Jl.hasAnimatedSinceResize=!1,this.nodes.forEach(Gv)))})}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()||UO,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=c.getProps(),g=!this.targetLayout||!rS(this.targetLayout,p),x=!d&&h;if(this.options.layoutRoot||this.resumeFrom||x||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Lm(m,"layout"),onPlay:y,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x,v.path)}else d||Gv(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(),Gr(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(zO),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&&oS(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(MO),this.nodes.forEach(Wv);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(LO),this.nodes.forEach(DO),this.nodes.forEach(TO),this.nodes.forEach(RO)):this.nodes.forEach(Hv),this.clearAllSnapshots();const a=lt.now();qe.delta=Dn(0,1e3/60,a-qe.timestamp),qe.timestamp=a,qe.isProcessing=!0,Bd.update.process(qe),Bd.preRender.process(qe),Bd.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AO),this.sharedNodes.forEach(BO)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ct(this.snapshot.measuredBox.x)&&!ct(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Be()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!nS(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||cs(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),WO(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return Be();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(HO))){const{scroll:u}=this.root;u&&(Tn(a.x,u.offset.x),Tn(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=Be();if(on(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&&on(a,o),Tn(a.x,d.offset.x),Tn(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l){var u,d;const c=l||Be();on(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&&(Tn(c.x,-p.scroll.offset.x),Tn(c.y,-p.scroll.offset.y)),cs(p.latestValues)&&Yl(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return cs(this.latestValues)&&Yl(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(o){var l;const a=Be();on(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!cs(u.latestValues))continue;let d;u.instance&&(Uh(u.latestValues)&&u.updateSnapshot(),d=Be(),on(d,u.measurePageBox())),Lv(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,d)}return cs(this.latestValues)&&Lv(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!==qe.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=qe.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=Be(),this.targetWithTransforms=Be()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fO(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):on(this.target,this.layout.layoutBox),W_(this.target,this.targetDelta)):on(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||Uh(this.parent.latestValues)||U_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Be(),this.relativeTargetOrigin=Be(),Hc(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),on(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===qe.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;on(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;$F(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Be());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Tv(this.prevProjectionDelta.x,this.projectionDelta.x),Tv(this.prevProjectionDelta.y,this.projectionDelta.y)),zo(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Bv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bv(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=ui(),this.projectionDelta=ui(),this.projectionDeltaWithTransform=ui()}setAnimationOrigin(o,a=!1,l){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=ui();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Be(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,g=this.getStack(),x=!g||g.members.length<=1,v=!!(w&&!x&&this.options.crossfade===!0&&!this.path.some(VO));this.animationProgress=0;let b;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=k=>{const j=k/1e3,E=S==null?void 0:S(j);E?(h.x.translate=E.x,h.x.scale=me(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=me(o.y.scale,1,j),h.y.origin=o.y.origin,h.y.originPoint=o.y.originPoint):(Kv(h.x,o.x,j),Kv(h.y,o.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),$O(this.relativeTarget,this.relativeTargetOrigin,p,j),b&&gO(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Be()),on(b,this.relativeTarget)),w&&(this.animationValues=d,vO(d,u,this.latestValues,j,v,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&&(Gr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Jl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ni(0)),this.motionValue.jump(0,!1),this.currentAnimation=kO(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(jO),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&&lS(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Be();const d=ct(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ct(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}on(a,l),Yl(a,u),zo(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new PO),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&qd("z",o,c,this.animationValues);for(let u=0;u<Qd.length;u++)qd(`rotate${Qd[u]}`,o,c,this.animationValues),qd(`skew${Qd[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Xl(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Xl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!cs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=yO(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 Hh){if(u[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:g}=Hh[m],x=d==="none"?u[m]:y(u[m],c);if(w){const v=w.length;for(let b=0;b<v;b++)o[w[b]]=x}else g?this.options.visualElement.renderState.vars[m]=x:o[m]=x}this.options.layoutId&&(o.pointerEvents=c===this?Xl(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Wv),this.root.sharedNodes.clear()}}}function TO(e){e.updateLayout()}function RO(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")jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(h);h.min=r[d].min,h.max=h.min+p});else if(i==="x"||i==="y"){const d=i==="x"?"y":"x";Gh(o?t.measuredBox[d]:t.layoutBox[d],r[d])}else lS(i,t.layoutBox,r)&&jn(d=>{const h=o?t.measuredBox[d]:t.layoutBox[d],p=ct(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=ui();zo(a,r,t.layoutBox);const l=ui();o?zo(l,e.applyTransform(s,!0),t.measuredBox):zo(l,r,t.layoutBox);const c=!nS(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,y=Be();Hc(y,t.layoutBox,h.layoutBox,m);const w=Be();Hc(w,r,p.layoutBox,m),rS(y,w)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,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 IO(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 NO(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AO(e){e.clearSnapshot()}function Wv(e){e.clearMeasurements()}function MO(e){e.isLayoutDirty=!0,e.updateLayout()}function Hv(e){e.isLayoutDirty=!1}function LO(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function DO(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function FO(e){e.resolveTargetDelta()}function OO(e){e.calcProjection()}function zO(e){e.resetSkewAndRotation()}function BO(e){e.removeLeadSnapshot()}function Kv(e,t,n){e.translate=me(t.translate,0,n),e.scale=me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Qv(e,t,n,r){e.min=me(t.min,n.min,r),e.max=me(t.max,n.max,r)}function $O(e,t,n,r){Qv(e.x,t.x,n.x,r),Qv(e.y,t.y,n.y,r)}function VO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const UO={duration:.45,ease:[.4,0,.1,1]},qv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Yv=qv("applewebkit/")&&!qv("chrome/")?Math.round:Jt;function Xv(e){e.min=Yv(e.min),e.max=Yv(e.max)}function WO(e){Xv(e.x),Xv(e.y)}function lS(e,t,n){return e==="position"||e==="preserve-aspect"&&!dO(zv(t),zv(n),.2)}function HO(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const GO=aS({attachResizeListener:(e,t)=>fa(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}),Yd={current:void 0},cS=aS({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yd.current){const e=new GO({});e.mount(window),e.setOptions({layoutScroll:!0}),Yd.current=e}return Yd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Km=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Jv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function KO(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Jv(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():Jv(e[s],null)}}}}function QO(...e){return _.useCallback(KO(...e),e)}class qO extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Gl(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Gl(r)&&r.offsetWidth||0,i=Gl(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function YO({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=_.useId(),a=_.useRef(null),l=_.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=_.useContext(Km),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=QO(a,u);return _.useInsertionEffect(()=>{const{width:p,height:m,top:y,left:w,right:g,bottom:x,direction:v}=l.current;if(t||i===!1||!a.current||!p||!m)return;const b=v==="rtl",S=n==="left"?b?`right: ${g}`:`left: ${w}`:b?`left: ${w}`:`right: ${g}`,k=r==="bottom"?`bottom: ${x}`:`top: ${y}`;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(`
71
- [data-motion-pop-id="${o}"] {
72
- position: absolute !important;
73
- width: ${p}px !important;
74
- height: ${m}px !important;
75
- ${S}px !important;
76
- ${k}px !important;
77
- }
78
- `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),E.contains(j)&&E.removeChild(j)}},[t]),f.jsx(qO,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:_.cloneElement(e,{ref:d})})}const XO=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=km(JO),d=_.useId();let h=!0,p=_.useMemo(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:m=>{u.set(m,!0);for(const y of u.values())if(!y)return;r&&r()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,r]);return i&&h&&(p={...p}),_.useMemo(()=>{u.forEach((m,y)=>u.set(y,!1))},[n]),_.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=f.jsx(YO,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),f.jsx(wu.Provider,{value:p,children:e})};function JO(){return new Map}function uS(e=!0){const t=_.useContext(wu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=_.useId();_.useEffect(()=>{if(e)return s(i)},[e]);const o=_.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const fl=e=>e.key||"";function Zv(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const dS=({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]=uS(o),h=_.useMemo(()=>Zv(e),[e]),p=o&&!u?[]:h.map(fl),m=_.useRef(!0),y=_.useRef(h),w=km(()=>new Map),g=_.useRef(new Set),[x,v]=_.useState(h),[b,S]=_.useState(h);Ok(()=>{m.current=!1,y.current=h;for(let E=0;E<b.length;E++){const R=fl(b[E]);p.includes(R)?(w.delete(R),g.current.delete(R)):w.get(R)!==!0&&w.set(R,!1)}},[b,p.length,p.join("-")]);const k=[];if(h!==x){let E=[...h];for(let R=0;R<b.length;R++){const T=b[R],N=fl(T);p.includes(N)||(E.splice(R,0,T),k.push(T))}return i==="wait"&&k.length&&(E=k),S(Zv(E)),v(h),null}const{forceRender:j}=_.useContext(bm);return f.jsx(f.Fragment,{children:b.map(E=>{const R=fl(E),T=o&&!u?!1:h===b||p.includes(R),N=()=>{if(g.current.has(R))return;if(w.has(R))g.current.add(R),w.set(R,!0);else return;let A=!0;w.forEach(O=>{O||(A=!1)}),A&&(j==null||j(),S(y.current),o&&(d==null||d()),r&&r())};return f.jsx(XO,{isPresent:T,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:T?void 0:N,anchorX:a,anchorY:l,children:E},R)})})},fS=_.createContext({strict:!1}),e0={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 t0=!1;function ZO(){if(t0)return;const e={};for(const t in e0)e[t]={isEnabled:n=>e0[t].some(r=>!!n[r])};B_(e),t0=!0}function hS(){return ZO(),FF()}function ez(e){const t=hS();for(const n in e)t[n]={...t[n],...e[n]};B_(t)}const tz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Gc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tz.has(e)}let pS=e=>!Gc(e);function nz(e){typeof e=="function"&&(pS=t=>t.startsWith("on")?!Gc(t):e(t))}try{nz(require("@emotion/is-prop-valid").default)}catch{}function rz(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ye(e[s])||(pS(s)||n===!0&&Gc(s)||!t&&!Gc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Su=_.createContext({});function sz(e,t){if(_u(e)){const{initial:n,animate:r}=e;return{initial:n===!1||da(n)?n:void 0,animate:da(r)?r:void 0}}return e.inherit!==!1?t:{}}function iz(e){const{initial:t,animate:n}=sz(e,_.useContext(Su));return _.useMemo(()=>({initial:t,animate:n}),[n0(t),n0(n)])}function n0(e){return Array.isArray(e)?e.join(" "):e}const Qm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mS(e,t,n){for(const r in t)!Ye(t[r])&&!K_(r,n)&&(e[r]=t[r])}function oz({transformTemplate:e},t){return _.useMemo(()=>{const n=Qm();return Hm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function az(e,t){const n=e.style||{},r={};return mS(r,n,e),Object.assign(r,oz(e,t)),r}function lz(e,t){const n={},r=az(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 gS=()=>({...Qm(),attrs:{}});function cz(e,t,n,r){const s=_.useMemo(()=>{const i=gS();return Q_(i,t,Y_(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};mS(i,e.style,e),s.style={...i,...s.style}}return s}const uz=["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 qm(e){return typeof e!="string"||e.includes("-")?!1:!!(uz.indexOf(e)>-1||/[A-Z]/u.test(e))}function dz(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??qm(e)?cz:lz)(t,r,s,e),c=rz(t,typeof e=="string",i),u=e!==_.Fragment?{...c,...l,ref:n}:{},{children:d}=t,h=_.useMemo(()=>Ye(d)?d.get():d,[d]);return _.createElement(e,{...u,children:h})}function fz({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:hz(n,r,s,e),renderState:t()}}function hz(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Xl(i[h]);let{initial:o,animate:a}=e;const l=_u(e),c=O_(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"&&!ku(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const m=Fm(e,h[p]);if(m){const{transitionEnd:y,transition:w,...g}=m;for(const x in g){let v=g[x];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(s[x]=v)}for(const x in y)s[x]=y[x]}}}return s}const yS=e=>(t,n)=>{const r=_.useContext(Su),s=_.useContext(wu),i=()=>fz(e,t,r,s);return n?i():km(i)},pz=yS({scrapeMotionValuesFromProps:Gm,createRenderState:Qm}),mz=yS({scrapeMotionValuesFromProps:X_,createRenderState:gS}),gz=Symbol.for("motionComponentSymbol");function yz(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.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 xS=_.createContext({});function Qs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xz(e,t,n,r,s,i){var v,b;const{visualElement:o}=_.useContext(Su),a=_.useContext(fS),l=_.useContext(wu),c=_.useContext(Km),u=c.reducedMotion,d=c.skipAnimations,h=_.useRef(null),p=_.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,y=_.useContext(xS);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&vz(h.current,n,s,y);const w=_.useRef(!1);_.useInsertionEffect(()=>{m&&w.current&&m.update(n,l)});const g=n[P_],x=_.useRef(!!g&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return Ok(()=>{p.current=!0,m&&(w.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,g)}),x.current=!1),m.enteringChildren=void 0)}),m}function vz(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:vS(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Qs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function vS(e){if(e)return e.options.allowProjection!==!1?e.projection:vS(e.parent)}function Xd(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&ez(r);const i=n?n==="svg":qm(e),o=i?mz:pz;function a(c,u){let d;const h={..._.useContext(Km),...c,layoutId:wz(c)},{isStatic:p}=h,m=iz(c),y=o(c,p);if(!p&&typeof window<"u"){bz();const w=kz(h);d=w.MeasureLayout,m.visualElement=xz(e,y,h,s,w.ProjectionNode,i)}return f.jsxs(Su.Provider,{value:m,children:[d&&m.visualElement?f.jsx(d,{visualElement:m.visualElement,...h}):null,dz(e,c,yz(y,m.visualElement,u),y,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=_.forwardRef(a);return l[gz]=e,l}function wz({layoutId:e}){const t=_.useContext(bm).id;return t&&e!==void 0?t+"-"+e:e}function bz(e,t){_.useContext(fS).strict}function kz(e){const t=hS(),{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 _z(e,t){if(typeof Proxy>"u")return Xd;const n=new Map,r=(i,o)=>Xd(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,Xd(o,void 0,e,t)),n.get(o))})}const Sz=(e,t)=>t.isSVG??qm(e)?new eO(t):new QF(t,{allowProjection:e!==_.Fragment});class Cz extends Zr{constructor(t){super(t),t.animationState||(t.animationState=iO(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ku(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 Pz=0;class jz extends Zr{constructor(){super(...arguments),this.id=Pz++,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=Ss(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 Ez={animation:{Feature:Cz},exit:{Feature:jz}};function Sa(e){return{point:{x:e.pageX,y:e.pageY}}}const Tz=e=>t=>Bm(t)&&e(t,Sa(t));function Bo(e,t,n,r){return fa(e,t,Tz(n),r)}const wS=({current:e})=>e?e.ownerDocument.defaultView:null,r0=(e,t)=>Math.abs(e-t);function Rz(e,t){const n=r0(e.x,t.x),r=r0(e.y,t.y);return Math.sqrt(n**2+r**2)}const s0=new Set(["auto","scroll"]);class bS{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=hl(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Jd(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=Rz(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:w}=p,{timestamp:g}=qe;this.history.push({...w,timestamp:g});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=hl(m,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:w,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Jd(p.type==="pointercancel"?this.lastMoveEventInfo:hl(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,x),w&&w(p,x)},!Bm(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Sa(t),c=hl(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=qe;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=n;h&&h(t,Jd(c,this.history)),this.removeListeners=ba(Bo(this.contextWindow,"pointermove",this.handlePointerMove),Bo(this.contextWindow,"pointerup",this.handlePointerUp),Bo(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(s0.has(r.overflowX)||s0.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),ge.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gr(this.updatePoint)}}function hl(e,t){return t?{point:t(e.point)}:e}function i0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jd({point:e},t){return{point:e,delta:i0(e,kS(t)),offset:i0(e,Iz(t)),velocity:Nz(t,.1)}}function Iz(e){return e[0]}function kS(e){return e[e.length-1]}function Nz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=kS(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Dt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Dt(t)*2&&(r=e[1]);const i=Yt(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 Az(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?me(n,e,r.max):Math.min(e,n)),e}function o0(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 Mz(e,{top:t,left:n,bottom:r,right:s}){return{x:o0(e.x,n,s),y:o0(e.y,t,r)}}function a0(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 Lz(e,t){return{x:a0(e.x,t.x),y:a0(e.y,t.y)}}function Dz(e,t){let n=.5;const r=ct(e),s=ct(t);return s>r?n=ca(t.min,t.max-r,e.min):r>s&&(n=ca(e.min,e.max-s,t.min)),Dn(0,1,n)}function Fz(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 Kh=.35;function Oz(e=Kh){return e===!1?e=0:e===!0&&(e=Kh),{x:l0(e,"left","right"),y:l0(e,"top","bottom")}}function l0(e,t,n){return{min:c0(e,t),max:c0(e,n)}}function c0(e,t){return typeof e=="number"?e:e[t]||0}const zz=new WeakMap;class Bz{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{n&&this.snapToCursor(Sa(d).point),this.stopAnimation()},o=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pF(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),jn(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Mn.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[g];b&&(x=ct(b)*(parseFloat(x)/100))}}this.originPoint[g]=x}),y&&ge.update(()=>y(d,h),!1,!0),Oh(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:g}=h;if(m&&this.currentDirection===null){this.currentDirection=Vz(g),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,g),this.updateAxis("y",h.point,g),this.visualElement.render(),w&&ge.update(()=>w(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 bS(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:wS(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&&ge.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||!pl(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Az(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Qs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Mz(r.layoutBox,t):this.constraints=!1,this.elastic=Oz(n),s!==this.constraints&&!Qs(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&jn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Fz(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Qs(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=VF(r,s.root,this.visualElement.getTransformPagePoint());let o=Lz(s.layout.layoutBox,i);if(n){const a=n(zF(o));this.hasMutatedConstraints=!!a,a&&(o=V_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=jn(u=>{if(!pl(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 Oh(this.visualElement,t),r.start(Dm(t,r,0,n,this.visualElement,!1))}stopAnimation(){jn(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){jn(n=>{const{drag:r}=this.getProps();if(!pl(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]-me(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Qs(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};jn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=Dz({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(),jn(o=>{if(!pl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(me(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;zz.set(this.visualElement,this);const t=this.visualElement.current,n=Bo(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&wF(h);u&&d&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Qs(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=$z(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ge.read(s);const a=fa(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(jn(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=Kh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function u0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function $z(e,t,n){const r=yv(e,u0(n)),s=yv(t,u0(n));return()=>{r(),s()}}function pl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Vz(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Uz extends Zr{constructor(t){super(t),this.removeGroupControls=Jt,this.removeListeners=Jt,this.controls=new Bz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Jt}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 Zd=e=>(t,n)=>{e&&ge.update(()=>e(t,n),!1,!0)};class Wz extends Zr{constructor(){super(...arguments),this.removePointerDownListener=Jt}onPointerDown(t){this.session=new bS(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wS(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Zd(t),onStart:Zd(n),onMove:Zd(r),onEnd:(i,o)=>{delete this.session,s&&ge.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Bo(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 ef=!1;class Hz extends _.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),ef&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),ef=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ge.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(),zm.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ef=!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 _S(e){const[t,n]=uS(),r=_.useContext(bm);return f.jsx(Hz,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(xS),isPresent:t,safeToRemove:n})}const Gz={pan:{Feature:Wz},drag:{Feature:Uz,ProjectionNode:cS,MeasureLayout:_S}};function d0(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&&ge.postRender(()=>i(t,Sa(t)))}class Kz extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=gF(t,(n,r)=>(d0(this.node,r,"Start"),s=>d0(this.node,s,"End"))))}unmount(){}}class Qz extends Zr{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=ba(fa(this.node.current,"focus",()=>this.onFocus()),fa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f0(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&&ge.postRender(()=>i(t,Sa(t)))}class qz extends Zr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=kF(t,(s,i)=>(f0(this.node,i,"Start"),(o,{success:a})=>f0(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Qh=new WeakMap,tf=new WeakMap,Yz=e=>{const t=Qh.get(e.target);t&&t(e)},Xz=e=>{e.forEach(Yz)};function Jz({root:e,...t}){const n=e||document;tf.has(n)||tf.set(n,{});const r=tf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Xz,{root:e,...t})),r[s]}function Zz(e,t,n){const r=Jz(t);return Qh.set(e,n),r.observe(e),()=>{Qh.delete(e),r.unobserve(e)}}const eB={some:0,all:1};class tB extends Zr{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:eB[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=Zz(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(nB(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function nB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rB={inView:{Feature:tB},tap:{Feature:qz},focus:{Feature:Qz},hover:{Feature:Kz}},sB={layout:{ProjectionNode:cS,MeasureLayout:_S}},iB={...Ez,...rB,...Gz,...sB},Ai=_z(iB,Sz);function Cu(){!Wm.current&&z_();const[e]=_.useState(Vc.current);return e}function Pu(e,t){const n=_.useRef(t);n.current=t,_.useEffect(()=>{if(!e)return;const r=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}const nf={stackPanelWidth:480,navIslandBottom:"1.5rem",navIslandHeight:"4.5rem"},X={bgBase:"#FDFCF8",bgSurface:"#FAF8F0",bgElevated:"#F5F1E6",textPrimary:"#1A1917",textSecondary:"#68635C",accentBlue:"#7C9CC0",accentBlueDark:"#51719B",accentGreen:"#8FB996",accentGreenDark:"#5E8A66",accentAmber:"#D4A373",accentAmberDark:"#A67B4F",accentRose:"#C98B8B",accentRoseDark:"#9E5E5E",accentSlate:"#8A9BA8",accentSlateDark:"#5E7080",canvasBase:"#F0EAD8",canvas300:"#E5DBC4",canvasDark:"#D6C9A8",washBlue:"#DEE4E5",washGreen:"#E3EADC",washAmber:"#F2E5D5",washRose:"#EFE0DA",washSlate:"#E1E4E0",chalkboardBg:"#142e22",chalkboardChalk:"#d4e8cb",chalkboardBorderBase:"#C8D2C3"};function nt(e,t){const n=e.replace("#",""),r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}const oB={4:"1rem"};function q(...e){return GL(pL(e))}const aB={height:32,lineHeight:"32px",padding:"0 16px"},lB={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")`},cB={white:X.bgBase,paper:X.bgSurface,speckle:X.bgSurface,parchment:X.bgElevated,canvas:X.canvasBase,kraft:X.canvas300,chalkboard:X.chalkboardBg},h0={white:X.bgElevated,paper:X.bgElevated,speckle:X.bgElevated,parchment:X.canvasBase,canvas:X.canvas300,kraft:X.canvasDark,chalkboard:X.chalkboardBg},uB={base:X.bgBase,surface:X.bgSurface,elevated:X.bgElevated,canvas:X.canvasBase,canvasDark:X.canvasDark,blue:X.washBlue,green:X.washGreen,amber:X.washAmber,rose:X.washRose,slate:X.washSlate},dB={blue:"rgba(168, 200, 216, 0.35)",brown:"rgba(164, 144, 120, 0.35)",black:"rgba(61, 53, 43, 0.15)"};function SS(e){const t=typeof e=="string"?{texture:e}:e,n=t.texture??"paper",r=t.ruledType??"none",s=t.ruledColor??"blue",i=lB[n],o=t.fill?uB[t.fill]:t.shade?h0[n]:cB[n],a=dB[s],l={"--pui-texture-shade":h0[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 Ca(e){return SS(e)}function Wi(e,t="paper"){if(e!==!1)return Ca(e===!0?t:e)}function fB(e){const t=Eu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=8+Math.round(n*6),s=50,i=50,o=46,a=2+n*14,l=[];for(let c=0;c<r;c++){const u=c/r*Math.PI*2+(t()-.5)*.15*n,d=o+(t()-.5)*a*2;l.push({x:s+Math.cos(u)*d,y:i+Math.sin(u)*d})}return ju(l)}function hB(e,t){const n=Eu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=8+Math.round(r*6),i=50,o=50,a=49,l=2+r*14,c=[];for(let u=0;u<s;u++){const 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 ju(c)}function pB(e){const t=Eu((e==null?void 0:e.seed)??Math.random()),n=Math.max(0,Math.min(1,(e==null?void 0:e.wobble)??.5)),r=3+Math.round(n*3),s=2,i=3+n*10,o=[],a=[{ax:s,ay:s,bx:100-s,by:s},{ax:100-s,ay:s,bx:100-s,by:100-s},{ax:100-s,ay:100-s,bx:s,by:100-s},{ax:s,ay:100-s,bx:s,by:s}];for(const l of a)for(let c=0;c<r;c++){const u=(c+.5)/r,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,y=Math.sqrt(p*p+m*m)||1,w=-m/y,g=p/y,x=(t()-.5)*i*2;o.push({x:d+w*x,y:h+g*x})}return ju(o)}function mB(e,t){const n=Eu(`${e}-ring`),r=Math.max(0,Math.min(1,t??.5)),s=3+Math.round(r*3),i=0,o=3+r*10,a=[],l=[{ax:i,ay:i,bx:100-i,by:i},{ax:100-i,ay:i,bx:100-i,by:100-i},{ax:100-i,ay:100-i,bx:i,by:100-i},{ax:i,ay:100-i,bx:i,by:i}];for(const c of l)for(let u=0;u<s;u++){const 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,y=c.by-c.ay,w=Math.sqrt(m*m+y*y)||1,g=-y/w,x=m/w,v=(n()-.5)*o*2;a.push({x:h+g*v,y:p+x*v})}return ju(a)}function ju(e){const t=e.length;if(t<3)return"";let n=`M ${hr(e[0].x)} ${hr(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 ${hr(l)} ${hr(c)}, ${hr(u)} ${hr(d)}, ${hr(o.x)} ${hr(o.y)}`}return n+=" Z",n}function hr(e){return e.toFixed(2)}function Eu(e){let t=typeof e=="string"?gB(e):e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function gB(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)||1}function Tu(){const e=_.useId();return _.useMemo(()=>{let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return(t+1)/4294967296},[e])}function Hi(e){const t=Tu();return _.useMemo(()=>({blob:fB({seed:t,wobble:e}),ring:hB(t,e)}),[t,e])}const yB="button-module__button___Z331g",xB="button-module__blobBg___QQFzf",vB="button-module__blobFill___XwLjV",wB="button-module__blobRing___567UW",bB="button-module__isActive___FXNSJ",kB="button-module__primary___ppbyq",_B="button-module__secondary___esy5L",SB="button-module__ghost___NisA0",CB="button-module__danger___Wnvuq",PB="button-module__chalkboard___d3Nqb",jB="button-module__small___u7y8a",EB="button-module__medium___HBIAj",TB="button-module__large___RPzNy",RB="button-module__fullWidth___H0P0F",IB="button-module__iconLeft___s60SZ",NB="button-module__iconRight___75eFu",AB="button-module__label___pXAyM",Ut={button:yB,blobBg:xB,blobFill:vB,blobRing:wB,isActive:bB,primary:kB,secondary:_B,ghost:SB,danger:CB,chalkboard:PB,small:jB,medium:EB,large:TB,fullWidth:RB,iconLeft:IB,iconRight:NB,label:AB},te=_.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=Hi(o);return f.jsxs("button",{ref:d,type:"button",className:q(Ut.button,Ut[e],Ut[n],t==="chalkboard"&&Ut.chalkboard,a&&Ut.isActive,i&&Ut.fullWidth,c),...u,children:[f.jsxs("svg",{className:Ut.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:h.blob,className:Ut.blobFill}),f.jsx("path",{d:h.ring,className:Ut.blobRing})]}),r&&f.jsx("span",{className:Ut.iconLeft,children:r}),f.jsx("span",{className:Ut.label,children:l}),s&&f.jsx("span",{className:Ut.iconRight,children:s})]})});function Ym(e){return{blue:e.accentBlue,green:e.accentGreen,amber:e.accentAmber,rose:e.accentRose,slate:e.accentSlate}}const Fe=cD.generator(),MB="sketch-border-module__svg___whV4x",LB="sketch-border-module__behind___lgdYV",DB="sketch-border-module__stroke___vAm-v",FB="sketch-border-module__fill___zlpd6",ml={svg:MB,behind:LB,stroke:DB,fill:FB},OB=1.2,zB=.7;function _t({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]=_.useState(Math.random),p=_.useRef(null),[m,y]=_.useState(null);_.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(!v)return;const b=new ResizeObserver(()=>{const S=v.offsetWidth,k=v.offsetHeight;y(j=>j&&j.width===S&&j.height===k?j:{width:S,height:k})});return b.observe(v),()=>b.disconnect()},[]);const{parts:w,clipPath:g}=_.useMemo(()=>{if(!m||m.width<8||m.height<8)return{parts:null,clipPath:null};const x=Math.max(1,Math.round(h*1e6)),v=x,b=x*2654435761%2147483647,S=R=>Fe.toPaths(Fe.path(R,{seed:v,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s})).filter(T=>!T.fill||T.fill==="none").map(T=>({d:T.d,filled:!1}));if(l){const R={seed:v,roughness:n,bowing:r,strokeWidth:s,disableMultiStroke:!0},T=A=>Fe.toPaths(A).filter(O=>!O.fill||O.fill==="none").map(O=>({d:O.d,filled:!1}));if(a){const A=gl(e,m,i,t,ss(b),n*1.1),O=u?p0(s,n):0,z=O?gl(e,m,i+O,t,ss(b),n*1.1):A;return{parts:T(Fe.path(z,{...R,preserveVertices:!0})),clipPath:A}}const N=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,R):Fe.path(rf(m,i,t,ss(v)),{...R,preserveVertices:!0});return{parts:T(N),clipPath:null}}if(a){if(c){const A=rf(m,i,t,ss(b)),O=Fe.toPaths(Fe.path(A,{seed:v,roughness:OB,bowing:zB,preserveVertices:!0,strokeWidth:s})).filter(z=>!z.fill||z.fill==="none").map(z=>({d:z.d,filled:!1}));return{parts:O.length?O:[{d:A,filled:!1}],clipPath:A}}const R=gl(e,m,i,t,ss(b),n*1.1),T=u?p0(s,n):0,N=T?gl(e,m,i+T,t,ss(b),n*1.1):R;return{parts:S(N),clipPath:R}}const k=(R,T)=>{const N=T?{fill:"#000",fillStyle:"solid"}:{},A=e==="circle"?Fe.ellipse(m.width/2,m.height/2,m.width-i*2,m.height-i*2,{seed:R,roughness:n,bowing:r,strokeWidth:s,...N}):Fe.path(rf(m,i,t,ss(R)),{seed:R,roughness:n,bowing:r,preserveVertices:!0,strokeWidth:s,...N});return Fe.toPaths(A)},j=o?k(b,!0).filter(R=>!!R.fill&&R.fill!=="none").map(R=>({d:R.d,filled:!0})):[],E=k(v,!1).filter(R=>!R.fill||R.fill==="none").map(R=>({d:R.d,filled:!1}));return{parts:[...j,...E],clipPath:null}},[m,h,a,l,c,e,t,n,r,s,i,o,u]);return _.useEffect(()=>{var x;const v=(x=p.current)==null?void 0:x.parentElement;if(v)return g?v.style.setProperty("--sketch-clip",`path("${g}")`):v.style.removeProperty("--sketch-clip"),()=>{v.style.removeProperty("--sketch-clip")}},[g]),f.jsx("svg",{ref:p,className:q(ml.svg,o&&ml.behind,d),viewBox:m?`0 0 ${m.width} ${m.height}`:void 0,"aria-hidden":"true",children:w==null?void 0:w.map((x,v)=>x.filled?f.jsx("path",{className:ml.fill,d:x.d},`f-${v}`):f.jsx("path",{className:ml.stroke,d:x.d,strokeWidth:s},`s-${v}`))})}function p0(e,t){return e/2+t*1.5}function ss(e){let t=e;return()=>(t=t*16807%2147483647,(t-1)/2147483646)}function gl(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,y=(x,v,b)=>{for(const S of[0,45,90]){const k=(b+S)*Math.PI/180;d.push({x:x+Math.cos(k)*h+u(),y:v+Math.sin(k)*h+u()})}},w=(x,v,b,S)=>{const k=Math.hypot(b-x,S-v),j=Math.min(12,Math.max(1,Math.round(k/160)));for(let E=1;E<=j;E++){const R=E/(j+1);d.push({x:x+(b-x)*R+u(),y:v+(S-v)*R+u()})}};y(p+h,m+h,180),w(p+h,m,p+o-h,m),y(p+o-h,m+h,270),w(p+o,m+h,p+o,m+a-h),y(p+o-h,m+a-h,0),w(p+o-h,m+a,p+h,m+a),y(p+h,m+a-h,90),w(p,m+a-h,p,m+h);const g=3;return m0([...d.slice(g),...d.slice(0,g)])}return m0(d)}function m0(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)),y=a.y-o.y+u*((l.y-a.y)/d-(l.y-o.y)/(u+d)),w=o.x+h/3,g=o.y+p/3,x=a.x-m/3,v=a.y-y/3;r+=` C ${w.toFixed(2)} ${g.toFixed(2)}, ${x.toFixed(2)} ${v.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`}return`${r} Z`}function rf(e,t,n,r){const s=[0,0,0,0].map(()=>Math.max(2,n+(r()-.5)*3));return BB(t,t,e.width-t*2,e.height-t*2,s)}function BB(e,t,n,r,s){const i=u=>Math.min(u,n/2,r/2),[o,a,l,c]=s.map(i);return[`M ${ye(e+o)} ${ye(t)}`,`L ${ye(e+n-a)} ${ye(t)}`,`Q ${ye(e+n)} ${ye(t)} ${ye(e+n)} ${ye(t+a)}`,`L ${ye(e+n)} ${ye(t+r-l)}`,`Q ${ye(e+n)} ${ye(t+r)} ${ye(e+n-l)} ${ye(t+r)}`,`L ${ye(e+c)} ${ye(t+r)}`,`Q ${ye(e)} ${ye(t+r)} ${ye(e)} ${ye(t+r-c)}`,`L ${ye(e)} ${ye(t+o)}`,`Q ${ye(e)} ${ye(t)} ${ye(e+o)} ${ye(t)}`,"Z"].join(" ")}function ye(e){return e.toFixed(2)}const St={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}},$B="page-module__page___-uHnG",VB="page-module__outlined___Wwtyg",UB="page-module__surface___sWfI6",WB="page-module__flat___HlOaY",HB="page-module__withAccent___lsv-m",GB="page-module__accentBlue___XxbMV",KB="page-module__accentGreen___Ne6Q8",QB="page-module__accentAmber___kLAwa",qB="page-module__accentRose___O9ZbZ",YB="page-module__accentSlate___xCB66",qs={page:$B,outlined:VB,surface:UB,flat:WB,withAccent:HB,accentBlue:GB,accentGreen:KB,accentAmber:QB,accentRose:qB,accentSlate:YB},XB=Ym(qs),JB={all:14,top:14,none:2};function CS({children:e,className:t,style:n,texture:r=!0,withAccent:s=!1,accentColor:i="blue",rounded:o="all",outline:a=!1,sketch:l=!1}){const c=Wi(r,{texture:"white",ruledType:"lines",ruledColor:"blue"})??{backgroundColor:"var(--pui-bg-base)"};return f.jsxs("div",{className:q(qs.page,a&&qs.outlined,s&&qs.withAccent,s&&XB[i],!l&&qs.flat,t),style:n,children:[f.jsx(_t,{clip:!0,...St.surface,radius:JB[o],straight:!l}),f.jsx("div",{className:qs.surface,style:c,children:e})]})}const ZB="layout-module__layout___O1aWi",e4="layout-module__header___I-kxe",t4="layout-module__headerLeft___JChJQ",n4="layout-module__headerTitles___aqSUG",r4="layout-module__headerTitle___wvr39",s4="layout-module__headerSubtitle___6f5BD",i4="layout-module__headerActions___adC12",o4="layout-module__mobileToggle___4WpVG",a4="layout-module__body___tywNf",l4="layout-module__mobileOverlay___tzbBC",c4="layout-module__sidebar___8VKGq",u4="layout-module__sidebarOpen___47rtr",d4="layout-module__sidebarInner___tq2X6",f4="layout-module__logoArea___RLnC0",h4="layout-module__logoText___pAmfV",p4="layout-module__nav___FxcrZ",m4="layout-module__main___9z7bu",g4="layout-module__navIslandFixed___H4TwP",y4="layout-module__content___jL-VB",x4="layout-module__contentWithPage___vVdfN",v4="layout-module__footer___LyakU",w4="layout-module__footerText___8BYxc",Ee={layout:ZB,header:e4,headerLeft:t4,headerTitles:n4,headerTitle:r4,headerSubtitle:s4,headerActions:i4,mobileToggle:o4,body:a4,mobileOverlay:l4,sidebar:c4,sidebarOpen:u4,sidebarInner:d4,logoArea:f4,logoText:h4,nav:p4,main:m4,navIslandFixed:g4,content:y4,contentWithPage:x4,footer:v4,footerText:w4};function b4(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"}:Ca(e)}function k4({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:y,navigationIsland:w,style:g,bleedBottom:x=!0,routeKey:v,stackOpen:b}){const[S,k]=_.useState(!1),j=Cu();Pu(S,()=>k(!1));const E=b4(i),R=r&&d.length>0,T=c!==void 0||u!==void 0?{...u!==void 0?Ca(u):{},...c!==void 0?{height:typeof c=="number"?`${c}px`:c}:{}}:void 0;return f.jsxs("div",{className:Ee.layout,style:{...E,...g},children:[t&&f.jsxs("header",{className:Ee.header,style:T,children:[f.jsxs("div",{className:Ee.headerLeft,children:[R&&f.jsx("button",{type:"button",className:Ee.mobileToggle,onClick:()=>k(!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:Ee.headerTitles,children:[o&&f.jsx("h1",{className:Ee.headerTitle,children:o}),a&&f.jsx("span",{className:Ee.headerSubtitle,children:a})]})]}),l&&f.jsx("div",{className:Ee.headerActions,children:l})]}),f.jsxs("div",{className:Ee.body,children:[S&&f.jsx("button",{type:"button",className:Ee.mobileOverlay,onClick:()=>k(!1),"aria-label":"Close navigation",tabIndex:-1}),R&&f.jsx("aside",{className:q(Ee.sidebar,S&&Ee.sidebarOpen),children:f.jsxs("div",{className:Ee.sidebarInner,children:[f.jsx("div",{className:Ee.logoArea,children:m||f.jsx("span",{className:Ee.logoText,children:"Paper UI"})}),f.jsx("nav",{className:Ee.nav,"aria-label":"Main navigation",children:d.map(N=>{const A=N.id===h;return f.jsx(te,{variant:"ghost",size:"small",isActive:A,onClick:()=>{p==null||p(N),k(!1)},"aria-current":A?"page":void 0,icon:N.icon,style:aB,children:N.label},N.id)})})]})}),f.jsx("div",{className:Ee.main,children:f.jsx("main",{className:s?Ee.contentWithPage:Ee.content,style:x?{paddingBottom:0}:void 0,children:(()=>{const N=v!==void 0?f.jsx(dS,{mode:"wait",children:f.jsx(Ai.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},v)}):e;return s?f.jsx(CS,{rounded:x?"top":"all",style:x&&w?{paddingBottom:`calc(${nf.navIslandBottom} + ${nf.navIslandHeight} + ${oB[4]})`}:void 0,children:N}):N})()})})]}),w&&f.jsx("div",{className:Ee.navIslandFixed,children:b!==void 0?f.jsx(Ai.div,{animate:{x:b?`-${nf.stackPanelWidth/2}px`:0},transition:{duration:j?0:.3,ease:[.4,0,.2,1]},children:w}):w}),n&&f.jsx("footer",{className:Ee.footer,children:y||f.jsx("p",{className:Ee.footerText,children:"Paper UI — Natural Materials Component Library"})})]})}const _4="checkbox-module__wrapper___uLYMI",S4="checkbox-module__blobFill___mPJSR",C4="checkbox-module__input___Ptgt7",P4="checkbox-module__blobBg___bw3sn",j4="checkbox-module__labelLeft___-vAmH",E4="checkbox-module__box___yAh-r",T4="checkbox-module__checkmark___tTyBz",R4="checkbox-module__indeterminateLine___IosI-",I4="checkbox-module__boxWrapper___byjoS",N4="checkbox-module__icon___RO-yn",A4="checkbox-module__labelText___bAnLr",M4="checkbox-module__chalkboard___sv6SL",Rt={wrapper:_4,blobFill:S4,input:C4,blobBg:P4,labelLeft:j4,box:E4,checkmark:T4,indeterminateLine:R4,boxWrapper:I4,icon:N4,labelText:A4,chalkboard:M4},L4=_.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=_.useId(),h=l??d,p=Hi(r),m=_.useRef(null);return _.useEffect(()=>{m.current&&(m.current.indeterminate=n)},[n]),f.jsxs("label",{className:q(Rt.wrapper,t==="left"&&Rt.labelLeft,s==="chalkboard"&&Rt.chalkboard,i),htmlFor:h,children:[f.jsxs("span",{className:Rt.boxWrapper,children:[f.jsx("input",{ref:y=>{m.current=y,typeof u=="function"?u(y):u&&(u.current=y)},id:h,type:"checkbox",className:Rt.input,checked:o,onChange:a,...c}),f.jsx("svg",{className:Rt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:p.blob,className:Rt.blobFill})}),f.jsxs("span",{className:Rt.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,...St.control}),n?f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("line",{x1:"4",y1:"10",x2:"16",y2:"10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:Rt.indeterminateLine})}):f.jsx("svg",{viewBox:"0 0 20 20",fill:"none",className:Rt.icon,children:f.jsx("path",{d:"M4 10 L8 14 L16 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:Rt.checkmark})})]})]}),e&&f.jsx("span",{className:Rt.labelText,children:e})]})}),D4="icon-button-module__iconButton___avg6i",F4="icon-button-module__blobBg___466Vy",O4="icon-button-module__blobFill___FTN1g",z4="icon-button-module__blobRing___hRdQb",B4="icon-button-module__isActive___XlvtM",$4="icon-button-module__icon___h204x",V4="icon-button-module__ghost___Wbxog",U4="icon-button-module__danger___p0Xz5",W4="icon-button-module__small___bPnCU",H4="icon-button-module__medium___nOxPf",G4="icon-button-module__large___UBU5z",K4="icon-button-module__chalkboard___mi0sQ",Vn={iconButton:D4,blobBg:F4,blobFill:O4,blobRing:z4,isActive:B4,icon:$4,default:"icon-button-module__default___9frNR",ghost:V4,danger:U4,small:W4,medium:H4,large:G4,chalkboard:K4},Ct=_.forwardRef(function({icon:e,variant:t="default",surface:n="paper",size:r="medium",label:s,wobble:i=.5,isActive:o=!1,className:a,...l},c){const u=Hi(i);return f.jsxs("button",{ref:c,type:"button",className:q(Vn.iconButton,Vn[t],n==="chalkboard"&&Vn.chalkboard,Vn[r],o&&Vn.isActive,a),"aria-label":s,title:s,...l,children:[f.jsxs("svg",{className:Vn.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:u.blob,className:Vn.blobFill}),f.jsx("path",{d:u.ring,className:Vn.blobRing})]}),f.jsx("span",{className:Vn.icon,children:e})]})}),Q4="stamp-module__stamp___5qaNY",q4="stamp-module__small___BBlBg",Y4="stamp-module__medium___HG2YD",X4="stamp-module__large___aUT0I",J4="stamp-module__blobBg___Mdrdd",Z4="stamp-module__blobFill___QyCeB",e$="stamp-module__blobRing___EUDx7",t$="stamp-module__dot___qZyCR",n$="stamp-module__label___T89iH",r$="stamp-module__chalkboard___syI4T",pr={stamp:Q4,small:q4,medium:Y4,large:X4,blobBg:J4,blobFill:Z4,blobRing:e$,dot:t$,label:n$,chalkboard:r$},sf={neutral:{fill:nt(X.accentSlate,.14),text:X.accentSlateDark,ring:nt(X.accentSlateDark,.35)},info:{fill:nt(X.accentBlue,.14),text:X.accentBlueDark,ring:nt(X.accentBlueDark,.35)},success:{fill:nt(X.accentGreen,.16),text:X.accentGreenDark,ring:nt(X.accentGreenDark,.35)},warning:{fill:nt(X.accentAmber,.16),text:X.accentAmberDark,ring:nt(X.accentAmberDark,.4)},error:{fill:nt(X.accentRose,.16),text:X.accentRoseDark,ring:nt(X.accentRoseDark,.35)}},g0={fill:nt(X.chalkboardBorderBase,.1),ring:nt(X.chalkboardBorderBase,.35)};function Ne({children:e,size:t="medium",variant:n,dot:r=!1,fillColor:s,textColor:i,wobble:o=.3,surface:a="paper",className:l}){const c=Hi(o),u=a==="chalkboard",d=n?u?g0.ring:sf[n].ring:void 0,h=s??(n?u?g0.fill:sf[n].fill:"transparent"),p=i??(n&&!u?sf[n].text:void 0);return f.jsxs("span",{className:q(pr.stamp,pr[t],u&&pr.chalkboard,l),style:p?{color:p}:void 0,children:[f.jsxs("svg",{className:pr.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:pr.blobFill,style:{fill:h}}),d&&f.jsx("path",{d:c.ring,className:pr.blobRing,style:{stroke:d}})]}),r&&f.jsx("span",{className:pr.dot,"aria-hidden":"true"}),f.jsx("span",{className:pr.label,children:e})]})}const s$="copy-button-module__copyButton___-hTo4",i$="copy-button-module__dark___O45N-",o$="copy-button-module__chalkboard___hW4aw",a$="copy-button-module__copied___XlHFr",yl={copyButton:s$,dark:i$,chalkboard:o$,copied:a$};function qh({text:e,variant:t="light",surface:n="paper",className:r,...s}){const[i,o]=_.useState(!1),a=_.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:q(yl.copyButton,t==="dark"&&yl.dark,n==="chalkboard"&&yl.chalkboard,i&&yl.copied,r),...s,children:i?"Copied!":"Copy"})}const l$="code-block-module__codeBlock___dq28o",c$="code-block-module__header___42Fek",u$="code-block-module__relative___oO-zy",d$="code-block-module__copyOverlay___PjAuq",f$="code-block-module__pre___zXzLZ",h$="code-block-module__chalkboard___bdo9J",p$="code-block-module__chalkboardHeader___3RiVd",m$="code-block-module__chalkboardPre___iRBFR",mr={codeBlock:l$,header:c$,relative:u$,copyOverlay:d$,pre:f$,chalkboard:h$,chalkboardHeader:p$,chalkboardPre:m$};function M9({code:e,filename:t,surface:n="paper"}){return f.jsxs("div",{className:q(mr.codeBlock,n==="chalkboard"&&mr.chalkboard),children:[t&&f.jsxs("div",{className:q(mr.header,n==="chalkboard"&&mr.chalkboardHeader),children:[f.jsx("span",{children:t}),f.jsx(qh,{text:e,variant:"light",surface:n})]}),!t&&f.jsx("div",{className:mr.relative,children:f.jsx("div",{className:mr.copyOverlay,children:f.jsx(qh,{text:e,variant:"dark",surface:n})})}),f.jsx("pre",{className:q(mr.pre,n==="chalkboard"&&mr.chalkboardPre),children:f.jsx("code",{children:e})})]})}function Pa({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 PS({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 Xm({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 g$({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("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function y$({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 x$({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 v$({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 w$="table-module__tableFrame___KP-90",b$="table-module__tableWrapper___gc3Y3",k$="table-module__toolbar___zhCel",_$="table-module__search___zIBk2",S$="table-module__searchIcon___ayhK8",C$="table-module__searchInput___PqsEG",P$="table-module__toolbarActions___EX6qS",j$="table-module__tableScroll___1gvc4",E$="table-module__table___tdU5g",T$="table-module__th___GQbKk",R$="table-module__td___WktB5",I$="table-module__tr___xeZno",N$="table-module__expandTh___uxkR4",A$="table-module__expandTd___VoBRC",M$="table-module__expandIcon___8V45X",L$="table-module__expandable___R7o2l",D$="table-module__expandedRow___1TbTQ",F$="table-module__expandedCell___sKAaD",O$="table-module__boardScroll___Y1yqm",z$="table-module__board___kFAI-",B$="table-module__boardColumn___-W9bP",$$="table-module__boardColumnHeader___kY3Fj",V$="table-module__accentBlue___PEJ1V",U$="table-module__accentGreen___wJ53r",W$="table-module__accentAmber___Iezjv",H$="table-module__accentRose___W8zxc",G$="table-module__accentSlate___oUZCX",K$="table-module__boardColumnLabel___JBEed",Q$="table-module__boardColumnCount___Pkpiq",q$="table-module__boardColumnBody___uAgRF",Y$="table-module__boardRow___C1P60",X$="table-module__boardEmpty___IKv2W",J$="table-module__chalkboardFrame___xB3N5",Z$="table-module__chalkboardWrapper___KjY5r",e5="table-module__chalkboard___v0m3A",ie={tableFrame:w$,tableWrapper:b$,toolbar:k$,search:_$,searchIcon:S$,searchInput:C$,toolbarActions:P$,tableScroll:j$,table:E$,th:T$,td:R$,tr:I$,expandTh:N$,expandTd:A$,expandIcon:M$,expandable:L$,expandedRow:D$,expandedCell:F$,boardScroll:O$,board:z$,boardColumn:B$,boardColumnHeader:$$,accentBlue:V$,accentGreen:U$,accentAmber:W$,accentRose:H$,accentSlate:G$,boardColumnLabel:K$,boardColumnCount:Q$,boardColumnBody:q$,boardRow:Y$,boardEmpty:X$,chalkboardFrame:J$,chalkboardWrapper:Z$,chalkboard:e5},t5=Ym(ie);function n5({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,className:d}){const h=Wi(s,r==="chalkboard"?"chalkboard":"paper"),p=!!i,[m,y]=_.useState(new Set),w=v=>{y(b=>{const S=new Set(b);return S.has(v)?S.delete(v):S.add(v),S})},g=!!(o&&a),x=g?t.length+1:t.length;return f.jsxs("div",{className:q(ie.tableFrame,r==="chalkboard"&&ie.chalkboardFrame,d),children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsxs("div",{className:q(ie.tableWrapper,r==="chalkboard"&&ie.chalkboardWrapper),style:h,children:[p&&f.jsxs("div",{className:ie.toolbar,children:[i.search&&f.jsxs("div",{className:ie.search,children:[f.jsx(r5,{className:ie.searchIcon}),f.jsx("input",{type:"text",className:ie.searchInput,placeholder:i.search.placeholder??"Search...","aria-label":i.search.placeholder??"Search",value:i.search.value,onChange:v=>{var b,S;return(S=(b=i.search)==null?void 0:b.onChange)==null?void 0:S.call(b,v.target.value)}}),f.jsx(_t,{fill:!0,...St.field})]}),i.actions&&f.jsx("div",{className:ie.toolbarActions,children:typeof i.actions=="function"?i.actions(r):i.actions})]}),n?f.jsx("div",{className:ie.boardScroll,children:f.jsx("div",{className:ie.board,children:n.map(v=>f.jsxs("div",{className:ie.boardColumn,children:[f.jsxs("div",{className:q(ie.boardColumnHeader,r==="chalkboard"&&ie.chalkboard,v.accent&&t5[v.accent]),children:[f.jsx("span",{className:ie.boardColumnLabel,children:v.label}),f.jsx("span",{className:ie.boardColumnCount,children:v.items.length})]}),f.jsx("div",{className:ie.boardColumnBody,children:v.items.length===0?f.jsx("div",{className:ie.boardEmpty,children:v.emptyLabel??"empty"}):v.items.map((b,S)=>f.jsx("div",{className:q(ie.boardRow,r==="chalkboard"&&ie.chalkboard),children:v.renderItem(b,S,r)},v.getKey?v.getKey(b,S):S))})]},v.key))})}):f.jsx("div",{className:ie.tableScroll,children:f.jsxs("table",{className:q(ie.table,r==="chalkboard"&&ie.chalkboard),children:[f.jsxs("colgroup",{children:[g&&f.jsx("col",{style:{width:"48px"}}),t.map(v=>f.jsx("col",{style:v.width?{width:`${v.width*32}px`}:void 0},v.key))]}),f.jsx("thead",{children:f.jsxs("tr",{children:[g&&f.jsx("th",{className:q(ie.th,ie.expandTh),"aria-label":"Expand"}),t.map(v=>f.jsx("th",{className:ie.th,style:v.align?{textAlign:v.align}:void 0,children:v.header},v.key))]})}),f.jsx("tbody",{children:e.map((v,b)=>{const S=l?l(v,b):b,k=o==null?void 0:o.render(v,b,r),j=!!k,E=j&&m.has(S),R=u==null?void 0:u(v,b);return f.jsxs(_.Fragment,{children:[f.jsxs("tr",{className:q(ie.tr,j&&ie.expandable,c==null?void 0:c(v,b)),style:R?Ca(R):void 0,onClick:()=>j&&w(S),children:[g&&f.jsx("td",{className:q(ie.td,ie.expandTd),children:j&&f.jsx("button",{type:"button",className:ie.expandIcon,"aria-expanded":E,"aria-label":E?"Collapse row":"Expand row",onClick:T=>{T.stopPropagation(),w(S)},children:f.jsx(v$,{size:14})})}),t.map(T=>f.jsx("td",{className:ie.td,style:T.align?{textAlign:T.align}:void 0,children:T.cell(v,b,r)},T.key))]}),E&&f.jsx("tr",{className:ie.expandedRow,children:f.jsx("td",{colSpan:x,className:ie.expandedCell,children:k})})]},S)})})]})})]})]})}function r5({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 s5="card-module__borderLayer___WSpJq",i5="card-module__elevated___uhWj9",o5="card-module__textureLayer___Kcofz",a5="card-module__flat___KnG5z",l5="card-module__small___HXUTr",c5="card-module__withAccent___2t7bV",u5="card-module__accentBlue___a1KIq",d5="card-module__accentGreen___RNWoA",f5="card-module__accentAmber___uMhom",h5="card-module__accentRose___VPI3t",p5="card-module__accentSlate___-l4jE",m5="card-module__chalkboard___bQ48O",vr={borderLayer:s5,default:"card-module__default___glPy-",elevated:i5,textureLayer:o5,flat:a5,small:l5,withAccent:c5,accentBlue:u5,accentGreen:d5,accentAmber:f5,accentRose:h5,accentSlate:p5,chalkboard:m5},g5=Ym(vr);function Le({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:SS({...s===!0||typeof s=="string"?{texture:s===!0?"parchment":s}:s,...i?{fill:i}:{},...o?{shade:o}:{}});return f.jsxs("div",{className:q(vr.borderLayer,vr[t],n==="chalkboard"&&vr.chalkboard,vr[r],a&&vr.withAccent,a&&g5[l],!c&&vr.flat,u),children:[f.jsx(_t,{clip:!0,...St.surface,straight:!c}),f.jsx("div",{className:vr.textureLayer,style:d,children:e})]})}const y5="input-module__wrapper___xaEw6",x5="input-module__label___lu7R1",v5="input-module__field___khFpX",w5="input-module__input___h7K-F",b5="input-module__small___SkByh",k5="input-module__medium___0QPuV",_5="input-module__large___zGwRu",S5="input-module__error___QDqga",C5="input-module__disabled___K-5hi",P5="input-module__helperText___njeLH",j5="input-module__helperError___qDBpD",E5="input-module__chalkboard___Xh-5s",kn={wrapper:y5,label:x5,field:v5,input:w5,small:b5,medium:k5,large:_5,error:S5,disabled:C5,helperText:P5,helperError:j5,chalkboard:E5},ja=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c;return f.jsxs("div",{className:q(kn.wrapper,s==="chalkboard"&&kn.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:kn.label,children:e}),f.jsxs("span",{className:q(kn.field,kn[r],n&&kn.error,a.disabled&&kn.disabled),children:[f.jsx("input",{ref:l,id:u,className:kn.input,...a}),f.jsx(_t,{fill:!0,...St.field})]}),t&&f.jsx("span",{className:q(kn.helperText,n&&kn.helperError),children:t})]})}),T5="select-module__wrapper___Hc5F3",R5="select-module__label___ay-3s",I5="select-module__nativeSelect___UA2d-",N5="select-module__trigger___xMYHi",A5="select-module__open___w3mbZ",M5="select-module__triggerLabel___ihpER",L5="select-module__placeholder___0VOFP",D5="select-module__small___iU9W9",F5="select-module__chevron___0dCTg",O5="select-module__medium___B-XBN",z5="select-module__large___iII2c",B5="select-module__chevronOpen___cFOYe",$5="select-module__error___P5RBk",V5="select-module__dropdown___Q-uK3",U5="select-module__slideDown___sT374",W5="select-module__options___HmrQ0",H5="select-module__option___vNnue",G5="select-module__optionDisabled___ex2zq",K5="select-module__optionSelected___tAFjn",Q5="select-module__optionHighlighted___zYQLq",q5="select-module__helperText___r5gyn",Y5="select-module__helperError___ydSPT",X5="select-module__chalkboard___sXBw8",Ae={wrapper:T5,label:R5,nativeSelect:I5,trigger:N5,open:A5,triggerLabel:M5,placeholder:L5,small:D5,chevron:F5,medium:O5,large:z5,chevronOpen:B5,error:$5,dropdown:V5,slideDown:U5,options:W5,option:H5,optionDisabled:G5,optionSelected:K5,optionHighlighted:Q5,helperText:q5,helperError:Y5,chalkboard:X5};function jS({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 y=_.useId(),[w,g]=_.useState(!1),[x,v]=_.useState(-1),[b,S]=_.useState(l??""),[k,j]=_.useState(null),E=_.useRef(null),R=_.useRef(null),T=a!==void 0,N=T?a:b,A=i.find(C=>C.value===N),O=(A==null?void 0:A.label)??o??"Select...",z=_.useCallback(()=>{if(d)return;g(!0);const C=i.findIndex(V=>V.value===N);v(C>=0?C:0)},[d,i,N]),P=_.useCallback(()=>{g(!1),v(-1)},[]),L=_.useCallback(C=>{var V;C.disabled||(T||S(C.value),c==null||c(C.value),P(),(V=E.current)==null||V.focus())},[T,c,P]),B=_.useCallback(C=>{if(!d)switch(C.key){case"Enter":case" ":C.preventDefault(),w&&x>=0?L(i[x]):z();break;case"Escape":C.preventDefault(),w&&P();break;case"ArrowDown":C.preventDefault(),w?v(V=>{let Q=V+1;for(;Q<i.length&&i[Q].disabled;)Q++;return Q<i.length?Q:V}):z();break;case"ArrowUp":C.preventDefault(),w?v(V=>{let Q=V-1;for(;Q>=0&&i[Q].disabled;)Q--;return Q>=0?Q:V}):z();break;case"Home":if(C.preventDefault(),w){let V=0;for(;V<i.length&&i[V].disabled;)V++;V<i.length&&v(V)}break;case"End":if(C.preventDefault(),w){let V=i.length-1;for(;V>=0&&i[V].disabled;)V--;V>=0&&v(V)}break;case"Tab":w&&P();break}},[d,w,x,i,z,P,L]);_.useEffect(()=>{if(!w)return;const C=V=>{var Q,I;const le=V.target;(Q=E.current)!=null&&Q.contains(le)||(I=R.current)!=null&&I.contains(le)||P()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[w,P]),_.useEffect(()=>{if(!w||x<0||!R.current)return;const C=R.current.querySelector(`[data-option-index="${x}"]`);C==null||C.scrollIntoView({block:"nearest"})},[w,x]),_.useEffect(()=>{if(!w){j(null);return}const C=()=>{if(!E.current)return;const V=E.current.getBoundingClientRect();if(V.bottom<0||V.top>window.innerHeight){P();return}j(V)};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)}},[w,P]);const M=Wi(p),$=M?{"--sketch-fill":M.backgroundColor}:void 0;return f.jsxs("div",{className:q(Ae.wrapper,s==="chalkboard"&&Ae.chalkboard,m),style:h?{width:typeof h=="number"?`${h}px`:h}:void 0,children:[e&&f.jsx("label",{htmlFor:y,className:Ae.label,children:e}),f.jsxs("select",{id:y,name:u,className:Ae.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":w,"aria-haspopup":"listbox","aria-controls":w?`${y}-listbox`:void 0,"aria-activedescendant":w&&x>=0?`${y}-option-${x}`:void 0,className:q(Ae.trigger,Ae[r],n&&Ae.error,w&&Ae.open,d&&Ae.disabled),onClick:()=>w?P():z(),onKeyDown:B,disabled:d,children:[f.jsx("span",{className:q(Ae.triggerLabel,!A&&Ae.placeholder),children:O}),f.jsx(J5,{className:q(Ae.chevron,w&&Ae.chevronOpen)}),f.jsx(_t,{fill:!0,...St.field})]}),w&&k&&As.createPortal(f.jsxs("div",{ref:R,id:`${y}-listbox`,role:"listbox",tabIndex:-1,className:Ae.dropdown,style:{...$,position:"fixed",top:k.bottom+6,left:k.left,width:k.width},onKeyDown:C=>{var V;C.key==="Escape"&&(C.preventDefault(),P(),(V=E.current)==null||V.focus())},children:[f.jsx(_t,{fill:!0,...St.surface}),f.jsx("div",{className:Ae.options,children:i.map((C,V)=>f.jsx("div",{id:`${y}-option-${V}`,role:"option","aria-selected":C.value===N,tabIndex:-1,"data-option-index":V,className:q(Ae.option,C.value===N&&Ae.optionSelected,V===x&&Ae.optionHighlighted,C.disabled&&Ae.optionDisabled),onClick:Q=>{Q.stopPropagation(),L(C)},onMouseEnter:()=>v(V),children:C.label},C.value))})]}),document.body),t&&f.jsx("span",{className:q(Ae.helperText,n&&Ae.helperError),children:t})]})}function J5({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 ES({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 Z5="alert-module__alert___j7ZRS",eV="alert-module__surface___IaVgU",tV="alert-module__iconWrapper___kLoxT",nV="alert-module__message___klR2U",rV="alert-module__dismiss___f2uoG",sV="alert-module__info___PBo1l",iV="alert-module__success___AVBKS",oV="alert-module__warning___zkMaJ",aV="alert-module__error___cxg96",lV="alert-module__chalkboard___7pgWk",is={alert:Z5,surface:eV,iconWrapper:tV,message:nV,dismiss:rV,info:sV,success:iV,warning:oV,error:aV,chalkboard:lV};function TS({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:q(is.alert,is[t],a&&is.chalkboard,o),role:t==="warning"||t==="error"?"alert":"status",children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:is.surface,style:a?void 0:Wi(r)}),f.jsx("span",{className:is.iconWrapper,children:f.jsx(ES,{variant:t})}),f.jsx("div",{className:is.message,children:e}),s&&f.jsx("button",{type:"button",className:is.dismiss,onClick:i,"aria-label":"Dismiss alert",children:f.jsx(Pa,{size:16})})]})}const cV="modal-module__overlay___a52Ni",uV="modal-module__fadeIn___5OWd5",dV="modal-module__backdrop___RS4yj",fV="modal-module__modal___ZioOV",hV="modal-module__slideUp___vfFrm",pV="modal-module__small___hcxwF",mV="modal-module__medium___mjbM5",gV="modal-module__large___1dzyf",yV="modal-module__header___iP09B",xV="modal-module__title___nj06m",vV="modal-module__close___gQou9",wV="modal-module__body___Y-EdA",bV="modal-module__chalkboard___qY8qo",Un={overlay:cV,fadeIn:uV,backdrop:dV,modal:fV,slideUp:hV,small:pV,medium:mV,large:gV,header:yV,title:xV,close:vV,body:wV,chalkboard:bV},kV='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ea({open:e,onClose:t,title:n,children:r,size:s="medium",surface:i="paper",texture:o=!1,className:a}){const l=_.useId(),c=_.useRef(null),u=_.useRef(null);if(Pu(e,t),_.useEffect(()=>{var h;if(!e)return;u.current=document.activeElement,(h=c.current)==null||h.focus();const p=y=>{var w;if(y.key!=="Tab")return;const g=(w=c.current)==null?void 0:w.querySelectorAll(kV);if(!g||g.length===0){y.preventDefault();return}const x=g[0],v=g[g.length-1];y.shiftKey&&document.activeElement===x?(y.preventDefault(),v.focus()):!y.shiftKey&&document.activeElement===v&&(y.preventDefault(),x.focus())};document.addEventListener("keydown",p);const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{var y,w;document.removeEventListener("keydown",p),document.body.style.overflow=m,(w=(y=u.current)==null?void 0:y.focus)==null||w.call(y)}},[e]),!e||typeof document>"u")return null;const d=Wi(o);return As.createPortal(f.jsxs("div",{className:Un.overlay,children:[f.jsx("button",{type:"button",className:Un.backdrop,"aria-label":"Close modal",onClick:t}),f.jsxs("div",{ref:c,className:q(Un.modal,Un[s],i==="chalkboard"&&Un.chalkboard,a),style:d,role:"dialog","aria-modal":"true","aria-labelledby":n?l:void 0,tabIndex:-1,children:[f.jsxs("div",{className:Un.header,children:[n&&f.jsx("h2",{id:l,className:Un.title,children:n}),f.jsx("button",{type:"button",className:Un.close,onClick:t,"aria-label":"Close modal",children:f.jsx(Pa,{size:18})})]}),f.jsx("div",{className:Un.body,children:r})]})]}),document.body)}const _V="textarea-module__wrapper___NbiNO",SV="textarea-module__label___ejhyZ",CV="textarea-module__field___KluQf",PV="textarea-module__textarea___0y-7v",jV="textarea-module__resizeGrip___lONlE",EV="textarea-module__small___yPyr8",TV="textarea-module__medium___ezQxA",RV="textarea-module__large___xfeKi",IV="textarea-module__error___EkXKJ",NV="textarea-module__disabled___9CKbb",AV="textarea-module__helperText___l1sPh",MV="textarea-module__helperError___VfTLy",LV="textarea-module__chalkboard___zZ0X0",an={wrapper:_V,label:SV,field:CV,textarea:PV,resizeGrip:jV,small:EV,medium:TV,large:RV,error:IV,disabled:NV,helperText:AV,helperError:MV,chalkboard:LV},DV=48,Ru=_.forwardRef(function({label:e,helperText:t,error:n=!1,size:r="medium",surface:s="paper",className:i,id:o,...a},l){const c=_.useId(),u=o??c,d=_.useRef(null),h=_.useCallback(m=>{d.current=m,typeof l=="function"?l(m):l&&(l.current=m)},[l]),p=_.useCallback(m=>{const y=d.current;if(!y)return;m.preventDefault();const w=m.clientY,g=y.offsetHeight,x=b=>{y.style.height=`${Math.max(DV,g+b.clientY-w)}px`},v=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",v)},[]);return f.jsxs("div",{className:q(an.wrapper,s==="chalkboard"&&an.chalkboard,i),children:[e&&f.jsx("label",{htmlFor:u,className:an.label,children:e}),f.jsxs("span",{className:q(an.field,an[r],n&&an.error,a.disabled&&an.disabled),children:[f.jsx("textarea",{ref:h,id:u,className:an.textarea,...a}),f.jsx(_t,{fill:!0,...St.field}),!a.disabled&&f.jsx("span",{className:an.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:q(an.helperText,n&&an.helperError),children:t})]})}),FV="progress-module__track___a5BMO",OV="progress-module__svg___3U0-E",y0={track:FV,svg:OV},of=300,gr=1;function zV({value:e,max:t=100,color:n,height:r=6,surface:s="paper",className:i}){const o=t>0?Math.max(0,Math.min(100,Math.round(e/t*100))):0,a=s==="chalkboard",l=Math.max(1,Math.round(Tu()*1e6)),c=a?nt(X.chalkboardBorderBase,.16):nt(X.textPrimary,.12),u=n??(a?X.chalkboardChalk:X.textSecondary),d=_.useMemo(()=>Fe.toPaths(Fe.rectangle(gr,gr,of-gr*2,r-gr*2,{seed:l,roughness:2.2,fill:c,fillStyle:"solid",stroke:c,strokeWidth:1.5})),[l,c,r]),h=Math.max(o/100*(of-gr*2),0),p=_.useMemo(()=>h>0?Fe.toPaths(Fe.rectangle(gr,gr,h,r-gr*2,{seed:l+1,roughness:2,fill:u,fillStyle:"solid",stroke:u,strokeWidth:1})):[],[l,u,h,r]);return f.jsx("div",{className:q(y0.track,i),style:{height:r,borderRadius:r/2},children:f.jsxs("svg",{className:y0.svg,viewBox:`0 0 ${of} ${r}`,preserveAspectRatio:"none","aria-hidden":"true",children:[d.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y)),p.map((m,y)=>f.jsx("path",{d:m.d,stroke:m.stroke,strokeWidth:m.strokeWidth,fill:m.fill},y))]})})}function BV(e){const t=Tu();return _.useMemo(()=>({blob:pB({seed:t,wobble:e}),ring:mB(t,e)}),[t,e])}const $V="list-item-module__listItem___-tw9O",VV="list-item-module__clickable___GLJmd",UV="list-item-module__blobBg___O3Mzh",WV="list-item-module__blobFill___dXHk1",HV="list-item-module__blobRing___S9mas",GV="list-item-module__active___UsL8O",KV="list-item-module__small___9dphK",QV="list-item-module__medium___yGZCr",qV="list-item-module__icon___2b4wU",YV="list-item-module__label___SIzJ4",XV="list-item-module__action___qGh0-",JV="list-item-module__chalkboard___qpWuM",Wt={listItem:$V,static:"list-item-module__static___qtEX6",clickable:VV,blobBg:UV,blobFill:WV,blobRing:HV,active:GV,small:KV,medium:QV,icon:qV,label:YV,action:XV,chalkboard:JV};function Kn({active:e=!1,icon:t,action:n,size:r="medium",wobble:s=.5,surface:i="paper",children:o,className:a,...l}){const c=BV(s),u=!!l.onClick;return f.jsxs("button",{type:"button",className:q(Wt.listItem,Wt[r],u&&Wt.clickable,!u&&!e&&Wt.static,e&&Wt.active,i==="chalkboard"&&Wt.chalkboard,a),"aria-current":e?"page":void 0,...l,children:[f.jsxs("svg",{className:Wt.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:c.blob,className:Wt.blobFill}),f.jsx("path",{d:c.ring,className:Wt.blobRing})]}),t&&f.jsx("span",{className:Wt.icon,children:t}),f.jsx("span",{className:Wt.label,children:o}),n&&f.jsx("span",{className:Wt.action,children:n})]})}const ZV="icon-module__icon___2vrJz",e6="icon-module__blobBg___ENPYJ",t6="icon-module__blobFill___IPbwQ",n6="icon-module__blobRing___1awqV",r6="icon-module__content___TaZR6",s6="icon-module__small___Xp--F",i6="icon-module__medium___tCjMB",o6="icon-module__large___vBtP7",Us={icon:ZV,blobBg:e6,blobFill:t6,blobRing:n6,content:r6,small:s6,medium:i6,large:o6},a6={small:20,medium:24,large:28};function l6({icon:e,size:t="medium",wobble:n=.5,fillColor:r,className:s}){const i=Hi(n),o=a6[t];return f.jsxs("span",{className:q(Us.icon,Us[t],s),children:[f.jsxs("svg",{className:Us.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:[f.jsx("path",{d:i.blob,className:Us.blobFill,style:r?{fill:r}:void 0}),f.jsx("path",{d:i.ring,className:Us.blobRing})]}),f.jsx("span",{className:Us.content,style:{width:o,height:o},children:e})]})}const c6="radio-module__wrapper___BB05E",u6="radio-module__blobFill___p5BX4",d6="radio-module__labelLeft___ijB93",f6="radio-module__input___M2nFJ",h6="radio-module__box___H7ofS",p6="radio-module__dot___jVJ-d",m6="radio-module__boxWrapper___Y3qis",g6="radio-module__blobBg___IR-M5",y6="radio-module__labelText___I-nu3",x6="radio-module__chalkboard___IIBqI",_n={wrapper:c6,blobFill:u6,labelLeft:d6,input:f6,box:h6,dot:p6,boxWrapper:m6,blobBg:g6,labelText:y6,chalkboard:x6};_.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=_.useId(),d=a??u,h=Hi(n);return f.jsxs("label",{className:q(_n.wrapper,t==="left"&&_n.labelLeft,r==="chalkboard"&&_n.chalkboard,s),htmlFor:d,children:[f.jsxs("span",{className:_n.boxWrapper,children:[f.jsx("input",{ref:c,id:d,type:"radio",className:_n.input,checked:i,onChange:o,...l}),f.jsx("svg",{className:_n.blobBg,viewBox:"-10 -10 120 120",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("path",{d:h.blob,className:_n.blobFill})}),f.jsxs("span",{className:_n.box,"aria-hidden":"true",children:[f.jsx(_t,{smooth:!0,shape:"circle",...St.control}),f.jsx("span",{className:_n.dot})]})]}),e&&f.jsx("span",{className:_n.labelText,children:e})]})});const v6="switch-module__wrapper___5-2P1",w6="switch-module__labelLeft___WlT-N",b6="switch-module__input___YKZRj",k6="switch-module__track___QNvnO",_6="switch-module__thumb___cunvF",S6="switch-module__small___WPIxc",C6="switch-module__medium___yPulW",P6="switch-module__large___VlKV1",j6="switch-module__labelText___9Qg39",E6="switch-module__chalkboard___qKTMz",yr={wrapper:v6,labelLeft:w6,input:b6,track:k6,thumb:_6,small:S6,medium:C6,large:P6,labelText:j6,chalkboard:E6},T6=_.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=_.useId(),d=a??u;return f.jsxs("label",{className:q(yr.wrapper,yr[n],t==="left"&&yr.labelLeft,r==="chalkboard"&&yr.chalkboard,s),htmlFor:d,children:[f.jsx("input",{ref:c,id:d,type:"checkbox",className:yr.input,checked:i,onChange:o,...l}),f.jsxs("span",{className:yr.track,"aria-hidden":"true",children:[f.jsx(_t,{...St.pill}),f.jsx("span",{className:yr.thumb})]}),e&&f.jsx("span",{className:yr.labelText,children:e})]})}),R6="spinner-module__spinner___FDTk2",I6="spinner-module__chalkboard___DLE1z",N6="spinner-module__svg___JnCWN",A6="spinner-module__track___xbnbo",M6="spinner-module__head___j5dWe",go={spinner:R6,chalkboard:I6,svg:N6,track:A6,head:M6},L6={small:18,medium:28,large:40},x0=25,D6=18,v0=Fe.toPaths(Fe.circle(x0,x0,D6*2,{seed:7,roughness:1.15,disableMultiStroke:!0})).map(e=>e.d).join(" ");function Rs({size:e="medium",color:t,label:n="Loading",surface:r="paper",className:s}){const i=L6[e];return f.jsx("span",{className:q(go.spinner,r==="chalkboard"&&go.chalkboard,s),role:"status","aria-label":n,children:f.jsxs("svg",{width:i,height:i,viewBox:"0 0 50 50",className:go.svg,style:t?{color:t}:void 0,"aria-hidden":"true",children:[f.jsx("path",{className:go.track,d:v0,fill:"none",pathLength:100,strokeLinecap:"round"}),f.jsx("path",{className:go.head,d:v0,fill:"none",pathLength:100,strokeLinecap:"round"})]})})}const F6="skeleton-module__skeleton___HCSvg",O6="skeleton-module__pulse___6eCq1",z6="skeleton-module__svg___OzxGp",B6="skeleton-module__text___v17Nv",$6="skeleton-module__rect___wqIJy",V6="skeleton-module__circle___RCmyR",af={skeleton:F6,pulse:O6,svg:z6,text:B6,rect:$6,circle:V6},w0={text:[0,0,200,24],rect:[0,0,200,100],circle:[0,0,40,40]},Ws=2;function ln({variant:e="text",width:t,height:n,surface:r="paper",className:s,style:i}){const o=r==="chalkboard",a=Math.max(1,Math.round(Tu()*1e6)),l=o?nt(X.chalkboardBorderBase,.16):nt(X.textPrimary,.09),c=_.useMemo(()=>{const[,,u,d]=w0[e],h=e==="circle"?Fe.ellipse(u/2,d/2,u-Ws*2,d-Ws*2,{seed:a,roughness:1.5,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1}):Fe.rectangle(Ws,Ws,u-Ws*2,d-Ws*2,{seed:a,roughness:1.4,fill:l,fillStyle:"solid",stroke:l,strokeWidth:1});return Fe.toPaths(h)},[e,a,l]);return f.jsx("span",{className:q(af.skeleton,af[e],s),style:{width:t,height:n,...i},"aria-hidden":"true",children:f.jsx("svg",{className:af.svg,viewBox:w0[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 U6="divider-module__horizontal___tP3rG",W6="divider-module__line___KnBes",H6="divider-module__label___WiUwZ",G6="divider-module__vertical___wBSrT",K6="divider-module__chalkboard___gXTde",Hs={horizontal:U6,line:W6,label:H6,vertical:G6,chalkboard:K6};function b0({orientation:e="horizontal",label:t,surface:n="paper",className:r}){const s=n==="chalkboard"&&Hs.chalkboard;return e==="vertical"?f.jsx("span",{className:q(Hs.vertical,s,r),role:"separator","aria-orientation":"vertical"}):f.jsxs("div",{className:q(Hs.horizontal,s,r),role:"separator",children:[f.jsx("span",{className:Hs.line}),t!=null&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:Hs.label,children:t}),f.jsx("span",{className:Hs.line})]})]})}const Q6="tooltip-module__wrapper___XeVNe",q6="tooltip-module__tooltip___e-rkz",Y6="tooltip-module__tooltipIn___CZbRw",X6="tooltip-module__top___78WWU",J6="tooltip-module__bottom___Irl3O",Z6="tooltip-module__left___C1Ec4",e8="tooltip-module__right___oUA-Z",t8="tooltip-module__chalkboard___Um6dx",xl={wrapper:Q6,tooltip:q6,tooltipIn:Y6,top:X6,bottom:J6,left:Z6,right:e8,chalkboard:t8},vl=8,wl=8,n8=typeof window>"u"?_.useEffect:_.useLayoutEffect;function r8(e,t,n){let r,s;switch(t){case"bottom":r=e.bottom+vl,s=e.left+e.width/2-n.width/2;break;case"left":r=e.top+e.height/2-n.height/2,s=e.left-vl-n.width;break;case"right":r=e.top+e.height/2-n.height/2,s=e.right+vl;break;default:r=e.top-vl-n.height,s=e.left+e.width/2-n.width/2}return s=Math.min(Math.max(s,wl),window.innerWidth-n.width-wl),r=Math.min(Math.max(r,wl),window.innerHeight-n.height-wl),{top:r,left:s}}function Ie({content:e,children:t,placement:n="top",delay:r=300,disabled:s=!1,surface:i="paper"}){const o=_.useId(),[a,l]=_.useState(!1),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),[y,w]=_.useState(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(),b=!s&&!!e&&!d&&(a||c),S=()=>{clearTimeout(v.current),v.current=setTimeout(()=>l(!0),r)},k=()=>{clearTimeout(v.current),l(!1),h(!1)},j=()=>{h(!1),u(!0)},E=()=>{u(!1),h(!1)};Pu(b,()=>h(!0)),_.useEffect(()=>{if(!b){m(null);return}const T=()=>{g.current&&m(g.current.getBoundingClientRect())};return T(),window.addEventListener("scroll",T,{capture:!0,passive:!0}),window.addEventListener("resize",T,{passive:!0}),()=>{window.removeEventListener("scroll",T,{capture:!0}),window.removeEventListener("resize",T)}},[b]),n8(()=>{if(!b){w(null);return}const T=x.current;T&&w({width:T.offsetWidth,height:T.offsetHeight})},[b,e,n]),_.useEffect(()=>()=>clearTimeout(v.current),[]);const R=t.props;return f.jsxs("span",{ref:g,className:xl.wrapper,onMouseEnter:S,onMouseLeave:k,onFocus:j,onBlur:E,children:[_.cloneElement(t,{"aria-describedby":b?o:R["aria-describedby"]}),b&&p&&typeof document<"u"&&As.createPortal(f.jsx("span",{ref:x,id:o,role:"tooltip",className:q(xl.tooltip,xl[n],i==="chalkboard"&&xl.chalkboard),style:y?{position:"fixed",...r8(p,n,y)}:{position:"fixed",top:0,left:0,visibility:"hidden"},children:e}),document.body)]})}const s8="toast-module__stack___hDi0s",i8="toast-module__topLeft___Luw-F",o8="toast-module__topCenter___N1DwF",a8="toast-module__topRight___Dtgau",l8="toast-module__bottomLeft___Eb2lo",c8="toast-module__bottomCenter___gs-Yb",u8="toast-module__bottomRight___-0e2j",d8="toast-module__item___RFjtm",f8="toast-module__toastIn___9m9iN",h8="toast-module__card___ZCvJS",p8="toast-module__surface___mfMl0",m8="toast-module__iconWrapper___lnjcC",g8="toast-module__content___AlliM",y8="toast-module__title___1Oqh8",x8="toast-module__description___eiUSB",v8="toast-module__dismiss___tUGx4",w8="toast-module__info___Nh8S9",b8="toast-module__success___hlKLc",k8="toast-module__warning___XUMJt",_8="toast-module__error___pSFFC",S8="toast-module__chalkboard___c49gt",Ht={stack:s8,topLeft:i8,topCenter:o8,topRight:a8,bottomLeft:l8,bottomCenter:c8,bottomRight:u8,item:d8,toastIn:f8,card:h8,surface:p8,iconWrapper:m8,content:g8,title:y8,description:x8,dismiss:v8,info:w8,success:b8,warning:k8,error:_8,chalkboard:S8};function C8({record:e,surface:t="paper",onDismiss:n}){const r=_.useRef(e.duration),s=_.useRef(0),i=_.useRef(),o=_.useCallback(d=>{clearTimeout(i.current),!(d<=0)&&(s.current=Date.now(),i.current=setTimeout(()=>n(e.id),d))},[n,e.id]);_.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:Ht.item,onMouseEnter:a,onMouseLeave:l,children:f.jsxs("div",{className:q(Ht.card,Ht[e.variant],c&&Ht.chalkboard),role:u,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:Ht.surface,style:c?void 0:Wi("kraft")}),f.jsx("span",{className:Ht.iconWrapper,children:f.jsx(ES,{variant:e.variant})}),f.jsxs("div",{className:Ht.content,children:[e.title&&f.jsx("div",{className:Ht.title,children:e.title}),f.jsx("div",{className:Ht.description,children:e.description})]}),f.jsx("button",{type:"button",className:Ht.dismiss,onClick:()=>n(e.id),"aria-label":"Dismiss notification",children:f.jsx(Pa,{size:16})})]})})}const RS=_.createContext(null);function P8(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function j8({children:e,position:t="bottom-right",surface:n="paper",defaultDuration:r=5e3}){const[s,i]=_.useState([]),o=_.useRef(0),a=_.useCallback(u=>{i(d=>d.filter(h=>h.id!==u))},[]),l=_.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(RS.Provider,{value:{toast:l,dismiss:a},children:[e,typeof document<"u"&&As.createPortal(f.jsx("div",{className:q(Ht.stack,Ht[P8(t)]),role:"region","aria-label":"Notifications",children:c.map(u=>f.jsx(C8,{record:u,surface:n,onDismiss:a},u.id))}),document.body)]})}function We(){const e=_.useContext(RS);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}const E8="breadcrumb-module__breadcrumb___r-ILp",T8="breadcrumb-module__list___V3YFy",R8="breadcrumb-module__item___dDwYf",I8="breadcrumb-module__link___CHC9k",N8="breadcrumb-module__linkButton___XoMW-",A8="breadcrumb-module__current___dprI9",M8="breadcrumb-module__separator___uLhtn",L8="breadcrumb-module__chalkboard___COJpw",Sn={breadcrumb:E8,list:T8,item:R8,link:I8,linkButton:N8,current:A8,static:"breadcrumb-module__static___affaf",separator:M8,chalkboard:L8};function k0({items:e,surface:t="paper",className:n}){return f.jsx("nav",{"aria-label":"Breadcrumb",className:q(Sn.breadcrumb,t==="chalkboard"&&Sn.chalkboard,n),children:f.jsx("ol",{className:Sn.list,children:e.map((r,s)=>{const i=s===e.length-1;return f.jsxs("li",{className:Sn.item,children:[i?f.jsx("span",{className:Sn.current,"aria-current":"page",children:r.label}):r.href?f.jsx("a",{href:r.href,className:Sn.link,onClick:r.onClick,children:r.label}):r.onClick?f.jsx("button",{type:"button",className:q(Sn.link,Sn.linkButton),onClick:r.onClick,children:r.label}):f.jsx("span",{className:Sn.static,children:r.label}),!i&&f.jsx(D8,{className:Sn.separator})]},r.id)})})})}function D8({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 F8="menu-module__wrapper___WCtoy",O8="menu-module__menu___i40Wj",z8="menu-module__surface___SJbaB",B8="menu-module__list___YjCfD",$8="menu-module__item___aqcgg",V8="menu-module__icon___1qUvA",U8="menu-module__label___MtQMh",W8="menu-module__danger___p9oZo",H8="menu-module__itemDisabled___HByLP",G8="menu-module__separator___g2uay",K8="menu-module__chalkboard___5jIwI",cn={wrapper:F8,menu:O8,surface:z8,list:B8,item:$8,icon:V8,label:U8,danger:W8,itemDisabled:H8,separator:G8,chalkboard:K8},Q8=6;function q8(e){return"type"in e&&e.type==="separator"}function IS({trigger:e,items:t,align:n="start",surface:r="paper",className:s}){const i=_.useId(),[o,a]=_.useState(!1),[l,c]=_.useState(null),u=_.useRef(null),d=_.useRef(null),h=_.useCallback(()=>{var g,x;(x=(g=u.current)==null?void 0:g.querySelector("button, a, [tabindex]"))==null||x.focus()},[]),p=_.useCallback(()=>a(!1),[]);Pu(o,()=>{p(),h()}),_.useEffect(()=>{if(!o)return;const g=x=>{var v,b;const S=x.target;(v=u.current)!=null&&v.contains(S)||(b=d.current)!=null&&b.contains(S)||p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o,p]),_.useEffect(()=>{if(!o){c(null);return}const g=()=>{u.current&&c(u.current.getBoundingClientRect())};return g(),document.addEventListener("scroll",g,{capture:!0,passive:!0}),window.addEventListener("resize",g,{passive:!0}),()=>{document.removeEventListener("scroll",g,{capture:!0}),window.removeEventListener("resize",g)}},[o]),_.useEffect(()=>{var g,x;!o||!l||(x=(g=d.current)==null?void 0:g.querySelector('[role="menuitem"]:not(:disabled)'))==null||x.focus()},[o,l]);const m=g=>{var x,v,b,S,k;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(g.key){case"ArrowDown":g.preventDefault(),(v=j[(E+1)%j.length])==null||v.focus();break;case"ArrowUp":g.preventDefault(),(b=j[(E-1+j.length)%j.length])==null||b.focus();break;case"Home":g.preventDefault(),(S=j[0])==null||S.focus();break;case"End":g.preventDefault(),(k=j[j.length-1])==null||k.focus();break;case"Tab":p();break}},y=g=>{var x;g.disabled||(p(),h(),(x=g.onSelect)==null||x.call(g))},w=e.props;return f.jsxs("span",{ref:u,className:cn.wrapper,children:[_.cloneElement(e,{"aria-haspopup":"menu","aria-expanded":o,onClick:g=>{var x;(x=w.onClick)==null||x.call(w,g),a(v=>!v)}}),o&&l&&typeof document<"u"&&As.createPortal(f.jsxs("div",{ref:d,id:i,role:"menu",className:q(cn.menu,r==="chalkboard"&&cn.chalkboard,s),style:{position:"fixed",top:l.bottom+Q8,minWidth:l.width,...n==="end"?{right:window.innerWidth-l.right}:{left:l.left}},onKeyDown:m,children:[f.jsx(_t,{clip:!0,...St.surface}),f.jsx("div",{className:cn.surface}),f.jsx("div",{className:cn.list,children:t.map(g=>q8(g)?f.jsx("div",{role:"separator",className:cn.separator},g.id):f.jsxs("button",{type:"button",role:"menuitem",tabIndex:-1,disabled:g.disabled,className:q(cn.item,g.danger&&cn.danger,g.disabled&&cn.itemDisabled),onClick:()=>y(g),children:[g.icon&&f.jsx("span",{className:cn.icon,children:g.icon}),f.jsx("span",{className:cn.label,children:g.label})]},g.id))})]}),document.body)]})}function Ue(e){const t=e.split(`
79
- `).map(r=>r.trim()).filter(Boolean);return t.find(r=>r.startsWith("!")||r.startsWith("error:")||r.startsWith("fatal:"))??t.at(-1)??e}const NS="font-display-luminari text-base font-semibold text-desk-text-muted mb-3",Qn={pass:"#2d5a3b",fail:"#5a2d2d",running:"#5a4a2d"},qn={pass:"#b5d6b5",fail:"#d6a0a0",running:"#d6c4a0"},Y8=Ue,X8=8,J8="basis-[9.25rem]",Z8=e=>{switch(e.taskKind){case"phase":return e.phaseIndex!==void 0?` — phase ${e.phaseIndex+1}`:"";case"audit":return" — audit";case"batch-reconcile":return" — batch reconcile";case"reconcile":return" — reconcile";case"fix-review":return" — fixing review comments";case"draft":return" — drafting";case"extend":return" — extending";case"commit-suggest":return" — suggesting commit message";case"overlap-check":return" — checking overlap";case"sync":return" — syncing to main";case"resolve-conflict":return" — resolving conflict";case"run-all":return" — run all phases";default:return""}},eU=({task:e,onStop:t})=>{const n=tn(),{toast:r}=We(),s=()=>n({to:"/tasks",search:{taskId:e.id}}),i=async l=>{l.stopPropagation();try{await t(e.id)}catch(c){r({title:"Failed to stop agent",description:Ue(c.message),variant:"error"})}},o={starting:Qn.running,running:Qn.running,stopping:Qn.running,done:Qn.pass,error:Qn.fail,superseded:Qn.running},a={starting:qn.running,running:qn.running,stopping:qn.running,done:qn.pass,error:qn.fail,superseded:qn.running};return f.jsx(Le,{surface:"chalkboard",size:"small",className:"stack-task-card",children:f.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s())},className:"flex cursor-pointer items-center justify-between gap-2 rounded-[10px]",children:[f.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-display-luminari text-sm font-semibold text-desk-chalk",children:[e.planTitle,Z8(e)," · ",IM[e.agentId]]}),f.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="error"&&e.errorKind==="auth"?f.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),n({to:"/settings/$section",params:{section:"setup"}})},className:"bg-none bg-transparent border-none p-0 cursor-pointer",children:f.jsx(Ne,{surface:"chalkboard",size:"small",fillColor:o.error,textColor:a.error,children:"stopped — agent signed out"})}):f.jsx(Ne,{surface:"chalkboard",size:"small",fillColor:o[e.status],textColor:a[e.status],children:e.status}),(e.status==="running"||e.status==="starting"||e.status==="stopping")&&f.jsx(Ct,{icon:f.jsx(Pa,{}),variant:"ghost",size:"small",label:"Stop agent",onClick:i,disabled:e.status==="stopping"})]})]})})},tU=()=>{const e=F(r=>r.agentStatus),t=F(r=>r.stopAgent),n=e.slice(0,X8);return f.jsxs("div",{className:"flex min-h-0 flex-auto flex-col p-6",children:[f.jsx("div",{className:NS,children:"Agent"}),f.jsx("div",{className:`flex min-h-0 flex-auto flex-col gap-2 overflow-y-auto ${J8} ${n.length>0?"justify-start":"justify-center"}`,children:n.length>0?n.map(r=>f.jsx(eU,{task:r,onStop:t},r.id)):f.jsx(Le,{surface:"chalkboard",size:"small",children:f.jsx("p",{className:"m-0 text-center text-xs opacity-50",children:"No agent running."})})})]})};function bl(e,t){const{toast:n}=We(),r=F(o=>o.activeGitAction),s=F(o=>o.setActiveGitAction),i=_.useCallback(async o=>{if(!F.getState().activeGitAction){s(e);try{await o()}catch(a){n({title:t,description:Ue(a.message),variant:"error"})}finally{s(null)}}},[n,t,e,s]);return[r===e,i]}function Iu(){const e=F(b=>b.loadGitStatus),t=F(b=>b.loadPlans),n=F(b=>b.loadIdeas),r=F(b=>b.activeGitAction!==null),{toast:s,dismiss:i}=We(),o=()=>Promise.all([e(),t(),n()]),[a,l]=bl("push","Push failed"),[c,u]=bl("sync","Sync failed"),[d,h]=bl("pull","Pull failed"),[p,m]=bl("fix-divergence","Fix failed"),y=_.useCallback((b,S)=>{if(S.recovering)return s({title:`${b} needs help`,description:"Handed off to a recovery agent — see Stack for progress",variant:"warning"}),!0;if("conflictPrompt"in S){const{conflictPrompt:k,message:j}=S,E=s({title:`${b} hit a conflict`,description:f.jsxs("div",{className:"flex flex-col items-start gap-2",children:[f.jsx("span",{children:Ue(j)}),f.jsx(te,{size:"small",onClick:async()=>{const R=await tL(k).catch(T=>({ok:!1,error:Ue(T.message)}));R.ok&&i(E),s({title:R.ok?"Resolving conflict":"Could not start the agent",description:R.ok?"Handed off to the agent — see Stack for progress":R.error??"The agent did not start.",variant:R.ok?"warning":"error"})},children:"Ask the agent to resolve"})]}),variant:"error",duration:0});return!0}return!1},[s,i]);return{pushing:a,syncing:c,pulling:d,fixingDivergence:p,gitActionBusy:r,handlePush:()=>l(async()=>{await XM(),await e()}),handleSync:()=>u(async()=>{const b=await JM();if(!b.ok){if(y("Sync",b)){await e();return}throw new Error(b.message)}await o()}),handlePull:()=>h(async()=>{await ZM(),await o()}),handleFixDivergence:()=>m(async()=>{const b=await eL();if(!b.ok){if(y("Fix",b)){await e();return}throw new Error(b.message)}await o()})}}function _0(e){const t=e.match(/Found (\d+) errors?\./);return t?Number(t[1]):0}function nU(e,t){const n=_0(e)+_0(t);return n>0?`${n} lint/format issue${n===1?"":"s"} found.`:"Lint or format check failed."}function rU(e){const t=e.match(/Tests\s+(\d+) failed/);return t?`${t[1]} test${t[1]==="1"?"":"s"} failed.`:"Tests failed."}const AS=({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"})]}),MS=({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"})]}),LS=({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"})]}),Nu=({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"})]}),sU=({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"})]}),DS=({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"})]}),iU=({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"})]}),oU=({size:e=12})=>f.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:[f.jsx("circle",{cx:"10",cy:"10",r:"3"}),f.jsx("path",{d:"M2.5 10h4.5M13 10h4.5"})]}),aU=({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"})}),Jm=({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"})]}),FS=({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"})]}),lU=["core","cli","app","server","agent","plans","ideas","docs","settings","stack","ui","ci","config","deps","repo"];function cU(e){var s;if(!e||e.phases.length>0&&e.phases.every(i=>i.done))return{title:""};const t=((s=e.tags)==null?void 0:s.find(i=>lU.includes(i)))??"repo";return{title:`${e.kind??"feat"}(${t}): ${e.title}`}}const uU=()=>{var A,O,z;const e=F(P=>P.status),t=F(P=>P.runCheck),n=F(P=>P.fixQuality),r=F(P=>P.consistency),s=F(P=>P.plans),i=F(P=>P.gitBranch),o=F(P=>P.gitAhead),a=F(P=>P.gitBehind),l=F(P=>P.gitDiverged),c=tn(),[u,d]=_.useState(!1),{fixingDivergence:h,gitActionBusy:p,handleFixDivergence:m}=Iu(),{qualityStatus:y,testStatus:w,consistencyStatus:g}=_.useMemo(()=>Ck(e),[e]),x=y==="running"||w==="running"||g==="running",v=r.length>0,b=_.useCallback(P=>P.planId?s==null?void 0:s.entries.find(L=>L.id===P.planId):void 0,[s==null?void 0:s.entries]),S=_.useCallback(P=>{const L=b(P);L&&c({to:"/plans/$planId",params:{planId:encodeURIComponent(L.title)}})},[b,c]),k={...Qn,stale:"transparent"},j={...qn,stale:void 0},E=x,R=v;`${((A=e==null?void 0:e.lint)==null?void 0:A.output)||"(none)"}${((O=e==null?void 0:e.format)==null?void 0:O.output)||"(none)"}`;const T=`Fix the failing tests in this repo. Output from the last test run:
80
-
81
- ${((z=e==null?void 0:e.test)==null?void 0:z.output)||"(no output captured)"}`,N=P=>f.jsx(Ie,{content:P.title,surface:"chalkboard",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] ${E?"cursor-not-allowed":"cursor-pointer"} ${E&&P.status!=="running"?"opacity-50":"opacity-100"}`,onClick:()=>{E||P.onClick()},disabled:E,children:f.jsxs(Ne,{surface:"chalkboard",size:"small",fillColor:k[P.status],textColor:j[P.status],children:[P.label,f.jsx("span",{className:P.status==="running"?"visible":"invisible",children:"…"})]})})});return f.jsxs("div",{className:"flex-none flex flex-col gap-3",children:[f.jsxs("div",{className:"flex gap-2 flex-wrap justify-center",children:[N({label:"Quality",status:y,title:"Code style & formatting (Biome lint + format). Click to run.",onClick:()=>{t("lint"),t("format")}}),N({label:"Tests",status:w,title:"Unit tests (Vitest). Click to run.",onClick:()=>t("test")}),N({label:"Consistency",status:g,title:"Dead code & architecture (Knip + dependency-cruiser). Click to run.",onClick:()=>t("consistency")}),f.jsxs("div",{children:[f.jsx(Ie,{content:R?"Plan/idea doc findings — orphan subjects, title style & stale references. Click to show.":"Plan/idea docs — no findings (orphan subjects, title style, stale references).",surface:"chalkboard",children:f.jsx("button",{type:"button",className:`inline-flex bg-none bg-transparent border-none p-0 ${R?"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:!R,"aria-expanded":R?u:void 0,"aria-controls":"stack-doc-findings",onClick:()=>{R&&d(P=>!P)},children:f.jsx(Ne,{surface:"chalkboard",size:"small",fillColor:R?Qn.fail:Qn.pass,textColor:R?qn.fail:qn.pass,children:"Docs"})})}),u&&R&&f.jsx("div",{id:"stack-doc-findings",className:"mt-2 flex flex-col gap-2",children:r.map((P,L)=>f.jsx("div",{className:"font-mono text-2xs text-desk-text-muted",children:b(P)?f.jsx("button",{type:"button",onClick:()=>S(P),className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit] text-left",children:P.message}):f.jsx("span",{className:"text-left",children:P.message})},`${P.kind}-${P.title}-${L}`))})]})]}),(()=>{var B,M,$;let P,L=null;return E?P=f.jsx("span",{className:"text-desk-text-muted",children:"Running checks…"}):l?(P=f.jsxs("span",{className:"text-desk-text-muted",children:[i," has diverged from origin (",o," local, ",a," remote)"]}),L=f.jsx("button",{type:"button",onClick:m,disabled:p,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 [font:inherit]",children:h?"Fixing…":"Suggested fix: Fix git issues"})):y==="fail"?(P=f.jsx("span",{className:"text-desk-text-muted",children:nU(((B=e==null?void 0:e.lint)==null?void 0:B.output)??"",((M=e==null?void 0:e.format)==null?void 0:M.output)??"")}),L=f.jsx("button",{type:"button",onClick:n,className:"bg-none bg-transparent border-none p-0 text-desk-chalk underline cursor-pointer [font:inherit]",children:"Suggested fix: run biome --write"})):w==="fail"?(P=f.jsx("span",{className:"text-desk-text-muted",children:rU((($=e==null?void 0:e.test)==null?void 0:$.output)??"")}),L=f.jsxs("span",{className:"text-desk-chalk",children:["Suggested fix: ",f.jsx(qh,{text:T,surface:"chalkboard"})]})):g==="fail"?(P=f.jsx("span",{className:"text-desk-text-muted",children:"Codebase consistency failed (knip / dependency-cruiser)."}),L=f.jsx("span",{className:"text-desk-text-muted opacity-80",children:"Run pnpm run consistency for details."})):v?P=f.jsx("span",{className:"text-desk-text-muted",children:"Plan doc issues — see the Docs stamp."}):y==="pass"&&w==="pass"&&g==="pass"?P=f.jsx("span",{className:"text-chalk-pass-text",children:"All checks passing."}):P=f.jsx("span",{className:"text-desk-text-muted opacity-60",children:"Checks haven't run yet."}),f.jsxs("div",{className:"text-center flex flex-col gap-1 font-handwritten text-sm",children:[P,f.jsx("span",{className:L?"visible":"invisible",children:L??" "})]})})()]})},dU=({count:e})=>{const t=tn();return f.jsxs("button",{type:"button",onClick:()=>t({to:"/diff"}),className:"block mx-auto bg-none bg-transparent border-none p-0 text-center font-mono text-xs text-desk-text-muted underline cursor-pointer",children:[e," file",e===1?"":"s"," changed"]})},fU=({files:e})=>{const t=F(S=>S.plans),n=F(S=>S.agentStatus),r=F(S=>S.loadGitStatus),s=F(S=>S.commitInFlight),i=F(S=>S.setCommitInFlight),{toast:o}=We(),[a,l]=_.useState(""),[c,u]=_.useState(!1),[d,h]=_.useState(!1),[p,m]=_.useState(null),y=_.useMemo(()=>jM(t==null?void 0:t.entries),[t==null?void 0:t.entries]),{title:w}=_.useMemo(()=>cU(y),[y]);_.useEffect(()=>{w&&!a&&l(w)},[w,a]);const g=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{if(g.current===null){if(n.length===0)return;g.current=new Set(n.filter(k=>k.suggestedCommit).map(k=>k.id))}const S=n.find(k=>{var j;return k.suggestedCommit&&!((j=g.current)!=null&&j.has(k.id))});!(S!=null&&S.suggestedCommit)||x.current===S.id||(x.current=S.id,l(S.suggestedCommit.title))},[n]);const v=_.useCallback(async()=>{if(!(!a.trim()||s)){u(!0),i(!0);try{await _k(e,a.trim()),l(""),await r()}catch(S){o({title:"Commit failed",description:Y8(S.message),variant:"error"}),await r()}finally{u(!1),i(!1)}}},[a,e,r,s,i,o]),b=_.useCallback(async()=>{if(e.length!==0){h(!0),m(null);try{const S=await Sk(e);l(S.title)}catch(S){m(S.message)}finally{h(!1)}}},[e]);return f.jsxs(f.Fragment,{children:[p&&f.jsx(TS,{surface:"chalkboard",dismissible:!0,onDismiss:()=>m(null),children:p}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx("div",{className:"flex-1",children:f.jsx(ja,{surface:"chalkboard",size:"small",placeholder:"Commit title",value:a,onChange:S=>l(S.currentTarget.value)})}),f.jsx(Ct,{icon:f.jsx(AS,{size:16}),surface:"chalkboard",size:"small",label:"Suggest title and message from the diff",disabled:e.length===0||d,onClick:b,wobble:d?1:0})]}),f.jsx(te,{surface:"chalkboard",size:"small",fullWidth:!0,disabled:e.length===0||!a.trim()||c||s,onClick:v,children:c||s?"Committing…":"Commit"})]})},hU=()=>{const{syncing:e,gitActionBusy:t,handleSync:n}=Iu();return f.jsx(te,{surface:"chalkboard",size:"small",fullWidth:!0,icon:f.jsx(Nu,{size:14}),disabled:t,onClick:n,children:e?"Syncing…":"Branch merged — sync to main"})},pU=({gitAhead:e,gitBranchHygiene:t})=>{const{pushing:n,syncing:r,pulling:s,gitActionBusy:i,handlePush:o,handleSync:a,handlePull:l}=Iu();return e>0?f.jsxs(f.Fragment,{children:[f.jsxs("p",{className:"opacity-50 text-xs m-0",children:["All changes committed — ",e," commit",e===1?"":"s"," ready to push."]}),f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(MS,{size:14}),disabled:i,onClick:o,children:n?"Pushing…":`Push ${e} commit${e===1?"":"s"}`})]}):f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"opacity-50 text-xs m-0",children:"No changed files."}),f.jsxs("div",{className:"flex gap-2 items-center",children:[f.jsx(Ie,{content:t==="clean-on-main"?"Already on clean main":void 0,surface:"chalkboard",children:f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(Nu,{size:14}),disabled:i||t==="clean-on-main",onClick:a,children:r?"Syncing…":"Sync to main"})}),f.jsx(te,{surface:"chalkboard",size:"small",icon:f.jsx(LS,{size:14}),disabled:i,onClick:l,children:s?"Pulling…":"Pull"})]})]})},mU=()=>{const e=F(s=>s.gitStatus),t=F(s=>s.gitAhead),n=F(s=>s.gitBranchHygiene),r=_.useMemo(()=>(e==null?void 0:e.map(s=>s.path))??[],[e]);return f.jsxs("div",{className:"flex-none flex flex-col p-6",children:[f.jsx("div",{className:NS,children:"Deliver"}),f.jsxs(Le,{surface:"chalkboard",size:"small",children:[f.jsx(uU,{}),e&&e.length>0?f.jsxs(f.Fragment,{children:[f.jsx(dU,{count:e.length}),f.jsx("div",{className:"flex-shrink-0 flex flex-col gap-3 mt-3",children:n==="stale-merged"?f.jsx(hU,{}):f.jsx(fU,{files:r})})]}):f.jsx("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-3",children:f.jsx(pU,{gitAhead:t,gitBranchHygiene:n})})]})]})},gU=({open:e,onToggle:t,pinned:n=!1})=>{const r=e||n,s=F(k=>k.loadPlans),i=F(k=>k.status),o=F(k=>k.loadStatus),a=F(k=>k.consistency),l=F(k=>k.loadConsistency),c=F(k=>k.loadGitStatus),u=F(k=>k.agentStatus),d=F(k=>k.loadAgentStatus),h=F(k=>k.loadSuggestions),p=F(k=>k.loadArchivableIdeas),m=Cu(),y=_.useRef({loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p});_.useEffect(()=>{y.current={loadPlans:s,loadStatus:o,loadConsistency:l,loadGitStatus:c,loadAgentStatus:d,loadSuggestions:h,loadArchivableIdeas:p}}),_.useEffect(()=>{y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},[]),_.useEffect(()=>{const k=()=>{y.current.loadPlans(),y.current.loadGitStatus()};return window.addEventListener("focus",k),()=>window.removeEventListener("focus",k)},[]),_.useEffect(()=>{const k=new EventSource("/api/activity/stream"),j={},E=(R,T,N)=>{j[R]&&clearTimeout(j[R]),j[R]=setTimeout(T,N)};return k.onmessage=R=>{const T=JSON.parse(R.data);if(T.type==="status"){E("status",()=>y.current.loadStatus(),80);return}if(T.type==="agent"){E("agent",()=>y.current.loadAgentStatus(),120);return}T.message==="changed"&&E("activity",()=>{y.current.loadPlans(),y.current.loadSuggestions(),y.current.loadStatus(),y.current.loadConsistency(),y.current.loadGitStatus(),y.current.loadAgentStatus(),y.current.loadArchivableIdeas()},250)},()=>{for(const R of Object.values(j))R&&clearTimeout(R);k.close()}},[]);const{qualityStatus:w,testStatus:g,consistencyStatus:x}=_.useMemo(()=>Ck(i),[i]),v=a.length>0,b=w==="fail"||g==="fail"||x==="fail"||v,S=u.some(k=>k.status==="running"||k.status==="starting"||k.status==="stopping");return f.jsxs(f.Fragment,{children:[f.jsx(dS,{children:!r&&f.jsx(Ai.div,{initial:m?void 0:{opacity:0,x:20},animate:{opacity:1,x:0},exit:m?void 0:{opacity:0,x:20},transition:{duration:m?0:.2,ease:"easeOut"},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(Ct,{icon:S?f.jsx(Rs,{size:"small",surface:"chalkboard",label:"Agent running"}):b?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:S?"Open stack panel — agent running":b?"Open stack panel — checks failing":"Open stack panel",onClick:t,className:`w-7 h-[64px] rounded-l-md ${S?"shadow-[inset_0_0_0_1px_rgba(214,196,160,0.6)]":b?"shadow-[inset_0_0_0_1px_rgba(214,160,160,0.6)]":""}`})})}),f.jsxs(Ai.div,{animate:{x:r?0:"100%"},transition:{duration:m?0:.3,ease:[.4,0,.2,1]},className:"fixed inset-y-0 right-0 z-[300] flex w-[min(480px,100vw)] flex-col overflow-hidden border-l-4 border-paper-950/[12%] text-desk-text bg-desk-bg bg-chalkboard [background-repeat:repeat,no-repeat] [background-size:200px_200px,auto]",children:[f.jsxs("div",{className:"flex h-20 shrink-0 items-center justify-between px-6",children:[f.jsx("span",{className:"font-display-luminari text-base font-bold text-desk-chalk",children:"Stack"}),!n&&f.jsx(Ct,{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(b0,{surface:"chalkboard"}),f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(tU,{}),f.jsx(b0,{surface:"chalkboard"}),f.jsx(mU,{})]})]})]})},yU=e=>e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()),xU=()=>{const[e,t]=_.useState(null),[n,r]=_.useState(null),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return i(!0),Promise.all([BA().then(a=>{!o&&a&&t(yU(a))}),zA().then(a=>{o||r(a)})]).finally(()=>{o||i(!1)}),()=>{o=!0}},[]),{projectName:e,iconDataUri:n,loading:s}},vU=["repo-docs","release-notes"],wU=["subjects","setup","merge-policy"];function Zm(){const{planId:e}=Fi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function bU(){const{ideaId:e}=Fi({strict:!1});return typeof e=="string"?decodeURIComponent(e):null}function kU(){const{section:e}=Fi({strict:!1});return vU.includes(e)?e:null}function L9(){const{section:e}=Fi({strict:!1});return wU.includes(e)?e:null}function D9(){const e=kU(),t=F(r=>r.activeDocTitle),n=F(r=>r.repoDocs);return e??(t&&n.some(r=>r.name===t)?"repo-docs":null)}const _U=250;function OS(e,t,n={}){const{debounceMs:r=_U,...s}=n,[i,o]=_.useState(e);_.useEffect(()=>{const c=setTimeout(()=>o(e),r);return()=>clearTimeout(c)},[e,r]);const{threshold:a,limit:l}=s;return _.useMemo(()=>HM(i,t,{threshold:a,limit:l}),[i,t,a,l])}const zS=()=>{const[e,t]=_.useState([]),[n,r]=_.useState(!0),[s,i]=_.useState(!0);return _.useEffect(()=>{let o=!1;return hk().then(a=>{o||(t((a==null?void 0:a.subjects)??[]),i(a!==null),r(!1))}),()=>{o=!0}},[]),{subjects:e,loading:n,available:s}},SU=({size:e="md"})=>{const{projectName:t,iconDataUri:n,loading:r}=xU();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(l6,{icon:f.jsx(y$,{}),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"})]})},CU=()=>{const[e,t]=_.useState(null);return _.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};function BS(e,t=0){return e?{duration:0,ease:"easeOut"}:{duration:.18,ease:"easeOut",delay:t}}function $S(e,t={y:8}){return{initial:e?void 0:{opacity:0,...t},animate:{opacity:1,x:0,y:0}}}const PU=({routeKey:e,children:t,mobileOpen:n,onMobileClose:r})=>{const s=Cu(),i=_.useRef(null);return _.useEffect(()=>{if(!n)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,r]),_.useEffect(()=>{var a;if(!n)return;const o=document.activeElement;return(a=i.current)==null||a.focus(),()=>{var l;return(l=o==null?void 0:o.focus)==null?void 0:l.call(o)}},[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.jsx("aside",{ref:i,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 transition-transform duration-300 ease-out 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:"flex-1 overflow-y-auto pt-5 relative",children:f.jsx(Ai.div,{...$S(s,{x:-8}),transition:BS(s,.08),children:t},e)})})]})},jU={...Ca("kraft"),display:"flex",alignItems:"center",gap:"0.75rem",height:"2rem",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid rgba(0, 0, 0, 0.08)",fontSize:"0.75rem",flexShrink:0,boxSizing:"border-box",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap"},EU={display:"flex",alignItems:"center",gap:"0.75rem",flexShrink:0},TU={display:"flex",alignItems:"center",gap:"0.25rem"},RU={opacity:.5},IU={color:"var(--pui-text-primary)"},S0={opacity:.6},NU={flex:1},C0={display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},kl={fontSize:"0.75rem"},P0={background:"none",backgroundColor:"transparent",border:"none",padding:0,cursor:"pointer"},AU=({gitBranch:e,gitAhead:t,changedFileCount:n,agentActive:r,activeTaskStatus:s,agentNotSignedIn:i,capabilityGapCount:o,gitBranchHygiene:a,commitInFlight:l,gitActionBusy:c,pushing:u,syncing:d,pulling:h,onSync:p,onPush:m,onPull:y,onQuickCommit:w,onOpenSetup:g,trailing:x})=>f.jsxs("div",{style:jU,children:[f.jsxs("div",{style:EU,children:[f.jsxs("span",{style:TU,children:[f.jsx("span",{style:RU,children:"⌥"}),f.jsx("code",{style:IU,children:e??"no branch"})]}),t>0&&f.jsxs("span",{style:S0,children:["↑",t]}),f.jsx("span",{style:S0,children:n>0?`${n} changed`:"clean"}),r&&f.jsx(Rs,{size:"small",label:`Agent ${s}…`}),i&&f.jsx(Ie,{content:"Sign in from Settings → Connections so agent tasks can run",children:f.jsx("button",{type:"button",onClick:g,style:P0,children:f.jsx(Ne,{size:"small",variant:"warning",children:"Agent not signed in"})})}),o>0&&f.jsx(Ie,{content:"Some features are disabled — open Setup to fix",children:f.jsx("button",{type:"button",onClick:g,style:P0,children:f.jsxs(Ne,{size:"small",variant:"warning",children:["Setup (",o,")"]})})})]}),f.jsx("div",{style:NU}),x&&f.jsx("div",{style:C0,children:x}),f.jsxs("div",{style:C0,children:[f.jsx(Ie,{content:a==="clean-on-main"?"Already on clean main":"Sync to main",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(Nu,{}),style:kl,disabled:c||a==="clean-on-main",onClick:p,children:d?"Syncing…":"Sync to main"})}),f.jsx(Ie,{content:"Push commits to origin",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(MS,{}),style:kl,disabled:c||t===0,onClick:m,children:u?"Pushing…":t>0?`Push (${t})`:"Push"})}),f.jsx(Ie,{content:"Fast-forward the current branch from origin",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(LS,{}),style:kl,disabled:c,onClick:y,children:h?"Pulling…":"Pull"})}),f.jsx(Ie,{content:"Commit all changes with an auto-suggested message",children:f.jsx(te,{variant:"ghost",size:"small",icon:f.jsx(oU,{}),style:kl,disabled:l||n===0,onClick:w,children:l?"Committing…":n>0?`Commit (${n})`:"Commit"})})]})]}),MU=()=>{const e=F(j=>j.agentStatus),t=F(j=>j.gitStatus),n=F(j=>j.gitBranch),r=F(j=>j.gitAhead),s=F(j=>j.gitBranchHygiene),i=F(j=>j.quickCommit),o=F(j=>j.commitInFlight),a=F(dL),l=F(fL),{pushing:c,syncing:u,pulling:d,gitActionBusy:h,handlePush:p,handleSync:m,handlePull:y}=Iu(),{toast:w}=We(),g=tn(),x=e.find(j=>j.status==="running"||j.status==="starting"||j.status==="stopping"),v=x!==void 0,b=(t==null?void 0:t.length)??0,S=async()=>{if(o||b===0)return;const j=await i();j.ok?w({title:"Committed",description:j.warning??j.title,variant:j.warning?"warning":"success"}):w({title:"Commit failed",description:j.error,variant:"error"})},k=()=>g({to:"/settings/$section",params:{section:"setup"}});return f.jsx(AU,{gitBranch:n,gitAhead:r,changedFileCount:b,agentActive:v,activeTaskStatus:x==null?void 0:x.status,agentNotSignedIn:l,capabilityGapCount:a,gitBranchHygiene:s,commitInFlight:o,gitActionBusy:h,pushing:c,syncing:u,pulling:d,onSync:m,onPush:p,onPull:y,onQuickCommit:S,onOpenSetup:k})},LU=({children:e})=>f.jsx("h1",{className:"text-4xl font-display-luminari font-semibold text-ink-900 mb-6 leading-[1.1]",children:e}),DU=3*6e4,FU=(e,t)=>{const n=F(o=>o.loadPlans),r=e.thread??[],s=r[r.length-1],i=e.id;_.useEffect(()=>{if(!i||!s||s.kind!=="chat")return;const o=setTimeout(()=>{ZA(i).then(a=>{if(!a.skipped)return n()}).catch(()=>{})},DU);return()=>clearTimeout(o)},[t,i,s,n])},Ta=()=>{const e=F(i=>i.loadPlans),{toast:t}=We(),[n,r]=_.useState(!1);return{patch:async(i,o,a)=>{r(!0);try{return await wM(i,o),await e(),!0}catch(l){return t({title:(a==null?void 0:a.errorTitle)??"Update failed",description:l.message,variant:"error"}),!1}finally{r(!1)}},updating:n}},OU=e=>{const t=F(a=>a.loadPlans),{toast:n}=We(),[r,s]=_.useState(null);return{promotingIndex:r,promoteToDurable:async(a,l)=>{if(!(!e.id||r!==null)){s(a);try{await Ix(e.id,a,l),await t()}catch(c){n({title:"Promote failed",description:Ue(c.message),variant:"error"})}finally{s(null)}}},promoteToIdea:async(a,l)=>{if(!e.id||r!==null)return!1;s(a);try{const c=await mk(l);return await Ix(e.id,a,"log",`Captured as ${c}: ${l.title}`).catch(()=>{}),await t(),!0}catch(c){return n({title:"Promote failed",description:Ue(c.message),variant:"error"}),!1}finally{s(null)}}}},zU=(e,{reload:t,notify:n})=>{const[r,s]=_.useState(!1),[i,o]=_.useState(!1),[a,l]=_.useState(null);return _.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 JA(e.id,d,h);return await t(),m&&l(m),p&&n({title:"Agent did not reply",description:Ue(p),variant:"error"}),!0}catch(h){return n({title:"Message failed to send",description:Ue(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 eM(e.id,a.commitSha);if(d){n({title:"Undo failed",description:Ue(d),variant:"error"});return}l(null),await t()}catch(d){n({title:"Undo failed",description:Ue(d.message),variant:"error"})}finally{o(!1)}}}}},BU=async e=>{const t=await fetch(`/api/trail?id=${encodeURIComponent(e)}`);if(!t.ok)throw new Error("Failed to load the provenance trail");return t.json()},$U=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{if(n(null),!e)return;let r=!1;return BU(e).then(s=>{r||n(s)}).catch(()=>{}),()=>{r=!0}},[e]),t};function VS(){const[e,t]=_.useState("idle"),[n,r]=_.useState(null),s=_.useRef(null),i=_.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=_.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 eg="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.",US="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 VU(e){const t=e.phases.map((s,i)=>`${i+1}. [${s.done?"x":" "}] ${s.text}`).join(`
82
- `),n=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
83
- `):"(none)",r=e.clarifications&&e.clarifications.length>0?e.clarifications.map(s=>`- ${s.date}: ${s.text}`).join(`
84
- `):"(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.
85
-
86
- Plan body: ${e.body}
87
-
88
- Current phases:
89
- ${t}
90
-
91
- Log entries (issues, bugs, and review notes recorded so far):
92
- ${n}
93
-
94
- Clarifications (answered scope/design questions):
95
- ${r}
96
-
97
- ${eg}
98
-
99
- Task:
100
- 1. Read the plan above, then inspect the relevant code in this repo.
101
- 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.
102
- 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.
103
- 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.
104
-
105
- Rules:
106
- - Never modify, reorder, check, uncheck, or delete any existing line, even if it looks stale, wrong, or redundant.
107
- - Never touch the YAML frontmatter.
108
- - Append only: new unchecked phases at the end of the list, plus the single Log line.`}function UU(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(`
109
- `):"(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.
110
-
111
- ${t?"Plan":"Idea"} body: ${e.body}
112
-
113
- Current phases:
114
- ${r}
115
-
116
- 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.
117
-
118
- 1. Read the ${n} above, then inspect the relevant code in this repo to find what has actually changed since the prose was written.
119
- 2. Reword only the sentences or phrases that are now stale: fix references and superseded approaches. Leave everything else byte-identical.
120
- 3. Do not summarize, restructure, or "improve" prose that is still accurate — an unnecessary rewrite is a failure of this task, not a bonus.
121
-
122
- Hard guardrails, never violate these:
123
- - Never touch the YAML frontmatter (id, title, kind, status, created, idea, tags, or any other field).
124
- - Never un-check, check, delete, or reorder any phase line, checked or unchecked.
125
- - Never add or remove phases.
126
- - Never touch the Log or Clarifications sections.
127
- - If nothing is stale, make no edits at all.`}function tg(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.
128
-
129
- ${n}
130
-
131
- ${eg}
132
-
133
- Task:
134
- 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.
135
- 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.
136
- 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).
137
-
138
- Keep unchanged:
139
- ${r}
140
-
141
- Append only — never rewrite or delete the idea's existing body or prior Log lines.`}function WU(e){const t=e.log&&e.log.length>0?e.log.map(s=>`- ${s.date}: ${s.text}`).join(`
142
- `):"(none)",n=`Current idea body, in full (do not modify this):
143
- ${e.body}
144
-
145
- Prior Log entries:
146
- ${t}`,r=`- the YAML frontmatter (id, title)
147
- - the \`## ${e.id??"IDEA-N"}: ${e.title}\` heading line and the original body prose beneath it`;return tg(e,"expanding",n,r)}const WS=`- the YAML frontmatter (id, title, status)
148
- - the original body prose beneath the frontmatter`;function HU(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:
149
- ${e.body}`;return tg(e,"fleshing out",t,WS)}function F9(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:
150
- ${e.body}`;return tg(e,"fleshing out",n,WS)}function GU(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(`
151
- `):"(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.
152
-
153
- Idea body, in full:
154
- ${e.body}
155
-
156
- ## What drafting adds to the file (see papercamp/about.md)
157
-
158
- The file already has YAML frontmatter (id, title, status, created, …) and the prose body above. Drafting means:
159
-
160
- 1. Add a \`type\` field to the frontmatter: the Conventional Commits type that best fits (\`feat | fix | chore | docs | refactor\` — most are \`feat\`).
161
- 2. Add 1-4 short subsystem \`tags\` to the frontmatter if it has none.
162
- 3. Append a \`### Phases\` checklist at the end of the file (after any \`### Log\` section move it below the phases — Phases, then Log):
163
-
164
- \`\`\`
165
- ### Phases
166
- - [ ] Short phase title
167
- Optional description of the phase, indented with 6 spaces.
168
- \`\`\`
169
-
170
- ${eg}
171
-
172
- Hard rules:
173
- - Never change the \`id\`, \`title\`, \`status\`, or \`created\` fields — \`status\` stays exactly \`idea\`; a human promotes it after reviewing your draft. (${US} Leave the existing title as-is even if it breaks this; never expand it into a symptom-sentence.)
174
- - Never rewrite or delete the existing prose body or \`### Log\` entries — the idea's history stays intact.
175
- - Phases: actionable steps a future agent or human could pick up one at a time, not one giant phase.
176
-
177
- ## Every other open (non-done) plan, for scope context
178
-
179
- ${r}
180
-
181
- 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 KU(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}
182
- ${s.body}`).join(`
183
-
184
- `):"(no ideas yet)",r=t.length?t.map(s=>`- ${s.date}: ${s.title} — ${s.description}`).join(`
185
- `):"(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.
186
-
187
- Existing ideas (do not repeat anything already covered here):
188
- ${n}
189
-
190
- Existing suggestions already in the holding pen (do not repeat these either):
191
- ${r}
192
-
193
- Task:
194
- 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.
195
- 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. ${US} Keep the description to a single physical line (no literal line breaks).
196
- 3. If you find nothing worth suggesting, make no edits at all — no empty line, no placeholder.
197
-
198
- Rules:
199
- - Append only — never modify, reorder, or delete any existing line in suggestions.md.
200
- - Never create papercamp/ideas/ files or touch ideas/index.md — a suggestion is not an idea until a human promotes it.
201
- - Never touch any other file in the repo.`}const Au=({idea:e,otherPlans:t})=>{const n=F(d=>d.launchPlanDraft),r=F(Jr),{state:s,errorMessage:i,run:o}=VS(),{toast:a}=We(),l=()=>{const d=e.id;d&&o(async()=>{try{await n(d,GU(e,t))}catch(h){throw a({title:"Draft failed",description:Ue(h.message),variant:"error"}),h}})},c=s==="loading"?"Drafting…":s==="success"?"Draft sent!":s==="error"?"Draft failed":"Draft plan",u=s==="error"?i??"Draft failed":e.id?r?void 0:"No agent CLI found — set up in Settings":"Idea needs an ID before an agent can run";return f.jsx(Ie,{content:u,children:f.jsx(te,{variant:"ghost",size:"small",onClick:l,disabled:s==="loading"||!e.id||!r,className:s==="error"?"text-watercolor-rose-dark":"text-ink-500",children:c})})},HS=({children:e,collapsedLines:t=3,resetKey:n})=>{const r=_.useRef(null),[s,i]=_.useState(!1),[o,a]=_.useState(!1);return _.useLayoutEffect(()=>i(!1),[n]),_.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"})]})},QU={review:"review",note:"note",decision:"decision",question:"question",clarification:"clarification"},qU=({messages:e,undo:t,undoing:n,onUndo:r,onPromote:s,promotingIndex:i})=>f.jsx(f.Fragment,{children:e.map((o,a)=>{const l=QU[o.kind],c=o.from==="agent",u=a===e.length-1,d=[{id:"decision",label:"Promote to decision",icon:f.jsx(Xm,{size:16}),onSelect:()=>s==null?void 0:s(a,"decision")},{id:"log",label:"Promote to log",icon:f.jsx(FS,{size:16}),onSelect:()=>s==null?void 0:s(a,"log")},{id:"idea",label:"Promote to idea",icon:f.jsx(PS,{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(Le,{size:"small",surface:"paper",texture:c?"kraft":l?"canvas":"parchment",shade:c,accent:!c,accentColor:l?"rose":"blue",children:f.jsx(HS,{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(Ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:"agent"}),c&&u&&t&&f.jsx(Ie,{content:"Revert this run's plan edit",children:f.jsx(te,{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(Ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:l}),s&&o.kind==="chat"&&(i===a?f.jsx(Rs,{size:"small",label:"Promoting…"}):f.jsx(IS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(DS,{size:14}),label:"Promote this message",size:"small",variant:"ghost"}),items:d}))]})]},`${o.kind}-${o.date??""}-${a}`)})}),es=({id:e})=>e?f.jsx(Ne,{size:"small",fillColor:"rgba(0,0,0,0.08)",children:e}):null,GS={"in-progress":"#C89A5A",planned:"#6A9B72",idea:"#8A9BAA",review:"#9B7AB5",done:"#8A7A8A",dropped:"#A06060"},ng={idea:"Idea",planned:"Planned","in-progress":"In progress",review:"Review",done:"Done",dropped:"Dropped"},sr={idea:{fill:"rgba(138, 155, 168, 0.25)",text:"#5E7080"},planned:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},"in-progress":{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F"},review:{fill:"rgba(155, 122, 181, 0.25)",text:"#7B5E9E"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},KS={open:"Open",done:"Done",dropped:"Dropped"},Kc={open:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},done:{fill:"rgba(168, 155, 168, 0.25)",text:"#6E5E6E"},dropped:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A"}},YU={draft:"Draft",open:"Open",closed:"Closed",merged:"Merged"},j0={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"}},XU={approved:"Approved","changes-requested":"Changes requested","review-required":"Review required"},E0={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"}},QS=({pr:e})=>f.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"no-underline inline-flex",children:f.jsx(Ne,{size:"small",fillColor:j0[e.state].fill,textColor:j0[e.state].text,children:f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(aU,{}),"#",e.number," ",YU[e.state]]})})}),qS=({pct:e,color:t,height:n=6})=>f.jsx(zV,{value:e,color:t,height:n}),T0={fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66"},R0={fill:"rgba(0, 0, 0, 0.05)",text:"rgba(0, 0, 0, 0.35)"},_l=({reached:e,label:t,tooltip:n,href:r})=>{const s=f.jsx(Ne,{size:"small",fillColor:e?T0.fill:R0.fill,textColor:e?T0.text:R0.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(Ie,{content:n,children:i}):i},lf=()=>f.jsx("span",{className:"opacity-30","aria-hidden":"true",children:"→"}),I0=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function JU(e){const t=e.match(/\(\[([0-9a-f]+)\]\((\S+)\)\)\s*$/);return t?{hash:t[1],url:t[2]}:void 0}const ZU=({trail:e,released:t})=>{var l,c;const{taskRuns:n,commits:r,pr:s,releaseLine:i}=e,o=i.data?JU(i.data):void 0,a=t?`Released ${t}`:o?`Released ${o.hash}`:"Release";return f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(_l,{reached:n.reached,label:n.data?I0(n.data.length,"task run"):"Tasks",tooltip:(l=n.data)==null?void 0:l.map(u=>u.taskKind).join(", ")}),f.jsx(lf,{}),f.jsx(_l,{reached:r.reached,label:r.data?I0(r.data.length,"commit"):"Commits",tooltip:(c=r.data)==null?void 0:c.join(`
202
- `)}),f.jsx(lf,{}),s.data?f.jsx(QS,{pr:s.data}):f.jsx(_l,{reached:!1,label:"PR"}),f.jsx(lf,{}),f.jsx(_l,{reached:i.reached||!!t,label:a,tooltip:i.data,href:o==null?void 0:o.url})]})},eW=({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(Ne,{size:"small",fillColor:E0[t].fill,textColor:E0[t].text,children:XU[t]}),!!n&&f.jsxs(Ne,{size:"small",fillColor:sr["in-progress"].fill,textColor:sr["in-progress"].text,children:[n," unaddressed comment",n===1?"":"s",r?" · new":""]})]})},YS=({open:e,onClose:t,onAdd:n,initialContent:r})=>{const[s,i]=_.useState(""),[o,a]=_.useState(""),[l,c]=_.useState(!1),[u,d]=_.useState(!1),[h,p]=_.useState(null),[m,y]=_.useState(null),[w,g]=_.useState(!1),[x,v]=_.useState(null),[b,S]=_.useState(null),k=F(P=>{var L;return((L=P.plans)==null?void 0:L.entries)??[]}),{patch:j}=Ta(),E=tn(),R=OS(s,k.map(P=>({id:P.id,title:P.title,body:P.body,tags:P.tags,log:P.log})));_.useEffect(()=>{e&&(i(""),a(r??""),c(!1),d(!1),p(null),g(!1),v(null),S(null))},[e,r]);const T=P=>{t(),E({to:"/plans/$planId",params:{planId:encodeURIComponent(P)}})},N=async()=>{const P=`${s.trim()}${o.trim()?`
203
-
204
- ${o.trim()}`:""}`;if(P){g(!0),S(null),v(null);try{const L=k.map(B=>({id:B.id,title:B.title,body:B.body,tags:B.tags}));v(await gk(P,L))}catch(L){S(L.message)}finally{g(!1)}}},A=P=>{const L=k.find(B=>B.id===P);L&&T(L.title)},O=async(P,L,B)=>{y(P);const $={date:new Date().toISOString().slice(0,10),text:s.trim()},C=await j(L,{log:[...B??[],$]},{errorTitle:"Extend failed"});y(null),C&&t()},z=async P=>{if(P.preventDefault(),!(!s.trim()||u)){p(null),d(!0);try{await n({title:s.trim(),content:o.trim()||void 0,kind:l?"note":void 0}),t()}catch(L){p(L.message)}finally{d(!1)}}};return f.jsx(Ea,{open:e,onClose:t,title:"New idea",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(ja,{label:"Title",value:s,onChange:P=>i(P.target.value),placeholder:"Idea title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:u,autoFocus:!0,required:!0}),R.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"}),R.map(({candidate:P})=>{const L={id:P.id??null,title:P.title,body:P.body,log:P.log},B=k.filter(M=>M.id!==P.id);return f.jsx(Le,{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(es,{id:P.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:P.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>T(P.title),children:"Open it"}),f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!P.id||!s.trim()||m!==null,onClick:()=>P.id&&O(P.id,P.title,P.log),children:m===P.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:L,otherPlans:B})]})]})},P.id??P.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!s.trim()||w,onClick:N,children:w?"Checking overlap…":"Check overlap"})}),b&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:b}),x&&f.jsx(Le,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:x.verdict==="new"?"Looks genuinely new":x.verdict==="extend"?`Extends ${x.targetId??"an existing idea"}`:`Belongs inside ${x.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:x.reasoning}),x.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>A(x.targetId),children:"Open it"})})]})})]}),f.jsx(Ru,{label:"Description",value:o,onChange:P=>a(P.target.value),placeholder:"Optional details…",disabled:u,rows:4}),f.jsx(T6,{label:"Just a note (no plan needed)",checked:l,onChange:P=>c(P.target.checked),disabled:u}),h&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:h}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:t,disabled:u,children:"Cancel"}),f.jsx(te,{type:"submit",variant:"primary",disabled:!s.trim()||u,children:"Add"})]})]})})},tW=({suggestion:e,onClose:t})=>{const n=F(u=>u.promoteSuggestion),r=F(u=>u.launchIdeaExtend),[s,i]=_.useState(!1),[o,a]=_.useState(null),{toast:l}=We();_.useEffect(()=>{e&&(i(!1),a(null))},[e]);const c=async()=>{if(e){i(!0),a(null);try{const u=await n(e),d=F.getState().ideaEntries.find(h=>h.id===u);if(d)try{await r(u,HU(d))}catch(h){l({title:"Idea created, but the refine agent failed to launch",description:Ue(h.message),variant:"error"})}t()}catch(u){a(u.message)}finally{i(!1)}}};return f.jsx(Ea,{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(te,{type:"button",variant:"ghost",onClick:t,disabled:s,children:"Cancel"}),f.jsx(te,{type:"button",variant:"primary",onClick:c,disabled:s,children:s?"Moving…":"Move to ideas"})]})]})})},cf=({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}`)})}),N0=e=>f.jsx("h4",{className:"font-display-luminari text-xs font-semibold mb-2 opacity-[0.65]",children:e}),nW=({plan:e,before:t,onApprove:n,onDiscard:r,queuePosition:s})=>{const[i,o]=_.useState(!1),[a,l]=_.useState(!1),c=e.body!==t.body,u=e.phases.map((m,y)=>({phase:m,before:t.phases[y],index:y})).filter(({phase:m,before:y})=>y!==void 0&&(m.text!==y.text||(m.description??"")!==(y.description??""))),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(Ea,{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:[N0("Body"),f.jsx("p",{className:"text-base m-0 leading-normal",children:f.jsx(cf,{tokens:Rd(t.body,e.body)})})]}),u.length>0&&f.jsxs("div",{children:[N0("Phases"),f.jsx("div",{className:"flex flex-col gap-3",children:u.map(({phase:m,before:y,index:w})=>f.jsxs("div",{className:"text-sm leading-normal",children:[f.jsx(cf,{tokens:Rd(y.text,m.text)}),(m.description||y.description)&&f.jsx("div",{className:"opacity-[0.85] mt-1",children:f.jsx(cf,{tokens:Rd(y.description??"",m.description??"")})})]},w))})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{variant:"danger",size:"small",onClick:h,disabled:d,children:"Discard"}),f.jsx(te,{variant:"primary",size:"small",onClick:p,disabled:d,children:"Approve"})]})]})})},rW=({onOpenIdea:e})=>{const t=F(d=>d.archivableIdeas),n=F(d=>d.archiveIdeas),[r,s]=_.useState(null),[i,o]=_.useState(!1),{toast:a}=We(),l=_.useCallback(async d=>{try{await n(d)}catch(h){a({title:"Archive failed",description:h.message,variant:"error"})}},[n,a]),c=_.useCallback(async d=>{s(d.id);try{await l([d.id])}finally{s(null)}},[l]),u=_.useCallback(async()=>{o(!0);try{await l(t.map(d=>d.id))}finally{o(!1)}},[l,t]);return t.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 (",t.length,")"]}),f.jsx(te,{variant:"ghost",size:"small",disabled:i||r!==null,onClick:u,children:i?"Archiving…":"Archive all"})]}),f.jsx("div",{className:"flex flex-col gap-1",children:t.map(d=>f.jsx("div",{className:"rounded-[10px]",children:f.jsx(Le,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("div",{role:e?"button":void 0,tabIndex:e?0:void 0,onClick:e?()=>e(d.title):void 0,onKeyDown:e?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e(d.title))}:void 0,className:`flex items-center gap-2 flex-1 min-w-0 ${e?"cursor-pointer":""}`,children:[f.jsx(es,{id:d.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:d.title})]}),f.jsx(te,{variant:"ghost",size:"small",disabled:r===d.id||i,onClick:()=>c(d),children:r===d.id?"Archiving…":"Archive"})]})})},d.id))})]})},sW="font-display-luminari font-semibold text-[1.75rem] leading-[1.2]",iW=({onAdd:e,disabled:t})=>{const[n,r]=_.useState(!1),[s,i]=_.useState(""),[o,a]=_.useState(null),[l,c]=_.useState(!1),u=()=>{r(!1),i(""),a(null)},d=async()=>{let h;try{h=QM(s)}catch(p){a(p instanceof Error?p.message:"Could not parse findings");return}c(!0),a(null);try{await e(h),u()}finally{c(!1)}};return f.jsxs(f.Fragment,{children:[f.jsx(Ie,{content:"Add code-review findings as phases",children:f.jsx(Ct,{variant:"ghost",size:"small",onClick:()=>r(!0),disabled:t,"aria-label":"Add code-review findings as phases",icon:f.jsx(x$,{size:16})})}),f.jsx(Ea,{open:n,onClose:u,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(Ru,{value:s,onChange:h=>i(h.target.value),placeholder:'[{ "description": "...", "file": "src/foo.ts", "line_start": 12, "failure_scenario": "..." }]',rows:10,disabled:l}),o&&f.jsxs(TS,{variant:"warning",children:["Could not add phases — ",o]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:u,disabled:l,children:"Cancel"}),f.jsx(te,{type:"button",variant:"primary",onClick:d,disabled:l||!s.trim(),children:"Add phases"})]})]})})]})},oW=RM.map(e=>({value:e,label:e})),aW=({open:e,onClose:t,onAdd:n})=>{const[r,s]=_.useState(""),[i,o]=_.useState(""),[a,l]=_.useState("feat"),[c,u]=_.useState(!1),[d,h]=_.useState(null),[p,m]=_.useState(null),[y,w]=_.useState(!1),[g,x]=_.useState(null),[v,b]=_.useState(null),S=F(P=>{var L;return((L=P.plans)==null?void 0:L.entries)??[]}),{patch:k}=Ta(),j=tn(),{toast:E}=We(),R=OS(r,S.map(P=>({id:P.id,title:P.title,body:P.body,tags:P.tags,log:P.log})));_.useEffect(()=>{e&&(s(""),o(""),l("feat"),u(!1),h(null),w(!1),x(null),b(null))},[e]),_.useEffect(()=>{x(null),b(null)},[r,i]);const T=P=>{t(),j({to:"/plans/$planId",params:{planId:encodeURIComponent(P)}})},N=async()=>{const P=`${r.trim()}${i.trim()?`
205
-
206
- ${i.trim()}`:""}`;if(P){w(!0),b(null),x(null);try{const L=S.map(B=>({id:B.id,title:B.title,body:B.body,tags:B.tags}));x(await gk(P,L))}catch(L){b(L.message)}finally{w(!1)}}},A=P=>{const L=S.find(B=>B.id===P);L?T(L.title):E({title:"Plan not found",description:`No plan with id ${P}`,variant:"error"})},O=async(P,L,B)=>{m(P);const $={date:new Date().toISOString().slice(0,10),text:r.trim()},C=await k(L,{log:[...B??[],$]},{errorTitle:"Extend failed"});m(null),C&&t()},z=async P=>{if(P.preventDefault(),!(!r.trim()||c)){h(null),u(!0);try{await n({title:r.trim(),content:i.trim()||void 0,kind:a}),t()}catch(L){h(L.message)}finally{u(!1)}}};return f.jsx(Ea,{open:e,onClose:t,title:"Quick plan",size:"small",children:f.jsxs("form",{onSubmit:z,className:"flex flex-col gap-4",children:[f.jsx(ja,{label:"Title",value:r,onChange:P=>s(P.target.value),placeholder:"Backlog item title…",helperText:"Noun/verb phrase, ≤40 chars — no subtitle; the detail goes in the description below.",disabled:c,autoFocus:!0,required:!0}),R.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"}),R.map(({candidate:P})=>{const L={id:P.id??null,title:P.title,body:P.body,log:P.log},B=S.filter(M=>M.id!==P.id);return f.jsx(Le,{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(es,{id:P.id}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:P.title})]}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>T(P.title),children:"Open it"}),f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!P.id||!r.trim()||p!==null,onClick:()=>P.id&&O(P.id,P.title,P.log),children:p===P.id?"Extending…":"Extend it instead"}),f.jsx(Au,{idea:L,otherPlans:B})]})]})},P.id??P.title)})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("div",{children:f.jsx(te,{type:"button",variant:"ghost",size:"small",disabled:!r.trim()||y,onClick:N,children:y?"Checking overlap…":"Check overlap"})}),v&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:v}),g&&f.jsx(Le,{size:"small",texture:"canvas",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("span",{className:"font-semibold",children:g.verdict==="new"?"Looks genuinely new":g.verdict==="extend"?`Extends ${g.targetId??"an existing idea"}`:`Belongs inside ${g.targetId??"an existing idea"}`}),f.jsx("span",{className:"text-sm opacity-80",children:g.reasoning}),g.targetId&&f.jsx("div",{className:"flex justify-end",children:f.jsx(te,{type:"button",variant:"ghost",size:"small",onClick:()=>A(g.targetId),children:"Open it"})})]})})]}),f.jsx(jS,{label:"Kind",value:a,onChange:P=>l(P),options:oW,disabled:c}),f.jsx(Ru,{label:"Description",value:i,onChange:P=>o(P.target.value),placeholder:"Optional details…",disabled:c,rows:4}),d&&f.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(te,{type:"button",variant:"ghost",onClick:t,disabled:c,children:"Cancel"}),f.jsx(te,{type:"submit",variant:"primary",disabled:!r.trim()||c,children:"Add"})]})]})})},lW=()=>f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("path",{d:"M10 6h10M10 12h10M10 18h10"}),f.jsx("path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"})]}),cW=()=>{const e=F(o=>o.loadPlans),t=F(o=>o.gitBranchHygiene),[n,r]=_.useState(!1),s=t==="stale-merged",i=async o=>{await vM(o),await e(),r(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(Ie,{content:s?"Switch to main first":void 0,children:f.jsx(Ct,{icon:f.jsx(lW,{}),variant:"ghost",size:"small",label:s?"Switch to main first":"Quick plan",disabled:s,onClick:()=>r(!0)})}),f.jsx(aW,{open:n,onClose:()=>r(!1),onAdd:i})]})},uW=({planId:e,phaseIndex:t,disabled:n})=>{const r=F(u=>u.launchAgent),s=F(Jr),{toast:i}=We(),[o,a]=_.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:Ue(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(Ct,{icon:f.jsx("span",{className:"text-xs leading-none",children:"▶"}),variant:"ghost",size:"small",label:c,onClick:l,disabled:n||o||!e||!s,className:"transition-opacity text-ink-500"})},dW=({plan:e,disabled:t})=>{const n=F(l=>l.launchPlanAudit),r=F(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,VU(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(Ie,{content:a,children:f.jsx(te,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Audit"})})},rg=({idea:e,compact:t})=>{const n=F(h=>h.launchIdeaExtend),r=F(Jr),{state:s,errorMessage:i,run:o}=VS(),{toast:a}=We(),l=e.id,c=()=>{l&&o(async()=>{const h=F.getState().ideaEntries.find(p=>p.id===l);if(!h)throw new Error(`Idea ${l} not found`);try{await n(l,WU(h))}catch(p){throw a({title:"Extension failed",description:Ue(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(Ie,{content:d,children:f.jsx(te,{variant:"ghost",size:"small",onClick:c,disabled:s==="loading"||!l||!r,className:s==="error"?"text-watercolor-rose-dark":void 0,children:u})})},fW=({plan:e,disabled:t})=>{const n=F(u=>u.launchFixReview),r=F(Jr),s=F(uL),[i,o]=_.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(Ie,{content:c,children:f.jsx(Kn,{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"})})},hW=()=>{const e=F(s=>s.loadIdeas),[t,n]=_.useState(!1),r=async s=>{await mk(s),await e(),n(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(te,{icon:f.jsx(PS,{size:16}),size:"small",onClick:()=>n(!0),children:"New idea"}),f.jsx(YS,{open:t,onClose:()=>n(!1),onAdd:r})]})};async function pW(e){var r;if((r=navigator.clipboard)!=null&&r.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const mW=({planTitle:e,planId:t,phaseIndex:n})=>{const[r,s]=_.useState("idle"),i=async o=>{o.stopPropagation();const a=`Start phase ${n+1} of plan "${e}" in papercamp/ideas/${t??"<ID>"}.md`,l=await pW(a);s(l?"copied":"failed"),setTimeout(()=>s("idle"),1500)};return f.jsx(Ct,{icon:r==="copied"?f.jsx(Xm,{size:16}):r==="failed"?f.jsx(Pa,{size:16}):f.jsx(g$,{size:16}),variant:"ghost",size:"small",label:r==="copied"?"Copied":r==="failed"?"Copy failed — select and copy manually":"Copy phase prompt",onClick:i,className:`transition-opacity ${r==="copied"?"text-state-success":r==="failed"?"text-state-danger":"text-ink-500"}`})},gW=({plan:e,disabled:t})=>{const n=F(l=>l.launchPlanReconcile),r=F(Jr),[s,i]=_.useState(!1),o=async()=>{if(e.id){i(!0);try{await n(e.id,UU(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(Ie,{content:a,children:f.jsx(te,{variant:"ghost",size:"small",onClick:o,disabled:t||s||!e.id||!r,children:"Refresh"})})},yW=()=>{const e=F(s=>s.refreshAll),t=F(s=>s.refreshing),{toast:n}=We(),r=async()=>{if(t)return;const s=await e();s.ok?n({title:"Up to date",description:"Plans, ideas, checks and PR review state re-read.",variant:"success"}):n({title:"Couldn't refresh",description:s.error??"The read failed — is the dev server running?",variant:"error"})};return f.jsx(Ct,{icon:f.jsx("span",{className:`inline-flex${t?" animate-pc-spin motion-reduce:animate-none":""}`,children:f.jsx(sU,{size:16})}),label:t?"Refreshing…":"Refresh data",size:"small",variant:"ghost",disabled:t,onClick:r})},xW=({plan:e,disabled:t})=>{const n=F(c=>c.launchRunAll),r=F(Jr),[s,i]=_.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(Ie,{content:l,children:f.jsx(Kn,{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"})})},vW=()=>{const e=F(y=>y.launchSuggestIdeas),t=F(y=>y.launchBatchReconcile),n=F(y=>y.launchPrioritise),r=F(y=>y.ideaEntries),s=F(y=>y.suggestions),i=F(ym),o=F(Jr),{toast:a}=We(),[l,c]=_.useState(null),u=async()=>{c("suggest");try{await e(KU(r,s))}catch(y){a({title:"Failed to launch",description:Ue(y.message),variant:"error"})}finally{c(null)}},d=async()=>{c("reconcile");try{await t()}catch(y){a({title:"Failed to launch",description:Ue(y.message),variant:"error"})}finally{c(null)}},h=async()=>{c("prioritise");try{const y=await n();a({title:y.moved.length>0?"Queue reordered":"Already in order",description:y.why||void 0,variant:"success"})}catch(y){a({title:"Failed to prioritise",description:Ue(y.message),variant:"error"})}finally{c(null)}},p=l!==null||i,m=[{id:"suggest-ideas",label:l==="suggest"?"Starting…":"Suggest ideas",icon:f.jsx(AS,{size:16}),disabled:p||!o,onSelect:u},{id:"reconcile-all",label:l==="reconcile"?"Starting…":"Reconcile all",icon:f.jsx(Xm,{size:16}),disabled:p||!o,onSelect:d},{id:"prioritise",label:l==="prioritise"?"Prioritising…":"Prioritise queue",icon:f.jsx(iU,{size:16}),disabled:p||!o,onSelect:h}];return f.jsx(IS,{align:"end",trigger:f.jsx(Ct,{icon:f.jsx(DS,{size:16}),label:"More actions",size:"small",variant:"ghost"}),items:m})};function wW(e){const t=e==null?void 0:e.match(/^[a-z]+\/([a-z]+-\d+)-/);return t?t[1].toUpperCase():null}const Mu="font-display-luminari text-sm font-semibold opacity-[0.65]",bW=({plan:e,auditRunning:t,agentBusy:n,agentPhaseIndex:r,planTask:s,updating:i,onTogglePhase:o,onToggleFix:a,onAddReviewPhases:l})=>{const c=F(p=>p.launchRunAll),u=e.fixes??[],d=u.some(p=>!p.done),h=[...e.phases.map((p,m)=>({kind:"phase",item:p,index:m})),...u.map((p,m)=>({kind:"fix",item:p,index:m}))];return f.jsxs("div",{className:"mb-8",children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[f.jsx("h3",{className:`${Mu} m-0`,children:"Phases"}),f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t&&f.jsx(Rs,{size:"small",label:"Audit running…"}),(e.status==="review"||e.status==="done")&&f.jsx(dW,{plan:e}),e.status!=="done"&&f.jsx(gW,{plan:e}),f.jsx(iW,{onAdd:l,disabled:i}),e.id&&d&&f.jsx(Ie,{content:"Run the open fixes with an agent",children:f.jsx(te,{size:"small",onClick:()=>e.id&&c(e.id),disabled:n,children:n?"Running…":"Run fixes"})})]})]}),f.jsx(n5,{data:h,columns:[{key:"checkbox",header:"Status",cell:p=>f.jsx(L4,{checked:p.item.done,onChange:()=>p.kind==="phase"?o(p.index):a(p.index),disabled:i}),width:2},{key:"title",header:"Title",cell:p=>f.jsxs("span",{className:`inline-flex items-center gap-2 ${p.item.done?"line-through opacity-[0.45]":"no-underline"}`,children:[p.item.text,p.kind==="phase"&&p.item.source==="review"&&f.jsx(Ne,{size:"small",fillColor:sr.review.fill,textColor:sr.review.text,children:"review"}),p.kind==="fix"&&f.jsx(Ne,{size:"small",variant:"warning",children:"fix"})]})},{key:"actions",header:"Actions",align:"end",cell:p=>p.kind==="phase"?f.jsxs("div",{className:"inline-flex gap-2 items-center",children:[f.jsx(mW,{planTitle:e.title,planId:e.id,phaseIndex:p.index}),!p.item.done&&r===p.index?f.jsx(Rs,{size:"small",label:`Agent ${s==null?void 0:s.status}…`}):!p.item.done&&f.jsx(uW,{planId:e.id,phaseIndex:p.index,disabled:n})]}):null,width:7}],expandable:{render:p=>p.item.description||null},showExpandColumn:!1,rowTexture:p=>p.kind==="fix"?"kraft":void 0,rowClassName:p=>p.kind==="phase"&&p.item.source==="review"?"bg-[rgba(155,122,181,0.08)]":void 0,className:"phase-table-phone"})]})},kW=({plan:e,gitBranch:t,onOwnBranch:n,branching:r,onCreateBranch:s})=>{const i=e.status==="planned"||e.status==="in-progress"||e.status==="review";return!i&&!e.pr?null:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-4",children:[i&&!n&&f.jsx(Le,{size:"small",accent:!0,accentColor:"amber",texture:"kraft",children:f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("span",{className:"text-sm",children:["Working branch: ",f.jsx("code",{children:t??"unknown"})," — not this plan's branch."]}),e.id&&f.jsx(Ie,{content:`Creates ${(e.kind??"feat").toLowerCase()}/${e.id.toLowerCase()}-… from main, or switches to it if it already exists`,children:f.jsx(te,{size:"small",onClick:s,disabled:r,children:r?"Switching…":"Create branch"})})]})}),i&&n&&f.jsxs("span",{className:"text-sm opacity-[0.45]",children:["Working branch: ",f.jsx("code",{children:t})]}),e.pr&&f.jsx(QS,{pr:e.pr}),e.pr&&f.jsx(eW,{pr:e.pr})]})},_W=({progress:e,color:t})=>f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"flex-1",children:f.jsx(qS,{pct:e.pct,color:t})}),f.jsxs("span",{className:"text-sm opacity-50 flex-shrink-0",children:[e.done,"/",e.total]})]}),SW=({plan:e})=>f.jsx("div",{className:"mb-4",children:f.jsx("div",{className:"opacity-[0.85]",children:e.body&&f.jsx(HS,{resetKey:e.id??e.title,children:f.jsx(ck,{children:e.body})})})}),CW=({clarifications:e})=>e.length===0?null:f.jsxs("div",{className:"mb-5",children:[f.jsx("h3",{className:`${Mu} 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}`))})]}),PW=({planId:e,released:t})=>{const n=$U(e);return n?f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Mu} mb-3`,children:"History"}),f.jsx(ZU,{trail:n,released:t})]}):null},jW=({plan:e,updating:t,onSend:n,undo:r,undoing:s,onUndo:i})=>{var g;const[o,a]=_.useState(""),[l,c]=_.useState(null),u=e.thread??[],{promotingIndex:d,promoteToDurable:h,promoteToIdea:p}=OU(e);FU(e,!0);const m=async()=>{o.trim()&&await n(o.trim())&&a("")},y=(x,v)=>{v==="idea"?c(x):h(x,v)},w=async x=>{l!==null&&await p(l,x)&&c(null)};return f.jsxs("div",{className:"mb-8",children:[f.jsx("h3",{className:`${Mu} mb-3`,children:"Feedback"}),f.jsxs(Le,{size:"small",accent:!0,accentColor:"slate",texture:"kraft",children:[f.jsx("div",{className:"flex flex-col gap-3 mb-4",children:u.length>0?f.jsx(qU,{messages:u,undo:r,undoing:s,onUndo:i,onPromote:y,promotingIndex:d}):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(Ru,{value:o,onChange:x=>a(x.target.value),"aria-label":"Feedback message",placeholder:"Write a message…",rows:3,disabled:t}),f.jsxs("div",{className:"flex justify-end items-center gap-3",children:[f.jsx("span",{className:t?"visible":"invisible",children:f.jsx(Rs,{size:"small",label:"Agent replying…"})}),f.jsx(te,{size:"small",onClick:m,disabled:t||!o.trim(),children:"Send"})]})]})]}),f.jsx(YS,{open:l!==null,onClose:()=>c(null),onAdd:w,initialContent:l!==null?(g=u[l])==null?void 0:g.text:void 0})]})},EW=({plan:e})=>{const t=F(P=>P.plans),n=F(P=>P.gitBranch),r=F(P=>P.loadGitStatus),s=F(P=>P.loadPlans),{toast:i}=We(),{patch:o,updating:a}=Ta(),[l,c]=_.useState(!1),u=F(P=>P.agentStatus),d=F(ym),h=F(P=>P.detailView),p=hm(e.id,u),m=p?p.phaseIndex:null,y=(p==null?void 0:p.taskKind)==="audit",w=CM(e),g=e.phases.length>0,x=h==="feedback",v={id:e.id??null,title:e.title,body:e.body,log:e.log},b=((t==null?void 0:t.entries)??[]).filter(P=>P.id!==e.id),S=e.id!==void 0&&wW(n)===e.id,k=async()=>{if(e.id){c(!0);try{const P=await nL(e.id);i({title:"Branch ready",description:`Now on ${P}`,variant:"success"}),await r()}catch(P){i({title:"Branch failed",description:Ue(P.message),variant:"error"})}finally{c(!1)}}},j=async P=>{const L=e.phases.map((M,$)=>$===P?{...M,done:!M.done}:M);L.every(M=>M.done)&&e.status==="in-progress"?await o(e.title,{phases:L,status:"review"}):await o(e.title,{phases:L})},E=async P=>{await o(e.title,{phases:[...e.phases,...P]})},R=async P=>{const L=(e.fixes??[]).map((M,$)=>$===P?{...M,done:!M.done}:M);L.every(M=>M.done)&&e.status==="in-progress"?await o(e.title,{fixes:L,status:"review"}):await o(e.title,{fixes:L})},{sending:T,send:N,undo:A,undoing:O,undoEdit:z}=zU(e,{reload:s,notify:i});return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3 mb-3 flex-wrap",children:[f.jsxs("h2",{className:`${sW} m-0 flex items-center gap-3 min-w-0 flex-wrap`,children:[f.jsx(es,{id:e.id}),e.title]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("span",{className:"text-sm opacity-[0.45] whitespace-nowrap",children:e.updated?`updated ${Ic(e.updated)}`:`created ${Ic(e.created)}`}),f.jsx(yW,{})]})]}),x?f.jsx(jW,{plan:e,updating:T,onSend:N,undo:A,undoing:O,onUndo:z}):f.jsxs(f.Fragment,{children:[f.jsx(kW,{plan:e,gitBranch:n,onOwnBranch:S,branching:l,onCreateBranch:k}),w!==null&&f.jsx(_W,{progress:w,color:GS[pm(e,u)]}),f.jsx(SW,{plan:e}),f.jsx(CW,{clarifications:e.clarifications??[]}),!g&&f.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[f.jsx(Au,{idea:v,otherPlans:b}),f.jsx(rg,{idea:v})]}),g&&f.jsx(bW,{plan:e,auditRunning:y,agentBusy:d,agentPhaseIndex:m,planTask:p,updating:a,onTogglePhase:j,onToggleFix:R,onAddReviewPhases:E}),f.jsx(PW,{planId:e.id,released:e.released})]})]})},TW=()=>{const[e,t]=_.useState(new Set);return _.useEffect(()=>{let n=!1;return fM().then(r=>{n||!r||t(new Set(r.horizons.flatMap(s=>s.items.map(i=>i.name))))}).catch(()=>{}),()=>{n=!0}},[]),e},yo="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",sg=({order:e,done:t,running:n,status:r})=>f.jsx("span",{className:"flex-[0_0_36px] flex items-center justify-center",children:n?f.jsx(Rs,{size:"small",label:"Agent running"}):t?f.jsx("span",{"aria-label":"Done",className:"text-watercolor-green-dark text-sm",children:"✓"}):e!==void 0?f.jsx(Ne,{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(Jm,{size:14})}):null}),Yh="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",XS=({plans:e,activePlanTitle:t,onOpen:n,showHeader:r=!0})=>{const s=Yh,i=F(o=>o.agentStatus);return f.jsxs("div",{className:"flex flex-col gap-1",children:[r&&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(Le,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx("span",{className:yo,children:"Id"}),f.jsx("span",{className:yo,children:"Title"}),f.jsx("span",{className:`max-lg:hidden ${yo}`,children:"Updated"}),f.jsx("span",{className:yo,children:"Progress"}),f.jsx("span",{className:yo,children:"Status"})]})})})]}),e.map(o=>{var c;const a=vk(o),l=pm(o,i);return f.jsxs("div",{className:"flex items-center",children:[f.jsx(sg,{order:o.order,done:o.status==="done",status:o.status,running:!!hm(o.id,i)}),f.jsx("div",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(o.title):void 0,onKeyDown:n?u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(o.title))}:void 0,className:`${n?"cursor-pointer":""} rounded-[10px] flex-1 min-w-0 ${o.title===t?"plan-row-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:f.jsx(Le,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:s,children:[f.jsx(es,{id:o.id}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:o.title}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45] whitespace-nowrap",children:o.updated?Ic(o.updated):Ic(o.created)}),a?f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(qS,{pct:a.pct,color:GS[l]})}),f.jsxs("span",{className:"text-sm opacity-50 shrink-0",children:[a.done,"/",a.total]})]}):f.jsx("span",{className:"text-sm opacity-30",children:"—"}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Ne,{size:"small",fillColor:sr[l].fill,textColor:sr[l].text,children:ng[l]}),((c=o.pr)==null?void 0:c.state)==="merged"&&f.jsx(Ie,{content:`Merged in #${o.pr.number}`,children:f.jsx("span",{className:"inline-flex text-[#7B5E9E]",children:f.jsx(Nu,{size:14})})})]})]})})})]},o.title)})]})},RW=5,IW="text-sm font-semibold opacity-60 whitespace-nowrap overflow-hidden",JS="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",A0="font-handwritten text-xs font-semibold opacity-55 leading-none pt-2 pr-1 pb-0 pl-1",M0=`${IW} bg-none bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left`,NW=[{key:"id",label:"Id"},{key:"title",label:"Title"},{key:"updated",label:"Updated"},{key:"progress",label:"Progress"},{key:"status",label:"Status"}],ZS="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",eC="overflow-hidden text-ellipsis whitespace-nowrap",AW=({rows:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const[i,o]=_.useState(new Set),{subjects:a,loading:l,available:c}=zS(),u=TW(),d=tn(),h=JS,p=F(k=>k.planFilters.sortKey),m=F(k=>k.planFilters.sortDirection),y=F(k=>k.setPlanSortKey),w=F(k=>k.togglePlanSortDirection),g=k=>{k===p?w():y(k)},x=k=>{o(j=>{const E=new Set(j);return E.has(k)?E.delete(k):E.add(k),E})},v=k=>k.type==="plan"?f.jsx(XS,{plans:[k.plan],activePlanTitle:n,onOpen:r,showHeader:!1},k.plan.title):k.type==="note"?f.jsx(MW,{row:k,onOpen:s},k.idea.title):f.jsx(LW,{row:k,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i.has(k.idea.title),onToggleExpanded:()=>x(k.idea.title)},k.idea.title),b=zM(e,m,l||!c?void 0:a),S=b.length>1;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx("span",{role:"columnheader",className:"flex-[0_0_36px] flex justify-center","aria-sort":p==="order"?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:M0,"aria-label":"Sort by run order",onClick:()=>g("order"),children:["#",p==="order"&&(m==="asc"?"▲":"▼")]})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Le,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsx("div",{className:h,children:NW.map(({key:k,label:j})=>{const E=k===p;return f.jsx("span",{role:"columnheader",className:k==="updated"?"max-lg:hidden":void 0,"aria-sort":E?m==="asc"?"ascending":"descending":void 0,children:f.jsxs("button",{type:"button",className:M0,onClick:()=>g(k),children:[j,E&&(m==="asc"?" ▲":" ▼")]})},k)})})})})]}),S?b.map(k=>{const j=k.subject;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx("div",{className:"flex items-baseline gap-2",children:j&&u.has(j)?f.jsx("button",{type:"button",className:`${A0} bg-none bg-transparent border-none cursor-pointer text-left hover:underline`,title:"View in roadmap",onClick:()=>d({to:"/roadmap",search:{item:j}}),children:j}):f.jsx("div",{className:A0,children:j??"No subject"})}),k.rows.map(E=>v(E))]},j??"__no-subject__")}):e.map(k=>v(k))]})},MW=({row:e,onOpen:t})=>{const n=e.idea,r=n.status??"open";return f.jsxs("div",{className:"flex items-center",children:[f.jsx(sg,{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(Le,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:JS,children:[n.id?f.jsx(es,{id:n.id}):f.jsx("span",{}),f.jsxs("span",{className:`${ZS} [cursor:inherit]`,children:[f.jsx(FS,{}),f.jsx("span",{className:eC,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(Ne,{size:"small",fillColor:Kc[r].fill,textColor:Kc[r].text,children:KS[r]})]})})})]})},LW=({row:e,plans:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s,expanded:i,onToggleExpanded:o})=>{const a=e.idea,l=e.children,c=l.filter(p=>p.status==="done"),u=l.filter(p=>p.status!=="done"),d=l.length>RW,h=d&&!i?u:l;return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx(sg,{order:a.order,done:a.status==="done",status:a.status}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Le,{size:"small",texture:"canvas",className:"plan-row-card",children:f.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)_84px_1fr] gap-2 items-center max-[480px]:grid-cols-1 max-[480px]:gap-1",children:[a.id?f.jsx(es,{id:a.id}):f.jsx("span",{}),f.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(a.title),className:ZS,children:[f.jsx(Jm,{}),f.jsx("span",{className:eC,children:a.title})]}),f.jsx("span",{className:"max-lg:hidden text-sm opacity-[0.45]",children:"—"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("span",{className:`text-sm ${l.length>0?"opacity-60":"opacity-30"}`,children:l.length>0?`${c.length}/${l.length} plans done`:"—"}),f.jsx(rg,{idea:a,compact:!0}),f.jsx(Au,{idea:a,otherPlans:t})]})]})})})]}),l.length>0&&f.jsxs("div",{className:"ml-5 pl-3 border-l-2 border-black/[8%] flex flex-col gap-1",children:[f.jsx(XS,{plans:h,activePlanTitle:n,onOpen:r,showHeader:!1}),d&&f.jsx("button",{type:"button",onClick:o,className:"self-start bg-none bg-transparent border-none py-1 px-0 opacity-60 cursor-pointer underline text-xs [font:inherit]",children:i?"Show less":`+${c.length} done`})]})]})},DW=({plans:e,rows:t,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s})=>{const i=_.useRef(null);return _.useEffect(()=>{var a;if(!n)return;const o=(a=i.current)==null?void 0:a.querySelector(".plan-row-highlighted");o==null||o.scrollIntoView({behavior:"smooth",block:"center"})},[n]),f.jsx("div",{ref:i,children:t.length>0?f.jsx(AW,{rows:t,plans:e,activePlanTitle:n,onOpenPlan:r,onOpenIdea:s}):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."})})},FW=({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(es,{id:e.id??void 0}),e.title,e.status&&f.jsx(Ne,{size:"small",fillColor:Kc[e.status].fill,textColor:Kc[e.status].text,children:KS[e.status]})]}),f.jsx(ck,{children:e.body.replace(/^#{1,3}\s+.+(\n|$)/,"").replace(/^\s*-{3,}\s*(\n|$)/,"").trim()}),f.jsx("div",{className:"mt-6",children:f.jsx(rg,{idea:e})})]}),uf="__no-subject__",Gs="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300",OW=()=>{const e=F(P=>P.plans),t=Zm(),n=F(ym),r=F(P=>P.agentStatus),{patch:s,updating:i}=Ta(),{subjects:o,available:a}=zS(),l=F(P=>P.detailView),c=F(P=>P.setDetailView),u=F(P=>P.archiveIdeas),{toast:d}=We(),h=t?e==null?void 0:e.entries.find(P=>P.title===t):null,[p,m]=_.useState(""),[y,w]=_.useState(!1);if(_.useEffect(()=>{m((h==null?void 0:h.order)!==void 0?String(h==null?void 0:h.order):"")},[h==null?void 0:h.order]),!h)return null;const g=pm(h,r),x=h.status==="in-progress",v=h.status==="review",b=h.status==="dropped",S=h.status==="done",k=h.phases.some(P=>!P.done),j=(h.status==="planned"||x)&&k,E=PM(h),R=!!(h.pr&&(h.pr.state==="open"||h.pr.state==="draft")&&h.pr.unresolvedThreadCount),T=a&&h.subject&&!o.includes(h.subject)?h.subject:void 0,N=P=>s(h.title,P),A=async()=>{if(h.id){w(!0);try{await u([h.id])}catch(P){d({title:"Archive failed",description:P.message,variant:"error"})}finally{w(!1)}}},O=x||v||h.status==="planned",z=async()=>{const P=p.trim(),L=Number(P);if(P===""||!Number.isInteger(L)||L<1){m(h.order!==void 0?String(h.order):"");return}L!==h.order&&await N({order:L})};return f.jsxs("div",{className:"flex flex-col gap-4 -mt-5",children:[f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Show"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(Kn,{size:"small",active:l==="details",onClick:()=>c("details"),className:"text-xs leading-4 py-2",children:"Details"}),f.jsx(Kn,{size:"small",active:l==="feedback",onClick:()=>c("feedback"),className:"text-xs leading-4 py-2",children:"Feedback"})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Status"}),f.jsx(Ne,{size:"small",fillColor:sr[g].fill,textColor:sr[g].text,children:ng[g]})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Subject"}),f.jsx(jS,{size:"small",value:h.subject??uf,onChange:P=>N({subject:P===uf?null:P}),disabled:i||!a,options:[{value:uf,label:"No subject"},...T?[{value:T,label:`${T} (orphan)`}]:[],...!a&&h.subject&&!T?[{value:h.subject,label:h.subject}]:[],...o.map(P=>({value:P,label:P}))]})]}),O&&f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("div",{className:Gs,children:"Order"}),f.jsx(ja,{type:"number",size:"small","aria-label":"Run order",min:1,value:p,onChange:P=>m(P.target.value),onBlur:z,disabled:i,className:"w-20"})]}),h.tags.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Tags"}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.tags.map(P=>f.jsx(Ne,{size:"small",fillColor:"rgba(0,0,0,0.06)",children:P},P))})]}),f.jsxs("div",{children:[f.jsx("div",{className:`${Gs} mb-1.5`,children:"Actions"}),f.jsxs("div",{className:"flex flex-col gap-1",children:[j&&f.jsx(xW,{plan:h,disabled:n||i}),R&&f.jsx(fW,{plan:h,disabled:n||i}),v&&f.jsx(Kn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:()=>N({status:"done"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:"Approve & close"}),S&&f.jsx(Kn,{size:"small",icon:f.jsx("span",{className:"text-ink-300",children:"▣"}),onClick:A,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Archiving…":"Archive"}),E&&f.jsx(Kn,{size:"small",icon:f.jsx("span",{className:"text-watercolor-green-dark",children:"✓"}),onClick:A,disabled:y||!h.id,className:`text-xs leading-4 py-2 ${y||!h.id?"opacity-50":""}`,children:y?"Marking done…":"Mark done"}),!S&&f.jsx(Kn,{size:"small",icon:f.jsx("span",{className:b?"text-watercolor-green-dark":"text-watercolor-rose-dark",children:b?"↺":"⊘"}),onClick:()=>N({status:b?null:"dropped"}),disabled:i,className:`text-xs leading-4 py-2 ${i?"opacity-50":""}`,children:b?"Reopen plan":"Mark dropped"})]})]})]})},L0=8,zW=["in-progress","review","planned","idea","done","dropped"],D0="text-2xs font-semibold tracking-[0.08em] uppercase text-ink-300 mb-2",BW=()=>{const e=F(b=>b.plans),t=Zm(),n=F(b=>b.planFilters),r=F(b=>b.togglePlanStatus),s=F(b=>b.togglePlanTag),i=F(b=>b.setPlanSearch),o=F(b=>b.setSubjectFilter),a=tn(),[l,c]=_.useState(!1);if(!e||t)return null;const{statusCounts:u,tagCounts:d}=Vl(e.entries,n),h=new Set(n.statuses),p=new Set(n.tags),y=[...new Set([...Object.keys(d),...n.tags])].sort((b,S)=>{const k=(d[S]??0)-(d[b]??0);return k!==0?k:b.localeCompare(S)}),w=l?y:y.slice(0,L0),g=y.length-w.length,x="bg-none bg-transparent border-none p-0 cursor-pointer opacity-70 underline text-2xs",v=zW.filter(b=>u[b]>0||h.has(b));return f.jsxs("div",{className:"flex flex-col gap-8 -mt-5",children:[f.jsx(ja,{type:"search",size:"small",placeholder:"Search plans…","aria-label":"Search plans",value:n.search,onChange:b=>i(b.target.value)}),n.subject!==null&&f.jsxs("div",{className:"flex items-center gap-2","data-testid":"subject-filter-chip",children:[f.jsxs("span",{className:"text-2xs opacity-70",children:["Subject: ",n.subject]}),f.jsx("button",{type:"button",onClick:()=>{o(null),a({to:"/",search:{}})},className:x,children:"Clear"})]}),f.jsxs("div",{children:[f.jsx("div",{className:D0,children:"Status"}),f.jsx("div",{className:"flex flex-col gap-1",children:v.map(b=>{const S=h.has(b);return f.jsx(Kn,{size:"small",active:S,onClick:()=>r(b),className:"text-xs leading-4 py-2",icon:f.jsx("span",{className:"w-[9px] h-[9px] rounded-full shrink-0",style:{background:sr[b].text}}),action:f.jsx("span",{className:"text-2xs text-ink-500",children:u[b]}),children:ng[b]},b)})})]}),f.jsxs("div",{children:[f.jsx("div",{className:D0,children:"Tags"}),f.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[y.length===0&&f.jsx("span",{className:"opacity-50 text-2xs",children:"No tags"}),w.map(b=>{const S=p.has(b);return f.jsxs(te,{type:"button",variant:"ghost",size:"small",isActive:S,"aria-pressed":S,onClick:()=>s(b),children:[b," ",d[b]??0]},b)}),g>0&&f.jsxs("button",{type:"button",onClick:()=>c(!0),className:x,children:["+",g," more"]}),l&&y.length>L0&&f.jsx("button",{type:"button",onClick:()=>c(!1),className:x,children:"Show less"})]})]})]})},F0=()=>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"}),f.jsx(hW,{}),f.jsx(cW,{}),f.jsx(vW,{})]}),$W=[{key:"a",title:"72%"},{key:"b",title:"54%"},{key:"c",title:"83%"},{key:"d",title:"46%"},{key:"e",title:"66%"},{key:"f",title:"58%"}],VW=()=>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(Le,{size:"small",texture:"kraft",className:"plan-row-card",children:f.jsxs("div",{className:Yh,children:[f.jsx(ln,{variant:"text",width:28}),f.jsx(ln,{variant:"text",width:44}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(ln,{variant:"text",width:56})}),f.jsx(ln,{variant:"text",width:64}),f.jsx(ln,{variant:"text",width:48})]})})})]}),$W.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(ln,{variant:"text",width:16})}),f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(Le,{size:"small",className:"plan-row-card",children:f.jsxs("div",{className:Yh,children:[f.jsx(ln,{variant:"rect",width:44,height:18}),f.jsx(ln,{variant:"text",width:e.title}),f.jsx("span",{className:"max-lg:hidden",children:f.jsx(ln,{variant:"text",width:52})}),f.jsx(ln,{variant:"rect",width:80,height:8}),f.jsx(ln,{variant:"rect",width:64,height:20})]})})})]},e.key))]}),UW=()=>{const e=F(u=>u.reconcileQueue),t=F(u=>u.removeFromReconcileQueue),n=F(u=>u.plans),{patch:r}=Ta(),{toast:s}=We(),i=_.useRef(0),o=e[0]??null,a=o?(n==null?void 0:n.entries.find(u=>u.id===o.planId))??null:null;if(_.useEffect(()=>{o&&!a&&t(o.previewId)},[o,a,t]),_.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(nW,{plan:a,before:o.before,onApprove:l,onDiscard:c,queuePosition:{index:i.current+1,total:i.current+e.length}})},WW=({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(Le,{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(Jm,{}),f.jsx("span",{className:"font-semibold overflow-hidden text-ellipsis whitespace-nowrap",children:r.title})]}),f.jsx(Ct,{icon:f.jsx("span",{children:"×"}),variant:"ghost",size:"small",label:"Dismiss",className:"w-[28px] h-[28px]",onClick:()=>n(r)})]})})},`${r.date}-${r.title}`))})]}),ig=()=>{const e=F(k=>k.plans),t=F(k=>k.plansError),n=F(k=>k.ideaEntries),r=F(k=>k.suggestions);F(k=>k.loadPlans);const s=F(k=>k.setDetailView),i=F(k=>k.planFilters),o=F(k=>k.setSubjectFilter),a=Zm(),l=bU(),c=F(k=>k.dismissSuggestion),u=tn(),{toast:d}=We(),{subject:h}=Xp({strict:!1});_.useEffect(()=>{o(h??null)},[h,o]),_.useEffect(()=>{s("details")},[a,l,s]);const p=()=>{u({to:"/"})},m=k=>{u({to:"/plans/$planId",params:{planId:encodeURIComponent(k)}})},y=k=>{u({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(k)}})},[w,g]=_.useState(null),x=async k=>{try{await c(k)}catch(j){d({title:"Failed to dismiss suggestion",description:j.message,variant:"error"})}},v=a?e==null?void 0:e.entries.find(k=>k.title===a):null,b=l?n.find(k=>k.title===l):null;if(t)return f.jsxs("div",{children:[f.jsx(LU,{children:"Plans"}),f.jsxs(Le,{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 f.jsxs("div",{children:[f.jsx(F0,{}),f.jsx("output",{"aria-live":"polite",className:"sr-only",children:"Loading plans…"}),f.jsx(VW,{})]});const{rows:S}=BM(e.entries,n,i);return f.jsxs(f.Fragment,{children:[f.jsx(UW,{}),v?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(k0,{items:[{id:"plans",label:"Plans",onClick:p},{id:"plan",label:v.title}]})}),f.jsx(EW,{plan:v})]}):b?f.jsxs("div",{children:[f.jsx("div",{className:"mb-4",children:f.jsx(k0,{items:[{id:"plans",label:"Plans",onClick:p},{id:"idea",label:b.title}]})}),f.jsx(FW,{idea:b})]}):f.jsxs("div",{children:[f.jsx(F0,{}),e.warnings.length>0&&f.jsxs(Le,{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(k=>f.jsxs("li",{children:[k.title,": ",k.message]},k.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(DW,{plans:e.entries,rows:S,activePlanTitle:a,onOpenPlan:m,onOpenIdea:y}),f.jsx(rW,{onOpenIdea:y}),f.jsx(WW,{suggestions:r,onOpen:g,onDismiss:x}),f.jsx(tW,{suggestion:w,onClose:()=>g(null)})]})]})},HW="data-paper-camp-mount";function GW(e){return(e==null?void 0:e.getAttribute(HW))??""}const tC=typeof document>"u"?"":GW(document.getElementById("root")),nC=_.lazy(()=>or(()=>import("./index-Cm3hzD0z.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsPage}))),KW=_.lazy(()=>or(()=>import("./index-Cm3hzD0z.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.DocsSidebar}))),rC=_.lazy(()=>or(()=>import("./index-Dtdlcmro.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsPage}))),QW=_.lazy(()=>or(()=>import("./index-Dtdlcmro.js"),__vite__mapDeps([2,3,1]),import.meta.url).then(e=>({default:e.SettingsSidebar}))),qW=_.lazy(()=>or(()=>import("./index-CGtPCj1V.js"),__vite__mapDeps([4,3]),import.meta.url).then(e=>({default:e.TasksPage}))),YW=_.lazy(()=>or(()=>import("./index-C6vBW0wx.js"),[],import.meta.url).then(e=>({default:e.RoadmapPage}))),XW=_.lazy(()=>or(()=>import("./index-BiDION9V.js"),[],import.meta.url).then(e=>({default:e.DiffPage}))),JW=_.lazy(()=>or(()=>import("./index-0BzPyUVh.js"),__vite__mapDeps([5,3]),import.meta.url).then(e=>({default:e.StatsPage}))),ZW=_.lazy(()=>or(()=>import("./index-Bz4Df_iX.js"),[],import.meta.url).then(e=>({default:e.InboxPage}))),df=[{id:"plans",label:"Plans",path:"/"},{id:"inbox",label:"Inbox",path:"/inbox"},{id:"roadmap",label:"Roadmap",path:"/roadmap"},{id:"docs",label:"Docs",path:"/docs"},{id:"tasks",label:"Tasks",path:"/tasks"},{id:"stats",label:"Stats",path:"/stats"},{id:"settings",label:"Settings",path:"/settings"}],O0=({item:e,count:t})=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.label,e.id==="inbox"&&t>0&&f.jsx(Ne,{size:"small",variant:"warning",children:t})]}),z0=()=>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"})}),sC="stack-open";function e9(){try{return localStorage.getItem(sC)==="true"}catch{return!1}}function t9(e){try{localStorage.setItem(sC,String(e))}catch{}}const n9="(min-width: 1440px)";function r9(e){const[t,n]=_.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return _.useEffect(()=>{const r=window.matchMedia(e),s=i=>n(i.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}const s9=()=>{var j;const e=tn(),t=FT({select:E=>E.location.pathname}),n=F(E=>E.loadPlans),r=F(E=>E.loadIdeas),s=F(E=>E.loadSuggestions),i=F(E=>E.loadCapabilities),o=F(E=>E.loadAgentAuthStatus),a=F(E=>E.loadParkedQuestions),l=F(E=>{var R;return((R=E.parkedQuestions)==null?void 0:R.length)??0}),c=F(E=>E.setActiveDocTitle),u=t==="/"||t.startsWith("/plans/")||t.startsWith("/ideas/"),d=t==="/docs"||t.startsWith("/docs/"),h=t==="/settings"||t.startsWith("/settings/"),p=u?"plans":d?"docs":h?"settings":(j=df.find(E=>E.path===t))==null?void 0:j.id,m=u||d||h,y=u?"plans":d?"docs":"settings",[w,g]=_.useState(e9),[x,v]=_.useState(!1),b=Cu(),S=r9(n9),k=_.useRef(!1);return _.useEffect(()=>{n(),r(),s(),i(),o(),a()},[n,r,s,i,o,a]),_.useEffect(()=>{k.current||t!=="/"||(k.current=!0,Promise.all([hk(),fk()]).then(([E,R])=>{if(!(E!=null&&E.setupDismissed)&&R!==null&&!R.every(T=>T.status==="ok")){e({to:"/settings/$section",params:{section:"setup"}});return}Promise.all([pk(),yk()]).then(([T,N])=>{T.entries.length>1||N.entries.length>0||(c("USAGE.md"),e({to:"/docs"}))})}))},[t,e,c]),_.useEffect(()=>{v(!1)},[t]),f.jsxs(j8,{position:"bottom-left",children:[f.jsxs("div",{className:"h-screen box-border min-[1440px]:pr-[480px] flex flex-col",children:[f.jsx(CU,{}),f.jsx(MU,{}),f.jsx(k4,{style:{flex:"1 1 0%",minHeight:0,height:"auto"},background:{texture:"speckle",ruledType:"grid",ruledColor:"blue"},showHeader:!0,showSidebar:!1,showPage:!1,bleedBottom:!0,headerActions:f.jsxs(f.Fragment,{children:[m&&f.jsx(Ct,{variant:"ghost",size:"small",className:"lg:hidden max-[480px]:hidden",label:"Open sidebar",onClick:()=>v(!0),icon:f.jsx(z0,{})}),f.jsx(SU,{size:"sm"}),f.jsx("div",{className:"flex-1"}),f.jsx("nav",{"aria-label":"Main navigation",className:"flex items-center gap-1 max-[480px]:hidden",children:df.map(E=>f.jsx(te,{variant:"ghost",size:"small",isActive:E.id===p,onClick:()=>e({to:E.path}),"aria-current":E.id===p?"page":void 0,children:f.jsx(O0,{item:E,count:l})},E.id))})]}),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 -mt-8 -ml-8 -mr-8 pt-0 pl-8 pr-8 pb-[var(--pc-content-pad-bottom,32px)]",children:f.jsxs("div",{className:"flex min-w-0 justify-center lg:[--pc-sidebar-h:calc(100vh-160px)] gap-6 w-full",children:[m&&f.jsxs(PU,{routeKey:y,mobileOpen:x,onMobileClose:()=>v(!1),children:[u&&f.jsxs(f.Fragment,{children:[f.jsx(BW,{}),f.jsx(OW,{})]}),d&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(KW,{})}),h&&f.jsx(_.Suspense,{fallback:null,children:f.jsx(QW,{})})]}),f.jsx("div",{className:`flex flex-col min-w-0 ${S?"flex-[1_1_0%]":"flex-[0_1_800px]"}`,children:f.jsx(Ai.div,{...$S(b),transition:BS(b),className:"flex flex-col flex-1 min-w-0",children:f.jsx(CS,{texture:{texture:"parchment"},outline:!0,className:`min-h-[calc(100vh-160px)] w-full ${S?"max-w-none":""}`,children:f.jsx(_.Suspense,{fallback:null,children:f.jsx(Pb,{})})})},t)})]})})})})]}),f.jsx(gU,{open:w,pinned:S,onToggle:()=>{const E=!w;t9(E),g(E)}}),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:[m&&f.jsx(Ct,{variant:"ghost",size:"small",label:"Open sidebar",onClick:()=>v(!0),icon:f.jsx(z0,{}),className:"min-h-11"}),df.map(E=>f.jsx(te,{variant:"ghost",size:"small",isActive:E.id===p,onClick:()=>e({to:E.path}),"aria-current":E.id===p?"page":void 0,className:"min-h-11",children:f.jsx(O0,{item:E,count:l})},E.id))]})]})},$t=kT({component:s9}),i9=nn({getParentRoute:()=>$t,path:"/",component:ig,validateSearch:e=>({subject:typeof e.subject=="string"?e.subject:void 0})}),o9=nn({getParentRoute:()=>$t,path:"/plans/$planId",component:ig}),a9=nn({getParentRoute:()=>$t,path:"/ideas/$ideaId",component:ig}),l9=nn({getParentRoute:()=>$t,path:"/docs",component:nC}),c9=nn({getParentRoute:()=>$t,path:"/docs/$section",component:nC}),u9=nn({getParentRoute:()=>$t,path:"/settings",component:rC}),d9=nn({getParentRoute:()=>$t,path:"/settings/$section",component:rC}),f9=nn({getParentRoute:()=>$t,path:"/roadmap",component:YW,validateSearch:e=>({item:typeof e.item=="string"?e.item:void 0})}),h9=nn({getParentRoute:()=>$t,path:"/diff",component:XW}),p9=nn({getParentRoute:()=>$t,path:"/inbox",component:ZW}),m9=nn({getParentRoute:()=>$t,path:"/stats",component:JW}),g9=nn({getParentRoute:()=>$t,path:"/tasks",component:qW,validateSearch:e=>({taskId:typeof e.taskId=="string"?e.taskId:void 0})}),y9=$t.addChildren([i9,o9,a9,l9,c9,u9,d9,g9,f9,h9,m9,p9]),x9=AT({routeTree:y9,basepath:tC||"/"});FA(tC);const iC=document.getElementById("root");if(!iC)throw new Error("#root element not found");J1(iC).render(f.jsx(_.StrictMode,{children:f.jsx(DT,{router:x9})}));export{E9 as A,Xp as B,_9 as C,T9 as D,Ea as E,F9 as F,Ue as G,fM as H,C9 as I,te as J,S9 as K,QS as L,ck as M,ng as N,TW as O,LU as P,R9 as Q,zV as R,sr as S,TM as T,Ne as U,M9 as V,zU as W,es as X,qU as Y,Ru as Z,Rs as _,tn as a,D9 as b,v9 as c,sW as d,hk as e,P9 as f,Ie as g,w9 as h,Kn as i,f as j,We as k,TS as l,zS as m,L9 as n,ja as o,b0 as p,xU as q,_ as r,b9 as s,k9 as t,F as u,jS as v,Le as w,j9 as x,k0 as y,IM as z};
207
- //# sourceMappingURL=main-Ba3mXsWY.js.map