@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
@@ -1,461 +0,0 @@
1
- function tp(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 np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Td={exports:{}},sa={},Ad={exports:{}},V={};/**
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 Tr=Symbol.for("react.element"),sp=Symbol.for("react.portal"),rp=Symbol.for("react.fragment"),ip=Symbol.for("react.strict_mode"),ap=Symbol.for("react.profiler"),op=Symbol.for("react.provider"),lp=Symbol.for("react.context"),cp=Symbol.for("react.forward_ref"),up=Symbol.for("react.suspense"),dp=Symbol.for("react.memo"),fp=Symbol.for("react.lazy"),Mc=Symbol.iterator;function mp(e){return e===null||typeof e!="object"?null:(e=Mc&&e[Mc]||e["@@iterator"],typeof e=="function"?e:null)}var Ld={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pd=Object.assign,Id={};function ys(e,t,n){this.props=e,this.context=t,this.refs=Id,this.updater=n||Ld}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 Od(){}Od.prototype=ys.prototype;function jl(e,t,n){this.props=e,this.context=t,this.refs=Id,this.updater=n||Ld}var wl=jl.prototype=new Od;wl.constructor=jl;Pd(wl,ys.prototype);wl.isPureReactComponent=!0;var Dc=Array.isArray,_d=Object.prototype.hasOwnProperty,kl={current:null},Md={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)_d.call(t,s)&&!Md.hasOwnProperty(s)&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return{$$typeof:Tr,type:e,key:a,ref:o,props:r,_owner:kl.current}}function hp(e,t){return{$$typeof:Tr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Nl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tr}function pp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $c=/\/+/g;function Pa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pp(""+e.key):t.toString(36)}function di(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 Tr:case sp:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+Pa(o,0):s,Dc(r)?(n="",e!=null&&(n=e.replace($c,"$&/")+"/"),di(r,t,n,"",function(u){return u})):r!=null&&(Nl(r)&&(r=hp(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace($c,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",Dc(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Pa(a,l);o+=di(a,t,n,c,r)}else if(c=mp(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Pa(a,l++),o+=di(a,t,n,c,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 zr(e,t,n){if(e==null)return e;var s=[],r=0;return di(e,s,"","",function(a){return t.call(n,a,r++)}),s}function gp(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 Oe={current:null},fi={transition:null},yp={ReactCurrentDispatcher:Oe,ReactCurrentBatchConfig:fi,ReactCurrentOwner:kl};function $d(){throw Error("act(...) is not supported in production builds of React.")}V.Children={map:zr,forEach:function(e,t,n){zr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zr(e,function(){t++}),t},toArray:function(e){return zr(e,function(t){return t})||[]},only:function(e){if(!Nl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Component=ys;V.Fragment=rp;V.Profiler=ap;V.PureComponent=jl;V.StrictMode=ip;V.Suspense=up;V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yp;V.act=$d;V.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=Pd({},e.props),r=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=kl.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)_d.call(t,c)&&!Md.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Tr,type:e.type,key:r,ref:a,props:s,_owner:o}};V.createContext=function(e){return e={$$typeof:lp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:op,_context:e},e.Consumer=e};V.createElement=Dd;V.createFactory=function(e){var t=Dd.bind(null,e);return t.type=e,t};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:cp,render:e}};V.isValidElement=Nl;V.lazy=function(e){return{$$typeof:fp,_payload:{_status:-1,_result:e},_init:gp}};V.memo=function(e,t){return{$$typeof:dp,type:e,compare:t===void 0?null:t}};V.startTransition=function(e){var t=fi.transition;fi.transition={};try{e()}finally{fi.transition=t}};V.unstable_act=$d;V.useCallback=function(e,t){return Oe.current.useCallback(e,t)};V.useContext=function(e){return Oe.current.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e){return Oe.current.useDeferredValue(e)};V.useEffect=function(e,t){return Oe.current.useEffect(e,t)};V.useId=function(){return Oe.current.useId()};V.useImperativeHandle=function(e,t,n){return Oe.current.useImperativeHandle(e,t,n)};V.useInsertionEffect=function(e,t){return Oe.current.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return Oe.current.useLayoutEffect(e,t)};V.useMemo=function(e,t){return Oe.current.useMemo(e,t)};V.useReducer=function(e,t,n){return Oe.current.useReducer(e,t,n)};V.useRef=function(e){return Oe.current.useRef(e)};V.useState=function(e){return Oe.current.useState(e)};V.useSyncExternalStore=function(e,t,n){return Oe.current.useSyncExternalStore(e,t,n)};V.useTransition=function(){return Oe.current.useTransition()};V.version="18.3.1";Ad.exports=V;var b=Ad.exports;const xp=np(b),vp=tp({__proto__:null,default:xp},[b]);/**
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 bp=b,jp=Symbol.for("react.element"),wp=Symbol.for("react.fragment"),kp=Object.prototype.hasOwnProperty,Np=bp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Sp={key:!0,ref:!0,__self:!0,__source:!0};function Rd(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)kp.call(t,s)&&!Sp.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:jp,type:e,key:a,ref:o,props:r,_owner:Np.current}}sa.Fragment=wp;sa.jsx=Rd;sa.jsxs=Rd;Td.exports=sa;var i=Td.exports,zd={exports:{}},Ke={},Fd={exports:{}},Bd={};/**
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(A,_){var $=A.length;A.push(_);e:for(;0<$;){var z=$-1>>>1,J=A[z];if(0<r(J,_))A[z]=_,A[$]=J,$=z;else break e}}function n(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var _=A[0],$=A.pop();if($!==_){A[0]=$;e:for(var z=0,J=A.length,xe=J>>>1;z<xe;){var Me=2*(z+1)-1,un=A[Me],gt=Me+1,O=A[gt];if(0>r(un,$))gt<J&&0>r(O,un)?(A[z]=O,A[gt]=$,z=gt):(A[z]=un,A[Me]=$,z=Me);else if(gt<J&&0>r(O,$))A[z]=O,A[gt]=$,z=gt;else break e}}return _}function r(A,_){var $=A.sortIndex-_.sortIndex;return $!==0?$:A.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],m=1,d=null,f=3,v=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(A){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=A)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function j(A){if(x=!1,h(A),!y)if(n(c)!==null)y=!0,I(k);else{var _=n(u);_!==null&&R(j,_.startTime-A)}}function k(A,_){y=!1,x&&(x=!1,g(N),N=-1),v=!0;var $=f;try{for(h(_),d=n(c);d!==null&&(!(d.expirationTime>_)||A&&!F());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var J=z(d.expirationTime<=_);_=e.unstable_now(),typeof J=="function"?d.callback=J:d===n(c)&&s(c),h(_)}else s(c);d=n(c)}if(d!==null)var xe=!0;else{var Me=n(u);Me!==null&&R(j,Me.startTime-_),xe=!1}return xe}finally{d=null,f=$,v=!1}}var C=!1,S=null,N=-1,T=5,L=-1;function F(){return!(e.unstable_now()-L<T)}function H(){if(S!==null){var A=e.unstable_now();L=A;var _=!0;try{_=S(!0,A)}finally{_?G():(C=!1,S=null)}}else C=!1}var G;if(typeof p=="function")G=function(){p(H)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,D=E.port2;E.port1.onmessage=H,G=function(){D.postMessage(null)}}else G=function(){w(H,0)};function I(A){S=A,C||(C=!0,G())}function R(A,_){N=w(function(){A(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(A){A.callback=null},e.unstable_continueExecution=function(){y||v||(y=!0,I(k))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(A){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var $=f;f=_;try{return A()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,_){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var $=f;f=A;try{return _()}finally{f=$}},e.unstable_scheduleCallback=function(A,_,$){var z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?z+$:z):$=z,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=$+J,A={id:m++,callback:_,priorityLevel:A,startTime:$,expirationTime:J,sortIndex:-1},$>z?(A.sortIndex=$,t(u,A),n(c)===null&&A===n(u)&&(x?(g(N),N=-1):x=!0,R(j,$-z))):(A.sortIndex=J,t(c,A),y||v||(y=!0,I(k))),A},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(A){var _=f;return function(){var $=f;f=_;try{return A.apply(this,arguments)}finally{f=$}}}})(Bd);Fd.exports=Bd;var Cp=Fd.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 Ep=b,Ve=Cp;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 Ud=new Set,ar={};function An(e,t){os(e,t),os(e+"Capture",t)}function os(e,t){for(ar[e]=t,e=0;e<t.length;e++)Ud.add(t[e])}var It=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),go=Object.prototype.hasOwnProperty,Tp=/^[: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 Ap(e){return go.call(zc,e)?!0:go.call(Rc,e)?!1:Tp.test(e)?zc[e]=!0:(Rc[e]=!0,!1)}function Lp(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 Pp(e,t,n,s){if(t===null||typeof t>"u"||Lp(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 Sl=/[\-:]([a-z])/g;function Cl(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(Sl,Cl);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(Sl,Cl);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(Sl,Cl);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 El(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")&&(Pp(t,n,r,s)&&(n=null),s||r===null?Ap(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 Dt=Ep.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fr=Symbol.for("react.element"),$n=Symbol.for("react.portal"),Rn=Symbol.for("react.fragment"),Tl=Symbol.for("react.strict_mode"),yo=Symbol.for("react.profiler"),Wd=Symbol.for("react.provider"),Hd=Symbol.for("react.context"),Al=Symbol.for("react.forward_ref"),xo=Symbol.for("react.suspense"),vo=Symbol.for("react.suspense_list"),Ll=Symbol.for("react.memo"),Ft=Symbol.for("react.lazy"),Vd=Symbol.for("react.offscreen"),Fc=Symbol.iterator;function As(e){return e===null||typeof e!="object"?null:(e=Fc&&e[Fc]||e["@@iterator"],typeof e=="function"?e:null)}var oe=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 Oa=!1;function _a(e,t){if(!e||Oa)return"";Oa=!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,l=a.length-1;1<=o&&0<=l&&r[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(r[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||r[o]!==a[l]){var c=`
37
- `+r[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bs(e):""}function Ip(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=_a(e.type,!1),e;case 11:return e=_a(e.type.render,!1),e;case 1:return e=_a(e.type,!0),e;default:return""}}function bo(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 Rn:return"Fragment";case $n:return"Portal";case yo:return"Profiler";case Tl:return"StrictMode";case xo:return"Suspense";case vo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hd:return(e.displayName||"Context")+".Consumer";case Wd:return(e._context.displayName||"Context")+".Provider";case Al:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ll:return t=e.displayName||null,t!==null?t:bo(e.type)||"Memo";case Ft:t=e._payload,e=e._init;try{return bo(e(t))}catch{}}return null}function Op(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 bo(t);case 8:return t===Tl?"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 rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _p(e){var t=Kd(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 Br(e){e._valueTracker||(e._valueTracker=_p(e))}function Gd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Kd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ei(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 jo(e,t){var n=t.checked;return oe({},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=rn(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 qd(e,t){t=t.checked,t!=null&&El(e,"checked",t,!1)}function wo(e,t){qd(e,t);var n=rn(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")?ko(e,t.type,n):t.hasOwnProperty("defaultValue")&&ko(e,t.type,rn(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 ko(e,t,n){(t!=="number"||Ei(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Us=Array.isArray;function Zn(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=""+rn(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 No(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return oe({},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:rn(n)}}function Yd(e,t){var n=rn(t.value),s=rn(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 Qd(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 So(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Qd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ur,Jd=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(Ur=Ur||document.createElement("div"),Ur.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ur.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ys={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},Mp=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){Mp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ys[t]=Ys[e]})});function Xd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}function Zd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Xd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Dp=oe({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 Co(e,t){if(t){if(Dp[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 Eo(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 To=null;function Pl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ao=null,es=null,ts=null;function Vc(e){if(e=Pr(e)){if(typeof Ao!="function")throw Error(P(280));var t=e.stateNode;t&&(t=la(t),Ao(e.stateNode,e.type,t))}}function ef(e){es?ts?ts.push(e):ts=[e]:es=e}function tf(){if(es){var e=es,t=ts;if(ts=es=null,Vc(e),t)for(e=0;e<t.length;e++)Vc(t[e])}}function nf(e,t){return e(t)}function sf(){}var Ma=!1;function rf(e,t,n){if(Ma)return e(t,n);Ma=!0;try{return nf(e,t,n)}finally{Ma=!1,(es!==null||ts!==null)&&(sf(),tf())}}function lr(e,t){var n=e.stateNode;if(n===null)return null;var s=la(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 Lo=!1;if(It)try{var Ls={};Object.defineProperty(Ls,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Lo=!1}function $p(e,t,n,s,r,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(m){this.onError(m)}}var Qs=!1,Ti=null,Ai=!1,Po=null,Rp={onError:function(e){Qs=!0,Ti=e}};function zp(e,t,n,s,r,a,o,l,c){Qs=!1,Ti=null,$p.apply(Rp,arguments)}function Fp(e,t,n,s,r,a,o,l,c){if(zp.apply(this,arguments),Qs){if(Qs){var u=Ti;Qs=!1,Ti=null}else throw Error(P(198));Ai||(Ai=!0,Po=u)}}function Ln(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 af(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(Ln(e)!==e)throw Error(P(188))}function Bp(e){var t=e.alternate;if(!t){if(t=Ln(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,l=r.child;l;){if(l===n){o=!0,n=r,s=a;break}if(l===s){o=!0,s=r,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=r;break}if(l===s){o=!0,s=a,n=r;break}l=l.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 of(e){return e=Bp(e),e!==null?lf(e):null}function lf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lf(e);if(t!==null)return t;e=e.sibling}return null}var cf=Ve.unstable_scheduleCallback,Gc=Ve.unstable_cancelCallback,Up=Ve.unstable_shouldYield,Wp=Ve.unstable_requestPaint,ue=Ve.unstable_now,Hp=Ve.unstable_getCurrentPriorityLevel,Il=Ve.unstable_ImmediatePriority,uf=Ve.unstable_UserBlockingPriority,Li=Ve.unstable_NormalPriority,Vp=Ve.unstable_LowPriority,df=Ve.unstable_IdlePriority,ra=null,jt=null;function Kp(e){if(jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(ra,e,void 0,(e.current.flags&128)===128)}catch{}}var dt=Math.clz32?Math.clz32:Yp,Gp=Math.log,qp=Math.LN2;function Yp(e){return e>>>=0,e===0?32:31-(Gp(e)/qp|0)|0}var Wr=64,Hr=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 Pi(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 l=o&~r;l!==0?s=Ws(l):(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-dt(t),r=1<<n,s|=e[n],t&=~r;return s}function Qp(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 Jp(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-dt(a),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=Qp(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Io(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ff(){var e=Wr;return Wr<<=1,!(Wr&4194240)&&(Wr=64),e}function Da(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ar(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dt(t),e[t]=n}function Xp(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-dt(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function Ol(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-dt(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var Q=0;function mf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hf,_l,pf,gf,yf,Oo=!1,Vr=[],qt=null,Yt=null,Qt=null,cr=new Map,ur=new Map,Wt=[],Zp="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":qt=null;break;case"dragenter":case"dragleave":Yt=null;break;case"mouseover":case"mouseout":Qt=null;break;case"pointerover":case"pointerout":cr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ur.delete(t.pointerId)}}function Ps(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=Pr(t),t!==null&&_l(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function e0(e,t,n,s,r){switch(t){case"focusin":return qt=Ps(qt,e,t,n,s,r),!0;case"dragenter":return Yt=Ps(Yt,e,t,n,s,r),!0;case"mouseover":return Qt=Ps(Qt,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return cr.set(a,Ps(cr.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,ur.set(a,Ps(ur.get(a)||null,e,t,n,s,r)),!0}return!1}function xf(e){var t=pn(e.target);if(t!==null){var n=Ln(t);if(n!==null){if(t=n.tag,t===13){if(t=af(n),t!==null){e.blockedOn=t,yf(e.priority,function(){pf(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 mi(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);To=s,n.target.dispatchEvent(s),To=null}else return t=Pr(n),t!==null&&_l(t),e.blockedOn=n,!1;t.shift()}return!0}function Yc(e,t,n){mi(e)&&n.delete(t)}function t0(){Oo=!1,qt!==null&&mi(qt)&&(qt=null),Yt!==null&&mi(Yt)&&(Yt=null),Qt!==null&&mi(Qt)&&(Qt=null),cr.forEach(Yc),ur.forEach(Yc)}function Is(e,t){e.blockedOn===t&&(e.blockedOn=null,Oo||(Oo=!0,Ve.unstable_scheduleCallback(Ve.unstable_NormalPriority,t0)))}function dr(e){function t(r){return Is(r,e)}if(0<Vr.length){Is(Vr[0],e);for(var n=1;n<Vr.length;n++){var s=Vr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(qt!==null&&Is(qt,e),Yt!==null&&Is(Yt,e),Qt!==null&&Is(Qt,e),cr.forEach(t),ur.forEach(t),n=0;n<Wt.length;n++)s=Wt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Wt.length&&(n=Wt[0],n.blockedOn===null);)xf(n),n.blockedOn===null&&Wt.shift()}var ns=Dt.ReactCurrentBatchConfig,Ii=!0;function n0(e,t,n,s){var r=Q,a=ns.transition;ns.transition=null;try{Q=1,Ml(e,t,n,s)}finally{Q=r,ns.transition=a}}function s0(e,t,n,s){var r=Q,a=ns.transition;ns.transition=null;try{Q=4,Ml(e,t,n,s)}finally{Q=r,ns.transition=a}}function Ml(e,t,n,s){if(Ii){var r=_o(e,t,n,s);if(r===null)Ka(e,t,s,Oi,n),qc(e,s);else if(e0(r,e,t,n,s))s.stopPropagation();else if(qc(e,s),t&4&&-1<Zp.indexOf(e)){for(;r!==null;){var a=Pr(r);if(a!==null&&hf(a),a=_o(e,t,n,s),a===null&&Ka(e,t,s,Oi,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else Ka(e,t,s,null,n)}}var Oi=null;function _o(e,t,n,s){if(Oi=null,e=Pl(s),e=pn(e),e!==null)if(t=Ln(e),t===null)e=null;else if(n=t.tag,n===13){if(e=af(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 vf(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(Hp()){case Il:return 1;case uf:return 4;case Li:case Vp:return 16;case df:return 536870912;default:return 16}default:return 16}}var Vt=null,Dl=null,hi=null;function bf(){if(hi)return hi;var e,t=Dl,n=t.length,s,r="value"in Vt?Vt.value:Vt.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 Kr(){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 l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Kr:Qc,this.isPropagationStopped=Qc,this}return oe(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=Kr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kr)},persist:function(){},isPersistent:Kr}),t}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=Ge(xs),Lr=oe({},xs,{view:0,detail:0}),r0=Ge(Lr),$a,Ra,Os,ia=oe({},Lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rl,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"?($a=e.screenX-Os.screenX,Ra=e.screenY-Os.screenY):Ra=$a=0,Os=e),$a)},movementY:function(e){return"movementY"in e?e.movementY:Ra}}),Jc=Ge(ia),i0=oe({},ia,{dataTransfer:0}),a0=Ge(i0),o0=oe({},Lr,{relatedTarget:0}),za=Ge(o0),l0=oe({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),c0=Ge(l0),u0=oe({},xs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),d0=Ge(u0),f0=oe({},xs,{data:0}),Xc=Ge(f0),m0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h0={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"},p0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=p0[e])?!!t[e]:!1}function Rl(){return g0}var y0=oe({},Lr,{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"?h0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rl,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}}),x0=Ge(y0),v0=oe({},ia,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zc=Ge(v0),b0=oe({},Lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rl}),j0=Ge(b0),w0=oe({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),k0=Ge(w0),N0=oe({},ia,{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}),S0=Ge(N0),C0=[9,13,27,32],zl=It&&"CompositionEvent"in window,Js=null;It&&"documentMode"in document&&(Js=document.documentMode);var E0=It&&"TextEvent"in window&&!Js,jf=It&&(!zl||Js&&8<Js&&11>=Js),eu=" ",tu=!1;function wf(e,t){switch(e){case"keyup":return C0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function T0(e,t){switch(e){case"compositionend":return kf(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 A0(e,t){if(zn)return e==="compositionend"||!zl&&wf(e,t)?(e=bf(),hi=Dl=Vt=null,zn=!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 L0={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"?!!L0[e.type]:t==="textarea"}function Nf(e,t,n,s){ef(s),t=_i(t,"onChange"),0<t.length&&(n=new $l("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Xs=null,fr=null;function P0(e){Mf(e,0)}function aa(e){var t=Un(e);if(Gd(t))return e}function I0(e,t){if(e==="change")return t}var Sf=!1;if(It){var Fa;if(It){var Ba="oninput"in document;if(!Ba){var su=document.createElement("div");su.setAttribute("oninput","return;"),Ba=typeof su.oninput=="function"}Fa=Ba}else Fa=!1;Sf=Fa&&(!document.documentMode||9<document.documentMode)}function ru(){Xs&&(Xs.detachEvent("onpropertychange",Cf),fr=Xs=null)}function Cf(e){if(e.propertyName==="value"&&aa(fr)){var t=[];Nf(t,fr,e,Pl(e)),rf(P0,t)}}function O0(e,t,n){e==="focusin"?(ru(),Xs=t,fr=n,Xs.attachEvent("onpropertychange",Cf)):e==="focusout"&&ru()}function _0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return aa(fr)}function M0(e,t){if(e==="click")return aa(t)}function D0(e,t){if(e==="input"||e==="change")return aa(t)}function $0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mt=typeof Object.is=="function"?Object.is:$0;function mr(e,t){if(mt(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(!go.call(t,r)||!mt(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 Ef(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ef(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tf(){for(var e=window,t=Ei();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ei(e.document)}return t}function Fl(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 R0(e){var t=Tf(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ef(n.ownerDocument.documentElement,n)){if(s!==null&&Fl(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 z0=It&&"documentMode"in document&&11>=document.documentMode,Fn=null,Mo=null,Zs=null,Do=!1;function ou(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Do||Fn==null||Fn!==Ei(s)||(s=Fn,"selectionStart"in s&&Fl(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}),Zs&&mr(Zs,s)||(Zs=s,s=_i(Mo,"onSelect"),0<s.length&&(t=new $l("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Fn)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Bn={animationend:Gr("Animation","AnimationEnd"),animationiteration:Gr("Animation","AnimationIteration"),animationstart:Gr("Animation","AnimationStart"),transitionend:Gr("Transition","TransitionEnd")},Ua={},Af={};It&&(Af=document.createElement("div").style,"AnimationEvent"in window||(delete Bn.animationend.animation,delete Bn.animationiteration.animation,delete Bn.animationstart.animation),"TransitionEvent"in window||delete Bn.transitionend.transition);function oa(e){if(Ua[e])return Ua[e];if(!Bn[e])return e;var t=Bn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Af)return Ua[e]=t[n];return e}var Lf=oa("animationend"),Pf=oa("animationiteration"),If=oa("animationstart"),Of=oa("transitionend"),_f=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 on(e,t){_f.set(e,t),An(t,[e])}for(var Wa=0;Wa<lu.length;Wa++){var Ha=lu[Wa],F0=Ha.toLowerCase(),B0=Ha[0].toUpperCase()+Ha.slice(1);on(F0,"on"+B0)}on(Lf,"onAnimationEnd");on(Pf,"onAnimationIteration");on(If,"onAnimationStart");on("dblclick","onDoubleClick");on("focusin","onFocus");on("focusout","onBlur");on(Of,"onTransitionEnd");os("onMouseEnter",["mouseout","mouseover"]);os("onMouseLeave",["mouseout","mouseover"]);os("onPointerEnter",["pointerout","pointerover"]);os("onPointerLeave",["pointerout","pointerover"]);An("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));An("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));An("onBeforeInput",["compositionend","keypress","textInput","paste"]);An("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));An("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));An("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(" "),U0=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,Fp(s,t,void 0,e),e.currentTarget=null}function Mf(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 l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&r.isPropagationStopped())break e;cu(r,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&r.isPropagationStopped())break e;cu(r,l,u),a=c}}}if(Ai)throw e=Po,Ai=!1,Po=null,e}function te(e,t){var n=t[Bo];n===void 0&&(n=t[Bo]=new Set);var s=e+"__bubble";n.has(s)||(Df(t,e,2,!1),n.add(s))}function Va(e,t,n){var s=0;t&&(s|=4),Df(n,e,s,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function hr(e){if(!e[qr]){e[qr]=!0,Ud.forEach(function(n){n!=="selectionchange"&&(U0.has(n)||Va(n,!1,e),Va(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,Va("selectionchange",!1,t))}}function Df(e,t,n,s){switch(vf(t)){case 1:var r=n0;break;case 4:r=s0;break;default:r=Ml}n=r.bind(null,t,n,e),r=void 0,!Lo||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 Ka(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 l=s.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;o=o.return}for(;l!==null;){if(o=pn(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}rf(function(){var u=a,m=Pl(n),d=[];e:{var f=_f.get(e);if(f!==void 0){var v=$l,y=e;switch(e){case"keypress":if(pi(n)===0)break e;case"keydown":case"keyup":v=x0;break;case"focusin":y="focus",v=za;break;case"focusout":y="blur",v=za;break;case"beforeblur":case"afterblur":v=za;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":v=Jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=a0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=j0;break;case Lf:case Pf:case If:v=c0;break;case Of:v=k0;break;case"scroll":v=r0;break;case"wheel":v=S0;break;case"copy":case"cut":case"paste":v=d0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Zc}var x=(t&4)!==0,w=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var p=u,h;p!==null;){h=p;var j=h.stateNode;if(h.tag===5&&j!==null&&(h=j,g!==null&&(j=lr(p,g),j!=null&&x.push(pr(p,j,h)))),w)break;p=p.return}0<x.length&&(f=new v(f,y,null,n,m),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",f&&n!==To&&(y=n.relatedTarget||n.fromElement)&&(pn(y)||y[Ot]))break e;if((v||f)&&(f=m.window===m?m:(f=m.ownerDocument)?f.defaultView||f.parentWindow:window,v?(y=n.relatedTarget||n.toElement,v=u,y=y?pn(y):null,y!==null&&(w=Ln(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(v=null,y=u),v!==y)){if(x=Jc,j="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(x=Zc,j="onPointerLeave",g="onPointerEnter",p="pointer"),w=v==null?f:Un(v),h=y==null?f:Un(y),f=new x(j,p+"leave",v,n,m),f.target=w,f.relatedTarget=h,j=null,pn(m)===u&&(x=new x(g,p+"enter",y,n,m),x.target=h,x.relatedTarget=w,j=x),w=j,v&&y)t:{for(x=v,g=y,p=0,h=x;h;h=Pn(h))p++;for(h=0,j=g;j;j=Pn(j))h++;for(;0<p-h;)x=Pn(x),p--;for(;0<h-p;)g=Pn(g),h--;for(;p--;){if(x===g||g!==null&&x===g.alternate)break t;x=Pn(x),g=Pn(g)}x=null}else x=null;v!==null&&uu(d,f,v,x,!1),y!==null&&w!==null&&uu(d,w,y,x,!0)}}e:{if(f=u?Un(u):window,v=f.nodeName&&f.nodeName.toLowerCase(),v==="select"||v==="input"&&f.type==="file")var k=I0;else if(nu(f))if(Sf)k=D0;else{k=_0;var C=O0}else(v=f.nodeName)&&v.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=M0);if(k&&(k=k(e,u))){Nf(d,k,n,m);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&ko(f,"number",f.value)}switch(C=u?Un(u):window,e){case"focusin":(nu(C)||C.contentEditable==="true")&&(Fn=C,Mo=u,Zs=null);break;case"focusout":Zs=Mo=Fn=null;break;case"mousedown":Do=!0;break;case"contextmenu":case"mouseup":case"dragend":Do=!1,ou(d,n,m);break;case"selectionchange":if(z0)break;case"keydown":case"keyup":ou(d,n,m)}var S;if(zl)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else zn?wf(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(jf&&n.locale!=="ko"&&(zn||N!=="onCompositionStart"?N==="onCompositionEnd"&&zn&&(S=bf()):(Vt=m,Dl="value"in Vt?Vt.value:Vt.textContent,zn=!0)),C=_i(u,N),0<C.length&&(N=new Xc(N,e,null,n,m),d.push({event:N,listeners:C}),S?N.data=S:(S=kf(n),S!==null&&(N.data=S)))),(S=E0?T0(e,n):A0(e,n))&&(u=_i(u,"onBeforeInput"),0<u.length&&(m=new Xc("onBeforeInput","beforeinput",null,n,m),d.push({event:m,listeners:u}),m.data=S))}Mf(d,t)})}function pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _i(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=lr(e,n),a!=null&&s.unshift(pr(e,a,r)),a=lr(e,t),a!=null&&s.push(pr(e,a,r))),e=e.return}return s}function Pn(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 l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,r?(c=lr(n,a),c!=null&&o.unshift(pr(n,c,l))):r||(c=lr(n,a),c!=null&&o.push(pr(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var W0=/\r\n?/g,H0=/\u0000|\uFFFD/g;function du(e){return(typeof e=="string"?e:""+e).replace(W0,`
38
- `).replace(H0,"")}function Yr(e,t,n){if(t=du(t),du(e)!==t&&n)throw Error(P(425))}function Mi(){}var $o=null,Ro=null;function zo(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 Fo=typeof setTimeout=="function"?setTimeout:void 0,V0=typeof clearTimeout=="function"?clearTimeout:void 0,fu=typeof Promise=="function"?Promise:void 0,K0=typeof queueMicrotask=="function"?queueMicrotask:typeof fu<"u"?function(e){return fu.resolve(null).then(e).catch(G0)}:Fo;function G0(e){setTimeout(function(){throw e})}function Ga(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),dr(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);dr(t)}function Jt(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 mu(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),bt="__reactFiber$"+vs,gr="__reactProps$"+vs,Ot="__reactContainer$"+vs,Bo="__reactEvents$"+vs,q0="__reactListeners$"+vs,Y0="__reactHandles$"+vs;function pn(e){var t=e[bt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mu(e);e!==null;){if(n=e[bt])return n;e=mu(e)}return t}e=n,n=e.parentNode}return null}function Pr(e){return e=e[bt]||e[Ot],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Un(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function la(e){return e[gr]||null}var Uo=[],Wn=-1;function ln(e){return{current:e}}function ne(e){0>Wn||(e.current=Uo[Wn],Uo[Wn]=null,Wn--)}function Z(e,t){Wn++,Uo[Wn]=e.current,e.current=t}var an={},Te=ln(an),ze=ln(!1),wn=an;function ls(e,t){var n=e.type.contextTypes;if(!n)return an;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 Di(){ne(ze),ne(Te)}function hu(e,t,n){if(Te.current!==an)throw Error(P(168));Z(Te,t),Z(ze,n)}function $f(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,Op(e)||"Unknown",r));return oe({},n,s)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,wn=Te.current,Z(Te,e),Z(ze,ze.current),!0}function pu(e,t,n){var s=e.stateNode;if(!s)throw Error(P(169));n?(e=$f(e,t,wn),s.__reactInternalMemoizedMergedChildContext=e,ne(ze),ne(Te),Z(Te,e)):ne(ze),Z(ze,n)}var Ct=null,ca=!1,qa=!1;function Rf(e){Ct===null?Ct=[e]:Ct.push(e)}function Q0(e){ca=!0,Rf(e)}function cn(){if(!qa&&Ct!==null){qa=!0;var e=0,t=Q;try{var n=Ct;for(Q=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Ct=null,ca=!1}catch(r){throw Ct!==null&&(Ct=Ct.slice(e+1)),cf(Il,cn),r}finally{Q=t,qa=!1}}return null}var Hn=[],Vn=0,Ri=null,zi=0,Ye=[],Qe=0,kn=null,Et=1,Tt="";function fn(e,t){Hn[Vn++]=zi,Hn[Vn++]=Ri,Ri=e,zi=t}function zf(e,t,n){Ye[Qe++]=Et,Ye[Qe++]=Tt,Ye[Qe++]=kn,kn=e;var s=Et;e=Tt;var r=32-dt(s)-1;s&=~(1<<r),n+=1;var a=32-dt(t)+r;if(30<a){var o=r-r%5;a=(s&(1<<o)-1).toString(32),s>>=o,r-=o,Et=1<<32-dt(t)+r|n<<r|s,Tt=a+e}else Et=1<<a|n<<r|s,Tt=e}function Bl(e){e.return!==null&&(fn(e,1),zf(e,1,0))}function Ul(e){for(;e===Ri;)Ri=Hn[--Vn],Hn[Vn]=null,zi=Hn[--Vn],Hn[Vn]=null;for(;e===kn;)kn=Ye[--Qe],Ye[Qe]=null,Tt=Ye[--Qe],Ye[Qe]=null,Et=Ye[--Qe],Ye[Qe]=null}var He=null,We=null,se=!1,ut=null;function Ff(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=Jt(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=kn!==null?{id:Et,overflow:Tt}: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 Wo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ho(e){if(se){var t=We;if(t){var n=t;if(!gu(e,t)){if(Wo(e))throw Error(P(418));t=Jt(n.nextSibling);var s=He;t&&gu(e,t)?Ff(s,n):(e.flags=e.flags&-4097|2,se=!1,He=e)}}else{if(Wo(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 Qr(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"&&!zo(e.type,e.memoizedProps)),t&&(t=We)){if(Wo(e))throw Bf(),Error(P(418));for(;t;)Ff(e,t),t=Jt(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=Jt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}We=null}}else We=He?Jt(e.stateNode.nextSibling):null;return!0}function Bf(){for(var e=We;e;)e=Jt(e.nextSibling)}function cs(){We=He=null,se=!1}function Wl(e){ut===null?ut=[e]:ut.push(e)}var J0=Dt.ReactCurrentBatchConfig;function _s(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 l=r.refs;o===null?delete l[a]:l[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 Jr(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 Uf(e){function t(g,p){if(e){var h=g.deletions;h===null?(g.deletions=[p],g.flags|=16):h.push(p)}}function n(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function s(g,p){for(g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function r(g,p){return g=tn(g,p),g.index=0,g.sibling=null,g}function a(g,p,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<p?(g.flags|=2,p):h):(g.flags|=2,p)):(g.flags|=1048576,p)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,p,h,j){return p===null||p.tag!==6?(p=to(h,g.mode,j),p.return=g,p):(p=r(p,h),p.return=g,p)}function c(g,p,h,j){var k=h.type;return k===Rn?m(g,p,h.props.children,j,h.key):p!==null&&(p.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ft&&xu(k)===p.type)?(j=r(p,h.props),j.ref=_s(g,p,h),j.return=g,j):(j=wi(h.type,h.key,h.props,null,g.mode,j),j.ref=_s(g,p,h),j.return=g,j)}function u(g,p,h,j){return p===null||p.tag!==4||p.stateNode.containerInfo!==h.containerInfo||p.stateNode.implementation!==h.implementation?(p=no(h,g.mode,j),p.return=g,p):(p=r(p,h.children||[]),p.return=g,p)}function m(g,p,h,j,k){return p===null||p.tag!==7?(p=jn(h,g.mode,j,k),p.return=g,p):(p=r(p,h),p.return=g,p)}function d(g,p,h){if(typeof p=="string"&&p!==""||typeof p=="number")return p=to(""+p,g.mode,h),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Fr:return h=wi(p.type,p.key,p.props,null,g.mode,h),h.ref=_s(g,null,p),h.return=g,h;case $n:return p=no(p,g.mode,h),p.return=g,p;case Ft:var j=p._init;return d(g,j(p._payload),h)}if(Us(p)||As(p))return p=jn(p,g.mode,h,null),p.return=g,p;Jr(g,p)}return null}function f(g,p,h,j){var k=p!==null?p.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:l(g,p,""+h,j);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Fr:return h.key===k?c(g,p,h,j):null;case $n:return h.key===k?u(g,p,h,j):null;case Ft:return k=h._init,f(g,p,k(h._payload),j)}if(Us(h)||As(h))return k!==null?null:m(g,p,h,j,null);Jr(g,h)}return null}function v(g,p,h,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(h)||null,l(p,g,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Fr:return g=g.get(j.key===null?h:j.key)||null,c(p,g,j,k);case $n:return g=g.get(j.key===null?h:j.key)||null,u(p,g,j,k);case Ft:var C=j._init;return v(g,p,h,C(j._payload),k)}if(Us(j)||As(j))return g=g.get(h)||null,m(p,g,j,k,null);Jr(p,j)}return null}function y(g,p,h,j){for(var k=null,C=null,S=p,N=p=0,T=null;S!==null&&N<h.length;N++){S.index>N?(T=S,S=null):T=S.sibling;var L=f(g,S,h[N],j);if(L===null){S===null&&(S=T);break}e&&S&&L.alternate===null&&t(g,S),p=a(L,p,N),C===null?k=L:C.sibling=L,C=L,S=T}if(N===h.length)return n(g,S),se&&fn(g,N),k;if(S===null){for(;N<h.length;N++)S=d(g,h[N],j),S!==null&&(p=a(S,p,N),C===null?k=S:C.sibling=S,C=S);return se&&fn(g,N),k}for(S=s(g,S);N<h.length;N++)T=v(S,g,N,h[N],j),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?N:T.key),p=a(T,p,N),C===null?k=T:C.sibling=T,C=T);return e&&S.forEach(function(F){return t(g,F)}),se&&fn(g,N),k}function x(g,p,h,j){var k=As(h);if(typeof k!="function")throw Error(P(150));if(h=k.call(h),h==null)throw Error(P(151));for(var C=k=null,S=p,N=p=0,T=null,L=h.next();S!==null&&!L.done;N++,L=h.next()){S.index>N?(T=S,S=null):T=S.sibling;var F=f(g,S,L.value,j);if(F===null){S===null&&(S=T);break}e&&S&&F.alternate===null&&t(g,S),p=a(F,p,N),C===null?k=F:C.sibling=F,C=F,S=T}if(L.done)return n(g,S),se&&fn(g,N),k;if(S===null){for(;!L.done;N++,L=h.next())L=d(g,L.value,j),L!==null&&(p=a(L,p,N),C===null?k=L:C.sibling=L,C=L);return se&&fn(g,N),k}for(S=s(g,S);!L.done;N++,L=h.next())L=v(S,g,N,L.value,j),L!==null&&(e&&L.alternate!==null&&S.delete(L.key===null?N:L.key),p=a(L,p,N),C===null?k=L:C.sibling=L,C=L);return e&&S.forEach(function(H){return t(g,H)}),se&&fn(g,N),k}function w(g,p,h,j){if(typeof h=="object"&&h!==null&&h.type===Rn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Fr:e:{for(var k=h.key,C=p;C!==null;){if(C.key===k){if(k=h.type,k===Rn){if(C.tag===7){n(g,C.sibling),p=r(C,h.props.children),p.return=g,g=p;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ft&&xu(k)===C.type){n(g,C.sibling),p=r(C,h.props),p.ref=_s(g,C,h),p.return=g,g=p;break e}n(g,C);break}else t(g,C);C=C.sibling}h.type===Rn?(p=jn(h.props.children,g.mode,j,h.key),p.return=g,g=p):(j=wi(h.type,h.key,h.props,null,g.mode,j),j.ref=_s(g,p,h),j.return=g,g=j)}return o(g);case $n:e:{for(C=h.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===h.containerInfo&&p.stateNode.implementation===h.implementation){n(g,p.sibling),p=r(p,h.children||[]),p.return=g,g=p;break e}else{n(g,p);break}else t(g,p);p=p.sibling}p=no(h,g.mode,j),p.return=g,g=p}return o(g);case Ft:return C=h._init,w(g,p,C(h._payload),j)}if(Us(h))return y(g,p,h,j);if(As(h))return x(g,p,h,j);Jr(g,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,p!==null&&p.tag===6?(n(g,p.sibling),p=r(p,h),p.return=g,g=p):(n(g,p),p=to(h,g.mode,j),p.return=g,g=p),o(g)):n(g,p)}return w}var us=Uf(!0),Wf=Uf(!1),Fi=ln(null),Bi=null,Kn=null,Hl=null;function Vl(){Hl=Kn=Bi=null}function Kl(e){var t=Fi.current;ne(Fi),e._currentValue=t}function Vo(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 ss(e,t){Bi=e,Hl=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&($e=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(Hl!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(Bi===null)throw Error(P(308));Kn=e,Bi.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var gn=null;function Gl(e){gn===null?gn=[e]:gn.push(e)}function Hf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Gl(t)):(n.next=r.next,r.next=n),t.interleaved=n,_t(e,s)}function _t(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 Bt=!1;function ql(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vf(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 Lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xt(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,_t(e,n)}return r=s.interleaved,r===null?(t.next=t,Gl(s)):(t.next=r.next,r.next=t),s.interleaved=t,_t(e,n)}function gi(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,Ol(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 Ui(e,t,n,s){var r=e.updateQueue;Bt=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=c))}if(a!==null){var d=r.baseState;o=0,m=u=c=null,l=a;do{var f=l.lane,v=l.eventTime;if((s&f)===f){m!==null&&(m=m.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(f=t,v=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){d=y.call(v,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(v,d,f):y,f==null)break e;d=oe({},d,f);break e;case 2:Bt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=r.effects,f===null?r.effects=[l]:f.push(l))}else v={eventTime:v,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(u=m=v,c=d):m=m.next=v,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;f=l,l=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(m===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=m,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);Sn|=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 Ir={},wt=ln(Ir),yr=ln(Ir),xr=ln(Ir);function yn(e){if(e===Ir)throw Error(P(174));return e}function Yl(e,t){switch(Z(xr,t),Z(yr,e),Z(wt,Ir),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:So(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=So(t,e)}ne(wt),Z(wt,t)}function ds(){ne(wt),ne(yr),ne(xr)}function Kf(e){yn(xr.current);var t=yn(wt.current),n=So(t,e.type);t!==n&&(Z(yr,e),Z(wt,n))}function Ql(e){yr.current===e&&(ne(wt),ne(yr))}var re=ln(0);function Wi(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 Ya=[];function Jl(){for(var e=0;e<Ya.length;e++)Ya[e]._workInProgressVersionPrimary=null;Ya.length=0}var yi=Dt.ReactCurrentDispatcher,Qa=Dt.ReactCurrentBatchConfig,Nn=0,ie=null,ge=null,ve=null,Hi=!1,er=!1,vr=0,X0=0;function Se(){throw Error(P(321))}function Xl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mt(e[n],t[n]))return!1;return!0}function Zl(e,t,n,s,r,a){if(Nn=a,ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yi.current=e===null||e.memoizedState===null?ng:sg,e=n(s,r),er){a=0;do{if(er=!1,vr=0,25<=a)throw Error(P(301));a+=1,ve=ge=null,t.updateQueue=null,yi.current=rg,e=n(s,r)}while(er)}if(yi.current=Vi,t=ge!==null&&ge.next!==null,Nn=0,ve=ge=ie=null,Hi=!1,t)throw Error(P(300));return e}function ec(){var e=vr!==0;return vr=0,e}function xt(){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(ge===null){var e=ie.alternate;e=e!==null?e.memoizedState:null}else e=ge.next;var t=ve===null?ie.memoizedState:ve.next;if(t!==null)ve=t,ge=e;else{if(e===null)throw Error(P(310));ge=e,e={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},ve===null?ie.memoizedState=ve=e:ve=ve.next=e}return ve}function br(e,t){return typeof t=="function"?t(e):t}function Ja(e){var t=nt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var s=ge,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 l=o=null,c=null,u=a;do{var m=u.lane;if((Nn&m)===m)c!==null&&(c=c.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:m,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=s):c=c.next=d,ie.lanes|=m,Sn|=m}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,mt(s,t.memoizedState)||($e=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,ie.lanes|=a,Sn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Xa(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);mt(a,t.memoizedState)||($e=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function Gf(){}function qf(e,t){var n=ie,s=nt(),r=t(),a=!mt(s.memoizedState,r);if(a&&(s.memoizedState=r,$e=!0),s=s.queue,tc(Jf.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||ve!==null&&ve.memoizedState.tag&1){if(n.flags|=2048,jr(9,Qf.bind(null,n,s,r,t),void 0,null),be===null)throw Error(P(349));Nn&30||Yf(n,t,r)}return r}function Yf(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 Qf(e,t,n,s){t.value=n,t.getSnapshot=s,Xf(t)&&Zf(e)}function Jf(e,t,n){return n(function(){Xf(t)&&Zf(e)})}function Xf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mt(e,n)}catch{return!0}}function Zf(e){var t=_t(e,1);t!==null&&ft(t,e,1,-1)}function ju(e){var t=xt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:e},t.queue=e,e=e.dispatch=tg.bind(null,ie,e),[t.memoizedState,e]}function jr(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 em(){return nt().memoizedState}function xi(e,t,n,s){var r=xt();ie.flags|=e,r.memoizedState=jr(1|t,n,void 0,s===void 0?null:s)}function ua(e,t,n,s){var r=nt();s=s===void 0?null:s;var a=void 0;if(ge!==null){var o=ge.memoizedState;if(a=o.destroy,s!==null&&Xl(s,o.deps)){r.memoizedState=jr(t,n,a,s);return}}ie.flags|=e,r.memoizedState=jr(1|t,n,a,s)}function wu(e,t){return xi(8390656,8,e,t)}function tc(e,t){return ua(2048,8,e,t)}function tm(e,t){return ua(4,2,e,t)}function nm(e,t){return ua(4,4,e,t)}function sm(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 rm(e,t,n){return n=n!=null?n.concat([e]):null,ua(4,4,sm.bind(null,t,e),n)}function nc(){}function im(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Xl(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function am(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Xl(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function om(e,t,n){return Nn&21?(mt(n,t)||(n=ff(),ie.lanes|=n,Sn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,$e=!0),e.memoizedState=n)}function Z0(e,t){var n=Q;Q=n!==0&&4>n?n:4,e(!0);var s=Qa.transition;Qa.transition={};try{e(!1),t()}finally{Q=n,Qa.transition=s}}function lm(){return nt().memoizedState}function eg(e,t,n){var s=en(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},cm(e))um(t,n);else if(n=Hf(e,t,n,s),n!==null){var r=Pe();ft(n,e,s,r),dm(n,t,s)}}function tg(e,t,n){var s=en(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(cm(e))um(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,l=a(o,n);if(r.hasEagerState=!0,r.eagerState=l,mt(l,o)){var c=t.interleaved;c===null?(r.next=r,Gl(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=Hf(e,t,r,s),n!==null&&(r=Pe(),ft(n,e,s,r),dm(n,t,s))}}function cm(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function um(e,t){er=Hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dm(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Ol(e,n)}}var Vi={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},ng={readContext:tt,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:wu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xi(4194308,4,sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xi(4194308,4,e,t)},useInsertionEffect:function(e,t){return xi(4,2,e,t)},useMemo:function(e,t){var n=xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=xt();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=eg.bind(null,ie,e),[s.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:ju,useDebugValue:nc,useDeferredValue:function(e){return xt().memoizedState=e},useTransition:function(){var e=ju(!1),t=e[0];return e=Z0.bind(null,e[1]),xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=ie,r=xt();if(se){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),be===null)throw Error(P(349));Nn&30||Yf(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,wu(Jf.bind(null,s,a,e),[e]),s.flags|=2048,jr(9,Qf.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=xt(),t=be.identifierPrefix;if(se){var n=Tt,s=Et;n=(s&~(1<<32-dt(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=vr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=X0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sg={readContext:tt,useCallback:im,useContext:tt,useEffect:tc,useImperativeHandle:rm,useInsertionEffect:tm,useLayoutEffect:nm,useMemo:am,useReducer:Ja,useRef:em,useState:function(){return Ja(br)},useDebugValue:nc,useDeferredValue:function(e){var t=nt();return om(t,ge.memoizedState,e)},useTransition:function(){var e=Ja(br)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Gf,useSyncExternalStore:qf,useId:lm,unstable_isNewReconciler:!1},rg={readContext:tt,useCallback:im,useContext:tt,useEffect:tc,useImperativeHandle:rm,useInsertionEffect:tm,useLayoutEffect:nm,useMemo:am,useReducer:Xa,useRef:em,useState:function(){return Xa(br)},useDebugValue:nc,useDeferredValue:function(e){var t=nt();return ge===null?t.memoizedState=e:om(t,ge.memoizedState,e)},useTransition:function(){var e=Xa(br)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Gf,useSyncExternalStore:qf,useId:lm,unstable_isNewReconciler:!1};function ot(e,t){if(e&&e.defaultProps){t=oe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ko(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var da={isMounted:function(e){return(e=e._reactInternals)?Ln(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=en(e),a=Lt(s,r);a.payload=t,n!=null&&(a.callback=n),t=Xt(e,a,r),t!==null&&(ft(t,e,r,s),gi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=en(e),a=Lt(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Xt(e,a,r),t!==null&&(ft(t,e,r,s),gi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pe(),s=en(e),r=Lt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Xt(e,r,s),t!==null&&(ft(t,e,s,n),gi(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?!mr(n,s)||!mr(r,a):!0}function fm(e,t,n){var s=!1,r=an,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)?ls(e,r):an),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=da,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&&da.enqueueReplaceState(t,t.state,null)}function Go(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},ql(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=tt(a):(a=Fe(t)?wn:Te.current,r.context=ls(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ko(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&&da.enqueueReplaceState(r,r.state,null),Ui(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function fs(e,t){try{var n="",s=t;do n+=Ip(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 Za(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 ig=typeof WeakMap=="function"?WeakMap:Map;function mm(e,t,n){n=Lt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Gi||(Gi=!0,rl=s),qo(e,t)},n}function hm(e,t,n){n=Lt(-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"&&(Zt===null?Zt=new Set([this]):Zt.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 ig;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=vg.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=Lt(-1,1),t.tag=2,Xt(n,t,1))),n.lanes|=1),e)}var ag=Dt.ReactCurrentOwner,$e=!1;function Ae(e,t,n,s){t.child=e===null?Wf(t,null,n,s):us(t,e.child,n,s)}function Tu(e,t,n,s,r){n=n.render;var a=t.ref;return ss(t,r),s=Zl(e,t,n,s,a,r),n=ec(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Mt(e,t,r)):(se&&n&&Bl(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"&&!uc(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,pm(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:mr,n(o,s)&&e.ref===t.ref)return Mt(e,t,r)}return t.flags|=1,e=tn(a,s),e.ref=t.ref,e.return=t,t.child=e}function pm(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if(mr(a,s)&&e.ref===t.ref)if($e=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&($e=!0);else return t.lanes=e.lanes,Mt(e,t,r)}return Yo(e,t,n,s,r)}function gm(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(qn,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(qn,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,Z(qn,Ue),Ue|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,Z(qn,Ue),Ue|=s;return Ae(e,t,r,n),t.child}function ym(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Yo(e,t,n,s,r){var a=Fe(n)?wn:Te.current;return a=ls(t,a),ss(t,r),n=Zl(e,t,n,s,a,r),s=ec(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Mt(e,t,r)):(se&&s&&Bl(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(ss(t,r),t.stateNode===null)vi(e,t),fm(t,n,s),Go(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=tt(u):(u=Fe(n)?wn:Te.current,u=ls(t,u));var m=n.getDerivedStateFromProps,d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&Nu(t,o,s,u),Bt=!1;var f=t.memoizedState;o.state=f,Ui(t,s,o,r),c=t.memoizedState,l!==s||f!==c||ze.current||Bt?(typeof m=="function"&&(Ko(t,n,m,s),c=t.memoizedState),(l=Bt||ku(t,n,l,s,f,c,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=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Vf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ot(t.type,l),o.props=u,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=tt(c):(c=Fe(n)?wn:Te.current,c=ls(t,c));var v=n.getDerivedStateFromProps;(m=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==c)&&Nu(t,o,s,c),Bt=!1,f=t.memoizedState,o.state=f,Ui(t,s,o,r);var y=t.memoizedState;l!==d||f!==y||ze.current||Bt?(typeof v=="function"&&(Ko(t,n,v,s),y=t.memoizedState),(u=Bt||ku(t,n,u,s,f,y,c)||!1)?(m||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=y),o.props=s,o.state=y,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Qo(e,t,n,s,a,r)}function Qo(e,t,n,s,r,a){ym(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&pu(t,n,!1),Mt(e,t,a);s=t.stateNode,ag.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=us(t,e.child,null,a),t.child=us(t,null,l,a)):Ae(e,t,l,a),t.memoizedState=s.state,r&&pu(t,n,!0),t.child}function xm(e){var t=e.stateNode;t.pendingContext?hu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hu(e,t.context,!1),Yl(e,t.containerInfo)}function Pu(e,t,n,s,r){return cs(),Wl(r),t.flags|=256,Ae(e,t,n,s),t.child}var Jo={dehydrated:null,treeContext:null,retryLane:0};function Xo(e){return{baseLanes:e,cachePool:null,transitions:null}}function vm(e,t,n){var s=t.pendingProps,r=re.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Z(re,r&1),e===null)return Ho(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=jn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Xo(n),t.memoizedState=Jo,e):sc(t,o));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return og(e,t,o,s,l,r,n);if(a){a=s.fallback,o=t.mode,r=e.child,l=r.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=tn(r,c),s.subtreeFlags=r.subtreeFlags&14680064),l!==null?a=tn(l,a):(a=jn(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?Xo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Jo,s}return a=e.child,e=a.sibling,s=tn(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 sc(e,t){return t=ha({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xr(e,t,n,s){return s!==null&&Wl(s),us(t,e.child,null,n),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function og(e,t,n,s,r,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Za(Error(P(422))),Xr(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=jn(a,r,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&us(t,e.child,null,o),t.child.memoizedState=Xo(o),t.memoizedState=Jo,a);if(!(t.mode&1))return Xr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(P(419)),s=Za(a,s,void 0),Xr(e,t,o,s)}if(l=(o&e.childLanes)!==0,$e||l){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,_t(e,r),ft(s,e,r,-1))}return cc(),s=Za(Error(P(421))),Xr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=bg.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,We=Jt(r.nextSibling),He=t,se=!0,ut=null,e!==null&&(Ye[Qe++]=Et,Ye[Qe++]=Tt,Ye[Qe++]=kn,Et=e.id,Tt=e.overflow,kn=t),t=sc(t,s.children),t.flags|=4096,t)}function Iu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vo(e.return,t,n)}function eo(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 bm(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&&Iu(e,n,t);else if(e.tag===19)Iu(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&&Wi(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),eo(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&&Wi(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}eo(t,!0,n,null,a);break;case"together":eo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Mt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sn|=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=tn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=tn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lg(e,t,n){switch(t.tag){case 3:xm(t),cs();break;case 5:Kf(t);break;case 1:Fe(t.type)&&$i(t);break;case 4:Yl(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;Z(Fi,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?vm(e,t,n):(Z(re,re.current&1),e=Mt(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 bm(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,gm(e,t,n)}return Mt(e,t,n)}var jm,Zo,wm,km;jm=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}};Zo=function(){};wm=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,yn(wt.current);var a=null;switch(n){case"input":r=jo(e,r),s=jo(e,s),a=[];break;case"select":r=oe({},r,{value:void 0}),s=oe({},s,{value:void 0}),a=[];break;case"textarea":r=No(e,r),s=No(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Mi)}Co(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ar.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ar.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&te("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};km=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ms(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 cg(e,t,n){var s=t.pendingProps;switch(Ul(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)&&Di(),Ce(t),null;case 3:return s=t.stateNode,ds(),ne(ze),ne(Te),Jl(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Qr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ut!==null&&(ol(ut),ut=null))),Zo(e,t),Ce(t),null;case 5:Ql(t);var r=yn(xr.current);if(n=t.type,e!==null&&t.stateNode!=null)wm(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=yn(wt.current),Qr(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[bt]=t,s[gr]=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)}Co(n,a),r=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&Yr(s.textContent,l,e),r=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Yr(s.textContent,l,e),r=["children",""+l]):ar.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&te("scroll",s)}switch(n){case"input":Br(s),Uc(s,a,!0);break;case"textarea":Br(s),Hc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=Mi)}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=Qd(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[bt]=t,e[gr]=s,jm(e,t,!1,!1),t.stateNode=e;e:{switch(o=Eo(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=jo(e,s),te("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=oe({},s,{value:void 0}),te("invalid",e);break;case"textarea":Wc(e,s),r=No(e,s),te("invalid",e);break;default:r=s}Co(n,r),l=r;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Zd(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Jd(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&or(e,c):typeof c=="number"&&or(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ar.hasOwnProperty(a)?c!=null&&a==="onScroll"&&te("scroll",e):c!=null&&El(e,a,c,o))}switch(n){case"input":Br(e),Uc(e,s,!1);break;case"textarea":Br(e),Hc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+rn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Zn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Zn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Mi)}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)km(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(P(166));if(n=yn(xr.current),yn(wt.current),Qr(t)){if(s=t.stateNode,n=t.memoizedProps,s[bt]=t,(a=s.nodeValue!==n)&&(e=He,e!==null))switch(e.tag){case 3:Yr(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Yr(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[bt]=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))Bf(),cs(),t.flags|=98560,a=!1;else if(a=Qr(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[bt]=t}else cs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ce(t),a=!1}else ut!==null&&(ol(ut),ut=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?ye===0&&(ye=3):cc())),t.updateQueue!==null&&(t.flags|=4),Ce(t),null);case 4:return ds(),Zo(e,t),e===null&&hr(t.stateNode.containerInfo),Ce(t),null;case 10:return Kl(t.type._context),Ce(t),null;case 17:return Fe(t.type)&&Di(),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)Ms(a,!1);else{if(ye!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wi(e),o!==null){for(t.flags|=128,Ms(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()>ms&&(t.flags|=128,s=!0,Ms(a,!1),t.lanes=4194304)}else{if(!s)if(e=Wi(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ms(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!se)return Ce(t),null}else 2*ue()-a.renderingStartTime>ms&&n!==1073741824&&(t.flags|=128,s=!0,Ms(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 lc(),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 ug(e,t){switch(Ul(t),t.tag){case 1:return Fe(t.type)&&Di(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ds(),ne(ze),ne(Te),Jl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ql(t),null;case 13:if(ne(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(re),null;case 4:return ds(),null;case 10:return Kl(t.type._context),null;case 22:case 23:return lc(),null;case 24:return null;default:return null}}var Zr=!1,Ee=!1,dg=typeof WeakSet=="function"?WeakSet:Set,M=null;function Gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){le(e,t,s)}else n.current=null}function el(e,t,n){try{n()}catch(s){le(e,t,s)}}var Ou=!1;function fg(e,t){if($o=Ii,e=Tf(),Fl(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,l=-1,c=-1,u=0,m=0,d=e,f=null;t:for(;;){for(var v;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(v=d.firstChild)!==null;)f=d,d=v;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===a&&++m===s&&(c=o),(v=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=v}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ro={focusedElem:e,selectionRange:n},Ii=!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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,w=y.memoizedState,g=t.stateNode,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:ot(t.type,x),w);g.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(j){le(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return y=Ou,Ou=!1,y}function tr(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&&el(t,n,a)}r=r.next}while(r!==s)}}function fa(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 tl(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 Nm(e){var t=e.alternate;t!==null&&(e.alternate=null,Nm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bt],delete t[gr],delete t[Bo],delete t[q0],delete t[Y0])),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 Sm(e){return e.tag===5||e.tag===3||e.tag===4}function _u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sm(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 nl(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=Mi));else if(s!==4&&(e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function sl(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(sl(e,t,n),e=e.sibling;e!==null;)sl(e,t,n),e=e.sibling}var je=null,ct=!1;function zt(e,t,n){for(n=n.child;n!==null;)Cm(e,t,n),n=n.sibling}function Cm(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(ra,n)}catch{}switch(n.tag){case 5:Ee||Gn(n,t);case 6:var s=je,r=ct;je=null,zt(e,t,n),je=s,ct=r,je!==null&&(ct?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(ct?(e=je,n=n.stateNode,e.nodeType===8?Ga(e.parentNode,n):e.nodeType===1&&Ga(e,n),dr(e)):Ga(je,n.stateNode));break;case 4:s=je,r=ct,je=n.stateNode.containerInfo,ct=!0,zt(e,t,n),je=s,ct=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)&&el(n,t,o),r=r.next}while(r!==s)}zt(e,t,n);break;case 1:if(!Ee&&(Gn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){le(n,t,l)}zt(e,t,n);break;case 21:zt(e,t,n);break;case 22:n.mode&1?(Ee=(s=Ee)||n.memoizedState!==null,zt(e,t,n),Ee=s):zt(e,t,n);break;default:zt(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 dg),t.forEach(function(s){var r=jg.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,l=o;e:for(;l!==null;){switch(l.tag){case 5:je=l.stateNode,ct=!1;break e;case 3:je=l.stateNode.containerInfo,ct=!0;break e;case 4:je=l.stateNode.containerInfo,ct=!0;break e}l=l.return}if(je===null)throw Error(P(160));Cm(a,o,r),je=null,ct=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){le(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Em(t,e),t=t.sibling}function Em(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(it(t,e),yt(e),s&4){try{tr(3,e,e.return),fa(3,e)}catch(x){le(e,e.return,x)}try{tr(5,e,e.return)}catch(x){le(e,e.return,x)}}break;case 1:it(t,e),yt(e),s&512&&n!==null&&Gn(n,n.return);break;case 5:if(it(t,e),yt(e),s&512&&n!==null&&Gn(n,n.return),e.flags&32){var r=e.stateNode;try{or(r,"")}catch(x){le(e,e.return,x)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&qd(r,a),Eo(l,o);var u=Eo(l,a);for(o=0;o<c.length;o+=2){var m=c[o],d=c[o+1];m==="style"?Zd(r,d):m==="dangerouslySetInnerHTML"?Jd(r,d):m==="children"?or(r,d):El(r,m,d,u)}switch(l){case"input":wo(r,a);break;case"textarea":Yd(r,a);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var v=a.value;v!=null?Zn(r,!!a.multiple,v,!1):f!==!!a.multiple&&(a.defaultValue!=null?Zn(r,!!a.multiple,a.defaultValue,!0):Zn(r,!!a.multiple,a.multiple?[]:"",!1))}r[gr]=a}catch(x){le(e,e.return,x)}}break;case 6:if(it(t,e),yt(e),s&4){if(e.stateNode===null)throw Error(P(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(x){le(e,e.return,x)}}break;case 3:if(it(t,e),yt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{dr(t.containerInfo)}catch(x){le(e,e.return,x)}break;case 4:it(t,e),yt(e);break;case 13:it(t,e),yt(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(ac=ue())),s&4&&Mu(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(u=Ee)||m,it(t,e),Ee=u):it(t,e),yt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!m&&e.mode&1)for(M=e,m=e.child;m!==null;){for(d=M=m;M!==null;){switch(f=M,v=f.child,f.tag){case 0:case 11:case 14:case 15:tr(4,f,f.return);break;case 1:Gn(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){le(s,n,x)}}break;case 5:Gn(f,f.return);break;case 22:if(f.memoizedState!==null){$u(d);continue}}v!==null?(v.return=f,M=v):$u(d)}m=m.sibling}e:for(m=null,d=e;;){if(d.tag===5){if(m===null){m=d;try{r=d.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Xd("display",o))}catch(x){le(e,e.return,x)}}}else if(d.tag===6){if(m===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){le(e,e.return,x)}}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;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:it(t,e),yt(e),s&4&&Mu(e);break;case 21:break;default:it(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Sm(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&&(or(r,""),s.flags&=-33);var a=_u(e);sl(e,a,r);break;case 3:case 4:var o=s.stateNode.containerInfo,l=_u(e);nl(e,l,o);break;default:throw Error(P(161))}}catch(c){le(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mg(e,t,n){M=e,Tm(e)}function Tm(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||Zr;if(!o){var l=r.alternate,c=l!==null&&l.memoizedState!==null||Ee;l=Zr;var u=Ee;if(Zr=o,(Ee=c)&&!u)for(M=r;M!==null;)o=M,c=o.child,o.tag===22&&o.memoizedState!==null?Ru(r):c!==null?(c.return=o,M=c):Ru(r);for(;a!==null;)M=a,Tm(a),a=a.sibling;M=r,Zr=l,Ee=u}Du(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,M=a):Du(e)}}function Du(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||fa(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 l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.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 m=u.memoizedState;if(m!==null){var d=m.dehydrated;d!==null&&dr(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}Ee||t.flags&512&&tl(t)}catch(f){le(t,t.return,f)}}if(t===e){M=null;break}if(n=t.sibling,n!==null){n.return=t.return,M=n;break}M=t.return}}function $u(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{fa(4,t)}catch(c){le(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){le(t,r,c)}}var a=t.return;try{tl(t)}catch(c){le(t,a,c)}break;case 5:var o=t.return;try{tl(t)}catch(c){le(t,o,c)}}}catch(c){le(t,t.return,c)}if(t===e){M=null;break}var l=t.sibling;if(l!==null){l.return=t.return,M=l;break}M=t.return}}var hg=Math.ceil,Ki=Dt.ReactCurrentDispatcher,rc=Dt.ReactCurrentOwner,Ze=Dt.ReactCurrentBatchConfig,Y=0,be=null,pe=null,ke=0,Ue=0,qn=ln(0),ye=0,wr=null,Sn=0,ma=0,ic=0,nr=null,De=null,ac=0,ms=1/0,St=null,Gi=!1,rl=null,Zt=null,ei=!1,Kt=null,qi=0,sr=0,il=null,bi=-1,ji=0;function Pe(){return Y&6?ue():bi!==-1?bi:bi=ue()}function en(e){return e.mode&1?Y&2&&ke!==0?ke&-ke:J0.transition!==null?(ji===0&&(ji=ff()),ji):(e=Q,e!==0||(e=window.event,e=e===void 0?16:vf(e.type)),e):1}function ft(e,t,n,s){if(50<sr)throw sr=0,il=null,Error(P(185));Ar(e,n,s),(!(Y&2)||e!==be)&&(e===be&&(!(Y&2)&&(ma|=n),ye===4&&Ht(e,ke)),Be(e,s),n===1&&Y===0&&!(t.mode&1)&&(ms=ue()+500,ca&&cn()))}function Be(e,t){var n=e.callbackNode;Jp(e,t);var s=Pi(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?Q0(zu.bind(null,e)):Rf(zu.bind(null,e)),K0(function(){!(Y&6)&&cn()}),n=null;else{switch(mf(s)){case 1:n=Il;break;case 4:n=uf;break;case 16:n=Li;break;case 536870912:n=df;break;default:n=Li}n=Dm(n,Am.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Am(e,t){if(bi=-1,ji=0,Y&6)throw Error(P(327));var n=e.callbackNode;if(rs()&&e.callbackNode!==n)return null;var s=Pi(e,e===be?ke:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Yi(e,s);else{t=s;var r=Y;Y|=2;var a=Pm();(be!==e||ke!==t)&&(St=null,ms=ue()+500,bn(e,t));do try{yg();break}catch(l){Lm(e,l)}while(!0);Vl(),Ki.current=a,Y=r,pe!==null?t=0:(be=null,ke=0,t=ye)}if(t!==0){if(t===2&&(r=Io(e),r!==0&&(s=r,t=al(e,r))),t===1)throw n=wr,bn(e,0),Ht(e,s),Be(e,ue()),n;if(t===6)Ht(e,s);else{if(r=e.current.alternate,!(s&30)&&!pg(r)&&(t=Yi(e,s),t===2&&(a=Io(e),a!==0&&(s=a,t=al(e,a))),t===1))throw n=wr,bn(e,0),Ht(e,s),Be(e,ue()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(P(345));case 2:mn(e,De,St);break;case 3:if(Ht(e,s),(s&130023424)===s&&(t=ac+500-ue(),10<t)){if(Pi(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Pe(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Fo(mn.bind(null,e,De,St),t);break}mn(e,De,St);break;case 4:if(Ht(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-dt(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*hg(s/1960))-s,10<s){e.timeoutHandle=Fo(mn.bind(null,e,De,St),s);break}mn(e,De,St);break;case 5:mn(e,De,St);break;default:throw Error(P(329))}}}return Be(e,ue()),e.callbackNode===n?Am.bind(null,e):null}function al(e,t){var n=nr;return e.current.memoizedState.isDehydrated&&(bn(e,t).flags|=256),e=Yi(e,t),e!==2&&(t=De,De=n,t!==null&&ol(t)),e}function ol(e){De===null?De=e:De.push.apply(De,e)}function pg(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(!mt(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 Ht(e,t){for(t&=~ic,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dt(t),s=1<<n;e[n]=-1,t&=~s}}function zu(e){if(Y&6)throw Error(P(327));rs();var t=Pi(e,0);if(!(t&1))return Be(e,ue()),null;var n=Yi(e,t);if(e.tag!==0&&n===2){var s=Io(e);s!==0&&(t=s,n=al(e,s))}if(n===1)throw n=wr,bn(e,0),Ht(e,t),Be(e,ue()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mn(e,De,St),Be(e,ue()),null}function oc(e,t){var n=Y;Y|=1;try{return e(t)}finally{Y=n,Y===0&&(ms=ue()+500,ca&&cn())}}function Cn(e){Kt!==null&&Kt.tag===0&&!(Y&6)&&rs();var t=Y;Y|=1;var n=Ze.transition,s=Q;try{if(Ze.transition=null,Q=1,e)return e()}finally{Q=s,Ze.transition=n,Y=t,!(Y&6)&&cn()}}function lc(){Ue=qn.current,ne(qn)}function bn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,V0(n)),pe!==null)for(n=pe.return;n!==null;){var s=n;switch(Ul(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Di();break;case 3:ds(),ne(ze),ne(Te),Jl();break;case 5:Ql(s);break;case 4:ds();break;case 13:ne(re);break;case 19:ne(re);break;case 10:Kl(s.type._context);break;case 22:case 23:lc()}n=n.return}if(be=e,pe=e=tn(e.current,null),ke=Ue=t,ye=0,wr=null,ic=ma=Sn=0,De=nr=null,gn!==null){for(t=0;t<gn.length;t++)if(n=gn[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}gn=null}return e}function Lm(e,t){do{var n=pe;try{if(Vl(),yi.current=Vi,Hi){for(var s=ie.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Hi=!1}if(Nn=0,ve=ge=ie=null,er=!1,vr=0,rc.current=null,n===null||n.return===null){ye=1,wr=t,pe=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=ke,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,m=l,d=m.tag;if(!(m.mode&1)&&(d===0||d===11||d===15)){var f=m.alternate;f?(m.updateQueue=f.updateQueue,m.memoizedState=f.memoizedState,m.lanes=f.lanes):(m.updateQueue=null,m.memoizedState=null)}var v=Cu(o);if(v!==null){v.flags&=-257,Eu(v,o,l,a,t),v.mode&1&&Su(a,u,t),t=v,c=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(c),t.updateQueue=x}else y.add(c);break e}else{if(!(t&1)){Su(a,u,t),cc();break e}c=Error(P(426))}}else if(se&&l.mode&1){var w=Cu(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Eu(w,o,l,a,t),Wl(fs(c,l));break e}}a=c=fs(c,l),ye!==4&&(ye=2),nr===null?nr=[a]:nr.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=mm(a,c,t);vu(a,g);break e;case 1:l=c;var p=a.type,h=a.stateNode;if(!(a.flags&128)&&(typeof p.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Zt===null||!Zt.has(h)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=hm(a,l,t);vu(a,j);break e}}a=a.return}while(a!==null)}Om(n)}catch(k){t=k,pe===n&&n!==null&&(pe=n=n.return);continue}break}while(!0)}function Pm(){var e=Ki.current;return Ki.current=Vi,e===null?Vi:e}function cc(){(ye===0||ye===3||ye===2)&&(ye=4),be===null||!(Sn&268435455)&&!(ma&268435455)||Ht(be,ke)}function Yi(e,t){var n=Y;Y|=2;var s=Pm();(be!==e||ke!==t)&&(St=null,bn(e,t));do try{gg();break}catch(r){Lm(e,r)}while(!0);if(Vl(),Y=n,Ki.current=s,pe!==null)throw Error(P(261));return be=null,ke=0,ye}function gg(){for(;pe!==null;)Im(pe)}function yg(){for(;pe!==null&&!Up();)Im(pe)}function Im(e){var t=Mm(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?Om(e):pe=t,rc.current=null}function Om(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ug(n,t),n!==null){n.flags&=32767,pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ye=6,pe=null;return}}else if(n=cg(n,t,Ue),n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ye===0&&(ye=5)}function mn(e,t,n){var s=Q,r=Ze.transition;try{Ze.transition=null,Q=1,xg(e,t,n,s)}finally{Ze.transition=r,Q=s}return null}function xg(e,t,n,s){do rs();while(Kt!==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(Xp(e,a),e===be&&(pe=be=null,ke=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ei||(ei=!0,Dm(Li,function(){return rs(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ze.transition,Ze.transition=null;var o=Q;Q=1;var l=Y;Y|=4,rc.current=null,fg(e,n),Em(n,e),R0(Ro),Ii=!!$o,Ro=$o=null,e.current=n,mg(n),Wp(),Y=l,Q=o,Ze.transition=a}else e.current=n;if(ei&&(ei=!1,Kt=e,qi=r),a=e.pendingLanes,a===0&&(Zt=null),Kp(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(Gi)throw Gi=!1,e=rl,rl=null,e;return qi&1&&e.tag!==0&&rs(),a=e.pendingLanes,a&1?e===il?sr++:(sr=0,il=e):sr=0,cn(),null}function rs(){if(Kt!==null){var e=mf(qi),t=Ze.transition,n=Q;try{if(Ze.transition=null,Q=16>e?16:e,Kt===null)var s=!1;else{if(e=Kt,Kt=null,qi=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 l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(M=u;M!==null;){var m=M;switch(m.tag){case 0:case 11:case 15:tr(8,m,a)}var d=m.child;if(d!==null)d.return=m,M=d;else for(;M!==null;){m=M;var f=m.sibling,v=m.return;if(Nm(m),m===u){M=null;break}if(f!==null){f.return=v,M=f;break}M=v}}}var y=a.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==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:tr(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,M=g;break e}M=a.return}}var p=e.current;for(M=p;M!==null;){o=M;var h=o.child;if(o.subtreeFlags&2064&&h!==null)h.return=o,M=h;else e:for(o=p;M!==null;){if(l=M,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:fa(9,l)}}catch(k){le(l,l.return,k)}if(l===o){M=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,M=j;break e}M=l.return}}if(Y=r,cn(),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(ra,e)}catch{}s=!0}return s}finally{Q=n,Ze.transition=t}}return!1}function Fu(e,t,n){t=fs(n,t),t=mm(e,t,1),e=Xt(e,t,1),t=Pe(),e!==null&&(Ar(e,1,t),Be(e,t))}function le(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"&&(Zt===null||!Zt.has(s))){e=fs(n,e),e=hm(t,e,1),t=Xt(t,e,1),e=Pe(),t!==null&&(Ar(t,1,e),Be(t,e));break}}t=t.return}}function vg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Pe(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(ke&n)===n&&(ye===4||ye===3&&(ke&130023424)===ke&&500>ue()-ac?bn(e,0):ic|=n),Be(e,t)}function _m(e,t){t===0&&(e.mode&1?(t=Hr,Hr<<=1,!(Hr&130023424)&&(Hr=4194304)):t=1);var n=Pe();e=_t(e,t),e!==null&&(Ar(e,t,n),Be(e,n))}function bg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_m(e,n)}function jg(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),_m(e,n)}var Mm;Mm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ze.current)$e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return $e=!1,lg(e,t,n);$e=!!(e.flags&131072)}else $e=!1,se&&t.flags&1048576&&zf(t,zi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;vi(e,t),e=t.pendingProps;var r=ls(t,Te.current);ss(t,n),r=Zl(null,t,s,e,r,n);var a=ec();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,ql(t),r.updater=da,t.stateNode=r,r._reactInternals=t,Go(t,s,e,n),t=Qo(null,t,s,!0,a,n)):(t.tag=0,se&&a&&Bl(t),Ae(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(vi(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=kg(s),e=ot(s,e),r){case 0:t=Yo(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),Yo(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(xm(t),e===null)throw Error(P(387));s=t.pendingProps,a=t.memoizedState,r=a.element,Vf(e,t),Ui(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=fs(Error(P(423)),t),t=Pu(e,t,s,n,r);break e}else if(s!==r){r=fs(Error(P(424)),t),t=Pu(e,t,s,n,r);break e}else for(We=Jt(t.stateNode.containerInfo.firstChild),He=t,se=!0,ut=null,n=Wf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(cs(),s===r){t=Mt(e,t,n);break e}Ae(e,t,s,n)}t=t.child}return t;case 5:return Kf(t),e===null&&Ho(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,zo(s,r)?o=null:a!==null&&zo(s,a)&&(t.flags|=32),ym(e,t),Ae(e,t,o,n),t.child;case 6:return e===null&&Ho(t),null;case 13:return vm(e,t,n);case 4:return Yl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=us(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(Fi,s._currentValue),s._currentValue=o,a!==null)if(mt(a.value,o)){if(a.children===r.children&&!ze.current){t=Mt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=Lt(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?c.next=c:(c.next=m.next,m.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Vo(a.return,n,t),l.lanes|=n;break}c=c.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,l=o.alternate,l!==null&&(l.lanes|=n),Vo(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,ss(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 pm(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),vi(e,t),t.tag=1,Fe(s)?(e=!0,$i(t)):e=!1,ss(t,n),fm(t,s,r),Go(t,s,r,n),Qo(null,t,s,!0,e,n);case 19:return bm(e,t,n);case 22:return gm(e,t,n)}throw Error(P(156,t.tag))};function Dm(e,t){return cf(e,t)}function wg(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 wg(e,t,n,s)}function uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kg(e){if(typeof e=="function")return uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Al)return 11;if(e===Ll)return 14}return 2}function tn(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")uc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Rn:return jn(n.children,r,a,t);case Tl:o=8,r|=8;break;case yo:return e=Xe(12,n,t,r|2),e.elementType=yo,e.lanes=a,e;case xo:return e=Xe(13,n,t,r),e.elementType=xo,e.lanes=a,e;case vo:return e=Xe(19,n,t,r),e.elementType=vo,e.lanes=a,e;case Vd:return ha(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wd:o=10;break e;case Hd:o=9;break e;case Al:o=11;break e;case Ll:o=14;break e;case Ft: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 jn(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=Vd,e.lanes=n,e.stateNode={isHidden:!1},e}function to(e,t,n){return e=Xe(6,e,null,t),e.lanes=n,e}function no(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 Ng(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 dc(e,t,n,s,r,a,o,l,c){return e=new Ng(e,t,n,l,c),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},ql(a),e}function Sg(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 $m(e){if(!e)return an;e=e._reactInternals;e:{if(Ln(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 $f(e,n,t)}return t}function Rm(e,t,n,s,r,a,o,l,c){return e=dc(n,s,!0,e,r,a,o,l,c),e.context=$m(null),n=e.current,s=Pe(),r=en(n),a=Lt(s,r),a.callback=t??null,Xt(n,a,r),e.current.lanes=r,Ar(e,r,s),Be(e,s),e}function pa(e,t,n,s){var r=t.current,a=Pe(),o=en(r);return n=$m(n),t.context===null?t.context=n:t.pendingContext=n,t=Lt(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Xt(r,t,o),e!==null&&(ft(e,r,o,a),gi(e,r,o)),o}function Qi(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 fc(e,t){Bu(e,t),(e=e.alternate)&&Bu(e,t)}function Cg(){return null}var zm=typeof reportError=="function"?reportError:function(e){console.error(e)};function mc(e){this._internalRoot=e}ga.prototype.render=mc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));pa(e,t,null,null)};ga.prototype.unmount=mc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cn(function(){pa(null,e,null,null)}),t[Ot]=null}};function ga(e){this._internalRoot=e}ga.prototype.unstable_scheduleHydration=function(e){if(e){var t=gf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wt.length&&t!==0&&t<Wt[n].priority;n++);Wt.splice(n,0,e),n===0&&xf(e)}};function hc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ya(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uu(){}function Eg(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=Qi(o);a.call(u)}}var o=Rm(t,s,e,0,null,!1,!1,"",Uu);return e._reactRootContainer=o,e[Ot]=o.current,hr(e.nodeType===8?e.parentNode:e),Cn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var l=s;s=function(){var u=Qi(c);l.call(u)}}var c=dc(e,0,!1,null,null,!1,!1,"",Uu);return e._reactRootContainer=c,e[Ot]=c.current,hr(e.nodeType===8?e.parentNode:e),Cn(function(){pa(t,c,n,s)}),c}function xa(e,t,n,s,r){var a=n._reactRootContainer;if(a){var o=a;if(typeof r=="function"){var l=r;r=function(){var c=Qi(o);l.call(c)}}pa(t,o,e,r)}else o=Eg(n,t,e,r,s);return Qi(o)}hf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ws(t.pendingLanes);n!==0&&(Ol(t,n|1),Be(t,ue()),!(Y&6)&&(ms=ue()+500,cn()))}break;case 13:Cn(function(){var s=_t(e,1);if(s!==null){var r=Pe();ft(s,e,1,r)}}),fc(e,1)}};_l=function(e){if(e.tag===13){var t=_t(e,134217728);if(t!==null){var n=Pe();ft(t,e,134217728,n)}fc(e,134217728)}};pf=function(e){if(e.tag===13){var t=en(e),n=_t(e,t);if(n!==null){var s=Pe();ft(n,e,t,s)}fc(e,t)}};gf=function(){return Q};yf=function(e,t){var n=Q;try{return Q=e,t()}finally{Q=n}};Ao=function(e,t,n){switch(t){case"input":if(wo(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=la(s);if(!r)throw Error(P(90));Gd(s),wo(s,r)}}}break;case"textarea":Yd(e,n);break;case"select":t=n.value,t!=null&&Zn(e,!!n.multiple,t,!1)}};nf=oc;sf=Cn;var Tg={usingClientEntryPoint:!1,Events:[Pr,Un,la,ef,tf,oc]},Ds={findFiberByHostInstance:pn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ag={bundleType:Ds.bundleType,version:Ds.version,rendererPackageName:Ds.rendererPackageName,rendererConfig:Ds.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=of(e),e===null?null:e.stateNode},findFiberByHostInstance:Ds.findFiberByHostInstance||Cg,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 ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ti.isDisabled&&ti.supportsFiber)try{ra=ti.inject(Ag),jt=ti}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tg;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hc(t))throw Error(P(200));return Sg(e,t,null,n)};Ke.createRoot=function(e,t){if(!hc(e))throw Error(P(299));var n=!1,s="",r=zm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=dc(e,1,!1,null,null,n,!1,s,r),e[Ot]=t.current,hr(e.nodeType===8?e.parentNode:e),new mc(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=of(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return Cn(e)};Ke.hydrate=function(e,t,n){if(!ya(t))throw Error(P(200));return xa(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!hc(e))throw Error(P(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",o=zm;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Rm(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 ga(t)};Ke.render=function(e,t,n){if(!ya(t))throw Error(P(200));return xa(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!ya(e))throw Error(P(40));return e._reactRootContainer?(Cn(function(){xa(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};Ke.unstable_batchedUpdates=oc;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ya(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return xa(e,t,n,!1,s)};Ke.version="18.3.1-next-f1338f8080-20240426";function Fm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fm)}catch(e){console.error(e)}}Fm(),zd.exports=Ke;var Lg=zd.exports,Bm,Wu=Lg;Bm=Wu.createRoot,Wu.hydrateRoot;const Pg="modulepreload",Ig=function(e){return"/"+e},Hu={},Og=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Ig(c),c in Hu)return;Hu[c]=!0;const u=c.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${m}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Pg,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,v)=>{d.addEventListener("load",f),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.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 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)}var Gt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Gt||(Gt={}));const Vu="popstate";function _g(e){e===void 0&&(e={});function t(s,r){let{pathname:a,search:o,hash:l}=s.location;return ll("",{pathname:a,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Ji(r)}return Dg(t,n,null,e)}function ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Mg(){return Math.random().toString(36).substr(2,8)}function Ku(e,t){return{usr:e.state,key:e.key,idx:t}}function ll(e,t,n,s){return n===void 0&&(n=null),kr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:n,key:t&&t.key||s||Mg()})}function Ji(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 Dg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,o=r.history,l=Gt.Pop,c=null,u=m();u==null&&(u=0,o.replaceState(kr({},o.state,{idx:u}),""));function m(){return(o.state||{idx:null}).idx}function d(){l=Gt.Pop;let w=m(),g=w==null?null:w-u;u=w,c&&c({action:l,location:x.location,delta:g})}function f(w,g){l=Gt.Push;let p=ll(x.location,w,g);u=m()+1;let h=Ku(p,u),j=x.createHref(p);try{o.pushState(h,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(j)}a&&c&&c({action:l,location:x.location,delta:1})}function v(w,g){l=Gt.Replace;let p=ll(x.location,w,g);u=m();let h=Ku(p,u),j=x.createHref(p);o.replaceState(h,"",j),a&&c&&c({action:l,location:x.location,delta:0})}function y(w){let g=r.location.origin!=="null"?r.location.origin:r.location.href,p=typeof w=="string"?w:Ji(w);return p=p.replace(/ $/,"%20"),ae(g,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,g)}let x={get action(){return l},get location(){return e(r,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Vu,d),c=w,()=>{r.removeEventListener(Vu,d),c=null}},createHref(w){return t(r,w)},createURL:y,encodeLocation(w){let g=y(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:v,go(w){return o.go(w)}};return x}var Gu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gu||(Gu={}));function $g(e,t,n){return n===void 0&&(n="/"),Rg(e,t,n)}function Rg(e,t,n,s){let r=typeof t=="string"?bs(t):t,a=hs(r.pathname||"/",n);if(a==null)return null;let o=Um(e);zg(o);let l=null,c=Qg(a);for(let u=0;l==null&&u<o.length;++u)l=qg(o[u],c);return l}function Um(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(ae(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=nn([s,c.relativePath]),m=n.concat(c);a.children&&a.children.length>0&&(ae(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Um(a.children,t,m,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Kg(u,a.index),routesMeta:m})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))r(a,o);else for(let c of Wm(a.path))r(a,o,c)}),t}function Wm(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=Wm(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function zg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Gg(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Fg=/^:[\w-]+$/,Bg=3,Ug=2,Wg=1,Hg=10,Vg=-2,qu=e=>e==="*";function Kg(e,t){let n=e.split("/"),s=n.length;return n.some(qu)&&(s+=Vg),t&&(s+=Ug),n.filter(r=>!qu(r)).reduce((r,a)=>r+(Fg.test(a)?Bg:a===""?Wg:Hg),s)}function Gg(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 l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,m=a==="/"?t:t.slice(a.length)||"/",d=cl({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},m),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:nn([a,d.pathname]),pathnameBase:ty(nn([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=nn([a,d.pathnameBase]))}return o}function cl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Yg(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,m,d)=>{let{paramName:f,isOptional:v}=m;if(f==="*"){let x=l[d]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const y=l[d];return v&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Yg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pc(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,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Qg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pc(!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 Jg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xg=e=>Jg.test(e);function Zg(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?bs(e):e,a;if(n)if(Xg(n))a=n;else{if(n.includes("//")){let o=n;n=Hm(n),pc(!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:ny(s),hash:sy(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 so(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 ey(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gc(e,t){let n=ey(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function yc(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=bs(e):(r=kr({},e),ae(!r.pathname||!r.pathname.includes("?"),so("?","pathname","search",r)),ae(!r.pathname||!r.pathname.includes("#"),so("#","pathname","hash",r)),ae(!r.search||!r.search.includes("#"),so("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=Zg(r,l),u=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||m)&&(c.pathname+="/"),c}const Hm=e=>e.replace(/\/\/+/g,"/"),nn=e=>Hm(e.join("/")),ty=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ny=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ry(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Vm=["post","put","patch","delete"];new Set(Vm);const iy=["get",...Vm];new Set(iy);/**
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 Nr(){return Nr=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},Nr.apply(null,arguments)}const va=b.createContext(null),Km=b.createContext(null),$t=b.createContext(null),ba=b.createContext(null),Nt=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Gm=b.createContext(null);function ay(e,t){let{relative:n}=t===void 0?{}:t;js()||ae(!1);let{basename:s,navigator:r}=b.useContext($t),{hash:a,pathname:o,search:l}=ja(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:nn([s,o])),r.createHref({pathname:c,search:l,hash:a})}function js(){return b.useContext(ba)!=null}function Rt(){return js()||ae(!1),b.useContext(ba).location}function qm(e){b.useContext($t).static||b.useLayoutEffect(e)}function Ym(){let{isDataRoute:e}=b.useContext(Nt);return e?wy():oy()}function oy(){js()||ae(!1);let e=b.useContext(va),{basename:t,future:n,navigator:s}=b.useContext($t),{matches:r}=b.useContext(Nt),{pathname:a}=Rt(),o=JSON.stringify(gc(r,n.v7_relativeSplatPath)),l=b.useRef(!1);return qm(()=>{l.current=!0}),b.useCallback(function(u,m){if(m===void 0&&(m={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=yc(u,JSON.parse(o),a,m.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:nn([t,d.pathname])),(m.replace?s.replace:s.push)(d,m.state,m)},[t,s,o,a,e])}const ly=b.createContext(null);function cy(e){let t=b.useContext(Nt).outlet;return t&&b.createElement(ly.Provider,{value:e},t)}function uy(){let{matches:e}=b.useContext(Nt),t=e[e.length-1];return t?t.params:{}}function ja(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=b.useContext($t),{matches:r}=b.useContext(Nt),{pathname:a}=Rt(),o=JSON.stringify(gc(r,s.v7_relativeSplatPath));return b.useMemo(()=>yc(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function dy(e,t){return fy(e,t)}function fy(e,t,n,s){js()||ae(!1);let{navigator:r}=b.useContext($t),{matches:a}=b.useContext(Nt),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Rt(),m;if(t){var d;let w=typeof t=="string"?bs(t):t;c==="/"||(d=w.pathname)!=null&&d.startsWith(c)||ae(!1),m=w}else m=u;let f=m.pathname||"/",v=f;if(c!=="/"){let w=c.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=$g(e,{pathname:v}),x=yy(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:nn([c,r.encodeLocation?r.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:nn([c,r.encodeLocation?r.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),a,n,s);return t&&x?b.createElement(ba.Provider,{value:{location:Nr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:Gt.Pop}},x):x}function my(){let e=jy(),t=ry(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 b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:r},n):null,null)}const hy=b.createElement(my,null);class py extends b.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?b.createElement(Nt.Provider,{value:this.props.routeContext},b.createElement(Gm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gy(e){let{routeContext:t,match:n,children:s}=e,r=b.useContext(va);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Nt.Provider,{value:t},s)}function yy(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,l=(r=n)==null?void 0:r.errors;if(l!=null){let m=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);m>=0||ae(!1),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let m=0;m<o.length;m++){let d=o[m];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=m),d.route.id){let{loaderData:f,errors:v}=n,y=d.route.loader&&f[d.route.id]===void 0&&(!v||v[d.route.id]===void 0);if(d.route.lazy||y){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((m,d,f)=>{let v,y=!1,x=null,w=null;n&&(v=l&&d.route.id?l[d.route.id]:void 0,x=d.route.errorElement||hy,c&&(u<0&&f===0?(ky("route-fallback"),y=!0,w=null):u===f&&(y=!0,w=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),p=()=>{let h;return v?h=x:y?h=w:d.route.Component?h=b.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=m,b.createElement(gy,{match:d,routeContext:{outlet:m,matches:g,isDataRoute:n!=null},children:h})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?b.createElement(py,{location:n.location,revalidation:n.revalidation,component:x,error:v,children:p(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):p()},null)}var Qm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Qm||{}),Jm=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}(Jm||{});function xy(e){let t=b.useContext(va);return t||ae(!1),t}function vy(e){let t=b.useContext(Km);return t||ae(!1),t}function by(e){let t=b.useContext(Nt);return t||ae(!1),t}function Xm(e){let t=by(),n=t.matches[t.matches.length-1];return n.route.id||ae(!1),n.route.id}function jy(){var e;let t=b.useContext(Gm),n=vy(),s=Xm();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function wy(){let{router:e}=xy(Qm.UseNavigateStable),t=Xm(Jm.UseNavigateStable),n=b.useRef(!1);return qm(()=>{n.current=!0}),b.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,Nr({fromRouteId:t},a)))},[e,t])}const Qu={};function ky(e,t,n){Qu[e]||(Qu[e]=!0)}function Ny(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Sy(e){let{to:t,replace:n,state:s,relative:r}=e;js()||ae(!1);let{future:a,static:o}=b.useContext($t),{matches:l}=b.useContext(Nt),{pathname:c}=Rt(),u=Ym(),m=yc(t,gc(l,a.v7_relativeSplatPath),c,r==="path"),d=JSON.stringify(m);return b.useEffect(()=>u(JSON.parse(d),{replace:n,state:s,relative:r}),[u,d,r,n,s]),null}function Cy(e){return cy(e.context)}function he(e){ae(!1)}function Ey(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Gt.Pop,navigator:a,static:o=!1,future:l}=e;js()&&ae(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:o,future:Nr({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=bs(s));let{pathname:m="/",search:d="",hash:f="",state:v=null,key:y="default"}=s,x=b.useMemo(()=>{let w=hs(m,c);return w==null?null:{location:{pathname:w,search:d,hash:f,state:v,key:y},navigationType:r}},[c,m,d,f,v,y,r]);return x==null?null:b.createElement($t.Provider,{value:u},b.createElement(ba.Provider,{children:n,value:x}))}function Ty(e){let{children:t,location:n}=e;return dy(ul(t),n)}new Promise(()=>{});function ul(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(s,r)=>{if(!b.isValidElement(s))return;let a=[...t,r];if(s.type===b.Fragment){n.push.apply(n,ul(s.props.children,a));return}s.type!==he&&ae(!1),!s.props.index||!s.props.children||ae(!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=ul(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 Xi(){return Xi=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},Xi.apply(null,arguments)}function Zm(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 Ay(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ly(e,t){return e.button===0&&(!t||t==="_self")&&!Ay(e)}const Py=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Iy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Oy="6";try{window.__reactRouterVersion=Oy}catch{}const _y=b.createContext({isTransitioning:!1}),My="startTransition",Ju=vp[My];function Dy(e){let{basename:t,children:n,future:s,window:r}=e,a=b.useRef();a.current==null&&(a.current=_g({window:r,v5Compat:!0}));let o=a.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},m=b.useCallback(d=>{u&&Ju?Ju(()=>c(d)):c(d)},[c,u]);return b.useLayoutEffect(()=>o.listen(m),[o,m]),b.useEffect(()=>Ny(s),[s]),b.createElement(Ey,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const $y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=b.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:m,viewTransition:d}=t,f=Zm(t,Py),{basename:v}=b.useContext($t),y,x=!1;if(typeof u=="string"&&Ry.test(u)&&(y=u,$y))try{let h=new URL(window.location.href),j=u.startsWith("//")?new URL(h.protocol+u):new URL(u),k=hs(j.pathname,v);j.origin===h.origin&&k!=null?u=k+j.search+j.hash:x=!0}catch{}let w=ay(u,{relative:r}),g=Fy(u,{replace:o,state:l,target:c,preventScrollReset:m,relative:r,viewTransition:d});function p(h){s&&s(h),h.defaultPrevented||g(h)}return b.createElement("a",Xi({},f,{href:y||w,onClick:x||a?s:p,ref:n,target:c}))}),lt=b.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:m}=t,d=Zm(t,Iy),f=ja(c,{relative:d.relative}),v=Rt(),y=b.useContext(Km),{navigator:x,basename:w}=b.useContext($t),g=y!=null&&By(f)&&u===!0,p=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,h=v.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(h=h.toLowerCase(),j=j?j.toLowerCase():null,p=p.toLowerCase()),j&&w&&(j=hs(j,w)||j);const k=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let C=h===p||!o&&h.startsWith(p)&&h.charAt(k)==="/",S=j!=null&&(j===p||!o&&j.startsWith(p)&&j.charAt(p.length)==="/"),N={isActive:C,isPending:S,isTransitioning:g},T=C?s:void 0,L;typeof a=="function"?L=a(N):L=[a,C?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(N):l;return b.createElement(we,Xi({},d,{"aria-current":T,className:L,ref:n,style:F,to:c,viewTransition:u}),typeof m=="function"?m(N):m)});var dl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dl||(dl={}));var Xu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xu||(Xu={}));function zy(e){let t=b.useContext(va);return t||ae(!1),t}function Fy(e,t){let{target:n,replace:s,state:r,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Ym(),u=Rt(),m=ja(e,{relative:o});return b.useCallback(d=>{if(Ly(d,n)){d.preventDefault();let f=s!==void 0?s:Ji(u)===Ji(m);c(e,{replace:f,state:r,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,m,s,r,n,e,a,o,l])}function By(e,t){t===void 0&&(t={});let n=b.useContext(_y);n==null&&ae(!1);let{basename:s}=zy(dl.useViewTransitionState),r=ja(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 cl(r.pathname,o)!=null||cl(r.pathname,a)!=null}function Uy(e){const[t,n]=b.useState(null),s=b.useRef(0),r=b.useCallback(()=>{if(e.length===0){n(null);return}let a=e[0];for(const o of e){const l=document.getElementById(o);l&&l.getBoundingClientRect().top<=100&&(a=o)}n(a)},[e]);return b.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 X(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:()=>X("GET","/api/status"),getConnectors:()=>X("GET","/api/connectors"),getConnector:(e,t)=>X("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>X("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>X("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return X("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>X("GET",`/api/audit/${e}`),getConfig:()=>X("GET","/api/config"),setConfig:(e,t)=>X("POST","/api/config",{key:e,value:t}),getPreferences:()=>X("GET","/api/preferences"),setPreference:(e,t)=>X("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>X("GET",`/api/goals?month=${e}`),upsertGoal:e=>X("POST","/api/goals",e),deleteGoal:e=>X("DELETE",`/api/goals/${e}`),getCachedReport:e=>X("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>X("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>X("GET","/api/timetracking/projects"),cacheProjects:e=>X("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>X("POST","/api/journal/generate",e),getCachedSecurityNews:()=>X("GET","/api/security-news/cache"),cacheSecurityNews:e=>X("POST","/api/security-news/cache",{data:e}),getCachedTrustedPeers:()=>X("GET","/api/trusted-peers/cache"),cacheTrustedPeers:e=>X("POST","/api/trusted-peers/cache",{data:e}),getCachedRoomAvailability:e=>X("GET",`/api/room-availability/cache?date=${e}`),cacheRoomAvailability:(e,t)=>X("POST","/api/room-availability/cache",{date:e,data:t}),getSkills:()=>X("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 eh={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},Wy={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"},Hy={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function W({variant:e="neutral",size:t="sm",className:n="",children:s}){return i.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${Hy[t]} ${Wy[e]} ${n}`,children:s})}function Vy(){const[e,t]=b.useState(null),[n,s]=b.useState([]),r=b.useCallback(()=>{B.getStatus().then(t).catch(()=>t(null)),B.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);b.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function a(o){const l=Date.now()-new Date(o).getTime(),c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c} min ago`;const u=Math.floor(c/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(W,{variant:eh[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 ht({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 Ky({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(W,{size:"sm",children:e.access}),e.capabilities.map(a=>i.jsx(W,{size:"sm",children:a},a)),e.isHighRisk&&e.isApproved&&i.jsx(W,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&i.jsx(W,{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(we,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),i.jsx(we,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function Gy({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,a]=b.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(Ky,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function qy(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(null),c=b.useCallback(()=>{const d=B.getConnectors(),f=B.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([v,y])=>{t(v.connectors);const x=y.config.security??{};s(x.approvedHighRisk??[])}).catch(()=>{}).finally(()=>a(!1))},[]);b.useEffect(()=>{c()},[c]);const u=b.useCallback(async d=>{l(d);try{const f=[...n,d];await B.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{l(null)}},[n,c]),m=b.useMemo(()=>wa(e),[e]);return r?i.jsx(ht,{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:m.map(([d,f])=>i.jsx(Gy,{site:d,connectors:f,approvingKey:o,onApprove:u},d))})]})}function Sr(){const[e,t]=b.useState(!1),[n,s]=b.useState(null),[r,a]=b.useState(null),[o,l]=b.useState(!1),[c,u]=b.useState(null),m=b.useCallback(()=>{t(!1),s(null),a(null),l(!1),u(null)},[]),d=b.useCallback(async(v,y)=>{t(!0),a(null),s(null),l(!1),u(null);try{const x=await B.run(v,y);if(x.requiresApproval&&x.requestId){l(!0);const w=new EventSource(`/api/run/events/${x.requestId}`);w.addEventListener("approval",g=>{const p=JSON.parse(g.data);u(p.approvalId)}),w.addEventListener("result",g=>{const p=JSON.parse(g.data);!p.ok&&p.error?a(p.error):s(p),l(!1),t(!1),w.close()}),w.onerror=()=>{a("SSE connection lost"),l(!1),t(!1),w.close()}}else!x.ok&&x.error?(a(x.error),t(!1)):(s(x),t(!1))}catch(x){a(x instanceof Error?x.message:"Unknown error"),t(!1)}},[]),f=b.useCallback(async v=>{if(c)try{await B.approve(c,v),v||(l(!1),t(!1),a("Approval rejected"))}catch(y){a(y instanceof Error?y.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:o,approvalId:c,run:d,handleApproval:f,reset:m}}function Yy(){const{site:e,name:t}=uy(),n=`${e}/${t}`,[s,r]=b.useState(null),[a,o]=b.useState(!0),[l,c]=b.useState({}),[u,m]=b.useState(null),{running:d,result:f,error:v,approvalPending:y,approvalId:x,run:w,handleApproval:g}=Sr();b.useEffect(()=>{!e||!t||B.getConnector(e,t).then(h=>{r(h.connector);const j={};for(const k of h.connector.args??[])j[k.name]="";c(j)}).catch(h=>m(h.message)).finally(()=>o(!1))},[e,t]);const p=b.useCallback(async()=>{const h={};for(const[j,k]of Object.entries(l))k&&(h[j]=k);await w(n,h)},[l,n,w]);return a?i.jsx(ht,{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(we,{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(h=>i.jsxs("label",{className:"form-control",children:[i.jsxs("span",{className:"label-text mb-1 text-sm",children:[h.name,!h.required&&i.jsx("span",{className:"opacity-40",children:" (optional)"})]}),i.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:h.help,value:l[h.name]??"",onChange:j=>c(k=>({...k,[h.name]:j.target.value})),pattern:h.pattern}),h.help&&i.jsx("span",{className:"text-xs opacity-40 mt-1",children:h.help})]},h.name)),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:p,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!y&&i.jsx(ht,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),y&&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:()=>g(!0),disabled:!x,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!x,children:"Reject"})]})]}),v&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:v})}),f&&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:[f.rowCount??f.data.length," rows",f.durationMs?` · ${(f.durationMs/1e3).toFixed(1)}s`:""]})]}),f.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:(f.columns??Object.keys(f.data[0])).map(h=>i.jsx("th",{children:h},h))})}),i.jsx("tbody",{children:f.data.map((h,j)=>i.jsx("tr",{children:(f.columns??Object.keys(h)).map(k=>i.jsx("td",{className:"text-sm",children:String(h[k]??"")},k))},j))})]})})]})]}):i.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const Qy=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],Jy=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],In=20;function Xy(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(168),[c,u]=b.useState(""),[m,d]=b.useState(""),[f,v]=b.useState(null),[y,x]=b.useState(0);b.useEffect(()=>{B.getConnectors().then(h=>s(h.connectors)).catch(()=>{})},[]);const w=b.useCallback(()=>{a(!0);const h={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(In+y+1)};c&&(h.type=c),m&&(h.connector=m),B.getAudit(h).then(j=>t(j.events)).catch(()=>{}).finally(()=>a(!1))},[o,c,m,y]);b.useEffect(()=>{w();const h=setInterval(w,6e4);return()=>clearInterval(h)},[w]);const g=e.slice(y,y+In),p=e.length>y+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:"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:h=>{l(Number(h.target.value)),x(0)},children:Qy.map(h=>i.jsx("option",{value:h.hours,children:h.label},h.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:c,onChange:h=>{u(h.target.value),x(0)},children:[i.jsx("option",{value:"",children:"All types"}),Jy.map(h=>i.jsx("option",{value:h,children:h},h))]})]}),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:m,onChange:h=>{d(h.target.value),x(0)},children:[i.jsx("option",{value:"",children:"All connectors"}),n.map(h=>i.jsx("option",{value:h.key,children:h.key},h.key))]})]})]}),r&&e.length===0?i.jsx(ht,{label:"Loading audit events..."}):i.jsxs(i.Fragment,{children:[g.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:g.map(h=>i.jsxs(b.Fragment,{children:[i.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>v(f===h.id?null:h.id),role:"button","aria-expanded":f===h.id,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),v(f===h.id?null:h.id))},children:[i.jsx("td",{className:"text-sm font-mono",children:new Date(h.timestamp).toLocaleString()}),i.jsx("td",{children:i.jsx(W,{variant:eh[h.type]??"neutral",children:h.type})}),i.jsx("td",{className:"font-mono text-sm",children:h.connector||"—"}),i.jsx("td",{className:"text-sm",children:h.user}),i.jsx("td",{className:"text-sm font-mono",children:h.durationMs?`${(h.durationMs/1e3).toFixed(1)}s`:"—"}),i.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:f===h.id?"▲":"▼"})]},h.id),f===h.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:h.id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",i.jsx("span",{className:"font-mono text-xs",children:h.correlationId??"—"})]}),h.connectorHash&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",i.jsx("span",{className:"font-mono text-xs",children:h.connectorHash})]}),h.error&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Error:"})," ",i.jsx("span",{className:"text-error",children:h.error})]}),h.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(h.args)})]}),h.domains&&h.domains.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Domains:"})," ",h.domains.join(", ")]}),h.capabilities&&h.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",h.capabilities.join(", ")]})]}),h.steps&&h.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:h.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))})]})]})]})},`${h.id}-detail`)]},h.id))})]})}),g.length>0&&i.jsxs("div",{className:"flex justify-between items-center mt-4",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:y===0,onClick:()=>x(Math.max(0,y-In)),children:"Previous"}),i.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",y+1,"–",Math.min(y+In,e.length),p?"":` of ${e.length}`]}),i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!p,onClick:()=>x(y+In),children:"Next"})]})]})]})}const xc=Symbol.for("yaml.alias"),fl=Symbol.for("yaml.document"),sn=Symbol.for("yaml.map"),th=Symbol.for("yaml.pair"),kt=Symbol.for("yaml.scalar"),ws=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),ks=e=>!!e&&typeof e=="object"&&e[st]===xc,Or=e=>!!e&&typeof e=="object"&&e[st]===fl,_r=e=>!!e&&typeof e=="object"&&e[st]===sn,me=e=>!!e&&typeof e=="object"&&e[st]===th,ee=e=>!!e&&typeof e=="object"&&e[st]===kt,Mr=e=>!!e&&typeof e=="object"&&e[st]===ws;function de(e){if(e&&typeof e=="object")switch(e[st]){case sn:case ws:return!0}return!1}function fe(e){if(e&&typeof e=="object")switch(e[st]){case xc:case sn:case kt:case ws:return!0}return!1}const nh=e=>(ee(e)||de(e))&&!!e.anchor,hn=Symbol("break visit"),Zy=Symbol("skip children"),rr=Symbol("remove node");function Ns(e,t){const n=ex(t);Or(e)?Yn(null,e.contents,n,Object.freeze([e]))===rr&&(e.contents=null):Yn(null,e,n,Object.freeze([]))}Ns.BREAK=hn;Ns.SKIP=Zy;Ns.REMOVE=rr;function Yn(e,t,n,s){const r=tx(e,t,n,s);if(fe(r)||me(r))return nx(e,s,r),Yn(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=Yn(a,t.items[a],n,s);if(typeof o=="number")a=o-1;else{if(o===hn)return hn;o===rr&&(t.items.splice(a,1),a-=1)}}}else if(me(t)){s=Object.freeze(s.concat(t));const a=Yn("key",t.key,n,s);if(a===hn)return hn;a===rr&&(t.key=null);const o=Yn("value",t.value,n,s);if(o===hn)return hn;o===rr&&(t.value=null)}}return r}function ex(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 tx(e,t,n,s){var r,a,o,l,c;if(typeof n=="function")return n(e,t,s);if(_r(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(Mr(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,s);if(me(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(ee(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(ks(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function nx(e,t,n){const s=t[t.length-1];if(de(s))s.items[e]=n;else if(me(s))e==="key"?s.key=n:s.value=n;else if(Or(s))s.contents=n;else{const r=ks(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const sx={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rx=e=>e.replace(/[!,[\]{}]/g,t=>sx[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+rx(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={};Ns(t.contents,(o,l)=>{fe(l)&&l.tag&&(a[l.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of s)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.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 sh(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 rh(e){const t=new Set;return Ns(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function ih(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function ix(e,t){const n=[],s=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=rh(e));const o=ih(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 l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=a,l}}},sourceObjects:s}}function Qn(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],l=Qn(e,s,String(r),o);l===void 0?delete s[r]:l!==o&&(s[r]=l)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const a=s.get(r),o=Qn(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=Qn(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=Qn(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||!nh(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 vc{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},l=et(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Qn(a,{"":l},"",l):l}}class bc extends vc{constructor(t){super(xc),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=[],Ns(t,{Node:(a,o)=>{(ks(o)||nh(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 c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(o);if(l||(et(o,null,n),l=s.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ki(r,o,s)),l.count*l.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(sh(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 ki(e,t,n){if(ks(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=ki(e,r,n);a>s&&(s=a)}return s}else if(me(t)){const s=ki(e,t.key,n),r=ki(e,t.value,n);return Math.max(s,r)}return 1}const ah=e=>!e||typeof e!="function"&&typeof e!="object";class U extends vc{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 ax="tag:yaml.org,2002:";function ox(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 Cr(e,t,n){var d,f,v;if(Or(e)&&(e=e.contents),fe(e))return e;if(me(e)){const y=(f=(d=n.schema[sn]).createNode)==null?void 0:f.call(d,n.schema,null,n);return y.items.push(e),y}(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:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new bc(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=ax+t.slice(2));let u=ox(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new U(e);return c&&(c.node=y),y}u=e instanceof Map?o[sn]:Symbol.iterator in Object(e)?o[ws]:o[sn]}a&&(a(u),delete n.onTagObj);const m=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((v=u==null?void 0:u.nodeClass)==null?void 0:v.from)=="function"?u.nodeClass.from(n.schema,e,n):new U(e);return t?m.tag=t:u.default||(m.tag=u.tag),c&&(c.node=m),m}function Zi(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 Cr(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 oh extends vc{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)||me(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,Zi(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(!me(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,Zi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const lx=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function At(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const xn=(e,t,n)=>e.endsWith(`
69
- `)?At(n,t):n.includes(`
70
- `)?`
71
- `+At(n,t):(e.endsWith(" ")?"":" ")+n,lh="flow",ml="block",Ni="quoted";function ka(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;r<a&&(a=0);const c=Math.max(1+a,1+r-t.length);if(e.length<=c)return e;const u=[],m={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,a)?u.push(0):d=r-s);let f,v,y=!1,x=-1,w=-1,g=-1;n===ml&&(x=Zu(e,x,t.length),x!==-1&&(d=x+c));for(let h;h=e[x+=1];){if(n===Ni&&h==="\\"){switch(w=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}g=x}if(h===`
72
- `)n===ml&&(x=Zu(e,x,t.length)),d=x+t.length+c,f=void 0;else{if(h===" "&&v&&v!==" "&&v!==`
73
- `&&v!==" "){const j=e[x+1];j&&j!==" "&&j!==`
74
- `&&j!==" "&&(f=x)}if(x>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===Ni){for(;v===" "||v===" ";)v=h,h=e[x+=1],y=!0;const j=x>g+1?x-2:w-1;if(m[j])return e;u.push(j),m[j]=!0,d=j+c,f=void 0}else y=!0}v=h}if(y&&l&&l(),u.length===0)return e;o&&o();let p=e.slice(0,u[0]);for(let h=0;h<u.length;++h){const j=u[h],k=u[h+1]||e.length;j===0?p=`
75
- ${t}${e.slice(0,k)}`:(n===Ni&&m[j]&&(p+=`${e[j]}\\`),p+=`
76
- ${t}${e.slice(j+1,k)}`)}return p}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 cx(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 ir(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="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const m=n.substr(c+2,4);switch(m){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:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(l,c)+`
79
-
80
- `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
81
- `,c+=2;o+=a,n[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+n.slice(l):n,s?o:ka(o,a,Ni,Na(t,!1))}function hl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
- `)||/[ \t]\n|\n[ \t]/.test(e))return ir(e,t);const n=t.indent||(Sa(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
- ${n}`)+"'";return t.implicitKey?s:ka(s,n,lh,Na(t,!1))}function Jn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=ir;else{const r=e.includes('"'),a=e.includes("'");r&&!a?s=hl:a&&!r?s=ir:s=n?hl:ir}return s(e,t)}let pl;try{pl=new RegExp(`(^|(?<!
84
- ))
85
- +(?!
86
- |$)`,"g")}catch{pl=/\n+(?!\n|$)/g}function Si({comment:e,type:t,value:n},s,r,a){const{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Jn(n,s);const u=s.indent||(s.forceBlockIndent||Sa(n)?" ":""),m=o==="literal"?!0:o==="folded"||t===U.BLOCK_FOLDED?!1:t===U.BLOCK_LITERAL?!0:!cx(n,c,u.length);if(!n)return m?`|
87
- `:`>
88
- `;let d,f;for(f=n.length;f>0;--f){const k=n[f-1];if(k!==`
89
- `&&k!==" "&&k!==" ")break}let v=n.substring(f);const y=v.indexOf(`
90
- `);y===-1?d="-":n===v||y!==v.length-1?(d="+",a&&a()):d="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
91
- `&&(v=v.slice(0,-1)),v=v.replace(pl,`$&${u}`));let x=!1,w,g=-1;for(w=0;w<n.length;++w){const k=n[w];if(k===" ")x=!0;else if(k===`
92
- `)g=w;else break}let p=n.substring(0,g<w?g+1:w);p&&(n=n.substring(p.length),p=p.replace(/\n+/g,`$&${u}`));let j=(x?u?"2":"1":"")+d;if(e&&(j+=" "+l(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!m){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 S=Na(s,!0);o!=="folded"&&t!==U.BLOCK_FOLDED&&(S.onOverflow=()=>{C=!0});const N=ka(`${p}${k}${v}`,u,ml,S);if(!C)return`>${j}
94
- ${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${j}
95
- ${u}${p}${n}${v}`}function ux(e,t,n,s){const{type:r,value:a}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:m}=t;if(l&&a.includes(`
96
- `)||m&&/[[\]{},]/.test(a))return Jn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||m||!a.includes(`
97
- `)?Jn(a,t):Si(e,t,n,s);if(!l&&!m&&r!==U.PLAIN&&a.includes(`
98
- `))return Si(e,t,n,s);if(Sa(a)){if(c==="")return t.forceBlockIndent=!0,Si(e,t,n,s);if(l&&c===u)return Jn(a,t)}const d=a.replace(/\n+/g,`$&
99
- ${c}`);if(o){const f=x=>{var w;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((w=x.test)==null?void 0:w.test(d))},{compat:v,tags:y}=t.doc.schema;if(y.some(f)||v!=null&&v.some(f))return Jn(a,t)}return l?d:ka(d,c,lh,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:l}=e;l!==U.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=U.QUOTE_DOUBLE);const c=m=>{switch(m){case U.BLOCK_FOLDED:case U.BLOCK_LITERAL:return r||a?Jn(o.value,t):Si(o,t,n,s);case U.QUOTE_DOUBLE:return ir(o.value,t);case U.QUOTE_SINGLE:return hl(o.value,t);case U.PLAIN:return ux(o,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:m,defaultStringType:d}=t.options,f=r&&m||d;if(u=c(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function ch(e,t){const n=Object.assign({blockQuote:!0,commentString:lx,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 dx(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 l;return(l=o.identify)==null?void 0:l.call(o,s)});if(a.length>1){const o=a.filter(l=>l.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 fx(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],a=(ee(e)||de(e))&&e.anchor;a&&sh(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 c;if(me(e))return e.toString(t,n,s);if(ks(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.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=dx(t.doc.schema.tags,a));const o=fx(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=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)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
100
- ${t.indent}${l}`:l}function mx({key:e,value:t},n,s,r){const{allNullValues:a,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:m,simpleKeys:d}}=n;let f=fe(e)&&e.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(de(e)||!fe(e)&&typeof e=="object"){const S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let v=!d&&(!e||f&&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:!v&&(d||!a),indent:l+c});let y=!1,x=!1,w=ps(e,n,()=>y=!0,()=>x=!0);if(!v&&!n.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return y&&s&&s(),w===""?"?":v?`? ${w}`:w}else if(a&&!d||t==null&&v)return w=`? ${w}`,f&&!y?w+=xn(w,n.indent,u(f)):x&&r&&r(),w;y&&(f=null),v?(f&&(w+=xn(w,n.indent,u(f))),w=`? ${w}
101
- ${l}:`):(w=`${w}:`,f&&(w+=xn(w,n.indent,u(f))));let g,p,h;fe(t)?(g=!!t.spaceBefore,p=t.commentBefore,h=t.comment):(g=!1,p=null,h=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!f&&ee(t)&&(n.indentAtStart=w.length+1),x=!1,!m&&c.length>=2&&!n.inFlow&&!v&&Mr(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let j=!1;const k=ps(t,n,()=>j=!0,()=>x=!0);let C=" ";if(f||g||p){if(C=g?`
102
- `:"",p){const S=u(p);C+=`
103
- ${At(S,n.indent)}`}k===""&&!n.inFlow?C===`
104
- `&&h&&(C=`
105
-
106
- `):C+=`
107
- ${n.indent}`}else if(!v&&de(t)){const S=k[0],N=k.indexOf(`
108
- `),T=N!==-1,L=n.inFlow??t.flow??t.items.length===0;if(T||!L){let F=!1;if(T&&(S==="&"||S==="!")){let H=k.indexOf(" ");S==="&"&&H!==-1&&H<N&&k[H+1]==="!"&&(H=k.indexOf(" ",H+1)),(H===-1||N<H)&&(F=!0)}F||(C=`
109
- ${n.indent}`)}}else(k===""||k[0]===`
110
- `)&&(C="");return w+=C+k,n.inFlow?j&&s&&s():h&&!j?w+=xn(w,n.indent,u(h)):x&&r&&r(),w}function uh(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ni="<<",Pt={identify:e=>e===ni||typeof e=="symbol"&&e.description===ni,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new U(Symbol(ni)),{addToJSMap:dh}),stringify:()=>ni},hx=(e,t)=>(Pt.identify(t)||ee(t)&&(!t.type||t.type===U.PLAIN)&&Pt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Pt.tag&&n.default));function dh(e,t,n){const s=fh(e,n);if(Mr(s))for(const r of s.items)ro(e,t,r);else if(Array.isArray(s))for(const r of s)ro(e,t,r);else ro(e,t,s)}function ro(e,t,n){const s=fh(e,n);if(!_r(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 fh(e,t){return e&&ks(t)?t.resolve(e.doc,e):t}function mh(e,t,{key:n,value:s}){if(fe(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(hx(e,n))dh(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=px(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 px(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(fe(e)&&(n!=null&&n.doc)){const s=ch(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)+'..."'),uh(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 wc(e,t,n){const s=Cr(e,void 0,n),r=Cr(t,void 0,n);return new Ie(s,r)}class Ie{constructor(t,n=null){Object.defineProperty(this,st,{value:th}),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 Ie(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return mh(n,s,this)}toString(t,n,s){return t!=null&&t.doc?mx(this,t,n,s):JSON.stringify(this)}}function hh(e,t,n){return(t.inFlow??e.flow?yx:gx)(e,t,n)}function gx({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:a,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,m=Object.assign({},n,{indent:a,type:null});let d=!1;const f=[];for(let y=0;y<t.length;++y){const x=t[y];let w=null;if(fe(x))!d&&x.spaceBefore&&f.push(""),ea(n,f,x.commentBefore,d),x.comment&&(w=x.comment);else if(me(x)){const p=fe(x.key)?x.key:null;p&&(!d&&p.spaceBefore&&f.push(""),ea(n,f,p.commentBefore,d))}d=!1;let g=ps(x,m,()=>w=null,()=>d=!0);w&&(g+=xn(g,a,u(w))),d&&w&&(d=!1),f.push(s+g)}let v;if(f.length===0)v=r.start+r.end;else{v=f[0];for(let y=1;y<f.length;++y){const x=f[y];v+=x?`
111
- ${c}${x}`:`
112
- `}}return e?(v+=`
113
- `+At(u(e),c),l&&l()):d&&o&&o(),v}function yx({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:l}}=t;s+=a;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,m=0;const d=[];for(let y=0;y<e.length;++y){const x=e[y];let w=null;if(fe(x))x.spaceBefore&&d.push(""),ea(t,d,x.commentBefore,!1),x.comment&&(w=x.comment);else if(me(x)){const p=fe(x.key)?x.key:null;p&&(p.spaceBefore&&d.push(""),ea(t,d,p.commentBefore,!1),p.comment&&(u=!0));const h=fe(x.value)?x.value:null;h?(h.comment&&(w=h.comment),h.commentBefore&&(u=!0)):x.value==null&&(p!=null&&p.comment)&&(w=p.comment)}w&&(u=!0);let g=ps(x,c,()=>w=null);u||(u=d.length>m||g.includes(`
114
- `)),y<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((p,h)=>p+h.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=xn(g,s,l(w))),d.push(g),m=d.length}const{start:f,end:v}=n;if(d.length===0)return f+v;if(!u){const y=d.reduce((x,w)=>x+w.length+2,2);u=t.options.lineWidth>0&&y>t.options.lineWidth}if(u){let y=f;for(const x of d)y+=x?`
115
- ${a}${r}${x}`:`
116
- `;return`${y}
117
- ${r}${v}`}else return`${f}${o}${d.join(" ")}${o}${v}`}function ea({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const a=At(t(s),e);n.push(a.trimStart())}}function vn(e,t){const n=ee(t)?t.value:t;for(const s of e)if(me(s)&&(s.key===t||s.key===n||ee(s.key)&&s.key.value===n))return s}class Je extends oh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(sn,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:a}=s,o=new this(t),l=(c,u)=>{if(typeof a=="function")u=a.call(n,c,u);else if(Array.isArray(a)&&!a.includes(c))return;(u!==void 0||r)&&o.items.push(wc(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;me(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ie(t,t==null?void 0:t.value):s=new Ie(t.key,t.value);const r=vn(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)&&ah(s.value)?r.value.value=s.value:r.value=s.value}else if(a){const l=this.items.findIndex(c=>a(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=vn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=vn(this.items,t),r=s==null?void 0:s.value;return(!n&&ee(r)?r.value:r)??void 0}has(t){return!!vn(this.items,t)}set(t,n){this.add(new Ie(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)mh(n,r,a);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!me(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})),hh(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const Ss={collection:"map",default:!0,nodeClass:Je,tag:"tag:yaml.org,2002:map",resolve(e,t){return _r(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Je.from(e,t,n)};class En extends oh{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=si(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=si(t);if(typeof s!="number")return;const r=this.items[s];return!n&&ee(r)?r.value:r}has(t){const n=si(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=si(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];ee(r)&&ah(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?hh(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 l of n){if(typeof r=="function"){const c=n instanceof Set?l:String(o++);l=r.call(n,c,l)}a.items.push(Cr(l,void 0,s))}}return a}}function si(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 Cs={collection:"seq",default:!0,nodeClass:En,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Mr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>En.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},kc={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&&kc.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 pt({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 l=t-(a.length-o-1);for(;l-- >0;)a+="0"}return a}const ph={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:pt},gh={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():pt(e)}},yh={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:pt},Ta=e=>typeof e=="bigint"||Number.isInteger(e),Nc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function xh(e,t,n){const{value:s}=e;return Ta(s)&&s>=0?n+s.toString(t):pt(e)}const vh={identify:e=>Ta(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Nc(e,2,8,n),stringify:e=>xh(e,8,"0o")},bh={identify:Ta,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Nc(e,0,10,n),stringify:pt},jh={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)=>Nc(e,2,16,n),stringify:e=>xh(e,16,"0x")},xx=[Ss,Cs,Ca,Ea,kc,vh,bh,jh,ph,gh,yh];function ed(e){return typeof e=="bigint"||Number.isInteger(e)}const ri=({value:e})=>JSON.stringify(e),vx=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ri},{identify:e=>e==null,createNode:()=>new U(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ri},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ri},{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:ri}],bx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},jx=[Ss,Cs].concat(vx,bx),Sc={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 l;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);l=btoa(c)}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 c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),m=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)m[d]=l.substr(f,c);l=m.join(t===U.BLOCK_LITERAL?`
118
- `:" ")}return jc({comment:e,type:t,value:l},s,r,a)}};function wh(e,t){if(Mr(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!me(s)){if(_r(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Ie(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]=me(s)?s:new Ie(s)}}else t("Expected a sequence for this tag");return e}function kh(e,t,n){const{replacer:s}=n,r=new En(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 l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=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)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(wc(l,c,n))}return r}const Cc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wh,createNode:kh};class is extends En{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=is.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(me(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=kh(t,n,s),a=new this;return a.items=r.items,a}}is.tag="tag:yaml.org,2002:omap";const Ec={collection:"seq",identify:e=>e instanceof Map,nodeClass:is,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=wh(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 is,n)},createNode:(e,t,n)=>is.from(e,t,n)};function Nh({value:e,source:t},n){return t&&(e?Sh:Ch).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Sh={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:Nh},Ch={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:Nh},wx={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:pt},kx={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():pt(e)}},Nx={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:pt},Dr=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 Tc(e,t,n){const{value:s}=e;if(Dr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return pt(e)}const Sx={identify:Dr,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=>Tc(e,2,"0b")},Cx={identify:Dr,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=>Tc(e,8,"0")},Ex={identify:Dr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Aa(e,0,10,n),stringify:pt},Tx={identify:Dr,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=>Tc(e,16,"0x")};class as extends Je{constructor(t){super(t),this.tag=as.tag}add(t){let n;me(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ie(t.key,null):n=new Ie(t,null),vn(this.items,n.key)||this.items.push(n)}get(t,n){const s=vn(this.items,t);return!n&&me(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=vn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ie(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(wc(o,null,s));return a}}as.tag="tag:yaml.org,2002:set";const Ac={collection:"map",identify:e=>e instanceof Set,nodeClass:as,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>as.from(e,t,n),resolve(e,t){if(_r(e)){if(e.hasAllNullValues(!0))return Object.assign(new as,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Lc(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,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*a:a}function Eh(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return pt(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 Th={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})=>Lc(e,n),stringify:Eh},Ah={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=>Lc(e,!1),stringify:Eh},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,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,a||0,o||0,l||0,c);const m=t[8];if(m&&m!=="Z"){let d=Lc(m,!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=[Ss,Cs,Ca,Ea,Sh,Ch,Sx,Cx,Ex,Tx,wx,kx,Nx,Sc,Pt,Ec,Cc,Ac,Th,Ah,La],nd=new Map([["core",xx],["failsafe",[Ss,Cs,Ca]],["json",jx],["yaml11",td],["yaml-1.1",td]]),sd={binary:Sc,bool:kc,float:yh,floatExp:gh,floatNaN:ph,floatTime:Ah,int:bh,intHex:jh,intOct:vh,intTime:Th,map:Ss,merge:Pt,null:Ea,omap:Ec,pairs:Cc,seq:Cs,set:Ac,timestamp:La},Ax={"tag:yaml.org,2002:binary":Sc,"tag:yaml.org,2002:merge":Pt,"tag:yaml.org,2002:omap":Ec,"tag:yaml.org,2002:pairs":Cc,"tag:yaml.org,2002:set":Ac,"tag:yaml.org,2002:timestamp":La};function io(e,t,n){const s=nd.get(t);if(s&&!e)return n&&!s.includes(Pt)?s.concat(Pt):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(Pt)),r.reduce((a,o)=>{const l=typeof o=="string"?sd[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(sd).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return a.includes(l)||a.push(l),a},[])}const Lx=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Pc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?io(t,"compat"):t?io(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?Ax:{},this.tags=io(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,sn,{value:Ss}),Object.defineProperty(this,kt,{value:Ca}),Object.defineProperty(this,ws,{value:Cs}),this.sortMapEntries=typeof o=="function"?o:o===!0?Lx:null}clone(){const t=Object.create(Pc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Px(e,t){var c;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=ch(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=a(e.commentBefore);n.unshift(At(u,""))}let o=!1,l=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(At(d,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let m=ps(e.contents,r,()=>l=null,u);l&&(m+=xn(m,"",a(l))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(ps(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=a(e.comment);u.includes(`
121
- `)?(n.push("..."),n.push(At(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(At(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:fl});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:fl}});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=rh(this);t.anchor=!n||s.has(n)?ih(n||"a",s):n}return new bc(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=p=>typeof p=="number"||p instanceof String||p instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:m}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:v}=ix(this,o||"a"),y={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:v},x=Cr(t,m,y);return l&&de(x)&&(x.flow=!0),f(),x}createPair(t,n,s={}){const r=this.createNode(t,null,s),a=this.createNode(n,null,s);return new Ie(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=Zi(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=Zi(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 Pc(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=et(this.contents,n??"",l);if(typeof a=="function")for(const{count:u,res:m}of l.anchors.values())a(m,u);return typeof o=="function"?Qn(o,{"":c},"",c):c}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 Px(this,t)}}function On(e){if(de(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Lh extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ks extends Lh{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class Ix extends Lh{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(l=>t.linePos(l));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 l=Math.min(a-39,o.length-79);o="…"+o.substring(l),a-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,a))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
124
- `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-a)));const u=" ".repeat(a)+"^".repeat(l);n.message+=`:
125
-
126
- ${o}
127
- ${u}
128
- `}};function gs(e,{flow:t,indicator:n,next:s,offset:r,onError:a,parentIndent:o,startOnNewline:l}){let c=!1,u=l,m=l,d="",f="",v=!1,y=!1,x=null,w=null,g=null,p=null,h=null,j=null,k=null;for(const N of e)switch(y&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),x&&(u&&N.type!=="comment"&&N.type!=="newline"&&a(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),N.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&N.source.includes(" ")&&(x=N),m=!0;break;case"comment":{m||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=N.source.substring(1)||" ";d?d+=f+T:d=T,f="",u=!1;break}case"newline":u?d?d+=N.source:(!j||n!=="seq-item-ind")&&(c=!0):f+=N.source,u=!0,v=!0,(w||g)&&(p=N),m=!0;break;case"anchor":w&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=N,k??(k=N.offset),u=!1,m=!1,y=!0;break;case"tag":{g&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),g=N,k??(k=N.offset),u=!1,m=!1,y=!0;break}case n:(w||g)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),j&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),j=N,u=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){h&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=N,u=!1,m=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,m=!1}const C=e[e.length-1],S=C?C.offset+C.source.length:r;return y&&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"),x&&(u&&x.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:j,spaceBefore:c,comment:d,hasNewline:v,anchor:w,tag:g,newlineAfterProp:p,end:S,start:k??S}}function Er(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(Er(t.key)||Er(t.value))return!0}return!1;default:return!0}}function gl(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&Er(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Ph(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 Ox({composeNode:e,composeEmptyNode:t},n,s,r,a){var m;const o=(a==null?void 0:a.nodeClass)??Je,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:f,key:v,sep:y,value:x}=d,w=gs(f,{indicator:"explicit-key-ind",next:v??(y==null?void 0:y[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!w.found;if(g){if(v&&(v.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==s.indent&&r(c,"BAD_INDENT",id)),!w.anchor&&!w.tag&&!y){u=w.end,w.comment&&(l.comment?l.comment+=`
130
- `+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||Er(v))&&r(v??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=w.found)==null?void 0:m.indent)!==s.indent&&r(c,"BAD_INDENT",id);n.atKey=!0;const p=w.end,h=v?e(n,v,w,r):t(n,p,f,null,w,r);n.schema.compat&&gl(s.indent,v,r),n.atKey=!1,Ph(n,l.items,h)&&r(p,"DUPLICATE_KEY","Map keys must be unique");const j=gs(y??[],{indicator:"map-value-ind",next:x,offset:h.range[2],onError:r,parentIndent:s.indent,startOnNewline:!v||v.type==="block-scalar"});if(c=j.end,j.found){g&&((x==null?void 0:x.type)==="block-map"&&!j.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<j.found.offset-1024&&r(h.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=x?e(n,x,j,r):t(n,c,y,null,j,r);n.schema.compat&&gl(s.indent,x,r),c=k.range[2];const C=new Ie(h,k);n.options.keepSourceTokens&&(C.srcToken=d),l.items.push(C)}else{g&&r(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&(h.comment?h.comment+=`
131
- `+j.comment:h.comment=j.comment);const k=new Ie(h);n.options.keepSourceTokens&&(k.srcToken=d),l.items.push(k)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}function _x({composeNode:e,composeEmptyNode:t},n,s,r,a){const o=(a==null?void 0:a.nodeClass)??En,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:m,value:d}of s.items){const f=gs(m,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)(d==null?void 0:d.type)==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=f.end,f.comment&&(l.comment=f.comment);continue}const v=d?e(n,d,f,r):t(n,f.end,m,null,f,r);n.schema.compat&&gl(s.indent,d,r),c=v.range[2],l.items.push(v)}return l.range=[s.offset,c,u??c],l}function Rr(e,t,n,s){let r="";if(e){let a=!1,o="";for(const l of e){const{source:c,type:u}=l;switch(u){case"space":a=!0;break;case"comment":{n&&!a&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=c.substring(1)||" ";r?r+=o+m:r=m,o="";break}case"newline":r&&(o+=c),a=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const ao="Block collections are not allowed within flow collections",oo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Mx({composeNode:e,composeEmptyNode:t},n,s,r,a){var w;const o=s.start.source==="{",l=o?"flow map":"flow sequence",c=(a==null?void 0:a.nodeClass)??(o?Je:En),u=new c(n.schema);u.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const p=s.items[g],{start:h,key:j,sep:k,value:C}=p,S=gs(h,{flow:l,indicator:"explicit-key-ind",next:j??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!k&&!C){g===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):g<s.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),S.comment&&(u.comment?u.comment+=`
132
- `+S.comment:u.comment=S.comment),d=S.end;continue}!o&&n.options.strict&&Er(j)&&r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${l} items`),S.comment){let N="";e:for(const T of h)switch(T.type){case"comma":case"space":break;case"comment":N=T.source.substring(1);break e;default:break e}if(N){let T=u.items[u.items.length-1];me(T)&&(T=T.value??T.key),T.comment?T.comment+=`
133
- `+N:T.comment=N,S.comment=S.comment.substring(N.length+1)}}if(!o&&!k&&!S.found){const N=C?e(n,C,S,r):t(n,S.end,k,null,S,r);u.items.push(N),d=N.range[2],oo(C)&&r(N.range,"BLOCK_IN_FLOW",ao)}else{n.atKey=!0;const N=S.end,T=j?e(n,j,S,r):t(n,N,h,null,S,r);oo(j)&&r(T.range,"BLOCK_IN_FLOW",ao),n.atKey=!1;const L=gs(k??[],{flow:l,indicator:"map-value-ind",next:C,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(L.found){if(!o&&!S.found&&n.options.strict){if(k)for(const G of k){if(G===L.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}}S.start<L.found.offset-1024&&r(L.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 ${l}`):r(L.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const F=C?e(n,C,L,r):L.found?t(n,L.end,k,null,L,r):null;F?oo(C)&&r(F.range,"BLOCK_IN_FLOW",ao):L.comment&&(T.comment?T.comment+=`
134
- `+L.comment:T.comment=L.comment);const H=new Ie(T,F);if(n.options.keepSourceTokens&&(H.srcToken=p),o){const G=u;Ph(n,G.items,T)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(H)}else{const G=new Je(n.schema);G.flow=!0,G.items.push(H);const E=(F??T).range;G.range=[T.range[0],E[1],E[2]],u.items.push(G)}d=F?F.range[2]:L.end}}const f=o?"}":"]",[v,...y]=s.end;let x=d;if((v==null?void 0:v.source)===f)x=v.offset+v.source.length;else{const g=l[0].toUpperCase()+l.substring(1),p=m?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(d,m?"MISSING_CHAR":"BAD_INDENT",p),v&&v.source.length!==1&&y.unshift(v)}if(y.length>0){const g=Rr(y,x,n.options.strict,r);g.comment&&(u.comment?u.comment+=`
135
- `+g.comment:u.comment=g.comment),u.range=[s.offset,x,g.offset]}else u.range=[s.offset,x,x];return u}function lo(e,t,n,s,r,a){const o=n.type==="block-map"?Ox(e,t,n,s,a):n.type==="block-seq"?_x(e,t,n,s,a):Mx(e,t,n,s,a),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function Dx(e,t,n,s,r){var f;const a=s.tag,o=a?t.directives.tagName(a.source,v=>r(a,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:y}=s,x=v&&a?v.offset>a.offset?v:a:v??a;x&&(!y||y.offset<x.offset)&&r(x,"MISSING_CHAR","Missing newline after block sequence props")}const l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Je.tagName&&l==="map"||o===En.tagName&&l==="seq")return lo(e,t,n,r,o);let c=t.schema.tags.find(v=>v.tag===o&&v.collection===l);if(!c){const v=t.schema.knownTags[o];if((v==null?void 0:v.collection)===l)t.schema.tags.push(Object.assign({},v,{default:!1})),c=v;else return v?r(a,"BAD_COLLECTION_TYPE",`${v.tag} used for ${l} collection, but expects ${v.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),lo(e,t,n,r,o)}const u=lo(e,t,n,r,o,c),m=((f=c.resolve)==null?void 0:f.call(c,u,v=>r(a,"TAG_RESOLVE_FAILED",v),t.options))??u,d=fe(m)?m:new U(m);return d.range=u.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function $x(e,t,n){const s=t.offset,r=Rx(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?zx(t.source):[];let l=o.length;for(let x=o.length-1;x>=0;--x){const w=o[x][1];if(w===""||w==="\r")l=x;else break}if(l===0){const x=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:x,type:a,comment:r.comment,range:[s,w,w]}}let c=t.indent+r.indent,u=t.offset+r.length,m=0;for(let x=0;x<l;++x){const[w,g]=o[x];if(g===""||g==="\r")r.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&n(u+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=w.length),m=x,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=w.length+g.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>c&&(l=x+1);let d="",f="",v=!1;for(let x=0;x<m;++x)d+=o[x][0].slice(c)+`
137
- `;for(let x=m;x<l;++x){let[w,g]=o[x];u+=w.length+g.length+1;const p=g[g.length-1]==="\r";if(p&&(g=g.slice(0,-1)),g&&w.length<c){const j=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-g.length-(p?2:1),"BAD_INDENT",j),w=""}a===U.BLOCK_LITERAL?(d+=f+w.slice(c)+g,f=`
138
- `):w.length>c||g[0]===" "?(f===" "?f=`
139
- `:!v&&f===`
140
- `&&(f=`
141
-
142
- `),d+=f+w.slice(c)+g,f=`
143
- `,v=!0):g===""?f===`
144
- `?d+=`
145
- `:f=`
146
- `:(d+=f+g,f=" ",v=!1)}switch(r.chomp){case"-":break;case"+":for(let x=l;x<o.length;++x)d+=`
147
- `+o[x][0].slice(c);d[d.length-1]!==`
148
- `&&(d+=`
149
- `);break;default:d+=`
150
- `}const y=s+r.length+t.source.length;return{value:d,type:a,comment:r.comment,range:[s,y,y]}}function Rx({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,l="",c=-1;for(let f=1;f<r.length;++f){const v=r[f];if(!l&&(v==="-"||v==="+"))l=v;else{const y=Number(v);!o&&y?o=y:c===-1&&(c=e+f)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,m="",d=r.length;for(let f=1;f<t.length;++f){const v=t[f];switch(v.type){case"space":u=!0;case"newline":d+=v.source.length;break;case"comment":n&&!u&&s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=v.source.length,m=v.source.substring(1);break;case"error":s(v,"UNEXPECTED_TOKEN",v.message),d+=v.source.length;break;default:{const y=`Unexpected token in block scalar header: ${v.type}`;s(v,"UNEXPECTED_TOKEN",y);const x=v.source;x&&typeof x=="string"&&(d+=x.length)}}}return{mode:a,indent:o,chomp:l,comment:m,length:d}}function zx(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 Fx(e,t,n){const{offset:s,type:r,source:a,end:o}=e;let l,c;const u=(f,v,y)=>n(s+f,v,y);switch(r){case"scalar":l=U.PLAIN,c=Bx(a,u);break;case"single-quoted-scalar":l=U.QUOTE_SINGLE,c=Ux(a,u);break;case"double-quoted-scalar":l=U.QUOTE_DOUBLE,c=Wx(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 m=s+a.length,d=Rr(o,m,t,n);return{value:c,type:l,comment:d.comment,range:[s,m,d.offset]}}function Bx(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}`),Ih(e)}function Ux(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Ih(e.slice(1,-1)).replace(/''/g,"'")}function Ih(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 l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),r+a+((s==null?void 0:s[1])??"")}function Wx(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}=Hx(e,s);n+=a,s=o}else if(r==="\\"){let a=e[++s];const o=Vx[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 l=a==="x"?2:a==="u"?4:8;n+=Kx(e,s+1,l,t),s+=l}else{const l=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}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 Hx(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 Vx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Kx(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 l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function Oh(e,t,n,s){const{value:r,type:a,comment:o,range:l}=t.type==="block-scalar"?$x(e,t,s):Fx(t,e.options.strict,s),c=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]:c?u=Gx(e.schema,r,c,n,s):t.type==="scalar"?u=qx(e,r,t,s):u=e.schema[kt];let m;try{const d=u.resolve(r,f=>s(n??t,"TAG_RESOLVE_FAILED",f),e.options);m=ee(d)?d:new U(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",f),m=new U(r)}return m.range=l,m.source=r,a&&(m.type=a),c&&(m.tag=c),u.format&&(m.format=u.format),o&&(m.comment=o),m}function Gx(e,t,n,s,r){var l;if(n==="!")return e[kt];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if((l=c.test)!=null&&l.test(t))return c;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(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[kt];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[kt];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),m=`Value may be parsed as either ${c} or ${u}`;a(r,"TAG_RESOLVE_FAILED",m,!0)}}return o}function Yx(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 Qx={composeNode:_h,composeEmptyNode:Ic};function _h(e,t,n,s){const r=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:c}=n;let u,m=!0;switch(t.type){case"alias":u=Jx(e,t,s),(l||c)&&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=Oh(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Dx(Qx,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(d){const f=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",f)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),m=!1}}return u??(u=Ic(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"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(c??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&&m&&(u.srcToken=t),u}function Ic(e,t,n,s,{spaceBefore:r,comment:a,anchor:o,tag:l,end:c},u){const m={type:"scalar",offset:Yx(t,n,s),indent:-1,source:""},d=Oh(e,m,l,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]=c),d}function Jx({options:e},{offset:t,source:n,end:s},r){const a=new bc(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,l=Rr(s,o,e.strict,r);return a.range=[t,o,l.offset],l.comment&&(a.comment=l.comment),a}function Xx(e,t,{offset:n,start:s,value:r,end:a},o){const l=Object.assign({_directives:t},e),c=new $r(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},m=gs(s,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?_h(u,r,m,o):Ic(u,m.end,s,null,m,o);const d=c.contents.range[2],f=Rr(a,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}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 Zx{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 Ix(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];me(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
170
- ${l}`: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=Xx(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=Rr(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 Mh="\uFEFF",Dh="",$h="",yl="";function ev(e){switch(e){case Mh:return"byte-order-mark";case Dh:return"doc-mode";case $h:return"flow-error-end";case yl: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"),tv=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ii=new Set(",[]{}"),nv=new Set(` ,[]{}
176
- \r `),co=e=>!e||nv.has(e);class sv{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]===Mh&&(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 Dh,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(co),"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 $h,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(co),"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 l=a;for(;o===" ";)o=this.buffer[--a];if(o===`
188
- `&&a>=this.pos&&a+1+n>l)t=a;else break}while(!0);return yield yl,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&&ii.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&&ii.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&&ii.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yl,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(co),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(at(s)||n&&ii.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(tv.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 rv{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 Ut(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 Rh(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 ai(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 _n(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 ta(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&&!Ut(t.start,"explicit-key-ind")&&!Ut(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Rh(t.value)?t.value.end?ta(t.value.end,t.sep):t.value.end=t.sep:ta(t.start,t.sep),delete t.sep)}class iv{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 sv,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=ev(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=ai(this.peek(2)),s=_n(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)){ta(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 l=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":l.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[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(Ut(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(Rh(n.key)&&!Ut(n.sep,"newline")){const l=_n(n.start),c=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:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ut(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=_n(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ut(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 l=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ut(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(l);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)){ta(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||Ut(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=ai(s),a=_n(r);cd(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={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]=l}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=ai(t),s=_n(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=ai(t),s=_n(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 av(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new rv||null,prettyErrors:t}}function ov(e,t={}){const{lineCounter:n,prettyErrors:s}=av(t),r=new iv(n==null?void 0:n.addNewLine),a=new Zx(t);let o=null;for(const l of a.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Ks(l.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 lv(e,t,n){let s;const r=ov(e,n);if(!r)return null;if(r.warnings.forEach(a=>uh(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 cv(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 uv=new Set(["daemon.host","daemon.port","app.port"]),dv=["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??[...dv],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 fv(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function mv(){const[e,t]=b.useState(null),[n,s]=b.useState(null),[r,a]=b.useState([]),[o,l]=b.useState(!0),[c,u]=b.useState(!1),[m,d]=b.useState(null),[f,v]=b.useState(!1),[y,x]=b.useState(""),[w,g]=b.useState(!1),[p,h]=b.useState("");b.useEffect(()=>{Promise.all([B.getConfig(),B.getConnectors()]).then(([E,D])=>{const I=ud(E.config);t(I),s(structuredClone(I)),a(D.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>l(!1))},[]);const j=b.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=b.useMemo(()=>{if(!e||!n)return 0;let E=0;for(const D of Object.keys(n)){const I=e[D],R=n[D];for(const A of Object.keys(R))JSON.stringify(I[A])!==JSON.stringify(R[A])&&E++}return E},[e,n]),C=b.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 E=!1;try{for(const D of Object.keys(n)){const I=e[D],R=n[D];for(const A of Object.keys(R)){const _=JSON.stringify(R[A]),$=JSON.stringify(I[A]??null);if(_!==$){const z=`${D}.${A}`,J=R[A];let xe;z==="security.approvalTimeoutMs"?xe=String(J):Array.isArray(J)?xe=JSON.stringify(J):xe=String(J),await B.setConfig(z,xe),uv.has(z)&&(E=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),E&&v(!0)}catch(D){d({type:"error",msg:D instanceof Error?D.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),S=b.useCallback(()=>{e&&s(structuredClone(e))},[e]),N=b.useCallback(()=>{!w&&n&&(x(cv(fv(n))),h("")),g(!w)},[w,n]),T=b.useCallback(()=>{try{const E=lv(y);if(!E||typeof E!="object")throw new Error("Invalid YAML");s(ud(E)),h("")}catch(E){h(E instanceof Error?E.message:"Invalid YAML")}},[y]),L=b.useCallback((E,D,I)=>{s(R=>R&&{...R,[E]:{...R[E],[D]:I}})},[]),F=b.useCallback((E,D,I)=>{s(R=>{if(!R)return R;const A=R[E],_=A[D]??[];return _.includes(I)?R:{...R,[E]:{...A,[D]:[..._,I]}}})},[]),H=b.useCallback((E,D,I)=>{s(R=>{if(!R)return R;const A=R[E],_=A[D]??[];return{...R,[E]:{...A,[D]:_.filter($=>$!==I)}}})},[]),G=b.useMemo(()=>({updateField:L,addToArray:F,removeFromArray:H}),[L,F,H]);return o?i.jsx(ht,{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"}),f&&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:()=>v(!1),children:"Dismiss"})]}),i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:i.jsx(hv,{config:n,actions:G})}),i.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:i.jsx(pv,{config:n,connectors:r,actions:G})}),i.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:i.jsx(gv,{config:n,actions:G})}),i.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:i.jsx(yv,{config:n,actions:G})}),i.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:i.jsx(xv,{config:n,actions:G})}),i.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:i.jsx(vv,{})})]}),i.jsxs("div",{className:"mt-8",children:[i.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:N,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:y,onChange:E=>x(E.target.value)}),p&&i.jsx("p",{className:"text-error text-sm mt-1",children:p}),i.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,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:[m&&i.jsx("span",{className:`text-sm ${m.type==="success"?"text-success":"text-error"}`,children:m.msg}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:S,children:"Discard"}),i.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function Es({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 hv({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Es,{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]=b.useState("");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>i.jsxs(W,{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 pv({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:a}=n,o=new Set(e.security.highRiskCapabilities),l=b.useMemo(()=>wa(t),[t]);return i.jsxs(Es,{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:l.map(([c,u])=>i.jsxs(b.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:[c,i.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(m=>{const d=m.key.split("/")[1],f=m.capabilities.some(x=>o.has(x)),v=e.security.approvedHighRisk.includes(m.key),y=e.security.autoApproveConnectors.includes(m.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:m.capabilities.map(x=>i.jsx(W,{variant:o.has(x)?"warning":"neutral",size:"xs",children:x},x))})}),i.jsx("td",{children:f?i.jsx(W,{variant:"warning",size:"xs",children:"High"}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:f?i.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:v,onChange:()=>v?a("security","approvedHighRisk",m.key):r("security","approvedHighRisk",m.key)}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:i.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:y,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>y?a("security","autoApproveConnectors",m.key):r("security","autoApproveConnectors",m.key)})})]},m.key)})]},c))})]})}),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:c=>r("security","highRiskCapabilities",c),onRemove:c=>a("security","highRiskCapabilities",c),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:c=>r("security","approvalRequired",c),onRemove:c=>a("security","approvalRequired",c),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:c=>s("security","approvalTimeoutMs",Number(c.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:c=>s("security","extensionId",c.target.value)})})]})}function gv({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,a]=b.useState("");return i.jsxs(Es,{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,l)=>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:"×"})]},l))}),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 yv({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Es,{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 xv({config:e,actions:t}){const{updateField:n}=t;return i.jsx(Es,{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 vv(){const[e,t]=b.useState(""),[n,s]=b.useState(""),[r,a]=b.useState(""),[o,l]=b.useState("40"),[c,u]=b.useState(!1),[m,d]=b.useState(!1);b.useEffect(()=>{B.getPreferences().then(v=>{if(!v.ok)return;const y=v.preferences;t(y["journal.author"]??""),s(y["journal.ado_org"]??""),a(y["journal.ado_repos"]??""),l(y["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){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 c?i.jsxs(Es,{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:v=>t(v.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:v=>s(v.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:v=>a(v.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:v=>l(v.target.value)})}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:f,children:"Save Journal Settings"}),m&&i.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const bv=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 jv(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(0),[o,l]=b.useState([]),[c,u]=b.useState([]),[m,d]=b.useState(null),f=b.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();l(k.connectors);const S=(await B.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(S.approvedHighRisk??[])}catch{}},[]);b.useEffect(()=>{f();const k=setInterval(f,1e4);return()=>clearInterval(k)},[f]);const v=b.useCallback(async k=>{d(k);try{const C=[...c,k];await B.setConfig("security.approvedHighRisk",JSON.stringify(C)),f()}catch{}finally{d(null)}},[c,f]),y=o.filter(k=>k.isHighRisk&&!k.isApproved),x=y.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."}];x&&w.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${y.length} need${y.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const g=w.filter(k=>k.ok).length,p=w.length,h=g===p,j=b.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:`${p>0?g/p*100:0}%`}})}),i.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[g,"/",p]})]}),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?bv:C+1}),i.jsx("span",{className:"font-semibold flex-1",children:k.label}),i.jsx(W,{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"&&y.length>0&&i.jsx("div",{className:"mt-3 space-y-2",children:y.map(S=>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:S.key}),S.description&&i.jsx("span",{className:"text-xs opacity-50 ml-2",children:S.description})]}),i.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:m===S.key,onClick:()=>v(S.key),children:m===S.key?"Authorizing…":"Authorize"})]},S.key))})]})]},C))}),h&&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(S=>{const N=S.key.split("/")[1];return i.jsx(we,{to:`/connectors/${k}/${N}`,className:"btn btn-sm btn-outline",children:i.jsx("span",{className:"font-mono",children:N})},S.key)})})]},k))})]}),!h&&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(S=>{const N=S.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:N}),i.jsx(W,{size:"xs",children:S.access})]}),S.description&&i.jsx("div",{className:"text-xs opacity-40 mb-1",children:S.description})]},S.key)})})]},k))}),i.jsx(we,{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 Tn({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 zh(e){const t=e.getDay();return t!==0&&t!==6}function wv(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++)zh(new Date(t,n-1,a))&&r++;return r}function kv(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 l=0;for(let c=1;c<=o.getDate();c++){const u=new Date(n,s-1,c);if(u>o)break;zh(u)&&l++}return l}function Nv(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,a=wv(s),o=kv(s,r),l=a-o,c=t>0?n/t*100:0,u=Math.max(0,(t-n)/8);if(n>=t)return{status:"reached",percentage:c,daysRemaining:0,hoursPerDayNeeded:0,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l};const m=a>0?t/a*o:0,d=l>0?Math.max(0,(t-n)/l):0;let f;return n>=m?f="on_track":a>0&&o/a<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l}}const Sv={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function Cv({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 ${Sv[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 Fh=(...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 Ev=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 Tv=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=Tv(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 uo={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 Av=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Lv=b.createContext({}),Pv=()=>b.useContext(Lv),Iv=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:a,iconNode:o,...l},c)=>{const{size:u=24,strokeWidth:m=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:v=""}=Pv()??{},y=s??d?Number(n??m)*24/Number(t??u):n??m;return b.createElement("svg",{ref:c,...uo,width:t??u??uo.width,height:t??u??uo.height,stroke:e??f,strokeWidth:y,className:Fh("lucide",v,r),...!a&&!Av(l)&&{"aria-hidden":"true"},...l},[...o.map(([x,w])=>b.createElement(x,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 K=(e,t)=>{const n=b.forwardRef(({className:s,...r},a)=>b.createElement(Iv,{ref:a,iconNode:t,className:Fh(`lucide-${Ev(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 Ov=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qe=K("arrow-right",Ov);/**
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 _v=[["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"}]],Bh=K("book-open",_v);/**
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 Mv=[["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"}]],Uh=K("circle-alert",Mv);/**
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 Dv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$v=K("circle-check-big",Dv);/**
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 Rv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Oc=K("circle-check",Rv);/**
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 zv=[["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"}]],Wh=K("circle-x",zv);/**
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 Fv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],_c=K("clock",Fv);/**
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 Bv=[["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"}]],Uv=K("code-xml",Bv);/**
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 Wv=[["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"}]],md=K("database",Wv);/**
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 Hv=[["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"}]],Hh=K("door-open",Hv);/**
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 Vv=[["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"}]],Vh=K("eye",Vv);/**
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 Kv=[["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"}]],fo=K("file-text",Kv);/**
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 Gv=[["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"}]],qv=K("fingerprint-pattern",Gv);/**
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 Yv=[["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"}]],oi=K("globe",Yv);/**
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 Qv=[["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"}]],Jv=K("key-round",Qv);/**
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 Xv=[["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"}]],Zv=K("layers",Xv);/**
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 e1=[["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"}]],t1=K("layout-dashboard",e1);/**
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 n1=[["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"}]],s1=K("library",n1);/**
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 r1=[["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"}]],i1=K("lightbulb",r1);/**
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 a1=[["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"}]],Kh=K("lock",a1);/**
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 o1=[["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"}]],l1=K("network",o1);/**
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 c1=[["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"}]],Gh=K("newspaper",c1);/**
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 u1=[["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"}]],d1=K("notebook-pen",u1);/**
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 f1=[["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"}]],m1=K("panels-top-left",f1);/**
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 h1=[["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"}]],p1=K("plug",h1);/**
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 g1=[["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"}]],qh=K("scroll-text",g1);/**
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 y1=[["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"}]],xl=K("server",y1);/**
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 x1=[["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"}]],v1=K("settings",x1);/**
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 b1=[["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"}]],j1=K("shield-alert",b1);/**
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 w1=[["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"}]],Yh=K("shield-check",w1);/**
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 k1=[["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"}]],N1=K("shield",k1);/**
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 S1=[["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"}]],C1=K("sparkles",S1);/**
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 E1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ci=K("terminal",E1);/**
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 T1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],A1=K("trending-up",T1);/**
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 L1=[["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"}]],P1=K("triangle-alert",L1),I1={reached:$v,on_track:A1,behind:_c,at_risk:P1},O1={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},_1={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function M1(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function D1({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,l)=>{const c=M1(o.projectId,o.activity,t),u=Nv({targetHours:o.targetHours,actualHours:c,month:r,today:a}),m=n.get(o.projectId),d=I1[u.status];return i.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${_1[u.status]} ${l>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:O1[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:m??o.projectId}),i.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[m?`${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(c*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(Cv,{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 $1({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:a,onRefreshProjects:o,refreshingProjects:l}){const[c,u]=b.useState(""),[m,d]=b.useState(""),[f,v]=b.useState(null),[y,x]=b.useState(""),[w,g]=b.useState(!1),p=b.useMemo(()=>{const T=new Set(e.map(L=>`${L.projectId}\0${L.activity}`));return s.filter(L=>!T.has(`${L.projectId}\0${L.activity}`))},[s,e]);function h(T){const L=T.indexOf("\0");return L<0?null:{projectId:T.slice(0,L),activity:T.slice(L+1)}}function j(T){return r.get(T)??T}function k(T,L){const F=a.get(`${T}\0${L}`);return F?`${j(T)} / ${F}`:`${j(T)} / ${L}`}async function C(){const T=h(c),L=parseFloat(m);if(!(!T||isNaN(L)||L<.5||L>31)){g(!0);try{await B.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:L}),u(""),d(""),n()}finally{g(!1)}}}async function S(T){g(!0);try{await B.deleteGoal(T),n()}finally{g(!1)}}async function N(T){const L=parseFloat(y);if(isNaN(L)||L<.5||L>31){v(null);return}g(!0);try{await B.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:L}),v(null),n()}finally{g(!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(T=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:j(T.projectId)}),r.has(T.projectId)&&i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:a.get(`${T.projectId}\0${T.activity}`)??T.activity}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),i.jsx("td",{className:"text-right",children:f===T.id?i.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:y,onChange:L=>x(L.target.value),onBlur:()=>N(T),onKeyDown:L=>{L.key==="Enter"&&N(T),L.key==="Escape"&&v(null)},autoFocus:!0}):T.targetDays}),i.jsx("td",{className:"text-right",children:T.targetHours}),i.jsxs("td",{className:"flex gap-1",children:[i.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{v(T.id),x(String(T.targetDays))},disabled:w,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),i.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>S(T.id),disabled:w,"aria-label":`Delete goal ${T.projectId} ${T.activity}`,children:"Del"})]})]},T.id))})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[i.jsx("option",{value:"",children:"Select project / activity…"}),p.map(T=>i.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:k(T.projectId,T.activity)},`${T.projectId}\0${T.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:m,onChange:T=>d(T.target.value)}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:w||!c,children:"Add"}),i.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:l,children:l?"Refreshing…":"Refresh projects"})]})]})]})}function R1(e,t){var G;const[n,s]=b.useState([]),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState([]),m=b.useRef(c);m.current=c;const[d,f]=b.useState(!1),v=b.useCallback(async()=>{try{const E=await B.getGoals(e);s(E.goals)}catch{}},[e]),y=b.useCallback(async()=>{try{const E=await B.getCachedReport(e);E.data?(a(E.data),l(E.fetchedAt)):(a([]),l(null))}catch{}},[e]),x=b.useCallback(async()=>{try{const E=await B.getCachedProjects();E.data&&u(E.data)}catch{}},[]),w=b.useCallback(async()=>{f(!0);try{const E=await B.run("timetracking/projects",{month:e});if(E.ok&&E.data&&E.data.length>0){const D=E.data.map(I=>({projectId:String(I.projectId??""),projectName:String(I.projectName??""),activityNumber:String(I.activityNumber??""),activityName:String(I.activityName??""),category:String(I.category??""),linePropertyId:String(I.linePropertyId??"")}));u(D),await B.cacheProjects(D)}}catch{}f(!1)},[e]);b.useEffect(()=>{v(),y(),x()},[v,y,x]);const g=t==null?void 0:t.data;b.useEffect(()=>{if(g&&g.length>0){l(null),B.cacheReport(e,g).catch(()=>{});const E=new Set,D=[];for(const I of g){const R=String(I.projectId??""),A=String(I.activity??"");if(!R||!A)continue;const _=`${R}\0${A}`;E.has(_)||(E.add(_),D.push({projectId:R,projectName:I.projectName?String(I.projectName):R,activityNumber:A,activityName:I.activityName?String(I.activityName):A,category:String(I.category??""),linePropertyId:""}))}if(D.length>0){const I=new Map;for(const A of m.current)I.set(`${A.projectId}\0${A.activityNumber}`,A);for(const A of D)I.set(`${A.projectId}\0${A.activityNumber}`,A);const R=Array.from(I.values());u(R),B.cacheProjects(R).catch(()=>{})}}},[g,e]);const p=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,h=p===r&&r.length>0&&!((G=t==null?void 0:t.data)!=null&&G.length),{projectNames:j,activityNames:k}=b.useMemo(()=>{const E=new Map,D=new Map;for(const I of c)I.projectId&&I.projectName&&E.set(I.projectId,I.projectName),I.projectId&&I.activityNumber&&I.activityName&&D.set(`${I.projectId}\0${I.activityNumber}`,I.activityName);for(const I of p){const R=String(I.projectId??""),A=I.projectName?String(I.projectName):null;R&&A&&E.set(R,A);const _=String(I.activity??""),$=I.activityName?String(I.activityName):null;R&&_&&$&&D.set(`${R}\0${_}`,$)}return{projectNames:E,activityNames:D}},[c,p]),{projectList:C,totalHours:S,draftCount:N,workingDayCount:T}=b.useMemo(()=>{const E=new Map;let D=0,I=0;const R=new Set;for(const A of p){const _=String(A.projectId??"Unknown"),$=Number(A.hours??0),z=String(A.date??""),J=String(A.status??""),xe=String(A.activity??"");D+=$,z&&R.add(z),J==="draft"&&I++,E.has(_)||E.set(_,{projectId:_,totalHours:0,entryCount:0,activities:new Set});const Me=E.get(_);if(Me.totalHours+=$,Me.entryCount++,xe){const un=k.get(`${_}\0${xe}`)??xe;Me.activities.add(un)}}return{projectList:Array.from(E.values()).sort((A,_)=>_.totalHours-A.totalHours),totalHours:D,draftCount:I,workingDayCount:R.size}},[p,k]),L=b.useMemo(()=>{const E=new Map;for(const D of p){const I=String(D.projectId??"Unknown"),R=String(D.activity??""),A=Number(D.hours??0),_=`${I}\0${R}`,$=E.get(_);$?$.totalHours+=A:E.set(_,{projectId:I,activity:R,totalHours:A})}return Array.from(E.values())},[p]),F=b.useMemo(()=>c.length>0?c.map(E=>({projectId:E.projectId,activity:E.activityNumber})):L.map(E=>({projectId:E.projectId,activity:E.activity})),[c,L]),H=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:v,rows:p,isCached:h,cachedAt:o,projectNames:j,activityNames:k,projectList:C,totalHours:S,draftCount:N,workingDayCount:T,activityHours:L,allCombos:F,todayStr:H,refreshProjects:w,refreshingProjects:d}}function z1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function F1(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 B1(){const[e,t]=b.useState(z1()),[n,s]=b.useState(!1),{running:r,result:a,error:o,approvalPending:l,approvalId:c,run:u,handleApproval:m,reset:d}=Sr(),{goals:f,loadGoals:v,rows:y,isCached:x,cachedAt:w,projectNames:g,activityNames:p,projectList:h,totalHours:j,draftCount:k,workingDayCount:C,activityHours:S,allCombos:N,todayStr:T,refreshProjects:L,refreshingProjects:F}=R1(e,a),H=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),G=b.useCallback(async()=>{const E={};e&&(E.month=e),await u("timetracking/report",E),await v()},[e,u,v]);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:E=>{t(E.target.value),d()},onClick:E=>{var D,I;return(I=(D=E.target).showPicker)==null?void 0:I.call(D)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:G,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!l&&i.jsx(ht,{label:"Fetching timetracking data..."}),l&&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:!c,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>m(!1),disabled:!c,children:"Reject"})]})]}),H&&i.jsx(Tn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!H&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),y.length>0&&i.jsxs(i.Fragment,{children:[x&&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 ",F1(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:h.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:h.map(E=>i.jsxs("tr",{children:[i.jsx("td",{children:g.has(E.projectId)?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm",children:g.get(E.projectId)}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}):i.jsx("span",{className:"font-mono text-sm",children:E.projectId})}),i.jsx("td",{className:"text-sm",children:Array.from(E.activities).join(", ")}),i.jsx("td",{className:"text-right font-semibold",children:E.totalHours.toFixed(1)}),i.jsx("td",{className:"text-right",children:E.entryCount})]},E.projectId))})]})}),i.jsxs("details",{open:n,onToggle:E=>s(E.target.open),children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",y.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:y.map((E,D)=>i.jsxs("tr",{children:[i.jsx("td",{children:String(E.date??"")}),i.jsx("td",{className:"font-mono text-xs",children:String(E.projectId??"")}),i.jsx("td",{children:String(E.activity??"")}),i.jsx("td",{className:"text-right",children:Number(E.hours??0).toFixed(1)}),i.jsx("td",{children:i.jsx(W,{variant:String(E.status)==="posted"?"success":"warning",size:"xs",children:String(E.status??"")})})]},D))})]})})]})]}),a&&(a.data??[]).length===0&&y.length===0&&!o&&i.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),f.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(D1,{goals:f,activityHours:S,projectNames:g,activityNames:p,month:e,today:T})]}),i.jsx("div",{className:"mt-6",children:i.jsx($1,{goals:f,month:e,onGoalChange:v,knownCombos:N,projectNames:g,activityNames:p,onRefreshProjects:L,refreshingProjects:F})})]})}const Qh={"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"},U1=Object.fromEntries(Object.entries(Qh).map(([e,t])=>[t.toLowerCase(),e.replace(/^MBTMY\s+/i,"").replace(/\b\w+/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())])),hd={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},W1={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"},H1={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 Mn(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function V1({rows:e}){var r,a;const[t,n]=b.useState(null),s=e.reduce((o,l)=>o+(l.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,l)=>{const c=s>0?(o.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===l,m=u?H1[o.state??""]??"bg-base-300":W1[o.state??""]??"bg-base-300";return i.jsxs("div",{className:`${m} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${c}%`},onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[c>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,": ",Mn(o.start??""),"–",Mn(o.end??"")," (",o.durationMin,"m)"]})]},l)})}),i.jsxs("div",{className:"flex justify-between mt-1",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Mn(((r=e[0])==null?void 0:r.start)??"")}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Mn(((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,l)=>i.jsxs("tr",{className:`transition-colors duration-75 ${t===l?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[i.jsx("td",{className:"font-mono text-sm",children:Mn(o.start??"")}),i.jsx("td",{className:"font-mono text-sm",children:Mn(o.end??"")}),i.jsx("td",{children:i.jsx(W,{variant:hd[o.state??""]??"neutral",children:o.state})}),i.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},l))})]})}),i.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(hd).map(([o,l])=>i.jsx("div",{className:"flex items-center gap-1.5",children:i.jsx(W,{variant:l,size:"xs",children:o})},o))})]})}const K1=[{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}],G1=[{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}],q1=[{x:90,y:28,dir:"down"},{x:355,y:28,dir:"down"},{x:765,y:28,dir:"down"},{x:24,y:596,dir:"left"}],Y1={free:"fill-success/15 stroke-success",busy:"fill-error/15 stroke-error",unknown:"fill-base-200/60 stroke-base-300"};function li(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^mbtmy/,"").replace(/^the/,"")}function Q1({statuses:e={},selected:t,onSelect:n}){const r=`hatch-${b.useId().replace(/[^a-zA-Z0-9]/g,"")}`,a=new Map(Object.entries(e).map(([c,u])=>[li(c),u])),o=t?li(t):null,l=c=>a.get(li(c.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"}),G1.map(c=>i.jsxs("g",{children:[i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,className:"fill-base-200/30 stroke-base-300",strokeWidth:"1",strokeDasharray:"4 4"}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",letterSpacing:"2",className:"fill-base-content/25 font-mono uppercase",children:c.name})]},c.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"}),q1.map((c,u)=>i.jsx("g",{children:c.dir==="left"?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:`M ${c.x} ${c.y-6} L ${c.x} ${c.y+6} L ${c.x-7} ${c.y} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:c.x+10,y:c.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 ${c.x-6} ${c.y} L ${c.x+6} ${c.y} L ${c.x} ${c.y+7} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:c.x,y:c.y-5,textAnchor:"middle",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]})},u)),K1.map(c=>{const u=l(c),m=o!==null&&li(c.name)===o,d=c.w<100;return i.jsxs("g",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(c.name):void 0,onKeyDown:n?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),n(c.name))}:void 0,className:n?"cursor-pointer hover:opacity-75 focus:outline-none transition-opacity":void 0,children:[i.jsx("title",{children:`${c.name} — ${u==="unknown"?"not checked":u}`}),i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,strokeWidth:u==="unknown"?1:1.5,className:Y1[u]}),m&&i.jsx("rect",{x:c.x+3,y:c.y+3,width:c.w-6,height:c.h-6,className:"fill-none stroke-primary",strokeWidth:"2"}),i.jsx("circle",{cx:c.x+15,cy:c.y+15,r:"9",className:"fill-base-100 stroke-base-content/30",strokeWidth:"1"}),i.jsx("text",{x:c.x+15,y:c.y+15,textAnchor:"middle",dominantBaseline:"central",fontSize:"8.5",className:"fill-base-content/60 font-mono",children:c.id}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.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:c.name.replace(/^The\s+/i,"")}),i.jsxs("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.h>90?10:8)+(d?14:16),textAnchor:"middle",fontSize:10.5,letterSpacing:"0.5",className:"fill-base-content/40 font-mono",children:[c.capacity,"p"]})]},c.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 J1(){return new Date().toISOString().slice(0,10)}const pd=[15,30,45,60,90,120,180,240,300,360,420,480,540],Rs=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 zs(e){const[t,n]=e.split(":").map(Number);return t*60+n}function na(e){const t=Math.floor(e/60)%24,n=e%60;return`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Xn(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 X1(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 Z1(e,t,n,s){const r=new Date(`${t}T${n}:00`),a=new Date(r.getTime()+s*6e4);return!e.some(l=>{if(l.state==="free")return!1;const c=vd(l.start,t),u=vd(l.end,t);return c===null||u===null?!1:c<a&&r<u})}const vt=24*60;function vl(e,t){return Math.max(0,Math.min(vt-t,e))}function bd(e){return Math.round(e/15)*15}function eb({startMinutes:e,durationMinutes:t,onChange:n}){const s=b.useRef(null),r=b.useRef(!1),a=v=>{const y=s.current;if(!y)return e;const x=y.getBoundingClientRect(),g=Math.max(0,Math.min(1,(v-x.left)/x.width))*vt;return bd(g)},o=v=>{const y=a(v)-t/2;n(vl(bd(y),t))},l=v=>{r.current=!0,v.currentTarget.setPointerCapture(v.pointerId),o(v.clientX)},c=v=>{r.current&&o(v.clientX)},u=()=>{r.current=!1},m=e/vt*100,d=t/vt*100,f=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:l,onPointerMove:c,onPointerUp:u,children:[i.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:8},(v,y)=>i.jsx("div",{className:"flex-1 border-r border-base-300/60 last:border-r-0"},y))}),i.jsx("div",{className:"absolute top-0 h-full bg-primary/20 border border-primary/50 rounded cursor-grab active:cursor-grabbing",style:{left:`${m}%`,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?`${m+d+.5}%`:`${m}%`,width:d<10?"auto":`${d}%`,justifyContent:d<10?"flex-start":"center"},children:i.jsxs("span",{className:d<10?"text-base-content/80":"",children:[Xn(na(e)),"–",Xn(na(f))]})})]}),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 tb(){var gt;const[e,t]=b.useState(J1()),[n,s]=b.useState(()=>zs(yd())),r=na(n),[a,o]=b.useState(120),[l,c]=b.useState("duration"),[u,m]=b.useState(()=>zs(yd())+120),[d,f]=b.useState(1),v=l==="endtime"?Math.max(Rs,u-n):a,y=b.useCallback(O=>{if(O!==l){if(O==="endtime")m(Math.min(vt,n+a));else{const q=Math.max(Rs,u-n),ce=pd.reduce((rt,Ts)=>Math.abs(Ts-q)<Math.abs(rt-q)?Ts:rt);o(ce)}c(O)}},[l,n,a,u]),x=b.useCallback(O=>{const q=Math.max(n+Rs,Math.min(vt,O));m(q)},[n]),w=b.useCallback(O=>{const q=vl(O,l==="endtime"?Rs:a);s(q),l==="endtime"&&m(ce=>Math.max(q+Rs,Math.min(vt,ce)))},[l,a]),[g,p]=b.useState(null),[h,j]=b.useState(null),[k,C]=b.useState(null),[S,N]=b.useState(!1),T=b.useRef(e),{running:L,result:F,error:H,approvalPending:G,approvalId:E,run:D,handleApproval:I}=Sr();b.useEffect(()=>{let O=!1;return B.getCachedRoomAvailability(e).then(q=>{O||(q.data&&q.data.length>0?(j(q.data),C(q.fetchedAt),N(!0)):(j(null),C(null),N(!1)))}).catch(()=>{}),()=>{O=!0}},[e]),b.useEffect(()=>{if(F!=null&&F.data&&F.data.length>0){const O=new Date().toISOString();C(O),N(!1),j(F.data),B.cacheRoomAvailability(T.current,F.data).catch(()=>{})}},[F]);const R=b.useCallback(async()=>{N(!1),T.current=e;const O=Object.entries(Qh).map(([q,ce])=>`${q}:${ce}`).join(",");await D("teams/rooms-availability",{rooms:O,date:e})},[D,e]),A=(H==null?void 0:H.includes("auth_required"))||(H==null?void 0:H.includes("sign in")),_=(F==null?void 0:F.data)??h??[],$=b.useMemo(()=>_.map(O=>({room:String(O.roomEmail??O.room??""),capacity:O.capacity===null||O.capacity===void 0||O.capacity===""?null:Number(O.capacity),start:String(O.start??""),end:String(O.end??""),state:String(O.state??""),durationMin:Number(O.durationMin??0)})),[_]),z=b.useMemo(()=>{const O=new Map;for(const ce of $){const rt=ce.room.toLowerCase();O.has(rt)||O.set(rt,[]),O.get(rt).push(ce)}const q=new Map;for(const[ce,rt]of O)q.set(U1[ce]??ce,rt);return q},[$]),J=b.useMemo(()=>{var q;const O={};for(const[ce,rt]of z){const Ts=((q=rt.find(ep=>ep.capacity!==null))==null?void 0:q.capacity)??null,Xh=Ts===null||Ts>=d,Zh=Z1(rt,e,r,v);O[ce]=Zh&&Xh?"free":"busy"}return O},[z,e,r,v,d]),xe=g?z.get(g)??[]:[],Me=((gt=xe.find(O=>O.capacity!==null))==null?void 0:gt.capacity)??null,un=b.useCallback(O=>{p(q=>q===O?null:O)},[]);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:O=>t(O.target.value),onClick:O=>{var q,ce;return(ce=(q=O.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:O=>w(zs(O.target.value)),children:gd.map(O=>i.jsx("option",{value:O,children:Xn(O)},O))})]}),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] ${l==="duration"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>y("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] ${l==="endtime"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>y("endtime"),children:"End time"})]}),l==="duration"?i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:a,onChange:O=>{const q=Number(O.target.value);o(q),s(ce=>vl(ce,q))},children:pd.map(O=>i.jsx("option",{value:O,children:X1(O)},O))}):i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:u===vt?"24:00":na(u),onChange:O=>{const q=O.target.value;x(q==="24:00"?vt:zs(q))},children:[gd.filter(O=>zs(O)>n).map(O=>i.jsx("option",{value:O,children:Xn(O)},O)),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:O=>O.target.select(),onChange:O=>f(Math.max(1,Number(O.target.value)||1))})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:R,disabled:L,children:L?"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(eb,{startMinutes:n,durationMinutes:v,onChange:O=>{s(O),l==="endtime"&&m(Math.min(vt,O+v))}})]}),L&&!G&&i.jsx(ht,{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:()=>I(!0),disabled:!E,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>I(!1),disabled:!E,children:"Reject"})]})]}),A&&i.jsx(Tn,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),H&&!A&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:H})}),k&&i.jsxs("div",{className:"flex items-center gap-2 mb-4 font-mono text-xs opacity-50",children:[S&&i.jsx("span",{className:"badge badge-sm badge-outline",children:"cached"}),i.jsxs("span",{children:["Last fetched ",new Date(k).toLocaleString()]})]}),!F&&!h&&!L&&!H&&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 · ",Xn(r),"–",Xn((()=>{const[O,q]=r.split(":").map(Number),ce=(O*60+q+v)%(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(Q1,{statuses:J,selected:g??void 0,onSelect:un})]}),g&&xe.length>0&&i.jsxs("div",{className:"mt-8",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[g,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(V1,{rows:xe})]}),g&&xe.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 ",g,' yet — run "Check floor plan" first.']})})]})}function nb({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,l=(s==null?void 0:s.blockers.length)??0,c=(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",l>0&&i.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",l," 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 · ${c} repo${c!==1?"s":""}`:""})]})]})}const sb=["Mon","Tue","Wed","Thu","Fri"];function rb(e){const t=new Date(e).getDay();return sb[t-1]??e}function ib({data:e}){const{timetracking:t,meetings:n,git:s,jira:r}=e,a=new Set;t==null||t.daily.forEach(f=>a.add(f.date)),n==null||n.daily.forEach(f=>a.add(f.date)),s==null||s.daily.forEach(f=>a.add(f.date));const o=[...a].sort().filter(f=>{const v=new Date(f+"T00:00:00").getDay();return v===0||v===6?(t==null?void 0:t.daily.some(x=>x.date===f&&x.hours>0))||(n==null?void 0:n.daily.some(x=>x.date===f&&x.count>0))||(s==null?void 0:s.daily.some(x=>x.date===f&&x.commits>0)):!0}),l=(t==null?void 0:t.totalHours)??0,c=(n==null?void 0:n.totalCount)??0,u=(n==null?void 0:n.totalHours)??0,m=(s==null?void 0:s.totalCommits)??0,d=(r==null?void 0:r.resolved.length)??0;return o.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:o.map(f=>{const v=t==null?void 0:t.daily.find(p=>p.date===f),y=n==null?void 0:n.daily.find(p=>p.date===f),x=s==null?void 0:s.daily.find(p=>p.date===f),w=t==null?void 0:t.gaps.includes(f),g=(r==null?void 0:r.resolved.filter(p=>p.resolvedDate===f))??[];return i.jsxs("tr",{className:w?"bg-warning/10":"",children:[i.jsx("td",{className:"font-medium",children:rb(f)}),i.jsx("td",{className:"text-xs text-base-content/60",children:f}),i.jsxs("td",{children:[i.jsx("span",{className:w?"text-warning font-semibold":"",children:v?`${v.hours}h`:"—"}),w&&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:x?`${x.commits}`:"0"}),i.jsx("td",{className:"text-xs",children:g.length>0?g.map(p=>p.key).join(", "):"—"})]},f)})}),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:l>0?`${l}h`:"—"}),i.jsx("td",{children:c>0?`${c} (${u}h)`:"—"}),i.jsx("td",{children:m}),i.jsx("td",{className:"text-xs",children:d>0?`${d} done`:"—"})]})})]})})}function ab({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 Jh(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 ob(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),Jh(e)}function jd(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),Jh(n)}function lb(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+6);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function cb(){const[e,t]=b.useState(ob()),[n,s]=b.useState(!1),[r,a]=b.useState(null),[o,l]=b.useState(null),[c,u]=b.useState(null);async function m(){s(!0),l(null),a(null),u(null);const d=Date.now();try{const f=await B.generateJournal({weekStart:e});u(Date.now()-d),a(f)}catch(f){l(f instanceof Error?f.message:"Unknown error")}finally{s(!1)}}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:"Dev Work Journal"}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(jd(e,-1)),disabled:n,children:"◄"}),i.jsx("span",{className:"font-medium text-lg",children:lb(e)}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(jd(e,1)),disabled:n,children:"►"}),i.jsx("button",{className:"btn btn-primary ml-4",onClick:m,disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):"Generate"}),c!==null&&!n&&i.jsxs("span",{className:"text-xs text-base-content/40 ml-2",children:["Generated in ",(c/1e3).toFixed(1),"s"]})]}),n&&i.jsxs("div",{className:"flex items-center gap-3 text-base-content/60 mb-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),i.jsx("span",{children:"Gathering data from Git, Outlook, Jira…"})]}),o&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),(r==null?void 0:r.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:r.errors.map((d,f)=>i.jsx("li",{children:d},f))})]})}),r&&r.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(nb,{data:r})]}),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(ib,{data:r})]}),i.jsx("section",{className:"space-y-4",children:i.jsx(ab,{insights:r.insights,errors:r.errors})})]}),(r==null?void 0:r.status)==="error"&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsxs("span",{children:["Failed to generate journal. ",r.errors.join("; ")]})})]})}function ub(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function db(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function fb(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function mb(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function hb(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++){const o=new Date(t,n-1,a).getDay();o!==0&&o!==6&&r++}return r}function pb(e,t){const n=db(),[s,r]=t.split("-").map(Number),a=new Date(n+"T00:00:00"),o=new Date(s,r,0).getDate(),l=[];for(let d=1;d<=o;d++){const f=new Date(s,r-1,d);if(f>a)break;const v=f.getDay();v!==0&&v!==6&&l.push(`${s}-${String(r).padStart(2,"0")}-${String(d).padStart(2,"0")}`)}const c=new Set(e.filter(d=>d.date&&d.status&&/released/i.test(String(d.status))).map(d=>d.date)),u=l.filter(d=>c.has(d)),m=l.filter(d=>!c.has(d));return{workingDaysTotal:hb(t),workingDaysElapsed:l.length,releasedDates:u,unreleasedDates:m}}function gb(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 yb(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 xb(){const[e]=b.useState(ub()),[t,n]=b.useState([]),s=Sr(),r=Sr();function a(){s.reset(),r.reset(),n([]),s.run("timetracking/report",{month:e}),r.run("saba/pending-training",{}),B.getGoals(e).then(y=>n(y.goals)).catch(()=>{})}const o=b.useMemo(()=>{var y;return((y=s.result)==null?void 0:y.data)??null},[s.result]),l=b.useMemo(()=>o?pb(o,e):null,[o,e]),c=b.useMemo(()=>{const y=new Map;if(o)for(const x of o){const w=typeof x.projectId=="string"?x.projectId:null,g=typeof x.hours=="number"?x.hours:0;w&&y.set(w,(y.get(w)??0)+g)}return y},[o]),u=b.useMemo(()=>{var y;return((y=r.result)==null?void 0:y.data)??[]},[r.result]),m=typeof r.error=="string"&&(r.error.toLowerCase().includes("auth_required")||r.error.toLowerCase().includes("sign in")),d=typeof s.error=="string"&&(s.error.toLowerCase().includes("auth_required")||s.error.toLowerCase().includes("sign in")),f=s.running||r.running,v=s.result!==null||r.result!==null;return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em]",children:"Daily Check-in"}),i.jsx("p",{className:"text-sm opacity-40 mt-0.5",children:fb(e)})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:a,disabled:f,children:f?"Loading…":v?"Refresh":"Load"})]}),f&&!s.approvalPending&&!r.approvalPending&&i.jsx("div",{className:"mb-4",children:i.jsx(ht,{label:"Fetching time tracking and Saba training…"})}),i.jsxs("section",{className:"space-y-4 mb-6",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Time Tracking"}),s.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"Time tracking requires approval."}),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"})]})]}),d&&i.jsx(Tn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),s.error&&!d&&i.jsx("div",{className:"alert alert-error text-sm",children:i.jsx("span",{children:s.error})}),l&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-4 border border-base-300",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:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysTotal}),i.jsx("div",{className:"text-xs opacity-40",children:"in month"})]}),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:"Elapsed"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysElapsed}),i.jsx("div",{className:"text-xs opacity-40",children:"so far"})]}),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:"Released"}),i.jsx("div",{className:"font-display text-xl font-bold text-success",children:l.releasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"days"})]}),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:"Unreleased"}),i.jsx("div",{className:`font-display text-xl font-bold ${l.unreleasedDates.length>0?"text-error":"text-success"}`,children:l.unreleasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"to action"})]})]}),l.unreleasedDates.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-2",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Unreleased dates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:l.unreleasedDates.map(y=>i.jsx("span",{className:"badge badge-error badge-outline badge-sm",children:mb(y)},y))})]}),l.unreleasedDates.length===0&&i.jsx("div",{className:"border border-base-300 p-4 text-center",children:i.jsx("p",{className:"text-sm text-success font-medium",children:"All days released ✓"})})]}),l&&t.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Goals Progress"}),i.jsx("div",{className:"space-y-3",children:t.map(y=>{const x=Math.round((c.get(y.projectId)??0)*100)/100,w=Math.round((y.targetHours-x)*100)/100,g=Math.min(100,Math.round(x/y.targetHours*100)),p=w<=0;return i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:y.projectId}),i.jsx("span",{className:`font-mono text-xs ${p?"text-success":"text-warning"}`,children:p?"✓ Goal met":`${w}h to go`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("progress",{className:`progress flex-1 ${p?"progress-success":"progress-warning"}`,value:g,max:100}),i.jsxs("span",{className:"font-mono text-xs opacity-50 w-24 text-right",children:[x,"h / ",y.targetHours,"h"]})]})]},y.id)})})]}),o===null&&!s.error&&!s.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to check your time tracking status."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Drives your browser — sign in to the portal first."})]})]}),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:"Pending Training (Saba)"}),r.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:()=>r.handleApproval(!0),disabled:!r.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>r.handleApproval(!1),disabled:!r.approvalId,children:"Reject"})]})]}),m&&i.jsx(Tn,{message:"Sign in to Saba Cloud (daimler.sabacloud.com) in Chrome, then try again."}),r.error&&!m&&i.jsx("div",{className:"alert alert-error text-sm font-mono whitespace-pre-wrap",children:i.jsx("span",{children:r.error})}),r.result&&u.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-3 border border-base-300",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:"Pending"}),i.jsx("div",{className:"font-display text-xl font-bold",children:u.length})]}),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:"Overdue"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(y=>y.isOverdue).length>0?"text-error":""}`,children:u.filter(y=>y.isOverdue).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:"Due ≤ 30d"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(y=>!y.isOverdue&&typeof y.daysUntilDue=="number"&&y.daysUntilDue<=30).length>0?"text-warning":""}`,children:u.filter(y=>!y.isOverdue&&typeof y.daysUntilDue=="number"&&y.daysUntilDue<=30).length})]})]}),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:u.map((y,x)=>i.jsxs("tr",{className:"hover",children:[i.jsx("td",{className:`font-medium text-sm ${y.isOverdue?"text-error":""}`,children:y.title??"—"}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:y.type??"—"}),i.jsx("td",{className:"text-xs opacity-70",children:y.status??"—"}),i.jsx("td",{className:"font-mono text-xs",children:y.dueDate||"—"}),i.jsx("td",{children:i.jsx("span",{className:gb(y),children:yb(y)})})]},x))})]})})]}),r.result&&u.length===0&&!r.error&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm text-success font-medium",children:"No pending training ✓"}),i.jsx("p",{className:"font-mono text-xs opacity-30 mt-0.5",children:"You're all caught up."})]}),!r.result&&!r.error&&!r.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to fetch your pending Saba training."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Requires an active Saba Cloud session in Chrome."})]})]})]})}const vb={socket:"info",wiz:"secondary",tldrsec:"warning"},bb={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function jb(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 wb(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 kb(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 Nb(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 Sb(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 wd={7:"Past 7 days",30:"Past 30 days"};function Cb(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 Eb(){const[e,t]=b.useState(7),[n,s]=b.useState("idle"),[r,a]=b.useState("idle"),[o,l]=b.useState("idle"),[c,u]=b.useState([]),[m,d]=b.useState([]),[f,v]=b.useState([]),[y,x]=b.useState(null),[w,g]=b.useState(null),[p,h]=b.useState(null),[j,k]=b.useState(null),[C,S]=b.useState(!1);b.useEffect(()=>{let E=!1;return B.getCachedSecurityNews().then(D=>{if(!E&&D.data&&D.data.length>0){if(s(_=>_==="loading"?(E=!0,_):"done"),E)return;const I=[],R=[],A=[];for(const _ of D.data){const $=_;$.source==="wiz"?R.push($):$.source==="tldrsec"?A.push($):I.push($)}u(I),d(R),v(A),k(D.fetchedAt),S(!0),a("done"),l("done")}}).catch(()=>{}),()=>{E=!0}},[]);const N=n==="loading"||r==="loading"||o==="loading",T=c.length>0||m.length>0||f.length>0,L=b.useMemo(()=>[...c,...m,...f].filter(D=>jb(D.date,e)).sort((D,I)=>new Date(I.date).getTime()-new Date(D.date).getTime()),[c,m,f,e]),F=b.useMemo(()=>{const E=L.filter(R=>R.source==="socket").length,D=L.filter(R=>R.source==="wiz").length,I=L.filter(R=>R.source==="tldrsec").length;return{total:L.length,socketCount:E,wizCount:D,tldrsecCount:I}},[L]),H=b.useCallback(async()=>{s("loading"),a("loading"),l("loading"),x(null),g(null),h(null),u([]),d([]),v([]),S(!1);let E=[],D=[],I=[];const R=B.run("socket/security-news",{}).then(z=>{!z.ok&&z.error?(x(z.error),s("error")):(E=kb(z),u(E),s("done"))}).catch(z=>{x(z instanceof Error?z.message:"Failed to fetch"),s("error")}),A=B.run("wiz/blog-security",{}).then(z=>{!z.ok&&z.error?(g(z.error),a("error")):(D=Nb(z),d(D),a("done"))}).catch(z=>{g(z instanceof Error?z.message:"Failed to fetch"),a("error")}),_=B.run("tldrsec/newsletter",{}).then(z=>{!z.ok&&z.error?(h(z.error),l("error")):(I=Sb(z),v(I),l("done"))}).catch(z=>{h(z instanceof Error?z.message:"Failed to fetch"),l("error")});await Promise.allSettled([R,A,_]);const $=[...E,...D,...I];if($.length>0){const z=new Date().toISOString();k(z),B.cacheSecurityNews($).catch(()=>{})}},[]),G=E=>(E==null?void 0:E.includes("auth_required"))||(E==null?void 0:E.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:E=>t(Number(E.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:H,disabled:N,children:N?"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})]})]}),N&&i.jsx(ht,{label:"Fetching security news..."}),y&&(G(y)?i.jsx(Tn,{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:"})," ",y]})})),w&&(G(w)?i.jsx(Tn,{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]})})),p&&i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",p]})}),j&&!N&&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"," ",Cb(j)]}),T&&!N&&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:wd[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})]})]}),L.length>0&&i.jsx("div",{className:"space-y-px",children:L.map((E,D)=>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:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:E.title}),i.jsx(W,{variant:vb[E.source]??"neutral",size:"xs",children:bb[E.source]??E.source.toUpperCase()})]}),E.summary&&i.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:E.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:wb(E.date)}),E.author&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:E.author}),E.tags&&i.jsx("div",{className:"flex gap-1 flex-wrap",children:E.tags.split(",").slice(0,3).map(I=>i.jsx(W,{variant:"neutral",size:"xs",children:I.trim()},I.trim()))})]})]},`${E.source}-${D}`))}),T&&L.length===0&&!N&&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 ",wd[e].toLowerCase()]}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!N&&!y&&!w&&!p&&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 ci(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 kd(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function Tb(e,t){switch(e){case"expired":return i.jsx(W,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return i.jsxs(W,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return i.jsxs(W,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return i.jsxs(W,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return i.jsx(W,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function Ab(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 Lb(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 Pb(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 Ib(){const[e,t]=b.useState("idle"),[n,s]=b.useState(""),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState("all"),[m,d]=b.useState(null),[f,v]=b.useState(!1),y=e==="clients"||e==="trustedby";b.useEffect(()=>{let j=!1;return B.getCachedTrustedPeers().then(k=>{if(!j&&k.data&&k.data.length>0){if(t(S=>S==="clients"||S==="trustedby"?(j=!0,S):"done"),j)return;const C=k.data;a(C),d(k.fetchedAt),v(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{j=!0}},[]);const x=b.useCallback(async()=>{t("clients"),l(null),a([]),v(!1),s("Fetching client list (all regions)...");try{const j=await B.run("tokenmaster/clients-list",{region:"all"});if(!j.ok&&j.error){l(j.error),t("error");return}const k=(j.data??[]).map(N=>({id:String(N.id??""),name:String(N.name??""),region:String(N.region??"emea")}));if(k.length===0){s("No clients found."),t("done");return}t("trustedby");const C=[],S=k.length;for(let N=0;N<k.length;N++){const T=k[N];s(`Fetching trusted peers... (${N+1}/${S}) — ${T.name||T.id}`);try{const L=await B.run("tokenmaster/client-trustedby",{clientid:T.id,region:T.region});if(L.ok&&L.data)for(const F of L.data)C.push({parentClientId:T.id,parentClientName:T.name||T.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??T.region)})}catch{}}if(a(C),s(`Loaded ${C.length} trusted peers from ${S} clients.`),t("done"),C.length>0){const N=new Date().toISOString();d(N),B.cacheTrustedPeers(C).catch(()=>{})}}catch(j){l(j instanceof Error?j.message:"Unknown error"),t("error")}},[]),w=b.useMemo(()=>[...c==="all"?r:r.filter(k=>k.region===c)].sort((k,C)=>{const S=ci(k.expiryDate),N=ci(C.expiryDate);return S===null&&N===null?0:S===null?1:N===null?-1:S-N}),[r,c]),g=b.useMemo(()=>{let j=0,k=0,C=0;for(const S of w){const N=kd(ci(S.expiryDate));N==="expired"?j++:N==="critical"?k++:N==="warning"&&C++}return{total:w.length,expired:j,critical:k,warning:C}},[w]),p=b.useMemo(()=>{const j=new Set(r.map(k=>k.region));return Array.from(j).sort()},[r]),h=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"}),m&&!y&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-3",children:[f?"Showing cached data from":"Last fetched"," ",Pb(m)]}),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:c,onChange:j=>u(j.target.value),children:[i.jsx("option",{value:"all",children:"All regions"}),p.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:x,disabled:y,children:y?"Loading...":"Load trusted peers"})]}),y&&i.jsx(ht,{label:n}),o&&(h(o)?i.jsx(Tn,{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&&!y&&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:g.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 ${g.expired>0?"text-red-500":""}`,children:g.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 ${g.critical>0?"text-red-500":""}`,children:g.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 ${g.warning>0?"text-amber-500":""}`,children:g.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=ci(j.expiryDate),S=kd(C);return i.jsxs("tr",{className:`border-b border-base-300/50 ${Lb(S)}`,children:[i.jsx("td",{children:Tb(S,C)}),i.jsx("td",{className:"font-mono text-sm",children:Ab(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(W,{variant:"neutral",size:"xs",children:j.region.toUpperCase()})})]},`${j.parentClientId}-${j.peerId}-${j.region}-${k}`)})})]})}),e==="done"&&!y&&r.length>0&&i.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!y&&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 Ob={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"},_b={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"};function bl({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 ${Ob[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 ${_b[o.color]}`})},o.id))}),i.jsx("div",{className:"relative",children:n.map((o,l)=>{if(o.type==="action"){const w=(t.findIndex(g=>g.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})})},l)}const c=t.findIndex(x=>x.id===o.from),u=t.findIndex(x=>x.id===o.to),m=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(m,d),v=Math.abs(d-m),y=c<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:`${f}%`,width:`${v}%`}}),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:`${m}%`}}),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(${y?"-100%":"0"}, -50%)`},children:y?"▸":"◂"}),i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(m+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})})]},l)})})]})]})]})}const Mb=[{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}],Db=[{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."}],$b=[{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"}]}],Rb=[{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:Mb.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(W,{size:"xs",children:e.tech}),e.port&&i.jsxs(W,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&i.jsx(W,{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:Db.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(W,{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(we,{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:$b.map(e=>i.jsx(bl,{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:Rb.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(W,{variant:"success",size:"xs",children:"npm"}):i.jsx(W,{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 Fb={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},Bb=[{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."}],Ub=[{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 }"}],Wb=[{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."}],Hb=[{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 Nd({ep:e}){const[t,n]=b.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(W,{variant:Fb[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(W,{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 Vb(){const[e,t]=b.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:Wb.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:Bb.map((n,s)=>i.jsx(Nd,{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:Ub.map((n,s)=>i.jsx(Nd,{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(we,{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:Hb.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(W,{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 Kb(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
408
- `),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(`
409
- `).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(`
410
- `).trim()}),s}function Gb({content:e}){return i.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function Sd({file:e,defaultOpen:t}){const[n,s]=b.useState(t??!1),r=b.useMemo(()=>Kb(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(Gb,{content:a.body})]},o))})]})}function qb({skill:e}){const[t,n]=b.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(W,{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(Sd,{file:s,defaultOpen:!0}),r.map(a=>i.jsx(Sd,{file:a},a.name))]})]})}function Yb(){const[e,t]=b.useState([]),[n,s]=b.useState(!0),[r,a]=b.useState(null);return b.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(ht,{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(W,{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(qb,{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 dn({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 ui({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 Qb={success:Oc,warning:Uh,error:Wh},Jb={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 ho({label:e,status:t}){const n=Qb[t];return i.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium ${Jb[t]}`,children:[i.jsx(n,{className:"w-3.5 h-3.5 shrink-0"}),e]})}const Xb=[{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 Zb(){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(dn,{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(ui,{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(dn,{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(oi,{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(Wh,{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(Uh,{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(dn,{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(W,{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(W,{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(oi,{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(fo,{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(Ci,{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(ui,{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:Xb.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(ho,{...e.cg})}),i.jsx("td",{children:i.jsx(ho,{...e.skills})}),i.jsx("td",{children:i.jsx(ho,{...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(dn,{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:Ci,title:"CLI",mono:"cg",desc:"Entry point for humans and AI agents. One command in, JSON out."},{icon:xl,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:oi,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:fo,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:md,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:m1,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(we,{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(we,{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(dn,{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:_c,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:Hh,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:Bh,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:Gh,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:Jv,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:s1,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(W,{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(we,{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(Ci,{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(oi,{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(Oc,{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(dn,{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:Kh,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:N1,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:Vh,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:qv,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:xl,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:fo,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation unless explicitly declared and approved."},{icon:qh,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:md,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(ui,{children:`# Install
411
- npm install -g @commandgarden/cli
412
-
413
- # Start the daemon and GUI
414
- cg up
415
-
416
- # Load the Chrome extension
417
- # Chrome → chrome://extensions → Developer mode → Load unpacked
418
-
419
- # Run your first connector
420
- cg run socket/security-news --format table`}),i.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[i.jsxs(we,{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(we,{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(we,{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(we,{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(we,{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(dn,{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(ui,{children:`site: mysite
421
- name: my-command
422
- version: "1.0"
423
- description: "Fetch search results"
424
- access: read
425
-
426
- domains:
427
- - "mysite.example.com"
428
- capabilities:
429
- - navigate
430
- - dom_read
431
-
432
- args:
433
- - name: query
434
- type: string
435
- required: true
436
-
437
- columns:
438
- - name: title
439
- type: string
440
- - name: url
441
- type: string
442
-
443
- pipeline:
444
- - step: navigate
445
- url: "https://mysite.example.com/search?q=\${{ args.query }}"
446
- - step: wait
447
- selector: ".results"
448
- - step: extract
449
- selector: ".results .item"
450
- fields:
451
- title: "h3"
452
- 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 po({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 ej({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 Cd=[{icon:xl,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:Vh,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:Uv,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]"}],tj=[{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."}],nj={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"}]},sj={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"}]},Ed=[{label:"Low",variant:"success",desc:"Runs automatically. Reading data, navigating pages.",icon:Oc},{label:"Medium",variant:"warning",desc:"Runs automatically, but every use is logged to the audit trail.",icon:Yh},{label:"High",variant:"error",desc:"Pauses for a yes/no, unless you've pre-approved that specific connector.",icon:j1}];function rj(){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(po,{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:Cd.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(W,{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<Cd.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:tj.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(W,{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(po,{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(bl,{flow:nj}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"A minimal connector pipeline"}),i.jsx(ej,{children:`pipeline:
453
- - step: navigate
454
- url: "https://example.com/tickets"
455
- - step: wait
456
- selector: ".ticket-row"
457
- - step: extract
458
- selector: ".ticket-row"
459
- fields:
460
- id: ".ticket-id"
461
- 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(po,{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:Ed.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(W,{variant:e.variant,size:"xs",children:e.label})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:e.desc})]}),t<Ed.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(bl,{flow:sj}),i.jsxs("div",{className:"mt-6 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(Kh,{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."})]})]})]})}b.lazy(()=>Og(()=>import("./Slides-D3xcxd9t.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 qs({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 ij({sections:e}){const t=b.useMemo(()=>e.map(r=>r.id),[e]),n=Uy(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))})}const aj=[{label:"Daily",to:"/apps/journal/daily"},{label:"Weekly",to:"/apps/journal/weekly"}];function oj({to:e,label:t,icon:n,items:s}){const a=Rt().pathname.startsWith(e);return i.jsxs(i.Fragment,{children:[i.jsxs(lt,{to:e,className:qs,children:[n,t]}),a&&s.length>0&&i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:s.map(o=>i.jsx(lt,{to:o.to,className:({isActive:l})=>`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${l?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:o.label},o.to))})]})}function Dn({to:e,label:t,icon:n,sections:s}){const a=Rt().pathname===e;return i.jsxs(i.Fragment,{children:[i.jsxs(lt,{to:e,end:e==="/",className:Gs,children:[n,t]}),a&&s.length>0&&i.jsx(ij,{sections:s})]})}function lj(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(!1),[o,l]=b.useState([]),[c,u]=b.useState(!1),m=b.useRef(null),d=Rt();b.useEffect(()=>{a(!1)},[d.pathname]),b.useEffect(()=>{if(!d.hash)return;const y=d.hash.slice(1),x=document.getElementById(y);x&&x.scrollIntoView({behavior:"smooth",block:"start"})},[d.pathname,d.hash]),b.useEffect(()=>{const y=()=>{B.getStatus().then(w=>{t(w.ok),s(w.extensionConnected)}).catch(()=>{t(!1),s(!1)})};y();const x=setInterval(y,3e4);return()=>clearInterval(x)},[]),b.useEffect(()=>{B.getConnectors().then(y=>{const x=wa(y.connectors).map(([w])=>w);l(x)}).catch(()=>{})},[]);const f=b.useMemo(()=>o.map(y=>({label:y,id:`conn-${y}`})),[o]),v=b.useCallback(()=>{const y=m.current;y&&u(y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);return b.useEffect(()=>{v();const y=m.current;if(y)return y.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{y.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,f,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(we,{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 y=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",y),localStorage.setItem("theme",y)},"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:m,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(lt,{to:"/",end:!0,className:Gs,children:[i.jsx(t1,{className:"w-4 h-4 shrink-0"}),"Dashboard"]}),i.jsxs(lt,{to:"/guide",className:Gs,children:[i.jsx(Bh,{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(lt,{to:"/apps/timetracking",className:qs,children:[i.jsx(_c,{className:"w-4 h-4 shrink-0"}),"Time Tracking"]}),i.jsxs(lt,{to:"/apps/rooms",className:qs,children:[i.jsx(Hh,{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.jsx(oj,{to:"/apps/journal",label:"Dev Journal",icon:i.jsx(d1,{className:"w-4 h-4 shrink-0"}),items:aj}),i.jsxs(lt,{to:"/apps/trusted-peer-expiry",className:qs,children:[i.jsx(Yh,{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(lt,{to:"/apps/security-news",className:qs,children:[i.jsx(Gh,{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(Dn,{to:"/connectors",label:"Connectors",icon:i.jsx(p1,{className:"w-4 h-4 shrink-0"}),sections:f}),i.jsxs(lt,{to:"/audit",className:Gs,children:[i.jsx(qh,{className:"w-4 h-4 shrink-0"}),"Audit Log"]}),i.jsx(Dn,{to:"/config",label:"Configuration",icon:i.jsx(v1,{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(Dn,{to:"/why",label:"Why commandGarden",icon:i.jsx(i1,{className:"w-4 h-4 shrink-0"}),sections:Fs["/why"]}),i.jsx(Dn,{to:"/api-reference",label:"API & CLI",icon:i.jsx(Ci,{className:"w-4 h-4 shrink-0"}),sections:Fs["/api-reference"]}),i.jsxs(lt,{to:"/skills",className:Gs,children:[i.jsx(C1,{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(Dn,{to:"/concepts",label:"Concepts",icon:i.jsx(Zv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/concepts"]}),i.jsx(Dn,{to:"/architecture",label:"Architecture",icon:i.jsx(l1,{className:"w-4 h-4 shrink-0"}),sections:Fs["/architecture"]}),!1]}),c&&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(Cy,{})})]})}function cj(){return i.jsx(Dy,{children:i.jsx(Ty,{children:i.jsxs(he,{element:i.jsx(lj,{}),children:[i.jsx(he,{index:!0,element:i.jsx(Vy,{})}),i.jsx(he,{path:"connectors",element:i.jsx(qy,{})}),i.jsx(he,{path:"connectors/:site/:name",element:i.jsx(Yy,{})}),i.jsx(he,{path:"audit",element:i.jsx(Xy,{})}),i.jsx(he,{path:"config",element:i.jsx(mv,{})}),i.jsx(he,{path:"guide",element:i.jsx(jv,{})}),i.jsx(he,{path:"apps/timetracking",element:i.jsx(B1,{})}),i.jsx(he,{path:"apps/rooms",element:i.jsx(tb,{})}),i.jsx(he,{path:"apps/journal",element:i.jsx(Sy,{to:"/apps/journal/daily",replace:!0})}),i.jsx(he,{path:"apps/journal/daily",element:i.jsx(xb,{})}),i.jsx(he,{path:"apps/journal/weekly",element:i.jsx(cb,{})}),i.jsx(he,{path:"apps/security-news",element:i.jsx(Eb,{})}),i.jsx(he,{path:"apps/trusted-peer-expiry",element:i.jsx(Ib,{})}),i.jsx(he,{path:"architecture",element:i.jsx(zb,{})}),i.jsx(he,{path:"api-reference",element:i.jsx(Vb,{})}),i.jsx(he,{path:"skills",element:i.jsx(Yb,{})}),i.jsx(he,{path:"why",element:i.jsx(Zb,{})}),i.jsx(he,{path:"concepts",element:i.jsx(rj,{})}),!1]})})})}Bm(document.getElementById("root")).render(i.jsx(b.StrictMode,{children:i.jsx(cj,{})}));export{Bh as B,Wh as C,md as D,Vh as E,fo as F,oi as G,Kh as L,m1 as P,xl as S,Ci as T,Uh as a,N1 as b,K as c,qv as d,W as e,i as j,b as r,Ym as u};