@promptowl/contextnest-community 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/API.md +2195 -0
  2. package/CONFIGURATION.md +8 -2
  3. package/README.md +62 -10
  4. package/STEWARDSHIP.md +253 -0
  5. package/dist/{chunk-2YPY2HGZ.js → chunk-2KHM5C7V.js} +40 -5
  6. package/dist/{chunk-XYD6V2LH.js → chunk-32SZCH36.js} +28 -33
  7. package/dist/{chunk-QLXC6542.js → chunk-7FROMOZM.js} +69 -27
  8. package/dist/{chunk-MLQU4I5J.js → chunk-DTLMBF4W.js} +10 -8
  9. package/dist/{chunk-QWNXWRWO.js → chunk-JDAOA5KP.js} +67 -1
  10. package/dist/{chunk-UOMW7TT6.js → chunk-KPGNZLZL.js} +2 -2
  11. package/dist/{chunk-YVMSM7LS.js → chunk-LHWOJPFE.js} +7 -0
  12. package/dist/{chunk-5CVZMHHB.js → chunk-TI7HMP64.js} +99 -12
  13. package/dist/{client-LWDMNKX3.js → client-D44ZHDTJ.js} +1 -1
  14. package/dist/{engine-QFF2IA3G.js → engine-TER6FDBP.js} +3 -3
  15. package/dist/{external-edit-service-F7D3VSA2.js → external-edit-service-CAGENHDJ.js} +4 -4
  16. package/dist/{grants-service-TBGTCO5K.js → grants-service-2OTFS7EH.js} +3 -3
  17. package/dist/index.js +1120 -331
  18. package/dist/{migrations.postgres-APCVSYUE.js → migrations.postgres-23VJJJJX.js} +56 -5
  19. package/dist/{review-service-A7PNLWG5.js → review-service-4G2XUFS6.js} +7 -7
  20. package/dist/{stewardship-service-32UHIRQ5.js → stewardship-service-S22V2JKG.js} +6 -4
  21. package/dist/{version-service-RJ6CWZ3O.js → version-service-X4FAG2OZ.js} +4 -4
  22. package/dist/web3/assets/ActivityTracePage-D2iIbEph.js +1 -0
  23. package/dist/web3/assets/AgentDocsPage-Dkhgb1hk.js +1 -0
  24. package/dist/web3/assets/CollaboratorManager-Bo81D--Q.js +1 -0
  25. package/dist/web3/assets/CollaboratorsTab-DRCitQuX.js +1 -0
  26. package/dist/web3/assets/DocumentEditor-DV2WHYbj.js +36 -0
  27. package/dist/web3/assets/DocumentsTab-BUxBCN8o.js +6 -0
  28. package/dist/web3/assets/ExternalEditsTab-kIBimZyE.js +1 -0
  29. package/dist/web3/assets/MarkdownEditor-CsVusP2d.css +1 -0
  30. package/dist/web3/assets/MarkdownEditor-Dfk5uIE5.js +648 -0
  31. package/dist/web3/assets/NestPageHeader-yOK-OIYZ.js +1 -0
  32. package/dist/web3/assets/NestView-DwIagxwJ.js +68 -0
  33. package/dist/web3/assets/OverviewTab-DFOFMVyE.js +1 -0
  34. package/dist/web3/assets/PersonCombobox-D350WlrJ.js +1 -0
  35. package/dist/web3/assets/ReasonDialog-CN3ECAnQ.js +1 -0
  36. package/dist/web3/assets/ReviewActions-BXDTDPp1.js +6 -0
  37. package/dist/web3/assets/ReviewTab-CZewAYiz.js +1 -0
  38. package/dist/web3/assets/StewardsTab-AagNWcWS.js +1 -0
  39. package/dist/web3/assets/SubmitForReviewModal-BOZJxwRN.js +1 -0
  40. package/dist/web3/assets/alert-dialog-4SiLKlz8.js +7 -0
  41. package/dist/web3/assets/arrow-left-BAgIocLn.js +6 -0
  42. package/dist/web3/assets/backlinks-Cb8Uf8mw.js +24 -0
  43. package/dist/web3/assets/card-UDyMRcps.js +1 -0
  44. package/dist/web3/assets/chevron-left-XR4ReJ9Z.js +6 -0
  45. package/dist/web3/assets/circle-check-CSkZUEFK.js +6 -0
  46. package/dist/web3/assets/circle-x-in2o3aHU.js +6 -0
  47. package/dist/web3/assets/client-attribution-BraarYaP.js +1 -0
  48. package/dist/web3/assets/code-xml-pPQgdctI.js +6 -0
  49. package/dist/web3/assets/corner-down-right-CuxZWscX.js +6 -0
  50. package/dist/web3/assets/count-skeleton-DBWCDhRy.js +1 -0
  51. package/dist/web3/assets/dates-BCxbm4_q.js +1 -0
  52. package/dist/web3/assets/earth-CXOcThqn.js +6 -0
  53. package/dist/web3/assets/file-exclamation-point-CSphs1VD.js +6 -0
  54. package/dist/web3/assets/folder-input-BAwK9tFL.js +11 -0
  55. package/dist/web3/assets/folder-target-CUSWqImF.js +1 -0
  56. package/dist/web3/assets/index-A0_ymcqL.js +29 -0
  57. package/dist/web3/assets/index-B5hLclEq.js +389 -0
  58. package/dist/web3/assets/index-DrUAtoQM.css +1 -0
  59. package/dist/web3/assets/page-BHD4beun.js +1 -0
  60. package/dist/web3/assets/page-BSYUXYmO.js +11 -0
  61. package/dist/web3/assets/page-BYc2DIux.js +45 -0
  62. package/dist/web3/assets/page-BfibLg8e.js +1 -0
  63. package/dist/web3/assets/page-CGe8MtUu.js +9 -0
  64. package/dist/web3/assets/page-CIgPJmG6.js +2 -0
  65. package/dist/web3/assets/page-CUjuSs5Q.js +24 -0
  66. package/dist/web3/assets/page-Ck31nx9b.js +1 -0
  67. package/dist/web3/assets/page-Cpdj_11Y.js +1 -0
  68. package/dist/web3/assets/page-D0sN3GO6.js +1 -0
  69. package/dist/web3/assets/page-DEpH91X2.js +1 -0
  70. package/dist/web3/assets/page-l8-B7CGt.js +1 -0
  71. package/dist/web3/assets/page-mnSHmk6A.js +6 -0
  72. package/dist/web3/assets/page-title-BkqlUA0j.js +1 -0
  73. package/dist/web3/assets/page-xzYqkBUP.js +16 -0
  74. package/dist/web3/assets/play-B8xE9j5f.js +6 -0
  75. package/dist/web3/assets/refresh-cw-CsCtmWwX.js +6 -0
  76. package/dist/web3/assets/scroll-area-CbcH6yrZ.js +1 -0
  77. package/dist/web3/assets/scroll-area-dRWncRqa.css +1 -0
  78. package/dist/web3/assets/select-DrL0mpRN.js +6 -0
  79. package/dist/web3/assets/send-CvAgOUPG.js +6 -0
  80. package/dist/web3/assets/settings-EY4A_DYv.js +6 -0
  81. package/dist/web3/assets/share-2-vGmZUl90.js +6 -0
  82. package/dist/web3/assets/tag-Br_y1f00.js +11 -0
  83. package/dist/web3/assets/trash-2-B4hRXo-p.js +6 -0
  84. package/dist/web3/assets/triangle-alert-CsYGyfGZ.js +6 -0
  85. package/dist/web3/assets/user-plus-4CTYEkd3.js +6 -0
  86. package/dist/web3/assets/x-qxt1WrUi.js +6 -0
  87. package/dist/web3/assets/zap-BcsKR0ef.js +16 -0
  88. package/dist/web3/index.html +2 -2
  89. package/package.json +5 -3
  90. package/dist/web3/assets/index-BJ-LRNis.js +0 -1382
  91. package/dist/web3/assets/index-DPMEt-A_.css +0 -1
@@ -0,0 +1,389 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/page-BHD4beun.js","assets/NestPageHeader-yOK-OIYZ.js","assets/arrow-left-BAgIocLn.js","assets/folder-target-CUSWqImF.js","assets/refresh-cw-CsCtmWwX.js","assets/x-qxt1WrUi.js","assets/zap-BcsKR0ef.js","assets/page-CIgPJmG6.js","assets/trash-2-B4hRXo-p.js","assets/triangle-alert-CsYGyfGZ.js","assets/page-CUjuSs5Q.js","assets/tag-Br_y1f00.js","assets/page-xzYqkBUP.js","assets/dates-BCxbm4_q.js","assets/MarkdownEditor-Dfk5uIE5.js","assets/scroll-area-CbcH6yrZ.js","assets/select-DrL0mpRN.js","assets/scroll-area-dRWncRqa.css","assets/index-A0_ymcqL.js","assets/MarkdownEditor-CsVusP2d.css","assets/NestView-DwIagxwJ.js","assets/chevron-left-XR4ReJ9Z.js","assets/alert-dialog-4SiLKlz8.js","assets/count-skeleton-DBWCDhRy.js","assets/folder-input-BAwK9tFL.js","assets/card-UDyMRcps.js","assets/PersonCombobox-D350WlrJ.js","assets/user-plus-4CTYEkd3.js","assets/ReviewActions-BXDTDPp1.js","assets/circle-check-CSkZUEFK.js","assets/circle-x-in2o3aHU.js","assets/ReasonDialog-CN3ECAnQ.js","assets/settings-EY4A_DYv.js","assets/play-B8xE9j5f.js","assets/corner-down-right-CuxZWscX.js","assets/page-l8-B7CGt.js","assets/page-title-BkqlUA0j.js","assets/page-BfibLg8e.js","assets/page-BSYUXYmO.js","assets/page-Cpdj_11Y.js","assets/SubmitForReviewModal-BOZJxwRN.js","assets/send-CvAgOUPG.js","assets/page-Ck31nx9b.js","assets/page-BYc2DIux.js","assets/earth-CXOcThqn.js","assets/page-CGe8MtUu.js","assets/page-mnSHmk6A.js","assets/page-D0sN3GO6.js","assets/page-DEpH91X2.js","assets/ActivityTracePage-D2iIbEph.js","assets/client-attribution-BraarYaP.js","assets/DocumentEditor-DV2WHYbj.js","assets/CollaboratorManager-Bo81D--Q.js","assets/share-2-vGmZUl90.js","assets/backlinks-Cb8Uf8mw.js","assets/code-xml-pPQgdctI.js","assets/file-exclamation-point-CSphs1VD.js","assets/AgentDocsPage-Dkhgb1hk.js"])))=>i.map(i=>d[i]);
2
+ var IS=Object.defineProperty;var Tg=e=>{throw TypeError(e)};var DS=(e,t,r)=>t in e?IS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Rg=(e,t,r)=>DS(e,typeof t!="symbol"?t+"":t,r),Pd=(e,t,r)=>t.has(e)||Tg("Cannot "+r);var P=(e,t,r)=>(Pd(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?Tg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,o)=>(Pd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r),$e=(e,t,r)=>(Pd(e,t,"access private method"),r);var Ll=(e,t,r,o)=>({set _(a){ue(e,t,a,r)},get _(){return P(e,t,o)}});function LS(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in e)){const c=Object.getOwnPropertyDescriptor(o,a);c&&Object.defineProperty(e,a,c.get?c:{enumerable:!0,get:()=>o[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(a){if(a.ep)return;a.ep=!0;const c=r(a);fetch(a.href,c)}})();var uI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jd={exports:{}},Xi={},Td={exports:{}},Fe={};/**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Ag;function zS(){if(Ag)return Fe;Ag=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),f=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=f&&O[f]||O["@@iterator"],typeof O=="function"?O:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,k={};function C(O,Q,re){this.props=O,this.context=Q,this.refs=k,this.updater=re||S}C.prototype.isReactComponent={},C.prototype.setState=function(O,Q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Q,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=C.prototype;function R(O,Q,re){this.props=O,this.context=Q,this.refs=k,this.updater=re||S}var I=R.prototype=new _;I.constructor=R,N(I,C.prototype),I.isPureReactComponent=!0;var j=Array.isArray,G=Object.prototype.hasOwnProperty,K={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function M(O,Q,re){var J,Z={},de=null,we=null;if(Q!=null)for(J in Q.ref!==void 0&&(we=Q.ref),Q.key!==void 0&&(de=""+Q.key),Q)G.call(Q,J)&&!A.hasOwnProperty(J)&&(Z[J]=Q[J]);var xe=arguments.length-2;if(xe===1)Z.children=re;else if(1<xe){for(var ve=Array(xe),Ue=0;Ue<xe;Ue++)ve[Ue]=arguments[Ue+2];Z.children=ve}if(O&&O.defaultProps)for(J in xe=O.defaultProps,xe)Z[J]===void 0&&(Z[J]=xe[J]);return{$$typeof:e,type:O,key:de,ref:we,props:Z,_owner:K.current}}function Y(O,Q){return{$$typeof:e,type:O.type,key:Q,ref:O.ref,props:O.props,_owner:O._owner}}function V(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function le(O){var Q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(re){return Q[re]})}var he=/\/+/g;function pe(O,Q){return typeof O=="object"&&O!==null&&O.key!=null?le(""+O.key):Q.toString(36)}function fe(O,Q,re,J,Z){var de=typeof O;(de==="undefined"||de==="boolean")&&(O=null);var we=!1;if(O===null)we=!0;else switch(de){case"string":case"number":we=!0;break;case"object":switch(O.$$typeof){case e:case t:we=!0}}if(we)return we=O,Z=Z(we),O=J===""?"."+pe(we,0):J,j(Z)?(re="",O!=null&&(re=O.replace(he,"$&/")+"/"),fe(Z,Q,re,"",function(Ue){return Ue})):Z!=null&&(V(Z)&&(Z=Y(Z,re+(!Z.key||we&&we.key===Z.key?"":(""+Z.key).replace(he,"$&/")+"/")+O)),Q.push(Z)),1;if(we=0,J=J===""?".":J+":",j(O))for(var xe=0;xe<O.length;xe++){de=O[xe];var ve=J+pe(de,xe);we+=fe(de,Q,re,ve,Z)}else if(ve=x(O),typeof ve=="function")for(O=ve.call(O),xe=0;!(de=O.next()).done;)de=de.value,ve=J+pe(de,xe++),we+=fe(de,Q,re,ve,Z);else if(de==="object")throw Q=String(O),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return we}function ce(O,Q,re){if(O==null)return O;var J=[],Z=0;return fe(O,J,"","",function(de){return Q.call(re,de,Z++)}),J}function X(O){if(O._status===-1){var Q=O._result;Q=Q(),Q.then(function(re){(O._status===0||O._status===-1)&&(O._status=1,O._result=re)},function(re){(O._status===0||O._status===-1)&&(O._status=2,O._result=re)}),O._status===-1&&(O._status=0,O._result=Q)}if(O._status===1)return O._result.default;throw O._result}var oe={current:null},q={transition:null},H={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:q,ReactCurrentOwner:K};function D(){throw Error("act(...) is not supported in production builds of React.")}return Fe.Children={map:ce,forEach:function(O,Q,re){ce(O,function(){Q.apply(this,arguments)},re)},count:function(O){var Q=0;return ce(O,function(){Q++}),Q},toArray:function(O){return ce(O,function(Q){return Q})||[]},only:function(O){if(!V(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},Fe.Component=C,Fe.Fragment=r,Fe.Profiler=a,Fe.PureComponent=R,Fe.StrictMode=o,Fe.Suspense=g,Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,Fe.act=D,Fe.cloneElement=function(O,Q,re){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var J=N({},O.props),Z=O.key,de=O.ref,we=O._owner;if(Q!=null){if(Q.ref!==void 0&&(de=Q.ref,we=K.current),Q.key!==void 0&&(Z=""+Q.key),O.type&&O.type.defaultProps)var xe=O.type.defaultProps;for(ve in Q)G.call(Q,ve)&&!A.hasOwnProperty(ve)&&(J[ve]=Q[ve]===void 0&&xe!==void 0?xe[ve]:Q[ve])}var ve=arguments.length-2;if(ve===1)J.children=re;else if(1<ve){xe=Array(ve);for(var Ue=0;Ue<ve;Ue++)xe[Ue]=arguments[Ue+2];J.children=xe}return{$$typeof:e,type:O.type,key:Z,ref:de,props:J,_owner:we}},Fe.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:c,_context:O},O.Consumer=O},Fe.createElement=M,Fe.createFactory=function(O){var Q=M.bind(null,O);return Q.type=O,Q},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(O){return{$$typeof:p,render:O}},Fe.isValidElement=V,Fe.lazy=function(O){return{$$typeof:w,_payload:{_status:-1,_result:O},_init:X}},Fe.memo=function(O,Q){return{$$typeof:v,type:O,compare:Q===void 0?null:Q}},Fe.startTransition=function(O){var Q=q.transition;q.transition={};try{O()}finally{q.transition=Q}},Fe.unstable_act=D,Fe.useCallback=function(O,Q){return oe.current.useCallback(O,Q)},Fe.useContext=function(O){return oe.current.useContext(O)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(O){return oe.current.useDeferredValue(O)},Fe.useEffect=function(O,Q){return oe.current.useEffect(O,Q)},Fe.useId=function(){return oe.current.useId()},Fe.useImperativeHandle=function(O,Q,re){return oe.current.useImperativeHandle(O,Q,re)},Fe.useInsertionEffect=function(O,Q){return oe.current.useInsertionEffect(O,Q)},Fe.useLayoutEffect=function(O,Q){return oe.current.useLayoutEffect(O,Q)},Fe.useMemo=function(O,Q){return oe.current.useMemo(O,Q)},Fe.useReducer=function(O,Q,re){return oe.current.useReducer(O,Q,re)},Fe.useRef=function(O){return oe.current.useRef(O)},Fe.useState=function(O){return oe.current.useState(O)},Fe.useSyncExternalStore=function(O,Q,re){return oe.current.useSyncExternalStore(O,Q,re)},Fe.useTransition=function(){return oe.current.useTransition()},Fe.version="18.3.1",Fe}var Mg;function _c(){return Mg||(Mg=1,Td.exports=zS()),Td.exports}/**
11
+ * @license React
12
+ * react-jsx-runtime.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var $g;function FS(){if($g)return Xi;$g=1;var e=_c(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(p,g,v){var w,f={},x=null,S=null;v!==void 0&&(x=""+v),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(S=g.ref);for(w in g)o.call(g,w)&&!c.hasOwnProperty(w)&&(f[w]=g[w]);if(p&&p.defaultProps)for(w in g=p.defaultProps,g)f[w]===void 0&&(f[w]=g[w]);return{$$typeof:t,type:p,key:x,ref:S,props:f,_owner:a.current}}return Xi.Fragment=r,Xi.jsx=d,Xi.jsxs=d,Xi}var Ig;function US(){return Ig||(Ig=1,jd.exports=FS()),jd.exports}var u=US(),y=_c();const ie=Qf(y),Gf=LS({__proto__:null,default:ie},[y]);var zl={},Rd={exports:{}},cn={},Ad={exports:{}},Md={};/**
19
+ * @license React
20
+ * scheduler.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Dg;function VS(){return Dg||(Dg=1,(function(e){function t(q,H){var D=q.length;q.push(H);e:for(;0<D;){var O=D-1>>>1,Q=q[O];if(0<a(Q,H))q[O]=H,q[D]=Q,D=O;else break e}}function r(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var H=q[0],D=q.pop();if(D!==H){q[0]=D;e:for(var O=0,Q=q.length,re=Q>>>1;O<re;){var J=2*(O+1)-1,Z=q[J],de=J+1,we=q[de];if(0>a(Z,D))de<Q&&0>a(we,Z)?(q[O]=we,q[de]=D,O=de):(q[O]=Z,q[J]=D,O=J);else if(de<Q&&0>a(we,D))q[O]=we,q[de]=D,O=de;else break e}}return H}function a(q,H){var D=q.sortIndex-H.sortIndex;return D!==0?D:q.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],v=[],w=1,f=null,x=3,S=!1,N=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(q){for(var H=r(v);H!==null;){if(H.callback===null)o(v);else if(H.startTime<=q)o(v),H.sortIndex=H.expirationTime,t(g,H);else break;H=r(v)}}function j(q){if(k=!1,I(q),!N)if(r(g)!==null)N=!0,X(G);else{var H=r(v);H!==null&&oe(j,H.startTime-q)}}function G(q,H){N=!1,k&&(k=!1,_(M),M=-1),S=!0;var D=x;try{for(I(H),f=r(g);f!==null&&(!(f.expirationTime>H)||q&&!le());){var O=f.callback;if(typeof O=="function"){f.callback=null,x=f.priorityLevel;var Q=O(f.expirationTime<=H);H=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===r(g)&&o(g),I(H)}else o(g);f=r(g)}if(f!==null)var re=!0;else{var J=r(v);J!==null&&oe(j,J.startTime-H),re=!1}return re}finally{f=null,x=D,S=!1}}var K=!1,A=null,M=-1,Y=5,V=-1;function le(){return!(e.unstable_now()-V<Y)}function he(){if(A!==null){var q=e.unstable_now();V=q;var H=!0;try{H=A(!0,q)}finally{H?pe():(K=!1,A=null)}}else K=!1}var pe;if(typeof R=="function")pe=function(){R(he)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ce=fe.port2;fe.port1.onmessage=he,pe=function(){ce.postMessage(null)}}else pe=function(){C(he,0)};function X(q){A=q,K||(K=!0,pe())}function oe(q,H){M=C(function(){q(e.unstable_now())},H)}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(q){q.callback=null},e.unstable_continueExecution=function(){N||S||(N=!0,X(G))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(g)},e.unstable_next=function(q){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var D=x;x=H;try{return q()}finally{x=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,H){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var D=x;x=q;try{return H()}finally{x=D}},e.unstable_scheduleCallback=function(q,H,D){var O=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?O+D:O):D=O,q){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=D+Q,q={id:w++,callback:H,priorityLevel:q,startTime:D,expirationTime:Q,sortIndex:-1},D>O?(q.sortIndex=D,t(v,q),r(g)===null&&q===r(v)&&(k?(_(M),M=-1):k=!0,oe(j,D-O))):(q.sortIndex=Q,t(g,q),N||S||(N=!0,X(G))),q},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(q){var H=x;return function(){var D=x;x=H;try{return q.apply(this,arguments)}finally{x=D}}}})(Md)),Md}var Lg;function BS(){return Lg||(Lg=1,Ad.exports=VS()),Ad.exports}/**
27
+ * @license React
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var zg;function WS(){if(zg)return cn;zg=1;var e=_c(),t=BS();function r(n){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+n,i=1;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function c(n,s){d(n,s),d(n+"Capture",s)}function d(n,s){for(a[n]=s,n=0;n<s.length;n++)o.add(s[n])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,v=/^[: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]*$/,w={},f={};function x(n){return g.call(f,n)?!0:g.call(w,n)?!1:v.test(n)?f[n]=!0:(w[n]=!0,!1)}function S(n,s,i,l){if(i!==null&&i.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function N(n,s,i,l){if(s===null||typeof s>"u"||S(n,s,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(n,s,i,l,h,m,b){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=l,this.attributeNamespace=h,this.mustUseProperty=i,this.propertyName=n,this.type=s,this.sanitizeURL=m,this.removeEmptyString=b}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){C[n]=new k(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var s=n[0];C[s]=new k(s,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){C[n]=new k(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){C[n]=new k(n,2,!1,n,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(n){C[n]=new k(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){C[n]=new k(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){C[n]=new k(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){C[n]=new k(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){C[n]=new k(n,5,!1,n.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function R(n){return n[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(n){var s=n.replace(_,R);C[s]=new k(s,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var s=n.replace(_,R);C[s]=new k(s,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var s=n.replace(_,R);C[s]=new k(s,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){C[n]=new k(n,1,!1,n.toLowerCase(),null,!1,!1)}),C.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){C[n]=new k(n,1,!1,n.toLowerCase(),null,!0,!0)});function I(n,s,i,l){var h=C.hasOwnProperty(s)?C[s]:null;(h!==null?h.type!==0:l||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(N(s,i,h,l)&&(i=null),l||h===null?x(s)&&(i===null?n.removeAttribute(s):n.setAttribute(s,""+i)):h.mustUseProperty?n[h.propertyName]=i===null?h.type===3?!1:"":i:(s=h.attributeName,l=h.attributeNamespace,i===null?n.removeAttribute(s):(h=h.type,i=h===3||h===4&&i===!0?"":""+i,l?n.setAttributeNS(l,s,i):n.setAttribute(s,i))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),K=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),le=Symbol.for("react.context"),he=Symbol.for("react.forward_ref"),pe=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),q=Symbol.iterator;function H(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var D=Object.assign,O;function Q(n){if(O===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);O=s&&s[1]||""}return`
35
+ `+O+n}var re=!1;function J(n,s){if(!n||re)return"";re=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(W){var l=W}Reflect.construct(n,[],s)}else{try{s.call()}catch(W){l=W}n.call(s.prototype)}else{try{throw Error()}catch(W){l=W}n()}}catch(W){if(W&&l&&typeof W.stack=="string"){for(var h=W.stack.split(`
36
+ `),m=l.stack.split(`
37
+ `),b=h.length-1,E=m.length-1;1<=b&&0<=E&&h[b]!==m[E];)E--;for(;1<=b&&0<=E;b--,E--)if(h[b]!==m[E]){if(b!==1||E!==1)do if(b--,E--,0>E||h[b]!==m[E]){var T=`
38
+ `+h[b].replace(" at new "," at ");return n.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",n.displayName)),T}while(1<=b&&0<=E);break}}}finally{re=!1,Error.prepareStackTrace=i}return(n=n?n.displayName||n.name:"")?Q(n):""}function Z(n){switch(n.tag){case 5:return Q(n.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return n=J(n.type,!1),n;case 11:return n=J(n.type.render,!1),n;case 1:return n=J(n.type,!0),n;default:return""}}function de(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case A:return"Fragment";case K:return"Portal";case Y:return"Profiler";case M:return"StrictMode";case pe:return"Suspense";case fe:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case le:return(n.displayName||"Context")+".Consumer";case V:return(n._context.displayName||"Context")+".Provider";case he:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case ce:return s=n.displayName||null,s!==null?s:de(n.type)||"Memo";case X:s=n._payload,n=n._init;try{return de(n(s))}catch{}}return null}function we(n){var s=n.type;switch(n.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=s.render,n=n.displayName||n.name||"",s.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(s);case 8:return s===M?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function xe(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ve(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ue(n){var s=ve(n)?"checked":"value",i=Object.getOwnPropertyDescriptor(n.constructor.prototype,s),l=""+n[s];if(!n.hasOwnProperty(s)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var h=i.get,m=i.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return h.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(n,s,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function at(n){n._valueTracker||(n._valueTracker=Ue(n))}function pt(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var i=s.getValue(),l="";return n&&(l=ve(n)?n.checked?"true":"false":n.value),n=l,n!==i?(s.setValue(n),!0):!1}function lt(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function vt(n,s){var i=s.checked;return D({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??n._wrapperState.initialChecked})}function tn(n,s){var i=s.defaultValue==null?"":s.defaultValue,l=s.checked!=null?s.checked:s.defaultChecked;i=xe(s.value!=null?s.value:i),n._wrapperState={initialChecked:l,initialValue:i,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Dn(n,s){s=s.checked,s!=null&&I(n,"checked",s,!1)}function pn(n,s){Dn(n,s);var i=xe(s.value),l=s.type;if(i!=null)l==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+i):n.value!==""+i&&(n.value=""+i);else if(l==="submit"||l==="reset"){n.removeAttribute("value");return}s.hasOwnProperty("value")?nt(n,s.type,i):s.hasOwnProperty("defaultValue")&&nt(n,s.type,xe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(n.defaultChecked=!!s.defaultChecked)}function rr(n,s,i){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var l=s.type;if(!(l!=="submit"&&l!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+n._wrapperState.initialValue,i||s===n.value||(n.value=s),n.defaultValue=s}i=n.name,i!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,i!==""&&(n.name=i)}function nt(n,s,i){(s!=="number"||lt(n.ownerDocument)!==n)&&(i==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+i&&(n.defaultValue=""+i))}var Ln=Array.isArray;function zn(n,s,i,l){if(n=n.options,s){s={};for(var h=0;h<i.length;h++)s["$"+i[h]]=!0;for(i=0;i<n.length;i++)h=s.hasOwnProperty("$"+n[i].value),n[i].selected!==h&&(n[i].selected=h),h&&l&&(n[i].defaultSelected=!0)}else{for(i=""+xe(i),s=null,h=0;h<n.length;h++){if(n[h].value===i){n[h].selected=!0,l&&(n[h].defaultSelected=!0);return}s!==null||n[h].disabled||(s=n[h])}s!==null&&(s.selected=!0)}}function wt(n,s){if(s.dangerouslySetInnerHTML!=null)throw Error(r(91));return D({},s,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function sr(n,s){var i=s.value;if(i==null){if(i=s.children,s=s.defaultValue,i!=null){if(s!=null)throw Error(r(92));if(Ln(i)){if(1<i.length)throw Error(r(93));i=i[0]}s=i}s==null&&(s=""),i=s}n._wrapperState={initialValue:xe(i)}}function Wt(n,s){var i=xe(s.value),l=xe(s.defaultValue);i!=null&&(i=""+i,i!==n.value&&(n.value=i),s.defaultValue==null&&n.defaultValue!==i&&(n.defaultValue=i)),l!=null&&(n.defaultValue=""+l)}function br(n){var s=n.textContent;s===n._wrapperState.initialValue&&s!==""&&s!==null&&(n.value=s)}function Sr(n){switch(n){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 or(n,s){return n==null||n==="http://www.w3.org/1999/xhtml"?Sr(s):n==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var ir,kr=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,i,l,h){MSApp.execUnsafeLocalFunction(function(){return n(s,i,l,h)})}:n})(function(n,s){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=s;else{for(ir=ir||document.createElement("div"),ir.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=ir.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;s.firstChild;)n.appendChild(s.firstChild)}});function L(n,s){if(s){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=s;return}}n.textContent=s}var ee={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},me=["Webkit","ms","Moz","O"];Object.keys(ee).forEach(function(n){me.forEach(function(s){s=s+n.charAt(0).toUpperCase()+n.substring(1),ee[s]=ee[n]})});function ge(n,s,i){return s==null||typeof s=="boolean"||s===""?"":i||typeof s!="number"||s===0||ee.hasOwnProperty(n)&&ee[n]?(""+s).trim():s+"px"}function Oe(n,s){n=n.style;for(var i in s)if(s.hasOwnProperty(i)){var l=i.indexOf("--")===0,h=ge(i,s[i],l);i==="float"&&(i="cssFloat"),l?n.setProperty(i,h):n[i]=h}}var Je=D({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 Et(n,s){if(s){if(Je[n]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function et(n,s){if(n.indexOf("-")===-1)return typeof s.is=="string";switch(n){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 ht=null;function ct(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Fn=null,hn=null,nn=null;function vi(n){if(n=Li(n)){if(typeof Fn!="function")throw Error(r(280));var s=n.stateNode;s&&(s=Xa(s),Fn(n.stateNode,n.type,s))}}function Ie(n){hn?nn?nn.push(n):nn=[n]:hn=n}function ut(){if(hn){var n=hn,s=nn;if(nn=hn=null,vi(n),s)for(n=0;n<s.length;n++)vi(s[n])}}function xt(n,s){return n(s)}function It(){}var Ur=!1;function mt(n,s,i){if(Ur)return n(s,i);Ur=!0;try{return xt(n,s,i)}finally{Ur=!1,(hn!==null||nn!==null)&&(It(),ut())}}function Ot(n,s){var i=n.stateNode;if(i===null)return null;var l=Xa(i);if(l===null)return null;i=l[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(r(231,s,typeof i));return i}var Vr=!1;if(p)try{var At={};Object.defineProperty(At,"passive",{get:function(){Vr=!0}}),window.addEventListener("test",At,At),window.removeEventListener("test",At,At)}catch{Vr=!1}function mn(n,s,i,l,h,m,b,E,T){var W=Array.prototype.slice.call(arguments,3);try{s.apply(i,W)}catch(ne){this.onError(ne)}}var Br=!1,Nn=null,wi=!1,Qc=null,Bb={onError:function(n){Br=!0,Nn=n}};function Wb(n,s,i,l,h,m,b,E,T){Br=!1,Nn=null,mn.apply(Bb,arguments)}function Hb(n,s,i,l,h,m,b,E,T){if(Wb.apply(this,arguments),Br){if(Br){var W=Nn;Br=!1,Nn=null}else throw Error(r(198));wi||(wi=!0,Qc=W)}}function Es(n){var s=n,i=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(i=s.return),n=s.return;while(n)}return s.tag===3?i:null}function eh(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function th(n){if(Es(n)!==n)throw Error(r(188))}function qb(n){var s=n.alternate;if(!s){if(s=Es(n),s===null)throw Error(r(188));return s!==n?null:n}for(var i=n,l=s;;){var h=i.return;if(h===null)break;var m=h.alternate;if(m===null){if(l=h.return,l!==null){i=l;continue}break}if(h.child===m.child){for(m=h.child;m;){if(m===i)return th(h),n;if(m===l)return th(h),s;m=m.sibling}throw Error(r(188))}if(i.return!==l.return)i=h,l=m;else{for(var b=!1,E=h.child;E;){if(E===i){b=!0,i=h,l=m;break}if(E===l){b=!0,l=h,i=m;break}E=E.sibling}if(!b){for(E=m.child;E;){if(E===i){b=!0,i=m,l=h;break}if(E===l){b=!0,l=m,i=h;break}E=E.sibling}if(!b)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?n:s}function nh(n){return n=qb(n),n!==null?rh(n):null}function rh(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var s=rh(n);if(s!==null)return s;n=n.sibling}return null}var sh=t.unstable_scheduleCallback,oh=t.unstable_cancelCallback,Kb=t.unstable_shouldYield,Qb=t.unstable_requestPaint,dt=t.unstable_now,Gb=t.unstable_getCurrentPriorityLevel,Gc=t.unstable_ImmediatePriority,ih=t.unstable_UserBlockingPriority,Aa=t.unstable_NormalPriority,Zb=t.unstable_LowPriority,ah=t.unstable_IdlePriority,Ma=null,ar=null;function Jb(n){if(ar&&typeof ar.onCommitFiberRoot=="function")try{ar.onCommitFiberRoot(Ma,n,void 0,(n.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:e1,Yb=Math.log,Xb=Math.LN2;function e1(n){return n>>>=0,n===0?32:31-(Yb(n)/Xb|0)|0}var $a=64,Ia=4194304;function xi(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Da(n,s){var i=n.pendingLanes;if(i===0)return 0;var l=0,h=n.suspendedLanes,m=n.pingedLanes,b=i&268435455;if(b!==0){var E=b&~h;E!==0?l=xi(E):(m&=b,m!==0&&(l=xi(m)))}else b=i&~h,b!==0?l=xi(b):m!==0&&(l=xi(m));if(l===0)return 0;if(s!==0&&s!==l&&(s&h)===0&&(h=l&-l,m=s&-s,h>=m||h===16&&(m&4194240)!==0))return s;if((l&4)!==0&&(l|=i&16),s=n.entangledLanes,s!==0)for(n=n.entanglements,s&=l;0<s;)i=31-Un(s),h=1<<i,l|=n[i],s&=~h;return l}function t1(n,s){switch(n){case 1:case 2:case 4:return s+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 s+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 n1(n,s){for(var i=n.suspendedLanes,l=n.pingedLanes,h=n.expirationTimes,m=n.pendingLanes;0<m;){var b=31-Un(m),E=1<<b,T=h[b];T===-1?((E&i)===0||(E&l)!==0)&&(h[b]=t1(E,s)):T<=s&&(n.expiredLanes|=E),m&=~E}}function Zc(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function lh(){var n=$a;return $a<<=1,($a&4194240)===0&&($a=64),n}function Jc(n){for(var s=[],i=0;31>i;i++)s.push(n);return s}function bi(n,s,i){n.pendingLanes|=s,s!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,s=31-Un(s),n[s]=i}function r1(n,s){var i=n.pendingLanes&~s;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=s,n.mutableReadLanes&=s,n.entangledLanes&=s,s=n.entanglements;var l=n.eventTimes;for(n=n.expirationTimes;0<i;){var h=31-Un(i),m=1<<h;s[h]=0,l[h]=-1,n[h]=-1,i&=~m}}function Yc(n,s){var i=n.entangledLanes|=s;for(n=n.entanglements;i;){var l=31-Un(i),h=1<<l;h&s|n[l]&s&&(n[l]|=s),i&=~h}}var qe=0;function ch(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var uh,Xc,dh,fh,ph,eu=!1,La=[],Wr=null,Hr=null,qr=null,Si=new Map,ki=new Map,Kr=[],s1="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 hh(n,s){switch(n){case"focusin":case"focusout":Wr=null;break;case"dragenter":case"dragleave":Hr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":Si.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(s.pointerId)}}function _i(n,s,i,l,h,m){return n===null||n.nativeEvent!==m?(n={blockedOn:s,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[h]},s!==null&&(s=Li(s),s!==null&&Xc(s)),n):(n.eventSystemFlags|=l,s=n.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),n)}function o1(n,s,i,l,h){switch(s){case"focusin":return Wr=_i(Wr,n,s,i,l,h),!0;case"dragenter":return Hr=_i(Hr,n,s,i,l,h),!0;case"mouseover":return qr=_i(qr,n,s,i,l,h),!0;case"pointerover":var m=h.pointerId;return Si.set(m,_i(Si.get(m)||null,n,s,i,l,h)),!0;case"gotpointercapture":return m=h.pointerId,ki.set(m,_i(ki.get(m)||null,n,s,i,l,h)),!0}return!1}function mh(n){var s=Os(n.target);if(s!==null){var i=Es(s);if(i!==null){if(s=i.tag,s===13){if(s=eh(i),s!==null){n.blockedOn=s,ph(n.priority,function(){dh(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function za(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var i=nu(n.domEventName,n.eventSystemFlags,s[0],n.nativeEvent);if(i===null){i=n.nativeEvent;var l=new i.constructor(i.type,i);ht=l,i.target.dispatchEvent(l),ht=null}else return s=Li(i),s!==null&&Xc(s),n.blockedOn=i,!1;s.shift()}return!0}function gh(n,s,i){za(n)&&i.delete(s)}function i1(){eu=!1,Wr!==null&&za(Wr)&&(Wr=null),Hr!==null&&za(Hr)&&(Hr=null),qr!==null&&za(qr)&&(qr=null),Si.forEach(gh),ki.forEach(gh)}function Ci(n,s){n.blockedOn===s&&(n.blockedOn=null,eu||(eu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,i1)))}function Ni(n){function s(h){return Ci(h,n)}if(0<La.length){Ci(La[0],n);for(var i=1;i<La.length;i++){var l=La[i];l.blockedOn===n&&(l.blockedOn=null)}}for(Wr!==null&&Ci(Wr,n),Hr!==null&&Ci(Hr,n),qr!==null&&Ci(qr,n),Si.forEach(s),ki.forEach(s),i=0;i<Kr.length;i++)l=Kr[i],l.blockedOn===n&&(l.blockedOn=null);for(;0<Kr.length&&(i=Kr[0],i.blockedOn===null);)mh(i),i.blockedOn===null&&Kr.shift()}var go=j.ReactCurrentBatchConfig,Fa=!0;function a1(n,s,i,l){var h=qe,m=go.transition;go.transition=null;try{qe=1,tu(n,s,i,l)}finally{qe=h,go.transition=m}}function l1(n,s,i,l){var h=qe,m=go.transition;go.transition=null;try{qe=4,tu(n,s,i,l)}finally{qe=h,go.transition=m}}function tu(n,s,i,l){if(Fa){var h=nu(n,s,i,l);if(h===null)wu(n,s,l,Ua,i),hh(n,l);else if(o1(h,n,s,i,l))l.stopPropagation();else if(hh(n,l),s&4&&-1<s1.indexOf(n)){for(;h!==null;){var m=Li(h);if(m!==null&&uh(m),m=nu(n,s,i,l),m===null&&wu(n,s,l,Ua,i),m===h)break;h=m}h!==null&&l.stopPropagation()}else wu(n,s,l,null,i)}}var Ua=null;function nu(n,s,i,l){if(Ua=null,n=ct(l),n=Os(n),n!==null)if(s=Es(n),s===null)n=null;else if(i=s.tag,i===13){if(n=eh(s),n!==null)return n;n=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null);return Ua=n,null}function yh(n){switch(n){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(Gb()){case Gc:return 1;case ih:return 4;case Aa:case Zb:return 16;case ah:return 536870912;default:return 16}default:return 16}}var Qr=null,ru=null,Va=null;function vh(){if(Va)return Va;var n,s=ru,i=s.length,l,h="value"in Qr?Qr.value:Qr.textContent,m=h.length;for(n=0;n<i&&s[n]===h[n];n++);var b=i-n;for(l=1;l<=b&&s[i-l]===h[m-l];l++);return Va=h.slice(n,1<l?1-l:void 0)}function Ba(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function Wa(){return!0}function wh(){return!1}function gn(n){function s(i,l,h,m,b){this._reactName=i,this._targetInst=h,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var E in n)n.hasOwnProperty(E)&&(i=n[E],this[E]=i?i(m):m[E]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Wa:wh,this.isPropagationStopped=wh,this}return D(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Wa)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Wa)},persist:function(){},isPersistent:Wa}),s}var yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},su=gn(yo),Ei=D({},yo,{view:0,detail:0}),c1=gn(Ei),ou,iu,Oi,Ha=D({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Oi&&(Oi&&n.type==="mousemove"?(ou=n.screenX-Oi.screenX,iu=n.screenY-Oi.screenY):iu=ou=0,Oi=n),ou)},movementY:function(n){return"movementY"in n?n.movementY:iu}}),xh=gn(Ha),u1=D({},Ha,{dataTransfer:0}),d1=gn(u1),f1=D({},Ei,{relatedTarget:0}),au=gn(f1),p1=D({},yo,{animationName:0,elapsedTime:0,pseudoElement:0}),h1=gn(p1),m1=D({},yo,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),g1=gn(m1),y1=D({},yo,{data:0}),bh=gn(y1),v1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={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"},x1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b1(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=x1[n])?!!s[n]:!1}function lu(){return b1}var S1=D({},Ei,{key:function(n){if(n.key){var s=v1[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=Ba(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?w1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lu,charCode:function(n){return n.type==="keypress"?Ba(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ba(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),k1=gn(S1),_1=D({},Ha,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=gn(_1),C1=D({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lu}),N1=gn(C1),E1=D({},yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),O1=gn(E1),P1=D({},Ha,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),j1=gn(P1),T1=[9,13,27,32],cu=p&&"CompositionEvent"in window,Pi=null;p&&"documentMode"in document&&(Pi=document.documentMode);var R1=p&&"TextEvent"in window&&!Pi,kh=p&&(!cu||Pi&&8<Pi&&11>=Pi),_h=" ",Ch=!1;function Nh(n,s){switch(n){case"keyup":return T1.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var vo=!1;function A1(n,s){switch(n){case"compositionend":return Eh(s);case"keypress":return s.which!==32?null:(Ch=!0,_h);case"textInput":return n=s.data,n===_h&&Ch?null:n;default:return null}}function M1(n,s){if(vo)return n==="compositionend"||!cu&&Nh(n,s)?(n=vh(),Va=ru=Qr=null,vo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return kh&&s.locale!=="ko"?null:s.data;default:return null}}var $1={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 Oh(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!$1[n.type]:s==="textarea"}function Ph(n,s,i,l){Ie(l),s=Za(s,"onChange"),0<s.length&&(i=new su("onChange","change",null,i,l),n.push({event:i,listeners:s}))}var ji=null,Ti=null;function I1(n){Kh(n,0)}function qa(n){var s=ko(n);if(pt(s))return n}function D1(n,s){if(n==="change")return s}var jh=!1;if(p){var uu;if(p){var du="oninput"in document;if(!du){var Th=document.createElement("div");Th.setAttribute("oninput","return;"),du=typeof Th.oninput=="function"}uu=du}else uu=!1;jh=uu&&(!document.documentMode||9<document.documentMode)}function Rh(){ji&&(ji.detachEvent("onpropertychange",Ah),Ti=ji=null)}function Ah(n){if(n.propertyName==="value"&&qa(Ti)){var s=[];Ph(s,Ti,n,ct(n)),mt(I1,s)}}function L1(n,s,i){n==="focusin"?(Rh(),ji=s,Ti=i,ji.attachEvent("onpropertychange",Ah)):n==="focusout"&&Rh()}function z1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return qa(Ti)}function F1(n,s){if(n==="click")return qa(s)}function U1(n,s){if(n==="input"||n==="change")return qa(s)}function V1(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var Vn=typeof Object.is=="function"?Object.is:V1;function Ri(n,s){if(Vn(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var i=Object.keys(n),l=Object.keys(s);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var h=i[l];if(!g.call(s,h)||!Vn(n[h],s[h]))return!1}return!0}function Mh(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $h(n,s){var i=Mh(n);n=0;for(var l;i;){if(i.nodeType===3){if(l=n+i.textContent.length,n<=s&&l>=s)return{node:i,offset:s-n};n=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Mh(i)}}function Ih(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?Ih(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function Dh(){for(var n=window,s=lt();s instanceof n.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)n=s.contentWindow;else break;s=lt(n.document)}return s}function fu(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}function B1(n){var s=Dh(),i=n.focusedElem,l=n.selectionRange;if(s!==i&&i&&i.ownerDocument&&Ih(i.ownerDocument.documentElement,i)){if(l!==null&&fu(i)){if(s=l.start,n=l.end,n===void 0&&(n=s),"selectionStart"in i)i.selectionStart=s,i.selectionEnd=Math.min(n,i.value.length);else if(n=(s=i.ownerDocument||document)&&s.defaultView||window,n.getSelection){n=n.getSelection();var h=i.textContent.length,m=Math.min(l.start,h);l=l.end===void 0?m:Math.min(l.end,h),!n.extend&&m>l&&(h=l,l=m,m=h),h=$h(i,m);var b=$h(i,l);h&&b&&(n.rangeCount!==1||n.anchorNode!==h.node||n.anchorOffset!==h.offset||n.focusNode!==b.node||n.focusOffset!==b.offset)&&(s=s.createRange(),s.setStart(h.node,h.offset),n.removeAllRanges(),m>l?(n.addRange(s),n.extend(b.node,b.offset)):(s.setEnd(b.node,b.offset),n.addRange(s)))}}for(s=[],n=i;n=n.parentNode;)n.nodeType===1&&s.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<s.length;i++)n=s[i],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var W1=p&&"documentMode"in document&&11>=document.documentMode,wo=null,pu=null,Ai=null,hu=!1;function Lh(n,s,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;hu||wo==null||wo!==lt(l)||(l=wo,"selectionStart"in l&&fu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ai&&Ri(Ai,l)||(Ai=l,l=Za(pu,"onSelect"),0<l.length&&(s=new su("onSelect","select",null,s,i),n.push({event:s,listeners:l}),s.target=wo)))}function Ka(n,s){var i={};return i[n.toLowerCase()]=s.toLowerCase(),i["Webkit"+n]="webkit"+s,i["Moz"+n]="moz"+s,i}var xo={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionend:Ka("Transition","TransitionEnd")},mu={},zh={};p&&(zh=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Qa(n){if(mu[n])return mu[n];if(!xo[n])return n;var s=xo[n],i;for(i in s)if(s.hasOwnProperty(i)&&i in zh)return mu[n]=s[i];return n}var Fh=Qa("animationend"),Uh=Qa("animationiteration"),Vh=Qa("animationstart"),Bh=Qa("transitionend"),Wh=new Map,Hh="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 Gr(n,s){Wh.set(n,s),c(s,[n])}for(var gu=0;gu<Hh.length;gu++){var yu=Hh[gu],H1=yu.toLowerCase(),q1=yu[0].toUpperCase()+yu.slice(1);Gr(H1,"on"+q1)}Gr(Fh,"onAnimationEnd"),Gr(Uh,"onAnimationIteration"),Gr(Vh,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(Bh,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mi="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(" "),K1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mi));function qh(n,s,i){var l=n.type||"unknown-event";n.currentTarget=i,Hb(l,s,void 0,n),n.currentTarget=null}function Kh(n,s){s=(s&4)!==0;for(var i=0;i<n.length;i++){var l=n[i],h=l.event;l=l.listeners;e:{var m=void 0;if(s)for(var b=l.length-1;0<=b;b--){var E=l[b],T=E.instance,W=E.currentTarget;if(E=E.listener,T!==m&&h.isPropagationStopped())break e;qh(h,E,W),m=T}else for(b=0;b<l.length;b++){if(E=l[b],T=E.instance,W=E.currentTarget,E=E.listener,T!==m&&h.isPropagationStopped())break e;qh(h,E,W),m=T}}}if(wi)throw n=Qc,wi=!1,Qc=null,n}function Ye(n,s){var i=s[Cu];i===void 0&&(i=s[Cu]=new Set);var l=n+"__bubble";i.has(l)||(Qh(s,n,2,!1),i.add(l))}function vu(n,s,i){var l=0;s&&(l|=4),Qh(i,n,l,s)}var Ga="_reactListening"+Math.random().toString(36).slice(2);function $i(n){if(!n[Ga]){n[Ga]=!0,o.forEach(function(i){i!=="selectionchange"&&(K1.has(i)||vu(i,!1,n),vu(i,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Ga]||(s[Ga]=!0,vu("selectionchange",!1,s))}}function Qh(n,s,i,l){switch(yh(s)){case 1:var h=a1;break;case 4:h=l1;break;default:h=tu}i=h.bind(null,s,i,n),h=void 0,!Vr||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),l?h!==void 0?n.addEventListener(s,i,{capture:!0,passive:h}):n.addEventListener(s,i,!0):h!==void 0?n.addEventListener(s,i,{passive:h}):n.addEventListener(s,i,!1)}function wu(n,s,i,l,h){var m=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var E=l.stateNode.containerInfo;if(E===h||E.nodeType===8&&E.parentNode===h)break;if(b===4)for(b=l.return;b!==null;){var T=b.tag;if((T===3||T===4)&&(T=b.stateNode.containerInfo,T===h||T.nodeType===8&&T.parentNode===h))return;b=b.return}for(;E!==null;){if(b=Os(E),b===null)return;if(T=b.tag,T===5||T===6){l=m=b;continue e}E=E.parentNode}}l=l.return}mt(function(){var W=m,ne=ct(i),se=[];e:{var te=Wh.get(n);if(te!==void 0){var ye=su,Se=n;switch(n){case"keypress":if(Ba(i)===0)break e;case"keydown":case"keyup":ye=k1;break;case"focusin":Se="focus",ye=au;break;case"focusout":Se="blur",ye=au;break;case"beforeblur":case"afterblur":ye=au;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=xh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=d1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=N1;break;case Fh:case Uh:case Vh:ye=h1;break;case Bh:ye=O1;break;case"scroll":ye=c1;break;case"wheel":ye=j1;break;case"copy":case"cut":case"paste":ye=g1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Sh}var Ne=(s&4)!==0,ft=!Ne&&n==="scroll",U=Ne?te!==null?te+"Capture":null:te;Ne=[];for(var $=W,B;$!==null;){B=$;var ae=B.stateNode;if(B.tag===5&&ae!==null&&(B=ae,U!==null&&(ae=Ot($,U),ae!=null&&Ne.push(Ii($,ae,B)))),ft)break;$=$.return}0<Ne.length&&(te=new ye(te,Se,null,i,ne),se.push({event:te,listeners:Ne}))}}if((s&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ye=n==="mouseout"||n==="pointerout",te&&i!==ht&&(Se=i.relatedTarget||i.fromElement)&&(Os(Se)||Se[_r]))break e;if((ye||te)&&(te=ne.window===ne?ne:(te=ne.ownerDocument)?te.defaultView||te.parentWindow:window,ye?(Se=i.relatedTarget||i.toElement,ye=W,Se=Se?Os(Se):null,Se!==null&&(ft=Es(Se),Se!==ft||Se.tag!==5&&Se.tag!==6)&&(Se=null)):(ye=null,Se=W),ye!==Se)){if(Ne=xh,ae="onMouseLeave",U="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ne=Sh,ae="onPointerLeave",U="onPointerEnter",$="pointer"),ft=ye==null?te:ko(ye),B=Se==null?te:ko(Se),te=new Ne(ae,$+"leave",ye,i,ne),te.target=ft,te.relatedTarget=B,ae=null,Os(ne)===W&&(Ne=new Ne(U,$+"enter",Se,i,ne),Ne.target=B,Ne.relatedTarget=ft,ae=Ne),ft=ae,ye&&Se)t:{for(Ne=ye,U=Se,$=0,B=Ne;B;B=bo(B))$++;for(B=0,ae=U;ae;ae=bo(ae))B++;for(;0<$-B;)Ne=bo(Ne),$--;for(;0<B-$;)U=bo(U),B--;for(;$--;){if(Ne===U||U!==null&&Ne===U.alternate)break t;Ne=bo(Ne),U=bo(U)}Ne=null}else Ne=null;ye!==null&&Gh(se,te,ye,Ne,!1),Se!==null&&ft!==null&&Gh(se,ft,Se,Ne,!0)}}e:{if(te=W?ko(W):window,ye=te.nodeName&&te.nodeName.toLowerCase(),ye==="select"||ye==="input"&&te.type==="file")var Ee=D1;else if(Oh(te))if(jh)Ee=U1;else{Ee=z1;var Pe=L1}else(ye=te.nodeName)&&ye.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(Ee=F1);if(Ee&&(Ee=Ee(n,W))){Ph(se,Ee,i,ne);break e}Pe&&Pe(n,te,W),n==="focusout"&&(Pe=te._wrapperState)&&Pe.controlled&&te.type==="number"&&nt(te,"number",te.value)}switch(Pe=W?ko(W):window,n){case"focusin":(Oh(Pe)||Pe.contentEditable==="true")&&(wo=Pe,pu=W,Ai=null);break;case"focusout":Ai=pu=wo=null;break;case"mousedown":hu=!0;break;case"contextmenu":case"mouseup":case"dragend":hu=!1,Lh(se,i,ne);break;case"selectionchange":if(W1)break;case"keydown":case"keyup":Lh(se,i,ne)}var je;if(cu)e:{switch(n){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else vo?Nh(n,i)&&(Me="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Me="onCompositionStart");Me&&(kh&&i.locale!=="ko"&&(vo||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&vo&&(je=vh()):(Qr=ne,ru="value"in Qr?Qr.value:Qr.textContent,vo=!0)),Pe=Za(W,Me),0<Pe.length&&(Me=new bh(Me,n,null,i,ne),se.push({event:Me,listeners:Pe}),je?Me.data=je:(je=Eh(i),je!==null&&(Me.data=je)))),(je=R1?A1(n,i):M1(n,i))&&(W=Za(W,"onBeforeInput"),0<W.length&&(ne=new bh("onBeforeInput","beforeinput",null,i,ne),se.push({event:ne,listeners:W}),ne.data=je))}Kh(se,s)})}function Ii(n,s,i){return{instance:n,listener:s,currentTarget:i}}function Za(n,s){for(var i=s+"Capture",l=[];n!==null;){var h=n,m=h.stateNode;h.tag===5&&m!==null&&(h=m,m=Ot(n,i),m!=null&&l.unshift(Ii(n,m,h)),m=Ot(n,s),m!=null&&l.push(Ii(n,m,h))),n=n.return}return l}function bo(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Gh(n,s,i,l,h){for(var m=s._reactName,b=[];i!==null&&i!==l;){var E=i,T=E.alternate,W=E.stateNode;if(T!==null&&T===l)break;E.tag===5&&W!==null&&(E=W,h?(T=Ot(i,m),T!=null&&b.unshift(Ii(i,T,E))):h||(T=Ot(i,m),T!=null&&b.push(Ii(i,T,E)))),i=i.return}b.length!==0&&n.push({event:s,listeners:b})}var Q1=/\r\n?/g,G1=/\u0000|\uFFFD/g;function Zh(n){return(typeof n=="string"?n:""+n).replace(Q1,`
39
+ `).replace(G1,"")}function Ja(n,s,i){if(s=Zh(s),Zh(n)!==s&&i)throw Error(r(425))}function Ya(){}var xu=null,bu=null;function Su(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var ku=typeof setTimeout=="function"?setTimeout:void 0,Z1=typeof clearTimeout=="function"?clearTimeout:void 0,Jh=typeof Promise=="function"?Promise:void 0,J1=typeof queueMicrotask=="function"?queueMicrotask:typeof Jh<"u"?function(n){return Jh.resolve(null).then(n).catch(Y1)}:ku;function Y1(n){setTimeout(function(){throw n})}function _u(n,s){var i=s,l=0;do{var h=i.nextSibling;if(n.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"){if(l===0){n.removeChild(h),Ni(s);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=h}while(i);Ni(s)}function Zr(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return n}function Yh(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"){if(s===0)return n;s--}else i==="/$"&&s++}n=n.previousSibling}return null}var So=Math.random().toString(36).slice(2),lr="__reactFiber$"+So,Di="__reactProps$"+So,_r="__reactContainer$"+So,Cu="__reactEvents$"+So,X1="__reactListeners$"+So,eS="__reactHandles$"+So;function Os(n){var s=n[lr];if(s)return s;for(var i=n.parentNode;i;){if(s=i[_r]||i[lr]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(n=Yh(n);n!==null;){if(i=n[lr])return i;n=Yh(n)}return s}n=i,i=n.parentNode}return null}function Li(n){return n=n[lr]||n[_r],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function ko(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function Xa(n){return n[Di]||null}var Nu=[],_o=-1;function Jr(n){return{current:n}}function Xe(n){0>_o||(n.current=Nu[_o],Nu[_o]=null,_o--)}function Ke(n,s){_o++,Nu[_o]=n.current,n.current=s}var Yr={},Dt=Jr(Yr),rn=Jr(!1),Ps=Yr;function Co(n,s){var i=n.type.contextTypes;if(!i)return Yr;var l=n.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===s)return l.__reactInternalMemoizedMaskedChildContext;var h={},m;for(m in i)h[m]=s[m];return l&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=s,n.__reactInternalMemoizedMaskedChildContext=h),h}function sn(n){return n=n.childContextTypes,n!=null}function el(){Xe(rn),Xe(Dt)}function Xh(n,s,i){if(Dt.current!==Yr)throw Error(r(168));Ke(Dt,s),Ke(rn,i)}function em(n,s,i){var l=n.stateNode;if(s=s.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var h in l)if(!(h in s))throw Error(r(108,we(n)||"Unknown",h));return D({},i,l)}function tl(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Yr,Ps=Dt.current,Ke(Dt,n),Ke(rn,rn.current),!0}function tm(n,s,i){var l=n.stateNode;if(!l)throw Error(r(169));i?(n=em(n,s,Ps),l.__reactInternalMemoizedMergedChildContext=n,Xe(rn),Xe(Dt),Ke(Dt,n)):Xe(rn),Ke(rn,i)}var Cr=null,nl=!1,Eu=!1;function nm(n){Cr===null?Cr=[n]:Cr.push(n)}function tS(n){nl=!0,nm(n)}function Xr(){if(!Eu&&Cr!==null){Eu=!0;var n=0,s=qe;try{var i=Cr;for(qe=1;n<i.length;n++){var l=i[n];do l=l(!0);while(l!==null)}Cr=null,nl=!1}catch(h){throw Cr!==null&&(Cr=Cr.slice(n+1)),sh(Gc,Xr),h}finally{qe=s,Eu=!1}}return null}var No=[],Eo=0,rl=null,sl=0,En=[],On=0,js=null,Nr=1,Er="";function Ts(n,s){No[Eo++]=sl,No[Eo++]=rl,rl=n,sl=s}function rm(n,s,i){En[On++]=Nr,En[On++]=Er,En[On++]=js,js=n;var l=Nr;n=Er;var h=32-Un(l)-1;l&=~(1<<h),i+=1;var m=32-Un(s)+h;if(30<m){var b=h-h%5;m=(l&(1<<b)-1).toString(32),l>>=b,h-=b,Nr=1<<32-Un(s)+h|i<<h|l,Er=m+n}else Nr=1<<m|i<<h|l,Er=n}function Ou(n){n.return!==null&&(Ts(n,1),rm(n,1,0))}function Pu(n){for(;n===rl;)rl=No[--Eo],No[Eo]=null,sl=No[--Eo],No[Eo]=null;for(;n===js;)js=En[--On],En[On]=null,Er=En[--On],En[On]=null,Nr=En[--On],En[On]=null}var yn=null,vn=null,tt=!1,Bn=null;function sm(n,s){var i=Rn(5,null,null,0);i.elementType="DELETED",i.stateNode=s,i.return=n,s=n.deletions,s===null?(n.deletions=[i],n.flags|=16):s.push(i)}function om(n,s){switch(n.tag){case 5:var i=n.type;return s=s.nodeType!==1||i.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(n.stateNode=s,yn=n,vn=Zr(s.firstChild),!0):!1;case 6:return s=n.pendingProps===""||s.nodeType!==3?null:s,s!==null?(n.stateNode=s,yn=n,vn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(i=js!==null?{id:Nr,overflow:Er}:null,n.memoizedState={dehydrated:s,treeContext:i,retryLane:1073741824},i=Rn(18,null,null,0),i.stateNode=s,i.return=n,n.child=i,yn=n,vn=null,!0):!1;default:return!1}}function ju(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Tu(n){if(tt){var s=vn;if(s){var i=s;if(!om(n,s)){if(ju(n))throw Error(r(418));s=Zr(i.nextSibling);var l=yn;s&&om(n,s)?sm(l,i):(n.flags=n.flags&-4097|2,tt=!1,yn=n)}}else{if(ju(n))throw Error(r(418));n.flags=n.flags&-4097|2,tt=!1,yn=n}}}function im(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;yn=n}function ol(n){if(n!==yn)return!1;if(!tt)return im(n),tt=!0,!1;var s;if((s=n.tag!==3)&&!(s=n.tag!==5)&&(s=n.type,s=s!=="head"&&s!=="body"&&!Su(n.type,n.memoizedProps)),s&&(s=vn)){if(ju(n))throw am(),Error(r(418));for(;s;)sm(n,s),s=Zr(s.nextSibling)}if(im(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"){if(s===0){vn=Zr(n.nextSibling);break e}s--}else i!=="$"&&i!=="$!"&&i!=="$?"||s++}n=n.nextSibling}vn=null}}else vn=yn?Zr(n.stateNode.nextSibling):null;return!0}function am(){for(var n=vn;n;)n=Zr(n.nextSibling)}function Oo(){vn=yn=null,tt=!1}function Ru(n){Bn===null?Bn=[n]:Bn.push(n)}var nS=j.ReactCurrentBatchConfig;function zi(n,s,i){if(n=i.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var l=i.stateNode}if(!l)throw Error(r(147,n));var h=l,m=""+n;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===m?s.ref:(s=function(b){var E=h.refs;b===null?delete E[m]:E[m]=b},s._stringRef=m,s)}if(typeof n!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,n))}return n}function il(n,s){throw n=Object.prototype.toString.call(s),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n))}function lm(n){var s=n._init;return s(n._payload)}function cm(n){function s(U,$){if(n){var B=U.deletions;B===null?(U.deletions=[$],U.flags|=16):B.push($)}}function i(U,$){if(!n)return null;for(;$!==null;)s(U,$),$=$.sibling;return null}function l(U,$){for(U=new Map;$!==null;)$.key!==null?U.set($.key,$):U.set($.index,$),$=$.sibling;return U}function h(U,$){return U=as(U,$),U.index=0,U.sibling=null,U}function m(U,$,B){return U.index=B,n?(B=U.alternate,B!==null?(B=B.index,B<$?(U.flags|=2,$):B):(U.flags|=2,$)):(U.flags|=1048576,$)}function b(U){return n&&U.alternate===null&&(U.flags|=2),U}function E(U,$,B,ae){return $===null||$.tag!==6?($=kd(B,U.mode,ae),$.return=U,$):($=h($,B),$.return=U,$)}function T(U,$,B,ae){var Ee=B.type;return Ee===A?ne(U,$,B.props.children,ae,B.key):$!==null&&($.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===X&&lm(Ee)===$.type)?(ae=h($,B.props),ae.ref=zi(U,$,B),ae.return=U,ae):(ae=jl(B.type,B.key,B.props,null,U.mode,ae),ae.ref=zi(U,$,B),ae.return=U,ae)}function W(U,$,B,ae){return $===null||$.tag!==4||$.stateNode.containerInfo!==B.containerInfo||$.stateNode.implementation!==B.implementation?($=_d(B,U.mode,ae),$.return=U,$):($=h($,B.children||[]),$.return=U,$)}function ne(U,$,B,ae,Ee){return $===null||$.tag!==7?($=zs(B,U.mode,ae,Ee),$.return=U,$):($=h($,B),$.return=U,$)}function se(U,$,B){if(typeof $=="string"&&$!==""||typeof $=="number")return $=kd(""+$,U.mode,B),$.return=U,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case G:return B=jl($.type,$.key,$.props,null,U.mode,B),B.ref=zi(U,null,$),B.return=U,B;case K:return $=_d($,U.mode,B),$.return=U,$;case X:var ae=$._init;return se(U,ae($._payload),B)}if(Ln($)||H($))return $=zs($,U.mode,B,null),$.return=U,$;il(U,$)}return null}function te(U,$,B,ae){var Ee=$!==null?$.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return Ee!==null?null:E(U,$,""+B,ae);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case G:return B.key===Ee?T(U,$,B,ae):null;case K:return B.key===Ee?W(U,$,B,ae):null;case X:return Ee=B._init,te(U,$,Ee(B._payload),ae)}if(Ln(B)||H(B))return Ee!==null?null:ne(U,$,B,ae,null);il(U,B)}return null}function ye(U,$,B,ae,Ee){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return U=U.get(B)||null,E($,U,""+ae,Ee);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case G:return U=U.get(ae.key===null?B:ae.key)||null,T($,U,ae,Ee);case K:return U=U.get(ae.key===null?B:ae.key)||null,W($,U,ae,Ee);case X:var Pe=ae._init;return ye(U,$,B,Pe(ae._payload),Ee)}if(Ln(ae)||H(ae))return U=U.get(B)||null,ne($,U,ae,Ee,null);il($,ae)}return null}function Se(U,$,B,ae){for(var Ee=null,Pe=null,je=$,Me=$=0,Tt=null;je!==null&&Me<B.length;Me++){je.index>Me?(Tt=je,je=null):Tt=je.sibling;var We=te(U,je,B[Me],ae);if(We===null){je===null&&(je=Tt);break}n&&je&&We.alternate===null&&s(U,je),$=m(We,$,Me),Pe===null?Ee=We:Pe.sibling=We,Pe=We,je=Tt}if(Me===B.length)return i(U,je),tt&&Ts(U,Me),Ee;if(je===null){for(;Me<B.length;Me++)je=se(U,B[Me],ae),je!==null&&($=m(je,$,Me),Pe===null?Ee=je:Pe.sibling=je,Pe=je);return tt&&Ts(U,Me),Ee}for(je=l(U,je);Me<B.length;Me++)Tt=ye(je,U,Me,B[Me],ae),Tt!==null&&(n&&Tt.alternate!==null&&je.delete(Tt.key===null?Me:Tt.key),$=m(Tt,$,Me),Pe===null?Ee=Tt:Pe.sibling=Tt,Pe=Tt);return n&&je.forEach(function(ls){return s(U,ls)}),tt&&Ts(U,Me),Ee}function Ne(U,$,B,ae){var Ee=H(B);if(typeof Ee!="function")throw Error(r(150));if(B=Ee.call(B),B==null)throw Error(r(151));for(var Pe=Ee=null,je=$,Me=$=0,Tt=null,We=B.next();je!==null&&!We.done;Me++,We=B.next()){je.index>Me?(Tt=je,je=null):Tt=je.sibling;var ls=te(U,je,We.value,ae);if(ls===null){je===null&&(je=Tt);break}n&&je&&ls.alternate===null&&s(U,je),$=m(ls,$,Me),Pe===null?Ee=ls:Pe.sibling=ls,Pe=ls,je=Tt}if(We.done)return i(U,je),tt&&Ts(U,Me),Ee;if(je===null){for(;!We.done;Me++,We=B.next())We=se(U,We.value,ae),We!==null&&($=m(We,$,Me),Pe===null?Ee=We:Pe.sibling=We,Pe=We);return tt&&Ts(U,Me),Ee}for(je=l(U,je);!We.done;Me++,We=B.next())We=ye(je,U,Me,We.value,ae),We!==null&&(n&&We.alternate!==null&&je.delete(We.key===null?Me:We.key),$=m(We,$,Me),Pe===null?Ee=We:Pe.sibling=We,Pe=We);return n&&je.forEach(function($S){return s(U,$S)}),tt&&Ts(U,Me),Ee}function ft(U,$,B,ae){if(typeof B=="object"&&B!==null&&B.type===A&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case G:e:{for(var Ee=B.key,Pe=$;Pe!==null;){if(Pe.key===Ee){if(Ee=B.type,Ee===A){if(Pe.tag===7){i(U,Pe.sibling),$=h(Pe,B.props.children),$.return=U,U=$;break e}}else if(Pe.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===X&&lm(Ee)===Pe.type){i(U,Pe.sibling),$=h(Pe,B.props),$.ref=zi(U,Pe,B),$.return=U,U=$;break e}i(U,Pe);break}else s(U,Pe);Pe=Pe.sibling}B.type===A?($=zs(B.props.children,U.mode,ae,B.key),$.return=U,U=$):(ae=jl(B.type,B.key,B.props,null,U.mode,ae),ae.ref=zi(U,$,B),ae.return=U,U=ae)}return b(U);case K:e:{for(Pe=B.key;$!==null;){if($.key===Pe)if($.tag===4&&$.stateNode.containerInfo===B.containerInfo&&$.stateNode.implementation===B.implementation){i(U,$.sibling),$=h($,B.children||[]),$.return=U,U=$;break e}else{i(U,$);break}else s(U,$);$=$.sibling}$=_d(B,U.mode,ae),$.return=U,U=$}return b(U);case X:return Pe=B._init,ft(U,$,Pe(B._payload),ae)}if(Ln(B))return Se(U,$,B,ae);if(H(B))return Ne(U,$,B,ae);il(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,$!==null&&$.tag===6?(i(U,$.sibling),$=h($,B),$.return=U,U=$):(i(U,$),$=kd(B,U.mode,ae),$.return=U,U=$),b(U)):i(U,$)}return ft}var Po=cm(!0),um=cm(!1),al=Jr(null),ll=null,jo=null,Au=null;function Mu(){Au=jo=ll=null}function $u(n){var s=al.current;Xe(al),n._currentValue=s}function Iu(n,s,i){for(;n!==null;){var l=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),n===i)break;n=n.return}}function To(n,s){ll=n,Au=jo=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&s)!==0&&(on=!0),n.firstContext=null)}function Pn(n){var s=n._currentValue;if(Au!==n)if(n={context:n,memoizedValue:s,next:null},jo===null){if(ll===null)throw Error(r(308));jo=n,ll.dependencies={lanes:0,firstContext:n}}else jo=jo.next=n;return s}var Rs=null;function Du(n){Rs===null?Rs=[n]:Rs.push(n)}function dm(n,s,i,l){var h=s.interleaved;return h===null?(i.next=i,Du(s)):(i.next=h.next,h.next=i),s.interleaved=i,Or(n,l)}function Or(n,s){n.lanes|=s;var i=n.alternate;for(i!==null&&(i.lanes|=s),i=n,n=n.return;n!==null;)n.childLanes|=s,i=n.alternate,i!==null&&(i.childLanes|=s),i=n,n=n.return;return i.tag===3?i.stateNode:null}var es=!1;function Lu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fm(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Pr(n,s){return{eventTime:n,lane:s,tag:0,payload:null,callback:null,next:null}}function ts(n,s,i){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var h=l.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),l.pending=s,Or(n,i)}return h=l.interleaved,h===null?(s.next=s,Du(l)):(s.next=h.next,h.next=s),l.interleaved=s,Or(n,i)}function cl(n,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194240)!==0)){var l=s.lanes;l&=n.pendingLanes,i|=l,s.lanes=i,Yc(n,i)}}function pm(n,s){var i=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var h=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var b={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};m===null?h=m=b:m=m.next=b,i=i.next}while(i!==null);m===null?h=m=s:m=m.next=s}else h=m=s;i={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:m,shared:l.shared,effects:l.effects},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=s:n.next=s,i.lastBaseUpdate=s}function ul(n,s,i,l){var h=n.updateQueue;es=!1;var m=h.firstBaseUpdate,b=h.lastBaseUpdate,E=h.shared.pending;if(E!==null){h.shared.pending=null;var T=E,W=T.next;T.next=null,b===null?m=W:b.next=W,b=T;var ne=n.alternate;ne!==null&&(ne=ne.updateQueue,E=ne.lastBaseUpdate,E!==b&&(E===null?ne.firstBaseUpdate=W:E.next=W,ne.lastBaseUpdate=T))}if(m!==null){var se=h.baseState;b=0,ne=W=T=null,E=m;do{var te=E.lane,ye=E.eventTime;if((l&te)===te){ne!==null&&(ne=ne.next={eventTime:ye,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var Se=n,Ne=E;switch(te=s,ye=i,Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){se=Se.call(ye,se,te);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,te=typeof Se=="function"?Se.call(ye,se,te):Se,te==null)break e;se=D({},se,te);break e;case 2:es=!0}}E.callback!==null&&E.lane!==0&&(n.flags|=64,te=h.effects,te===null?h.effects=[E]:te.push(E))}else ye={eventTime:ye,lane:te,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ne===null?(W=ne=ye,T=se):ne=ne.next=ye,b|=te;if(E=E.next,E===null){if(E=h.shared.pending,E===null)break;te=E,E=te.next,te.next=null,h.lastBaseUpdate=te,h.shared.pending=null}}while(!0);if(ne===null&&(T=se),h.baseState=T,h.firstBaseUpdate=W,h.lastBaseUpdate=ne,s=h.shared.interleaved,s!==null){h=s;do b|=h.lane,h=h.next;while(h!==s)}else m===null&&(h.shared.lanes=0);$s|=b,n.lanes=b,n.memoizedState=se}}function hm(n,s,i){if(n=s.effects,s.effects=null,n!==null)for(s=0;s<n.length;s++){var l=n[s],h=l.callback;if(h!==null){if(l.callback=null,l=i,typeof h!="function")throw Error(r(191,h));h.call(l)}}}var Fi={},cr=Jr(Fi),Ui=Jr(Fi),Vi=Jr(Fi);function As(n){if(n===Fi)throw Error(r(174));return n}function zu(n,s){switch(Ke(Vi,s),Ke(Ui,n),Ke(cr,Fi),n=s.nodeType,n){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:or(null,"");break;default:n=n===8?s.parentNode:s,s=n.namespaceURI||null,n=n.tagName,s=or(s,n)}Xe(cr),Ke(cr,s)}function Ro(){Xe(cr),Xe(Ui),Xe(Vi)}function mm(n){As(Vi.current);var s=As(cr.current),i=or(s,n.type);s!==i&&(Ke(Ui,n),Ke(cr,i))}function Fu(n){Ui.current===n&&(Xe(cr),Xe(Ui))}var rt=Jr(0);function dl(n){for(var s=n;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Uu=[];function Vu(){for(var n=0;n<Uu.length;n++)Uu[n]._workInProgressVersionPrimary=null;Uu.length=0}var fl=j.ReactCurrentDispatcher,Bu=j.ReactCurrentBatchConfig,Ms=0,st=null,bt=null,Pt=null,pl=!1,Bi=!1,Wi=0,rS=0;function Lt(){throw Error(r(321))}function Wu(n,s){if(s===null)return!1;for(var i=0;i<s.length&&i<n.length;i++)if(!Vn(n[i],s[i]))return!1;return!0}function Hu(n,s,i,l,h,m){if(Ms=m,st=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,fl.current=n===null||n.memoizedState===null?aS:lS,n=i(l,h),Bi){m=0;do{if(Bi=!1,Wi=0,25<=m)throw Error(r(301));m+=1,Pt=bt=null,s.updateQueue=null,fl.current=cS,n=i(l,h)}while(Bi)}if(fl.current=gl,s=bt!==null&&bt.next!==null,Ms=0,Pt=bt=st=null,pl=!1,s)throw Error(r(300));return n}function qu(){var n=Wi!==0;return Wi=0,n}function ur(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?st.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function jn(){if(bt===null){var n=st.alternate;n=n!==null?n.memoizedState:null}else n=bt.next;var s=Pt===null?st.memoizedState:Pt.next;if(s!==null)Pt=s,bt=n;else{if(n===null)throw Error(r(310));bt=n,n={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Pt===null?st.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function Hi(n,s){return typeof s=="function"?s(n):s}function Ku(n){var s=jn(),i=s.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=n;var l=bt,h=l.baseQueue,m=i.pending;if(m!==null){if(h!==null){var b=h.next;h.next=m.next,m.next=b}l.baseQueue=h=m,i.pending=null}if(h!==null){m=h.next,l=l.baseState;var E=b=null,T=null,W=m;do{var ne=W.lane;if((Ms&ne)===ne)T!==null&&(T=T.next={lane:0,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),l=W.hasEagerState?W.eagerState:n(l,W.action);else{var se={lane:ne,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null};T===null?(E=T=se,b=l):T=T.next=se,st.lanes|=ne,$s|=ne}W=W.next}while(W!==null&&W!==m);T===null?b=l:T.next=E,Vn(l,s.memoizedState)||(on=!0),s.memoizedState=l,s.baseState=b,s.baseQueue=T,i.lastRenderedState=l}if(n=i.interleaved,n!==null){h=n;do m=h.lane,st.lanes|=m,$s|=m,h=h.next;while(h!==n)}else h===null&&(i.lanes=0);return[s.memoizedState,i.dispatch]}function Qu(n){var s=jn(),i=s.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=n;var l=i.dispatch,h=i.pending,m=s.memoizedState;if(h!==null){i.pending=null;var b=h=h.next;do m=n(m,b.action),b=b.next;while(b!==h);Vn(m,s.memoizedState)||(on=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),i.lastRenderedState=m}return[m,l]}function gm(){}function ym(n,s){var i=st,l=jn(),h=s(),m=!Vn(l.memoizedState,h);if(m&&(l.memoizedState=h,on=!0),l=l.queue,Gu(xm.bind(null,i,l,n),[n]),l.getSnapshot!==s||m||Pt!==null&&Pt.memoizedState.tag&1){if(i.flags|=2048,qi(9,wm.bind(null,i,l,h,s),void 0,null),jt===null)throw Error(r(349));(Ms&30)!==0||vm(i,s,h)}return h}function vm(n,s,i){n.flags|=16384,n={getSnapshot:s,value:i},s=st.updateQueue,s===null?(s={lastEffect:null,stores:null},st.updateQueue=s,s.stores=[n]):(i=s.stores,i===null?s.stores=[n]:i.push(n))}function wm(n,s,i,l){s.value=i,s.getSnapshot=l,bm(s)&&Sm(n)}function xm(n,s,i){return i(function(){bm(s)&&Sm(n)})}function bm(n){var s=n.getSnapshot;n=n.value;try{var i=s();return!Vn(n,i)}catch{return!0}}function Sm(n){var s=Or(n,1);s!==null&&Kn(s,n,1,-1)}function km(n){var s=ur();return typeof n=="function"&&(n=n()),s.memoizedState=s.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:n},s.queue=n,n=n.dispatch=iS.bind(null,st,n),[s.memoizedState,n]}function qi(n,s,i,l){return n={tag:n,create:s,destroy:i,deps:l,next:null},s=st.updateQueue,s===null?(s={lastEffect:null,stores:null},st.updateQueue=s,s.lastEffect=n.next=n):(i=s.lastEffect,i===null?s.lastEffect=n.next=n:(l=i.next,i.next=n,n.next=l,s.lastEffect=n)),n}function _m(){return jn().memoizedState}function hl(n,s,i,l){var h=ur();st.flags|=n,h.memoizedState=qi(1|s,i,void 0,l===void 0?null:l)}function ml(n,s,i,l){var h=jn();l=l===void 0?null:l;var m=void 0;if(bt!==null){var b=bt.memoizedState;if(m=b.destroy,l!==null&&Wu(l,b.deps)){h.memoizedState=qi(s,i,m,l);return}}st.flags|=n,h.memoizedState=qi(1|s,i,m,l)}function Cm(n,s){return hl(8390656,8,n,s)}function Gu(n,s){return ml(2048,8,n,s)}function Nm(n,s){return ml(4,2,n,s)}function Em(n,s){return ml(4,4,n,s)}function Om(n,s){if(typeof s=="function")return n=n(),s(n),function(){s(null)};if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function Pm(n,s,i){return i=i!=null?i.concat([n]):null,ml(4,4,Om.bind(null,s,n),i)}function Zu(){}function jm(n,s){var i=jn();s=s===void 0?null:s;var l=i.memoizedState;return l!==null&&s!==null&&Wu(s,l[1])?l[0]:(i.memoizedState=[n,s],n)}function Tm(n,s){var i=jn();s=s===void 0?null:s;var l=i.memoizedState;return l!==null&&s!==null&&Wu(s,l[1])?l[0]:(n=n(),i.memoizedState=[n,s],n)}function Rm(n,s,i){return(Ms&21)===0?(n.baseState&&(n.baseState=!1,on=!0),n.memoizedState=i):(Vn(i,s)||(i=lh(),st.lanes|=i,$s|=i,n.baseState=!0),s)}function sS(n,s){var i=qe;qe=i!==0&&4>i?i:4,n(!0);var l=Bu.transition;Bu.transition={};try{n(!1),s()}finally{qe=i,Bu.transition=l}}function Am(){return jn().memoizedState}function oS(n,s,i){var l=os(n);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Mm(n))$m(s,i);else if(i=dm(n,s,i,l),i!==null){var h=qt();Kn(i,n,l,h),Im(i,s,l)}}function iS(n,s,i){var l=os(n),h={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Mm(n))$m(s,h);else{var m=n.alternate;if(n.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var b=s.lastRenderedState,E=m(b,i);if(h.hasEagerState=!0,h.eagerState=E,Vn(E,b)){var T=s.interleaved;T===null?(h.next=h,Du(s)):(h.next=T.next,T.next=h),s.interleaved=h;return}}catch{}finally{}i=dm(n,s,h,l),i!==null&&(h=qt(),Kn(i,n,l,h),Im(i,s,l))}}function Mm(n){var s=n.alternate;return n===st||s!==null&&s===st}function $m(n,s){Bi=pl=!0;var i=n.pending;i===null?s.next=s:(s.next=i.next,i.next=s),n.pending=s}function Im(n,s,i){if((i&4194240)!==0){var l=s.lanes;l&=n.pendingLanes,i|=l,s.lanes=i,Yc(n,i)}}var gl={readContext:Pn,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},aS={readContext:Pn,useCallback:function(n,s){return ur().memoizedState=[n,s===void 0?null:s],n},useContext:Pn,useEffect:Cm,useImperativeHandle:function(n,s,i){return i=i!=null?i.concat([n]):null,hl(4194308,4,Om.bind(null,s,n),i)},useLayoutEffect:function(n,s){return hl(4194308,4,n,s)},useInsertionEffect:function(n,s){return hl(4,2,n,s)},useMemo:function(n,s){var i=ur();return s=s===void 0?null:s,n=n(),i.memoizedState=[n,s],n},useReducer:function(n,s,i){var l=ur();return s=i!==void 0?i(s):s,l.memoizedState=l.baseState=s,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:s},l.queue=n,n=n.dispatch=oS.bind(null,st,n),[l.memoizedState,n]},useRef:function(n){var s=ur();return n={current:n},s.memoizedState=n},useState:km,useDebugValue:Zu,useDeferredValue:function(n){return ur().memoizedState=n},useTransition:function(){var n=km(!1),s=n[0];return n=sS.bind(null,n[1]),ur().memoizedState=n,[s,n]},useMutableSource:function(){},useSyncExternalStore:function(n,s,i){var l=st,h=ur();if(tt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=s(),jt===null)throw Error(r(349));(Ms&30)!==0||vm(l,s,i)}h.memoizedState=i;var m={value:i,getSnapshot:s};return h.queue=m,Cm(xm.bind(null,l,m,n),[n]),l.flags|=2048,qi(9,wm.bind(null,l,m,i,s),void 0,null),i},useId:function(){var n=ur(),s=jt.identifierPrefix;if(tt){var i=Er,l=Nr;i=(l&~(1<<32-Un(l)-1)).toString(32)+i,s=":"+s+"R"+i,i=Wi++,0<i&&(s+="H"+i.toString(32)),s+=":"}else i=rS++,s=":"+s+"r"+i.toString(32)+":";return n.memoizedState=s},unstable_isNewReconciler:!1},lS={readContext:Pn,useCallback:jm,useContext:Pn,useEffect:Gu,useImperativeHandle:Pm,useInsertionEffect:Nm,useLayoutEffect:Em,useMemo:Tm,useReducer:Ku,useRef:_m,useState:function(){return Ku(Hi)},useDebugValue:Zu,useDeferredValue:function(n){var s=jn();return Rm(s,bt.memoizedState,n)},useTransition:function(){var n=Ku(Hi)[0],s=jn().memoizedState;return[n,s]},useMutableSource:gm,useSyncExternalStore:ym,useId:Am,unstable_isNewReconciler:!1},cS={readContext:Pn,useCallback:jm,useContext:Pn,useEffect:Gu,useImperativeHandle:Pm,useInsertionEffect:Nm,useLayoutEffect:Em,useMemo:Tm,useReducer:Qu,useRef:_m,useState:function(){return Qu(Hi)},useDebugValue:Zu,useDeferredValue:function(n){var s=jn();return bt===null?s.memoizedState=n:Rm(s,bt.memoizedState,n)},useTransition:function(){var n=Qu(Hi)[0],s=jn().memoizedState;return[n,s]},useMutableSource:gm,useSyncExternalStore:ym,useId:Am,unstable_isNewReconciler:!1};function Wn(n,s){if(n&&n.defaultProps){s=D({},s),n=n.defaultProps;for(var i in n)s[i]===void 0&&(s[i]=n[i]);return s}return s}function Ju(n,s,i,l){s=n.memoizedState,i=i(l,s),i=i==null?s:D({},s,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var yl={isMounted:function(n){return(n=n._reactInternals)?Es(n)===n:!1},enqueueSetState:function(n,s,i){n=n._reactInternals;var l=qt(),h=os(n),m=Pr(l,h);m.payload=s,i!=null&&(m.callback=i),s=ts(n,m,h),s!==null&&(Kn(s,n,h,l),cl(s,n,h))},enqueueReplaceState:function(n,s,i){n=n._reactInternals;var l=qt(),h=os(n),m=Pr(l,h);m.tag=1,m.payload=s,i!=null&&(m.callback=i),s=ts(n,m,h),s!==null&&(Kn(s,n,h,l),cl(s,n,h))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var i=qt(),l=os(n),h=Pr(i,l);h.tag=2,s!=null&&(h.callback=s),s=ts(n,h,l),s!==null&&(Kn(s,n,l,i),cl(s,n,l))}};function Dm(n,s,i,l,h,m,b){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,m,b):s.prototype&&s.prototype.isPureReactComponent?!Ri(i,l)||!Ri(h,m):!0}function Lm(n,s,i){var l=!1,h=Yr,m=s.contextType;return typeof m=="object"&&m!==null?m=Pn(m):(h=sn(s)?Ps:Dt.current,l=s.contextTypes,m=(l=l!=null)?Co(n,h):Yr),s=new s(i,m),n.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=yl,n.stateNode=s,s._reactInternals=n,l&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=h,n.__reactInternalMemoizedMaskedChildContext=m),s}function zm(n,s,i,l){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,l),s.state!==n&&yl.enqueueReplaceState(s,s.state,null)}function Yu(n,s,i,l){var h=n.stateNode;h.props=i,h.state=n.memoizedState,h.refs={},Lu(n);var m=s.contextType;typeof m=="object"&&m!==null?h.context=Pn(m):(m=sn(s)?Ps:Dt.current,h.context=Co(n,m)),h.state=n.memoizedState,m=s.getDerivedStateFromProps,typeof m=="function"&&(Ju(n,s,m,i),h.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(s=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),s!==h.state&&yl.enqueueReplaceState(h,h.state,null),ul(n,i,h,l),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308)}function Ao(n,s){try{var i="",l=s;do i+=Z(l),l=l.return;while(l);var h=i}catch(m){h=`
40
+ Error generating stack: `+m.message+`
41
+ `+m.stack}return{value:n,source:s,stack:h,digest:null}}function Xu(n,s,i){return{value:n,source:null,stack:i??null,digest:s??null}}function ed(n,s){try{console.error(s.value)}catch(i){setTimeout(function(){throw i})}}var uS=typeof WeakMap=="function"?WeakMap:Map;function Fm(n,s,i){i=Pr(-1,i),i.tag=3,i.payload={element:null};var l=s.value;return i.callback=function(){_l||(_l=!0,md=l),ed(n,s)},i}function Um(n,s,i){i=Pr(-1,i),i.tag=3;var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var h=s.value;i.payload=function(){return l(h)},i.callback=function(){ed(n,s)}}var m=n.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(i.callback=function(){ed(n,s),typeof l!="function"&&(rs===null?rs=new Set([this]):rs.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})}),i}function Vm(n,s,i){var l=n.pingCache;if(l===null){l=n.pingCache=new uS;var h=new Set;l.set(s,h)}else h=l.get(s),h===void 0&&(h=new Set,l.set(s,h));h.has(i)||(h.add(i),n=_S.bind(null,n,s,i),s.then(n,n))}function Bm(n){do{var s;if((s=n.tag===13)&&(s=n.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return n;n=n.return}while(n!==null);return null}function Wm(n,s,i,l,h){return(n.mode&1)===0?(n===s?n.flags|=65536:(n.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(s=Pr(-1,1),s.tag=2,ts(i,s,1))),i.lanes|=1),n):(n.flags|=65536,n.lanes=h,n)}var dS=j.ReactCurrentOwner,on=!1;function Ht(n,s,i,l){s.child=n===null?um(s,null,i,l):Po(s,n.child,i,l)}function Hm(n,s,i,l,h){i=i.render;var m=s.ref;return To(s,h),l=Hu(n,s,i,l,m,h),i=qu(),n!==null&&!on?(s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~h,jr(n,s,h)):(tt&&i&&Ou(s),s.flags|=1,Ht(n,s,l,h),s.child)}function qm(n,s,i,l,h){if(n===null){var m=i.type;return typeof m=="function"&&!Sd(m)&&m.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(s.tag=15,s.type=m,Km(n,s,m,l,h)):(n=jl(i.type,null,l,s,s.mode,h),n.ref=s.ref,n.return=s,s.child=n)}if(m=n.child,(n.lanes&h)===0){var b=m.memoizedProps;if(i=i.compare,i=i!==null?i:Ri,i(b,l)&&n.ref===s.ref)return jr(n,s,h)}return s.flags|=1,n=as(m,l),n.ref=s.ref,n.return=s,s.child=n}function Km(n,s,i,l,h){if(n!==null){var m=n.memoizedProps;if(Ri(m,l)&&n.ref===s.ref)if(on=!1,s.pendingProps=l=m,(n.lanes&h)!==0)(n.flags&131072)!==0&&(on=!0);else return s.lanes=n.lanes,jr(n,s,h)}return td(n,s,i,l,h)}function Qm(n,s,i){var l=s.pendingProps,h=l.children,m=n!==null?n.memoizedState:null;if(l.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke($o,wn),wn|=i;else{if((i&1073741824)===0)return n=m!==null?m.baseLanes|i:i,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:n,cachePool:null,transitions:null},s.updateQueue=null,Ke($o,wn),wn|=n,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=m!==null?m.baseLanes:i,Ke($o,wn),wn|=l}else m!==null?(l=m.baseLanes|i,s.memoizedState=null):l=i,Ke($o,wn),wn|=l;return Ht(n,s,h,i),s.child}function Gm(n,s){var i=s.ref;(n===null&&i!==null||n!==null&&n.ref!==i)&&(s.flags|=512,s.flags|=2097152)}function td(n,s,i,l,h){var m=sn(i)?Ps:Dt.current;return m=Co(s,m),To(s,h),i=Hu(n,s,i,l,m,h),l=qu(),n!==null&&!on?(s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~h,jr(n,s,h)):(tt&&l&&Ou(s),s.flags|=1,Ht(n,s,i,h),s.child)}function Zm(n,s,i,l,h){if(sn(i)){var m=!0;tl(s)}else m=!1;if(To(s,h),s.stateNode===null)wl(n,s),Lm(s,i,l),Yu(s,i,l,h),l=!0;else if(n===null){var b=s.stateNode,E=s.memoizedProps;b.props=E;var T=b.context,W=i.contextType;typeof W=="object"&&W!==null?W=Pn(W):(W=sn(i)?Ps:Dt.current,W=Co(s,W));var ne=i.getDerivedStateFromProps,se=typeof ne=="function"||typeof b.getSnapshotBeforeUpdate=="function";se||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==l||T!==W)&&zm(s,b,l,W),es=!1;var te=s.memoizedState;b.state=te,ul(s,l,b,h),T=s.memoizedState,E!==l||te!==T||rn.current||es?(typeof ne=="function"&&(Ju(s,i,ne,l),T=s.memoizedState),(E=es||Dm(s,i,E,l,te,T,W))?(se||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=T),b.props=l,b.state=T,b.context=W,l=E):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{b=s.stateNode,fm(n,s),E=s.memoizedProps,W=s.type===s.elementType?E:Wn(s.type,E),b.props=W,se=s.pendingProps,te=b.context,T=i.contextType,typeof T=="object"&&T!==null?T=Pn(T):(T=sn(i)?Ps:Dt.current,T=Co(s,T));var ye=i.getDerivedStateFromProps;(ne=typeof ye=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==se||te!==T)&&zm(s,b,l,T),es=!1,te=s.memoizedState,b.state=te,ul(s,l,b,h);var Se=s.memoizedState;E!==se||te!==Se||rn.current||es?(typeof ye=="function"&&(Ju(s,i,ye,l),Se=s.memoizedState),(W=es||Dm(s,i,W,l,te,Se,T)||!1)?(ne||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(l,Se,T),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(l,Se,T)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===n.memoizedProps&&te===n.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&te===n.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=Se),b.props=l,b.state=Se,b.context=T,l=W):(typeof b.componentDidUpdate!="function"||E===n.memoizedProps&&te===n.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&te===n.memoizedState||(s.flags|=1024),l=!1)}return nd(n,s,i,l,m,h)}function nd(n,s,i,l,h,m){Gm(n,s);var b=(s.flags&128)!==0;if(!l&&!b)return h&&tm(s,i,!1),jr(n,s,m);l=s.stateNode,dS.current=s;var E=b&&typeof i.getDerivedStateFromError!="function"?null:l.render();return s.flags|=1,n!==null&&b?(s.child=Po(s,n.child,null,m),s.child=Po(s,null,E,m)):Ht(n,s,E,m),s.memoizedState=l.state,h&&tm(s,i,!0),s.child}function Jm(n){var s=n.stateNode;s.pendingContext?Xh(n,s.pendingContext,s.pendingContext!==s.context):s.context&&Xh(n,s.context,!1),zu(n,s.containerInfo)}function Ym(n,s,i,l,h){return Oo(),Ru(h),s.flags|=256,Ht(n,s,i,l),s.child}var rd={dehydrated:null,treeContext:null,retryLane:0};function sd(n){return{baseLanes:n,cachePool:null,transitions:null}}function Xm(n,s,i){var l=s.pendingProps,h=rt.current,m=!1,b=(s.flags&128)!==0,E;if((E=b)||(E=n!==null&&n.memoizedState===null?!1:(h&2)!==0),E?(m=!0,s.flags&=-129):(n===null||n.memoizedState!==null)&&(h|=1),Ke(rt,h&1),n===null)return Tu(s),n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((s.mode&1)===0?s.lanes=1:n.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(b=l.children,n=l.fallback,m?(l=s.mode,m=s.child,b={mode:"hidden",children:b},(l&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=b):m=Tl(b,l,0,null),n=zs(n,l,i,null),m.return=s,n.return=s,m.sibling=n,s.child=m,s.child.memoizedState=sd(i),s.memoizedState=rd,n):od(s,b));if(h=n.memoizedState,h!==null&&(E=h.dehydrated,E!==null))return fS(n,s,b,l,E,h,i);if(m){m=l.fallback,b=s.mode,h=n.child,E=h.sibling;var T={mode:"hidden",children:l.children};return(b&1)===0&&s.child!==h?(l=s.child,l.childLanes=0,l.pendingProps=T,s.deletions=null):(l=as(h,T),l.subtreeFlags=h.subtreeFlags&14680064),E!==null?m=as(E,m):(m=zs(m,b,i,null),m.flags|=2),m.return=s,l.return=s,l.sibling=m,s.child=l,l=m,m=s.child,b=n.child.memoizedState,b=b===null?sd(i):{baseLanes:b.baseLanes|i,cachePool:null,transitions:b.transitions},m.memoizedState=b,m.childLanes=n.childLanes&~i,s.memoizedState=rd,l}return m=n.child,n=m.sibling,l=as(m,{mode:"visible",children:l.children}),(s.mode&1)===0&&(l.lanes=i),l.return=s,l.sibling=null,n!==null&&(i=s.deletions,i===null?(s.deletions=[n],s.flags|=16):i.push(n)),s.child=l,s.memoizedState=null,l}function od(n,s){return s=Tl({mode:"visible",children:s},n.mode,0,null),s.return=n,n.child=s}function vl(n,s,i,l){return l!==null&&Ru(l),Po(s,n.child,null,i),n=od(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function fS(n,s,i,l,h,m,b){if(i)return s.flags&256?(s.flags&=-257,l=Xu(Error(r(422))),vl(n,s,b,l)):s.memoizedState!==null?(s.child=n.child,s.flags|=128,null):(m=l.fallback,h=s.mode,l=Tl({mode:"visible",children:l.children},h,0,null),m=zs(m,h,b,null),m.flags|=2,l.return=s,m.return=s,l.sibling=m,s.child=l,(s.mode&1)!==0&&Po(s,n.child,null,b),s.child.memoizedState=sd(b),s.memoizedState=rd,m);if((s.mode&1)===0)return vl(n,s,b,null);if(h.data==="$!"){if(l=h.nextSibling&&h.nextSibling.dataset,l)var E=l.dgst;return l=E,m=Error(r(419)),l=Xu(m,l,void 0),vl(n,s,b,l)}if(E=(b&n.childLanes)!==0,on||E){if(l=jt,l!==null){switch(b&-b){case 4:h=2;break;case 16:h=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:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(l.suspendedLanes|b))!==0?0:h,h!==0&&h!==m.retryLane&&(m.retryLane=h,Or(n,h),Kn(l,n,h,-1))}return bd(),l=Xu(Error(r(421))),vl(n,s,b,l)}return h.data==="$?"?(s.flags|=128,s.child=n.child,s=CS.bind(null,n),h._reactRetry=s,null):(n=m.treeContext,vn=Zr(h.nextSibling),yn=s,tt=!0,Bn=null,n!==null&&(En[On++]=Nr,En[On++]=Er,En[On++]=js,Nr=n.id,Er=n.overflow,js=s),s=od(s,l.children),s.flags|=4096,s)}function eg(n,s,i){n.lanes|=s;var l=n.alternate;l!==null&&(l.lanes|=s),Iu(n.return,s,i)}function id(n,s,i,l,h){var m=n.memoizedState;m===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:h}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=i,m.tailMode=h)}function tg(n,s,i){var l=s.pendingProps,h=l.revealOrder,m=l.tail;if(Ht(n,s,l.children,i),l=rt.current,(l&2)!==0)l=l&1|2,s.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&eg(n,i,s);else if(n.tag===19)eg(n,i,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}l&=1}if(Ke(rt,l),(s.mode&1)===0)s.memoizedState=null;else switch(h){case"forwards":for(i=s.child,h=null;i!==null;)n=i.alternate,n!==null&&dl(n)===null&&(h=i),i=i.sibling;i=h,i===null?(h=s.child,s.child=null):(h=i.sibling,i.sibling=null),id(s,!1,h,i,m);break;case"backwards":for(i=null,h=s.child,s.child=null;h!==null;){if(n=h.alternate,n!==null&&dl(n)===null){s.child=h;break}n=h.sibling,h.sibling=i,i=h,h=n}id(s,!0,i,null,m);break;case"together":id(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function wl(n,s){(s.mode&1)===0&&n!==null&&(n.alternate=null,s.alternate=null,s.flags|=2)}function jr(n,s,i){if(n!==null&&(s.dependencies=n.dependencies),$s|=s.lanes,(i&s.childLanes)===0)return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,i=as(n,n.pendingProps),s.child=i,i.return=s;n.sibling!==null;)n=n.sibling,i=i.sibling=as(n,n.pendingProps),i.return=s;i.sibling=null}return s.child}function pS(n,s,i){switch(s.tag){case 3:Jm(s),Oo();break;case 5:mm(s);break;case 1:sn(s.type)&&tl(s);break;case 4:zu(s,s.stateNode.containerInfo);break;case 10:var l=s.type._context,h=s.memoizedProps.value;Ke(al,l._currentValue),l._currentValue=h;break;case 13:if(l=s.memoizedState,l!==null)return l.dehydrated!==null?(Ke(rt,rt.current&1),s.flags|=128,null):(i&s.child.childLanes)!==0?Xm(n,s,i):(Ke(rt,rt.current&1),n=jr(n,s,i),n!==null?n.sibling:null);Ke(rt,rt.current&1);break;case 19:if(l=(i&s.childLanes)!==0,(n.flags&128)!==0){if(l)return tg(n,s,i);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Ke(rt,rt.current),l)break;return null;case 22:case 23:return s.lanes=0,Qm(n,s,i)}return jr(n,s,i)}var ng,ad,rg,sg;ng=function(n,s){for(var i=s.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},ad=function(){},rg=function(n,s,i,l){var h=n.memoizedProps;if(h!==l){n=s.stateNode,As(cr.current);var m=null;switch(i){case"input":h=vt(n,h),l=vt(n,l),m=[];break;case"select":h=D({},h,{value:void 0}),l=D({},l,{value:void 0}),m=[];break;case"textarea":h=wt(n,h),l=wt(n,l),m=[];break;default:typeof h.onClick!="function"&&typeof l.onClick=="function"&&(n.onclick=Ya)}Et(i,l);var b;i=null;for(W in h)if(!l.hasOwnProperty(W)&&h.hasOwnProperty(W)&&h[W]!=null)if(W==="style"){var E=h[W];for(b in E)E.hasOwnProperty(b)&&(i||(i={}),i[b]="")}else W!=="dangerouslySetInnerHTML"&&W!=="children"&&W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(a.hasOwnProperty(W)?m||(m=[]):(m=m||[]).push(W,null));for(W in l){var T=l[W];if(E=h!=null?h[W]:void 0,l.hasOwnProperty(W)&&T!==E&&(T!=null||E!=null))if(W==="style")if(E){for(b in E)!E.hasOwnProperty(b)||T&&T.hasOwnProperty(b)||(i||(i={}),i[b]="");for(b in T)T.hasOwnProperty(b)&&E[b]!==T[b]&&(i||(i={}),i[b]=T[b])}else i||(m||(m=[]),m.push(W,i)),i=T;else W==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,E=E?E.__html:void 0,T!=null&&E!==T&&(m=m||[]).push(W,T)):W==="children"?typeof T!="string"&&typeof T!="number"||(m=m||[]).push(W,""+T):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&(a.hasOwnProperty(W)?(T!=null&&W==="onScroll"&&Ye("scroll",n),m||E===T||(m=[])):(m=m||[]).push(W,T))}i&&(m=m||[]).push("style",i);var W=m;(s.updateQueue=W)&&(s.flags|=4)}},sg=function(n,s,i,l){i!==l&&(s.flags|=4)};function Ki(n,s){if(!tt)switch(n.tailMode){case"hidden":s=n.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function zt(n){var s=n.alternate!==null&&n.alternate.child===n.child,i=0,l=0;if(s)for(var h=n.child;h!==null;)i|=h.lanes|h.childLanes,l|=h.subtreeFlags&14680064,l|=h.flags&14680064,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)i|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=l,n.childLanes=i,s}function hS(n,s,i){var l=s.pendingProps;switch(Pu(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(s),null;case 1:return sn(s.type)&&el(),zt(s),null;case 3:return l=s.stateNode,Ro(),Xe(rn),Xe(Dt),Vu(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(ol(s)?s.flags|=4:n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Bn!==null&&(vd(Bn),Bn=null))),ad(n,s),zt(s),null;case 5:Fu(s);var h=As(Vi.current);if(i=s.type,n!==null&&s.stateNode!=null)rg(n,s,i,l,h),n.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!l){if(s.stateNode===null)throw Error(r(166));return zt(s),null}if(n=As(cr.current),ol(s)){l=s.stateNode,i=s.type;var m=s.memoizedProps;switch(l[lr]=s,l[Di]=m,n=(s.mode&1)!==0,i){case"dialog":Ye("cancel",l),Ye("close",l);break;case"iframe":case"object":case"embed":Ye("load",l);break;case"video":case"audio":for(h=0;h<Mi.length;h++)Ye(Mi[h],l);break;case"source":Ye("error",l);break;case"img":case"image":case"link":Ye("error",l),Ye("load",l);break;case"details":Ye("toggle",l);break;case"input":tn(l,m),Ye("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!m.multiple},Ye("invalid",l);break;case"textarea":sr(l,m),Ye("invalid",l)}Et(i,m),h=null;for(var b in m)if(m.hasOwnProperty(b)){var E=m[b];b==="children"?typeof E=="string"?l.textContent!==E&&(m.suppressHydrationWarning!==!0&&Ja(l.textContent,E,n),h=["children",E]):typeof E=="number"&&l.textContent!==""+E&&(m.suppressHydrationWarning!==!0&&Ja(l.textContent,E,n),h=["children",""+E]):a.hasOwnProperty(b)&&E!=null&&b==="onScroll"&&Ye("scroll",l)}switch(i){case"input":at(l),rr(l,m,!0);break;case"textarea":at(l),br(l);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(l.onclick=Ya)}l=h,s.updateQueue=l,l!==null&&(s.flags|=4)}else{b=h.nodeType===9?h:h.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=Sr(i)),n==="http://www.w3.org/1999/xhtml"?i==="script"?(n=b.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof l.is=="string"?n=b.createElement(i,{is:l.is}):(n=b.createElement(i),i==="select"&&(b=n,l.multiple?b.multiple=!0:l.size&&(b.size=l.size))):n=b.createElementNS(n,i),n[lr]=s,n[Di]=l,ng(n,s,!1,!1),s.stateNode=n;e:{switch(b=et(i,l),i){case"dialog":Ye("cancel",n),Ye("close",n),h=l;break;case"iframe":case"object":case"embed":Ye("load",n),h=l;break;case"video":case"audio":for(h=0;h<Mi.length;h++)Ye(Mi[h],n);h=l;break;case"source":Ye("error",n),h=l;break;case"img":case"image":case"link":Ye("error",n),Ye("load",n),h=l;break;case"details":Ye("toggle",n),h=l;break;case"input":tn(n,l),h=vt(n,l),Ye("invalid",n);break;case"option":h=l;break;case"select":n._wrapperState={wasMultiple:!!l.multiple},h=D({},l,{value:void 0}),Ye("invalid",n);break;case"textarea":sr(n,l),h=wt(n,l),Ye("invalid",n);break;default:h=l}Et(i,h),E=h;for(m in E)if(E.hasOwnProperty(m)){var T=E[m];m==="style"?Oe(n,T):m==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,T!=null&&kr(n,T)):m==="children"?typeof T=="string"?(i!=="textarea"||T!=="")&&L(n,T):typeof T=="number"&&L(n,""+T):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(a.hasOwnProperty(m)?T!=null&&m==="onScroll"&&Ye("scroll",n):T!=null&&I(n,m,T,b))}switch(i){case"input":at(n),rr(n,l,!1);break;case"textarea":at(n),br(n);break;case"option":l.value!=null&&n.setAttribute("value",""+xe(l.value));break;case"select":n.multiple=!!l.multiple,m=l.value,m!=null?zn(n,!!l.multiple,m,!1):l.defaultValue!=null&&zn(n,!!l.multiple,l.defaultValue,!0);break;default:typeof h.onClick=="function"&&(n.onclick=Ya)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return zt(s),null;case 6:if(n&&s.stateNode!=null)sg(n,s,n.memoizedProps,l);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=As(Vi.current),As(cr.current),ol(s)){if(l=s.stateNode,i=s.memoizedProps,l[lr]=s,(m=l.nodeValue!==i)&&(n=yn,n!==null))switch(n.tag){case 3:Ja(l.nodeValue,i,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Ja(l.nodeValue,i,(n.mode&1)!==0)}m&&(s.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[lr]=s,s.stateNode=l}return zt(s),null;case 13:if(Xe(rt),l=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(tt&&vn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)am(),Oo(),s.flags|=98560,m=!1;else if(m=ol(s),l!==null&&l.dehydrated!==null){if(n===null){if(!m)throw Error(r(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[lr]=s}else Oo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;zt(s),m=!1}else Bn!==null&&(vd(Bn),Bn=null),m=!0;if(!m)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=i,s):(l=l!==null,l!==(n!==null&&n.memoizedState!==null)&&l&&(s.child.flags|=8192,(s.mode&1)!==0&&(n===null||(rt.current&1)!==0?St===0&&(St=3):bd())),s.updateQueue!==null&&(s.flags|=4),zt(s),null);case 4:return Ro(),ad(n,s),n===null&&$i(s.stateNode.containerInfo),zt(s),null;case 10:return $u(s.type._context),zt(s),null;case 17:return sn(s.type)&&el(),zt(s),null;case 19:if(Xe(rt),m=s.memoizedState,m===null)return zt(s),null;if(l=(s.flags&128)!==0,b=m.rendering,b===null)if(l)Ki(m,!1);else{if(St!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(b=dl(n),b!==null){for(s.flags|=128,Ki(m,!1),l=b.updateQueue,l!==null&&(s.updateQueue=l,s.flags|=4),s.subtreeFlags=0,l=i,i=s.child;i!==null;)m=i,n=l,m.flags&=14680066,b=m.alternate,b===null?(m.childLanes=0,m.lanes=n,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=b.childLanes,m.lanes=b.lanes,m.child=b.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=b.memoizedProps,m.memoizedState=b.memoizedState,m.updateQueue=b.updateQueue,m.type=b.type,n=b.dependencies,m.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i=i.sibling;return Ke(rt,rt.current&1|2),s.child}n=n.sibling}m.tail!==null&&dt()>Io&&(s.flags|=128,l=!0,Ki(m,!1),s.lanes=4194304)}else{if(!l)if(n=dl(b),n!==null){if(s.flags|=128,l=!0,i=n.updateQueue,i!==null&&(s.updateQueue=i,s.flags|=4),Ki(m,!0),m.tail===null&&m.tailMode==="hidden"&&!b.alternate&&!tt)return zt(s),null}else 2*dt()-m.renderingStartTime>Io&&i!==1073741824&&(s.flags|=128,l=!0,Ki(m,!1),s.lanes=4194304);m.isBackwards?(b.sibling=s.child,s.child=b):(i=m.last,i!==null?i.sibling=b:s.child=b,m.last=b)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=dt(),s.sibling=null,i=rt.current,Ke(rt,l?i&1|2:i&1),s):(zt(s),null);case 22:case 23:return xd(),l=s.memoizedState!==null,n!==null&&n.memoizedState!==null!==l&&(s.flags|=8192),l&&(s.mode&1)!==0?(wn&1073741824)!==0&&(zt(s),s.subtreeFlags&6&&(s.flags|=8192)):zt(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function mS(n,s){switch(Pu(s),s.tag){case 1:return sn(s.type)&&el(),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Ro(),Xe(rn),Xe(Dt),Vu(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 5:return Fu(s),null;case 13:if(Xe(rt),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Oo()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return Xe(rt),null;case 4:return Ro(),null;case 10:return $u(s.type._context),null;case 22:case 23:return xd(),null;case 24:return null;default:return null}}var xl=!1,Ft=!1,gS=typeof WeakSet=="function"?WeakSet:Set,be=null;function Mo(n,s){var i=n.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){ot(n,s,l)}else i.current=null}function ld(n,s,i){try{i()}catch(l){ot(n,s,l)}}var og=!1;function yS(n,s){if(xu=Fa,n=Dh(),fu(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var h=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var b=0,E=-1,T=-1,W=0,ne=0,se=n,te=null;t:for(;;){for(var ye;se!==i||h!==0&&se.nodeType!==3||(E=b+h),se!==m||l!==0&&se.nodeType!==3||(T=b+l),se.nodeType===3&&(b+=se.nodeValue.length),(ye=se.firstChild)!==null;)te=se,se=ye;for(;;){if(se===n)break t;if(te===i&&++W===h&&(E=b),te===m&&++ne===l&&(T=b),(ye=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=ye}i=E===-1||T===-1?null:{start:E,end:T}}else i=null}i=i||{start:0,end:0}}else i=null;for(bu={focusedElem:n,selectionRange:i},Fa=!1,be=s;be!==null;)if(s=be,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,be=n;else for(;be!==null;){s=be;try{var Se=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ne=Se.memoizedProps,ft=Se.memoizedState,U=s.stateNode,$=U.getSnapshotBeforeUpdate(s.elementType===s.type?Ne:Wn(s.type,Ne),ft);U.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var B=s.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ae){ot(s,s.return,ae)}if(n=s.sibling,n!==null){n.return=s.return,be=n;break}be=s.return}return Se=og,og=!1,Se}function Qi(n,s,i){var l=s.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&n)===n){var m=h.destroy;h.destroy=void 0,m!==void 0&&ld(s,i,m)}h=h.next}while(h!==l)}}function bl(n,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&n)===n){var l=i.create;i.destroy=l()}i=i.next}while(i!==s)}}function cd(n){var s=n.ref;if(s!==null){var i=n.stateNode;switch(n.tag){case 5:n=i;break;default:n=i}typeof s=="function"?s(n):s.current=n}}function ig(n){var s=n.alternate;s!==null&&(n.alternate=null,ig(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&(delete s[lr],delete s[Di],delete s[Cu],delete s[X1],delete s[eS])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function ag(n){return n.tag===5||n.tag===3||n.tag===4}function lg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ag(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function ud(n,s,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,s?i.nodeType===8?i.parentNode.insertBefore(n,s):i.insertBefore(n,s):(i.nodeType===8?(s=i.parentNode,s.insertBefore(n,i)):(s=i,s.appendChild(n)),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=Ya));else if(l!==4&&(n=n.child,n!==null))for(ud(n,s,i),n=n.sibling;n!==null;)ud(n,s,i),n=n.sibling}function dd(n,s,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,s?i.insertBefore(n,s):i.appendChild(n);else if(l!==4&&(n=n.child,n!==null))for(dd(n,s,i),n=n.sibling;n!==null;)dd(n,s,i),n=n.sibling}var Mt=null,Hn=!1;function ns(n,s,i){for(i=i.child;i!==null;)cg(n,s,i),i=i.sibling}function cg(n,s,i){if(ar&&typeof ar.onCommitFiberUnmount=="function")try{ar.onCommitFiberUnmount(Ma,i)}catch{}switch(i.tag){case 5:Ft||Mo(i,s);case 6:var l=Mt,h=Hn;Mt=null,ns(n,s,i),Mt=l,Hn=h,Mt!==null&&(Hn?(n=Mt,i=i.stateNode,n.nodeType===8?n.parentNode.removeChild(i):n.removeChild(i)):Mt.removeChild(i.stateNode));break;case 18:Mt!==null&&(Hn?(n=Mt,i=i.stateNode,n.nodeType===8?_u(n.parentNode,i):n.nodeType===1&&_u(n,i),Ni(n)):_u(Mt,i.stateNode));break;case 4:l=Mt,h=Hn,Mt=i.stateNode.containerInfo,Hn=!0,ns(n,s,i),Mt=l,Hn=h;break;case 0:case 11:case 14:case 15:if(!Ft&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){h=l=l.next;do{var m=h,b=m.destroy;m=m.tag,b!==void 0&&((m&2)!==0||(m&4)!==0)&&ld(i,s,b),h=h.next}while(h!==l)}ns(n,s,i);break;case 1:if(!Ft&&(Mo(i,s),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(E){ot(i,s,E)}ns(n,s,i);break;case 21:ns(n,s,i);break;case 22:i.mode&1?(Ft=(l=Ft)||i.memoizedState!==null,ns(n,s,i),Ft=l):ns(n,s,i);break;default:ns(n,s,i)}}function ug(n){var s=n.updateQueue;if(s!==null){n.updateQueue=null;var i=n.stateNode;i===null&&(i=n.stateNode=new gS),s.forEach(function(l){var h=NS.bind(null,n,l);i.has(l)||(i.add(l),l.then(h,h))})}}function qn(n,s){var i=s.deletions;if(i!==null)for(var l=0;l<i.length;l++){var h=i[l];try{var m=n,b=s,E=b;e:for(;E!==null;){switch(E.tag){case 5:Mt=E.stateNode,Hn=!1;break e;case 3:Mt=E.stateNode.containerInfo,Hn=!0;break e;case 4:Mt=E.stateNode.containerInfo,Hn=!0;break e}E=E.return}if(Mt===null)throw Error(r(160));cg(m,b,h),Mt=null,Hn=!1;var T=h.alternate;T!==null&&(T.return=null),h.return=null}catch(W){ot(h,s,W)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)dg(s,n),s=s.sibling}function dg(n,s){var i=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(qn(s,n),dr(n),l&4){try{Qi(3,n,n.return),bl(3,n)}catch(Ne){ot(n,n.return,Ne)}try{Qi(5,n,n.return)}catch(Ne){ot(n,n.return,Ne)}}break;case 1:qn(s,n),dr(n),l&512&&i!==null&&Mo(i,i.return);break;case 5:if(qn(s,n),dr(n),l&512&&i!==null&&Mo(i,i.return),n.flags&32){var h=n.stateNode;try{L(h,"")}catch(Ne){ot(n,n.return,Ne)}}if(l&4&&(h=n.stateNode,h!=null)){var m=n.memoizedProps,b=i!==null?i.memoizedProps:m,E=n.type,T=n.updateQueue;if(n.updateQueue=null,T!==null)try{E==="input"&&m.type==="radio"&&m.name!=null&&Dn(h,m),et(E,b);var W=et(E,m);for(b=0;b<T.length;b+=2){var ne=T[b],se=T[b+1];ne==="style"?Oe(h,se):ne==="dangerouslySetInnerHTML"?kr(h,se):ne==="children"?L(h,se):I(h,ne,se,W)}switch(E){case"input":pn(h,m);break;case"textarea":Wt(h,m);break;case"select":var te=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!m.multiple;var ye=m.value;ye!=null?zn(h,!!m.multiple,ye,!1):te!==!!m.multiple&&(m.defaultValue!=null?zn(h,!!m.multiple,m.defaultValue,!0):zn(h,!!m.multiple,m.multiple?[]:"",!1))}h[Di]=m}catch(Ne){ot(n,n.return,Ne)}}break;case 6:if(qn(s,n),dr(n),l&4){if(n.stateNode===null)throw Error(r(162));h=n.stateNode,m=n.memoizedProps;try{h.nodeValue=m}catch(Ne){ot(n,n.return,Ne)}}break;case 3:if(qn(s,n),dr(n),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ni(s.containerInfo)}catch(Ne){ot(n,n.return,Ne)}break;case 4:qn(s,n),dr(n);break;case 13:qn(s,n),dr(n),h=n.child,h.flags&8192&&(m=h.memoizedState!==null,h.stateNode.isHidden=m,!m||h.alternate!==null&&h.alternate.memoizedState!==null||(hd=dt())),l&4&&ug(n);break;case 22:if(ne=i!==null&&i.memoizedState!==null,n.mode&1?(Ft=(W=Ft)||ne,qn(s,n),Ft=W):qn(s,n),dr(n),l&8192){if(W=n.memoizedState!==null,(n.stateNode.isHidden=W)&&!ne&&(n.mode&1)!==0)for(be=n,ne=n.child;ne!==null;){for(se=be=ne;be!==null;){switch(te=be,ye=te.child,te.tag){case 0:case 11:case 14:case 15:Qi(4,te,te.return);break;case 1:Mo(te,te.return);var Se=te.stateNode;if(typeof Se.componentWillUnmount=="function"){l=te,i=te.return;try{s=l,Se.props=s.memoizedProps,Se.state=s.memoizedState,Se.componentWillUnmount()}catch(Ne){ot(l,i,Ne)}}break;case 5:Mo(te,te.return);break;case 22:if(te.memoizedState!==null){hg(se);continue}}ye!==null?(ye.return=te,be=ye):hg(se)}ne=ne.sibling}e:for(ne=null,se=n;;){if(se.tag===5){if(ne===null){ne=se;try{h=se.stateNode,W?(m=h.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(E=se.stateNode,T=se.memoizedProps.style,b=T!=null&&T.hasOwnProperty("display")?T.display:null,E.style.display=ge("display",b))}catch(Ne){ot(n,n.return,Ne)}}}else if(se.tag===6){if(ne===null)try{se.stateNode.nodeValue=W?"":se.memoizedProps}catch(Ne){ot(n,n.return,Ne)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===n)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===n)break e;for(;se.sibling===null;){if(se.return===null||se.return===n)break e;ne===se&&(ne=null),se=se.return}ne===se&&(ne=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:qn(s,n),dr(n),l&4&&ug(n);break;case 21:break;default:qn(s,n),dr(n)}}function dr(n){var s=n.flags;if(s&2){try{e:{for(var i=n.return;i!==null;){if(ag(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var h=l.stateNode;l.flags&32&&(L(h,""),l.flags&=-33);var m=lg(n);dd(n,m,h);break;case 3:case 4:var b=l.stateNode.containerInfo,E=lg(n);ud(n,E,b);break;default:throw Error(r(161))}}catch(T){ot(n,n.return,T)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function vS(n,s,i){be=n,fg(n)}function fg(n,s,i){for(var l=(n.mode&1)!==0;be!==null;){var h=be,m=h.child;if(h.tag===22&&l){var b=h.memoizedState!==null||xl;if(!b){var E=h.alternate,T=E!==null&&E.memoizedState!==null||Ft;E=xl;var W=Ft;if(xl=b,(Ft=T)&&!W)for(be=h;be!==null;)b=be,T=b.child,b.tag===22&&b.memoizedState!==null?mg(h):T!==null?(T.return=b,be=T):mg(h);for(;m!==null;)be=m,fg(m),m=m.sibling;be=h,xl=E,Ft=W}pg(n)}else(h.subtreeFlags&8772)!==0&&m!==null?(m.return=h,be=m):pg(n)}}function pg(n){for(;be!==null;){var s=be;if((s.flags&8772)!==0){var i=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:Ft||bl(5,s);break;case 1:var l=s.stateNode;if(s.flags&4&&!Ft)if(i===null)l.componentDidMount();else{var h=s.elementType===s.type?i.memoizedProps:Wn(s.type,i.memoizedProps);l.componentDidUpdate(h,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var m=s.updateQueue;m!==null&&hm(s,m,l);break;case 3:var b=s.updateQueue;if(b!==null){if(i=null,s.child!==null)switch(s.child.tag){case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}hm(s,b,i)}break;case 5:var E=s.stateNode;if(i===null&&s.flags&4){i=E;var T=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":T.autoFocus&&i.focus();break;case"img":T.src&&(i.src=T.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var W=s.alternate;if(W!==null){var ne=W.memoizedState;if(ne!==null){var se=ne.dehydrated;se!==null&&Ni(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Ft||s.flags&512&&cd(s)}catch(te){ot(s,s.return,te)}}if(s===n){be=null;break}if(i=s.sibling,i!==null){i.return=s.return,be=i;break}be=s.return}}function hg(n){for(;be!==null;){var s=be;if(s===n){be=null;break}var i=s.sibling;if(i!==null){i.return=s.return,be=i;break}be=s.return}}function mg(n){for(;be!==null;){var s=be;try{switch(s.tag){case 0:case 11:case 15:var i=s.return;try{bl(4,s)}catch(T){ot(s,i,T)}break;case 1:var l=s.stateNode;if(typeof l.componentDidMount=="function"){var h=s.return;try{l.componentDidMount()}catch(T){ot(s,h,T)}}var m=s.return;try{cd(s)}catch(T){ot(s,m,T)}break;case 5:var b=s.return;try{cd(s)}catch(T){ot(s,b,T)}}}catch(T){ot(s,s.return,T)}if(s===n){be=null;break}var E=s.sibling;if(E!==null){E.return=s.return,be=E;break}be=s.return}}var wS=Math.ceil,Sl=j.ReactCurrentDispatcher,fd=j.ReactCurrentOwner,Tn=j.ReactCurrentBatchConfig,Be=0,jt=null,gt=null,$t=0,wn=0,$o=Jr(0),St=0,Gi=null,$s=0,kl=0,pd=0,Zi=null,an=null,hd=0,Io=1/0,Tr=null,_l=!1,md=null,rs=null,Cl=!1,ss=null,Nl=0,Ji=0,gd=null,El=-1,Ol=0;function qt(){return(Be&6)!==0?dt():El!==-1?El:El=dt()}function os(n){return(n.mode&1)===0?1:(Be&2)!==0&&$t!==0?$t&-$t:nS.transition!==null?(Ol===0&&(Ol=lh()),Ol):(n=qe,n!==0||(n=window.event,n=n===void 0?16:yh(n.type)),n)}function Kn(n,s,i,l){if(50<Ji)throw Ji=0,gd=null,Error(r(185));bi(n,i,l),((Be&2)===0||n!==jt)&&(n===jt&&((Be&2)===0&&(kl|=i),St===4&&is(n,$t)),ln(n,l),i===1&&Be===0&&(s.mode&1)===0&&(Io=dt()+500,nl&&Xr()))}function ln(n,s){var i=n.callbackNode;n1(n,s);var l=Da(n,n===jt?$t:0);if(l===0)i!==null&&oh(i),n.callbackNode=null,n.callbackPriority=0;else if(s=l&-l,n.callbackPriority!==s){if(i!=null&&oh(i),s===1)n.tag===0?tS(yg.bind(null,n)):nm(yg.bind(null,n)),J1(function(){(Be&6)===0&&Xr()}),i=null;else{switch(ch(l)){case 1:i=Gc;break;case 4:i=ih;break;case 16:i=Aa;break;case 536870912:i=ah;break;default:i=Aa}i=Cg(i,gg.bind(null,n))}n.callbackPriority=s,n.callbackNode=i}}function gg(n,s){if(El=-1,Ol=0,(Be&6)!==0)throw Error(r(327));var i=n.callbackNode;if(Do()&&n.callbackNode!==i)return null;var l=Da(n,n===jt?$t:0);if(l===0)return null;if((l&30)!==0||(l&n.expiredLanes)!==0||s)s=Pl(n,l);else{s=l;var h=Be;Be|=2;var m=wg();(jt!==n||$t!==s)&&(Tr=null,Io=dt()+500,Ds(n,s));do try{SS();break}catch(E){vg(n,E)}while(!0);Mu(),Sl.current=m,Be=h,gt!==null?s=0:(jt=null,$t=0,s=St)}if(s!==0){if(s===2&&(h=Zc(n),h!==0&&(l=h,s=yd(n,h))),s===1)throw i=Gi,Ds(n,0),is(n,l),ln(n,dt()),i;if(s===6)is(n,l);else{if(h=n.current.alternate,(l&30)===0&&!xS(h)&&(s=Pl(n,l),s===2&&(m=Zc(n),m!==0&&(l=m,s=yd(n,m))),s===1))throw i=Gi,Ds(n,0),is(n,l),ln(n,dt()),i;switch(n.finishedWork=h,n.finishedLanes=l,s){case 0:case 1:throw Error(r(345));case 2:Ls(n,an,Tr);break;case 3:if(is(n,l),(l&130023424)===l&&(s=hd+500-dt(),10<s)){if(Da(n,0)!==0)break;if(h=n.suspendedLanes,(h&l)!==l){qt(),n.pingedLanes|=n.suspendedLanes&h;break}n.timeoutHandle=ku(Ls.bind(null,n,an,Tr),s);break}Ls(n,an,Tr);break;case 4:if(is(n,l),(l&4194240)===l)break;for(s=n.eventTimes,h=-1;0<l;){var b=31-Un(l);m=1<<b,b=s[b],b>h&&(h=b),l&=~m}if(l=h,l=dt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*wS(l/1960))-l,10<l){n.timeoutHandle=ku(Ls.bind(null,n,an,Tr),l);break}Ls(n,an,Tr);break;case 5:Ls(n,an,Tr);break;default:throw Error(r(329))}}}return ln(n,dt()),n.callbackNode===i?gg.bind(null,n):null}function yd(n,s){var i=Zi;return n.current.memoizedState.isDehydrated&&(Ds(n,s).flags|=256),n=Pl(n,s),n!==2&&(s=an,an=i,s!==null&&vd(s)),n}function vd(n){an===null?an=n:an.push.apply(an,n)}function xS(n){for(var s=n;;){if(s.flags&16384){var i=s.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var h=i[l],m=h.getSnapshot;h=h.value;try{if(!Vn(m(),h))return!1}catch{return!1}}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function is(n,s){for(s&=~pd,s&=~kl,n.suspendedLanes|=s,n.pingedLanes&=~s,n=n.expirationTimes;0<s;){var i=31-Un(s),l=1<<i;n[i]=-1,s&=~l}}function yg(n){if((Be&6)!==0)throw Error(r(327));Do();var s=Da(n,0);if((s&1)===0)return ln(n,dt()),null;var i=Pl(n,s);if(n.tag!==0&&i===2){var l=Zc(n);l!==0&&(s=l,i=yd(n,l))}if(i===1)throw i=Gi,Ds(n,0),is(n,s),ln(n,dt()),i;if(i===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=s,Ls(n,an,Tr),ln(n,dt()),null}function wd(n,s){var i=Be;Be|=1;try{return n(s)}finally{Be=i,Be===0&&(Io=dt()+500,nl&&Xr())}}function Is(n){ss!==null&&ss.tag===0&&(Be&6)===0&&Do();var s=Be;Be|=1;var i=Tn.transition,l=qe;try{if(Tn.transition=null,qe=1,n)return n()}finally{qe=l,Tn.transition=i,Be=s,(Be&6)===0&&Xr()}}function xd(){wn=$o.current,Xe($o)}function Ds(n,s){n.finishedWork=null,n.finishedLanes=0;var i=n.timeoutHandle;if(i!==-1&&(n.timeoutHandle=-1,Z1(i)),gt!==null)for(i=gt.return;i!==null;){var l=i;switch(Pu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&el();break;case 3:Ro(),Xe(rn),Xe(Dt),Vu();break;case 5:Fu(l);break;case 4:Ro();break;case 13:Xe(rt);break;case 19:Xe(rt);break;case 10:$u(l.type._context);break;case 22:case 23:xd()}i=i.return}if(jt=n,gt=n=as(n.current,null),$t=wn=s,St=0,Gi=null,pd=kl=$s=0,an=Zi=null,Rs!==null){for(s=0;s<Rs.length;s++)if(i=Rs[s],l=i.interleaved,l!==null){i.interleaved=null;var h=l.next,m=i.pending;if(m!==null){var b=m.next;m.next=h,l.next=b}i.pending=l}Rs=null}return n}function vg(n,s){do{var i=gt;try{if(Mu(),fl.current=gl,pl){for(var l=st.memoizedState;l!==null;){var h=l.queue;h!==null&&(h.pending=null),l=l.next}pl=!1}if(Ms=0,Pt=bt=st=null,Bi=!1,Wi=0,fd.current=null,i===null||i.return===null){St=1,Gi=s,gt=null;break}e:{var m=n,b=i.return,E=i,T=s;if(s=$t,E.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){var W=T,ne=E,se=ne.tag;if((ne.mode&1)===0&&(se===0||se===11||se===15)){var te=ne.alternate;te?(ne.updateQueue=te.updateQueue,ne.memoizedState=te.memoizedState,ne.lanes=te.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var ye=Bm(b);if(ye!==null){ye.flags&=-257,Wm(ye,b,E,m,s),ye.mode&1&&Vm(m,W,s),s=ye,T=W;var Se=s.updateQueue;if(Se===null){var Ne=new Set;Ne.add(T),s.updateQueue=Ne}else Se.add(T);break e}else{if((s&1)===0){Vm(m,W,s),bd();break e}T=Error(r(426))}}else if(tt&&E.mode&1){var ft=Bm(b);if(ft!==null){(ft.flags&65536)===0&&(ft.flags|=256),Wm(ft,b,E,m,s),Ru(Ao(T,E));break e}}m=T=Ao(T,E),St!==4&&(St=2),Zi===null?Zi=[m]:Zi.push(m),m=b;do{switch(m.tag){case 3:m.flags|=65536,s&=-s,m.lanes|=s;var U=Fm(m,T,s);pm(m,U);break e;case 1:E=T;var $=m.type,B=m.stateNode;if((m.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(rs===null||!rs.has(B)))){m.flags|=65536,s&=-s,m.lanes|=s;var ae=Um(m,E,s);pm(m,ae);break e}}m=m.return}while(m!==null)}bg(i)}catch(Ee){s=Ee,gt===i&&i!==null&&(gt=i=i.return);continue}break}while(!0)}function wg(){var n=Sl.current;return Sl.current=gl,n===null?gl:n}function bd(){(St===0||St===3||St===2)&&(St=4),jt===null||($s&268435455)===0&&(kl&268435455)===0||is(jt,$t)}function Pl(n,s){var i=Be;Be|=2;var l=wg();(jt!==n||$t!==s)&&(Tr=null,Ds(n,s));do try{bS();break}catch(h){vg(n,h)}while(!0);if(Mu(),Be=i,Sl.current=l,gt!==null)throw Error(r(261));return jt=null,$t=0,St}function bS(){for(;gt!==null;)xg(gt)}function SS(){for(;gt!==null&&!Kb();)xg(gt)}function xg(n){var s=_g(n.alternate,n,wn);n.memoizedProps=n.pendingProps,s===null?bg(n):gt=s,fd.current=null}function bg(n){var s=n;do{var i=s.alternate;if(n=s.return,(s.flags&32768)===0){if(i=hS(i,s,wn),i!==null){gt=i;return}}else{if(i=mS(i,s),i!==null){i.flags&=32767,gt=i;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{St=6,gt=null;return}}if(s=s.sibling,s!==null){gt=s;return}gt=s=n}while(s!==null);St===0&&(St=5)}function Ls(n,s,i){var l=qe,h=Tn.transition;try{Tn.transition=null,qe=1,kS(n,s,i,l)}finally{Tn.transition=h,qe=l}return null}function kS(n,s,i,l){do Do();while(ss!==null);if((Be&6)!==0)throw Error(r(327));i=n.finishedWork;var h=n.finishedLanes;if(i===null)return null;if(n.finishedWork=null,n.finishedLanes=0,i===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var m=i.lanes|i.childLanes;if(r1(n,m),n===jt&&(gt=jt=null,$t=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Cl||(Cl=!0,Cg(Aa,function(){return Do(),null})),m=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||m){m=Tn.transition,Tn.transition=null;var b=qe;qe=1;var E=Be;Be|=4,fd.current=null,yS(n,i),dg(i,n),B1(bu),Fa=!!xu,bu=xu=null,n.current=i,vS(i),Qb(),Be=E,qe=b,Tn.transition=m}else n.current=i;if(Cl&&(Cl=!1,ss=n,Nl=h),m=n.pendingLanes,m===0&&(rs=null),Jb(i.stateNode),ln(n,dt()),s!==null)for(l=n.onRecoverableError,i=0;i<s.length;i++)h=s[i],l(h.value,{componentStack:h.stack,digest:h.digest});if(_l)throw _l=!1,n=md,md=null,n;return(Nl&1)!==0&&n.tag!==0&&Do(),m=n.pendingLanes,(m&1)!==0?n===gd?Ji++:(Ji=0,gd=n):Ji=0,Xr(),null}function Do(){if(ss!==null){var n=ch(Nl),s=Tn.transition,i=qe;try{if(Tn.transition=null,qe=16>n?16:n,ss===null)var l=!1;else{if(n=ss,ss=null,Nl=0,(Be&6)!==0)throw Error(r(331));var h=Be;for(Be|=4,be=n.current;be!==null;){var m=be,b=m.child;if((be.flags&16)!==0){var E=m.deletions;if(E!==null){for(var T=0;T<E.length;T++){var W=E[T];for(be=W;be!==null;){var ne=be;switch(ne.tag){case 0:case 11:case 15:Qi(8,ne,m)}var se=ne.child;if(se!==null)se.return=ne,be=se;else for(;be!==null;){ne=be;var te=ne.sibling,ye=ne.return;if(ig(ne),ne===W){be=null;break}if(te!==null){te.return=ye,be=te;break}be=ye}}}var Se=m.alternate;if(Se!==null){var Ne=Se.child;if(Ne!==null){Se.child=null;do{var ft=Ne.sibling;Ne.sibling=null,Ne=ft}while(Ne!==null)}}be=m}}if((m.subtreeFlags&2064)!==0&&b!==null)b.return=m,be=b;else e:for(;be!==null;){if(m=be,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:Qi(9,m,m.return)}var U=m.sibling;if(U!==null){U.return=m.return,be=U;break e}be=m.return}}var $=n.current;for(be=$;be!==null;){b=be;var B=b.child;if((b.subtreeFlags&2064)!==0&&B!==null)B.return=b,be=B;else e:for(b=$;be!==null;){if(E=be,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:bl(9,E)}}catch(Ee){ot(E,E.return,Ee)}if(E===b){be=null;break e}var ae=E.sibling;if(ae!==null){ae.return=E.return,be=ae;break e}be=E.return}}if(Be=h,Xr(),ar&&typeof ar.onPostCommitFiberRoot=="function")try{ar.onPostCommitFiberRoot(Ma,n)}catch{}l=!0}return l}finally{qe=i,Tn.transition=s}}return!1}function Sg(n,s,i){s=Ao(i,s),s=Fm(n,s,1),n=ts(n,s,1),s=qt(),n!==null&&(bi(n,1,s),ln(n,s))}function ot(n,s,i){if(n.tag===3)Sg(n,n,i);else for(;s!==null;){if(s.tag===3){Sg(s,n,i);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(rs===null||!rs.has(l))){n=Ao(i,n),n=Um(s,n,1),s=ts(s,n,1),n=qt(),s!==null&&(bi(s,1,n),ln(s,n));break}}s=s.return}}function _S(n,s,i){var l=n.pingCache;l!==null&&l.delete(s),s=qt(),n.pingedLanes|=n.suspendedLanes&i,jt===n&&($t&i)===i&&(St===4||St===3&&($t&130023424)===$t&&500>dt()-hd?Ds(n,0):pd|=i),ln(n,s)}function kg(n,s){s===0&&((n.mode&1)===0?s=1:(s=Ia,Ia<<=1,(Ia&130023424)===0&&(Ia=4194304)));var i=qt();n=Or(n,s),n!==null&&(bi(n,s,i),ln(n,i))}function CS(n){var s=n.memoizedState,i=0;s!==null&&(i=s.retryLane),kg(n,i)}function NS(n,s){var i=0;switch(n.tag){case 13:var l=n.stateNode,h=n.memoizedState;h!==null&&(i=h.retryLane);break;case 19:l=n.stateNode;break;default:throw Error(r(314))}l!==null&&l.delete(s),kg(n,i)}var _g;_g=function(n,s,i){if(n!==null)if(n.memoizedProps!==s.pendingProps||rn.current)on=!0;else{if((n.lanes&i)===0&&(s.flags&128)===0)return on=!1,pS(n,s,i);on=(n.flags&131072)!==0}else on=!1,tt&&(s.flags&1048576)!==0&&rm(s,sl,s.index);switch(s.lanes=0,s.tag){case 2:var l=s.type;wl(n,s),n=s.pendingProps;var h=Co(s,Dt.current);To(s,i),h=Hu(null,s,l,n,h,i);var m=qu();return s.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,sn(l)?(m=!0,tl(s)):m=!1,s.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Lu(s),h.updater=yl,s.stateNode=h,h._reactInternals=s,Yu(s,l,n,i),s=nd(null,s,l,!0,m,i)):(s.tag=0,tt&&m&&Ou(s),Ht(null,s,h,i),s=s.child),s;case 16:l=s.elementType;e:{switch(wl(n,s),n=s.pendingProps,h=l._init,l=h(l._payload),s.type=l,h=s.tag=OS(l),n=Wn(l,n),h){case 0:s=td(null,s,l,n,i);break e;case 1:s=Zm(null,s,l,n,i);break e;case 11:s=Hm(null,s,l,n,i);break e;case 14:s=qm(null,s,l,Wn(l.type,n),i);break e}throw Error(r(306,l,""))}return s;case 0:return l=s.type,h=s.pendingProps,h=s.elementType===l?h:Wn(l,h),td(n,s,l,h,i);case 1:return l=s.type,h=s.pendingProps,h=s.elementType===l?h:Wn(l,h),Zm(n,s,l,h,i);case 3:e:{if(Jm(s),n===null)throw Error(r(387));l=s.pendingProps,m=s.memoizedState,h=m.element,fm(n,s),ul(s,l,null,i);var b=s.memoizedState;if(l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){h=Ao(Error(r(423)),s),s=Ym(n,s,l,i,h);break e}else if(l!==h){h=Ao(Error(r(424)),s),s=Ym(n,s,l,i,h);break e}else for(vn=Zr(s.stateNode.containerInfo.firstChild),yn=s,tt=!0,Bn=null,i=um(s,null,l,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Oo(),l===h){s=jr(n,s,i);break e}Ht(n,s,l,i)}s=s.child}return s;case 5:return mm(s),n===null&&Tu(s),l=s.type,h=s.pendingProps,m=n!==null?n.memoizedProps:null,b=h.children,Su(l,h)?b=null:m!==null&&Su(l,m)&&(s.flags|=32),Gm(n,s),Ht(n,s,b,i),s.child;case 6:return n===null&&Tu(s),null;case 13:return Xm(n,s,i);case 4:return zu(s,s.stateNode.containerInfo),l=s.pendingProps,n===null?s.child=Po(s,null,l,i):Ht(n,s,l,i),s.child;case 11:return l=s.type,h=s.pendingProps,h=s.elementType===l?h:Wn(l,h),Hm(n,s,l,h,i);case 7:return Ht(n,s,s.pendingProps,i),s.child;case 8:return Ht(n,s,s.pendingProps.children,i),s.child;case 12:return Ht(n,s,s.pendingProps.children,i),s.child;case 10:e:{if(l=s.type._context,h=s.pendingProps,m=s.memoizedProps,b=h.value,Ke(al,l._currentValue),l._currentValue=b,m!==null)if(Vn(m.value,b)){if(m.children===h.children&&!rn.current){s=jr(n,s,i);break e}}else for(m=s.child,m!==null&&(m.return=s);m!==null;){var E=m.dependencies;if(E!==null){b=m.child;for(var T=E.firstContext;T!==null;){if(T.context===l){if(m.tag===1){T=Pr(-1,i&-i),T.tag=2;var W=m.updateQueue;if(W!==null){W=W.shared;var ne=W.pending;ne===null?T.next=T:(T.next=ne.next,ne.next=T),W.pending=T}}m.lanes|=i,T=m.alternate,T!==null&&(T.lanes|=i),Iu(m.return,i,s),E.lanes|=i;break}T=T.next}}else if(m.tag===10)b=m.type===s.type?null:m.child;else if(m.tag===18){if(b=m.return,b===null)throw Error(r(341));b.lanes|=i,E=b.alternate,E!==null&&(E.lanes|=i),Iu(b,i,s),b=m.sibling}else b=m.child;if(b!==null)b.return=m;else for(b=m;b!==null;){if(b===s){b=null;break}if(m=b.sibling,m!==null){m.return=b.return,b=m;break}b=b.return}m=b}Ht(n,s,h.children,i),s=s.child}return s;case 9:return h=s.type,l=s.pendingProps.children,To(s,i),h=Pn(h),l=l(h),s.flags|=1,Ht(n,s,l,i),s.child;case 14:return l=s.type,h=Wn(l,s.pendingProps),h=Wn(l.type,h),qm(n,s,l,h,i);case 15:return Km(n,s,s.type,s.pendingProps,i);case 17:return l=s.type,h=s.pendingProps,h=s.elementType===l?h:Wn(l,h),wl(n,s),s.tag=1,sn(l)?(n=!0,tl(s)):n=!1,To(s,i),Lm(s,l,h),Yu(s,l,h,i),nd(null,s,l,!0,n,i);case 19:return tg(n,s,i);case 22:return Qm(n,s,i)}throw Error(r(156,s.tag))};function Cg(n,s){return sh(n,s)}function ES(n,s,i,l){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(n,s,i,l){return new ES(n,s,i,l)}function Sd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function OS(n){if(typeof n=="function")return Sd(n)?1:0;if(n!=null){if(n=n.$$typeof,n===he)return 11;if(n===ce)return 14}return 2}function as(n,s){var i=n.alternate;return i===null?(i=Rn(n.tag,s,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=s,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&14680064,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,s=n.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i}function jl(n,s,i,l,h,m){var b=2;if(l=n,typeof n=="function")Sd(n)&&(b=1);else if(typeof n=="string")b=5;else e:switch(n){case A:return zs(i.children,h,m,s);case M:b=8,h|=8;break;case Y:return n=Rn(12,i,s,h|2),n.elementType=Y,n.lanes=m,n;case pe:return n=Rn(13,i,s,h),n.elementType=pe,n.lanes=m,n;case fe:return n=Rn(19,i,s,h),n.elementType=fe,n.lanes=m,n;case oe:return Tl(i,h,m,s);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case V:b=10;break e;case le:b=9;break e;case he:b=11;break e;case ce:b=14;break e;case X:b=16,l=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return s=Rn(b,i,s,h),s.elementType=n,s.type=l,s.lanes=m,s}function zs(n,s,i,l){return n=Rn(7,n,l,s),n.lanes=i,n}function Tl(n,s,i,l){return n=Rn(22,n,l,s),n.elementType=oe,n.lanes=i,n.stateNode={isHidden:!1},n}function kd(n,s,i){return n=Rn(6,n,null,s),n.lanes=i,n}function _d(n,s,i){return s=Rn(4,n.children!==null?n.children:[],n.key,s),s.lanes=i,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}function PS(n,s,i,l,h){this.tag=s,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jc(0),this.expirationTimes=Jc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jc(0),this.identifierPrefix=l,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Cd(n,s,i,l,h,m,b,E,T){return n=new PS(n,s,i,E,T),s===1?(s=1,m===!0&&(s|=8)):s=0,m=Rn(3,null,null,s),n.current=m,m.stateNode=n,m.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lu(m),n}function jS(n,s,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:l==null?null:""+l,children:n,containerInfo:s,implementation:i}}function Ng(n){if(!n)return Yr;n=n._reactInternals;e:{if(Es(n)!==n||n.tag!==1)throw Error(r(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(sn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(r(171))}if(n.tag===1){var i=n.type;if(sn(i))return em(n,i,s)}return s}function Eg(n,s,i,l,h,m,b,E,T){return n=Cd(i,l,!0,n,h,m,b,E,T),n.context=Ng(null),i=n.current,l=qt(),h=os(i),m=Pr(l,h),m.callback=s??null,ts(i,m,h),n.current.lanes=h,bi(n,h,l),ln(n,l),n}function Rl(n,s,i,l){var h=s.current,m=qt(),b=os(h);return i=Ng(i),s.context===null?s.context=i:s.pendingContext=i,s=Pr(m,b),s.payload={element:n},l=l===void 0?null:l,l!==null&&(s.callback=l),n=ts(h,s,b),n!==null&&(Kn(n,h,b,m),cl(n,h,b)),b}function Al(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function Og(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<s?i:s}}function Nd(n,s){Og(n,s),(n=n.alternate)&&Og(n,s)}function TS(){return null}var Pg=typeof reportError=="function"?reportError:function(n){console.error(n)};function Ed(n){this._internalRoot=n}Ml.prototype.render=Ed.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(r(409));Rl(n,s,null,null)},Ml.prototype.unmount=Ed.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;Is(function(){Rl(null,n,null,null)}),s[_r]=null}};function Ml(n){this._internalRoot=n}Ml.prototype.unstable_scheduleHydration=function(n){if(n){var s=fh();n={blockedOn:null,target:n,priority:s};for(var i=0;i<Kr.length&&s!==0&&s<Kr[i].priority;i++);Kr.splice(i,0,n),i===0&&mh(n)}};function Od(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function $l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function jg(){}function RS(n,s,i,l,h){if(h){if(typeof l=="function"){var m=l;l=function(){var W=Al(b);m.call(W)}}var b=Eg(s,l,n,0,null,!1,!1,"",jg);return n._reactRootContainer=b,n[_r]=b.current,$i(n.nodeType===8?n.parentNode:n),Is(),b}for(;h=n.lastChild;)n.removeChild(h);if(typeof l=="function"){var E=l;l=function(){var W=Al(T);E.call(W)}}var T=Cd(n,0,!1,null,null,!1,!1,"",jg);return n._reactRootContainer=T,n[_r]=T.current,$i(n.nodeType===8?n.parentNode:n),Is(function(){Rl(s,T,i,l)}),T}function Il(n,s,i,l,h){var m=i._reactRootContainer;if(m){var b=m;if(typeof h=="function"){var E=h;h=function(){var T=Al(b);E.call(T)}}Rl(s,b,n,h)}else b=RS(i,s,n,h,l);return Al(b)}uh=function(n){switch(n.tag){case 3:var s=n.stateNode;if(s.current.memoizedState.isDehydrated){var i=xi(s.pendingLanes);i!==0&&(Yc(s,i|1),ln(s,dt()),(Be&6)===0&&(Io=dt()+500,Xr()))}break;case 13:Is(function(){var l=Or(n,1);if(l!==null){var h=qt();Kn(l,n,1,h)}}),Nd(n,1)}},Xc=function(n){if(n.tag===13){var s=Or(n,134217728);if(s!==null){var i=qt();Kn(s,n,134217728,i)}Nd(n,134217728)}},dh=function(n){if(n.tag===13){var s=os(n),i=Or(n,s);if(i!==null){var l=qt();Kn(i,n,s,l)}Nd(n,s)}},fh=function(){return qe},ph=function(n,s){var i=qe;try{return qe=n,s()}finally{qe=i}},Fn=function(n,s,i){switch(s){case"input":if(pn(n,i),s=i.name,i.type==="radio"&&s!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<i.length;s++){var l=i[s];if(l!==n&&l.form===n.form){var h=Xa(l);if(!h)throw Error(r(90));pt(l),pn(l,h)}}}break;case"textarea":Wt(n,i);break;case"select":s=i.value,s!=null&&zn(n,!!i.multiple,s,!1)}},xt=wd,It=Is;var AS={usingClientEntryPoint:!1,Events:[Li,ko,Xa,Ie,ut,wd]},Yi={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},MS={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=nh(n),n===null?null:n.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||TS,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 Dl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dl.isDisabled&&Dl.supportsFiber)try{Ma=Dl.inject(MS),ar=Dl}catch{}}return cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=AS,cn.createPortal=function(n,s){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Od(s))throw Error(r(200));return jS(n,s,null,i)},cn.createRoot=function(n,s){if(!Od(n))throw Error(r(299));var i=!1,l="",h=Pg;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onRecoverableError!==void 0&&(h=s.onRecoverableError)),s=Cd(n,1,!1,null,null,i,!1,l,h),n[_r]=s.current,$i(n.nodeType===8?n.parentNode:n),new Ed(s)},cn.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=nh(s),n=n===null?null:n.stateNode,n},cn.flushSync=function(n){return Is(n)},cn.hydrate=function(n,s,i){if(!$l(s))throw Error(r(200));return Il(null,n,s,!0,i)},cn.hydrateRoot=function(n,s,i){if(!Od(n))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,h=!1,m="",b=Pg;if(i!=null&&(i.unstable_strictMode===!0&&(h=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),s=Eg(s,null,n,1,i??null,h,!1,m,b),n[_r]=s.current,$i(n),l)for(n=0;n<l.length;n++)i=l[n],h=i._getVersion,h=h(i._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[i,h]:s.mutableSourceEagerHydrationData.push(i,h);return new Ml(s)},cn.render=function(n,s,i){if(!$l(s))throw Error(r(200));return Il(null,n,s,!1,i)},cn.unmountComponentAtNode=function(n){if(!$l(n))throw Error(r(40));return n._reactRootContainer?(Is(function(){Il(null,null,n,!1,function(){n._reactRootContainer=null,n[_r]=null})}),!0):!1},cn.unstable_batchedUpdates=wd,cn.unstable_renderSubtreeIntoContainer=function(n,s,i,l){if(!$l(i))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return Il(n,s,i,!1,l)},cn.version="18.3.1-next-f1338f8080-20240426",cn}var Fg;function Nv(){if(Fg)return Rd.exports;Fg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rd.exports=WS(),Rd.exports}var Ug;function HS(){if(Ug)return zl;Ug=1;var e=Nv();return zl.createRoot=e.createRoot,zl.hydrateRoot=e.hydrateRoot,zl}var qS=HS();const KS=Qf(qS);var Zf=Nv();const Ev=Qf(Zf);function QS(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const GS=e=>{switch(e){case"success":return YS;case"info":return ek;case"warning":return XS;case"error":return tk;default:return null}},ZS=Array(12).fill(0),JS=({visible:e,className:t})=>ie.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ie.createElement("div",{className:"sonner-spinner"},ZS.map((r,o)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),YS=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),XS=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ek=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tk=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nk=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rk=()=>{const[e,t]=ie.useState(document.hidden);return ie.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let rf=1;class sk{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:o,...a}=t,c=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:rf++,d=this.toasts.find(g=>g.id===c),p=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(g=>g.id===c?(this.publish({...g,...t,id:c,title:o}),{...g,...t,id:c,dismissible:p,title:o}):g):this.addToast({title:o,...a,dismissible:p,id:c}),c},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let c=o!==void 0,d;const p=a.then(async v=>{if(d=["resolve",v],ie.isValidElement(v))c=!1,this.create({id:o,type:"default",message:v});else if(ik(v)&&!v.ok){c=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${v.status}`):r.error,x=typeof r.description=="function"?await r.description(`HTTP error! status: ${v.status}`):r.description,N=typeof f=="object"&&!ie.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:x,...N})}else if(v instanceof Error){c=!1;const f=typeof r.error=="function"?await r.error(v):r.error,x=typeof r.description=="function"?await r.description(v):r.description,N=typeof f=="object"&&!ie.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:x,...N})}else if(r.success!==void 0){c=!1;const f=typeof r.success=="function"?await r.success(v):r.success,x=typeof r.description=="function"?await r.description(v):r.description,N=typeof f=="object"&&!ie.isValidElement(f)?f:{message:f};this.create({id:o,type:"success",description:x,...N})}}).catch(async v=>{if(d=["reject",v],r.error!==void 0){c=!1;const w=typeof r.error=="function"?await r.error(v):r.error,f=typeof r.description=="function"?await r.description(v):r.description,S=typeof w=="object"&&!ie.isValidElement(w)?w:{message:w};this.create({id:o,type:"error",description:f,...S})}}).finally(()=>{c&&(this.dismiss(o),o=void 0),r.finally==null||r.finally.call(r)}),g=()=>new Promise((v,w)=>p.then(()=>d[0]==="reject"?w(d[1]):v(d[1])).catch(w));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(t,r)=>{const o=(r==null?void 0:r.id)||rf++;return this.create({jsx:t(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fn=new sk,ok=(e,t)=>{const r=(t==null?void 0:t.id)||rf++;return fn.addToast({title:e,...t,id:r}),r},ik=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ak=ok,lk=()=>fn.toasts,ck=()=>fn.getActiveToasts(),ac=Object.assign(ak,{success:fn.success,info:fn.info,warning:fn.warning,error:fn.error,custom:fn.custom,message:fn.message,promise:fn.promise,dismiss:fn.dismiss,loading:fn.loading},{getHistory:lk,getToasts:ck});QS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Fl(e){return e.label!==void 0}const uk=3,dk="24px",fk="16px",Vg=4e3,pk=356,hk=14,mk=45,gk=200;function fr(...e){return e.filter(Boolean).join(" ")}function yk(e){const[t,r]=e.split("-"),o=[];return t&&o.push(t),r&&o.push(r),o}const vk=e=>{var t,r,o,a,c,d,p,g,v;const{invert:w,toast:f,unstyled:x,interacting:S,setHeights:N,visibleToasts:k,heights:C,index:_,toasts:R,expanded:I,removeToast:j,defaultRichColors:G,closeButton:K,style:A,cancelButtonStyle:M,actionButtonStyle:Y,className:V="",descriptionClassName:le="",duration:he,position:pe,gap:fe,expandByDefault:ce,classNames:X,icons:oe,closeButtonAriaLabel:q="Close toast"}=e,[H,D]=ie.useState(null),[O,Q]=ie.useState(null),[re,J]=ie.useState(!1),[Z,de]=ie.useState(!1),[we,xe]=ie.useState(!1),[ve,Ue]=ie.useState(!1),[at,pt]=ie.useState(!1),[lt,vt]=ie.useState(0),[tn,Dn]=ie.useState(0),pn=ie.useRef(f.duration||he||Vg),rr=ie.useRef(null),nt=ie.useRef(null),Ln=_===0,zn=_+1<=k,wt=f.type,sr=f.dismissible!==!1,Wt=f.className||"",br=f.descriptionClassName||"",Sr=ie.useMemo(()=>C.findIndex(Ie=>Ie.toastId===f.id)||0,[C,f.id]),or=ie.useMemo(()=>{var Ie;return(Ie=f.closeButton)!=null?Ie:K},[f.closeButton,K]),ir=ie.useMemo(()=>f.duration||he||Vg,[f.duration,he]),kr=ie.useRef(0),L=ie.useRef(0),ee=ie.useRef(0),me=ie.useRef(null),[ge,Oe]=pe.split("-"),Je=ie.useMemo(()=>C.reduce((Ie,ut,xt)=>xt>=Sr?Ie:Ie+ut.height,0),[C,Sr]),Et=rk(),et=f.invert||w,ht=wt==="loading";L.current=ie.useMemo(()=>Sr*fe+Je,[Sr,Je]),ie.useEffect(()=>{pn.current=ir},[ir]),ie.useEffect(()=>{J(!0)},[]),ie.useEffect(()=>{const Ie=nt.current;if(Ie){const ut=Ie.getBoundingClientRect().height;return Dn(ut),N(xt=>[{toastId:f.id,height:ut,position:f.position},...xt]),()=>N(xt=>xt.filter(It=>It.toastId!==f.id))}},[N,f.id]),ie.useLayoutEffect(()=>{if(!re)return;const Ie=nt.current,ut=Ie.style.height;Ie.style.height="auto";const xt=Ie.getBoundingClientRect().height;Ie.style.height=ut,Dn(xt),N(It=>It.find(mt=>mt.toastId===f.id)?It.map(mt=>mt.toastId===f.id?{...mt,height:xt}:mt):[{toastId:f.id,height:xt,position:f.position},...It])},[re,f.title,f.description,N,f.id,f.jsx,f.action,f.cancel]);const ct=ie.useCallback(()=>{de(!0),vt(L.current),N(Ie=>Ie.filter(ut=>ut.toastId!==f.id)),setTimeout(()=>{j(f)},gk)},[f,j,N,L]);ie.useEffect(()=>{if(f.promise&&wt==="loading"||f.duration===1/0||f.type==="loading")return;let Ie;return I||S||Et?(()=>{if(ee.current<kr.current){const It=new Date().getTime()-kr.current;pn.current=pn.current-It}ee.current=new Date().getTime()})():(()=>{pn.current!==1/0&&(kr.current=new Date().getTime(),Ie=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),ct()},pn.current))})(),()=>clearTimeout(Ie)},[I,S,f,wt,Et,ct]),ie.useEffect(()=>{f.delete&&(ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[ct,f.delete]);function Fn(){var Ie;if(oe!=null&&oe.loading){var ut;return ie.createElement("div",{className:fr(X==null?void 0:X.loader,f==null||(ut=f.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":wt==="loading"},oe.loading)}return ie.createElement(JS,{className:fr(X==null?void 0:X.loader,f==null||(Ie=f.classNames)==null?void 0:Ie.loader),visible:wt==="loading"})}const hn=f.icon||(oe==null?void 0:oe[wt])||GS(wt);var nn,vi;return ie.createElement("li",{tabIndex:0,ref:nt,className:fr(V,Wt,X==null?void 0:X.toast,f==null||(t=f.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[wt],f==null||(r=f.classNames)==null?void 0:r[wt]),"data-sonner-toast":"","data-rich-colors":(nn=f.richColors)!=null?nn:G,"data-styled":!(f.jsx||f.unstyled||x),"data-mounted":re,"data-promise":!!f.promise,"data-swiped":at,"data-removed":Z,"data-visible":zn,"data-y-position":ge,"data-x-position":Oe,"data-index":_,"data-front":Ln,"data-swiping":we,"data-dismissible":sr,"data-type":wt,"data-invert":et,"data-swipe-out":ve,"data-swipe-direction":O,"data-expanded":!!(I||ce&&re),"data-testid":f.testId,style:{"--index":_,"--toasts-before":_,"--z-index":R.length-_,"--offset":`${Z?lt:L.current}px`,"--initial-height":ce?"auto":`${tn}px`,...A,...f.style},onDragEnd:()=>{xe(!1),D(null),me.current=null},onPointerDown:Ie=>{Ie.button!==2&&(ht||!sr||(rr.current=new Date,vt(L.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(xe(!0),me.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,ut,xt;if(ve||!sr)return;me.current=null;const It=Number(((Ie=nt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ur=Number(((ut=nt.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((xt=rr.current)==null?void 0:xt.getTime()),Ot=H==="x"?It:Ur,Vr=Math.abs(Ot)/mt;if(Math.abs(Ot)>=mk||Vr>.11){vt(L.current),f.onDismiss==null||f.onDismiss.call(f,f),Q(H==="x"?It>0?"right":"left":Ur>0?"down":"up"),ct(),Ue(!0);return}else{var At,mn;(At=nt.current)==null||At.style.setProperty("--swipe-amount-x","0px"),(mn=nt.current)==null||mn.style.setProperty("--swipe-amount-y","0px")}pt(!1),xe(!1),D(null)},onPointerMove:Ie=>{var ut,xt,It;if(!me.current||!sr||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const mt=Ie.clientY-me.current.y,Ot=Ie.clientX-me.current.x;var Vr;const At=(Vr=e.swipeDirections)!=null?Vr:yk(pe);!H&&(Math.abs(Ot)>1||Math.abs(mt)>1)&&D(Math.abs(Ot)>Math.abs(mt)?"x":"y");let mn={x:0,y:0};const Br=Nn=>1/(1.5+Math.abs(Nn)/20);if(H==="y"){if(At.includes("top")||At.includes("bottom"))if(At.includes("top")&&mt<0||At.includes("bottom")&&mt>0)mn.y=mt;else{const Nn=mt*Br(mt);mn.y=Math.abs(Nn)<Math.abs(mt)?Nn:mt}}else if(H==="x"&&(At.includes("left")||At.includes("right")))if(At.includes("left")&&Ot<0||At.includes("right")&&Ot>0)mn.x=Ot;else{const Nn=Ot*Br(Ot);mn.x=Math.abs(Nn)<Math.abs(Ot)?Nn:Ot}(Math.abs(mn.x)>0||Math.abs(mn.y)>0)&&pt(!0),(xt=nt.current)==null||xt.style.setProperty("--swipe-amount-x",`${mn.x}px`),(It=nt.current)==null||It.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},or&&!f.jsx&&wt!=="loading"?ie.createElement("button",{"aria-label":q,"data-disabled":ht,"data-close-button":!0,onClick:ht||!sr?()=>{}:()=>{ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:fr(X==null?void 0:X.closeButton,f==null||(o=f.classNames)==null?void 0:o.closeButton)},(vi=oe==null?void 0:oe.close)!=null?vi:nk):null,(wt||f.icon||f.promise)&&f.icon!==null&&((oe==null?void 0:oe[wt])!==null||f.icon)?ie.createElement("div",{"data-icon":"",className:fr(X==null?void 0:X.icon,f==null||(a=f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Fn():null,f.type!=="loading"?hn:null):null,ie.createElement("div",{"data-content":"",className:fr(X==null?void 0:X.content,f==null||(c=f.classNames)==null?void 0:c.content)},ie.createElement("div",{"data-title":"",className:fr(X==null?void 0:X.title,f==null||(d=f.classNames)==null?void 0:d.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ie.createElement("div",{"data-description":"",className:fr(le,br,X==null?void 0:X.description,f==null||(p=f.classNames)==null?void 0:p.description)},typeof f.description=="function"?f.description():f.description):null),ie.isValidElement(f.cancel)?f.cancel:f.cancel&&Fl(f.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||M,onClick:Ie=>{Fl(f.cancel)&&sr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ie),ct())},className:fr(X==null?void 0:X.cancelButton,f==null||(g=f.classNames)==null?void 0:g.cancelButton)},f.cancel.label):null,ie.isValidElement(f.action)?f.action:f.action&&Fl(f.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||Y,onClick:Ie=>{Fl(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ie),!Ie.defaultPrevented&&ct())},className:fr(X==null?void 0:X.actionButton,f==null||(v=f.classNames)==null?void 0:v.actionButton)},f.action.label):null)};function Bg(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wk(e,t){const r={};return[e,t].forEach((o,a)=>{const c=a===1,d=c?"--mobile-offset":"--offset",p=c?fk:dk;function g(v){["top","right","bottom","left"].forEach(w=>{r[`${d}-${w}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?r[`${d}-${v}`]=p:r[`${d}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),r}const xk=ie.forwardRef(function(t,r){const{id:o,invert:a,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:p,closeButton:g,className:v,offset:w,mobileOffset:f,theme:x="light",richColors:S,duration:N,style:k,visibleToasts:C=uk,toastOptions:_,dir:R=Bg(),gap:I=hk,icons:j,containerAriaLabel:G="Notifications"}=t,[K,A]=ie.useState([]),M=ie.useMemo(()=>o?K.filter(re=>re.toasterId===o):K.filter(re=>!re.toasterId),[K,o]),Y=ie.useMemo(()=>Array.from(new Set([c].concat(M.filter(re=>re.position).map(re=>re.position)))),[M,c]),[V,le]=ie.useState([]),[he,pe]=ie.useState(!1),[fe,ce]=ie.useState(!1),[X,oe]=ie.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ie.useRef(null),H=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=ie.useRef(null),O=ie.useRef(!1),Q=ie.useCallback(re=>{A(J=>{var Z;return(Z=J.find(de=>de.id===re.id))!=null&&Z.delete||fn.dismiss(re.id),J.filter(({id:de})=>de!==re.id)})},[]);return ie.useEffect(()=>fn.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{A(J=>J.map(Z=>Z.id===re.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{Ev.flushSync(()=>{A(J=>{const Z=J.findIndex(de=>de.id===re.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...re},...J.slice(Z+1)]:[re,...J]})})})}),[K]),ie.useEffect(()=>{if(x!=="system"){oe(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?oe("dark"):oe("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:J})=>{oe(J?"dark":"light")})}catch{re.addListener(({matches:Z})=>{try{oe(Z?"dark":"light")}catch(de){console.error(de)}})}},[x]),ie.useEffect(()=>{K.length<=1&&pe(!1)},[K]),ie.useEffect(()=>{const re=J=>{var Z;if(d.every(xe=>J[xe]||J.code===xe)){var we;pe(!0),(we=q.current)==null||we.focus()}J.code==="Escape"&&(document.activeElement===q.current||(Z=q.current)!=null&&Z.contains(document.activeElement))&&pe(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[d]),ie.useEffect(()=>{if(q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,O.current=!1)}},[q.current]),ie.createElement("section",{ref:r,"aria-label":`${G} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((re,J)=>{var Z;const[de,we]=re.split("-");return M.length?ie.createElement("ol",{key:re,dir:R==="auto"?Bg():R,tabIndex:-1,ref:q,className:v,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":de,"data-x-position":we,style:{"--front-toast-height":`${((Z=V[0])==null?void 0:Z.height)||0}px`,"--width":`${pk}px`,"--gap":`${I}px`,...k,...wk(w,f)},onBlur:xe=>{O.current&&!xe.currentTarget.contains(xe.relatedTarget)&&(O.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||O.current||(O.current=!0,D.current=xe.relatedTarget)},onMouseEnter:()=>pe(!0),onMouseMove:()=>pe(!0),onMouseLeave:()=>{fe||pe(!1)},onDragEnd:()=>pe(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},M.filter(xe=>!xe.position&&J===0||xe.position===re).map((xe,ve)=>{var Ue,at;return ie.createElement(vk,{key:xe.id,icons:j,index:ve,toast:xe,defaultRichColors:S,duration:(Ue=_==null?void 0:_.duration)!=null?Ue:N,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:a,visibleToasts:C,closeButton:(at=_==null?void 0:_.closeButton)!=null?at:g,interacting:fe,position:re,style:_==null?void 0:_.style,unstyled:_==null?void 0:_.unstyled,classNames:_==null?void 0:_.classNames,cancelButtonStyle:_==null?void 0:_.cancelButtonStyle,actionButtonStyle:_==null?void 0:_.actionButtonStyle,closeButtonAriaLabel:_==null?void 0:_.closeButtonAriaLabel,removeToast:Q,toasts:M.filter(pt=>pt.position==xe.position),heights:V.filter(pt=>pt.position==xe.position),setHeights:le,expandByDefault:p,gap:I,expanded:he,swipeDirections:t.swipeDirections})})):null}))}),bk="modulepreload",Sk=function(e){return"/"+e},Wg={},_t=function(t,r,o){let a=Promise.resolve();if(r&&r.length>0){let d=function(v){return Promise.all(v.map(w=>Promise.resolve(w).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));a=d(r.map(v=>{if(v=Sk(v),v in Wg)return;Wg[v]=!0;const w=v.endsWith(".css"),f=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${f}`))return;const x=document.createElement("link");if(x.rel=w?"stylesheet":bk,w||(x.as="script"),x.crossOrigin="",x.href=v,g&&x.setAttribute("nonce",g),document.head.appendChild(x),w)return new Promise((S,N)=>{x.addEventListener("load",S),x.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return a.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return t().catch(c)})},$d="chunk-reload";function Jf(e){return y.lazy(()=>e().then(t=>{try{sessionStorage.removeItem($d)}catch{}return t},t=>{if(!kk(t))throw t;let r=!1;try{r=sessionStorage.getItem($d)==="1",r||sessionStorage.setItem($d,"1")}catch{}if(r)throw t;return window.location.reload(),new Promise(()=>{})}))}function kk(e){const t=String((e==null?void 0:e.message)??e??"");return/Failed to fetch dynamically imported module/i.test(t)||/Importing a module script failed/i.test(t)||/error loading dynamically imported module/i.test(t)||/Loading chunk .* failed/i.test(t)}/**
42
+ * @license lucide-react v0.577.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Ov=(...e)=>e.filter((t,r,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===r).join(" ").trim();/**
47
+ * @license lucide-react v0.577.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const _k=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
52
+ * @license lucide-react v0.577.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Ck=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,o)=>o?o.toUpperCase():r.toLowerCase());/**
57
+ * @license lucide-react v0.577.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Hg=e=>{const t=Ck(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
62
+ * @license lucide-react v0.577.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */var Nk={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"};/**
67
+ * @license lucide-react v0.577.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Ek=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
72
+ * @license lucide-react v0.577.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const Ok=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:c,iconNode:d,...p},g)=>y.createElement("svg",{ref:g,...Nk,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:Ov("lucide",a),...!c&&!Ek(p)&&{"aria-hidden":"true"},...p},[...d.map(([v,w])=>y.createElement(v,w)),...Array.isArray(c)?c:[c]]));/**
77
+ * @license lucide-react v0.577.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Ae=(e,t)=>{const r=y.forwardRef(({className:o,...a},c)=>y.createElement(Ok,{ref:c,iconNode:t,className:Ov(`lucide-${_k(Hg(e))}`,`lucide-${e}`,o),...a}));return r.displayName=Hg(e),r};/**
82
+ * @license lucide-react v0.577.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Pk=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],jk=Ae("book-marked",Pk);/**
87
+ * @license lucide-react v0.577.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const Tk=[["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"}]],Pv=Ae("book-open",Tk);/**
92
+ * @license lucide-react v0.577.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Rk=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Ak=Ae("bot",Rk);/**
97
+ * @license lucide-react v0.577.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Mk=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],$k=Ae("building-2",Mk);/**
102
+ * @license lucide-react v0.577.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Ik=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cc=Ae("check",Ik);/**
107
+ * @license lucide-react v0.577.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Dk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],li=Ae("chevron-down",Dk);/**
112
+ * @license lucide-react v0.577.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Lk=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ca=Ae("chevron-right",Lk);/**
117
+ * @license lucide-react v0.577.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const zk=[["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"}]],tc=Ae("circle-alert",zk);/**
122
+ * @license lucide-react v0.577.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const Fk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Uk=Ae("circle",Fk);/**
127
+ * @license lucide-react v0.577.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Vk=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],Bk=Ae("clipboard-check",Vk);/**
132
+ * @license lucide-react v0.577.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Wk=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Yf=Ae("copy",Wk);/**
137
+ * @license lucide-react v0.577.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Hk=[["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"}]],jv=Ae("database",Hk);/**
142
+ * @license lucide-react v0.577.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const qk=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nc=Ae("download",qk);/**
147
+ * @license lucide-react v0.577.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const Kk=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],sf=Ae("external-link",Kk);/**
152
+ * @license lucide-react v0.577.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Qk=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Tv=Ae("eye-off",Qk);/**
157
+ * @license lucide-react v0.577.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Gk=[["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"}]],Rv=Ae("eye",Gk);/**
162
+ * @license lucide-react v0.577.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Zk=[["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"}]],Xf=Ae("file-text",Zk);/**
167
+ * @license lucide-react v0.577.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const Jk=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Yk=Ae("folder-open",Jk);/**
172
+ * @license lucide-react v0.577.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Xk=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],e_=Ae("folder",Xk);/**
177
+ * @license lucide-react v0.577.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const t_=[["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"}]],n_=Ae("globe",t_);/**
182
+ * @license lucide-react v0.577.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const r_=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Av=Ae("house",r_);/**
187
+ * @license lucide-react v0.577.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const s_=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],o_=Ae("inbox",s_);/**
192
+ * @license lucide-react v0.577.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const i_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],qg=Ae("info",i_);/**
197
+ * @license lucide-react v0.577.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const a_=[["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"}]],ep=Ae("key-round",a_);/**
202
+ * @license lucide-react v0.577.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const l_=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],c_=Ae("key",l_);/**
207
+ * @license lucide-react v0.577.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const u_=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],d_=Ae("keyboard",u_);/**
212
+ * @license lucide-react v0.577.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const f_=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Mv=Ae("layout-grid",f_);/**
217
+ * @license lucide-react v0.577.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const p_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ci=Ae("loader-circle",p_);/**
222
+ * @license lucide-react v0.577.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const h_=[["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"}]],m_=Ae("lock",h_);/**
227
+ * @license lucide-react v0.577.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const g_=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],$v=Ae("log-out",g_);/**
232
+ * @license lucide-react v0.577.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const y_=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],v_=Ae("message-square-text",y_);/**
237
+ * @license lucide-react v0.577.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const w_=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Kg=Ae("monitor",w_);/**
242
+ * @license lucide-react v0.577.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const x_=[["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"}]],b_=Ae("network",x_);/**
247
+ * @license lucide-react v0.577.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const S_=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ul=Ae("package",S_);/**
252
+ * @license lucide-react v0.577.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const k_=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],__=Ae("panel-left-close",k_);/**
257
+ * @license lucide-react v0.577.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const C_=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],N_=Ae("panel-left",C_);/**
262
+ * @license lucide-react v0.577.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const E_=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],O_=Ae("pencil",E_);/**
267
+ * @license lucide-react v0.577.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const P_=[["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"}]],j_=Ae("plug",P_);/**
272
+ * @license lucide-react v0.577.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const T_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Iv=Ae("plus",T_);/**
277
+ * @license lucide-react v0.577.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const R_=[["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"}]],A_=Ae("scroll-text",R_);/**
282
+ * @license lucide-react v0.577.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const M_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tp=Ae("search",M_);/**
287
+ * @license lucide-react v0.577.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const $_=[["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"}]],I_=Ae("shield-alert",$_);/**
292
+ * @license lucide-react v0.577.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const D_=[["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"}]],L_=Ae("shield-check",D_);/**
297
+ * @license lucide-react v0.577.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const z_=[["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"}]],Nc=Ae("shield",z_);/**
302
+ * @license lucide-react v0.577.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const F_=[["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"}]],U_=Ae("sparkles",F_);/**
307
+ * @license lucide-react v0.577.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const V_=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Qg=Ae("terminal",V_);/**
312
+ * @license lucide-react v0.577.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const B_=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Dv=Ae("user-round",B_);/**
317
+ * @license lucide-react v0.577.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const W_=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Lv=Ae("users",W_);/**
322
+ * @license lucide-react v0.577.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const H_=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],q_=Ae("workflow",H_),zv="contextnest:draft:",np=(e,t)=>`${zv}${e}:${t}`;function dI(e,t){try{const r=localStorage.getItem(np(e,t));return r?JSON.parse(r):null}catch{return null}}function K_(e){let t=null,r=1/0;for(let o=0;o<localStorage.length;o++){const a=localStorage.key(o);if(!a||a===e||!a.startsWith(zv))continue;let c=0;try{c=Number(JSON.parse(localStorage.getItem(a)||"{}").savedAt)||0}catch{c=0}c<r&&(r=c,t=a)}return t?(localStorage.removeItem(t),!0):!1}function fI(e,t,r){const o=np(e,t),a=JSON.stringify({...r,savedAt:Date.now()});for(;;)try{return localStorage.setItem(o,a),!0}catch{let c=!1;try{c=K_(o)}catch{c=!1}if(!c)return!1}}function Q_(e,t){try{localStorage.removeItem(np(e,t))}catch{}}const Ec="",G_="cnst_token";function Fv(){try{localStorage.removeItem(G_)}catch{}}async function F(e,t={}){const r={"Content-Type":"application/json",...t.headers},o=await fetch(`${Ec}${e}`,{...t,headers:r,credentials:"include"}),a=await o.text();let c;try{c=a?JSON.parse(a):{}}catch{c={error:a.slice(0,200)}}if(!o.ok){o.status===401&&(Fv(),typeof window<"u"&&window.dispatchEvent(new Event("auth:unauthorized")));const p=new Error(c.error||`Request failed: ${o.status}`);throw p.status=o.status,p.body=c,p}return(t.method??"GET").toUpperCase()!=="GET"&&(eo==null||eo.invalidatePath(e)),c}let eo=null;function Z_(e){eo=e}function Id(e){{eo==null||eo.clear();return}}async function Uv(e,t){return F("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}async function J_(e,t,r){return F("/auth/register",{method:"POST",body:JSON.stringify({email:e,password:t,name:r})})}async function Y_(){return F("/auth/logout",{method:"POST"})}async function Vv(){return F("/auth/device",{method:"POST",body:JSON.stringify({})})}async function Bv(e,t){return F(`/auth/device/poll?code=${encodeURIComponent(e)}&client_secret=${encodeURIComponent(t)}`)}async function Wv(e){return F("/auth/promptowl",{method:"POST",body:JSON.stringify({token:e})})}async function la(){return F("/health")}async function X_(){return F("/admin/settings")}async function pI(e){return F("/admin/settings",{method:"PATCH",body:JSON.stringify(e)})}async function hI(e){return F("/admin/settings/test-notification",{method:"POST",body:JSON.stringify({channel:e})})}async function Hv(){return F("/license/status")}async function eC(e){return F("/license/install",{method:"POST",body:JSON.stringify({key:e})})}async function Dd(){return F("/auth/admin-status")}async function tC(){return F("/auth/teammates")}async function mI(e){return F("/auth/invite",{method:"POST",body:JSON.stringify({email:e})})}async function nC(){return F("/admin/super-admins")}async function gI(e){return F("/admin/super-admins",{method:"POST",body:JSON.stringify({email:e})})}async function yI(e){return F(`/admin/super-admins/${encodeURIComponent(e)}`,{method:"DELETE"})}async function rC(){return F("/admin/community-sites")}async function vI(e){return F("/admin/community-sites",{method:"POST",body:JSON.stringify(e)})}async function wI(e,t){return F(`/admin/community-sites/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function xI(e){return F(`/admin/community-sites/${encodeURIComponent(e)}`,{method:"DELETE"})}async function bI(e){return F("/auth/profile",{method:"PATCH",body:JSON.stringify({name:e})})}async function SI(e,t){return F("/auth/password",{method:"POST",body:JSON.stringify({current:e,next:t})})}async function kI(e={}){const t=new URLSearchParams;e.kind&&t.set("kind",e.kind),e.user&&t.set("user",e.user),e.nest&&t.set("nest",e.nest),e.limit!=null&&t.set("limit",String(e.limit)),e.offset!=null&&t.set("offset",String(e.offset));const r=t.toString()?`?${t}`:"";return F(`/admin/trace${r}`)}async function _I(e,t={}){const r=new URLSearchParams;t.kind&&r.set("kind",t.kind),t.user&&r.set("user",t.user),t.limit!=null&&r.set("limit",String(t.limit)),t.offset!=null&&r.set("offset",String(t.offset));const o=r.toString()?`?${r}`:"";return F(`/nests/${encodeURIComponent(e)}/trace${o}`)}async function CI(e){return F(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"})}async function NI(e,t){return F(`/auth/admin/reset-password/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({})})}async function sC(){return F("/auth/keys")}async function EI(e){return F("/auth/keys",{method:"POST",body:JSON.stringify(e||{})})}async function OI(e){return F("/auth/keys/rotate",{method:"POST",body:JSON.stringify(e||{})})}async function PI(e){return F(`/auth/keys/${encodeURIComponent(e)}`,{method:"DELETE"})}async function oC(e){return F(`/nests/${e}/settings`)}async function jI(e,t){return F(`/nests/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function TI(e,t){if(typeof e.prime=="boolean")return e.prime;if(!t.length)return!1;const r=new Set(t);return(e.tags||[]).some(o=>r.has(o.trim().replace(/^#+/,"").toLowerCase()))}async function iC(e){return F(e!=null&&e.archived?"/nests?archived=1":"/nests")}async function RI(e,t){return F("/nests",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function aC(e){return F("/nests/"+e,{method:"DELETE"})}async function AI(e){return F("/nests/"+e+"/archive",{method:"POST"})}async function MI(e){return F("/nests/"+e+"/restore",{method:"POST"})}async function $I(e,t){return F("/nests/"+e+"/pin",{method:t?"POST":"DELETE"})}async function II(e,t){return F("/nests/"+e,{method:"PATCH",body:JSON.stringify(t)})}const lC=4*1024*1024,cC=8*1024*1024;async function DI(e,t,r){const o=new TextEncoder,a=[],c=[];let d=[],p=0;for(const x of t){const S=o.encode(x.path).length+o.encode(x.content??"").length;if(S>cC){c.push(x.path);continue}d.length&&p+S>lC&&(a.push(d),d=[],p=0),d.push(x),p+=S}(d.length||!a.length)&&a.push(d),r==null||r(0,t.length);const g=[...c],v=await F("/nests/import",{method:"POST",body:JSON.stringify({name:e,files:a[0],partial:a.length>1})});g.push(...v.rejected??[]);let w=a[0].length;if(r==null||r(w,t.length),a.length===1)return{nest:v.nest,documents:v.documents??0,rejected:g};const f=v.nest.id;try{for(const S of a.slice(1)){const N=await F("/nests/import",{method:"POST",body:JSON.stringify({nestId:f,files:S})});g.push(...N.rejected??[]),w+=S.length,r==null||r(w,t.length)}return{...await F("/nests/import",{method:"POST",body:JSON.stringify({nestId:f,finalize:!0})}),rejected:g}}catch(x){throw await aC(f).catch(()=>{}),x}}async function uC(){return F("/nests/unsynced")}async function LI(e){return F("/nests/unsynced/sync",{method:"POST",body:JSON.stringify({name:e})})}async function zI(e){return F("/nests/unsynced/sync",{method:"DELETE",body:JSON.stringify({name:e})})}async function FI(e,t,r){return F(`/nests/${e}/visibility`,{method:"PATCH",body:JSON.stringify(r?{visibility:t,acknowledge_public:!0}:{visibility:t})})}async function UI(e,t){return F(`/nests/${e}/reader-mode`,{method:"PATCH",body:JSON.stringify(t)})}async function dC(e){return F(`/nests/${e}`)}async function fC(e){return F(`/nests/${e}/definitions`)}async function VI(e,t){return F(`/nests/${e}/definitions`,{method:"POST",body:JSON.stringify(t)})}async function BI(e,t){return F(`/nests/${e}/definitions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function WI(e,t){const r=new FormData;r.append("file",t);const o=await fetch(`/nests/${e}/assets`,{method:"POST",body:r,credentials:"include"}),a=await o.json().catch(()=>({}));if(!o.ok)throw new Error(a.error||`Upload failed: ${o.status}`);return a}async function pC(e){return F(`/nests/${e}/nodes?content=1`)}async function hC(e,t){return F(`/nests/${e}/nodes?folder=${encodeURIComponent(t)}`)}async function mC(e,t=!1){return F(`/nests/${e}/nodes${t?"?approved_only=1":""}`)}async function gC(e){return F(`/nests/${e}/census`)}async function yC(e){return F(`/nests/${e}/comment-counts`)}async function vC(e,t,r=!1){return F(`/nests/${e}/nodes/${t}${r?"?approved_only=1":""}`)}async function HI(e,t){return F(`/nests/${e}/nodes`,{method:"POST",body:JSON.stringify(t)})}async function qI(e,t,r={}){const o=new FormData;o.append("file",t),r.title&&o.append("title",r.title),r.folder&&o.append("folder",r.folder),r.nodeId&&o.append("nodeId",r.nodeId);for(const d of r.tags??[])o.append("tags",d);const a=await fetch(`/nests/${e}/nodes/pdf`,{method:"POST",body:o,credentials:"include"}),c=await a.json().catch(()=>({}));if(!a.ok)throw new Error(c.error||`PDF upload failed: ${a.status}`);return c}function KI(e,t,r={}){const o=new URLSearchParams;r.version&&o.set("version",String(r.version)),r.approvedOnly&&o.set("approved_only","1"),r.download&&o.set("download","1");const a=o.toString();return`/nests/${e}/nodes/${t}/pdf${a?`?${a}`:""}`}async function QI(e,t,r,o){const a={};return o!==void 0&&(a["X-Base-Version"]=String(o)),F(`/nests/${e}/nodes/${t}`,{method:"PATCH",headers:a,body:JSON.stringify(r)})}async function GI(e,t){return F(`/nests/${e}/nodes/${t}`,{method:"DELETE"})}async function ZI(e,t,r){return F(`/nests/${e}/nodes/${t}/move`,{method:"POST",body:JSON.stringify({folder:r})})}async function wC(e,t){return F(`/nests/${e}/search?q=${encodeURIComponent(t)}`)}async function xC(e,t=20){return F(`/search?q=${encodeURIComponent(e)}&limit=${t}`)}async function bC(e){return F(`/nests/${e}/overview`)}async function SC(e,t={}){const r=new URLSearchParams({format:"markdown"});t.selector&&r.set("selector",t.selector),t.maxTokens&&r.set("max_tokens",String(t.maxTokens));const o=await fetch(`${Ec}/nests/${e}/export?${r.toString()}`,{credentials:"include"});if(!o.ok){const a=await o.text();let c=`Export failed (${o.status})`;try{c=JSON.parse(a).error||c}catch{}throw new Error(c)}return o.text()}async function kC(e,t={}){const r=new URLSearchParams({format:"bundle"});t.includeDrafts&&r.set("includeDrafts","1");const o=await fetch(`${Ec}/nests/${e}/export?${r.toString()}`,{credentials:"include"});if(!o.ok){const g=await o.text();let v=`Export failed (${o.status})`;try{v=JSON.parse(g).error||v}catch{}throw new Error(v)}const a=await o.blob(),c=URL.createObjectURL(a),d=document.createElement("a");d.href=c;const p=(t.nestName||"nest").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"nest";d.download=`${p}-bundle.zip`,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(c)}async function _C(e){const t=await F(`/nests/${e}/overview`),r=(t==null?void 0:t.tags)??{};return Object.keys(r).map(o=>o.replace(/^#+/,"")).filter(Boolean).sort((o,a)=>o.localeCompare(a))}async function CC(e){return F(`/nests/${e}/stewards`)}async function JI(e){return F(`/nests/${e}/stewards/sync`,{method:"POST",body:"{}"})}async function YI(e,t){return F(`/nests/${e}/stewards`,{method:"POST",body:JSON.stringify(t)})}async function XI(e,t){return F(`/nests/${e}/stewards/${t}`,{method:"DELETE"})}async function eD(e,t,r){return F(`/nests/${e}/stewards/${t}`,{method:"PATCH",body:JSON.stringify(r)})}async function NC(e,t){return F(`/nests/${e}/nodes/${t}/stewards`)}async function tD(e,t,r){return F(`/nests/${e}/nodes/${t}/request-deletion`,{method:"POST",body:JSON.stringify({reason:r})})}async function nD(e,t){return F(`/nests/${e}/delete-folder`,{method:"POST",body:JSON.stringify({folder:t})})}async function rD(e,t,r,o){return F(`/nests/${e}/request-deletion`,{method:"POST",body:JSON.stringify({targetType:t,target:r,reason:o})})}async function EC(e,t="pending"){return F(`/nests/${e}/deletion-requests?status=${encodeURIComponent(t)}`)}async function sD(e,t){return F(`/nests/${e}/deletion-requests/${t}/delete`,{method:"POST"})}async function oD(e,t,r){return F(`/nests/${e}/deletion-requests/${t}/decline`,{method:"POST",body:JSON.stringify({note:r})})}async function iD(e,t){return F(`/nests/${e}/deletion-requests/${t}/withdraw`,{method:"POST"})}async function aD(e,t){return F(`/nests/${e}/folders`,{method:"POST",body:JSON.stringify({folder:t})})}async function lD(e,t){return F(`/nests/${e}/nodes/${t}/cancel-review`,{method:"POST"})}async function OC(e,t="pending"){return F(`/nests/${e}/review-queue?status=${encodeURIComponent(t)}`)}async function PC(e,t="all",r=50,o=0){const a=new URLSearchParams({filter:t,limit:String(r),offset:String(o)});return F(`/nests/${e}/feed?${a.toString()}`)}async function cD(e,t,r,o){return F(`/nests/${e}/nodes/${t}/submit-review`,{method:"POST",body:JSON.stringify({note:r,priority:o})})}async function uD(e,t,r){return F(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:r})})}async function dD(e,t,r){return F(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:r})})}async function fD(e,t,r,o){return F(`/nests/${e}/review-queue/bulk`,{method:"POST",body:JSON.stringify({action:t,nodeIds:r,note:o})})}async function pD(e,t,r){return F(`/nests/${e}/nodes/${t}/revert`,{method:"POST",body:JSON.stringify({targetVersion:r})})}async function jC(e,t){return F(`/nests/${e}/nodes/${t}/versions`)}async function hD(e,t,r){return F(`/nests/${e}/nodes/${t}/versions/${r}`)}async function TC(e,t){return F(`/nests/${e}/nodes/${t}/reviews`)}function RC(e,t,r,o){const a=new URLSearchParams;r!=null&&a.set("v",String(r)),o!=null&&a.set("_",String(o));const c=a.toString(),d=t.replace(/^nodes\//,"");return`${Ec}/nests/${e}/nodes/${d}/hosted${c?`?${c}`:""}`}async function mD(e,t,r,o){const a=await fetch(RC(e,t,r,o),{credentials:"include",cache:"no-store"});if(!a.ok)throw new Error(`Failed to load artifact (${a.status})`);const c=a.headers.get("X-Artifact-Snapshot"),d=c?Number(c):null;return{html:await a.text(),snapshot:Number.isFinite(d)?d:null}}async function AC(e,t){return F(`/nests/${e}/nodes/${t}/annotations`)}async function gD(e,t,r){return F(`/nests/${e}/nodes/${t}/annotations`,{method:"POST",body:JSON.stringify(r)})}async function yD(e,t,r,o){return F(`/nests/${e}/nodes/${t}/annotations/${r}/comments`,{method:"POST",body:JSON.stringify({body:o})})}async function vD(e,t,r){return F(`/nests/${e}/nodes/${t}/annotations/${r}/resolve`,{method:"POST",body:"{}"})}async function wD(e,t,r){return F(`/nests/${e}/nodes/${t}/annotations/${r}/reopen`,{method:"POST",body:"{}"})}async function MC(e,t,r){const o=r?`?status=${r}`:"";return F(`/nests/${e}/nodes/${t}/comments${o}`)}async function $C(e,t,r=100){return F(`/nests/${e}/nodes/${t}/activity?limit=${r}`)}async function IC(e,t=!1){return F(`/nests/${e}/external-edits${t?"?refresh=true":""}`)}async function DC(e){return F(`/nests/${e}/external-edits?count=1`)}async function xD(e){return F(`/nests/${e}/external-edits/scan`,{method:"POST",body:"{}"})}async function LC(e,t){return F(`/nests/${e}/nodes/${t}/external-edits`)}async function bD(e,t,r){return F(`/nests/${e}/nodes/${t}/external-edits/${r}`)}async function SD(e,t,r,o){return F(`/nests/${e}/nodes/${t}/external-edits/${r}/approve`,{method:"POST",body:JSON.stringify({comment:o})})}async function kD(e,t,r,o){return F(`/nests/${e}/nodes/${t}/external-edits/${r}/reject`,{method:"POST",body:JSON.stringify({reason:o})})}async function _D(e){return F(`/nests/${e}/publications`)}async function CD(e,t){return F(`/nests/${e}/publications`,{method:"POST",body:JSON.stringify(t)})}async function ND(e,t){return F(`/nests/${e}/publications/${t}/views`)}async function ED(e,t){return F(`/nests/${e}/publications/${t}`,{method:"DELETE"})}async function zC(e){return F(`/nests/${e}/collaborators`)}async function FC(e){return F(`/nests/${e}/mentionable`)}async function UC(e=""){const t=e.trim()?`?q=${encodeURIComponent(e.trim())}`:"";return F(`/people/suggest${t}`)}async function OD(e,t){return F(`/nests/${e}/collaborators`,{method:"POST",body:JSON.stringify(t)})}async function PD(e,t,r){return F(`/nests/${e}/collaborators/${t}`,{method:"PATCH",body:JSON.stringify({permission:r})})}async function jD(e,t){return F(`/nests/${e}/collaborators/${t}`,{method:"DELETE"})}async function TD(e){return F(`/nests/${e}/grants`)}async function RD(e,t){return F(`/nests/${e}/grants`,{method:"POST",body:JSON.stringify(t)})}async function AD(e,t){return F(`/nests/${e}/grants/${t}`,{method:"DELETE"})}const MD=[{value:"viewer",label:"Viewer",hint:"Read only"},{value:"editor",label:"Editor",hint:"Read and edit documents"},{value:"admin",label:"Admin",hint:"Full access except deleting the nest"}];async function VC(){return F("/teams")}async function BC(e){return F(`/teams/${e}`)}async function $D(e){return F("/teams",{method:"POST",body:JSON.stringify({name:e})})}async function ID(e,t){return F(`/teams/${e}`,{method:"PATCH",body:JSON.stringify({name:t})})}async function DD(e){return F(`/teams/${e}`,{method:"DELETE"})}async function LD(e,t){return F(`/teams/${e}/members`,{method:"POST",body:JSON.stringify(t)})}async function zD(e,t,r){return F(`/teams/${e}/members/${t}`,{method:"PATCH",body:JSON.stringify({role:r})})}async function FD(e,t){return F(`/teams/${e}/members/${t}`,{method:"DELETE"})}function UD(e){return["owner","editor"].includes((e.your_role||"").toLowerCase())}const WC="promptowl_connect_required";function VD(){return typeof document>"u"?!1:document.cookie.split(";").some(e=>e.trim().startsWith("cnst_po_session="))}function BD(e){var t;return((t=e==null?void 0:e.body)==null?void 0:t.code)===WC}async function HC(){return F("/teams/promptowl")}async function WD(e){return F("/teams/promptowl/sync",{method:"POST",body:JSON.stringify({team_ids:e})})}async function qC(e){return F(`/nests/${e}/teams`)}async function HD(e,t){return F(`/nests/${e}/teams`,{method:"POST",body:JSON.stringify({team_id:t})})}async function qD(e,t){return F(`/nests/${e}/teams/${t}`,{method:"DELETE"})}async function KC(e){return F(`/nests/${e}/graph`)}async function QC(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!=null&&t.set("offset",String(e.offset));const r=t.toString();return F(`/me/work${r?`?${r}`:""}`)}async function GC(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!=null&&t.set("offset",String(e.offset)),e!=null&&e.q&&t.set("q",e.q),e!=null&&e.sort&&e.sort!=="updated"&&t.set("sort",e.sort);const r=t.toString();return F(`/me/drafts${r?`?${r}`:""}`)}async function KD(e,t){const r=await F(`/nests/${e}/nodes/${t}/discard`,{method:"POST"});return Q_(e,t),r}async function QD(e,t,r){return F(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:r})})}async function GD(e,t,r){return F(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:r})})}const ZD=e=>e.status==="running"&&!e.claimed_by;async function ZC(e){return(await F(`/nests/${e}/edge-types`)).edge_types}async function JC(e){return(await F(`/nests/${e}/edges`)).edges}async function JD(e,t){return(await F(`/nests/${e}/edges`,{method:"POST",body:JSON.stringify(t)})).edge}async function YD(e,t,r){return(await F(`/nests/${e}/edges/${t}`,{method:"PATCH",body:JSON.stringify(r)})).edge}async function XD(e,t){return F(`/nests/${e}/edges/${t}`,{method:"DELETE"})}async function YC(e){return(await F(`/nests/${e}/schedules`)).schedules}async function e4(e,t){return(await F(`/nests/${e}/schedules`,{method:"POST",body:JSON.stringify(t)})).schedule}async function t4(e,t,r){return(await F(`/nests/${e}/schedules/${t}`,{method:"PATCH",body:JSON.stringify(r)})).schedule}async function n4(e,t){return F(`/nests/${e}/schedules/${t}`,{method:"DELETE"})}async function XC(e,t){return(await F(`/nests/${e}/nodes/${t}/watchers`)).watchers}async function r4(e,t,r){return(await F(`/nests/${e}/nodes/${t}/watchers`,{method:"POST",body:JSON.stringify({email:r})})).watchers}async function s4(e,t,r){return(await F(`/nests/${e}/nodes/${t}/watchers?email=${encodeURIComponent(r)}`,{method:"DELETE"})).watchers}async function o4(e){return F("/me/notifications/read",{method:"POST",body:JSON.stringify({ids:e})})}async function eN(e){return(await F(`/nests/${e}/env`)).env}async function i4(e,t,r){return F(`/nests/${e}/env`,{method:"PUT",body:JSON.stringify({key:t,value:r})})}async function a4(e,t){return F(`/nests/${e}/env/${encodeURIComponent(t)}`,{method:"DELETE"})}async function tN(e,t){const r=t?`?agent=${encodeURIComponent(t)}`:"";return(await F(`/nests/${e}/hooks${r}`)).hooks}async function l4(e,t,r){return(await F(`/nests/${e}/hooks`,{method:"POST",body:JSON.stringify({agent_node:t,preset:r})})).hook}async function c4(e,t){return F(`/nests/${e}/hooks/${t}`,{method:"DELETE"})}async function nN(e){return(await F(`/nests/${e}/connectors`)).connectors}async function u4(e,t){return(await F(`/nests/${e}/connectors`,{method:"POST",body:JSON.stringify(t)})).connector}async function d4(e,t,r){return(await F(`/nests/${e}/connectors/${t}`,{method:"PATCH",body:JSON.stringify(r)})).connector}async function f4(e,t){return F(`/nests/${e}/connectors/${t}`,{method:"DELETE"})}async function p4(e,t,r){return F(`/nests/${e}/table-query`,{method:"POST",body:JSON.stringify({table:t,query:r,include_drafts:!0})})}async function h4(e,t,r,o=4e3){return F(`/nests/${e}/context`,{method:"POST",body:JSON.stringify({selector:t,hops:r,max_tokens:o})})}async function m4(e,t,r){const o=new URLSearchParams;o.set("limit",String(r));const a=o.toString();return(await F(`/nests/${e}/runs${a?`?${a}`:""}`)).runs}async function g4(e){const t=await F(`/runs/${e}`);return{...t.run,steps:t.steps}}async function y4(e,t){return F(`/runs/${e}`,{method:"PATCH",body:JSON.stringify({status:"cancelled",trace:{error:"Cancelled from the Runs page"}})})}async function v4(e,t,r,o){return F(`/nests/${e}/run/${t}`,{method:"POST",body:JSON.stringify({...r?{inputs:r}:{},...o?{parent_run_id:o}:{}})})}async function rN(e){try{return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}catch{return!1}}async function ui(e,t){const r=await rN(e);return r?t&&ac.success(t):ac.error("Couldn't copy automatically — select the text and copy it manually."),r}let lc=null;const ia=[],sN=50;function oN(e,t){if(!e){ia.length=0;return}lc||(lc=_t(async()=>{const{default:r}=await import("./module-uADzTImp.js");return{default:r}},[]).then(({default:r})=>{r.init(e,{api_host:t||"https://us.i.posthog.com",person_profiles:"identified_only"});for(const[o,a]of ia.splice(0))r.capture(o,a);return r}).catch(r=>(console.warn("[analytics] PostHog failed to load",r),ia.length=0,null)))}function iN(e,t){if(!lc){ia.length<sN&&ia.push([e,t]);return}lc.then(r=>r==null?void 0:r.capture(e,t))}const qv=y.createContext(null);function aN({children:e}){var re;const[t,r]=y.useState(null),[o,a]=y.useState(null),[c,d]=y.useState(null),[p,g]=y.useState(!1),[v,w]=y.useState(!1),[f,x]=y.useState(!0),[S,N]=y.useState(!1),[k,C]=y.useState(!0),[_,R]=y.useState(!1),[I,j]=y.useState(8),[G,K]=y.useState(16),[A,M]=y.useState(null),[Y,V]=y.useState(!1),[le,he]=y.useState(!0),[pe,fe]=y.useState(null),ce=y.useRef(0),X=y.useCallback((J,Z)=>J==="open"?!0:!!Z,[]),oe=y.useCallback(async()=>{try{const J=await la();a(J.logo_url??null),g(!!J.workflow_plane_enabled),w(!!J.promptowl_teams_enabled),x(J.type_artifact_enabled!==!1),C(J.type_table_enabled!==!1),N(!!J.shared_deployment),R(!!J.subagent_runs_enabled),typeof J.subagent_max_depth=="number"&&j(J.subagent_max_depth),typeof J.subagent_max_children=="number"&&K(J.subagent_max_children)}catch{}},[]),q=y.useCallback(async()=>{const J=++ce.current;try{const Z=await Dd();if(ce.current!==J)return;M(Z),V(t==="open"?!0:!!Z.me)}catch{}},[t]);y.useEffect(()=>{Fv();let J=!1;return(async()=>{try{const Z=await la();if(J)return;const de=Z.auth_mode;r(de),a(Z.logo_url??null),d(Z.version??null),g(!!Z.workflow_plane_enabled),w(!!Z.promptowl_teams_enabled),x(Z.type_artifact_enabled!==!1),C(Z.type_table_enabled!==!1),N(!!Z.shared_deployment),R(!!Z.subagent_runs_enabled),oN(Z.posthog_key,Z.posthog_host),typeof Z.subagent_max_depth=="number"&&j(Z.subagent_max_depth),typeof Z.subagent_max_children=="number"&&K(Z.subagent_max_children);const we=await Dd();if(J)return;M(we),V(X(de,we.me))}catch{J||fe("Cannot connect to server")}finally{J||he(!1)}})(),()=>{J=!0}},[X]),y.useEffect(()=>{if(!o)return;const J=document.querySelector('link[rel="icon"]');J&&(J.href=o)},[o]),y.useEffect(()=>{const J=()=>{++ce.current,V(t==="open"),M(Z=>Z&&{...Z,me:null})};return window.addEventListener("auth:unauthorized",J),()=>window.removeEventListener("auth:unauthorized",J)},[t]),y.useEffect(()=>{const J="cnst_auth_tick",Z=we=>{we.key===J&&(Id(),q())},de=()=>{document.visibilityState==="visible"&&q()};return window.addEventListener("storage",Z),document.addEventListener("visibilitychange",de),()=>{window.removeEventListener("storage",Z),document.removeEventListener("visibilitychange",de)}},[q]);const H=y.useCallback(()=>{try{localStorage.setItem("cnst_auth_tick",String(Date.now()))}catch{}},[]),D=y.useCallback(J=>{const Z=++ce.current;if(Id(),J){const de=J.name??null;M(we=>({claimed:(we==null?void 0:we.claimed)??!0,admin:(we==null?void 0:we.admin)??{email:J.email,name:de},me:{email:J.email,name:de,is_admin:J.is_admin}})),V(!0)}H(),(async()=>{try{const de=await Dd();ce.current===Z&&(M(de),V(X(t,de.me)))}catch{}})()},[t,H,X]),O=y.useCallback(async()=>{if(++ce.current,document.cookie.split(";").some(Z=>Z.trim().startsWith("cnst_sso_session="))){window.location.assign("/auth/oidc/logout");return}try{await Y_()}catch{}Id(),V(t==="open"),M(Z=>Z&&{...Z,me:null}),H()},[t,H]),Q=!!((re=A==null?void 0:A.me)!=null&&re.is_admin);return u.jsx(qv.Provider,{value:{authMode:t,logoUrl:o,serverVersion:c,adminStatus:A,authenticated:Y,isAdmin:Q,workflowPlaneEnabled:p,promptowlTeamsEnabled:v,typeArtifactEnabled:f,typeTableEnabled:k,sharedDeployment:S,subagentRunsEnabled:_,subagentMaxDepth:I,subagentMaxChildren:G,loading:le,error:pe,refresh:q,refreshHealth:oe,loginSuccess:D,logout:O},children:e})}function Na(){const e=y.useContext(qv);if(!e)throw new Error("useAuth must be used inside <AuthProvider>");return e}function lN(){const{loginSuccess:e,logoUrl:t}=Na(),[r,o]=y.useState("login"),[a,c]=y.useState(""),[d,p]=y.useState(""),[g,v]=y.useState(""),[w,f]=y.useState(null),[x,S]=y.useState(!1),[N,k]=y.useState(null),[C,_]=y.useState(null),[R,I]=y.useState(!1),[j,G]=y.useState(!1),[K,A]=y.useState("open"),[M,Y]=y.useState("open"),[V,le]=y.useState({enabled:!1,issuer:""}),he=typeof window<"u"&&new URLSearchParams(window.location.search).has("admin"),pe=K==="open"||K==="admin-only"&&he,fe=M!=="disabled",ce=M==="open",X=(()=>{try{const D=new URL(V.issuer).host;if(D==="login.microsoftonline.com")return"Sign in with Microsoft";if(D==="accounts.google.com")return"Sign in with Google"}catch{}return"Sign in with SSO"})();y.useEffect(()=>{let D=!1;return la().then(O=>{D||(A(O.promptowl_sign_in_gate??"open"),Y(O.manual_sign_in??"open"),le({enabled:!!O.oidc_enabled,issuer:O.oidc_issuer??""}))}).catch(()=>{}),()=>{D=!0}},[]);const oe=async()=>{C&&await ui(C)&&(I(!0),setTimeout(()=>I(!1),1500))},q=async D=>{D.preventDefault(),f(null),S(!0);try{const O=r==="register"?await J_(a,d,g):await Uv(a,d);e(O.user?{email:O.user.email,name:O.user.name,is_admin:!!O.user.is_admin}:void 0)}catch(O){f(O.message)}finally{S(!1)}},H=async()=>{f(null),S(!0);try{const D=await Vv();k(D.verificationUrl),_(D.deviceCode),window.open(D.verificationUrl,"_blank","noopener,noreferrer");for(let O=0;O<180;O++){await new Promise(J=>setTimeout(J,2e3));const Q=await Bv(D.deviceCode,D.clientSecret);if(Q.status==="approved"&&Q.token){const J=await Wv(Q.token);e(J.user?{email:J.user.email,name:J.user.name,is_admin:!!J.user.is_admin}:void 0);return}if(Q.status==="pending")continue;const re=Q.status==="denied"||Q.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":Q.status==="expired"?"Login expired. Try again.":Q.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${Q.status}). Try again.`;f(re),k(null),_(null),S(!1);return}f("Login timed out waiting for approval. Try again."),k(null),_(null),S(!1)}catch(D){f(D.message),k(null),_(null),S(!1)}};return u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:u.jsxs("div",{className:"w-full max-w-sm space-y-6 p-6",children:[u.jsxs("div",{className:"text-center",children:[t?u.jsx("img",{src:t,alt:"",className:"h-12 w-12 mx-auto object-contain"}):u.jsx("span",{className:"text-4xl",children:"🪺"}),u.jsx("h1",{className:"text-xl font-semibold mt-2",children:"ContextNest"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Community Server"})]}),pe&&u.jsx("button",{onClick:H,disabled:x,className:"w-full flex items-center justify-center gap-2 py-2.5 px-4 rounded-lg border border-border bg-card hover:bg-secondary text-sm font-medium transition-colors",children:x&&N?"Waiting for approval...":"Login with PromptOwl"}),V.enabled&&!N&&u.jsx("a",{href:"/auth/oidc/login",className:"w-full flex items-center justify-center gap-2 py-2.5 px-4 rounded-lg border border-border bg-card hover:bg-secondary text-sm font-medium transition-colors",children:X}),N&&u.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[u.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",u.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"PromptOwl"}),". If it asks for a verification code, use this:"]}),C&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:C}),u.jsx("button",{type:"button",onClick:oe,className:"px-2 py-1.5 rounded border text-xs hover:bg-secondary",children:R?"Copied":"Copy"})]})]}),!N&&fe&&u.jsxs(u.Fragment,{children:[(pe||V.enabled)&&u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full border-t border-border"})}),u.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),u.jsxs("form",{onSubmit:q,className:"space-y-3",children:[r==="register"&&u.jsx("input",{type:"text",placeholder:"Name",value:g,onChange:D=>v(D.target.value),className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),u.jsx("input",{type:"email",placeholder:"Email",value:a,onChange:D=>c(D.target.value),required:!0,className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:j?"text":"password",placeholder:"Password",value:d,onChange:D=>p(D.target.value),required:!0,className:"w-full px-3 py-2 pr-9 rounded-md border border-input bg-background text-sm"}),u.jsx("button",{type:"button",onClick:()=>G(D=>!D),"aria-label":j?"Hide password":"Show password",tabIndex:-1,className:"absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-r-md",children:j?u.jsx(Tv,{className:"h-4 w-4"}):u.jsx(Rv,{className:"h-4 w-4"})})]}),u.jsx("button",{type:"submit",disabled:x,className:"w-full py-2.5 px-4 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 disabled:opacity-50",children:x?"...":r==="register"?"Create Account":"Login"})]})]}),w&&u.jsx("p",{className:"text-sm text-destructive text-center",children:w}),!N&&fe&&ce&&u.jsx("p",{className:"text-xs text-center text-muted-foreground",children:r==="login"?u.jsxs(u.Fragment,{children:["No account?"," ",u.jsx("button",{onClick:()=>o("register"),className:"text-primary underline",children:"Register"})]}):u.jsxs(u.Fragment,{children:["Have an account?"," ",u.jsx("button",{onClick:()=>o("login"),className:"text-primary underline",children:"Login"})]})}),!N&&!fe&&!pe&&!V.enabled&&u.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Sign-in is restricted on this server. Contact your admin for access."}),K==="admin-only"&&!he&&!N&&u.jsx("p",{className:"text-xs text-center text-muted-foreground",children:u.jsx("a",{href:"?admin=1",className:"text-primary underline",children:"Admin sign-in"})})]})})}var mi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ws,ps,Ko,mv,cN=(mv=class extends mi{constructor(){super();_e(this,Ws);_e(this,ps);_e(this,Ko);ue(this,Ko,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,ps)||this.setEventListener(P(this,Ko))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,ps))==null||t.call(this),ue(this,ps,void 0))}setEventListener(t){var r;ue(this,Ko,t),(r=P(this,ps))==null||r.call(this),ue(this,ps,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){P(this,Ws)!==t&&(ue(this,Ws,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof P(this,Ws)=="boolean"?P(this,Ws):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ws=new WeakMap,ps=new WeakMap,Ko=new WeakMap,mv),rp=new cN,uN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hs,Kf,gv,dN=(gv=class{constructor(){_e(this,hs,uN);_e(this,Kf,!1)}setTimeoutProvider(e){ue(this,hs,e)}setTimeout(e,t){return P(this,hs).setTimeout(e,t)}clearTimeout(e){P(this,hs).clearTimeout(e)}setInterval(e,t){return P(this,hs).setInterval(e,t)}clearInterval(e){P(this,hs).clearInterval(e)}},hs=new WeakMap,Kf=new WeakMap,gv),Bs=new dN;function fN(e){setTimeout(e,0)}var pN=typeof window>"u"||"Deno"in globalThis;function Gt(){}function hN(e,t){return typeof e=="function"?e(t):e}function of(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ss(e,t){return typeof e=="function"?e(t):e}function Sn(e,t){return typeof e=="function"?e(t):e}function Gg(e,t){const{type:r="all",exact:o,fetchStatus:a,predicate:c,queryKey:d,stale:p}=e;if(d){if(o){if(t.queryHash!==sp(d,t.options))return!1}else if(!di(t.queryKey,d))return!1}if(r!=="all"){const g=t.isActive();if(r==="active"&&!g||r==="inactive"&&g)return!1}return!(typeof p=="boolean"&&t.isStale()!==p||a&&a!==t.state.fetchStatus||c&&!c(t))}function Zg(e,t){const{exact:r,status:o,predicate:a,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(r){if(ca(t.options.mutationKey)!==ca(c))return!1}else if(!di(t.options.mutationKey,c))return!1}return!(o&&t.state.status!==o||a&&!a(t))}function sp(e,t){return((t==null?void 0:t.queryKeyHashFn)||ca)(e)}function ca(e){return JSON.stringify(e,(t,r)=>af(r)?Object.keys(r).sort().reduce((o,a)=>(o[a]=r[a],o),{}):r)}function di(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let o=0;o<t.length;o++)if(!di(e[o],t[o]))return!1;return!0}const r=Object.keys(t);for(const o of r)if(!di(e[o],t[o]))return!1;return!0}return!1}var mN=Object.prototype.hasOwnProperty;function op(e,t,r=0){if(e===t)return e;if(r>500)return t;const o=Jg(e)&&Jg(t);if(!o&&!(af(e)&&af(t)))return t;const c=(o?e:Object.keys(e)).length,d=o?t:Object.keys(t),p=d.length,g=o?new Array(p):{};let v=0;for(let w=0;w<p;w++){const f=o?w:d[w],x=e[f],S=t[f];if(x===S){g[f]=x,(o?w<c:mN.call(e,f))&&v++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){g[f]=S;continue}const N=op(x,S,r+1);g[f]=N,N===x&&v++}return c===p&&v===c?e:g}function cc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Jg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function af(e){if(!Yg(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Yg(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Yg(e){return Object.prototype.toString.call(e)==="[object Object]"}function gN(e){return new Promise(t=>{Bs.setTimeout(t,e)})}function lf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?op(e,t):t}function yN(e,t,r=0){const o=[...e,t];return r&&o.length>r?o.slice(1):o}function vN(e,t,r=0){const o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var ip=Symbol();function Qv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ip?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gv(e,t){return typeof e=="function"?e(...t):!!e}function wN(e,t,r){let o=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),o||(o=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var ua=(()=>{let e=()=>pN;return{isServer(){return e()},setIsServer(t){e=t}}})();function cf(){let e,t;const r=new Promise((a,c)=>{e=a,t=c});r.status="pending",r.catch(()=>{});function o(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{o({status:"fulfilled",value:a}),e(a)},r.reject=a=>{o({status:"rejected",reason:a}),t(a)},r}var xN=fN;function bN(){let e=[],t=0,r=p=>{p()},o=p=>{p()},a=xN;const c=p=>{t?e.push(p):a(()=>{r(p)})},d=()=>{const p=e;e=[],p.length&&a(()=>{o(()=>{p.forEach(g=>{r(g)})})})};return{batch:p=>{let g;t++;try{g=p()}finally{t--,t||d()}return g},batchCalls:p=>(...g)=>{c(()=>{p(...g)})},schedule:c,setNotifyFunction:p=>{r=p},setBatchNotifyFunction:p=>{o=p},setScheduler:p=>{a=p}}}var yt=bN(),Qo,ms,Go,yv,SN=(yv=class extends mi{constructor(){super();_e(this,Qo,!0);_e(this,ms);_e(this,Go);ue(this,Go,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",o)}}})}onSubscribe(){P(this,ms)||this.setEventListener(P(this,Go))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,ms))==null||t.call(this),ue(this,ms,void 0))}setEventListener(t){var r;ue(this,Go,t),(r=P(this,ms))==null||r.call(this),ue(this,ms,t(this.setOnline.bind(this)))}setOnline(t){P(this,Qo)!==t&&(ue(this,Qo,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return P(this,Qo)}},Qo=new WeakMap,ms=new WeakMap,Go=new WeakMap,yv),uc=new SN;function kN(e){return Math.min(1e3*2**e,3e4)}function Zv(e){return(e??"online")==="online"?uc.isOnline():!0}var uf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Jv(e){let t=!1,r=0,o;const a=cf(),c=()=>a.status!=="pending",d=k=>{var C;if(!c()){const _=new uf(k);x(_),(C=e.onCancel)==null||C.call(e,_)}},p=()=>{t=!0},g=()=>{t=!1},v=()=>rp.isFocused()&&(e.networkMode==="always"||uc.isOnline())&&e.canRun(),w=()=>Zv(e.networkMode)&&e.canRun(),f=k=>{c()||(o==null||o(),a.resolve(k))},x=k=>{c()||(o==null||o(),a.reject(k))},S=()=>new Promise(k=>{var C;o=_=>{(c()||v())&&k(_)},(C=e.onPause)==null||C.call(e)}).then(()=>{var k;o=void 0,c()||(k=e.onContinue)==null||k.call(e)}),N=()=>{if(c())return;let k;const C=r===0?e.initialPromise:void 0;try{k=C??e.fn()}catch(_){k=Promise.reject(_)}Promise.resolve(k).then(f).catch(_=>{var K;if(c())return;const R=e.retry??(ua.isServer()?0:3),I=e.retryDelay??kN,j=typeof I=="function"?I(r,_):I,G=R===!0||typeof R=="number"&&r<R||typeof R=="function"&&R(r,_);if(t||!G){x(_);return}r++,(K=e.onFail)==null||K.call(e,r,_),gN(j).then(()=>v()?void 0:S()).then(()=>{t?x(_):N()})})};return{promise:a,status:()=>a.status,cancel:d,continue:()=>(o==null||o(),a),cancelRetry:p,continueRetry:g,canStart:w,start:()=>(w()?N():S().then(N),a)}}var Hs,vv,Yv=(vv=class{constructor(){_e(this,Hs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),of(this.gcTime)&&ue(this,Hs,Bs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ua.isServer()?1/0:300*1e3))}clearGcTimeout(){P(this,Hs)!==void 0&&(Bs.clearTimeout(P(this,Hs)),ue(this,Hs,void 0))}},Hs=new WeakMap,vv);function _N(e){return{onFetch:(t,r)=>{var w,f,x,S,N;const o=t.options,a=(x=(f=(w=t.fetchOptions)==null?void 0:w.meta)==null?void 0:f.fetchMore)==null?void 0:x.direction,c=((S=t.state.data)==null?void 0:S.pages)||[],d=((N=t.state.data)==null?void 0:N.pageParams)||[];let p={pages:[],pageParams:[]},g=0;const v=async()=>{let k=!1;const C=I=>{wN(I,()=>t.signal,()=>k=!0)},_=Qv(t.options,t.fetchOptions),R=async(I,j,G)=>{if(k)return Promise.reject(t.signal.reason);if(j==null&&I.pages.length)return Promise.resolve(I);const A=(()=>{const le={client:t.client,queryKey:t.queryKey,pageParam:j,direction:G?"backward":"forward",meta:t.options.meta};return C(le),le})(),M=await _(A),{maxPages:Y}=t.options,V=G?vN:yN;return{pages:V(I.pages,M,Y),pageParams:V(I.pageParams,j,Y)}};if(a&&c.length){const I=a==="backward",j=I?CN:Xg,G={pages:c,pageParams:d},K=j(o,G);p=await R(G,K,I)}else{const I=e??c.length;do{const j=g===0?d[0]??o.initialPageParam:Xg(o,p);if(g>0&&j==null)break;p=await R(p,j),g++}while(g<I)}return p};t.options.persister?t.fetchFn=()=>{var k,C;return(C=(k=t.options).persister)==null?void 0:C.call(k,v,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=v}}}function Xg(e,{pages:t,pageParams:r}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function CN(e,{pages:t,pageParams:r}){var o;return t.length>0?(o=e.getPreviousPageParam)==null?void 0:o.call(e,t[0],t,r[0],r):void 0}var Zo,qs,Jo,Mn,Ks,Rt,ga,Qs,bn,Xv,Ar,wv,NN=(wv=class extends Yv{constructor(t){super();_e(this,bn);_e(this,Zo);_e(this,qs);_e(this,Jo);_e(this,Mn);_e(this,Ks);_e(this,Rt);_e(this,ga);_e(this,Qs);ue(this,Qs,!1),ue(this,ga,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,Ks,t.client),ue(this,Mn,P(this,Ks).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,qs,ty(this.options)),this.state=t.state??P(this,qs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return P(this,Zo)}get promise(){var t;return(t=P(this,Rt))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,ga),...t},t!=null&&t._type&&ue(this,Zo,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ty(this.options);r.data!==void 0&&(this.setState(ey(r.data,r.dataUpdatedAt)),ue(this,qs,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Mn).remove(this)}setData(t,r){const o=lf(this.state.data,t,this.options);return $e(this,bn,Ar).call(this,{data:o,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),o}setState(t){$e(this,bn,Ar).call(this,{type:"setState",state:t})}cancel(t){var o,a;const r=(o=P(this,Rt))==null?void 0:o.promise;return(a=P(this,Rt))==null||a.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return P(this,qs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Sn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ip||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ss(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Kv(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Rt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Rt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Mn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(P(this,Rt)&&(P(this,Qs)||$e(this,bn,Xv).call(this)?P(this,Rt).cancel({revert:!0}):P(this,Rt).cancelRetry()),this.scheduleGc()),P(this,Mn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,bn,Ar).call(this,{type:"invalidate"})}async fetch(t,r){var v,w,f,x,S,N,k,C,_,R,I;if(this.state.fetchStatus!=="idle"&&((v=P(this,Rt))==null?void 0:v.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,Rt))return P(this,Rt).continueRetry(),P(this,Rt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(G=>G.options.queryFn);j&&this.setOptions(j.options)}const o=new AbortController,a=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ue(this,Qs,!0),o.signal)})},c=()=>{const j=Qv(this.options,r),K=(()=>{const A={client:P(this,Ks),queryKey:this.queryKey,meta:this.meta};return a(A),A})();return ue(this,Qs,!1),this.options.persister?this.options.persister(j,K,this):j(K)},p=(()=>{const j={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:P(this,Ks),state:this.state,fetchFn:c};return a(j),j})(),g=P(this,Zo)==="infinite"?_N(this.options.pages):this.options.behavior;g==null||g.onFetch(p,this),ue(this,Jo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((w=p.fetchOptions)==null?void 0:w.meta))&&$e(this,bn,Ar).call(this,{type:"fetch",meta:(f=p.fetchOptions)==null?void 0:f.meta}),ue(this,Rt,Jv({initialPromise:r==null?void 0:r.initialPromise,fn:p.fetchFn,onCancel:j=>{j instanceof uf&&j.revert&&this.setState({...P(this,Jo),fetchStatus:"idle"}),o.abort()},onFail:(j,G)=>{$e(this,bn,Ar).call(this,{type:"failed",failureCount:j,error:G})},onPause:()=>{$e(this,bn,Ar).call(this,{type:"pause"})},onContinue:()=>{$e(this,bn,Ar).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const j=await P(this,Rt).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(S=(x=P(this,Mn).config).onSuccess)==null||S.call(x,j,this),(k=(N=P(this,Mn).config).onSettled)==null||k.call(N,j,this.state.error,this),j}catch(j){if(j instanceof uf){if(j.silent)return P(this,Rt).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw $e(this,bn,Ar).call(this,{type:"error",error:j}),(_=(C=P(this,Mn).config).onError)==null||_.call(C,j,this),(I=(R=P(this,Mn).config).onSettled)==null||I.call(R,this.state.data,j,this),j}finally{this.scheduleGc()}}},Zo=new WeakMap,qs=new WeakMap,Jo=new WeakMap,Mn=new WeakMap,Ks=new WeakMap,Rt=new WeakMap,ga=new WeakMap,Qs=new WeakMap,bn=new WeakSet,Xv=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ar=function(t){const r=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...ew(o.data,this.options),fetchMeta:t.meta??null};case"success":const a={...o,...ey(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Jo,t.manual?a:void 0),a;case"error":const c=t.error;return{...o,error:c,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),P(this,Mn).notify({query:this,type:"updated",action:t})})},wv);function ew(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ey(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ty(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var un,Ve,ya,Qt,Gs,Yo,$r,gs,va,Xo,ei,Zs,Js,ys,ti,He,ra,df,ff,pf,hf,mf,gf,yf,tw,xv,ap=(xv=class extends mi{constructor(t,r){super();_e(this,He);_e(this,un);_e(this,Ve);_e(this,ya);_e(this,Qt);_e(this,Gs);_e(this,Yo);_e(this,$r);_e(this,gs);_e(this,va);_e(this,Xo);_e(this,ei);_e(this,Zs);_e(this,Js);_e(this,ys);_e(this,ti,new Set);this.options=r,ue(this,un,t),ue(this,gs,null),ue(this,$r,cf()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Ve).addObserver(this),ny(P(this,Ve),this.options)?$e(this,He,ra).call(this):this.updateResult(),$e(this,He,hf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(P(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(P(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,He,mf).call(this),$e(this,He,gf).call(this),P(this,Ve).removeObserver(this)}setOptions(t){const r=this.options,o=P(this,Ve);if(this.options=P(this,un).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sn(this.options.enabled,P(this,Ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,He,yf).call(this),P(this,Ve).setOptions(this.options),r._defaulted&&!cc(this.options,r)&&P(this,un).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Ve),observer:this});const a=this.hasListeners();a&&ry(P(this,Ve),o,this.options,r)&&$e(this,He,ra).call(this),this.updateResult(),a&&(P(this,Ve)!==o||Sn(this.options.enabled,P(this,Ve))!==Sn(r.enabled,P(this,Ve))||Ss(this.options.staleTime,P(this,Ve))!==Ss(r.staleTime,P(this,Ve)))&&$e(this,He,df).call(this);const c=$e(this,He,ff).call(this);a&&(P(this,Ve)!==o||Sn(this.options.enabled,P(this,Ve))!==Sn(r.enabled,P(this,Ve))||c!==P(this,ys))&&$e(this,He,pf).call(this,c)}getOptimisticResult(t){const r=P(this,un).getQueryCache().build(P(this,un),t),o=this.createResult(r,t);return ON(this,o)&&(ue(this,Qt,o),ue(this,Yo,this.options),ue(this,Gs,P(this,Ve).state)),o}getCurrentResult(){return P(this,Qt)}trackResult(t,r){return new Proxy(t,{get:(o,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&P(this,$r).status==="pending"&&P(this,$r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,a))})}trackProp(t){P(this,ti).add(t)}getCurrentQuery(){return P(this,Ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,un).defaultQueryOptions(t),o=P(this,un).getQueryCache().build(P(this,un),r);return o.fetch().then(()=>this.createResult(o,r))}fetch(t){return $e(this,He,ra).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Qt)))}createResult(t,r){var Y;const o=P(this,Ve),a=this.options,c=P(this,Qt),d=P(this,Gs),p=P(this,Yo),v=t!==o?t.state:P(this,ya),{state:w}=t;let f={...w},x=!1,S;if(r._optimisticResults){const V=this.hasListeners(),le=!V&&ny(t,r),he=V&&ry(t,o,r,a);(le||he)&&(f={...f,...ew(w.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:N,errorUpdatedAt:k,status:C}=f;S=f.data;let _=!1;if(r.placeholderData!==void 0&&S===void 0&&C==="pending"){let V;c!=null&&c.isPlaceholderData&&r.placeholderData===(p==null?void 0:p.placeholderData)?(V=c.data,_=!0):V=typeof r.placeholderData=="function"?r.placeholderData((Y=P(this,ei))==null?void 0:Y.state.data,P(this,ei)):r.placeholderData,V!==void 0&&(C="success",S=lf(c==null?void 0:c.data,V,r),x=!0)}if(r.select&&S!==void 0&&!_)if(c&&S===(d==null?void 0:d.data)&&r.select===P(this,va))S=P(this,Xo);else try{ue(this,va,r.select),S=r.select(S),S=lf(c==null?void 0:c.data,S,r),ue(this,Xo,S),ue(this,gs,null)}catch(V){ue(this,gs,V)}P(this,gs)&&(N=P(this,gs),S=P(this,Xo),k=Date.now(),C="error");const R=f.fetchStatus==="fetching",I=C==="pending",j=C==="error",G=I&&R,K=S!==void 0,M={status:C,fetchStatus:f.fetchStatus,isPending:I,isSuccess:C==="success",isError:j,isInitialLoading:G,isLoading:G,data:S,dataUpdatedAt:f.dataUpdatedAt,error:N,errorUpdatedAt:k,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>v.dataUpdateCount||f.errorUpdateCount>v.errorUpdateCount,isFetching:R,isRefetching:R&&!I,isLoadingError:j&&!K,isPaused:f.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:j&&K,isStale:lp(t,r),refetch:this.refetch,promise:P(this,$r),isEnabled:Sn(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=M.data!==void 0,le=M.status==="error"&&!V,he=ce=>{le?ce.reject(M.error):V&&ce.resolve(M.data)},pe=()=>{const ce=ue(this,$r,M.promise=cf());he(ce)},fe=P(this,$r);switch(fe.status){case"pending":t.queryHash===o.queryHash&&he(fe);break;case"fulfilled":(le||M.data!==fe.value)&&pe();break;case"rejected":(!le||M.error!==fe.reason)&&pe();break}}return M}updateResult(){const t=P(this,Qt),r=this.createResult(P(this,Ve),this.options);if(ue(this,Gs,P(this,Ve).state),ue(this,Yo,this.options),P(this,Gs).data!==void 0&&ue(this,ei,P(this,Ve)),cc(r,t))return;ue(this,Qt,r);const o=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,c=typeof a=="function"?a():a;if(c==="all"||!c&&!P(this,ti).size)return!0;const d=new Set(c??P(this,ti));return this.options.throwOnError&&d.add("error"),Object.keys(P(this,Qt)).some(p=>{const g=p;return P(this,Qt)[g]!==t[g]&&d.has(g)})};$e(this,He,tw).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,He,hf).call(this)}},un=new WeakMap,Ve=new WeakMap,ya=new WeakMap,Qt=new WeakMap,Gs=new WeakMap,Yo=new WeakMap,$r=new WeakMap,gs=new WeakMap,va=new WeakMap,Xo=new WeakMap,ei=new WeakMap,Zs=new WeakMap,Js=new WeakMap,ys=new WeakMap,ti=new WeakMap,He=new WeakSet,ra=function(t){$e(this,He,yf).call(this);let r=P(this,Ve).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},df=function(){$e(this,He,mf).call(this);const t=Ss(this.options.staleTime,P(this,Ve));if(ua.isServer()||P(this,Qt).isStale||!of(t))return;const o=Kv(P(this,Qt).dataUpdatedAt,t)+1;ue(this,Zs,Bs.setTimeout(()=>{P(this,Qt).isStale||this.updateResult()},o))},ff=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Ve)):this.options.refetchInterval)??!1},pf=function(t){$e(this,He,gf).call(this),ue(this,ys,t),!(ua.isServer()||Sn(this.options.enabled,P(this,Ve))===!1||!of(P(this,ys))||P(this,ys)===0)&&ue(this,Js,Bs.setInterval(()=>{(this.options.refetchIntervalInBackground||rp.isFocused())&&$e(this,He,ra).call(this)},P(this,ys)))},hf=function(){$e(this,He,df).call(this),$e(this,He,pf).call(this,$e(this,He,ff).call(this))},mf=function(){P(this,Zs)!==void 0&&(Bs.clearTimeout(P(this,Zs)),ue(this,Zs,void 0))},gf=function(){P(this,Js)!==void 0&&(Bs.clearInterval(P(this,Js)),ue(this,Js,void 0))},yf=function(){const t=P(this,un).getQueryCache().build(P(this,un),this.options);if(t===P(this,Ve))return;const r=P(this,Ve);ue(this,Ve,t),ue(this,ya,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},tw=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,Qt))}),P(this,un).getQueryCache().notify({query:P(this,Ve),type:"observerResultsUpdated"})})},xv);function EN(e,t){return Sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Sn(t.retryOnMount,e)===!1)}function ny(e,t){return EN(e,t)||e.state.data!==void 0&&vf(e,t,t.refetchOnMount)}function vf(e,t,r){if(Sn(t.enabled,e)!==!1&&Ss(t.staleTime,e)!=="static"){const o=typeof r=="function"?r(e):r;return o==="always"||o!==!1&&lp(e,t)}return!1}function ry(e,t,r,o){return(e!==t||Sn(o.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&lp(e,r)}function lp(e,t){return Sn(t.enabled,e)!==!1&&e.isStaleByTime(Ss(t.staleTime,e))}function ON(e,t){return!cc(e.getCurrentResult(),t)}var wa,pr,Ut,Ys,hr,ds,bv,PN=(bv=class extends Yv{constructor(t){super();_e(this,hr);_e(this,wa);_e(this,pr);_e(this,Ut);_e(this,Ys);ue(this,wa,t.client),this.mutationId=t.mutationId,ue(this,Ut,t.mutationCache),ue(this,pr,[]),this.state=t.state||jN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,pr).includes(t)||(P(this,pr).push(t),this.clearGcTimeout(),P(this,Ut).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,pr,P(this,pr).filter(r=>r!==t)),this.scheduleGc(),P(this,Ut).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,pr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Ut).remove(this))}continue(){var t;return((t=P(this,Ys))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,p,g,v,w,f,x,S,N,k,C,_,R,I,j,G,K,A;const r=()=>{$e(this,hr,ds).call(this,{type:"continue"})},o={client:P(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,Ys,Jv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(M,Y)=>{$e(this,hr,ds).call(this,{type:"failed",failureCount:M,error:Y})},onPause:()=>{$e(this,hr,ds).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Ut).canRun(this)}));const a=this.state.status==="pending",c=!P(this,Ys).canStart();try{if(a)r();else{$e(this,hr,ds).call(this,{type:"pending",variables:t,isPaused:c}),P(this,Ut).config.onMutate&&await P(this,Ut).config.onMutate(t,this,o);const Y=await((p=(d=this.options).onMutate)==null?void 0:p.call(d,t,o));Y!==this.state.context&&$e(this,hr,ds).call(this,{type:"pending",context:Y,variables:t,isPaused:c})}const M=await P(this,Ys).start();return await((v=(g=P(this,Ut).config).onSuccess)==null?void 0:v.call(g,M,t,this.state.context,this,o)),await((f=(w=this.options).onSuccess)==null?void 0:f.call(w,M,t,this.state.context,o)),await((S=(x=P(this,Ut).config).onSettled)==null?void 0:S.call(x,M,null,this.state.variables,this.state.context,this,o)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,M,null,t,this.state.context,o)),$e(this,hr,ds).call(this,{type:"success",data:M}),M}catch(M){try{await((_=(C=P(this,Ut).config).onError)==null?void 0:_.call(C,M,t,this.state.context,this,o))}catch(Y){Promise.reject(Y)}try{await((I=(R=this.options).onError)==null?void 0:I.call(R,M,t,this.state.context,o))}catch(Y){Promise.reject(Y)}try{await((G=(j=P(this,Ut).config).onSettled)==null?void 0:G.call(j,void 0,M,this.state.variables,this.state.context,this,o))}catch(Y){Promise.reject(Y)}try{await((A=(K=this.options).onSettled)==null?void 0:A.call(K,void 0,M,t,this.state.context,o))}catch(Y){Promise.reject(Y)}throw $e(this,hr,ds).call(this,{type:"error",error:M}),M}finally{P(this,Ut).runNext(this)}}},wa=new WeakMap,pr=new WeakMap,Ut=new WeakMap,Ys=new WeakMap,hr=new WeakSet,ds=function(t){const r=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),yt.batch(()=>{P(this,pr).forEach(o=>{o.onMutationUpdate(t)}),P(this,Ut).notify({mutation:this,type:"updated",action:t})})},bv);function jN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ir,Qn,xa,Sv,TN=(Sv=class extends mi{constructor(t={}){super();_e(this,Ir);_e(this,Qn);_e(this,xa);this.config=t,ue(this,Ir,new Set),ue(this,Qn,new Map),ue(this,xa,0)}build(t,r,o){const a=new PN({client:t,mutationCache:this,mutationId:++Ll(this,xa)._,options:t.defaultMutationOptions(r),state:o});return this.add(a),a}add(t){P(this,Ir).add(t);const r=Vl(t);if(typeof r=="string"){const o=P(this,Qn).get(r);o?o.push(t):P(this,Qn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,Ir).delete(t)){const r=Vl(t);if(typeof r=="string"){const o=P(this,Qn).get(r);if(o)if(o.length>1){const a=o.indexOf(t);a!==-1&&o.splice(a,1)}else o[0]===t&&P(this,Qn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Vl(t);if(typeof r=="string"){const o=P(this,Qn).get(r),a=o==null?void 0:o.find(c=>c.state.status==="pending");return!a||a===t}else return!0}runNext(t){var o;const r=Vl(t);if(typeof r=="string"){const a=(o=P(this,Qn).get(r))==null?void 0:o.find(c=>c!==t&&c.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yt.batch(()=>{P(this,Ir).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,Ir).clear(),P(this,Qn).clear()})}getAll(){return Array.from(P(this,Ir))}find(t){const r={exact:!0,...t};return this.getAll().find(o=>Zg(r,o))}findAll(t={}){return this.getAll().filter(r=>Zg(t,r))}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},Ir=new WeakMap,Qn=new WeakMap,xa=new WeakMap,Sv);function Vl(e){var t;return(t=e.options.scope)==null?void 0:t.id}function sy(e,t){const r=new Set(t);return e.filter(o=>!r.has(o))}function RN(e,t,r){const o=e.slice(0);return o[t]=r,o}var ni,dn,ri,Xs,xn,vs,ba,Sa,ka,_a,Nt,wf,xf,nw,bf,Sf,kf,kv,AN=(kv=class extends mi{constructor(t,r,o){super();_e(this,Nt);_e(this,ni);_e(this,dn);_e(this,ri);_e(this,Xs);_e(this,xn);_e(this,vs);_e(this,ba);_e(this,Sa);_e(this,ka);_e(this,_a,[]);ue(this,ni,t),ue(this,Xs,o),ue(this,ri,[]),ue(this,xn,[]),ue(this,dn,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&P(this,xn).forEach(t=>{t.subscribe(r=>{$e(this,Nt,Sf).call(this,t,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,P(this,xn).forEach(t=>{t.destroy()})}setQueries(t,r){ue(this,ri,t),ue(this,Xs,r),yt.batch(()=>{const o=P(this,xn),a=$e(this,Nt,bf).call(this,P(this,ri));a.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const c=a.map(f=>f.observer),d=c.map(f=>f.getCurrentResult()),p=o.length!==c.length,g=c.some((f,x)=>f!==o[x]),v=p||g,w=v?!0:d.some((f,x)=>{const S=P(this,dn)[x];return!S||!cc(f,S)});!v&&!w||(v&&(ue(this,_a,a),ue(this,xn,c)),ue(this,dn,d),this.hasListeners()&&(v&&(sy(o,c).forEach(f=>{f.destroy()}),sy(c,o).forEach(f=>{f.subscribe(x=>{$e(this,Nt,Sf).call(this,f,x)})})),$e(this,Nt,kf).call(this)))})}getCurrentResult(){return P(this,dn)}getQueries(){return P(this,xn).map(t=>t.getCurrentQuery())}getObservers(){return P(this,xn)}getOptimisticResult(t,r){const o=$e(this,Nt,bf).call(this,t),a=o.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),c=o.map(d=>d.defaultedQueryOptions.queryHash);return[a,d=>$e(this,Nt,xf).call(this,d??a,r,c),()=>$e(this,Nt,wf).call(this,a,o)]}},ni=new WeakMap,dn=new WeakMap,ri=new WeakMap,Xs=new WeakMap,xn=new WeakMap,vs=new WeakMap,ba=new WeakMap,Sa=new WeakMap,ka=new WeakMap,_a=new WeakMap,Nt=new WeakSet,wf=function(t,r){return r.map((o,a)=>{const c=t[a];return o.defaultedQueryOptions.notifyOnChangeProps?c:o.observer.trackResult(c,d=>{r.forEach(p=>{p.observer.trackProp(d)})})})},xf=function(t,r,o){if(r){const a=P(this,ka),c=o!==void 0&&a!==void 0&&(a.length!==o.length||o.some((d,p)=>d!==a[p]));return(!P(this,vs)||P(this,dn)!==P(this,Sa)||c||r!==P(this,ba))&&(ue(this,ba,r),ue(this,Sa,P(this,dn)),o!==void 0&&ue(this,ka,o),ue(this,vs,op(P(this,vs),r(t)))),P(this,vs)}return t},nw=function(){var t;return((t=P(this,Xs))==null?void 0:t.combine)!==void 0&&P(this,xn).some((r,o)=>{var a;return r.options.suspense&&((a=P(this,dn)[o])==null?void 0:a.data)===void 0})},bf=function(t){const r=new Map;P(this,xn).forEach(a=>{const c=a.options.queryHash;if(!c)return;const d=r.get(c);d?d.push(a):r.set(c,[a])});const o=[];return t.forEach(a=>{var g;const c=P(this,ni).defaultQueryOptions(a),p=((g=r.get(c.queryHash))==null?void 0:g.shift())??new ap(P(this,ni),c);o.push({defaultedQueryOptions:c,observer:p})}),o},Sf=function(t,r){const o=P(this,xn).indexOf(t);o!==-1&&(ue(this,dn,RN(P(this,dn),o,r)),$e(this,Nt,kf).call(this))},kf=function(){var t;if(this.hasListeners()){const r=$e(this,Nt,wf).call(this,P(this,dn),P(this,_a)),o=$e(this,Nt,nw).call(this),a=P(this,vs),c=o?a:$e(this,Nt,xf).call(this,r,(t=P(this,Xs))==null?void 0:t.combine);(o||a!==c)&&yt.batch(()=>{this.listeners.forEach(d=>{d(P(this,dn))})})}},kv),mr,_v,MN=(_v=class extends mi{constructor(t={}){super();_e(this,mr);this.config=t,ue(this,mr,new Map)}build(t,r,o){const a=r.queryKey,c=r.queryHash??sp(a,r);let d=this.get(c);return d||(d=new NN({client:t,queryKey:a,queryHash:c,options:t.defaultQueryOptions(r),state:o,defaultOptions:t.getQueryDefaults(a)}),this.add(d)),d}add(t){P(this,mr).has(t.queryHash)||(P(this,mr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,mr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,mr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,mr).get(t)}getAll(){return[...P(this,mr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(o=>Gg(r,o))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(o=>Gg(t,o)):r}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mr=new WeakMap,_v),it,ws,xs,si,oi,bs,ii,ai,Cv,$N=(Cv=class{constructor(e={}){_e(this,it);_e(this,ws);_e(this,xs);_e(this,si);_e(this,oi);_e(this,bs);_e(this,ii);_e(this,ai);ue(this,it,e.queryCache||new MN),ue(this,ws,e.mutationCache||new TN),ue(this,xs,e.defaultOptions||{}),ue(this,si,new Map),ue(this,oi,new Map),ue(this,bs,0)}mount(){Ll(this,bs)._++,P(this,bs)===1&&(ue(this,ii,rp.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,it).onFocus())})),ue(this,ai,uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,it).onOnline())})))}unmount(){var e,t;Ll(this,bs)._--,P(this,bs)===0&&((e=P(this,ii))==null||e.call(this),ue(this,ii,void 0),(t=P(this,ai))==null||t.call(this),ue(this,ai,void 0))}isFetching(e){return P(this,it).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,ws).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,it).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=P(this,it).build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ss(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return P(this,it).findAll(e).map(({queryKey:t,state:r})=>{const o=r.data;return[t,o]})}setQueryData(e,t,r){const o=this.defaultQueryOptions({queryKey:e}),a=P(this,it).get(o.queryHash),c=a==null?void 0:a.state.data,d=hN(t,c);if(d!==void 0)return P(this,it).build(this,o).setData(d,{...r,manual:!0})}setQueriesData(e,t,r){return yt.batch(()=>P(this,it).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,it).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=P(this,it);yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,it);return yt.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},o=yt.batch(()=>P(this,it).findAll(e).map(a=>a.cancel(r)));return Promise.all(o).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return yt.batch(()=>(P(this,it).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},o=yt.batch(()=>P(this,it).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let c=a.fetch(void 0,r);return r.throwOnError||(c=c.catch(Gt)),a.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=P(this,it).build(this,t);return r.isStaleByTime(Ss(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return uc.isOnline()?P(this,ws).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,it)}getMutationCache(){return P(this,ws)}getDefaultOptions(){return P(this,xs)}setDefaultOptions(e){ue(this,xs,e)}setQueryDefaults(e,t){P(this,si).set(ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,si).values()],r={};return t.forEach(o=>{di(e,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(e,t){P(this,oi).set(ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,oi).values()],r={};return t.forEach(o=>{di(e,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,xs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ip&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,xs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,it).clear(),P(this,ws).clear()}},it=new WeakMap,ws=new WeakMap,xs=new WeakMap,si=new WeakMap,oi=new WeakMap,bs=new WeakMap,ii=new WeakMap,ai=new WeakMap,Cv),rw=y.createContext(void 0),Oc=e=>{const t=y.useContext(rw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},IN=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(rw.Provider,{value:e,children:t})),sw=y.createContext(!1),ow=()=>y.useContext(sw);sw.Provider;function DN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var LN=y.createContext(DN()),iw=()=>y.useContext(LN),aw=(e,t,r)=>{const o=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Gv(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=!1))},lw=e=>{y.useEffect(()=>{e.clearReset()},[e])},cw=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(a&&e.data===void 0||Gv(r,[e.error,o])),uw=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...a)=>r(o(...a)):r(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zN=(e,t)=>e.isLoading&&e.isFetching&&!t,_f=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Cf=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function FN({queries:e,...t},r){const o=Oc(),a=ow(),c=iw(),d=y.useMemo(()=>e.map(k=>{const C=o.defaultQueryOptions(k);return C._optimisticResults=a?"isRestoring":"optimistic",C}),[e,o,a]);d.forEach(k=>{uw(k);const C=o.getQueryCache().get(k.queryHash);aw(k,c,C)}),lw(c);const[p]=y.useState(()=>new AN(o,d,t)),[g,v,w]=p.getOptimisticResult(d,t.combine),f=!a&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(k=>f?p.subscribe(yt.batchCalls(k)):Gt,[p,f]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setQueries(d,t)},[d,t,p]);const S=g.some((k,C)=>_f(d[C],k))?g.flatMap((k,C)=>{const _=d[C];if(_&&_f(_,k)){const R=new ap(o,_);return Cf(_,R,c)}return[]}):[];if(S.length>0)throw Promise.all(S);const N=g.find((k,C)=>{const _=d[C];return _&&cw({result:k,errorResetBoundary:c,throwOnError:_.throwOnError,query:o.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(N!=null&&N.error)throw N.error;return v(w())}function UN(e,t,r){var S,N,k,C;const o=ow(),a=iw(),c=Oc(),d=c.defaultQueryOptions(e);(N=(S=c.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||N.call(S,d);const p=c.getQueryCache().get(d.queryHash),g=e.subscribed!==!1;d._optimisticResults=o?"isRestoring":g?"optimistic":void 0,uw(d),aw(d,a,p),lw(a);const v=!c.getQueryCache().get(d.queryHash),[w]=y.useState(()=>new t(c,d)),f=w.getOptimisticResult(d),x=!o&&g;if(y.useSyncExternalStore(y.useCallback(_=>{const R=x?w.subscribe(yt.batchCalls(_)):Gt;return w.updateResult(),R},[w,x]),()=>w.getCurrentResult(),()=>w.getCurrentResult()),y.useEffect(()=>{w.setOptions(d)},[d,w]),_f(d,f))throw Cf(d,w,a);if(cw({result:f,errorResetBoundary:a,throwOnError:d.throwOnError,query:p,suspense:d.suspense}))throw f.error;if((C=(k=c.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||C.call(k,d,f),d.experimental_prefetchInRender&&!ua.isServer()&&zN(f,o)){const _=v?Cf(d,w,a):p==null?void 0:p.promise;_==null||_.catch(Gt).finally(()=>{w.updateResult()})}return d.notifyOnChangeProps?f:w.trackResult(f)}function Lr(e,t){return UN(e,ap)}const z={nests:["nests"],nestList:(e=!1)=>[...z.nestListAll(),e?"archived":"live"],nestListAll:()=>[...z.nests,"list"],unsynced:()=>[...z.nests,"unsynced"],nest:e=>[...z.nests,"detail",e],settings:e=>[...z.nest(e),"settings"],nodes:e=>[...z.nest(e),"nodes"],folderNodes:(e,t)=>[...z.nodes(e),"folder",t],nodesMeta:(e,t=!1)=>[...z.nodes(e),"meta",t?"approved":"all"],census:e=>[...z.nodes(e),"census"],stewards:e=>[...z.nest(e),"stewards"],collaborators:e=>[...z.nest(e),"collaborators"],mentionable:e=>[...z.nest(e),"mentionable"],definitions:e=>[...z.nest(e),"definitions"],commentCounts:e=>[...z.nest(e),"comment-counts"],overview:e=>[...z.nest(e),"overview"],tags:e=>[...z.nest(e),"tags"],graph:e=>[...z.nest(e),"graph"],edgeTypes:e=>[...z.nest(e),"edge-types"],edges:e=>[...z.nest(e),"edges"],schedules:e=>[...z.nest(e),"schedules"],env:e=>[...z.nest(e),"env"],connectors:e=>[...z.nest(e),"connectors"],nestTeams:e=>[...z.nest(e),"teams"],externalEdits:e=>[...z.nest(e),"external-edits"],externalEditCount:e=>[...z.externalEdits(e),"count"],hooks:(e,t)=>[...z.nest(e),"hooks",t??"all"],reviewQueue:(e,t)=>[...z.nest(e),"review-queue",t],deletionRequests:(e,t)=>[...z.nest(e),"deletion-requests",t],feed:(e,t,r,o)=>[...z.nest(e),"feed",t,r,o],node:(e,t)=>[...z.nodes(e),"node",t],nodeVersions:(e,t)=>[...z.node(e,t),"versions"],nodeReviews:(e,t)=>[...z.node(e,t),"reviews"],nodeStewards:(e,t)=>[...z.node(e,t),"stewards"],nodeWatchers:(e,t)=>[...z.node(e,t),"watchers"],nodeAnnotations:(e,t)=>[...z.node(e,t),"annotations"],nodePendingEdit:(e,t)=>[...z.node(e,t),"external-edit"],nodeComments:(e,t,r)=>[...z.node(e,t),"comments",r],nodeActivity:(e,t,r)=>[...z.node(e,t),"activity",r],people:["people"],peopleSuggest:e=>[...z.people,"suggest",e],teams:["teams"],teamList:()=>[...z.teams,"list"],team:e=>[...z.teams,"detail",e],promptowlTeams:()=>[...z.teams,"promptowl"],admin:["admin"],adminSettings:()=>[...z.admin,"settings"],superAdmins:()=>[...z.admin,"super-admins"],communitySites:()=>[...z.admin,"community-sites"],auth:["auth"],teammates:()=>[...z.auth,"teammates"],apiKeys:()=>[...z.auth,"keys"],license:["license"],licenseStatus:()=>[...z.license,"status"],me:["me"],myWork:(e,t)=>[...z.me,"work",e??null,t??null],myDrafts:(e,t,r,o)=>[...z.me,"drafts",e??null,t??null,r??null,o??null],health:["health"],search:["search"],globalSearch:(e,t)=>[...z.search,"global",e,t]},Te={reference:5*6e4,listing:3e4,governance:5e3,content:0};function VN(e,t){const r=t==null?void 0:t.status;return r===401||r===403||r===404?!1:e<2}function BN(){return new $N({defaultOptions:{queries:{retry:VN,gcTime:5*6e4,retryOnMount:!0}}})}const WN=[{match:/^\/nodes\/(.+)\/(?:comments|annotations)(?:\/|$)/,affects:(e,t)=>[z.node(e,t[1]),z.commentCounts(e),[...z.nest(e),"feed"]]},{match:/^\/nodes\/(.+)\/watchers(?:\/|$|\?)/,affects:(e,t)=>[z.nodeWatchers(e,t[1])]},{match:/^\/nodes\/(.+)\/(?:approve|reject|submit-review|revert|external-edits)(?:\/|$)/,affects:e=>[z.nodes(e),[...z.nest(e),"review-queue"],z.externalEdits(e),[...z.nest(e),"feed"],z.me]},{match:/^\/nodes\/(.+)\/request-deletion(?:\/|$)/,affects:e=>[[...z.nest(e),"deletion-requests"],z.me]},{match:/^\/nodes\/(.+)\/move(?:\/|$)/,affects:(e,t)=>[z.node(e,t[1]),z.nodes(e),z.nestListAll(),[...z.nest(e),"feed"]]},{match:/^\/nodes(?:\/)?$/,affects:e=>[z.nodes(e),z.nestListAll(),z.search,[...z.nest(e),"feed"]]},{match:/^\/nodes\/(.+)$/,affects:(e,t)=>[z.node(e,t[1]),z.nodes(e),z.nestListAll(),z.search,[...z.nest(e),"feed"]]},{match:/^\/stewards/,affects:e=>[z.stewards(e),z.mentionable(e),z.nest(e)]},{match:/^\/collaborators/,affects:e=>[z.collaborators(e),z.mentionable(e),z.nest(e)]},{match:/^\/teams/,affects:e=>[z.nestTeams(e),z.teams,z.collaborators(e),z.mentionable(e),z.nest(e)]},{match:/^\/settings/,affects:e=>[z.nest(e)]},{match:/^\/visibility/,affects:e=>[z.nest(e),z.nestListAll()]},{match:/^\/reader-mode/,affects:e=>[z.nest(e),z.nestListAll()]},{match:/^\/definitions/,affects:e=>[z.definitions(e)]},{match:/^\/edges/,affects:e=>[z.edges(e),z.graph(e)]},{match:/^\/edge-types/,affects:e=>[z.edgeTypes(e),z.edges(e)]},{match:/^\/env/,affects:e=>[z.env(e)]},{match:/^\/hooks/,affects:e=>[[...z.nest(e),"hooks"]]},{match:/^\/schedules/,affects:e=>[z.schedules(e)]},{match:/^\/connectors/,affects:e=>[z.connectors(e)]},{match:/^\/external-edits/,affects:e=>[z.externalEdits(e),z.nodes(e)]},{match:/^\/deletion-requests/,affects:e=>[[...z.nest(e),"deletion-requests"],z.nodes(e),z.nestListAll(),z.me]},{match:/^\/(delete-folder|request-deletion)/,affects:e=>[z.nodes(e),z.nestListAll()]},{match:/^\/(archive|restore)/,affects:e=>[z.nest(e),z.nestListAll(),z.me,z.search]},{match:/^\/pin/,affects:()=>[z.nestList()]}];function HN(e,t){var a;const r=c=>void e.invalidateQueries({queryKey:c}),o=(a=t.match(/^\/nests\/([^/?]+)/))==null?void 0:a[1];if(o&&o!=="import"&&o!=="unsynced"){const c=t.slice(`/nests/${o}`.length).split("?")[0];for(const d of WN){const p=c.match(d.match);if(p){for(const g of d.affects(o,p))r(g);return}}r(z.nest(o)),r(z.nestListAll());return}if(t.startsWith("/nests")){r(z.nestListAll()),r(z.unsynced());return}if(t.startsWith("/teams")){r(z.teams),r(z.nests);return}if(t.startsWith("/admin")){r(z.admin),r(z.auth),r(z.people),r(z.nests);return}if(t.startsWith("/auth")){r(z.auth);return}if(t.startsWith("/license")){r(z.license);return}t.startsWith("/me")&&r(z.me)}function qN(e){Z_({clear:()=>e.clear(),invalidatePath:t=>HN(e,t)})}const Bt={nestList:(e=!1)=>({queryKey:z.nestList(e),queryFn:()=>iC({archived:e}),staleTime:Te.reference}),unsynced:()=>({queryKey:z.unsynced(),queryFn:()=>uC(),staleTime:Te.listing}),nest:e=>({queryKey:z.nest(e),queryFn:()=>dC(e),staleTime:Te.reference}),settings:e=>({queryKey:z.settings(e),queryFn:()=>oC(e),staleTime:Te.reference}),nodes:e=>({queryKey:z.nodes(e),queryFn:()=>pC(e),staleTime:Te.listing}),folderNodes:(e,t)=>({queryKey:z.folderNodes(e,t),queryFn:()=>hC(e,t),staleTime:Te.listing}),nodesMeta:(e,t=!1)=>({queryKey:z.nodesMeta(e,t),queryFn:()=>mC(e,t),staleTime:Te.listing}),census:e=>({queryKey:z.census(e),queryFn:()=>gC(e),staleTime:Te.listing}),stewards:e=>({queryKey:z.stewards(e),queryFn:()=>CC(e),staleTime:Te.reference}),collaborators:e=>({queryKey:z.collaborators(e),queryFn:()=>zC(e),staleTime:Te.reference}),mentionable:e=>({queryKey:z.mentionable(e),queryFn:()=>FC(e),staleTime:Te.reference}),peopleSuggest:e=>({queryKey:z.peopleSuggest(e),queryFn:()=>UC(e),staleTime:Te.reference}),definitions:e=>({queryKey:z.definitions(e),queryFn:()=>fC(e),staleTime:Te.reference}),commentCounts:e=>({queryKey:z.commentCounts(e),queryFn:()=>yC(e),staleTime:Te.listing}),overview:e=>({queryKey:z.overview(e),queryFn:()=>bC(e),staleTime:Te.listing}),globalSearch:(e,t)=>({queryKey:z.globalSearch(e,t),queryFn:()=>xC(e,t),staleTime:Te.listing}),tags:e=>({queryKey:z.tags(e),queryFn:()=>_C(e),staleTime:Te.reference}),graph:e=>({queryKey:z.graph(e),queryFn:()=>KC(e),staleTime:Te.listing}),edgeTypes:e=>({queryKey:z.edgeTypes(e),queryFn:()=>ZC(e),staleTime:Te.reference}),edges:e=>({queryKey:z.edges(e),queryFn:()=>JC(e),staleTime:Te.listing}),schedules:e=>({queryKey:z.schedules(e),queryFn:()=>YC(e),staleTime:Te.reference}),env:e=>({queryKey:z.env(e),queryFn:()=>eN(e),staleTime:Te.reference}),connectors:e=>({queryKey:z.connectors(e),queryFn:()=>nN(e),staleTime:Te.reference}),nestTeams:e=>({queryKey:z.nestTeams(e),queryFn:()=>qC(e),staleTime:Te.reference}),hooks:(e,t)=>({queryKey:z.hooks(e,t),queryFn:()=>tN(e,t),staleTime:Te.reference}),externalEdits:e=>({queryKey:z.externalEdits(e),queryFn:()=>IC(e),staleTime:Te.governance}),externalEditCount:e=>({queryKey:z.externalEditCount(e),queryFn:()=>DC(e),staleTime:Te.governance}),reviewQueue:(e,t="pending")=>({queryKey:z.reviewQueue(e,t),queryFn:()=>OC(e,t),staleTime:Te.governance}),deletionRequests:(e,t="pending")=>({queryKey:z.deletionRequests(e,t),queryFn:()=>EC(e,t),staleTime:Te.governance}),feed:(e,t="all",r=50,o=0)=>({queryKey:z.feed(e,t,r,o),queryFn:()=>PC(e,t,r,o),staleTime:Te.governance}),node:(e,t)=>({queryKey:z.node(e,t),queryFn:()=>vC(e,t),staleTime:Te.content,gcTime:6e4}),nodeVersions:(e,t)=>({queryKey:z.nodeVersions(e,t),queryFn:()=>jC(e,t),staleTime:Te.listing}),nodeReviews:(e,t)=>({queryKey:z.nodeReviews(e,t),queryFn:()=>TC(e,t),staleTime:Te.governance}),nodeStewards:(e,t)=>({queryKey:z.nodeStewards(e,t),queryFn:()=>NC(e,t),staleTime:Te.reference}),nodeWatchers:(e,t)=>({queryKey:z.nodeWatchers(e,t),queryFn:()=>XC(e,t),staleTime:Te.reference}),nodeAnnotations:(e,t)=>({queryKey:z.nodeAnnotations(e,t),queryFn:()=>AC(e,t),staleTime:Te.governance}),nodePendingEdit:(e,t)=>({queryKey:z.nodePendingEdit(e,t),queryFn:()=>LC(e,t),staleTime:Te.governance}),nodeComments:(e,t,r)=>({queryKey:z.nodeComments(e,t,r??"all"),queryFn:()=>MC(e,t,r),staleTime:Te.governance}),nodeActivity:(e,t,r=100)=>({queryKey:z.nodeActivity(e,t,r),queryFn:()=>$C(e,t,r),staleTime:Te.governance}),health:()=>({queryKey:z.health,queryFn:()=>la(),staleTime:Te.reference}),adminSettings:()=>({queryKey:z.adminSettings(),queryFn:()=>X_(),staleTime:Te.reference}),superAdmins:()=>({queryKey:z.superAdmins(),queryFn:()=>nC(),staleTime:Te.reference}),communitySites:()=>({queryKey:z.communitySites(),queryFn:()=>rC(),staleTime:Te.reference}),teammates:()=>({queryKey:z.teammates(),queryFn:()=>tC(),staleTime:Te.reference}),apiKeys:()=>({queryKey:z.apiKeys(),queryFn:()=>sC(),staleTime:Te.reference}),licenseStatus:()=>({queryKey:z.licenseStatus(),queryFn:()=>Hv(),staleTime:Te.reference}),teamList:()=>({queryKey:z.teamList(),queryFn:()=>VC(),staleTime:Te.reference}),team:e=>({queryKey:z.team(e),queryFn:()=>BC(e),staleTime:Te.reference}),promptowlTeams:()=>({queryKey:z.promptowlTeams(),queryFn:()=>HC(),staleTime:Te.reference}),myWork:e=>({queryKey:z.myWork(e==null?void 0:e.limit,e==null?void 0:e.offset),queryFn:()=>QC(e),staleTime:Te.governance}),myDrafts:e=>({queryKey:z.myDrafts(e==null?void 0:e.limit,e==null?void 0:e.offset,e==null?void 0:e.q,e==null?void 0:e.sort),queryFn:()=>GC(e),staleTime:Te.governance})},w4=(e=!1)=>Lr(Bt.nestList(e)),KN=e=>Lr({...Bt.nest(e??""),enabled:!!e}),x4=e=>Lr({...Bt.settings(e??""),enabled:!!e}),b4=(e,t)=>Lr({...Bt.nodeStewards(e??"",t??""),enabled:!!e&&!!t}),S4=e=>Lr({...Bt.apiKeys(),...e}),dw="00000000-0000-0000-0000-000000000000",k4=8,_4=50;function QN(e){return!!(e!=null&&e.archived_at)}function Nf({roles:e,permission:t,myStewards:r,isOwner:o,isAdmin:a,readerMode:c,previewReader:d,isArchived:p}){if(p)return{canManage:!1,collabCanWrite:!1,canReviewDocs:!1,canEditDocs:!1,isReadOnly:!0,isReaderView:!!c};const v=o||a||((...k)=>e.some(C=>k.includes(C)))("owner","admin"),w=t==="owner"||t==="admin"||t==="write",f=v||r.some(k=>k.role==="reviewer"),x=v||w||r.some(k=>k.role==="editor"&&k.scope==="nest"),S=!x&&!f&&!v;return{canManage:v,collabCanWrite:w,canReviewDocs:f,canEditDocs:x,isReadOnly:S,isReaderView:!!c&&(S||!!d)}}function C4(e,t){return!t&&(e==="editor"||e==="admin")}function Ef(e){const t=e.startsWith("nodes/")?e.slice(6):e;return(t.includes("/")?t.slice(t.lastIndexOf("/")+1):t).toLowerCase()}function N4(e,t){return(e==null?void 0:e.id)===t||Ef((e==null?void 0:e.id)||"")===Ef(t)}function E4(e){return[Ef((e==null?void 0:e.id)||""),String((e==null?void 0:e.title)||"").toLowerCase()]}const GN=["board","ontology-graph","definitions"];function fw(e){return GN.includes(e)}function Ld(e,t){return!!t&&fw(e)}const kn="__uncategorized__",ZN=["draft","pending_review","approved","published","rejected","external_edit_pending"],JN={draft:"Draft",pending_review:"Pending Review",approved:"Approved",published:"Published",rejected:"Rejected",external_edit_pending:"External Edit"};function cp(e){const t=e.startsWith("nodes/")?e.slice(6):e,r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function up(e){return(e.tagNamespace??"").trim().split(":")[0].trim()}const pw=e=>e.startsWith("#")?e.slice(1):e,oy=e=>e.startsWith("#")?e:`#${e}`;function YN(e){return e.dimension==="tag"?`tag:${up(e)}`:e.dimension}function O4(e,t){if(!e.startsWith("tag:"))return t;const r=o=>o&&[...new Set(o.map(pw))];return{columnOrder:r(t.columnOrder),hiddenColumns:r(t.hiddenColumns)}}function P4(e){const t=e.layouts[YN(e)]??{};return{dimension:e.dimension,tagNamespace:e.tagNamespace,columnOrder:t.columnOrder??(e.dimension==="status"?ZN:void 0),hiddenColumns:t.hiddenColumns,explicitColumns:e.dimension==="tag"&&t.columnOrder!==void 0}}function hw(e,t){switch(t.dimension){case"folder":return[cp(e.id)];case"status":return[e.status||kn];case"tag":{const r=up(t),o=e.tags.map(pw),a=r?o.filter(c=>c.startsWith(`${r}:`)).map(c=>c.slice(r.length+1)).filter(Boolean):o.filter(Boolean);return a.length>0?[...new Set(a)]:[kn]}}}function XN(e,t){return hw(e,t)[0]}function mw(e,t,r){const o=hw(e,t).filter(a=>!r.has(a));if(t.explicitColumns){const a=new Set((t.columnOrder??[]).filter(c=>!r.has(c)));return o.filter(c=>a.has(c))}return o.length>0?o:[kn]}function eE(e){const t=new Map(e.map(a=>[a,a.split("/")])),r=new Map(e.map(a=>[a,1])),o=a=>t.get(a).slice(-r.get(a)).join("/");for(;;){const a=new Map;for(const d of e){const p=o(d),g=a.get(p);g?g.push(d):a.set(p,[d])}let c=!1;for(const d of a.values())if(!(d.length<2))for(const p of d)r.get(p)<t.get(p).length&&(r.set(p,r.get(p)+1),c=!0);if(!c)break}return new Map(e.map(a=>[a,o(a)]))}function iy(e,t){return e===kn?"Uncategorized":e===""&&t.dimension==="folder"?"(root)":t.dimension==="status"?JN[e]??e.replace(/_/g," "):e}function j4(e){return e!=="tag"}function ay(e,t){return e===kn?"Uncategorized":e===""&&t.dimension==="folder"?"(root)":e}function tE(e,t){const r=new Set(t.hiddenColumns??[]);if(t.explicitColumns){const w=new Set,f=[];for(const x of t.columnOrder??[])r.has(x)||x===kn||w.has(x)||(w.add(x),f.push(x));return f.map(x=>({key:x,label:iy(x,t),title:ay(x,t)}))}const o=new Set;for(const w of e)for(const f of mw(w,t,r))o.add(f);const a=o.has(kn);o.delete(kn);const c=[],d=new Set;for(const w of t.columnOrder??[])r.has(w)||w===kn||d.has(w)||(d.add(w),c.push(w),o.delete(w));const p=[...o].sort(),g=[...c,...p];a&&g.push(kn);const v=t.dimension==="folder"?eE(g.filter(w=>w!==kn&&w!=="")):null;return g.map(w=>({key:w,label:(v==null?void 0:v.get(w))??iy(w,t),title:ay(w,t)}))}function T4(e,t){const r=new Set(t.hiddenColumns??[]),o=tE(e,t),a={};for(const c of o)a[c.key]=[];for(const c of e)for(const d of mw(c,t,r))(a[d]??(a[d]=[])).push(c);return{columns:o,byColumn:a}}function R4(e,t,r,o){switch(r.dimension){case"folder":return XN(e,r)===t?{kind:"unsupported",reason:"Already in this column."}:{kind:"move-folder",folder:t};case"tag":{if(t===kn)return{kind:"unsupported",reason:"Drop onto a tag column to add that tag."};if(o&&o===t)return{kind:"unsupported",reason:"Already in this column."};const a=up(r),c=v=>oy(a?`${a}:${v}`:v),d=o&&o!==kn?c(o):null,p=c(t),g=new Set(e.tags.map(oy));return d&&g.delete(d),!d&&g.has(p)?{kind:"unsupported",reason:"Already in this column."}:(g.add(p),{kind:"retag",tags:[...g]})}case"status":return{kind:"unsupported",reason:"Status changes go through the review workflow, not the board — open the doc and submit for review."}}}const nE={path:"board",label:"Board",icon:Mv,order:1,viewPage:"board"},rE=Object.freeze(Object.defineProperty({__proto__:null,meta:nE},Symbol.toStringTag,{value:"Module"})),sE={path:"definitions",label:"Definitions",icon:jk,order:3,viewPage:"definitions"},oE=Object.freeze(Object.defineProperty({__proto__:null,meta:sE},Symbol.toStringTag,{value:"Module"})),iE={path:"graph",label:"Graph",icon:b_,order:2,viewPage:"ontology-graph"},aE=Object.freeze(Object.defineProperty({__proto__:null,meta:iE},Symbol.toStringTag,{value:"Module"})),lE={path:"workflows",label:"Workflows",icon:q_,order:4,viewPage:"workflows",beta:!0,visible:e=>e.workflowPlaneEnabled&&e.canEditDocs},cE=Object.freeze(Object.defineProperty({__proto__:null,meta:lE},Symbol.toStringTag,{value:"Module"})),uE=Object.assign({"../pages/nest/board/meta.ts":rE,"../pages/nest/definitions/meta.ts":oE,"../pages/nest/graph/meta.ts":aE,"../pages/nest/workflows/meta.ts":cE}),dE=Object.assign({"../pages/nest/board/page.tsx":()=>_t(()=>import("./page-BHD4beun.js"),__vite__mapDeps([0,1,2,3,4,5,6])),"../pages/nest/definitions/page.tsx":()=>_t(()=>import("./page-CIgPJmG6.js"),__vite__mapDeps([7,1,2,8,9])),"../pages/nest/graph/page.tsx":()=>_t(()=>import("./page-CUjuSs5Q.js"),__vite__mapDeps([10,1,2,11,9])),"../pages/nest/workflows/page.tsx":()=>_t(()=>import("./page-xzYqkBUP.js"),__vite__mapDeps([12,13,14,6,9,15,16,17,18,2,8,5,19,20,21,22,1,23,24,25,26,11,4,27,28,29,30,31,32,33,34]))}),fE=e=>e.split("/").slice(-2,-1)[0],Pc=Object.entries(uE).map(([e,t])=>{const r=fE(e),o=dE[e.replace(/meta\.ts$/,"page.tsx")];if(!o)throw new Error(`pages/nest/${r}: meta.ts has no page.tsx beside it`);return{id:r,...t.meta,Component:Jf(o)}}).sort((e,t)=>e.order-t.order),ea=e=>Pc.find(t=>t.viewPage===e),pE=e=>e?Pc.find(t=>t.path===e):void 0,hE=e=>Pc.filter(t=>!t.visible||t.visible(e));function mE(e){if(e==="new")return[];const t=cp(e);if(!t)return[];const r=t.split("/");return r.map((o,a)=>r.slice(0,a+1).join("/"))}function gE(e){const t=new Map;for(const o of e){const a=cp(o.id),c=t.get(a);c?c.push(o):t.set(a,[o])}const r=new Intl.Collator(void 0,{sensitivity:"base"});return[...t.entries()].sort(([o],[a])=>r.compare(o,a)).map(([o,a])=>({folder:o,items:[...a].sort((c,d)=>r.compare(c.title??c.id,d.title??d.id))}))}function A4(e,t){return e||!!t.initialThreadId||!!t.commentMode||!!t.pendingAnchor||!!t.activeThreadId}const gw="contextnest:doc-page",Lo={sidebarCollapsed:!1,commentsOpen:!1,viewsOpen:!1,closedGroups:[]};function jc(e){try{const t=e.getItem(gw);if(!t)return{...Lo};const r=JSON.parse(t);return{sidebarCollapsed:typeof(r==null?void 0:r.sidebarCollapsed)=="boolean"?r.sidebarCollapsed:Lo.sidebarCollapsed,commentsOpen:typeof(r==null?void 0:r.commentsOpen)=="boolean"?r.commentsOpen:Lo.commentsOpen,viewsOpen:typeof(r==null?void 0:r.viewsOpen)=="boolean"?r.viewsOpen:Lo.viewsOpen,closedGroups:Array.isArray(r==null?void 0:r.closedGroups)?r.closedGroups.filter(o=>typeof o=="string"):[...Lo.closedGroups]}}catch{return{...Lo}}}function dp(e,t){try{const r={...jc(e),...t};e.setItem(gw,JSON.stringify(r))}catch{}}function yE(e,t){const r=[{id:"overview",label:"Overview",page:"nest",tab:"overview"}];if(e.isReaderView)return r;!e.isReadOnly&&(t.stewardshipEnabled||t.hasPending)&&r.push({id:"review",label:"Review queue",page:"nest",tab:"review"});for(const o of hE({...e,workflowPlaneEnabled:t.workflowPlaneEnabled}))r.push({id:o.id,label:o.label,icon:o.icon,page:o.viewPage,group:"views"});return r}function Of(e){return e==="Root"?"Root":e.split(/[-_]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function M4(e){return e==="Root"?"Root":e.split("/").map(Of).join(" / ")}function vE(e,t="",r){const o={path:t,name:"",label:"",depth:-1,count:0,total:0,docs:[],children:[]},a=new Map([[t,o]]),c=v=>{const w=a.get(v);if(w)return w;const x=(t&&v.startsWith(`${t}/`)?v.slice(t.length+1):v).split("/"),S=x.length>1?`${t?`${t}/`:""}${x.slice(0,-1).join("/")}`:t,N=c(S),k={path:v,name:x[x.length-1],label:Of(x[x.length-1]),depth:N.depth+1,count:0,total:0,docs:[],children:[]};return N.children.push(k),a.set(v,k),k},d=new Map;for(const v of r??[])!v.path||v.path===t||t&&!v.path.startsWith(`${t}/`)||(c(v.path),d.set(v.path,v.total));for(const v of e){const w=v.folder;if(!w||w===t||w==="Root"){o.docs.push(...v.items);continue}c(w).docs.push(...v.items)}const p=v=>{v.count=v.docs.length,v.children.sort((f,x)=>f.name.localeCompare(x.name));let w=v.count;for(const f of v.children)w+=p(f);return v.total=Math.max(w,d.get(v.path)??0),v.total};p(o);const g=(v,w)=>{const f=[v.name];let x=v;for(;x.count===0&&x.children.length===1;)x=x.children[0],f.push(x.name);return{path:x.path,name:x.name,label:f.map(Of).join(" / "),depth:w,count:x.count,total:x.total,docs:x.docs,children:x.children.map(S=>g(S,w+1))}};return o.children=r?o.children:o.children.map(v=>g(v,0)),o}function wE({groups:e,baseFolder:t="",known:r,indentRem:o=1.25,isCollapsed:a,renderFolder:c,renderDoc:d,className:p}){const g=y.useMemo(()=>vE(e,t,r),[e,t,r]),v=[],w=x=>x>0?{marginLeft:`${x*o}rem`}:void 0,f=x=>{const S=x.depth+1;for(const N of x.docs)v.push(u.jsx("div",{style:w(S),children:d(N,{depth:S,parent:x})},`doc:${N.id}`));for(const N of x.children){const k=a?a(N.path):!1;v.push(u.jsx("div",{style:w(N.depth),children:c(N,{collapsed:k,depth:N.depth})},`folder:${N.path}`)),k||f(N)}};return f(g),u.jsx("div",{className:p,children:v})}const xE={path:"/account",label:"Account",icon:Dv,order:40,hidden:!0},bE=Object.freeze(Object.defineProperty({__proto__:null,meta:xE},Symbol.toStringTag,{value:"Module"})),SE={path:"/api-keys",label:"API keys",icon:ep,order:11,group:"workspace"},kE=Object.freeze(Object.defineProperty({__proto__:null,meta:SE},Symbol.toStringTag,{value:"Module"})),_E={path:"/guide",label:"How it works",icon:Pv,order:30,group:"help"},CE=Object.freeze(Object.defineProperty({__proto__:null,meta:_E},Symbol.toStringTag,{value:"Module"})),NE={path:"/my-drafts",label:"My Drafts",icon:O_,order:3,group:"work",badge:{options:()=>Bt.myDrafts({limit:1}),count:e=>{var t;return((t=e==null?void 0:e.pagination)==null?void 0:t.total)??0},tone:"muted"}},EE=Object.freeze(Object.defineProperty({__proto__:null,meta:NE},Symbol.toStringTag,{value:"Module"})),OE={path:"/my-work",label:"My Work",icon:o_,order:2,group:"work",badge:{options:()=>Bt.myWork({limit:1}),count:e=>{var t;return((t=e==null?void 0:e.pagination)==null?void 0:t.total)??0},tone:"primary"}},PE=Object.freeze(Object.defineProperty({__proto__:null,meta:OE},Symbol.toStringTag,{value:"Module"})),jE={path:"/",label:"Nests",icon:jv,order:1},TE=Object.freeze(Object.defineProperty({__proto__:null,meta:jE},Symbol.toStringTag,{value:"Module"})),RE={path:"/settings",label:"Server settings",icon:Nc,order:21,group:"admin",visible:({isAdmin:e})=>e},AE=Object.freeze(Object.defineProperty({__proto__:null,meta:RE},Symbol.toStringTag,{value:"Module"})),ME={path:"/teammates",label:"Teammates",icon:Lv,order:20,group:"admin",visible:({isAdmin:e})=>e},$E=Object.freeze(Object.defineProperty({__proto__:null,meta:ME},Symbol.toStringTag,{value:"Module"})),IE={path:"/teams",label:"Teams",icon:Lv,order:10,group:"workspace"},DE=Object.freeze(Object.defineProperty({__proto__:null,meta:IE},Symbol.toStringTag,{value:"Module"})),LE={path:"/trace",label:"Activity trace",icon:A_,order:22,group:"admin",visible:({isAdmin:e})=>e},zE=Object.freeze(Object.defineProperty({__proto__:null,meta:LE},Symbol.toStringTag,{value:"Module"})),FE=[{id:"work",label:"Work"},{id:"workspace",label:"Workspace"},{id:"admin",label:"Admin"},{id:"help",label:"Help"}],UE=Object.assign({"../pages/app/account/meta.ts":bE,"../pages/app/api-keys/meta.ts":kE,"../pages/app/guide/meta.ts":CE,"../pages/app/my-drafts/meta.ts":EE,"../pages/app/my-work/meta.ts":PE,"../pages/app/nests/meta.ts":TE,"../pages/app/settings/meta.ts":AE,"../pages/app/teammates/meta.ts":$E,"../pages/app/teams/meta.ts":DE,"../pages/app/trace/meta.ts":zE}),VE=Object.assign({"../pages/app/account/page.tsx":()=>_t(()=>import("./page-l8-B7CGt.js"),__vite__mapDeps([35,36])),"../pages/app/api-keys/page.tsx":()=>_t(()=>import("./page-BfibLg8e.js"),__vite__mapDeps([37,36,13,4,8])),"../pages/app/guide/page.tsx":()=>_t(()=>import("./page-BSYUXYmO.js"),__vite__mapDeps([38,36,32])),"../pages/app/my-drafts/page.tsx":()=>_t(()=>import("./page-Cpdj_11Y.js"),__vite__mapDeps([39,13,36,15,16,17,25,40,41,22,29,8,21])),"../pages/app/my-work/page.tsx":()=>_t(()=>import("./page-Ck31nx9b.js"),__vite__mapDeps([42,13,36,28,15,16,17,29,30,25,31,8,21])),"../pages/app/nests/page.tsx":()=>_t(()=>import("./page-BYc2DIux.js"),__vite__mapDeps([43,44,13,23,8,24,15,16,17,25,36,31,22,29])),"../pages/app/settings/page.tsx":()=>_t(()=>import("./page-CGe8MtUu.js"),__vite__mapDeps([45,36,25,9,18,44,8])),"../pages/app/teammates/page.tsx":()=>_t(()=>import("./page-mnSHmk6A.js"),__vite__mapDeps([46,13,36,25,27])),"../pages/app/teams/page.tsx":()=>_t(()=>import("./page-D0sN3GO6.js"),__vite__mapDeps([47,36,26,25,16,4,9,8,29,30,5,27])),"../pages/app/trace/page.tsx":()=>_t(()=>import("./page-DEpH91X2.js"),__vite__mapDeps([48,49,36,16,13,50,2,4,21]))}),BE=e=>e.split("/").slice(-2,-1)[0],aa=Object.entries(UE).map(([e,t])=>{const r=BE(e),o=VE[e.replace(/meta\.ts$/,"page.tsx")];if(!o)throw new Error(`pages/app/${r}: meta.ts has no page.tsx beside it`);return{id:r,...t.meta,Component:Jf(o)}}).sort((e,t)=>e.order-t.order),dc="nests";function Pf(e){return aa.find(t=>t.id===e)??aa.find(t=>t.id===dc)??aa[0]}function WE(e){return Pf(e).path}function HE(e){var r;const t=e.length>1?e.replace(/\/+$/,""):e;return((r=aa.find(o=>o.path===t))==null?void 0:r.id)??null}const yw=(e,t)=>!e.visible||e.visible(t);function zd(e,t){const r=Pf(e);return yw(r,t)?r:Pf(dc)}function qE(e){const t=aa.filter(r=>!r.hidden&&yw(r,e));return{top:t.filter(r=>!r.group),groups:FE.map(r=>({...r,pages:t.filter(o=>o.group===r.id)})).filter(r=>r.pages.length>0)}}function vw(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=vw(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function ww(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=vw(e))&&(o&&(o+=" "),o+=t);return o}const KE=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},QE=(e,t)=>({classGroupId:e,validator:t}),xw=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),fc="-",ly=[],GE="arbitrary..",ZE=e=>{const t=YE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return JE(d);const p=d.split(fc),g=p[0]===""&&p.length>1?1:0;return bw(p,g,t)},getConflictingClassGroupIds:(d,p)=>{if(p){const g=o[d],v=r[d];return g?v?KE(v,g):g:v||ly}return r[d]||ly}}},bw=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],c=r.nextPart.get(a);if(c){const v=bw(e,t+1,c);if(v)return v}const d=r.validators;if(d===null)return;const p=t===0?e.join(fc):e.slice(t).join(fc),g=d.length;for(let v=0;v<g;v++){const w=d[v];if(w.validator(p))return w.classGroupId}},JE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?GE+o:void 0})(),YE=e=>{const{theme:t,classGroups:r}=e;return XE(r,t)},XE=(e,t)=>{const r=xw();for(const o in e){const a=e[o];fp(a,r,o,t)}return r},fp=(e,t,r,o)=>{const a=e.length;for(let c=0;c<a;c++){const d=e[c];e2(d,t,r,o)}},e2=(e,t,r,o)=>{if(typeof e=="string"){t2(e,t,r);return}if(typeof e=="function"){n2(e,t,r,o);return}r2(e,t,r,o)},t2=(e,t,r)=>{const o=e===""?t:Sw(t,e);o.classGroupId=r},n2=(e,t,r,o)=>{if(s2(e)){fp(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(QE(r,e))},r2=(e,t,r,o)=>{const a=Object.entries(e),c=a.length;for(let d=0;d<c;d++){const[p,g]=a[d];fp(g,Sw(t,p),r,o)}},Sw=(e,t)=>{let r=e;const o=t.split(fc),a=o.length;for(let c=0;c<a;c++){const d=o[c];let p=r.nextPart.get(d);p||(p=xw(),r.nextPart.set(d,p)),r=p}return r},s2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,o2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const a=(c,d)=>{r[c]=d,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(c){let d=r[c];if(d!==void 0)return d;if((d=o[c])!==void 0)return a(c,d),d},set(c,d){c in r?r[c]=d:a(c,d)}}},jf="!",cy=":",i2=[],uy=(e,t,r,o,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:a}),a2=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=a=>{const c=[];let d=0,p=0,g=0,v;const w=a.length;for(let k=0;k<w;k++){const C=a[k];if(d===0&&p===0){if(C===cy){c.push(a.slice(g,k)),g=k+1;continue}if(C==="/"){v=k;continue}}C==="["?d++:C==="]"?d--:C==="("?p++:C===")"&&p--}const f=c.length===0?a:a.slice(g);let x=f,S=!1;f.endsWith(jf)?(x=f.slice(0,-1),S=!0):f.startsWith(jf)&&(x=f.slice(1),S=!0);const N=v&&v>g?v-g:void 0;return uy(c,S,x,N)};if(t){const a=t+cy,c=o;o=d=>d.startsWith(a)?c(d.slice(a.length)):uy(i2,!1,d,void 0,!0)}if(r){const a=o;o=c=>r({className:c,parseClassName:a})}return o},l2=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let a=[];for(let c=0;c<r.length;c++){const d=r[c],p=d[0]==="[",g=t.has(d);p||g?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(d)):a.push(d)}return a.length>0&&(a.sort(),o.push(...a)),o}},c2=e=>({cache:o2(e.cacheSize),parseClassName:a2(e),sortModifiers:l2(e),...ZE(e)}),u2=/\s+/,d2=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:c}=t,d=[],p=e.trim().split(u2);let g="";for(let v=p.length-1;v>=0;v-=1){const w=p[v],{isExternal:f,modifiers:x,hasImportantModifier:S,baseClassName:N,maybePostfixModifierPosition:k}=r(w);if(f){g=w+(g.length>0?" "+g:g);continue}let C=!!k,_=o(C?N.substring(0,k):N);if(!_){if(!C){g=w+(g.length>0?" "+g:g);continue}if(_=o(N),!_){g=w+(g.length>0?" "+g:g);continue}C=!1}const R=x.length===0?"":x.length===1?x[0]:c(x).join(":"),I=S?R+jf:R,j=I+_;if(d.indexOf(j)>-1)continue;d.push(j);const G=a(_,C);for(let K=0;K<G.length;++K){const A=G[K];d.push(I+A)}g=w+(g.length>0?" "+g:g)}return g},f2=(...e)=>{let t=0,r,o,a="";for(;t<e.length;)(r=e[t++])&&(o=kw(r))&&(a&&(a+=" "),a+=o);return a},kw=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=kw(e[o]))&&(r&&(r+=" "),r+=t);return r},p2=(e,...t)=>{let r,o,a,c;const d=g=>{const v=t.reduce((w,f)=>f(w),e());return r=c2(v),o=r.cache.get,a=r.cache.set,c=p,p(g)},p=g=>{const v=o(g);if(v)return v;const w=d2(g,r);return a(g,w),w};return c=d,(...g)=>c(f2(...g))},h2=[],kt=e=>{const t=r=>r[e]||h2;return t.isThemeGetter=!0,t},_w=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,m2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,g2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>m2.test(e),ze=e=>!!e&&!Number.isNaN(Number(e)),us=e=>!!e&&Number.isInteger(Number(e)),Fd=e=>e.endsWith("%")&&ze(e.slice(0,-1)),Rr=e=>g2.test(e),Nw=()=>!0,b2=e=>y2.test(e)&&!v2.test(e),pp=()=>!1,S2=e=>w2.test(e),k2=e=>x2.test(e),_2=e=>!ke(e)&&!Ce(e),C2=e=>_s(e,Pw,pp),ke=e=>_w.test(e),Fs=e=>_s(e,jw,b2),dy=e=>_s(e,A2,ze),N2=e=>_s(e,Rw,Nw),E2=e=>_s(e,Tw,pp),fy=e=>_s(e,Ew,pp),O2=e=>_s(e,Ow,k2),Bl=e=>_s(e,Aw,S2),Ce=e=>Cw.test(e),ta=e=>po(e,jw),P2=e=>po(e,Tw),py=e=>po(e,Ew),j2=e=>po(e,Pw),T2=e=>po(e,Ow),Wl=e=>po(e,Aw,!0),R2=e=>po(e,Rw,!0),_s=(e,t,r)=>{const o=_w.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},po=(e,t,r=!1)=>{const o=Cw.exec(e);return o?o[1]?t(o[1]):r:!1},Ew=e=>e==="position"||e==="percentage",Ow=e=>e==="image"||e==="url",Pw=e=>e==="length"||e==="size"||e==="bg-size",jw=e=>e==="length",A2=e=>e==="number",Tw=e=>e==="family-name",Rw=e=>e==="number"||e==="weight",Aw=e=>e==="shadow",M2=()=>{const e=kt("color"),t=kt("font"),r=kt("text"),o=kt("font-weight"),a=kt("tracking"),c=kt("leading"),d=kt("breakpoint"),p=kt("container"),g=kt("spacing"),v=kt("radius"),w=kt("shadow"),f=kt("inset-shadow"),x=kt("text-shadow"),S=kt("drop-shadow"),N=kt("blur"),k=kt("perspective"),C=kt("aspect"),_=kt("ease"),R=kt("animate"),I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...j(),Ce,ke],K=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],M=()=>[Ce,ke,g],Y=()=>[cs,"full","auto",...M()],V=()=>[us,"none","subgrid",Ce,ke],le=()=>["auto",{span:["full",us,Ce,ke]},us,Ce,ke],he=()=>[us,"auto",Ce,ke],pe=()=>["auto","min","max","fr",Ce,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...M()],oe=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],q=()=>[cs,"screen","full","dvw","lvw","svw","min","max","fit",...M()],H=()=>[cs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],D=()=>[e,Ce,ke],O=()=>[...j(),py,fy,{position:[Ce,ke]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",j2,C2,{size:[Ce,ke]}],J=()=>[Fd,ta,Fs],Z=()=>["","none","full",v,Ce,ke],de=()=>["",ze,ta,Fs],we=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[ze,Fd,py,fy],Ue=()=>["","none",N,Ce,ke],at=()=>["none",ze,Ce,ke],pt=()=>["none",ze,Ce,ke],lt=()=>[ze,Ce,ke],vt=()=>[cs,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rr],breakpoint:[Rr],color:[Nw],container:[Rr],"drop-shadow":[Rr],ease:["in","out","in-out"],font:[_2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rr],shadow:[Rr],spacing:["px",ze],text:[Rr],"text-shadow":[Rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,ke,Ce,C]}],container:["container"],columns:[{columns:[ze,ke,Ce,p]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[us,"auto",Ce,ke]}],basis:[{basis:[cs,"full","auto",p,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,cs,"auto","initial","none",ke]}],grow:[{grow:["",ze,Ce,ke]}],shrink:[{shrink:["",ze,Ce,ke]}],order:[{order:[us,"first","last","none",Ce,ke]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[p,"screen",...oe()]}],"min-w":[{"min-w":[p,"screen","none",...oe()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[d]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",r,ta,Fs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,R2,N2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fd,ke]}],"font-family":[{font:[P2,E2,t]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ce,ke]}],"line-clamp":[{"line-clamp":[ze,"none",Ce,dy]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",Ce,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",Ce,Fs]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[ze,"auto",Ce,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ce,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},us,Ce,ke],radial:["",Ce,ke],conic:[us,Ce,ke]},T2,O2]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,Ce,ke]}],"outline-w":[{outline:["",ze,ta,Fs]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",w,Wl,Bl]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,Wl,Bl]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[ze,Fs]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",x,Wl,Bl]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[ze,Ce,ke]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Ce,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,ke]}],filter:[{filter:["","none",Ce,ke]}],blur:[{blur:Ue()}],brightness:[{brightness:[ze,Ce,ke]}],contrast:[{contrast:[ze,Ce,ke]}],"drop-shadow":[{"drop-shadow":["","none",S,Wl,Bl]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",ze,Ce,ke]}],"hue-rotate":[{"hue-rotate":[ze,Ce,ke]}],invert:[{invert:["",ze,Ce,ke]}],saturate:[{saturate:[ze,Ce,ke]}],sepia:[{sepia:["",ze,Ce,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,ke]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[ze,Ce,ke]}],"backdrop-contrast":[{"backdrop-contrast":[ze,Ce,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,Ce,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,Ce,ke]}],"backdrop-invert":[{"backdrop-invert":["",ze,Ce,ke]}],"backdrop-opacity":[{"backdrop-opacity":[ze,Ce,ke]}],"backdrop-saturate":[{"backdrop-saturate":[ze,Ce,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,Ce,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",Ce,ke]}],ease:[{ease:["linear","initial",_,Ce,ke]}],delay:[{delay:[ze,Ce,ke]}],animate:[{animate:["none",R,Ce,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ce,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:at()}],"rotate-x":[{"rotate-x":at()}],"rotate-y":[{"rotate-y":at()}],"rotate-z":[{"rotate-z":at()}],scale:[{scale:pt()}],"scale-x":[{"scale-x":pt()}],"scale-y":[{"scale-y":pt()}],"scale-z":[{"scale-z":pt()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[Ce,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:vt()}],"translate-x":[{"translate-x":vt()}],"translate-y":[{"translate-y":vt()}],"translate-z":[{"translate-z":vt()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ce,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ce,ke]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[ze,ta,Fs,dy]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$2=p2(M2);var hy;function Re(e,t,r){function o(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,g);const v=d.prototype,w=Object.keys(v);for(let f=0;f<w.length;f++){const x=w[f];x in p||(p[x]=v[x].bind(p))}}const a=(r==null?void 0:r.Parent)??Object;class c extends a{}Object.defineProperty(c,"name",{value:e});function d(p){var g;const v=r!=null&&r.Parent?new c:this;o(v,p),(g=v._zod).deferred??(g.deferred=[]);for(const w of v._zod.deferred)w();return v}return Object.defineProperty(d,"init",{value:o}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>{var g,v;return r!=null&&r.Parent&&p instanceof r.Parent?!0:(v=(g=p==null?void 0:p._zod)==null?void 0:g.traits)==null?void 0:v.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class Wo extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Mw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(hy=globalThis).__zod_globalConfig??(hy.__zod_globalConfig={});const I2=globalThis.__zod_globalConfig;function so(e){return I2}function Tf(e,t){return typeof t=="bigint"?t.toString():t}function hp(e){return e==null}function mp(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const my=Symbol("evaluating");function Ge(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==my)return o===void 0&&(o=my,o=r()),o},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function D2(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function L2(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $w="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rf(e){if(gy(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(gy(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Iw(e){return Rf(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function gp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z2(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(o._zod.parent=e),o}function Jt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Bo(e,t=0){var r;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)!==!0)return!0;return!1}function F2(e,t=0){var r;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)===!1)return!0;return!1}function U2(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Hl(e){return typeof e=="string"?e:e==null?void 0:e.message}function oo(e,t,r){var g,v,w,f,x,S;const o=e.message?e.message:Hl((w=(v=(g=e.inst)==null?void 0:g._zod.def)==null?void 0:v.error)==null?void 0:w.call(v,e))??Hl((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Hl((x=r.customError)==null?void 0:x.call(r,e))??Hl((S=r.localeError)==null?void 0:S.call(r,e))??"Invalid input",{inst:a,continue:c,input:d,...p}=e;return p.path??(p.path=[]),p.message=o,t!=null&&t.reportInput&&(p.input=d),p}function yp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function da(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const Dw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Lw=Re("$ZodError",Dw),zw=Re("$ZodError",Dw,{Parent:Error});function V2(e,t=r=>r.message){const r={},o=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):o.push(t(a));return{formErrors:o,fieldErrors:r}}function B2(e,t=r=>r.message){const r={_errors:[]},o=(a,c=[])=>{for(const d of a.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(p=>o({issues:p},[...c,...d.path]));else if(d.code==="invalid_key")o({issues:d.issues},[...c,...d.path]);else if(d.code==="invalid_element")o({issues:d.issues},[...c,...d.path]);else{const p=[...c,...d.path];if(p.length===0)r._errors.push(t(d));else{let g=r,v=0;for(;v<p.length;){const w=p[v];v===p.length-1?(g[w]=g[w]||{_errors:[]},g[w]._errors.push(t(d))):g[w]=g[w]||{_errors:[]},g=g[w],v++}}}};return o(e),r}const vp=e=>(t,r,o,a)=>{const c=o?{...o,async:!1}:{async:!1},d=t._zod.run({value:r,issues:[]},c);if(d instanceof Promise)throw new Wo;if(d.issues.length){const p=new((a==null?void 0:a.Err)??e)(d.issues.map(g=>oo(g,c,so())));throw $w(p,a==null?void 0:a.callee),p}return d.value},wp=e=>async(t,r,o,a)=>{const c=o?{...o,async:!0}:{async:!0};let d=t._zod.run({value:r,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const p=new((a==null?void 0:a.Err)??e)(d.issues.map(g=>oo(g,c,so())));throw $w(p,a==null?void 0:a.callee),p}return d.value},Tc=e=>(t,r,o)=>{const a=o?{...o,async:!1}:{async:!1},c=t._zod.run({value:r,issues:[]},a);if(c instanceof Promise)throw new Wo;return c.issues.length?{success:!1,error:new(e??Lw)(c.issues.map(d=>oo(d,a,so())))}:{success:!0,data:c.value}},W2=Tc(zw),Rc=e=>async(t,r,o)=>{const a=o?{...o,async:!0}:{async:!0};let c=t._zod.run({value:r,issues:[]},a);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>oo(d,a,so())))}:{success:!0,data:c.value}},H2=Rc(zw),q2=e=>(t,r,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return vp(e)(t,r,a)},K2=e=>(t,r,o)=>vp(e)(t,r,o),Q2=e=>async(t,r,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return wp(e)(t,r,a)},G2=e=>async(t,r,o)=>wp(e)(t,r,o),Z2=e=>(t,r,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return Tc(e)(t,r,a)},J2=e=>(t,r,o)=>Tc(e)(t,r,o),Y2=e=>async(t,r,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return Rc(e)(t,r,a)},X2=e=>async(t,r,o)=>Rc(e)(t,r,o),eO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tO=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},nO=/^[^A-Z]*$/,rO=/^[^a-z]*$/,wr=Re("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sO=Re("$ZodCheckMaxLength",(e,t)=>{var r;wr.init(e,t),(r=e._zod.def).when??(r.when=o=>{const a=o.value;return!hp(a)&&a.length!==void 0}),e._zod.onattach.push(o=>{const a=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const a=o.value;if(a.length<=t.maximum)return;const d=yp(a);o.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),oO=Re("$ZodCheckMinLength",(e,t)=>{var r;wr.init(e,t),(r=e._zod.def).when??(r.when=o=>{const a=o.value;return!hp(a)&&a.length!==void 0}),e._zod.onattach.push(o=>{const a=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const a=o.value;if(a.length>=t.minimum)return;const d=yp(a);o.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),iO=Re("$ZodCheckLengthEquals",(e,t)=>{var r;wr.init(e,t),(r=e._zod.def).when??(r.when=o=>{const a=o.value;return!hp(a)&&a.length!==void 0}),e._zod.onattach.push(o=>{const a=o._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=o=>{const a=o.value,c=a.length;if(c===t.length)return;const d=yp(a),p=c>t.length;o.issues.push({origin:d,...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ac=Re("$ZodCheckStringFormat",(e,t)=>{var r,o;wr.init(e,t),e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),aO=Re("$ZodCheckRegex",(e,t)=>{Ac.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lO=Re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nO),Ac.init(e,t)}),cO=Re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rO),Ac.init(e,t)}),uO=Re("$ZodCheckIncludes",(e,t)=>{wr.init(e,t);const r=gp(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(a=>{const c=a._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(o)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),dO=Re("$ZodCheckStartsWith",(e,t)=>{wr.init(e,t);const r=new RegExp(`^${gp(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),fO=Re("$ZodCheckEndsWith",(e,t)=>{wr.init(e,t);const r=new RegExp(`.*${gp(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),pO=Re("$ZodCheckOverwrite",(e,t)=>{wr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),hO={major:4,minor:4,patch:3},Yt=Re("$ZodType",(e,t)=>{var a;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hO;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const c of o)for(const d of c._zod.onattach)d(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse});else{const c=(p,g,v)=>{let w=Bo(p),f;for(const x of g){if(x._zod.def.when){if(F2(p)||!x._zod.def.when(p))continue}else if(w)continue;const S=p.issues.length,N=x._zod.check(p);if(N instanceof Promise&&(v==null?void 0:v.async)===!1)throw new Wo;if(f||N instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await N,p.issues.length!==S&&(w||(w=Bo(p,S)))});else{if(p.issues.length===S)continue;w||(w=Bo(p,S))}}return f?f.then(()=>p):p},d=(p,g,v)=>{if(Bo(p))return p.aborted=!0,p;const w=c(g,o,v);if(w instanceof Promise){if(v.async===!1)throw new Wo;return w.then(f=>e._zod.parse(f,v))}return e._zod.parse(w,v)};e._zod.run=(p,g)=>{if(g.skipChecks)return e._zod.parse(p,g);if(g.direction==="backward"){const w=e._zod.parse({value:p.value,issues:[]},{...g,skipChecks:!0});return w instanceof Promise?w.then(f=>d(f,p,g)):d(w,p,g)}const v=e._zod.parse(p,g);if(v instanceof Promise){if(g.async===!1)throw new Wo;return v.then(w=>c(w,o,g))}return c(v,o,g)}}Ge(e,"~standard",()=>({validate:c=>{var d;try{const p=W2(e,c);return p.success?{value:p.data}:{issues:(d=p.error)==null?void 0:d.issues}}catch{return H2(e,c).then(g=>{var v;return g.success?{value:g.data}:{issues:(v=g.error)==null?void 0:v.issues}})}},vendor:"zod",version:1}))}),Fw=Re("$ZodString",(e,t)=>{var r;Yt.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??tO(e._zod.bag),e._zod.parse=(o,a)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Uw=Re("$ZodStringFormat",(e,t)=>{Ac.init(e,t),Fw.init(e,t)}),mO=Re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eO),Uw.init(e,t)});function yy(e,t,r){e.issues.length&&t.issues.push(...U2(r,e.issues)),t.value[r]=e.value}const gO=Re("$ZodArray",(e,t)=>{Yt.init(e,t),e._zod.parse=(r,o)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const c=[];for(let d=0;d<a.length;d++){const p=a[d],g=t.element._zod.run({value:p,issues:[]},o);g instanceof Promise?c.push(g.then(v=>yy(v,r,d))):yy(g,r,d)}return c.length?Promise.all(c).then(()=>r):r}});function vy(e,t,r,o){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const a=e.filter(c=>!Bo(c));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(c=>c.issues.map(d=>oo(d,o,so())))}),t)}const yO=Re("$ZodUnion",(e,t)=>{Yt.init(e,t),Ge(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ge(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ge(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ge(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>mp(a.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,a)=>{if(r)return r(o,a);let c=!1;const d=[];for(const p of t.options){const g=p._zod.run({value:o.value,issues:[]},a);if(g instanceof Promise)d.push(g),c=!0;else{if(g.issues.length===0)return g;d.push(g)}}return c?Promise.all(d).then(p=>vy(p,o,e,a)):vy(d,o,e,a)}}),vO=Re("$ZodIntersection",(e,t)=>{Yt.init(e,t),e._zod.parse=(r,o)=>{const a=r.value,c=t.left._zod.run({value:a,issues:[]},o),d=t.right._zod.run({value:a,issues:[]},o);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,v])=>wy(r,g,v)):wy(r,c,d)}});function Af(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rf(e)&&Rf(t)){const r=Object.keys(t),o=Object.keys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};for(const c of o){const d=Af(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};a[c]=d.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const a=e[o],c=t[o],d=Af(a,c);if(!d.valid)return{valid:!1,mergeErrorPath:[o,...d.mergeErrorPath]};r.push(d.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function wy(e,t,r){const o=new Map;let a;for(const p of t.issues)if(p.code==="unrecognized_keys"){a??(a=p);for(const g of p.keys)o.has(g)||o.set(g,{}),o.get(g).l=!0}else e.issues.push(p);for(const p of r.issues)if(p.code==="unrecognized_keys")for(const g of p.keys)o.has(g)||o.set(g,{}),o.get(g).r=!0;else e.issues.push(p);const c=[...o].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(c.length&&a&&e.issues.push({...a,keys:c}),Bo(e))return e;const d=Af(t.value,r.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const wO=Re("$ZodTransform",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Mw(e.constructor.name);const a=t.transform(r.value,r);if(o.async)return(a instanceof Promise?a:Promise.resolve(a)).then(d=>(r.value=d,r.fallback=!0,r));if(a instanceof Promise)throw new Wo;return r.value=a,r.fallback=!0,r}});function xy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Vw=Re("$ZodOptional",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ge(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mp(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const a=r.value,c=t.innerType._zod.run(r,o);return c instanceof Promise?c.then(d=>xy(d,a)):xy(c,a)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),xO=Re("$ZodExactOptional",(e,t)=>{Vw.init(e,t),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),bO=Re("$ZodNullable",(e,t)=>{Yt.init(e,t),Ge(e._zod,"optin",()=>t.innerType._zod.optin),Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mp(r.source)}|null)$`):void 0}),Ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),SO=Re("$ZodDefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(c=>by(c,t)):by(a,t)}});function by(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const kO=Re("$ZodPrefault",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),_O=Re("$ZodNonOptional",(e,t)=>{Yt.init(e,t),Ge(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(c=>Sy(c,e)):Sy(a,e)}});function Sy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const CO=Re("$ZodCatch",(e,t)=>{Yt.init(e,t),e._zod.optin="optional",Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(c=>(r.value=c.value,c.issues.length&&(r.value=t.catchValue({...r,error:{issues:c.issues.map(d=>oo(d,o,so()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(c=>oo(c,o,so()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),NO=Re("$ZodPipe",(e,t)=>{Yt.init(e,t),Ge(e._zod,"values",()=>t.in._zod.values),Ge(e._zod,"optin",()=>t.in._zod.optin),Ge(e._zod,"optout",()=>t.out._zod.optout),Ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const c=t.out._zod.run(r,o);return c instanceof Promise?c.then(d=>ql(d,t.in,o)):ql(c,t.in,o)}const a=t.in._zod.run(r,o);return a instanceof Promise?a.then(c=>ql(c,t.out,o)):ql(a,t.out,o)}});function ql(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const EO=Re("$ZodReadonly",(e,t)=>{Yt.init(e,t),Ge(e._zod,"propValues",()=>t.innerType._zod.propValues),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"optin",()=>{var r,o;return(o=(r=t.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Ge(e._zod,"optout",()=>{var r,o;return(o=(r=t.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const a=t.innerType._zod.run(r,o);return a instanceof Promise?a.then(ky):ky(a)}});function ky(e){return e.value=Object.freeze(e.value),e}const OO=Re("$ZodCustom",(e,t)=>{wr.init(e,t),Yt.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,a=t.fn(o);if(a instanceof Promise)return a.then(c=>_y(c,r,o,e));_y(a,r,o,e)}});function _y(e,t,r,o){if(!e){const a={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(a.params=o._zod.def.params),t.issues.push(da(a))}}var Cy;class PO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const a={...o,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function jO(){return new PO}(Cy=globalThis).__zod_globalRegistry??(Cy.__zod_globalRegistry=jO());const sa=globalThis.__zod_globalRegistry;function TO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Jt(t)})}function Bw(e,t){return new sO({check:"max_length",...Jt(t),maximum:e})}function pc(e,t){return new oO({check:"min_length",...Jt(t),minimum:e})}function Ww(e,t){return new iO({check:"length_equals",...Jt(t),length:e})}function RO(e,t){return new aO({check:"string_format",format:"regex",...Jt(t),pattern:e})}function AO(e){return new lO({check:"string_format",format:"lowercase",...Jt(e)})}function MO(e){return new cO({check:"string_format",format:"uppercase",...Jt(e)})}function $O(e,t){return new uO({check:"string_format",format:"includes",...Jt(t),includes:e})}function IO(e,t){return new dO({check:"string_format",format:"starts_with",...Jt(t),prefix:e})}function DO(e,t){return new fO({check:"string_format",format:"ends_with",...Jt(t),suffix:e})}function gi(e){return new pO({check:"overwrite",tx:e})}function LO(e){return gi(t=>t.normalize(e))}function zO(){return gi(e=>e.trim())}function FO(){return gi(e=>e.toLowerCase())}function UO(){return gi(e=>e.toUpperCase())}function VO(){return gi(e=>L2(e))}function BO(e,t,r){return new e({type:"array",element:t,...Jt(r)})}function WO(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Jt(r)})}function HO(e,t){const r=qO(o=>(o.addIssue=a=>{if(typeof a=="string")o.issues.push(da(a,o.value,r._zod.def));else{const c=a;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=o.value),c.inst??(c.inst=r),c.continue??(c.continue=!r._zod.def.abort),o.issues.push(da(c))}},e(o.value,o)),t);return r}function qO(e,t){const r=new wr({check:"custom",...Jt(t)});return r._zod.check=e,r}function Hw(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??sa,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Zt(e,t,r={path:[],schemaPath:[]}){var w,f;var o;const a=e._zod.def,c=t.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,d);const p=(f=(w=e._zod).toJSONSchema)==null?void 0:f.call(w);if(p)d.schema=p;else{const x={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,x);else{const N=d.schema,k=t.processors[a.type];if(!k)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);k(e,t,N,x)}const S=e._zod.parent;S&&(d.ref||(d.ref=S),Zt(S,t,x),t.seen.get(S).isParent=!0)}const g=t.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),t.io==="input"&&Kt(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&"_prefault"in d.schema&&((o=d.schema).default??(o.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function qw(e,t){var d,p,g,v;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const w of e.seen.entries()){const f=(d=e.metadataRegistry.get(w[0]))==null?void 0:d.id;if(f){const x=o.get(f);if(x&&x!==w[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,w[0])}}const a=w=>{var k;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(k=e.external.registry.get(w[0]))==null?void 0:k.id,_=e.external.uri??(I=>I);if(C)return{ref:_(C)};const R=w[1].defId??w[1].schema.id??`schema${e.counter++}`;return w[1].defId=R,{defId:R,ref:`${_("__shared")}#/${f}/${R}`}}if(w[1]===r)return{ref:"#"};const S=`#/${f}/`,N=w[1].schema.id??`__schema${e.counter++}`;return{defId:N,ref:S+N}},c=w=>{if(w[1].schema.$ref)return;const f=w[1],{ref:x,defId:S}=a(w);f.def={...f.schema},S&&(f.defId=S);const N=f.schema;for(const k in N)delete N[k];N.$ref=x};if(e.cycles==="throw")for(const w of e.seen.entries()){const f=w[1];if(f.cycle)throw new Error(`Cycle detected: #/${(p=f.cycle)==null?void 0:p.join("/")}/<root>
327
+
328
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const w of e.seen.entries()){const f=w[1];if(t===w[0]){c(w);continue}if(e.external){const S=(g=e.external.registry.get(w[0]))==null?void 0:g.id;if(t!==w[0]&&S){c(w);continue}}if((v=e.metadataRegistry.get(w[0]))==null?void 0:v.id){c(w);continue}if(f.cycle){c(w);continue}if(f.count>1&&e.reused==="ref"){c(w);continue}}}function Kw(e,t){var p,g,v,w;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=f=>{const x=e.seen.get(f);if(x.ref===null)return;const S=x.def??x.schema,N={...S},k=x.ref;if(x.ref=null,k){o(k);const _=e.seen.get(k),R=_.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(S.allOf=S.allOf??[],S.allOf.push(R)):Object.assign(S,R),Object.assign(S,N),f._zod.parent===k)for(const j in S)j==="$ref"||j==="allOf"||j in N||delete S[j];if(R.$ref&&_.def)for(const j in S)j==="$ref"||j==="allOf"||j in _.def&&JSON.stringify(S[j])===JSON.stringify(_.def[j])&&delete S[j]}const C=f._zod.parent;if(C&&C!==k){o(C);const _=e.seen.get(C);if(_!=null&&_.schema.$ref&&(S.$ref=_.schema.$ref,_.def))for(const R in S)R==="$ref"||R==="allOf"||R in _.def&&JSON.stringify(S[R])===JSON.stringify(_.def[R])&&delete S[R]}e.override({zodSchema:f,jsonSchema:S,path:x.path??[]})};for(const f of[...e.seen.entries()].reverse())o(f[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,(p=e.external)!=null&&p.uri){const f=(g=e.external.registry.get(t))==null?void 0:g.id;if(!f)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(f)}Object.assign(a,r.def??r.schema);const c=(v=e.metadataRegistry.get(t))==null?void 0:v.id;c!==void 0&&a.id===c&&delete a.id;const d=((w=e.external)==null?void 0:w.defs)??{};for(const f of e.seen.entries()){const x=f[1];x.def&&x.defId&&(x.def.id===x.defId&&delete x.def.id,d[x.defId]=x.def)}e.external||Object.keys(d).length>0&&(e.target==="draft-2020-12"?a.$defs=d:a.definitions=d);try{const f=JSON.parse(JSON.stringify(a));return Object.defineProperty(f,"~standard",{value:{...t["~standard"],jsonSchema:{input:hc(t,"input",e.processors),output:hc(t,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function Kt(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Kt(o.element,r);if(o.type==="set")return Kt(o.valueType,r);if(o.type==="lazy")return Kt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Kt(o.innerType,r);if(o.type==="intersection")return Kt(o.left,r)||Kt(o.right,r);if(o.type==="record"||o.type==="map")return Kt(o.keyType,r)||Kt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Kt(o.in,r)||Kt(o.out,r);if(o.type==="object"){for(const a in o.shape)if(Kt(o.shape[a],r))return!0;return!1}if(o.type==="union"){for(const a of o.options)if(Kt(a,r))return!0;return!1}if(o.type==="tuple"){for(const a of o.items)if(Kt(a,r))return!0;return!!(o.rest&&Kt(o.rest,r))}return!1}const KO=(e,t={})=>r=>{const o=Hw({...r,processors:t});return Zt(e,o),qw(o,e),Kw(o,e)},hc=(e,t,r={})=>o=>{const{libraryOptions:a,target:c}=o??{},d=Hw({...a??{},target:c,io:t,processors:r});return Zt(e,d),qw(d,e),Kw(d,e)},QO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GO=(e,t,r,o)=>{const a=r;a.type="string";const{minimum:c,maximum:d,format:p,patterns:g,contentEncoding:v}=e._zod.bag;if(typeof c=="number"&&(a.minLength=c),typeof d=="number"&&(a.maxLength=d),p&&(a.format=QO[p]??p,a.format===""&&delete a.format,p==="time"&&delete a.format),v&&(a.contentEncoding=v),g&&g.size>0){const w=[...g];w.length===1?a.pattern=w[0].source:w.length>1&&(a.allOf=[...w.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ZO=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JO=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},YO=(e,t,r,o)=>{const a=r,c=e._zod.def,{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(a.minItems=d),typeof p=="number"&&(a.maxItems=p),a.type="array",a.items=Zt(c.element,t,{...o,path:[...o.path,"items"]})},XO=(e,t,r,o)=>{const a=e._zod.def,c=a.inclusive===!1,d=a.options.map((p,g)=>Zt(p,t,{...o,path:[...o.path,c?"oneOf":"anyOf",g]}));c?r.oneOf=d:r.anyOf=d},eP=(e,t,r,o)=>{const a=e._zod.def,c=Zt(a.left,t,{...o,path:[...o.path,"allOf",0]}),d=Zt(a.right,t,{...o,path:[...o.path,"allOf",1]}),p=v=>"allOf"in v&&Object.keys(v).length===1,g=[...p(c)?c.allOf:[c],...p(d)?d.allOf:[d]];r.allOf=g},tP=(e,t,r,o)=>{const a=e._zod.def,c=Zt(a.innerType,t,o),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=a.innerType,r.nullable=!0):r.anyOf=[c,{type:"null"}]},nP=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType},rP=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))},sP=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},oP=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType;let d;try{d=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=d},iP=(e,t,r,o)=>{const a=e._zod.def,c=a.in._zod.traits.has("$ZodTransform"),d=t.io==="input"?c?a.out:a.in:a.out;Zt(d,t,o);const p=t.seen.get(e);p.ref=d},aP=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType,r.readOnly=!0},Qw=(e,t,r,o)=>{const a=e._zod.def;Zt(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType},lP=(e,t)=>{Lw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>B2(e,r)},flatten:{value:r=>V2(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Tf,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Tf,2)}},isEmpty:{get(){return e.issues.length===0}}})},In=Re("ZodError",lP,{Parent:Error}),cP=vp(In),uP=wp(In),dP=Tc(In),fP=Rc(In),pP=q2(In),hP=K2(In),mP=Q2(In),gP=G2(In),yP=Z2(In),vP=J2(In),wP=Y2(In),xP=X2(In),Ny=new WeakMap;function xp(e,t,r){const o=Object.getPrototypeOf(e);let a=Ny.get(o);if(a||(a=new Set,Ny.set(o,a)),!a.has(t)){a.add(t);for(const c in r){const d=r[c];Object.defineProperty(o,c,{configurable:!0,enumerable:!1,get(){const p=d.bind(this);return Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:p}),p},set(p){Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:p})}})}}}const Xt=Re("ZodType",(e,t)=>(Yt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:hc(e,"input"),output:hc(e,"output")}}),e.toJSONSchema=KO(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>cP(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>dP(e,r,o),e.parseAsync=async(r,o)=>uP(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>fP(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>pP(e,r,o),e.decode=(r,o)=>hP(e,r,o),e.encodeAsync=async(r,o)=>mP(e,r,o),e.decodeAsync=async(r,o)=>gP(e,r,o),e.safeEncode=(r,o)=>yP(e,r,o),e.safeDecode=(r,o)=>vP(e,r,o),e.safeEncodeAsync=async(r,o)=>wP(e,r,o),e.safeDecodeAsync=async(r,o)=>xP(e,r,o),xp(e,"ZodType",{check(...r){const o=this.def;return this.clone(D2(o,{checks:[...o.checks??[],...r.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return z2(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(GP(r,o))},superRefine(r,o){return this.check(ZP(r,o))},overwrite(r){return this.check(gi(r))},optional(){return Ey(this)},exactOptional(){return $P(this)},nullable(){return Oy(this)},nullish(){return Ey(Oy(this))},nonoptional(r){return VP(this,r)},array(){return NP(this)},or(r){return OP([this,r])},and(r){return jP(this,r)},transform(r){return Py(this,RP(r))},default(r){return LP(this,r)},prefault(r){return FP(this,r)},catch(r){return WP(this,r)},pipe(r){return Py(this,r)},readonly(){return KP(this)},describe(r){const o=this.clone();return sa.add(o,{description:r}),o},meta(...r){if(r.length===0)return sa.get(this);const o=this.clone();return sa.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){var r;return(r=sa.get(e))==null?void 0:r.description},configurable:!0}),e)),bP=Re("_ZodString",(e,t)=>{Fw.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(o,a,c)=>GO(e,o,a);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,xp(e,"_ZodString",{regex(...o){return this.check(RO(...o))},includes(...o){return this.check($O(...o))},startsWith(...o){return this.check(IO(...o))},endsWith(...o){return this.check(DO(...o))},min(...o){return this.check(pc(...o))},max(...o){return this.check(Bw(...o))},length(...o){return this.check(Ww(...o))},nonempty(...o){return this.check(pc(1,...o))},lowercase(o){return this.check(AO(o))},uppercase(o){return this.check(MO(o))},trim(){return this.check(zO())},normalize(...o){return this.check(LO(...o))},toLowerCase(){return this.check(FO())},toUpperCase(){return this.check(UO())},slugify(){return this.check(VO())}})}),SP=Re("ZodStringFormat",(e,t)=>{Uw.init(e,t),bP.init(e,t)}),kP=Re("ZodEmail",(e,t)=>{mO.init(e,t),SP.init(e,t)});function _P(e){return TO(kP,e)}const CP=Re("ZodArray",(e,t)=>{gO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>YO(e,r,o,a),e.element=t.element,xp(e,"ZodArray",{min(r,o){return this.check(pc(r,o))},nonempty(r){return this.check(pc(1,r))},max(r,o){return this.check(Bw(r,o))},length(r,o){return this.check(Ww(r,o))},unwrap(){return this.element}})});function NP(e,t){return BO(CP,e,t)}const EP=Re("ZodUnion",(e,t)=>{yO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>XO(e,r,o,a),e.options=t.options});function OP(e,t){return new EP({type:"union",options:e,...Jt(t)})}const PP=Re("ZodIntersection",(e,t)=>{vO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>eP(e,r,o,a)});function jP(e,t){return new PP({type:"intersection",left:e,right:t})}const TP=Re("ZodTransform",(e,t)=>{wO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>JO(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Mw(e.constructor.name);r.addIssue=c=>{if(typeof c=="string")r.issues.push(da(c,r.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=r.value),d.inst??(d.inst=e),r.issues.push(da(d))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(c=>(r.value=c,r.fallback=!0,r)):(r.value=a,r.fallback=!0,r)}});function RP(e){return new TP({type:"transform",transform:e})}const AP=Re("ZodOptional",(e,t)=>{Vw.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>Qw(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function Ey(e){return new AP({type:"optional",innerType:e})}const MP=Re("ZodExactOptional",(e,t)=>{xO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>Qw(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function $P(e){return new MP({type:"optional",innerType:e})}const IP=Re("ZodNullable",(e,t)=>{bO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>tP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function Oy(e){return new IP({type:"nullable",innerType:e})}const DP=Re("ZodDefault",(e,t)=>{SO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>rP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function LP(e,t){return new DP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Iw(t)}})}const zP=Re("ZodPrefault",(e,t)=>{kO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>sP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function FP(e,t){return new zP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Iw(t)}})}const UP=Re("ZodNonOptional",(e,t)=>{_O.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>nP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function VP(e,t){return new UP({type:"nonoptional",innerType:e,...Jt(t)})}const BP=Re("ZodCatch",(e,t)=>{CO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>oP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function WP(e,t){return new BP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const HP=Re("ZodPipe",(e,t)=>{NO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>iP(e,r,o,a),e.in=t.in,e.out=t.out});function Py(e,t){return new HP({type:"pipe",in:e,out:t})}const qP=Re("ZodReadonly",(e,t)=>{EO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>aP(e,r,o,a),e.unwrap=()=>e._zod.def.innerType});function KP(e){return new qP({type:"readonly",innerType:e})}const QP=Re("ZodCustom",(e,t)=>{OO.init(e,t),Xt.init(e,t),e._zod.processJSONSchema=(r,o,a)=>ZO(e,r)});function GP(e,t={}){return WO(QP,e,t)}function ZP(e,t){return HO(e,t)}function Le(...e){return $2(ww(e))}const JP=_P();function $4(e){return JP.safeParse(e.trim()).success}const jy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ty=ww,Mc=(e,t)=>r=>{var o;if((t==null?void 0:t.variants)==null)return Ty(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:c}=t,d=Object.keys(a).map(v=>{const w=r==null?void 0:r[v],f=c==null?void 0:c[v];if(w===null)return null;const x=jy(w)||jy(f);return a[v][x]}),p=r&&Object.entries(r).reduce((v,w)=>{let[f,x]=w;return x===void 0||(v[f]=x),v},{}),g=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((v,w)=>{let{class:f,className:x,...S}=w;return Object.entries(S).every(N=>{let[k,C]=N;return Array.isArray(C)?C.includes({...c,...p}[k]):{...c,...p}[k]===C})?[...v,f,x]:v},[]);return Ty(e,d,g,r==null?void 0:r.class,r==null?void 0:r.className)},YP=Mc("inline-flex items-center rounded-sm border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-muted text-foreground hover:bg-muted/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80 dark:text-destructive-foreground",outline:"text-foreground dark:text-foreground",success:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/50 dark:text-green-300 dark:border-green-700",warning:"bg-amber-100 text-amber-700 border-amber-200 dark:bg-amber-900/50 dark:text-amber-300 dark:border-amber-700",info:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/50 dark:text-blue-300 dark:border-blue-700",rejected:"bg-red-100 text-red-700 border-red-200 dark:bg-red-900/50 dark:text-red-300 dark:border-red-700",neutral:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-700 dark:text-gray-200 dark:border-gray-600"}},defaultVariants:{variant:"default"}});function bp({className:e,variant:t,...r}){return u.jsx("div",{className:Le(YP({variant:t}),e),...r})}const to="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm hover:bg-muted",no="text-foreground/80 hover:text-foreground",Sp="bg-muted font-medium text-foreground",Dr="h-4 w-4 shrink-0",XP="flex w-full items-center gap-1.5 rounded px-2.5 py-1 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",Kl=e=>({nestId:e.id,nestName:e.name,isOwner:e.is_owner??e.permission==="owner",isAnonOwned:e.user_id===dw});function ej({nestId:e,nodeId:t,activeView:r=null,onCollapse:o,onOpenDocument:a,onOpenNest:c,onOpenView:d,onConnect:p,onOpenDashboard:g,logoUrl:v,dashboardTab:w=null,onOpenDashboardTab:f,onNewDocument:x}){var G,K;const S=Lr({...Bt.nestList(),enabled:e!==null}),{isAdmin:N,workflowPlaneEnabled:k}=Na(),[C,_]=y.useState(()=>new Set(e?[e]:[]));y.useEffect(()=>{e&&_(A=>A.has(e)?A:new Set([...A,e]))},[e]);const[R,I]=y.useState(""),j=y.useMemo(()=>{var Y;const A=((Y=S.data)==null?void 0:Y.nests)??[],M=R.trim().toLowerCase();return A.filter(V=>!M||V.id===e||String(V.name).toLowerCase().includes(M)).sort((V,le)=>V.id===e?-1:le.id===e?1:String(V.name).localeCompare(String(le.name)))},[S.data,e,R]);return u.jsxs("nav",{"aria-label":"Nests and documents",className:"flex h-full flex-col bg-muted/30 text-sm","data-testid":"document-sidebar",children:[u.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between gap-1 border-b border-border px-4",children:[u.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 items-center gap-2 hover:opacity-80",title:"Dashboard","data-testid":"document-sidebar-brand",children:[u.jsx("img",{src:v,alt:"ContextNest",className:"h-7 w-7 object-contain"}),u.jsx("span",{className:"font-semibold",children:"ContextNest"}),u.jsx(bp,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]}),u.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",title:"Hide sidebar","aria-label":"Hide sidebar","data-testid":"document-sidebar-collapse",children:u.jsx(__,{className:"h-4 w-4"})})]}),e!==null&&u.jsxs("button",{type:"button",onClick:g,className:Le(to,no,"mx-2 mt-3 w-auto"),title:"All nests",children:[u.jsx(Mv,{className:Dr}),"All nests"]}),e!==null&&(((K=(G=S.data)==null?void 0:G.nests)==null?void 0:K.length)??0)>1&&u.jsxs("div",{className:"relative mx-2 mt-1 mb-2",children:[u.jsx(tp,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),u.jsx("input",{type:"search",value:R,onChange:A=>I(A.target.value),placeholder:"Filter nests","aria-label":"Filter nests",className:"h-8 w-full rounded-md border border-border bg-background pl-7 pr-2 text-sm outline-none focus:ring-1 focus:ring-ring","data-testid":"document-sidebar-nest-filter"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-4",children:[e===null&&u.jsx(tj,{active:w,isAdmin:N,onOpen:f}),e!==null&&S.isLoading&&u.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"Loading…"}),e!==null&&j.map(A=>{const M=C.has(A.id),Y=A.id===e;return u.jsxs("div",{className:Le("mb-1",Y&&"mb-3"),children:[u.jsxs("div",{className:Le("group flex items-center gap-1 rounded px-1.5 py-1",Y?"text-foreground":"text-muted-foreground"),children:[u.jsx("button",{type:"button",onClick:()=>_(V=>{const le=new Set(V);return le.has(A.id)?le.delete(A.id):le.add(A.id),le}),className:"rounded p-0.5 hover:bg-muted","aria-label":M?`Collapse ${A.name}`:`Expand ${A.name}`,"aria-expanded":M,children:M?u.jsx(li,{className:"h-3.5 w-3.5"}):u.jsx(Ca,{className:"h-3.5 w-3.5"})}),u.jsxs("button",{type:"button",onClick:()=>c(Kl(A)),className:"flex min-w-0 flex-1 items-center gap-1.5 truncate text-left text-xs font-semibold uppercase tracking-wide hover:text-foreground",title:`Open ${A.name}`,children:[u.jsx("span",{className:"truncate",children:A.name}),u.jsx(nj,{visibility:A.visibility})]}),Y&&x&&u.jsx("button",{type:"button",onClick:()=>x(),className:"rounded p-0.5 opacity-0 hover:bg-muted group-hover:opacity-100 focus:opacity-100",title:"New document","aria-label":"New document",children:u.jsx(Iv,{className:"h-3.5 w-3.5"})})]}),M&&Y&&u.jsx(sj,{nestId:A.id,isOwner:Kl(A).isOwner,isAdmin:N,workflowPlaneEnabled:k,activeView:r,onOpen:V=>d(Kl(A),V),onConnect:p}),M&&u.jsx(oj,{nestId:A.id,currentNodeId:Y?t:null,onOpen:V=>a({...Kl(A),nodeId:V}),onNewDocument:Y?x:void 0})]},A.id)})]})]})}function tj({active:e,isAdmin:t,onOpen:r}){const o=qE({isAdmin:t}),[a,c]=y.useState(()=>jc(localStorage).closedGroups),d=(p,g)=>{const v=g?a.filter(w=>w!==p):[...a,p];c(v),dp(localStorage,{closedGroups:v})};return u.jsxs("div",{className:"mt-3 space-y-0.5","data-testid":"document-sidebar-dashboard",children:[o.top.map(p=>u.jsx(Ry,{page:p,active:p.id===e,onOpen:r},p.id)),o.groups.map(p=>{const g=p.pages.some(w=>w.id===e),v=!a.includes(p.id)||g;return u.jsxs("div",{className:"pt-2",children:[u.jsxs("button",{type:"button",onClick:()=>d(p.id,!v),"aria-expanded":v,className:XP,"data-testid":`document-sidebar-group-${p.id}`,children:[v?u.jsx(li,{className:"h-3.5 w-3.5 shrink-0"}):u.jsx(Ca,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"truncate",children:p.label})]}),v&&u.jsx("div",{className:"space-y-0.5",children:p.pages.map(w=>u.jsx(Ry,{page:w,active:w.id===e,onOpen:r,indent:!0},w.id))})]},p.id)})]})}function Ry({page:e,active:t,indent:r=!1,onOpen:o}){var p,g;const a=Lr({...((p=e.badge)==null?void 0:p.options())??{queryKey:["page-badge",e.id,"none"],queryFn:async()=>null},enabled:!!e.badge}),c=e.badge?e.badge.count(a.data):0,d=e.icon;return u.jsxs("button",{type:"button",onClick:()=>o==null?void 0:o(e.id),"aria-current":t?"page":void 0,className:Le(to,r&&"pl-7",t?Sp:no),"data-testid":`document-sidebar-dashboard-${e.id}`,children:[u.jsx(d,{className:Dr}),u.jsx("span",{className:"truncate",children:e.label}),c>0&&u.jsx("span",{className:Le("ml-auto rounded-full px-2 py-0.5 text-[11px] font-semibold tabular-nums",((g=e.badge)==null?void 0:g.tone)==="primary"?"bg-primary text-primary-foreground":"bg-muted-foreground/15 text-muted-foreground"),children:c})]})}function nj({visibility:e}){return e==="public"?u.jsx(n_,{className:"h-3 w-3 shrink-0 text-green-600","aria-label":"Public"}):e==="org"?u.jsx($k,{className:"h-3 w-3 shrink-0 text-blue-600","aria-label":"Organization"}):u.jsx(m_,{className:"h-3 w-3 shrink-0 opacity-60","aria-label":"Private"})}const rj={overview:Av,review:Bk};function sj({nestId:e,isOwner:t,isAdmin:r,workflowPlaneEnabled:o,activeView:a,onOpen:c,onConnect:d}){var G,K,A,M,Y;const p=KN(e),g=y.useMemo(()=>{var le;const V=p.data;return V?Nf({roles:V.roles??[],permission:V.permission??null,myStewards:V.myStewards??[],isOwner:t,isAdmin:r,readerMode:!!((le=V.nest)!=null&&le.reader_mode),isArchived:QN(V.nest)}):null},[p.data,t,r]),v=Lr({...Bt.reviewQueue(e),enabled:!!g&&!g.isReadOnly&&!g.isReaderView}),w=((G=v.data)==null?void 0:G.total)??((A=(K=v.data)==null?void 0:K.requests)==null?void 0:A.length)??0,f=!!((Y=(M=p.data)==null?void 0:M.nest)!=null&&Y.stewardship_enabled),x=y.useMemo(()=>g?yE(g,{workflowPlaneEnabled:o,stewardshipEnabled:f,hasPending:w>0}):[],[g,o,f,w]),[S,N]=y.useState(()=>jc(localStorage).viewsOpen),k=V=>{N(V),dp(localStorage,{viewsOpen:V})},C=x.some(V=>V.group==="views"&&V.id===a),_=S||C,R=x.filter(V=>!V.group),I=x.filter(V=>V.group==="views");if(x.length===0)return null;const j=(V,le=!1)=>{const he=V.icon??rj[V.id]??Av,pe=V.id===a;return u.jsxs("button",{type:"button",onClick:()=>c(V),"aria-current":pe?"page":void 0,className:Le(to,le&&"pl-7",pe?Sp:no),"data-testid":`document-sidebar-view-${V.id}`,children:[u.jsx(he,{className:Dr}),u.jsx("span",{className:"truncate",children:V.label}),V.id==="review"&&w>0&&u.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-px text-[10px] font-semibold tabular-nums text-amber-800 dark:bg-amber-950/40 dark:text-amber-300",title:`${w} awaiting review`,"data-testid":"document-sidebar-review-badge",children:[u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500","aria-hidden":!0}),w]})]},V.id)};return u.jsxs("div",{className:"mb-1 ml-2 pl-1","data-testid":"document-sidebar-views",children:[R.map(V=>j(V)),I.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",onClick:()=>k(!_),"aria-expanded":_,className:Le(to,no),"data-testid":"document-sidebar-views-group",children:[_?u.jsx(li,{className:Dr}):u.jsx(Ca,{className:Dr}),u.jsx("span",{className:"truncate",children:"Views"})]}),_&&I.map(V=>j(V,!0))]}),d&&u.jsxs("button",{type:"button",onClick:d,className:Le(to,no),title:"Connect a CLI, MCP client or API caller to this nest","data-testid":"document-sidebar-connect",children:[u.jsx(j_,{className:Dr}),u.jsx("span",{className:"truncate",children:"Connect"})]})]})}function oj({nestId:e,currentNodeId:t,onOpen:r,onNewDocument:o}){var C;const[a,c]=y.useState(()=>new Map),d=y.useMemo(()=>new Set(t?mE(t):[]),[t]),p=_=>a.get(_)??!d.has(_),g=Lr(Bt.census(e)),v=y.useMemo(()=>{var _;return(((_=g.data)==null?void 0:_.census.folders)??[]).map(R=>({path:R.path,total:R.total??0}))},[g.data]),w=y.useMemo(()=>["",...v.map(R=>R.path).filter(R=>!p(R))],[v,a,d]),f=FN({queries:w.map(_=>Bt.folderNodes(e,_))}),x=f[0],S=f.flatMap(_=>{var R;return((R=_.data)==null?void 0:R.nodes)??[]}),N=S.map(_=>_.id).join("|"),k=y.useMemo(()=>gE(S),[N]);return x!=null&&x.isLoading&&g.isLoading?u.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"Loading…"}):x!=null&&x.isError?u.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"Couldn't load"}):!(x!=null&&x.isLoading)&&(((C=x==null?void 0:x.data)==null?void 0:C.nodes)??[]).length===0&&v.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"No documents yet"}):u.jsx(wE,{groups:k,known:v,indentRem:.75,isCollapsed:p,className:"ml-2 border-l border-border/60 pl-1",renderFolder:(_,{collapsed:R})=>u.jsxs("div",{className:"group flex items-center",children:[u.jsxs("button",{type:"button",onClick:()=>c(I=>new Map(I).set(_.path,!R)),className:Le(to,no),"aria-expanded":!R,title:_.path,children:[R?u.jsx(e_,{className:Dr}):u.jsx(Yk,{className:Dr}),u.jsx("span",{className:"truncate",children:_.label}),_.total>0&&u.jsx("span",{className:"ml-auto text-[10px] tabular-nums opacity-70",children:_.total})]}),o&&u.jsx("button",{type:"button",onClick:()=>o(_.path),className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 hover:bg-muted hover:text-foreground focus:opacity-100 group-hover:opacity-100",title:`New document in ${_.label}`,"aria-label":`New document in ${_.label}`,"data-testid":"document-sidebar-folder-new",children:u.jsx(Iv,{className:"h-3.5 w-3.5"})})]}),renderDoc:_=>{const R=_.id===t;return u.jsxs("button",{type:"button",onClick:()=>r(_.id),"aria-current":R?"page":void 0,className:Le(to,R?Sp:no),title:_.title,"data-testid":"document-sidebar-doc",children:[u.jsx(Xf,{className:Dr}),u.jsx("span",{className:"truncate",children:_.title||"Untitled"})]})}})}function De(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Ay(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cs(...e){return t=>{let r=!1;const o=e.map(a=>{const c=Ay(a,t);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let a=0;a<o.length;a++){const c=o[a];typeof c=="function"?c():Ay(e[a],null)}}}}function Ct(...e){return y.useCallback(Cs(...e),e)}function ij(e,t){const r=y.createContext(t),o=c=>{const{children:d,...p}=c,g=y.useMemo(()=>p,Object.values(p));return u.jsx(r.Provider,{value:g,children:d})};o.displayName=e+"Provider";function a(c){const d=y.useContext(r);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[o,a]}function Ns(e,t=[]){let r=[];function o(c,d){const p=y.createContext(d),g=r.length;r=[...r,d];const v=f=>{var _;const{scope:x,children:S,...N}=f,k=((_=x==null?void 0:x[e])==null?void 0:_[g])||p,C=y.useMemo(()=>N,Object.values(N));return u.jsx(k.Provider,{value:C,children:S})};v.displayName=c+"Provider";function w(f,x){var k;const S=((k=x==null?void 0:x[e])==null?void 0:k[g])||p,N=y.useContext(S);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${f}\` must be used within \`${c}\``)}return[v,w]}const a=()=>{const c=r.map(d=>y.createContext(d));return function(p){const g=(p==null?void 0:p[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...p,[e]:g}}),[p,g])}};return a.scopeName=e,[o,aj(a,...t)]}function aj(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const d=o.reduce((p,{useScope:g,scopeName:v})=>{const f=g(c)[`__scope${v}`];return{...p,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return r.scopeName=t.scopeName,r}var Jn=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},lj=Gf[" useId ".trim().toString()]||(()=>{}),cj=0;function ro(e){const[t,r]=y.useState(lj());return Jn(()=>{r(o=>o??String(cj++))},[e]),e||(t?`radix-${t}`:"")}var uj=Gf[" useInsertionEffect ".trim().toString()]||Jn;function Ea({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[a,c,d]=dj({defaultProp:t,onChange:r}),p=e!==void 0,g=p?e:a;{const w=y.useRef(e!==void 0);y.useEffect(()=>{const f=w.current;f!==p&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${p?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),w.current=p},[p,o])}const v=y.useCallback(w=>{var f;if(p){const x=fj(w)?w(e):w;x!==e&&((f=d.current)==null||f.call(d,x))}else c(w)},[p,e,c,d]);return[g,v]}function dj({defaultProp:e,onChange:t}){const[r,o]=y.useState(e),a=y.useRef(r),c=y.useRef(t);return uj(()=>{c.current=t},[t]),y.useEffect(()=>{var d;a.current!==r&&((d=c.current)==null||d.call(c,r),a.current=r)},[r,a]),[r,o,c]}function fj(e){return typeof e=="function"}function pj(e){const t=hj(e),r=y.forwardRef((o,a)=>{const{children:c,...d}=o,p=y.Children.toArray(c),g=p.find(gj);if(g){const v=g.props.children,w=p.map(f=>f===g?y.Children.count(v)>1?y.Children.only(null):y.isValidElement(v)?v.props.children:null:f);return u.jsx(t,{...d,ref:a,children:y.isValidElement(v)?y.cloneElement(v,void 0,w):null})}return u.jsx(t,{...d,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function hj(e){const t=y.forwardRef((r,o)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const d=vj(a),p=yj(c,a.props);return a.type!==y.Fragment&&(p.ref=o?Cs(o,d):d),y.cloneElement(a,p)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mj=Symbol("radix.slottable");function gj(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mj}function yj(e,t){const r={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?r[o]=(...p)=>{const g=c(...p);return a(...p),g}:a&&(r[o]=a):o==="style"?r[o]={...a,...c}:o==="className"&&(r[o]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function vj(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var wj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=wj.reduce((e,t)=>{const r=pj(`Primitive.${t}`),o=y.forwardRef((a,c)=>{const{asChild:d,...p}=a,g=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...p,ref:c})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Gw(e,t){e&&Zf.flushSync(()=>e.dispatchEvent(t))}function vr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function xj(e,t=globalThis==null?void 0:globalThis.document){const r=vr(e);y.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var bj="DismissableLayer",Mf="dismissableLayer.update",Sj="dismissableLayer.pointerDownOutside",kj="dismissableLayer.focusOutside",My,Zw=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:d,onDismiss:p,...g}=e,v=y.useContext(Zw),[w,f]=y.useState(null),x=(w==null?void 0:w.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=y.useState({}),N=Ct(t,A=>f(A)),k=Array.from(v.layers),[C]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),_=k.indexOf(C),R=w?k.indexOf(w):-1,I=v.layersWithOutsidePointerEventsDisabled.size>0,j=R>=_,G=Nj(A=>{const M=A.target,Y=[...v.branches].some(V=>V.contains(M));!j||Y||(a==null||a(A),d==null||d(A),A.defaultPrevented||p==null||p())},x),K=Ej(A=>{const M=A.target;[...v.branches].some(V=>V.contains(M))||(c==null||c(A),d==null||d(A),A.defaultPrevented||p==null||p())},x);return xj(A=>{R===v.layers.size-1&&(o==null||o(A),!A.defaultPrevented&&p&&(A.preventDefault(),p()))},x),y.useEffect(()=>{if(w)return r&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(My=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(w)),v.layers.add(w),$y(),()=>{r&&v.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=My)}},[w,x,r,v]),y.useEffect(()=>()=>{w&&(v.layers.delete(w),v.layersWithOutsidePointerEventsDisabled.delete(w),$y())},[w,v]),y.useEffect(()=>{const A=()=>S({});return document.addEventListener(Mf,A),()=>document.removeEventListener(Mf,A)},[]),u.jsx(Ze.div,{...g,ref:N,style:{pointerEvents:I?j?"auto":"none":void 0,...e.style},onFocusCapture:De(e.onFocusCapture,K.onFocusCapture),onBlurCapture:De(e.onBlurCapture,K.onBlurCapture),onPointerDownCapture:De(e.onPointerDownCapture,G.onPointerDownCapture)})});kp.displayName=bj;var _j="DismissableLayerBranch",Cj=y.forwardRef((e,t)=>{const r=y.useContext(Zw),o=y.useRef(null),a=Ct(t,o);return y.useEffect(()=>{const c=o.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),u.jsx(Ze.div,{...e,ref:a})});Cj.displayName=_j;function Nj(e,t=globalThis==null?void 0:globalThis.document){const r=vr(e),o=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const c=p=>{if(p.target&&!o.current){let g=function(){Jw(Sj,r,v,{discrete:!0})};const v={originalEvent:p};p.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=g,t.addEventListener("click",a.current,{once:!0})):g()}else t.removeEventListener("click",a.current);o.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Ej(e,t=globalThis==null?void 0:globalThis.document){const r=vr(e),o=y.useRef(!1);return y.useEffect(()=>{const a=c=>{c.target&&!o.current&&Jw(kj,r,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function $y(){const e=new CustomEvent(Mf);document.dispatchEvent(e)}function Jw(e,t,r,{discrete:o}){const a=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?Gw(a,c):a.dispatchEvent(c)}var Ud="focusScope.autoFocusOnMount",Vd="focusScope.autoFocusOnUnmount",Iy={bubbles:!1,cancelable:!0},Oj="FocusScope",_p=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:c,...d}=e,[p,g]=y.useState(null),v=vr(a),w=vr(c),f=y.useRef(null),x=Ct(t,k=>g(k)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(o){let k=function(I){if(S.paused||!p)return;const j=I.target;p.contains(j)?f.current=j:fs(f.current,{select:!0})},C=function(I){if(S.paused||!p)return;const j=I.relatedTarget;j!==null&&(p.contains(j)||fs(f.current,{select:!0}))},_=function(I){if(document.activeElement===document.body)for(const G of I)G.removedNodes.length>0&&fs(p)};document.addEventListener("focusin",k),document.addEventListener("focusout",C);const R=new MutationObserver(_);return p&&R.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",C),R.disconnect()}}},[o,p,S.paused]),y.useEffect(()=>{if(p){Ly.add(S);const k=document.activeElement;if(!p.contains(k)){const _=new CustomEvent(Ud,Iy);p.addEventListener(Ud,v),p.dispatchEvent(_),_.defaultPrevented||(Pj(Mj(Yw(p)),{select:!0}),document.activeElement===k&&fs(p))}return()=>{p.removeEventListener(Ud,v),setTimeout(()=>{const _=new CustomEvent(Vd,Iy);p.addEventListener(Vd,w),p.dispatchEvent(_),_.defaultPrevented||fs(k??document.body,{select:!0}),p.removeEventListener(Vd,w),Ly.remove(S)},0)}}},[p,v,w,S]);const N=y.useCallback(k=>{if(!r&&!o||S.paused)return;const C=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,_=document.activeElement;if(C&&_){const R=k.currentTarget,[I,j]=jj(R);I&&j?!k.shiftKey&&_===j?(k.preventDefault(),r&&fs(I,{select:!0})):k.shiftKey&&_===I&&(k.preventDefault(),r&&fs(j,{select:!0})):_===R&&k.preventDefault()}},[r,o,S.paused]);return u.jsx(Ze.div,{tabIndex:-1,...d,ref:x,onKeyDown:N})});_p.displayName=Oj;function Pj(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(fs(o,{select:t}),document.activeElement!==r)return}function jj(e){const t=Yw(e),r=Dy(t,e),o=Dy(t.reverse(),e);return[r,o]}function Yw(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Dy(e,t){for(const r of e)if(!Tj(r,{upTo:t}))return r}function Tj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Rj(e){return e instanceof HTMLInputElement&&"select"in e}function fs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Rj(e)&&t&&e.select()}}var Ly=Aj();function Aj(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=zy(e,t),e.unshift(t)},remove(t){var r;e=zy(e,t),(r=e[0])==null||r.resume()}}}function zy(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Mj(e){return e.filter(t=>t.tagName!=="A")}var $j="Portal",Cp=y.forwardRef((e,t)=>{var p;const{container:r,...o}=e,[a,c]=y.useState(!1);Jn(()=>c(!0),[]);const d=r||a&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return d?Ev.createPortal(u.jsx(Ze.div,{...o,ref:t}),d):null});Cp.displayName=$j;function Ij(e,t){return y.useReducer((r,o)=>t[r][o]??r,e)}var zr=e=>{const{present:t,children:r}=e,o=Dj(t),a=typeof r=="function"?r({present:o.isPresent}):y.Children.only(r),c=Ct(o.ref,Lj(a));return typeof r=="function"||o.isPresent?y.cloneElement(a,{ref:c}):null};zr.displayName="Presence";function Dj(e){const[t,r]=y.useState(),o=y.useRef(null),a=y.useRef(e),c=y.useRef("none"),d=e?"mounted":"unmounted",[p,g]=Ij(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const v=Ql(o.current);c.current=p==="mounted"?v:"none"},[p]),Jn(()=>{const v=o.current,w=a.current;if(w!==e){const x=c.current,S=Ql(v);e?g("MOUNT"):S==="none"||(v==null?void 0:v.display)==="none"?g("UNMOUNT"):g(w&&x!==S?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,g]),Jn(()=>{if(t){let v;const w=t.ownerDocument.defaultView??window,f=S=>{const k=Ql(o.current).includes(CSS.escape(S.animationName));if(S.target===t&&k&&(g("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",v=w.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=S=>{S.target===t&&(c.current=Ql(o.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{w.clearTimeout(v),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else g("ANIMATION_END")},[t,g]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:y.useCallback(v=>{o.current=v?getComputedStyle(v):null,r(v)},[])}}function Ql(e){return(e==null?void 0:e.animationName)||"none"}function Lj(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Bd=0;function Xw(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fy()),document.body.insertAdjacentElement("beforeend",e[1]??Fy()),Bd++,()=>{Bd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bd--}},[])}function Fy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gr=function(){return gr=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])}return t},gr.apply(this,arguments)};function ex(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function zj(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,c;o<a;o++)(c||!(o in t))&&(c||(c=Array.prototype.slice.call(t,0,o)),c[o]=t[o]);return e.concat(c||Array.prototype.slice.call(t))}var rc="right-scroll-bar-position",sc="width-before-scroll-bar",Fj="with-scroll-bars-hidden",Uj="--removed-body-scroll-bar-size";function Wd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Vj(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Bj=typeof window<"u"?y.useLayoutEffect:y.useEffect,Uy=new WeakMap;function Wj(e,t){var r=Vj(null,function(o){return e.forEach(function(a){return Wd(a,o)})});return Bj(function(){var o=Uy.get(r);if(o){var a=new Set(o),c=new Set(e),d=r.current;a.forEach(function(p){c.has(p)||Wd(p,null)}),c.forEach(function(p){a.has(p)||Wd(p,d)})}Uy.set(r,e)},[e]),r}function Hj(e){return e}function qj(e,t){t===void 0&&(t=Hj);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var d=t(c,o);return r.push(d),function(){r=r.filter(function(p){return p!==d})}},assignSyncMedium:function(c){for(o=!0;r.length;){var d=r;r=[],d.forEach(c)}r={push:function(p){return c(p)},filter:function(){return r}}},assignMedium:function(c){o=!0;var d=[];if(r.length){var p=r;r=[],p.forEach(c),d=r}var g=function(){var w=d;d=[],w.forEach(c)},v=function(){return Promise.resolve().then(g)};v(),r={push:function(w){d.push(w),v()},filter:function(w){return d=d.filter(w),r}}}};return a}function Kj(e){e===void 0&&(e={});var t=qj(null);return t.options=gr({async:!0,ssr:!1},e),t}var tx=function(e){var t=e.sideCar,r=ex(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return y.createElement(o,gr({},r))};tx.isSideCarExport=!0;function Qj(e,t){return e.useMedium(t),tx}var nx=Kj(),Hd=function(){},$c=y.forwardRef(function(e,t){var r=y.useRef(null),o=y.useState({onScrollCapture:Hd,onWheelCapture:Hd,onTouchMoveCapture:Hd}),a=o[0],c=o[1],d=e.forwardProps,p=e.children,g=e.className,v=e.removeScrollBar,w=e.enabled,f=e.shards,x=e.sideCar,S=e.noRelative,N=e.noIsolation,k=e.inert,C=e.allowPinchZoom,_=e.as,R=_===void 0?"div":_,I=e.gapMode,j=ex(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=x,K=Wj([r,t]),A=gr(gr({},j),a);return y.createElement(y.Fragment,null,w&&y.createElement(G,{sideCar:nx,removeScrollBar:v,shards:f,noRelative:S,noIsolation:N,inert:k,setCallbacks:c,allowPinchZoom:!!C,lockRef:r,gapMode:I}),d?y.cloneElement(y.Children.only(p),gr(gr({},A),{ref:K})):y.createElement(R,gr({},A,{className:g,ref:K}),p))});$c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$c.classNames={fullWidth:sc,zeroRight:rc};var Gj=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Gj();return t&&e.setAttribute("nonce",t),e}function Jj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xj=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Zj())&&(Jj(t,r),Yj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eT=function(){var e=Xj();return function(t,r){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},rx=function(){var e=eT(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},tT={left:0,top:0,right:0,gap:0},qd=function(e){return parseInt(e||"",10)||0},nT=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[qd(r),qd(o),qd(a)]},rT=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tT;var t=nT(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},sT=rx(),Ho="data-scroll-locked",oT=function(e,t,r,o){var a=e.left,c=e.top,d=e.right,p=e.gap;return r===void 0&&(r="margin"),`
329
+ .`.concat(Fj,` {
330
+ overflow: hidden `).concat(o,`;
331
+ padding-right: `).concat(p,"px ").concat(o,`;
332
+ }
333
+ body[`).concat(Ho,`] {
334
+ overflow: hidden `).concat(o,`;
335
+ overscroll-behavior: contain;
336
+ `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
337
+ padding-left: `.concat(a,`px;
338
+ padding-top: `).concat(c,`px;
339
+ padding-right: `).concat(d,`px;
340
+ margin-left:0;
341
+ margin-top:0;
342
+ margin-right: `).concat(p,"px ").concat(o,`;
343
+ `),r==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
344
+ }
345
+
346
+ .`).concat(rc,` {
347
+ right: `).concat(p,"px ").concat(o,`;
348
+ }
349
+
350
+ .`).concat(sc,` {
351
+ margin-right: `).concat(p,"px ").concat(o,`;
352
+ }
353
+
354
+ .`).concat(rc," .").concat(rc,` {
355
+ right: 0 `).concat(o,`;
356
+ }
357
+
358
+ .`).concat(sc," .").concat(sc,` {
359
+ margin-right: 0 `).concat(o,`;
360
+ }
361
+
362
+ body[`).concat(Ho,`] {
363
+ `).concat(Uj,": ").concat(p,`px;
364
+ }
365
+ `)},Vy=function(){var e=parseInt(document.body.getAttribute(Ho)||"0",10);return isFinite(e)?e:0},iT=function(){y.useEffect(function(){return document.body.setAttribute(Ho,(Vy()+1).toString()),function(){var e=Vy()-1;e<=0?document.body.removeAttribute(Ho):document.body.setAttribute(Ho,e.toString())}},[])},aT=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;iT();var c=y.useMemo(function(){return rT(a)},[a]);return y.createElement(sT,{styles:oT(c,!t,a,r?"":"!important")})},$f=!1;if(typeof window<"u")try{var Gl=Object.defineProperty({},"passive",{get:function(){return $f=!0,!0}});window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{$f=!1}var zo=$f?{passive:!1}:!1,lT=function(e){return e.tagName==="TEXTAREA"},sx=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!lT(e)&&r[t]==="visible")},cT=function(e){return sx(e,"overflowY")},uT=function(e){return sx(e,"overflowX")},By=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=ox(e,o);if(a){var c=ix(e,o),d=c[1],p=c[2];if(d>p)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},dT=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},fT=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},ox=function(e,t){return e==="v"?cT(t):uT(t)},ix=function(e,t){return e==="v"?dT(t):fT(t)},pT=function(e,t){return e==="h"&&t==="rtl"?-1:1},hT=function(e,t,r,o,a){var c=pT(e,window.getComputedStyle(t).direction),d=c*o,p=r.target,g=t.contains(p),v=!1,w=d>0,f=0,x=0;do{if(!p)break;var S=ix(e,p),N=S[0],k=S[1],C=S[2],_=k-C-c*N;(N||_)&&ox(e,p)&&(f+=_,x+=N);var R=p.parentNode;p=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!g&&p!==document.body||g&&(t.contains(p)||t===p));return(w&&Math.abs(f)<1||!w&&Math.abs(x)<1)&&(v=!0),v},Zl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wy=function(e){return[e.deltaX,e.deltaY]},Hy=function(e){return e&&"current"in e?e.current:e},mT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gT=function(e){return`
366
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
367
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
368
+ `)},yT=0,Fo=[];function vT(e){var t=y.useRef([]),r=y.useRef([0,0]),o=y.useRef(),a=y.useState(yT++)[0],c=y.useState(rx)[0],d=y.useRef(e);y.useEffect(function(){d.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var k=zj([e.lockRef.current],(e.shards||[]).map(Hy),!0).filter(Boolean);return k.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),k.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var p=y.useCallback(function(k,C){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!d.current.allowPinchZoom;var _=Zl(k),R=r.current,I="deltaX"in k?k.deltaX:R[0]-_[0],j="deltaY"in k?k.deltaY:R[1]-_[1],G,K=k.target,A=Math.abs(I)>Math.abs(j)?"h":"v";if("touches"in k&&A==="h"&&K.type==="range")return!1;var M=window.getSelection(),Y=M&&M.anchorNode,V=Y?Y===K||Y.contains(K):!1;if(V)return!1;var le=By(A,K);if(!le)return!0;if(le?G=A:(G=A==="v"?"h":"v",le=By(A,K)),!le)return!1;if(!o.current&&"changedTouches"in k&&(I||j)&&(o.current=G),!G)return!0;var he=o.current||G;return hT(he,C,k,he==="h"?I:j)},[]),g=y.useCallback(function(k){var C=k;if(!(!Fo.length||Fo[Fo.length-1]!==c)){var _="deltaY"in C?Wy(C):Zl(C),R=t.current.filter(function(G){return G.name===C.type&&(G.target===C.target||C.target===G.shadowParent)&&mT(G.delta,_)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var I=(d.current.shards||[]).map(Hy).filter(Boolean).filter(function(G){return G.contains(C.target)}),j=I.length>0?p(C,I[0]):!d.current.noIsolation;j&&C.cancelable&&C.preventDefault()}}},[]),v=y.useCallback(function(k,C,_,R){var I={name:k,delta:C,target:_,should:R,shadowParent:wT(_)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(j){return j!==I})},1)},[]),w=y.useCallback(function(k){r.current=Zl(k),o.current=void 0},[]),f=y.useCallback(function(k){v(k.type,Wy(k),k.target,p(k,e.lockRef.current))},[]),x=y.useCallback(function(k){v(k.type,Zl(k),k.target,p(k,e.lockRef.current))},[]);y.useEffect(function(){return Fo.push(c),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",g,zo),document.addEventListener("touchmove",g,zo),document.addEventListener("touchstart",w,zo),function(){Fo=Fo.filter(function(k){return k!==c}),document.removeEventListener("wheel",g,zo),document.removeEventListener("touchmove",g,zo),document.removeEventListener("touchstart",w,zo)}},[]);var S=e.removeScrollBar,N=e.inert;return y.createElement(y.Fragment,null,N?y.createElement(c,{styles:gT(a)}):null,S?y.createElement(aT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xT=Qj(nx,vT);var Np=y.forwardRef(function(e,t){return y.createElement($c,gr({},e,{ref:t,sideCar:xT}))});Np.classNames=$c.classNames;var bT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Uo=new WeakMap,Jl=new WeakMap,Yl={},Kd=0,ax=function(e){return e&&(e.host||ax(e.parentNode))},ST=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=ax(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},kT=function(e,t,r,o){var a=ST(t,Array.isArray(e)?e:[e]);Yl[r]||(Yl[r]=new WeakMap);var c=Yl[r],d=[],p=new Set,g=new Set(a),v=function(f){!f||p.has(f)||(p.add(f),v(f.parentNode))};a.forEach(v);var w=function(f){!f||g.has(f)||Array.prototype.forEach.call(f.children,function(x){if(p.has(x))w(x);else try{var S=x.getAttribute(o),N=S!==null&&S!=="false",k=(Uo.get(x)||0)+1,C=(c.get(x)||0)+1;Uo.set(x,k),c.set(x,C),d.push(x),k===1&&N&&Jl.set(x,!0),C===1&&x.setAttribute(r,"true"),N||x.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",x,_)}})};return w(t),p.clear(),Kd++,function(){d.forEach(function(f){var x=Uo.get(f)-1,S=c.get(f)-1;Uo.set(f,x),c.set(f,S),x||(Jl.has(f)||f.removeAttribute(o),Jl.delete(f)),S||f.removeAttribute(r)}),Kd--,Kd||(Uo=new WeakMap,Uo=new WeakMap,Jl=new WeakMap,Yl={})}},lx=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=bT(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),kT(o,a,r,"aria-hidden")):function(){return null}};function _T(e){const t=CT(e),r=y.forwardRef((o,a)=>{const{children:c,...d}=o,p=y.Children.toArray(c),g=p.find(ET);if(g){const v=g.props.children,w=p.map(f=>f===g?y.Children.count(v)>1?y.Children.only(null):y.isValidElement(v)?v.props.children:null:f);return u.jsx(t,{...d,ref:a,children:y.isValidElement(v)?y.cloneElement(v,void 0,w):null})}return u.jsx(t,{...d,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function CT(e){const t=y.forwardRef((r,o)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const d=PT(a),p=OT(c,a.props);return a.type!==y.Fragment&&(p.ref=o?Cs(o,d):d),y.cloneElement(a,p)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NT=Symbol("radix.slottable");function ET(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NT}function OT(e,t){const r={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?r[o]=(...p)=>{const g=c(...p);return a(...p),g}:a&&(r[o]=a):o==="style"?r[o]={...a,...c}:o==="className"&&(r[o]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function PT(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ic="Dialog",[cx,I4]=Ns(Ic),[jT,nr]=cx(Ic),ux=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:c,modal:d=!0}=e,p=y.useRef(null),g=y.useRef(null),[v,w]=Ea({prop:o,defaultProp:a??!1,onChange:c,caller:Ic});return u.jsx(jT,{scope:t,triggerRef:p,contentRef:g,contentId:ro(),titleId:ro(),descriptionId:ro(),open:v,onOpenChange:w,onOpenToggle:y.useCallback(()=>w(f=>!f),[w]),modal:d,children:r})};ux.displayName=Ic;var dx="DialogTrigger",fx=y.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=nr(dx,r),c=Ct(t,a.triggerRef);return u.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Pp(a.open),...o,ref:c,onClick:De(e.onClick,a.onOpenToggle)})});fx.displayName=dx;var Ep="DialogPortal",[TT,px]=cx(Ep,{forceMount:void 0}),hx=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,c=nr(Ep,t);return u.jsx(TT,{scope:t,forceMount:r,children:y.Children.map(o,d=>u.jsx(zr,{present:r||c.open,children:u.jsx(Cp,{asChild:!0,container:a,children:d})}))})};hx.displayName=Ep;var mc="DialogOverlay",mx=y.forwardRef((e,t)=>{const r=px(mc,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,c=nr(mc,e.__scopeDialog);return c.modal?u.jsx(zr,{present:o||c.open,children:u.jsx(AT,{...a,ref:t})}):null});mx.displayName=mc;var RT=_T("DialogOverlay.RemoveScroll"),AT=y.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=nr(mc,r);return u.jsx(Np,{as:RT,allowPinchZoom:!0,shards:[a.contentRef],children:u.jsx(Ze.div,{"data-state":Pp(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),io="DialogContent",gx=y.forwardRef((e,t)=>{const r=px(io,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,c=nr(io,e.__scopeDialog);return u.jsx(zr,{present:o||c.open,children:c.modal?u.jsx(MT,{...a,ref:t}):u.jsx($T,{...a,ref:t})})});gx.displayName=io;var MT=y.forwardRef((e,t)=>{const r=nr(io,e.__scopeDialog),o=y.useRef(null),a=Ct(t,r.contentRef,o);return y.useEffect(()=>{const c=o.current;if(c)return lx(c)},[]),u.jsx(yx,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:De(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),(d=r.triggerRef.current)==null||d.focus()}),onPointerDownOutside:De(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,p=d.button===0&&d.ctrlKey===!0;(d.button===2||p)&&c.preventDefault()}),onFocusOutside:De(e.onFocusOutside,c=>c.preventDefault())})}),$T=y.forwardRef((e,t)=>{const r=nr(io,e.__scopeDialog),o=y.useRef(!1),a=y.useRef(!1);return u.jsx(yx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var d,p;(d=e.onCloseAutoFocus)==null||d.call(e,c),c.defaultPrevented||(o.current||(p=r.triggerRef.current)==null||p.focus(),c.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:c=>{var g,v;(g=e.onInteractOutside)==null||g.call(e,c),c.defaultPrevented||(o.current=!0,c.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const d=c.target;((v=r.triggerRef.current)==null?void 0:v.contains(d))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&a.current&&c.preventDefault()}})}),yx=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:c,...d}=e,p=nr(io,r),g=y.useRef(null),v=Ct(t,g);return Xw(),u.jsxs(u.Fragment,{children:[u.jsx(_p,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:c,children:u.jsx(kp,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":Pp(p.open),...d,ref:v,onDismiss:()=>p.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(IT,{titleId:p.titleId}),u.jsx(LT,{contentRef:g,descriptionId:p.descriptionId})]})]})}),Op="DialogTitle",vx=y.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=nr(Op,r);return u.jsx(Ze.h2,{id:a.titleId,...o,ref:t})});vx.displayName=Op;var wx="DialogDescription",xx=y.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=nr(wx,r);return u.jsx(Ze.p,{id:a.descriptionId,...o,ref:t})});xx.displayName=wx;var bx="DialogClose",Sx=y.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=nr(bx,r);return u.jsx(Ze.button,{type:"button",...o,ref:t,onClick:De(e.onClick,()=>a.onOpenChange(!1))})});Sx.displayName=bx;function Pp(e){return e?"open":"closed"}var kx="DialogTitleWarning",[D4,_x]=ij(kx,{contentName:io,titleName:Op,docsSlug:"dialog"}),IT=({titleId:e})=>{const t=_x(kx),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
369
+
370
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
371
+
372
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},DT="DialogDescriptionWarning",LT=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_x(DT).contentName}}.`;return y.useEffect(()=>{var c;const a=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},zT=ux,L4=fx,FT=hx,Cx=mx,Nx=gx,Ex=vx,Ox=xx,UT=Sx;function Px(e,t){if(e==null)return{};var r={},o=Object.keys(e),a,c;for(c=0;c<o.length;c++)a=o[c],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}var VT=["color"],BT=y.forwardRef(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,a=Px(e,VT);return y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),y.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),WT=["color"],z4=y.forwardRef(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,a=Px(e,WT);return y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),y.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});const fi=zT,HT=FT,jx=y.forwardRef(({className:e,...t},r)=>u.jsx(Cx,{ref:r,className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));jx.displayName=Cx.displayName;const ao=y.forwardRef(({className:e,children:t,hideCloseButton:r,...o},a)=>u.jsxs(HT,{children:[u.jsx(jx,{}),u.jsxs(Nx,{ref:a,className:Le("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg [overflow-wrap:anywhere]",e),...o,children:[t,!r&&u.jsxs(UT,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(BT,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ao.displayName=Nx.displayName;const lo=({className:e,...t})=>u.jsx("div",{className:Le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});lo.displayName="DialogHeader";const jp=({className:e,...t})=>u.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jp.displayName="DialogFooter";const co=y.forwardRef(({className:e,...t},r)=>u.jsx(Ex,{ref:r,className:Le("text-lg font-semibold leading-none tracking-tight",e),...t}));co.displayName=Ex.displayName;const uo=y.forwardRef(({className:e,...t},r)=>u.jsx(Ox,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));uo.displayName=Ox.displayName;var qT=Symbol.for("react.lazy"),gc=Gf[" use ".trim().toString()];function KT(e){return typeof e=="object"&&e!==null&&"then"in e}function Tx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qT&&"_payload"in e&&KT(e._payload)}function Tp(e){const t=GT(e),r=y.forwardRef((o,a)=>{let{children:c,...d}=o;Tx(c)&&typeof gc=="function"&&(c=gc(c._payload));const p=y.Children.toArray(c),g=p.find(JT);if(g){const v=g.props.children,w=p.map(f=>f===g?y.Children.count(v)>1?y.Children.only(null):y.isValidElement(v)?v.props.children:null:f);return u.jsx(t,{...d,ref:a,children:y.isValidElement(v)?y.cloneElement(v,void 0,w):null})}return u.jsx(t,{...d,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}var QT=Tp("Slot");function GT(e){const t=y.forwardRef((r,o)=>{let{children:a,...c}=r;if(Tx(a)&&typeof gc=="function"&&(a=gc(a._payload)),y.isValidElement(a)){const d=XT(a),p=YT(c,a.props);return a.type!==y.Fragment&&(p.ref=o?Cs(o,d):d),y.cloneElement(a,p)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZT=Symbol("radix.slottable");function JT(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZT}function YT(e,t){const r={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?r[o]=(...p)=>{const g=c(...p);return a(...p),g}:a&&(r[o]=a):o==="style"?r[o]={...a,...c}:o==="className"&&(r[o]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function XT(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const eR=Mc("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Qe=y.forwardRef(({className:e,variant:t="default",size:r="default",asChild:o=!1,...a},c)=>{const d=o?QT:"button";return u.jsx(d,{className:Le(eR({variant:t,size:r,className:e})),ref:c,...a})});Qe.displayName="Button";function tR(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Rx(e){const[t,r]=y.useState(void 0);return Jn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const c=a[0];let d,p;if("borderBoxSize"in c){const g=c.borderBoxSize,v=Array.isArray(g)?g[0]:g;d=v.inlineSize,p=v.blockSize}else d=e.offsetWidth,p=e.offsetHeight;r({width:d,height:p})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Dc="Switch",[nR]=Ns(Dc),[rR,sR]=nR(Dc),Ax=y.forwardRef((e,t)=>{const{__scopeSwitch:r,name:o,checked:a,defaultChecked:c,required:d,disabled:p,value:g="on",onCheckedChange:v,form:w,...f}=e,[x,S]=y.useState(null),N=Ct(t,I=>S(I)),k=y.useRef(!1),C=x?w||!!x.closest("form"):!0,[_,R]=Ea({prop:a,defaultProp:c??!1,onChange:v,caller:Dc});return u.jsxs(rR,{scope:r,checked:_,disabled:p,children:[u.jsx(Ze.button,{type:"button",role:"switch","aria-checked":_,"aria-required":d,"data-state":Dx(_),"data-disabled":p?"":void 0,disabled:p,value:g,...f,ref:N,onClick:De(e.onClick,I=>{R(j=>!j),C&&(k.current=I.isPropagationStopped(),k.current||I.stopPropagation())})}),C&&u.jsx(Ix,{control:x,bubbles:!k.current,name:o,value:g,checked:_,required:d,disabled:p,form:w,style:{transform:"translateX(-100%)"}})]})});Ax.displayName=Dc;var Mx="SwitchThumb",$x=y.forwardRef((e,t)=>{const{__scopeSwitch:r,...o}=e,a=sR(Mx,r);return u.jsx(Ze.span,{"data-state":Dx(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})});$x.displayName=Mx;var oR="SwitchBubbleInput",Ix=y.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:o=!0,...a},c)=>{const d=y.useRef(null),p=Ct(d,c),g=tR(r),v=Rx(t);return y.useEffect(()=>{const w=d.current;if(!w)return;const f=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(f,"checked").set;if(g!==r&&S){const N=new Event("click",{bubbles:o});S.call(w,r),w.dispatchEvent(N)}},[g,r,o]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:p,style:{...a.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ix.displayName=oR;function Dx(e){return e?"checked":"unchecked"}var Lx=Ax,iR=$x;const zx=y.forwardRef(({className:e,...t},r)=>u.jsx(Lx,{className:Le("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-lg border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:u.jsx(iR,{className:Le("pointer-events-none block h-4 w-4 rounded-lg bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));zx.displayName=Lx.displayName;var aR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lR=aR.reduce((e,t)=>{const r=Tp(`Primitive.${t}`),o=y.forwardRef((a,c)=>{const{asChild:d,...p}=a,g=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...p,ref:c})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),cR="Label",Fx=y.forwardRef((e,t)=>u.jsx(lR.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Fx.displayName=cR;var Ux=Fx;const uR=Mc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),fa=y.forwardRef(({className:e,...t},r)=>u.jsx(Ux,{ref:r,className:Le(uR(),e),...t}));fa.displayName=Ux.displayName;function qy(e){const t=dR(e),r=y.forwardRef((o,a)=>{const{children:c,...d}=o,p=y.Children.toArray(c),g=p.find(pR);if(g){const v=g.props.children,w=p.map(f=>f===g?y.Children.count(v)>1?y.Children.only(null):y.isValidElement(v)?v.props.children:null:f);return u.jsx(t,{...d,ref:a,children:y.isValidElement(v)?y.cloneElement(v,void 0,w):null})}return u.jsx(t,{...d,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function dR(e){const t=y.forwardRef((r,o)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const d=mR(a),p=hR(c,a.props);return a.type!==y.Fragment&&(p.ref=o?Cs(o,d):d),y.cloneElement(a,p)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fR=Symbol("radix.slottable");function pR(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fR}function hR(e,t){const r={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?r[o]=(...p)=>{const g=c(...p);return a(...p),g}:a&&(r[o]=a):o==="style"?r[o]={...a,...c}:o==="className"&&(r[o]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function mR(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Vx(e){const t=e+"CollectionProvider",[r,o]=Ns(t),[a,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),d=k=>{const{scope:C,children:_}=k,R=ie.useRef(null),I=ie.useRef(new Map).current;return u.jsx(a,{scope:C,itemMap:I,collectionRef:R,children:_})};d.displayName=t;const p=e+"CollectionSlot",g=qy(p),v=ie.forwardRef((k,C)=>{const{scope:_,children:R}=k,I=c(p,_),j=Ct(C,I.collectionRef);return u.jsx(g,{ref:j,children:R})});v.displayName=p;const w=e+"CollectionItemSlot",f="data-radix-collection-item",x=qy(w),S=ie.forwardRef((k,C)=>{const{scope:_,children:R,...I}=k,j=ie.useRef(null),G=Ct(C,j),K=c(w,_);return ie.useEffect(()=>(K.itemMap.set(j,{ref:j,...I}),()=>void K.itemMap.delete(j))),u.jsx(x,{[f]:"",ref:G,children:R})});S.displayName=w;function N(k){const C=c(e+"CollectionConsumer",k);return ie.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const I=Array.from(R.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((K,A)=>I.indexOf(K.ref.current)-I.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:v,ItemSlot:S},N,o]}var gR=y.createContext(void 0);function Rp(e){const t=y.useContext(gR);return e||t||"ltr"}var Qd="rovingFocusGroup.onEntryFocus",yR={bubbles:!1,cancelable:!0},Oa="RovingFocusGroup",[If,Bx,vR]=Vx(Oa),[wR,Lc]=Ns(Oa,[vR]),[xR,bR]=wR(Oa),Wx=y.forwardRef((e,t)=>u.jsx(If.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(If.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(SR,{...e,ref:t})})}));Wx.displayName=Oa;var SR=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:g,onEntryFocus:v,preventScrollOnEntryFocus:w=!1,...f}=e,x=y.useRef(null),S=Ct(t,x),N=Rp(c),[k,C]=Ea({prop:d,defaultProp:p??null,onChange:g,caller:Oa}),[_,R]=y.useState(!1),I=vr(v),j=Bx(r),G=y.useRef(!1),[K,A]=y.useState(0);return y.useEffect(()=>{const M=x.current;if(M)return M.addEventListener(Qd,I),()=>M.removeEventListener(Qd,I)},[I]),u.jsx(xR,{scope:r,orientation:o,dir:N,loop:a,currentTabStopId:k,onItemFocus:y.useCallback(M=>C(M),[C]),onItemShiftTab:y.useCallback(()=>R(!0),[]),onFocusableItemAdd:y.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:y.useCallback(()=>A(M=>M-1),[]),children:u.jsx(Ze.div,{tabIndex:_||K===0?-1:0,"data-orientation":o,...f,ref:S,style:{outline:"none",...e.style},onMouseDown:De(e.onMouseDown,()=>{G.current=!0}),onFocus:De(e.onFocus,M=>{const Y=!G.current;if(M.target===M.currentTarget&&Y&&!_){const V=new CustomEvent(Qd,yR);if(M.currentTarget.dispatchEvent(V),!V.defaultPrevented){const le=j().filter(X=>X.focusable),he=le.find(X=>X.active),pe=le.find(X=>X.id===k),ce=[he,pe,...le].filter(Boolean).map(X=>X.ref.current);Kx(ce,w)}}G.current=!1}),onBlur:De(e.onBlur,()=>R(!1))})})}),Hx="RovingFocusGroupItem",qx=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:c,children:d,...p}=e,g=ro(),v=c||g,w=bR(Hx,r),f=w.currentTabStopId===v,x=Bx(r),{onFocusableItemAdd:S,onFocusableItemRemove:N,currentTabStopId:k}=w;return y.useEffect(()=>{if(o)return S(),()=>N()},[o,S,N]),u.jsx(If.ItemSlot,{scope:r,id:v,focusable:o,active:a,children:u.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":w.orientation,...p,ref:t,onMouseDown:De(e.onMouseDown,C=>{o?w.onItemFocus(v):C.preventDefault()}),onFocus:De(e.onFocus,()=>w.onItemFocus(v)),onKeyDown:De(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){w.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const _=CR(C,w.orientation,w.dir);if(_!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let I=x().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")I.reverse();else if(_==="prev"||_==="next"){_==="prev"&&I.reverse();const j=I.indexOf(C.currentTarget);I=w.loop?NR(I,j+1):I.slice(j+1)}setTimeout(()=>Kx(I))}}),children:typeof d=="function"?d({isCurrentTabStop:f,hasTabStop:k!=null}):d})})});qx.displayName=Hx;var kR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _R(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CR(e,t,r){const o=_R(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return kR[o]}function Kx(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function NR(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var Qx=Wx,Gx=qx,zc="Tabs",[ER]=Ns(zc,[Lc]),Zx=Lc(),[OR,Ap]=ER(zc),Jx=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:a,defaultValue:c,orientation:d="horizontal",dir:p,activationMode:g="automatic",...v}=e,w=Rp(p),[f,x]=Ea({prop:o,onChange:a,defaultProp:c??"",caller:zc});return u.jsx(OR,{scope:r,baseId:ro(),value:f,onValueChange:x,orientation:d,dir:w,activationMode:g,children:u.jsx(Ze.div,{dir:w,"data-orientation":d,...v,ref:t})})});Jx.displayName=zc;var Yx="TabsList",Xx=y.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...a}=e,c=Ap(Yx,r),d=Zx(r);return u.jsx(Qx,{asChild:!0,...d,orientation:c.orientation,dir:c.dir,loop:o,children:u.jsx(Ze.div,{role:"tablist","aria-orientation":c.orientation,...a,ref:t})})});Xx.displayName=Yx;var e0="TabsTrigger",t0=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:a=!1,...c}=e,d=Ap(e0,r),p=Zx(r),g=s0(d.baseId,o),v=o0(d.baseId,o),w=o===d.value;return u.jsx(Gx,{asChild:!0,...p,focusable:!a,active:w,children:u.jsx(Ze.button,{type:"button",role:"tab","aria-selected":w,"aria-controls":v,"data-state":w?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:g,...c,ref:t,onMouseDown:De(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?d.onValueChange(o):f.preventDefault()}),onKeyDown:De(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&d.onValueChange(o)}),onFocus:De(e.onFocus,()=>{const f=d.activationMode!=="manual";!w&&!a&&f&&d.onValueChange(o)})})})});t0.displayName=e0;var n0="TabsContent",r0=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:a,children:c,...d}=e,p=Ap(n0,r),g=s0(p.baseId,o),v=o0(p.baseId,o),w=o===p.value,f=y.useRef(w);return y.useEffect(()=>{const x=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(x)},[]),u.jsx(zr,{present:a||w,children:({present:x})=>u.jsx(Ze.div,{"data-state":w?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":g,hidden:!x,id:v,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:x&&c})})});r0.displayName=n0;function s0(e,t){return`${e}-trigger-${t}`}function o0(e,t){return`${e}-content-${t}`}var PR=Jx,i0=Xx,a0=t0,l0=r0;const c0=PR,Mp=y.forwardRef(({className:e,...t},r)=>u.jsx(i0,{ref:r,className:Le("inline-flex min-h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Mp.displayName=i0.displayName;const Vs=y.forwardRef(({className:e,...t},r)=>u.jsx(a0,{ref:r,className:Le("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Vs.displayName=a0.displayName;const Vo=y.forwardRef(({className:e,...t},r)=>u.jsx(l0,{ref:r,className:Le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Vo.displayName=l0.displayName;const Mr="<paste-your-api-key-here>";function F4(e){const t=e.reduce((r,o)=>{const a=Number(o.document_count??0);return r+(Number.isFinite(a)?a:0)},0);return{nestCount:e.length,documentCount:t}}function jR(e){return`${e.replace(/\/+$/,"")}/mcp`}function U4(e,t=!1){return["Connect to all my ContextNest nests and treat them as my source of truth.","",`Add one MCP server "contextnest" at: ${jR(e)}`,t?"This server needs no credential — connect directly.":"Authenticate with my ContextNest API key when your client asks for it — never print it back.","","Call nest_index first to see every nest (name, description, size).","","SEARCH/LIST: Omit `nest` to search across ALL nests at once, or specify a nest to target one.","READS: context_get/context_resolve need a `nest` argument — specify which nest.","WRITES: nest_create (no nest needed), context_create/update/delete/move/submit_review need a `nest`.","","Cite what you use as `nest:id`. Never write without asking me first."].join(`
373
+ `)}function TR(e){const{serverUrl:t,apiKey:r,nestId:o}=e;return["# ContextNest — keep this secret. Do not commit this file.",`CONTEXTNEST_SERVER=${t.replace(/\/+$/,"")}`,o?`CONTEXTNEST_NEST=${o}`:null,`CONTEXTNEST_API_KEY=${r}`,""].filter(Boolean).join(`
374
+ `)}function RR(e,t){return[`You are my assistant for the "${e}" nest — my governed knowledge base. Treat it as the source of truth.`,"","- When I ask something this nest could cover, SEARCH it first and answer from what you find; cite what you use as `nest:id`.","- If the nest doesn't cover it, say so plainly — don't invent. Offer to add it if it's worth remembering.","- If my question is ambiguous, ask one clarifying question first.","- Never publish or share anything publicly without asking me first.","",`Start by telling me what "${e}" covers, then ask what I want to dig into.`].join(`
375
+ `)}function Pa(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"nest"}function u0(e,t,r,o=!1){const a=e.replace(/\/+$/,""),c=Pa(r);return[`ctx vault add ${c} --url ${a}/nests/${t}/mcp${o?"":" --bearer-env CONTEXTNEST_API_KEY"}`,`ctx query "#tag" --vault ${c}`].join(`
376
+ `)}function AR(e,t,r,o=!1){const a=t.replace(/\/+$/,""),c=`${a}/nests/${r}/mcp`,d=o?"":'-H "Authorization: Bearer $CONTEXTNEST_API_KEY" ',p=o?"":` ${d.trimEnd()}`;return[`Connect to my ContextNest nest "${e}" and treat it as my source of truth.`,"",o?null:"KEY — it is in the environment variable CONTEXTNEST_API_KEY. If that variable is empty, ask me for it and stop: minting a key needs a credential you do not have yet.",o?null:"","RULE — do NOT claim you're connected until a call has returned real documents you can name. If nothing works, tell me which step failed and stop. Never guess, never summarise.","","STEP 1 — read the nest:",` curl -s -w '\\nHTTP_STATUS:%{http_code}\\n' -X POST ${a}/nests/${r}/context \\`,` ${d}-H "Content-Type: application/json" \\`,` -d '{"selector":"type:document","hops":1,"max_tokens":2000}'`,""," Documents back? You're connected. Name them, then read WHAT YOU CAN DO below.",""," Otherwise the status code tells you which problem you have:"," 503 the server has no PromptOwl license, which blocks that endpoint. This one is a"," GET, so it still works, and returns every document WITH its text in one call:",` curl -s -w '\\nHTTP_STATUS:%{http_code}\\n' "${a}/nests/${r}/export?format=markdown"${p}`," If the nest is too big to take in one go, list it and read what you need instead."," Append the id EXACTLY as the list returned it — for a nest created in the app that"," id already starts with `nodes/`, so the path looks doubled and that is correct; a"," nest imported from a folder has no such prefix. Do not add or strip one yourself:",` curl -s -w '\\nHTTP_STATUS:%{http_code}\\n' "${a}/nests/${r}/nodes"${p}`,` curl -s -w '\\nHTTP_STATUS:%{http_code}\\n' "${a}/nests/${r}/nodes/<id-from-the-list>"${p}`," Documents back from either call count as connected — the proof is real documents,"," not which endpoint served them. Tell me the server is unlicensed, and note the same"," gate covers every non-GET, so WRITES ARE ALSO UNAVAILABLE until a licence is installed.",o?null:" 401 the key is missing or wrong. Also check you did not send the literal text",o?null:" `$CONTEXTNEST_API_KEY`: that happens when the command runs without a shell to",o?null:" expand it, and you must substitute the value yourself. Otherwise ask me for the key."," 403 read the body. JSON with an `error` field is the server refusing you, and it says"," which: a `required_permission` field means my key lacks the tier for that action"," (a read-only key does this on any write); a scope message means the key belongs to"," a different nest. Tell me which one; neither is a network problem."," A 403 with NO JSON body came from something between you and the server, not from us."," that bodyless 403, or no response at all / connection refused / a timeout"," something between you and the server is blocking this — a sandbox or network egress"," policy. Either nothing answered, or a gateway answered instead of ContextNest."," Do not retry and do not tunnel around it. This one is mine to fix, not yours: ask me"," to add ContextNest as a custom connector in my client (Settings → Connectors), which"," is dialled server-side and is not subject to your egress rules.","","WHAT YOU CAN DO — if step 1 returned 503 this server is unlicensed: read it as above, and","do not attempt writes at all, they are blocked by the same gate. Otherwise this connection","reads, and writes IF my key carries write access — a read-only key reads perfectly well and","is refused on the first write. Assume nothing either way until you have my say-so to try.","Over MCP the write tools are","context_create, context_update, context_move and context_submit_review; over REST it is",`POST ${a}/nests/${r}/nodes to create, and PATCH that same path with the document's`,"id appended to update. Never write, publish or share without asking me first.","",`THEN — answer from the nest, cite what you use as \`${e}:nodes/<slug>\` (that is the id shape the server returns), and say plainly when something is not covered.`,"","LATER, optional, persists across sessions — ASK ME FIRST if setting either of these means","writing my key into a config file on this machine; that is my call, not a step you take in","passing. Both use the same credential:",` an MCP server "contextnest" at ${c}${o?"":" (Bearer header)"}`,...u0(a,r,e,o).split(`
377
+ `).map(g=>` ${g}`)," Both only take effect after you RESTART the session, so neither can prove anything now —"," and both go over MCP, which is POST, so on an unlicensed server (the 503 above) they are"," blocked by that same gate. On an unlicensed server the GET reads are all you have."].filter(g=>g!==null).join(`
378
+ `)}function MR(e,t,r=!1){return JSON.stringify({mcpServers:{[Pa(e)]:{command:"npx",args:["-y","mcp-remote",t,...r?[]:["--header",`Authorization: Bearer ${Mr}`]]}}},null,2)}function $R(e,t,r=!1){return`claude mcp add --transport http ${Pa(e)} ${t}${r?"":` --header "Authorization: Bearer ${Mr}"`}`}function IR(e,t,r=!1){return JSON.stringify({mcpServers:{[Pa(e)]:{url:t,...r?{}:{headers:{Authorization:`Bearer ${Mr}`}}}}},null,2)}function DR({isOpen:e,onClose:t,nestId:r,nestName:o,onManageKeys:a}){const{authenticated:c,authMode:d}=Na(),p=typeof window<"u"?window.location.origin:"http://localhost:3838",g=`${p}/nests/${r}/mcp`,v=`${p}/nests/${r}/export?format=markdown`,[w,f]=y.useState(!1),[x,S]=y.useState(!1),[N,k]=y.useState(!1),[C,_]=y.useState(!1),[R,I]=y.useState(!1),[j,G]=y.useState(!1),[K,A]=y.useState(null);y.useEffect(()=>{e||A(null)},[e]);const M=async()=>{A(null),S(!0);try{await kC(r,{nestName:o,includeDrafts:C}),k(!1)}catch(O){A((O==null?void 0:O.message)||"Bundle export failed")}finally{S(!1)}},Y=async()=>{A(null),f(!0);try{const O=await SC(r),Q=URL.createObjectURL(new Blob([O],{type:"text/markdown"})),re=document.createElement("a");re.href=Q,re.download=`${Pa(o)}.md`,document.body.appendChild(re),re.click(),re.remove(),URL.revokeObjectURL(Q)}catch(O){A((O==null?void 0:O.message)||"Export failed")}finally{f(!1)}},V=d==="open",le=MR(o,g,V),he=$R(o,g,V),pe=IR(o,g,V),fe=V,ce=!c&&d==="key",X=fe?"":` \\
379
+ -H "Authorization: Bearer ${Mr}"`,oe=`curl -X POST ${p}/nests/${r}/context \\
380
+ -H "Content-Type: application/json"${X} \\
381
+ -d '{"selector": "#gtm", "hops": 2, "max_tokens": 4000}'`,q=`curl "${p}/nests/${r}/nodes/nodes/<slug>?format=markdown"${X}`,H=u0(p,r,o,fe),D=fe?`ctx push --server ${p} --nest ${r}`:`CONTEXTNEST_API_KEY=${Mr} ctx push --server ${p} --nest ${r}`;return u.jsxs(u.Fragment,{children:[u.jsx(fi,{open:e,onOpenChange:t,children:u.jsxs(ao,{className:"sm:max-w-[640px] max-h-[85vh] flex flex-col overflow-hidden [&>*]:min-w-0",children:[u.jsxs(lo,{children:[u.jsxs(co,{children:["Connect to ",o]}),u.jsx(uo,{children:"Use this nest in the app you already have. New to this? Start on the Hootie tab — it's the quickest way in."})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden min-w-0 space-y-4",children:[u.jsxs("div",{className:"rounded-lg border-2 border-primary/30 bg-primary/5 p-3.5",children:[u.jsx("p",{className:"text-sm font-semibold",children:"Now paste into your AI agent or harness"}),u.jsx("p",{className:"mb-3 mt-0.5 text-xs text-muted-foreground",children:"Drop one of these into Claude, Cursor, Hootie, or any agent. It self-installs, connects, and asks you for your API key — one paste, all-purpose."}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsxs(Qe,{size:"sm",onClick:()=>ui(RR(o),"Chat prompt copied"),children:[u.jsx(v_,{className:"mr-1.5 h-3.5 w-3.5"}),"Chat with this nest"]}),u.jsxs(Qe,{size:"sm",onClick:()=>ui(AR(o,p,r,fe),"Setup prompt copied"),children:[u.jsx(U_,{className:"mr-1.5 h-3.5 w-3.5"}),"Set up an agent"]})]})]}),ce&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:[u.jsx(tc,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),u.jsx("span",{children:"You're not logged in. Login from the header to generate an API key for external clients."})]}),fe&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:[u.jsx(tc,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),u.jsxs("span",{children:["Server is in ",u.jsx("strong",{children:"open"})," mode — anyone on the network can read/write without a key. The snippets below omit the Authorization header."]})]}),K&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-900",children:[u.jsx(tc,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),u.jsx("span",{children:K})]}),c&&!fe&&u.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2",children:[u.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[u.jsx(c_,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"font-medium truncate",children:"External-client API key"})]}),a&&u.jsx(Qe,{variant:"outline",size:"sm",className:"shrink-0",onClick:a,children:"Manage API keys"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the key you already have — any of your keys works on every nest you can see. Need a new one, or lost the plaintext? Create or rotate it on the API keys page; keys are shown only once, when they're created."})]}),u.jsxs("button",{type:"button",onClick:()=>I(O=>!O),"aria-expanded":R,className:"flex w-full items-center justify-between rounded-lg border px-3 py-2.5 text-sm hover:bg-muted/40",children:[u.jsx("span",{className:"font-medium",children:"Configure a specific client"}),u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Hootie · Claude · Cursor · CLI",u.jsx(li,{className:`h-4 w-4 transition-transform ${R?"rotate-180":""}`})]})]}),R&&u.jsxs(c0,{defaultValue:"hootie",className:"w-full min-w-0",children:[u.jsxs(Mp,{className:"grid w-full grid-cols-5 sticky top-0 z-10",children:[u.jsxs(Vs,{value:"hootie",children:[u.jsx(Ak,{className:"h-3.5 w-3.5 mr-1"}),"Hootie"]}),u.jsxs(Vs,{value:"claude",children:[u.jsx(Kg,{className:"h-3.5 w-3.5 mr-1"}),"Claude"]}),u.jsx(Vs,{value:"mcp",children:"MCP"}),u.jsx(Vs,{value:"api",children:"API"}),u.jsxs(Vs,{value:"cli",children:[u.jsx(Qg,{className:"h-3.5 w-3.5 mr-1"}),"CLI"]})]}),u.jsxs(Vo,{value:"hootie",className:"space-y-4 pt-4",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm mb-3",children:["In Hootie, open"," ",u.jsx("strong",{children:"Settings → ContextNest Vault → Remote Server"})," ","and paste:"]}),u.jsx(An,{label:"Server URL",value:p}),!fe&&u.jsx(An,{label:"API Key (paste your generated key)",value:Mr})]}),u.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1 list-decimal list-inside",children:[u.jsx("li",{children:"Open Hootie"}),u.jsx("li",{children:"Click the gear icon (Settings)"}),u.jsx("li",{children:"Scroll to ContextNest Vault"}),u.jsx("li",{children:'Switch tab to "Remote Server"'}),u.jsxs("li",{children:["Paste the URL",!fe&&" + your API Key"," ","above, click Test Vault"]})]})]}),u.jsxs(Vo,{value:"claude",className:"space-y-4 pt-4",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm mb-3",children:[u.jsx("strong",{children:"Claude Code"})," (the CLI) registers a server with one command — it persists the config itself, no file to find or edit.",!fe&&u.jsxs(u.Fragment,{children:[" ","Replace"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Mr})," ","with your generated key."]})]}),u.jsx(An,{label:"Run in your terminal (Claude Code CLI)",value:he,multiline:!0}),u.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Takes effect on your next Claude Code session — the nest's context tools then appear in the tools panel."})]}),u.jsxs("div",{className:"border-t pt-3",children:[u.jsxs("p",{className:"text-sm mb-3",children:["Using ",u.jsx("strong",{children:"Claude Desktop"})," (the GUI app) instead? It has no CLI, so add this to your"," ",u.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"claude_desktop_config.json"}),!fe&&u.jsxs(u.Fragment,{children:[" ","(replace"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Mr})," ","with your generated key):"]})]}),u.jsx(An,{label:"Claude Desktop config (via mcp-remote bridge)",value:le,multiline:!0}),u.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Location:"," ",u.jsx("code",{className:"text-[10px]",children:"%APPDATA%\\Claude\\claude_desktop_config.json"})," ","(Windows) or"," ",u.jsx("code",{className:"text-[10px]",children:"~/Library/Application Support/Claude/claude_desktop_config.json"})," ","(Mac)"]}),u.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Claude Desktop config runs a local command, so this uses"," ",u.jsx("code",{className:"text-[10px]",children:"mcp-remote"})," to bridge to the server's HTTP endpoint — you need"," ",u.jsx("a",{href:"https://nodejs.org",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Node.js"})," ","installed (it provides"," ",u.jsx("code",{className:"text-[10px]",children:"npx"}),"). Restart Claude Desktop after editing; the nest's context tools then appear in the tools panel."]})]})]}),u.jsxs(Vo,{value:"mcp",className:"space-y-4 pt-4",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm mb-3",children:["Streamable HTTP MCP endpoint with 21 tools (11 content + 7 governance + 3 admin/sync). Works with native HTTP MCP clients (Cursor, VS Code) as a JSON config; Claude Code has its own one-command setup and Claude Desktop needs a bridge — see the Claude tab for both.",!fe&&u.jsxs(u.Fragment,{children:[" ","Replace"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Mr})," ","with your generated key."]})]}),u.jsx(An,{label:"Direct HTTP config (Cursor, VS Code, Claude Code — not Claude Desktop)",value:pe,multiline:!0}),u.jsx(An,{label:`From the ctx CLI (2.2+)${fe?"":" — export CONTEXTNEST_API_KEY first"}`,value:H,multiline:!0})]}),u.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[u.jsx("p",{className:"font-medium",children:"Available tools:"}),u.jsxs("div",{className:"grid grid-cols-2 gap-x-4 font-mono text-[11px]",children:[u.jsx("span",{children:"context_init"}),u.jsx("span",{children:"context_resolve"}),u.jsx("span",{children:"context_overview"}),u.jsx("span",{children:"context_create"}),u.jsx("span",{children:"context_search"}),u.jsx("span",{children:"context_update"}),u.jsx("span",{children:"context_query"}),u.jsx("span",{children:"context_export"}),u.jsx("span",{children:"context_get"}),u.jsx("span",{children:"context_comments"}),u.jsx("span",{children:"context_list"}),u.jsx("span",{children:"context_stewards"}),u.jsx("span",{children:"context_review_queue"}),u.jsx("span",{children:"context_my_drafts"}),u.jsx("span",{children:"context_submit_review"}),u.jsx("span",{children:"context_approve"}),u.jsx("span",{children:"context_reject"}),u.jsx("span",{children:"context_versions"}),u.jsx("span",{children:"context_assign_steward"}),u.jsx("span",{children:"context_request_deletion"}),u.jsx("span",{children:"context_deletion_queue"}),u.jsx("span",{children:"context_resolve_deletion"}),u.jsx("span",{children:"context_share_nest"}),u.jsx("span",{children:"context_unsynced_list"}),u.jsx("span",{children:"context_sync_folder"})]})]})]}),u.jsxs(Vo,{value:"api",className:"space-y-4 pt-4",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm mb-3",children:["Deterministic retrieval over plain HTTP — the same selector and ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"hops"})," ","always assemble the same context. One call returns the matched nodes plus their graph neighborhood as ready-to-use markdown, with a trace (",u.jsx("code",{className:"text-[11px]",children:"hops_used"}),","," ",u.jsx("code",{className:"text-[11px]",children:"nodes_traversed"}),") so you can audit exactly what was pulled."]}),u.jsx(An,{label:"Query + N-hop graph context (POST /context)",value:oe,multiline:!0}),u.jsx(An,{label:"Single document (GET, deterministic by id)",value:q,multiline:!0})]}),u.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[u.jsx("p",{className:"font-medium",children:"Selector grammar:"}),u.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[11px]",children:[u.jsx("span",{children:"#tag"}),u.jsx("span",{className:"font-sans",children:"nodes carrying a tag"}),u.jsx("span",{children:"type:document"}),u.jsx("span",{className:"font-sans",children:"nodes of a type"}),u.jsx("span",{children:"[[Title]]"}),u.jsx("span",{className:"font-sans",children:"a node by title"}),u.jsx("span",{children:"scope:team"}),u.jsx("span",{className:"font-sans",children:"nodes by visibility scope"}),u.jsx("span",{children:"+AND · |OR · -NOT"}),u.jsx("span",{className:"font-sans",children:"combine selectors"})]}),u.jsxs("p",{className:"pt-1",children:[u.jsx("span",{className:"font-medium",children:"Hops"})," controls graph traversal from the matches:"," ",u.jsx("code",{className:"text-[11px]",children:"1"})," = matches + directly linked nodes (single hop),"," ",u.jsx("code",{className:"text-[11px]",children:"2"})," (default) and up follow wiki-links further out for multi-hop context."," ",u.jsx("code",{className:"text-[11px]",children:"max_tokens"})," caps the payload; the response reports what was truncated."]}),u.jsxs("p",{children:["Also useful:"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"POST /query"})," ","(matches + snippets, no bodies),"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"GET /overview"})," ","(types/tags map), and the export URL below for the whole nest. All under"," ",u.jsxs("code",{className:"text-[11px] bg-muted px-1 rounded",children:["/nests/","<nest-id>","/…"]})]})]})]}),u.jsxs(Vo,{value:"cli",className:"space-y-4 pt-4",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm mb-3",children:["Read this nest from the shell, or push a local vault into it, with the"," ",u.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"ctx"})," ","CLI",!fe&&u.jsxs(u.Fragment,{children:[" ","(export"," ",u.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"CONTEXTNEST_API_KEY"})," ","first — the key never goes on the command line)"]}),":"]}),u.jsx(An,{label:"Install",value:"npm i -g @promptowl/contextnest-cli"}),u.jsx(An,{label:"Register this nest as a vault alias, then query it",value:H,multiline:!0}),u.jsx(An,{label:"Push a local vault into this nest",value:D,multiline:!0})]}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.jsx("code",{className:"text-[10px]",children:"query"}),","," ",u.jsx("code",{className:"text-[10px]",children:"read"}),","," ",u.jsx("code",{className:"text-[10px]",children:"list"})," and"," ",u.jsx("code",{className:"text-[10px]",children:"search"})," accept"," ",u.jsx("code",{className:"text-[10px]",children:"--vault <alias>"})," ","once the alias exists (ctx 2.2+). Full CLI reference lives in the ContextNest docs."]})]})]}),R&&u.jsxs("div",{className:"border-t pt-3",children:[u.jsx("p",{className:"mb-2 text-sm font-medium",children:"Get the apps"}),u.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[u.jsxs("a",{href:"https://promptowl.ai/download",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm hover:border-primary hover:bg-muted/40",children:[u.jsx(Kg,{className:"h-4 w-4 shrink-0"})," Desktop app"]}),u.jsxs("a",{href:"https://www.npmjs.com/package/@promptowl/contextnest-cli",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm hover:border-primary hover:bg-muted/40",children:[u.jsx(Qg,{className:"h-4 w-4 shrink-0"})," ctx CLI"]}),u.jsxs("a",{href:"https://github.com/PromptOwl/ContextNest",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-lg border px-3 py-2.5 text-sm hover:border-primary hover:bg-muted/40",children:[u.jsx(Ul,{className:"h-4 w-4 shrink-0"})," Self-hosted"]})]})]}),u.jsxs("button",{type:"button",onClick:()=>G(O=>!O),"aria-expanded":j,className:"flex w-full items-center justify-between rounded-lg border px-3 py-2.5 text-sm hover:bg-muted/40",children:[u.jsx("span",{className:"font-medium",children:"Export & nest details"}),u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Markdown · .zip · Nest ID",u.jsx(li,{className:`h-4 w-4 transition-transform ${j?"rotate-180":""}`})]})]}),j&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"border-t pt-3 space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[u.jsx(nc,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"font-medium truncate",children:"Export as markdown"})]}),u.jsx(Qe,{variant:"outline",size:"sm",className:"shrink-0",onClick:Y,disabled:w,"aria-label":"Download this nest as a single markdown file",children:w?u.jsx(ci,{className:"h-3.5 w-3.5 animate-spin"}):u.jsxs(u.Fragment,{children:[u.jsx(nc,{className:"h-3.5 w-3.5 mr-1"}),"Download .md"]})})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Frontmatter + body, one file. Approved versions only. Agents can fetch this URL directly."}),u.jsx(An,{label:"Export URL (text/markdown)",value:v})]}),u.jsxs("div",{className:"border-t pt-3 space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[u.jsx(Ul,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"font-medium truncate",children:"Portability bundle"})]}),u.jsxs(Qe,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>k(!0),"aria-label":"Export this nest as a portable .zip bundle",children:[u.jsx(Ul,{className:"h-3.5 w-3.5 mr-1"}),"Export .zip"]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Whole nest — nodes, full version history, tags, definitions and edges — as one .zip. Import it on another ContextNest host to recreate the nest."})]}),u.jsx("div",{className:"border-t pt-3",children:u.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx("span",{children:"Nest ID:"}),u.jsx("code",{className:"flex-1 bg-muted px-2 py-1 rounded text-[11px] font-mono truncate",children:r}),u.jsx(d0,{value:r})]})})]})]})]})}),u.jsx(fi,{open:N,onOpenChange:O=>!x&&k(O),children:u.jsxs(ao,{className:"sm:max-w-[420px]",children:[u.jsxs(lo,{children:[u.jsxs(co,{className:"flex items-center gap-2",children:[u.jsx(Ul,{className:"h-5 w-5"}),"Export portability bundle"]}),u.jsxs(uo,{children:["Downloads a ",u.jsx("code",{children:".zip"})," of this nest's documents. On another ContextNest host, unzip it and bring it in with the existing"," ",u.jsx("strong",{children:"Import Folder"})," button."]})]}),u.jsxs("div",{className:"flex items-start justify-between gap-3 py-2",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(fa,{htmlFor:"include-drafts",className:"text-sm font-medium",children:"Include draft documents"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Off: approved / published documents only. On: also export unapproved drafts."})]}),u.jsx(zx,{id:"include-drafts",checked:C,onCheckedChange:_})]}),K&&u.jsx("p",{className:"text-sm text-destructive",children:K}),u.jsxs(jp,{children:[u.jsx(Qe,{variant:"outline",onClick:()=>k(!1),disabled:x,children:"Cancel"}),u.jsxs(Qe,{onClick:M,disabled:x,children:[x?u.jsx(ci,{className:"h-4 w-4 mr-2 animate-spin"}):u.jsx(nc,{className:"h-4 w-4 mr-2"}),"Download .zip"]})]})]})})]})}function V4({apiKey:e,kind:t,onClose:r,nestId:o}){const[a,c]=y.useState(!1),d=async()=>{await ui(e)&&(c(!0),setTimeout(()=>c(!1),1500))},p=()=>{const g=typeof window<"u"?window.location.origin:"http://localhost:3838",v=URL.createObjectURL(new Blob([TR({serverUrl:g,apiKey:e,nestId:o})],{type:"text/plain"})),w=document.createElement("a");w.href=v,w.download="contextnest.env",document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(v)};return u.jsx(fi,{open:!0,onOpenChange:r,children:u.jsxs(ao,{className:"sm:max-w-[480px]",children:[u.jsxs(lo,{children:[u.jsxs(co,{className:"flex items-center gap-2",children:[u.jsx(I_,{className:"h-4 w-4 text-amber-700"}),t==="generated"?"API key generated":"API key rotated"]}),u.jsxs(uo,{children:["This key is shown ",u.jsx("strong",{children:"only once"}),". Copy it now and store it somewhere safe (password manager, secrets vault). It cannot be retrieved again — if you lose it, rotate to mint a new one.",t==="rotated"&&u.jsxs(u.Fragment,{children:[" ","Your previous key has been invalidated and will stop working immediately."]})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:e}),u.jsx(Qe,{size:"sm",variant:"outline",onClick:d,children:a?u.jsx(Cc,{className:"h-3.5 w-3.5 text-green-600"}):u.jsx(Yf,{className:"h-3.5 w-3.5"})})]}),u.jsxs(Qe,{variant:"outline",size:"sm",className:"w-full",onClick:p,children:[u.jsx(nc,{className:"mr-1.5 h-3.5 w-3.5"}),"Download .env"]}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Copy it, or download a ready"," ",u.jsx("code",{className:"text-[11px]",children:".env"})," (server URL + key) to hand your agent. Keep it secret — don't commit it."]})]}),u.jsx("div",{className:"flex justify-end pt-2",children:u.jsx(Qe,{onClick:r,children:"I've saved it — close"})})]})})}function An({label:e,value:t,multiline:r}){return u.jsxs("div",{className:"mb-3 min-w-0",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1 min-w-0",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground truncate",children:e}),u.jsx(d0,{value:t})]}),u.jsx("pre",{className:`${r?"p-3":"px-3 py-2"} bg-muted rounded text-xs font-mono min-w-0 ${r?"whitespace-pre overflow-x-auto":"whitespace-pre-wrap break-all"}`,children:t})]})}function d0({value:e}){const[t,r]=y.useState(!1),o=async()=>{await ui(e)&&(r(!0),setTimeout(()=>r(!1),1500))};return u.jsx(Qe,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:o,children:t?u.jsx(Cc,{className:"h-3 w-3 text-green-600"}):u.jsx(Yf,{className:"h-3 w-3"})})}const yc=y.forwardRef(({className:e,type:t,...r},o)=>u.jsx("input",{type:t,className:Le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));yc.displayName="Input";const LR=Mc("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-warning/50 text-warning dark:border-warning [&>svg]:text-warning"}},defaultVariants:{variant:"default"}}),Df=y.forwardRef(({className:e,variant:t,...r},o)=>u.jsx("div",{ref:o,role:"alert",className:Le(LR({variant:t}),e),...r}));Df.displayName="Alert";const zR=y.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:Le("mb-1 font-medium leading-none tracking-tight",e),...t}));zR.displayName="AlertTitle";const Lf=y.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:Le("text-sm [&_p]:leading-relaxed",e),...t}));Lf.displayName="AlertDescription";function FR({existingAdmin:e,onClose:t}){const{loginSuccess:r}=Na(),[o,a]=y.useState("promptowl"),[c,d]=y.useState(""),[p,g]=y.useState(""),[v,w]=y.useState(!1),[f,x]=y.useState(null),[S,N]=y.useState(null),[k,C]=y.useState(null),[_,R]=y.useState(!1),[I,j]=y.useState(!1),[G,K]=y.useState(null),[A,M]=y.useState("open"),Y=typeof window<"u"&&new URLSearchParams(window.location.search).has("admin"),V=A==="open"||A==="admin-only"&&Y,le=V?o:"password";y.useEffect(()=>{let ce=!1;return la().then(X=>{ce||M(X.promptowl_sign_in_gate??"open")}).catch(()=>{}),()=>{ce=!0}},[]);const he=async()=>{k&&await ui(k)&&(R(!0),setTimeout(()=>R(!1),1500))},pe=async()=>{x(null),w(!0);try{const ce=await Vv();N(ce.verificationUrl),C(ce.deviceCode),window.open(ce.verificationUrl,"_blank","noopener,noreferrer");for(let X=0;X<180;X++){await new Promise(H=>setTimeout(H,2e3));const oe=await Bv(ce.deviceCode,ce.clientSecret);if(oe.status==="approved"&&oe.token){const H=await Wv(oe.token);if(r(H.user?{email:H.user.email,name:H.user.name,is_admin:!!H.user.is_admin}:void 0),H.claim_blocked&&!H.user.is_admin){K({info:H.claim_blocked,attemptedEmail:H.user.email}),N(null),C(null),w(!1);return}t();return}if(oe.status==="pending")continue;const q=oe.status==="denied"||oe.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":oe.status==="expired"?"Login expired. Try again.":oe.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${oe.status}). Try again.`;x(q),N(null),C(null),w(!1);return}x("Login timed out waiting for approval. Try again."),N(null),C(null),w(!1)}catch(ce){x(ce.message),N(null),C(null),w(!1)}},fe=async ce=>{ce.preventDefault(),x(null),w(!0);try{const X=await Uv(c,p);r(X.user?{email:X.user.email,name:X.user.name,is_admin:!!X.user.is_admin}:void 0),t()}catch(X){x(X.message),w(!1)}};return u.jsx(fi,{open:!0,onOpenChange:t,children:u.jsxs(ao,{className:"sm:max-w-[420px]",children:[u.jsxs(lo,{children:[u.jsxs(co,{className:"flex items-center gap-2",children:[u.jsx(Nc,{className:"h-4 w-4"}),"Login"]}),u.jsx(uo,{children:e?`This server is administered by ${e}. Login to manage settings and teammates.`:"Login with your account."})]}),u.jsxs("div",{className:"space-y-4 pt-2",children:[f&&u.jsxs(Df,{variant:"destructive",children:[u.jsx(tc,{className:"h-4 w-4"}),u.jsx(Lf,{children:f})]}),G&&u.jsxs(Df,{variant:"destructive",children:[u.jsx(ep,{className:"h-4 w-4"}),u.jsx(Lf,{children:G.info.reason==="license_required"?u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"font-medium",children:"Admin claim blocked — no license installed."}),u.jsx("p",{className:"text-xs",children:"Generate a Community License key in PromptOwl, then paste it on the setup screen. Only the PromptOwl account that minted the key can claim admin on this server."}),u.jsxs("a",{href:"https://app.promptowl.ai/community-license",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs underline",children:["Open Community License page",u.jsx(sf,{className:"h-3 w-3"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"font-medium",children:"Admin claim blocked — email does not match license owner."}),u.jsxs("p",{className:"text-xs",children:["License owner:"," ",u.jsx("code",{className:"font-mono",children:G.info.license_owner_email||"(unknown)"})]}),u.jsxs("p",{className:"text-xs",children:["You logged in as:"," ",u.jsx("code",{className:"font-mono",children:G.attemptedEmail})]}),u.jsx("p",{className:"text-xs",children:"Log in with the PromptOwl account that generated the installed license key, or install a different key belonging to this account."})]})})]}),le==="promptowl"?u.jsxs(u.Fragment,{children:[u.jsx(Qe,{onClick:pe,disabled:v,className:"w-full",children:v&&S?u.jsxs(u.Fragment,{children:[u.jsx(ci,{className:"h-4 w-4 mr-2 animate-spin"}),"Waiting for approval..."]}):"Login with PromptOwl"}),S&&u.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[u.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",u.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary underline",children:["PromptOwl",u.jsx(sf,{className:"h-3 w-3"})]}),". If it asks for a verification code, use this:"]}),k&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:k}),u.jsx(Qe,{size:"sm",variant:"outline",onClick:he,children:_?u.jsx(Cc,{className:"h-3.5 w-3.5 text-green-600"}):u.jsx(Yf,{className:"h-3.5 w-3.5"})})]})]}),!S&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full border-t border-border"})}),u.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),u.jsx(Qe,{variant:"outline",className:"w-full",onClick:()=>a("password"),children:"Use email + password"})]})]}):u.jsxs("form",{onSubmit:fe,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(fa,{children:"Email"}),u.jsx(yc,{type:"email",value:c,onChange:ce=>d(ce.target.value),required:!0,autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(fa,{children:"Password"}),u.jsxs("div",{className:"relative",children:[u.jsx(yc,{type:I?"text":"password",value:p,onChange:ce=>g(ce.target.value),required:!0,className:"pr-9"}),u.jsx("button",{type:"button",onClick:()=>j(ce=>!ce),"aria-label":I?"Hide password":"Show password",tabIndex:-1,className:"absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-r-md",children:I?u.jsx(Tv,{className:"h-4 w-4"}):u.jsx(Rv,{className:"h-4 w-4"})})]})]}),u.jsx(Qe,{type:"submit",disabled:v,className:"w-full",children:v?u.jsx(ci,{className:"h-4 w-4 animate-spin"}):"Login"}),V&&u.jsx("button",{type:"button",onClick:()=>a("promptowl"),className:"w-full text-xs text-muted-foreground hover:text-foreground",children:"← Back to PromptOwl login"})]})]})]})})}function UR({onActivated:e}){const[t,r]=y.useState(""),[o,a]=y.useState(!1),[c,d]=y.useState(null),[p,g]=y.useState(null),v=async()=>{const w=t.trim();if(!w.startsWith("pk_")){d("License key must start with pk_");return}d(null),g(null),a(!0);try{const f=await eC(w);if(!f.valid){d(f.error||"PromptOwl rejected this key.");return}if(f.warning){g(f.warning);return}e()}catch(f){d(f instanceof Error?f.message:"Failed to install key")}finally{a(!1)}};return u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:u.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[u.jsxs("div",{className:"text-center space-y-2",children:[u.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-primary/10",children:u.jsx(L_,{className:"h-6 w-6 text-primary"})}),u.jsx("h1",{className:"text-2xl font-bold",children:"Activate ContextNest Community"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"This server is in setup mode. Paste a PromptOwl license key to unlock write access."})]}),u.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(fa,{htmlFor:"license-key",children:"License key"}),u.jsx(yc,{id:"license-key","data-testid":"license-setup-key-input",placeholder:"pk_...",value:t,autoFocus:!0,onChange:w=>{r(w.target.value),c&&d(null)},onKeyDown:w=>{w.key==="Enter"&&!o&&v()},className:"font-mono"}),c&&u.jsx("p",{className:"text-sm text-destructive","data-testid":"license-setup-error",children:c}),p&&u.jsxs("div",{className:"text-sm rounded-md border border-amber-300 bg-amber-50 text-amber-800 p-3 space-y-1","data-testid":"license-setup-warning",children:[u.jsx("p",{className:"font-medium",children:"License not saved"}),u.jsx("p",{children:p})]})]}),p?u.jsx(Qe,{className:"w-full",variant:"outline",onClick:e,"data-testid":"license-setup-continue",children:"Continue anyway (key lost on restart)"}):u.jsx(Qe,{className:"w-full",onClick:v,disabled:o||!t.trim(),"data-testid":"license-setup-submit",children:o?u.jsxs(u.Fragment,{children:[u.jsx(ci,{className:"h-4 w-4 mr-2 animate-spin"}),"Validating..."]}):u.jsxs(u.Fragment,{children:[u.jsx(ep,{className:"h-4 w-4 mr-2"}),"Activate Server"]})})]}),u.jsxs("div",{className:"text-sm text-muted-foreground space-y-2 border rounded-lg p-4 bg-muted/30",children:[u.jsx("p",{className:"font-medium text-foreground",children:"Need a key?"}),u.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[u.jsxs("li",{children:["Sign up free at"," ",u.jsxs("a",{href:"https://app.promptowl.ai",target:"_blank",rel:"noreferrer",className:"text-primary underline inline-flex items-center gap-1",children:["app.promptowl.ai",u.jsx(sf,{className:"h-3 w-3"})]})]}),u.jsx("li",{children:"Open Overview > Community License"}),u.jsx("li",{children:"Generate a key and paste it above"})]}),u.jsx("p",{className:"text-xs pt-2",children:"Reads stay available without a license. Writes (nest/node create, update, delete) require activation."})]})]})})}function VR(e,t){const r=t.toLowerCase().split(/\s+/).filter(Boolean);return r.length===0?[]:e.filter(o=>{const a=`${o.name??""} ${o.description??""} ${o.id??""}`.toLowerCase();return r.every(c=>a.includes(c))}).sort((o,a)=>+!!a.pinned-+!!o.pinned).map(o=>({id:o.id,title:o.name??o.id,description:o.description??null}))}const Gd=20;function BR(e,t){const r=t.trim().split(/\s+/).filter(Boolean);if(r.length===0)return e;const o=new RegExp(`(${r.map(c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi"),a=r.map(c=>c.toLowerCase());return e.split(o).map((c,d)=>c&&a.includes(c.toLowerCase())?u.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-700/60 rounded-sm px-0.5",children:c},d):c)}function Ky({active:e,onClick:t,label:r}){return u.jsx("button",{type:"button",onClick:t,"aria-pressed":e,className:`max-w-[16rem] truncate rounded px-1.5 py-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${e?"bg-muted font-medium text-foreground":"hover:bg-muted/60"}`,children:r})}function WR({nestId:e,nestName:t,onSelect:r,onClose:o}){const[a,c]=y.useState(""),[d,p]=y.useState(!1),[g,v]=y.useState([]),[w,f]=y.useState(0),[x,S]=y.useState(!1),[N,k]=y.useState(0),C=y.useRef(null),_=y.useRef(null),R=Oc(),I=!e||d;y.useEffect(()=>{var A;(A=C.current)==null||A.focus()},[]),y.useEffect(()=>{const A=M=>{M.key==="Escape"&&o()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[o]),y.useEffect(()=>(_.current&&clearTimeout(_.current),_.current=setTimeout(async()=>{const A=a.trim();if(!A){v([]),k(0);return}S(!0);try{if(I){const[M,Y]=await Promise.all([R.fetchQuery(Bt.nestList()).then(V=>VR((V==null?void 0:V.nests)??[],A).map(le=>({...le,kind:"nest"}))).catch(()=>[]),R.fetchQuery(Bt.globalSearch(A,Gd)).then(V=>(k(V.count),V.nodes.map(le=>({...le,kind:"node"})))).catch(()=>(k(0),[]))]);v([...M.slice(0,4),...Y.slice(0,Gd)])}else{const M=await wC(e,A);k(M.nodes.length),v(M.nodes.slice(0,Gd).map(Y=>({...Y,kind:"node",nest_id:Y.nest_id??e,nest_name:Y.nest_name??t})))}f(0)}catch{v([]),k(0)}finally{S(!1)}},a.trim()?250:0),()=>{_.current&&clearTimeout(_.current)}),[e,t,I,a,R]);const j=A=>{const M=g[A];M&&r(M.id,M)},G=g.filter(A=>A.kind==="node").length,K=()=>x?"Searching…":a.trim()?I?"No matches":u.jsxs(u.Fragment,{children:["No matches in ",t??"this nest","."," ",u.jsx("button",{type:"button",onClick:()=>p(!0),className:"font-medium text-foreground underline underline-offset-2 hover:no-underline","data-testid":"quick-open-widen-scope",children:"Search all nests"})]}):I?"Type to search nests and documents…":`Type to search ${t??"this nest"}…`;return u.jsx("div",{className:"fixed inset-0 z-50 bg-black/30 flex items-start justify-center pt-[15vh]",onClick:o,children:u.jsxs("div",{className:"w-full max-w-lg rounded-lg border bg-background shadow-xl overflow-hidden",onClick:A=>A.stopPropagation(),children:[u.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[x?u.jsx(ci,{className:"h-4 w-4 text-muted-foreground animate-spin"}):u.jsx(tp,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("input",{ref:C,value:a,onChange:A=>c(A.target.value),onKeyDown:A=>{A.key==="Tab"&&e&&(A.preventDefault(),p(M=>!M)),A.key==="ArrowDown"&&(A.preventDefault(),f(M=>Math.min(M+1,g.length-1))),A.key==="ArrowUp"&&(A.preventDefault(),f(M=>Math.max(M-1,0))),A.key==="Enter"&&(A.preventDefault(),j(w))},placeholder:I?"Search nests and documents…":"Search documents — title, tags, content…",className:"flex-1 bg-transparent py-3 text-sm outline-none","data-testid":"quick-open-input"}),u.jsx("kbd",{className:"text-[10px] text-muted-foreground border rounded px-1",children:"esc"})]}),u.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-1.5 text-xs text-muted-foreground",children:[u.jsx("span",{children:"Searching"}),e?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Ky,{active:!d,onClick:()=>p(!1),label:t?`This nest — ${t}`:"This nest"}),u.jsx(Ky,{active:d,onClick:()=>p(!0),label:"All nests"}),u.jsx("kbd",{className:"rounded border px-1 text-[10px]",children:"tab"})]}):u.jsx("span",{className:"font-medium text-foreground",children:"all nests"})]}),u.jsx("div",{className:"max-h-72 overflow-y-auto py-1",children:g.length===0?u.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:K()}):g.map((A,M)=>{var Y;return u.jsxs(y.Fragment,{children:[A.kind!==((Y=g[M-1])==null?void 0:Y.kind)&&u.jsx("div",{className:"px-3 pb-0.5 pt-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:A.kind==="nest"?"Nests":"Documents"}),u.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 px-3 py-2 text-left text-sm ${M===w?"bg-muted":"hover:bg-muted/50"}`,onMouseEnter:()=>f(M),onClick:()=>j(M),children:[A.kind==="nest"?u.jsx(jv,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}):u.jsx(Xf,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"truncate font-medium",children:A.title}),A.kind==="nest"?u.jsx("span",{className:"ml-auto text-xs text-muted-foreground shrink-0",children:"Nest"}):I&&A.nest_name?u.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground shrink-0",children:A.nest_name}):A.tags&&A.tags.length>0&&u.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:A.tags.slice(0,3).join(" ")})]}),A.kind==="node"&&A.snippet&&a.trim()&&u.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:BR(A.snippet,a)})]})]})]},`${A.kind}:${A.nest_id??""}${A.id}`)})}),G>0&&N>G&&u.jsxs("div",{className:"border-t px-3 py-2 text-xs text-muted-foreground",children:["Showing ",G," of ",N," matching documents — keep typing to narrow."]})]})})}const na=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl",HR=[{title:"Anywhere",items:[[`${na} K`,"Search nests and documents"],["?","Show this cheatsheet"],["Esc","Close a dialog or the search palette"]]},{title:"Search palette",items:[["↑ ↓","Move between results"],["Enter","Open the selected result"]]},{title:"Editing a document",items:[[`${na} B`,"Bold"],[`${na} I`,"Italic"],[`${na} Z`,"Undo"],[`${na} ⇧ Z`,"Redo"],["# / ## / ###","Heading, typed at the start of a line"],["[[","Link to another document"],["@","Mention a person"]]}];function qR({onClose:e}){return u.jsx(fi,{open:!0,onOpenChange:e,children:u.jsxs(ao,{className:"sm:max-w-[480px]",children:[u.jsxs(lo,{children:[u.jsx(co,{children:"Keyboard shortcuts"}),u.jsxs(uo,{children:["Press ",u.jsx("kbd",{className:"rounded border px-1",children:"?"})," anywhere to bring this back."]})]}),u.jsx("div",{className:"space-y-4",children:HR.map(t=>u.jsxs("div",{children:[u.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t.title}),u.jsx("dl",{className:"space-y-1",children:t.items.map(([r,o])=>u.jsxs("div",{className:"flex items-baseline gap-3 text-sm",children:[u.jsx("dt",{className:"w-32 shrink-0",children:u.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 text-xs",children:r})}),u.jsx("dd",{className:"text-muted-foreground",children:o})]},r))})]},t.title))})]})})}let zf=null,Ff=!1;function B4(e){zf=e}function KR(e){!Ff&&zf&&zf(e)||e()}function W4(e){Ff=!0;try{e()}finally{Ff=!1}}function QR(e,t){return e!==null&&t!==null&&t!==e?"push":"replace"}const f0=/^\/nest\/([^/]+)(?:\/([^/]+))?\/?$/;function GR(e){try{return decodeURIComponent(e)}catch{return e}}function Zd(e=window.location){const t=e.pathname.match(f0);return t?GR(t[1]):new URLSearchParams(e.search).get("nest")}function Qy(e=window.location){const t=e.pathname.match(f0);return t!=null&&t[2]?t[2]:new URLSearchParams(e.search).get("view")}function Gy(e,t){if(!e)return"/";const r=`/nest/${encodeURIComponent(e)}`;return t?`${r}/${t}`:r}const p0=y.createContext(null),ZR=p0.Provider;function H4(){const e=y.useContext(p0);if(!e)throw new Error("useNestPage: no NestPageProvider above this page");return e}const h0=y.createContext(null),JR=h0.Provider;function q4(){const e=y.useContext(h0);if(!e)throw new Error("useAppNav: no AppNavProvider above this page");return e}const $p=y.createContext(null);function YR({children:e}){const[t,r]=y.useState([]);return u.jsx($p.Provider,{value:{tail:t,setTail:r},children:e})}function K4(e){const t=y.useContext($p),r=e.map(o=>o.label).join("\0");y.useEffect(()=>{if(t)return t.setTail(e),()=>t.setTail([])},[r])}function XR(){var e;return((e=y.useContext($p))==null?void 0:e.tail)??[]}const Jd="/assets/hootie-_U3ECslt.svg";function eA({className:e}){return u.jsx("span",{className:Le("inline-flex items-center rounded-sm border border-blue-200 bg-blue-100 px-1.5 py-0 text-[10px] font-semibold uppercase tracking-wide leading-4 text-blue-700 dark:border-blue-700 dark:bg-blue-900/50 dark:text-blue-300",e),children:"Beta"})}function tA(e,t=[]){let r=[];function o(c,d){const p=y.createContext(d);p.displayName=c+"Context";const g=r.length;r=[...r,d];const v=f=>{var _;const{scope:x,children:S,...N}=f,k=((_=x==null?void 0:x[e])==null?void 0:_[g])||p,C=y.useMemo(()=>N,Object.values(N));return u.jsx(k.Provider,{value:C,children:S})};v.displayName=c+"Provider";function w(f,x){var k;const S=((k=x==null?void 0:x[e])==null?void 0:k[g])||p,N=y.useContext(S);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${f}\` must be used within \`${c}\``)}return[v,w]}const a=()=>{const c=r.map(d=>y.createContext(d));return function(p){const g=(p==null?void 0:p[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...p,[e]:g}}),[p,g])}};return a.scopeName=e,[o,nA(a,...t)]}function nA(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const d=o.reduce((p,{useScope:g,scopeName:v})=>{const f=g(c)[`__scope${v}`];return{...p,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return r.scopeName=t.scopeName,r}var rA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ip=rA.reduce((e,t)=>{const r=Tp(`Primitive.${t}`),o=y.forwardRef((a,c)=>{const{asChild:d,...p}=a,g=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(g,{...p,ref:c})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Yd={exports:{}},Xd={};/**
382
+ * @license React
383
+ * use-sync-external-store-shim.production.js
384
+ *
385
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
386
+ *
387
+ * This source code is licensed under the MIT license found in the
388
+ * LICENSE file in the root directory of this source tree.
389
+ */var Zy;function sA(){if(Zy)return Xd;Zy=1;var e=_c();function t(f,x){return f===x&&(f!==0||1/f===1/x)||f!==f&&x!==x}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,a=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function p(f,x){var S=x(),N=o({inst:{value:S,getSnapshot:x}}),k=N[0].inst,C=N[1];return c(function(){k.value=S,k.getSnapshot=x,g(k)&&C({inst:k})},[f,S,x]),a(function(){return g(k)&&C({inst:k}),f(function(){g(k)&&C({inst:k})})},[f]),d(S),S}function g(f){var x=f.getSnapshot;f=f.value;try{var S=x();return!r(f,S)}catch{return!0}}function v(f,x){return x()}var w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:p;return Xd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w,Xd}var Jy;function oA(){return Jy||(Jy=1,Yd.exports=sA()),Yd.exports}var iA=oA();function aA(){return iA.useSyncExternalStore(lA,()=>!0,()=>!1)}function lA(){return()=>{}}var Dp="Avatar",[cA]=tA(Dp),[uA,m0]=cA(Dp),g0=y.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[a,c]=y.useState("idle");return u.jsx(uA,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:c,children:u.jsx(Ip.span,{...o,ref:t})})});g0.displayName=Dp;var y0="AvatarImage",v0=y.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:a=()=>{},...c}=e,d=m0(y0,r),p=dA(o,c),g=vr(v=>{a(v),d.onImageLoadingStatusChange(v)});return Jn(()=>{p!=="idle"&&g(p)},[p,g]),p==="loaded"?u.jsx(Ip.img,{...c,ref:t,src:o}):null});v0.displayName=y0;var w0="AvatarFallback",x0=y.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...a}=e,c=m0(w0,r),[d,p]=y.useState(o===void 0);return y.useEffect(()=>{if(o!==void 0){const g=window.setTimeout(()=>p(!0),o);return()=>window.clearTimeout(g)}},[o]),d&&c.imageLoadingStatus!=="loaded"?u.jsx(Ip.span,{...a,ref:t}):null});x0.displayName=w0;function Yy(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function dA(e,{referrerPolicy:t,crossOrigin:r}){const o=aA(),a=y.useRef(null),c=o?(a.current||(a.current=new window.Image),a.current):null,[d,p]=y.useState(()=>Yy(c,e));return Jn(()=>{p(Yy(c,e))},[c,e]),Jn(()=>{const g=f=>()=>{p(f)};if(!c)return;const v=g("loaded"),w=g("error");return c.addEventListener("load",v),c.addEventListener("error",w),t&&(c.referrerPolicy=t),typeof r=="string"&&(c.crossOrigin=r),()=>{c.removeEventListener("load",v),c.removeEventListener("error",w)}},[c,r,t]),d}var b0=g0,S0=v0,k0=x0;const Uf=y.forwardRef(({className:e,...t},r)=>u.jsx(b0,{ref:r,className:Le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Uf.displayName=b0.displayName;const fA=y.forwardRef(({className:e,...t},r)=>u.jsx(S0,{ref:r,className:Le("aspect-square h-full w-full",e),...t}));fA.displayName=S0.displayName;const Vf=y.forwardRef(({className:e,...t},r)=>u.jsx(k0,{ref:r,className:Le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Vf.displayName=k0.displayName;const _0=["top","right","bottom","left"],Xy=["start","end"],ev=_0.reduce((e,t)=>e.concat(t,t+"-"+Xy[0],t+"-"+Xy[1]),[]),Yn=Math.min,Vt=Math.max,vc=Math.round,Xl=Math.floor,yr=e=>({x:e,y:e}),pA={left:"right",right:"left",bottom:"top",top:"bottom"};function Bf(e,t,r){return Vt(e,Yn(t,r))}function Xn(e,t){return typeof e=="function"?e(t):e}function Cn(e){return e.split("-")[0]}function Zn(e){return e.split("-")[1]}function Lp(e){return e==="x"?"y":"x"}function zp(e){return e==="y"?"height":"width"}function Gn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fp(e){return Lp(Gn(e))}function C0(e,t,r){r===void 0&&(r=!1);const o=Zn(e),a=Fp(e),c=zp(a);let d=a==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(d=xc(d)),[d,xc(d)]}function hA(e){const t=xc(e);return[wc(e),t,wc(t)]}function wc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const tv=["left","right"],nv=["right","left"],mA=["top","bottom"],gA=["bottom","top"];function yA(e,t,r){switch(e){case"top":case"bottom":return r?t?nv:tv:t?tv:nv;case"left":case"right":return t?mA:gA;default:return[]}}function vA(e,t,r,o){const a=Zn(e);let c=yA(Cn(e),r==="start",o);return a&&(c=c.map(d=>d+"-"+a),t&&(c=c.concat(c.map(wc)))),c}function xc(e){const t=Cn(e);return pA[t]+e.slice(t.length)}function wA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Up(e){return typeof e!="number"?wA(e):{top:e,right:e,bottom:e,left:e}}function pi(e){const{x:t,y:r,width:o,height:a}=e;return{width:o,height:a,top:r,left:t,right:t+o,bottom:r+a,x:t,y:r}}function rv(e,t,r){let{reference:o,floating:a}=e;const c=Gn(t),d=Fp(t),p=zp(d),g=Cn(t),v=c==="y",w=o.x+o.width/2-a.width/2,f=o.y+o.height/2-a.height/2,x=o[p]/2-a[p]/2;let S;switch(g){case"top":S={x:w,y:o.y-a.height};break;case"bottom":S={x:w,y:o.y+o.height};break;case"right":S={x:o.x+o.width,y:f};break;case"left":S={x:o.x-a.width,y:f};break;default:S={x:o.x,y:o.y}}switch(Zn(t)){case"start":S[d]-=x*(r&&v?-1:1);break;case"end":S[d]+=x*(r&&v?-1:1);break}return S}async function xA(e,t){var r;t===void 0&&(t={});const{x:o,y:a,platform:c,rects:d,elements:p,strategy:g}=e,{boundary:v="clippingAncestors",rootBoundary:w="viewport",elementContext:f="floating",altBoundary:x=!1,padding:S=0}=Xn(t,e),N=Up(S),C=p[x?f==="floating"?"reference":"floating":f],_=pi(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(C)))==null||r?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(p.floating)),boundary:v,rootBoundary:w,strategy:g})),R=f==="floating"?{x:o,y:a,width:d.floating.width,height:d.floating.height}:d.reference,I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p.floating)),j=await(c.isElement==null?void 0:c.isElement(I))?await(c.getScale==null?void 0:c.getScale(I))||{x:1,y:1}:{x:1,y:1},G=pi(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:R,offsetParent:I,strategy:g}):R);return{top:(_.top-G.top+N.top)/j.y,bottom:(G.bottom-_.bottom+N.bottom)/j.y,left:(_.left-G.left+N.left)/j.x,right:(G.right-_.right+N.right)/j.x}}const bA=50,SA=async(e,t,r)=>{const{placement:o="bottom",strategy:a="absolute",middleware:c=[],platform:d}=r,p=d.detectOverflow?d:{...d,detectOverflow:xA},g=await(d.isRTL==null?void 0:d.isRTL(t));let v=await d.getElementRects({reference:e,floating:t,strategy:a}),{x:w,y:f}=rv(v,o,g),x=o,S=0;const N={};for(let k=0;k<c.length;k++){const C=c[k];if(!C)continue;const{name:_,fn:R}=C,{x:I,y:j,data:G,reset:K}=await R({x:w,y:f,initialPlacement:o,placement:x,strategy:a,middlewareData:N,rects:v,platform:p,elements:{reference:e,floating:t}});w=I??w,f=j??f,N[_]={...N[_],...G},K&&S<bA&&(S++,typeof K=="object"&&(K.placement&&(x=K.placement),K.rects&&(v=K.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:a}):K.rects),{x:w,y:f}=rv(v,x,g)),k=-1)}return{x:w,y:f,placement:x,strategy:a,middlewareData:N}},kA=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:a,rects:c,platform:d,elements:p,middlewareData:g}=t,{element:v,padding:w=0}=Xn(e,t)||{};if(v==null)return{};const f=Up(w),x={x:r,y:o},S=Fp(a),N=zp(S),k=await d.getDimensions(v),C=S==="y",_=C?"top":"left",R=C?"bottom":"right",I=C?"clientHeight":"clientWidth",j=c.reference[N]+c.reference[S]-x[S]-c.floating[N],G=x[S]-c.reference[S],K=await(d.getOffsetParent==null?void 0:d.getOffsetParent(v));let A=K?K[I]:0;(!A||!await(d.isElement==null?void 0:d.isElement(K)))&&(A=p.floating[I]||c.floating[N]);const M=j/2-G/2,Y=A/2-k[N]/2-1,V=Yn(f[_],Y),le=Yn(f[R],Y),he=V,pe=A-k[N]-le,fe=A/2-k[N]/2+M,ce=Bf(he,fe,pe),X=!g.arrow&&Zn(a)!=null&&fe!==ce&&c.reference[N]/2-(fe<he?V:le)-k[N]/2<0,oe=X?fe<he?fe-he:fe-pe:0;return{[S]:x[S]+oe,data:{[S]:ce,centerOffset:fe-ce-oe,...X&&{alignmentOffset:oe}},reset:X}}});function _A(e,t,r){return(e?[...r.filter(a=>Zn(a)===e),...r.filter(a=>Zn(a)!==e)]:r.filter(a=>Cn(a)===a)).filter(a=>e?Zn(a)===e||(t?wc(a)!==a:!1):!0)}const CA=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,o,a;const{rects:c,middlewareData:d,placement:p,platform:g,elements:v}=t,{crossAxis:w=!1,alignment:f,allowedPlacements:x=ev,autoAlignment:S=!0,...N}=Xn(e,t),k=f!==void 0||x===ev?_A(f||null,S,x):x,C=await g.detectOverflow(t,N),_=((r=d.autoPlacement)==null?void 0:r.index)||0,R=k[_];if(R==null)return{};const I=C0(R,c,await(g.isRTL==null?void 0:g.isRTL(v.floating)));if(p!==R)return{reset:{placement:k[0]}};const j=[C[Cn(R)],C[I[0]],C[I[1]]],G=[...((o=d.autoPlacement)==null?void 0:o.overflows)||[],{placement:R,overflows:j}],K=k[_+1];if(K)return{data:{index:_+1,overflows:G},reset:{placement:K}};const A=G.map(V=>{const le=Zn(V.placement);return[V.placement,le&&w?V.overflows.slice(0,2).reduce((he,pe)=>he+pe,0):V.overflows[0],V.overflows]}).sort((V,le)=>V[1]-le[1]),Y=((a=A.filter(V=>V[2].slice(0,Zn(V[0])?2:3).every(le=>le<=0))[0])==null?void 0:a[0])||A[0][0];return Y!==p?{data:{index:_+1,overflows:G},reset:{placement:Y}}:{}}}},NA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:a,middlewareData:c,rects:d,initialPlacement:p,platform:g,elements:v}=t,{mainAxis:w=!0,crossAxis:f=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:k=!0,...C}=Xn(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const _=Cn(a),R=Gn(p),I=Cn(p)===p,j=await(g.isRTL==null?void 0:g.isRTL(v.floating)),G=x||(I||!k?[xc(p)]:hA(p)),K=N!=="none";!x&&K&&G.push(...vA(p,k,N,j));const A=[p,...G],M=await g.detectOverflow(t,C),Y=[];let V=((o=c.flip)==null?void 0:o.overflows)||[];if(w&&Y.push(M[_]),f){const fe=C0(a,d,j);Y.push(M[fe[0]],M[fe[1]])}if(V=[...V,{placement:a,overflows:Y}],!Y.every(fe=>fe<=0)){var le,he;const fe=(((le=c.flip)==null?void 0:le.index)||0)+1,ce=A[fe];if(ce&&(!(f==="alignment"?R!==Gn(ce):!1)||V.every(q=>Gn(q.placement)===R?q.overflows[0]>0:!0)))return{data:{index:fe,overflows:V},reset:{placement:ce}};let X=(he=V.filter(oe=>oe.overflows[0]<=0).sort((oe,q)=>oe.overflows[1]-q.overflows[1])[0])==null?void 0:he.placement;if(!X)switch(S){case"bestFit":{var pe;const oe=(pe=V.filter(q=>{if(K){const H=Gn(q.placement);return H===R||H==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(H=>H>0).reduce((H,D)=>H+D,0)]).sort((q,H)=>q[1]-H[1])[0])==null?void 0:pe[0];oe&&(X=oe);break}case"initialPlacement":X=p;break}if(a!==X)return{reset:{placement:X}}}return{}}}};function sv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ov(e){return _0.some(t=>e[t]>=0)}const EA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:o}=t,{strategy:a="referenceHidden",...c}=Xn(e,t);switch(a){case"referenceHidden":{const d=await o.detectOverflow(t,{...c,elementContext:"reference"}),p=sv(d,r.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:ov(p)}}}case"escaped":{const d=await o.detectOverflow(t,{...c,altBoundary:!0}),p=sv(d,r.floating);return{data:{escapedOffsets:p,escaped:ov(p)}}}default:return{}}}}};function N0(e){const t=Yn(...e.map(c=>c.left)),r=Yn(...e.map(c=>c.top)),o=Vt(...e.map(c=>c.right)),a=Vt(...e.map(c=>c.bottom));return{x:t,y:r,width:o-t,height:a-r}}function OA(e){const t=e.slice().sort((a,c)=>a.y-c.y),r=[];let o=null;for(let a=0;a<t.length;a++){const c=t[a];!o||c.y-o.y>o.height/2?r.push([c]):r[r.length-1].push(c),o=c}return r.map(a=>pi(N0(a)))}const PA=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:o,rects:a,platform:c,strategy:d}=t,{padding:p=2,x:g,y:v}=Xn(e,t),w=Array.from(await(c.getClientRects==null?void 0:c.getClientRects(o.reference))||[]),f=OA(w),x=pi(N0(w)),S=Up(p);function N(){if(f.length===2&&f[0].left>f[1].right&&g!=null&&v!=null)return f.find(C=>g>C.left-S.left&&g<C.right+S.right&&v>C.top-S.top&&v<C.bottom+S.bottom)||x;if(f.length>=2){if(Gn(r)==="y"){const V=f[0],le=f[f.length-1],he=Cn(r)==="top",pe=V.top,fe=le.bottom,ce=he?V.left:le.left,X=he?V.right:le.right,oe=X-ce,q=fe-pe;return{top:pe,bottom:fe,left:ce,right:X,width:oe,height:q,x:ce,y:pe}}const C=Cn(r)==="left",_=Vt(...f.map(V=>V.right)),R=Yn(...f.map(V=>V.left)),I=f.filter(V=>C?V.left===R:V.right===_),j=I[0].top,G=I[I.length-1].bottom,K=R,A=_,M=A-K,Y=G-j;return{top:j,bottom:G,left:K,right:A,width:M,height:Y,x:K,y:j}}return x}const k=await c.getElementRects({reference:{getBoundingClientRect:N},floating:o.floating,strategy:d});return a.reference.x!==k.reference.x||a.reference.y!==k.reference.y||a.reference.width!==k.reference.width||a.reference.height!==k.reference.height?{reset:{rects:k}}:{}}}},E0=new Set(["left","top"]);async function jA(e,t){const{placement:r,platform:o,elements:a}=e,c=await(o.isRTL==null?void 0:o.isRTL(a.floating)),d=Cn(r),p=Zn(r),g=Gn(r)==="y",v=E0.has(d)?-1:1,w=c&&g?-1:1,f=Xn(t,e);let{mainAxis:x,crossAxis:S,alignmentAxis:N}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return p&&typeof N=="number"&&(S=p==="end"?N*-1:N),g?{x:S*w,y:x*v}:{x:x*v,y:S*w}}const TA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:a,y:c,placement:d,middlewareData:p}=t,g=await jA(t,e);return d===((r=p.offset)==null?void 0:r.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:a+g.x,y:c+g.y,data:{...g,placement:d}}}}},RA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:a,platform:c}=t,{mainAxis:d=!0,crossAxis:p=!1,limiter:g={fn:_=>{let{x:R,y:I}=_;return{x:R,y:I}}},...v}=Xn(e,t),w={x:r,y:o},f=await c.detectOverflow(t,v),x=Gn(Cn(a)),S=Lp(x);let N=w[S],k=w[x];if(d){const _=S==="y"?"top":"left",R=S==="y"?"bottom":"right",I=N+f[_],j=N-f[R];N=Bf(I,N,j)}if(p){const _=x==="y"?"top":"left",R=x==="y"?"bottom":"right",I=k+f[_],j=k-f[R];k=Bf(I,k,j)}const C=g.fn({...t,[S]:N,[x]:k});return{...C,data:{x:C.x-r,y:C.y-o,enabled:{[S]:d,[x]:p}}}}}},AA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:a,rects:c,middlewareData:d}=t,{offset:p=0,mainAxis:g=!0,crossAxis:v=!0}=Xn(e,t),w={x:r,y:o},f=Gn(a),x=Lp(f);let S=w[x],N=w[f];const k=Xn(p,t),C=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(g){const I=x==="y"?"height":"width",j=c.reference[x]-c.floating[I]+C.mainAxis,G=c.reference[x]+c.reference[I]-C.mainAxis;S<j?S=j:S>G&&(S=G)}if(v){var _,R;const I=x==="y"?"width":"height",j=E0.has(Cn(a)),G=c.reference[f]-c.floating[I]+(j&&((_=d.offset)==null?void 0:_[f])||0)+(j?0:C.crossAxis),K=c.reference[f]+c.reference[I]+(j?0:((R=d.offset)==null?void 0:R[f])||0)-(j?C.crossAxis:0);N<G?N=G:N>K&&(N=K)}return{[x]:S,[f]:N}}}},MA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:a,rects:c,platform:d,elements:p}=t,{apply:g=()=>{},...v}=Xn(e,t),w=await d.detectOverflow(t,v),f=Cn(a),x=Zn(a),S=Gn(a)==="y",{width:N,height:k}=c.floating;let C,_;f==="top"||f==="bottom"?(C=f,_=x===(await(d.isRTL==null?void 0:d.isRTL(p.floating))?"start":"end")?"left":"right"):(_=f,C=x==="end"?"top":"bottom");const R=k-w.top-w.bottom,I=N-w.left-w.right,j=Yn(k-w[C],R),G=Yn(N-w[_],I),K=!t.middlewareData.shift;let A=j,M=G;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(M=I),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(A=R),K&&!x){const V=Vt(w.left,0),le=Vt(w.right,0),he=Vt(w.top,0),pe=Vt(w.bottom,0);S?M=N-2*(V!==0||le!==0?V+le:Vt(w.left,w.right)):A=k-2*(he!==0||pe!==0?he+pe:Vt(w.top,w.bottom))}await g({...t,availableWidth:M,availableHeight:A});const Y=await d.getDimensions(p.floating);return N!==Y.width||k!==Y.height?{reset:{rects:!0}}:{}}}};function Fc(){return typeof window<"u"}function yi(e){return O0(e)?(e.nodeName||"").toLowerCase():"#document"}function _n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xr(e){var t;return(t=(O0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function O0(e){return Fc()?e instanceof Node||e instanceof _n(e).Node:!1}function er(e){return Fc()?e instanceof Element||e instanceof _n(e).Element:!1}function Fr(e){return Fc()?e instanceof HTMLElement||e instanceof _n(e).HTMLElement:!1}function iv(e){return!Fc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _n(e).ShadowRoot}function ja(e){const{overflow:t,overflowX:r,overflowY:o,display:a}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&a!=="inline"&&a!=="contents"}function $A(e){return/^(table|td|th)$/.test(yi(e))}function Uc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const IA=/transform|translate|scale|rotate|perspective|filter/,DA=/paint|layout|strict|content/,Us=e=>!!e&&e!=="none";let ef;function Vp(e){const t=er(e)?tr(e):e;return Us(t.transform)||Us(t.translate)||Us(t.scale)||Us(t.rotate)||Us(t.perspective)||!Bp()&&(Us(t.backdropFilter)||Us(t.filter))||IA.test(t.willChange||"")||DA.test(t.contain||"")}function LA(e){let t=ks(e);for(;Fr(t)&&!hi(t);){if(Vp(t))return t;if(Uc(t))return null;t=ks(t)}return null}function Bp(){return ef==null&&(ef=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ef}function hi(e){return/^(html|body|#document)$/.test(yi(e))}function tr(e){return _n(e).getComputedStyle(e)}function Vc(e){return er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ks(e){if(yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iv(e)&&e.host||xr(e);return iv(t)?t.host:t}function P0(e){const t=ks(e);return hi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fr(t)&&ja(t)?t:P0(t)}function pa(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=P0(e),c=a===((o=e.ownerDocument)==null?void 0:o.body),d=_n(a);if(c){const p=Wf(d);return t.concat(d,d.visualViewport||[],ja(a)?a:[],p&&r?pa(p):[])}else return t.concat(a,pa(a,[],r))}function Wf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j0(e){const t=tr(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const a=Fr(e),c=a?e.offsetWidth:r,d=a?e.offsetHeight:o,p=vc(r)!==c||vc(o)!==d;return p&&(r=c,o=d),{width:r,height:o,$:p}}function Wp(e){return er(e)?e:e.contextElement}function qo(e){const t=Wp(e);if(!Fr(t))return yr(1);const r=t.getBoundingClientRect(),{width:o,height:a,$:c}=j0(t);let d=(c?vc(r.width):r.width)/o,p=(c?vc(r.height):r.height)/a;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const zA=yr(0);function T0(e){const t=_n(e);return!Bp()||!t.visualViewport?zA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FA(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==_n(e)?!1:t}function fo(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),c=Wp(e);let d=yr(1);t&&(o?er(o)&&(d=qo(o)):d=qo(e));const p=FA(c,r,o)?T0(c):yr(0);let g=(a.left+p.x)/d.x,v=(a.top+p.y)/d.y,w=a.width/d.x,f=a.height/d.y;if(c){const x=_n(c),S=o&&er(o)?_n(o):o;let N=x,k=Wf(N);for(;k&&o&&S!==N;){const C=qo(k),_=k.getBoundingClientRect(),R=tr(k),I=_.left+(k.clientLeft+parseFloat(R.paddingLeft))*C.x,j=_.top+(k.clientTop+parseFloat(R.paddingTop))*C.y;g*=C.x,v*=C.y,w*=C.x,f*=C.y,g+=I,v+=j,N=_n(k),k=Wf(N)}}return pi({width:w,height:f,x:g,y:v})}function Bc(e,t){const r=Vc(e).scrollLeft;return t?t.left+r:fo(xr(e)).left+r}function R0(e,t){const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Bc(e,r),a=r.top+t.scrollTop;return{x:o,y:a}}function UA(e){let{elements:t,rect:r,offsetParent:o,strategy:a}=e;const c=a==="fixed",d=xr(o),p=t?Uc(t.floating):!1;if(o===d||p&&c)return r;let g={scrollLeft:0,scrollTop:0},v=yr(1);const w=yr(0),f=Fr(o);if((f||!f&&!c)&&((yi(o)!=="body"||ja(d))&&(g=Vc(o)),f)){const S=fo(o);v=qo(o),w.x=S.x+o.clientLeft,w.y=S.y+o.clientTop}const x=d&&!f&&!c?R0(d,g):yr(0);return{width:r.width*v.x,height:r.height*v.y,x:r.x*v.x-g.scrollLeft*v.x+w.x+x.x,y:r.y*v.y-g.scrollTop*v.y+w.y+x.y}}function VA(e){return Array.from(e.getClientRects())}function BA(e){const t=xr(e),r=Vc(e),o=e.ownerDocument.body,a=Vt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),c=Vt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let d=-r.scrollLeft+Bc(e);const p=-r.scrollTop;return tr(o).direction==="rtl"&&(d+=Vt(t.clientWidth,o.clientWidth)-a),{width:a,height:c,x:d,y:p}}const av=25;function WA(e,t){const r=_n(e),o=xr(e),a=r.visualViewport;let c=o.clientWidth,d=o.clientHeight,p=0,g=0;if(a){c=a.width,d=a.height;const w=Bp();(!w||w&&t==="fixed")&&(p=a.offsetLeft,g=a.offsetTop)}const v=Bc(o);if(v<=0){const w=o.ownerDocument,f=w.body,x=getComputedStyle(f),S=w.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,N=Math.abs(o.clientWidth-f.clientWidth-S);N<=av&&(c-=N)}else v<=av&&(c+=v);return{width:c,height:d,x:p,y:g}}function HA(e,t){const r=fo(e,!0,t==="fixed"),o=r.top+e.clientTop,a=r.left+e.clientLeft,c=Fr(e)?qo(e):yr(1),d=e.clientWidth*c.x,p=e.clientHeight*c.y,g=a*c.x,v=o*c.y;return{width:d,height:p,x:g,y:v}}function lv(e,t,r){let o;if(t==="viewport")o=WA(e,r);else if(t==="document")o=BA(xr(e));else if(er(t))o=HA(t,r);else{const a=T0(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return pi(o)}function A0(e,t){const r=ks(e);return r===t||!er(r)||hi(r)?!1:tr(r).position==="fixed"||A0(r,t)}function qA(e,t){const r=t.get(e);if(r)return r;let o=pa(e,[],!1).filter(p=>er(p)&&yi(p)!=="body"),a=null;const c=tr(e).position==="fixed";let d=c?ks(e):e;for(;er(d)&&!hi(d);){const p=tr(d),g=Vp(d);!g&&p.position==="fixed"&&(a=null),(c?!g&&!a:!g&&p.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||ja(d)&&!g&&A0(e,d))?o=o.filter(w=>w!==d):a=p,d=ks(d)}return t.set(e,o),o}function KA(e){let{element:t,boundary:r,rootBoundary:o,strategy:a}=e;const d=[...r==="clippingAncestors"?Uc(t)?[]:qA(t,this._c):[].concat(r),o],p=lv(t,d[0],a);let g=p.top,v=p.right,w=p.bottom,f=p.left;for(let x=1;x<d.length;x++){const S=lv(t,d[x],a);g=Vt(S.top,g),v=Yn(S.right,v),w=Yn(S.bottom,w),f=Vt(S.left,f)}return{width:v-f,height:w-g,x:f,y:g}}function QA(e){const{width:t,height:r}=j0(e);return{width:t,height:r}}function GA(e,t,r){const o=Fr(t),a=xr(t),c=r==="fixed",d=fo(e,!0,c,t);let p={scrollLeft:0,scrollTop:0};const g=yr(0);function v(){g.x=Bc(a)}if(o||!o&&!c)if((yi(t)!=="body"||ja(a))&&(p=Vc(t)),o){const S=fo(t,!0,c,t);g.x=S.x+t.clientLeft,g.y=S.y+t.clientTop}else a&&v();c&&!o&&a&&v();const w=a&&!o&&!c?R0(a,p):yr(0),f=d.left+p.scrollLeft-g.x-w.x,x=d.top+p.scrollTop-g.y-w.y;return{x:f,y:x,width:d.width,height:d.height}}function tf(e){return tr(e).position==="static"}function cv(e,t){if(!Fr(e)||tr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return xr(e)===r&&(r=r.ownerDocument.body),r}function M0(e,t){const r=_n(e);if(Uc(e))return r;if(!Fr(e)){let a=ks(e);for(;a&&!hi(a);){if(er(a)&&!tf(a))return a;a=ks(a)}return r}let o=cv(e,t);for(;o&&$A(o)&&tf(o);)o=cv(o,t);return o&&hi(o)&&tf(o)&&!Vp(o)?r:o||LA(e)||r}const ZA=async function(e){const t=this.getOffsetParent||M0,r=this.getDimensions,o=await r(e.floating);return{reference:GA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function JA(e){return tr(e).direction==="rtl"}const YA={convertOffsetParentRelativeRectToViewportRelativeRect:UA,getDocumentElement:xr,getClippingRect:KA,getOffsetParent:M0,getElementRects:ZA,getClientRects:VA,getDimensions:QA,getScale:qo,isElement:er,isRTL:JA};function $0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XA(e,t){let r=null,o;const a=xr(e);function c(){var p;clearTimeout(o),(p=r)==null||p.disconnect(),r=null}function d(p,g){p===void 0&&(p=!1),g===void 0&&(g=1),c();const v=e.getBoundingClientRect(),{left:w,top:f,width:x,height:S}=v;if(p||t(),!x||!S)return;const N=Xl(f),k=Xl(a.clientWidth-(w+x)),C=Xl(a.clientHeight-(f+S)),_=Xl(w),I={rootMargin:-N+"px "+-k+"px "+-C+"px "+-_+"px",threshold:Vt(0,Yn(1,g))||1};let j=!0;function G(K){const A=K[0].intersectionRatio;if(A!==g){if(!j)return d();A?d(!1,A):o=setTimeout(()=>{d(!1,1e-7)},1e3)}A===1&&!$0(v,e.getBoundingClientRect())&&d(),j=!1}try{r=new IntersectionObserver(G,{...I,root:a.ownerDocument})}catch{r=new IntersectionObserver(G,I)}r.observe(e)}return d(!0),c}function eM(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=Wp(e),w=a||c?[...v?pa(v):[],...t?pa(t):[]]:[];w.forEach(_=>{a&&_.addEventListener("scroll",r,{passive:!0}),c&&_.addEventListener("resize",r)});const f=v&&p?XA(v,r):null;let x=-1,S=null;d&&(S=new ResizeObserver(_=>{let[R]=_;R&&R.target===v&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var I;(I=S)==null||I.observe(t)})),r()}),v&&!g&&S.observe(v),t&&S.observe(t));let N,k=g?fo(e):null;g&&C();function C(){const _=fo(e);k&&!$0(k,_)&&r(),k=_,N=requestAnimationFrame(C)}return r(),()=>{var _;w.forEach(R=>{a&&R.removeEventListener("scroll",r),c&&R.removeEventListener("resize",r)}),f==null||f(),(_=S)==null||_.disconnect(),S=null,g&&cancelAnimationFrame(N)}}const tM=TA,Q4=CA,nM=RA,rM=NA,sM=MA,oM=EA,uv=kA,G4=PA,iM=AA,aM=(e,t,r)=>{const o=new Map,a={platform:YA,...r},c={...a.platform,_c:o};return SA(e,t,{...a,platform:c})};var lM=typeof document<"u",cM=function(){},oc=lM?y.useLayoutEffect:cM;function bc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!bc(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=r;o--!==0;){const c=a[o];if(!(c==="_owner"&&e.$$typeof)&&!bc(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function I0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dv(e,t){const r=I0(e);return Math.round(t*r)/r}function nf(e){const t=y.useRef(e);return oc(()=>{t.current=e}),t}function uM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:c,floating:d}={},transform:p=!0,whileElementsMounted:g,open:v}=e,[w,f]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=y.useState(o);bc(x,o)||S(o);const[N,k]=y.useState(null),[C,_]=y.useState(null),R=y.useCallback(q=>{q!==K.current&&(K.current=q,k(q))},[]),I=y.useCallback(q=>{q!==A.current&&(A.current=q,_(q))},[]),j=c||N,G=d||C,K=y.useRef(null),A=y.useRef(null),M=y.useRef(w),Y=g!=null,V=nf(g),le=nf(a),he=nf(v),pe=y.useCallback(()=>{if(!K.current||!A.current)return;const q={placement:t,strategy:r,middleware:x};le.current&&(q.platform=le.current),aM(K.current,A.current,q).then(H=>{const D={...H,isPositioned:he.current!==!1};fe.current&&!bc(M.current,D)&&(M.current=D,Zf.flushSync(()=>{f(D)}))})},[x,t,r,le,he]);oc(()=>{v===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[v]);const fe=y.useRef(!1);oc(()=>(fe.current=!0,()=>{fe.current=!1}),[]),oc(()=>{if(j&&(K.current=j),G&&(A.current=G),j&&G){if(V.current)return V.current(j,G,pe);pe()}},[j,G,pe,V,Y]);const ce=y.useMemo(()=>({reference:K,floating:A,setReference:R,setFloating:I}),[R,I]),X=y.useMemo(()=>({reference:j,floating:G}),[j,G]),oe=y.useMemo(()=>{const q={position:r,left:0,top:0};if(!X.floating)return q;const H=dv(X.floating,w.x),D=dv(X.floating,w.y);return p?{...q,transform:"translate("+H+"px, "+D+"px)",...I0(X.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:H,top:D}},[r,p,X.floating,w.x,w.y]);return y.useMemo(()=>({...w,update:pe,refs:ce,elements:X,floatingStyles:oe}),[w,pe,ce,X,oe])}const dM=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:a}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?uv({element:o.current,padding:a}).fn(r):{}:o?uv({element:o,padding:a}).fn(r):{}}}},fM=(e,t)=>{const r=tM(e);return{name:r.name,fn:r.fn,options:[e,t]}},pM=(e,t)=>{const r=nM(e);return{name:r.name,fn:r.fn,options:[e,t]}},hM=(e,t)=>({fn:iM(e).fn,options:[e,t]}),mM=(e,t)=>{const r=rM(e);return{name:r.name,fn:r.fn,options:[e,t]}},gM=(e,t)=>{const r=sM(e);return{name:r.name,fn:r.fn,options:[e,t]}},yM=(e,t)=>{const r=oM(e);return{name:r.name,fn:r.fn,options:[e,t]}},vM=(e,t)=>{const r=dM(e);return{name:r.name,fn:r.fn,options:[e,t]}};var wM="Arrow",D0=y.forwardRef((e,t)=>{const{children:r,width:o=10,height:a=5,...c}=e;return u.jsx(Ze.svg,{...c,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});D0.displayName=wM;var xM=D0,Hp="Popper",[L0,z0]=Ns(Hp),[bM,F0]=L0(Hp),U0=e=>{const{__scopePopper:t,children:r}=e,[o,a]=y.useState(null);return u.jsx(bM,{scope:t,anchor:o,onAnchorChange:a,children:r})};U0.displayName=Hp;var V0="PopperAnchor",B0=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...a}=e,c=F0(V0,r),d=y.useRef(null),p=Ct(t,d),g=y.useRef(null);return y.useEffect(()=>{const v=g.current;g.current=(o==null?void 0:o.current)||d.current,v!==g.current&&c.onAnchorChange(g.current)}),o?null:u.jsx(Ze.div,{...a,ref:p})});B0.displayName=V0;var qp="PopperContent",[SM,kM]=L0(qp),W0=y.forwardRef((e,t)=>{var we,xe,ve,Ue,at,pt;const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:c="center",alignOffset:d=0,arrowPadding:p=0,avoidCollisions:g=!0,collisionBoundary:v=[],collisionPadding:w=0,sticky:f="partial",hideWhenDetached:x=!1,updatePositionStrategy:S="optimized",onPlaced:N,...k}=e,C=F0(qp,r),[_,R]=y.useState(null),I=Ct(t,lt=>R(lt)),[j,G]=y.useState(null),K=Rx(j),A=(K==null?void 0:K.width)??0,M=(K==null?void 0:K.height)??0,Y=o+(c!=="center"?"-"+c:""),V=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},le=Array.isArray(v)?v:[v],he=le.length>0,pe={padding:V,boundary:le.filter(CM),altBoundary:he},{refs:fe,floatingStyles:ce,placement:X,isPositioned:oe,middlewareData:q}=uM({strategy:"fixed",placement:Y,whileElementsMounted:(...lt)=>eM(...lt,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[fM({mainAxis:a+M,alignmentAxis:d}),g&&pM({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?hM():void 0,...pe}),g&&mM({...pe}),gM({...pe,apply:({elements:lt,rects:vt,availableWidth:tn,availableHeight:Dn})=>{const{width:pn,height:rr}=vt.reference,nt=lt.floating.style;nt.setProperty("--radix-popper-available-width",`${tn}px`),nt.setProperty("--radix-popper-available-height",`${Dn}px`),nt.setProperty("--radix-popper-anchor-width",`${pn}px`),nt.setProperty("--radix-popper-anchor-height",`${rr}px`)}}),j&&vM({element:j,padding:p}),NM({arrowWidth:A,arrowHeight:M}),x&&yM({strategy:"referenceHidden",...pe})]}),[H,D]=K0(X),O=vr(N);Jn(()=>{oe&&(O==null||O())},[oe,O]);const Q=(we=q.arrow)==null?void 0:we.x,re=(xe=q.arrow)==null?void 0:xe.y,J=((ve=q.arrow)==null?void 0:ve.centerOffset)!==0,[Z,de]=y.useState();return Jn(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),u.jsx("div",{ref:fe.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:oe?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(Ue=q.transformOrigin)==null?void 0:Ue.x,(at=q.transformOrigin)==null?void 0:at.y].join(" "),...((pt=q.hide)==null?void 0:pt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(SM,{scope:r,placedSide:H,onArrowChange:G,arrowX:Q,arrowY:re,shouldHideArrow:J,children:u.jsx(Ze.div,{"data-side":H,"data-align":D,...k,ref:I,style:{...k.style,animation:oe?void 0:"none"}})})})});W0.displayName=qp;var H0="PopperArrow",_M={top:"bottom",right:"left",bottom:"top",left:"right"},q0=y.forwardRef(function(t,r){const{__scopePopper:o,...a}=t,c=kM(H0,o),d=_M[c.placedSide];return u.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:u.jsx(xM,{...a,ref:r,style:{...a.style,display:"block"}})})});q0.displayName=H0;function CM(e){return e!==null}var NM=e=>({name:"transformOrigin",options:e,fn(t){var C,_,R;const{placement:r,rects:o,middlewareData:a}=t,d=((C=a.arrow)==null?void 0:C.centerOffset)!==0,p=d?0:e.arrowWidth,g=d?0:e.arrowHeight,[v,w]=K0(r),f={start:"0%",center:"50%",end:"100%"}[w],x=(((_=a.arrow)==null?void 0:_.x)??0)+p/2,S=(((R=a.arrow)==null?void 0:R.y)??0)+g/2;let N="",k="";return v==="bottom"?(N=d?f:`${x}px`,k=`${-g}px`):v==="top"?(N=d?f:`${x}px`,k=`${o.floating.height+g}px`):v==="right"?(N=`${-g}px`,k=d?f:`${S}px`):v==="left"&&(N=`${o.floating.width+g}px`,k=d?f:`${S}px`),{data:{x:N,y:k}}}});function K0(e){const[t,r="center"]=e.split("-");return[t,r]}var EM=U0,OM=B0,PM=W0,jM=q0;function TM(e){const t=RM(e),r=y.forwardRef((o,a)=>{const{children:c,...d}=o,p=y.Children.toArray(c),g=p.find(MM);if(g){const v=g.props.children,w=p.map(f=>f===g?y.Children.count(v)>1?y.Children.only(null):y.isValidElement(v)?v.props.children:null:f);return u.jsx(t,{...d,ref:a,children:y.isValidElement(v)?y.cloneElement(v,void 0,w):null})}return u.jsx(t,{...d,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function RM(e){const t=y.forwardRef((r,o)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const d=IM(a),p=$M(c,a.props);return a.type!==y.Fragment&&(p.ref=o?Cs(o,d):d),y.cloneElement(a,p)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AM=Symbol("radix.slottable");function MM(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AM}function $M(e,t){const r={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?r[o]=(...p)=>{const g=c(...p);return a(...p),g}:a&&(r[o]=a):o==="style"?r[o]={...a,...c}:o==="className"&&(r[o]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function IM(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Hf=["Enter"," "],DM=["ArrowDown","PageUp","Home"],Q0=["ArrowUp","PageDown","End"],LM=[...DM,...Q0],zM={ltr:[...Hf,"ArrowRight"],rtl:[...Hf,"ArrowLeft"]},FM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ta="Menu",[ha,UM,VM]=Vx(Ta),[ho,G0]=Ns(Ta,[VM,z0,Lc]),Wc=z0(),Z0=Lc(),[BM,mo]=ho(Ta),[WM,Ra]=ho(Ta),J0=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:a,onOpenChange:c,modal:d=!0}=e,p=Wc(t),[g,v]=y.useState(null),w=y.useRef(!1),f=vr(c),x=Rp(a);return y.useEffect(()=>{const S=()=>{w.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},N=()=>w.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),u.jsx(EM,{...p,children:u.jsx(BM,{scope:t,open:r,onOpenChange:f,content:g,onContentChange:v,children:u.jsx(WM,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:w,dir:x,modal:d,children:o})})})};J0.displayName=Ta;var HM="MenuAnchor",Kp=y.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,a=Wc(r);return u.jsx(OM,{...a,...o,ref:t})});Kp.displayName=HM;var Qp="MenuPortal",[qM,Y0]=ho(Qp,{forceMount:void 0}),X0=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:a}=e,c=mo(Qp,t);return u.jsx(qM,{scope:t,forceMount:r,children:u.jsx(zr,{present:r||c.open,children:u.jsx(Cp,{asChild:!0,container:a,children:o})})})};X0.displayName=Qp;var $n="MenuContent",[KM,Gp]=ho($n),eb=y.forwardRef((e,t)=>{const r=Y0($n,e.__scopeMenu),{forceMount:o=r.forceMount,...a}=e,c=mo($n,e.__scopeMenu),d=Ra($n,e.__scopeMenu);return u.jsx(ha.Provider,{scope:e.__scopeMenu,children:u.jsx(zr,{present:o||c.open,children:u.jsx(ha.Slot,{scope:e.__scopeMenu,children:d.modal?u.jsx(QM,{...a,ref:t}):u.jsx(GM,{...a,ref:t})})})})}),QM=y.forwardRef((e,t)=>{const r=mo($n,e.__scopeMenu),o=y.useRef(null),a=Ct(t,o);return y.useEffect(()=>{const c=o.current;if(c)return lx(c)},[]),u.jsx(Zp,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:De(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),GM=y.forwardRef((e,t)=>{const r=mo($n,e.__scopeMenu);return u.jsx(Zp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),ZM=TM("MenuContent.ScrollLock"),Zp=y.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEntryFocus:g,onEscapeKeyDown:v,onPointerDownOutside:w,onFocusOutside:f,onInteractOutside:x,onDismiss:S,disableOutsideScroll:N,...k}=e,C=mo($n,r),_=Ra($n,r),R=Wc(r),I=Z0(r),j=UM(r),[G,K]=y.useState(null),A=y.useRef(null),M=Ct(t,A,C.onContentChange),Y=y.useRef(0),V=y.useRef(""),le=y.useRef(0),he=y.useRef(null),pe=y.useRef("right"),fe=y.useRef(0),ce=N?Np:y.Fragment,X=N?{as:ZM,allowPinchZoom:!0}:void 0,oe=H=>{var we,xe;const D=V.current+H,O=j().filter(ve=>!ve.disabled),Q=document.activeElement,re=(we=O.find(ve=>ve.ref.current===Q))==null?void 0:we.textValue,J=O.map(ve=>ve.textValue),Z=l$(J,D,re),de=(xe=O.find(ve=>ve.textValue===Z))==null?void 0:xe.ref.current;(function ve(Ue){V.current=Ue,window.clearTimeout(Y.current),Ue!==""&&(Y.current=window.setTimeout(()=>ve(""),1e3))})(D),de&&setTimeout(()=>de.focus())};y.useEffect(()=>()=>window.clearTimeout(Y.current),[]),Xw();const q=y.useCallback(H=>{var O,Q;return pe.current===((O=he.current)==null?void 0:O.side)&&u$(H,(Q=he.current)==null?void 0:Q.area)},[]);return u.jsx(KM,{scope:r,searchRef:V,onItemEnter:y.useCallback(H=>{q(H)&&H.preventDefault()},[q]),onItemLeave:y.useCallback(H=>{var D;q(H)||((D=A.current)==null||D.focus(),K(null))},[q]),onTriggerLeave:y.useCallback(H=>{q(H)&&H.preventDefault()},[q]),pointerGraceTimerRef:le,onPointerGraceIntentChange:y.useCallback(H=>{he.current=H},[]),children:u.jsx(ce,{...X,children:u.jsx(_p,{asChild:!0,trapped:a,onMountAutoFocus:De(c,H=>{var D;H.preventDefault(),(D=A.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:u.jsx(kp,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:v,onPointerDownOutside:w,onFocusOutside:f,onInteractOutside:x,onDismiss:S,children:u.jsx(Qx,{asChild:!0,...I,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:G,onCurrentTabStopIdChange:K,onEntryFocus:De(g,H=>{_.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(PM,{role:"menu","aria-orientation":"vertical","data-state":gb(C.open),"data-radix-menu-content":"",dir:_.dir,...R,...k,ref:M,style:{outline:"none",...k.style},onKeyDown:De(k.onKeyDown,H=>{const O=H.target.closest("[data-radix-menu-content]")===H.currentTarget,Q=H.ctrlKey||H.altKey||H.metaKey,re=H.key.length===1;O&&(H.key==="Tab"&&H.preventDefault(),!Q&&re&&oe(H.key));const J=A.current;if(H.target!==J||!LM.includes(H.key))return;H.preventDefault();const de=j().filter(we=>!we.disabled).map(we=>we.ref.current);Q0.includes(H.key)&&de.reverse(),i$(de)}),onBlur:De(e.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(Y.current),V.current="")}),onPointerMove:De(e.onPointerMove,ma(H=>{const D=H.target,O=fe.current!==H.clientX;if(H.currentTarget.contains(D)&&O){const Q=H.clientX>fe.current?"right":"left";pe.current=Q,fe.current=H.clientX}}))})})})})})})});eb.displayName=$n;var JM="MenuGroup",Jp=y.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return u.jsx(Ze.div,{role:"group",...o,ref:t})});Jp.displayName=JM;var YM="MenuLabel",tb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return u.jsx(Ze.div,{...o,ref:t})});tb.displayName=YM;var Sc="MenuItem",fv="menu.itemSelect",Hc=y.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...a}=e,c=y.useRef(null),d=Ra(Sc,e.__scopeMenu),p=Gp(Sc,e.__scopeMenu),g=Ct(t,c),v=y.useRef(!1),w=()=>{const f=c.current;if(!r&&f){const x=new CustomEvent(fv,{bubbles:!0,cancelable:!0});f.addEventListener(fv,S=>o==null?void 0:o(S),{once:!0}),Gw(f,x),x.defaultPrevented?v.current=!1:d.onClose()}};return u.jsx(nb,{...a,ref:g,disabled:r,onClick:De(e.onClick,w),onPointerDown:f=>{var x;(x=e.onPointerDown)==null||x.call(e,f),v.current=!0},onPointerUp:De(e.onPointerUp,f=>{var x;v.current||(x=f.currentTarget)==null||x.click()}),onKeyDown:De(e.onKeyDown,f=>{const x=p.searchRef.current!=="";r||x&&f.key===" "||Hf.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Hc.displayName=Sc;var nb=y.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:a,...c}=e,d=Gp(Sc,r),p=Z0(r),g=y.useRef(null),v=Ct(t,g),[w,f]=y.useState(!1),[x,S]=y.useState("");return y.useEffect(()=>{const N=g.current;N&&S((N.textContent??"").trim())},[c.children]),u.jsx(ha.ItemSlot,{scope:r,disabled:o,textValue:a??x,children:u.jsx(Gx,{asChild:!0,...p,focusable:!o,children:u.jsx(Ze.div,{role:"menuitem","data-highlighted":w?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:v,onPointerMove:De(e.onPointerMove,ma(N=>{o?d.onItemLeave(N):(d.onItemEnter(N),N.defaultPrevented||N.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:De(e.onPointerLeave,ma(N=>d.onItemLeave(N))),onFocus:De(e.onFocus,()=>f(!0)),onBlur:De(e.onBlur,()=>f(!1))})})})}),XM="MenuCheckboxItem",rb=y.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...a}=e;return u.jsx(lb,{scope:e.__scopeMenu,checked:r,children:u.jsx(Hc,{role:"menuitemcheckbox","aria-checked":kc(r)?"mixed":r,...a,ref:t,"data-state":Xp(r),onSelect:De(a.onSelect,()=>o==null?void 0:o(kc(r)?!0:!r),{checkForDefaultPrevented:!1})})})});rb.displayName=XM;var sb="MenuRadioGroup",[e$,t$]=ho(sb,{value:void 0,onValueChange:()=>{}}),ob=y.forwardRef((e,t)=>{const{value:r,onValueChange:o,...a}=e,c=vr(o);return u.jsx(e$,{scope:e.__scopeMenu,value:r,onValueChange:c,children:u.jsx(Jp,{...a,ref:t})})});ob.displayName=sb;var ib="MenuRadioItem",ab=y.forwardRef((e,t)=>{const{value:r,...o}=e,a=t$(ib,e.__scopeMenu),c=r===a.value;return u.jsx(lb,{scope:e.__scopeMenu,checked:c,children:u.jsx(Hc,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Xp(c),onSelect:De(o.onSelect,()=>{var d;return(d=a.onValueChange)==null?void 0:d.call(a,r)},{checkForDefaultPrevented:!1})})})});ab.displayName=ib;var Yp="MenuItemIndicator",[lb,n$]=ho(Yp,{checked:!1}),cb=y.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...a}=e,c=n$(Yp,r);return u.jsx(zr,{present:o||kc(c.checked)||c.checked===!0,children:u.jsx(Ze.span,{...a,ref:t,"data-state":Xp(c.checked)})})});cb.displayName=Yp;var r$="MenuSeparator",ub=y.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return u.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});ub.displayName=r$;var s$="MenuArrow",db=y.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,a=Wc(r);return u.jsx(jM,{...a,...o,ref:t})});db.displayName=s$;var o$="MenuSub",[Z4,fb]=ho(o$),oa="MenuSubTrigger",pb=y.forwardRef((e,t)=>{const r=mo(oa,e.__scopeMenu),o=Ra(oa,e.__scopeMenu),a=fb(oa,e.__scopeMenu),c=Gp(oa,e.__scopeMenu),d=y.useRef(null),{pointerGraceTimerRef:p,onPointerGraceIntentChange:g}=c,v={__scopeMenu:e.__scopeMenu},w=y.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return y.useEffect(()=>w,[w]),y.useEffect(()=>{const f=p.current;return()=>{window.clearTimeout(f),g(null)}},[p,g]),u.jsx(Kp,{asChild:!0,...v,children:u.jsx(nb,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":gb(r.open),...e,ref:Cs(t,a.onTriggerChange),onClick:f=>{var x;(x=e.onClick)==null||x.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:De(e.onPointerMove,ma(f=>{c.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),w()},100))})),onPointerLeave:De(e.onPointerLeave,ma(f=>{var S,N;w();const x=(S=r.content)==null?void 0:S.getBoundingClientRect();if(x){const k=(N=r.content)==null?void 0:N.dataset.side,C=k==="right",_=C?-5:5,R=x[C?"left":"right"],I=x[C?"right":"left"];c.onPointerGraceIntentChange({area:[{x:f.clientX+_,y:f.clientY},{x:R,y:x.top},{x:I,y:x.top},{x:I,y:x.bottom},{x:R,y:x.bottom}],side:k}),window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(f),f.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:De(e.onKeyDown,f=>{var S;const x=c.searchRef.current!=="";e.disabled||x&&f.key===" "||zM[o.dir].includes(f.key)&&(r.onOpenChange(!0),(S=r.content)==null||S.focus(),f.preventDefault())})})})});pb.displayName=oa;var hb="MenuSubContent",mb=y.forwardRef((e,t)=>{const r=Y0($n,e.__scopeMenu),{forceMount:o=r.forceMount,...a}=e,c=mo($n,e.__scopeMenu),d=Ra($n,e.__scopeMenu),p=fb(hb,e.__scopeMenu),g=y.useRef(null),v=Ct(t,g);return u.jsx(ha.Provider,{scope:e.__scopeMenu,children:u.jsx(zr,{present:o||c.open,children:u.jsx(ha.Slot,{scope:e.__scopeMenu,children:u.jsx(Zp,{id:p.contentId,"aria-labelledby":p.triggerId,...a,ref:v,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:w=>{var f;d.isUsingKeyboardRef.current&&((f=g.current)==null||f.focus()),w.preventDefault()},onCloseAutoFocus:w=>w.preventDefault(),onFocusOutside:De(e.onFocusOutside,w=>{w.target!==p.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:De(e.onEscapeKeyDown,w=>{d.onClose(),w.preventDefault()}),onKeyDown:De(e.onKeyDown,w=>{var S;const f=w.currentTarget.contains(w.target),x=FM[d.dir].includes(w.key);f&&x&&(c.onOpenChange(!1),(S=p.trigger)==null||S.focus(),w.preventDefault())})})})})})});mb.displayName=hb;function gb(e){return e?"open":"closed"}function kc(e){return e==="indeterminate"}function Xp(e){return kc(e)?"indeterminate":e?"checked":"unchecked"}function i$(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function a$(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function l$(e,t,r){const a=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let d=a$(e,Math.max(c,0));a.length===1&&(d=d.filter(v=>v!==r));const g=d.find(v=>v.toLowerCase().startsWith(a.toLowerCase()));return g!==r?g:void 0}function c$(e,t){const{x:r,y:o}=e;let a=!1;for(let c=0,d=t.length-1;c<t.length;d=c++){const p=t[c],g=t[d],v=p.x,w=p.y,f=g.x,x=g.y;w>o!=x>o&&r<(f-v)*(o-w)/(x-w)+v&&(a=!a)}return a}function u$(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return c$(r,t)}function ma(e){return t=>t.pointerType==="mouse"?e(t):void 0}var d$=J0,f$=Kp,p$=X0,h$=eb,m$=Jp,g$=tb,y$=Hc,v$=rb,w$=ob,x$=ab,b$=cb,S$=ub,k$=db,_$=pb,C$=mb,qc="DropdownMenu",[N$]=Ns(qc,[G0]),en=G0(),[E$,yb]=N$(qc),vb=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:a,defaultOpen:c,onOpenChange:d,modal:p=!0}=e,g=en(t),v=y.useRef(null),[w,f]=Ea({prop:a,defaultProp:c??!1,onChange:d,caller:qc});return u.jsx(E$,{scope:t,triggerId:ro(),triggerRef:v,contentId:ro(),open:w,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(x=>!x),[f]),modal:p,children:u.jsx(d$,{...g,open:w,onOpenChange:f,dir:o,modal:p,children:r})})};vb.displayName=qc;var wb="DropdownMenuTrigger",xb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...a}=e,c=yb(wb,r),d=en(r);return u.jsx(f$,{asChild:!0,...d,children:u.jsx(Ze.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:Cs(t,c.triggerRef),onPointerDown:De(e.onPointerDown,p=>{!o&&p.button===0&&p.ctrlKey===!1&&(c.onOpenToggle(),c.open||p.preventDefault())}),onKeyDown:De(e.onKeyDown,p=>{o||(["Enter"," "].includes(p.key)&&c.onOpenToggle(),p.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})});xb.displayName=wb;var O$="DropdownMenuPortal",bb=e=>{const{__scopeDropdownMenu:t,...r}=e,o=en(t);return u.jsx(p$,{...o,...r})};bb.displayName=O$;var Sb="DropdownMenuContent",kb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=yb(Sb,r),c=en(r),d=y.useRef(!1);return u.jsx(h$,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...o,ref:t,onCloseAutoFocus:De(e.onCloseAutoFocus,p=>{var g;d.current||(g=a.triggerRef.current)==null||g.focus(),d.current=!1,p.preventDefault()}),onInteractOutside:De(e.onInteractOutside,p=>{const g=p.detail.originalEvent,v=g.button===0&&g.ctrlKey===!0,w=g.button===2||v;(!a.modal||w)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kb.displayName=Sb;var P$="DropdownMenuGroup",j$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(m$,{...a,...o,ref:t})});j$.displayName=P$;var T$="DropdownMenuLabel",_b=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(g$,{...a,...o,ref:t})});_b.displayName=T$;var R$="DropdownMenuItem",Cb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(y$,{...a,...o,ref:t})});Cb.displayName=R$;var A$="DropdownMenuCheckboxItem",Nb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(v$,{...a,...o,ref:t})});Nb.displayName=A$;var M$="DropdownMenuRadioGroup",$$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(w$,{...a,...o,ref:t})});$$.displayName=M$;var I$="DropdownMenuRadioItem",Eb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(x$,{...a,...o,ref:t})});Eb.displayName=I$;var D$="DropdownMenuItemIndicator",Ob=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(b$,{...a,...o,ref:t})});Ob.displayName=D$;var L$="DropdownMenuSeparator",Pb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(S$,{...a,...o,ref:t})});Pb.displayName=L$;var z$="DropdownMenuArrow",F$=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(k$,{...a,...o,ref:t})});F$.displayName=z$;var U$="DropdownMenuSubTrigger",jb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(_$,{...a,...o,ref:t})});jb.displayName=U$;var V$="DropdownMenuSubContent",Tb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,a=en(r);return u.jsx(C$,{...a,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Tb.displayName=V$;var B$=vb,W$=xb,H$=bb,Rb=kb,Ab=_b,Mb=Cb,$b=Nb,Ib=Eb,Db=Ob,Lb=Pb,zb=jb,Fb=Tb;const q$=B$,K$=W$,Q$=y.forwardRef(({className:e,inset:t,children:r,...o},a)=>u.jsxs(zb,{ref:a,className:Le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[r,u.jsx(Ca,{className:"ml-auto h-4 w-4"})]}));Q$.displayName=zb.displayName;const G$=y.forwardRef(({className:e,...t},r)=>u.jsx(Fb,{ref:r,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));G$.displayName=Fb.displayName;const Ub=y.forwardRef(({className:e,sideOffset:t=4,...r},o)=>u.jsx(H$,{children:u.jsx(Rb,{ref:o,sideOffset:t,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Ub.displayName=Rb.displayName;const ic=y.forwardRef(({className:e,inset:t,...r},o)=>u.jsx(Mb,{ref:o,className:Le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));ic.displayName=Mb.displayName;const Z$=y.forwardRef(({className:e,children:t,checked:r,...o},a)=>u.jsxs($b,{ref:a,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Db,{children:u.jsx(Cc,{className:"h-4 w-4"})})}),t]}));Z$.displayName=$b.displayName;const J$=y.forwardRef(({className:e,children:t,...r},o)=>u.jsxs(Ib,{ref:o,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Db,{children:u.jsx(Uk,{className:"h-2 w-2 fill-current"})})}),t]}));J$.displayName=Ib.displayName;const Y$=y.forwardRef(({className:e,inset:t,...r},o)=>u.jsx(Ab,{ref:o,className:Le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Y$.displayName=Ab.displayName;const qf=y.forwardRef(({className:e,...t},r)=>u.jsx(Lb,{ref:r,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));qf.displayName=Lb.displayName;const Kc=(e,t)=>Jf(()=>e().then(r=>({default:r[t]}))),X$=Kc(()=>_t(()=>import("./NestView-DwIagxwJ.js").then(e=>e.e),__vite__mapDeps([20,14,6,9,15,16,17,18,2,8,5,19,13,21,22,1,23,24,25,26,11,4,27,28,29,30,31,32])),"NestView"),eI=Kc(()=>_t(()=>import("./DocumentEditor-DV2WHYbj.js"),__vite__mapDeps([51,13,14,6,9,15,16,17,18,2,8,5,19,52,22,26,27,53,54,25,50,29,30,24,33,55,4,28,41,34,40,31,56])),"DocumentEditor"),tI=Kc(()=>_t(()=>import("./AgentDocsPage-Dkhgb1hk.js"),__vite__mapDeps([57,36,55,18])),"AgentDocsPage"),nI=Kc(()=>_t(()=>import("./ActivityTracePage-D2iIbEph.js"),__vite__mapDeps([49,36,16,13,50,2,4,21])),"ActivityTracePage"),Vb=[{page:"nest",label:"Nest",icon:Xf,beta:!1},...Pc.map(e=>({page:e.viewPage,label:e.label,icon:e.icon,beta:!!e.beta}))],rI={overview:"Overview",documents:"Documents",review:"Review queue","external-edits":"External edits",stewards:"Stewards",collaborators:"Collaborators"},sI=["overview","documents","review","external-edits","stewards","collaborators"],ec=e=>Vb.some(t=>t.page===e.page),pv=e=>e.page==="document"?`${e.nestId}/${e.nodeId}`:e.page==="nest"&&e.readerMode&&e.readerDoc?`${e.nestId}/${e.readerDoc}`:null;let hv=!1;function oI(){var ir,kr;const{authMode:e,logoUrl:t,serverVersion:r,adminStatus:o,authenticated:a,isAdmin:c,workflowPlaneEnabled:d,subagentRunsEnabled:p,loading:g,error:v,logout:w}=Na(),[f,x]=y.useState(()=>({page:"dashboard",...typeof window<"u"?{tab:HE(window.location.pathname)??dc}:{}})),S=y.useCallback(L=>KR(()=>x(L)),[]),N=y.useRef(null);y.useEffect(()=>{iN("$pageview",{page:f.page})},[f.page]);const[k,C]=y.useState(!1),[_,R]=y.useState(()=>typeof window>"u"?{status:"idle"}:Zd()?{status:"loading"}:{status:"idle"}),[I,j]=y.useState(null),[G,K]=y.useState(!0),[A,M]=y.useState(!1),[Y,V]=y.useState(!1),[le,he]=y.useState(!1),[pe,fe]=y.useState(()=>jc(localStorage).sidebarCollapsed),ce=L=>{fe(L),dp(localStorage,{sidebarCollapsed:L})},[X,oe]=y.useState(!1);y.useEffect(()=>{oe(!1)},[f]);const[q,H]=y.useState(!1),D=y.useCallback(()=>M(!0),[]),O=Oc(),Q=y.useCallback(async L=>{var Et;const ee=await O.fetchQuery(Bt.nestList()).catch(()=>null),me=L.kind==="nest"?L.id:L.nest_id,ge=(Et=ee==null?void 0:ee.nests)==null?void 0:Et.find(et=>et.id===me),Oe={isOwner:(ge==null?void 0:ge.is_owner)??!1,isAnonOwned:(ge==null?void 0:ge.user_id)===dw},Je=L.kind==="nest"?L.title:L.nest_name;S(L.kind==="nest"?{page:"nest",nestId:me,nestName:Je,...Oe}:{page:"document",nestId:me,nestName:Je,nodeId:L.id,...Oe})},[O]),re=f.page==="nest"||f.page==="document"||f.page==="dashboard";y.useEffect(()=>{if(!re){he(!1);return}const L=ee=>{(ee.metaKey||ee.ctrlKey)&&ee.key.toLowerCase()==="k"&&(ee.preventDefault(),he(me=>!me))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[re]);const[J,Z]=y.useState(!1);y.useEffect(()=>{const L=ee=>{if(ee.key!=="?"||ee.metaKey||ee.ctrlKey||ee.altKey)return;const me=ee.target;me!=null&&me.isContentEditable||(me==null?void 0:me.tagName)==="INPUT"||(me==null?void 0:me.tagName)==="TEXTAREA"||(me==null?void 0:me.tagName)==="SELECT"||(ee.preventDefault(),Z(!0))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[]);const de=y.useCallback(async()=>{V(!0);try{await w(),M(!1),ac.success("Logged out successfully")}finally{V(!1)}},[w]),we=y.useCallback(async()=>{try{const L=await Hv();j(L)}catch{j(null)}finally{K(!1)}},[]);y.useEffect(()=>{if(_.status!=="loading")return;const L=new URLSearchParams(window.location.search),ee=_.nestId??Zd();if(!ee){R({status:"missing"});return}if(g&&Qy()==="workflows")return;let me=!1;return(async()=>{try{const{nest:ge,permission:Oe,roles:Je,myStewards:Et}=await O.fetchQuery(Bt.nest(ee));if(me)return;const et=Oe==="owner",ht=Nf({roles:Je??[],permission:Oe,myStewards:Et??[],isOwner:et,isAdmin:c,readerMode:!!ge.reader_mode}).isReaderView;R({status:"ok",nestId:ge.id,nestName:ge.name});const ct=L.get("doc");if(ct&&ct!=="new"&&ht){S({page:"nest",nestId:ge.id,nestName:ge.name,isOwner:et,isAnonOwned:!1,readerMode:ht,readerDoc:ct});return}if(ct&&ct!=="new"){S({page:"document",nestId:ge.id,nestName:ge.name,nodeId:ct,isOwner:et,isAnonOwned:!1,initialThreadId:L.get("thread")||void 0});return}const Fn=Qy(),hn=pE(Fn),nn=hn?hn.visible&&!hn.visible({isReadOnly:!1,isReaderView:!1,canEditDocs:!0,workflowPlaneEnabled:d})?null:hn.viewPage:Fn==="trace"?"nest-trace":null;if(nn&&Ld(nn,ht)){S({page:"nest",nestId:ge.id,nestName:ge.name,isOwner:et,isAnonOwned:!1,readerMode:ht});return}if(nn){S({page:nn,nestId:ge.id,nestName:ge.name,isOwner:et,isAnonOwned:!1,readerMode:ht});return}S({page:"nest",nestId:ge.id,nestName:ge.name,isOwner:et,isAnonOwned:!1,readerMode:ht,tab:sI.includes(L.get("tab")??"")?L.get("tab"):void 0})}catch{me||R({status:"unreachable",nestId:ee})}})(),()=>{me=!0}},[_.status,d,g]),y.useEffect(()=>{var ht;if(typeof window>"u"||_.status==="loading")return;const L=new URLSearchParams(window.location.search);L.delete("nest");let ee=null,me=null;f.page==="document"?(ee=f.nestId,f.nodeId&&f.nodeId!=="new"?L.set("doc",f.nodeId):L.delete("doc"),f.initialThreadId?L.set("thread",f.initialThreadId):L.delete("thread"),L.delete("view"),L.delete("tab")):f.page==="nest"?(ee=f.nestId,f.readerMode&&f.readerDoc?L.set("doc",f.readerDoc):L.delete("doc"),L.delete("thread"),L.delete("view"),f.tab&&f.tab!=="overview"?L.set("tab",f.tab):L.delete("tab")):f.page==="ontology-graph"||f.page==="workflows"||f.page==="definitions"||f.page==="board"||f.page==="nest-trace"?(ee=f.nestId,me=f.page==="nest-trace"?"trace":((ht=ea(f.page))==null?void 0:ht.path)??null,L.delete("doc"),L.delete("thread"),L.delete("tab"),L.delete("view")):(L.delete("doc"),L.delete("thread"),L.delete("view"),L.delete("tab"));const ge=L.toString(),Je=(f.page==="dashboard"?WE(f.tab):Gy(ee,me))+(ge?`?${ge}`:"")+window.location.hash,Et=window.location.pathname+window.location.search+window.location.hash,et=pv(f);Je!==Et&&(QR(N.current,et)==="push"?window.history.pushState(f,"",Je):window.history.replaceState(f,"",Je)),N.current=et},[f,_.status]),y.useEffect(()=>{const L=ee=>{const me=ee.state;me&&typeof me=="object"&&"page"in me&&(N.current=pv(me),x(me))};return window.addEventListener("popstate",L),()=>window.removeEventListener("popstate",L)},[]);const[xe,ve]=y.useState(null),Ue=ec(f)?xe??f.readerMode??!1:!1;y.useEffect(()=>{ec(f)&&Ld(f.page,Ue)&&S({page:"nest",nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned,readerMode:Ue})},[f,Ue]);const at="nestId"in f?f.nestId:null,pt="nestId"in f?f.isOwner:!1,[lt,vt]=y.useState(null);y.useEffect(()=>{if(vt(null),ve(null),!at)return;let L=!1;return O.fetchQuery(Bt.nest(at)).then(ee=>{var ge;if(L)return;const me=Nf({roles:(ee==null?void 0:ee.roles)??[],permission:(ee==null?void 0:ee.permission)??null,myStewards:(ee==null?void 0:ee.myStewards)??[],isOwner:pt,isAdmin:c,readerMode:!!((ge=ee==null?void 0:ee.nest)!=null&&ge.reader_mode)});vt(me.canEditDocs),ve(me.isReaderView)}).catch(()=>{L||(vt(!1),ve(!1))}),()=>{L=!0}},[at,pt,c]),y.useEffect(()=>{f.page==="workflows"&&lt===!1&&S({page:"nest",nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned})},[f,lt]);const tn=XR(),Dn=y.useMemo(()=>{var ee;const L={label:"Home",go:()=>S({page:"dashboard"})};if(f.page==="dashboard"){const me=zd(f.tab,{isAdmin:c});return tn.length?[L,...tn]:me.id===dc?[{label:me.label}]:[L,{label:me.label}]}if("nestId"in f){const me={label:f.nestName,go:()=>S({page:"nest",nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned,tab:"overview"})};if(tn.length)return[L,me,...tn];const ge=f.page==="nest"?rI[f.tab??"overview"]??"Overview":f.page==="document"?"Document":f.page==="nest-trace"?"Trace":((ee=ea(f.page))==null?void 0:ee.label)??"";return[L,me,{label:ge}]}return f.page==="docs"?[L,{label:"Docs"}]:tn.length?[L,...tn]:[]},[f,S,tn]),pn=y.useMemo(()=>({openNest:(L,ee,me,ge,Oe)=>S({page:"nest",nestId:L,nestName:ee,isOwner:me,isAnonOwned:ge,isArchived:Oe}),openReview:(L,ee,me)=>S({page:"document",nestId:L,nestName:ee,nodeId:me,isOwner:!0,isAnonOwned:!0}),manageKeys:()=>S({page:"dashboard",tab:"api-keys"})}),[S]),rr=y.useCallback(()=>{if(typeof window<"u"&&Zd()){const L=new URLSearchParams(window.location.search);L.delete("nest");const ee=L.toString();window.history.replaceState({},"",Gy(null)+(ee?`?${ee}`:"")+window.location.hash)}!a&&e==="key"&&R({status:"missing"}),S({page:"dashboard"})},[a,e]);y.useEffect(()=>{if(typeof window>"u"||hv)return;const L=new URLSearchParams(window.location.search),ee=L.get("sso_error");if(!ee)return;hv=!0,L.delete("sso_error");const me=L.toString();window.history.replaceState({},"",window.location.pathname+(me?`?${me}`:"")+window.location.hash);const Oe={not_supported:"One-click sign-in isn't available on this community.",missing_ticket:"The sign-in link was incomplete. Try again from PromptOwl.",invalid_ticket:"The sign-in link is invalid or has expired. Try again from PromptOwl.",bad_audience:"This sign-in link was issued for a different community.",ticket_used:"This sign-in link was already used. Start again from PromptOwl.",rate_limited:"Too many sign-in attempts. Wait a moment and try again.",sign_in_restricted:"Sign-in is restricted on this community. Contact an admin.",service_error:"Something went wrong signing you in. Please try again.",disabled:"Single sign-on is turned off on this server.",not_configured:"Single sign-on isn't fully configured. Contact your admin.",discovery_failed:"Couldn't reach the identity provider. Try again, or contact your admin.",provider_error:"Your identity provider declined the sign-in. Try again.",state_mismatch:"The sign-in attempt expired or didn't match this browser. Try again.",exchange_failed:"Sign-in couldn't be completed with the identity provider. Try again.",invalid_token:"The identity provider returned an invalid sign-in token. Try again.",domain_not_allowed:"Your email domain isn't allowed on this server. Contact your admin.",email_not_verified:"Your identity provider reports your email address as unverified. Verify it with your provider, then try again.",not_invited:"No account exists for your email on this server. Ask your admin for an invite."}[ee]??"Sign-in failed. Please try again.";setTimeout(()=>ac.error(Oe),0)},[]),y.useEffect(()=>{we();const L=setInterval(we,900*1e3),ee=()=>{we()};return window.addEventListener("auth:unauthorized",ee),()=>{clearInterval(L),window.removeEventListener("auth:unauthorized",ee)}},[we]);const nt=((ir=o==null?void 0:o.me)==null?void 0:ir.email)??null,Ln=y.useRef(nt);if(y.useEffect(()=>{if(Ln.current===nt)return;const L=Ln.current!==null;Ln.current=nt,L&&x({page:"dashboard"})},[nt]),v)return u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-lg font-medium text-destructive",children:v}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Check that the community server is running."})]})});if(g||e===null||G||_.status==="loading")return u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[u.jsx("img",{src:t??Jd,alt:"",className:"h-10 w-10"}),u.jsx("span",{className:"text-sm font-medium",children:"ContextNest"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading your nests…"})]})});if(I&&!I.valid)return u.jsx(UR,{onActivated:we});const zn=u.jsxs(u.Fragment,{children:[u.jsx(fi,{open:A,onOpenChange:L=>{!L&&!Y&&M(!1)},children:u.jsxs(ao,{className:"sm:max-w-[400px]",children:[u.jsxs(lo,{children:[u.jsxs(co,{className:"flex items-center gap-2",children:[u.jsx($v,{className:"h-4 w-4 text-muted-foreground"}),"Log out?"]}),u.jsx(uo,{children:"You'll be signed out of this browser. Any unsaved edits in other tabs may be lost — save your work first."})]}),u.jsxs(jp,{className:"gap-2",children:[u.jsx(Qe,{variant:"outline",onClick:()=>M(!1),disabled:Y,children:"Cancel"}),u.jsx(Qe,{variant:"destructive",onClick:de,disabled:Y,children:Y?"Logging out...":"Log out"})]})]})}),le&&re&&u.jsx(WR,{nestId:f.page==="nest"||f.page==="document"?f.nestId:void 0,nestName:f.page==="nest"||f.page==="document"?f.nestName:void 0,onClose:()=>he(!1),onSelect:(L,ee)=>{if(he(!1),(f.page==="nest"||f.page==="document")&&ee.kind==="node"&&(ee.nest_id??f.nestId)===f.nestId){S({page:"document",nestId:f.nestId,nestName:f.nestName,nodeId:L,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned});return}Q(ee)}}),J&&u.jsx(qR,{onClose:()=>Z(!1)})]});if(!a&&e==="key"&&_.status!=="ok")return u.jsxs(u.Fragment,{children:[u.jsx(lN,{}),zn]});const wt=f.page==="document",Wt="nestId"in f&&xe!==!0||f.page==="dashboard"||f.page==="docs",br=Wt&&(!pe||X),Sr=f.page==="board"?"max-w-[1800px]":"max-w-6xl",or=Wt?"w-full max-w-none":`${Sr} mx-auto`;return u.jsxs("div",{className:Wt?"flex min-h-screen items-stretch bg-background":"min-h-screen bg-background",children:[Wt&&u.jsxs(u.Fragment,{children:[Wt&&X&&u.jsx("button",{type:"button",className:"fixed inset-0 z-40 bg-black/30 md:hidden","aria-label":"Close sidebar",onClick:()=>oe(!1)}),br&&(()=>{var me,ge;const L=f,ee=Oe=>"nestId"in Oe?Oe:null;return u.jsx("div",{className:X?"fixed inset-y-0 left-0 z-50 w-72 max-w-[85vw] border-r bg-background shadow-xl md:static md:z-auto md:w-64 md:max-w-none md:shadow-none":"hidden w-64 shrink-0 border-r md:block",children:u.jsx("div",{className:"sticky top-0 h-screen max-h-screen",children:u.jsx(ej,{logoUrl:t??Jd,nestId:((me=ee(L))==null?void 0:me.nestId)??null,nodeId:L.page==="document"?L.nodeId:null,activeView:L.page==="nest"?L.tab==="review"?"review":"overview":((ge=ea(L.page))==null?void 0:ge.id)??null,onCollapse:()=>X?oe(!1):ce(!0),onOpenDashboard:()=>S({page:"dashboard"}),dashboardTab:L.page==="dashboard"?zd(L.tab,{isAdmin:c}).id:null,onOpenDashboardTab:Oe=>S({page:"dashboard",tab:Oe}),onOpenNest:Oe=>S({page:"nest",nestId:Oe.nestId,nestName:Oe.nestName,isOwner:Oe.isOwner,isAnonOwned:Oe.isAnonOwned,tab:"documents"}),onOpenView:(Oe,Je)=>S({page:Je.page,nestId:Oe.nestId,nestName:Oe.nestName,isOwner:Oe.isOwner,isAnonOwned:Oe.isAnonOwned,readerMode:Ue,...Je.page==="nest"&&Je.tab?{tab:Je.tab}:{}}),onConnect:()=>H(!0),onOpenDocument:Oe=>{L.page==="document"&&Oe.nestId===L.nestId&&Oe.nodeId===L.nodeId||S({page:"document",nestId:Oe.nestId,nestName:Oe.nestName,nodeId:Oe.nodeId,isOwner:Oe.isOwner,isAnonOwned:Oe.isAnonOwned})},onNewDocument:!("nestId"in L)||L.page==="document"&&L.nodeId==="new"?void 0:Oe=>S({page:"document",nestId:L.nestId,nestName:L.nestName,nodeId:"new",isOwner:L.isOwner,isAnonOwned:L.isAnonOwned,initialFolder:Oe})})})})})()]}),u.jsxs("div",{className:Wt?"flex min-w-0 flex-1 flex-col":"",children:[u.jsxs("header",{className:"contents",children:[u.jsx("div",{className:"sticky top-0 z-40 border-b border-border bg-card",children:u.jsxs("div",{className:`${or} h-16 px-4 flex items-center justify-between`,children:[u.jsxs("div",{className:"flex items-center gap-1",children:[Wt&&u.jsx(Qe,{variant:"ghost",size:"icon",className:`h-8 w-8 shrink-0${br?" md:hidden":""}`,title:"Show sidebar","aria-label":"Show sidebar","data-testid":"nest-sidebar-expand",onClick:()=>{window.matchMedia("(max-width: 767px)").matches?oe(!0):ce(!1)},children:u.jsx(N_,{className:"h-4 w-4"})}),u.jsxs("button",{onClick:()=>S({page:"dashboard"}),className:`flex items-center gap-2 hover:opacity-80${br?" md:hidden":""}`,children:[u.jsx("img",{src:t??Jd,alt:"ContextNest",className:"h-7 w-7 object-contain"}),u.jsx("span",{className:"font-semibold",children:"ContextNest"}),u.jsx(bp,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]}),Wt&&Dn.length>0&&u.jsx("nav",{"aria-label":"Breadcrumb",className:"ml-1 flex min-w-0 items-center gap-1 text-sm","data-testid":"header-breadcrumb",children:Dn.map((L,ee)=>{const me=ee===Dn.length-1;return u.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[ee>0&&u.jsx(Ca,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60","aria-hidden":!0}),me||!L.go?u.jsx("span",{className:me?"truncate text-base font-semibold":"truncate text-muted-foreground","aria-current":me?"page":void 0,children:L.label}):u.jsx("button",{type:"button",onClick:L.go,className:"truncate text-muted-foreground hover:text-foreground",children:L.label})]},ee)})})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[re&&u.jsxs("button",{onClick:()=>he(!0),title:f.page==="dashboard"?"Search nests and documents (⌘K)":"Search this nest (⌘K)",className:"flex items-center gap-2 h-8 pl-2.5 pr-2 rounded-md border border-input bg-background text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors","data-testid":"global-search-trigger",children:[u.jsx(tp,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Search"}),u.jsx("kbd",{className:"ml-1 hidden sm:inline text-[10px] font-mono bg-muted text-muted-foreground px-1 py-0.5 rounded border border-border",children:"⌘K"})]}),e==="open"&&!(o!=null&&o.me)&&u.jsxs("span",{className:"hidden md:inline-flex items-center gap-1.5 text-xs text-amber-700 bg-amber-50 border border-amber-200 px-2 py-1 rounded",children:[u.jsx(qg,{className:"h-3 w-3"}),"Open mode"]}),e==="key"&&!a&&u.jsxs("span",{className:"hidden md:inline-flex items-center gap-1.5 text-xs text-blue-700 bg-blue-50 border border-blue-200 px-2 py-1 rounded",children:[u.jsx(qg,{className:"h-3 w-3"}),"Public read-only"]}),f.page!=="docs"&&u.jsxs(Qe,{variant:"ghost",size:"sm",onClick:()=>S({page:"docs"}),title:"API, MCP & CLI docs for agents",children:[u.jsx(Pv,{className:"h-3.5 w-3.5 mr-1"}),"Docs"]}),o!=null&&o.me?u.jsx(iI,{me:o.me,isAdmin:c,onShortcuts:()=>Z(!0),onAccount:()=>S({page:"dashboard",tab:"account"}),onLogout:D}):u.jsxs(Qe,{variant:"outline",size:"sm",onClick:()=>C(!0),children:[u.jsx(Nc,{className:"h-3.5 w-3.5 mr-1"}),"Login"]})]})]})}),ec(f)&&!Ue&&u.jsx("div",{className:`${or} px-4 py-2 overflow-x-auto flex items-center gap-2${br?" md:hidden":""}`,children:u.jsx(c0,{value:f.page,onValueChange:L=>S({page:L,nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned,readerMode:Ue,isArchived:f.isArchived}),children:u.jsx(Mp,{children:Vb.filter(L=>{const ee=ea(L.page);return!(ee!=null&&ee.visible)||ee.visible({isReadOnly:lt===!1,isReaderView:!!Ue,canEditDocs:lt===!0,workflowPlaneEnabled:d})}).filter(L=>!Ue||!fw(L.page)).map(L=>{const ee=L.icon;return u.jsxs(Vs,{value:L.page,className:"gap-1.5",children:[u.jsx(ee,{className:"h-3.5 w-3.5"}),L.label,L.beta&&u.jsx(eA,{})]},L.page)})})})})]}),u.jsx("main",{className:`${or} min-w-0 overflow-x-clip${Wt?"":" px-4 py-4"}`,children:_.status==="unreachable"?u.jsxs("div",{className:"py-20 text-center",children:[u.jsx("p",{className:"text-lg font-medium",children:"This nest doesn't exist or you don't have access."}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"It may have been deleted, the link may be out of date, or the request may simply have failed."}),u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[u.jsx(Qe,{variant:"outline",onClick:()=>R({status:"loading",nestId:_.nestId}),children:"Try again"}),u.jsx(Qe,{onClick:()=>R({status:"missing"}),children:"Back to dashboard"})]})]}):u.jsx("div",{className:Wt&&!wt?"px-8 py-6":"",children:u.jsxs(y.Suspense,{fallback:u.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:[f.page==="dashboard"&&(()=>{const L=zd(f.tab,{isAdmin:c}).Component;return u.jsx(JR,{value:pn,children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:u.jsx(L,{})})})})(),f.page==="nest"&&u.jsx(X$,{nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned,isArchived:f.isArchived,initialSearch:f.initialSearch,initialTags:f.initialTags,initialFolder:f.initialFolder,initialTab:f.tab,initialDoc:f.readerDoc??null,onReaderDocChange:L=>S({...f,readerDoc:L??void 0}),onManageKeys:()=>S({page:"dashboard",tab:"api-keys"}),onTabChange:L=>S({...f,tab:L}),onBack:rr,onOpenDocument:(L,ee)=>S({page:"document",nestId:f.nestId,nestName:f.nestName,nodeId:L,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned,initialFolder:ee==null?void 0:ee.folder,initialThreadId:ee==null?void 0:ee.thread}),onOpenTrace:()=>S({page:"nest-trace",nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned})}),f.page==="nest-trace"&&u.jsx(nI,{nestId:f.nestId,onBack:()=>S({page:"nest",nestId:f.nestId,nestName:f.nestName,isOwner:f.isOwner,isAnonOwned:f.isAnonOwned})}),f.page==="document"&&(()=>{const L=f,ee=ge=>S({page:"document",...ge}),me=ge=>S({page:"nest",nestId:L.nestId,nestName:L.nestName,isOwner:L.isOwner,isAnonOwned:L.isAnonOwned,...ge});return u.jsx(eI,{sidebarCollapsed:pe,onToggleSidebar:()=>{window.matchMedia("(max-width: 767px)").matches?oe(!0):ce(!1)},nestId:L.nestId,nestName:L.nestName,nodeId:L.nodeId,initialFolder:L.initialFolder,initialThreadId:L.initialThreadId,isOwner:L.isOwner,breadcrumb:L.breadcrumb,onBack:()=>{const ge=L.breadcrumb??[];if(ge.length>0){const Oe=ge[ge.length-1];ee({...Oe,breadcrumb:ge.slice(0,-1)});return}me({tab:"documents"})},onJumpBreadcrumb:ge=>{const Oe=L.breadcrumb??[],Je=Oe[ge];Je&&ee({...Je,breadcrumb:Oe.slice(0,ge)})},onSaved:()=>me(),onNavigateDocument:(ge,Oe,Je)=>{const Et=L.breadcrumb??[],et=ge===L.nestId;if(ge===L.nestId&&Oe===L.nodeId)return;const ht=Et.findIndex(Fn=>Fn.nestId===ge&&Fn.nodeId===Oe);if(ht!==-1){ee({nestId:ge,nestName:et?L.nestName:"Document",nodeId:Oe,isOwner:et?L.isOwner:!1,isAnonOwned:et?L.isAnonOwned:!1,breadcrumb:Et.slice(0,ht)});return}const ct=L.nodeId!=="new"?[...Et,{nestId:L.nestId,nestName:L.nestName,nodeId:L.nodeId,title:(Je==null?void 0:Je.trim())||"Untitled",isOwner:L.isOwner,isAnonOwned:L.isAnonOwned}]:Et;ee({nestId:ge,nestName:et?L.nestName:"Document",nodeId:Oe,isOwner:et?L.isOwner:!1,isAnonOwned:et?L.isAnonOwned:!1,breadcrumb:ct})},onTagClick:ge=>me({initialTags:[ge]}),onOpenNest:()=>me(),onOpenFolder:ge=>me({initialFolder:ge}),onCreateDocument:(ge,Oe)=>ee({nestId:ge,nestName:L.nestName,nodeId:"new",isOwner:L.isOwner,isAnonOwned:L.isAnonOwned,initialTitle:Oe}),initialTitle:L.initialTitle},`${L.nestId}/${L.nodeId}/${L.initialFolder??""}`)})(),ec(f)&&f.page!=="nest"&&(()=>{const L=ea(f.page);if(!L||Ld(f.page,Ue))return null;const ee=f,me={nestId:ee.nestId,nestName:ee.nestName,isOwner:ee.isOwner,isAnonOwned:ee.isAnonOwned,isArchived:ee.isArchived,openDocument:ge=>S({page:"document",nestId:ee.nestId,nestName:ee.nestName,nodeId:ge,isOwner:ee.isOwner,isAnonOwned:ee.isAnonOwned}),openNest:ge=>S({page:"nest",nestId:ee.nestId,nestName:ee.nestName,isOwner:ee.isOwner,isAnonOwned:ee.isAnonOwned,...ge!=null&&ge.tags?{initialTags:ge.tags}:{}}),leaveNest:rr};return u.jsx(ZR,{value:me,children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:u.jsx(L.Component,{})})})})(),f.page==="docs"&&u.jsx(tI,{onOpenGuide:()=>S({page:"dashboard",tab:"guide"})})]})})}),f.page!=="document"&&u.jsxs("footer",{className:`${or} px-4 py-4 text-xs text-muted-foreground text-center`,children:["ContextNest Community",r?` v${r}`:""]})]}),q&&"nestId"in f&&u.jsx(DR,{isOpen:!0,onClose:()=>H(!1),nestId:f.nestId,nestName:f.nestName,onManageKeys:()=>{H(!1),S({page:"dashboard",tab:"api-keys"})}}),k&&u.jsx(FR,{existingAdmin:((kr=o==null?void 0:o.admin)==null?void 0:kr.email)||null,onClose:()=>C(!1)}),zn]})}function iI({me:e,isAdmin:t,onShortcuts:r,onAccount:o,onLogout:a}){var p;const c=((p=e.name)==null?void 0:p.trim())||e.email,d=c.charAt(0);return u.jsxs(q$,{modal:!1,children:[u.jsx(K$,{asChild:!0,children:u.jsxs(Qe,{variant:"ghost",size:"sm",className:"group h-9 gap-2 px-2","data-testid":"user-menu-trigger",children:[u.jsx(Uf,{className:"h-[1.8rem] w-[1.8rem] rounded-sm shrink-0",children:u.jsx(Vf,{className:"rounded-sm",children:d})}),u.jsx("span",{className:"hidden sm:inline max-w-[140px] truncate text-sm font-medium",children:c}),u.jsx(li,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),u.jsxs(Ub,{align:"end",className:"min-w-56",children:[u.jsxs("div",{className:"flex items-center gap-2 p-2",children:[u.jsx(Uf,{className:"h-8 w-8 rounded-sm shrink-0",children:u.jsx(Vf,{className:"rounded-sm",children:d})}),u.jsxs("div",{className:"grid gap-0.5 leading-none min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"font-semibold truncate",children:c}),t&&u.jsxs(bp,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[u.jsx(Nc,{className:"h-2.5 w-2.5"}),"Admin"]})]}),u.jsx("div",{className:"text-sm text-muted-foreground truncate",children:e.email})]})]}),u.jsx(qf,{}),u.jsxs(ic,{onSelect:o,className:"cursor-pointer","data-testid":"user-menu-account",children:[u.jsx(Dv,{className:"h-3.5 w-3.5 mr-2"}),"Account"]}),u.jsxs(ic,{onSelect:r,className:"cursor-pointer",children:[u.jsx(d_,{className:"h-3.5 w-3.5 mr-2"}),"Keyboard shortcuts"]}),u.jsx(qf,{}),u.jsxs(ic,{onSelect:a,className:"cursor-pointer text-red-600 focus:text-red-700","data-testid":"user-menu-logout",children:[u.jsx($v,{className:"h-3.5 w-3.5 mr-2"}),"Logout"]})]})]})}class aI extends y.Component{constructor(){super(...arguments);Rg(this,"state",{error:null,info:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,o){console.error("[ui] render crash:",r,o.componentStack),this.setState({info:o})}render(){const{error:r,info:o}=this.state;return r?u.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:u.jsxs("div",{className:"max-w-2xl w-full space-y-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold text-destructive",children:"Something broke while rendering this page"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"The error below was caught by the app instead of leaving a blank screen. Copy it when reporting the problem."})]}),u.jsx("pre",{className:"text-xs bg-muted rounded-md p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:r.message}),(o==null?void 0:o.componentStack)&&u.jsxs("details",{className:"text-xs",children:[u.jsx("summary",{className:"cursor-pointer text-muted-foreground",children:"Component stack"}),u.jsx("pre",{className:"mt-2 bg-muted rounded-md p-3 overflow-auto max-h-60 whitespace-pre-wrap",children:o.componentStack})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{type:"button",onClick:()=>this.setState({error:null,info:null}),className:"px-3 py-1.5 rounded-md border text-sm hover:bg-muted",children:"Try again"}),u.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"px-3 py-1.5 rounded-md border text-sm hover:bg-muted",children:"Reload"})]})]})}):this.props.children}}function lI({children:e}){const[t]=y.useState(()=>{const r=BN();return qN(r),r});return u.jsx(IN,{client:t,children:e})}KS.createRoot(document.getElementById("root")).render(u.jsx(ie.StrictMode,{children:u.jsx(aI,{children:u.jsx(lI,{children:u.jsxs(aN,{children:[u.jsx(YR,{children:u.jsx(oI,{})}),u.jsx(xk,{richColors:!0,position:"bottom-right"})]})})})}));export{jc as $,Df as A,Qe as B,Cc as C,fi as D,Rv as E,Xf as F,uo as G,jp as H,yc as I,fa as J,tc as K,ci as L,qD as M,HD as N,Na as O,Mp as P,Vs as Q,Vo as R,Lr as S,c0 as T,Lv as U,zx as V,KN as W,x4 as X,b4 as Y,K4 as Z,QN as _,Lf as a,YC as a$,A4 as a0,Of as a1,Ak as a2,dI as a3,Q_ as a4,KD as a5,B4 as a6,fI as a7,z as a8,n_ as a9,cD as aA,W4 as aB,Gy as aC,HI as aD,Pv as aE,j_ as aF,Qg as aG,dC as aH,Nf as aI,YN as aJ,P4 as aK,T4 as aL,R4 as aM,kn as aN,hw as aO,Iv as aP,j4 as aQ,O4 as aR,jv as aS,H4 as aT,VI as aU,BI as aV,KC as aW,qg as aX,JC as aY,ZC as aZ,pC as a_,$k as aa,m_ as ab,M4 as ac,ZI as ad,HN as ae,N_ as af,O_ as ag,q$ as ah,K$ as ai,li as aj,Ub as ak,Y$ as al,ic as am,qf as an,Yf as ao,WI as ap,GI as aq,tD as ar,iD as as,ui as at,dD as au,uD as av,dp as aw,lD as ax,k4 as ay,Yk as az,SD as b,tM as b$,XC as b0,tN as b1,v4 as b2,t4 as b3,n4 as b4,e4 as b5,c4 as b6,l4 as b7,s4 as b8,r4 as b9,e_ as bA,$4 as bB,II as bC,qI as bD,DR as bE,JI as bF,rD as bG,Jf as bH,_t as bI,aD as bJ,UI as bK,YI as bL,eD as bM,XI as bN,sD as bO,oD as bP,FI as bQ,KI as bR,nc as bS,wC as bT,_c as bU,oA as bV,iA as bW,ie as bX,Ev as bY,rM as bZ,nM as b_,h4 as ba,m4 as bb,eN as bc,la as bd,i4 as be,nN as bf,d4 as bg,f4 as bh,u4 as bi,a4 as bj,JD as bk,YD as bl,XD as bm,ZD as bn,y4 as bo,g4 as bp,U_ as bq,c_ as br,Nc as bs,jI as bt,N4 as bu,E4 as bv,tp as bw,Ca as bx,vC as by,wE as bz,Ae as c,Ze as c$,uv as c0,sM as c1,Q4 as c2,oM as c3,G4 as c4,aM as c5,Zf as c6,Qf as c7,ep as c8,Tv as c9,DI as cA,w4 as cB,Kg as cC,dw as cD,MI as cE,LI as cF,zI as cG,RI as cH,$I as cI,C4 as cJ,AI as cK,aC as cL,zT as cM,I4 as cN,FT as cO,Ct as cP,D4 as cQ,Nx as cR,De as cS,Ex as cT,Ox as cU,UT as cV,Cx as cW,Ns as cX,L4 as cY,eR as cZ,ro as c_,SI as ca,Dv as cb,Uf as cc,Vf as cd,bI as ce,S4 as cf,V4 as cg,PI as ch,EI as ci,OI as cj,q4 as ck,L_ as cl,Mv as cm,eA as cn,_4 as co,o_ as cp,o4 as cq,QD as cr,GD as cs,fD as ct,F4 as cu,jR as cv,U4 as cw,v_ as cx,uI as cy,Tp as cz,kD as d,Cs as d0,z4 as d1,zr as d2,Ea as d3,tR as d4,Rx as d5,Rp as d6,vr as d7,Jn as d8,X_ as d9,ID as dA,zD as dB,FD as dC,_I as dD,kI as dE,A_ as dF,Vx as dG,lx as dH,Xw as dI,Np as dJ,_p as dK,xD as dL,OD as dM,PD as dN,jD as dO,TI as dP,nD as dQ,_D as dR,CD as dS,ND as dT,ED as dU,TD as dV,RD as dW,AD as dX,pI as da,wI as db,vI as dc,xI as dd,hI as de,NI as df,CI as dg,gI as dh,yI as di,mI as dj,EM as dk,OM as dl,z0 as dm,Cp as dn,kp as dp,PM as dq,jM as dr,BD as ds,UD as dt,WD as du,VD as dv,DD as dw,MD as dx,$D as dy,LD as dz,bp as e,ac as f,bD as g,RC as h,Bt as i,u as j,pD as k,QI as l,mD as m,gD as n,yD as o,vD as p,wD as q,y as r,Le as s,p4 as t,Oc as u,sf as v,hD as w,ao as x,lo as y,co as z};