@commandgarden/cli 2.10.0 → 2.12.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 (60) hide show
  1. package/dist/main.js +6 -6
  2. package/node_modules/@commandgarden/app/dist/client/assets/{Slides-D3xcxd9t.js → Slides-CDEAUexS.js} +5 -15
  3. package/node_modules/@commandgarden/app/dist/client/assets/index-CLleh8jO.js +501 -0
  4. package/node_modules/@commandgarden/app/dist/client/assets/{index-DbqYLIqy.css → index-wgb9-PIF.css} +1 -1
  5. package/node_modules/@commandgarden/app/dist/client/index.html +19 -19
  6. package/node_modules/@commandgarden/app/dist/server/daemon-client.test.js +47 -0
  7. package/node_modules/@commandgarden/app/dist/server/journal/journal.service.d.ts +1 -0
  8. package/node_modules/@commandgarden/app/dist/server/journal/journal.service.js +25 -6
  9. package/node_modules/@commandgarden/app/dist/server/journal/journal.types.d.ts +26 -0
  10. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.d.ts +10 -4
  11. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.js +36 -29
  12. package/node_modules/@commandgarden/app/dist/server/journal/sources/timetracking.source.d.ts +10 -1
  13. package/node_modules/@commandgarden/app/dist/server/journal/sources/timetracking.source.js +62 -8
  14. package/node_modules/@commandgarden/app/dist/server/routes/journal.d.ts +12 -0
  15. package/node_modules/@commandgarden/app/dist/server/routes/journal.js +87 -5
  16. package/node_modules/@commandgarden/app/dist/server/routes/routes.test.js +137 -0
  17. package/node_modules/@commandgarden/app/dist/server/store.d.ts +27 -0
  18. package/node_modules/@commandgarden/app/dist/server/store.js +130 -39
  19. package/node_modules/@commandgarden/app/dist/server/store.test.js +59 -0
  20. package/node_modules/@commandgarden/app/package.json +42 -42
  21. package/node_modules/@commandgarden/chrome/dist/content-script.js.map +1 -1
  22. package/node_modules/@commandgarden/chrome/dist/fetch-interceptor.js +44 -0
  23. package/node_modules/@commandgarden/chrome/dist/manifest.json +26 -26
  24. package/node_modules/@commandgarden/chrome/dist/popup.html +218 -218
  25. package/node_modules/@commandgarden/chrome/dist/popup.js.map +1 -1
  26. package/node_modules/@commandgarden/chrome/dist/service-worker.js +11 -3
  27. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  28. package/node_modules/@commandgarden/chrome/package.json +26 -26
  29. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.eval.js +100 -100
  30. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.yaml +70 -70
  31. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-content.yaml +61 -61
  32. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-pages.yaml +54 -54
  33. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.eval.js +115 -115
  34. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.yaml +54 -54
  35. package/node_modules/@commandgarden/daemon/connectors/lib/msal-token.js +20 -20
  36. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.eval.js +204 -198
  37. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.yaml +42 -42
  38. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.eval.js +94 -94
  39. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.yaml +34 -34
  40. package/node_modules/@commandgarden/daemon/connectors/socket-security-news.yaml +63 -63
  41. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +437 -437
  42. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +53 -53
  43. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.eval.js +547 -547
  44. package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.yaml +48 -48
  45. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.eval.js +52 -52
  46. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.yaml +42 -42
  47. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.eval.js +81 -81
  48. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.yaml +52 -52
  49. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.eval.js +27 -27
  50. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.yaml +38 -38
  51. package/node_modules/@commandgarden/daemon/connectors/tokenmaster-clients-list.yaml +55 -55
  52. package/node_modules/@commandgarden/daemon/dist/audit-store.js +8 -8
  53. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts +24 -0
  54. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts.map +1 -0
  55. package/node_modules/@commandgarden/daemon/dist/cdp-client.js +150 -0
  56. package/node_modules/@commandgarden/daemon/dist/cdp-client.js.map +1 -0
  57. package/node_modules/@commandgarden/daemon/package.json +32 -32
  58. package/node_modules/@commandgarden/shared/package.json +32 -32
  59. package/package.json +58 -58
  60. package/node_modules/@commandgarden/app/dist/client/assets/index-_jNYPoLF.js +0 -461
@@ -0,0 +1,501 @@
1
+ function sm(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function rm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ad={exports:{}},na={},Ld={exports:{}},K={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Cr=Symbol.for("react.element"),im=Symbol.for("react.portal"),am=Symbol.for("react.fragment"),om=Symbol.for("react.strict_mode"),lm=Symbol.for("react.profiler"),cm=Symbol.for("react.provider"),um=Symbol.for("react.context"),dm=Symbol.for("react.forward_ref"),fm=Symbol.for("react.suspense"),hm=Symbol.for("react.memo"),pm=Symbol.for("react.lazy"),Mc=Symbol.iterator;function mm(e){return e===null||typeof e!="object"?null:(e=Mc&&e[Mc]||e["@@iterator"],typeof e=="function"?e:null)}var Pd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Od=Object.assign,Id={};function ys(e,t,n){this.props=e,this.context=t,this.refs=Id,this.updater=n||Pd}ys.prototype.isReactComponent={};ys.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")};ys.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _d(){}_d.prototype=ys.prototype;function Nl(e,t,n){this.props=e,this.context=t,this.refs=Id,this.updater=n||Pd}var Sl=Nl.prototype=new _d;Sl.constructor=Nl;Od(Sl,ys.prototype);Sl.isPureReactComponent=!0;var $c=Array.isArray,Md=Object.prototype.hasOwnProperty,Cl={current:null},$d={key:!0,ref:!0,__self:!0,__source:!0};function Dd(e,t,n){var s,r={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)Md.call(t,s)&&!$d.hasOwnProperty(s)&&(r[s]=t[s]);var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(s in c=e.defaultProps,c)r[s]===void 0&&(r[s]=c[s]);return{$$typeof:Cr,type:e,key:a,ref:o,props:r,_owner:Cl.current}}function gm(e,t){return{$$typeof:Cr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function El(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cr}function ym(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Dc=/\/+/g;function Oa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ym(""+e.key):t.toString(36)}function ui(e,t,n,s,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Cr:case im:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+Oa(o,0):s,$c(r)?(n="",e!=null&&(n=e.replace(Dc,"$&/")+"/"),ui(r,t,n,"",function(u){return u})):r!=null&&(El(r)&&(r=gm(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(Dc,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",$c(e))for(var c=0;c<e.length;c++){a=e[c];var l=s+Oa(a,c);o+=ui(a,t,n,l,r)}else if(l=mm(e),typeof l=="function")for(e=l.call(e),c=0;!(a=e.next()).done;)a=a.value,l=s+Oa(a,c++),o+=ui(a,t,n,l,r);else if(a==="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 Rr(e,t,n){if(e==null)return e;var s=[],r=0;return ui(e,s,"","",function(a){return t.call(n,a,r++)}),s}function xm(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 Ie={current:null},di={transition:null},vm={ReactCurrentDispatcher:Ie,ReactCurrentBatchConfig:di,ReactCurrentOwner:Cl};function Rd(){throw Error("act(...) is not supported in production builds of React.")}K.Children={map:Rr,forEach:function(e,t,n){Rr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Rr(e,function(){t++}),t},toArray:function(e){return Rr(e,function(t){return t})||[]},only:function(e){if(!El(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};K.Component=ys;K.Fragment=am;K.Profiler=lm;K.PureComponent=Nl;K.StrictMode=om;K.Suspense=fm;K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vm;K.act=Rd;K.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Od({},e.props),r=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Cl.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)Md.call(t,l)&&!$d.hasOwnProperty(l)&&(s[l]=t[l]===void 0&&c!==void 0?c[l]:t[l])}var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}return{$$typeof:Cr,type:e.type,key:r,ref:a,props:s,_owner:o}};K.createContext=function(e){return e={$$typeof:um,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:cm,_context:e},e.Consumer=e};K.createElement=Dd;K.createFactory=function(e){var t=Dd.bind(null,e);return t.type=e,t};K.createRef=function(){return{current:null}};K.forwardRef=function(e){return{$$typeof:dm,render:e}};K.isValidElement=El;K.lazy=function(e){return{$$typeof:pm,_payload:{_status:-1,_result:e},_init:xm}};K.memo=function(e,t){return{$$typeof:hm,type:e,compare:t===void 0?null:t}};K.startTransition=function(e){var t=di.transition;di.transition={};try{e()}finally{di.transition=t}};K.unstable_act=Rd;K.useCallback=function(e,t){return Ie.current.useCallback(e,t)};K.useContext=function(e){return Ie.current.useContext(e)};K.useDebugValue=function(){};K.useDeferredValue=function(e){return Ie.current.useDeferredValue(e)};K.useEffect=function(e,t){return Ie.current.useEffect(e,t)};K.useId=function(){return Ie.current.useId()};K.useImperativeHandle=function(e,t,n){return Ie.current.useImperativeHandle(e,t,n)};K.useInsertionEffect=function(e,t){return Ie.current.useInsertionEffect(e,t)};K.useLayoutEffect=function(e,t){return Ie.current.useLayoutEffect(e,t)};K.useMemo=function(e,t){return Ie.current.useMemo(e,t)};K.useReducer=function(e,t,n){return Ie.current.useReducer(e,t,n)};K.useRef=function(e){return Ie.current.useRef(e)};K.useState=function(e){return Ie.current.useState(e)};K.useSyncExternalStore=function(e,t,n){return Ie.current.useSyncExternalStore(e,t,n)};K.useTransition=function(){return Ie.current.useTransition()};K.version="18.3.1";Ld.exports=K;var v=Ld.exports;const bm=rm(v),wm=sm({__proto__:null,default:bm},[v]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var jm=v,km=Symbol.for("react.element"),Nm=Symbol.for("react.fragment"),Sm=Object.prototype.hasOwnProperty,Cm=jm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Em={key:!0,ref:!0,__self:!0,__source:!0};function zd(e,t,n){var s,r={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Sm.call(t,s)&&!Em.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)r[s]===void 0&&(r[s]=t[s]);return{$$typeof:km,type:e,key:a,ref:o,props:r,_owner:Cm.current}}na.Fragment=Nm;na.jsx=zd;na.jsxs=zd;Ad.exports=na;var i=Ad.exports,Fd={exports:{}},Ke={},Bd={exports:{}},Ud={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(L,_){var D=L.length;L.push(_);e:for(;0<D;){var z=D-1>>>1,X=L[z];if(0<r(X,_))L[z]=_,L[D]=X,D=z;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var _=L[0],D=L.pop();if(D!==_){L[0]=D;e:for(var z=0,X=L.length,ye=X>>>1;z<ye;){var Me=2*(z+1)-1,cn=L[Me],pt=Me+1,I=L[pt];if(0>r(cn,D))pt<X&&0>r(I,cn)?(L[z]=I,L[pt]=D,z=pt):(L[z]=cn,L[Me]=D,z=Me);else if(pt<X&&0>r(I,D))L[z]=I,L[pt]=D,z=pt;else break e}}return _}function r(L,_){var D=L.sortIndex-_.sortIndex;return D!==0?D:L.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var l=[],u=[],h=1,d=null,p=3,x=!1,b=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(L){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=L)s(u),_.sortIndex=_.expirationTime,t(l,_);else break;_=n(u)}}function j(L){if(g=!1,f(L),!b)if(n(l)!==null)b=!0,O(k);else{var _=n(u);_!==null&&R(j,_.startTime-L)}}function k(L,_){b=!1,g&&(g=!1,m(S),S=-1),x=!0;var D=p;try{for(f(_),d=n(l);d!==null&&(!(d.expirationTime>_)||L&&!F());){var z=d.callback;if(typeof z=="function"){d.callback=null,p=d.priorityLevel;var X=z(d.expirationTime<=_);_=e.unstable_now(),typeof X=="function"?d.callback=X:d===n(l)&&s(l),f(_)}else s(l);d=n(l)}if(d!==null)var ye=!0;else{var Me=n(u);Me!==null&&R(j,Me.startTime-_),ye=!1}return ye}finally{d=null,p=D,x=!1}}var C=!1,N=null,S=-1,E=5,A=-1;function F(){return!(e.unstable_now()-A<E)}function V(){if(N!==null){var L=e.unstable_now();A=L;var _=!0;try{_=N(!0,L)}finally{_?G():(C=!1,N=null)}}else C=!1}var G;if(typeof y=="function")G=function(){y(V)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,$=T.port2;T.port1.onmessage=V,G=function(){$.postMessage(null)}}else G=function(){w(V,0)};function O(L){N=L,C||(C=!0,G())}function R(L,_){S=w(function(){L(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(L){L.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,O(k))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var _=3;break;default:_=p}var D=p;p=_;try{return L()}finally{p=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,_){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var D=p;p=L;try{return _()}finally{p=D}},e.unstable_scheduleCallback=function(L,_,D){var z=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?z+D:z):D=z,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=D+X,L={id:h++,callback:_,priorityLevel:L,startTime:D,expirationTime:X,sortIndex:-1},D>z?(L.sortIndex=D,t(u,L),n(l)===null&&L===n(u)&&(g?(m(S),S=-1):g=!0,R(j,D-z))):(L.sortIndex=X,t(l,L),b||x||(b=!0,O(k))),L},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(L){var _=p;return function(){var D=p;p=_;try{return L.apply(this,arguments)}finally{p=D}}}})(Ud);Bd.exports=Ud;var Tm=Bd.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Am=v,Ve=Tm;function P(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 Wd=new Set,ir={};function En(e,t){as(e,t),as(e+"Capture",t)}function as(e,t){for(ir[e]=t,e=0;e<t.length;e++)Wd.add(t[e])}var Pt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=Object.prototype.hasOwnProperty,Lm=/^[: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]*$/,Rc={},zc={};function Pm(e){return xo.call(zc,e)?!0:xo.call(Rc,e)?!1:Lm.test(e)?zc[e]=!0:(Rc[e]=!0,!1)}function Om(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Im(e,t,n,s){if(t===null||typeof t>"u"||Om(e,t,n,s))return!0;if(s)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 _e(e,t,n,s,r,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ne[e]=new _e(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ne[t]=new _e(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ne[e]=new _e(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ne[e]=new _e(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){Ne[e]=new _e(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ne[e]=new _e(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ne[e]=new _e(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ne[e]=new _e(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ne[e]=new _e(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tl=/[\-:]([a-z])/g;function Al(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(Tl,Al);Ne[t]=new _e(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(Tl,Al);Ne[t]=new _e(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(Tl,Al);Ne[t]=new _e(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ne[e]=new _e(e,1,!1,e.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new _e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ne[e]=new _e(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ll(e,t,n,s){var r=Ne.hasOwnProperty(t)?Ne[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Im(t,n,r,s)&&(n=null),s||r===null?Pm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Mt=Am.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zr=Symbol.for("react.element"),$n=Symbol.for("react.portal"),Dn=Symbol.for("react.fragment"),Pl=Symbol.for("react.strict_mode"),vo=Symbol.for("react.profiler"),Hd=Symbol.for("react.provider"),Vd=Symbol.for("react.context"),Ol=Symbol.for("react.forward_ref"),bo=Symbol.for("react.suspense"),wo=Symbol.for("react.suspense_list"),Il=Symbol.for("react.memo"),Rt=Symbol.for("react.lazy"),Kd=Symbol.for("react.offscreen"),Fc=Symbol.iterator;function Ts(e){return e===null||typeof e!="object"?null:(e=Fc&&e[Fc]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Object.assign,Ia;function Bs(e){if(Ia===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ia=t&&t[1]||""}return`
34
+ `+Ia+e}var _a=!1;function Ma(e,t){if(!e||_a)return"";_a=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
35
+ `),a=s.stack.split(`
36
+ `),o=r.length-1,c=a.length-1;1<=o&&0<=c&&r[o]!==a[c];)c--;for(;1<=o&&0<=c;o--,c--)if(r[o]!==a[c]){if(o!==1||c!==1)do if(o--,c--,0>c||r[o]!==a[c]){var l=`
37
+ `+r[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=c);break}}}finally{_a=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bs(e):""}function _m(e){switch(e.tag){case 5:return Bs(e.type);case 16:return Bs("Lazy");case 13:return Bs("Suspense");case 19:return Bs("SuspenseList");case 0:case 2:case 15:return e=Ma(e.type,!1),e;case 11:return e=Ma(e.type.render,!1),e;case 1:return e=Ma(e.type,!0),e;default:return""}}function jo(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 Dn:return"Fragment";case $n:return"Portal";case vo:return"Profiler";case Pl:return"StrictMode";case bo:return"Suspense";case wo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vd:return(e.displayName||"Context")+".Consumer";case Hd:return(e._context.displayName||"Context")+".Provider";case Ol:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Il:return t=e.displayName||null,t!==null?t:jo(e.type)||"Memo";case Rt:t=e._payload,e=e._init;try{return jo(e(t))}catch{}}return null}function Mm(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 jo(t);case 8:return t===Pl?"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 nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $m(e){var t=Gd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fr(e){e._valueTracker||(e._valueTracker=$m(e))}function qd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Gd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ci(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 ko(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=nn(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Yd(e,t){t=t.checked,t!=null&&Ll(e,"checked",t,!1)}function No(e,t){Yd(e,t);var n=nn(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?So(e,t.type,n):t.hasOwnProperty("defaultValue")&&So(e,t.type,nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Uc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="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 So(e,t,n){(t!=="number"||Ci(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Us=Array.isArray;function Xn(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+nn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Co(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Us(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:nn(n)}}function Qd(e,t){var n=nn(t.value),s=nn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Hc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jd(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 Eo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Br,Xd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Br=Br||document.createElement("div"),Br.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Br.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qs={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},Dm=["Webkit","ms","Moz","O"];Object.keys(qs).forEach(function(e){Dm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qs[t]=qs[e]})});function Zd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qs.hasOwnProperty(e)&&qs[e]?(""+t).trim():t+"px"}function ef(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Zd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Rm=ae({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 To(e,t){if(t){if(Rm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function Ao(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 Lo=null;function _l(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Po=null,Zn=null,es=null;function Vc(e){if(e=Ar(e)){if(typeof Po!="function")throw Error(P(280));var t=e.stateNode;t&&(t=oa(t),Po(e.stateNode,e.type,t))}}function tf(e){Zn?es?es.push(e):es=[e]:Zn=e}function nf(){if(Zn){var e=Zn,t=es;if(es=Zn=null,Vc(e),t)for(e=0;e<t.length;e++)Vc(t[e])}}function sf(e,t){return e(t)}function rf(){}var $a=!1;function af(e,t,n){if($a)return e(t,n);$a=!0;try{return sf(e,t,n)}finally{$a=!1,(Zn!==null||es!==null)&&(rf(),nf())}}function or(e,t){var n=e.stateNode;if(n===null)return null;var s=oa(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var Oo=!1;if(Pt)try{var As={};Object.defineProperty(As,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{Oo=!1}function zm(e,t,n,s,r,a,o,c,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var Ys=!1,Ei=null,Ti=!1,Io=null,Fm={onError:function(e){Ys=!0,Ei=e}};function Bm(e,t,n,s,r,a,o,c,l){Ys=!1,Ei=null,zm.apply(Fm,arguments)}function Um(e,t,n,s,r,a,o,c,l){if(Bm.apply(this,arguments),Ys){if(Ys){var u=Ei;Ys=!1,Ei=null}else throw Error(P(198));Ti||(Ti=!0,Io=u)}}function Tn(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 of(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 Kc(e){if(Tn(e)!==e)throw Error(P(188))}function Wm(e){var t=e.alternate;if(!t){if(t=Tn(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return Kc(r),e;if(a===s)return Kc(r),t;a=a.sibling}throw Error(P(188))}if(n.return!==s.return)n=r,s=a;else{for(var o=!1,c=r.child;c;){if(c===n){o=!0,n=r,s=a;break}if(c===s){o=!0,s=r,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,s=r;break}if(c===s){o=!0,s=a,n=r;break}c=c.sibling}if(!o)throw Error(P(189))}}if(n.alternate!==s)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function lf(e){return e=Wm(e),e!==null?cf(e):null}function cf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cf(e);if(t!==null)return t;e=e.sibling}return null}var uf=Ve.unstable_scheduleCallback,Gc=Ve.unstable_cancelCallback,Hm=Ve.unstable_shouldYield,Vm=Ve.unstable_requestPaint,ue=Ve.unstable_now,Km=Ve.unstable_getCurrentPriorityLevel,Ml=Ve.unstable_ImmediatePriority,df=Ve.unstable_UserBlockingPriority,Ai=Ve.unstable_NormalPriority,Gm=Ve.unstable_LowPriority,ff=Ve.unstable_IdlePriority,sa=null,bt=null;function qm(e){if(bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(sa,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:Jm,Ym=Math.log,Qm=Math.LN2;function Jm(e){return e>>>=0,e===0?32:31-(Ym(e)/Qm|0)|0}var Ur=64,Wr=4194304;function Ws(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 Li(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var c=o&~r;c!==0?s=Ws(c):(a&=o,a!==0&&(s=Ws(a)))}else o=n&~r,o!==0?s=Ws(o):a!==0&&(s=Ws(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,a=t&-t,r>=a||r===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-ut(t),r=1<<n,s|=e[n],t&=~r;return s}function Xm(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 Zm(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ut(a),c=1<<o,l=r[o];l===-1?(!(c&n)||c&s)&&(r[o]=Xm(c,t)):l<=t&&(e.expiredLanes|=c),a&=~c}}function _o(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hf(){var e=Ur;return Ur<<=1,!(Ur&4194240)&&(Ur=64),e}function Da(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function e0(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 s=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-ut(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function $l(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ut(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var J=0;function pf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var mf,Dl,gf,yf,xf,Mo=!1,Hr=[],Kt=null,Gt=null,qt=null,lr=new Map,cr=new Map,Bt=[],t0="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 qc(e,t){switch(e){case"focusin":case"focusout":Kt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":qt=null;break;case"pointerover":case"pointerout":lr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cr.delete(t.pointerId)}}function Ls(e,t,n,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=Ar(t),t!==null&&Dl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function n0(e,t,n,s,r){switch(t){case"focusin":return Kt=Ls(Kt,e,t,n,s,r),!0;case"dragenter":return Gt=Ls(Gt,e,t,n,s,r),!0;case"mouseover":return qt=Ls(qt,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return lr.set(a,Ls(lr.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,cr.set(a,Ls(cr.get(a)||null,e,t,n,s,r)),!0}return!1}function vf(e){var t=pn(e.target);if(t!==null){var n=Tn(t);if(n!==null){if(t=n.tag,t===13){if(t=of(n),t!==null){e.blockedOn=t,xf(e.priority,function(){gf(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 fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$o(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Lo=s,n.target.dispatchEvent(s),Lo=null}else return t=Ar(n),t!==null&&Dl(t),e.blockedOn=n,!1;t.shift()}return!0}function Yc(e,t,n){fi(e)&&n.delete(t)}function s0(){Mo=!1,Kt!==null&&fi(Kt)&&(Kt=null),Gt!==null&&fi(Gt)&&(Gt=null),qt!==null&&fi(qt)&&(qt=null),lr.forEach(Yc),cr.forEach(Yc)}function Ps(e,t){e.blockedOn===t&&(e.blockedOn=null,Mo||(Mo=!0,Ve.unstable_scheduleCallback(Ve.unstable_NormalPriority,s0)))}function ur(e){function t(r){return Ps(r,e)}if(0<Hr.length){Ps(Hr[0],e);for(var n=1;n<Hr.length;n++){var s=Hr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Kt!==null&&Ps(Kt,e),Gt!==null&&Ps(Gt,e),qt!==null&&Ps(qt,e),lr.forEach(t),cr.forEach(t),n=0;n<Bt.length;n++)s=Bt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Bt.length&&(n=Bt[0],n.blockedOn===null);)vf(n),n.blockedOn===null&&Bt.shift()}var ts=Mt.ReactCurrentBatchConfig,Pi=!0;function r0(e,t,n,s){var r=J,a=ts.transition;ts.transition=null;try{J=1,Rl(e,t,n,s)}finally{J=r,ts.transition=a}}function i0(e,t,n,s){var r=J,a=ts.transition;ts.transition=null;try{J=4,Rl(e,t,n,s)}finally{J=r,ts.transition=a}}function Rl(e,t,n,s){if(Pi){var r=$o(e,t,n,s);if(r===null)Ga(e,t,s,Oi,n),qc(e,s);else if(n0(r,e,t,n,s))s.stopPropagation();else if(qc(e,s),t&4&&-1<t0.indexOf(e)){for(;r!==null;){var a=Ar(r);if(a!==null&&mf(a),a=$o(e,t,n,s),a===null&&Ga(e,t,s,Oi,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else Ga(e,t,s,null,n)}}var Oi=null;function $o(e,t,n,s){if(Oi=null,e=_l(s),e=pn(e),e!==null)if(t=Tn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=of(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 Oi=e,null}function bf(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(Km()){case Ml:return 1;case df:return 4;case Ai:case Gm:return 16;case ff:return 536870912;default:return 16}default:return 16}}var Wt=null,zl=null,hi=null;function wf(){if(hi)return hi;var e,t=zl,n=t.length,s,r="value"in Wt?Wt.value:Wt.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[a-s];s++);return hi=r.slice(e,1<s?1-s:void 0)}function pi(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 Vr(){return!0}function Qc(){return!1}function Ge(e){function t(n,s,r,a,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(n=e[c],this[c]=n?n(a):a[c]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Vr:Qc,this.isPropagationStopped=Qc,this}return ae(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=Vr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vr)},persist:function(){},isPersistent:Vr}),t}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=Ge(xs),Tr=ae({},xs,{view:0,detail:0}),a0=Ge(Tr),Ra,za,Os,ra=ae({},Tr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bl,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!==Os&&(Os&&e.type==="mousemove"?(Ra=e.screenX-Os.screenX,za=e.screenY-Os.screenY):za=Ra=0,Os=e),Ra)},movementY:function(e){return"movementY"in e?e.movementY:za}}),Jc=Ge(ra),o0=ae({},ra,{dataTransfer:0}),l0=Ge(o0),c0=ae({},Tr,{relatedTarget:0}),Fa=Ge(c0),u0=ae({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),d0=Ge(u0),f0=ae({},xs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),h0=Ge(f0),p0=ae({},xs,{data:0}),Xc=Ge(p0),m0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g0={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"},y0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=y0[e])?!!t[e]:!1}function Bl(){return x0}var v0=ae({},Tr,{key:function(e){if(e.key){var t=m0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?g0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bl,charCode:function(e){return e.type==="keypress"?pi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),b0=Ge(v0),w0=ae({},ra,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zc=Ge(w0),j0=ae({},Tr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bl}),k0=Ge(j0),N0=ae({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),S0=Ge(N0),C0=ae({},ra,{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}),E0=Ge(C0),T0=[9,13,27,32],Ul=Pt&&"CompositionEvent"in window,Qs=null;Pt&&"documentMode"in document&&(Qs=document.documentMode);var A0=Pt&&"TextEvent"in window&&!Qs,jf=Pt&&(!Ul||Qs&&8<Qs&&11>=Qs),eu=" ",tu=!1;function kf(e,t){switch(e){case"keyup":return T0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function L0(e,t){switch(e){case"compositionend":return Nf(t);case"keypress":return t.which!==32?null:(tu=!0,eu);case"textInput":return e=t.data,e===eu&&tu?null:e;default:return null}}function P0(e,t){if(Rn)return e==="compositionend"||!Ul&&kf(e,t)?(e=wf(),hi=zl=Wt=null,Rn=!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 jf&&t.locale!=="ko"?null:t.data;default:return null}}var O0={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 nu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!O0[e.type]:t==="textarea"}function Sf(e,t,n,s){tf(s),t=Ii(t,"onChange"),0<t.length&&(n=new Fl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Js=null,dr=null;function I0(e){$f(e,0)}function ia(e){var t=Bn(e);if(qd(t))return e}function _0(e,t){if(e==="change")return t}var Cf=!1;if(Pt){var Ba;if(Pt){var Ua="oninput"in document;if(!Ua){var su=document.createElement("div");su.setAttribute("oninput","return;"),Ua=typeof su.oninput=="function"}Ba=Ua}else Ba=!1;Cf=Ba&&(!document.documentMode||9<document.documentMode)}function ru(){Js&&(Js.detachEvent("onpropertychange",Ef),dr=Js=null)}function Ef(e){if(e.propertyName==="value"&&ia(dr)){var t=[];Sf(t,dr,e,_l(e)),af(I0,t)}}function M0(e,t,n){e==="focusin"?(ru(),Js=t,dr=n,Js.attachEvent("onpropertychange",Ef)):e==="focusout"&&ru()}function $0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ia(dr)}function D0(e,t){if(e==="click")return ia(t)}function R0(e,t){if(e==="input"||e==="change")return ia(t)}function z0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ft=typeof Object.is=="function"?Object.is:z0;function fr(e,t){if(ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!xo.call(t,r)||!ft(e[r],t[r]))return!1}return!0}function iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function au(e,t){var n=iu(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=iu(n)}}function Tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Af(){for(var e=window,t=Ci();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ci(e.document)}return t}function Wl(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 F0(e){var t=Af(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tf(n.ownerDocument.documentElement,n)){if(s!==null&&Wl(n)){if(t=s.start,e=s.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 r=n.textContent.length,a=Math.min(s.start,r);s=s.end===void 0?a:Math.min(s.end,r),!e.extend&&a>s&&(r=s,s=a,a=r),r=au(n,a);var o=au(n,s);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),a>s?(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 B0=Pt&&"documentMode"in document&&11>=document.documentMode,zn=null,Do=null,Xs=null,Ro=!1;function ou(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ro||zn==null||zn!==Ci(s)||(s=zn,"selectionStart"in s&&Wl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Xs&&fr(Xs,s)||(Xs=s,s=Ii(Do,"onSelect"),0<s.length&&(t=new Fl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=zn)))}function Kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fn={animationend:Kr("Animation","AnimationEnd"),animationiteration:Kr("Animation","AnimationIteration"),animationstart:Kr("Animation","AnimationStart"),transitionend:Kr("Transition","TransitionEnd")},Wa={},Lf={};Pt&&(Lf=document.createElement("div").style,"AnimationEvent"in window||(delete Fn.animationend.animation,delete Fn.animationiteration.animation,delete Fn.animationstart.animation),"TransitionEvent"in window||delete Fn.transitionend.transition);function aa(e){if(Wa[e])return Wa[e];if(!Fn[e])return e;var t=Fn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lf)return Wa[e]=t[n];return e}var Pf=aa("animationend"),Of=aa("animationiteration"),If=aa("animationstart"),_f=aa("transitionend"),Mf=new Map,lu="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 rn(e,t){Mf.set(e,t),En(t,[e])}for(var Ha=0;Ha<lu.length;Ha++){var Va=lu[Ha],U0=Va.toLowerCase(),W0=Va[0].toUpperCase()+Va.slice(1);rn(U0,"on"+W0)}rn(Pf,"onAnimationEnd");rn(Of,"onAnimationIteration");rn(If,"onAnimationStart");rn("dblclick","onDoubleClick");rn("focusin","onFocus");rn("focusout","onBlur");rn(_f,"onTransitionEnd");as("onMouseEnter",["mouseout","mouseover"]);as("onMouseLeave",["mouseout","mouseover"]);as("onPointerEnter",["pointerout","pointerover"]);as("onPointerLeave",["pointerout","pointerover"]);En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));En("onBeforeInput",["compositionend","keypress","textInput","paste"]);En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hs="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(" "),H0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hs));function cu(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,Um(s,t,void 0,e),e.currentTarget=null}function $f(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var c=s[o],l=c.instance,u=c.currentTarget;if(c=c.listener,l!==a&&r.isPropagationStopped())break e;cu(r,c,u),a=l}else for(o=0;o<s.length;o++){if(c=s[o],l=c.instance,u=c.currentTarget,c=c.listener,l!==a&&r.isPropagationStopped())break e;cu(r,c,u),a=l}}}if(Ti)throw e=Io,Ti=!1,Io=null,e}function te(e,t){var n=t[Wo];n===void 0&&(n=t[Wo]=new Set);var s=e+"__bubble";n.has(s)||(Df(t,e,2,!1),n.add(s))}function Ka(e,t,n){var s=0;t&&(s|=4),Df(n,e,s,t)}var Gr="_reactListening"+Math.random().toString(36).slice(2);function hr(e){if(!e[Gr]){e[Gr]=!0,Wd.forEach(function(n){n!=="selectionchange"&&(H0.has(n)||Ka(n,!1,e),Ka(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gr]||(t[Gr]=!0,Ka("selectionchange",!1,t))}}function Df(e,t,n,s){switch(bf(t)){case 1:var r=r0;break;case 4:r=i0;break;default:r=Rl}n=r.bind(null,t,n,e),r=void 0,!Oo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Ga(e,t,n,s,r){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var c=s.stateNode.containerInfo;if(c===r||c.nodeType===8&&c.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;c!==null;){if(o=pn(c),o===null)return;if(l=o.tag,l===5||l===6){s=a=o;continue e}c=c.parentNode}}s=s.return}af(function(){var u=a,h=_l(n),d=[];e:{var p=Mf.get(e);if(p!==void 0){var x=Fl,b=e;switch(e){case"keypress":if(pi(n)===0)break e;case"keydown":case"keyup":x=b0;break;case"focusin":b="focus",x=Fa;break;case"focusout":b="blur",x=Fa;break;case"beforeblur":case"afterblur":x=Fa;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":x=Jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=l0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=k0;break;case Pf:case Of:case If:x=d0;break;case _f:x=S0;break;case"scroll":x=a0;break;case"wheel":x=E0;break;case"copy":case"cut":case"paste":x=h0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Zc}var g=(t&4)!==0,w=!g&&e==="scroll",m=g?p!==null?p+"Capture":null:p;g=[];for(var y=u,f;y!==null;){f=y;var j=f.stateNode;if(f.tag===5&&j!==null&&(f=j,m!==null&&(j=or(y,m),j!=null&&g.push(pr(y,j,f)))),w)break;y=y.return}0<g.length&&(p=new x(p,b,null,n,h),d.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",p&&n!==Lo&&(b=n.relatedTarget||n.fromElement)&&(pn(b)||b[Ot]))break e;if((x||p)&&(p=h.window===h?h:(p=h.ownerDocument)?p.defaultView||p.parentWindow:window,x?(b=n.relatedTarget||n.toElement,x=u,b=b?pn(b):null,b!==null&&(w=Tn(b),b!==w||b.tag!==5&&b.tag!==6)&&(b=null)):(x=null,b=u),x!==b)){if(g=Jc,j="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=Zc,j="onPointerLeave",m="onPointerEnter",y="pointer"),w=x==null?p:Bn(x),f=b==null?p:Bn(b),p=new g(j,y+"leave",x,n,h),p.target=w,p.relatedTarget=f,j=null,pn(h)===u&&(g=new g(m,y+"enter",b,n,h),g.target=f,g.relatedTarget=w,j=g),w=j,x&&b)t:{for(g=x,m=b,y=0,f=g;f;f=Ln(f))y++;for(f=0,j=m;j;j=Ln(j))f++;for(;0<y-f;)g=Ln(g),y--;for(;0<f-y;)m=Ln(m),f--;for(;y--;){if(g===m||m!==null&&g===m.alternate)break t;g=Ln(g),m=Ln(m)}g=null}else g=null;x!==null&&uu(d,p,x,g,!1),b!==null&&w!==null&&uu(d,w,b,g,!0)}}e:{if(p=u?Bn(u):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var k=_0;else if(nu(p))if(Cf)k=R0;else{k=$0;var C=M0}else(x=p.nodeName)&&x.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=D0);if(k&&(k=k(e,u))){Sf(d,k,n,h);break e}C&&C(e,p,u),e==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&So(p,"number",p.value)}switch(C=u?Bn(u):window,e){case"focusin":(nu(C)||C.contentEditable==="true")&&(zn=C,Do=u,Xs=null);break;case"focusout":Xs=Do=zn=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,ou(d,n,h);break;case"selectionchange":if(B0)break;case"keydown":case"keyup":ou(d,n,h)}var N;if(Ul)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Rn?kf(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(jf&&n.locale!=="ko"&&(Rn||S!=="onCompositionStart"?S==="onCompositionEnd"&&Rn&&(N=wf()):(Wt=h,zl="value"in Wt?Wt.value:Wt.textContent,Rn=!0)),C=Ii(u,S),0<C.length&&(S=new Xc(S,e,null,n,h),d.push({event:S,listeners:C}),N?S.data=N:(N=Nf(n),N!==null&&(S.data=N)))),(N=A0?L0(e,n):P0(e,n))&&(u=Ii(u,"onBeforeInput"),0<u.length&&(h=new Xc("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:u}),h.data=N))}$f(d,t)})}function pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ii(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=or(e,n),a!=null&&s.unshift(pr(e,a,r)),a=or(e,t),a!=null&&s.push(pr(e,a,r))),e=e.return}return s}function Ln(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function uu(e,t,n,s,r){for(var a=t._reactName,o=[];n!==null&&n!==s;){var c=n,l=c.alternate,u=c.stateNode;if(l!==null&&l===s)break;c.tag===5&&u!==null&&(c=u,r?(l=or(n,a),l!=null&&o.unshift(pr(n,l,c))):r||(l=or(n,a),l!=null&&o.push(pr(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var V0=/\r\n?/g,K0=/\u0000|\uFFFD/g;function du(e){return(typeof e=="string"?e:""+e).replace(V0,`
38
+ `).replace(K0,"")}function qr(e,t,n){if(t=du(t),du(e)!==t&&n)throw Error(P(425))}function _i(){}var zo=null,Fo=null;function Bo(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 Uo=typeof setTimeout=="function"?setTimeout:void 0,G0=typeof clearTimeout=="function"?clearTimeout:void 0,fu=typeof Promise=="function"?Promise:void 0,q0=typeof queueMicrotask=="function"?queueMicrotask:typeof fu<"u"?function(e){return fu.resolve(null).then(e).catch(Y0)}:Uo;function Y0(e){setTimeout(function(){throw e})}function qa(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){e.removeChild(r),ur(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);ur(t)}function Yt(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 hu(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 vs=Math.random().toString(36).slice(2),vt="__reactFiber$"+vs,mr="__reactProps$"+vs,Ot="__reactContainer$"+vs,Wo="__reactEvents$"+vs,Q0="__reactListeners$"+vs,J0="__reactHandles$"+vs;function pn(e){var t=e[vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hu(e);e!==null;){if(n=e[vt])return n;e=hu(e)}return t}e=n,n=e.parentNode}return null}function Ar(e){return e=e[vt]||e[Ot],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function oa(e){return e[mr]||null}var Ho=[],Un=-1;function an(e){return{current:e}}function ne(e){0>Un||(e.current=Ho[Un],Ho[Un]=null,Un--)}function Z(e,t){Un++,Ho[Un]=e.current,e.current=t}var sn={},Te=an(sn),ze=an(!1),wn=sn;function os(e,t){var n=e.type.contextTypes;if(!n)return sn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},a;for(a in n)r[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Fe(e){return e=e.childContextTypes,e!=null}function Mi(){ne(ze),ne(Te)}function pu(e,t,n){if(Te.current!==sn)throw Error(P(168));Z(Te,t),Z(ze,n)}function Rf(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in t))throw Error(P(108,Mm(e)||"Unknown",r));return ae({},n,s)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,wn=Te.current,Z(Te,e),Z(ze,ze.current),!0}function mu(e,t,n){var s=e.stateNode;if(!s)throw Error(P(169));n?(e=Rf(e,t,wn),s.__reactInternalMemoizedMergedChildContext=e,ne(ze),ne(Te),Z(Te,e)):ne(ze),Z(ze,n)}var St=null,la=!1,Ya=!1;function zf(e){St===null?St=[e]:St.push(e)}function X0(e){la=!0,zf(e)}function on(){if(!Ya&&St!==null){Ya=!0;var e=0,t=J;try{var n=St;for(J=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}St=null,la=!1}catch(r){throw St!==null&&(St=St.slice(e+1)),uf(Ml,on),r}finally{J=t,Ya=!1}}return null}var Wn=[],Hn=0,Di=null,Ri=0,Ye=[],Qe=0,jn=null,Ct=1,Et="";function dn(e,t){Wn[Hn++]=Ri,Wn[Hn++]=Di,Di=e,Ri=t}function Ff(e,t,n){Ye[Qe++]=Ct,Ye[Qe++]=Et,Ye[Qe++]=jn,jn=e;var s=Ct;e=Et;var r=32-ut(s)-1;s&=~(1<<r),n+=1;var a=32-ut(t)+r;if(30<a){var o=r-r%5;a=(s&(1<<o)-1).toString(32),s>>=o,r-=o,Ct=1<<32-ut(t)+r|n<<r|s,Et=a+e}else Ct=1<<a|n<<r|s,Et=e}function Hl(e){e.return!==null&&(dn(e,1),Ff(e,1,0))}function Vl(e){for(;e===Di;)Di=Wn[--Hn],Wn[Hn]=null,Ri=Wn[--Hn],Wn[Hn]=null;for(;e===jn;)jn=Ye[--Qe],Ye[Qe]=null,Et=Ye[--Qe],Ye[Qe]=null,Ct=Ye[--Qe],Ye[Qe]=null}var He=null,We=null,se=!1,ct=null;function Bf(e,t){var n=Xe(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 gu(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,He=e,We=Yt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,He=e,We=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=jn!==null?{id:Ct,overflow:Et}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,He=e,We=null,!0):!1;default:return!1}}function Vo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ko(e){if(se){var t=We;if(t){var n=t;if(!gu(e,t)){if(Vo(e))throw Error(P(418));t=Yt(n.nextSibling);var s=He;t&&gu(e,t)?Bf(s,n):(e.flags=e.flags&-4097|2,se=!1,He=e)}}else{if(Vo(e))throw Error(P(418));e.flags=e.flags&-4097|2,se=!1,He=e}}}function yu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;He=e}function Yr(e){if(e!==He)return!1;if(!se)return yu(e),se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Bo(e.type,e.memoizedProps)),t&&(t=We)){if(Vo(e))throw Uf(),Error(P(418));for(;t;)Bf(e,t),t=Yt(t.nextSibling)}if(yu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){We=Yt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}We=null}}else We=He?Yt(e.stateNode.nextSibling):null;return!0}function Uf(){for(var e=We;e;)e=Yt(e.nextSibling)}function ls(){We=He=null,se=!1}function Kl(e){ct===null?ct=[e]:ct.push(e)}var Z0=Mt.ReactCurrentBatchConfig;function Is(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(P(309));var s=n.stateNode}if(!s)throw Error(P(147,e));var r=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var c=r.refs;o===null?delete c[a]:c[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function Qr(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xu(e){var t=e._init;return t(e._payload)}function Wf(e){function t(m,y){if(e){var f=m.deletions;f===null?(m.deletions=[y],m.flags|=16):f.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function s(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function r(m,y){return m=Zt(m,y),m.index=0,m.sibling=null,m}function a(m,y,f){return m.index=f,e?(f=m.alternate,f!==null?(f=f.index,f<y?(m.flags|=2,y):f):(m.flags|=2,y)):(m.flags|=1048576,y)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function c(m,y,f,j){return y===null||y.tag!==6?(y=no(f,m.mode,j),y.return=m,y):(y=r(y,f),y.return=m,y)}function l(m,y,f,j){var k=f.type;return k===Dn?h(m,y,f.props.children,j,f.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Rt&&xu(k)===y.type)?(j=r(y,f.props),j.ref=Is(m,y,f),j.return=m,j):(j=wi(f.type,f.key,f.props,null,m.mode,j),j.ref=Is(m,y,f),j.return=m,j)}function u(m,y,f,j){return y===null||y.tag!==4||y.stateNode.containerInfo!==f.containerInfo||y.stateNode.implementation!==f.implementation?(y=so(f,m.mode,j),y.return=m,y):(y=r(y,f.children||[]),y.return=m,y)}function h(m,y,f,j,k){return y===null||y.tag!==7?(y=bn(f,m.mode,j,k),y.return=m,y):(y=r(y,f),y.return=m,y)}function d(m,y,f){if(typeof y=="string"&&y!==""||typeof y=="number")return y=no(""+y,m.mode,f),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case zr:return f=wi(y.type,y.key,y.props,null,m.mode,f),f.ref=Is(m,null,y),f.return=m,f;case $n:return y=so(y,m.mode,f),y.return=m,y;case Rt:var j=y._init;return d(m,j(y._payload),f)}if(Us(y)||Ts(y))return y=bn(y,m.mode,f,null),y.return=m,y;Qr(m,y)}return null}function p(m,y,f,j){var k=y!==null?y.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return k!==null?null:c(m,y,""+f,j);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case zr:return f.key===k?l(m,y,f,j):null;case $n:return f.key===k?u(m,y,f,j):null;case Rt:return k=f._init,p(m,y,k(f._payload),j)}if(Us(f)||Ts(f))return k!==null?null:h(m,y,f,j,null);Qr(m,f)}return null}function x(m,y,f,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return m=m.get(f)||null,c(y,m,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case zr:return m=m.get(j.key===null?f:j.key)||null,l(y,m,j,k);case $n:return m=m.get(j.key===null?f:j.key)||null,u(y,m,j,k);case Rt:var C=j._init;return x(m,y,f,C(j._payload),k)}if(Us(j)||Ts(j))return m=m.get(f)||null,h(y,m,j,k,null);Qr(y,j)}return null}function b(m,y,f,j){for(var k=null,C=null,N=y,S=y=0,E=null;N!==null&&S<f.length;S++){N.index>S?(E=N,N=null):E=N.sibling;var A=p(m,N,f[S],j);if(A===null){N===null&&(N=E);break}e&&N&&A.alternate===null&&t(m,N),y=a(A,y,S),C===null?k=A:C.sibling=A,C=A,N=E}if(S===f.length)return n(m,N),se&&dn(m,S),k;if(N===null){for(;S<f.length;S++)N=d(m,f[S],j),N!==null&&(y=a(N,y,S),C===null?k=N:C.sibling=N,C=N);return se&&dn(m,S),k}for(N=s(m,N);S<f.length;S++)E=x(N,m,S,f[S],j),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?S:E.key),y=a(E,y,S),C===null?k=E:C.sibling=E,C=E);return e&&N.forEach(function(F){return t(m,F)}),se&&dn(m,S),k}function g(m,y,f,j){var k=Ts(f);if(typeof k!="function")throw Error(P(150));if(f=k.call(f),f==null)throw Error(P(151));for(var C=k=null,N=y,S=y=0,E=null,A=f.next();N!==null&&!A.done;S++,A=f.next()){N.index>S?(E=N,N=null):E=N.sibling;var F=p(m,N,A.value,j);if(F===null){N===null&&(N=E);break}e&&N&&F.alternate===null&&t(m,N),y=a(F,y,S),C===null?k=F:C.sibling=F,C=F,N=E}if(A.done)return n(m,N),se&&dn(m,S),k;if(N===null){for(;!A.done;S++,A=f.next())A=d(m,A.value,j),A!==null&&(y=a(A,y,S),C===null?k=A:C.sibling=A,C=A);return se&&dn(m,S),k}for(N=s(m,N);!A.done;S++,A=f.next())A=x(N,m,S,A.value,j),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?S:A.key),y=a(A,y,S),C===null?k=A:C.sibling=A,C=A);return e&&N.forEach(function(V){return t(m,V)}),se&&dn(m,S),k}function w(m,y,f,j){if(typeof f=="object"&&f!==null&&f.type===Dn&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case zr:e:{for(var k=f.key,C=y;C!==null;){if(C.key===k){if(k=f.type,k===Dn){if(C.tag===7){n(m,C.sibling),y=r(C,f.props.children),y.return=m,m=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Rt&&xu(k)===C.type){n(m,C.sibling),y=r(C,f.props),y.ref=Is(m,C,f),y.return=m,m=y;break e}n(m,C);break}else t(m,C);C=C.sibling}f.type===Dn?(y=bn(f.props.children,m.mode,j,f.key),y.return=m,m=y):(j=wi(f.type,f.key,f.props,null,m.mode,j),j.ref=Is(m,y,f),j.return=m,m=j)}return o(m);case $n:e:{for(C=f.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===f.containerInfo&&y.stateNode.implementation===f.implementation){n(m,y.sibling),y=r(y,f.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else t(m,y);y=y.sibling}y=so(f,m.mode,j),y.return=m,m=y}return o(m);case Rt:return C=f._init,w(m,y,C(f._payload),j)}if(Us(f))return b(m,y,f,j);if(Ts(f))return g(m,y,f,j);Qr(m,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,y!==null&&y.tag===6?(n(m,y.sibling),y=r(y,f),y.return=m,m=y):(n(m,y),y=no(f,m.mode,j),y.return=m,m=y),o(m)):n(m,y)}return w}var cs=Wf(!0),Hf=Wf(!1),zi=an(null),Fi=null,Vn=null,Gl=null;function ql(){Gl=Vn=Fi=null}function Yl(e){var t=zi.current;ne(zi),e._currentValue=t}function Go(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function ns(e,t){Fi=e,Gl=Vn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(Gl!==e)if(e={context:e,memoizedValue:t,next:null},Vn===null){if(Fi===null)throw Error(P(308));Vn=e,Fi.dependencies={lanes:0,firstContext:e}}else Vn=Vn.next=e;return t}var mn=null;function Ql(e){mn===null?mn=[e]:mn.push(e)}function Vf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Ql(t)):(n.next=r.next,r.next=n),t.interleaved=n,It(e,s)}function It(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 zt=!1;function Jl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kf(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 At(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Y&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,It(e,n)}return r=s.interleaved,r===null?(t.next=t,Ql(s)):(t.next=r.next,r.next=t),s.interleaved=t,It(e,n)}function mi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$l(e,n)}}function vu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,a=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};a===null?r=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Bi(e,t,n,s){var r=e.updateQueue;zt=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,c=r.shared.pending;if(c!==null){r.shared.pending=null;var l=c,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var h=e.alternate;h!==null&&(h=h.updateQueue,c=h.lastBaseUpdate,c!==o&&(c===null?h.firstBaseUpdate=u:c.next=u,h.lastBaseUpdate=l))}if(a!==null){var d=r.baseState;o=0,h=u=l=null,c=a;do{var p=c.lane,x=c.eventTime;if((s&p)===p){h!==null&&(h=h.next={eventTime:x,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var b=e,g=c;switch(p=t,x=n,g.tag){case 1:if(b=g.payload,typeof b=="function"){d=b.call(x,d,p);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,p=typeof b=="function"?b.call(x,d,p):b,p==null)break e;d=ae({},d,p);break e;case 2:zt=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,p=r.effects,p===null?r.effects=[c]:p.push(c))}else x={eventTime:x,lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},h===null?(u=h=x,l=d):h=h.next=x,o|=p;if(c=c.next,c===null){if(c=r.shared.pending,c===null)break;p=c,c=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(h===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=h,t=r.shared.interleaved,t!==null){r=t;do o|=r.lane,r=r.next;while(r!==t)}else a===null&&(r.shared.lanes=0);Nn|=o,e.lanes=o,e.memoizedState=d}}function bu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(P(191,r));r.call(s)}}}var Lr={},wt=an(Lr),gr=an(Lr),yr=an(Lr);function gn(e){if(e===Lr)throw Error(P(174));return e}function Xl(e,t){switch(Z(yr,t),Z(gr,e),Z(wt,Lr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Eo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Eo(t,e)}ne(wt),Z(wt,t)}function us(){ne(wt),ne(gr),ne(yr)}function Gf(e){gn(yr.current);var t=gn(wt.current),n=Eo(t,e.type);t!==n&&(Z(gr,e),Z(wt,n))}function Zl(e){gr.current===e&&(ne(wt),ne(gr))}var re=an(0);function Ui(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 Qa=[];function ec(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var gi=Mt.ReactCurrentDispatcher,Ja=Mt.ReactCurrentBatchConfig,kn=0,ie=null,me=null,ve=null,Wi=!1,Zs=!1,xr=0,eg=0;function Se(){throw Error(P(321))}function tc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function nc(e,t,n,s,r,a){if(kn=a,ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gi.current=e===null||e.memoizedState===null?rg:ig,e=n(s,r),Zs){a=0;do{if(Zs=!1,xr=0,25<=a)throw Error(P(301));a+=1,ve=me=null,t.updateQueue=null,gi.current=ag,e=n(s,r)}while(Zs)}if(gi.current=Hi,t=me!==null&&me.next!==null,kn=0,ve=me=ie=null,Wi=!1,t)throw Error(P(300));return e}function sc(){var e=xr!==0;return xr=0,e}function yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ve===null?ie.memoizedState=ve=e:ve=ve.next=e,ve}function nt(){if(me===null){var e=ie.alternate;e=e!==null?e.memoizedState:null}else e=me.next;var t=ve===null?ie.memoizedState:ve.next;if(t!==null)ve=t,me=e;else{if(e===null)throw Error(P(310));me=e,e={memoizedState:me.memoizedState,baseState:me.baseState,baseQueue:me.baseQueue,queue:me.queue,next:null},ve===null?ie.memoizedState=ve=e:ve=ve.next=e}return ve}function vr(e,t){return typeof t=="function"?t(e):t}function Xa(e){var t=nt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var s=me,r=s.baseQueue,a=n.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}s.baseQueue=r=a,n.pending=null}if(r!==null){a=r.next,s=s.baseState;var c=o=null,l=null,u=a;do{var h=u.lane;if((kn&h)===h)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=d,o=s):l=l.next=d,ie.lanes|=h,Nn|=h}u=u.next}while(u!==null&&u!==a);l===null?o=s:l.next=c,ft(s,t.memoizedState)||(De=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=l,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,ie.lanes|=a,Nn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Za(e){var t=nt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=e(a,o.action),o=o.next;while(o!==r);ft(a,t.memoizedState)||(De=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function qf(){}function Yf(e,t){var n=ie,s=nt(),r=t(),a=!ft(s.memoizedState,r);if(a&&(s.memoizedState=r,De=!0),s=s.queue,rc(Xf.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||ve!==null&&ve.memoizedState.tag&1){if(n.flags|=2048,br(9,Jf.bind(null,n,s,r,t),void 0,null),be===null)throw Error(P(349));kn&30||Qf(n,t,r)}return r}function Qf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ie.updateQueue,t===null?(t={lastEffect:null,stores:null},ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jf(e,t,n,s){t.value=n,t.getSnapshot=s,Zf(t)&&eh(e)}function Xf(e,t,n){return n(function(){Zf(t)&&eh(e)})}function Zf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function eh(e){var t=It(e,1);t!==null&&dt(t,e,1,-1)}function wu(e){var t=yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:e},t.queue=e,e=e.dispatch=sg.bind(null,ie,e),[t.memoizedState,e]}function br(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=ie.updateQueue,t===null?(t={lastEffect:null,stores:null},ie.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function th(){return nt().memoizedState}function yi(e,t,n,s){var r=yt();ie.flags|=e,r.memoizedState=br(1|t,n,void 0,s===void 0?null:s)}function ca(e,t,n,s){var r=nt();s=s===void 0?null:s;var a=void 0;if(me!==null){var o=me.memoizedState;if(a=o.destroy,s!==null&&tc(s,o.deps)){r.memoizedState=br(t,n,a,s);return}}ie.flags|=e,r.memoizedState=br(1|t,n,a,s)}function ju(e,t){return yi(8390656,8,e,t)}function rc(e,t){return ca(2048,8,e,t)}function nh(e,t){return ca(4,2,e,t)}function sh(e,t){return ca(4,4,e,t)}function rh(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 ih(e,t,n){return n=n!=null?n.concat([e]):null,ca(4,4,rh.bind(null,t,e),n)}function ic(){}function ah(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&tc(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function oh(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&tc(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function lh(e,t,n){return kn&21?(ft(n,t)||(n=hf(),ie.lanes|=n,Nn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=n)}function tg(e,t){var n=J;J=n!==0&&4>n?n:4,e(!0);var s=Ja.transition;Ja.transition={};try{e(!1),t()}finally{J=n,Ja.transition=s}}function ch(){return nt().memoizedState}function ng(e,t,n){var s=Xt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},uh(e))dh(t,n);else if(n=Vf(e,t,n,s),n!==null){var r=Pe();dt(n,e,s,r),fh(n,t,s)}}function sg(e,t,n){var s=Xt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(uh(e))dh(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,c=a(o,n);if(r.hasEagerState=!0,r.eagerState=c,ft(c,o)){var l=t.interleaved;l===null?(r.next=r,Ql(t)):(r.next=l.next,l.next=r),t.interleaved=r;return}}catch{}finally{}n=Vf(e,t,r,s),n!==null&&(r=Pe(),dt(n,e,s,r),fh(n,t,s))}}function uh(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function dh(e,t){Zs=Wi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fh(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$l(e,n)}}var Hi={readContext:tt,useCallback:Se,useContext:Se,useEffect:Se,useImperativeHandle:Se,useInsertionEffect:Se,useLayoutEffect:Se,useMemo:Se,useReducer:Se,useRef:Se,useState:Se,useDebugValue:Se,useDeferredValue:Se,useTransition:Se,useMutableSource:Se,useSyncExternalStore:Se,useId:Se,unstable_isNewReconciler:!1},rg={readContext:tt,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:ju,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,yi(4194308,4,rh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return yi(4194308,4,e,t)},useInsertionEffect:function(e,t){return yi(4,2,e,t)},useMemo:function(e,t){var n=yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=yt();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=ng.bind(null,ie,e),[s.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:wu,useDebugValue:ic,useDeferredValue:function(e){return yt().memoizedState=e},useTransition:function(){var e=wu(!1),t=e[0];return e=tg.bind(null,e[1]),yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=ie,r=yt();if(se){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),be===null)throw Error(P(349));kn&30||Qf(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,ju(Xf.bind(null,s,a,e),[e]),s.flags|=2048,br(9,Jf.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=yt(),t=be.identifierPrefix;if(se){var n=Et,s=Ct;n=(s&~(1<<32-ut(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=xr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=eg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ig={readContext:tt,useCallback:ah,useContext:tt,useEffect:rc,useImperativeHandle:ih,useInsertionEffect:nh,useLayoutEffect:sh,useMemo:oh,useReducer:Xa,useRef:th,useState:function(){return Xa(vr)},useDebugValue:ic,useDeferredValue:function(e){var t=nt();return lh(t,me.memoizedState,e)},useTransition:function(){var e=Xa(vr)[0],t=nt().memoizedState;return[e,t]},useMutableSource:qf,useSyncExternalStore:Yf,useId:ch,unstable_isNewReconciler:!1},ag={readContext:tt,useCallback:ah,useContext:tt,useEffect:rc,useImperativeHandle:ih,useInsertionEffect:nh,useLayoutEffect:sh,useMemo:oh,useReducer:Za,useRef:th,useState:function(){return Za(vr)},useDebugValue:ic,useDeferredValue:function(e){var t=nt();return me===null?t.memoizedState=e:lh(t,me.memoizedState,e)},useTransition:function(){var e=Za(vr)[0],t=nt().memoizedState;return[e,t]},useMutableSource:qf,useSyncExternalStore:Yf,useId:ch,unstable_isNewReconciler:!1};function ot(e,t){if(e&&e.defaultProps){t=ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qo(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ua={isMounted:function(e){return(e=e._reactInternals)?Tn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Xt(e),a=At(s,r);a.payload=t,n!=null&&(a.callback=n),t=Qt(e,a,r),t!==null&&(dt(t,e,r,s),mi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Xt(e),a=At(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Qt(e,a,r),t!==null&&(dt(t,e,r,s),mi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pe(),s=Xt(e),r=At(n,s);r.tag=2,t!=null&&(r.callback=t),t=Qt(e,r,s),t!==null&&(dt(t,e,s,n),mi(t,e,s))}};function ku(e,t,n,s,r,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!fr(n,s)||!fr(r,a):!0}function hh(e,t,n){var s=!1,r=sn,a=t.contextType;return typeof a=="object"&&a!==null?a=tt(a):(r=Fe(t)?wn:Te.current,s=t.contextTypes,a=(s=s!=null)?os(e,r):sn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ua,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function Nu(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&ua.enqueueReplaceState(t,t.state,null)}function Yo(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Jl(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=tt(a):(a=Fe(t)?wn:Te.current,r.context=os(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(qo(e,t,a,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&ua.enqueueReplaceState(r,r.state,null),Bi(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ds(e,t){try{var n="",s=t;do n+=_m(s),s=s.return;while(s);var r=n}catch(a){r=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:r,digest:null}}function eo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Qo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var og=typeof WeakMap=="function"?WeakMap:Map;function ph(e,t,n){n=At(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Ki||(Ki=!0,al=s),Qo(e,t)},n}function mh(e,t,n){n=At(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){Qo(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Qo(e,t),typeof s!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Su(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new og;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(r.add(n),e=wg.bind(null,e,t,n),t.then(e,e))}function Cu(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 Eu(e,t,n,s,r){return e.mode&1?(e.flags|=65536,e.lanes=r,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=At(-1,1),t.tag=2,Qt(n,t,1))),n.lanes|=1),e)}var lg=Mt.ReactCurrentOwner,De=!1;function Ae(e,t,n,s){t.child=e===null?Hf(t,null,n,s):cs(t,e.child,n,s)}function Tu(e,t,n,s,r){n=n.render;var a=t.ref;return ns(t,r),s=nc(e,t,n,s,a,r),n=sc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,_t(e,t,r)):(se&&n&&Hl(t),t.flags|=1,Ae(e,t,s,r),t.child)}function Au(e,t,n,s,r){if(e===null){var a=n.type;return typeof a=="function"&&!hc(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,gh(e,t,a,s,r)):(e=wi(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:fr,n(o,s)&&e.ref===t.ref)return _t(e,t,r)}return t.flags|=1,e=Zt(a,s),e.ref=t.ref,e.return=t,t.child=e}function gh(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if(fr(a,s)&&e.ref===t.ref)if(De=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,_t(e,t,r)}return Jo(e,t,n,s,r)}function yh(e,t,n){var s=t.pendingProps,r=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Z(Gn,Ue),Ue|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Z(Gn,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,Z(Gn,Ue),Ue|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,Z(Gn,Ue),Ue|=s;return Ae(e,t,r,n),t.child}function xh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jo(e,t,n,s,r){var a=Fe(n)?wn:Te.current;return a=os(t,a),ns(t,r),n=nc(e,t,n,s,a,r),s=sc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,_t(e,t,r)):(se&&s&&Hl(t),t.flags|=1,Ae(e,t,n,r),t.child)}function Lu(e,t,n,s,r){if(Fe(n)){var a=!0;$i(t)}else a=!1;if(ns(t,r),t.stateNode===null)xi(e,t),hh(t,n,s),Yo(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,c=t.memoizedProps;o.props=c;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=tt(u):(u=Fe(n)?wn:Te.current,u=os(t,u));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(c!==s||l!==u)&&Nu(t,o,s,u),zt=!1;var p=t.memoizedState;o.state=p,Bi(t,s,o,r),l=t.memoizedState,c!==s||p!==l||ze.current||zt?(typeof h=="function"&&(qo(t,n,h,s),l=t.memoizedState),(c=zt||ku(t,n,c,s,p,l,u))?(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=s,t.memoizedState=l),o.props=s,o.state=l,o.context=u,s=c):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Kf(e,t),c=t.memoizedProps,u=t.type===t.elementType?c:ot(t.type,c),o.props=u,d=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=tt(l):(l=Fe(n)?wn:Te.current,l=os(t,l));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(c!==d||p!==l)&&Nu(t,o,s,l),zt=!1,p=t.memoizedState,o.state=p,Bi(t,s,o,r);var b=t.memoizedState;c!==d||p!==b||ze.current||zt?(typeof x=="function"&&(qo(t,n,x,s),b=t.memoizedState),(u=zt||ku(t,n,u,s,p,b,l)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,b,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,b,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=b),o.props=s,o.state=b,o.context=l,s=u):(typeof o.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return Xo(e,t,n,s,a,r)}function Xo(e,t,n,s,r,a){xh(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&mu(t,n,!1),_t(e,t,a);s=t.stateNode,lg.current=t;var c=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=cs(t,e.child,null,a),t.child=cs(t,null,c,a)):Ae(e,t,c,a),t.memoizedState=s.state,r&&mu(t,n,!0),t.child}function vh(e){var t=e.stateNode;t.pendingContext?pu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pu(e,t.context,!1),Xl(e,t.containerInfo)}function Pu(e,t,n,s,r){return ls(),Kl(r),t.flags|=256,Ae(e,t,n,s),t.child}var Zo={dehydrated:null,treeContext:null,retryLane:0};function el(e){return{baseLanes:e,cachePool:null,transitions:null}}function bh(e,t,n){var s=t.pendingProps,r=re.current,a=!1,o=(t.flags&128)!==0,c;if((c=o)||(c=e!==null&&e.memoizedState===null?!1:(r&2)!==0),c?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Z(re,r&1),e===null)return Ko(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=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ha(o,s,0,null),e=bn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=el(n),t.memoizedState=Zo,e):ac(t,o));if(r=e.memoizedState,r!==null&&(c=r.dehydrated,c!==null))return cg(e,t,o,s,c,r,n);if(a){a=s.fallback,o=t.mode,r=e.child,c=r.sibling;var l={mode:"hidden",children:s.children};return!(o&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=l,t.deletions=null):(s=Zt(r,l),s.subtreeFlags=r.subtreeFlags&14680064),c!==null?a=Zt(c,a):(a=bn(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?el(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Zo,s}return a=e.child,e=a.sibling,s=Zt(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function ac(e,t){return t=ha({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Jr(e,t,n,s){return s!==null&&Kl(s),cs(t,e.child,null,n),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cg(e,t,n,s,r,a,o){if(n)return t.flags&256?(t.flags&=-257,s=eo(Error(P(422))),Jr(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,r=t.mode,s=ha({mode:"visible",children:s.children},r,0,null),a=bn(a,r,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&cs(t,e.child,null,o),t.child.memoizedState=el(o),t.memoizedState=Zo,a);if(!(t.mode&1))return Jr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var c=s.dgst;return s=c,a=Error(P(419)),s=eo(a,s,void 0),Jr(e,t,o,s)}if(c=(o&e.childLanes)!==0,De||c){if(s=be,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==a.retryLane&&(a.retryLane=r,It(e,r),dt(s,e,r,-1))}return fc(),s=eo(Error(P(421))),Jr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=jg.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,We=Yt(r.nextSibling),He=t,se=!0,ct=null,e!==null&&(Ye[Qe++]=Ct,Ye[Qe++]=Et,Ye[Qe++]=jn,Ct=e.id,Et=e.overflow,jn=t),t=ac(t,s.children),t.flags|=4096,t)}function Ou(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Go(e.return,t,n)}function to(e,t,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r)}function wh(e,t,n){var s=t.pendingProps,r=s.revealOrder,a=s.tail;if(Ae(e,t,s.children,n),s=re.current,s&2)s=s&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&&Ou(e,n,t);else if(e.tag===19)Ou(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}s&=1}if(Z(re,s),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Ui(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),to(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Ui(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}to(t,!0,n,null,a);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _t(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=Zt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ug(e,t,n){switch(t.tag){case 3:vh(t),ls();break;case 5:Gf(t);break;case 1:Fe(t.type)&&$i(t);break;case 4:Xl(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;Z(zi,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Z(re,re.current&1),t.flags|=128,null):n&t.child.childLanes?bh(e,t,n):(Z(re,re.current&1),e=_t(e,t,n),e!==null?e.sibling:null);Z(re,re.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return wh(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Z(re,re.current),s)break;return null;case 22:case 23:return t.lanes=0,yh(e,t,n)}return _t(e,t,n)}var jh,tl,kh,Nh;jh=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}};tl=function(){};kh=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,gn(wt.current);var a=null;switch(n){case"input":r=ko(e,r),s=ko(e,s),a=[];break;case"select":r=ae({},r,{value:void 0}),s=ae({},s,{value:void 0}),a=[];break;case"textarea":r=Co(e,r),s=Co(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=_i)}To(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var c=r[u];for(o in c)c.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ir.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var l=s[u];if(c=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u==="style")if(c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(a||(a=[]),a.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ir.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&te("scroll",e),a||c===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Nh=function(e,t,n,s){n!==s&&(t.flags|=4)};function _s(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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function dg(e,t,n){var s=t.pendingProps;switch(Vl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(t),null;case 1:return Fe(t.type)&&Mi(),Ce(t),null;case 3:return s=t.stateNode,us(),ne(ze),ne(Te),ec(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Yr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ct!==null&&(cl(ct),ct=null))),tl(e,t),Ce(t),null;case 5:Zl(t);var r=gn(yr.current);if(n=t.type,e!==null&&t.stateNode!=null)kh(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(P(166));return Ce(t),null}if(e=gn(wt.current),Yr(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[vt]=t,s[mr]=a,e=(t.mode&1)!==0,n){case"dialog":te("cancel",s),te("close",s);break;case"iframe":case"object":case"embed":te("load",s);break;case"video":case"audio":for(r=0;r<Hs.length;r++)te(Hs[r],s);break;case"source":te("error",s);break;case"img":case"image":case"link":te("error",s),te("load",s);break;case"details":te("toggle",s);break;case"input":Bc(s,a),te("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},te("invalid",s);break;case"textarea":Wc(s,a),te("invalid",s)}To(n,a),r=null;for(var o in a)if(a.hasOwnProperty(o)){var c=a[o];o==="children"?typeof c=="string"?s.textContent!==c&&(a.suppressHydrationWarning!==!0&&qr(s.textContent,c,e),r=["children",c]):typeof c=="number"&&s.textContent!==""+c&&(a.suppressHydrationWarning!==!0&&qr(s.textContent,c,e),r=["children",""+c]):ir.hasOwnProperty(o)&&c!=null&&o==="onScroll"&&te("scroll",s)}switch(n){case"input":Fr(s),Uc(s,a,!0);break;case"textarea":Fr(s),Hc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=_i)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[vt]=t,e[mr]=s,jh(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ao(n,s),n){case"dialog":te("cancel",e),te("close",e),r=s;break;case"iframe":case"object":case"embed":te("load",e),r=s;break;case"video":case"audio":for(r=0;r<Hs.length;r++)te(Hs[r],e);r=s;break;case"source":te("error",e),r=s;break;case"img":case"image":case"link":te("error",e),te("load",e),r=s;break;case"details":te("toggle",e),r=s;break;case"input":Bc(e,s),r=ko(e,s),te("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=ae({},s,{value:void 0}),te("invalid",e);break;case"textarea":Wc(e,s),r=Co(e,s),te("invalid",e);break;default:r=s}To(n,r),c=r;for(a in c)if(c.hasOwnProperty(a)){var l=c[a];a==="style"?ef(e,l):a==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Xd(e,l)):a==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ar(e,l):typeof l=="number"&&ar(e,""+l):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ir.hasOwnProperty(a)?l!=null&&a==="onScroll"&&te("scroll",e):l!=null&&Ll(e,a,l,o))}switch(n){case"input":Fr(e),Uc(e,s,!1);break;case"textarea":Fr(e),Hc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+nn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Xn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Xn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=_i)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ce(t),null;case 6:if(e&&t.stateNode!=null)Nh(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(P(166));if(n=gn(yr.current),gn(wt.current),Yr(t)){if(s=t.stateNode,n=t.memoizedProps,s[vt]=t,(a=s.nodeValue!==n)&&(e=He,e!==null))switch(e.tag){case 3:qr(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qr(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[vt]=t,t.stateNode=s}return Ce(t),null;case 13:if(ne(re),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(se&&We!==null&&t.mode&1&&!(t.flags&128))Uf(),ls(),t.flags|=98560,a=!1;else if(a=Yr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(P(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(P(317));a[vt]=t}else ls(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ce(t),a=!1}else ct!==null&&(cl(ct),ct=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||re.current&1?ge===0&&(ge=3):fc())),t.updateQueue!==null&&(t.flags|=4),Ce(t),null);case 4:return us(),tl(e,t),e===null&&hr(t.stateNode.containerInfo),Ce(t),null;case 10:return Yl(t.type._context),Ce(t),null;case 17:return Fe(t.type)&&Mi(),Ce(t),null;case 19:if(ne(re),a=t.memoizedState,a===null)return Ce(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)_s(a,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ui(e),o!==null){for(t.flags|=128,_s(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Z(re,re.current&1|2),t.child}e=e.sibling}a.tail!==null&&ue()>fs&&(t.flags|=128,s=!0,_s(a,!1),t.lanes=4194304)}else{if(!s)if(e=Ui(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),_s(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!se)return Ce(t),null}else 2*ue()-a.renderingStartTime>fs&&n!==1073741824&&(t.flags|=128,s=!0,_s(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ue(),t.sibling=null,n=re.current,Z(re,s?n&1|2:n&1),t):(Ce(t),null);case 22:case 23:return dc(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Ue&1073741824&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function fg(e,t){switch(Vl(t),t.tag){case 1:return Fe(t.type)&&Mi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return us(),ne(ze),ne(Te),ec(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zl(t),null;case 13:if(ne(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(re),null;case 4:return us(),null;case 10:return Yl(t.type._context),null;case 22:case 23:return dc(),null;case 24:return null;default:return null}}var Xr=!1,Ee=!1,hg=typeof WeakSet=="function"?WeakSet:Set,M=null;function Kn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){oe(e,t,s)}else n.current=null}function nl(e,t,n){try{n()}catch(s){oe(e,t,s)}}var Iu=!1;function pg(e,t){if(zo=Pi,e=Af(),Wl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,c=-1,l=-1,u=0,h=0,d=e,p=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(c=o+r),d!==a||s!==0&&d.nodeType!==3||(l=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)p=d,d=x;for(;;){if(d===e)break t;if(p===n&&++u===r&&(c=o),p===a&&++h===s&&(l=o),(x=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=x}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fo={focusedElem:e,selectionRange:n},Pi=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,w=b.memoizedState,m=t.stateNode,y=m.getSnapshotBeforeUpdate(t.elementType===t.type?g:ot(t.type,g),w);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(j){oe(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return b=Iu,Iu=!1,b}function er(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var a=r.destroy;r.destroy=void 0,a!==void 0&&nl(t,n,a)}r=r.next}while(r!==s)}}function da(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 s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function sl(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 Sh(e){var t=e.alternate;t!==null&&(e.alternate=null,Sh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vt],delete t[mr],delete t[Wo],delete t[Q0],delete t[J0])),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 Ch(e){return e.tag===5||e.tag===3||e.tag===4}function _u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ch(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 rl(e,t,n){var s=e.tag;if(s===5||s===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=_i));else if(s!==4&&(e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}var we=null,lt=!1;function Dt(e,t,n){for(n=n.child;n!==null;)Eh(e,t,n),n=n.sibling}function Eh(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(sa,n)}catch{}switch(n.tag){case 5:Ee||Kn(n,t);case 6:var s=we,r=lt;we=null,Dt(e,t,n),we=s,lt=r,we!==null&&(lt?(e=we,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):we.removeChild(n.stateNode));break;case 18:we!==null&&(lt?(e=we,n=n.stateNode,e.nodeType===8?qa(e.parentNode,n):e.nodeType===1&&qa(e,n),ur(e)):qa(we,n.stateNode));break;case 4:s=we,r=lt,we=n.stateNode.containerInfo,lt=!0,Dt(e,t,n),we=s,lt=r;break;case 0:case 11:case 14:case 15:if(!Ee&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var a=r,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&nl(n,t,o),r=r.next}while(r!==s)}Dt(e,t,n);break;case 1:if(!Ee&&(Kn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(c){oe(n,t,c)}Dt(e,t,n);break;case 21:Dt(e,t,n);break;case 22:n.mode&1?(Ee=(s=Ee)||n.memoizedState!==null,Dt(e,t,n),Ee=s):Dt(e,t,n);break;default:Dt(e,t,n)}}function Mu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hg),t.forEach(function(s){var r=kg.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var a=e,o=t,c=o;e:for(;c!==null;){switch(c.tag){case 5:we=c.stateNode,lt=!1;break e;case 3:we=c.stateNode.containerInfo,lt=!0;break e;case 4:we=c.stateNode.containerInfo,lt=!0;break e}c=c.return}if(we===null)throw Error(P(160));Eh(a,o,r),we=null,lt=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){oe(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Th(t,e),t=t.sibling}function Th(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(it(t,e),mt(e),s&4){try{er(3,e,e.return),da(3,e)}catch(g){oe(e,e.return,g)}try{er(5,e,e.return)}catch(g){oe(e,e.return,g)}}break;case 1:it(t,e),mt(e),s&512&&n!==null&&Kn(n,n.return);break;case 5:if(it(t,e),mt(e),s&512&&n!==null&&Kn(n,n.return),e.flags&32){var r=e.stateNode;try{ar(r,"")}catch(g){oe(e,e.return,g)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c==="input"&&a.type==="radio"&&a.name!=null&&Yd(r,a),Ao(c,o);var u=Ao(c,a);for(o=0;o<l.length;o+=2){var h=l[o],d=l[o+1];h==="style"?ef(r,d):h==="dangerouslySetInnerHTML"?Xd(r,d):h==="children"?ar(r,d):Ll(r,h,d,u)}switch(c){case"input":No(r,a);break;case"textarea":Qd(r,a);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var x=a.value;x!=null?Xn(r,!!a.multiple,x,!1):p!==!!a.multiple&&(a.defaultValue!=null?Xn(r,!!a.multiple,a.defaultValue,!0):Xn(r,!!a.multiple,a.multiple?[]:"",!1))}r[mr]=a}catch(g){oe(e,e.return,g)}}break;case 6:if(it(t,e),mt(e),s&4){if(e.stateNode===null)throw Error(P(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(g){oe(e,e.return,g)}}break;case 3:if(it(t,e),mt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ur(t.containerInfo)}catch(g){oe(e,e.return,g)}break;case 4:it(t,e),mt(e);break;case 13:it(t,e),mt(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(cc=ue())),s&4&&Mu(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(u=Ee)||h,it(t,e),Ee=u):it(t,e),mt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(M=e,h=e.child;h!==null;){for(d=M=h;M!==null;){switch(p=M,x=p.child,p.tag){case 0:case 11:case 14:case 15:er(4,p,p.return);break;case 1:Kn(p,p.return);var b=p.stateNode;if(typeof b.componentWillUnmount=="function"){s=p,n=p.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(g){oe(s,n,g)}}break;case 5:Kn(p,p.return);break;case 22:if(p.memoizedState!==null){Du(d);continue}}x!==null?(x.return=p,M=x):Du(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{r=d.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(c=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,c.style.display=Zd("display",o))}catch(g){oe(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){oe(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:it(t,e),mt(e),s&4&&Mu(e);break;case 21:break;default:it(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ch(n)){var s=n;break e}n=n.return}throw Error(P(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(ar(r,""),s.flags&=-33);var a=_u(e);il(e,a,r);break;case 3:case 4:var o=s.stateNode.containerInfo,c=_u(e);rl(e,c,o);break;default:throw Error(P(161))}}catch(l){oe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mg(e,t,n){M=e,Ah(e)}function Ah(e,t,n){for(var s=(e.mode&1)!==0;M!==null;){var r=M,a=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Xr;if(!o){var c=r.alternate,l=c!==null&&c.memoizedState!==null||Ee;c=Xr;var u=Ee;if(Xr=o,(Ee=l)&&!u)for(M=r;M!==null;)o=M,l=o.child,o.tag===22&&o.memoizedState!==null?Ru(r):l!==null?(l.return=o,M=l):Ru(r);for(;a!==null;)M=a,Ah(a),a=a.sibling;M=r,Xr=c,Ee=u}$u(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,M=a):$u(e)}}function $u(e){for(;M!==null;){var t=M;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||da(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ee)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:ot(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&bu(t,a,s);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}bu(t,o,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&ur(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}Ee||t.flags&512&&sl(t)}catch(p){oe(t,t.return,p)}}if(t===e){M=null;break}if(n=t.sibling,n!==null){n.return=t.return,M=n;break}M=t.return}}function Du(e){for(;M!==null;){var t=M;if(t===e){M=null;break}var n=t.sibling;if(n!==null){n.return=t.return,M=n;break}M=t.return}}function Ru(e){for(;M!==null;){var t=M;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{da(4,t)}catch(l){oe(t,n,l)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(l){oe(t,r,l)}}var a=t.return;try{sl(t)}catch(l){oe(t,a,l)}break;case 5:var o=t.return;try{sl(t)}catch(l){oe(t,o,l)}}}catch(l){oe(t,t.return,l)}if(t===e){M=null;break}var c=t.sibling;if(c!==null){c.return=t.return,M=c;break}M=t.return}}var gg=Math.ceil,Vi=Mt.ReactCurrentDispatcher,oc=Mt.ReactCurrentOwner,Ze=Mt.ReactCurrentBatchConfig,Y=0,be=null,pe=null,ke=0,Ue=0,Gn=an(0),ge=0,wr=null,Nn=0,fa=0,lc=0,tr=null,$e=null,cc=0,fs=1/0,Nt=null,Ki=!1,al=null,Jt=null,Zr=!1,Ht=null,Gi=0,nr=0,ol=null,vi=-1,bi=0;function Pe(){return Y&6?ue():vi!==-1?vi:vi=ue()}function Xt(e){return e.mode&1?Y&2&&ke!==0?ke&-ke:Z0.transition!==null?(bi===0&&(bi=hf()),bi):(e=J,e!==0||(e=window.event,e=e===void 0?16:bf(e.type)),e):1}function dt(e,t,n,s){if(50<nr)throw nr=0,ol=null,Error(P(185));Er(e,n,s),(!(Y&2)||e!==be)&&(e===be&&(!(Y&2)&&(fa|=n),ge===4&&Ut(e,ke)),Be(e,s),n===1&&Y===0&&!(t.mode&1)&&(fs=ue()+500,la&&on()))}function Be(e,t){var n=e.callbackNode;Zm(e,t);var s=Li(e,e===be?ke:0);if(s===0)n!==null&&Gc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Gc(n),t===1)e.tag===0?X0(zu.bind(null,e)):zf(zu.bind(null,e)),q0(function(){!(Y&6)&&on()}),n=null;else{switch(pf(s)){case 1:n=Ml;break;case 4:n=df;break;case 16:n=Ai;break;case 536870912:n=ff;break;default:n=Ai}n=Dh(n,Lh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Lh(e,t){if(vi=-1,bi=0,Y&6)throw Error(P(327));var n=e.callbackNode;if(ss()&&e.callbackNode!==n)return null;var s=Li(e,e===be?ke:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=qi(e,s);else{t=s;var r=Y;Y|=2;var a=Oh();(be!==e||ke!==t)&&(Nt=null,fs=ue()+500,vn(e,t));do try{vg();break}catch(c){Ph(e,c)}while(!0);ql(),Vi.current=a,Y=r,pe!==null?t=0:(be=null,ke=0,t=ge)}if(t!==0){if(t===2&&(r=_o(e),r!==0&&(s=r,t=ll(e,r))),t===1)throw n=wr,vn(e,0),Ut(e,s),Be(e,ue()),n;if(t===6)Ut(e,s);else{if(r=e.current.alternate,!(s&30)&&!yg(r)&&(t=qi(e,s),t===2&&(a=_o(e),a!==0&&(s=a,t=ll(e,a))),t===1))throw n=wr,vn(e,0),Ut(e,s),Be(e,ue()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(P(345));case 2:fn(e,$e,Nt);break;case 3:if(Ut(e,s),(s&130023424)===s&&(t=cc+500-ue(),10<t)){if(Li(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Pe(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Uo(fn.bind(null,e,$e,Nt),t);break}fn(e,$e,Nt);break;case 4:if(Ut(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-ut(s);a=1<<o,o=t[o],o>r&&(r=o),s&=~a}if(s=r,s=ue()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*gg(s/1960))-s,10<s){e.timeoutHandle=Uo(fn.bind(null,e,$e,Nt),s);break}fn(e,$e,Nt);break;case 5:fn(e,$e,Nt);break;default:throw Error(P(329))}}}return Be(e,ue()),e.callbackNode===n?Lh.bind(null,e):null}function ll(e,t){var n=tr;return e.current.memoizedState.isDehydrated&&(vn(e,t).flags|=256),e=qi(e,t),e!==2&&(t=$e,$e=n,t!==null&&cl(t)),e}function cl(e){$e===null?$e=e:$e.push.apply($e,e)}function yg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],a=r.getSnapshot;r=r.value;try{if(!ft(a(),r))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 Ut(e,t){for(t&=~lc,t&=~fa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ut(t),s=1<<n;e[n]=-1,t&=~s}}function zu(e){if(Y&6)throw Error(P(327));ss();var t=Li(e,0);if(!(t&1))return Be(e,ue()),null;var n=qi(e,t);if(e.tag!==0&&n===2){var s=_o(e);s!==0&&(t=s,n=ll(e,s))}if(n===1)throw n=wr,vn(e,0),Ut(e,t),Be(e,ue()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fn(e,$e,Nt),Be(e,ue()),null}function uc(e,t){var n=Y;Y|=1;try{return e(t)}finally{Y=n,Y===0&&(fs=ue()+500,la&&on())}}function Sn(e){Ht!==null&&Ht.tag===0&&!(Y&6)&&ss();var t=Y;Y|=1;var n=Ze.transition,s=J;try{if(Ze.transition=null,J=1,e)return e()}finally{J=s,Ze.transition=n,Y=t,!(Y&6)&&on()}}function dc(){Ue=Gn.current,ne(Gn)}function vn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,G0(n)),pe!==null)for(n=pe.return;n!==null;){var s=n;switch(Vl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Mi();break;case 3:us(),ne(ze),ne(Te),ec();break;case 5:Zl(s);break;case 4:us();break;case 13:ne(re);break;case 19:ne(re);break;case 10:Yl(s.type._context);break;case 22:case 23:dc()}n=n.return}if(be=e,pe=e=Zt(e.current,null),ke=Ue=t,ge=0,wr=null,lc=fa=Nn=0,$e=tr=null,mn!==null){for(t=0;t<mn.length;t++)if(n=mn[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=r,s.next=o}n.pending=s}mn=null}return e}function Ph(e,t){do{var n=pe;try{if(ql(),gi.current=Hi,Wi){for(var s=ie.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Wi=!1}if(kn=0,ve=me=ie=null,Zs=!1,xr=0,oc.current=null,n===null||n.return===null){ge=1,wr=t,pe=null;break}e:{var a=e,o=n.return,c=n,l=t;if(t=ke,c.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,h=c,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var p=h.alternate;p?(h.updateQueue=p.updateQueue,h.memoizedState=p.memoizedState,h.lanes=p.lanes):(h.updateQueue=null,h.memoizedState=null)}var x=Cu(o);if(x!==null){x.flags&=-257,Eu(x,o,c,a,t),x.mode&1&&Su(a,u,t),t=x,l=u;var b=t.updateQueue;if(b===null){var g=new Set;g.add(l),t.updateQueue=g}else b.add(l);break e}else{if(!(t&1)){Su(a,u,t),fc();break e}l=Error(P(426))}}else if(se&&c.mode&1){var w=Cu(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Eu(w,o,c,a,t),Kl(ds(l,c));break e}}a=l=ds(l,c),ge!==4&&(ge=2),tr===null?tr=[a]:tr.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=ph(a,l,t);vu(a,m);break e;case 1:c=l;var y=a.type,f=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Jt===null||!Jt.has(f)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=mh(a,c,t);vu(a,j);break e}}a=a.return}while(a!==null)}_h(n)}catch(k){t=k,pe===n&&n!==null&&(pe=n=n.return);continue}break}while(!0)}function Oh(){var e=Vi.current;return Vi.current=Hi,e===null?Hi:e}function fc(){(ge===0||ge===3||ge===2)&&(ge=4),be===null||!(Nn&268435455)&&!(fa&268435455)||Ut(be,ke)}function qi(e,t){var n=Y;Y|=2;var s=Oh();(be!==e||ke!==t)&&(Nt=null,vn(e,t));do try{xg();break}catch(r){Ph(e,r)}while(!0);if(ql(),Y=n,Vi.current=s,pe!==null)throw Error(P(261));return be=null,ke=0,ge}function xg(){for(;pe!==null;)Ih(pe)}function vg(){for(;pe!==null&&!Hm();)Ih(pe)}function Ih(e){var t=$h(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?_h(e):pe=t,oc.current=null}function _h(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fg(n,t),n!==null){n.flags&=32767,pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,pe=null;return}}else if(n=dg(n,t,Ue),n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ge===0&&(ge=5)}function fn(e,t,n){var s=J,r=Ze.transition;try{Ze.transition=null,J=1,bg(e,t,n,s)}finally{Ze.transition=r,J=s}return null}function bg(e,t,n,s){do ss();while(Ht!==null);if(Y&6)throw Error(P(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(e0(e,a),e===be&&(pe=be=null,ke=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zr||(Zr=!0,Dh(Ai,function(){return ss(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ze.transition,Ze.transition=null;var o=J;J=1;var c=Y;Y|=4,oc.current=null,pg(e,n),Th(n,e),F0(Fo),Pi=!!zo,Fo=zo=null,e.current=n,mg(n),Vm(),Y=c,J=o,Ze.transition=a}else e.current=n;if(Zr&&(Zr=!1,Ht=e,Gi=r),a=e.pendingLanes,a===0&&(Jt=null),qm(n.stateNode),Be(e,ue()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(Ki)throw Ki=!1,e=al,al=null,e;return Gi&1&&e.tag!==0&&ss(),a=e.pendingLanes,a&1?e===ol?nr++:(nr=0,ol=e):nr=0,on(),null}function ss(){if(Ht!==null){var e=pf(Gi),t=Ze.transition,n=J;try{if(Ze.transition=null,J=16>e?16:e,Ht===null)var s=!1;else{if(e=Ht,Ht=null,Gi=0,Y&6)throw Error(P(331));var r=Y;for(Y|=4,M=e.current;M!==null;){var a=M,o=a.child;if(M.flags&16){var c=a.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(M=u;M!==null;){var h=M;switch(h.tag){case 0:case 11:case 15:er(8,h,a)}var d=h.child;if(d!==null)d.return=h,M=d;else for(;M!==null;){h=M;var p=h.sibling,x=h.return;if(Sh(h),h===u){M=null;break}if(p!==null){p.return=x,M=p;break}M=x}}}var b=a.alternate;if(b!==null){var g=b.child;if(g!==null){b.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}M=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,M=o;else e:for(;M!==null;){if(a=M,a.flags&2048)switch(a.tag){case 0:case 11:case 15:er(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,M=m;break e}M=a.return}}var y=e.current;for(M=y;M!==null;){o=M;var f=o.child;if(o.subtreeFlags&2064&&f!==null)f.return=o,M=f;else e:for(o=y;M!==null;){if(c=M,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:da(9,c)}}catch(k){oe(c,c.return,k)}if(c===o){M=null;break e}var j=c.sibling;if(j!==null){j.return=c.return,M=j;break e}M=c.return}}if(Y=r,on(),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(sa,e)}catch{}s=!0}return s}finally{J=n,Ze.transition=t}}return!1}function Fu(e,t,n){t=ds(n,t),t=ph(e,t,1),e=Qt(e,t,1),t=Pe(),e!==null&&(Er(e,1,t),Be(e,t))}function oe(e,t,n){if(e.tag===3)Fu(e,e,n);else for(;t!==null;){if(t.tag===3){Fu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Jt===null||!Jt.has(s))){e=ds(n,e),e=mh(t,e,1),t=Qt(t,e,1),e=Pe(),t!==null&&(Er(t,1,e),Be(t,e));break}}t=t.return}}function wg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Pe(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(ke&n)===n&&(ge===4||ge===3&&(ke&130023424)===ke&&500>ue()-cc?vn(e,0):lc|=n),Be(e,t)}function Mh(e,t){t===0&&(e.mode&1?(t=Wr,Wr<<=1,!(Wr&130023424)&&(Wr=4194304)):t=1);var n=Pe();e=It(e,t),e!==null&&(Er(e,t,n),Be(e,n))}function jg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mh(e,n)}function kg(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(P(314))}s!==null&&s.delete(t),Mh(e,n)}var $h;$h=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ze.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,ug(e,t,n);De=!!(e.flags&131072)}else De=!1,se&&t.flags&1048576&&Ff(t,Ri,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;xi(e,t),e=t.pendingProps;var r=os(t,Te.current);ns(t,n),r=nc(null,t,s,e,r,n);var a=sc();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Fe(s)?(a=!0,$i(t)):a=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Jl(t),r.updater=ua,t.stateNode=r,r._reactInternals=t,Yo(t,s,e,n),t=Xo(null,t,s,!0,a,n)):(t.tag=0,se&&a&&Hl(t),Ae(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(xi(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=Sg(s),e=ot(s,e),r){case 0:t=Jo(null,t,s,e,n);break e;case 1:t=Lu(null,t,s,e,n);break e;case 11:t=Tu(null,t,s,e,n);break e;case 14:t=Au(null,t,s,ot(s.type,e),n);break e}throw Error(P(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Jo(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Lu(e,t,s,r,n);case 3:e:{if(vh(t),e===null)throw Error(P(387));s=t.pendingProps,a=t.memoizedState,r=a.element,Kf(e,t),Bi(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){r=ds(Error(P(423)),t),t=Pu(e,t,s,n,r);break e}else if(s!==r){r=ds(Error(P(424)),t),t=Pu(e,t,s,n,r);break e}else for(We=Yt(t.stateNode.containerInfo.firstChild),He=t,se=!0,ct=null,n=Hf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ls(),s===r){t=_t(e,t,n);break e}Ae(e,t,s,n)}t=t.child}return t;case 5:return Gf(t),e===null&&Ko(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,Bo(s,r)?o=null:a!==null&&Bo(s,a)&&(t.flags|=32),xh(e,t),Ae(e,t,o,n),t.child;case 6:return e===null&&Ko(t),null;case 13:return bh(e,t,n);case 4:return Xl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=cs(t,null,s,n):Ae(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Tu(e,t,s,r,n);case 7:return Ae(e,t,t.pendingProps,n),t.child;case 8:return Ae(e,t,t.pendingProps.children,n),t.child;case 12:return Ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,a=t.memoizedProps,o=r.value,Z(zi,s._currentValue),s._currentValue=o,a!==null)if(ft(a.value,o)){if(a.children===r.children&&!ze.current){t=_t(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){o=a.child;for(var l=c.firstContext;l!==null;){if(l.context===s){if(a.tag===1){l=At(-1,n&-n),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Go(a.return,n,t),c.lanes|=n;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(P(341));o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Go(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ae(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,ns(t,n),r=tt(r),s=s(r),t.flags|=1,Ae(e,t,s,n),t.child;case 14:return s=t.type,r=ot(s,t.pendingProps),r=ot(s.type,r),Au(e,t,s,r,n);case 15:return gh(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),xi(e,t),t.tag=1,Fe(s)?(e=!0,$i(t)):e=!1,ns(t,n),hh(t,s,r),Yo(t,s,r,n),Xo(null,t,s,!0,e,n);case 19:return wh(e,t,n);case 22:return yh(e,t,n)}throw Error(P(156,t.tag))};function Dh(e,t){return uf(e,t)}function Ng(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xe(e,t,n,s){return new Ng(e,t,n,s)}function hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sg(e){if(typeof e=="function")return hc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ol)return 11;if(e===Il)return 14}return 2}function Zt(e,t){var n=e.alternate;return n===null?(n=Xe(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 wi(e,t,n,s,r,a){var o=2;if(s=e,typeof e=="function")hc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Dn:return bn(n.children,r,a,t);case Pl:o=8,r|=8;break;case vo:return e=Xe(12,n,t,r|2),e.elementType=vo,e.lanes=a,e;case bo:return e=Xe(13,n,t,r),e.elementType=bo,e.lanes=a,e;case wo:return e=Xe(19,n,t,r),e.elementType=wo,e.lanes=a,e;case Kd:return ha(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Hd:o=10;break e;case Vd:o=9;break e;case Ol:o=11;break e;case Il:o=14;break e;case Rt:o=16,s=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=Xe(o,n,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function bn(e,t,n,s){return e=Xe(7,e,s,t),e.lanes=n,e}function ha(e,t,n,s){return e=Xe(22,e,s,t),e.elementType=Kd,e.lanes=n,e.stateNode={isHidden:!1},e}function no(e,t,n){return e=Xe(6,e,null,t),e.lanes=n,e}function so(e,t,n){return t=Xe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cg(e,t,n,s,r){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=Da(0),this.expirationTimes=Da(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Da(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function pc(e,t,n,s,r,a,o,c,l){return e=new Cg(e,t,n,c,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Xe(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jl(a),e}function Eg(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$n,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Rh(e){if(!e)return sn;e=e._reactInternals;e:{if(Tn(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Fe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(Fe(n))return Rf(e,n,t)}return t}function zh(e,t,n,s,r,a,o,c,l){return e=pc(n,s,!0,e,r,a,o,c,l),e.context=Rh(null),n=e.current,s=Pe(),r=Xt(n),a=At(s,r),a.callback=t??null,Qt(n,a,r),e.current.lanes=r,Er(e,r,s),Be(e,s),e}function pa(e,t,n,s){var r=t.current,a=Pe(),o=Xt(r);return n=Rh(n),t.context===null?t.context=n:t.pendingContext=n,t=At(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Qt(r,t,o),e!==null&&(dt(e,r,o,a),mi(e,r,o)),o}function Yi(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 Bu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mc(e,t){Bu(e,t),(e=e.alternate)&&Bu(e,t)}function Tg(){return null}var Fh=typeof reportError=="function"?reportError:function(e){console.error(e)};function gc(e){this._internalRoot=e}ma.prototype.render=gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));pa(e,t,null,null)};ma.prototype.unmount=gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sn(function(){pa(null,e,null,null)}),t[Ot]=null}};function ma(e){this._internalRoot=e}ma.prototype.unstable_scheduleHydration=function(e){if(e){var t=yf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bt.length&&t!==0&&t<Bt[n].priority;n++);Bt.splice(n,0,e),n===0&&vf(e)}};function yc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ga(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uu(){}function Ag(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=Yi(o);a.call(u)}}var o=zh(t,s,e,0,null,!1,!1,"",Uu);return e._reactRootContainer=o,e[Ot]=o.current,hr(e.nodeType===8?e.parentNode:e),Sn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var c=s;s=function(){var u=Yi(l);c.call(u)}}var l=pc(e,0,!1,null,null,!1,!1,"",Uu);return e._reactRootContainer=l,e[Ot]=l.current,hr(e.nodeType===8?e.parentNode:e),Sn(function(){pa(t,l,n,s)}),l}function ya(e,t,n,s,r){var a=n._reactRootContainer;if(a){var o=a;if(typeof r=="function"){var c=r;r=function(){var l=Yi(o);c.call(l)}}pa(t,o,e,r)}else o=Ag(n,t,e,r,s);return Yi(o)}mf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ws(t.pendingLanes);n!==0&&($l(t,n|1),Be(t,ue()),!(Y&6)&&(fs=ue()+500,on()))}break;case 13:Sn(function(){var s=It(e,1);if(s!==null){var r=Pe();dt(s,e,1,r)}}),mc(e,1)}};Dl=function(e){if(e.tag===13){var t=It(e,134217728);if(t!==null){var n=Pe();dt(t,e,134217728,n)}mc(e,134217728)}};gf=function(e){if(e.tag===13){var t=Xt(e),n=It(e,t);if(n!==null){var s=Pe();dt(n,e,t,s)}mc(e,t)}};yf=function(){return J};xf=function(e,t){var n=J;try{return J=e,t()}finally{J=n}};Po=function(e,t,n){switch(t){case"input":if(No(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 s=n[t];if(s!==e&&s.form===e.form){var r=oa(s);if(!r)throw Error(P(90));qd(s),No(s,r)}}}break;case"textarea":Qd(e,n);break;case"select":t=n.value,t!=null&&Xn(e,!!n.multiple,t,!1)}};sf=uc;rf=Sn;var Lg={usingClientEntryPoint:!1,Events:[Ar,Bn,oa,tf,nf,uc]},Ms={findFiberByHostInstance:pn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Pg={bundleType:Ms.bundleType,version:Ms.version,rendererPackageName:Ms.rendererPackageName,rendererConfig:Ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=lf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ms.findFiberByHostInstance||Tg,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 ei=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ei.isDisabled&&ei.supportsFiber)try{sa=ei.inject(Pg),bt=ei}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lg;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yc(t))throw Error(P(200));return Eg(e,t,null,n)};Ke.createRoot=function(e,t){if(!yc(e))throw Error(P(299));var n=!1,s="",r=Fh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=pc(e,1,!1,null,null,n,!1,s,r),e[Ot]=t.current,hr(e.nodeType===8?e.parentNode:e),new gc(t)};Ke.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(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=lf(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return Sn(e)};Ke.hydrate=function(e,t,n){if(!ga(t))throw Error(P(200));return ya(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!yc(e))throw Error(P(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",o=Fh;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=zh(t,null,e,1,n??null,r,!1,a,o),e[Ot]=t.current,hr(e),s)for(e=0;e<s.length;e++)n=s[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new ma(t)};Ke.render=function(e,t,n){if(!ga(t))throw Error(P(200));return ya(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!ga(e))throw Error(P(40));return e._reactRootContainer?(Sn(function(){ya(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};Ke.unstable_batchedUpdates=uc;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ga(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return ya(e,t,n,!1,s)};Ke.version="18.3.1-next-f1338f8080-20240426";function Bh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bh)}catch(e){console.error(e)}}Bh(),Fd.exports=Ke;var Og=Fd.exports,Uh,Wu=Og;Uh=Wu.createRoot,Wu.hydrateRoot;const Ig="modulepreload",_g=function(e){return"/"+e},Hu={},Mg=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(l=>{if(l=_g(l),l in Hu)return;Hu[l]=!0;const u=l.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Ig,u||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),u)return new Promise((p,x)=>{d.addEventListener("load",p),d.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return r.then(o=>{for(const c of o||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};/**
41
+ * @remix-run/router v1.23.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},jr.apply(null,arguments)}var Vt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vt||(Vt={}));const Vu="popstate";function $g(e){e===void 0&&(e={});function t(s,r){let{pathname:a,search:o,hash:c}=s.location;return ul("",{pathname:a,search:o,hash:c},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Qi(r)}return Rg(t,n,null,e)}function le(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Dg(){return Math.random().toString(36).substr(2,8)}function Ku(e,t){return{usr:e.state,key:e.key,idx:t}}function ul(e,t,n,s){return n===void 0&&(n=null),jr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:n,key:t&&t.key||s||Dg()})}function Qi(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function bs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Rg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,o=r.history,c=Vt.Pop,l=null,u=h();u==null&&(u=0,o.replaceState(jr({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){c=Vt.Pop;let w=h(),m=w==null?null:w-u;u=w,l&&l({action:c,location:g.location,delta:m})}function p(w,m){c=Vt.Push;let y=ul(g.location,w,m);u=h()+1;let f=Ku(y,u),j=g.createHref(y);try{o.pushState(f,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(j)}a&&l&&l({action:c,location:g.location,delta:1})}function x(w,m){c=Vt.Replace;let y=ul(g.location,w,m);u=h();let f=Ku(y,u),j=g.createHref(y);o.replaceState(f,"",j),a&&l&&l({action:c,location:g.location,delta:0})}function b(w){let m=r.location.origin!=="null"?r.location.origin:r.location.href,y=typeof w=="string"?w:Qi(w);return y=y.replace(/ $/,"%20"),le(m,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,m)}let g={get action(){return c},get location(){return e(r,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Vu,d),l=w,()=>{r.removeEventListener(Vu,d),l=null}},createHref(w){return t(r,w)},createURL:b,encodeLocation(w){let m=b(w);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:x,go(w){return o.go(w)}};return g}var Gu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gu||(Gu={}));function zg(e,t,n){return n===void 0&&(n="/"),Fg(e,t,n)}function Fg(e,t,n,s){let r=typeof t=="string"?bs(t):t,a=hs(r.pathname||"/",n);if(a==null)return null;let o=Wh(e);Bg(o);let c=null,l=Xg(a);for(let u=0;c==null&&u<o.length;++u)c=Qg(o[u],l);return c}function Wh(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(a,o,c)=>{let l={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(le(l.relativePath.startsWith(s),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(s.length));let u=en([s,l.relativePath]),h=n.concat(l);a.children&&a.children.length>0&&(le(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Wh(a.children,t,h,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:qg(u,a.index),routesMeta:h})};return e.forEach((a,o)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))r(a,o);else for(let l of Hh(a.path))r(a,o,l)}),t}function Hh(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let o=Hh(s.join("/")),c=[];return c.push(...o.map(l=>l===""?a:[a,l].join("/"))),r&&c.push(...o),c.map(l=>e.startsWith("/")&&l===""?"/":l)}function Bg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Yg(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Ug=/^:[\w-]+$/,Wg=3,Hg=2,Vg=1,Kg=10,Gg=-2,qu=e=>e==="*";function qg(e,t){let n=e.split("/"),s=n.length;return n.some(qu)&&(s+=Gg),t&&(s+=Hg),n.filter(r=>!qu(r)).reduce((r,a)=>r+(Ug.test(a)?Wg:a===""?Vg:Kg),s)}function Yg(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Qg(e,t,n){let{routesMeta:s}=e,r={},a="/",o=[];for(let c=0;c<s.length;++c){let l=s[c],u=c===s.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=dl({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},h),p=l.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:en([a,d.pathname]),pathnameBase:sy(en([a,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(a=en([a,d.pathnameBase]))}return o}function dl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Jg(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:s.reduce((u,h,d)=>{let{paramName:p,isOptional:x}=h;if(p==="*"){let g=c[d]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const b=c[d];return x&&!b?u[p]=void 0:u[p]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Jg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),xc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,l)=>(s.push({paramName:c,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Xg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function hs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const Zg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ey=e=>Zg.test(e);function ty(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?bs(e):e,a;if(n)if(ey(n))a=n;else{if(n.includes("//")){let o=n;n=Gh(n),xc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Yu(n.substring(1),"/"):a=Yu(n,t)}else a=t;return{pathname:a,search:ry(s),hash:iy(r)}}function Yu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ro(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ny(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Vh(e,t){let n=ny(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Kh(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=bs(e):(r=jr({},e),le(!r.pathname||!r.pathname.includes("?"),ro("?","pathname","search",r)),le(!r.pathname||!r.pathname.includes("#"),ro("#","pathname","hash",r)),le(!r.search||!r.search.includes("#"),ro("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,c;if(o==null)c=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}c=d>=0?t[d]:"/"}let l=ty(r,c),u=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||h)&&(l.pathname+="/"),l}const Gh=e=>e.replace(/\/\/+/g,"/"),en=e=>Gh(e.join("/")),sy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ry=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ay(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qh=["post","put","patch","delete"];new Set(qh);const oy=["get",...qh];new Set(oy);/**
50
+ * React Router v6.30.4
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},kr.apply(null,arguments)}const xa=v.createContext(null),Yh=v.createContext(null),ln=v.createContext(null),va=v.createContext(null),$t=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Qh=v.createContext(null);function ly(e,t){let{relative:n}=t===void 0?{}:t;Pr()||le(!1);let{basename:s,navigator:r}=v.useContext(ln),{hash:a,pathname:o,search:c}=ba(e,{relative:n}),l=o;return s!=="/"&&(l=o==="/"?s:en([s,o])),r.createHref({pathname:l,search:c,hash:a})}function Pr(){return v.useContext(va)!=null}function An(){return Pr()||le(!1),v.useContext(va).location}function Jh(e){v.useContext(ln).static||v.useLayoutEffect(e)}function cy(){let{isDataRoute:e}=v.useContext($t);return e?Sy():uy()}function uy(){Pr()||le(!1);let e=v.useContext(xa),{basename:t,future:n,navigator:s}=v.useContext(ln),{matches:r}=v.useContext($t),{pathname:a}=An(),o=JSON.stringify(Vh(r,n.v7_relativeSplatPath)),c=v.useRef(!1);return Jh(()=>{c.current=!0}),v.useCallback(function(u,h){if(h===void 0&&(h={}),!c.current)return;if(typeof u=="number"){s.go(u);return}let d=Kh(u,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:en([t,d.pathname])),(h.replace?s.replace:s.push)(d,h.state,h)},[t,s,o,a,e])}const dy=v.createContext(null);function fy(e){let t=v.useContext($t).outlet;return t&&v.createElement(dy.Provider,{value:e},t)}function hy(){let{matches:e}=v.useContext($t),t=e[e.length-1];return t?t.params:{}}function ba(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=v.useContext(ln),{matches:r}=v.useContext($t),{pathname:a}=An(),o=JSON.stringify(Vh(r,s.v7_relativeSplatPath));return v.useMemo(()=>Kh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function py(e,t){return my(e,t)}function my(e,t,n,s){Pr()||le(!1);let{navigator:r}=v.useContext(ln),{matches:a}=v.useContext($t),o=a[a.length-1],c=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=An(),h;if(t){var d;let w=typeof t=="string"?bs(t):t;l==="/"||(d=w.pathname)!=null&&d.startsWith(l)||le(!1),h=w}else h=u;let p=h.pathname||"/",x=p;if(l!=="/"){let w=l.replace(/^\//,"").split("/");x="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let b=zg(e,{pathname:x}),g=by(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:en([l,r.encodeLocation?r.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:en([l,r.encodeLocation?r.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),a,n,s);return t&&g?v.createElement(va.Provider,{value:{location:kr({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Vt.Pop}},g):g}function gy(){let e=Ny(),t=ay(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:r},n):null,null)}const yy=v.createElement(gy,null);class xy extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement($t.Provider,{value:this.props.routeContext},v.createElement(Qh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vy(e){let{routeContext:t,match:n,children:s}=e,r=v.useContext(xa);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement($t.Provider,{value:t},s)}function by(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(r=n)==null?void 0:r.errors;if(c!=null){let h=o.findIndex(d=>d.route.id&&(c==null?void 0:c[d.route.id])!==void 0);h>=0||le(!1),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:p,errors:x}=n,b=d.route.loader&&p[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||b){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,p)=>{let x,b=!1,g=null,w=null;n&&(x=c&&d.route.id?c[d.route.id]:void 0,g=d.route.errorElement||yy,l&&(u<0&&p===0?(Cy("route-fallback"),b=!0,w=null):u===p&&(b=!0,w=d.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,p+1)),y=()=>{let f;return x?f=g:b?f=w:d.route.Component?f=v.createElement(d.route.Component,null):d.route.element?f=d.route.element:f=h,v.createElement(vy,{match:d,routeContext:{outlet:h,matches:m,isDataRoute:n!=null},children:f})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?v.createElement(xy,{location:n.location,revalidation:n.revalidation,component:g,error:x,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):y()},null)}var Xh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Xh||{}),Zh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Zh||{});function wy(e){let t=v.useContext(xa);return t||le(!1),t}function jy(e){let t=v.useContext(Yh);return t||le(!1),t}function ky(e){let t=v.useContext($t);return t||le(!1),t}function ep(e){let t=ky(),n=t.matches[t.matches.length-1];return n.route.id||le(!1),n.route.id}function Ny(){var e;let t=v.useContext(Qh),n=jy(),s=ep();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Sy(){let{router:e}=wy(Xh.UseNavigateStable),t=ep(Zh.UseNavigateStable),n=v.useRef(!1);return Jh(()=>{n.current=!0}),v.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,kr({fromRouteId:t},a)))},[e,t])}const Qu={};function Cy(e,t,n){Qu[e]||(Qu[e]=!0)}function Ey(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ty(e){return fy(e.context)}function xe(e){le(!1)}function Ay(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Vt.Pop,navigator:a,static:o=!1,future:c}=e;Pr()&&le(!1);let l=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:a,static:o,future:kr({v7_relativeSplatPath:!1},c)}),[l,c,a,o]);typeof s=="string"&&(s=bs(s));let{pathname:h="/",search:d="",hash:p="",state:x=null,key:b="default"}=s,g=v.useMemo(()=>{let w=hs(h,l);return w==null?null:{location:{pathname:w,search:d,hash:p,state:x,key:b},navigationType:r}},[l,h,d,p,x,b,r]);return g==null?null:v.createElement(ln.Provider,{value:u},v.createElement(va.Provider,{children:n,value:g}))}function Ly(e){let{children:t,location:n}=e;return py(fl(t),n)}new Promise(()=>{});function fl(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(s,r)=>{if(!v.isValidElement(s))return;let a=[...t,r];if(s.type===v.Fragment){n.push.apply(n,fl(s.props.children,a));return}s.type!==xe&&le(!1),!s.props.index||!s.props.children||le(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=fl(s.props.children,a)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.4
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ji.apply(null,arguments)}function tp(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function Py(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Oy(e,t){return e.button===0&&(!t||t==="_self")&&!Py(e)}const Iy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_y=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],My="6";try{window.__reactRouterVersion=My}catch{}const $y=v.createContext({isTransitioning:!1}),Dy="startTransition",Ju=wm[Dy];function Ry(e){let{basename:t,children:n,future:s,window:r}=e,a=v.useRef();a.current==null&&(a.current=$g({window:r,v5Compat:!0}));let o=a.current,[c,l]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},h=v.useCallback(d=>{u&&Ju?Ju(()=>l(d)):l(d)},[l,u]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>Ey(s),[s]),v.createElement(Ay,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:s})}const zy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Fy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,je=v.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:a,replace:o,state:c,target:l,to:u,preventScrollReset:h,viewTransition:d}=t,p=tp(t,Iy),{basename:x}=v.useContext(ln),b,g=!1;if(typeof u=="string"&&Fy.test(u)&&(b=u,zy))try{let f=new URL(window.location.href),j=u.startsWith("//")?new URL(f.protocol+u):new URL(u),k=hs(j.pathname,x);j.origin===f.origin&&k!=null?u=k+j.search+j.hash:g=!0}catch{}let w=ly(u,{relative:r}),m=Uy(u,{replace:o,state:c,target:l,preventScrollReset:h,relative:r,viewTransition:d});function y(f){s&&s(f),f.defaultPrevented||m(f)}return v.createElement("a",Ji({},p,{href:b||w,onClick:g||a?s:y,ref:n,target:l}))}),gt=v.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:a="",end:o=!1,style:c,to:l,viewTransition:u,children:h}=t,d=tp(t,_y),p=ba(l,{relative:d.relative}),x=An(),b=v.useContext(Yh),{navigator:g,basename:w}=v.useContext(ln),m=b!=null&&Wy(p)&&u===!0,y=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,f=x.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(f=f.toLowerCase(),j=j?j.toLowerCase():null,y=y.toLowerCase()),j&&w&&(j=hs(j,w)||j);const k=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let C=f===y||!o&&f.startsWith(y)&&f.charAt(k)==="/",N=j!=null&&(j===y||!o&&j.startsWith(y)&&j.charAt(y.length)==="/"),S={isActive:C,isPending:N,isTransitioning:m},E=C?s:void 0,A;typeof a=="function"?A=a(S):A=[a,C?"active":null,N?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let F=typeof c=="function"?c(S):c;return v.createElement(je,Ji({},d,{"aria-current":E,className:A,ref:n,style:F,to:l,viewTransition:u}),typeof h=="function"?h(S):h)});var hl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hl||(hl={}));var Xu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xu||(Xu={}));function By(e){let t=v.useContext(xa);return t||le(!1),t}function Uy(e,t){let{target:n,replace:s,state:r,preventScrollReset:a,relative:o,viewTransition:c}=t===void 0?{}:t,l=cy(),u=An(),h=ba(e,{relative:o});return v.useCallback(d=>{if(Oy(d,n)){d.preventDefault();let p=s!==void 0?s:Qi(u)===Qi(h);l(e,{replace:p,state:r,preventScrollReset:a,relative:o,viewTransition:c})}},[u,l,h,s,r,n,e,a,o,c])}function Wy(e,t){t===void 0&&(t={});let n=v.useContext($y);n==null&&le(!1);let{basename:s}=By(hl.useViewTransitionState),r=ba(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=hs(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=hs(n.nextLocation.pathname,s)||n.nextLocation.pathname;return dl(r.pathname,o)!=null||dl(r.pathname,a)!=null}function Hy(e){const[t,n]=v.useState(null),s=v.useRef(0),r=v.useCallback(()=>{if(e.length===0){n(null);return}let a=e[0];for(const o of e){const c=document.getElementById(o);c&&c.getBoundingClientRect().top<=100&&(a=o)}n(a)},[e]);return v.useEffect(()=>{if(e.length===0)return;r();const a=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a),cancelAnimationFrame(s.current)}},[r,e]),t}async function Q(e,t,n){const s={method:e};n&&(s.headers={"Content-Type":"application/json"},s.body=JSON.stringify(n));const r=await fetch(t,s),a=await r.json();if(!r.ok)throw new Error(a.error??`HTTP ${r.status}`);return a}const B={getStatus:()=>Q("GET","/api/status"),getConnectors:()=>Q("GET","/api/connectors"),getConnector:(e,t)=>Q("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>Q("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>Q("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return Q("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>Q("GET",`/api/audit/${e}`),getConfig:()=>Q("GET","/api/config"),setConfig:(e,t)=>Q("POST","/api/config",{key:e,value:t}),getPreferences:()=>Q("GET","/api/preferences"),setPreference:(e,t)=>Q("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>Q("GET",`/api/goals?month=${e}`),upsertGoal:e=>Q("POST","/api/goals",e),deleteGoal:e=>Q("DELETE",`/api/goals/${e}`),getCachedReport:e=>Q("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>Q("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>Q("GET","/api/timetracking/projects"),cacheProjects:e=>Q("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>Q("POST","/api/journal/generate",e),getCachedJournal:e=>Q("GET",`/api/journal/cache?weekStart=${e}`),cacheJournalSaba:(e,t)=>Q("POST","/api/journal/cache/saba",{weekStart:e,saba:t}),getJournalSourcePrefs:()=>Q("GET","/api/journal/source-prefs"),saveJournalSourcePrefs:e=>Q("POST","/api/journal/source-prefs",e),getCachedSecurityNews:()=>Q("GET","/api/security-news/cache"),cacheSecurityNews:e=>Q("POST","/api/security-news/cache",{data:e}),getCachedTrustedPeers:()=>Q("GET","/api/trusted-peers/cache"),cacheTrustedPeers:e=>Q("POST","/api/trusted-peers/cache",{data:e}),getCachedRoomAvailability:e=>Q("GET",`/api/room-availability/cache?date=${e}`),cacheRoomAvailability:(e,t)=>Q("POST","/api/room-availability/cache",{date:e,data:t}),getSkills:()=>Q("GET","/api/skills")};function wa(e){const t=new Map;for(const n of e){const s=n.key.split("/")[0],r=t.get(s)??[];r.push(n),t.set(s,r)}return[...t.entries()]}const np={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},Vy={success:"border-emerald-500 text-emerald-600 dark:text-emerald-400",error:"border-red-500 text-red-600 dark:text-red-400",warning:"border-amber-500 text-amber-600 dark:text-amber-400",info:"border-sky-500 text-sky-600 dark:text-sky-400",secondary:"border-violet-500 text-violet-600 dark:text-violet-400",neutral:"border-base-300 text-base-content/60"},Ky={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function H({variant:e="neutral",size:t="sm",className:n="",children:s}){return i.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${Ky[t]} ${Vy[e]} ${n}`,children:s})}function Gy(){const[e,t]=v.useState(null),[n,s]=v.useState([]),r=v.useCallback(()=>{B.getStatus().then(t).catch(()=>t(null)),B.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);v.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function a(o){const c=Date.now()-new Date(o).getTime(),l=Math.floor(c/6e4);if(l<1)return"just now";if(l<60)return`${l} min ago`;const u=Math.floor(l/60);return u<24?`${u} hr ago`:`${Math.floor(u/24)}d ago`}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[i.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),i.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Duration"})]})}),i.jsx("tbody",{children:n.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"opacity-50 text-sm font-mono",children:a(o.timestamp)}),i.jsx("td",{className:"font-mono text-sm",children:o.connector}),i.jsx("td",{children:i.jsx(H,{variant:np[o.type]??"neutral",children:o.type})}),i.jsx("td",{className:"text-sm font-mono",children:o.durationMs?`${(o.durationMs/1e3).toFixed(1)}s`:"—"})]},o.id))})]})})]})}function jt({label:e}){return i.jsxs("div",{className:"flex items-center gap-3 py-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),e&&i.jsx("span",{className:"text-sm opacity-60",children:e})]})}function qy({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return i.jsxs("div",{className:"border border-base-300/50 p-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),i.jsx(H,{size:"sm",children:e.access}),e.capabilities.map(a=>i.jsx(H,{size:"sm",children:a},a)),e.isHighRisk&&e.isApproved&&i.jsx(H,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&i.jsx(H,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),i.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&i.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),i.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&i.jsx("button",{className:"btn btn-sm btn-warning btn-outline",disabled:t===e.key,onClick:()=>n(e.key),children:t===e.key?"Approving...":"Approve"}),e.hasAppPage&&e.appRoute&&i.jsx(je,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),i.jsx(je,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function Yy({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,a]=v.useState(!1);return i.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>a(!r),children:[i.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),i.jsx("span",{className:"font-mono font-semibold",children:e}),i.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&i.jsx("div",{className:"space-y-2 mt-3",children:t.map(o=>i.jsx(qy,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function Qy(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,a]=v.useState(!0),[o,c]=v.useState(null),l=v.useCallback(()=>{const d=B.getConnectors(),p=B.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,p]).then(([x,b])=>{t(x.connectors);const g=b.config.security??{};s(g.approvedHighRisk??[])}).catch(()=>{}).finally(()=>a(!1))},[]);v.useEffect(()=>{l()},[l]);const u=v.useCallback(async d=>{c(d);try{const p=[...n,d];await B.setConfig("security.approvedHighRisk",JSON.stringify(p)),l()}catch{}finally{c(null)}},[n,l]),h=v.useMemo(()=>wa(e),[e]);return r?i.jsx(jt,{label:"Loading connectors..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):i.jsx("div",{className:"space-y-3",children:h.map(([d,p])=>i.jsx(Yy,{site:d,connectors:p,approvingKey:o,onApprove:u},d))})]})}function ja(){const[e,t]=v.useState(!1),[n,s]=v.useState(null),[r,a]=v.useState(null),[o,c]=v.useState(!1),[l,u]=v.useState(null),h=v.useCallback(()=>{t(!1),s(null),a(null),c(!1),u(null)},[]),d=v.useCallback(async(b,g)=>{t(!0),a(null),s(null),c(!1),u(null);try{const w=await B.run(b,g);if(w.requiresApproval&&w.requestId){c(!0);const m=new EventSource(`/api/run/events/${w.requestId}`);m.addEventListener("approval",y=>{const f=JSON.parse(y.data);u(f.approvalId)}),m.addEventListener("result",y=>{const f=JSON.parse(y.data);!f.ok&&f.error?a(f.error):s(f),c(!1),t(!1),m.close()}),m.onerror=()=>{a("SSE connection lost"),c(!1),t(!1),m.close()}}else!w.ok&&w.error?(a(w.error),t(!1)):(s(w),t(!1))}catch(w){a(w instanceof Error?w.message:"Unknown error"),t(!1)}},[]),p=v.useCallback(async b=>{if(l)try{await B.approve(l,b),b||(c(!1),t(!1),a("Approval rejected"))}catch(g){a(g instanceof Error?g.message:"Approval failed")}},[l]),x=v.useCallback(b=>{t(!1),s(b),a(null),c(!1),u(null)},[]);return{running:e,result:n,error:r,approvalPending:o,approvalId:l,run:d,handleApproval:p,reset:h,hydrate:x}}function Jy(){const{site:e,name:t}=hy(),n=`${e}/${t}`,[s,r]=v.useState(null),[a,o]=v.useState(!0),[c,l]=v.useState({}),[u,h]=v.useState(null),{running:d,result:p,error:x,approvalPending:b,approvalId:g,run:w,handleApproval:m}=ja();v.useEffect(()=>{!e||!t||B.getConnector(e,t).then(f=>{r(f.connector);const j={};for(const k of f.connector.args??[])j[k.name]="";l(j)}).catch(f=>h(f.message)).finally(()=>o(!1))},[e,t]);const y=v.useCallback(async()=>{const f={};for(const[j,k]of Object.entries(c))k&&(f[j]=k);await w(n,f)},[c,n,w]);return a?i.jsx(jt,{label:"Loading connector..."}):s?i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(je,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),i.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),i.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),i.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[i.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(f=>i.jsxs("label",{className:"form-control",children:[i.jsxs("span",{className:"label-text mb-1 text-sm",children:[f.name,!f.required&&i.jsx("span",{className:"opacity-40",children:" (optional)"})]}),i.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:f.help,value:c[f.name]??"",onChange:j=>l(k=>({...k,[f.name]:j.target.value})),pattern:f.pattern}),f.help&&i.jsx("span",{className:"text-xs opacity-40 mt-1",children:f.help})]},f.name)),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:y,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!b&&i.jsx(jt,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),b&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>m(!0),disabled:!g,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>m(!1),disabled:!g,children:"Reject"})]})]}),x&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:x})}),p&&i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"font-semibold",children:"Results"}),i.jsxs("div",{className:"text-xs opacity-40",children:[p.rowCount??p.data.length," rows",p.durationMs?` · ${(p.durationMs/1e3).toFixed(1)}s`:""]})]}),p.data.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsx("tr",{children:(p.columns??Object.keys(p.data[0])).map(f=>i.jsx("th",{children:f},f))})}),i.jsx("tbody",{children:p.data.map((f,j)=>i.jsx("tr",{children:(p.columns??Object.keys(f)).map(k=>i.jsx("td",{className:"text-sm",children:String(f[k]??"")},k))},j))})]})})]})]}):i.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const Xy=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],Zy=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Pn=20;function ex(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,a]=v.useState(!0),[o,c]=v.useState(168),[l,u]=v.useState(""),[h,d]=v.useState(""),[p,x]=v.useState(null),[b,g]=v.useState(0);v.useEffect(()=>{B.getConnectors().then(f=>s(f.connectors)).catch(()=>{})},[]);const w=v.useCallback(()=>{a(!0);const f={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(Pn+b+1)};l&&(f.type=l),h&&(f.connector=h),B.getAudit(f).then(j=>t(j.events)).catch(()=>{}).finally(()=>a(!1))},[o,l,h,b]);v.useEffect(()=>{w();const f=setInterval(w,6e4);return()=>clearInterval(f)},[w]);const m=e.slice(b,b+Pn),y=e.length>b+Pn;return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),i.jsx("select",{className:"select select-bordered select-sm",value:o,onChange:f=>{c(Number(f.target.value)),g(0)},children:Xy.map(f=>i.jsx("option",{value:f.hours,children:f.label},f.hours))})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),i.jsxs("select",{className:"select select-bordered select-sm",value:l,onChange:f=>{u(f.target.value),g(0)},children:[i.jsx("option",{value:"",children:"All types"}),Zy.map(f=>i.jsx("option",{value:f,children:f},f))]})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),i.jsxs("select",{className:"select select-bordered select-sm",value:h,onChange:f=>{d(f.target.value),g(0)},children:[i.jsx("option",{value:"",children:"All connectors"}),n.map(f=>i.jsx("option",{value:f.key,children:f.key},f.key))]})]})]}),r&&e.length===0?i.jsx(jt,{label:"Loading audit events..."}):i.jsxs(i.Fragment,{children:[m.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"User"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:m.map(f=>i.jsxs(v.Fragment,{children:[i.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>x(p===f.id?null:f.id),role:"button","aria-expanded":p===f.id,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),x(p===f.id?null:f.id))},children:[i.jsx("td",{className:"text-sm font-mono",children:new Date(f.timestamp).toLocaleString()}),i.jsx("td",{children:i.jsx(H,{variant:np[f.type]??"neutral",children:f.type})}),i.jsx("td",{className:"font-mono text-sm",children:f.connector||"—"}),i.jsx("td",{className:"text-sm",children:f.user}),i.jsx("td",{className:"text-sm font-mono",children:f.durationMs?`${(f.durationMs/1e3).toFixed(1)}s`:"—"}),i.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:p===f.id?"▲":"▼"})]},f.id),p===f.id&&i.jsx("tr",{children:i.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"ID:"})," ",i.jsx("span",{className:"font-mono text-xs",children:f.id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",i.jsx("span",{className:"font-mono text-xs",children:f.correlationId??"—"})]}),f.connectorHash&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",i.jsx("span",{className:"font-mono text-xs",children:f.connectorHash})]}),f.error&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Error:"})," ",i.jsx("span",{className:"text-error",children:f.error})]}),f.args&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Args:"})," ",i.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(f.args)})]}),f.domains&&f.domains.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Domains:"})," ",f.domains.join(", ")]}),f.capabilities&&f.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",f.capabilities.join(", ")]})]}),f.steps&&f.steps.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"#"}),i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Error"})]})}),i.jsx("tbody",{children:f.steps.map((j,k)=>i.jsxs("tr",{children:[i.jsx("td",{children:k+1}),i.jsx("td",{children:j.step}),i.jsx("td",{children:j.capability}),i.jsxs("td",{children:[(j.durationMs/1e3).toFixed(2),"s"]}),i.jsx("td",{className:"text-error",children:j.error??""})]},k))})]})]})]})},`${f.id}-detail`)]},f.id))})]})}),m.length>0&&i.jsxs("div",{className:"flex justify-between items-center mt-4",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:b===0,onClick:()=>g(Math.max(0,b-Pn)),children:"Previous"}),i.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",b+1,"–",Math.min(b+Pn,e.length),y?"":` of ${e.length}`]}),i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!y,onClick:()=>g(b+Pn),children:"Next"})]})]})]})}const vc=Symbol.for("yaml.alias"),pl=Symbol.for("yaml.document"),tn=Symbol.for("yaml.map"),sp=Symbol.for("yaml.pair"),kt=Symbol.for("yaml.scalar"),ws=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),js=e=>!!e&&typeof e=="object"&&e[st]===vc,Or=e=>!!e&&typeof e=="object"&&e[st]===pl,Ir=e=>!!e&&typeof e=="object"&&e[st]===tn,he=e=>!!e&&typeof e=="object"&&e[st]===sp,ee=e=>!!e&&typeof e=="object"&&e[st]===kt,_r=e=>!!e&&typeof e=="object"&&e[st]===ws;function de(e){if(e&&typeof e=="object")switch(e[st]){case tn:case ws:return!0}return!1}function fe(e){if(e&&typeof e=="object")switch(e[st]){case vc:case tn:case kt:case ws:return!0}return!1}const rp=e=>(ee(e)||de(e))&&!!e.anchor,hn=Symbol("break visit"),tx=Symbol("skip children"),sr=Symbol("remove node");function ks(e,t){const n=nx(t);Or(e)?qn(null,e.contents,n,Object.freeze([e]))===sr&&(e.contents=null):qn(null,e,n,Object.freeze([]))}ks.BREAK=hn;ks.SKIP=tx;ks.REMOVE=sr;function qn(e,t,n,s){const r=sx(e,t,n,s);if(fe(r)||he(r))return rx(e,s,r),qn(e,r,n,s);if(typeof r!="symbol"){if(de(t)){s=Object.freeze(s.concat(t));for(let a=0;a<t.items.length;++a){const o=qn(a,t.items[a],n,s);if(typeof o=="number")a=o-1;else{if(o===hn)return hn;o===sr&&(t.items.splice(a,1),a-=1)}}}else if(he(t)){s=Object.freeze(s.concat(t));const a=qn("key",t.key,n,s);if(a===hn)return hn;a===sr&&(t.key=null);const o=qn("value",t.value,n,s);if(o===hn)return hn;o===sr&&(t.value=null)}}return r}function nx(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function sx(e,t,n,s){var r,a,o,c,l;if(typeof n=="function")return n(e,t,s);if(Ir(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(_r(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,s);if(he(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(ee(t))return(c=n.Scalar)==null?void 0:c.call(n,e,t,s);if(js(t))return(l=n.Alias)==null?void 0:l.call(n,e,t,s)}function rx(e,t,n){const s=t[t.length-1];if(de(s))s.items[e]=n;else if(he(s))e==="key"?s.key=n:s.value=n;else if(Or(s))s.contents=n;else{const r=js(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const ix={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ax=e=>e.replace(/[!,[\]{}]/g,t=>ix[t]);class Le{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Le.defaultYaml,t),this.tags=Object.assign({},Le.defaultTags,n)}clone(){const t=new Le(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Le(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Le.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Le.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Le.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Le.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[a,o]=s;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const a=this.tags[s];if(a)try{return a+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+ax(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let r;if(t&&s.length>0&&fe(t.contents)){const a={};ks(t.contents,(o,c)=>{fe(c)&&c.tag&&(a[c.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of s)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(c=>c.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
68
+ `)}}Le.defaultYaml={explicit:!1,version:"1.2"};Le.defaultTags={"!!":"tag:yaml.org,2002:"};function ip(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ap(e){const t=new Set;return ks(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function op(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function ox(e,t){const n=[],s=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=ap(e));const o=op(t,r);return r.add(o),o},setAnchors:()=>{for(const a of n){const o=s.get(a);if(typeof o=="object"&&o.anchor&&(ee(o.node)||de(o.node)))o.node.anchor=o.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:s}}function Yn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,a=s.length;r<a;++r){const o=s[r],c=Yn(e,s,String(r),o);c===void 0?delete s[r]:c!==o&&(s[r]=c)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const a=s.get(r),o=Yn(e,s,r,a);o===void 0?s.delete(r):o!==a&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const a=Yn(e,s,r,r);a===void 0?s.delete(r):a!==r&&(s.delete(r),s.add(a))}else for(const[r,a]of Object.entries(s)){const o=Yn(e,s,r,a);o===void 0?delete s[r]:o!==a&&(s[r]=o)}return e.call(t,n,s)}function et(e,t,n){if(Array.isArray(e))return e.map((s,r)=>et(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!rp(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=a=>{s.res=a,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class bc{constructor(t){Object.defineProperty(this,st,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:a}={}){if(!Or(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=et(this,"",o);if(typeof r=="function")for(const{count:l,res:u}of o.anchors.values())r(u,l);return typeof a=="function"?Yn(a,{"":c},"",c):c}}class wc extends bc{constructor(t){super(vc),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],ks(t,{Node:(a,o)=>{(js(o)||rp(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(const a of s){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:a}=n,o=this.resolve(r,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let c=s.get(o);if(c||(et(o,null,n),c=s.get(o)),(c==null?void 0:c.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ji(r,o,s)),c.count*c.aliasCount>a)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return c.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(ip(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${r} `}return r}}function ji(e,t,n){if(js(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(de(t)){let s=0;for(const r of t.items){const a=ji(e,r,n);a>s&&(s=a)}return s}else if(he(t)){const s=ji(e,t.key,n),r=ji(e,t.value,n);return Math.max(s,r)}return 1}const lp=e=>!e||typeof e!="function"&&typeof e!="object";class U extends bc{constructor(t){super(kt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:et(this.value,t,n)}toString(){return String(this.value)}}U.BLOCK_FOLDED="BLOCK_FOLDED";U.BLOCK_LITERAL="BLOCK_LITERAL";U.PLAIN="PLAIN";U.QUOTE_DOUBLE="QUOTE_DOUBLE";U.QUOTE_SINGLE="QUOTE_SINGLE";const lx="tag:yaml.org,2002:";function cx(e,t,n){if(t){const s=n.filter(a=>a.tag===t),r=s.find(a=>!a.format)??s[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(s=>{var r;return((r=s.identify)==null?void 0:r.call(s,e))&&!s.format})}function Nr(e,t,n){var d,p,x;if(Or(e)&&(e=e.contents),fe(e))return e;if(he(e)){const b=(p=(d=n.schema[tn]).createNode)==null?void 0:p.call(d,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:a,schema:o,sourceObjects:c}=n;let l;if(s&&e&&typeof e=="object"){if(l=c.get(e),l)return l.anchor??(l.anchor=r(e)),new wc(l.anchor);l={anchor:null,node:null},c.set(e,l)}t!=null&&t.startsWith("!!")&&(t=lx+t.slice(2));let u=cx(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new U(e);return l&&(l.node=b),b}u=e instanceof Map?o[tn]:Symbol.iterator in Object(e)?o[ws]:o[tn]}a&&(a(u),delete n.onTagObj);const h=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((x=u==null?void 0:u.nodeClass)==null?void 0:x.from)=="function"?u.nodeClass.from(n.schema,e,n):new U(e);return t?h.tag=t:u.default||(h.tag=u.tag),l&&(l.node=h),h}function Xi(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const a=t[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=s,s=o}else s=new Map([[a,s]])}return Nr(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Vs=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class cp extends bc{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>fe(s)||he(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Vs(t))this.add(n);else{const[s,...r]=t,a=this.get(s,!0);if(de(a))a.addIn(r,n);else if(a===void 0&&this.schema)this.set(s,Xi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const r=this.get(n,!0);if(de(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...r]=t,a=this.get(s,!0);return r.length===0?!n&&ee(a)?a.value:a:de(a)?a.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!he(n))return!1;const s=n.value;return s==null||t&&ee(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const r=this.get(n,!0);return de(r)?r.hasIn(s):!1}setIn(t,n){const[s,...r]=t;if(r.length===0)this.set(s,n);else{const a=this.get(s,!0);if(de(a))a.setIn(r,n);else if(a===void 0&&this.schema)this.set(s,Xi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const ux=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Tt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const yn=(e,t,n)=>e.endsWith(`
69
+ `)?Tt(n,t):n.includes(`
70
+ `)?`
71
+ `+Tt(n,t):(e.endsWith(" ")?"":" ")+n,up="flow",ml="block",ki="quoted";function ka(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:c}={}){if(!r||r<0)return e;r<a&&(a=0);const l=Math.max(1+a,1+r-t.length);if(e.length<=l)return e;const u=[],h={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,a)?u.push(0):d=r-s);let p,x,b=!1,g=-1,w=-1,m=-1;n===ml&&(g=Zu(e,g,t.length),g!==-1&&(d=g+l));for(let f;f=e[g+=1];){if(n===ki&&f==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}m=g}if(f===`
72
+ `)n===ml&&(g=Zu(e,g,t.length)),d=g+t.length+l,p=void 0;else{if(f===" "&&x&&x!==" "&&x!==`
73
+ `&&x!==" "){const j=e[g+1];j&&j!==" "&&j!==`
74
+ `&&j!==" "&&(p=g)}if(g>=d)if(p)u.push(p),d=p+l,p=void 0;else if(n===ki){for(;x===" "||x===" ";)x=f,f=e[g+=1],b=!0;const j=g>m+1?g-2:w-1;if(h[j])return e;u.push(j),h[j]=!0,d=j+l,p=void 0}else b=!0}x=f}if(b&&c&&c(),u.length===0)return e;o&&o();let y=e.slice(0,u[0]);for(let f=0;f<u.length;++f){const j=u[f],k=u[f+1]||e.length;j===0?y=`
75
+ ${t}${e.slice(0,k)}`:(n===ki&&h[j]&&(y+=`${e[j]}\\`),y+=`
76
+ ${t}${e.slice(j+1,k)}`)}return y}function Zu(e,t,n){let s=t,r=t+1,a=e[r];for(;a===" "||a===" ";)if(t<r+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
77
+ `);s=t,r=t+1,a=e[r]}return s}const Na=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Sa=e=>/^(%|---|\.\.\.)/m.test(e);function dx(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let a=0,o=0;a<r;++a)if(e[a]===`
78
+ `){if(a-o>s)return!0;if(o=a+1,r-o<=s)return!1}return!0}function rr(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Sa(e)?" ":"");let o="",c=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(c,l)+"\\ ",l+=1,c=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{o+=n.slice(c,l);const h=n.substr(l+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=n.substr(l,6)}l+=5,c=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(c,l)+`
79
+
80
+ `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
81
+ `,l+=2;o+=a,n[l+2]===" "&&(o+="\\"),l+=1,c=l+1}break;default:l+=1}return o=c?o+n.slice(c):n,s?o:ka(o,a,ki,Na(t,!1))}function gl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
+ `)||/[ \t]\n|\n[ \t]/.test(e))return rr(e,t);const n=t.indent||(Sa(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
+ ${n}`)+"'";return t.implicitKey?s:ka(s,n,up,Na(t,!1))}function Qn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=rr;else{const r=e.includes('"'),a=e.includes("'");r&&!a?s=gl:a&&!r?s=rr:s=n?gl:rr}return s(e,t)}let yl;try{yl=new RegExp(`(^|(?<!
84
+ ))
85
+ +(?!
86
+ |$)`,"g")}catch{yl=/\n+(?!\n|$)/g}function Ni({comment:e,type:t,value:n},s,r,a){const{blockQuote:o,commentString:c,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return Qn(n,s);const u=s.indent||(s.forceBlockIndent||Sa(n)?" ":""),h=o==="literal"?!0:o==="folded"||t===U.BLOCK_FOLDED?!1:t===U.BLOCK_LITERAL?!0:!dx(n,l,u.length);if(!n)return h?`|
87
+ `:`>
88
+ `;let d,p;for(p=n.length;p>0;--p){const k=n[p-1];if(k!==`
89
+ `&&k!==" "&&k!==" ")break}let x=n.substring(p);const b=x.indexOf(`
90
+ `);b===-1?d="-":n===x||b!==x.length-1?(d="+",a&&a()):d="",x&&(n=n.slice(0,-x.length),x[x.length-1]===`
91
+ `&&(x=x.slice(0,-1)),x=x.replace(yl,`$&${u}`));let g=!1,w,m=-1;for(w=0;w<n.length;++w){const k=n[w];if(k===" ")g=!0;else if(k===`
92
+ `)m=w;else break}let y=n.substring(0,m<w?m+1:w);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${u}`));let j=(g?u?"2":"1":"")+d;if(e&&(j+=" "+c(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!h){const k=n.replace(/\n+/g,`
93
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let C=!1;const N=Na(s,!0);o!=="folded"&&t!==U.BLOCK_FOLDED&&(N.onOverflow=()=>{C=!0});const S=ka(`${y}${k}${x}`,u,ml,N);if(!C)return`>${j}
94
+ ${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${j}
95
+ ${u}${y}${n}${x}`}function fx(e,t,n,s){const{type:r,value:a}=e,{actualString:o,implicitKey:c,indent:l,indentStep:u,inFlow:h}=t;if(c&&a.includes(`
96
+ `)||h&&/[[\]{},]/.test(a))return Qn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||h||!a.includes(`
97
+ `)?Qn(a,t):Ni(e,t,n,s);if(!c&&!h&&r!==U.PLAIN&&a.includes(`
98
+ `))return Ni(e,t,n,s);if(Sa(a)){if(l==="")return t.forceBlockIndent=!0,Ni(e,t,n,s);if(c&&l===u)return Qn(a,t)}const d=a.replace(/\n+/g,`$&
99
+ ${l}`);if(o){const p=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(d))},{compat:x,tags:b}=t.doc.schema;if(b.some(p)||x!=null&&x.some(p))return Qn(a,t)}return c?d:ka(d,l,up,Na(t,!1))}function jc(e,t,n,s){const{implicitKey:r,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==U.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(c=U.QUOTE_DOUBLE);const l=h=>{switch(h){case U.BLOCK_FOLDED:case U.BLOCK_LITERAL:return r||a?Qn(o.value,t):Ni(o,t,n,s);case U.QUOTE_DOUBLE:return rr(o.value,t);case U.QUOTE_SINGLE:return gl(o.value,t);case U.PLAIN:return fx(o,t,n,s);default:return null}};let u=l(c);if(u===null){const{defaultKeyType:h,defaultStringType:d}=t.options,p=r&&h||d;if(u=l(p),u===null)throw new Error(`Unsupported default string type ${p}`)}return u}function dp(e,t){const n=Object.assign({blockQuote:!0,commentString:ux,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function hx(e,t){var r;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,s;if(ee(t)){s=t.value;let a=e.filter(o=>{var c;return(c=o.identify)==null?void 0:c.call(o,s)});if(a.length>1){const o=a.filter(c=>c.test);o.length>0&&(a=o)}n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else s=t,n=e.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!n){const a=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${a} value`)}return n}function px(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],a=(ee(e)||de(e))&&e.anchor;a&&ip(a)&&(n.add(a),r.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function ps(e,t,n,s){var l;if(he(e))return e.toString(t,n,s);if(js(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const a=fe(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=hx(t.doc.schema.tags,a));const o=px(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const c=typeof r.stringify=="function"?r.stringify(a,t,n,s):ee(a)?jc(a,t,n,s):a.toString(t,n,s);return o?ee(a)||c[0]==="{"||c[0]==="["?`${o} ${c}`:`${o}
100
+ ${t.indent}${c}`:c}function mx({key:e,value:t},n,s,r){const{allNullValues:a,doc:o,indent:c,indentStep:l,options:{commentString:u,indentSeq:h,simpleKeys:d}}=n;let p=fe(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(de(e)||!fe(e)&&typeof e=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let x=!d&&(!e||p&&t==null&&!n.inFlow||de(e)||(ee(e)?e.type===U.BLOCK_FOLDED||e.type===U.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!x&&(d||!a),indent:c+l});let b=!1,g=!1,w=ps(e,n,()=>b=!0,()=>g=!0);if(!x&&!n.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(n.inFlow){if(a||t==null)return b&&s&&s(),w===""?"?":x?`? ${w}`:w}else if(a&&!d||t==null&&x)return w=`? ${w}`,p&&!b?w+=yn(w,n.indent,u(p)):g&&r&&r(),w;b&&(p=null),x?(p&&(w+=yn(w,n.indent,u(p))),w=`? ${w}
101
+ ${c}:`):(w=`${w}:`,p&&(w+=yn(w,n.indent,u(p))));let m,y,f;fe(t)?(m=!!t.spaceBefore,y=t.commentBefore,f=t.comment):(m=!1,y=null,f=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!x&&!p&&ee(t)&&(n.indentAtStart=w.length+1),g=!1,!h&&l.length>=2&&!n.inFlow&&!x&&_r(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let j=!1;const k=ps(t,n,()=>j=!0,()=>g=!0);let C=" ";if(p||m||y){if(C=m?`
102
+ `:"",y){const N=u(y);C+=`
103
+ ${Tt(N,n.indent)}`}k===""&&!n.inFlow?C===`
104
+ `&&f&&(C=`
105
+
106
+ `):C+=`
107
+ ${n.indent}`}else if(!x&&de(t)){const N=k[0],S=k.indexOf(`
108
+ `),E=S!==-1,A=n.inFlow??t.flow??t.items.length===0;if(E||!A){let F=!1;if(E&&(N==="&"||N==="!")){let V=k.indexOf(" ");N==="&"&&V!==-1&&V<S&&k[V+1]==="!"&&(V=k.indexOf(" ",V+1)),(V===-1||S<V)&&(F=!0)}F||(C=`
109
+ ${n.indent}`)}}else(k===""||k[0]===`
110
+ `)&&(C="");return w+=C+k,n.inFlow?j&&s&&s():f&&!j?w+=yn(w,n.indent,u(f)):g&&r&&r(),w}function fp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ti="<<",Lt={identify:e=>e===ti||typeof e=="symbol"&&e.description===ti,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new U(Symbol(ti)),{addToJSMap:hp}),stringify:()=>ti},gx=(e,t)=>(Lt.identify(t)||ee(t)&&(!t.type||t.type===U.PLAIN)&&Lt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Lt.tag&&n.default));function hp(e,t,n){const s=pp(e,n);if(_r(s))for(const r of s.items)io(e,t,r);else if(Array.isArray(s))for(const r of s)io(e,t,r);else io(e,t,s)}function io(e,t,n){const s=pp(e,n);if(!Ir(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[a,o]of r)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function pp(e,t){return e&&js(t)?t.resolve(e.doc,e):t}function mp(e,t,{key:n,value:s}){if(fe(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(gx(e,n))hp(e,t,s);else{const r=et(n,"",e);if(t instanceof Map)t.set(r,et(s,r,e));else if(t instanceof Set)t.add(r);else{const a=yx(n,r,e),o=et(s,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function yx(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(fe(e)&&(n!=null&&n.doc)){const s=dp(n.doc,{});s.anchors=new Set;for(const a of n.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),fp(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function kc(e,t,n){const s=Nr(e,void 0,n),r=Nr(t,void 0,n);return new Oe(s,r)}class Oe{constructor(t,n=null){Object.defineProperty(this,st,{value:sp}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return fe(n)&&(n=n.clone(t)),fe(s)&&(s=s.clone(t)),new Oe(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return mp(n,s,this)}toString(t,n,s){return t!=null&&t.doc?mx(this,t,n,s):JSON.stringify(this)}}function gp(e,t,n){return(t.inFlow??e.flow?vx:xx)(e,t,n)}function xx({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:a,onChompKeep:o,onComment:c}){const{indent:l,options:{commentString:u}}=n,h=Object.assign({},n,{indent:a,type:null});let d=!1;const p=[];for(let b=0;b<t.length;++b){const g=t[b];let w=null;if(fe(g))!d&&g.spaceBefore&&p.push(""),Zi(n,p,g.commentBefore,d),g.comment&&(w=g.comment);else if(he(g)){const y=fe(g.key)?g.key:null;y&&(!d&&y.spaceBefore&&p.push(""),Zi(n,p,y.commentBefore,d))}d=!1;let m=ps(g,h,()=>w=null,()=>d=!0);w&&(m+=yn(m,a,u(w))),d&&w&&(d=!1),p.push(s+m)}let x;if(p.length===0)x=r.start+r.end;else{x=p[0];for(let b=1;b<p.length;++b){const g=p[b];x+=g?`
111
+ ${l}${g}`:`
112
+ `}}return e?(x+=`
113
+ `+Tt(u(e),l),c&&c()):d&&o&&o(),x}function vx({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:c}}=t;s+=a;const l=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,h=0;const d=[];for(let b=0;b<e.length;++b){const g=e[b];let w=null;if(fe(g))g.spaceBefore&&d.push(""),Zi(t,d,g.commentBefore,!1),g.comment&&(w=g.comment);else if(he(g)){const y=fe(g.key)?g.key:null;y&&(y.spaceBefore&&d.push(""),Zi(t,d,y.commentBefore,!1),y.comment&&(u=!0));const f=fe(g.value)?g.value:null;f?(f.comment&&(w=f.comment),f.commentBefore&&(u=!0)):g.value==null&&(y!=null&&y.comment)&&(w=y.comment)}w&&(u=!0);let m=ps(g,l,()=>w=null);u||(u=d.length>h||m.includes(`
114
+ `)),b<e.length-1?m+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((y,f)=>y+f.length+2,2)+(m.length+2)>t.options.lineWidth)),u&&(m+=",")),w&&(m+=yn(m,s,c(w))),d.push(m),h=d.length}const{start:p,end:x}=n;if(d.length===0)return p+x;if(!u){const b=d.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&b>t.options.lineWidth}if(u){let b=p;for(const g of d)b+=g?`
115
+ ${a}${r}${g}`:`
116
+ `;return`${b}
117
+ ${r}${x}`}else return`${p}${o}${d.join(" ")}${o}${x}`}function Zi({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const a=Tt(t(s),e);n.push(a.trimStart())}}function xn(e,t){const n=ee(t)?t.value:t;for(const s of e)if(he(s)&&(s.key===t||s.key===n||ee(s.key)&&s.key.value===n))return s}class Je extends cp{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(tn,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:a}=s,o=new this(t),c=(l,u)=>{if(typeof a=="function")u=a.call(n,l,u);else if(Array.isArray(a)&&!a.includes(l))return;(u!==void 0||r)&&o.items.push(kc(l,u,s))};if(n instanceof Map)for(const[l,u]of n)c(l,u);else if(n&&typeof n=="object")for(const l of Object.keys(n))c(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;he(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Oe(t,t==null?void 0:t.value):s=new Oe(t.key,t.value);const r=xn(this.items,s.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);ee(r.value)&&lp(s.value)?r.value.value=s.value:r.value=s.value}else if(a){const c=this.items.findIndex(l=>a(s,l)<0);c===-1?this.items.push(s):this.items.splice(c,0,s)}else this.items.push(s)}delete(t){const n=xn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=xn(this.items,t),r=s==null?void 0:s.value;return(!n&&ee(r)?r.value:r)??void 0}has(t){return!!xn(this.items,t)}set(t,n){this.add(new Oe(t,n),!0)}toJSON(t,n,s){const r=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const a of this.items)mp(n,r,a);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!he(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),gp(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const Ns={collection:"map",default:!0,nodeClass:Je,tag:"tag:yaml.org,2002:map",resolve(e,t){return Ir(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Je.from(e,t,n)};class Cn extends cp{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ws,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ni(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=ni(t);if(typeof s!="number")return;const r=this.items[s];return!n&&ee(r)?r.value:r}has(t){const n=ni(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=ni(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];ee(r)&&lp(n)?r.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let r=0;for(const a of this.items)s.push(et(a,String(r++),n));return s}toString(t,n,s){return t?gp(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let c of n){if(typeof r=="function"){const l=n instanceof Set?c:String(o++);c=r.call(n,l,c)}a.items.push(Nr(c,void 0,s))}}return a}}function ni(e){let t=ee(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ss={collection:"seq",default:!0,nodeClass:Cn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return _r(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Cn.from(e,t,n)},Ca={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),jc(e,t,n,s)}},Ea={identify:e=>e==null,createNode:()=>new U(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new U(null),stringify:({source:e},t)=>typeof e=="string"&&Ea.test.test(e)?e:t.options.nullStr},Nc={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new U(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Nc.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function ht({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let a=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let c=t-(a.length-o-1);for(;c-- >0;)a+="0"}return a}const yp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ht},xp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ht(e)}},vp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new U(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ht},Ta=e=>typeof e=="bigint"||Number.isInteger(e),Sc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function bp(e,t,n){const{value:s}=e;return Ta(s)&&s>=0?n+s.toString(t):ht(e)}const wp={identify:e=>Ta(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Sc(e,2,8,n),stringify:e=>bp(e,8,"0o")},jp={identify:Ta,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Sc(e,0,10,n),stringify:ht},kp={identify:e=>Ta(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Sc(e,2,16,n),stringify:e=>bp(e,16,"0x")},bx=[Ns,Ss,Ca,Ea,Nc,wp,jp,kp,yp,xp,vp];function ed(e){return typeof e=="bigint"||Number.isInteger(e)}const si=({value:e})=>JSON.stringify(e),wx=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:si},{identify:e=>e==null,createNode:()=>new U(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:si},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:si},{identify:ed,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>ed(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:si}],jx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},kx=[Ns,Ss].concat(wx,jx),Cc={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,a){if(!n)return"";const o=n;let c;if(typeof btoa=="function"){let l="";for(let u=0;u<o.length;++u)l+=String.fromCharCode(o[u]);c=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=U.BLOCK_LITERAL),t!==U.QUOTE_DOUBLE){const l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(c.length/l),h=new Array(u);for(let d=0,p=0;d<u;++d,p+=l)h[d]=c.substr(p,l);c=h.join(t===U.BLOCK_LITERAL?`
118
+ `:" ")}return jc({comment:e,type:t,value:c},s,r,a)}};function Np(e,t){if(_r(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!he(s)){if(Ir(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Oe(new U(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
119
+ ${r.key.commentBefore}`:s.commentBefore),s.comment){const a=r.value??r.key;a.comment=a.comment?`${s.comment}
120
+ ${a.comment}`:s.comment}s=r}e.items[n]=he(s)?s:new Oe(s)}}else t("Expected a sequence for this tag");return e}function Sp(e,t,n){const{replacer:s}=n,r=new Cn(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(a++),o));let c,l;if(Array.isArray(o))if(o.length===2)c=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)c=u[0],l=o[c];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else c=o;r.items.push(kc(c,l,n))}return r}const Ec={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Np,createNode:Sp};class rs extends Cn{constructor(){super(),this.add=Je.prototype.add.bind(this),this.delete=Je.prototype.delete.bind(this),this.get=Je.prototype.get.bind(this),this.has=Je.prototype.has.bind(this),this.set=Je.prototype.set.bind(this),this.tag=rs.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const r of this.items){let a,o;if(he(r)?(a=et(r.key,"",n),o=et(r.value,a,n)):a=et(r,"",n),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,o)}return s}static from(t,n,s){const r=Sp(t,n,s),a=new this;return a.items=r.items,a}}rs.tag="tag:yaml.org,2002:omap";const Tc={collection:"seq",identify:e=>e instanceof Map,nodeClass:rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Np(e,t),s=[];for(const{key:r}of n.items)ee(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new rs,n)},createNode:(e,t,n)=>rs.from(e,t,n)};function Cp({value:e,source:t},n){return t&&(e?Ep:Tp).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Ep={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new U(!0),stringify:Cp},Tp={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new U(!1),stringify:Cp},Nx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ht},Sx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ht(e)}},Cx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new U(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:ht},Mr=e=>typeof e=="bigint"||Number.isInteger(e);function Aa(e,t,n,{intAsBigInt:s}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return r==="-"?-1*a:a}function Ac(e,t,n){const{value:s}=e;if(Mr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return ht(e)}const Ex={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Aa(e,2,2,n),stringify:e=>Ac(e,2,"0b")},Tx={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Aa(e,1,8,n),stringify:e=>Ac(e,8,"0")},Ax={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Aa(e,0,10,n),stringify:ht},Lx={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Aa(e,2,16,n),stringify:e=>Ac(e,16,"0x")};class is extends Je{constructor(t){super(t),this.tag=is.tag}add(t){let n;he(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Oe(t.key,null):n=new Oe(t,null),xn(this.items,n.key)||this.items.push(n)}get(t,n){const s=xn(this.items,t);return!n&&he(s)?ee(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=xn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Oe(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),a.items.push(kc(o,null,s));return a}}is.tag="tag:yaml.org,2002:set";const Lc={collection:"map",identify:e=>e instanceof Set,nodeClass:is,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>is.from(e,t,n),resolve(e,t){if(Ir(e)){if(e.hasAllNullValues(!0))return Object.assign(new is,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Pc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),a=s.replace(/_/g,"").split(":").reduce((o,c)=>o*r(60)+r(c),r(0));return n==="-"?r(-1)*a:a}function Ap(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ht(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),a=[t%r];return t<60?a.unshift(0):(t=(t-a[0])/r,a.unshift(t%r),t>=60&&(t=(t-a[0])/r,a.unshift(t))),s+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Lp={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Pc(e,n),stringify:Ap},Pp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Pc(e,!1),stringify:Ap},La={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(La.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,a,o,c]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,a||0,o||0,c||0,l);const h=t[8];if(h&&h!=="Z"){let d=Pc(h,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},td=[Ns,Ss,Ca,Ea,Ep,Tp,Ex,Tx,Ax,Lx,Nx,Sx,Cx,Cc,Lt,Tc,Ec,Lc,Lp,Pp,La],nd=new Map([["core",bx],["failsafe",[Ns,Ss,Ca]],["json",kx],["yaml11",td],["yaml-1.1",td]]),sd={binary:Cc,bool:Nc,float:vp,floatExp:xp,floatNaN:yp,floatTime:Pp,int:jp,intHex:kp,intOct:wp,intTime:Lp,map:Ns,merge:Lt,null:Ea,omap:Tc,pairs:Ec,seq:Ss,set:Lc,timestamp:La},Px={"tag:yaml.org,2002:binary":Cc,"tag:yaml.org,2002:merge":Lt,"tag:yaml.org,2002:omap":Tc,"tag:yaml.org,2002:pairs":Ec,"tag:yaml.org,2002:set":Lc,"tag:yaml.org,2002:timestamp":La};function ao(e,t,n){const s=nd.get(t);if(s&&!e)return n&&!s.includes(Lt)?s.concat(Lt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const a=Array.from(nd.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)r=r.concat(a);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Lt)),r.reduce((a,o)=>{const c=typeof o=="string"?sd[o]:o;if(!c){const l=JSON.stringify(o),u=Object.keys(sd).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return a.includes(c)||a.push(c),a},[])}const Ox=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Oc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:c}){this.compat=Array.isArray(t)?ao(t,"compat"):t?ao(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?Px:{},this.tags=ao(n,this.name,s),this.toStringOptions=c??null,Object.defineProperty(this,tn,{value:Ns}),Object.defineProperty(this,kt,{value:Ca}),Object.defineProperty(this,ws,{value:Ss}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ox:null}clone(){const t=Object.create(Oc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Ix(e,t){var l;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const r=dp(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=a(e.commentBefore);n.unshift(Tt(u,""))}let o=!1,c=null;if(e.contents){if(fe(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Tt(d,""))}r.forceBlockIndent=!!e.comment,c=e.contents.comment}const u=c?void 0:()=>o=!0;let h=ps(e.contents,r,()=>c=null,u);c&&(h+=yn(h,"",a(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(ps(e.contents,r));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const u=a(e.comment);u.includes(`
121
+ `)?(n.push("..."),n.push(Tt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||c)&&n[n.length-1]!==""&&n.push(""),n.push(Tt(a(u),"")))}return n.join(`
122
+ `)+`
123
+ `}class $r{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:pl});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:o}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Le({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create($r.prototype,{[st]:{value:pl}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=fe(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){On(this.contents)&&this.contents.add(t)}addIn(t,n){On(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=ap(this);t.anchor=!n||s.has(n)?op(n||"a",s):n}return new wc(t.anchor)}createNode(t,n,s){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const w=y=>typeof y=="number"||y instanceof String||y instanceof Number,m=n.filter(w).map(String);m.length>0&&(n=n.concat(m)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:c,keepUndefined:l,onTagObj:u,tag:h}=s??{},{onAnchor:d,setAnchors:p,sourceObjects:x}=ox(this,o||"a"),b={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:x},g=Nr(t,h,b);return c&&de(g)&&(g.flow=!0),p(),g}createPair(t,n,s={}){const r=this.createNode(t,null,s),a=this.createNode(n,null,s);return new Oe(r,a)}delete(t){return On(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Vs(t)?this.contents==null?!1:(this.contents=null,!0):On(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return de(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Vs(t)?!n&&ee(this.contents)?this.contents.value:this.contents:de(this.contents)?this.contents.getIn(t,n):void 0}has(t){return de(this.contents)?this.contents.has(t):!1}hasIn(t){return Vs(t)?this.contents!==void 0:de(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Xi(this.schema,[t],n):On(this.contents)&&this.contents.set(t,n)}setIn(t,n){Vs(t)?this.contents=n:this.contents==null?this.contents=Xi(this.schema,Array.from(t),n):On(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Le({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Le({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new Oc(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:a,reviver:o}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=et(this.contents,n??"",c);if(typeof a=="function")for(const{count:u,res:h}of c.anchors.values())a(h,u);return typeof o=="function"?Yn(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Ix(this,t)}}function On(e){if(de(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Op extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ks extends Op{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class _x extends Op{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const rd=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let a=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const c=Math.min(a-39,o.length-79);o="…"+o.substring(c),a-=c-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,a))){let c=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);c.length>80&&(c=c.substring(0,79)+`…
124
+ `),o=c+o}if(/[^ ]/.test(o)){let c=1;const l=n.linePos[1];(l==null?void 0:l.line)===s&&l.col>r&&(c=Math.max(1,Math.min(l.col-r,80-a)));const u=" ".repeat(a)+"^".repeat(c);n.message+=`:
125
+
126
+ ${o}
127
+ ${u}
128
+ `}};function ms(e,{flow:t,indicator:n,next:s,offset:r,onError:a,parentIndent:o,startOnNewline:c}){let l=!1,u=c,h=c,d="",p="",x=!1,b=!1,g=null,w=null,m=null,y=null,f=null,j=null,k=null;for(const S of e)switch(b&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&a(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&a(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),h=!0;break;case"comment":{h||a(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const E=S.source.substring(1)||" ";d?d+=p+E:d=E,p="",u=!1;break}case"newline":u?d?d+=S.source:(!j||n!=="seq-item-ind")&&(l=!0):p+=S.source,u=!0,x=!0,(w||m)&&(y=S),h=!0;break;case"anchor":w&&a(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&a(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=S,k??(k=S.offset),u=!1,h=!1,b=!0;break;case"tag":{m&&a(S,"MULTIPLE_TAGS","A node can have at most one tag"),m=S,k??(k=S.offset),u=!1,h=!1,b=!0;break}case n:(w||m)&&a(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),j&&a(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),j=S,u=n==="seq-item-ind"||n==="explicit-key-ind",h=!1;break;case"comma":if(t){f&&a(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),f=S,u=!1,h=!1;break}default:a(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,h=!1}const C=e[e.length-1],N=C?C.offset+C.source.length:r;return b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:f,found:j,spaceBefore:l,comment:d,hasNewline:x,anchor:w,tag:m,newlineAfterProp:y,end:N,start:k??N}}function Sr(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
129
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Sr(t.key)||Sr(t.value))return!0}return!1;default:return!0}}function xl(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&Sr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Ip(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(a,o)=>a===o||ee(a)&&ee(o)&&a.value===o.value;return t.some(a=>r(a.key,n))}const id="All mapping items must start at the same column";function Mx({composeNode:e,composeEmptyNode:t},n,s,r,a){var h;const o=(a==null?void 0:a.nodeClass)??Je,c=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,u=null;for(const d of s.items){const{start:p,key:x,sep:b,value:g}=d,w=ms(p,{indicator:"explicit-key-ind",next:x??(b==null?void 0:b[0]),offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),m=!w.found;if(m){if(x&&(x.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==s.indent&&r(l,"BAD_INDENT",id)),!w.anchor&&!w.tag&&!b){u=w.end,w.comment&&(c.comment?c.comment+=`
130
+ `+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||Sr(x))&&r(x??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((h=w.found)==null?void 0:h.indent)!==s.indent&&r(l,"BAD_INDENT",id);n.atKey=!0;const y=w.end,f=x?e(n,x,w,r):t(n,y,p,null,w,r);n.schema.compat&&xl(s.indent,x,r),n.atKey=!1,Ip(n,c.items,f)&&r(y,"DUPLICATE_KEY","Map keys must be unique");const j=ms(b??[],{indicator:"map-value-ind",next:g,offset:f.range[2],onError:r,parentIndent:s.indent,startOnNewline:!x||x.type==="block-scalar"});if(l=j.end,j.found){m&&((g==null?void 0:g.type)==="block-map"&&!j.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<j.found.offset-1024&&r(f.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,j,r):t(n,l,b,null,j,r);n.schema.compat&&xl(s.indent,g,r),l=k.range[2];const C=new Oe(f,k);n.options.keepSourceTokens&&(C.srcToken=d),c.items.push(C)}else{m&&r(f.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&(f.comment?f.comment+=`
131
+ `+j.comment:f.comment=j.comment);const k=new Oe(f);n.options.keepSourceTokens&&(k.srcToken=d),c.items.push(k)}}return u&&u<l&&r(u,"IMPOSSIBLE","Map comment with trailing content"),c.range=[s.offset,l,u??l],c}function $x({composeNode:e,composeEmptyNode:t},n,s,r,a){const o=(a==null?void 0:a.nodeClass)??Cn,c=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,u=null;for(const{start:h,value:d}of s.items){const p=ms(h,{indicator:"seq-item-ind",next:d,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)(d==null?void 0:d.type)==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{u=p.end,p.comment&&(c.comment=p.comment);continue}const x=d?e(n,d,p,r):t(n,p.end,h,null,p,r);n.schema.compat&&xl(s.indent,d,r),l=x.range[2],c.items.push(x)}return c.range=[s.offset,l,u??l],c}function Dr(e,t,n,s){let r="";if(e){let a=!1,o="";for(const c of e){const{source:l,type:u}=c;switch(u){case"space":a=!0;break;case"comment":{n&&!a&&s(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=l.substring(1)||" ";r?r+=o+h:r=h,o="";break}case"newline":r&&(o+=l),a=!0;break;default:s(c,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=l.length}}return{comment:r,offset:t}}const oo="Block collections are not allowed within flow collections",lo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Dx({composeNode:e,composeEmptyNode:t},n,s,r,a){var w;const o=s.start.source==="{",c=o?"flow map":"flow sequence",l=(a==null?void 0:a.nodeClass)??(o?Je:Cn),u=new l(n.schema);u.flow=!0;const h=n.atRoot;h&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){const y=s.items[m],{start:f,key:j,sep:k,value:C}=y,N=ms(f,{flow:c,indicator:"explicit-key-ind",next:j??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!C){m===0&&N.comma?r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):m<s.items.length-1&&r(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),N.comment&&(u.comment?u.comment+=`
132
+ `+N.comment:u.comment=N.comment),d=N.end;continue}!o&&n.options.strict&&Sr(j)&&r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)N.comma&&r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(N.comma||r(N.start,"MISSING_CHAR",`Missing , between ${c} items`),N.comment){let S="";e:for(const E of f)switch(E.type){case"comma":case"space":break;case"comment":S=E.source.substring(1);break e;default:break e}if(S){let E=u.items[u.items.length-1];he(E)&&(E=E.value??E.key),E.comment?E.comment+=`
133
+ `+S:E.comment=S,N.comment=N.comment.substring(S.length+1)}}if(!o&&!k&&!N.found){const S=C?e(n,C,N,r):t(n,N.end,k,null,N,r);u.items.push(S),d=S.range[2],lo(C)&&r(S.range,"BLOCK_IN_FLOW",oo)}else{n.atKey=!0;const S=N.end,E=j?e(n,j,N,r):t(n,S,f,null,N,r);lo(j)&&r(E.range,"BLOCK_IN_FLOW",oo),n.atKey=!1;const A=ms(k??[],{flow:c,indicator:"map-value-ind",next:C,offset:E.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!o&&!N.found&&n.options.strict){if(k)for(const G of k){if(G===A.found)break;if(G.type==="newline"){r(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&((w=C.source)==null?void 0:w[0])===":"?r(C,"MISSING_CHAR",`Missing space after : in ${c}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=C?e(n,C,A,r):A.found?t(n,A.end,k,null,A,r):null;F?lo(C)&&r(F.range,"BLOCK_IN_FLOW",oo):A.comment&&(E.comment?E.comment+=`
134
+ `+A.comment:E.comment=A.comment);const V=new Oe(E,F);if(n.options.keepSourceTokens&&(V.srcToken=y),o){const G=u;Ip(n,G.items,E)&&r(S,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(V)}else{const G=new Je(n.schema);G.flow=!0,G.items.push(V);const T=(F??E).range;G.range=[E.range[0],T[1],T[2]],u.items.push(G)}d=F?F.range[2]:A.end}}const p=o?"}":"]",[x,...b]=s.end;let g=d;if((x==null?void 0:x.source)===p)g=x.offset+x.source.length;else{const m=c[0].toUpperCase()+c.substring(1),y=h?`${m} must end with a ${p}`:`${m} in block collection must be sufficiently indented and end with a ${p}`;r(d,h?"MISSING_CHAR":"BAD_INDENT",y),x&&x.source.length!==1&&b.unshift(x)}if(b.length>0){const m=Dr(b,g,n.options.strict,r);m.comment&&(u.comment?u.comment+=`
135
+ `+m.comment:u.comment=m.comment),u.range=[s.offset,g,m.offset]}else u.range=[s.offset,g,g];return u}function co(e,t,n,s,r,a){const o=n.type==="block-map"?Mx(e,t,n,s,a):n.type==="block-seq"?$x(e,t,n,s,a):Dx(e,t,n,s,a),c=o.constructor;return r==="!"||r===c.tagName?(o.tag=c.tagName,o):(r&&(o.tag=r),o)}function Rx(e,t,n,s,r){var p;const a=s.tag,o=a?t.directives.tagName(a.source,x=>r(a,"TAG_RESOLVE_FAILED",x)):null;if(n.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=s,g=x&&a?x.offset>a.offset?x:a:x??a;g&&(!b||b.offset<g.offset)&&r(g,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Je.tagName&&c==="map"||o===Cn.tagName&&c==="seq")return co(e,t,n,r,o);let l=t.schema.tags.find(x=>x.tag===o&&x.collection===c);if(!l){const x=t.schema.knownTags[o];if((x==null?void 0:x.collection)===c)t.schema.tags.push(Object.assign({},x,{default:!1})),l=x;else return x?r(a,"BAD_COLLECTION_TYPE",`${x.tag} used for ${c} collection, but expects ${x.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),co(e,t,n,r,o)}const u=co(e,t,n,r,o,l),h=((p=l.resolve)==null?void 0:p.call(l,u,x=>r(a,"TAG_RESOLVE_FAILED",x),t.options))??u,d=fe(h)?h:new U(h);return d.range=u.range,d.tag=o,l!=null&&l.format&&(d.format=l.format),d}function zx(e,t,n){const s=t.offset,r=Fx(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const a=r.mode===">"?U.BLOCK_FOLDED:U.BLOCK_LITERAL,o=t.source?Bx(t.source):[];let c=o.length;for(let g=o.length-1;g>=0;--g){const w=o[g][1];if(w===""||w==="\r")c=g;else break}if(c===0){const g=r.chomp==="+"&&o.length>0?`
136
+ `.repeat(Math.max(1,o.length-1)):"";let w=s+r.length;return t.source&&(w+=t.source.length),{value:g,type:a,comment:r.comment,range:[s,w,w]}}let l=t.indent+r.indent,u=t.offset+r.length,h=0;for(let g=0;g<c;++g){const[w,m]=o[g];if(m===""||m==="\r")r.indent===0&&w.length>l&&(l=w.length);else{w.length<l&&n(u+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=w.length),h=g,l===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=w.length+m.length+1}for(let g=o.length-1;g>=c;--g)o[g][0].length>l&&(c=g+1);let d="",p="",x=!1;for(let g=0;g<h;++g)d+=o[g][0].slice(l)+`
137
+ `;for(let g=h;g<c;++g){let[w,m]=o[g];u+=w.length+m.length+1;const y=m[m.length-1]==="\r";if(y&&(m=m.slice(0,-1)),m&&w.length<l){const j=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-m.length-(y?2:1),"BAD_INDENT",j),w=""}a===U.BLOCK_LITERAL?(d+=p+w.slice(l)+m,p=`
138
+ `):w.length>l||m[0]===" "?(p===" "?p=`
139
+ `:!x&&p===`
140
+ `&&(p=`
141
+
142
+ `),d+=p+w.slice(l)+m,p=`
143
+ `,x=!0):m===""?p===`
144
+ `?d+=`
145
+ `:p=`
146
+ `:(d+=p+m,p=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let g=c;g<o.length;++g)d+=`
147
+ `+o[g][0].slice(l);d[d.length-1]!==`
148
+ `&&(d+=`
149
+ `);break;default:d+=`
150
+ `}const b=s+r.length+t.source.length;return{value:d,type:a,comment:r.comment,range:[s,b,b]}}function Fx({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],a=r[0];let o=0,c="",l=-1;for(let p=1;p<r.length;++p){const x=r[p];if(!c&&(x==="-"||x==="+"))c=x;else{const b=Number(x);!o&&b?o=b:l===-1&&(l=e+p)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,h="",d=r.length;for(let p=1;p<t.length;++p){const x=t[p];switch(x.type){case"space":u=!0;case"newline":d+=x.source.length;break;case"comment":n&&!u&&s(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=x.source.length,h=x.source.substring(1);break;case"error":s(x,"UNEXPECTED_TOKEN",x.message),d+=x.source.length;break;default:{const b=`Unexpected token in block scalar header: ${x.type}`;s(x,"UNEXPECTED_TOKEN",b);const g=x.source;g&&typeof g=="string"&&(d+=g.length)}}}return{mode:a,indent:o,chomp:c,comment:h,length:d}}function Bx(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),a=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function Ux(e,t,n){const{offset:s,type:r,source:a,end:o}=e;let c,l;const u=(p,x,b)=>n(s+p,x,b);switch(r){case"scalar":c=U.PLAIN,l=Wx(a,u);break;case"single-quoted-scalar":c=U.QUOTE_SINGLE,l=Hx(a,u);break;case"double-quoted-scalar":c=U.QUOTE_DOUBLE,l=Vx(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const h=s+a.length,d=Dr(o,h,t,n);return{value:l,type:c,comment:d.comment,range:[s,h,d.offset]}}function Wx(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_p(e)}function Hx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),_p(e.slice(1,-1)).replace(/''/g,"'")}function _p(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
151
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
152
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?a===`
153
+ `?r+=a:a=`
154
+ `:(r+=a+s[1],a=" "),o=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=o,s=c.exec(e),r+a+((s==null?void 0:s[1])??"")}function Vx(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if(!(r==="\r"&&e[s+1]===`
155
+ `))if(r===`
156
+ `){const{fold:a,offset:o}=Kx(e,s);n+=a,s=o}else if(r==="\\"){let a=e[++s];const o=Gx[a];if(o)n+=o;else if(a===`
157
+ `)for(a=e[s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="\r"&&e[s+1]===`
158
+ `)for(a=e[++s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="x"||a==="u"||a==="U"){const c=a==="x"?2:a==="u"?4:8;n+=qx(e,s+1,c,t),s+=c}else{const c=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(r===" "||r===" "){const a=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
159
+ `&&!(o==="\r"&&e[s+2]===`
160
+ `)&&(n+=s>a?e.slice(a,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Kx(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
161
+ `||s==="\r")&&!(s==="\r"&&e[t+2]!==`
162
+ `);)s===`
163
+ `&&(n+=`
164
+ `),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Gx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function qx(e,t,n,s){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const c=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}}function Mp(e,t,n,s){const{value:r,type:a,comment:o,range:c}=t.type==="block-scalar"?zx(e,t,s):Ux(t,e.options.strict,s),l=n?e.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[kt]:l?u=Yx(e.schema,r,l,n,s):t.type==="scalar"?u=Qx(e,r,t,s):u=e.schema[kt];let h;try{const d=u.resolve(r,p=>s(n??t,"TAG_RESOLVE_FAILED",p),e.options);h=ee(d)?d:new U(d)}catch(d){const p=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",p),h=new U(r)}return h.range=c,h.source=r,a&&(h.type=a),l&&(h.tag=l),u.format&&(h.format=u.format),o&&(h.comment=o),h}function Yx(e,t,n,s,r){var c;if(n==="!")return e[kt];const a=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)a.push(l);else return l;for(const l of a)if((c=l.test)!=null&&c.test(t))return l;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[kt])}function Qx({atKey:e,directives:t,schema:n},s,r,a){const o=n.tags.find(c=>{var l;return(c.default===!0||e&&c.default==="key")&&((l=c.test)==null?void 0:l.test(s))})||n[kt];if(n.compat){const c=n.compat.find(l=>{var u;return l.default&&((u=l.test)==null?void 0:u.test(s))})??n[kt];if(o.tag!==c.tag){const l=t.tagString(o.tag),u=t.tagString(c.tag),h=`Value may be parsed as either ${l} or ${u}`;a(r,"TAG_RESOLVE_FAILED",h,!0)}}return o}function Jx(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++s];break}}return e}const Xx={composeNode:$p,composeEmptyNode:Ic};function $p(e,t,n,s){const r=e.atKey,{spaceBefore:a,comment:o,anchor:c,tag:l}=n;let u,h=!0;switch(t.type){case"alias":u=Zx(e,t,s),(c||l)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Mp(e,t,l,s),c&&(u.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Rx(Xx,e,t,n,s),c&&(u.anchor=c.source.substring(1))}catch(d){const p=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",p)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),h=!1}}return u??(u=Ic(e,t.offset,void 0,null,n,s)),c&&u.anchor===""&&s(c,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ee(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&h&&(u.srcToken=t),u}function Ic(e,t,n,s,{spaceBefore:r,comment:a,anchor:o,tag:c,end:l},u){const h={type:"scalar",offset:Jx(t,n,s),indent:-1,source:""},d=Mp(e,h,c,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=l),d}function Zx({options:e},{offset:t,source:n,end:s},r){const a=new wc(n.substring(1));a.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,c=Dr(s,o,e.strict,r);return a.range=[t,o,c.offset],c.comment&&(a.comment=c.comment),a}function e1(e,t,{offset:n,start:s,value:r,end:a},o){const c=Object.assign({_directives:t},e),l=new $r(void 0,c),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=ms(s,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?$p(u,r,h,o):Ic(u,h.end,s,null,h,o);const d=l.contents.range[2],p=Dr(a,d,!1,o);return p.comment&&(l.comment=p.comment),l.range=[n,d,p.offset],l}function $s(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function ad(e){var r;let t="",n=!1,s=!1;for(let a=0;a<e.length;++a){const o=e[a];switch(o[0]){case"#":t+=(t===""?"":s?`
166
+
167
+ `:`
168
+ `)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[a+1])==null?void 0:r[0])!=="#"&&(a+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class t1{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,a)=>{const o=$s(n);a?this.warnings.push(new _x(o,s,r)):this.errors.push(new Ks(o,s,r))},this.directives=new Le({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=ad(this.prelude);if(s){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
169
+ ${s}`:s;else if(r||t.directives.docStart||!a)t.commentBefore=s;else if(de(a)&&!a.flow&&a.items.length>0){let o=a.items[0];he(o)&&(o=o.key);const c=o.commentBefore;o.commentBefore=c?`${s}
170
+ ${c}`:s}else{const o=a.commentBefore;a.commentBefore=o?`${s}
171
+ ${o}`:s}}if(n){for(let a=0;a<this.errors.length;++a)t.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)t.warnings.push(this.warnings[a])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:ad(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(const r of t)yield*this.next(r);yield*this.end(n,s)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,s,r)=>{const a=$s(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=e1(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Ks($s(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Ks($s(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Dr(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
172
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ks($s(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),r=new $r(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}const Dp="\uFEFF",Rp="",zp="",vl="";function n1(e){switch(e){case Dp:return"byte-order-mark";case Rp:return"doc-mode";case zp:return"flow-error-end";case vl:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
173
+ `:case`\r
174
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function at(e){switch(e){case void 0:case" ":case`
175
+ `:case"\r":case" ":return!0;default:return!1}}const od=new Set("0123456789ABCDEFabcdef"),s1=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ri=new Set(",[]{}"),r1=new Set(` ,[]{}
176
+ \r `),uo=e=>!e||r1.has(e);class i1{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
177
+ `?!0:n==="\r"?this.buffer[t+1]===`
178
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const r=this.buffer[s+t+1];if(r===`
179
+ `||!r&&!this.atEnd)return t+s+1}return n===`
180
+ `||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&at(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
181
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Dp&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const a=t[s-1];if(a===" "||a===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield Rp,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&at(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!at(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&at(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(uo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&at(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield zp,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(uo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||at(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let r=s.indexOf(`
182
+ `,this.pos);if(r!==-1){for(;r!==-1;){const a=this.continueScalar(r+1);if(a===-1)break;r=s.indexOf(`
183
+ `,a)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>at(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":n+=1;break;case`
184
+ `:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
185
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
186
+ `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
187
+ `;)s=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const c=a;for(;o===" ";)o=this.buffer[--a];if(o===`
188
+ `&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield vl,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){const a=this.buffer[s+1];if(at(a)||t&&ri.has(a))break;n=s}else if(at(r)){let a=this.buffer[s+1];if(r==="\r"&&(a===`
189
+ `?(s+=1,r=`
190
+ `,a=this.buffer[s+1]):n=s),a==="#"||t&&ri.has(a))break;if(r===`
191
+ `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&ri.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield vl,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(uo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(at(s)||n&&ri.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!at(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(s1.has(n))n=this.buffer[++t];else if(n==="%"&&od.has(this.buffer[t+1])&&od.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
192
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
193
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class a1{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const a=n+s>>1;this.lineStarts[a]<t?n=a+1:s=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}}function Ft(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ld(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Fp(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ii(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function In(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function ea(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function cd(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ft(t.start,"explicit-key-ind")&&!Ft(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Fp(t.value)?t.value.end?ea(t.value.end,t.sep):t.value.end=t.sep:ea(t.start,t.sep),delete t.sep)}class o1{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new i1,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=n1(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&cd(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&ld(r.start)===-1&&(n.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{ld(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=ii(this.peek(2)),s=In(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
194
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
195
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){ea(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,a=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(a&&n.sep&&!n.value){const c=[];for(let l=0;l<n.sep.length;++l){const u=n.sep[l];switch(u.type){case"newline":c.push(l);break;case"space":break;case"comment":u.indent>t.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(o=n.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ft(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Fp(n.key)&&!Ft(n.sep,"newline")){const c=In(n.start),l=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ft(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const c=In(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ft(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:c,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(c):(Object.assign(n,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(t);if(c){if(c.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ft(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){ea(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ft(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=ii(s),a=In(r);cd(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
196
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
197
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=ii(t),s=In(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=ii(t),s=In(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function l1(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new a1||null,prettyErrors:t}}function c1(e,t={}){const{lineCounter:n,prettyErrors:s}=l1(t),r=new o1(n==null?void 0:n.addNewLine),a=new t1(t);let o=null;for(const c of a.compose(r.parse(e),!0,e.length))if(!o)o=c;else if(o.options.logLevel!=="silent"){o.errors.push(new Ks(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(rd(e,n)),o.warnings.forEach(rd(e,n))),o}function u1(e,t,n){let s;const r=c1(e,n);if(!r)return null;if(r.warnings.forEach(a=>fp(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function d1(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return Or(e)&&!s?e.toString(n):new $r(e,s,n).toString(n)}const f1=new Set(["daemon.host","daemon.port","app.port"]),h1=["js_evaluate","cookie_write"];function ud(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},a=e.output??{},o=e.app??{};return{daemon:{host:String(t.host??"127.0.0.1"),port:Number(t.port??9091)},security:{extensionId:String(n.extensionId??""),highRiskCapabilities:n.highRiskCapabilities??[...h1],approvedHighRisk:n.approvedHighRisk??[],approvalRequired:n.approvalRequired??[],autoApproveConnectors:n.autoApproveConnectors??[],approvalTimeoutMs:Number(n.approvalTimeoutMs??12e4)},connectors:{paths:s.paths??["./connectors","~/.commandgarden/connectors"]},audit:{retentionDays:Number(r.retentionDays??90),dbPath:String(r.dbPath??"~/.commandgarden/audit.db")},output:{defaultFormat:String(a.defaultFormat??"table")},app:{port:Number(o.port??9092)}}}function p1(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function m1(){const[e,t]=v.useState(null),[n,s]=v.useState(null),[r,a]=v.useState([]),[o,c]=v.useState(!0),[l,u]=v.useState(!1),[h,d]=v.useState(null),[p,x]=v.useState(!1),[b,g]=v.useState(""),[w,m]=v.useState(!1),[y,f]=v.useState("");v.useEffect(()=>{Promise.all([B.getConfig(),B.getConnectors()]).then(([T,$])=>{const O=ud(T.config);t(O),s(structuredClone(O)),a($.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>c(!1))},[]);const j=v.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=v.useMemo(()=>{if(!e||!n)return 0;let T=0;for(const $ of Object.keys(n)){const O=e[$],R=n[$];for(const L of Object.keys(R))JSON.stringify(O[L])!==JSON.stringify(R[L])&&T++}return T},[e,n]),C=v.useCallback(async()=>{if(!e||!n)return;if(!n.daemon.host.trim()){d({type:"error",msg:"Daemon host cannot be empty."});return}u(!0),d(null);let T=!1;try{for(const $ of Object.keys(n)){const O=e[$],R=n[$];for(const L of Object.keys(R)){const _=JSON.stringify(R[L]),D=JSON.stringify(O[L]??null);if(_!==D){const z=`${$}.${L}`,X=R[L];let ye;z==="security.approvalTimeoutMs"?ye=String(X):Array.isArray(X)?ye=JSON.stringify(X):ye=String(X),await B.setConfig(z,ye),f1.has(z)&&(T=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),T&&x(!0)}catch($){d({type:"error",msg:$ instanceof Error?$.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),N=v.useCallback(()=>{e&&s(structuredClone(e))},[e]),S=v.useCallback(()=>{!w&&n&&(g(d1(p1(n))),f("")),m(!w)},[w,n]),E=v.useCallback(()=>{try{const T=u1(b);if(!T||typeof T!="object")throw new Error("Invalid YAML");s(ud(T)),f("")}catch(T){f(T instanceof Error?T.message:"Invalid YAML")}},[b]),A=v.useCallback((T,$,O)=>{s(R=>R&&{...R,[T]:{...R[T],[$]:O}})},[]),F=v.useCallback((T,$,O)=>{s(R=>{if(!R)return R;const L=R[T],_=L[$]??[];return _.includes(O)?R:{...R,[T]:{...L,[$]:[..._,O]}}})},[]),V=v.useCallback((T,$,O)=>{s(R=>{if(!R)return R;const L=R[T],_=L[$]??[];return{...R,[T]:{...L,[$]:_.filter(D=>D!==O)}}})},[]),G=v.useMemo(()=>({updateField:A,addToArray:F,removeFromArray:V}),[A,F,V]);return o?i.jsx(jt,{label:"Loading configuration..."}):!n||!e?i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):i.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),p&&i.jsxs("div",{className:"alert alert-warning mb-6",children:[i.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",i.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>x(!1),children:"Dismiss"})]}),i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:i.jsx(g1,{config:n,actions:G})}),i.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:i.jsx(y1,{config:n,connectors:r,actions:G})}),i.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:i.jsx(x1,{config:n,actions:G})}),i.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:i.jsx(v1,{config:n,actions:G})}),i.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:i.jsx(b1,{config:n,actions:G})}),i.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:i.jsx(w1,{})})]}),i.jsxs("div",{className:"mt-8",children:[i.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:S,children:[w?"▾":"▸"," Raw Configuration (YAML)"]}),w&&i.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[i.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:b,onChange:T=>g(T.target.value)}),y&&i.jsx("p",{className:"text-error text-sm mt-1",children:y}),i.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:E,children:"Apply to form"})]})]}),j&&i.jsxs("div",{className:"fixed bottom-0 left-0 md:left-56 right-0 bg-base-100 border-t border-base-300 px-6 py-3 flex items-center justify-between z-50",children:[i.jsxs("span",{className:"text-sm opacity-60",children:[k," unsaved ",k===1?"change":"changes"]}),i.jsxs("div",{className:"flex items-center gap-3",children:[h&&i.jsx("span",{className:`text-sm ${h.type==="success"?"text-success":"text-error"}`,children:h.msg}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:N,children:"Discard"}),i.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:l,children:l?"Saving...":"Save changes"})]})]})]})}function Cs({title:e,description:t,children:n}){return i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),i.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),i.jsx("div",{className:"space-y-5",children:n})]})}function Re({label:e,help:t,restart:n,children:s}){return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"w-48 shrink-0",children:[i.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&i.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:i.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),i.jsx("div",{className:"flex-1",children:s})]}),i.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function g1({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Cs,{title:"Server",description:"Daemon and app server binding configuration",children:[i.jsx(Re,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",required:!0,value:e.daemon.host,onChange:s=>n("daemon","host",s.target.value)})}),i.jsx(Re,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.daemon.port,onChange:s=>n("daemon","port",Number(s.target.value))})}),i.jsx(Re,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.app.port,onChange:s=>n("app","port",Number(s.target.value))})})]})}function dd({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,a]=v.useState("");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>i.jsxs(H,{size:"sm",className:"gap-1",children:[o,i.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(o),children:"×"})]},o))}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(t(r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),a(""))},children:"Add"})]})]})}function y1({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:a}=n,o=new Set(e.security.highRiskCapabilities),c=v.useMemo(()=>wa(t),[t]);return i.jsxs(Cs,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&i.jsx("div",{className:"overflow-x-auto mb-4",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"Approved"}),i.jsx("th",{children:"Auto-Approve"})]})}),i.jsx("tbody",{children:c.map(([l,u])=>i.jsxs(v.Fragment,{children:[i.jsx("tr",{children:i.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[l,i.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(h=>{const d=h.key.split("/")[1],p=h.capabilities.some(g=>o.has(g)),x=e.security.approvedHighRisk.includes(h.key),b=e.security.autoApproveConnectors.includes(h.key);return i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-sm pl-6",children:d}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-wrap gap-1",children:h.capabilities.map(g=>i.jsx(H,{variant:o.has(g)?"warning":"neutral",size:"xs",children:g},g))})}),i.jsx("td",{children:p?i.jsx(H,{variant:"warning",size:"xs",children:"High"}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:p?i.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:x,onChange:()=>x?a("security","approvedHighRisk",h.key):r("security","approvedHighRisk",h.key)}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:i.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:b,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>b?a("security","autoApproveConnectors",h.key):r("security","autoApproveConnectors",h.key)})})]},h.key)})]},l))})]})}),i.jsx(Re,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:i.jsx(dd,{values:e.security.highRiskCapabilities,onAdd:l=>r("security","highRiskCapabilities",l),onRemove:l=>a("security","highRiskCapabilities",l),placeholder:"Capability name"})}),i.jsx(Re,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:i.jsx(dd,{values:e.security.approvalRequired,onAdd:l=>r("security","approvalRequired",l),onRemove:l=>a("security","approvalRequired",l),placeholder:"Capability name"})}),i.jsx(Re,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:600,value:Math.round(e.security.approvalTimeoutMs/1e3),onChange:l=>s("security","approvalTimeoutMs",Number(l.target.value)*1e3)})}),i.jsx(Re,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"Leave blank for any",value:e.security.extensionId,onChange:l=>s("security","extensionId",l.target.value)})})]})}function x1({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,a]=v.useState("");return i.jsxs(Cs,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[i.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((o,c)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-sm flex-1",children:o}),i.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",o),children:"×"})]},c))}),i.jsxs("div",{className:"flex gap-1 mt-2",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),a(""))},children:"Add path"})]}),i.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",i.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function v1({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Cs,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[i.jsx(Re,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:3650,value:e.audit.retentionDays,onChange:s=>n("audit","retentionDays",Number(s.target.value))})}),i.jsx(Re,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono opacity-60",value:e.audit.dbPath,onChange:s=>n("audit","dbPath",s.target.value)})})]})}function b1({config:e,actions:t}){const{updateField:n}=t;return i.jsx(Cs,{title:"Output Defaults",description:"Default formatting for CLI output",children:i.jsx(Re,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:i.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[i.jsx("option",{value:"table",children:"table"}),i.jsx("option",{value:"json",children:"json"}),i.jsx("option",{value:"csv",children:"csv"})]})})})}function w1(){const[e,t]=v.useState(""),[n,s]=v.useState(""),[r,a]=v.useState(""),[o,c]=v.useState("40"),[l,u]=v.useState(!1),[h,d]=v.useState(!1);v.useEffect(()=>{B.getPreferences().then(x=>{if(!x.ok)return;const b=x.preferences;t(b["journal.author"]??""),s(b["journal.ado_org"]??""),a(b["journal.ado_repos"]??""),c(b["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function p(){await Promise.all([B.setPreference("journal.author",e),B.setPreference("journal.ado_org",n),B.setPreference("journal.ado_repos",r),B.setPreference("journal.target_hours",o)]),d(!0),setTimeout(()=>d(!1),2e3)}return l?i.jsxs(Cs,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[i.jsx(Re,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"your.name@company.com",value:e,onChange:x=>t(x.target.value)})}),i.jsx(Re,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:x=>s(x.target.value)})}),i.jsx(Re,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:x=>a(x.target.value)})}),i.jsx(Re,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:o,onChange:x=>c(x.target.value)})}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:p,children:"Save Journal Settings"}),h&&i.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const j1=i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"w-3.5 h-3.5",children:i.jsx("path",{d:"M20 6 9 17l-5-5"})});function k1(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,a]=v.useState(0),[o,c]=v.useState([]),[l,u]=v.useState([]),[h,d]=v.useState(null),p=v.useCallback(async()=>{try{const k=await B.getStatus();t(k.ok),s(k.extensionConnected),a(k.connectorCount)}catch{t(!1),s(!1),a(0)}try{const k=await B.getConnectors();c(k.connectors);const N=(await B.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(N.approvedHighRisk??[])}catch{}},[]);v.useEffect(()=>{p();const k=setInterval(p,1e4);return()=>clearInterval(k)},[p]);const x=v.useCallback(async k=>{d(k);try{const C=[...l,k];await B.setConfig("security.approvedHighRisk",JSON.stringify(C)),p()}catch{}finally{d(null)}},[l,p]),b=o.filter(k=>k.isHighRisk&&!k.isApproved),g=b.length>0,w=[{id:"daemon",label:"Background service",ok:e,detail:e?"Running":"Not running",instructions:"Run cg up in your terminal to start commandGarden. This launches the background service and opens the web interface."},{id:"extension",label:"Browser extension",ok:n,detail:n?"Connected":"Not connected",instructions:"Install the commandGarden Chrome extension, then open Chrome. The extension connects automatically when the background service is running."},{id:"connectors",label:"Connectors installed",ok:r>0,detail:r>0?`${r} available`:"None found",instructions:"Connectors are loaded automatically when you start the service. If none appear, check that connector files exist in ~/.commandgarden/connectors/ and restart with cg up."}];g&&w.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${b.length} need${b.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const m=w.filter(k=>k.ok).length,y=w.length,f=m===y,j=v.useMemo(()=>wa(o),[o]);return i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:i.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${y>0?m/y*100:0}%`}})}),i.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[m,"/",y]})]}),i.jsx("div",{className:"space-y-3 mb-8",children:w.map((k,C)=>i.jsxs("div",{className:`border ${k.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3",children:[i.jsx("span",{className:`w-5 h-5 flex items-center justify-center font-mono text-xs font-bold shrink-0 ${k.ok?"bg-success text-success-content":"border border-base-300 text-base-content/50"}`,children:k.ok?j1:C+1}),i.jsx("span",{className:"font-semibold flex-1",children:k.label}),i.jsx(H,{variant:k.ok?"success":"warning",children:k.detail})]}),!k.ok&&i.jsxs("div",{className:"px-4 pb-4 text-sm opacity-70 border-t border-base-300/50 pt-3 ml-8",children:[k.instructions,k.id==="permissions"&&b.length>0&&i.jsx("div",{className:"mt-3 space-y-2",children:b.map(N=>i.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-mono text-sm",children:N.key}),N.description&&i.jsx("span",{className:"text-xs opacity-50 ml-2",children:N.description})]}),i.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:h===N.key,onClick:()=>x(N.key),children:h===N.key?"Authorizing…":"Authorize"})]},N.key))})]})]},C))}),f&&o.length>0&&i.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[i.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),i.jsx("div",{className:"space-y-3",children:j.map(([k,C])=>i.jsxs("div",{children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:k}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.map(N=>{const S=N.key.split("/")[1];return i.jsx(je,{to:`/connectors/${k}/${S}`,className:"btn btn-sm btn-outline",children:i.jsx("span",{className:"font-mono",children:S})},N.key)})})]},k))})]}),!f&&o.length>0&&i.jsxs("div",{className:"border-t border-base-300 pt-6",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),i.jsx("div",{className:"space-y-4",children:j.map(([k,C])=>i.jsxs("div",{children:[i.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:k}),i.jsx("div",{className:"space-y-1",children:C.map(N=>{const S=N.key.split("/")[1];return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-sm",children:S}),i.jsx(H,{size:"xs",children:N.access})]}),N.description&&i.jsx("div",{className:"text-xs opacity-40 mb-1",children:N.description})]},N.key)})})]},k))}),i.jsx(je,{to:"/connectors",className:"inline-flex items-center gap-1 font-mono text-xs mt-5 opacity-50 hover:opacity-80 transition-opacity",children:"View all connectors →"})]})]})}function gs({message:e}){return i.jsx("div",{role:"alert",className:"alert alert-warning",children:i.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function Bp(e){const t=e.getDay();return t!==0&&t!==6}function N1(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++)Bp(new Date(t,n-1,a))&&r++;return r}function S1(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),a=new Date(n,s,0),o=r>a?a:r;let c=0;for(let l=1;l<=o.getDate();l++){const u=new Date(n,s-1,l);if(u>o)break;Bp(u)&&c++}return c}function C1(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,a=N1(s),o=S1(s,r),c=a-o,l=t>0?n/t*100:0,u=Math.max(0,(t-n)/8);if(n>=t)return{status:"reached",percentage:l,daysRemaining:0,hoursPerDayNeeded:0,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:c};const h=a>0?t/a*o:0,d=c>0?Math.max(0,(t-n)/c):0;let p;return n>=h?p="on_track":a>0&&o/a<.8?p="behind":p="at_risk",{status:p,percentage:l,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:c}}const E1={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function T1({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return i.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:i.jsx("div",{className:`h-full ${E1[t]} transition-[width] duration-150`,style:{width:`${s}%`}})})}/**
198
+ * @license lucide-react v1.23.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Up=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
203
+ * @license lucide-react v1.23.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const A1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
208
+ * @license lucide-react v1.23.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const L1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
213
+ * @license lucide-react v1.23.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const fd=e=>{const t=L1(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
218
+ * @license lucide-react v1.23.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */var fo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
223
+ * @license lucide-react v1.23.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const P1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},O1=v.createContext({}),I1=()=>v.useContext(O1),_1=v.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:a,iconNode:o,...c},l)=>{const{size:u=24,strokeWidth:h=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:x=""}=I1()??{},b=s??d?Number(n??h)*24/Number(t??u):n??h;return v.createElement("svg",{ref:l,...fo,width:t??u??fo.width,height:t??u??fo.height,stroke:e??p,strokeWidth:b,className:Up("lucide",x,r),...!a&&!P1(c)&&{"aria-hidden":"true"},...c},[...o.map(([g,w])=>v.createElement(g,w)),...Array.isArray(a)?a:[a]])});/**
228
+ * @license lucide-react v1.23.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const W=(e,t)=>{const n=v.forwardRef(({className:s,...r},a)=>v.createElement(_1,{ref:a,iconNode:t,className:Up(`lucide-${A1(fd(e))}`,`lucide-${e}`,s),...r}));return n.displayName=fd(e),n};/**
233
+ * @license lucide-react v1.23.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const M1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qe=W("arrow-right",M1);/**
238
+ * @license lucide-react v1.23.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const $1=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Wp=W("book-open",$1);/**
243
+ * @license lucide-react v1.23.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const D1=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],R1=W("calendar-days",D1);/**
248
+ * @license lucide-react v1.23.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const z1=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],F1=W("calendar-range",z1);/**
253
+ * @license lucide-react v1.23.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const B1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],U1=W("chevron-down",B1);/**
258
+ * @license lucide-react v1.23.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const W1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],H1=W("chevron-left",W1);/**
263
+ * @license lucide-react v1.23.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const V1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],K1=W("chevron-right",V1);/**
268
+ * @license lucide-react v1.23.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const G1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hp=W("circle-alert",G1);/**
273
+ * @license lucide-react v1.23.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const q1=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Y1=W("circle-check-big",q1);/**
278
+ * @license lucide-react v1.23.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const Q1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_c=W("circle-check",Q1);/**
283
+ * @license lucide-react v1.23.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const J1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Vp=W("circle-x",J1);/**
288
+ * @license lucide-react v1.23.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const X1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Pa=W("clock",X1);/**
293
+ * @license lucide-react v1.23.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const Z1=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],ev=W("code-xml",Z1);/**
298
+ * @license lucide-react v1.23.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const tv=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],hd=W("database",tv);/**
303
+ * @license lucide-react v1.23.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const nv=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],Kp=W("door-open",nv);/**
308
+ * @license lucide-react v1.23.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const sv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Gp=W("eye",sv);/**
313
+ * @license lucide-react v1.23.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const rv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ho=W("file-text",rv);/**
318
+ * @license lucide-react v1.23.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const iv=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],av=W("fingerprint-pattern",iv);/**
323
+ * @license lucide-react v1.23.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const ov=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],lv=W("git-branch",ov);/**
328
+ * @license lucide-react v1.23.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const cv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ai=W("globe",cv);/**
333
+ * @license lucide-react v1.23.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const uv=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],dv=W("graduation-cap",uv);/**
338
+ * @license lucide-react v1.23.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const fv=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],hv=W("key-round",fv);/**
343
+ * @license lucide-react v1.23.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const pv=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],mv=W("layers",pv);/**
348
+ * @license lucide-react v1.23.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const gv=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],yv=W("layout-dashboard",gv);/**
353
+ * @license lucide-react v1.23.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const xv=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],vv=W("library",xv);/**
358
+ * @license lucide-react v1.23.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const bv=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],wv=W("lightbulb",bv);/**
363
+ * @license lucide-react v1.23.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const jv=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],qp=W("lock",jv);/**
368
+ * @license lucide-react v1.23.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const kv=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Nv=W("network",kv);/**
373
+ * @license lucide-react v1.23.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const Sv=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],Yp=W("newspaper",Sv);/**
378
+ * @license lucide-react v1.23.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const Cv=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],Ev=W("notebook-pen",Cv);/**
383
+ * @license lucide-react v1.23.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const Tv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Av=W("panels-top-left",Tv);/**
388
+ * @license lucide-react v1.23.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const Lv=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Pv=W("plug",Lv);/**
393
+ * @license lucide-react v1.23.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const Ov=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Qp=W("scroll-text",Ov);/**
398
+ * @license lucide-react v1.23.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const Iv=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],bl=W("server",Iv);/**
403
+ * @license lucide-react v1.23.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const _v=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mv=W("settings",_v);/**
408
+ * @license lucide-react v1.23.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const $v=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Dv=W("shield-alert",$v);/**
413
+ * @license lucide-react v1.23.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const Rv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Jp=W("shield-check",Rv);/**
418
+ * @license lucide-react v1.23.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const zv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Fv=W("shield",zv);/**
423
+ * @license lucide-react v1.23.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const Bv=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],wl=W("sparkles",Bv);/**
428
+ * @license lucide-react v1.23.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const Uv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Si=W("terminal",Uv);/**
433
+ * @license lucide-react v1.23.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const Wv=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]],Hv=W("ticket",Wv);/**
438
+ * @license lucide-react v1.23.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const Vv=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Kv=W("trending-up",Vv);/**
443
+ * @license lucide-react v1.23.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const Gv=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],qv=W("triangle-alert",Gv),Yv={reached:Y1,on_track:Kv,behind:Pa,at_risk:qv},Qv={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},Jv={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function Xv(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function Zv({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:a}){return e.length===0?null:i.jsx("div",{className:"border border-base-300",children:e.map((o,c)=>{const l=Xv(o.projectId,o.activity,t),u=C1({targetHours:o.targetHours,actualHours:l,month:r,today:a}),h=n.get(o.projectId),d=Yv[u.status];return i.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${Jv[u.status]} ${c>0?"border-t border-base-300":""}`,children:[i.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:i.jsx(d,{size:18,className:Qv[u.status]})}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-display font-semibold text-sm",children:h??o.projectId}),i.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[h?`${o.projectId} · `:"",s.get(`${o.projectId}\0${o.activity}`)??o.activity]})]}),i.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[i.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(l*10)/10,"/",o.targetHours,"h"]}),i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[o.targetDays,"d target"]})]}),i.jsxs("div",{className:"p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(T1,{percentage:u.percentage,status:u.status,className:"flex-1"}),i.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:u.workingDaysRemaining>0?`Book ${Math.round(u.hoursPerDayNeeded*10)/10}h/day · ${u.workingDaysRemaining} days left`:`${Math.round(u.daysRemaining*10)/10} days remaining`})]})]},o.id)})})}function eb({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:a,onRefreshProjects:o,refreshingProjects:c}){const[l,u]=v.useState(""),[h,d]=v.useState(""),[p,x]=v.useState(null),[b,g]=v.useState(""),[w,m]=v.useState(!1),y=v.useMemo(()=>{const E=new Set(e.map(A=>`${A.projectId}\0${A.activity}`));return s.filter(A=>!E.has(`${A.projectId}\0${A.activity}`))},[s,e]);function f(E){const A=E.indexOf("\0");return A<0?null:{projectId:E.slice(0,A),activity:E.slice(A+1)}}function j(E){return r.get(E)??E}function k(E,A){const F=a.get(`${E}\0${A}`);return F?`${j(E)} / ${F}`:`${j(E)} / ${A}`}async function C(){const E=f(l),A=parseFloat(h);if(!(!E||isNaN(A)||A<.5||A>31)){m(!0);try{await B.upsertGoal({month:t,projectId:E.projectId,activity:E.activity,targetDays:A}),u(""),d(""),n()}finally{m(!1)}}}async function N(E){m(!0);try{await B.deleteGoal(E),n()}finally{m(!1)}}async function S(E){const A=parseFloat(b);if(isNaN(A)||A<.5||A>31){x(null);return}m(!0);try{await B.upsertGoal({month:E.month,projectId:E.projectId,activity:E.activity,targetDays:A}),x(null),n()}finally{m(!1)}}return i.jsxs("details",{children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),i.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Target (days)"}),i.jsx("th",{className:"text-right",children:"Target (hours)"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:e.map(E=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:j(E.projectId)}),r.has(E.projectId)&&i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}),i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:a.get(`${E.projectId}\0${E.activity}`)??E.activity}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.activity})]}),i.jsx("td",{className:"text-right",children:p===E.id?i.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:b,onChange:A=>g(A.target.value),onBlur:()=>S(E),onKeyDown:A=>{A.key==="Enter"&&S(E),A.key==="Escape"&&x(null)},autoFocus:!0}):E.targetDays}),i.jsx("td",{className:"text-right",children:E.targetHours}),i.jsxs("td",{className:"flex gap-1",children:[i.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{x(E.id),g(String(E.targetDays))},disabled:w,"aria-label":`Edit goal ${E.projectId} ${E.activity}`,children:"Edit"}),i.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>N(E.id),disabled:w,"aria-label":`Delete goal ${E.projectId} ${E.activity}`,children:"Del"})]})]},E.id))})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("select",{className:"select select-bordered select-sm",value:l,onChange:E=>u(E.target.value),children:[i.jsx("option",{value:"",children:"Select project / activity…"}),y.map(E=>i.jsx("option",{value:`${E.projectId}\0${E.activity}`,children:k(E.projectId,E.activity)},`${E.projectId}\0${E.activity}`))]}),i.jsx("input",{type:"number",step:"0.5",min:"0.5",max:"31",placeholder:"Days",className:"input input-bordered input-sm w-24",value:h,onChange:E=>d(E.target.value)}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:w||!l,children:"Add"}),i.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:c,children:c?"Refreshing…":"Refresh projects"})]})]})]})}function tb(e,t){var G;const[n,s]=v.useState([]),[r,a]=v.useState([]),[o,c]=v.useState(null),[l,u]=v.useState([]),h=v.useRef(l);h.current=l;const[d,p]=v.useState(!1),x=v.useCallback(async()=>{try{const T=await B.getGoals(e);s(T.goals)}catch{}},[e]),b=v.useCallback(async()=>{try{const T=await B.getCachedReport(e);T.data?(a(T.data),c(T.fetchedAt)):(a([]),c(null))}catch{}},[e]),g=v.useCallback(async()=>{try{const T=await B.getCachedProjects();T.data&&u(T.data)}catch{}},[]),w=v.useCallback(async()=>{p(!0);try{const T=await B.run("timetracking/projects",{month:e});if(T.ok&&T.data&&T.data.length>0){const $=T.data.map(O=>({projectId:String(O.projectId??""),projectName:String(O.projectName??""),activityNumber:String(O.activityNumber??""),activityName:String(O.activityName??""),category:String(O.category??""),linePropertyId:String(O.linePropertyId??"")}));u($),await B.cacheProjects($)}}catch{}p(!1)},[e]);v.useEffect(()=>{x(),b(),g()},[x,b,g]);const m=t==null?void 0:t.data;v.useEffect(()=>{if(m&&m.length>0){c(null),B.cacheReport(e,m).catch(()=>{});const T=new Set,$=[];for(const O of m){const R=String(O.projectId??""),L=String(O.activity??"");if(!R||!L)continue;const _=`${R}\0${L}`;T.has(_)||(T.add(_),$.push({projectId:R,projectName:O.projectName?String(O.projectName):R,activityNumber:L,activityName:O.activityName?String(O.activityName):L,category:String(O.category??""),linePropertyId:""}))}if($.length>0){const O=new Map;for(const L of h.current)O.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of $)O.set(`${L.projectId}\0${L.activityNumber}`,L);const R=Array.from(O.values());u(R),B.cacheProjects(R).catch(()=>{})}}},[m,e]);const y=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,f=y===r&&r.length>0&&!((G=t==null?void 0:t.data)!=null&&G.length),{projectNames:j,activityNames:k}=v.useMemo(()=>{const T=new Map,$=new Map;for(const O of l)O.projectId&&O.projectName&&T.set(O.projectId,O.projectName),O.projectId&&O.activityNumber&&O.activityName&&$.set(`${O.projectId}\0${O.activityNumber}`,O.activityName);for(const O of y){const R=String(O.projectId??""),L=O.projectName?String(O.projectName):null;R&&L&&T.set(R,L);const _=String(O.activity??""),D=O.activityName?String(O.activityName):null;R&&_&&D&&$.set(`${R}\0${_}`,D)}return{projectNames:T,activityNames:$}},[l,y]),{projectList:C,totalHours:N,draftCount:S,workingDayCount:E}=v.useMemo(()=>{const T=new Map;let $=0,O=0;const R=new Set;for(const L of y){const _=String(L.projectId??"Unknown"),D=Number(L.hours??0),z=String(L.date??""),X=String(L.status??""),ye=String(L.activity??"");$+=D,z&&R.add(z),X==="draft"&&O++,T.has(_)||T.set(_,{projectId:_,totalHours:0,entryCount:0,activities:new Set});const Me=T.get(_);if(Me.totalHours+=D,Me.entryCount++,ye){const cn=k.get(`${_}\0${ye}`)??ye;Me.activities.add(cn)}}return{projectList:Array.from(T.values()).sort((L,_)=>_.totalHours-L.totalHours),totalHours:$,draftCount:O,workingDayCount:R.size}},[y,k]),A=v.useMemo(()=>{const T=new Map;for(const $ of y){const O=String($.projectId??"Unknown"),R=String($.activity??""),L=Number($.hours??0),_=`${O}\0${R}`,D=T.get(_);D?D.totalHours+=L:T.set(_,{projectId:O,activity:R,totalHours:L})}return Array.from(T.values())},[y]),F=v.useMemo(()=>l.length>0?l.map(T=>({projectId:T.projectId,activity:T.activityNumber})):A.map(T=>({projectId:T.projectId,activity:T.activity})),[l,A]),V=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:x,rows:y,isCached:f,cachedAt:o,projectNames:j,activityNames:k,projectList:C,totalHours:N,draftCount:S,workingDayCount:E,activityHours:A,allCombos:F,todayStr:V,refreshProjects:w,refreshingProjects:d}}function nb(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function sb(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function rb(){const[e,t]=v.useState(nb()),[n,s]=v.useState(!1),{running:r,result:a,error:o,approvalPending:c,approvalId:l,run:u,handleApproval:h,reset:d}=ja(),{goals:p,loadGoals:x,rows:b,isCached:g,cachedAt:w,projectNames:m,activityNames:y,projectList:f,totalHours:j,draftCount:k,workingDayCount:C,activityHours:N,allCombos:S,todayStr:E,refreshProjects:A,refreshingProjects:F}=tb(e,a),V=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),G=v.useCallback(async()=>{const T={};e&&(T.month=e),await u("timetracking/report",T),await x()},[e,u,x]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),i.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),i.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:T=>{t(T.target.value),d()},onClick:T=>{var $,O;return(O=($=T.target).showPicker)==null?void 0:O.call($)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:G,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!c&&i.jsx(jt,{label:"Fetching timetracking data..."}),c&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>h(!0),disabled:!l,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>h(!1),disabled:!l,children:"Reject"})]})]}),V&&i.jsx(gs,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!V&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),b.length>0&&i.jsxs(i.Fragment,{children:[g&&w&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",sb(w)]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),i.jsx("div",{className:"font-display text-xl font-bold",children:j.toFixed(1)})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:C})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),i.jsx("div",{className:"font-display text-xl font-bold",children:f.length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),i.jsx("div",{className:"font-display text-xl font-bold",children:k})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activities"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{className:"text-right",children:"Entries"})]})}),i.jsx("tbody",{children:f.map(T=>i.jsxs("tr",{children:[i.jsx("td",{children:m.has(T.projectId)?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm",children:m.get(T.projectId)}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}):i.jsx("span",{className:"font-mono text-sm",children:T.projectId})}),i.jsx("td",{className:"text-sm",children:Array.from(T.activities).join(", ")}),i.jsx("td",{className:"text-right font-semibold",children:T.totalHours.toFixed(1)}),i.jsx("td",{className:"text-right",children:T.entryCount})]},T.projectId))})]})}),i.jsxs("details",{open:n,onToggle:T=>s(T.target.open),children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",b.length,")"]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:b.map((T,$)=>i.jsxs("tr",{children:[i.jsx("td",{children:String(T.date??"")}),i.jsx("td",{className:"font-mono text-xs",children:String(T.projectId??"")}),i.jsx("td",{children:String(T.activity??"")}),i.jsx("td",{className:"text-right",children:Number(T.hours??0).toFixed(1)}),i.jsx("td",{children:i.jsx(H,{variant:String(T.status)==="posted"?"success":"warning",size:"xs",children:String(T.status??"")})})]},$))})]})})]})]}),a&&(a.data??[]).length===0&&b.length===0&&!o&&i.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),p.length>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),i.jsx(Zv,{goals:p,activityHours:N,projectNames:m,activityNames:y,month:e,today:E})]}),i.jsx("div",{className:"mt-6",children:i.jsx(eb,{goals:p,month:e,onGoalChange:x,knownCombos:S,projectNames:m,activityNames:y,onRefreshProjects:A,refreshingProjects:F})})]})}const Xp={"MBTMY THE BASE CAMP":"res-rere-m6vz23ty@mercedes-benz.com","MBTMY THE TRAILHEAD":"res-rere-m6vc2q4d@mercedes-benz.com","MBTMY THE FOOTHILLS":"res-rere-m6vcb79c@mercedes-benz.com","MBTMY THE BRIDGE":"res-rere-m6vgcah6@mercedes-benz.com","MBTMY THE RIDGE":"res-rere-m6vjxdkc@mercedes-benz.com","MBTMY THE MEADOW":"res-rere-m6vhkzmd@mercedes-benz.com","MBTMY THE FOREST":"res-rere-m6vhsc6h@mercedes-benz.com","MBTMY THE LOOKOUT":"res-rere-m6vjqgrq@mercedes-benz.com","MBTMY THE CLIFFSIDE":"res-rere-m6vjl2tw@mercedes-benz.com","MBTMY THE LEDGE":"res-rere-m6vjfbmr@mercedes-benz.com","MBTMY THE HIGHPOINT":"res-rere-m6vjblgb@mercedes-benz.com","MBTMY THE VISTA":"RES-RERE-M6VJ7ZUW@mercedes-benz.com","MBTMY THE SHOULDER":"res-rere-m6vj3tuq@mercedes-benz.com","MBTMY THE PINNACLE":"res-rere-m6vhxd4c@mercedes-benz.com","MBTMY THE DESCENT":"res-rere-m6vzgysp@mercedes-benz.com"},ib=Object.fromEntries(Object.entries(Xp).map(([e,t])=>[t.toLowerCase(),e.replace(/^MBTMY\s+/i,"").replace(/\b\w+/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())])),pd={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},ab={free:"bg-success/20 border-success/40",busy:"bg-error/20 border-error/40",tentative:"bg-warning/20 border-warning/40",oof:"bg-secondary/20 border-secondary/40",elsewhere:"bg-info/20 border-info/40"},ob={free:"bg-success/35 border-success/60",busy:"bg-error/35 border-error/60",tentative:"bg-warning/35 border-warning/60",oof:"bg-secondary/35 border-secondary/60",elsewhere:"bg-info/35 border-info/60"};function _n(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function lb({rows:e}){var r,a;const[t,n]=v.useState(null),s=e.reduce((o,c)=>o+(c.durationMin??0),0);return i.jsxs("div",{children:[s>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((o,c)=>{const l=s>0?(o.durationMin??0)/s*100:0;if(l<.5)return null;const u=t===c,h=u?ob[o.state??""]??"bg-base-300":ab[o.state??""]??"bg-base-300";return i.jsxs("div",{className:`${h} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${l}%`},onMouseEnter:()=>n(c),onMouseLeave:()=>n(null),children:[l>12&&i.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:o.state}),u&&i.jsxs("div",{className:"absolute -top-9 left-1/2 -translate-x-1/2 bg-base-300 border border-base-content/10 px-2 py-1 text-[0.65rem] font-mono whitespace-nowrap z-10 pointer-events-none",children:[o.state,": ",_n(o.start??""),"–",_n(o.end??"")," (",o.durationMin,"m)"]})]},c)})}),i.jsxs("div",{className:"flex justify-between mt-1",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:_n(((r=e[0])==null?void 0:r.start)??"")}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:_n(((a=e[e.length-1])==null?void 0:a.end)??"")})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Start"}),i.jsx("th",{children:"End"}),i.jsx("th",{children:"State"}),i.jsx("th",{className:"text-right",children:"Duration"})]})}),i.jsx("tbody",{children:e.map((o,c)=>i.jsxs("tr",{className:`transition-colors duration-75 ${t===c?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(c),onMouseLeave:()=>n(null),children:[i.jsx("td",{className:"font-mono text-sm",children:_n(o.start??"")}),i.jsx("td",{className:"font-mono text-sm",children:_n(o.end??"")}),i.jsx("td",{children:i.jsx(H,{variant:pd[o.state??""]??"neutral",children:o.state})}),i.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},c))})]})}),i.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(pd).map(([o,c])=>i.jsx("div",{className:"flex items-center gap-1.5",children:i.jsx(H,{variant:c,size:"xs",children:o})},o))})]})}const cb=[{id:1,name:"The Base Camp",x:685,y:75,w:160,h:85,capacity:10},{id:2,name:"The Trailhead",x:880,y:130,w:95,h:100,capacity:4},{id:3,name:"The Foothills",x:880,y:255,w:95,h:100,capacity:5},{id:4,name:"The Bridge",x:880,y:380,w:95,h:100,capacity:4},{id:5,name:"The Ridge",x:650,y:620,w:250,h:110,capacity:18},{id:6,name:"The Meadow",x:535,y:480,w:92,h:80,capacity:6},{id:7,name:"The Forest",x:428,y:480,w:92,h:80,capacity:16},{id:8,name:"The Lookout",x:540,y:795,w:110,h:75,capacity:4},{id:9,name:"The Cliffside",x:410,y:795,w:110,h:75,capacity:4},{id:10,name:"The Ledge",x:280,y:795,w:110,h:75,capacity:4},{id:11,name:"The Highpoint",x:150,y:795,w:110,h:75,capacity:10},{id:12,name:"The Vista",x:30,y:750,w:100,h:115,capacity:12},{id:13,name:"The Shoulder",x:30,y:620,w:100,h:110,capacity:4},{id:14,name:"The Pinnacle",x:30,y:300,w:120,h:260,capacity:16},{id:15,name:"The Descent",x:30,y:60,w:120,h:170,capacity:6}],ub=[{name:"The Summit",x:170,y:60,w:230,h:500},{name:"The Lodge",x:670,y:60,w:190,h:500},{name:"The Plateau",x:150,y:620,w:470,h:150}],db=[{x:90,y:28,dir:"down"},{x:355,y:28,dir:"down"},{x:765,y:28,dir:"down"},{x:24,y:596,dir:"left"}],fb={free:"fill-success/15 stroke-success",busy:"fill-error/15 stroke-error",unknown:"fill-base-200/60 stroke-base-300"};function oi(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^mbtmy/,"").replace(/^the/,"")}function hb({statuses:e={},selected:t,onSelect:n}){const r=`hatch-${v.useId().replace(/[^a-zA-Z0-9]/g,"")}`,a=new Map(Object.entries(e).map(([l,u])=>[oi(l),u])),o=t?oi(t):null,c=l=>a.get(oi(l.name))??"unknown";return i.jsxs("div",{className:"border border-base-300 p-3 sm:p-4",children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 1000 900",className:"min-w-[560px] w-full h-auto select-none",role:"group","aria-label":"Office floor plan",children:[i.jsx("defs",{children:i.jsx("pattern",{id:r,width:"7",height:"7",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:i.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"7",strokeWidth:"1",className:"stroke-base-300"})})}),i.jsx("rect",{x:"14",y:"40",width:"972",height:"846",className:"fill-base-100 stroke-base-content/60",strokeWidth:"2"}),ub.map(l=>i.jsxs("g",{children:[i.jsx("rect",{x:l.x,y:l.y,width:l.w,height:l.h,className:"fill-base-200/30 stroke-base-300",strokeWidth:"1",strokeDasharray:"4 4"}),i.jsx("text",{x:l.x+l.w/2,y:l.y+l.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",letterSpacing:"2",className:"fill-base-content/25 font-mono uppercase",children:l.name})]},l.name)),i.jsxs("g",{children:[i.jsx("rect",{x:"420",y:"60",width:"232",height:"405",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("rect",{x:"437",y:"192",width:"198",height:"140",className:"fill-base-100 stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"536",y:"255",textAnchor:"middle",fontSize:"12",letterSpacing:"2",className:"fill-base-content/40 font-mono uppercase",children:"Courtyard"}),i.jsx("text",{x:"536",y:"275",textAnchor:"middle",fontSize:"8",letterSpacing:"1.5",className:"fill-base-content/25 font-mono uppercase",children:"Reflective pool"})]}),i.jsx("rect",{x:"680",y:"758",width:"220",height:"112",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"790",y:"818",textAnchor:"middle",fontSize:"9",letterSpacing:"1.5",className:"fill-base-content/30 font-mono uppercase",children:"Facilities"}),db.map((l,u)=>i.jsx("g",{children:l.dir==="left"?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:`M ${l.x} ${l.y-6} L ${l.x} ${l.y+6} L ${l.x-7} ${l.y} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:l.x+10,y:l.y,textAnchor:"start",dominantBaseline:"central",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:`M ${l.x-6} ${l.y} L ${l.x+6} ${l.y} L ${l.x} ${l.y+7} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:l.x,y:l.y-5,textAnchor:"middle",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]})},u)),cb.map(l=>{const u=c(l),h=o!==null&&oi(l.name)===o,d=l.w<100;return i.jsxs("g",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(l.name):void 0,onKeyDown:n?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),n(l.name))}:void 0,className:n?"cursor-pointer hover:opacity-75 focus:outline-none transition-opacity":void 0,children:[i.jsx("title",{children:`${l.name} — ${u==="unknown"?"not checked":u}`}),i.jsx("rect",{x:l.x,y:l.y,width:l.w,height:l.h,strokeWidth:u==="unknown"?1:1.5,className:fb[u]}),h&&i.jsx("rect",{x:l.x+3,y:l.y+3,width:l.w-6,height:l.h-6,className:"fill-none stroke-primary",strokeWidth:"2"}),i.jsx("circle",{cx:l.x+15,cy:l.y+15,r:"9",className:"fill-base-100 stroke-base-content/30",strokeWidth:"1"}),i.jsx("text",{x:l.x+15,y:l.y+15,textAnchor:"middle",dominantBaseline:"central",fontSize:"8.5",className:"fill-base-content/60 font-mono",children:l.id}),i.jsx("text",{x:l.x+l.w/2,y:l.y+l.h/2+(l.h>90?10:8),textAnchor:"middle",fontSize:d?12:13.5,letterSpacing:"0.8",className:"fill-base-content/80 font-mono uppercase font-medium",children:l.name.replace(/^The\s+/i,"")}),i.jsxs("text",{x:l.x+l.w/2,y:l.y+l.h/2+(l.h>90?10:8)+(d?14:16),textAnchor:"middle",fontSize:10.5,letterSpacing:"0.5",className:"fill-base-content/40 font-mono",children:[l.capacity,"p"]})]},l.id)})]})}),i.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 mt-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-70",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-success/15 border border-success"})," Available"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-error/15 border border-error"})," Busy"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-base-200 border border-base-300"})," Not checked"]}),n&&i.jsx("span",{className:"opacity-60",children:"Click a room to select it"})]})]})}function pb(){return new Date().toISOString().slice(0,10)}const md=[15,30,45,60,90,120,180,240,300,360,420,480,540],Ds=15,gd=Array.from({length:24*4},(e,t)=>{const n=Math.floor(t/4),s=t%4*15;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`});function yd(){const e=new Date,t=e.getHours()*60+Math.round(e.getMinutes()/15)*15,n=Math.floor(t/60)%24,s=t%60;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}function Rs(e){const[t,n]=e.split(":").map(Number);return t*60+n}function ta(e){const t=Math.floor(e/60)%24,n=e%60;return`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Jn(e){const[t,n]=e.split(":").map(Number),s=t<12?"AM":"PM";return`${t%12===0?12:t%12}:${String(n).padStart(2,"0")} ${s}`}function mb(e){if(e<60)return`${e} min`;const t=Math.floor(e/60),n=e%60;return n===0?`${t}h`:`${t}h ${n}m`}function xd(e){try{const t=new Date(e+"T00:00:00"),n=new Date;n.setHours(0,0,0,0);const s=t.getTime()-n.getTime(),r=Math.round(s/864e5);return r===0?"Today":r===1?"Tomorrow":r===-1?"Yesterday":t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return e}}function vd(e,t){if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?(n=new Date(`${t}T${e}`),Number.isNaN(n.getTime())?null:n):n}function gb(e,t,n,s){const r=new Date(`${t}T${n}:00`),a=new Date(r.getTime()+s*6e4);return!e.some(c=>{if(c.state==="free")return!1;const l=vd(c.start,t),u=vd(c.end,t);return l===null||u===null?!1:l<a&&r<u})}const xt=24*60;function jl(e,t){return Math.max(0,Math.min(xt-t,e))}function bd(e){return Math.round(e/15)*15}function yb({startMinutes:e,durationMinutes:t,onChange:n}){const s=v.useRef(null),r=v.useRef(!1),a=x=>{const b=s.current;if(!b)return e;const g=b.getBoundingClientRect(),m=Math.max(0,Math.min(1,(x-g.left)/g.width))*xt;return bd(m)},o=x=>{const b=a(x)-t/2;n(jl(bd(b),t))},c=x=>{r.current=!0,x.currentTarget.setPointerCapture(x.pointerId),o(x.clientX)},l=x=>{r.current&&o(x.clientX)},u=()=>{r.current=!1},h=e/xt*100,d=t/xt*100,p=e+t;return i.jsxs("div",{children:[i.jsxs("div",{ref:s,className:"relative h-10 bg-base-200 border border-base-300 rounded cursor-pointer select-none touch-none",onPointerDown:c,onPointerMove:l,onPointerUp:u,children:[i.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:8},(x,b)=>i.jsx("div",{className:"flex-1 border-r border-base-300/60 last:border-r-0"},b))}),i.jsx("div",{className:"absolute top-0 h-full bg-primary/20 border border-primary/50 rounded cursor-grab active:cursor-grabbing",style:{left:`${h}%`,width:`${d}%`}}),i.jsx("div",{className:"absolute top-0 h-full flex items-center text-xs font-mono font-semibold text-base-content whitespace-nowrap pointer-events-none",style:{left:d<10?`${h+d+.5}%`:`${h}%`,width:d<10?"auto":`${d}%`,justifyContent:d<10?"flex-start":"center"},children:i.jsxs("span",{className:d<10?"text-base-content/80":"",children:[Jn(ta(e)),"–",Jn(ta(p))]})})]}),i.jsxs("div",{className:"flex justify-between font-mono text-[0.55rem] opacity-50 mt-1",children:[i.jsx("span",{children:"12 AM"}),i.jsx("span",{children:"3 AM"}),i.jsx("span",{children:"6 AM"}),i.jsx("span",{children:"9 AM"}),i.jsx("span",{children:"12 PM"}),i.jsx("span",{children:"3 PM"}),i.jsx("span",{children:"6 PM"}),i.jsx("span",{children:"9 PM"}),i.jsx("span",{children:"12 AM"})]})]})}function xb(){var pt;const[e,t]=v.useState(pb()),[n,s]=v.useState(()=>Rs(yd())),r=ta(n),[a,o]=v.useState(120),[c,l]=v.useState("duration"),[u,h]=v.useState(()=>Rs(yd())+120),[d,p]=v.useState(1),x=c==="endtime"?Math.max(Ds,u-n):a,b=v.useCallback(I=>{if(I!==c){if(I==="endtime")h(Math.min(xt,n+a));else{const q=Math.max(Ds,u-n),ce=md.reduce((rt,Es)=>Math.abs(Es-q)<Math.abs(rt-q)?Es:rt);o(ce)}l(I)}},[c,n,a,u]),g=v.useCallback(I=>{const q=Math.max(n+Ds,Math.min(xt,I));h(q)},[n]),w=v.useCallback(I=>{const q=jl(I,c==="endtime"?Ds:a);s(q),c==="endtime"&&h(ce=>Math.max(q+Ds,Math.min(xt,ce)))},[c,a]),[m,y]=v.useState(null),[f,j]=v.useState(null),[k,C]=v.useState(null),[N,S]=v.useState(!1),E=v.useRef(e),{running:A,result:F,error:V,approvalPending:G,approvalId:T,run:$,handleApproval:O}=ja();v.useEffect(()=>{let I=!1;return B.getCachedRoomAvailability(e).then(q=>{I||(q.data&&q.data.length>0?(j(q.data),C(q.fetchedAt),S(!0)):(j(null),C(null),S(!1)))}).catch(()=>{}),()=>{I=!0}},[e]),v.useEffect(()=>{if(F!=null&&F.data&&F.data.length>0){const I=new Date().toISOString();C(I),S(!1),j(F.data),B.cacheRoomAvailability(E.current,F.data).catch(()=>{})}},[F]);const R=v.useCallback(async()=>{S(!1),E.current=e;const I=Object.entries(Xp).map(([q,ce])=>`${q}:${ce}`).join(",");await $("teams/rooms-availability",{rooms:I,date:e})},[$,e]),L=(V==null?void 0:V.includes("auth_required"))||(V==null?void 0:V.includes("sign in")),_=(F==null?void 0:F.data)??f??[],D=v.useMemo(()=>_.map(I=>({room:String(I.roomEmail??I.room??""),capacity:I.capacity===null||I.capacity===void 0||I.capacity===""?null:Number(I.capacity),start:String(I.start??""),end:String(I.end??""),state:String(I.state??""),durationMin:Number(I.durationMin??0)})),[_]),z=v.useMemo(()=>{const I=new Map;for(const ce of D){const rt=ce.room.toLowerCase();I.has(rt)||I.set(rt,[]),I.get(rt).push(ce)}const q=new Map;for(const[ce,rt]of I)q.set(ib[ce]??ce,rt);return q},[D]),X=v.useMemo(()=>{var q;const I={};for(const[ce,rt]of z){const Es=((q=rt.find(nm=>nm.capacity!==null))==null?void 0:q.capacity)??null,em=Es===null||Es>=d,tm=gb(rt,e,r,x);I[ce]=tm&&em?"free":"busy"}return I},[z,e,r,x,d]),ye=m?z.get(m)??[]:[],Me=((pt=ye.find(I=>I.capacity!==null))==null?void 0:pt.capacity)??null,cn=v.useCallback(I=>{y(q=>q===I?null:I)},[]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),i.jsx("input",{type:"date",className:"input input-bordered input-sm w-full sm:w-auto",value:e,onChange:I=>t(I.target.value),onClick:I=>{var q,ce;return(ce=(q=I.target).showPicker)==null?void 0:ce.call(q)}})]}),i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Start time"}),i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:r,onChange:I=>w(Rs(I.target.value)),children:gd.map(I=>i.jsx("option",{value:I,children:Jn(I)},I))})]}),i.jsxs("div",{className:"form-control w-full sm:w-auto",children:[i.jsxs("div",{className:"join mb-1",children:[i.jsx("button",{type:"button",className:`join-item btn btn-xs px-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] ${c==="duration"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>b("duration"),children:"Duration"}),i.jsx("button",{type:"button",className:`join-item btn btn-xs px-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] ${c==="endtime"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>b("endtime"),children:"End time"})]}),c==="duration"?i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:a,onChange:I=>{const q=Number(I.target.value);o(q),s(ce=>jl(ce,q))},children:md.map(I=>i.jsx("option",{value:I,children:mb(I)},I))}):i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:u===xt?"24:00":ta(u),onChange:I=>{const q=I.target.value;g(q==="24:00"?xt:Rs(q))},children:[gd.filter(I=>Rs(I)>n).map(I=>i.jsx("option",{value:I,children:Jn(I)},I)),i.jsx("option",{value:"24:00",children:"End of day"},"eod")]})]}),i.jsxs("label",{className:"form-control w-full sm:w-24",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"People"}),i.jsx("input",{type:"number",min:1,className:"input input-bordered input-sm w-full sm:w-24",value:d,onFocus:I=>I.target.select(),onChange:I=>p(Math.max(1,Number(I.target.value)||1))})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:R,disabled:A,children:A?"Checking floor...":"Check floor plan"})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1 block",children:"Drag to pick a time · bar width = duration"}),i.jsx(yb,{startMinutes:n,durationMinutes:x,onChange:I=>{s(I),c==="endtime"&&h(Math.min(xt,I+x))}})]}),A&&!G&&i.jsx(jt,{label:"Checking all rooms on the floor plan (this drives Outlook UI and can take a few minutes)..."}),G&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>O(!0),disabled:!T,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>O(!1),disabled:!T,children:"Reject"})]})]}),L&&i.jsx(gs,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),V&&!L&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:V})}),k&&i.jsxs("div",{className:"flex items-center gap-2 mb-4 font-mono text-xs opacity-50",children:[N&&i.jsx("span",{className:"badge badge-sm badge-outline",children:"cached"}),i.jsxs("span",{children:["Last fetched ",new Date(k).toLocaleString()]})]}),!F&&!f&&!A&&!V&&i.jsxs("div",{className:"border border-base-300 p-8 text-center mb-8",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Pick a date, time, duration and party size, then check the floor plan"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Rooms that are free and big enough will show green; everything else red."})]}),i.jsxs("div",{className:"mt-2",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:["Floor plan · ",Jn(r),"–",Jn((()=>{const[I,q]=r.split(":").map(Number),ce=(I*60+q+x)%(24*60);return`${String(Math.floor(ce/60)).padStart(2,"0")}:${String(ce%60).padStart(2,"0")}`})())," · ",xd(e)," · ",d," ",d===1?"person":"people"]}),i.jsx(hb,{statuses:X,selected:m??void 0,onSelect:cn})]}),m&&ye.length>0&&i.jsxs("div",{className:"mt-8",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[m,Me!==null&&i.jsxs("span",{className:"ml-2 font-mono text-xs font-normal opacity-50 uppercase tracking-[0.08em]",children:["Capacity ",Me]})," ","· ",xd(e)]}),i.jsx(lb,{rows:ye})]}),m&&ye.length===0&&i.jsx("div",{className:"mt-8 border border-base-300 p-6 text-center",children:i.jsxs("p",{className:"text-sm opacity-50",children:["No data for ",m,' yet — run "Check floor plan" first.']})})]})}function vb({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,a=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,o=t&&t.totalHours<t.targetHours*.8,c=(s==null?void 0:s.blockers.length)??0,l=(r==null?void 0:r.repos.length)??0;return i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Hours Logged"}),i.jsx("div",{className:`font-display text-xl font-bold ${o?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),i.jsxs("div",{className:"text-xs opacity-40",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&i.jsx("progress",{className:`progress ${o?"progress-warning":"progress-success"} w-full mt-1`,value:a,max:100})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Meetings"}),i.jsx("div",{className:`font-display text-xl font-bold ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Tickets Done"}),i.jsx("div",{className:"font-display text-xl font-bold text-accent",children:s?String(s.resolved.length):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:s?i.jsxs(i.Fragment,{children:[s.inProgress.length," in progress",c>0&&i.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",c," blocked"]})]}):""})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Commits"}),i.jsx("div",{className:"font-display text-xl font-bold text-primary",children:r?String(r.totalCommits):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:r?`${r.totalPRsMerged} PRs · ${l} repo${l!==1?"s":""}`:""})]})]})}const bb=["Mon","Tue","Wed","Thu","Fri"];function wb(e){const t=new Date(e).getDay();return bb[t-1]??e}function jb({data:e,weekStart:t}){const{timetracking:n,meetings:s,git:r,jira:a}=e,o=new Set,c=new Date(t+"T00:00:00");for(let w=0;w<5;w++){const m=c.getFullYear(),y=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0");o.add(`${m}-${y}-${f}`),c.setDate(c.getDate()+1)}n==null||n.daily.forEach(w=>o.add(w.date)),s==null||s.daily.forEach(w=>o.add(w.date)),r==null||r.daily.forEach(w=>o.add(w.date));const l=new Date(t+"T00:00:00");l.setDate(l.getDate()+6);const u=l.toISOString().slice(0,10),h=[...o].filter(w=>w>=t&&w<=u).sort().filter(w=>{const m=new Date(w+"T00:00:00").getDay();return m===0||m===6?(n==null?void 0:n.daily.some(f=>f.date===w&&f.hours>0))||(s==null?void 0:s.daily.some(f=>f.date===w&&f.count>0))||(r==null?void 0:r.daily.some(f=>f.date===w&&f.commits>0)):!0}),d=(n==null?void 0:n.totalHours)??0,p=(s==null?void 0:s.totalCount)??0,x=(s==null?void 0:s.totalHours)??0,b=(r==null?void 0:r.totalCommits)??0,g=(a==null?void 0:a.resolved.length)??0;return h.length===0?i.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Day"}),i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Hours Logged"}),i.jsx("th",{children:"Meetings"}),i.jsx("th",{children:"Commits"}),i.jsx("th",{children:"Tickets"})]})}),i.jsx("tbody",{children:h.map(w=>{const m=n==null?void 0:n.daily.find(C=>C.date===w),y=s==null?void 0:s.daily.find(C=>C.date===w),f=r==null?void 0:r.daily.find(C=>C.date===w),j=n==null?void 0:n.gaps.includes(w),k=(a==null?void 0:a.resolved.filter(C=>C.resolvedDate===w))??[];return i.jsxs("tr",{className:j?"bg-warning/10":"",children:[i.jsx("td",{className:"font-medium",children:wb(w)}),i.jsx("td",{className:"text-xs text-base-content/60",children:w}),i.jsxs("td",{children:[i.jsx("span",{className:j?"text-warning font-semibold":"",children:m?`${m.hours}h`:"—"}),j&&i.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),i.jsx("td",{children:y?`${y.count} (${y.hours}h)`:"—"}),i.jsx("td",{children:f?`${f.commits}`:"0"}),i.jsx("td",{className:"text-xs",children:k.length>0?k.map(C=>C.key).join(", "):"—"})]},w)})}),i.jsx("tfoot",{children:i.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[i.jsx("td",{colSpan:2,children:"Total"}),i.jsx("td",{children:d>0?`${d}h`:"—"}),i.jsx("td",{children:p>0?`${p} (${x}h)`:"—"}),i.jsx("td",{children:b}),i.jsx("td",{className:"text-xs",children:g>0?`${g} done`:"—"})]})})]})})}function kb({insights:e,errors:t}){return i.jsxs("div",{className:"space-y-3",children:[e.length>0&&i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em] mb-2",children:"Insights"}),i.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:e.map((n,s)=>i.jsx("li",{children:n},s))})]}),t.length>0&&i.jsx("div",{className:"alert alert-warning text-sm",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((n,s)=>i.jsx("li",{children:n},s))})]})})]})}function Nb(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function Sb(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function Cb(e){return e.isOverdue?"badge badge-error badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=7?"badge badge-warning badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=30?"badge badge-info badge-sm":"badge badge-ghost badge-sm"}function Eb(e){return e.isOverdue?"Overdue":e.daysUntilDue==null||e.daysUntilDue===9999?"No deadline":e.daysUntilDue===0?"Due today":e.daysUntilDue===1?"Due tomorrow":`${e.daysUntilDue}d left`}function Tb({month:e,monthly:t,goals:n,saba:s,enabled:r}){const[a,o]=v.useState(!1),c=v.useMemo(()=>{const g=new Map;for(const w of(t==null?void 0:t.hoursByProject)??[])g.set(w.projectId,w.hours);return g},[t]),l=v.useMemo(()=>{var g;return((g=s.result)==null?void 0:g.data)??[]},[s.result]),u=typeof s.error=="string"&&(s.error.toLowerCase().includes("auth_required")||s.error.toLowerCase().includes("sign in")),h=l.filter(g=>g.isOverdue).length,d=l.filter(g=>!g.isOverdue&&typeof g.daysUntilDue=="number"&&g.daysUntilDue<=30).length,p=r.timetracking?t?t.unreleasedDates.length>0?{label:`${t.unreleasedDates.length} unreleased`,className:"text-warning"}:{label:"Released ✓",className:"text-success"}:{label:"Not checked",className:"opacity-40"}:null,x=r.saba?s.result?l.length===0?{label:"No training due ✓",className:"text-success"}:{label:`${l.length} training${l.length!==1?"s":""}${h>0?` · ${h} overdue`:""}`,className:h>0?"text-error":"text-warning"}:{label:"Not checked",className:"opacity-40"}:null,b=s.approvalPending||u||s.error&&!u;return i.jsxs("div",{className:"border border-base-300 text-sm",children:[i.jsxs("button",{type:"button",onClick:()=>o(g=>!g),className:"w-full flex items-center justify-between gap-3 p-3 text-left","aria-expanded":a,children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.1em]",children:"Month-to-date"}),i.jsx("span",{className:"text-xs opacity-40",children:Nb(e)})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[p&&i.jsx("span",{className:`text-xs font-medium whitespace-nowrap ${p.className}`,children:p.label}),x&&i.jsx("span",{className:`text-xs font-medium whitespace-nowrap ${x.className}`,children:x.label}),i.jsx(U1,{className:`w-3.5 h-3.5 opacity-40 transition-transform ${a?"rotate-180":""}`})]})]}),b&&i.jsxs("div",{className:"border-t border-base-300 p-3 space-y-2",children:[s.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>s.handleApproval(!0),disabled:!s.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>s.handleApproval(!1),disabled:!s.approvalId,children:"Reject"})]})]}),u&&i.jsx(gs,{message:"Sign in to Saba Cloud (daimler.sabacloud.com) in Chrome, then try again."}),s.error&&!u&&i.jsx("div",{className:"alert alert-error text-sm font-mono whitespace-pre-wrap",children:i.jsx("span",{children:s.error})})]}),a&&i.jsxs("div",{className:"border-t border-base-300 p-3 space-y-4",children:[r.timetracking&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Time Tracking"}),t?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xs opacity-50",children:[t.workingDaysElapsed," of ",t.workingDaysTotal," working days elapsed this month"]}),t.unreleasedDates.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.unreleasedDates.map(g=>i.jsx("span",{className:"badge badge-warning badge-outline badge-sm",children:Sb(g)},g))}),n.length>0&&i.jsx("div",{className:"space-y-2 pt-1",children:n.map(g=>{const w=Math.round((c.get(g.projectId)??0)*100)/100,m=Math.round((g.targetHours-w)*100)/100,y=Math.min(100,Math.round(w/g.targetHours*100)),f=m<=0;return i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsx("span",{className:"font-medium",children:g.projectId}),i.jsx("span",{className:`font-mono ${f?"text-success":"text-warning"}`,children:f?"✓ Goal met":`${m}h to go`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("progress",{className:`progress flex-1 ${f?"progress-success":"progress-warning"}`,value:y,max:100}),i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-50 w-20 text-right",children:[w,"h / ",g.targetHours,"h"]})]})]},g.id)})})]}):i.jsx("p",{className:"text-xs opacity-40",children:"Click Generate above to check your time tracking status."})]}),r.saba&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Pending Training (Saba)"}),s.result&&l.length>0&&i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("p",{className:"text-xs opacity-50",children:[d," due within 30 days"]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Course"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Due"}),i.jsx("th",{children:"Urgency"})]})}),i.jsx("tbody",{children:l.map((g,w)=>i.jsxs("tr",{className:"hover",children:[i.jsx("td",{className:`font-medium text-sm ${g.isOverdue?"text-error":""}`,children:g.title??"—"}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:g.type??"—"}),i.jsx("td",{className:"text-xs opacity-70",children:g.status??"—"}),i.jsx("td",{className:"font-mono text-xs",children:g.dueDate||"—"}),i.jsx("td",{children:i.jsx("span",{className:Cb(g),children:Eb(g)})})]},w))})]})})]}),s.result&&l.length===0&&!s.error&&i.jsx("p",{className:"text-xs opacity-40",children:"You're all caught up."}),!s.result&&!s.error&&!s.running&&i.jsx("p",{className:"text-xs opacity-40",children:"Click Generate above to fetch your pending Saba training."})]})]})]})}const wd=[{key:"timetracking",label:"Timetracking",icon:Pa},{key:"meetings",label:"Meetings",icon:R1},{key:"jira",label:"Jira",icon:Hv},{key:"git",label:"ADO (Git)",icon:lv},{key:"saba",label:"Saba Training",icon:dv}];function Zp(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${s}`}function po(){const e=new Date,t=e.getDay(),n=t===0?-6:1-t;return e.setDate(e.getDate()+n),Zp(e)}function jd(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),Zp(n)}function Ab(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+4);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function Lb(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Pb(e){const t=Math.round((Date.now()-new Date(e).getTime())/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n} min ago`;const s=Math.round(n/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function Ob(){const[e,t]=v.useState(po()),[n]=v.useState(Lb()),[s,r]=v.useState(!1),[a,o]=v.useState(null),[c,l]=v.useState(null),[u,h]=v.useState(null),[d,p]=v.useState([]),[x,b]=v.useState({timetracking:!0,meetings:!0,jira:!0,git:!0,saba:!0}),g=ja();function w(N){b(S=>{const E={...S,[N]:!S[N]};return B.saveJournalSourcePrefs(E).catch(()=>{}),E})}function m(N){t(N),o(null),l(null),h(null),y(N)}async function y(N){try{const S=await B.getCachedJournal(N);S.data&&o(S.data),g.hydrate(S.saba??null)}catch{}}v.useEffect(()=>{B.getJournalSourcePrefs().then(N=>{N.prefs&&b(N.prefs)}).catch(()=>{}).finally(()=>{y(e)})},[]),v.useEffect(()=>{g.result&&B.cacheJournalSaba(e,g.result).catch(()=>{})},[g.result]);const f=e===po(),j=Object.values(x).some(Boolean),k=wd.filter(N=>x[N.key]).map(N=>N.label);async function C(N=!1){r(!0),l(null),o(null),h(null),g.reset(),p([]);const S=Date.now();x.timetracking&&B.getGoals(n).then(E=>p(E.goals)).catch(()=>{}),x.saba&&g.run("saba/pending-training",{});try{const E=await B.generateJournal({weekStart:e,sources:x,forceRefresh:N});h(Date.now()-S),o(E)}catch(E){l(E instanceof Error?E.message:"Unknown error")}finally{r(!1)}}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] flex items-center gap-2",children:[i.jsx(F1,{className:"w-5 h-5 opacity-50","aria-hidden":"true"}),"Dev Work Journal"]}),i.jsx("p",{className:"text-sm opacity-50 mt-1",children:"Pulls your week's activity from the sources below so you can spot gaps before your report is due."})]}),i.jsxs("div",{className:"border border-base-300 p-4 mb-6 space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{className:"btn btn-sm btn-ghost btn-square",onClick:()=>m(jd(e,-1)),disabled:s,"aria-label":"Previous week",children:i.jsx(H1,{className:"w-4 h-4"})}),i.jsxs("div",{className:"text-center min-w-[170px]",children:[i.jsx("div",{className:"font-medium leading-tight",children:Ab(e)}),i.jsx("div",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] text-primary/70 h-4",children:f?"This week":" "})]}),i.jsx("button",{className:"btn btn-sm btn-ghost btn-square",onClick:()=>m(jd(e,1)),disabled:s,"aria-label":"Next week",children:i.jsx(K1,{className:"w-4 h-4"})}),!f&&i.jsx("button",{className:"btn btn-xs btn-ghost ml-1",onClick:()=>m(po()),disabled:s,children:"Today"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[u!==null&&!s&&i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-40",children:["Generated in ",(u/1e3).toFixed(1),"s"]}),i.jsx("button",{className:"btn btn-primary gap-2",onClick:()=>C(!0),disabled:s||!j,title:j?void 0:"Select at least one source first",children:s?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):i.jsxs(i.Fragment,{children:[i.jsx(wl,{className:"w-4 h-4"}),"Generate"]})})]})]}),i.jsxs("div",{className:"border-t border-base-300 pt-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:"Sources"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:wd.map(({key:N,label:S,icon:E})=>{const A=x[N];return i.jsxs("button",{type:"button",onClick:()=>w(N),disabled:s,"aria-pressed":A,className:`inline-flex items-center gap-1.5 px-3 py-1.5 border text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${A?"border-primary text-primary bg-primary/10":"border-base-300 text-base-content/40 hover:text-base-content/70 hover:border-base-content/30"}`,children:[i.jsx(E,{className:"w-3.5 h-3.5","aria-hidden":"true"}),S]},N)})}),!j&&i.jsx("p",{className:"text-xs text-warning mt-2",children:"Select at least one source to generate a journal."})]})]}),s&&i.jsxs("div",{className:"flex items-center gap-3 text-base-content/60 mb-4 border border-base-300 p-3",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),i.jsxs("span",{className:"text-sm",children:["Gathering data from ",k.join(", "),"…"]})]}),!a&&!s&&!c&&i.jsxs("div",{className:"border border-dashed border-base-300 p-8 text-center mb-6",children:[i.jsx(wl,{className:"w-6 h-6 mx-auto opacity-30 mb-2","aria-hidden":"true"}),i.jsx("p",{className:"text-sm opacity-50",children:"Pick a week and hit Generate to build your journal."})]}),c&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsx("span",{children:c})}),(a==null?void 0:a.cache)&&i.jsxs("div",{className:"flex items-center justify-between gap-3 border border-base-300 px-3 py-2 mb-4 text-xs",children:[i.jsxs("span",{className:"opacity-70",children:[a.cache.hit?"Cached result from":"Freshly fetched"," ",i.jsx("span",{className:`font-medium ${a.cache.hit?"text-warning":"text-success"}`,title:new Date(a.cache.fetchedAt).toLocaleString(),children:Pb(a.cache.fetchedAt)})]}),i.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:()=>C(!0),disabled:s,children:"Refresh"})]}),i.jsx(Tb,{month:n,monthly:(a==null?void 0:a.monthlyTimetracking)??null,goals:d,saba:g,enabled:{timetracking:x.timetracking,saba:x.saba}}),i.jsx("div",{className:"h-6"}),(a==null?void 0:a.status)==="partial"&&i.jsx("div",{role:"alert",className:"alert alert-warning text-sm mb-4",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:a.errors.map((N,S)=>i.jsx("li",{children:N},S))})]})}),a&&a.status!=="error"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Summary"}),i.jsx(vb,{data:a})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Daily Breakdown"}),i.jsx(jb,{data:a,weekStart:e})]}),i.jsx("section",{className:"space-y-4",children:i.jsx(kb,{insights:a.insights,errors:a.errors})})]}),(a==null?void 0:a.status)==="error"&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsxs("span",{children:["Failed to generate journal. ",a.errors.join("; ")]})})]})}const Ib={socket:"info",wiz:"secondary",tldrsec:"warning"},_b={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function Mb(e,t){try{const n=new Date(e);if(isNaN(n.getTime()))return!1;const s=Date.now()-t*24*60*60*1e3;return n.getTime()>=s}catch{return!1}}function $b(e){try{const t=new Date(e);if(isNaN(t.getTime()))return e;const s=new Date().getTime()-t.getTime(),r=Math.floor(s/36e5);if(r<1)return"just now";if(r<24)return`${r}h ago`;const a=Math.floor(r/24);return a===1?"yesterday":a<7?`${a}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function Db(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.summary??""),url:String(t.url??""),date:String(t.date??""),source:"socket",author:String(t.author??""),tags:String(t.tags??"")}))}function Rb(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"wiz",author:String(t.authors??""),tags:String(t.tags??"")}))}function zb(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"tldrsec",author:String(t.authors??""),tags:String(t.tags??"")}))}const kd={7:"Past 7 days",30:"Past 30 days"};function Fb(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Bb(){const[e,t]=v.useState(7),[n,s]=v.useState("idle"),[r,a]=v.useState("idle"),[o,c]=v.useState("idle"),[l,u]=v.useState([]),[h,d]=v.useState([]),[p,x]=v.useState([]),[b,g]=v.useState(null),[w,m]=v.useState(null),[y,f]=v.useState(null),[j,k]=v.useState(null),[C,N]=v.useState(!1);v.useEffect(()=>{let T=!1;return B.getCachedSecurityNews().then($=>{if(!T&&$.data&&$.data.length>0){if(s(_=>_==="loading"?(T=!0,_):"done"),T)return;const O=[],R=[],L=[];for(const _ of $.data){const D=_;D.source==="wiz"?R.push(D):D.source==="tldrsec"?L.push(D):O.push(D)}u(O),d(R),x(L),k($.fetchedAt),N(!0),a("done"),c("done")}}).catch(()=>{}),()=>{T=!0}},[]);const S=n==="loading"||r==="loading"||o==="loading",E=l.length>0||h.length>0||p.length>0,A=v.useMemo(()=>[...l,...h,...p].filter($=>Mb($.date,e)).sort(($,O)=>new Date(O.date).getTime()-new Date($.date).getTime()),[l,h,p,e]),F=v.useMemo(()=>{const T=A.filter(R=>R.source==="socket").length,$=A.filter(R=>R.source==="wiz").length,O=A.filter(R=>R.source==="tldrsec").length;return{total:A.length,socketCount:T,wizCount:$,tldrsecCount:O}},[A]),V=v.useCallback(async()=>{s("loading"),a("loading"),c("loading"),g(null),m(null),f(null),u([]),d([]),x([]),N(!1);let T=[],$=[],O=[];const R=B.run("socket/security-news",{}).then(z=>{!z.ok&&z.error?(g(z.error),s("error")):(T=Db(z),u(T),s("done"))}).catch(z=>{g(z instanceof Error?z.message:"Failed to fetch"),s("error")}),L=B.run("wiz/blog-security",{}).then(z=>{!z.ok&&z.error?(m(z.error),a("error")):($=Rb(z),d($),a("done"))}).catch(z=>{m(z instanceof Error?z.message:"Failed to fetch"),a("error")}),_=B.run("tldrsec/newsletter",{}).then(z=>{!z.ok&&z.error?(f(z.error),c("error")):(O=zb(z),x(O),c("done"))}).catch(z=>{f(z instanceof Error?z.message:"Failed to fetch"),c("error")});await Promise.allSettled([R,L,_]);const D=[...T,...$,...O];if(D.length>0){const z=new Date().toISOString();k(z),B.cacheSecurityNews(D).catch(()=>{})}},[]),G=T=>(T==null?void 0:T.includes("auth_required"))||(T==null?void 0:T.includes("sign in"));return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:T=>t(Number(T.target.value)),children:[i.jsx("option",{value:7,children:"Past 7 days"}),i.jsx("option",{value:30,children:"Past 30 days"})]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:V,disabled:S,children:S?"Loading...":"Load news"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(mo,{label:"Socket",status:n}),i.jsx(mo,{label:"Wiz",status:r}),i.jsx(mo,{label:"tl;dr sec",status:o})]})]}),S&&i.jsx(jt,{label:"Fetching security news..."}),b&&(G(b)?i.jsx(gs,{message:"Sign in to Socket.dev in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Socket:"})," ",b]})})),w&&(G(w)?i.jsx(gs,{message:"Sign in to Wiz in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",w]})})),y&&i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",y]})}),j&&!S&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[C?"Showing cached data from":"Last fetched"," ",Fb(j)]}),E&&!S&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:kd[e]}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.socketCount})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.wizCount})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.tldrsecCount})]})]}),A.length>0&&i.jsx("div",{className:"space-y-px",children:A.map((T,$)=>i.jsxs("article",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[i.jsx("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:T.title}),i.jsx(H,{variant:Ib[T.source]??"neutral",size:"xs",children:_b[T.source]??T.source.toUpperCase()})]}),T.summary&&i.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:T.summary}),i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:$b(T.date)}),T.author&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:T.author}),T.tags&&i.jsx("div",{className:"flex gap-1 flex-wrap",children:T.tags.split(",").slice(0,3).map(O=>i.jsx(H,{variant:"neutral",size:"xs",children:O.trim()},O.trim()))})]})]},`${T.source}-${$}`))}),E&&A.length===0&&!S&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",kd[e].toLowerCase()]}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!E&&!S&&!b&&!w&&!y&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function mo({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function li(e){if(!e)return null;try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;return n.setHours(0,0,0,0),t.setHours(0,0,0,0),Math.ceil((t.getTime()-n.getTime())/(24*60*60*1e3))}catch{return null}}function Nd(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function Ub(e,t){switch(e){case"expired":return i.jsx(H,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return i.jsxs(H,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return i.jsxs(H,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return i.jsxs(H,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return i.jsx(H,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function Wb(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function Hb(e){switch(e){case"expired":return"bg-red-500/5";case"critical":return"bg-red-500/5";case"warning":return"bg-amber-500/5";default:return""}}function Vb(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Kb(){const[e,t]=v.useState("idle"),[n,s]=v.useState(""),[r,a]=v.useState([]),[o,c]=v.useState(null),[l,u]=v.useState("all"),[h,d]=v.useState(null),[p,x]=v.useState(!1),b=e==="clients"||e==="trustedby";v.useEffect(()=>{let j=!1;return B.getCachedTrustedPeers().then(k=>{if(!j&&k.data&&k.data.length>0){if(t(N=>N==="clients"||N==="trustedby"?(j=!0,N):"done"),j)return;const C=k.data;a(C),d(k.fetchedAt),x(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{j=!0}},[]);const g=v.useCallback(async()=>{t("clients"),c(null),a([]),x(!1),s("Fetching client list (all regions)...");try{const j=await B.run("tokenmaster/clients-list",{region:"all"});if(!j.ok&&j.error){c(j.error),t("error");return}const k=(j.data??[]).map(S=>({id:String(S.id??""),name:String(S.name??""),region:String(S.region??"emea")}));if(k.length===0){s("No clients found."),t("done");return}t("trustedby");const C=[],N=k.length;for(let S=0;S<k.length;S++){const E=k[S];s(`Fetching trusted peers... (${S+1}/${N}) — ${E.name||E.id}`);try{const A=await B.run("tokenmaster/client-trustedby",{clientid:E.id,region:E.region});if(A.ok&&A.data)for(const F of A.data)C.push({parentClientId:E.id,parentClientName:E.name||E.id,peerId:String(F.id??""),peerName:String(F.name??""),peerIdDisplay:String(F.idDisplay??""),expiryDate:F.expiry_date?String(F.expiry_date):null,region:String(F.region??E.region)})}catch{}}if(a(C),s(`Loaded ${C.length} trusted peers from ${N} clients.`),t("done"),C.length>0){const S=new Date().toISOString();d(S),B.cacheTrustedPeers(C).catch(()=>{})}}catch(j){c(j instanceof Error?j.message:"Unknown error"),t("error")}},[]),w=v.useMemo(()=>[...l==="all"?r:r.filter(k=>k.region===l)].sort((k,C)=>{const N=li(k.expiryDate),S=li(C.expiryDate);return N===null&&S===null?0:N===null?1:S===null?-1:N-S}),[r,l]),m=v.useMemo(()=>{let j=0,k=0,C=0;for(const N of w){const S=Nd(li(N.expiryDate));S==="expired"?j++:S==="critical"?k++:S==="warning"&&C++}return{total:w.length,expired:j,critical:k,warning:C}},[w]),y=v.useMemo(()=>{const j=new Set(r.map(k=>k.region));return Array.from(j).sort()},[r]),f=j=>(j==null?void 0:j.includes("auth_required"))||(j==null?void 0:j.includes("sign in"));return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),h&&!b&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-3",children:[p?"Showing cached data from":"Last fetched"," ",Vb(h)]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:l,onChange:j=>u(j.target.value),children:[i.jsx("option",{value:"all",children:"All regions"}),y.map(j=>i.jsx("option",{value:j,children:j.toUpperCase()},j))]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:g,disabled:b,children:b?"Loading...":"Load trusted peers"})]}),b&&i.jsx(jt,{label:n}),o&&(f(o)?i.jsx(gs,{message:"Sign in to TokenMaster in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsx("span",{children:o})})),r.length>0&&!b&&i.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),i.jsx("div",{className:"font-display text-xl font-bold",children:m.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),i.jsx("div",{className:`font-display text-xl font-bold ${m.expired>0?"text-red-500":""}`,children:m.expired})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${m.critical>0?"text-red-500":""}`,children:m.critical})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${m.warning>0?"text-amber-500":""}`,children:m.warning})]})]}),w.length>0&&i.jsx("div",{className:"border border-base-300 overflow-x-auto",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-base-300",children:[i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),i.jsx("tbody",{children:w.map((j,k)=>{const C=li(j.expiryDate),N=Nd(C);return i.jsxs("tr",{className:`border-b border-base-300/50 ${Hb(N)}`,children:[i.jsx("td",{children:Ub(N,C)}),i.jsx("td",{className:"font-mono text-sm",children:Wb(j.expiryDate)}),i.jsx("td",{className:"font-mono text-sm",children:C!==null?C<0?`${Math.abs(C)}d overdue`:`${C}d`:"—"}),i.jsx("td",{className:"text-sm font-semibold",children:j.peerName||j.peerId}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:j.peerIdDisplay||j.peerId}),i.jsx("td",{className:"text-sm",children:j.parentClientName}),i.jsx("td",{children:i.jsx(H,{variant:"neutral",size:"xs",children:j.region.toUpperCase()})})]},`${j.parentClientId}-${j.peerId}-${j.region}-${k}`)})})]})}),e==="done"&&!b&&r.length>0&&i.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!b&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:'Press "Load trusted peers" to fetch all clients and their trusted peer expiry dates across all regions.'})]})]})}const Gb={client:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400",daemon:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",extension:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",browser:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},qb={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"};function kl({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,a=`repeat(${r}, 1fr)`;return i.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),i.jsxs("div",{style:{minWidth:r*130},children:[i.jsx("div",{className:"grid",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${Gb[o.color]}`,children:o.label})},o.id))}),i.jsxs("div",{className:"relative py-1",children:[i.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:`w-0.5 h-full ${qb[o.color]}`})},o.id))}),i.jsx("div",{className:"relative",children:n.map((o,c)=>{if(o.type==="action"){const w=(t.findIndex(m=>m.id===o.lane)+.5)/r*100;return i.jsx("div",{className:"relative",style:{height:26},children:i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${w}%`},children:i.jsx("span",{className:"block px-2 py-0.5 text-[0.6rem] font-mono bg-base-200/90 border border-base-300/60 text-base-content/60 whitespace-nowrap",children:o.label})})},c)}const l=t.findIndex(g=>g.id===o.from),u=t.findIndex(g=>g.id===o.to),h=(l+.5)/r*100,d=(u+.5)/r*100,p=Math.min(h,d),x=Math.abs(d-h),b=l<u;return i.jsxs("div",{className:"relative",style:{height:30},children:[i.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${p}%`,width:`${x}%`}}),i.jsx("div",{className:"absolute top-1/2 w-1.5 h-1.5 rounded-full bg-base-content/30 -translate-x-1/2 -translate-y-1/2",style:{left:`${h}%`}}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 text-[0.55rem] leading-none text-base-content/40",style:{left:`${d}%`,transform:`translate(${b?"-100%":"0"}, -50%)`},children:b?"▸":"◂"}),i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(h+d)/2}%`},children:i.jsx("span",{className:"px-1.5 py-px text-[0.6rem] font-mono bg-base-100 text-base-content/60 whitespace-nowrap",children:o.label})})]},c)})})]})]})]})}const Yb=[{name:"CLI Client",tech:"Node.js / Commander.js",port:null,desc:"Terminal interface. Sends commands to the Daemon over HTTP, formats output as table / JSON / CSV.",pkg:"@commandgarden/cli"},{name:"GUI",tech:"React SPA / Vite / Tailwind / DaisyUI",port:null,desc:"Browser-based interface. Talks to the App Server — never to the Daemon directly.",pkg:null},{name:"App Server",tech:"Fastify / SQLite",port:"9092",desc:"GUI backend. Proxies Daemon calls, enriches responses, and owns app-specific state (preferences, cached reports, goals).",pkg:"@commandgarden/app"},{name:"Daemon",tech:"Fastify / WebSocket / SQLite",port:"9091",desc:"Core service. Validates auth and capabilities, loads connectors, relays pipelines to the Chrome Extension, writes audit log.",pkg:"@commandgarden/daemon"},{name:"Chrome Extension",tech:"MV3 / TypeScript / Service Worker",port:null,desc:"Runs connector pipelines inside browser tabs via content scripts and CDP. Connects to the Daemon via WebSocket.",pkg:null}],Qb=[{name:"Audit Log",tech:"SQLite",path:"~/.commandgarden/audit.db",desc:"Every command execution, denial, auth failure, and config change."},{name:"App DB",tech:"SQLite",path:"~/.commandgarden/app.db",desc:"Preferences, cached reports, goals, and saved views."},{name:"Config",tech:"YAML",path:"~/.commandgarden/config.yaml",desc:"Daemon + security + connector + audit settings."},{name:"Session Token",tech:"File",path:"~/.commandgarden/session-token",desc:"Bearer token generated on daemon start. CLI and App Server read it for auth."}],Jb=[{title:"Command execution (CLI path)",lanes:[{id:"cli",label:"CLI",color:"client"},{id:"daemon",label:"Daemon :9091",color:"daemon"},{id:"ext",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"cli",to:"daemon",label:"POST /api/run (HTTP)"},{type:"action",lane:"daemon",label:"validate token + CSRF"},{type:"action",lane:"daemon",label:"check connector, domains, capabilities"},{type:"action",lane:"daemon",label:"audit: command.start"},{type:"action",lane:"daemon",label:"split pipeline (extension vs daemon steps)"},{type:"arrow",from:"daemon",to:"ext",label:"relay extension steps (WS)"},{type:"arrow",from:"ext",to:"browser",label:"execute pipeline steps"},{type:"arrow",from:"browser",to:"ext",label:"page data"},{type:"arrow",from:"ext",to:"daemon",label:"results (WS)"},{type:"action",lane:"daemon",label:"run daemon-side steps (transform, map)"},{type:"action",lane:"daemon",label:"audit: command.success / error"},{type:"arrow",from:"daemon",to:"cli",label:"structured data response"}]},{title:"Command execution (GUI path)",lanes:[{id:"gui",label:"GUI",color:"client"},{id:"app",label:"App Server :9092",color:"daemon"},{id:"daemon",label:"Daemon :9091",color:"daemon"}],steps:[{type:"arrow",from:"gui",to:"app",label:"POST /api/run (HTTP)"},{type:"arrow",from:"app",to:"daemon",label:"proxy to daemon (HTTP)"},{type:"action",lane:"daemon",label:"validate, execute, audit (same as CLI path)"},{type:"arrow",from:"daemon",to:"app",label:"structured data"},{type:"arrow",from:"app",to:"gui",label:"enriched response"}]},{title:"Step approval flow",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"ext",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"detect approval-required capability"},{type:"arrow",from:"daemon",to:"client",label:"HTTP 202 + requestId"},{type:"arrow",from:"daemon",to:"client",label:"approval prompt (SSE)"},{type:"arrow",from:"daemon",to:"ext",label:"approval notification (WS)"},{type:"arrow",from:"client",to:"daemon",label:"POST /api/approval"},{type:"arrow",from:"ext",to:"daemon",label:"resolve via WS"},{type:"action",lane:"daemon",label:"first responder wins → continue or abort"},{type:"action",lane:"daemon",label:"audit: approval.granted / rejected"}]},{title:"Extension connection",lanes:[{id:"ext",label:"Extension",color:"extension"},{id:"daemon",label:"Daemon",color:"daemon"}],steps:[{type:"arrow",from:"ext",to:"daemon",label:"WS connect :9091"},{type:"action",lane:"daemon",label:"validate origin"},{type:"action",lane:"daemon",label:"attach WS relay"},{type:"action",lane:"ext",label:"ready for commands"},{type:"arrow",from:"ext",to:"daemon",label:"heartbeat"}]}],Xb=[{name:"shared",desc:"Connector schema (Zod), protocol messages, audit events, expression parser, pipeline definitions",published:!1},{name:"daemon",desc:"HTTP + WebSocket server, auth, connector registry, capability validation, audit store, WebSocket relay",published:!1},{name:"cli",desc:"CLI client (Commander.js) — run, list, inspect, validate, daemon/gui management, audit queries, config",published:!0},{name:"chrome",desc:"Chrome MV3 extension — service worker, content scripts, domain guard, pipeline step execution engine",published:!1},{name:"app",desc:"Web GUI — Fastify app server + React SPA (Vite, Tailwind, DaisyUI)",published:!1},{name:"connectors",desc:"Built-in YAML connector definitions",published:!1}];function Zb(){return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),i.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:i.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.5})}),i.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.5})})]}),i.jsx("rect",{x:15,y:8,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),i.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Node.js"}),i.jsx("rect",{x:15,y:120,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:190,y:120,width:145,height:50,rx:3,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.6)",strokeWidth:1}),i.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),i.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),i.jsx("rect",{x:395,y:10,width:160,height:84,rx:3,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.7)",strokeWidth:1.5}),i.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:615,y:20,width:150,height:60,rx:3,fill:"rgba(52,211,153,0.15)",stroke:"rgba(52,211,153,0.6)",strokeWidth:1}),i.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:630,y:200,width:130,height:50,rx:3,fill:"rgba(167,139,250,0.15)",stroke:"rgba(167,139,250,0.6)",strokeWidth:1}),i.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"App DB"}),i.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Audit Log"}),i.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Config"}),i.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"YAML"}),i.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Session Token"}),i.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"file"}),i.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),i.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:557,y1:50,x2:613,y2:50,stroke:"currentColor",strokeOpacity:.4,strokeWidth:1.5,markerEnd:"url(#arch-ah)",markerStart:"url(#arch-ah-rev)"}),i.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"Content"}),i.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"Scripts"}),i.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),i.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.18,strokeDasharray:"3 2"}),i.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.18,strokeDasharray:"3 2"})]})}),i.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),i.jsx("div",{className:"space-y-2 mb-8",children:Yb.map(e=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[i.jsx("span",{className:"font-semibold",children:e.name}),i.jsx(H,{size:"xs",children:e.tech}),e.port&&i.jsxs(H,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&i.jsx(H,{variant:"secondary",size:"xs",children:e.pkg})]}),i.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),i.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Store"}),i.jsx("th",{children:"Format"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Purpose"})]})}),i.jsx("tbody",{children:Qb.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-semibold text-sm",children:e.name}),i.jsx("td",{children:i.jsx(H,{size:"xs",children:e.tech})}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),i.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),i.jsxs("p",{className:"text-sm opacity-60 mb-4",children:["For a plain-language walkthrough of these same flows, see"," ",i.jsxs(je,{to:"/concepts",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Concepts ",i.jsx(qe,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"space-y-4 mb-8",children:Jb.map(e=>i.jsx(kl,{flow:e},e.title))}),i.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),i.jsx("div",{className:"border border-base-300 p-4 mb-8",children:i.jsxs("ul",{className:"space-y-2",children:[i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Session token"})," — generated on daemon start, stored at ~/.commandgarden/session-token. Every API call (except /api/status) requires Bearer auth + X-CommandGarden CSRF header."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Capability gating"})," — each pipeline step requires a declared capability. High-risk capabilities (js_evaluate, cookie_write) require explicit approval."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),i.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Package"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Published"})]})}),i.jsx("tbody",{children:Xb.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc}),i.jsx("td",{children:e.published?i.jsx(H,{variant:"success",size:"xs",children:"npm"}):i.jsx(H,{size:"xs",children:"bundled"})})]},e.name))})]})}),i.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&i.jsx("span",{className:"opacity-40",children:"→"})]},e))}),i.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"npm run build"})," from the commandGarden root to build all packages in dependency order."]})]})]})}const ew={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},tw=[{method:"GET",path:"/api/status",auth:!1,desc:"Health check. Returns daemon status, extension connection, and connector count."},{method:"GET",path:"/api/connectors",auth:!0,desc:"List all loaded connectors with key, description, access, domains, and capabilities."},{method:"GET",path:"/api/connectors/:site/:name",auth:!0,desc:"Full connector definition including pipeline, args, and columns.",params:"site, name — connector key segments"},{method:"POST",path:"/api/run",auth:!0,desc:"Execute a connector pipeline. Returns structured data. Returns 202 with requestId if step approval is required.",body:"{ connector: string, args: Record<string, string> }"},{method:"GET",path:"/api/audit",auth:!0,desc:"List audit events with optional filters.",params:"since?, connector?, type?, limit?"},{method:"GET",path:"/api/audit/:id",auth:!0,desc:"Single audit event with full detail including pipeline steps."},{method:"GET",path:"/api/config",auth:!0,desc:"Read the full config.yaml as JSON."},{method:"POST",path:"/api/config",auth:!0,desc:"Set a config value. Key must be section.property format.",body:"{ key: string, value: string }"},{method:"POST",path:"/api/approval",auth:!0,desc:"Resolve a pending step approval.",body:"{ approvalId: string, approved: boolean }"},{method:"SSE",path:"/api/run/events/:requestId",auth:!0,desc:"Server-Sent Events stream for approval-required runs. Sends approval and result events."},{method:"WS",path:"/ws/extension",auth:!1,desc:"WebSocket endpoint for Chrome Extension. Origin validated against security.extensionId."}],nw=[{method:"GET",path:"/api/status",auth:!1,desc:"Proxied daemon status (same as daemon /api/status)."},{method:"GET",path:"/api/connectors",auth:!1,desc:"Enriched connector list with hasAppPage, appRoute, isHighRisk, isApproved, isAutoApproved."},{method:"GET",path:"/api/connectors/:site/:name",auth:!1,desc:"Proxied connector detail."},{method:"POST",path:"/api/run",auth:!1,desc:"Proxied connector execution."},{method:"GET",path:"/api/audit",auth:!1,desc:"Proxied audit event list."},{method:"GET",path:"/api/audit/:id",auth:!1,desc:"Proxied single audit event."},{method:"GET",path:"/api/config",auth:!1,desc:"Proxied config read."},{method:"POST",path:"/api/config",auth:!1,desc:"Proxied config write."},{method:"POST",path:"/api/approval",auth:!1,desc:"Proxied approval resolution."},{method:"GET",path:"/api/preferences",auth:!1,desc:"Read app preferences (SQLite-backed).",response:"{ ok, preferences }"},{method:"PUT",path:"/api/preferences",auth:!1,desc:"Set an app preference.",body:"{ key: string, value: string }"},{method:"GET",path:"/api/goals",auth:!1,desc:"Read goals for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/goals",auth:!1,desc:"Create or update a goal.",body:"{ month, projectId, activity, targetDays }"},{method:"DELETE",path:"/api/goals/:id",auth:!1,desc:"Delete a goal."},{method:"GET",path:"/api/timetracking/cache",auth:!1,desc:"Get cached timetracking report for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/timetracking/cache",auth:!1,desc:"Store timetracking report in cache.",body:"{ month, data }"},{method:"GET",path:"/api/timetracking/projects",auth:!1,desc:"Get cached project/activity list."},{method:"POST",path:"/api/timetracking/projects",auth:!1,desc:"Store project/activity list in cache.",body:"{ data }"},{method:"POST",path:"/api/journal/generate",auth:!1,desc:"Generate a dev journal for a given week.",body:"{ weekStart: string }"},{method:"GET",path:"/api/security-news/cache",auth:!1,desc:"Get cached security news articles."},{method:"POST",path:"/api/security-news/cache",auth:!1,desc:"Store security news in cache.",body:"{ data }"}],sw=[{cmd:"cg up",desc:"Start daemon + GUI, open browser.",opts:["--no-open Skip opening browser"]},{cmd:"cg down",desc:"Stop GUI + daemon."},{cmd:"cg run <connector>",desc:"Run a connector command.",args:"Connector key (site/name), plus connector-specific args as --key value",opts:["-f, --format <format> Output format: table, json, csv (default: table)"],example:"cg run timetracking/report --month 2026-07 --format json"},{cmd:"cg list",desc:"List all installed connectors with access, domains, and capabilities."},{cmd:"cg inspect <connector>",desc:"Show full details of a connector (args, columns, pipeline).",example:"cg inspect teams/room-availability"},{cmd:"cg validate <file>",desc:"Validate a connector YAML file against the schema.",example:"cg validate connectors/my-connector.yaml"},{cmd:"cg daemon status",desc:"Check if the daemon is running."},{cmd:"cg daemon start",desc:"Start the daemon in background."},{cmd:"cg daemon stop",desc:"Stop the daemon."},{cmd:"cg gui",desc:"Start the GUI app server (foreground by default).",opts:["-b, --background Run in background","--no-open Skip opening browser"]},{cmd:"cg gui stop",desc:"Stop the GUI app server."},{cmd:"cg gui status",desc:"Check if the GUI is running."},{cmd:"cg audit list",desc:"List recent audit events.",opts:["--since <duration> Time window (e.g. 7d, 2w, 12h)","--connector <pattern> Filter by connector (e.g. test/*)","--type <pattern> Filter by event type (e.g. auth.failed)","--limit <n> Max events (default: 100)"]},{cmd:"cg audit show <id>",desc:"Show full details of a single audit event including pipeline steps."},{cmd:"cg audit export",desc:"Export audit events.",opts:["--format <format> Export format: json, csv (default: json)","--since <duration> Time window","--connector <pattern> Filter","--type <pattern> Filter"]},{cmd:"cg config show",desc:"Show current config.yaml contents."},{cmd:"cg config set <key> <value>",desc:"Set a config value (section.property format).",example:"cg config set daemon.port 9999"},{cmd:"cg extension setup",desc:"Show extension path and instructions for Chrome installation."}],rw=[{step:"navigate",capability:"navigate",desc:"Open a URL in the browser tab"},{step:"wait",capability:"navigate",desc:"Wait for a selector or timeout"},{step:"extract",capability:"dom_read",desc:"Read data from DOM elements"},{step:"extract_tree",capability:"dom_read",desc:"Recursive DOM tree walk with ancestry"},{step:"extract_html",capability:"dom_read",desc:"Capture element HTML as a variable"},{step:"click",capability:"dom_write",desc:"Click an element"},{step:"click_all",capability:"dom_write",desc:"Click all matching elements (with re-scan loop)"},{step:"type",capability:"dom_write",desc:"Type text into an input"},{step:"intercept",capability:"intercept_response",desc:"Capture a network response body"},{step:"cookie",capability:"cookie_read",desc:"Read cookies for a domain"},{step:"fetch",capability:"cookie_read",desc:"HTTP request from page context"},{step:"map",capability:"—",desc:"Transform/rename extracted fields"},{step:"filter",capability:"—",desc:"Filter rows by condition"},{step:"set",capability:"—",desc:"Set a variable for later steps"},{step:"transform",capability:"—",desc:"Server-side data transform (e.g. HTML→Markdown)"}];function Sd({ep:e}){const[t,n]=v.useState(!1),s=e.params||e.body||e.response;return i.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[i.jsxs("button",{className:`flex items-center gap-3 w-full text-left px-3 py-2.5 ${s?"cursor-pointer hover:bg-base-200/50":""}`,onClick:()=>s&&n(!t),disabled:!s,children:[i.jsx(H,{variant:ew[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),i.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&i.jsx(H,{variant:"warning",size:"xs",children:"auth"}),s&&i.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),i.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&i.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),i.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function iw(){const[e,t]=v.useState("cli");return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),i.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:i.jsxs("p",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"X-CommandGarden: 1"})," CSRF header. The App Server handles auth internally — GUI requests don't need tokens."]})}),i.jsx("div",{className:"flex border-b border-base-300 mb-4",children:[{id:"cli",label:"CLI Commands",sub:"cg"},{id:"daemon-api",label:"Daemon API",sub:":9091"},{id:"app-api",label:"App Server API",sub:":9092"}].map(n=>i.jsxs("button",{className:`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${e===n.id?"border-primary text-primary":"border-transparent opacity-60 hover:opacity-100"}`,onClick:()=>t(n.id),children:[n.label," ",i.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&i.jsx("div",{className:"space-y-2 mb-8",children:sw.map(n=>i.jsxs("div",{className:"border border-base-300 p-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),i.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&i.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),i.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&i.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>i.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&i.jsx("div",{className:"mt-2 ml-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200/70 px-2 py-1 block opacity-60",children:n.example})})]},n.cmd))}),e==="daemon-api"&&i.jsx("div",{className:"border border-base-300 mb-8",children:tw.map((n,s)=>i.jsx(Sd,{ep:n},s))}),e==="app-api"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:":9092"})," proxies all daemon endpoints and adds app-specific routes for preferences, caching, goals, and journal generation."]}),i.jsx("div",{className:"border border-base-300 mb-8",children:nw.map((n,s)=>i.jsx(Sd,{ep:n},s))})]}),i.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["Available steps for connector YAML pipeline definitions. For why each capability runs where it does, see"," ",i.jsxs(je,{to:"/concepts#concepts-worlds",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Capability & World Model ",i.jsx(qe,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Description"})]})}),i.jsx("tbody",{children:rw.map(n=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),i.jsx("td",{children:i.jsx(H,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),i.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),i.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),i.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),i.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),i.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),i.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),i.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function aw(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
448
+ `),s=[];let r=null;for(const a of n){const o=a.match(/^(#{1,3})\s+(.+)/);o?(r&&s.push({heading:r.heading,body:r.lines.join(`
449
+ `).trim()}),r={heading:o[2],lines:[]}):r?r.lines.push(a):a.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(a))}return r&&s.push({heading:r.heading,body:r.lines.join(`
450
+ `).trim()}),s}function ow({content:e}){return i.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function Cd({file:e,defaultOpen:t}){const[n,s]=v.useState(t??!1),r=v.useMemo(()=>aw(e.content),[e.content]);return i.jsxs("div",{className:"border border-base-300/50",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left px-4 py-3 hover:bg-base-200/50 transition-colors",onClick:()=>s(!n),children:[i.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),i.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&i.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((a,o)=>i.jsxs("div",{children:[a.heading&&i.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:a.heading}),i.jsx(ow,{content:a.body})]},o))})]})}function lw({skill:e}){const[t,n]=v.useState(!1),s=e.files.find(a=>a.name==="SKILL.md"),r=e.files.filter(a=>a.name!=="SKILL.md");return i.jsxs("div",{className:"border border-base-300",children:[i.jsx("div",{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap min-w-0",children:[i.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),i.jsxs(H,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),i.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&i.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&i.jsx(Cd,{file:s,defaultOpen:!0}),r.map(a=>i.jsx(Cd,{file:a},a.name))]})]})}function cw(){const[e,t]=v.useState([]),[n,s]=v.useState(!0),[r,a]=v.useState(null);return v.useEffect(()=>{B.getSkills().then(o=>t(o.skills)).catch(o=>a(o instanceof Error?o.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?i.jsx(jt,{label:"Loading skills..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),i.jsx("p",{className:"text-sm opacity-60 mb-5",children:"AI agent skills bundled with commandGarden. These teach coding assistants how to use cg and author connectors."}),r?i.jsxs("div",{className:"border border-error/30 p-4",children:[i.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),i.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Skill"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Files"})]})}),i.jsx("tbody",{children:e.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:o.name}),i.jsx("td",{className:"text-sm opacity-60",children:o.description}),i.jsx("td",{className:"text-center",children:i.jsx(H,{size:"xs",children:o.files.length})})]},o.name))})]})}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),i.jsx("div",{className:"space-y-3",children:e.map(o=>i.jsx(lw,{skill:o},o.name))}),i.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[i.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),i.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"SKILL.md"})," into your AI assistant's skill directory to teach it how to use commandGarden."]}),i.jsxs("div",{className:"font-mono text-xs opacity-40",children:[i.jsx("span",{children:"Windsurf: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),i.jsx("span",{className:"mx-2",children:"|"}),i.jsx("span",{children:"Claude: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function un({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function ci({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}const uw={success:_c,warning:Hp,error:Vp},dw={success:"text-emerald-600 dark:text-emerald-400",warning:"text-amber-600 dark:text-amber-400",error:"text-red-600 dark:text-red-400"};function go({label:e,status:t}){const n=uw[t];return i.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium ${dw[t]}`,children:[i.jsx(n,{className:"w-3.5 h-3.5 shrink-0"}),e]})}const fw=[{label:"Return format",cg:{label:"Fixed schema",status:"success"},skills:{label:"Loose, varies",status:"warning"},mcp:{label:"Typed schema",status:"success"}},{label:"Parsing cost",cg:{label:"Zero tokens",status:"success"},skills:{label:"Tokens/call",status:"error"},mcp:{label:"Tool-call overhead",status:"warning"}},{label:"Auth handling",cg:{label:"Browser required",status:"warning"},skills:{label:"Agent navigates",status:"error"},mcp:{label:"Server-configured",status:"success"}},{label:"Processing",cg:{label:"Local only",status:"success"},skills:{label:"Cloud/agent",status:"warning"},mcp:{label:"Server-side",status:"warning"}},{label:"Privacy",cg:{label:"Stays on machine",status:"success"},skills:{label:"Through AI",status:"error"},mcp:{label:"Through server",status:"warning"}},{label:"Coverage",cg:{label:"Any website",status:"success"},skills:{label:"Any (expensive)",status:"warning"},mcp:{label:"Server-limited",status:"warning"}}];function hw(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsxs("section",{className:"pt-8 pb-16 border-b border-base-300",children:[i.jsx(un,{children:"For engineers tired of copy-pasting from internal portals"}),i.jsx("h1",{className:"font-display text-3xl sm:text-4xl font-bold tracking-tight leading-tight mb-3",style:{textWrap:"balance"},children:"Turn any website into a CLI command."}),i.jsx("p",{className:"text-base sm:text-lg opacity-70 max-w-[65ch] mb-8 leading-relaxed",style:{textWrap:"pretty"},children:"commandGarden reuses your existing browser sessions to extract structured data from authenticated websites. You're already logged in — it just reads what's on screen."}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-8 font-mono text-xs",children:[{label:"cg run",color:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400"},{label:"Daemon",color:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400"},{label:"Chrome Extension",color:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"},{label:"Browser Tab",color:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},{label:"Structured JSON",color:"border-primary/50 bg-primary/10 text-primary"}].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`px-2.5 py-1 border font-semibold ${e.color}`,children:e.label}),t<4&&i.jsx("span",{className:"opacity-30",children:"→"})]},e.label))}),i.jsx(ci,{children:"npm install -g @commandgarden/cli"})]}),i.jsxs("section",{id:"why-problem",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"Where the data actually lives"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"The Problem"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(ai,{className:"w-4 h-4 text-primary"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Real-world data lives in browsers"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI agents can't reach data inside enterprise tools and SaaS dashboards. These systems are where the work happens, but they're locked behind browser sessions."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Vp,{className:"w-4 h-4 text-error"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"APIs are the exception"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"Most sites don't provide APIs. When one exists, you need service accounts and OAuth flows before you see a single row of data. What's visible in the UI often has no programmatic equivalent."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Hp,{className:"w-4 h-4 text-warning"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Browser automation is expensive"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI browser tools like Playwright burn tokens on every interaction just to understand what's on screen — even when the page layout hasn't changed."})]})]}),i.jsx("p",{className:"text-sm opacity-50 max-w-[65ch]",children:"Skills, MCP servers, and browser agents all re-parse page structure on every call. That parsing only needs to happen once."})]}),i.jsxs("section",{id:"why-solution",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"How commandGarden works"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"The Solution"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-10",children:["commandGarden replaces ad-hoc browser automation with ",i.jsx("strong",{className:"text-base-content",children:"connectors"}),": pre-built recipes that know how to navigate a site and return structured JSON. The agent (or a human) runs one CLI command and gets back a fixed-schema response, instead of re-parsing the page from scratch."]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[i.jsxs("div",{className:"border border-error/20 bg-error/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-error/60 uppercase tracking-[0.12em] mb-4",children:"Without commandGarden"}),i.jsx("div",{className:"space-y-0",children:[{label:"Task received",note:"agent or human",struck:!1},{label:"Launch browser",note:"headless instance",struck:!0},{label:"Navigate + Wait",note:"auth redirects",struck:!0},{label:"Parse HTML",note:"tokens for structure",struck:!0},{label:"Extract Data",note:"tokens for content",struck:!0},{label:"Loose output",note:"varies per run",struck:!1}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:`flex items-center gap-2.5 ${e.struck?"opacity-40 line-through decoration-error/50":""}`,children:[i.jsx("span",{className:`w-5 h-5 border flex items-center justify-center font-mono text-[0.6rem] shrink-0 ${e.struck?"border-error/20 text-error/40":"border-error/30 bg-error/10 text-error/60"}`,children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<5&&i.jsx("div",{className:`ml-2.5 w-px h-2 ${e.struck?"bg-error/15":"bg-error/20"}`})]},t))})]}),i.jsxs("div",{className:"border border-primary/20 bg-primary/[0.03] p-5 flex flex-col",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-primary/60 uppercase tracking-[0.12em] mb-4",children:"With commandGarden"}),i.jsx("div",{className:"space-y-0",children:[{label:"Task received",note:"agent or human"},{label:"cg run site/command",note:"one CLI call",accent:!0},{label:"Structured JSON",note:"fixed schema"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-primary/30 bg-primary/10 flex items-center justify-center font-mono text-[0.6rem] text-primary/60 shrink-0",children:t+1}),i.jsx("span",{className:`text-sm font-medium ${"accent"in e&&e.accent?"text-primary font-semibold":""}`,children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<2&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-primary/20"})]},t))})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-14",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(H,{variant:"error",size:"xs",children:"thousands of tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"per interaction"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(H,{variant:"success",size:"xs",children:"0 tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"parsing done locally"})]})]}),i.jsxs("div",{className:"space-y-8 mb-12",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ai,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Reuse your browser session"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"A Chrome extension runs inside your already-authenticated browser. No separate login, no stored credentials."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ho,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Fixed-format parsing, done locally"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"Each connector defines a pipeline that produces the same output shape on every run. Parsing happens in the extension and daemon — nothing leaves your machine."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(Si,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"One CLI for humans and AI agents"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed mb-3",children:"The same command works whether a human types it or an AI agent calls it via a skill. Same arguments, same JSON schema."}),i.jsx(ci,{children:"cg run timetracking/report --month 2026-06"})]})]})]}),i.jsx("h3",{className:"font-display font-semibold text-sm mb-3",children:"How it compares"}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{className:"sticky left-0 z-10 bg-base-200"}),i.jsx("th",{className:"bg-primary/10 border-x border-primary/20 text-primary",children:"commandGarden"}),i.jsx("th",{children:"AI Skills"}),i.jsx("th",{children:"MCP Servers"})]})}),i.jsx("tbody",{children:fw.map(e=>i.jsxs("tr",{children:[i.jsx("td",{className:"sticky left-0 z-10 bg-base-100 font-mono text-xs font-medium border-r border-base-300",children:e.label}),i.jsx("td",{className:"bg-primary/5 border-x border-primary/20",children:i.jsx(go,{...e.cg})}),i.jsx("td",{children:i.jsx(go,{...e.skills})}),i.jsx("td",{children:i.jsx(go,{...e.mcp})})]},e.label))})]})}),i.jsxs("p",{className:"text-sm opacity-50 mt-4 max-w-[65ch]",children:["Skills and MCP provide the integration layer; commandGarden does the extraction and parsing locally. The ",i.jsx("span",{className:"font-mono",children:"cg"})," skill lets AI agents call commandGarden commands directly."]})]}),i.jsx("section",{id:"why-architecture",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(un,{children:"Five processes, all on localhost"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"All communication stays on localhost. Here's what each piece does."}),i.jsx("div",{className:"border border-base-300 bg-base-100 p-5 mb-8 overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 700 260",className:"w-full text-base-content",style:{minWidth:560},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"why-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.5})}),i.jsx("marker",{id:"why-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.5})})]}),i.jsx("rect",{x:10,y:10,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:65,y:30,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI"}),i.jsx("text",{x:65,y:44,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"cg run ..."}),i.jsx("rect",{x:10,y:80,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:65,y:100,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:65,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:160,y:80,width:120,height:46,rx:0,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.6)",strokeWidth:1}),i.jsx("text",{x:220,y:100,textAnchor:"middle",fill:"currentColor",fontSize:10,fontWeight:600,children:"App Server"}),i.jsx("text",{x:220,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:":9092"}),i.jsx("rect",{x:320,y:15,width:150,height:76,rx:0,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.7)",strokeWidth:1.5}),i.jsx("text",{x:395,y:40,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:395,y:56,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:395,y:78,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.45,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:520,y:20,width:130,height:55,rx:0,fill:"rgba(52,211,153,0.15)",stroke:"rgba(52,211,153,0.6)",strokeWidth:1}),i.jsx("text",{x:585,y:42,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:585,y:58,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:530,y:160,width:120,height:46,rx:0,fill:"rgba(167,139,250,0.15)",stroke:"rgba(167,139,250,0.6)",strokeWidth:1}),i.jsx("text",{x:590,y:180,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:590,y:194,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:310,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:355,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"Audit Log"}),i.jsx("rect",{x:410,y:170,width:80,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:450,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"Config"}),i.jsx("rect",{x:160,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:205,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"App DB"}),i.jsx("line",{x1:122,y1:33,x2:318,y2:45,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:210,y:28,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"HTTP"}),i.jsx("line",{x1:122,y1:103,x2:158,y2:103,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:282,y1:96,x2:318,y2:72,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:295,y:76,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:472,y1:48,x2:518,y2:48,stroke:"currentColor",strokeOpacity:.4,strokeWidth:1.5,markerEnd:"url(#why-ah)",markerStart:"url(#why-ah-rev)"}),i.jsx("text",{x:495,y:38,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:590,y1:77,x2:590,y2:158,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:370,y1:93,x2:365,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:430,y1:93,x2:445,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:210,y1:128,x2:210,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"})]})}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[{icon:Si,title:"CLI",mono:"cg",desc:"Entry point for humans and AI agents. One command in, JSON out."},{icon:bl,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:ai,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:ho,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:hd,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:Av,title:"GUI",mono:":9092",desc:"React SPA with app pages, connector browsing, and config management."}].map(({icon:e,title:t,mono:n,desc:s})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-1.5 mb-0.5",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx("span",{className:"font-mono text-[0.65rem] opacity-40",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]},t))}),i.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.jsxs(je,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Full architecture details ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(je,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts deep dive ",i.jsx(qe,{className:"w-3 h-3"})]})]})]})}),i.jsxs("section",{id:"why-apps",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"Ships with six connectors"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Built-in Apps"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with connectors and app pages for common enterprise tasks. Each runs on your local machine using your browser session."}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{icon:Pa,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:Kp,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:Wp,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:Yp,title:"Security News",tag:"Security",desc:"Aggregated feed from Socket.dev, Wiz, and tl;dr sec",route:"/apps/security-news",cmd:"socket/security-news"},{icon:hv,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:vv,title:"GCS Knowledge Base",tag:"Security",desc:"Browse and read internal security docs, converted to Markdown",route:null,cmd:"gcs/kb-pages"}].map(({icon:e,title:t,tag:n,desc:s,route:r,cmd:a})=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx(H,{size:"xs",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]}),i.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-base-300/50",children:[i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-30",children:["cg run ",a]}),r&&i.jsxs(je,{to:r,className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Open ",i.jsx(qe,{className:"w-3 h-3"})]})]})]},t))}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Each app page combines multiple connector calls into a single view. The GUI handles layout and caching; the connectors provide the raw data."})]}),i.jsxs("section",{id:"why-happy-path",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"From install to first result"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Si,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Human user"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Install",cmd:"npm install -g @commandgarden/cli"},{step:"Start",cmd:"cg up"},{step:"Load extension",cmd:"chrome://extensions → Load unpacked"},{step:"Verify",cmd:"cg daemon status"},{step:"Run",cmd:"cg run timetracking/report --month 2026-06"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsxs("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:["Or open the GUI at ",i.jsx("span",{className:"font-mono",children:"localhost:9092"})," and use the visual interface."]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(ai,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"AI agent"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Load skill",cmd:"cg skill loaded"},{step:"Check status",cmd:"cg daemon status → ready"},{step:"Discover",cmd:"cg list → available connectors"},{step:"Inspect",cmd:"cg inspect timetracking/report → args, columns"},{step:"Run",cmd:"cg run timetracking/report --format json"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsx("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:"Same JSON, same schema as the human path."})]})]}),i.jsxs("div",{className:"mt-8 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(_c,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"Human or agent, the output is the same. Same connector, same schema."})]})]}),i.jsx("section",{id:"why-security",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(un,{children:"Touching enterprise data means no shortcuts"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Security"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"This tool has access to your cookies and session tokens. That's a lot of trust, so the defaults are locked down — you have to explicitly open things up."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8",children:[{icon:qp,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:Fv,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:Gp,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:av,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:bl,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:ho,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation unless explicitly declared and approved."},{icon:Qp,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:hd,title:"Per-session auth",desc:"Session token generated on startup with owner-only permissions. Extension verifies its own ID per message."}].map(({icon:e,title:t,desc:n})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold text-sm mb-0.5",children:t}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:n})]})]},t))}),i.jsxs("div",{className:"border border-base-300 bg-base-100 p-5",children:[i.jsx("h3",{className:"font-mono text-xs font-medium opacity-50 uppercase tracking-wide mb-3",children:"Limitations"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5 text-sm opacity-70",children:[i.jsx("p",{children:"Only works while browser is open and you're logged in."}),i.jsx("p",{children:"Connectors may break when a site redesigns its HTML/APIs."}),i.jsx("p",{children:"Chrome-based browsers only for now."}),i.jsx("p",{children:"No credential storage, so sessions expire when you log out."})]})]})]})}),i.jsxs("section",{id:"why-get-started",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Get started in 60 seconds"}),i.jsx(ci,{children:`# Install
451
+ npm install -g @commandgarden/cli
452
+
453
+ # Start the daemon and GUI
454
+ cg up
455
+
456
+ # Load the Chrome extension
457
+ # Chrome → chrome://extensions → Developer mode → Load unpacked
458
+
459
+ # Run your first connector
460
+ cg run socket/security-news --format table`}),i.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[i.jsxs(je,{to:"/guide",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Setup Guide ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(je,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Architecture ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(je,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(je,{to:"/api-reference",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["API & CLI Reference ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(je,{to:"/skills",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Skills ",i.jsx(qe,{className:"w-3 h-3"})]})]})]}),i.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[i.jsx(un,{children:"Extend to any website"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Write your own connector"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"The built-in connectors cover common tasks, but you can write your own for any site. If you can see it in Chrome, you can turn it into a CLI command."}),i.jsx("div",{className:"space-y-3 mb-8",children:[["Create a YAML file","~/.commandgarden/connectors/"],["Declare the domain, capabilities, arguments, and columns",null],["Define a pipeline","navigate → wait → extract/fetch → map"],["Validate","cg validate my-connector.yaml"],["Run","cg run mysite/my-command --format json"]].map(([e,t],n)=>i.jsxs("div",{className:"flex gap-3 items-baseline",children:[i.jsxs("span",{className:"font-mono text-xs opacity-30 w-4 text-right shrink-0",children:[n+1,"."]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-medium",children:e}),t&&i.jsx("span",{className:"font-mono text-xs opacity-40 ml-2",children:t})]})]},n))}),i.jsx(ci,{children:`site: mysite
461
+ name: my-command
462
+ version: "1.0"
463
+ description: "Fetch search results"
464
+ access: read
465
+
466
+ domains:
467
+ - "mysite.example.com"
468
+ capabilities:
469
+ - navigate
470
+ - dom_read
471
+
472
+ args:
473
+ - name: query
474
+ type: string
475
+ required: true
476
+
477
+ columns:
478
+ - name: title
479
+ type: string
480
+ - name: url
481
+ type: string
482
+
483
+ pipeline:
484
+ - step: navigate
485
+ url: "https://mysite.example.com/search?q=\${{ args.query }}"
486
+ - step: wait
487
+ selector: ".results"
488
+ - step: extract
489
+ selector: ".results .item"
490
+ fields:
491
+ title: "h3"
492
+ url: "a@href"`}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Most connectors are pure YAML. The declarative format covers DOM extraction, cookie-authenticated API calls, network interception, and field mapping."})]})]})}function yo({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function pw({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}const Ed=[{icon:bl,title:"Background Worker",subtitle:"no page contact",access:"Never touches the page. Talks to Chrome APIs directly.",steps:["navigate","cookie"],tone:"border-sky-500/40 bg-sky-500/[0.04]"},{icon:Gp,title:"ISOLATED Content Script",subtitle:"DOM only",access:"Shares the live page DOM, but can't see the page's own JavaScript variables or in-memory state.",steps:["dom_read","dom_write","fetch"],tone:"border-emerald-500/40 bg-emerald-500/[0.04]"},{icon:ev,title:"MAIN Page World",subtitle:"full page access",access:"Runs in the exact same JS realm as the website itself. Anything the page can do, this can do too.",steps:["js_evaluate"],tone:"border-red-500/40 bg-red-500/[0.04]"}],mw=[{cap:"navigate",zone:"Background",risk:"info",desc:"Open a URL and wait for the page to finish loading."},{cap:"dom_read",zone:"ISOLATED",risk:"info",desc:"Read text and structure out of the page. Never modifies anything."},{cap:"dom_write",zone:"ISOLATED",risk:"warning",desc:"Click, type, and interact with page elements."},{cap:"cookie_read",zone:"Background / ISOLATED",risk:"warning",desc:"Reuse the browser's existing session to call an API or read a cookie value."},{cap:"js_evaluate",zone:"MAIN",risk:"error",desc:"Run arbitrary JavaScript in the page: the escape hatch for sites with no simpler path. Least constrained, used as a last resort."}],gw={title:"What happens when you run a command",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"client",to:"daemon",label:"cg run site/command"},{type:"action",lane:"daemon",label:"check auth + declared domains + capabilities"},{type:"arrow",from:"daemon",to:"extension",label:"send the pipeline"},{type:"arrow",from:"extension",to:"browser",label:"run each step in your open tab"},{type:"arrow",from:"browser",to:"extension",label:"page data"},{type:"arrow",from:"extension",to:"daemon",label:"structured rows"},{type:"arrow",from:"daemon",to:"client",label:"JSON / table / CSV"}]},yw={title:"When a step needs your OK",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"this step needs approval"},{type:"arrow",from:"daemon",to:"client",label:'prompt: "allow this?"'},{type:"arrow",from:"daemon",to:"extension",label:"also notify the extension"},{type:"arrow",from:"client",to:"daemon",label:"you say yes or no"},{type:"action",lane:"daemon",label:"whichever answers first wins"},{type:"action",lane:"daemon",label:"continue the pipeline, or stop and report why"}]},Td=[{label:"Low",variant:"success",desc:"Runs automatically. Reading data, navigating pages.",icon:_c},{label:"Medium",variant:"warning",desc:"Runs automatically, but every use is logged to the audit trail.",icon:Jp},{label:"High",variant:"error",desc:"Pauses for a yes/no, unless you've pre-approved that specific connector.",icon:Dv}];function xw(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Concepts"}),i.jsx("p",{className:"text-sm opacity-60 mb-10",children:"Three ideas worth understanding before you dig deeper into commandGarden."}),i.jsxs("section",{id:"concepts-worlds",className:"mb-16 scroll-mt-4",children:[i.jsx(yo,{children:"Not every step is equally trusted"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Capability & world model"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:["A connector's pipeline is a list of steps: ",i.jsx("span",{className:"font-mono text-xs",children:"navigate"}),","," ",i.jsx("span",{className:"font-mono text-xs",children:"extract"}),", ",i.jsx("span",{className:"font-mono text-xs",children:"click"}),", and so on. Each step type is only allowed to run in one of three places, and each place can see a little more of the page than the last."]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4",children:Ed.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:`border p-4 h-full ${e.tone}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx("span",{className:"font-display font-semibold text-sm",children:e.title})]}),i.jsx(H,{size:"xs",className:"mb-2",children:e.subtitle}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed mb-3",children:e.access}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.steps.map(n=>i.jsx("span",{className:"font-mono text-[0.65rem] px-1.5 py-0.5 bg-base-200 border border-base-300",children:n},n))})]}),t<Ed.length-1&&i.jsx(qe,{className:"hidden md:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.title))}),i.jsx("p",{className:"text-xs opacity-40 mb-8",children:"More access, left to right. Most steps never need the rightmost zone."}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Runs in"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"What it does"})]})}),i.jsx("tbody",{children:mw.map(e=>i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-xs font-semibold",children:e.cap}),i.jsx("td",{className:"text-xs opacity-60",children:e.zone}),i.jsx("td",{children:i.jsx(H,{variant:e.risk,size:"xs",children:e.risk==="info"?"low":e.risk==="warning"?"medium":"high"})}),i.jsx("td",{className:"text-sm opacity-70",children:e.desc})]},e.cap))})]})})]}),i.jsxs("section",{id:"concepts-lifecycle",className:"mb-16 scroll-mt-4",children:[i.jsx(yo,{children:"From command to structured data"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Connector pipeline lifecycle"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"A connector is a YAML file describing a pipeline. Running it walks the same four hops every time, whether you typed the command or an AI agent did."}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1.3fr_1fr] gap-4 mb-2",children:[i.jsx(kl,{flow:gw}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"A minimal connector pipeline"}),i.jsx(pw,{children:`pipeline:
493
+ - step: navigate
494
+ url: "https://example.com/tickets"
495
+ - step: wait
496
+ selector: ".ticket-row"
497
+ - step: extract
498
+ selector: ".ticket-row"
499
+ fields:
500
+ id: ".ticket-id"
501
+ title: ".ticket-title"`}),i.jsxs("p",{className:"text-xs opacity-50 mt-2",children:["Each ",i.jsx("span",{className:"font-mono",children:"step"})," above maps to one hop in the diagram: navigate opens the tab, wait confirms it loaded, extract reads structured rows back out."]})]})]})]}),i.jsxs("section",{id:"concepts-approval",className:"scroll-mt-4",children:[i.jsx(yo,{children:"Not everything runs unattended"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Approval & risk-tiering workflow"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"Every capability has a risk tier. Low and medium tiers run without interruption. High-risk steps pause and wait for a human to say yes, either in the CLI or as a Chrome notification."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-8",children:Td.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"border border-base-300 p-4 h-full",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx(H,{variant:e.variant,size:"xs",children:e.label})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:e.desc})]}),t<Td.length-1&&i.jsx(qe,{className:"hidden sm:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.label))}),i.jsx(kl,{flow:yw}),i.jsxs("div",{className:"mt-6 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(qp,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"No credentials are ever stored to make this work. Approval just gates whether an already-authenticated step is allowed to run."})]})]})]})}v.lazy(()=>Mg(()=>import("./Slides-CDEAUexS.js"),[]));function Gs({isActive:e}){return`flex items-center gap-2 px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}function zs({isActive:e}){return`flex items-center gap-2 pl-4 pr-3 py-1.5 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const Fs={"/config":[{label:"Server",id:"cfg-server"},{label:"Security",id:"cfg-security"},{label:"Sources",id:"cfg-sources"},{label:"Audit",id:"cfg-audit"},{label:"Output",id:"cfg-output"},{label:"Journal",id:"cfg-journal"}],"/architecture":[{label:"Diagram",id:"arch-diagram"},{label:"Components",id:"arch-components"},{label:"Data Stores",id:"arch-stores"},{label:"Data Flows",id:"arch-flows"},{label:"Security",id:"arch-security"},{label:"Packages",id:"arch-packages"},{label:"Build Order",id:"arch-build"}],"/api-reference":[{label:"Endpoints",id:"api-endpoints"},{label:"Pipeline Steps",id:"api-pipeline"},{label:"Expressions",id:"api-expressions"}],"/concepts":[{label:"Capability & World Model",id:"concepts-worlds"},{label:"Pipeline Lifecycle",id:"concepts-lifecycle"},{label:"Approval & Risk-Tiering",id:"concepts-approval"}],"/why":[{label:"The Problem",id:"why-problem"},{label:"The Solution",id:"why-solution"},{label:"Architecture",id:"why-architecture"},{label:"Built-in Apps",id:"why-apps"},{label:"Workflow",id:"why-happy-path"},{label:"Security",id:"why-security"},{label:"Get Started",id:"why-get-started"},{label:"Extend",id:"why-extend"}]};function vw({sections:e}){const t=v.useMemo(()=>e.map(r=>r.id),[e]),n=Hy(t),s=r=>{const a=document.getElementById(r);a&&a.scrollIntoView({behavior:"smooth",block:"start"})};return i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>i.jsx("button",{onClick:()=>s(r.id),className:`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${n===r.id?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:r.label},r.id))})}function Mn({to:e,label:t,icon:n,sections:s}){const a=An().pathname===e;return i.jsxs(i.Fragment,{children:[i.jsxs(gt,{to:e,end:e==="/",className:Gs,children:[n,t]}),a&&s.length>0&&i.jsx(vw,{sections:s})]})}function bw(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,a]=v.useState(!1),[o,c]=v.useState([]),[l,u]=v.useState(!1),h=v.useRef(null),d=An();v.useEffect(()=>{a(!1)},[d.pathname]),v.useEffect(()=>{if(!d.hash)return;const b=d.hash.slice(1),g=document.getElementById(b);g&&g.scrollIntoView({behavior:"smooth",block:"start"})},[d.pathname,d.hash]),v.useEffect(()=>{const b=()=>{B.getStatus().then(w=>{t(w.ok),s(w.extensionConnected)}).catch(()=>{t(!1),s(!1)})};b();const g=setInterval(b,3e4);return()=>clearInterval(g)},[]),v.useEffect(()=>{B.getConnectors().then(b=>{const g=wa(b.connectors).map(([w])=>w);c(g)}).catch(()=>{})},[]);const p=v.useMemo(()=>o.map(b=>({label:b,id:`conn-${b}`})),[o]),x=v.useCallback(()=>{const b=h.current;b&&u(b.scrollHeight-b.scrollTop-b.clientHeight>1)},[]);return v.useEffect(()=>{x();const b=h.current;if(b)return b.addEventListener("scroll",x,{passive:!0}),window.addEventListener("resize",x),()=>{b.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[x,p,d.pathname,e]),i.jsxs("div",{className:"flex min-h-screen",children:[i.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>a(!r),"aria-label":r?"Close menu":"Open menu",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&i.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>a(!1)}),i.jsxs("aside",{className:`w-56 bg-base-100 border-r border-base-300 flex flex-col fixed top-0 left-0 bottom-0 z-40 transition-transform duration-150 ease-out ${r?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[i.jsxs("div",{className:"flex items-start justify-between px-3 py-3 border-b border-base-300",children:[i.jsxs(je,{to:"/",className:"hover:opacity-80 transition-opacity",children:[i.jsxs("h1",{className:"font-display text-lg font-bold tracking-tight",children:[i.jsx("span",{className:"font-normal opacity-50",children:"command"}),"Garden"]}),i.jsx("p",{className:"font-mono text-[0.65rem] opacity-30 mt-1 uppercase tracking-[0.14em]",children:"browser automation"})]}),i.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>{const b=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",b),localStorage.setItem("theme",b)},"aria-label":"Toggle theme",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]}),i.jsxs("div",{className:"relative flex-1 min-h-0",children:[i.jsxs("nav",{ref:h,className:"h-full px-2 py-2 space-y-0.5 overflow-y-auto",children:[i.jsx("div",{className:"px-3 pt-3 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Overview"}),i.jsxs(gt,{to:"/",end:!0,className:Gs,children:[i.jsx(yv,{className:"w-4 h-4 shrink-0"}),"Dashboard"]}),i.jsxs(gt,{to:"/guide",className:Gs,children:[i.jsx(Wp,{className:"w-4 h-4 shrink-0"}),"Setup Guide"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Apps"}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Administrative"}),i.jsxs(gt,{to:"/apps/timetracking",className:zs,children:[i.jsx(Pa,{className:"w-4 h-4 shrink-0"}),"Time Tracking"]}),i.jsxs(gt,{to:"/apps/rooms",className:zs,children:[i.jsx(Kp,{className:"w-4 h-4 shrink-0"}),"Room Availability"]}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Productivity"}),i.jsxs(gt,{to:"/apps/journal",className:zs,children:[i.jsx(Ev,{className:"w-4 h-4 shrink-0"}),"Dev Journal"]}),i.jsxs(gt,{to:"/apps/trusted-peer-expiry",className:zs,children:[i.jsx(Jp,{className:"w-4 h-4 shrink-0"}),"Trusted Peer Expiry"]}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Security"}),i.jsxs(gt,{to:"/apps/security-news",className:zs,children:[i.jsx(Yp,{className:"w-4 h-4 shrink-0"}),"Security News"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Platform"}),i.jsx(Mn,{to:"/connectors",label:"Connectors",icon:i.jsx(Pv,{className:"w-4 h-4 shrink-0"}),sections:p}),i.jsxs(gt,{to:"/audit",className:Gs,children:[i.jsx(Qp,{className:"w-4 h-4 shrink-0"}),"Audit Log"]}),i.jsx(Mn,{to:"/config",label:"Configuration",icon:i.jsx(Mv,{className:"w-4 h-4 shrink-0"}),sections:e?Fs["/config"]:[]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Reference"}),i.jsx(Mn,{to:"/why",label:"Why commandGarden",icon:i.jsx(wv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/why"]}),i.jsx(Mn,{to:"/api-reference",label:"API & CLI",icon:i.jsx(Si,{className:"w-4 h-4 shrink-0"}),sections:Fs["/api-reference"]}),i.jsxs(gt,{to:"/skills",className:Gs,children:[i.jsx(wl,{className:"w-4 h-4 shrink-0"}),"Skills"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Deep Dive"}),i.jsx(Mn,{to:"/concepts",label:"Concepts",icon:i.jsx(mv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/concepts"]}),i.jsx(Mn,{to:"/architecture",label:"Architecture",icon:i.jsx(Nv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/architecture"]}),!1]}),l&&i.jsx("div",{className:"pointer-events-none absolute bottom-0 inset-x-0 h-8 bg-gradient-to-t from-base-100 to-transparent","aria-hidden":"true"})]}),i.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),i.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:i.jsx(Ty,{})})]})}function ww(){return i.jsx(Ry,{children:i.jsx(Ly,{children:i.jsxs(xe,{element:i.jsx(bw,{}),children:[i.jsx(xe,{index:!0,element:i.jsx(Gy,{})}),i.jsx(xe,{path:"connectors",element:i.jsx(Qy,{})}),i.jsx(xe,{path:"connectors/:site/:name",element:i.jsx(Jy,{})}),i.jsx(xe,{path:"audit",element:i.jsx(ex,{})}),i.jsx(xe,{path:"config",element:i.jsx(m1,{})}),i.jsx(xe,{path:"guide",element:i.jsx(k1,{})}),i.jsx(xe,{path:"apps/timetracking",element:i.jsx(rb,{})}),i.jsx(xe,{path:"apps/rooms",element:i.jsx(xb,{})}),i.jsx(xe,{path:"apps/journal",element:i.jsx(Ob,{})}),i.jsx(xe,{path:"apps/security-news",element:i.jsx(Bb,{})}),i.jsx(xe,{path:"apps/trusted-peer-expiry",element:i.jsx(Kb,{})}),i.jsx(xe,{path:"architecture",element:i.jsx(Zb,{})}),i.jsx(xe,{path:"api-reference",element:i.jsx(iw,{})}),i.jsx(xe,{path:"skills",element:i.jsx(cw,{})}),i.jsx(xe,{path:"why",element:i.jsx(hw,{})}),i.jsx(xe,{path:"concepts",element:i.jsx(xw,{})}),!1]})})})}Uh(document.getElementById("root")).render(i.jsx(v.StrictMode,{children:i.jsx(ww,{})}));export{Wp as B,H1 as C,hd as D,Gp as E,ho as F,ai as G,qp as L,Av as P,bl as S,Si as T,K1 as a,Vp as b,W as c,Hp as d,Fv as e,av as f,H as g,i as j,v as r,cy as u};