@promptowl/contextnest-community 1.26.0 → 1.27.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 (94) hide show
  1. package/API.md +34 -1
  2. package/CONFIGURATION.md +32 -1
  3. package/dist/{chunk-TRSGPS27.js → chunk-H3W72HN3.js} +28 -0
  4. package/dist/{chunk-DGPTJXIV.js → chunk-MB52DWWP.js} +4 -4
  5. package/dist/{chunk-IEAWRHMV.js → chunk-NFFUZF2B.js} +23 -2
  6. package/dist/{chunk-PICUHQEM.js → chunk-O3JEI33N.js} +2 -2
  7. package/dist/{chunk-SWA5M5XX.js → chunk-QMQDWRHN.js} +128 -22
  8. package/dist/{chunk-I5EDEZBQ.js → chunk-RXCVXG34.js} +1 -1
  9. package/dist/{chunk-2QOJE7A5.js → chunk-SE5U4J4T.js} +4 -4
  10. package/dist/{chunk-RPGFHESR.js → chunk-VHEMGQ3I.js} +1 -1
  11. package/dist/{chunk-M6PGYMBD.js → chunk-VRLAP4HB.js} +33 -15
  12. package/dist/{engine-QNMFDIBV.js → engine-HLYQLP5T.js} +3 -3
  13. package/dist/{external-edit-service-4MEGPT4D.js → external-edit-service-3DFQ4EZZ.js} +4 -4
  14. package/dist/{grants-service-24GLUBY4.js → grants-service-WICV4Y2J.js} +2 -2
  15. package/dist/index.js +804 -304
  16. package/dist/{invited-user-AM6A3WGO.js → invited-user-XEBX6BM4.js} +3 -3
  17. package/dist/{review-service-2EWN7WWO.js → review-service-GB43UQVH.js} +7 -7
  18. package/dist/{stewardship-service-TDZUC2Q6.js → stewardship-service-KDBPWRZI.js} +4 -4
  19. package/dist/{version-service-C3JTZLJH.js → version-service-JYHFPSYP.js} +8 -4
  20. package/dist/web3/assets/{ActivityTracePage-DzwWIjjx.js → ActivityTracePage-CkRoyIc-.js} +1 -1
  21. package/dist/web3/assets/AgentDocsPage-BTRXmliv.js +1 -0
  22. package/dist/web3/assets/CollaboratorManager-CqJIkvs-.js +1 -0
  23. package/dist/web3/assets/CollaboratorsTab-JcO1P-qm.js +1 -0
  24. package/dist/web3/assets/DocumentEditor-D1GLeeEP.js +36 -0
  25. package/dist/web3/assets/DocumentsTab-BAgSxTX1.js +6 -0
  26. package/dist/web3/assets/ExternalEditsTab-DuuTXZap.js +1 -0
  27. package/dist/web3/assets/{MarkdownEditor-CKh4WSn-.js → MarkdownEditor-BELFww9q.js} +116 -126
  28. package/dist/web3/assets/{NestPageHeader-Cizo8nUi.js → NestPageHeader-Bbje2ncY.js} +1 -1
  29. package/dist/web3/assets/NestView-D4OMXPQ7.js +73 -0
  30. package/dist/web3/assets/OverviewTab-FIDGjR3Q.js +6 -0
  31. package/dist/web3/assets/{PersonCombobox-BKI7dff4.js → PersonCombobox-D52m_jhc.js} +1 -1
  32. package/dist/web3/assets/{ReviewActions-CS8JXgXF.js → ReviewActions-DYqBcWlv.js} +2 -2
  33. package/dist/web3/assets/ReviewTab-DoxfygOb.js +1 -0
  34. package/dist/web3/assets/StewardsTab-CFsYjbEn.js +1 -0
  35. package/dist/web3/assets/{SubmitForReviewModal-Biq3m79i.js → SubmitForReviewModal-AW2OLNAE.js} +1 -1
  36. package/dist/web3/assets/{alert-dialog-BvF3NFr7.js → alert-dialog-p-fBLSWx.js} +2 -2
  37. package/dist/web3/assets/{arrow-left-CWIsv-sG.js → arrow-left-CiErCCTG.js} +1 -1
  38. package/dist/web3/assets/{backlinks-Cqcn7n1J.js → backlinks-DaVSYvhV.js} +2 -2
  39. package/dist/web3/assets/{boxes-ClbgQqG2.js → boxes-VWrCCMzW.js} +1 -1
  40. package/dist/web3/assets/{chevron-left-CK_ZPFm9.js → chevron-left-CsD8gZwL.js} +1 -1
  41. package/dist/web3/assets/{circle-check-Bw_aTXiH.js → circle-check-BBCXd9LI.js} +1 -1
  42. package/dist/web3/assets/{circle-x-DkIG68H7.js → circle-x-C9LsnORQ.js} +1 -1
  43. package/dist/web3/assets/{code-xml-BlR7EN6l.js → code-xml-BaoV7HiQ.js} +1 -1
  44. package/dist/web3/assets/{corner-down-right-DSVxK3tf.js → corner-down-right-DgiTXrtw.js} +1 -1
  45. package/dist/web3/assets/{count-skeleton-DToLM74B.js → count-skeleton-CnEE4uF-.js} +1 -1
  46. package/dist/web3/assets/{earth-BXhVPvCR.js → earth-BmMbVt9k.js} +1 -1
  47. package/dist/web3/assets/{file-exclamation-point-BevGZgtj.js → file-exclamation-point-qJeca9-A.js} +1 -1
  48. package/dist/web3/assets/{folder-input-m8UBV4fA.js → folder-input-D7R93LJ6.js} +1 -1
  49. package/dist/web3/assets/index-DNmWTxN7.css +1 -0
  50. package/dist/web3/assets/index-DvuUIUP6.js +451 -0
  51. package/dist/web3/assets/{page-DzKwP5Ds.js → page-BJQuaTRW.js} +2 -2
  52. package/dist/web3/assets/{page-B6pkc9cd.js → page-Bb8xGOPQ.js} +2 -2
  53. package/dist/web3/assets/{page-Deq6IKiN.js → page-BtM-qDzr.js} +2 -2
  54. package/dist/web3/assets/{page-DPY01SOj.js → page-Bxd0EG25.js} +1 -1
  55. package/dist/web3/assets/page-C3QCO6IR.js +1 -0
  56. package/dist/web3/assets/{page-CptuAPJc.js → page-CfoR0khy.js} +2 -2
  57. package/dist/web3/assets/page-D7Zr5tAI.js +1 -0
  58. package/dist/web3/assets/{page-Dwbp4Seu.js → page-DATSlHCW.js} +2 -2
  59. package/dist/web3/assets/page-DTjPQizZ.js +45 -0
  60. package/dist/web3/assets/{page-Bgy9Ng9p.js → page-DspptlWr.js} +1 -1
  61. package/dist/web3/assets/{page-Dh57L0RG.js → page-I6vAFJOj.js} +4 -4
  62. package/dist/web3/assets/page-QxI4Ud2s.js +9 -0
  63. package/dist/web3/assets/{page-BJrFCKXB.js → page-YcNNg-dX.js} +1 -1
  64. package/dist/web3/assets/page-kM7eO5Kj.js +1 -0
  65. package/dist/web3/assets/{page-title-DVq4qvMR.js → page-title-Dn5jANiU.js} +1 -1
  66. package/dist/web3/assets/{play-CXhS6Pgq.js → play-B2k_Ix-L.js} +1 -1
  67. package/dist/web3/assets/{send-DdfwnIrj.js → send-DPNxv3As.js} +1 -1
  68. package/dist/web3/assets/{settings-DKX0Q4gO.js → settings-DZjq-OQA.js} +1 -1
  69. package/dist/web3/assets/{share-2-CxmXRt58.js → share-2-C-OnE2ru.js} +1 -1
  70. package/dist/web3/assets/{tag-DeYC_mRv.js → tag-CwJl7FdI.js} +1 -1
  71. package/dist/web3/assets/{trash-2-B0HyPTnI.js → trash-2-aljmIff4.js} +1 -1
  72. package/dist/web3/assets/{user-plus-Ckm_Isyc.js → user-plus-DPerZexX.js} +1 -1
  73. package/dist/web3/assets/{zap-D2ifcnYb.js → zap-CHZtiN7P.js} +1 -1
  74. package/dist/web3/index.html +2 -2
  75. package/package.json +6 -2
  76. package/dist/web3/assets/AgentDocsPage-ixP2UdAE.js +0 -1
  77. package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +0 -1
  78. package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +0 -1
  79. package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +0 -36
  80. package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +0 -6
  81. package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +0 -1
  82. package/dist/web3/assets/NestView-EW-sraEb.js +0 -73
  83. package/dist/web3/assets/OverviewTab-CjidsMX_.js +0 -6
  84. package/dist/web3/assets/ReviewTab-CwVrXzw5.js +0 -1
  85. package/dist/web3/assets/StewardsTab-C-iP6gnh.js +0 -1
  86. package/dist/web3/assets/index-BOVYgMvj.js +0 -29
  87. package/dist/web3/assets/index-DVnaYqj9.css +0 -1
  88. package/dist/web3/assets/index-WYDmEOfO.js +0 -404
  89. package/dist/web3/assets/page-C2zoxumw.js +0 -1
  90. package/dist/web3/assets/page-CJWO06dN.js +0 -1
  91. package/dist/web3/assets/page-Dea2SblF.js +0 -9
  92. package/dist/web3/assets/page-Dfjg8p7Z.js +0 -1
  93. package/dist/web3/assets/page-YxjrE5b5.js +0 -45
  94. package/dist/web3/assets/x-mNtADYHc.js +0 -6
@@ -1,404 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/page-CJWO06dN.js","assets/NestPageHeader-Cizo8nUi.js","assets/arrow-left-CWIsv-sG.js","assets/folder-target-CUSWqImF.js","assets/x-mNtADYHc.js","assets/zap-D2ifcnYb.js","assets/page-B6pkc9cd.js","assets/trash-2-B0HyPTnI.js","assets/page-DzKwP5Ds.js","assets/tag-DeYC_mRv.js","assets/page-Dh57L0RG.js","assets/MarkdownEditor-CKh4WSn-.js","assets/index-BOVYgMvj.js","assets/MarkdownEditor-ndtIx5x0.css","assets/NestView-EW-sraEb.js","assets/chevron-left-CK_ZPFm9.js","assets/alert-dialog-BvF3NFr7.js","assets/count-skeleton-DToLM74B.js","assets/folder-input-m8UBV4fA.js","assets/PersonCombobox-BKI7dff4.js","assets/user-plus-Ckm_Isyc.js","assets/ReviewActions-CS8JXgXF.js","assets/circle-check-Bw_aTXiH.js","assets/circle-x-DkIG68H7.js","assets/settings-DKX0Q4gO.js","assets/play-CXhS6Pgq.js","assets/corner-down-right-DSVxK3tf.js","assets/page-Bgy9Ng9p.js","assets/page-title-DVq4qvMR.js","assets/page-CptuAPJc.js","assets/boxes-ClbgQqG2.js","assets/page-Dwbp4Seu.js","assets/page-DPY01SOj.js","assets/SubmitForReviewModal-Biq3m79i.js","assets/send-DdfwnIrj.js","assets/page-BJrFCKXB.js","assets/page-YxjrE5b5.js","assets/earth-BXhVPvCR.js","assets/page-Dea2SblF.js","assets/page-Deq6IKiN.js","assets/page-Dfjg8p7Z.js","assets/page-C2zoxumw.js","assets/ActivityTracePage-DzwWIjjx.js","assets/client-attribution-BraarYaP.js","assets/DocumentEditor-C2CP2fiE.js","assets/CollaboratorManager-C9VAXZ0h.js","assets/share-2-CxmXRt58.js","assets/backlinks-Cqcn7n1J.js","assets/code-xml-BlR7EN6l.js","assets/file-exclamation-point-BevGZgtj.js","assets/AgentDocsPage-ixP2UdAE.js"])))=>i.map(i=>d[i]);
2
- var gC=Object.defineProperty;var zy=e=>{throw TypeError(e)};var yC=(e,t,n)=>t in e?gC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fy=(e,t,n)=>yC(e,typeof t!="symbol"?t+"":t,n),bf=(e,t,n)=>t.has(e)||zy("Cannot "+n);var O=(e,t,n)=>(bf(e,t,"read from private field"),n?n.call(e):t.get(e)),Pe=(e,t,n)=>t.has(e)?zy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ve=(e,t,n,s)=>(bf(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),Be=(e,t,n)=>(bf(e,t,"access private method"),n);var fc=(e,t,n,s)=>({set _(i){ve(e,t,i,n)},get _(){return O(e,t,s)}});function vC(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(s,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>s[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var J4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sf={exports:{}},wa={},kf={exports:{}},We={};/**
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 Uy;function wC(){if(Uy)return We;Uy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=p&&R[p]||R["@@iterator"],typeof R=="function"?R:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function C(R,A,ee){this.props=R,this.context=A,this.refs=S,this.updater=ee||b}C.prototype.isReactComponent={},C.prototype.setState=function(R,A){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,A,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function _(){}_.prototype=C.prototype;function E(R,A,ee){this.props=R,this.context=A,this.refs=S,this.updater=ee||b}var T=E.prototype=new _;T.constructor=E,N(T,C.prototype),T.isPureReactComponent=!0;var j=Array.isArray,q=Object.prototype.hasOwnProperty,V={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function $(R,A,ee){var Y,L={},ne=null,X=null;if(A!=null)for(Y in A.ref!==void 0&&(X=A.ref),A.key!==void 0&&(ne=""+A.key),A)q.call(A,Y)&&!D.hasOwnProperty(Y)&&(L[Y]=A[Y]);var oe=arguments.length-2;if(oe===1)L.children=ee;else if(1<oe){for(var ue=Array(oe),Te=0;Te<oe;Te++)ue[Te]=arguments[Te+2];L.children=ue}if(R&&R.defaultProps)for(Y in oe=R.defaultProps,oe)L[Y]===void 0&&(L[Y]=oe[Y]);return{$$typeof:e,type:R,key:ne,ref:X,props:L,_owner:V.current}}function F(R,A){return{$$typeof:e,type:R.type,key:A,ref:R.ref,props:R.props,_owner:R._owner}}function I(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function re(R){var A={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ee){return A[ee]})}var fe=/\/+/g;function de(R,A){return typeof R=="object"&&R!==null&&R.key!=null?re(""+R.key):A.toString(36)}function ge(R,A,ee,Y,L){var ne=typeof R;(ne==="undefined"||ne==="boolean")&&(R=null);var X=!1;if(R===null)X=!0;else switch(ne){case"string":case"number":X=!0;break;case"object":switch(R.$$typeof){case e:case t:X=!0}}if(X)return X=R,L=L(X),R=Y===""?"."+de(X,0):Y,j(L)?(ee="",R!=null&&(ee=R.replace(fe,"$&/")+"/"),ge(L,A,ee,"",function(Te){return Te})):L!=null&&(I(L)&&(L=F(L,ee+(!L.key||X&&X.key===L.key?"":(""+L.key).replace(fe,"$&/")+"/")+R)),A.push(L)),1;if(X=0,Y=Y===""?".":Y+":",j(R))for(var oe=0;oe<R.length;oe++){ne=R[oe];var ue=Y+de(ne,oe);X+=ge(ne,A,ee,ue,L)}else if(ue=x(R),typeof ue=="function")for(R=ue.call(R),oe=0;!(ne=R.next()).done;)ne=ne.value,ue=Y+de(ne,oe++),X+=ge(ne,A,ee,ue,L);else if(ne==="object")throw A=String(R),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.");return X}function ce(R,A,ee){if(R==null)return R;var Y=[],L=0;return ge(R,Y,"","",function(ne){return A.call(ee,ne,L++)}),Y}function te(R){if(R._status===-1){var A=R._result;A=A(),A.then(function(ee){(R._status===0||R._status===-1)&&(R._status=1,R._result=ee)},function(ee){(R._status===0||R._status===-1)&&(R._status=2,R._result=ee)}),R._status===-1&&(R._status=0,R._result=A)}if(R._status===1)return R._result.default;throw R._result}var ie={current:null},G={transition:null},Z={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:G,ReactCurrentOwner:V};function U(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:ce,forEach:function(R,A,ee){ce(R,function(){A.apply(this,arguments)},ee)},count:function(R){var A=0;return ce(R,function(){A++}),A},toArray:function(R){return ce(R,function(A){return A})||[]},only:function(R){if(!I(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},We.Component=C,We.Fragment=n,We.Profiler=i,We.PureComponent=E,We.StrictMode=s,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,We.act=U,We.cloneElement=function(R,A,ee){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var Y=N({},R.props),L=R.key,ne=R.ref,X=R._owner;if(A!=null){if(A.ref!==void 0&&(ne=A.ref,X=V.current),A.key!==void 0&&(L=""+A.key),R.type&&R.type.defaultProps)var oe=R.type.defaultProps;for(ue in A)q.call(A,ue)&&!D.hasOwnProperty(ue)&&(Y[ue]=A[ue]===void 0&&oe!==void 0?oe[ue]:A[ue])}var ue=arguments.length-2;if(ue===1)Y.children=ee;else if(1<ue){oe=Array(ue);for(var Te=0;Te<ue;Te++)oe[Te]=arguments[Te+2];Y.children=oe}return{$$typeof:e,type:R.type,key:L,ref:ne,props:Y,_owner:X}},We.createContext=function(R){return R={$$typeof:d,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:l,_context:R},R.Consumer=R},We.createElement=$,We.createFactory=function(R){var A=$.bind(null,R);return A.type=R,A},We.createRef=function(){return{current:null}},We.forwardRef=function(R){return{$$typeof:f,render:R}},We.isValidElement=I,We.lazy=function(R){return{$$typeof:v,_payload:{_status:-1,_result:R},_init:te}},We.memo=function(R,A){return{$$typeof:y,type:R,compare:A===void 0?null:A}},We.startTransition=function(R){var A=G.transition;G.transition={};try{R()}finally{G.transition=A}},We.unstable_act=U,We.useCallback=function(R,A){return ie.current.useCallback(R,A)},We.useContext=function(R){return ie.current.useContext(R)},We.useDebugValue=function(){},We.useDeferredValue=function(R){return ie.current.useDeferredValue(R)},We.useEffect=function(R,A){return ie.current.useEffect(R,A)},We.useId=function(){return ie.current.useId()},We.useImperativeHandle=function(R,A,ee){return ie.current.useImperativeHandle(R,A,ee)},We.useInsertionEffect=function(R,A){return ie.current.useInsertionEffect(R,A)},We.useLayoutEffect=function(R,A){return ie.current.useLayoutEffect(R,A)},We.useMemo=function(R,A){return ie.current.useMemo(R,A)},We.useReducer=function(R,A,ee){return ie.current.useReducer(R,A,ee)},We.useRef=function(R){return ie.current.useRef(R)},We.useState=function(R){return ie.current.useState(R)},We.useSyncExternalStore=function(R,A,ee){return ie.current.useSyncExternalStore(R,A,ee)},We.useTransition=function(){return ie.current.useTransition()},We.version="18.3.1",We}var By;function ou(){return By||(By=1,kf.exports=wC()),kf.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 Vy;function xC(){if(Vy)return wa;Vy=1;var e=ou(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d(f,g,y){var v,p={},x=null,b=null;y!==void 0&&(x=""+y),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(b=g.ref);for(v in g)s.call(g,v)&&!l.hasOwnProperty(v)&&(p[v]=g[v]);if(f&&f.defaultProps)for(v in g=f.defaultProps,g)p[v]===void 0&&(p[v]=g[v]);return{$$typeof:t,type:f,key:x,ref:b,props:p,_owner:i.current}}return wa.Fragment=n,wa.jsx=d,wa.jsxs=d,wa}var Hy;function bC(){return Hy||(Hy=1,Sf.exports=xC()),Sf.exports}var c=bC(),m=ou();const me=Gp(m),Qp=vC({__proto__:null,default:me},[m]);var pc={},_f={exports:{}},pn={},Cf={exports:{}},Nf={};/**
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 Wy;function SC(){return Wy||(Wy=1,(function(e){function t(G,Z){var U=G.length;G.push(Z);e:for(;0<U;){var R=U-1>>>1,A=G[R];if(0<i(A,Z))G[R]=Z,G[U]=A,U=R;else break e}}function n(G){return G.length===0?null:G[0]}function s(G){if(G.length===0)return null;var Z=G[0],U=G.pop();if(U!==Z){G[0]=U;e:for(var R=0,A=G.length,ee=A>>>1;R<ee;){var Y=2*(R+1)-1,L=G[Y],ne=Y+1,X=G[ne];if(0>i(L,U))ne<A&&0>i(X,L)?(G[R]=X,G[ne]=U,R=ne):(G[R]=L,G[Y]=U,R=Y);else if(ne<A&&0>i(X,U))G[R]=X,G[ne]=U,R=ne;else break e}}return Z}function i(G,Z){var U=G.sortIndex-Z.sortIndex;return U!==0?U:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var g=[],y=[],v=1,p=null,x=3,b=!1,N=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var Z=n(y);Z!==null;){if(Z.callback===null)s(y);else if(Z.startTime<=G)s(y),Z.sortIndex=Z.expirationTime,t(g,Z);else break;Z=n(y)}}function j(G){if(S=!1,T(G),!N)if(n(g)!==null)N=!0,te(q);else{var Z=n(y);Z!==null&&ie(j,Z.startTime-G)}}function q(G,Z){N=!1,S&&(S=!1,_($),$=-1),b=!0;var U=x;try{for(T(Z),p=n(g);p!==null&&(!(p.expirationTime>Z)||G&&!re());){var R=p.callback;if(typeof R=="function"){p.callback=null,x=p.priorityLevel;var A=R(p.expirationTime<=Z);Z=e.unstable_now(),typeof A=="function"?p.callback=A:p===n(g)&&s(g),T(Z)}else s(g);p=n(g)}if(p!==null)var ee=!0;else{var Y=n(y);Y!==null&&ie(j,Y.startTime-Z),ee=!1}return ee}finally{p=null,x=U,b=!1}}var V=!1,D=null,$=-1,F=5,I=-1;function re(){return!(e.unstable_now()-I<F)}function fe(){if(D!==null){var G=e.unstable_now();I=G;var Z=!0;try{Z=D(!0,G)}finally{Z?de():(V=!1,D=null)}}else V=!1}var de;if(typeof E=="function")de=function(){E(fe)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,ce=ge.port2;ge.port1.onmessage=fe,de=function(){ce.postMessage(null)}}else de=function(){C(fe,0)};function te(G){D=G,V||(V=!0,de())}function ie(G,Z){$=C(function(){G(e.unstable_now())},Z)}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(G){G.callback=null},e.unstable_continueExecution=function(){N||b||(N=!0,te(q))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(g)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var U=x;x=Z;try{return G()}finally{x=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var U=x;x=G;try{return Z()}finally{x=U}},e.unstable_scheduleCallback=function(G,Z,U){var R=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?R+U:R):U=R,G){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=U+A,G={id:v++,callback:Z,priorityLevel:G,startTime:U,expirationTime:A,sortIndex:-1},U>R?(G.sortIndex=U,t(y,G),n(g)===null&&G===n(y)&&(S?(_($),$=-1):S=!0,ie(j,U-R))):(G.sortIndex=A,t(g,G),N||b||(N=!0,te(q))),G},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(G){var Z=x;return function(){var U=x;x=Z;try{return G.apply(this,arguments)}finally{x=U}}}})(Nf)),Nf}var qy;function kC(){return qy||(qy=1,Cf.exports=SC()),Cf.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 Ky;function _C(){if(Ky)return pn;Ky=1;var e=ou(),t=kC();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,i={};function l(r,o){d(r,o),d(r+"Capture",o)}function d(r,o){for(i[r]=o,r=0;r<o.length;r++)s.add(o[r])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,y=/^[: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]*$/,v={},p={};function x(r){return g.call(p,r)?!0:g.call(v,r)?!1:y.test(r)?p[r]=!0:(v[r]=!0,!1)}function b(r,o,a,u){if(a!==null&&a.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return u?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function N(r,o,a,u){if(o===null||typeof o>"u"||b(r,o,a,u))return!0;if(u)return!1;if(a!==null)switch(a.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function S(r,o,a,u,h,w,k){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=u,this.attributeNamespace=h,this.mustUseProperty=a,this.propertyName=r,this.type=o,this.sanitizeURL=w,this.removeEmptyString=k}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){C[r]=new S(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];C[o]=new S(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){C[r]=new S(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){C[r]=new S(r,2,!1,r,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(r){C[r]=new S(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){C[r]=new S(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){C[r]=new S(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){C[r]=new S(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){C[r]=new S(r,5,!1,r.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function E(r){return r[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(r){var o=r.replace(_,E);C[o]=new S(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(_,E);C[o]=new S(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(_,E);C[o]=new S(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){C[r]=new S(r,1,!1,r.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){C[r]=new S(r,1,!1,r.toLowerCase(),null,!0,!0)});function T(r,o,a,u){var h=C.hasOwnProperty(o)?C[o]:null;(h!==null?h.type!==0:u||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(N(o,a,h,u)&&(a=null),u||h===null?x(o)&&(a===null?r.removeAttribute(o):r.setAttribute(o,""+a)):h.mustUseProperty?r[h.propertyName]=a===null?h.type===3?!1:"":a:(o=h.attributeName,u=h.attributeNamespace,a===null?r.removeAttribute(o):(h=h.type,a=h===3||h===4&&a===!0?"":""+a,u?r.setAttributeNS(u,o,a):r.setAttribute(o,a))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),V=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),re=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),G=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var U=Object.assign,R;function A(r){if(R===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);R=o&&o[1]||""}return`
35
- `+R+r}var ee=!1;function Y(r,o){if(!r||ee)return"";ee=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(J){var u=J}Reflect.construct(r,[],o)}else{try{o.call()}catch(J){u=J}r.call(o.prototype)}else{try{throw Error()}catch(J){u=J}r()}}catch(J){if(J&&u&&typeof J.stack=="string"){for(var h=J.stack.split(`
36
- `),w=u.stack.split(`
37
- `),k=h.length-1,P=w.length-1;1<=k&&0<=P&&h[k]!==w[P];)P--;for(;1<=k&&0<=P;k--,P--)if(h[k]!==w[P]){if(k!==1||P!==1)do if(k--,P--,0>P||h[k]!==w[P]){var M=`
38
- `+h[k].replace(" at new "," at ");return r.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",r.displayName)),M}while(1<=k&&0<=P);break}}}finally{ee=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?A(r):""}function L(r){switch(r.tag){case 5:return A(r.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("SuspenseList");case 0:case 2:case 15:return r=Y(r.type,!1),r;case 11:return r=Y(r.type.render,!1),r;case 1:return r=Y(r.type,!0),r;default:return""}}function ne(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case D:return"Fragment";case V:return"Portal";case F:return"Profiler";case $:return"StrictMode";case de:return"Suspense";case ge:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case re:return(r.displayName||"Context")+".Consumer";case I:return(r._context.displayName||"Context")+".Provider";case fe:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ce:return o=r.displayName||null,o!==null?o:ne(r.type)||"Memo";case te:o=r._payload,r=r._init;try{return ne(r(o))}catch{}}return null}function X(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(o);case 8:return o===$?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function oe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ue(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Te(r){var o=ue(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),u=""+r[o];if(!r.hasOwnProperty(o)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var h=a.get,w=a.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return h.call(this)},set:function(k){u=""+k,w.call(this,k)}}),Object.defineProperty(r,o,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Fe(r){r._valueTracker||(r._valueTracker=Te(r))}function ye(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var a=o.getValue(),u="";return r&&(u=ue(r)?r.checked?"true":"false":r.value),r=u,r!==a?(o.setValue(r),!0):!1}function Ve(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Ge(r,o){var a=o.checked;return U({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function Lt(r,o){var a=o.defaultValue==null?"":o.defaultValue,u=o.checked!=null?o.checked:o.defaultChecked;a=oe(o.value!=null?o.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Zt(r,o){o=o.checked,o!=null&&T(r,"checked",o,!1)}function ut(r,o){Zt(r,o);var a=oe(o.value),u=o.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?wt(r,o.type,a):o.hasOwnProperty("defaultValue")&&wt(r,o.type,oe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function qn(r,o,a){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var u=o.type;if(!(u!=="submit"&&u!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,a||o===r.value||(r.value=o),r.defaultValue=o}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function wt(r,o,a){(o!=="number"||Ve(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var dr=Array.isArray;function bn(r,o,a,u){if(r=r.options,o){o={};for(var h=0;h<a.length;h++)o["$"+a[h]]=!0;for(a=0;a<r.length;a++)h=o.hasOwnProperty("$"+r[a].value),r[a].selected!==h&&(r[a].selected=h),h&&u&&(r[a].defaultSelected=!0)}else{for(a=""+oe(a),o=null,h=0;h<r.length;h++){if(r[h].value===a){r[h].selected=!0,u&&(r[h].defaultSelected=!0);return}o!==null||r[h].disabled||(o=r[h])}o!==null&&(o.selected=!0)}}function ht(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return U({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function On(r,o){var a=o.value;if(a==null){if(a=o.children,o=o.defaultValue,a!=null){if(o!=null)throw Error(n(92));if(dr(a)){if(1<a.length)throw Error(n(93));a=a[0]}o=a}o==null&&(o=""),a=o}r._wrapperState={initialValue:oe(a)}}function Rs(r,o){var a=oe(o.value),u=oe(o.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),o.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),u!=null&&(r.defaultValue=""+u)}function Os(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function Ct(r){switch(r){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 fr(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?Ct(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Tr,An=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,a,u,h){MSApp.execUnsafeLocalFunction(function(){return r(o,a,u,h)})}:r})(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(Tr=Tr||document.createElement("div"),Tr.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Tr.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function st(r,o){if(o){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=o;return}}r.textContent=o}var pr={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},Kn=["Webkit","ms","Moz","O"];Object.keys(pr).forEach(function(r){Kn.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),pr[o]=pr[r]})});function Bo(r,o,a){return o==null||typeof o=="boolean"||o===""?"":a||typeof o!="number"||o===0||pr.hasOwnProperty(r)&&pr[r]?(""+o).trim():o+"px"}function Vo(r,o){r=r.style;for(var a in o)if(o.hasOwnProperty(a)){var u=a.indexOf("--")===0,h=Bo(a,o[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,h):r[a]=h}}var H=U({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 se(r,o){if(o){if(H[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function xe(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){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 we=null;function Ee(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var nt=null,xt=null,et=null;function Rt(r){if(r=oa(r)){if(typeof nt!="function")throw Error(n(280));var o=r.stateNode;o&&(o=El(o),nt(r.stateNode,r.type,o))}}function Me(r){xt?et?et.push(r):et=[r]:xt=r}function tt(){if(xt){var r=xt,o=et;if(et=xt=null,Rt(r),o)for(r=0;r<o.length;r++)Rt(o[r])}}function lt(r,o){return r(o)}function gt(){}var Kr=!1;function bt(r,o,a){if(Kr)return r(o,a);Kr=!0;try{return lt(r,o,a)}finally{Kr=!1,(xt!==null||et!==null)&&(gt(),tt())}}function Ot(r,o){var a=r.stateNode;if(a===null)return null;var u=El(a);if(u===null)return null;a=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,o,typeof a));return a}var Gr=!1;if(f)try{var zt={};Object.defineProperty(zt,"passive",{get:function(){Gr=!0}}),window.addEventListener("test",zt,zt),window.removeEventListener("test",zt,zt)}catch{Gr=!1}function Sn(r,o,a,u,h,w,k,P,M){var J=Array.prototype.slice.call(arguments,3);try{o.apply(a,J)}catch(le){this.onError(le)}}var Qr=!1,Mn=null,zi=!1,zu=null,kk={onError:function(r){Qr=!0,Mn=r}};function _k(r,o,a,u,h,w,k,P,M){Qr=!1,Mn=null,Sn.apply(kk,arguments)}function Ck(r,o,a,u,h,w,k,P,M){if(_k.apply(this,arguments),Qr){if(Qr){var J=Mn;Qr=!1,Mn=null}else throw Error(n(198));zi||(zi=!0,zu=J)}}function Ho(r){var o=r,a=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(a=o.return),r=o.return;while(r)}return o.tag===3?a:null}function lh(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function ch(r){if(Ho(r)!==r)throw Error(n(188))}function Nk(r){var o=r.alternate;if(!o){if(o=Ho(r),o===null)throw Error(n(188));return o!==r?null:r}for(var a=r,u=o;;){var h=a.return;if(h===null)break;var w=h.alternate;if(w===null){if(u=h.return,u!==null){a=u;continue}break}if(h.child===w.child){for(w=h.child;w;){if(w===a)return ch(h),r;if(w===u)return ch(h),o;w=w.sibling}throw Error(n(188))}if(a.return!==u.return)a=h,u=w;else{for(var k=!1,P=h.child;P;){if(P===a){k=!0,a=h,u=w;break}if(P===u){k=!0,u=h,a=w;break}P=P.sibling}if(!k){for(P=w.child;P;){if(P===a){k=!0,a=w,u=h;break}if(P===u){k=!0,u=w,a=h;break}P=P.sibling}if(!k)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:o}function uh(r){return r=Nk(r),r!==null?dh(r):null}function dh(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=dh(r);if(o!==null)return o;r=r.sibling}return null}var fh=t.unstable_scheduleCallback,ph=t.unstable_cancelCallback,Ek=t.unstable_shouldYield,Pk=t.unstable_requestPaint,yt=t.unstable_now,jk=t.unstable_getCurrentPriorityLevel,Fu=t.unstable_ImmediatePriority,mh=t.unstable_UserBlockingPriority,al=t.unstable_NormalPriority,Tk=t.unstable_LowPriority,hh=t.unstable_IdlePriority,ll=null,mr=null;function Rk(r){if(mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(ll,r,void 0,(r.current.flags&128)===128)}catch{}}var Gn=Math.clz32?Math.clz32:Mk,Ok=Math.log,Ak=Math.LN2;function Mk(r){return r>>>=0,r===0?32:31-(Ok(r)/Ak|0)|0}var cl=64,ul=4194304;function Fi(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function dl(r,o){var a=r.pendingLanes;if(a===0)return 0;var u=0,h=r.suspendedLanes,w=r.pingedLanes,k=a&268435455;if(k!==0){var P=k&~h;P!==0?u=Fi(P):(w&=k,w!==0&&(u=Fi(w)))}else k=a&~h,k!==0?u=Fi(k):w!==0&&(u=Fi(w));if(u===0)return 0;if(o!==0&&o!==u&&(o&h)===0&&(h=u&-u,w=o&-o,h>=w||h===16&&(w&4194240)!==0))return o;if((u&4)!==0&&(u|=a&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=u;0<o;)a=31-Gn(o),h=1<<a,u|=r[a],o&=~h;return u}function Ik(r,o){switch(r){case 1:case 2:case 4:return o+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 o+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 $k(r,o){for(var a=r.suspendedLanes,u=r.pingedLanes,h=r.expirationTimes,w=r.pendingLanes;0<w;){var k=31-Gn(w),P=1<<k,M=h[k];M===-1?((P&a)===0||(P&u)!==0)&&(h[k]=Ik(P,o)):M<=o&&(r.expiredLanes|=P),w&=~P}}function Uu(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function gh(){var r=cl;return cl<<=1,(cl&4194240)===0&&(cl=64),r}function Bu(r){for(var o=[],a=0;31>a;a++)o.push(r);return o}function Ui(r,o,a){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-Gn(o),r[o]=a}function Dk(r,o){var a=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0<a;){var h=31-Gn(a),w=1<<h;o[h]=0,u[h]=-1,r[h]=-1,a&=~w}}function Vu(r,o){var a=r.entangledLanes|=o;for(r=r.entanglements;a;){var u=31-Gn(a),h=1<<u;h&o|r[u]&o&&(r[u]|=o),a&=~h}}var Xe=0;function yh(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var vh,Hu,wh,xh,bh,Wu=!1,fl=[],Zr=null,Yr=null,Jr=null,Bi=new Map,Vi=new Map,Xr=[],Lk="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 Sh(r,o){switch(r){case"focusin":case"focusout":Zr=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Bi.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(o.pointerId)}}function Hi(r,o,a,u,h,w){return r===null||r.nativeEvent!==w?(r={blockedOn:o,domEventName:a,eventSystemFlags:u,nativeEvent:w,targetContainers:[h]},o!==null&&(o=oa(o),o!==null&&Hu(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,h!==null&&o.indexOf(h)===-1&&o.push(h),r)}function zk(r,o,a,u,h){switch(o){case"focusin":return Zr=Hi(Zr,r,o,a,u,h),!0;case"dragenter":return Yr=Hi(Yr,r,o,a,u,h),!0;case"mouseover":return Jr=Hi(Jr,r,o,a,u,h),!0;case"pointerover":var w=h.pointerId;return Bi.set(w,Hi(Bi.get(w)||null,r,o,a,u,h)),!0;case"gotpointercapture":return w=h.pointerId,Vi.set(w,Hi(Vi.get(w)||null,r,o,a,u,h)),!0}return!1}function kh(r){var o=Wo(r.target);if(o!==null){var a=Ho(o);if(a!==null){if(o=a.tag,o===13){if(o=lh(a),o!==null){r.blockedOn=o,bh(r.priority,function(){wh(a)});return}}else if(o===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pl(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var a=Ku(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var u=new a.constructor(a.type,a);we=u,a.target.dispatchEvent(u),we=null}else return o=oa(a),o!==null&&Hu(o),r.blockedOn=a,!1;o.shift()}return!0}function _h(r,o,a){pl(r)&&a.delete(o)}function Fk(){Wu=!1,Zr!==null&&pl(Zr)&&(Zr=null),Yr!==null&&pl(Yr)&&(Yr=null),Jr!==null&&pl(Jr)&&(Jr=null),Bi.forEach(_h),Vi.forEach(_h)}function Wi(r,o){r.blockedOn===o&&(r.blockedOn=null,Wu||(Wu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fk)))}function qi(r){function o(h){return Wi(h,r)}if(0<fl.length){Wi(fl[0],r);for(var a=1;a<fl.length;a++){var u=fl[a];u.blockedOn===r&&(u.blockedOn=null)}}for(Zr!==null&&Wi(Zr,r),Yr!==null&&Wi(Yr,r),Jr!==null&&Wi(Jr,r),Bi.forEach(o),Vi.forEach(o),a=0;a<Xr.length;a++)u=Xr[a],u.blockedOn===r&&(u.blockedOn=null);for(;0<Xr.length&&(a=Xr[0],a.blockedOn===null);)kh(a),a.blockedOn===null&&Xr.shift()}var As=j.ReactCurrentBatchConfig,ml=!0;function Uk(r,o,a,u){var h=Xe,w=As.transition;As.transition=null;try{Xe=1,qu(r,o,a,u)}finally{Xe=h,As.transition=w}}function Bk(r,o,a,u){var h=Xe,w=As.transition;As.transition=null;try{Xe=4,qu(r,o,a,u)}finally{Xe=h,As.transition=w}}function qu(r,o,a,u){if(ml){var h=Ku(r,o,a,u);if(h===null)ud(r,o,u,hl,a),Sh(r,u);else if(zk(h,r,o,a,u))u.stopPropagation();else if(Sh(r,u),o&4&&-1<Lk.indexOf(r)){for(;h!==null;){var w=oa(h);if(w!==null&&vh(w),w=Ku(r,o,a,u),w===null&&ud(r,o,u,hl,a),w===h)break;h=w}h!==null&&u.stopPropagation()}else ud(r,o,u,null,a)}}var hl=null;function Ku(r,o,a,u){if(hl=null,r=Ee(u),r=Wo(r),r!==null)if(o=Ho(r),o===null)r=null;else if(a=o.tag,a===13){if(r=lh(o),r!==null)return r;r=null}else if(a===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return hl=r,null}function Ch(r){switch(r){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(jk()){case Fu:return 1;case mh:return 4;case al:case Tk:return 16;case hh:return 536870912;default:return 16}default:return 16}}var eo=null,Gu=null,gl=null;function Nh(){if(gl)return gl;var r,o=Gu,a=o.length,u,h="value"in eo?eo.value:eo.textContent,w=h.length;for(r=0;r<a&&o[r]===h[r];r++);var k=a-r;for(u=1;u<=k&&o[a-u]===h[w-u];u++);return gl=h.slice(r,1<u?1-u:void 0)}function yl(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function vl(){return!0}function Eh(){return!1}function kn(r){function o(a,u,h,w,k){this._reactName=a,this._targetInst=h,this.type=u,this.nativeEvent=w,this.target=k,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(a=r[P],this[P]=a?a(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?vl:Eh,this.isPropagationStopped=Eh,this}return U(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=vl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=vl)},persist:function(){},isPersistent:vl}),o}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qu=kn(Ms),Ki=U({},Ms,{view:0,detail:0}),Vk=kn(Ki),Zu,Yu,Gi,wl=U({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Gi&&(Gi&&r.type==="mousemove"?(Zu=r.screenX-Gi.screenX,Yu=r.screenY-Gi.screenY):Yu=Zu=0,Gi=r),Zu)},movementY:function(r){return"movementY"in r?r.movementY:Yu}}),Ph=kn(wl),Hk=U({},wl,{dataTransfer:0}),Wk=kn(Hk),qk=U({},Ki,{relatedTarget:0}),Ju=kn(qk),Kk=U({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),Gk=kn(Kk),Qk=U({},Ms,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Zk=kn(Qk),Yk=U({},Ms,{data:0}),jh=kn(Yk),Jk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xk={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"},e_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t_(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=e_[r])?!!o[r]:!1}function Xu(){return t_}var n_=U({},Ki,{key:function(r){if(r.key){var o=Jk[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=yl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Xk[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xu,charCode:function(r){return r.type==="keypress"?yl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?yl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),r_=kn(n_),o_=U({},wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Th=kn(o_),s_=U({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xu}),i_=kn(s_),a_=U({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),l_=kn(a_),c_=U({},wl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),u_=kn(c_),d_=[9,13,27,32],ed=f&&"CompositionEvent"in window,Qi=null;f&&"documentMode"in document&&(Qi=document.documentMode);var f_=f&&"TextEvent"in window&&!Qi,Rh=f&&(!ed||Qi&&8<Qi&&11>=Qi),Oh=" ",Ah=!1;function Mh(r,o){switch(r){case"keyup":return d_.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ih(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Is=!1;function p_(r,o){switch(r){case"compositionend":return Ih(o);case"keypress":return o.which!==32?null:(Ah=!0,Oh);case"textInput":return r=o.data,r===Oh&&Ah?null:r;default:return null}}function m_(r,o){if(Is)return r==="compositionend"||!ed&&Mh(r,o)?(r=Nh(),gl=Gu=eo=null,Is=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Rh&&o.locale!=="ko"?null:o.data;default:return null}}var h_={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 $h(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!h_[r.type]:o==="textarea"}function Dh(r,o,a,u){Me(u),o=_l(o,"onChange"),0<o.length&&(a=new Qu("onChange","change",null,a,u),r.push({event:a,listeners:o}))}var Zi=null,Yi=null;function g_(r){tg(r,0)}function xl(r){var o=Fs(r);if(ye(o))return r}function y_(r,o){if(r==="change")return o}var Lh=!1;if(f){var td;if(f){var nd="oninput"in document;if(!nd){var zh=document.createElement("div");zh.setAttribute("oninput","return;"),nd=typeof zh.oninput=="function"}td=nd}else td=!1;Lh=td&&(!document.documentMode||9<document.documentMode)}function Fh(){Zi&&(Zi.detachEvent("onpropertychange",Uh),Yi=Zi=null)}function Uh(r){if(r.propertyName==="value"&&xl(Yi)){var o=[];Dh(o,Yi,r,Ee(r)),bt(g_,o)}}function v_(r,o,a){r==="focusin"?(Fh(),Zi=o,Yi=a,Zi.attachEvent("onpropertychange",Uh)):r==="focusout"&&Fh()}function w_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return xl(Yi)}function x_(r,o){if(r==="click")return xl(o)}function b_(r,o){if(r==="input"||r==="change")return xl(o)}function S_(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Qn=typeof Object.is=="function"?Object.is:S_;function Ji(r,o){if(Qn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var a=Object.keys(r),u=Object.keys(o);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var h=a[u];if(!g.call(o,h)||!Qn(r[h],o[h]))return!1}return!0}function Bh(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Vh(r,o){var a=Bh(r);r=0;for(var u;a;){if(a.nodeType===3){if(u=r+a.textContent.length,r<=o&&u>=o)return{node:a,offset:o-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Bh(a)}}function Hh(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Hh(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Wh(){for(var r=window,o=Ve();o instanceof r.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)r=o.contentWindow;else break;o=Ve(r.document)}return o}function rd(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function k_(r){var o=Wh(),a=r.focusedElem,u=r.selectionRange;if(o!==a&&a&&a.ownerDocument&&Hh(a.ownerDocument.documentElement,a)){if(u!==null&&rd(a)){if(o=u.start,r=u.end,r===void 0&&(r=o),"selectionStart"in a)a.selectionStart=o,a.selectionEnd=Math.min(r,a.value.length);else if(r=(o=a.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var h=a.textContent.length,w=Math.min(u.start,h);u=u.end===void 0?w:Math.min(u.end,h),!r.extend&&w>u&&(h=u,u=w,w=h),h=Vh(a,w);var k=Vh(a,u);h&&k&&(r.rangeCount!==1||r.anchorNode!==h.node||r.anchorOffset!==h.offset||r.focusNode!==k.node||r.focusOffset!==k.offset)&&(o=o.createRange(),o.setStart(h.node,h.offset),r.removeAllRanges(),w>u?(r.addRange(o),r.extend(k.node,k.offset)):(o.setEnd(k.node,k.offset),r.addRange(o)))}}for(o=[],r=a;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<o.length;a++)r=o[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var __=f&&"documentMode"in document&&11>=document.documentMode,$s=null,od=null,Xi=null,sd=!1;function qh(r,o,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;sd||$s==null||$s!==Ve(u)||(u=$s,"selectionStart"in u&&rd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Xi&&Ji(Xi,u)||(Xi=u,u=_l(od,"onSelect"),0<u.length&&(o=new Qu("onSelect","select",null,o,a),r.push({event:o,listeners:u}),o.target=$s)))}function bl(r,o){var a={};return a[r.toLowerCase()]=o.toLowerCase(),a["Webkit"+r]="webkit"+o,a["Moz"+r]="moz"+o,a}var Ds={animationend:bl("Animation","AnimationEnd"),animationiteration:bl("Animation","AnimationIteration"),animationstart:bl("Animation","AnimationStart"),transitionend:bl("Transition","TransitionEnd")},id={},Kh={};f&&(Kh=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function Sl(r){if(id[r])return id[r];if(!Ds[r])return r;var o=Ds[r],a;for(a in o)if(o.hasOwnProperty(a)&&a in Kh)return id[r]=o[a];return r}var Gh=Sl("animationend"),Qh=Sl("animationiteration"),Zh=Sl("animationstart"),Yh=Sl("transitionend"),Jh=new Map,Xh="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 to(r,o){Jh.set(r,o),l(o,[r])}for(var ad=0;ad<Xh.length;ad++){var ld=Xh[ad],C_=ld.toLowerCase(),N_=ld[0].toUpperCase()+ld.slice(1);to(C_,"on"+N_)}to(Gh,"onAnimationEnd"),to(Qh,"onAnimationIteration"),to(Zh,"onAnimationStart"),to("dblclick","onDoubleClick"),to("focusin","onFocus"),to("focusout","onBlur"),to(Yh,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),E_=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function eg(r,o,a){var u=r.type||"unknown-event";r.currentTarget=a,Ck(u,o,void 0,r),r.currentTarget=null}function tg(r,o){o=(o&4)!==0;for(var a=0;a<r.length;a++){var u=r[a],h=u.event;u=u.listeners;e:{var w=void 0;if(o)for(var k=u.length-1;0<=k;k--){var P=u[k],M=P.instance,J=P.currentTarget;if(P=P.listener,M!==w&&h.isPropagationStopped())break e;eg(h,P,J),w=M}else for(k=0;k<u.length;k++){if(P=u[k],M=P.instance,J=P.currentTarget,P=P.listener,M!==w&&h.isPropagationStopped())break e;eg(h,P,J),w=M}}}if(zi)throw r=zu,zi=!1,zu=null,r}function it(r,o){var a=o[gd];a===void 0&&(a=o[gd]=new Set);var u=r+"__bubble";a.has(u)||(ng(o,r,2,!1),a.add(u))}function cd(r,o,a){var u=0;o&&(u|=4),ng(a,r,u,o)}var kl="_reactListening"+Math.random().toString(36).slice(2);function ta(r){if(!r[kl]){r[kl]=!0,s.forEach(function(a){a!=="selectionchange"&&(E_.has(a)||cd(a,!1,r),cd(a,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[kl]||(o[kl]=!0,cd("selectionchange",!1,o))}}function ng(r,o,a,u){switch(Ch(o)){case 1:var h=Uk;break;case 4:h=Bk;break;default:h=qu}a=h.bind(null,o,a,r),h=void 0,!Gr||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(h=!0),u?h!==void 0?r.addEventListener(o,a,{capture:!0,passive:h}):r.addEventListener(o,a,!0):h!==void 0?r.addEventListener(o,a,{passive:h}):r.addEventListener(o,a,!1)}function ud(r,o,a,u,h){var w=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var k=u.tag;if(k===3||k===4){var P=u.stateNode.containerInfo;if(P===h||P.nodeType===8&&P.parentNode===h)break;if(k===4)for(k=u.return;k!==null;){var M=k.tag;if((M===3||M===4)&&(M=k.stateNode.containerInfo,M===h||M.nodeType===8&&M.parentNode===h))return;k=k.return}for(;P!==null;){if(k=Wo(P),k===null)return;if(M=k.tag,M===5||M===6){u=w=k;continue e}P=P.parentNode}}u=u.return}bt(function(){var J=w,le=Ee(a),pe=[];e:{var ae=Jh.get(r);if(ae!==void 0){var be=Qu,Ce=r;switch(r){case"keypress":if(yl(a)===0)break e;case"keydown":case"keyup":be=r_;break;case"focusin":Ce="focus",be=Ju;break;case"focusout":Ce="blur",be=Ju;break;case"beforeblur":case"afterblur":be=Ju;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=Ph;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=Wk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=i_;break;case Gh:case Qh:case Zh:be=Gk;break;case Yh:be=l_;break;case"scroll":be=Vk;break;case"wheel":be=u_;break;case"copy":case"cut":case"paste":be=Zk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=Th}var Re=(o&4)!==0,vt=!Re&&r==="scroll",K=Re?ae!==null?ae+"Capture":null:ae;Re=[];for(var z=J,Q;z!==null;){Q=z;var he=Q.stateNode;if(Q.tag===5&&he!==null&&(Q=he,K!==null&&(he=Ot(z,K),he!=null&&Re.push(na(z,he,Q)))),vt)break;z=z.return}0<Re.length&&(ae=new be(ae,Ce,null,a,le),pe.push({event:ae,listeners:Re}))}}if((o&7)===0){e:{if(ae=r==="mouseover"||r==="pointerover",be=r==="mouseout"||r==="pointerout",ae&&a!==we&&(Ce=a.relatedTarget||a.fromElement)&&(Wo(Ce)||Ce[Rr]))break e;if((be||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,be?(Ce=a.relatedTarget||a.toElement,be=J,Ce=Ce?Wo(Ce):null,Ce!==null&&(vt=Ho(Ce),Ce!==vt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(be=null,Ce=J),be!==Ce)){if(Re=Ph,he="onMouseLeave",K="onMouseEnter",z="mouse",(r==="pointerout"||r==="pointerover")&&(Re=Th,he="onPointerLeave",K="onPointerEnter",z="pointer"),vt=be==null?ae:Fs(be),Q=Ce==null?ae:Fs(Ce),ae=new Re(he,z+"leave",be,a,le),ae.target=vt,ae.relatedTarget=Q,he=null,Wo(le)===J&&(Re=new Re(K,z+"enter",Ce,a,le),Re.target=Q,Re.relatedTarget=vt,he=Re),vt=he,be&&Ce)t:{for(Re=be,K=Ce,z=0,Q=Re;Q;Q=Ls(Q))z++;for(Q=0,he=K;he;he=Ls(he))Q++;for(;0<z-Q;)Re=Ls(Re),z--;for(;0<Q-z;)K=Ls(K),Q--;for(;z--;){if(Re===K||K!==null&&Re===K.alternate)break t;Re=Ls(Re),K=Ls(K)}Re=null}else Re=null;be!==null&&rg(pe,ae,be,Re,!1),Ce!==null&&vt!==null&&rg(pe,vt,Ce,Re,!0)}}e:{if(ae=J?Fs(J):window,be=ae.nodeName&&ae.nodeName.toLowerCase(),be==="select"||be==="input"&&ae.type==="file")var Oe=y_;else if($h(ae))if(Lh)Oe=b_;else{Oe=w_;var Ie=v_}else(be=ae.nodeName)&&be.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Oe=x_);if(Oe&&(Oe=Oe(r,J))){Dh(pe,Oe,a,le);break e}Ie&&Ie(r,ae,J),r==="focusout"&&(Ie=ae._wrapperState)&&Ie.controlled&&ae.type==="number"&&wt(ae,"number",ae.value)}switch(Ie=J?Fs(J):window,r){case"focusin":($h(Ie)||Ie.contentEditable==="true")&&($s=Ie,od=J,Xi=null);break;case"focusout":Xi=od=$s=null;break;case"mousedown":sd=!0;break;case"contextmenu":case"mouseup":case"dragend":sd=!1,qh(pe,a,le);break;case"selectionchange":if(__)break;case"keydown":case"keyup":qh(pe,a,le)}var $e;if(ed)e:{switch(r){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Is?Mh(r,a)&&(Ue="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Ue="onCompositionStart");Ue&&(Rh&&a.locale!=="ko"&&(Is||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Is&&($e=Nh()):(eo=le,Gu="value"in eo?eo.value:eo.textContent,Is=!0)),Ie=_l(J,Ue),0<Ie.length&&(Ue=new jh(Ue,r,null,a,le),pe.push({event:Ue,listeners:Ie}),$e?Ue.data=$e:($e=Ih(a),$e!==null&&(Ue.data=$e)))),($e=f_?p_(r,a):m_(r,a))&&(J=_l(J,"onBeforeInput"),0<J.length&&(le=new jh("onBeforeInput","beforeinput",null,a,le),pe.push({event:le,listeners:J}),le.data=$e))}tg(pe,o)})}function na(r,o,a){return{instance:r,listener:o,currentTarget:a}}function _l(r,o){for(var a=o+"Capture",u=[];r!==null;){var h=r,w=h.stateNode;h.tag===5&&w!==null&&(h=w,w=Ot(r,a),w!=null&&u.unshift(na(r,w,h)),w=Ot(r,o),w!=null&&u.push(na(r,w,h))),r=r.return}return u}function Ls(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function rg(r,o,a,u,h){for(var w=o._reactName,k=[];a!==null&&a!==u;){var P=a,M=P.alternate,J=P.stateNode;if(M!==null&&M===u)break;P.tag===5&&J!==null&&(P=J,h?(M=Ot(a,w),M!=null&&k.unshift(na(a,M,P))):h||(M=Ot(a,w),M!=null&&k.push(na(a,M,P)))),a=a.return}k.length!==0&&r.push({event:o,listeners:k})}var P_=/\r\n?/g,j_=/\u0000|\uFFFD/g;function og(r){return(typeof r=="string"?r:""+r).replace(P_,`
39
- `).replace(j_,"")}function Cl(r,o,a){if(o=og(o),og(r)!==o&&a)throw Error(n(425))}function Nl(){}var dd=null,fd=null;function pd(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var md=typeof setTimeout=="function"?setTimeout:void 0,T_=typeof clearTimeout=="function"?clearTimeout:void 0,sg=typeof Promise=="function"?Promise:void 0,R_=typeof queueMicrotask=="function"?queueMicrotask:typeof sg<"u"?function(r){return sg.resolve(null).then(r).catch(O_)}:md;function O_(r){setTimeout(function(){throw r})}function hd(r,o){var a=o,u=0;do{var h=a.nextSibling;if(r.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"){if(u===0){r.removeChild(h),qi(o);return}u--}else a!=="$"&&a!=="$?"&&a!=="$!"||u++;a=h}while(a);qi(o)}function no(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function ig(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(o===0)return r;o--}else a==="/$"&&o++}r=r.previousSibling}return null}var zs=Math.random().toString(36).slice(2),hr="__reactFiber$"+zs,ra="__reactProps$"+zs,Rr="__reactContainer$"+zs,gd="__reactEvents$"+zs,A_="__reactListeners$"+zs,M_="__reactHandles$"+zs;function Wo(r){var o=r[hr];if(o)return o;for(var a=r.parentNode;a;){if(o=a[Rr]||a[hr]){if(a=o.alternate,o.child!==null||a!==null&&a.child!==null)for(r=ig(r);r!==null;){if(a=r[hr])return a;r=ig(r)}return o}r=a,a=r.parentNode}return null}function oa(r){return r=r[hr]||r[Rr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Fs(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function El(r){return r[ra]||null}var yd=[],Us=-1;function ro(r){return{current:r}}function at(r){0>Us||(r.current=yd[Us],yd[Us]=null,Us--)}function rt(r,o){Us++,yd[Us]=r.current,r.current=o}var oo={},Vt=ro(oo),ln=ro(!1),qo=oo;function Bs(r,o){var a=r.type.contextTypes;if(!a)return oo;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===o)return u.__reactInternalMemoizedMaskedChildContext;var h={},w;for(w in a)h[w]=o[w];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=h),h}function cn(r){return r=r.childContextTypes,r!=null}function Pl(){at(ln),at(Vt)}function ag(r,o,a){if(Vt.current!==oo)throw Error(n(168));rt(Vt,o),rt(ln,a)}function lg(r,o,a){var u=r.stateNode;if(o=o.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var h in u)if(!(h in o))throw Error(n(108,X(r)||"Unknown",h));return U({},a,u)}function jl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||oo,qo=Vt.current,rt(Vt,r),rt(ln,ln.current),!0}function cg(r,o,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=lg(r,o,qo),u.__reactInternalMemoizedMergedChildContext=r,at(ln),at(Vt),rt(Vt,r)):at(ln),rt(ln,a)}var Or=null,Tl=!1,vd=!1;function ug(r){Or===null?Or=[r]:Or.push(r)}function I_(r){Tl=!0,ug(r)}function so(){if(!vd&&Or!==null){vd=!0;var r=0,o=Xe;try{var a=Or;for(Xe=1;r<a.length;r++){var u=a[r];do u=u(!0);while(u!==null)}Or=null,Tl=!1}catch(h){throw Or!==null&&(Or=Or.slice(r+1)),fh(Fu,so),h}finally{Xe=o,vd=!1}}return null}var Vs=[],Hs=0,Rl=null,Ol=0,In=[],$n=0,Ko=null,Ar=1,Mr="";function Go(r,o){Vs[Hs++]=Ol,Vs[Hs++]=Rl,Rl=r,Ol=o}function dg(r,o,a){In[$n++]=Ar,In[$n++]=Mr,In[$n++]=Ko,Ko=r;var u=Ar;r=Mr;var h=32-Gn(u)-1;u&=~(1<<h),a+=1;var w=32-Gn(o)+h;if(30<w){var k=h-h%5;w=(u&(1<<k)-1).toString(32),u>>=k,h-=k,Ar=1<<32-Gn(o)+h|a<<h|u,Mr=w+r}else Ar=1<<w|a<<h|u,Mr=r}function wd(r){r.return!==null&&(Go(r,1),dg(r,1,0))}function xd(r){for(;r===Rl;)Rl=Vs[--Hs],Vs[Hs]=null,Ol=Vs[--Hs],Vs[Hs]=null;for(;r===Ko;)Ko=In[--$n],In[$n]=null,Mr=In[--$n],In[$n]=null,Ar=In[--$n],In[$n]=null}var _n=null,Cn=null,ct=!1,Zn=null;function fg(r,o){var a=Fn(5,null,null,0);a.elementType="DELETED",a.stateNode=o,a.return=r,o=r.deletions,o===null?(r.deletions=[a],r.flags|=16):o.push(a)}function pg(r,o){switch(r.tag){case 5:var a=r.type;return o=o.nodeType!==1||a.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,_n=r,Cn=no(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,_n=r,Cn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(a=Ko!==null?{id:Ar,overflow:Mr}:null,r.memoizedState={dehydrated:o,treeContext:a,retryLane:1073741824},a=Fn(18,null,null,0),a.stateNode=o,a.return=r,r.child=a,_n=r,Cn=null,!0):!1;default:return!1}}function bd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Sd(r){if(ct){var o=Cn;if(o){var a=o;if(!pg(r,o)){if(bd(r))throw Error(n(418));o=no(a.nextSibling);var u=_n;o&&pg(r,o)?fg(u,a):(r.flags=r.flags&-4097|2,ct=!1,_n=r)}}else{if(bd(r))throw Error(n(418));r.flags=r.flags&-4097|2,ct=!1,_n=r}}}function mg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;_n=r}function Al(r){if(r!==_n)return!1;if(!ct)return mg(r),ct=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!pd(r.type,r.memoizedProps)),o&&(o=Cn)){if(bd(r))throw hg(),Error(n(418));for(;o;)fg(r,o),o=no(o.nextSibling)}if(mg(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(o===0){Cn=no(r.nextSibling);break e}o--}else a!=="$"&&a!=="$!"&&a!=="$?"||o++}r=r.nextSibling}Cn=null}}else Cn=_n?no(r.stateNode.nextSibling):null;return!0}function hg(){for(var r=Cn;r;)r=no(r.nextSibling)}function Ws(){Cn=_n=null,ct=!1}function kd(r){Zn===null?Zn=[r]:Zn.push(r)}var $_=j.ReactCurrentBatchConfig;function sa(r,o,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var u=a.stateNode}if(!u)throw Error(n(147,r));var h=u,w=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===w?o.ref:(o=function(k){var P=h.refs;k===null?delete P[w]:P[w]=k},o._stringRef=w,o)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Ml(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function gg(r){var o=r._init;return o(r._payload)}function yg(r){function o(K,z){if(r){var Q=K.deletions;Q===null?(K.deletions=[z],K.flags|=16):Q.push(z)}}function a(K,z){if(!r)return null;for(;z!==null;)o(K,z),z=z.sibling;return null}function u(K,z){for(K=new Map;z!==null;)z.key!==null?K.set(z.key,z):K.set(z.index,z),z=z.sibling;return K}function h(K,z){return K=mo(K,z),K.index=0,K.sibling=null,K}function w(K,z,Q){return K.index=Q,r?(Q=K.alternate,Q!==null?(Q=Q.index,Q<z?(K.flags|=2,z):Q):(K.flags|=2,z)):(K.flags|=1048576,z)}function k(K){return r&&K.alternate===null&&(K.flags|=2),K}function P(K,z,Q,he){return z===null||z.tag!==6?(z=hf(Q,K.mode,he),z.return=K,z):(z=h(z,Q),z.return=K,z)}function M(K,z,Q,he){var Oe=Q.type;return Oe===D?le(K,z,Q.props.children,he,Q.key):z!==null&&(z.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===te&&gg(Oe)===z.type)?(he=h(z,Q.props),he.ref=sa(K,z,Q),he.return=K,he):(he=oc(Q.type,Q.key,Q.props,null,K.mode,he),he.ref=sa(K,z,Q),he.return=K,he)}function J(K,z,Q,he){return z===null||z.tag!==4||z.stateNode.containerInfo!==Q.containerInfo||z.stateNode.implementation!==Q.implementation?(z=gf(Q,K.mode,he),z.return=K,z):(z=h(z,Q.children||[]),z.return=K,z)}function le(K,z,Q,he,Oe){return z===null||z.tag!==7?(z=ns(Q,K.mode,he,Oe),z.return=K,z):(z=h(z,Q),z.return=K,z)}function pe(K,z,Q){if(typeof z=="string"&&z!==""||typeof z=="number")return z=hf(""+z,K.mode,Q),z.return=K,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case q:return Q=oc(z.type,z.key,z.props,null,K.mode,Q),Q.ref=sa(K,null,z),Q.return=K,Q;case V:return z=gf(z,K.mode,Q),z.return=K,z;case te:var he=z._init;return pe(K,he(z._payload),Q)}if(dr(z)||Z(z))return z=ns(z,K.mode,Q,null),z.return=K,z;Ml(K,z)}return null}function ae(K,z,Q,he){var Oe=z!==null?z.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Oe!==null?null:P(K,z,""+Q,he);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case q:return Q.key===Oe?M(K,z,Q,he):null;case V:return Q.key===Oe?J(K,z,Q,he):null;case te:return Oe=Q._init,ae(K,z,Oe(Q._payload),he)}if(dr(Q)||Z(Q))return Oe!==null?null:le(K,z,Q,he,null);Ml(K,Q)}return null}function be(K,z,Q,he,Oe){if(typeof he=="string"&&he!==""||typeof he=="number")return K=K.get(Q)||null,P(z,K,""+he,Oe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case q:return K=K.get(he.key===null?Q:he.key)||null,M(z,K,he,Oe);case V:return K=K.get(he.key===null?Q:he.key)||null,J(z,K,he,Oe);case te:var Ie=he._init;return be(K,z,Q,Ie(he._payload),Oe)}if(dr(he)||Z(he))return K=K.get(Q)||null,le(z,K,he,Oe,null);Ml(z,he)}return null}function Ce(K,z,Q,he){for(var Oe=null,Ie=null,$e=z,Ue=z=0,It=null;$e!==null&&Ue<Q.length;Ue++){$e.index>Ue?(It=$e,$e=null):It=$e.sibling;var Ze=ae(K,$e,Q[Ue],he);if(Ze===null){$e===null&&($e=It);break}r&&$e&&Ze.alternate===null&&o(K,$e),z=w(Ze,z,Ue),Ie===null?Oe=Ze:Ie.sibling=Ze,Ie=Ze,$e=It}if(Ue===Q.length)return a(K,$e),ct&&Go(K,Ue),Oe;if($e===null){for(;Ue<Q.length;Ue++)$e=pe(K,Q[Ue],he),$e!==null&&(z=w($e,z,Ue),Ie===null?Oe=$e:Ie.sibling=$e,Ie=$e);return ct&&Go(K,Ue),Oe}for($e=u(K,$e);Ue<Q.length;Ue++)It=be($e,K,Ue,Q[Ue],he),It!==null&&(r&&It.alternate!==null&&$e.delete(It.key===null?Ue:It.key),z=w(It,z,Ue),Ie===null?Oe=It:Ie.sibling=It,Ie=It);return r&&$e.forEach(function(ho){return o(K,ho)}),ct&&Go(K,Ue),Oe}function Re(K,z,Q,he){var Oe=Z(Q);if(typeof Oe!="function")throw Error(n(150));if(Q=Oe.call(Q),Q==null)throw Error(n(151));for(var Ie=Oe=null,$e=z,Ue=z=0,It=null,Ze=Q.next();$e!==null&&!Ze.done;Ue++,Ze=Q.next()){$e.index>Ue?(It=$e,$e=null):It=$e.sibling;var ho=ae(K,$e,Ze.value,he);if(ho===null){$e===null&&($e=It);break}r&&$e&&ho.alternate===null&&o(K,$e),z=w(ho,z,Ue),Ie===null?Oe=ho:Ie.sibling=ho,Ie=ho,$e=It}if(Ze.done)return a(K,$e),ct&&Go(K,Ue),Oe;if($e===null){for(;!Ze.done;Ue++,Ze=Q.next())Ze=pe(K,Ze.value,he),Ze!==null&&(z=w(Ze,z,Ue),Ie===null?Oe=Ze:Ie.sibling=Ze,Ie=Ze);return ct&&Go(K,Ue),Oe}for($e=u(K,$e);!Ze.done;Ue++,Ze=Q.next())Ze=be($e,K,Ue,Ze.value,he),Ze!==null&&(r&&Ze.alternate!==null&&$e.delete(Ze.key===null?Ue:Ze.key),z=w(Ze,z,Ue),Ie===null?Oe=Ze:Ie.sibling=Ze,Ie=Ze);return r&&$e.forEach(function(hC){return o(K,hC)}),ct&&Go(K,Ue),Oe}function vt(K,z,Q,he){if(typeof Q=="object"&&Q!==null&&Q.type===D&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case q:e:{for(var Oe=Q.key,Ie=z;Ie!==null;){if(Ie.key===Oe){if(Oe=Q.type,Oe===D){if(Ie.tag===7){a(K,Ie.sibling),z=h(Ie,Q.props.children),z.return=K,K=z;break e}}else if(Ie.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===te&&gg(Oe)===Ie.type){a(K,Ie.sibling),z=h(Ie,Q.props),z.ref=sa(K,Ie,Q),z.return=K,K=z;break e}a(K,Ie);break}else o(K,Ie);Ie=Ie.sibling}Q.type===D?(z=ns(Q.props.children,K.mode,he,Q.key),z.return=K,K=z):(he=oc(Q.type,Q.key,Q.props,null,K.mode,he),he.ref=sa(K,z,Q),he.return=K,K=he)}return k(K);case V:e:{for(Ie=Q.key;z!==null;){if(z.key===Ie)if(z.tag===4&&z.stateNode.containerInfo===Q.containerInfo&&z.stateNode.implementation===Q.implementation){a(K,z.sibling),z=h(z,Q.children||[]),z.return=K,K=z;break e}else{a(K,z);break}else o(K,z);z=z.sibling}z=gf(Q,K.mode,he),z.return=K,K=z}return k(K);case te:return Ie=Q._init,vt(K,z,Ie(Q._payload),he)}if(dr(Q))return Ce(K,z,Q,he);if(Z(Q))return Re(K,z,Q,he);Ml(K,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,z!==null&&z.tag===6?(a(K,z.sibling),z=h(z,Q),z.return=K,K=z):(a(K,z),z=hf(Q,K.mode,he),z.return=K,K=z),k(K)):a(K,z)}return vt}var qs=yg(!0),vg=yg(!1),Il=ro(null),$l=null,Ks=null,_d=null;function Cd(){_d=Ks=$l=null}function Nd(r){var o=Il.current;at(Il),r._currentValue=o}function Ed(r,o,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===a)break;r=r.return}}function Gs(r,o){$l=r,_d=Ks=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(un=!0),r.firstContext=null)}function Dn(r){var o=r._currentValue;if(_d!==r)if(r={context:r,memoizedValue:o,next:null},Ks===null){if($l===null)throw Error(n(308));Ks=r,$l.dependencies={lanes:0,firstContext:r}}else Ks=Ks.next=r;return o}var Qo=null;function Pd(r){Qo===null?Qo=[r]:Qo.push(r)}function wg(r,o,a,u){var h=o.interleaved;return h===null?(a.next=a,Pd(o)):(a.next=h.next,h.next=a),o.interleaved=a,Ir(r,u)}function Ir(r,o){r.lanes|=o;var a=r.alternate;for(a!==null&&(a.lanes|=o),a=r,r=r.return;r!==null;)r.childLanes|=o,a=r.alternate,a!==null&&(a.childLanes|=o),a=r,r=r.return;return a.tag===3?a.stateNode:null}var io=!1;function jd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xg(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function $r(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function ao(r,o,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(Qe&2)!==0){var h=u.pending;return h===null?o.next=o:(o.next=h.next,h.next=o),u.pending=o,Ir(r,a)}return h=u.interleaved,h===null?(o.next=o,Pd(u)):(o.next=h.next,h.next=o),u.interleaved=o,Ir(r,a)}function Dl(r,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194240)!==0)){var u=o.lanes;u&=r.pendingLanes,a|=u,o.lanes=a,Vu(r,a)}}function bg(r,o){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var h=null,w=null;if(a=a.firstBaseUpdate,a!==null){do{var k={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};w===null?h=w=k:w=w.next=k,a=a.next}while(a!==null);w===null?h=w=o:w=w.next=o}else h=w=o;a={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:w,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=o:r.next=o,a.lastBaseUpdate=o}function Ll(r,o,a,u){var h=r.updateQueue;io=!1;var w=h.firstBaseUpdate,k=h.lastBaseUpdate,P=h.shared.pending;if(P!==null){h.shared.pending=null;var M=P,J=M.next;M.next=null,k===null?w=J:k.next=J,k=M;var le=r.alternate;le!==null&&(le=le.updateQueue,P=le.lastBaseUpdate,P!==k&&(P===null?le.firstBaseUpdate=J:P.next=J,le.lastBaseUpdate=M))}if(w!==null){var pe=h.baseState;k=0,le=J=M=null,P=w;do{var ae=P.lane,be=P.eventTime;if((u&ae)===ae){le!==null&&(le=le.next={eventTime:be,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var Ce=r,Re=P;switch(ae=o,be=a,Re.tag){case 1:if(Ce=Re.payload,typeof Ce=="function"){pe=Ce.call(be,pe,ae);break e}pe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Re.payload,ae=typeof Ce=="function"?Ce.call(be,pe,ae):Ce,ae==null)break e;pe=U({},pe,ae);break e;case 2:io=!0}}P.callback!==null&&P.lane!==0&&(r.flags|=64,ae=h.effects,ae===null?h.effects=[P]:ae.push(P))}else be={eventTime:be,lane:ae,tag:P.tag,payload:P.payload,callback:P.callback,next:null},le===null?(J=le=be,M=pe):le=le.next=be,k|=ae;if(P=P.next,P===null){if(P=h.shared.pending,P===null)break;ae=P,P=ae.next,ae.next=null,h.lastBaseUpdate=ae,h.shared.pending=null}}while(!0);if(le===null&&(M=pe),h.baseState=M,h.firstBaseUpdate=J,h.lastBaseUpdate=le,o=h.shared.interleaved,o!==null){h=o;do k|=h.lane,h=h.next;while(h!==o)}else w===null&&(h.shared.lanes=0);Jo|=k,r.lanes=k,r.memoizedState=pe}}function Sg(r,o,a){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var u=r[o],h=u.callback;if(h!==null){if(u.callback=null,u=a,typeof h!="function")throw Error(n(191,h));h.call(u)}}}var ia={},gr=ro(ia),aa=ro(ia),la=ro(ia);function Zo(r){if(r===ia)throw Error(n(174));return r}function Td(r,o){switch(rt(la,o),rt(aa,r),rt(gr,ia),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:fr(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=fr(o,r)}at(gr),rt(gr,o)}function Qs(){at(gr),at(aa),at(la)}function kg(r){Zo(la.current);var o=Zo(gr.current),a=fr(o,r.type);o!==a&&(rt(aa,r),rt(gr,a))}function Rd(r){aa.current===r&&(at(gr),at(aa))}var dt=ro(0);function zl(r){for(var o=r;o!==null;){if(o.tag===13){var a=o.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Od=[];function Ad(){for(var r=0;r<Od.length;r++)Od[r]._workInProgressVersionPrimary=null;Od.length=0}var Fl=j.ReactCurrentDispatcher,Md=j.ReactCurrentBatchConfig,Yo=0,ft=null,Nt=null,At=null,Ul=!1,ca=!1,ua=0,D_=0;function Ht(){throw Error(n(321))}function Id(r,o){if(o===null)return!1;for(var a=0;a<o.length&&a<r.length;a++)if(!Qn(r[a],o[a]))return!1;return!0}function $d(r,o,a,u,h,w){if(Yo=w,ft=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Fl.current=r===null||r.memoizedState===null?U_:B_,r=a(u,h),ca){w=0;do{if(ca=!1,ua=0,25<=w)throw Error(n(301));w+=1,At=Nt=null,o.updateQueue=null,Fl.current=V_,r=a(u,h)}while(ca)}if(Fl.current=Hl,o=Nt!==null&&Nt.next!==null,Yo=0,At=Nt=ft=null,Ul=!1,o)throw Error(n(300));return r}function Dd(){var r=ua!==0;return ua=0,r}function yr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?ft.memoizedState=At=r:At=At.next=r,At}function Ln(){if(Nt===null){var r=ft.alternate;r=r!==null?r.memoizedState:null}else r=Nt.next;var o=At===null?ft.memoizedState:At.next;if(o!==null)At=o,Nt=r;else{if(r===null)throw Error(n(310));Nt=r,r={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},At===null?ft.memoizedState=At=r:At=At.next=r}return At}function da(r,o){return typeof o=="function"?o(r):o}function Ld(r){var o=Ln(),a=o.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=Nt,h=u.baseQueue,w=a.pending;if(w!==null){if(h!==null){var k=h.next;h.next=w.next,w.next=k}u.baseQueue=h=w,a.pending=null}if(h!==null){w=h.next,u=u.baseState;var P=k=null,M=null,J=w;do{var le=J.lane;if((Yo&le)===le)M!==null&&(M=M.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),u=J.hasEagerState?J.eagerState:r(u,J.action);else{var pe={lane:le,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};M===null?(P=M=pe,k=u):M=M.next=pe,ft.lanes|=le,Jo|=le}J=J.next}while(J!==null&&J!==w);M===null?k=u:M.next=P,Qn(u,o.memoizedState)||(un=!0),o.memoizedState=u,o.baseState=k,o.baseQueue=M,a.lastRenderedState=u}if(r=a.interleaved,r!==null){h=r;do w=h.lane,ft.lanes|=w,Jo|=w,h=h.next;while(h!==r)}else h===null&&(a.lanes=0);return[o.memoizedState,a.dispatch]}function zd(r){var o=Ln(),a=o.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=a.dispatch,h=a.pending,w=o.memoizedState;if(h!==null){a.pending=null;var k=h=h.next;do w=r(w,k.action),k=k.next;while(k!==h);Qn(w,o.memoizedState)||(un=!0),o.memoizedState=w,o.baseQueue===null&&(o.baseState=w),a.lastRenderedState=w}return[w,u]}function _g(){}function Cg(r,o){var a=ft,u=Ln(),h=o(),w=!Qn(u.memoizedState,h);if(w&&(u.memoizedState=h,un=!0),u=u.queue,Fd(Pg.bind(null,a,u,r),[r]),u.getSnapshot!==o||w||At!==null&&At.memoizedState.tag&1){if(a.flags|=2048,fa(9,Eg.bind(null,a,u,h,o),void 0,null),Mt===null)throw Error(n(349));(Yo&30)!==0||Ng(a,o,h)}return h}function Ng(r,o,a){r.flags|=16384,r={getSnapshot:o,value:a},o=ft.updateQueue,o===null?(o={lastEffect:null,stores:null},ft.updateQueue=o,o.stores=[r]):(a=o.stores,a===null?o.stores=[r]:a.push(r))}function Eg(r,o,a,u){o.value=a,o.getSnapshot=u,jg(o)&&Tg(r)}function Pg(r,o,a){return a(function(){jg(o)&&Tg(r)})}function jg(r){var o=r.getSnapshot;r=r.value;try{var a=o();return!Qn(r,a)}catch{return!0}}function Tg(r){var o=Ir(r,1);o!==null&&er(o,r,1,-1)}function Rg(r){var o=yr();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:r},o.queue=r,r=r.dispatch=F_.bind(null,ft,r),[o.memoizedState,r]}function fa(r,o,a,u){return r={tag:r,create:o,destroy:a,deps:u,next:null},o=ft.updateQueue,o===null?(o={lastEffect:null,stores:null},ft.updateQueue=o,o.lastEffect=r.next=r):(a=o.lastEffect,a===null?o.lastEffect=r.next=r:(u=a.next,a.next=r,r.next=u,o.lastEffect=r)),r}function Og(){return Ln().memoizedState}function Bl(r,o,a,u){var h=yr();ft.flags|=r,h.memoizedState=fa(1|o,a,void 0,u===void 0?null:u)}function Vl(r,o,a,u){var h=Ln();u=u===void 0?null:u;var w=void 0;if(Nt!==null){var k=Nt.memoizedState;if(w=k.destroy,u!==null&&Id(u,k.deps)){h.memoizedState=fa(o,a,w,u);return}}ft.flags|=r,h.memoizedState=fa(1|o,a,w,u)}function Ag(r,o){return Bl(8390656,8,r,o)}function Fd(r,o){return Vl(2048,8,r,o)}function Mg(r,o){return Vl(4,2,r,o)}function Ig(r,o){return Vl(4,4,r,o)}function $g(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Dg(r,o,a){return a=a!=null?a.concat([r]):null,Vl(4,4,$g.bind(null,o,r),a)}function Ud(){}function Lg(r,o){var a=Ln();o=o===void 0?null:o;var u=a.memoizedState;return u!==null&&o!==null&&Id(o,u[1])?u[0]:(a.memoizedState=[r,o],r)}function zg(r,o){var a=Ln();o=o===void 0?null:o;var u=a.memoizedState;return u!==null&&o!==null&&Id(o,u[1])?u[0]:(r=r(),a.memoizedState=[r,o],r)}function Fg(r,o,a){return(Yo&21)===0?(r.baseState&&(r.baseState=!1,un=!0),r.memoizedState=a):(Qn(a,o)||(a=gh(),ft.lanes|=a,Jo|=a,r.baseState=!0),o)}function L_(r,o){var a=Xe;Xe=a!==0&&4>a?a:4,r(!0);var u=Md.transition;Md.transition={};try{r(!1),o()}finally{Xe=a,Md.transition=u}}function Ug(){return Ln().memoizedState}function z_(r,o,a){var u=fo(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Bg(r))Vg(o,a);else if(a=wg(r,o,a,u),a!==null){var h=Jt();er(a,r,u,h),Hg(a,o,u)}}function F_(r,o,a){var u=fo(r),h={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Bg(r))Vg(o,h);else{var w=r.alternate;if(r.lanes===0&&(w===null||w.lanes===0)&&(w=o.lastRenderedReducer,w!==null))try{var k=o.lastRenderedState,P=w(k,a);if(h.hasEagerState=!0,h.eagerState=P,Qn(P,k)){var M=o.interleaved;M===null?(h.next=h,Pd(o)):(h.next=M.next,M.next=h),o.interleaved=h;return}}catch{}finally{}a=wg(r,o,h,u),a!==null&&(h=Jt(),er(a,r,u,h),Hg(a,o,u))}}function Bg(r){var o=r.alternate;return r===ft||o!==null&&o===ft}function Vg(r,o){ca=Ul=!0;var a=r.pending;a===null?o.next=o:(o.next=a.next,a.next=o),r.pending=o}function Hg(r,o,a){if((a&4194240)!==0){var u=o.lanes;u&=r.pendingLanes,a|=u,o.lanes=a,Vu(r,a)}}var Hl={readContext:Dn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},U_={readContext:Dn,useCallback:function(r,o){return yr().memoizedState=[r,o===void 0?null:o],r},useContext:Dn,useEffect:Ag,useImperativeHandle:function(r,o,a){return a=a!=null?a.concat([r]):null,Bl(4194308,4,$g.bind(null,o,r),a)},useLayoutEffect:function(r,o){return Bl(4194308,4,r,o)},useInsertionEffect:function(r,o){return Bl(4,2,r,o)},useMemo:function(r,o){var a=yr();return o=o===void 0?null:o,r=r(),a.memoizedState=[r,o],r},useReducer:function(r,o,a){var u=yr();return o=a!==void 0?a(o):o,u.memoizedState=u.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},u.queue=r,r=r.dispatch=z_.bind(null,ft,r),[u.memoizedState,r]},useRef:function(r){var o=yr();return r={current:r},o.memoizedState=r},useState:Rg,useDebugValue:Ud,useDeferredValue:function(r){return yr().memoizedState=r},useTransition:function(){var r=Rg(!1),o=r[0];return r=L_.bind(null,r[1]),yr().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,a){var u=ft,h=yr();if(ct){if(a===void 0)throw Error(n(407));a=a()}else{if(a=o(),Mt===null)throw Error(n(349));(Yo&30)!==0||Ng(u,o,a)}h.memoizedState=a;var w={value:a,getSnapshot:o};return h.queue=w,Ag(Pg.bind(null,u,w,r),[r]),u.flags|=2048,fa(9,Eg.bind(null,u,w,a,o),void 0,null),a},useId:function(){var r=yr(),o=Mt.identifierPrefix;if(ct){var a=Mr,u=Ar;a=(u&~(1<<32-Gn(u)-1)).toString(32)+a,o=":"+o+"R"+a,a=ua++,0<a&&(o+="H"+a.toString(32)),o+=":"}else a=D_++,o=":"+o+"r"+a.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},B_={readContext:Dn,useCallback:Lg,useContext:Dn,useEffect:Fd,useImperativeHandle:Dg,useInsertionEffect:Mg,useLayoutEffect:Ig,useMemo:zg,useReducer:Ld,useRef:Og,useState:function(){return Ld(da)},useDebugValue:Ud,useDeferredValue:function(r){var o=Ln();return Fg(o,Nt.memoizedState,r)},useTransition:function(){var r=Ld(da)[0],o=Ln().memoizedState;return[r,o]},useMutableSource:_g,useSyncExternalStore:Cg,useId:Ug,unstable_isNewReconciler:!1},V_={readContext:Dn,useCallback:Lg,useContext:Dn,useEffect:Fd,useImperativeHandle:Dg,useInsertionEffect:Mg,useLayoutEffect:Ig,useMemo:zg,useReducer:zd,useRef:Og,useState:function(){return zd(da)},useDebugValue:Ud,useDeferredValue:function(r){var o=Ln();return Nt===null?o.memoizedState=r:Fg(o,Nt.memoizedState,r)},useTransition:function(){var r=zd(da)[0],o=Ln().memoizedState;return[r,o]},useMutableSource:_g,useSyncExternalStore:Cg,useId:Ug,unstable_isNewReconciler:!1};function Yn(r,o){if(r&&r.defaultProps){o=U({},o),r=r.defaultProps;for(var a in r)o[a]===void 0&&(o[a]=r[a]);return o}return o}function Bd(r,o,a,u){o=r.memoizedState,a=a(u,o),a=a==null?o:U({},o,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Wl={isMounted:function(r){return(r=r._reactInternals)?Ho(r)===r:!1},enqueueSetState:function(r,o,a){r=r._reactInternals;var u=Jt(),h=fo(r),w=$r(u,h);w.payload=o,a!=null&&(w.callback=a),o=ao(r,w,h),o!==null&&(er(o,r,h,u),Dl(o,r,h))},enqueueReplaceState:function(r,o,a){r=r._reactInternals;var u=Jt(),h=fo(r),w=$r(u,h);w.tag=1,w.payload=o,a!=null&&(w.callback=a),o=ao(r,w,h),o!==null&&(er(o,r,h,u),Dl(o,r,h))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var a=Jt(),u=fo(r),h=$r(a,u);h.tag=2,o!=null&&(h.callback=o),o=ao(r,h,u),o!==null&&(er(o,r,u,a),Dl(o,r,u))}};function Wg(r,o,a,u,h,w,k){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,w,k):o.prototype&&o.prototype.isPureReactComponent?!Ji(a,u)||!Ji(h,w):!0}function qg(r,o,a){var u=!1,h=oo,w=o.contextType;return typeof w=="object"&&w!==null?w=Dn(w):(h=cn(o)?qo:Vt.current,u=o.contextTypes,w=(u=u!=null)?Bs(r,h):oo),o=new o(a,w),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Wl,r.stateNode=o,o._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=h,r.__reactInternalMemoizedMaskedChildContext=w),o}function Kg(r,o,a,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(a,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(a,u),o.state!==r&&Wl.enqueueReplaceState(o,o.state,null)}function Vd(r,o,a,u){var h=r.stateNode;h.props=a,h.state=r.memoizedState,h.refs={},jd(r);var w=o.contextType;typeof w=="object"&&w!==null?h.context=Dn(w):(w=cn(o)?qo:Vt.current,h.context=Bs(r,w)),h.state=r.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Bd(r,o,w,a),h.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(o=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),o!==h.state&&Wl.enqueueReplaceState(h,h.state,null),Ll(r,a,h,u),h.state=r.memoizedState),typeof h.componentDidMount=="function"&&(r.flags|=4194308)}function Zs(r,o){try{var a="",u=o;do a+=L(u),u=u.return;while(u);var h=a}catch(w){h=`
40
- Error generating stack: `+w.message+`
41
- `+w.stack}return{value:r,source:o,stack:h,digest:null}}function Hd(r,o,a){return{value:r,source:null,stack:a??null,digest:o??null}}function Wd(r,o){try{console.error(o.value)}catch(a){setTimeout(function(){throw a})}}var H_=typeof WeakMap=="function"?WeakMap:Map;function Gg(r,o,a){a=$r(-1,a),a.tag=3,a.payload={element:null};var u=o.value;return a.callback=function(){Jl||(Jl=!0,af=u),Wd(r,o)},a}function Qg(r,o,a){a=$r(-1,a),a.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;a.payload=function(){return u(h)},a.callback=function(){Wd(r,o)}}var w=r.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){Wd(r,o),typeof u!="function"&&(co===null?co=new Set([this]):co.add(this));var k=o.stack;this.componentDidCatch(o.value,{componentStack:k!==null?k:""})}),a}function Zg(r,o,a){var u=r.pingCache;if(u===null){u=r.pingCache=new H_;var h=new Set;u.set(o,h)}else h=u.get(o),h===void 0&&(h=new Set,u.set(o,h));h.has(a)||(h.add(a),r=oC.bind(null,r,o,a),o.then(r,r))}function Yg(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function Jg(r,o,a,u,h){return(r.mode&1)===0?(r===o?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(o=$r(-1,1),o.tag=2,ao(a,o,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=h,r)}var W_=j.ReactCurrentOwner,un=!1;function Yt(r,o,a,u){o.child=r===null?vg(o,null,a,u):qs(o,r.child,a,u)}function Xg(r,o,a,u,h){a=a.render;var w=o.ref;return Gs(o,h),u=$d(r,o,a,u,w,h),a=Dd(),r!==null&&!un?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~h,Dr(r,o,h)):(ct&&a&&wd(o),o.flags|=1,Yt(r,o,u,h),o.child)}function ey(r,o,a,u,h){if(r===null){var w=a.type;return typeof w=="function"&&!mf(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(o.tag=15,o.type=w,ty(r,o,w,u,h)):(r=oc(a.type,null,u,o,o.mode,h),r.ref=o.ref,r.return=o,o.child=r)}if(w=r.child,(r.lanes&h)===0){var k=w.memoizedProps;if(a=a.compare,a=a!==null?a:Ji,a(k,u)&&r.ref===o.ref)return Dr(r,o,h)}return o.flags|=1,r=mo(w,u),r.ref=o.ref,r.return=o,o.child=r}function ty(r,o,a,u,h){if(r!==null){var w=r.memoizedProps;if(Ji(w,u)&&r.ref===o.ref)if(un=!1,o.pendingProps=u=w,(r.lanes&h)!==0)(r.flags&131072)!==0&&(un=!0);else return o.lanes=r.lanes,Dr(r,o,h)}return qd(r,o,a,u,h)}function ny(r,o,a){var u=o.pendingProps,h=u.children,w=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(Js,Nn),Nn|=a;else{if((a&1073741824)===0)return r=w!==null?w.baseLanes|a:a,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,rt(Js,Nn),Nn|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=w!==null?w.baseLanes:a,rt(Js,Nn),Nn|=u}else w!==null?(u=w.baseLanes|a,o.memoizedState=null):u=a,rt(Js,Nn),Nn|=u;return Yt(r,o,h,a),o.child}function ry(r,o){var a=o.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(o.flags|=512,o.flags|=2097152)}function qd(r,o,a,u,h){var w=cn(a)?qo:Vt.current;return w=Bs(o,w),Gs(o,h),a=$d(r,o,a,u,w,h),u=Dd(),r!==null&&!un?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~h,Dr(r,o,h)):(ct&&u&&wd(o),o.flags|=1,Yt(r,o,a,h),o.child)}function oy(r,o,a,u,h){if(cn(a)){var w=!0;jl(o)}else w=!1;if(Gs(o,h),o.stateNode===null)Kl(r,o),qg(o,a,u),Vd(o,a,u,h),u=!0;else if(r===null){var k=o.stateNode,P=o.memoizedProps;k.props=P;var M=k.context,J=a.contextType;typeof J=="object"&&J!==null?J=Dn(J):(J=cn(a)?qo:Vt.current,J=Bs(o,J));var le=a.getDerivedStateFromProps,pe=typeof le=="function"||typeof k.getSnapshotBeforeUpdate=="function";pe||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==u||M!==J)&&Kg(o,k,u,J),io=!1;var ae=o.memoizedState;k.state=ae,Ll(o,u,k,h),M=o.memoizedState,P!==u||ae!==M||ln.current||io?(typeof le=="function"&&(Bd(o,a,le,u),M=o.memoizedState),(P=io||Wg(o,a,P,u,ae,M,J))?(pe||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(o.flags|=4194308)):(typeof k.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=M),k.props=u,k.state=M,k.context=J,u=P):(typeof k.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{k=o.stateNode,xg(r,o),P=o.memoizedProps,J=o.type===o.elementType?P:Yn(o.type,P),k.props=J,pe=o.pendingProps,ae=k.context,M=a.contextType,typeof M=="object"&&M!==null?M=Dn(M):(M=cn(a)?qo:Vt.current,M=Bs(o,M));var be=a.getDerivedStateFromProps;(le=typeof be=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==pe||ae!==M)&&Kg(o,k,u,M),io=!1,ae=o.memoizedState,k.state=ae,Ll(o,u,k,h);var Ce=o.memoizedState;P!==pe||ae!==Ce||ln.current||io?(typeof be=="function"&&(Bd(o,a,be,u),Ce=o.memoizedState),(J=io||Wg(o,a,J,u,ae,Ce,M)||!1)?(le||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(u,Ce,M),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(u,Ce,M)),typeof k.componentDidUpdate=="function"&&(o.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof k.componentDidUpdate!="function"||P===r.memoizedProps&&ae===r.memoizedState||(o.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&ae===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=Ce),k.props=u,k.state=Ce,k.context=M,u=J):(typeof k.componentDidUpdate!="function"||P===r.memoizedProps&&ae===r.memoizedState||(o.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===r.memoizedProps&&ae===r.memoizedState||(o.flags|=1024),u=!1)}return Kd(r,o,a,u,w,h)}function Kd(r,o,a,u,h,w){ry(r,o);var k=(o.flags&128)!==0;if(!u&&!k)return h&&cg(o,a,!1),Dr(r,o,w);u=o.stateNode,W_.current=o;var P=k&&typeof a.getDerivedStateFromError!="function"?null:u.render();return o.flags|=1,r!==null&&k?(o.child=qs(o,r.child,null,w),o.child=qs(o,null,P,w)):Yt(r,o,P,w),o.memoizedState=u.state,h&&cg(o,a,!0),o.child}function sy(r){var o=r.stateNode;o.pendingContext?ag(r,o.pendingContext,o.pendingContext!==o.context):o.context&&ag(r,o.context,!1),Td(r,o.containerInfo)}function iy(r,o,a,u,h){return Ws(),kd(h),o.flags|=256,Yt(r,o,a,u),o.child}var Gd={dehydrated:null,treeContext:null,retryLane:0};function Qd(r){return{baseLanes:r,cachePool:null,transitions:null}}function ay(r,o,a){var u=o.pendingProps,h=dt.current,w=!1,k=(o.flags&128)!==0,P;if((P=k)||(P=r!==null&&r.memoizedState===null?!1:(h&2)!==0),P?(w=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(h|=1),rt(dt,h&1),r===null)return Sd(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((o.mode&1)===0?o.lanes=1:r.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(k=u.children,r=u.fallback,w?(u=o.mode,w=o.child,k={mode:"hidden",children:k},(u&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=k):w=sc(k,u,0,null),r=ns(r,u,a,null),w.return=o,r.return=o,w.sibling=r,o.child=w,o.child.memoizedState=Qd(a),o.memoizedState=Gd,r):Zd(o,k));if(h=r.memoizedState,h!==null&&(P=h.dehydrated,P!==null))return q_(r,o,k,u,P,h,a);if(w){w=u.fallback,k=o.mode,h=r.child,P=h.sibling;var M={mode:"hidden",children:u.children};return(k&1)===0&&o.child!==h?(u=o.child,u.childLanes=0,u.pendingProps=M,o.deletions=null):(u=mo(h,M),u.subtreeFlags=h.subtreeFlags&14680064),P!==null?w=mo(P,w):(w=ns(w,k,a,null),w.flags|=2),w.return=o,u.return=o,u.sibling=w,o.child=u,u=w,w=o.child,k=r.child.memoizedState,k=k===null?Qd(a):{baseLanes:k.baseLanes|a,cachePool:null,transitions:k.transitions},w.memoizedState=k,w.childLanes=r.childLanes&~a,o.memoizedState=Gd,u}return w=r.child,r=w.sibling,u=mo(w,{mode:"visible",children:u.children}),(o.mode&1)===0&&(u.lanes=a),u.return=o,u.sibling=null,r!==null&&(a=o.deletions,a===null?(o.deletions=[r],o.flags|=16):a.push(r)),o.child=u,o.memoizedState=null,u}function Zd(r,o){return o=sc({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function ql(r,o,a,u){return u!==null&&kd(u),qs(o,r.child,null,a),r=Zd(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function q_(r,o,a,u,h,w,k){if(a)return o.flags&256?(o.flags&=-257,u=Hd(Error(n(422))),ql(r,o,k,u)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(w=u.fallback,h=o.mode,u=sc({mode:"visible",children:u.children},h,0,null),w=ns(w,h,k,null),w.flags|=2,u.return=o,w.return=o,u.sibling=w,o.child=u,(o.mode&1)!==0&&qs(o,r.child,null,k),o.child.memoizedState=Qd(k),o.memoizedState=Gd,w);if((o.mode&1)===0)return ql(r,o,k,null);if(h.data==="$!"){if(u=h.nextSibling&&h.nextSibling.dataset,u)var P=u.dgst;return u=P,w=Error(n(419)),u=Hd(w,u,void 0),ql(r,o,k,u)}if(P=(k&r.childLanes)!==0,un||P){if(u=Mt,u!==null){switch(k&-k){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&(u.suspendedLanes|k))!==0?0:h,h!==0&&h!==w.retryLane&&(w.retryLane=h,Ir(r,h),er(u,r,h,-1))}return pf(),u=Hd(Error(n(421))),ql(r,o,k,u)}return h.data==="$?"?(o.flags|=128,o.child=r.child,o=sC.bind(null,r),h._reactRetry=o,null):(r=w.treeContext,Cn=no(h.nextSibling),_n=o,ct=!0,Zn=null,r!==null&&(In[$n++]=Ar,In[$n++]=Mr,In[$n++]=Ko,Ar=r.id,Mr=r.overflow,Ko=o),o=Zd(o,u.children),o.flags|=4096,o)}function ly(r,o,a){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),Ed(r.return,o,a)}function Yd(r,o,a,u,h){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:h}:(w.isBackwards=o,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=a,w.tailMode=h)}function cy(r,o,a){var u=o.pendingProps,h=u.revealOrder,w=u.tail;if(Yt(r,o,u.children,a),u=dt.current,(u&2)!==0)u=u&1|2,o.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ly(r,a,o);else if(r.tag===19)ly(r,a,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}u&=1}if(rt(dt,u),(o.mode&1)===0)o.memoizedState=null;else switch(h){case"forwards":for(a=o.child,h=null;a!==null;)r=a.alternate,r!==null&&zl(r)===null&&(h=a),a=a.sibling;a=h,a===null?(h=o.child,o.child=null):(h=a.sibling,a.sibling=null),Yd(o,!1,h,a,w);break;case"backwards":for(a=null,h=o.child,o.child=null;h!==null;){if(r=h.alternate,r!==null&&zl(r)===null){o.child=h;break}r=h.sibling,h.sibling=a,a=h,h=r}Yd(o,!0,a,null,w);break;case"together":Yd(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Kl(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function Dr(r,o,a){if(r!==null&&(o.dependencies=r.dependencies),Jo|=o.lanes,(a&o.childLanes)===0)return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,a=mo(r,r.pendingProps),o.child=a,a.return=o;r.sibling!==null;)r=r.sibling,a=a.sibling=mo(r,r.pendingProps),a.return=o;a.sibling=null}return o.child}function K_(r,o,a){switch(o.tag){case 3:sy(o),Ws();break;case 5:kg(o);break;case 1:cn(o.type)&&jl(o);break;case 4:Td(o,o.stateNode.containerInfo);break;case 10:var u=o.type._context,h=o.memoizedProps.value;rt(Il,u._currentValue),u._currentValue=h;break;case 13:if(u=o.memoizedState,u!==null)return u.dehydrated!==null?(rt(dt,dt.current&1),o.flags|=128,null):(a&o.child.childLanes)!==0?ay(r,o,a):(rt(dt,dt.current&1),r=Dr(r,o,a),r!==null?r.sibling:null);rt(dt,dt.current&1);break;case 19:if(u=(a&o.childLanes)!==0,(r.flags&128)!==0){if(u)return cy(r,o,a);o.flags|=128}if(h=o.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),rt(dt,dt.current),u)break;return null;case 22:case 23:return o.lanes=0,ny(r,o,a)}return Dr(r,o,a)}var uy,Jd,dy,fy;uy=function(r,o){for(var a=o.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},Jd=function(){},dy=function(r,o,a,u){var h=r.memoizedProps;if(h!==u){r=o.stateNode,Zo(gr.current);var w=null;switch(a){case"input":h=Ge(r,h),u=Ge(r,u),w=[];break;case"select":h=U({},h,{value:void 0}),u=U({},u,{value:void 0}),w=[];break;case"textarea":h=ht(r,h),u=ht(r,u),w=[];break;default:typeof h.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=Nl)}se(a,u);var k;a=null;for(J in h)if(!u.hasOwnProperty(J)&&h.hasOwnProperty(J)&&h[J]!=null)if(J==="style"){var P=h[J];for(k in P)P.hasOwnProperty(k)&&(a||(a={}),a[k]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(i.hasOwnProperty(J)?w||(w=[]):(w=w||[]).push(J,null));for(J in u){var M=u[J];if(P=h!=null?h[J]:void 0,u.hasOwnProperty(J)&&M!==P&&(M!=null||P!=null))if(J==="style")if(P){for(k in P)!P.hasOwnProperty(k)||M&&M.hasOwnProperty(k)||(a||(a={}),a[k]="");for(k in M)M.hasOwnProperty(k)&&P[k]!==M[k]&&(a||(a={}),a[k]=M[k])}else a||(w||(w=[]),w.push(J,a)),a=M;else J==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,P=P?P.__html:void 0,M!=null&&P!==M&&(w=w||[]).push(J,M)):J==="children"?typeof M!="string"&&typeof M!="number"||(w=w||[]).push(J,""+M):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(i.hasOwnProperty(J)?(M!=null&&J==="onScroll"&&it("scroll",r),w||P===M||(w=[])):(w=w||[]).push(J,M))}a&&(w=w||[]).push("style",a);var J=w;(o.updateQueue=J)&&(o.flags|=4)}},fy=function(r,o,a,u){a!==u&&(o.flags|=4)};function pa(r,o){if(!ct)switch(r.tailMode){case"hidden":o=r.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function Wt(r){var o=r.alternate!==null&&r.alternate.child===r.child,a=0,u=0;if(o)for(var h=r.child;h!==null;)a|=h.lanes|h.childLanes,u|=h.subtreeFlags&14680064,u|=h.flags&14680064,h.return=r,h=h.sibling;else for(h=r.child;h!==null;)a|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=r,h=h.sibling;return r.subtreeFlags|=u,r.childLanes=a,o}function G_(r,o,a){var u=o.pendingProps;switch(xd(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(o),null;case 1:return cn(o.type)&&Pl(),Wt(o),null;case 3:return u=o.stateNode,Qs(),at(ln),at(Vt),Ad(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Al(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Zn!==null&&(uf(Zn),Zn=null))),Jd(r,o),Wt(o),null;case 5:Rd(o);var h=Zo(la.current);if(a=o.type,r!==null&&o.stateNode!=null)dy(r,o,a,u,h),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!u){if(o.stateNode===null)throw Error(n(166));return Wt(o),null}if(r=Zo(gr.current),Al(o)){u=o.stateNode,a=o.type;var w=o.memoizedProps;switch(u[hr]=o,u[ra]=w,r=(o.mode&1)!==0,a){case"dialog":it("cancel",u),it("close",u);break;case"iframe":case"object":case"embed":it("load",u);break;case"video":case"audio":for(h=0;h<ea.length;h++)it(ea[h],u);break;case"source":it("error",u);break;case"img":case"image":case"link":it("error",u),it("load",u);break;case"details":it("toggle",u);break;case"input":Lt(u,w),it("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!w.multiple},it("invalid",u);break;case"textarea":On(u,w),it("invalid",u)}se(a,w),h=null;for(var k in w)if(w.hasOwnProperty(k)){var P=w[k];k==="children"?typeof P=="string"?u.textContent!==P&&(w.suppressHydrationWarning!==!0&&Cl(u.textContent,P,r),h=["children",P]):typeof P=="number"&&u.textContent!==""+P&&(w.suppressHydrationWarning!==!0&&Cl(u.textContent,P,r),h=["children",""+P]):i.hasOwnProperty(k)&&P!=null&&k==="onScroll"&&it("scroll",u)}switch(a){case"input":Fe(u),qn(u,w,!0);break;case"textarea":Fe(u),Os(u);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(u.onclick=Nl)}u=h,o.updateQueue=u,u!==null&&(o.flags|=4)}else{k=h.nodeType===9?h:h.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Ct(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=k.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=k.createElement(a,{is:u.is}):(r=k.createElement(a),a==="select"&&(k=r,u.multiple?k.multiple=!0:u.size&&(k.size=u.size))):r=k.createElementNS(r,a),r[hr]=o,r[ra]=u,uy(r,o,!1,!1),o.stateNode=r;e:{switch(k=xe(a,u),a){case"dialog":it("cancel",r),it("close",r),h=u;break;case"iframe":case"object":case"embed":it("load",r),h=u;break;case"video":case"audio":for(h=0;h<ea.length;h++)it(ea[h],r);h=u;break;case"source":it("error",r),h=u;break;case"img":case"image":case"link":it("error",r),it("load",r),h=u;break;case"details":it("toggle",r),h=u;break;case"input":Lt(r,u),h=Ge(r,u),it("invalid",r);break;case"option":h=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},h=U({},u,{value:void 0}),it("invalid",r);break;case"textarea":On(r,u),h=ht(r,u),it("invalid",r);break;default:h=u}se(a,h),P=h;for(w in P)if(P.hasOwnProperty(w)){var M=P[w];w==="style"?Vo(r,M):w==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&An(r,M)):w==="children"?typeof M=="string"?(a!=="textarea"||M!=="")&&st(r,M):typeof M=="number"&&st(r,""+M):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(i.hasOwnProperty(w)?M!=null&&w==="onScroll"&&it("scroll",r):M!=null&&T(r,w,M,k))}switch(a){case"input":Fe(r),qn(r,u,!1);break;case"textarea":Fe(r),Os(r);break;case"option":u.value!=null&&r.setAttribute("value",""+oe(u.value));break;case"select":r.multiple=!!u.multiple,w=u.value,w!=null?bn(r,!!u.multiple,w,!1):u.defaultValue!=null&&bn(r,!!u.multiple,u.defaultValue,!0);break;default:typeof h.onClick=="function"&&(r.onclick=Nl)}switch(a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return Wt(o),null;case 6:if(r&&o.stateNode!=null)fy(r,o,r.memoizedProps,u);else{if(typeof u!="string"&&o.stateNode===null)throw Error(n(166));if(a=Zo(la.current),Zo(gr.current),Al(o)){if(u=o.stateNode,a=o.memoizedProps,u[hr]=o,(w=u.nodeValue!==a)&&(r=_n,r!==null))switch(r.tag){case 3:Cl(u.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Cl(u.nodeValue,a,(r.mode&1)!==0)}w&&(o.flags|=4)}else u=(a.nodeType===9?a:a.ownerDocument).createTextNode(u),u[hr]=o,o.stateNode=u}return Wt(o),null;case 13:if(at(dt),u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(ct&&Cn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)hg(),Ws(),o.flags|=98560,w=!1;else if(w=Al(o),u!==null&&u.dehydrated!==null){if(r===null){if(!w)throw Error(n(318));if(w=o.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[hr]=o}else Ws(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Wt(o),w=!1}else Zn!==null&&(uf(Zn),Zn=null),w=!0;if(!w)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=a,o):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(o.child.flags|=8192,(o.mode&1)!==0&&(r===null||(dt.current&1)!==0?Et===0&&(Et=3):pf())),o.updateQueue!==null&&(o.flags|=4),Wt(o),null);case 4:return Qs(),Jd(r,o),r===null&&ta(o.stateNode.containerInfo),Wt(o),null;case 10:return Nd(o.type._context),Wt(o),null;case 17:return cn(o.type)&&Pl(),Wt(o),null;case 19:if(at(dt),w=o.memoizedState,w===null)return Wt(o),null;if(u=(o.flags&128)!==0,k=w.rendering,k===null)if(u)pa(w,!1);else{if(Et!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(k=zl(r),k!==null){for(o.flags|=128,pa(w,!1),u=k.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),o.subtreeFlags=0,u=a,a=o.child;a!==null;)w=a,r=u,w.flags&=14680066,k=w.alternate,k===null?(w.childLanes=0,w.lanes=r,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=k.childLanes,w.lanes=k.lanes,w.child=k.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=k.memoizedProps,w.memoizedState=k.memoizedState,w.updateQueue=k.updateQueue,w.type=k.type,r=k.dependencies,w.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return rt(dt,dt.current&1|2),o.child}r=r.sibling}w.tail!==null&&yt()>Xs&&(o.flags|=128,u=!0,pa(w,!1),o.lanes=4194304)}else{if(!u)if(r=zl(k),r!==null){if(o.flags|=128,u=!0,a=r.updateQueue,a!==null&&(o.updateQueue=a,o.flags|=4),pa(w,!0),w.tail===null&&w.tailMode==="hidden"&&!k.alternate&&!ct)return Wt(o),null}else 2*yt()-w.renderingStartTime>Xs&&a!==1073741824&&(o.flags|=128,u=!0,pa(w,!1),o.lanes=4194304);w.isBackwards?(k.sibling=o.child,o.child=k):(a=w.last,a!==null?a.sibling=k:o.child=k,w.last=k)}return w.tail!==null?(o=w.tail,w.rendering=o,w.tail=o.sibling,w.renderingStartTime=yt(),o.sibling=null,a=dt.current,rt(dt,u?a&1|2:a&1),o):(Wt(o),null);case 22:case 23:return ff(),u=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(o.flags|=8192),u&&(o.mode&1)!==0?(Nn&1073741824)!==0&&(Wt(o),o.subtreeFlags&6&&(o.flags|=8192)):Wt(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function Q_(r,o){switch(xd(o),o.tag){case 1:return cn(o.type)&&Pl(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Qs(),at(ln),at(Vt),Ad(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return Rd(o),null;case 13:if(at(dt),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ws()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return at(dt),null;case 4:return Qs(),null;case 10:return Nd(o.type._context),null;case 22:case 23:return ff(),null;case 24:return null;default:return null}}var Gl=!1,qt=!1,Z_=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Ys(r,o){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){pt(r,o,u)}else a.current=null}function Xd(r,o,a){try{a()}catch(u){pt(r,o,u)}}var py=!1;function Y_(r,o){if(dd=ml,r=Wh(),rd(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var h=u.anchorOffset,w=u.focusNode;u=u.focusOffset;try{a.nodeType,w.nodeType}catch{a=null;break e}var k=0,P=-1,M=-1,J=0,le=0,pe=r,ae=null;t:for(;;){for(var be;pe!==a||h!==0&&pe.nodeType!==3||(P=k+h),pe!==w||u!==0&&pe.nodeType!==3||(M=k+u),pe.nodeType===3&&(k+=pe.nodeValue.length),(be=pe.firstChild)!==null;)ae=pe,pe=be;for(;;){if(pe===r)break t;if(ae===a&&++J===h&&(P=k),ae===w&&++le===u&&(M=k),(be=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=be}a=P===-1||M===-1?null:{start:P,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(fd={focusedElem:r,selectionRange:a},ml=!1,ke=o;ke!==null;)if(o=ke,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,ke=r;else for(;ke!==null;){o=ke;try{var Ce=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var Re=Ce.memoizedProps,vt=Ce.memoizedState,K=o.stateNode,z=K.getSnapshotBeforeUpdate(o.elementType===o.type?Re:Yn(o.type,Re),vt);K.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var Q=o.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(he){pt(o,o.return,he)}if(r=o.sibling,r!==null){r.return=o.return,ke=r;break}ke=o.return}return Ce=py,py=!1,Ce}function ma(r,o,a){var u=o.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&r)===r){var w=h.destroy;h.destroy=void 0,w!==void 0&&Xd(o,a,w)}h=h.next}while(h!==u)}}function Ql(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var a=o=o.next;do{if((a.tag&r)===r){var u=a.create;a.destroy=u()}a=a.next}while(a!==o)}}function ef(r){var o=r.ref;if(o!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof o=="function"?o(r):o.current=r}}function my(r){var o=r.alternate;o!==null&&(r.alternate=null,my(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[hr],delete o[ra],delete o[gd],delete o[A_],delete o[M_])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function hy(r){return r.tag===5||r.tag===3||r.tag===4}function gy(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||hy(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function tf(r,o,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?a.nodeType===8?a.parentNode.insertBefore(r,o):a.insertBefore(r,o):(a.nodeType===8?(o=a.parentNode,o.insertBefore(r,a)):(o=a,o.appendChild(r)),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=Nl));else if(u!==4&&(r=r.child,r!==null))for(tf(r,o,a),r=r.sibling;r!==null;)tf(r,o,a),r=r.sibling}function nf(r,o,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?a.insertBefore(r,o):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(nf(r,o,a),r=r.sibling;r!==null;)nf(r,o,a),r=r.sibling}var Ft=null,Jn=!1;function lo(r,o,a){for(a=a.child;a!==null;)yy(r,o,a),a=a.sibling}function yy(r,o,a){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(ll,a)}catch{}switch(a.tag){case 5:qt||Ys(a,o);case 6:var u=Ft,h=Jn;Ft=null,lo(r,o,a),Ft=u,Jn=h,Ft!==null&&(Jn?(r=Ft,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Ft.removeChild(a.stateNode));break;case 18:Ft!==null&&(Jn?(r=Ft,a=a.stateNode,r.nodeType===8?hd(r.parentNode,a):r.nodeType===1&&hd(r,a),qi(r)):hd(Ft,a.stateNode));break;case 4:u=Ft,h=Jn,Ft=a.stateNode.containerInfo,Jn=!0,lo(r,o,a),Ft=u,Jn=h;break;case 0:case 11:case 14:case 15:if(!qt&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){h=u=u.next;do{var w=h,k=w.destroy;w=w.tag,k!==void 0&&((w&2)!==0||(w&4)!==0)&&Xd(a,o,k),h=h.next}while(h!==u)}lo(r,o,a);break;case 1:if(!qt&&(Ys(a,o),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(P){pt(a,o,P)}lo(r,o,a);break;case 21:lo(r,o,a);break;case 22:a.mode&1?(qt=(u=qt)||a.memoizedState!==null,lo(r,o,a),qt=u):lo(r,o,a);break;default:lo(r,o,a)}}function vy(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new Z_),o.forEach(function(u){var h=iC.bind(null,r,u);a.has(u)||(a.add(u),u.then(h,h))})}}function Xn(r,o){var a=o.deletions;if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];try{var w=r,k=o,P=k;e:for(;P!==null;){switch(P.tag){case 5:Ft=P.stateNode,Jn=!1;break e;case 3:Ft=P.stateNode.containerInfo,Jn=!0;break e;case 4:Ft=P.stateNode.containerInfo,Jn=!0;break e}P=P.return}if(Ft===null)throw Error(n(160));yy(w,k,h),Ft=null,Jn=!1;var M=h.alternate;M!==null&&(M.return=null),h.return=null}catch(J){pt(h,o,J)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)wy(o,r),o=o.sibling}function wy(r,o){var a=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Xn(o,r),vr(r),u&4){try{ma(3,r,r.return),Ql(3,r)}catch(Re){pt(r,r.return,Re)}try{ma(5,r,r.return)}catch(Re){pt(r,r.return,Re)}}break;case 1:Xn(o,r),vr(r),u&512&&a!==null&&Ys(a,a.return);break;case 5:if(Xn(o,r),vr(r),u&512&&a!==null&&Ys(a,a.return),r.flags&32){var h=r.stateNode;try{st(h,"")}catch(Re){pt(r,r.return,Re)}}if(u&4&&(h=r.stateNode,h!=null)){var w=r.memoizedProps,k=a!==null?a.memoizedProps:w,P=r.type,M=r.updateQueue;if(r.updateQueue=null,M!==null)try{P==="input"&&w.type==="radio"&&w.name!=null&&Zt(h,w),xe(P,k);var J=xe(P,w);for(k=0;k<M.length;k+=2){var le=M[k],pe=M[k+1];le==="style"?Vo(h,pe):le==="dangerouslySetInnerHTML"?An(h,pe):le==="children"?st(h,pe):T(h,le,pe,J)}switch(P){case"input":ut(h,w);break;case"textarea":Rs(h,w);break;case"select":var ae=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!w.multiple;var be=w.value;be!=null?bn(h,!!w.multiple,be,!1):ae!==!!w.multiple&&(w.defaultValue!=null?bn(h,!!w.multiple,w.defaultValue,!0):bn(h,!!w.multiple,w.multiple?[]:"",!1))}h[ra]=w}catch(Re){pt(r,r.return,Re)}}break;case 6:if(Xn(o,r),vr(r),u&4){if(r.stateNode===null)throw Error(n(162));h=r.stateNode,w=r.memoizedProps;try{h.nodeValue=w}catch(Re){pt(r,r.return,Re)}}break;case 3:if(Xn(o,r),vr(r),u&4&&a!==null&&a.memoizedState.isDehydrated)try{qi(o.containerInfo)}catch(Re){pt(r,r.return,Re)}break;case 4:Xn(o,r),vr(r);break;case 13:Xn(o,r),vr(r),h=r.child,h.flags&8192&&(w=h.memoizedState!==null,h.stateNode.isHidden=w,!w||h.alternate!==null&&h.alternate.memoizedState!==null||(sf=yt())),u&4&&vy(r);break;case 22:if(le=a!==null&&a.memoizedState!==null,r.mode&1?(qt=(J=qt)||le,Xn(o,r),qt=J):Xn(o,r),vr(r),u&8192){if(J=r.memoizedState!==null,(r.stateNode.isHidden=J)&&!le&&(r.mode&1)!==0)for(ke=r,le=r.child;le!==null;){for(pe=ke=le;ke!==null;){switch(ae=ke,be=ae.child,ae.tag){case 0:case 11:case 14:case 15:ma(4,ae,ae.return);break;case 1:Ys(ae,ae.return);var Ce=ae.stateNode;if(typeof Ce.componentWillUnmount=="function"){u=ae,a=ae.return;try{o=u,Ce.props=o.memoizedProps,Ce.state=o.memoizedState,Ce.componentWillUnmount()}catch(Re){pt(u,a,Re)}}break;case 5:Ys(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Sy(pe);continue}}be!==null?(be.return=ae,ke=be):Sy(pe)}le=le.sibling}e:for(le=null,pe=r;;){if(pe.tag===5){if(le===null){le=pe;try{h=pe.stateNode,J?(w=h.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(P=pe.stateNode,M=pe.memoizedProps.style,k=M!=null&&M.hasOwnProperty("display")?M.display:null,P.style.display=Bo("display",k))}catch(Re){pt(r,r.return,Re)}}}else if(pe.tag===6){if(le===null)try{pe.stateNode.nodeValue=J?"":pe.memoizedProps}catch(Re){pt(r,r.return,Re)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===r)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===r)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===r)break e;le===pe&&(le=null),pe=pe.return}le===pe&&(le=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:Xn(o,r),vr(r),u&4&&vy(r);break;case 21:break;default:Xn(o,r),vr(r)}}function vr(r){var o=r.flags;if(o&2){try{e:{for(var a=r.return;a!==null;){if(hy(a)){var u=a;break e}a=a.return}throw Error(n(160))}switch(u.tag){case 5:var h=u.stateNode;u.flags&32&&(st(h,""),u.flags&=-33);var w=gy(r);nf(r,w,h);break;case 3:case 4:var k=u.stateNode.containerInfo,P=gy(r);tf(r,P,k);break;default:throw Error(n(161))}}catch(M){pt(r,r.return,M)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function J_(r,o,a){ke=r,xy(r)}function xy(r,o,a){for(var u=(r.mode&1)!==0;ke!==null;){var h=ke,w=h.child;if(h.tag===22&&u){var k=h.memoizedState!==null||Gl;if(!k){var P=h.alternate,M=P!==null&&P.memoizedState!==null||qt;P=Gl;var J=qt;if(Gl=k,(qt=M)&&!J)for(ke=h;ke!==null;)k=ke,M=k.child,k.tag===22&&k.memoizedState!==null?ky(h):M!==null?(M.return=k,ke=M):ky(h);for(;w!==null;)ke=w,xy(w),w=w.sibling;ke=h,Gl=P,qt=J}by(r)}else(h.subtreeFlags&8772)!==0&&w!==null?(w.return=h,ke=w):by(r)}}function by(r){for(;ke!==null;){var o=ke;if((o.flags&8772)!==0){var a=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:qt||Ql(5,o);break;case 1:var u=o.stateNode;if(o.flags&4&&!qt)if(a===null)u.componentDidMount();else{var h=o.elementType===o.type?a.memoizedProps:Yn(o.type,a.memoizedProps);u.componentDidUpdate(h,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var w=o.updateQueue;w!==null&&Sg(o,w,u);break;case 3:var k=o.updateQueue;if(k!==null){if(a=null,o.child!==null)switch(o.child.tag){case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}Sg(o,k,a)}break;case 5:var P=o.stateNode;if(a===null&&o.flags&4){a=P;var M=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&a.focus();break;case"img":M.src&&(a.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var J=o.alternate;if(J!==null){var le=J.memoizedState;if(le!==null){var pe=le.dehydrated;pe!==null&&qi(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qt||o.flags&512&&ef(o)}catch(ae){pt(o,o.return,ae)}}if(o===r){ke=null;break}if(a=o.sibling,a!==null){a.return=o.return,ke=a;break}ke=o.return}}function Sy(r){for(;ke!==null;){var o=ke;if(o===r){ke=null;break}var a=o.sibling;if(a!==null){a.return=o.return,ke=a;break}ke=o.return}}function ky(r){for(;ke!==null;){var o=ke;try{switch(o.tag){case 0:case 11:case 15:var a=o.return;try{Ql(4,o)}catch(M){pt(o,a,M)}break;case 1:var u=o.stateNode;if(typeof u.componentDidMount=="function"){var h=o.return;try{u.componentDidMount()}catch(M){pt(o,h,M)}}var w=o.return;try{ef(o)}catch(M){pt(o,w,M)}break;case 5:var k=o.return;try{ef(o)}catch(M){pt(o,k,M)}}}catch(M){pt(o,o.return,M)}if(o===r){ke=null;break}var P=o.sibling;if(P!==null){P.return=o.return,ke=P;break}ke=o.return}}var X_=Math.ceil,Zl=j.ReactCurrentDispatcher,rf=j.ReactCurrentOwner,zn=j.ReactCurrentBatchConfig,Qe=0,Mt=null,St=null,Ut=0,Nn=0,Js=ro(0),Et=0,ha=null,Jo=0,Yl=0,of=0,ga=null,dn=null,sf=0,Xs=1/0,Lr=null,Jl=!1,af=null,co=null,Xl=!1,uo=null,ec=0,ya=0,lf=null,tc=-1,nc=0;function Jt(){return(Qe&6)!==0?yt():tc!==-1?tc:tc=yt()}function fo(r){return(r.mode&1)===0?1:(Qe&2)!==0&&Ut!==0?Ut&-Ut:$_.transition!==null?(nc===0&&(nc=gh()),nc):(r=Xe,r!==0||(r=window.event,r=r===void 0?16:Ch(r.type)),r)}function er(r,o,a,u){if(50<ya)throw ya=0,lf=null,Error(n(185));Ui(r,a,u),((Qe&2)===0||r!==Mt)&&(r===Mt&&((Qe&2)===0&&(Yl|=a),Et===4&&po(r,Ut)),fn(r,u),a===1&&Qe===0&&(o.mode&1)===0&&(Xs=yt()+500,Tl&&so()))}function fn(r,o){var a=r.callbackNode;$k(r,o);var u=dl(r,r===Mt?Ut:0);if(u===0)a!==null&&ph(a),r.callbackNode=null,r.callbackPriority=0;else if(o=u&-u,r.callbackPriority!==o){if(a!=null&&ph(a),o===1)r.tag===0?I_(Cy.bind(null,r)):ug(Cy.bind(null,r)),R_(function(){(Qe&6)===0&&so()}),a=null;else{switch(yh(u)){case 1:a=Fu;break;case 4:a=mh;break;case 16:a=al;break;case 536870912:a=hh;break;default:a=al}a=Ay(a,_y.bind(null,r))}r.callbackPriority=o,r.callbackNode=a}}function _y(r,o){if(tc=-1,nc=0,(Qe&6)!==0)throw Error(n(327));var a=r.callbackNode;if(ei()&&r.callbackNode!==a)return null;var u=dl(r,r===Mt?Ut:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||o)o=rc(r,u);else{o=u;var h=Qe;Qe|=2;var w=Ey();(Mt!==r||Ut!==o)&&(Lr=null,Xs=yt()+500,es(r,o));do try{nC();break}catch(P){Ny(r,P)}while(!0);Cd(),Zl.current=w,Qe=h,St!==null?o=0:(Mt=null,Ut=0,o=Et)}if(o!==0){if(o===2&&(h=Uu(r),h!==0&&(u=h,o=cf(r,h))),o===1)throw a=ha,es(r,0),po(r,u),fn(r,yt()),a;if(o===6)po(r,u);else{if(h=r.current.alternate,(u&30)===0&&!eC(h)&&(o=rc(r,u),o===2&&(w=Uu(r),w!==0&&(u=w,o=cf(r,w))),o===1))throw a=ha,es(r,0),po(r,u),fn(r,yt()),a;switch(r.finishedWork=h,r.finishedLanes=u,o){case 0:case 1:throw Error(n(345));case 2:ts(r,dn,Lr);break;case 3:if(po(r,u),(u&130023424)===u&&(o=sf+500-yt(),10<o)){if(dl(r,0)!==0)break;if(h=r.suspendedLanes,(h&u)!==u){Jt(),r.pingedLanes|=r.suspendedLanes&h;break}r.timeoutHandle=md(ts.bind(null,r,dn,Lr),o);break}ts(r,dn,Lr);break;case 4:if(po(r,u),(u&4194240)===u)break;for(o=r.eventTimes,h=-1;0<u;){var k=31-Gn(u);w=1<<k,k=o[k],k>h&&(h=k),u&=~w}if(u=h,u=yt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*X_(u/1960))-u,10<u){r.timeoutHandle=md(ts.bind(null,r,dn,Lr),u);break}ts(r,dn,Lr);break;case 5:ts(r,dn,Lr);break;default:throw Error(n(329))}}}return fn(r,yt()),r.callbackNode===a?_y.bind(null,r):null}function cf(r,o){var a=ga;return r.current.memoizedState.isDehydrated&&(es(r,o).flags|=256),r=rc(r,o),r!==2&&(o=dn,dn=a,o!==null&&uf(o)),r}function uf(r){dn===null?dn=r:dn.push.apply(dn,r)}function eC(r){for(var o=r;;){if(o.flags&16384){var a=o.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var h=a[u],w=h.getSnapshot;h=h.value;try{if(!Qn(w(),h))return!1}catch{return!1}}}if(a=o.child,o.subtreeFlags&16384&&a!==null)a.return=o,o=a;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function po(r,o){for(o&=~of,o&=~Yl,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var a=31-Gn(o),u=1<<a;r[a]=-1,o&=~u}}function Cy(r){if((Qe&6)!==0)throw Error(n(327));ei();var o=dl(r,0);if((o&1)===0)return fn(r,yt()),null;var a=rc(r,o);if(r.tag!==0&&a===2){var u=Uu(r);u!==0&&(o=u,a=cf(r,u))}if(a===1)throw a=ha,es(r,0),po(r,o),fn(r,yt()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,ts(r,dn,Lr),fn(r,yt()),null}function df(r,o){var a=Qe;Qe|=1;try{return r(o)}finally{Qe=a,Qe===0&&(Xs=yt()+500,Tl&&so())}}function Xo(r){uo!==null&&uo.tag===0&&(Qe&6)===0&&ei();var o=Qe;Qe|=1;var a=zn.transition,u=Xe;try{if(zn.transition=null,Xe=1,r)return r()}finally{Xe=u,zn.transition=a,Qe=o,(Qe&6)===0&&so()}}function ff(){Nn=Js.current,at(Js)}function es(r,o){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,T_(a)),St!==null)for(a=St.return;a!==null;){var u=a;switch(xd(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&Pl();break;case 3:Qs(),at(ln),at(Vt),Ad();break;case 5:Rd(u);break;case 4:Qs();break;case 13:at(dt);break;case 19:at(dt);break;case 10:Nd(u.type._context);break;case 22:case 23:ff()}a=a.return}if(Mt=r,St=r=mo(r.current,null),Ut=Nn=o,Et=0,ha=null,of=Yl=Jo=0,dn=ga=null,Qo!==null){for(o=0;o<Qo.length;o++)if(a=Qo[o],u=a.interleaved,u!==null){a.interleaved=null;var h=u.next,w=a.pending;if(w!==null){var k=w.next;w.next=h,u.next=k}a.pending=u}Qo=null}return r}function Ny(r,o){do{var a=St;try{if(Cd(),Fl.current=Hl,Ul){for(var u=ft.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}Ul=!1}if(Yo=0,At=Nt=ft=null,ca=!1,ua=0,rf.current=null,a===null||a.return===null){Et=1,ha=o,St=null;break}e:{var w=r,k=a.return,P=a,M=o;if(o=Ut,P.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var J=M,le=P,pe=le.tag;if((le.mode&1)===0&&(pe===0||pe===11||pe===15)){var ae=le.alternate;ae?(le.updateQueue=ae.updateQueue,le.memoizedState=ae.memoizedState,le.lanes=ae.lanes):(le.updateQueue=null,le.memoizedState=null)}var be=Yg(k);if(be!==null){be.flags&=-257,Jg(be,k,P,w,o),be.mode&1&&Zg(w,J,o),o=be,M=J;var Ce=o.updateQueue;if(Ce===null){var Re=new Set;Re.add(M),o.updateQueue=Re}else Ce.add(M);break e}else{if((o&1)===0){Zg(w,J,o),pf();break e}M=Error(n(426))}}else if(ct&&P.mode&1){var vt=Yg(k);if(vt!==null){(vt.flags&65536)===0&&(vt.flags|=256),Jg(vt,k,P,w,o),kd(Zs(M,P));break e}}w=M=Zs(M,P),Et!==4&&(Et=2),ga===null?ga=[w]:ga.push(w),w=k;do{switch(w.tag){case 3:w.flags|=65536,o&=-o,w.lanes|=o;var K=Gg(w,M,o);bg(w,K);break e;case 1:P=M;var z=w.type,Q=w.stateNode;if((w.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(co===null||!co.has(Q)))){w.flags|=65536,o&=-o,w.lanes|=o;var he=Qg(w,P,o);bg(w,he);break e}}w=w.return}while(w!==null)}jy(a)}catch(Oe){o=Oe,St===a&&a!==null&&(St=a=a.return);continue}break}while(!0)}function Ey(){var r=Zl.current;return Zl.current=Hl,r===null?Hl:r}function pf(){(Et===0||Et===3||Et===2)&&(Et=4),Mt===null||(Jo&268435455)===0&&(Yl&268435455)===0||po(Mt,Ut)}function rc(r,o){var a=Qe;Qe|=2;var u=Ey();(Mt!==r||Ut!==o)&&(Lr=null,es(r,o));do try{tC();break}catch(h){Ny(r,h)}while(!0);if(Cd(),Qe=a,Zl.current=u,St!==null)throw Error(n(261));return Mt=null,Ut=0,Et}function tC(){for(;St!==null;)Py(St)}function nC(){for(;St!==null&&!Ek();)Py(St)}function Py(r){var o=Oy(r.alternate,r,Nn);r.memoizedProps=r.pendingProps,o===null?jy(r):St=o,rf.current=null}function jy(r){var o=r;do{var a=o.alternate;if(r=o.return,(o.flags&32768)===0){if(a=G_(a,o,Nn),a!==null){St=a;return}}else{if(a=Q_(a,o),a!==null){a.flags&=32767,St=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Et=6,St=null;return}}if(o=o.sibling,o!==null){St=o;return}St=o=r}while(o!==null);Et===0&&(Et=5)}function ts(r,o,a){var u=Xe,h=zn.transition;try{zn.transition=null,Xe=1,rC(r,o,a,u)}finally{zn.transition=h,Xe=u}return null}function rC(r,o,a,u){do ei();while(uo!==null);if((Qe&6)!==0)throw Error(n(327));a=r.finishedWork;var h=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var w=a.lanes|a.childLanes;if(Dk(r,w),r===Mt&&(St=Mt=null,Ut=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Xl||(Xl=!0,Ay(al,function(){return ei(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=zn.transition,zn.transition=null;var k=Xe;Xe=1;var P=Qe;Qe|=4,rf.current=null,Y_(r,a),wy(a,r),k_(fd),ml=!!dd,fd=dd=null,r.current=a,J_(a),Pk(),Qe=P,Xe=k,zn.transition=w}else r.current=a;if(Xl&&(Xl=!1,uo=r,ec=h),w=r.pendingLanes,w===0&&(co=null),Rk(a.stateNode),fn(r,yt()),o!==null)for(u=r.onRecoverableError,a=0;a<o.length;a++)h=o[a],u(h.value,{componentStack:h.stack,digest:h.digest});if(Jl)throw Jl=!1,r=af,af=null,r;return(ec&1)!==0&&r.tag!==0&&ei(),w=r.pendingLanes,(w&1)!==0?r===lf?ya++:(ya=0,lf=r):ya=0,so(),null}function ei(){if(uo!==null){var r=yh(ec),o=zn.transition,a=Xe;try{if(zn.transition=null,Xe=16>r?16:r,uo===null)var u=!1;else{if(r=uo,uo=null,ec=0,(Qe&6)!==0)throw Error(n(331));var h=Qe;for(Qe|=4,ke=r.current;ke!==null;){var w=ke,k=w.child;if((ke.flags&16)!==0){var P=w.deletions;if(P!==null){for(var M=0;M<P.length;M++){var J=P[M];for(ke=J;ke!==null;){var le=ke;switch(le.tag){case 0:case 11:case 15:ma(8,le,w)}var pe=le.child;if(pe!==null)pe.return=le,ke=pe;else for(;ke!==null;){le=ke;var ae=le.sibling,be=le.return;if(my(le),le===J){ke=null;break}if(ae!==null){ae.return=be,ke=ae;break}ke=be}}}var Ce=w.alternate;if(Ce!==null){var Re=Ce.child;if(Re!==null){Ce.child=null;do{var vt=Re.sibling;Re.sibling=null,Re=vt}while(Re!==null)}}ke=w}}if((w.subtreeFlags&2064)!==0&&k!==null)k.return=w,ke=k;else e:for(;ke!==null;){if(w=ke,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:ma(9,w,w.return)}var K=w.sibling;if(K!==null){K.return=w.return,ke=K;break e}ke=w.return}}var z=r.current;for(ke=z;ke!==null;){k=ke;var Q=k.child;if((k.subtreeFlags&2064)!==0&&Q!==null)Q.return=k,ke=Q;else e:for(k=z;ke!==null;){if(P=ke,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:Ql(9,P)}}catch(Oe){pt(P,P.return,Oe)}if(P===k){ke=null;break e}var he=P.sibling;if(he!==null){he.return=P.return,ke=he;break e}ke=P.return}}if(Qe=h,so(),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(ll,r)}catch{}u=!0}return u}finally{Xe=a,zn.transition=o}}return!1}function Ty(r,o,a){o=Zs(a,o),o=Gg(r,o,1),r=ao(r,o,1),o=Jt(),r!==null&&(Ui(r,1,o),fn(r,o))}function pt(r,o,a){if(r.tag===3)Ty(r,r,a);else for(;o!==null;){if(o.tag===3){Ty(o,r,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(co===null||!co.has(u))){r=Zs(a,r),r=Qg(o,r,1),o=ao(o,r,1),r=Jt(),o!==null&&(Ui(o,1,r),fn(o,r));break}}o=o.return}}function oC(r,o,a){var u=r.pingCache;u!==null&&u.delete(o),o=Jt(),r.pingedLanes|=r.suspendedLanes&a,Mt===r&&(Ut&a)===a&&(Et===4||Et===3&&(Ut&130023424)===Ut&&500>yt()-sf?es(r,0):of|=a),fn(r,o)}function Ry(r,o){o===0&&((r.mode&1)===0?o=1:(o=ul,ul<<=1,(ul&130023424)===0&&(ul=4194304)));var a=Jt();r=Ir(r,o),r!==null&&(Ui(r,o,a),fn(r,a))}function sC(r){var o=r.memoizedState,a=0;o!==null&&(a=o.retryLane),Ry(r,a)}function iC(r,o){var a=0;switch(r.tag){case 13:var u=r.stateNode,h=r.memoizedState;h!==null&&(a=h.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(o),Ry(r,a)}var Oy;Oy=function(r,o,a){if(r!==null)if(r.memoizedProps!==o.pendingProps||ln.current)un=!0;else{if((r.lanes&a)===0&&(o.flags&128)===0)return un=!1,K_(r,o,a);un=(r.flags&131072)!==0}else un=!1,ct&&(o.flags&1048576)!==0&&dg(o,Ol,o.index);switch(o.lanes=0,o.tag){case 2:var u=o.type;Kl(r,o),r=o.pendingProps;var h=Bs(o,Vt.current);Gs(o,a),h=$d(null,o,u,r,h,a);var w=Dd();return o.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,cn(u)?(w=!0,jl(o)):w=!1,o.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,jd(o),h.updater=Wl,o.stateNode=h,h._reactInternals=o,Vd(o,u,r,a),o=Kd(null,o,u,!0,w,a)):(o.tag=0,ct&&w&&wd(o),Yt(null,o,h,a),o=o.child),o;case 16:u=o.elementType;e:{switch(Kl(r,o),r=o.pendingProps,h=u._init,u=h(u._payload),o.type=u,h=o.tag=lC(u),r=Yn(u,r),h){case 0:o=qd(null,o,u,r,a);break e;case 1:o=oy(null,o,u,r,a);break e;case 11:o=Xg(null,o,u,r,a);break e;case 14:o=ey(null,o,u,Yn(u.type,r),a);break e}throw Error(n(306,u,""))}return o;case 0:return u=o.type,h=o.pendingProps,h=o.elementType===u?h:Yn(u,h),qd(r,o,u,h,a);case 1:return u=o.type,h=o.pendingProps,h=o.elementType===u?h:Yn(u,h),oy(r,o,u,h,a);case 3:e:{if(sy(o),r===null)throw Error(n(387));u=o.pendingProps,w=o.memoizedState,h=w.element,xg(r,o),Ll(o,u,null,a);var k=o.memoizedState;if(u=k.element,w.isDehydrated)if(w={element:u,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},o.updateQueue.baseState=w,o.memoizedState=w,o.flags&256){h=Zs(Error(n(423)),o),o=iy(r,o,u,a,h);break e}else if(u!==h){h=Zs(Error(n(424)),o),o=iy(r,o,u,a,h);break e}else for(Cn=no(o.stateNode.containerInfo.firstChild),_n=o,ct=!0,Zn=null,a=vg(o,null,u,a),o.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ws(),u===h){o=Dr(r,o,a);break e}Yt(r,o,u,a)}o=o.child}return o;case 5:return kg(o),r===null&&Sd(o),u=o.type,h=o.pendingProps,w=r!==null?r.memoizedProps:null,k=h.children,pd(u,h)?k=null:w!==null&&pd(u,w)&&(o.flags|=32),ry(r,o),Yt(r,o,k,a),o.child;case 6:return r===null&&Sd(o),null;case 13:return ay(r,o,a);case 4:return Td(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=qs(o,null,u,a):Yt(r,o,u,a),o.child;case 11:return u=o.type,h=o.pendingProps,h=o.elementType===u?h:Yn(u,h),Xg(r,o,u,h,a);case 7:return Yt(r,o,o.pendingProps,a),o.child;case 8:return Yt(r,o,o.pendingProps.children,a),o.child;case 12:return Yt(r,o,o.pendingProps.children,a),o.child;case 10:e:{if(u=o.type._context,h=o.pendingProps,w=o.memoizedProps,k=h.value,rt(Il,u._currentValue),u._currentValue=k,w!==null)if(Qn(w.value,k)){if(w.children===h.children&&!ln.current){o=Dr(r,o,a);break e}}else for(w=o.child,w!==null&&(w.return=o);w!==null;){var P=w.dependencies;if(P!==null){k=w.child;for(var M=P.firstContext;M!==null;){if(M.context===u){if(w.tag===1){M=$r(-1,a&-a),M.tag=2;var J=w.updateQueue;if(J!==null){J=J.shared;var le=J.pending;le===null?M.next=M:(M.next=le.next,le.next=M),J.pending=M}}w.lanes|=a,M=w.alternate,M!==null&&(M.lanes|=a),Ed(w.return,a,o),P.lanes|=a;break}M=M.next}}else if(w.tag===10)k=w.type===o.type?null:w.child;else if(w.tag===18){if(k=w.return,k===null)throw Error(n(341));k.lanes|=a,P=k.alternate,P!==null&&(P.lanes|=a),Ed(k,a,o),k=w.sibling}else k=w.child;if(k!==null)k.return=w;else for(k=w;k!==null;){if(k===o){k=null;break}if(w=k.sibling,w!==null){w.return=k.return,k=w;break}k=k.return}w=k}Yt(r,o,h.children,a),o=o.child}return o;case 9:return h=o.type,u=o.pendingProps.children,Gs(o,a),h=Dn(h),u=u(h),o.flags|=1,Yt(r,o,u,a),o.child;case 14:return u=o.type,h=Yn(u,o.pendingProps),h=Yn(u.type,h),ey(r,o,u,h,a);case 15:return ty(r,o,o.type,o.pendingProps,a);case 17:return u=o.type,h=o.pendingProps,h=o.elementType===u?h:Yn(u,h),Kl(r,o),o.tag=1,cn(u)?(r=!0,jl(o)):r=!1,Gs(o,a),qg(o,u,h),Vd(o,u,h,a),Kd(null,o,u,!0,r,a);case 19:return cy(r,o,a);case 22:return ny(r,o,a)}throw Error(n(156,o.tag))};function Ay(r,o){return fh(r,o)}function aC(r,o,a,u){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(r,o,a,u){return new aC(r,o,a,u)}function mf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function lC(r){if(typeof r=="function")return mf(r)?1:0;if(r!=null){if(r=r.$$typeof,r===fe)return 11;if(r===ce)return 14}return 2}function mo(r,o){var a=r.alternate;return a===null?(a=Fn(r.tag,o,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=o,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,o=r.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function oc(r,o,a,u,h,w){var k=2;if(u=r,typeof r=="function")mf(r)&&(k=1);else if(typeof r=="string")k=5;else e:switch(r){case D:return ns(a.children,h,w,o);case $:k=8,h|=8;break;case F:return r=Fn(12,a,o,h|2),r.elementType=F,r.lanes=w,r;case de:return r=Fn(13,a,o,h),r.elementType=de,r.lanes=w,r;case ge:return r=Fn(19,a,o,h),r.elementType=ge,r.lanes=w,r;case ie:return sc(a,h,w,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case I:k=10;break e;case re:k=9;break e;case fe:k=11;break e;case ce:k=14;break e;case te:k=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=Fn(k,a,o,h),o.elementType=r,o.type=u,o.lanes=w,o}function ns(r,o,a,u){return r=Fn(7,r,u,o),r.lanes=a,r}function sc(r,o,a,u){return r=Fn(22,r,u,o),r.elementType=ie,r.lanes=a,r.stateNode={isHidden:!1},r}function hf(r,o,a){return r=Fn(6,r,null,o),r.lanes=a,r}function gf(r,o,a){return o=Fn(4,r.children!==null?r.children:[],r.key,o),o.lanes=a,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function cC(r,o,a,u,h){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=u,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function yf(r,o,a,u,h,w,k,P,M){return r=new cC(r,o,a,P,M),o===1?(o=1,w===!0&&(o|=8)):o=0,w=Fn(3,null,null,o),r.current=w,w.stateNode=r,w.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},jd(w),r}function uC(r,o,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:u==null?null:""+u,children:r,containerInfo:o,implementation:a}}function My(r){if(!r)return oo;r=r._reactInternals;e:{if(Ho(r)!==r||r.tag!==1)throw Error(n(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(cn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(cn(a))return lg(r,a,o)}return o}function Iy(r,o,a,u,h,w,k,P,M){return r=yf(a,u,!0,r,h,w,k,P,M),r.context=My(null),a=r.current,u=Jt(),h=fo(a),w=$r(u,h),w.callback=o??null,ao(a,w,h),r.current.lanes=h,Ui(r,h,u),fn(r,u),r}function ic(r,o,a,u){var h=o.current,w=Jt(),k=fo(h);return a=My(a),o.context===null?o.context=a:o.pendingContext=a,o=$r(w,k),o.payload={element:r},u=u===void 0?null:u,u!==null&&(o.callback=u),r=ao(h,o,k),r!==null&&(er(r,h,k,w),Dl(r,h,k)),k}function ac(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function $y(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<o?a:o}}function vf(r,o){$y(r,o),(r=r.alternate)&&$y(r,o)}function dC(){return null}var Dy=typeof reportError=="function"?reportError:function(r){console.error(r)};function wf(r){this._internalRoot=r}lc.prototype.render=wf.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));ic(r,o,null,null)},lc.prototype.unmount=wf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Xo(function(){ic(null,r,null,null)}),o[Rr]=null}};function lc(r){this._internalRoot=r}lc.prototype.unstable_scheduleHydration=function(r){if(r){var o=xh();r={blockedOn:null,target:r,priority:o};for(var a=0;a<Xr.length&&o!==0&&o<Xr[a].priority;a++);Xr.splice(a,0,r),a===0&&kh(r)}};function xf(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function cc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Ly(){}function fC(r,o,a,u,h){if(h){if(typeof u=="function"){var w=u;u=function(){var J=ac(k);w.call(J)}}var k=Iy(o,u,r,0,null,!1,!1,"",Ly);return r._reactRootContainer=k,r[Rr]=k.current,ta(r.nodeType===8?r.parentNode:r),Xo(),k}for(;h=r.lastChild;)r.removeChild(h);if(typeof u=="function"){var P=u;u=function(){var J=ac(M);P.call(J)}}var M=yf(r,0,!1,null,null,!1,!1,"",Ly);return r._reactRootContainer=M,r[Rr]=M.current,ta(r.nodeType===8?r.parentNode:r),Xo(function(){ic(o,M,a,u)}),M}function uc(r,o,a,u,h){var w=a._reactRootContainer;if(w){var k=w;if(typeof h=="function"){var P=h;h=function(){var M=ac(k);P.call(M)}}ic(o,k,r,h)}else k=fC(a,o,r,h,u);return ac(k)}vh=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var a=Fi(o.pendingLanes);a!==0&&(Vu(o,a|1),fn(o,yt()),(Qe&6)===0&&(Xs=yt()+500,so()))}break;case 13:Xo(function(){var u=Ir(r,1);if(u!==null){var h=Jt();er(u,r,1,h)}}),vf(r,1)}},Hu=function(r){if(r.tag===13){var o=Ir(r,134217728);if(o!==null){var a=Jt();er(o,r,134217728,a)}vf(r,134217728)}},wh=function(r){if(r.tag===13){var o=fo(r),a=Ir(r,o);if(a!==null){var u=Jt();er(a,r,o,u)}vf(r,o)}},xh=function(){return Xe},bh=function(r,o){var a=Xe;try{return Xe=r,o()}finally{Xe=a}},nt=function(r,o,a){switch(o){case"input":if(ut(r,a),o=a.name,a.type==="radio"&&o!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<a.length;o++){var u=a[o];if(u!==r&&u.form===r.form){var h=El(u);if(!h)throw Error(n(90));ye(u),ut(u,h)}}}break;case"textarea":Rs(r,a);break;case"select":o=a.value,o!=null&&bn(r,!!a.multiple,o,!1)}},lt=df,gt=Xo;var pC={usingClientEntryPoint:!1,Events:[oa,Fs,El,Me,tt,df]},va={findFiberByHostInstance:Wo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mC={bundleType:va.bundleType,version:va.version,rendererPackageName:va.rendererPackageName,rendererConfig:va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=uh(r),r===null?null:r.stateNode},findFiberByHostInstance:va.findFiberByHostInstance||dC,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 dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{ll=dc.inject(mC),mr=dc}catch{}}return pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pC,pn.createPortal=function(r,o){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xf(o))throw Error(n(200));return uC(r,o,null,a)},pn.createRoot=function(r,o){if(!xf(r))throw Error(n(299));var a=!1,u="",h=Dy;return o!=null&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onRecoverableError!==void 0&&(h=o.onRecoverableError)),o=yf(r,1,!1,null,null,a,!1,u,h),r[Rr]=o.current,ta(r.nodeType===8?r.parentNode:r),new wf(o)},pn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=uh(o),r=r===null?null:r.stateNode,r},pn.flushSync=function(r){return Xo(r)},pn.hydrate=function(r,o,a){if(!cc(o))throw Error(n(200));return uc(null,r,o,!0,a)},pn.hydrateRoot=function(r,o,a){if(!xf(r))throw Error(n(405));var u=a!=null&&a.hydratedSources||null,h=!1,w="",k=Dy;if(a!=null&&(a.unstable_strictMode===!0&&(h=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),o=Iy(o,null,r,1,a??null,h,!1,w,k),r[Rr]=o.current,ta(r),u)for(r=0;r<u.length;r++)a=u[r],h=a._getVersion,h=h(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,h]:o.mutableSourceEagerHydrationData.push(a,h);return new lc(o)},pn.render=function(r,o,a){if(!cc(o))throw Error(n(200));return uc(null,r,o,!1,a)},pn.unmountComponentAtNode=function(r){if(!cc(r))throw Error(n(40));return r._reactRootContainer?(Xo(function(){uc(null,null,r,!1,function(){r._reactRootContainer=null,r[Rr]=null})}),!0):!1},pn.unstable_batchedUpdates=df,pn.unstable_renderSubtreeIntoContainer=function(r,o,a,u){if(!cc(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return uc(r,o,a,!1,u)},pn.version="18.3.1-next-f1338f8080-20240426",pn}var Gy;function Ww(){if(Gy)return _f.exports;Gy=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(),_f.exports=_C(),_f.exports}var Qy;function CC(){if(Qy)return pc;Qy=1;var e=Ww();return pc.createRoot=e.createRoot,pc.hydrateRoot=e.hydrateRoot,pc}var NC=CC();const EC=Gp(NC);var Za=Ww();const qw=Gp(Za);function PC(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const jC=e=>{switch(e){case"success":return OC;case"info":return MC;case"warning":return AC;case"error":return IC;default:return null}},TC=Array(12).fill(0),RC=({visible:e,className:t})=>me.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},TC.map((n,s)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),OC=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),AC=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),MC=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),IC=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),$C=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),DC=()=>{const[e,t]=me.useState(document.hidden);return me.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Yf=1;class LC{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...i}=t,l=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Yf++,d=this.toasts.find(g=>g.id===l),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),d?this.toasts=this.toasts.map(g=>g.id===l?(this.publish({...g,...t,id:l,title:s}),{...g,...t,id:l,dismissible:f,title:s}):g):this.addToast({title:s,...i,dismissible:f,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let l=s!==void 0,d;const f=i.then(async y=>{if(d=["resolve",y],me.isValidElement(y))l=!1,this.create({id:s,type:"default",message:y});else if(FC(y)&&!y.ok){l=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${y.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${y.status}`):n.description,N=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:x,...N})}else if(y instanceof Error){l=!1;const p=typeof n.error=="function"?await n.error(y):n.error,x=typeof n.description=="function"?await n.description(y):n.description,N=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:x,...N})}else if(n.success!==void 0){l=!1;const p=typeof n.success=="function"?await n.success(y):n.success,x=typeof n.description=="function"?await n.description(y):n.description,N=typeof p=="object"&&!me.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:x,...N})}}).catch(async y=>{if(d=["reject",y],n.error!==void 0){l=!1;const v=typeof n.error=="function"?await n.error(y):n.error,p=typeof n.description=="function"?await n.description(y):n.description,b=typeof v=="object"&&!me.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:p,...b})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),g=()=>new Promise((y,v)=>f.then(()=>d[0]==="reject"?v(d[1]):y(d[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:g}:Object.assign(s,{unwrap:g})},this.custom=(t,n)=>{const s=(n==null?void 0:n.id)||Yf++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yn=new LC,zC=(e,t)=>{const n=(t==null?void 0:t.id)||Yf++;return yn.addToast({title:e,...t,id:n}),n},FC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",UC=zC,BC=()=>yn.toasts,VC=()=>yn.getActiveToasts(),Aa=Object.assign(UC,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:BC,getToasts:VC});PC("[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 mc(e){return e.label!==void 0}const HC=3,WC="24px",qC="16px",Zy=4e3,KC=356,GC=14,QC=45,ZC=200;function wr(...e){return e.filter(Boolean).join(" ")}function YC(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const JC=e=>{var t,n,s,i,l,d,f,g,y;const{invert:v,toast:p,unstyled:x,interacting:b,setHeights:N,visibleToasts:S,heights:C,index:_,toasts:E,expanded:T,removeToast:j,defaultRichColors:q,closeButton:V,style:D,cancelButtonStyle:$,actionButtonStyle:F,className:I="",descriptionClassName:re="",duration:fe,position:de,gap:ge,expandByDefault:ce,classNames:te,icons:ie,closeButtonAriaLabel:G="Close toast"}=e,[Z,U]=me.useState(null),[R,A]=me.useState(null),[ee,Y]=me.useState(!1),[L,ne]=me.useState(!1),[X,oe]=me.useState(!1),[ue,Te]=me.useState(!1),[Fe,ye]=me.useState(!1),[Ve,Ge]=me.useState(0),[Lt,Zt]=me.useState(0),ut=me.useRef(p.duration||fe||Zy),qn=me.useRef(null),wt=me.useRef(null),dr=_===0,bn=_+1<=S,ht=p.type,On=p.dismissible!==!1,Rs=p.className||"",Os=p.descriptionClassName||"",Ct=me.useMemo(()=>C.findIndex(Me=>Me.toastId===p.id)||0,[C,p.id]),fr=me.useMemo(()=>{var Me;return(Me=p.closeButton)!=null?Me:V},[p.closeButton,V]),Tr=me.useMemo(()=>p.duration||fe||Zy,[p.duration,fe]),An=me.useRef(0),st=me.useRef(0),pr=me.useRef(0),Kn=me.useRef(null),[Bo,Vo]=de.split("-"),H=me.useMemo(()=>C.reduce((Me,tt,lt)=>lt>=Ct?Me:Me+tt.height,0),[C,Ct]),se=DC(),xe=p.invert||v,we=ht==="loading";st.current=me.useMemo(()=>Ct*ge+H,[Ct,H]),me.useEffect(()=>{ut.current=Tr},[Tr]),me.useEffect(()=>{Y(!0)},[]),me.useEffect(()=>{const Me=wt.current;if(Me){const tt=Me.getBoundingClientRect().height;return Zt(tt),N(lt=>[{toastId:p.id,height:tt,position:p.position},...lt]),()=>N(lt=>lt.filter(gt=>gt.toastId!==p.id))}},[N,p.id]),me.useLayoutEffect(()=>{if(!ee)return;const Me=wt.current,tt=Me.style.height;Me.style.height="auto";const lt=Me.getBoundingClientRect().height;Me.style.height=tt,Zt(lt),N(gt=>gt.find(bt=>bt.toastId===p.id)?gt.map(bt=>bt.toastId===p.id?{...bt,height:lt}:bt):[{toastId:p.id,height:lt,position:p.position},...gt])},[ee,p.title,p.description,N,p.id,p.jsx,p.action,p.cancel]);const Ee=me.useCallback(()=>{ne(!0),Ge(st.current),N(Me=>Me.filter(tt=>tt.toastId!==p.id)),setTimeout(()=>{j(p)},ZC)},[p,j,N,st]);me.useEffect(()=>{if(p.promise&&ht==="loading"||p.duration===1/0||p.type==="loading")return;let Me;return T||b||se?(()=>{if(pr.current<An.current){const gt=new Date().getTime()-An.current;ut.current=ut.current-gt}pr.current=new Date().getTime()})():(()=>{ut.current!==1/0&&(An.current=new Date().getTime(),Me=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Ee()},ut.current))})(),()=>clearTimeout(Me)},[T,b,p,ht,se,Ee]),me.useEffect(()=>{p.delete&&(Ee(),p.onDismiss==null||p.onDismiss.call(p,p))},[Ee,p.delete]);function nt(){var Me;if(ie!=null&&ie.loading){var tt;return me.createElement("div",{className:wr(te==null?void 0:te.loader,p==null||(tt=p.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":ht==="loading"},ie.loading)}return me.createElement(RC,{className:wr(te==null?void 0:te.loader,p==null||(Me=p.classNames)==null?void 0:Me.loader),visible:ht==="loading"})}const xt=p.icon||(ie==null?void 0:ie[ht])||jC(ht);var et,Rt;return me.createElement("li",{tabIndex:0,ref:wt,className:wr(I,Rs,te==null?void 0:te.toast,p==null||(t=p.classNames)==null?void 0:t.toast,te==null?void 0:te.default,te==null?void 0:te[ht],p==null||(n=p.classNames)==null?void 0:n[ht]),"data-sonner-toast":"","data-rich-colors":(et=p.richColors)!=null?et:q,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":ee,"data-promise":!!p.promise,"data-swiped":Fe,"data-removed":L,"data-visible":bn,"data-y-position":Bo,"data-x-position":Vo,"data-index":_,"data-front":dr,"data-swiping":X,"data-dismissible":On,"data-type":ht,"data-invert":xe,"data-swipe-out":ue,"data-swipe-direction":R,"data-expanded":!!(T||ce&&ee),"data-testid":p.testId,style:{"--index":_,"--toasts-before":_,"--z-index":E.length-_,"--offset":`${L?Ve:st.current}px`,"--initial-height":ce?"auto":`${Lt}px`,...D,...p.style},onDragEnd:()=>{oe(!1),U(null),Kn.current=null},onPointerDown:Me=>{Me.button!==2&&(we||!On||(qn.current=new Date,Ge(st.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(oe(!0),Kn.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,tt,lt;if(ue||!On)return;Kn.current=null;const gt=Number(((Me=wt.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Kr=Number(((tt=wt.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((lt=qn.current)==null?void 0:lt.getTime()),Ot=Z==="x"?gt:Kr,Gr=Math.abs(Ot)/bt;if(Math.abs(Ot)>=QC||Gr>.11){Ge(st.current),p.onDismiss==null||p.onDismiss.call(p,p),A(Z==="x"?gt>0?"right":"left":Kr>0?"down":"up"),Ee(),Te(!0);return}else{var zt,Sn;(zt=wt.current)==null||zt.style.setProperty("--swipe-amount-x","0px"),(Sn=wt.current)==null||Sn.style.setProperty("--swipe-amount-y","0px")}ye(!1),oe(!1),U(null)},onPointerMove:Me=>{var tt,lt,gt;if(!Kn.current||!On||((tt=window.getSelection())==null?void 0:tt.toString().length)>0)return;const bt=Me.clientY-Kn.current.y,Ot=Me.clientX-Kn.current.x;var Gr;const zt=(Gr=e.swipeDirections)!=null?Gr:YC(de);!Z&&(Math.abs(Ot)>1||Math.abs(bt)>1)&&U(Math.abs(Ot)>Math.abs(bt)?"x":"y");let Sn={x:0,y:0};const Qr=Mn=>1/(1.5+Math.abs(Mn)/20);if(Z==="y"){if(zt.includes("top")||zt.includes("bottom"))if(zt.includes("top")&&bt<0||zt.includes("bottom")&&bt>0)Sn.y=bt;else{const Mn=bt*Qr(bt);Sn.y=Math.abs(Mn)<Math.abs(bt)?Mn:bt}}else if(Z==="x"&&(zt.includes("left")||zt.includes("right")))if(zt.includes("left")&&Ot<0||zt.includes("right")&&Ot>0)Sn.x=Ot;else{const Mn=Ot*Qr(Ot);Sn.x=Math.abs(Mn)<Math.abs(Ot)?Mn:Ot}(Math.abs(Sn.x)>0||Math.abs(Sn.y)>0)&&ye(!0),(lt=wt.current)==null||lt.style.setProperty("--swipe-amount-x",`${Sn.x}px`),(gt=wt.current)==null||gt.style.setProperty("--swipe-amount-y",`${Sn.y}px`)}},fr&&!p.jsx&&ht!=="loading"?me.createElement("button",{"aria-label":G,"data-disabled":we,"data-close-button":!0,onClick:we||!On?()=>{}:()=>{Ee(),p.onDismiss==null||p.onDismiss.call(p,p)},className:wr(te==null?void 0:te.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},(Rt=ie==null?void 0:ie.close)!=null?Rt:$C):null,(ht||p.icon||p.promise)&&p.icon!==null&&((ie==null?void 0:ie[ht])!==null||p.icon)?me.createElement("div",{"data-icon":"",className:wr(te==null?void 0:te.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||nt():null,p.type!=="loading"?xt:null):null,me.createElement("div",{"data-content":"",className:wr(te==null?void 0:te.content,p==null||(l=p.classNames)==null?void 0:l.content)},me.createElement("div",{"data-title":"",className:wr(te==null?void 0:te.title,p==null||(d=p.classNames)==null?void 0:d.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?me.createElement("div",{"data-description":"",className:wr(re,Os,te==null?void 0:te.description,p==null||(f=p.classNames)==null?void 0:f.description)},typeof p.description=="function"?p.description():p.description):null),me.isValidElement(p.cancel)?p.cancel:p.cancel&&mc(p.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||$,onClick:Me=>{mc(p.cancel)&&On&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Me),Ee())},className:wr(te==null?void 0:te.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,me.isValidElement(p.action)?p.action:p.action&&mc(p.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:Me=>{mc(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Me),!Me.defaultPrevented&&Ee())},className:wr(te==null?void 0:te.actionButton,p==null||(y=p.classNames)==null?void 0:y.actionButton)},p.action.label):null)};function Yy(){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 XC(e,t){const n={};return[e,t].forEach((s,i)=>{const l=i===1,d=l?"--mobile-offset":"--offset",f=l?qC:WC;function g(y){["top","right","bottom","left"].forEach(v=>{n[`${d}-${v}`]=typeof y=="number"?`${y}px`:y})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(y=>{s[y]===void 0?n[`${d}-${y}`]=f:n[`${d}-${y}`]=typeof s[y]=="number"?`${s[y]}px`:s[y]}):g(f)}),n}const eN=me.forwardRef(function(t,n){const{id:s,invert:i,position:l="bottom-right",hotkey:d=["altKey","KeyT"],expand:f,closeButton:g,className:y,offset:v,mobileOffset:p,theme:x="light",richColors:b,duration:N,style:S,visibleToasts:C=HC,toastOptions:_,dir:E=Yy(),gap:T=GC,icons:j,containerAriaLabel:q="Notifications"}=t,[V,D]=me.useState([]),$=me.useMemo(()=>s?V.filter(ee=>ee.toasterId===s):V.filter(ee=>!ee.toasterId),[V,s]),F=me.useMemo(()=>Array.from(new Set([l].concat($.filter(ee=>ee.position).map(ee=>ee.position)))),[$,l]),[I,re]=me.useState([]),[fe,de]=me.useState(!1),[ge,ce]=me.useState(!1),[te,ie]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=me.useRef(null),Z=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=me.useRef(null),R=me.useRef(!1),A=me.useCallback(ee=>{D(Y=>{var L;return(L=Y.find(ne=>ne.id===ee.id))!=null&&L.delete||yn.dismiss(ee.id),Y.filter(({id:ne})=>ne!==ee.id)})},[]);return me.useEffect(()=>yn.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{D(Y=>Y.map(L=>L.id===ee.id?{...L,delete:!0}:L))});return}setTimeout(()=>{qw.flushSync(()=>{D(Y=>{const L=Y.findIndex(ne=>ne.id===ee.id);return L!==-1?[...Y.slice(0,L),{...Y[L],...ee},...Y.slice(L+1)]:[ee,...Y]})})})}),[V]),me.useEffect(()=>{if(x!=="system"){ie(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ie("dark"):ie("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:Y})=>{ie(Y?"dark":"light")})}catch{ee.addListener(({matches:L})=>{try{ie(L?"dark":"light")}catch(ne){console.error(ne)}})}},[x]),me.useEffect(()=>{V.length<=1&&de(!1)},[V]),me.useEffect(()=>{const ee=Y=>{var L;if(d.every(oe=>Y[oe]||Y.code===oe)){var X;de(!0),(X=G.current)==null||X.focus()}Y.code==="Escape"&&(document.activeElement===G.current||(L=G.current)!=null&&L.contains(document.activeElement))&&de(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[d]),me.useEffect(()=>{if(G.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,R.current=!1)}},[G.current]),me.createElement("section",{ref:n,"aria-label":`${q} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((ee,Y)=>{var L;const[ne,X]=ee.split("-");return $.length?me.createElement("ol",{key:ee,dir:E==="auto"?Yy():E,tabIndex:-1,ref:G,className:y,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":ne,"data-x-position":X,style:{"--front-toast-height":`${((L=I[0])==null?void 0:L.height)||0}px`,"--width":`${KC}px`,"--gap":`${T}px`,...S,...XC(v,p)},onBlur:oe=>{R.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(R.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||R.current||(R.current=!0,U.current=oe.relatedTarget)},onMouseEnter:()=>de(!0),onMouseMove:()=>de(!0),onMouseLeave:()=>{ge||de(!1)},onDragEnd:()=>de(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},$.filter(oe=>!oe.position&&Y===0||oe.position===ee).map((oe,ue)=>{var Te,Fe;return me.createElement(JC,{key:oe.id,icons:j,index:ue,toast:oe,defaultRichColors:b,duration:(Te=_==null?void 0:_.duration)!=null?Te:N,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:i,visibleToasts:C,closeButton:(Fe=_==null?void 0:_.closeButton)!=null?Fe:g,interacting:ge,position:ee,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:A,toasts:$.filter(ye=>ye.position==oe.position),heights:I.filter(ye=>ye.position==oe.position),setHeights:re,expandByDefault:f,gap:T,expanded:fe,swipeDirections:t.swipeDirections})})):null}))}),tN="modulepreload",nN=function(e){return"/"+e},Jy={},jt=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){let d=function(y){return Promise.all(y.map(v=>Promise.resolve(v).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),g=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));i=d(n.map(y=>{if(y=nN(y),y in Jy)return;Jy[y]=!0;const v=y.endsWith(".css"),p=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${p}`))return;const x=document.createElement("link");if(x.rel=v?"stylesheet":tN,v||(x.as="script"),x.crossOrigin="",x.href=y,g&&x.setAttribute("nonce",g),document.head.appendChild(x),v)return new Promise((b,N)=>{x.addEventListener("load",b),x.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return i.then(d=>{for(const f of d||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})},Ef="chunk-reload";function Zp(e){return m.lazy(()=>e().then(t=>{try{sessionStorage.removeItem(Ef)}catch{}return t},t=>{if(!rN(t))throw t;let n=!1;try{n=sessionStorage.getItem(Ef)==="1",n||sessionStorage.setItem(Ef,"1")}catch{}if(n)throw t;return window.location.reload(),new Promise(()=>{})}))}function rN(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 Kw=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).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 oN=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 sN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.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 Xy=e=>{const t=sN(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 iN={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 aN=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 lN=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:d,...f},g)=>m.createElement("svg",{ref:g,...iN,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Kw("lucide",i),...!l&&!aN(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>m.createElement(y,v)),...Array.isArray(l)?l:[l]]));/**
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 Le=(e,t)=>{const n=m.forwardRef(({className:s,...i},l)=>m.createElement(lN,{ref:l,iconNode:t,className:Kw(`lucide-${oN(Xy(e))}`,`lucide-${e}`,s),...i}));return n.displayName=Xy(e),n};/**
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 cN=[["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"}]],uN=Le("book-marked",cN);/**
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 dN=[["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"}]],Gw=Le("book-open",dN);/**
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 fN=[["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"}]],pN=Le("bot",fN);/**
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 mN=[["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"}]],hN=Le("building-2",mN);/**
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 gN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mi=Le("check",gN);/**
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 yN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ro=Le("chevron-down",yN);/**
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 vN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ya=Le("chevron-right",vN);/**
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 wN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xN=Le("chevron-up",wN);/**
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 bN=[["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"}]],Ta=Le("circle-alert",bN);/**
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 SN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],kN=Le("circle",SN);/**
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 _N=[["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"}]],CN=Le("clipboard-check",_N);/**
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 NN=[["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"}]],Yp=Le("copy",NN);/**
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 EN=[["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"}]],Qw=Le("database",EN);/**
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 PN=[["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"}]],Tc=Le("download",PN);/**
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 jN=[["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"}]],Jf=Le("external-link",jN);/**
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 TN=[["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"}]],Zw=Le("eye-off",TN);/**
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 RN=[["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"}]],Yw=Le("eye",RN);/**
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 ON=[["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"}]],Jp=Le("file-text",ON);/**
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 AN=[["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"}]],MN=Le("folder-open",AN);/**
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 IN=[["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"}]],$N=Le("folder",IN);/**
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 DN=[["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"}]],LN=Le("globe",DN);/**
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 zN=[["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"}]],Jw=Le("house",zN);/**
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 FN=[["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"}]],UN=Le("inbox",FN);/**
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 BN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ev=Le("info",BN);/**
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 VN=[["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"}]],Xp=Le("key-round",VN);/**
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 HN=[["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"}]],tv=Le("key",HN);/**
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 WN=[["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"}]],qN=Le("keyboard",WN);/**
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 KN=[["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"}]],Xw=Le("layout-grid",KN);/**
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 GN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Cr=Le("loader-circle",GN);/**
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 QN=[["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"}]],ZN=Le("lock",QN);/**
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 YN=[["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"}]],ex=Le("log-out",YN);/**
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 JN=[["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"}]],XN=Le("message-square-text",JN);/**
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 eE=[["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"}]],nv=Le("monitor",eE);/**
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 tE=[["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"}]],nE=Le("network",tE);/**
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 rE=[["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"}]],hc=Le("package",rE);/**
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 oE=[["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"}]],sE=Le("panel-left-close",oE);/**
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 iE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aE=Le("panel-left",iE);/**
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 lE=[["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"}]],cE=Le("pencil",lE);/**
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 uE=[["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"}]],dE=Le("plug",uE);/**
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 fE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tx=Le("plus",fE);/**
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 pE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],mE=Le("refresh-cw",pE);/**
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 hE=[["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"}]],gE=Le("scroll-text",hE);/**
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 yE=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],em=Le("search",yE);/**
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 vE=[["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"}]],wE=Le("shield-alert",vE);/**
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 xE=[["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"}]],bE=Le("shield-check",xE);/**
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 SE=[["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"}]],su=Le("shield",SE);/**
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 kE=[["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"}]],_E=Le("sparkles",kE);/**
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 CE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],rv=Le("terminal",CE);/**
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 NE=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],EE=Le("triangle-alert",NE);/**
327
- * @license lucide-react v0.577.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const PE=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],nx=Le("user-round",PE);/**
332
- * @license lucide-react v0.577.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const jE=[["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"}]],rx=Le("users",jE);/**
337
- * @license lucide-react v0.577.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const TE=[["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"}]],RE=Le("workflow",TE),ox="contextnest:draft:",tm=(e,t)=>`${ox}${e}:${t}`;function X4(e,t){try{const n=localStorage.getItem(tm(e,t));return n?JSON.parse(n):null}catch{return null}}function OE(e){let t=null,n=1/0;for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);if(!i||i===e||!i.startsWith(ox))continue;let l=0;try{l=Number(JSON.parse(localStorage.getItem(i)||"{}").savedAt)||0}catch{l=0}l<n&&(n=l,t=i)}return t?(localStorage.removeItem(t),!0):!1}function e3(e,t,n){const s=tm(e,t),i=JSON.stringify({...n,savedAt:Date.now()});for(;;)try{return localStorage.setItem(s,i),!0}catch{let l=!1;try{l=OE(s)}catch{l=!1}if(!l)return!1}}function AE(e,t){try{localStorage.removeItem(tm(e,t))}catch{}}const iu="",ME="cnst_token";function sx(){try{localStorage.removeItem(ME)}catch{}}async function W(e,t={}){const n={"Content-Type":"application/json",...t.headers},s=await fetch(`${iu}${e}`,{...t,headers:n,credentials:"include"}),i=await s.text();let l;try{l=i?JSON.parse(i):{}}catch{l={error:i.slice(0,200)}}if(!s.ok){s.status===401&&(sx(),typeof window<"u"&&window.dispatchEvent(new Event("auth:unauthorized")));const f=new Error(l.error||`Request failed: ${s.status}`);throw f.status=s.status,f.body=l,f}return(t.method??"GET").toUpperCase()!=="GET"&&(ys==null||ys.invalidatePath(e)),l}let ys=null;function IE(e){ys=e}function Pf(e){{ys==null||ys.clear();return}}async function ix(e,t){return W("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}async function $E(e,t,n){return W("/auth/register",{method:"POST",body:JSON.stringify({email:e,password:t,name:n})})}async function DE(){return W("/auth/logout",{method:"POST"})}async function ax(){return W("/auth/device",{method:"POST",body:JSON.stringify({})})}async function lx(e,t){return W(`/auth/device/poll?code=${encodeURIComponent(e)}&client_secret=${encodeURIComponent(t)}`)}async function cx(e){return W("/auth/promptowl",{method:"POST",body:JSON.stringify({token:e})})}async function Ma(){return W("/health")}async function LE(){return W("/admin/settings")}async function t3(e){return W("/admin/settings",{method:"PATCH",body:JSON.stringify(e)})}async function n3(e){return W("/admin/settings/test-notification",{method:"POST",body:JSON.stringify({channel:e})})}async function ux(){return W("/license/status")}async function zE(e){return W("/license/install",{method:"POST",body:JSON.stringify({key:e})})}async function jf(){return W("/auth/admin-status")}async function FE(){return W("/auth/teammates")}async function r3(e){return W("/auth/invite",{method:"POST",body:JSON.stringify({email:e})})}async function UE(){return W("/admin/super-admins")}async function o3(e){return W("/admin/super-admins",{method:"POST",body:JSON.stringify({email:e})})}async function s3(e){return W(`/admin/super-admins/${encodeURIComponent(e)}`,{method:"DELETE"})}async function BE(){return W("/admin/community-sites")}async function i3(e){return W("/admin/community-sites",{method:"POST",body:JSON.stringify(e)})}async function a3(e,t){return W(`/admin/community-sites/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function l3(e){return W(`/admin/community-sites/${encodeURIComponent(e)}`,{method:"DELETE"})}async function c3(e){return W("/auth/profile",{method:"PATCH",body:JSON.stringify({name:e})})}async function u3(e,t){return W("/auth/password",{method:"POST",body:JSON.stringify({current:e,next:t})})}async function d3(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 n=t.toString()?`?${t}`:"";return W(`/admin/trace${n}`)}async function f3(e,t={}){const n=new URLSearchParams;t.kind&&n.set("kind",t.kind),t.user&&n.set("user",t.user),t.limit!=null&&n.set("limit",String(t.limit)),t.offset!=null&&n.set("offset",String(t.offset));const s=n.toString()?`?${n}`:"";return W(`/nests/${encodeURIComponent(e)}/trace${s}`)}async function p3(e){return W(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"})}async function m3(e,t){return W(`/auth/admin/reset-password/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify({})})}async function VE(){return W("/auth/keys")}async function HE(e){return W("/auth/keys",{method:"POST",body:JSON.stringify(e||{})})}async function WE(e){return W("/auth/keys/rotate",{method:"POST",body:JSON.stringify(e||{})})}async function h3(e){return W(`/auth/keys/${encodeURIComponent(e)}`,{method:"DELETE"})}async function qE(e){return W(`/nests/${e}/settings`)}async function g3(e,t){return W(`/nests/${e}/settings`,{method:"PATCH",body:JSON.stringify(t)})}function y3(e,t){if(typeof e.prime=="boolean")return e.prime;if(!t.length)return!1;const n=new Set(t);return(e.tags||[]).some(s=>n.has(s.trim().replace(/^#+/,"").toLowerCase()))}async function KE(e){return W(e!=null&&e.archived?"/nests?archived=1":"/nests")}async function v3(e,t){return W("/nests",{method:"POST",body:JSON.stringify({name:e,description:t})})}async function GE(e){return W("/nests/"+e,{method:"DELETE"})}async function w3(e){return W("/nests/"+e+"/archive",{method:"POST"})}async function x3(e){return W("/nests/"+e+"/restore",{method:"POST"})}async function b3(e,t){return W("/nests/"+e+"/pin",{method:t?"POST":"DELETE"})}async function S3(e,t){return W("/nests/"+e,{method:"PATCH",body:JSON.stringify(t)})}const QE=4*1024*1024,ZE=8*1024*1024;async function k3(e,t,n){const s=new TextEncoder,i=[],l=[];let d=[],f=0;for(const x of t){const b=s.encode(x.path).length+s.encode(x.content??"").length;if(b>ZE){l.push(x.path);continue}d.length&&f+b>QE&&(i.push(d),d=[],f=0),d.push(x),f+=b}(d.length||!i.length)&&i.push(d),n==null||n(0,t.length);const g=[...l],y=await W("/nests/import",{method:"POST",body:JSON.stringify({name:e,files:i[0],partial:i.length>1})});g.push(...y.rejected??[]);let v=i[0].length;if(n==null||n(v,t.length),i.length===1)return{nest:y.nest,documents:y.documents??0,rejected:g};const p=y.nest.id;try{for(const b of i.slice(1)){const N=await W("/nests/import",{method:"POST",body:JSON.stringify({nestId:p,files:b})});g.push(...N.rejected??[]),v+=b.length,n==null||n(v,t.length)}return{...await W("/nests/import",{method:"POST",body:JSON.stringify({nestId:p,finalize:!0})}),rejected:g}}catch(x){throw await GE(p).catch(()=>{}),x}}async function YE(){return W("/nests/unsynced")}async function _3(e){return W("/nests/unsynced/sync",{method:"POST",body:JSON.stringify({name:e})})}async function C3(e){return W("/nests/unsynced/sync",{method:"DELETE",body:JSON.stringify({name:e})})}async function N3(e,t,n){return W(`/nests/${e}/visibility`,{method:"PATCH",body:JSON.stringify(n?{visibility:t,acknowledge_public:!0}:{visibility:t})})}async function E3(e,t){return W(`/nests/${e}/reader-mode`,{method:"PATCH",body:JSON.stringify(t)})}async function P3(e,t){return W(`/nests/${e}/branding`,{method:"PATCH",body:JSON.stringify(t)})}async function JE(e){return W(`/nests/${e}`)}async function XE(e){return W(`/nests/${e}/definitions`)}async function j3(e,t){return W(`/nests/${e}/definitions`,{method:"POST",body:JSON.stringify(t)})}async function T3(e,t){return W(`/nests/${e}/definitions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function R3(e,t){const n=new FormData;n.append("file",t);const s=await fetch(`/nests/${e}/assets`,{method:"POST",body:n,credentials:"include"}),i=await s.json().catch(()=>({}));if(!s.ok)throw new Error(i.error||`Upload failed: ${s.status}`);return i}async function e2(e){return W(`/nests/${e}/nodes?content=1`)}async function t2(e,t){return W(`/nests/${e}/nodes?folder=${encodeURIComponent(t)}`)}async function n2(e,t=!1){return W(`/nests/${e}/nodes${t?"?approved_only=1":""}`)}async function r2(e){return W(`/nests/${e}/census`)}async function o2(e){return W(`/nests/${e}/comment-counts`)}async function s2(e,t,n=!1){return W(`/nests/${e}/nodes/${t}${n?"?approved_only=1":""}`)}async function O3(e,t){return W(`/nests/${e}/nodes`,{method:"POST",body:JSON.stringify(t)})}async function A3(e,t,n={}){const s=new FormData;s.append("file",t),n.title&&s.append("title",n.title),n.folder&&s.append("folder",n.folder),n.nodeId&&s.append("nodeId",n.nodeId);for(const d of n.tags??[])s.append("tags",d);const i=await fetch(`/nests/${e}/nodes/pdf`,{method:"POST",body:s,credentials:"include"}),l=await i.json().catch(()=>({}));if(!i.ok)throw new Error(l.error||`PDF upload failed: ${i.status}`);return l}function M3(e,t,n={}){const s=new URLSearchParams;n.version&&s.set("version",String(n.version)),n.approvedOnly&&s.set("approved_only","1"),n.download&&s.set("download","1");const i=s.toString();return`/nests/${e}/nodes/${t}/pdf${i?`?${i}`:""}`}async function I3(e,t,n,s){const i={};return s!==void 0&&(i["X-Base-Version"]=String(s)),W(`/nests/${e}/nodes/${t}`,{method:"PATCH",headers:i,body:JSON.stringify(n)})}async function $3(e,t){return W(`/nests/${e}/nodes/${t}`,{method:"DELETE"})}async function D3(e,t,n){return W(`/nests/${e}/nodes/${t}/move`,{method:"POST",body:JSON.stringify({folder:n})})}async function i2(e,t){return W(`/nests/${e}/search?q=${encodeURIComponent(t)}`)}async function a2(e,t=20){return W(`/search?q=${encodeURIComponent(e)}&limit=${t}`)}async function l2(e){return W(`/nests/${e}/overview`)}async function c2(e,t={}){const n=new URLSearchParams({format:"markdown"});t.selector&&n.set("selector",t.selector),t.maxTokens&&n.set("max_tokens",String(t.maxTokens));const s=await fetch(`${iu}/nests/${e}/export?${n.toString()}`,{credentials:"include"});if(!s.ok){const i=await s.text();let l=`Export failed (${s.status})`;try{l=JSON.parse(i).error||l}catch{}throw new Error(l)}return s.text()}async function u2(e,t={}){const n=new URLSearchParams({format:"bundle"});t.includeDrafts&&n.set("includeDrafts","1");const s=await fetch(`${iu}/nests/${e}/export?${n.toString()}`,{credentials:"include"});if(!s.ok){const g=await s.text();let y=`Export failed (${s.status})`;try{y=JSON.parse(g).error||y}catch{}throw new Error(y)}const i=await s.blob(),l=URL.createObjectURL(i),d=document.createElement("a");d.href=l;const f=(t.nestName||"nest").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"nest";d.download=`${f}-bundle.zip`,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(l)}async function d2(e){const t=await W(`/nests/${e}/overview`),n=(t==null?void 0:t.tags)??{};return Object.keys(n).map(s=>s.replace(/^#+/,"")).filter(Boolean).sort((s,i)=>s.localeCompare(i))}async function f2(e){return W(`/nests/${e}/stewards`)}async function L3(e){return W(`/nests/${e}/stewards/sync`,{method:"POST",body:"{}"})}async function z3(e,t){return W(`/nests/${e}/stewards`,{method:"POST",body:JSON.stringify(t)})}async function F3(e,t){return W(`/nests/${e}/stewards/${t}`,{method:"DELETE"})}async function U3(e,t,n){return W(`/nests/${e}/stewards/${t}`,{method:"PATCH",body:JSON.stringify(n)})}async function p2(e,t){return W(`/nests/${e}/nodes/${t}/stewards`)}async function B3(e,t,n){return W(`/nests/${e}/nodes/${t}/request-deletion`,{method:"POST",body:JSON.stringify({reason:n})})}async function V3(e,t){return W(`/nests/${e}/delete-folder`,{method:"POST",body:JSON.stringify({folder:t})})}async function H3(e,t,n,s){return W(`/nests/${e}/request-deletion`,{method:"POST",body:JSON.stringify({targetType:t,target:n,reason:s})})}async function m2(e,t="pending"){return W(`/nests/${e}/deletion-requests?status=${encodeURIComponent(t)}`)}async function W3(e,t){return W(`/nests/${e}/deletion-requests/${t}/delete`,{method:"POST"})}async function q3(e,t,n){return W(`/nests/${e}/deletion-requests/${t}/decline`,{method:"POST",body:JSON.stringify({note:n})})}async function K3(e,t){return W(`/nests/${e}/deletion-requests/${t}/withdraw`,{method:"POST"})}async function G3(e,t){return W(`/nests/${e}/folders`,{method:"POST",body:JSON.stringify({folder:t})})}async function Q3(e,t){return W(`/nests/${e}/nodes/${t}/cancel-review`,{method:"POST"})}async function h2(e,t="pending"){return W(`/nests/${e}/review-queue?status=${encodeURIComponent(t)}`)}async function g2(e,t="all",n=50,s=0){const i=new URLSearchParams({filter:t,limit:String(n),offset:String(s)});return W(`/nests/${e}/feed?${i.toString()}`)}async function Z3(e,t,n,s){return W(`/nests/${e}/nodes/${t}/submit-review`,{method:"POST",body:JSON.stringify({note:n,priority:s})})}async function Y3(e,t,n){return W(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:n})})}async function J3(e,t,n){return W(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:n})})}async function X3(e,t,n,s){return W(`/nests/${e}/review-queue/bulk`,{method:"POST",body:JSON.stringify({action:t,nodeIds:n,note:s})})}async function ez(e,t,n){return W(`/nests/${e}/nodes/${t}/revert`,{method:"POST",body:JSON.stringify({targetVersion:n})})}async function y2(e,t){return W(`/nests/${e}/nodes/${t}/versions`)}async function tz(e,t,n){return W(`/nests/${e}/nodes/${t}/versions/${n}`)}async function v2(e,t){return W(`/nests/${e}/nodes/${t}/reviews`)}function w2(e,t,n,s){const i=new URLSearchParams;n!=null&&i.set("v",String(n)),s!=null&&i.set("_",String(s));const l=i.toString(),d=t.replace(/^nodes\//,"");return`${iu}/nests/${e}/nodes/${d}/hosted${l?`?${l}`:""}`}async function nz(e,t,n,s){const i=await fetch(w2(e,t,n,s),{credentials:"include",cache:"no-store"});if(!i.ok)throw new Error(`Failed to load artifact (${i.status})`);const l=i.headers.get("X-Artifact-Snapshot"),d=l?Number(l):null;return{html:await i.text(),snapshot:Number.isFinite(d)?d:null}}async function x2(e,t){return W(`/nests/${e}/nodes/${t}/annotations`)}async function rz(e,t,n){return W(`/nests/${e}/nodes/${t}/annotations`,{method:"POST",body:JSON.stringify(n)})}async function oz(e,t,n,s){return W(`/nests/${e}/nodes/${t}/annotations/${n}/comments`,{method:"POST",body:JSON.stringify({body:s})})}async function sz(e,t,n){return W(`/nests/${e}/nodes/${t}/annotations/${n}/resolve`,{method:"POST",body:"{}"})}async function iz(e,t,n){return W(`/nests/${e}/nodes/${t}/annotations/${n}/reopen`,{method:"POST",body:"{}"})}async function b2(e,t,n){const s=n?`?status=${n}`:"";return W(`/nests/${e}/nodes/${t}/comments${s}`)}async function S2(e,t,n=100){return W(`/nests/${e}/nodes/${t}/activity?limit=${n}`)}async function k2(e,t=!1){return W(`/nests/${e}/external-edits${t?"?refresh=true":""}`)}async function _2(e){return W(`/nests/${e}/external-edits?count=1`)}async function az(e){return W(`/nests/${e}/external-edits/scan`,{method:"POST",body:"{}"})}async function C2(e,t){return W(`/nests/${e}/nodes/${t}/external-edits`)}async function lz(e,t,n){return W(`/nests/${e}/nodes/${t}/external-edits/${n}`)}async function cz(e,t,n,s){return W(`/nests/${e}/nodes/${t}/external-edits/${n}/approve`,{method:"POST",body:JSON.stringify({comment:s})})}async function uz(e,t,n,s){return W(`/nests/${e}/nodes/${t}/external-edits/${n}/reject`,{method:"POST",body:JSON.stringify({reason:s})})}async function dz(e){return W(`/nests/${e}/publications`)}async function fz(e,t){return W(`/nests/${e}/publications`,{method:"POST",body:JSON.stringify(t)})}async function pz(e,t){return W(`/nests/${e}/publications/${t}/views`)}async function mz(e,t){return W(`/nests/${e}/publications/${t}`,{method:"DELETE"})}async function N2(e){return W(`/nests/${e}/collaborators`)}async function E2(e){return W(`/nests/${e}/mentionable`)}async function P2(e=""){const t=e.trim()?`?q=${encodeURIComponent(e.trim())}`:"";return W(`/people/suggest${t}`)}async function hz(e,t){return W(`/nests/${e}/collaborators`,{method:"POST",body:JSON.stringify(t)})}async function gz(e,t,n){return W(`/nests/${e}/collaborators/${t}`,{method:"PATCH",body:JSON.stringify({permission:n})})}async function yz(e,t){return W(`/nests/${e}/collaborators/${t}`,{method:"DELETE"})}async function vz(e){return W(`/nests/${e}/grants`)}async function wz(e,t){return W(`/nests/${e}/grants`,{method:"POST",body:JSON.stringify(t)})}async function xz(e,t){return W(`/nests/${e}/grants/${t}`,{method:"DELETE"})}const bz=[{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 j2(){return W("/teams")}async function T2(e){return W(`/teams/${e}`)}async function Sz(e){return W("/teams",{method:"POST",body:JSON.stringify({name:e})})}async function kz(e,t){return W(`/teams/${e}`,{method:"PATCH",body:JSON.stringify({name:t})})}async function _z(e){return W(`/teams/${e}`,{method:"DELETE"})}async function Cz(e,t){return W(`/teams/${e}/members`,{method:"POST",body:JSON.stringify(t)})}async function Nz(e,t,n){return W(`/teams/${e}/members/${t}`,{method:"PATCH",body:JSON.stringify({role:n})})}async function Ez(e,t){return W(`/teams/${e}/members/${t}`,{method:"DELETE"})}function Pz(e){return["owner","editor"].includes((e.your_role||"").toLowerCase())}const R2="promptowl_connect_required";function jz(){return typeof document>"u"?!1:document.cookie.split(";").some(e=>e.trim().startsWith("cnst_po_session="))}function Tz(e){var t;return((t=e==null?void 0:e.body)==null?void 0:t.code)===R2}async function O2(){return W("/teams/promptowl")}async function Rz(e){return W("/teams/promptowl/sync",{method:"POST",body:JSON.stringify({team_ids:e})})}async function A2(e){return W(`/nests/${e}/teams`)}async function Oz(e,t){return W(`/nests/${e}/teams`,{method:"POST",body:JSON.stringify({team_id:t})})}async function Az(e,t){return W(`/nests/${e}/teams/${t}`,{method:"DELETE"})}async function M2(e){return W(`/nests/${e}/graph`)}async function I2(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 n=t.toString();return W(`/me/work${n?`?${n}`:""}`)}async function $2(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 n=t.toString();return W(`/me/drafts${n?`?${n}`:""}`)}async function Mz(e,t){const n=await W(`/nests/${e}/nodes/${t}/discard`,{method:"POST"});return AE(e,t),n}async function Iz(e,t,n){return W(`/nests/${e}/nodes/${t}/approve`,{method:"POST",body:JSON.stringify({note:n})})}async function $z(e,t,n){return W(`/nests/${e}/nodes/${t}/reject`,{method:"POST",body:JSON.stringify({note:n})})}const Dz=e=>e.status==="running"&&!e.claimed_by;async function D2(e){return(await W(`/nests/${e}/edge-types`)).edge_types}async function L2(e){return(await W(`/nests/${e}/edges`)).edges}async function Lz(e,t){return(await W(`/nests/${e}/edges`,{method:"POST",body:JSON.stringify(t)})).edge}async function zz(e,t,n){return(await W(`/nests/${e}/edges/${t}`,{method:"PATCH",body:JSON.stringify(n)})).edge}async function Fz(e,t){return W(`/nests/${e}/edges/${t}`,{method:"DELETE"})}async function z2(e){return(await W(`/nests/${e}/schedules`)).schedules}async function Uz(e,t){return(await W(`/nests/${e}/schedules`,{method:"POST",body:JSON.stringify(t)})).schedule}async function Bz(e,t,n){return(await W(`/nests/${e}/schedules/${t}`,{method:"PATCH",body:JSON.stringify(n)})).schedule}async function Vz(e,t){return W(`/nests/${e}/schedules/${t}`,{method:"DELETE"})}async function F2(e,t){return(await W(`/nests/${e}/nodes/${t}/watchers`)).watchers}async function Hz(e,t,n){return(await W(`/nests/${e}/nodes/${t}/watchers`,{method:"POST",body:JSON.stringify({email:n})})).watchers}async function Wz(e,t,n){return(await W(`/nests/${e}/nodes/${t}/watchers?email=${encodeURIComponent(n)}`,{method:"DELETE"})).watchers}async function U2(){return W("/me/notifications?unread=true")}async function qz(e){return W(`/me/nests/${e}/leave`,{method:"POST"})}async function Kz(e){return W("/me/notifications/read",{method:"POST",body:JSON.stringify({ids:e})})}async function B2(e){return(await W(`/nests/${e}/env`)).env}async function Gz(e,t,n){return W(`/nests/${e}/env`,{method:"PUT",body:JSON.stringify({key:t,value:n})})}async function Qz(e,t){return W(`/nests/${e}/env/${encodeURIComponent(t)}`,{method:"DELETE"})}async function V2(e,t){const n=t?`?agent=${encodeURIComponent(t)}`:"";return(await W(`/nests/${e}/hooks${n}`)).hooks}async function Zz(e,t,n){return(await W(`/nests/${e}/hooks`,{method:"POST",body:JSON.stringify({agent_node:t,preset:n})})).hook}async function Yz(e,t){return W(`/nests/${e}/hooks/${t}`,{method:"DELETE"})}async function H2(e){return(await W(`/nests/${e}/connectors`)).connectors}async function Jz(e,t){return(await W(`/nests/${e}/connectors`,{method:"POST",body:JSON.stringify(t)})).connector}async function Xz(e,t,n){return(await W(`/nests/${e}/connectors/${t}`,{method:"PATCH",body:JSON.stringify(n)})).connector}async function eF(e,t){return W(`/nests/${e}/connectors/${t}`,{method:"DELETE"})}async function tF(e,t,n){return W(`/nests/${e}/table-query`,{method:"POST",body:JSON.stringify({table:t,query:n,include_drafts:!0})})}async function nF(e,t,n,s=4e3){return W(`/nests/${e}/context`,{method:"POST",body:JSON.stringify({selector:t,hops:n,max_tokens:s})})}async function rF(e,t,n){const s=new URLSearchParams;s.set("limit",String(n));const i=s.toString();return(await W(`/nests/${e}/runs${i?`?${i}`:""}`)).runs}async function oF(e){const t=await W(`/runs/${e}`);return{...t.run,steps:t.steps}}async function sF(e,t){return W(`/runs/${e}`,{method:"PATCH",body:JSON.stringify({status:"cancelled",trace:{error:"Cancelled from the Runs page"}})})}async function iF(e,t,n,s){return W(`/nests/${e}/run/${t}`,{method:"POST",body:JSON.stringify({...n?{inputs:n}:{},...s?{parent_run_id:s}:{}})})}async function W2(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 Pi(e,t){const n=await W2(e);return n?t&&Aa.success(t):Aa.error("Couldn't copy automatically — select the text and copy it manually."),n}let Ic=null;const Ra=[],q2=50;function K2(e,t){if(!e){Ra.length=0;return}Ic||(Ic=jt(async()=>{const{default:n}=await import("./module-uADzTImp.js");return{default:n}},[]).then(({default:n})=>{n.init(e,{api_host:t||"https://us.i.posthog.com",person_profiles:"identified_only"});for(const[s,i]of Ra.splice(0))n.capture(s,i);return n}).catch(n=>(console.warn("[analytics] PostHog failed to load",n),Ra.length=0,null)))}function G2(e,t){if(!Ic){Ra.length<q2&&Ra.push([e,t]);return}Ic.then(n=>n==null?void 0:n.capture(e,t))}const dx=m.createContext(null);function Q2({children:e}){var ee;const[t,n]=m.useState(null),[s,i]=m.useState(null),[l,d]=m.useState(null),[f,g]=m.useState(!1),[y,v]=m.useState(!1),[p,x]=m.useState(!0),[b,N]=m.useState(!1),[S,C]=m.useState(!0),[_,E]=m.useState(!1),[T,j]=m.useState(8),[q,V]=m.useState(16),[D,$]=m.useState(null),[F,I]=m.useState(!1),[re,fe]=m.useState(!0),[de,ge]=m.useState(null),ce=m.useRef(0),te=m.useCallback((Y,L)=>Y==="open"?!0:!!L,[]),ie=m.useCallback(async()=>{try{const Y=await Ma();i(Y.logo_url??null),g(!!Y.workflow_plane_enabled),v(!!Y.promptowl_teams_enabled),x(Y.type_artifact_enabled!==!1),C(Y.type_table_enabled!==!1),N(!!Y.shared_deployment),E(!!Y.subagent_runs_enabled),typeof Y.subagent_max_depth=="number"&&j(Y.subagent_max_depth),typeof Y.subagent_max_children=="number"&&V(Y.subagent_max_children)}catch{}},[]),G=m.useCallback(async()=>{const Y=++ce.current;try{const L=await jf();if(ce.current!==Y)return;$(L),I(t==="open"?!0:!!L.me)}catch{}},[t]);m.useEffect(()=>{sx();let Y=!1;return(async()=>{try{const L=await Ma();if(Y)return;const ne=L.auth_mode;n(ne),i(L.logo_url??null),d(L.version??null),g(!!L.workflow_plane_enabled),v(!!L.promptowl_teams_enabled),x(L.type_artifact_enabled!==!1),C(L.type_table_enabled!==!1),N(!!L.shared_deployment),E(!!L.subagent_runs_enabled),K2(L.posthog_key,L.posthog_host),typeof L.subagent_max_depth=="number"&&j(L.subagent_max_depth),typeof L.subagent_max_children=="number"&&V(L.subagent_max_children);const X=await jf();if(Y)return;$(X),I(te(ne,X.me))}catch{Y||ge("Cannot connect to server")}finally{Y||fe(!1)}})(),()=>{Y=!0}},[te]),m.useEffect(()=>{if(!s)return;const Y=document.querySelector('link[rel="icon"]');Y&&(Y.href=s)},[s]),m.useEffect(()=>{const Y=()=>{++ce.current,I(t==="open"),$(L=>L&&{...L,me:null})};return window.addEventListener("auth:unauthorized",Y),()=>window.removeEventListener("auth:unauthorized",Y)},[t]),m.useEffect(()=>{const Y="cnst_auth_tick",L=X=>{X.key===Y&&(Pf(),G())},ne=()=>{document.visibilityState==="visible"&&G()};return window.addEventListener("storage",L),document.addEventListener("visibilitychange",ne),()=>{window.removeEventListener("storage",L),document.removeEventListener("visibilitychange",ne)}},[G]);const Z=m.useCallback(()=>{try{localStorage.setItem("cnst_auth_tick",String(Date.now()))}catch{}},[]),U=m.useCallback(Y=>{const L=++ce.current;if(Pf(),Y){const ne=Y.name??null;$(X=>({claimed:(X==null?void 0:X.claimed)??!0,admin:(X==null?void 0:X.admin)??{email:Y.email,name:ne},me:{email:Y.email,name:ne,is_admin:Y.is_admin}})),I(!0)}Z(),(async()=>{try{const ne=await jf();ce.current===L&&($(ne),I(te(t,ne.me)))}catch{}})()},[t,Z,te]),R=m.useCallback(async()=>{if(++ce.current,document.cookie.split(";").some(L=>L.trim().startsWith("cnst_sso_session="))){window.location.assign("/auth/oidc/logout");return}try{await DE()}catch{}Pf(),I(t==="open"),$(L=>L&&{...L,me:null}),Z()},[t,Z]),A=!!((ee=D==null?void 0:D.me)!=null&&ee.is_admin);return c.jsx(dx.Provider,{value:{authMode:t,logoUrl:s,serverVersion:l,adminStatus:D,authenticated:F,isAdmin:A,workflowPlaneEnabled:f,promptowlTeamsEnabled:y,typeArtifactEnabled:p,typeTableEnabled:S,sharedDeployment:b,subagentRunsEnabled:_,subagentMaxDepth:T,subagentMaxChildren:q,loading:re,error:de,refresh:G,refreshHealth:ie,loginSuccess:U,logout:R},children:e})}function Ja(){const e=m.useContext(dx);if(!e)throw new Error("useAuth must be used inside <AuthProvider>");return e}var Aw;const xr=typeof window<"u"&&((Aw=new URLSearchParams(window.location.search).get("invite"))==null?void 0:Aw.trim())||null;function Z2(){const{loginSuccess:e,logoUrl:t}=Ja(),[n,s]=m.useState("login"),[i,l]=m.useState(xr??""),[d,f]=m.useState(""),[g,y]=m.useState(""),[v,p]=m.useState(null),[x,b]=m.useState(!1),[N,S]=m.useState(null),[C,_]=m.useState(null),[E,T]=m.useState(!1),[j,q]=m.useState(!1),[V,D]=m.useState("open"),[$,F]=m.useState("open"),[I,re]=m.useState({enabled:!1,issuer:""}),fe=typeof window<"u"&&new URLSearchParams(window.location.search).has("admin"),de=V==="open"||V==="admin-only"&&fe,ge=$!=="disabled",ce=$==="open",te=(()=>{try{const U=new URL(I.issuer).host;if(U==="login.microsoftonline.com")return"Sign in with Microsoft";if(U==="accounts.google.com")return"Sign in with Google"}catch{}return"Sign in with SSO"})();m.useEffect(()=>{let U=!1;return Ma().then(R=>{U||(D(R.promptowl_sign_in_gate??"open"),F(R.manual_sign_in??"open"),re({enabled:!!R.oidc_enabled,issuer:R.oidc_issuer??""}))}).catch(()=>{}),()=>{U=!0}},[]);const ie=async()=>{C&&await Pi(C)&&(T(!0),setTimeout(()=>T(!1),1500))},G=async U=>{U.preventDefault(),p(null),b(!0);try{const R=n==="register"?await $E(i,d,g):await ix(i,d);e(R.user?{email:R.user.email,name:R.user.name,is_admin:!!R.user.is_admin}:void 0)}catch(R){p(n==="login"&&R.status===401?`Invalid email or password. If you were invited, ${de?"continue with PromptOwl using the invited email, or ":""}use the temporary password from your invite email, or ask your admin to reset it.`:R.message)}finally{b(!1)}},Z=async()=>{var U,R;p(null),b(!0);try{const A=await ax(),ee=xr?`${A.verificationUrl}${A.verificationUrl.includes("?")?"&":"?"}email=${encodeURIComponent(xr)}`:A.verificationUrl;S(ee),_(A.deviceCode),window.open(ee,"_blank","noopener,noreferrer");for(let Y=0;Y<180;Y++){await new Promise(X=>setTimeout(X,2e3));const L=await lx(A.deviceCode,A.clientSecret);if(L.status==="approved"&&L.token){const X=await cx(L.token),oe=(R=(U=X.user)==null?void 0:U.email)==null?void 0:R.toLowerCase();xr&&oe&&oe!==xr.toLowerCase()&&Aa.warning(`You signed in as ${oe}, but the invite was for ${xr}. Nests shared with ${xr} won't show here — sign out and continue with PromptOwl using that email.`,{duration:15e3}),e(X.user?{email:X.user.email,name:X.user.name,is_admin:!!X.user.is_admin}:void 0);return}if(L.status==="pending")continue;const ne=L.status==="denied"||L.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":L.status==="expired"?"Login expired. Try again.":L.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${L.status}). Try again.`;p(ne),S(null),_(null),b(!1);return}p("Login timed out waiting for approval. Try again."),S(null),_(null),b(!1)}catch(A){p(A.message),S(null),_(null),b(!1)}};return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:c.jsxs("div",{className:"w-full max-w-sm space-y-6 p-6",children:[c.jsxs("div",{className:"text-center",children:[t?c.jsx("img",{src:t,alt:"",className:"h-12 w-12 mx-auto object-contain"}):c.jsx("span",{className:"text-4xl",children:"🪺"}),c.jsx("h1",{className:"text-xl font-semibold mt-2",children:"ContextNest"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Community Server"})]}),xr&&!N&&c.jsxs("div",{className:"rounded-md border border-primary/30 bg-primary/5 p-3 text-sm space-y-1",children:[c.jsxs("p",{children:["You were invited as ",c.jsx("strong",{children:xr}),"."]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:de?"Continue with PromptOwl using this email — you can create a PromptOwl account there if you don't have one. Or sign in below with the temporary password from your invite email.":"Sign in below with the temporary password from your invite email."})]}),de&&c.jsx("button",{onClick:Z,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...":xr?"Continue with PromptOwl":"Login with PromptOwl"}),I.enabled&&!N&&c.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:te}),N&&c.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",c.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&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:C}),c.jsx("button",{type:"button",onClick:ie,className:"px-2 py-1.5 rounded border text-xs hover:bg-secondary",children:E?"Copied":"Copy"})]})]}),!N&&ge&&c.jsxs(c.Fragment,{children:[(de||I.enabled)&&c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("div",{className:"w-full border-t border-border"})}),c.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),c.jsxs("form",{onSubmit:G,className:"space-y-3",children:[n==="register"&&c.jsx("input",{type:"text",placeholder:"Name",value:g,onChange:U=>y(U.target.value),className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),c.jsx("input",{type:"email",placeholder:"Email",value:i,onChange:U=>l(U.target.value),required:!0,className:"w-full px-3 py-2 rounded-md border border-input bg-background text-sm"}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:j?"text":"password",placeholder:"Password",value:d,onChange:U=>f(U.target.value),required:!0,className:"w-full px-3 py-2 pr-9 rounded-md border border-input bg-background text-sm"}),c.jsx("button",{type:"button",onClick:()=>q(U=>!U),"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?c.jsx(Zw,{className:"h-4 w-4"}):c.jsx(Yw,{className:"h-4 w-4"})})]}),c.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?"...":n==="register"?"Create Account":"Login"})]})]}),v&&c.jsx("p",{className:"text-sm text-destructive text-center",children:v}),!N&&ge&&ce&&c.jsx("p",{className:"text-xs text-center text-muted-foreground",children:n==="login"?c.jsxs(c.Fragment,{children:["No account?"," ",c.jsx("button",{onClick:()=>s("register"),className:"text-primary underline",children:"Register"})]}):c.jsxs(c.Fragment,{children:["Have an account?"," ",c.jsx("button",{onClick:()=>s("login"),className:"text-primary underline",children:"Login"})]})}),!N&&!ge&&!de&&!I.enabled&&c.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Sign-in is restricted on this server. Contact your admin for access."}),V==="admin-only"&&!fe&&!N&&c.jsx("p",{className:"text-xs text-center text-muted-foreground",children:c.jsx("a",{href:"?admin=1",className:"text-primary underline",children:"Admin sign-in"})})]})})}var Ii=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(){}},as,xo,pi,Mw,Y2=(Mw=class extends Ii{constructor(){super();Pe(this,as);Pe(this,xo);Pe(this,pi);ve(this,pi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,xo)||this.setEventListener(O(this,pi))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,xo))==null||t.call(this),ve(this,xo,void 0))}setEventListener(t){var n;ve(this,pi,t),(n=O(this,xo))==null||n.call(this),ve(this,xo,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){O(this,as)!==t&&(ve(this,as,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,as)=="boolean"?O(this,as):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},as=new WeakMap,xo=new WeakMap,pi=new WeakMap,Mw),nm=new Y2,J2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bo,Kp,Iw,X2=(Iw=class{constructor(){Pe(this,bo,J2);Pe(this,Kp,!1)}setTimeoutProvider(e){ve(this,bo,e)}setTimeout(e,t){return O(this,bo).setTimeout(e,t)}clearTimeout(e){O(this,bo).clearTimeout(e)}setInterval(e,t){return O(this,bo).setInterval(e,t)}clearInterval(e){O(this,bo).clearInterval(e)}},bo=new WeakMap,Kp=new WeakMap,Iw),is=new X2;function eP(e){setTimeout(e,0)}var tP=typeof window>"u"||"Deno"in globalThis;function tn(){}function nP(e,t){return typeof e=="function"?e(t):e}function Xf(e){return typeof e=="number"&&e>=0&&e!==1/0}function fx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jo(e,t){return typeof e=="function"?e(t):e}function jn(e,t){return typeof e=="function"?e(t):e}function ov(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:l,queryKey:d,stale:f}=e;if(d){if(s){if(t.queryHash!==rm(d,t.options))return!1}else if(!ji(t.queryKey,d))return!1}if(n!=="all"){const g=t.isActive();if(n==="active"&&!g||n==="inactive"&&g)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||l&&!l(t))}function sv(e,t){const{exact:n,status:s,predicate:i,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Ia(t.options.mutationKey)!==Ia(l))return!1}else if(!ji(t.options.mutationKey,l))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ia)(e)}function Ia(e){return JSON.stringify(e,(t,n)=>ep(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function ji(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 s=0;s<t.length;s++)if(!ji(e[s],t[s]))return!1;return!0}const n=Object.keys(t);for(const s of n)if(!ji(e[s],t[s]))return!1;return!0}return!1}var rP=Object.prototype.hasOwnProperty;function om(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=iv(e)&&iv(t);if(!s&&!(ep(e)&&ep(t)))return t;const l=(s?e:Object.keys(e)).length,d=s?t:Object.keys(t),f=d.length,g=s?new Array(f):{};let y=0;for(let v=0;v<f;v++){const p=s?v:d[v],x=e[p],b=t[p];if(x===b){g[p]=x,(s?v<l:rP.call(e,p))&&y++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){g[p]=b;continue}const N=om(x,b,n+1);g[p]=N,N===x&&y++}return l===f&&y===l?e:g}function $c(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function iv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ep(e){if(!av(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!av(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function av(e){return Object.prototype.toString.call(e)==="[object Object]"}function oP(e){return new Promise(t=>{is.setTimeout(t,e)})}function tp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?om(e,t):t}function sP(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function iP(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var sm=Symbol();function px(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===sm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mx(e,t){return typeof e=="function"?e(...t):!!e}function aP(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var $a=(()=>{let e=()=>tP;return{isServer(){return e()},setIsServer(t){e=t}}})();function np(){let e,t;const n=new Promise((i,l)=>{e=i,t=l});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var lP=eP;function cP(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=lP;const l=f=>{t?e.push(f):i(()=>{n(f)})},d=()=>{const f=e;e=[],f.length&&i(()=>{s(()=>{f.forEach(g=>{n(g)})})})};return{batch:f=>{let g;t++;try{g=f()}finally{t--,t||d()}return g},batchCalls:f=>(...g)=>{l(()=>{f(...g)})},schedule:l,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var kt=cP(),mi,So,hi,$w,uP=($w=class extends Ii{constructor(){super();Pe(this,mi,!0);Pe(this,So);Pe(this,hi);ve(this,hi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){O(this,So)||this.setEventListener(O(this,hi))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,So))==null||t.call(this),ve(this,So,void 0))}setEventListener(t){var n;ve(this,hi,t),(n=O(this,So))==null||n.call(this),ve(this,So,t(this.setOnline.bind(this)))}setOnline(t){O(this,mi)!==t&&(ve(this,mi,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return O(this,mi)}},mi=new WeakMap,So=new WeakMap,hi=new WeakMap,$w),Dc=new uP;function dP(e){return Math.min(1e3*2**e,3e4)}function hx(e){return(e??"online")==="online"?Dc.isOnline():!0}var rp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gx(e){let t=!1,n=0,s;const i=np(),l=()=>i.status!=="pending",d=S=>{var C;if(!l()){const _=new rp(S);x(_),(C=e.onCancel)==null||C.call(e,_)}},f=()=>{t=!0},g=()=>{t=!1},y=()=>nm.isFocused()&&(e.networkMode==="always"||Dc.isOnline())&&e.canRun(),v=()=>hx(e.networkMode)&&e.canRun(),p=S=>{l()||(s==null||s(),i.resolve(S))},x=S=>{l()||(s==null||s(),i.reject(S))},b=()=>new Promise(S=>{var C;s=_=>{(l()||y())&&S(_)},(C=e.onPause)==null||C.call(e)}).then(()=>{var S;s=void 0,l()||(S=e.onContinue)==null||S.call(e)}),N=()=>{if(l())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(_){S=Promise.reject(_)}Promise.resolve(S).then(p).catch(_=>{var V;if(l())return;const E=e.retry??($a.isServer()?0:3),T=e.retryDelay??dP,j=typeof T=="function"?T(n,_):T,q=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,_);if(t||!q){x(_);return}n++,(V=e.onFail)==null||V.call(e,n,_),oP(j).then(()=>y()?void 0:b()).then(()=>{t?x(_):N()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:g,canStart:v,start:()=>(v()?N():b().then(N),i)}}var ls,Dw,yx=(Dw=class{constructor(){Pe(this,ls)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xf(this.gcTime)&&ve(this,ls,is.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($a.isServer()?1/0:300*1e3))}clearGcTimeout(){O(this,ls)!==void 0&&(is.clearTimeout(O(this,ls)),ve(this,ls,void 0))}},ls=new WeakMap,Dw);function fP(e){return{onFetch:(t,n)=>{var v,p,x,b,N;const s=t.options,i=(x=(p=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:p.fetchMore)==null?void 0:x.direction,l=((b=t.state.data)==null?void 0:b.pages)||[],d=((N=t.state.data)==null?void 0:N.pageParams)||[];let f={pages:[],pageParams:[]},g=0;const y=async()=>{let S=!1;const C=T=>{aP(T,()=>t.signal,()=>S=!0)},_=px(t.options,t.fetchOptions),E=async(T,j,q)=>{if(S)return Promise.reject(t.signal.reason);if(j==null&&T.pages.length)return Promise.resolve(T);const D=(()=>{const re={client:t.client,queryKey:t.queryKey,pageParam:j,direction:q?"backward":"forward",meta:t.options.meta};return C(re),re})(),$=await _(D),{maxPages:F}=t.options,I=q?iP:sP;return{pages:I(T.pages,$,F),pageParams:I(T.pageParams,j,F)}};if(i&&l.length){const T=i==="backward",j=T?pP:lv,q={pages:l,pageParams:d},V=j(s,q);f=await E(q,V,T)}else{const T=e??l.length;do{const j=g===0?d[0]??s.initialPageParam:lv(s,f);if(g>0&&j==null)break;f=await E(f,j),g++}while(g<T)}return f};t.options.persister?t.fetchFn=()=>{var S,C;return(C=(S=t.options).persister)==null?void 0:C.call(S,y,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=y}}}function lv(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function pP(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var gi,cs,yi,Un,us,$t,Ua,ds,Pn,vx,Fr,Lw,mP=(Lw=class extends yx{constructor(t){super();Pe(this,Pn);Pe(this,gi);Pe(this,cs);Pe(this,yi);Pe(this,Un);Pe(this,us);Pe(this,$t);Pe(this,Ua);Pe(this,ds);ve(this,ds,!1),ve(this,Ua,t.defaultOptions),this.setOptions(t.options),this.observers=[],ve(this,us,t.client),ve(this,Un,O(this,us).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ve(this,cs,uv(this.options)),this.state=t.state??O(this,cs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return O(this,gi)}get promise(){var t;return(t=O(this,$t))==null?void 0:t.promise}setOptions(t){if(this.options={...O(this,Ua),...t},t!=null&&t._type&&ve(this,gi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=uv(this.options);n.data!==void 0&&(this.setState(cv(n.data,n.dataUpdatedAt)),ve(this,cs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&O(this,Un).remove(this)}setData(t,n){const s=tp(this.state.data,t,this.options);return Be(this,Pn,Fr).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t){Be(this,Pn,Fr).call(this,{type:"setState",state:t})}cancel(t){var s,i;const n=(s=O(this,$t))==null?void 0:s.promise;return(i=O(this,$t))==null||i.cancel(t),n?n.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return O(this,cs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>jn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>jo(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:!fx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,$t))==null||n.continue()}onOnline(){var n;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,$t))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),O(this,Un).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(O(this,$t)&&(O(this,ds)||Be(this,Pn,vx).call(this)?O(this,$t).cancel({revert:!0}):O(this,$t).cancelRetry()),this.scheduleGc()),O(this,Un).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Pn,Fr).call(this,{type:"invalidate"})}async fetch(t,n){var y,v,p,x,b,N,S,C,_,E,T;if(this.state.fetchStatus!=="idle"&&((y=O(this,$t))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,$t))return O(this,$t).continueRetry(),O(this,$t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(q=>q.options.queryFn);j&&this.setOptions(j.options)}const s=new AbortController,i=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ve(this,ds,!0),s.signal)})},l=()=>{const j=px(this.options,n),V=(()=>{const D={client:O(this,us),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return ve(this,ds,!1),this.options.persister?this.options.persister(j,V,this):j(V)},f=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:O(this,us),state:this.state,fetchFn:l};return i(j),j})(),g=O(this,gi)==="infinite"?fP(this.options.pages):this.options.behavior;g==null||g.onFetch(f,this),ve(this,yi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=f.fetchOptions)==null?void 0:v.meta))&&Be(this,Pn,Fr).call(this,{type:"fetch",meta:(p=f.fetchOptions)==null?void 0:p.meta}),ve(this,$t,gx({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:j=>{j instanceof rp&&j.revert&&this.setState({...O(this,yi),fetchStatus:"idle"}),s.abort()},onFail:(j,q)=>{Be(this,Pn,Fr).call(this,{type:"failed",failureCount:j,error:q})},onPause:()=>{Be(this,Pn,Fr).call(this,{type:"pause"})},onContinue:()=>{Be(this,Pn,Fr).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const j=await O(this,$t).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(b=(x=O(this,Un).config).onSuccess)==null||b.call(x,j,this),(S=(N=O(this,Un).config).onSettled)==null||S.call(N,j,this.state.error,this),j}catch(j){if(j instanceof rp){if(j.silent)return O(this,$t).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Be(this,Pn,Fr).call(this,{type:"error",error:j}),(_=(C=O(this,Un).config).onError)==null||_.call(C,j,this),(T=(E=O(this,Un).config).onSettled)==null||T.call(E,this.state.data,j,this),j}finally{this.scheduleGc()}}},gi=new WeakMap,cs=new WeakMap,yi=new WeakMap,Un=new WeakMap,us=new WeakMap,$t=new WeakMap,Ua=new WeakMap,ds=new WeakMap,Pn=new WeakSet,vx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Fr=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...wx(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,...cv(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ve(this,yi,t.manual?i:void 0),i;case"error":const l=t.error;return{...s,error:l,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),O(this,Un).notify({query:this,type:"updated",action:t})})},Lw);function wx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function uv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hn,Ke,Ba,en,fs,vi,Br,ko,Va,wi,xi,ps,ms,_o,bi,Je,Ca,op,sp,ip,ap,lp,cp,up,xx,zw,im=(zw=class extends Ii{constructor(t,n){super();Pe(this,Je);Pe(this,hn);Pe(this,Ke);Pe(this,Ba);Pe(this,en);Pe(this,fs);Pe(this,vi);Pe(this,Br);Pe(this,ko);Pe(this,Va);Pe(this,wi);Pe(this,xi);Pe(this,ps);Pe(this,ms);Pe(this,_o);Pe(this,bi,new Set);this.options=n,ve(this,hn,t),ve(this,ko,null),ve(this,Br,np()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,Ke).addObserver(this),dv(O(this,Ke),this.options)?Be(this,Je,Ca).call(this):this.updateResult(),Be(this,Je,ap).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dp(O(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dp(O(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,Je,lp).call(this),Be(this,Je,cp).call(this),O(this,Ke).removeObserver(this)}setOptions(t){const n=this.options,s=O(this,Ke);if(this.options=O(this,hn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jn(this.options.enabled,O(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,Je,up).call(this),O(this,Ke).setOptions(this.options),n._defaulted&&!$c(this.options,n)&&O(this,hn).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,Ke),observer:this});const i=this.hasListeners();i&&fv(O(this,Ke),s,this.options,n)&&Be(this,Je,Ca).call(this),this.updateResult(),i&&(O(this,Ke)!==s||jn(this.options.enabled,O(this,Ke))!==jn(n.enabled,O(this,Ke))||jo(this.options.staleTime,O(this,Ke))!==jo(n.staleTime,O(this,Ke)))&&Be(this,Je,op).call(this);const l=Be(this,Je,sp).call(this);i&&(O(this,Ke)!==s||jn(this.options.enabled,O(this,Ke))!==jn(n.enabled,O(this,Ke))||l!==O(this,_o))&&Be(this,Je,ip).call(this,l)}getOptimisticResult(t){const n=O(this,hn).getQueryCache().build(O(this,hn),t),s=this.createResult(n,t);return gP(this,s)&&(ve(this,en,s),ve(this,vi,this.options),ve(this,fs,O(this,Ke).state)),s}getCurrentResult(){return O(this,en)}trackResult(t,n){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&O(this,Br).status==="pending"&&O(this,Br).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){O(this,bi).add(t)}getCurrentQuery(){return O(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=O(this,hn).defaultQueryOptions(t),s=O(this,hn).getQueryCache().build(O(this,hn),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(t){return Be(this,Je,Ca).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,en)))}createResult(t,n){var F;const s=O(this,Ke),i=this.options,l=O(this,en),d=O(this,fs),f=O(this,vi),y=t!==s?t.state:O(this,Ba),{state:v}=t;let p={...v},x=!1,b;if(n._optimisticResults){const I=this.hasListeners(),re=!I&&dv(t,n),fe=I&&fv(t,s,n,i);(re||fe)&&(p={...p,...wx(v.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:N,errorUpdatedAt:S,status:C}=p;b=p.data;let _=!1;if(n.placeholderData!==void 0&&b===void 0&&C==="pending"){let I;l!=null&&l.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(I=l.data,_=!0):I=typeof n.placeholderData=="function"?n.placeholderData((F=O(this,xi))==null?void 0:F.state.data,O(this,xi)):n.placeholderData,I!==void 0&&(C="success",b=tp(l==null?void 0:l.data,I,n),x=!0)}if(n.select&&b!==void 0&&!_)if(l&&b===(d==null?void 0:d.data)&&n.select===O(this,Va))b=O(this,wi);else try{ve(this,Va,n.select),b=n.select(b),b=tp(l==null?void 0:l.data,b,n),ve(this,wi,b),ve(this,ko,null)}catch(I){ve(this,ko,I)}O(this,ko)&&(N=O(this,ko),b=O(this,wi),S=Date.now(),C="error");const E=p.fetchStatus==="fetching",T=C==="pending",j=C==="error",q=T&&E,V=b!==void 0,$={status:C,fetchStatus:p.fetchStatus,isPending:T,isSuccess:C==="success",isError:j,isInitialLoading:q,isLoading:q,data:b,dataUpdatedAt:p.dataUpdatedAt,error:N,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>y.dataUpdateCount||p.errorUpdateCount>y.errorUpdateCount,isFetching:E,isRefetching:E&&!T,isLoadingError:j&&!V,isPaused:p.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:j&&V,isStale:am(t,n),refetch:this.refetch,promise:O(this,Br),isEnabled:jn(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=$.data!==void 0,re=$.status==="error"&&!I,fe=ce=>{re?ce.reject($.error):I&&ce.resolve($.data)},de=()=>{const ce=ve(this,Br,$.promise=np());fe(ce)},ge=O(this,Br);switch(ge.status){case"pending":t.queryHash===s.queryHash&&fe(ge);break;case"fulfilled":(re||$.data!==ge.value)&&de();break;case"rejected":(!re||$.error!==ge.reason)&&de();break}}return $}updateResult(){const t=O(this,en),n=this.createResult(O(this,Ke),this.options);if(ve(this,fs,O(this,Ke).state),ve(this,vi,this.options),O(this,fs).data!==void 0&&ve(this,xi,O(this,Ke)),$c(n,t))return;ve(this,en,n);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!O(this,bi).size)return!0;const d=new Set(l??O(this,bi));return this.options.throwOnError&&d.add("error"),Object.keys(O(this,en)).some(f=>{const g=f;return O(this,en)[g]!==t[g]&&d.has(g)})};Be(this,Je,xx).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,Je,ap).call(this)}},hn=new WeakMap,Ke=new WeakMap,Ba=new WeakMap,en=new WeakMap,fs=new WeakMap,vi=new WeakMap,Br=new WeakMap,ko=new WeakMap,Va=new WeakMap,wi=new WeakMap,xi=new WeakMap,ps=new WeakMap,ms=new WeakMap,_o=new WeakMap,bi=new WeakMap,Je=new WeakSet,Ca=function(t){Be(this,Je,up).call(this);let n=O(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(tn)),n},op=function(){Be(this,Je,lp).call(this);const t=jo(this.options.staleTime,O(this,Ke));if($a.isServer()||O(this,en).isStale||!Xf(t))return;const s=fx(O(this,en).dataUpdatedAt,t)+1;ve(this,ps,is.setTimeout(()=>{O(this,en).isStale||this.updateResult()},s))},sp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,Ke)):this.options.refetchInterval)??!1},ip=function(t){Be(this,Je,cp).call(this),ve(this,_o,t),!($a.isServer()||jn(this.options.enabled,O(this,Ke))===!1||!Xf(O(this,_o))||O(this,_o)===0)&&ve(this,ms,is.setInterval(()=>{(this.options.refetchIntervalInBackground||nm.isFocused())&&Be(this,Je,Ca).call(this)},O(this,_o)))},ap=function(){Be(this,Je,op).call(this),Be(this,Je,ip).call(this,Be(this,Je,sp).call(this))},lp=function(){O(this,ps)!==void 0&&(is.clearTimeout(O(this,ps)),ve(this,ps,void 0))},cp=function(){O(this,ms)!==void 0&&(is.clearInterval(O(this,ms)),ve(this,ms,void 0))},up=function(){const t=O(this,hn).getQueryCache().build(O(this,hn),this.options);if(t===O(this,Ke))return;const n=O(this,Ke);ve(this,Ke,t),ve(this,Ba,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xx=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(O(this,en))}),O(this,hn).getQueryCache().notify({query:O(this,Ke),type:"observerResultsUpdated"})})},zw);function hP(e,t){return jn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&jn(t.retryOnMount,e)===!1)}function dv(e,t){return hP(e,t)||e.state.data!==void 0&&dp(e,t,t.refetchOnMount)}function dp(e,t,n){if(jn(t.enabled,e)!==!1&&jo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&am(e,t)}return!1}function fv(e,t,n,s){return(e!==t||jn(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&am(e,n)}function am(e,t){return jn(t.enabled,e)!==!1&&e.isStaleByTime(jo(t.staleTime,e))}function gP(e,t){return!$c(e.getCurrentResult(),t)}var Ha,br,Kt,hs,Sr,vo,Fw,yP=(Fw=class extends yx{constructor(t){super();Pe(this,Sr);Pe(this,Ha);Pe(this,br);Pe(this,Kt);Pe(this,hs);ve(this,Ha,t.client),this.mutationId=t.mutationId,ve(this,Kt,t.mutationCache),ve(this,br,[]),this.state=t.state||vP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,br).includes(t)||(O(this,br).push(t),this.clearGcTimeout(),O(this,Kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ve(this,br,O(this,br).filter(n=>n!==t)),this.scheduleGc(),O(this,Kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,br).length||(this.state.status==="pending"?this.scheduleGc():O(this,Kt).remove(this))}continue(){var t;return((t=O(this,hs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,f,g,y,v,p,x,b,N,S,C,_,E,T,j,q,V,D;const n=()=>{Be(this,Sr,vo).call(this,{type:"continue"})},s={client:O(this,Ha),meta:this.options.meta,mutationKey:this.options.mutationKey};ve(this,hs,gx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:($,F)=>{Be(this,Sr,vo).call(this,{type:"failed",failureCount:$,error:F})},onPause:()=>{Be(this,Sr,vo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>O(this,Kt).canRun(this)}));const i=this.state.status==="pending",l=!O(this,hs).canStart();try{if(i)n();else{Be(this,Sr,vo).call(this,{type:"pending",variables:t,isPaused:l}),O(this,Kt).config.onMutate&&await O(this,Kt).config.onMutate(t,this,s);const F=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,t,s));F!==this.state.context&&Be(this,Sr,vo).call(this,{type:"pending",context:F,variables:t,isPaused:l})}const $=await O(this,hs).start();return await((y=(g=O(this,Kt).config).onSuccess)==null?void 0:y.call(g,$,t,this.state.context,this,s)),await((p=(v=this.options).onSuccess)==null?void 0:p.call(v,$,t,this.state.context,s)),await((b=(x=O(this,Kt).config).onSettled)==null?void 0:b.call(x,$,null,this.state.variables,this.state.context,this,s)),await((S=(N=this.options).onSettled)==null?void 0:S.call(N,$,null,t,this.state.context,s)),Be(this,Sr,vo).call(this,{type:"success",data:$}),$}catch($){try{await((_=(C=O(this,Kt).config).onError)==null?void 0:_.call(C,$,t,this.state.context,this,s))}catch(F){Promise.reject(F)}try{await((T=(E=this.options).onError)==null?void 0:T.call(E,$,t,this.state.context,s))}catch(F){Promise.reject(F)}try{await((q=(j=O(this,Kt).config).onSettled)==null?void 0:q.call(j,void 0,$,this.state.variables,this.state.context,this,s))}catch(F){Promise.reject(F)}try{await((D=(V=this.options).onSettled)==null?void 0:D.call(V,void 0,$,t,this.state.context,s))}catch(F){Promise.reject(F)}throw Be(this,Sr,vo).call(this,{type:"error",error:$}),$}finally{O(this,Kt).runNext(this)}}},Ha=new WeakMap,br=new WeakMap,Kt=new WeakMap,hs=new WeakMap,Sr=new WeakSet,vo=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{O(this,br).forEach(s=>{s.onMutationUpdate(t)}),O(this,Kt).notify({mutation:this,type:"updated",action:t})})},Fw);function vP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vr,nr,Wa,Uw,wP=(Uw=class extends Ii{constructor(t={}){super();Pe(this,Vr);Pe(this,nr);Pe(this,Wa);this.config=t,ve(this,Vr,new Set),ve(this,nr,new Map),ve(this,Wa,0)}build(t,n,s){const i=new yP({client:t,mutationCache:this,mutationId:++fc(this,Wa)._,options:t.defaultMutationOptions(n),state:s});return this.add(i),i}add(t){O(this,Vr).add(t);const n=gc(t);if(typeof n=="string"){const s=O(this,nr).get(n);s?s.push(t):O(this,nr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(O(this,Vr).delete(t)){const n=gc(t);if(typeof n=="string"){const s=O(this,nr).get(n);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&O(this,nr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gc(t);if(typeof n=="string"){const s=O(this,nr).get(n),i=s==null?void 0:s.find(l=>l.state.status==="pending");return!i||i===t}else return!0}runNext(t){var s;const n=gc(t);if(typeof n=="string"){const i=(s=O(this,nr).get(n))==null?void 0:s.find(l=>l!==t&&l.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{O(this,Vr).forEach(t=>{this.notify({type:"removed",mutation:t})}),O(this,Vr).clear(),O(this,nr).clear()})}getAll(){return Array.from(O(this,Vr))}find(t){const n={exact:!0,...t};return this.getAll().find(s=>sv(n,s))}findAll(t={}){return this.getAll().filter(n=>sv(t,n))}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(t.map(n=>n.continue().catch(tn))))}},Vr=new WeakMap,nr=new WeakMap,Wa=new WeakMap,Uw);function gc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pv(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function xP(e,t,n){const s=e.slice(0);return s[t]=n,s}var Si,gn,ki,gs,En,Co,qa,Ka,Ga,Qa,Tt,fp,pp,bx,mp,hp,gp,Bw,bP=(Bw=class extends Ii{constructor(t,n,s){super();Pe(this,Tt);Pe(this,Si);Pe(this,gn);Pe(this,ki);Pe(this,gs);Pe(this,En);Pe(this,Co);Pe(this,qa);Pe(this,Ka);Pe(this,Ga);Pe(this,Qa,[]);ve(this,Si,t),ve(this,gs,s),ve(this,ki,[]),ve(this,En,[]),ve(this,gn,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&O(this,En).forEach(t=>{t.subscribe(n=>{Be(this,Tt,hp).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,O(this,En).forEach(t=>{t.destroy()})}setQueries(t,n){ve(this,ki,t),ve(this,gs,n),kt.batch(()=>{const s=O(this,En),i=Be(this,Tt,mp).call(this,O(this,ki));i.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const l=i.map(p=>p.observer),d=l.map(p=>p.getCurrentResult()),f=s.length!==l.length,g=l.some((p,x)=>p!==s[x]),y=f||g,v=y?!0:d.some((p,x)=>{const b=O(this,gn)[x];return!b||!$c(p,b)});!y&&!v||(y&&(ve(this,Qa,i),ve(this,En,l)),ve(this,gn,d),this.hasListeners()&&(y&&(pv(s,l).forEach(p=>{p.destroy()}),pv(l,s).forEach(p=>{p.subscribe(x=>{Be(this,Tt,hp).call(this,p,x)})})),Be(this,Tt,gp).call(this)))})}getCurrentResult(){return O(this,gn)}getQueries(){return O(this,En).map(t=>t.getCurrentQuery())}getObservers(){return O(this,En)}getOptimisticResult(t,n){const s=Be(this,Tt,mp).call(this,t),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),l=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>Be(this,Tt,pp).call(this,d??i,n,l),()=>Be(this,Tt,fp).call(this,i,s)]}},Si=new WeakMap,gn=new WeakMap,ki=new WeakMap,gs=new WeakMap,En=new WeakMap,Co=new WeakMap,qa=new WeakMap,Ka=new WeakMap,Ga=new WeakMap,Qa=new WeakMap,Tt=new WeakSet,fp=function(t,n){return n.map((s,i)=>{const l=t[i];return s.defaultedQueryOptions.notifyOnChangeProps?l:s.observer.trackResult(l,d=>{n.forEach(f=>{f.observer.trackProp(d)})})})},pp=function(t,n,s){if(n){const i=O(this,Ga),l=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!O(this,Co)||O(this,gn)!==O(this,Ka)||l||n!==O(this,qa))&&(ve(this,qa,n),ve(this,Ka,O(this,gn)),s!==void 0&&ve(this,Ga,s),ve(this,Co,om(O(this,Co),n(t)))),O(this,Co)}return t},bx=function(){var t;return((t=O(this,gs))==null?void 0:t.combine)!==void 0&&O(this,En).some((n,s)=>{var i;return n.options.suspense&&((i=O(this,gn)[s])==null?void 0:i.data)===void 0})},mp=function(t){const n=new Map;O(this,En).forEach(i=>{const l=i.options.queryHash;if(!l)return;const d=n.get(l);d?d.push(i):n.set(l,[i])});const s=[];return t.forEach(i=>{var g;const l=O(this,Si).defaultQueryOptions(i),f=((g=n.get(l.queryHash))==null?void 0:g.shift())??new im(O(this,Si),l);s.push({defaultedQueryOptions:l,observer:f})}),s},hp=function(t,n){const s=O(this,En).indexOf(t);s!==-1&&(ve(this,gn,xP(O(this,gn),s,n)),Be(this,Tt,gp).call(this))},gp=function(){var t;if(this.hasListeners()){const n=Be(this,Tt,fp).call(this,O(this,gn),O(this,Qa)),s=Be(this,Tt,bx).call(this),i=O(this,Co),l=s?i:Be(this,Tt,pp).call(this,n,(t=O(this,gs))==null?void 0:t.combine);(s||i!==l)&&kt.batch(()=>{this.listeners.forEach(d=>{d(O(this,gn))})})}},Bw),kr,Vw,SP=(Vw=class extends Ii{constructor(t={}){super();Pe(this,kr);this.config=t,ve(this,kr,new Map)}build(t,n,s){const i=n.queryKey,l=n.queryHash??rm(i,n);let d=this.get(l);return d||(d=new mP({client:t,queryKey:i,queryHash:l,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(d)),d}add(t){O(this,kr).has(t.queryHash)||(O(this,kr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,kr).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,kr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,kr).get(t)}getAll(){return[...O(this,kr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>ov(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>ov(t,s)):n}notify(t){kt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kr=new WeakMap,Vw),mt,No,Eo,_i,Ci,Po,Ni,Ei,Hw,kP=(Hw=class{constructor(e={}){Pe(this,mt);Pe(this,No);Pe(this,Eo);Pe(this,_i);Pe(this,Ci);Pe(this,Po);Pe(this,Ni);Pe(this,Ei);ve(this,mt,e.queryCache||new SP),ve(this,No,e.mutationCache||new wP),ve(this,Eo,e.defaultOptions||{}),ve(this,_i,new Map),ve(this,Ci,new Map),ve(this,Po,0)}mount(){fc(this,Po)._++,O(this,Po)===1&&(ve(this,Ni,nm.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,mt).onFocus())})),ve(this,Ei,Dc.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,mt).onOnline())})))}unmount(){var e,t;fc(this,Po)._--,O(this,Po)===0&&((e=O(this,Ni))==null||e.call(this),ve(this,Ni,void 0),(t=O(this,Ei))==null||t.call(this),ve(this,Ei,void 0))}isFetching(e){return O(this,mt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,No).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,mt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=O(this,mt).build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(jo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return O(this,mt).findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),i=O(this,mt).get(s.queryHash),l=i==null?void 0:i.state.data,d=nP(t,l);if(d!==void 0)return O(this,mt).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(e,t,n){return kt.batch(()=>O(this,mt).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,mt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,mt);kt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,mt);return kt.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=kt.batch(()=>O(this,mt).findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(tn).catch(tn)}invalidateQueries(e,t={}){return kt.batch(()=>(O(this,mt).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},s=kt.batch(()=>O(this,mt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let l=i.fetch(void 0,n);return n.throwOnError||(l=l.catch(tn)),i.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(s).then(tn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,mt).build(this,t);return n.isStaleByTime(jo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tn).catch(tn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(tn).catch(tn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Dc.isOnline()?O(this,No).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,mt)}getMutationCache(){return O(this,No)}getDefaultOptions(){return O(this,Eo)}setDefaultOptions(e){ve(this,Eo,e)}setQueryDefaults(e,t){O(this,_i).set(Ia(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,_i).values()],n={};return t.forEach(s=>{ji(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){O(this,Ci).set(Ia(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,Ci).values()],n={};return t.forEach(s=>{ji(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,Eo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(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===sm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,Eo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,mt).clear(),O(this,No).clear()}},mt=new WeakMap,No=new WeakMap,Eo=new WeakMap,_i=new WeakMap,Ci=new WeakMap,Po=new WeakMap,Ni=new WeakMap,Ei=new WeakMap,Hw),Sx=m.createContext(void 0),Xa=e=>{const t=m.useContext(Sx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_P=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Sx.Provider,{value:e,children:t})),kx=m.createContext(!1),_x=()=>m.useContext(kx);kx.Provider;function CP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var NP=m.createContext(CP()),Cx=()=>m.useContext(NP),Nx=(e,t,n)=>{const s=n!=null&&n.state.error&&typeof e.throwOnError=="function"?mx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},Ex=e=>{m.useEffect(()=>{e.clearReset()},[e])},Px=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||mx(n,[e.error,s])),jx=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},EP=(e,t)=>e.isLoading&&e.isFetching&&!t,yp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PP({queries:e,...t},n){const s=Xa(),i=_x(),l=Cx(),d=m.useMemo(()=>e.map(S=>{const C=s.defaultQueryOptions(S);return C._optimisticResults=i?"isRestoring":"optimistic",C}),[e,s,i]);d.forEach(S=>{jx(S);const C=s.getQueryCache().get(S.queryHash);Nx(S,l,C)}),Ex(l);const[f]=m.useState(()=>new bP(s,d,t)),[g,y,v]=f.getOptimisticResult(d,t.combine),p=!i&&t.subscribed!==!1;m.useSyncExternalStore(m.useCallback(S=>p?f.subscribe(kt.batchCalls(S)):tn,[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),m.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=g.some((S,C)=>yp(d[C],S))?g.flatMap((S,C)=>{const _=d[C];if(_&&yp(_,S)){const E=new im(s,_);return vp(_,E,l)}return[]}):[];if(b.length>0)throw Promise.all(b);const N=g.find((S,C)=>{const _=d[C];return _&&Px({result:S,errorResetBoundary:l,throwOnError:_.throwOnError,query:s.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(N!=null&&N.error)throw N.error;return y(v())}function jP(e,t,n){var b,N,S,C;const s=_x(),i=Cx(),l=Xa(),d=l.defaultQueryOptions(e);(N=(b=l.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||N.call(b,d);const f=l.getQueryCache().get(d.queryHash),g=e.subscribed!==!1;d._optimisticResults=s?"isRestoring":g?"optimistic":void 0,jx(d),Nx(d,i,f),Ex(i);const y=!l.getQueryCache().get(d.queryHash),[v]=m.useState(()=>new t(l,d)),p=v.getOptimisticResult(d),x=!s&&g;if(m.useSyncExternalStore(m.useCallback(_=>{const E=x?v.subscribe(kt.batchCalls(_)):tn;return v.updateResult(),E},[v,x]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),m.useEffect(()=>{v.setOptions(d)},[d,v]),yp(d,p))throw vp(d,v,i);if(Px({result:p,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw p.error;if((C=(S=l.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||C.call(S,d,p),d.experimental_prefetchInRender&&!$a.isServer()&&EP(p,s)){const _=y?vp(d,v,i):f==null?void 0:f.promise;_==null||_.catch(tn).finally(()=>{v.updateResult()})}return d.notifyOnChangeProps?p:v.trackResult(p)}function Wr(e,t){return jP(e,im)}const B={nests:["nests"],nestList:(e=!1)=>[...B.nestListAll(),e?"archived":"live"],nestListAll:()=>[...B.nests,"list"],unsynced:()=>[...B.nests,"unsynced"],nest:e=>[...B.nests,"detail",e],settings:e=>[...B.nest(e),"settings"],nodes:e=>[...B.nest(e),"nodes"],folderNodes:(e,t)=>[...B.nodes(e),"folder",t],nodesMeta:(e,t=!1)=>[...B.nodes(e),"meta",t?"approved":"all"],census:e=>[...B.nodes(e),"census"],stewards:e=>[...B.nest(e),"stewards"],collaborators:e=>[...B.nest(e),"collaborators"],mentionable:e=>[...B.nest(e),"mentionable"],definitions:e=>[...B.nest(e),"definitions"],commentCounts:e=>[...B.nest(e),"comment-counts"],overview:e=>[...B.nest(e),"overview"],tags:e=>[...B.nest(e),"tags"],graph:e=>[...B.nest(e),"graph"],edgeTypes:e=>[...B.nest(e),"edge-types"],edges:e=>[...B.nest(e),"edges"],schedules:e=>[...B.nest(e),"schedules"],env:e=>[...B.nest(e),"env"],connectors:e=>[...B.nest(e),"connectors"],nestTeams:e=>[...B.nest(e),"teams"],externalEdits:e=>[...B.nest(e),"external-edits"],externalEditCount:e=>[...B.externalEdits(e),"count"],hooks:(e,t)=>[...B.nest(e),"hooks",t??"all"],reviewQueue:(e,t)=>[...B.nest(e),"review-queue",t],deletionRequests:(e,t)=>[...B.nest(e),"deletion-requests",t],feed:(e,t,n,s)=>[...B.nest(e),"feed",t,n,s],node:(e,t)=>[...B.nodes(e),"node",t],nodeVersions:(e,t)=>[...B.node(e,t),"versions"],nodeReviews:(e,t)=>[...B.node(e,t),"reviews"],nodeStewards:(e,t)=>[...B.node(e,t),"stewards"],nodeWatchers:(e,t)=>[...B.node(e,t),"watchers"],nodeAnnotations:(e,t)=>[...B.node(e,t),"annotations"],nodePendingEdit:(e,t)=>[...B.node(e,t),"external-edit"],nodeComments:(e,t,n)=>[...B.node(e,t),"comments",n],nodeActivity:(e,t,n)=>[...B.node(e,t),"activity",n],people:["people"],peopleSuggest:e=>[...B.people,"suggest",e],teams:["teams"],teamList:()=>[...B.teams,"list"],team:e=>[...B.teams,"detail",e],promptowlTeams:()=>[...B.teams,"promptowl"],admin:["admin"],adminSettings:()=>[...B.admin,"settings"],superAdmins:()=>[...B.admin,"super-admins"],communitySites:()=>[...B.admin,"community-sites"],auth:["auth"],teammates:()=>[...B.auth,"teammates"],apiKeys:()=>[...B.auth,"keys"],license:["license"],licenseStatus:()=>[...B.license,"status"],me:["me"],unreadNotifications:()=>[...B.me,"notifications","unread"],myWork:(e,t)=>[...B.me,"work",e??null,t??null],myDrafts:(e,t,n,s)=>[...B.me,"drafts",e??null,t??null,n??null,s??null],health:["health"],search:["search"],globalSearch:(e,t)=>[...B.search,"global",e,t]},De={reference:5*6e4,listing:3e4,governance:5e3,content:0};function TP(e,t){const n=t==null?void 0:t.status;return n===401||n===403||n===404?!1:e<2}function RP(){return new kP({defaultOptions:{queries:{retry:TP,gcTime:5*6e4,retryOnMount:!0}}})}const OP=[{match:/^\/nodes\/(.+)\/(?:comments|annotations)(?:\/|$)/,affects:(e,t)=>[B.node(e,t[1]),B.commentCounts(e),[...B.nest(e),"feed"]]},{match:/^\/nodes\/(.+)\/watchers(?:\/|$|\?)/,affects:(e,t)=>[B.nodeWatchers(e,t[1])]},{match:/^\/nodes\/(.+)\/(?:approve|reject|submit-review|revert|external-edits)(?:\/|$)/,affects:e=>[B.nodes(e),[...B.nest(e),"review-queue"],B.externalEdits(e),[...B.nest(e),"feed"],B.me]},{match:/^\/nodes\/(.+)\/request-deletion(?:\/|$)/,affects:e=>[[...B.nest(e),"deletion-requests"],B.me]},{match:/^\/nodes\/(.+)\/move(?:\/|$)/,affects:(e,t)=>[B.node(e,t[1]),B.nodes(e),B.nestListAll(),[...B.nest(e),"feed"]]},{match:/^\/nodes(?:\/)?$/,affects:e=>[B.nodes(e),B.nestListAll(),B.search,[...B.nest(e),"feed"]]},{match:/^\/nodes\/(.+)$/,affects:(e,t)=>[B.node(e,t[1]),B.nodes(e),B.nestListAll(),B.search,[...B.nest(e),"feed"]]},{match:/^\/stewards/,affects:e=>[B.stewards(e),B.mentionable(e),B.nest(e)]},{match:/^\/collaborators/,affects:e=>[B.collaborators(e),B.mentionable(e),B.nest(e)]},{match:/^\/teams/,affects:e=>[B.nestTeams(e),B.teams,B.collaborators(e),B.mentionable(e),B.nest(e)]},{match:/^\/settings/,affects:e=>[B.nest(e)]},{match:/^\/visibility/,affects:e=>[B.nest(e),B.nestListAll()]},{match:/^\/reader-mode/,affects:e=>[B.nest(e),B.nestListAll()]},{match:/^\/branding/,affects:e=>[B.nest(e)]},{match:/^\/definitions/,affects:e=>[B.definitions(e)]},{match:/^\/edges/,affects:e=>[B.edges(e),B.graph(e)]},{match:/^\/edge-types/,affects:e=>[B.edgeTypes(e),B.edges(e)]},{match:/^\/env/,affects:e=>[B.env(e)]},{match:/^\/hooks/,affects:e=>[[...B.nest(e),"hooks"]]},{match:/^\/schedules/,affects:e=>[B.schedules(e)]},{match:/^\/connectors/,affects:e=>[B.connectors(e)]},{match:/^\/external-edits/,affects:e=>[B.externalEdits(e),B.nodes(e)]},{match:/^\/deletion-requests/,affects:e=>[[...B.nest(e),"deletion-requests"],B.nodes(e),B.nestListAll(),B.me]},{match:/^\/(delete-folder|request-deletion)/,affects:e=>[B.nodes(e),B.nestListAll()]},{match:/^\/(archive|restore)/,affects:e=>[B.nest(e),B.nestListAll(),B.me,B.search]},{match:/^\/pin/,affects:()=>[B.nestList()]}];function AP(e,t){var i;const n=l=>void e.invalidateQueries({queryKey:l}),s=(i=t.match(/^\/nests\/([^/?]+)/))==null?void 0:i[1];if(s&&s!=="import"&&s!=="unsynced"){const l=t.slice(`/nests/${s}`.length).split("?")[0];for(const d of OP){const f=l.match(d.match);if(f){for(const g of d.affects(s,f))n(g);return}}n(B.nest(s)),n(B.nestListAll());return}if(t.startsWith("/nests")){n(B.nestListAll()),n(B.unsynced());return}if(t.startsWith("/teams")){n(B.teams),n(B.nests);return}if(t.startsWith("/admin")){n(B.admin),n(B.auth),n(B.people),n(B.nests);return}if(t.startsWith("/auth")){n(B.auth);return}if(t.startsWith("/license")){n(B.license);return}t.startsWith("/me")&&n(B.me)}function MP(e){IE({clear:()=>e.clear(),invalidatePath:t=>AP(e,t)})}const Bt={nestList:(e=!1)=>({queryKey:B.nestList(e),queryFn:()=>KE({archived:e}),staleTime:De.reference}),unsynced:()=>({queryKey:B.unsynced(),queryFn:()=>YE(),staleTime:De.listing}),nest:e=>({queryKey:B.nest(e),queryFn:()=>JE(e),staleTime:De.reference}),settings:e=>({queryKey:B.settings(e),queryFn:()=>qE(e),staleTime:De.reference}),nodes:e=>({queryKey:B.nodes(e),queryFn:()=>e2(e),staleTime:De.listing}),folderNodes:(e,t)=>({queryKey:B.folderNodes(e,t),queryFn:()=>t2(e,t),staleTime:De.listing}),nodesMeta:(e,t=!1)=>({queryKey:B.nodesMeta(e,t),queryFn:()=>n2(e,t),staleTime:De.listing}),census:e=>({queryKey:B.census(e),queryFn:()=>r2(e),staleTime:De.listing}),stewards:e=>({queryKey:B.stewards(e),queryFn:()=>f2(e),staleTime:De.reference}),collaborators:e=>({queryKey:B.collaborators(e),queryFn:()=>N2(e),staleTime:De.reference}),mentionable:e=>({queryKey:B.mentionable(e),queryFn:()=>E2(e),staleTime:De.reference}),peopleSuggest:e=>({queryKey:B.peopleSuggest(e),queryFn:()=>P2(e),staleTime:De.reference}),definitions:e=>({queryKey:B.definitions(e),queryFn:()=>XE(e),staleTime:De.reference}),commentCounts:e=>({queryKey:B.commentCounts(e),queryFn:()=>o2(e),staleTime:De.listing}),overview:e=>({queryKey:B.overview(e),queryFn:()=>l2(e),staleTime:De.listing}),globalSearch:(e,t)=>({queryKey:B.globalSearch(e,t),queryFn:()=>a2(e,t),staleTime:De.listing}),tags:e=>({queryKey:B.tags(e),queryFn:()=>d2(e),staleTime:De.reference}),graph:e=>({queryKey:B.graph(e),queryFn:()=>M2(e),staleTime:De.listing}),edgeTypes:e=>({queryKey:B.edgeTypes(e),queryFn:()=>D2(e),staleTime:De.reference}),edges:e=>({queryKey:B.edges(e),queryFn:()=>L2(e),staleTime:De.listing}),schedules:e=>({queryKey:B.schedules(e),queryFn:()=>z2(e),staleTime:De.reference}),env:e=>({queryKey:B.env(e),queryFn:()=>B2(e),staleTime:De.reference}),connectors:e=>({queryKey:B.connectors(e),queryFn:()=>H2(e),staleTime:De.reference}),nestTeams:e=>({queryKey:B.nestTeams(e),queryFn:()=>A2(e),staleTime:De.reference}),hooks:(e,t)=>({queryKey:B.hooks(e,t),queryFn:()=>V2(e,t),staleTime:De.reference}),externalEdits:e=>({queryKey:B.externalEdits(e),queryFn:()=>k2(e),staleTime:De.governance}),externalEditCount:e=>({queryKey:B.externalEditCount(e),queryFn:()=>_2(e),staleTime:De.governance}),reviewQueue:(e,t="pending")=>({queryKey:B.reviewQueue(e,t),queryFn:()=>h2(e,t),staleTime:De.governance}),deletionRequests:(e,t="pending")=>({queryKey:B.deletionRequests(e,t),queryFn:()=>m2(e,t),staleTime:De.governance}),feed:(e,t="all",n=50,s=0)=>({queryKey:B.feed(e,t,n,s),queryFn:()=>g2(e,t,n,s),staleTime:De.governance}),node:(e,t)=>({queryKey:B.node(e,t),queryFn:()=>s2(e,t),staleTime:De.content,gcTime:6e4}),nodeVersions:(e,t)=>({queryKey:B.nodeVersions(e,t),queryFn:()=>y2(e,t),staleTime:De.listing}),nodeReviews:(e,t)=>({queryKey:B.nodeReviews(e,t),queryFn:()=>v2(e,t),staleTime:De.governance}),nodeStewards:(e,t)=>({queryKey:B.nodeStewards(e,t),queryFn:()=>p2(e,t),staleTime:De.reference}),nodeWatchers:(e,t)=>({queryKey:B.nodeWatchers(e,t),queryFn:()=>F2(e,t),staleTime:De.reference}),nodeAnnotations:(e,t)=>({queryKey:B.nodeAnnotations(e,t),queryFn:()=>x2(e,t),staleTime:De.governance}),nodePendingEdit:(e,t)=>({queryKey:B.nodePendingEdit(e,t),queryFn:()=>C2(e,t),staleTime:De.governance}),nodeComments:(e,t,n)=>({queryKey:B.nodeComments(e,t,n??"all"),queryFn:()=>b2(e,t,n),staleTime:De.governance}),nodeActivity:(e,t,n=100)=>({queryKey:B.nodeActivity(e,t,n),queryFn:()=>S2(e,t,n),staleTime:De.governance}),unreadNotifications:()=>({queryKey:B.unreadNotifications(),queryFn:()=>U2(),staleTime:De.listing}),health:()=>({queryKey:B.health,queryFn:()=>Ma(),staleTime:De.reference}),adminSettings:()=>({queryKey:B.adminSettings(),queryFn:()=>LE(),staleTime:De.reference}),superAdmins:()=>({queryKey:B.superAdmins(),queryFn:()=>UE(),staleTime:De.reference}),communitySites:()=>({queryKey:B.communitySites(),queryFn:()=>BE(),staleTime:De.reference}),teammates:()=>({queryKey:B.teammates(),queryFn:()=>FE(),staleTime:De.reference}),apiKeys:()=>({queryKey:B.apiKeys(),queryFn:()=>VE(),staleTime:De.reference}),licenseStatus:()=>({queryKey:B.licenseStatus(),queryFn:()=>ux(),staleTime:De.reference}),teamList:()=>({queryKey:B.teamList(),queryFn:()=>j2(),staleTime:De.reference}),team:e=>({queryKey:B.team(e),queryFn:()=>T2(e),staleTime:De.reference}),promptowlTeams:()=>({queryKey:B.promptowlTeams(),queryFn:()=>O2(),staleTime:De.reference}),myWork:e=>({queryKey:B.myWork(e==null?void 0:e.limit,e==null?void 0:e.offset),queryFn:()=>I2(e),staleTime:De.governance}),myDrafts:e=>({queryKey:B.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:()=>$2(e),staleTime:De.governance})},aF=(e=!1)=>Wr(Bt.nestList(e)),IP=e=>Wr({...Bt.nest(e??""),enabled:!!e}),lF=e=>Wr({...Bt.settings(e??""),enabled:!!e}),cF=(e,t)=>Wr({...Bt.nodeStewards(e??"",t??""),enabled:!!e&&!!t}),$P=e=>Wr({...Bt.apiKeys(),...e}),Tx="00000000-0000-0000-0000-000000000000",uF=8,dF=50;function DP(e){return!!(e!=null&&e.archived_at)}function wp({roles:e,permission:t,myStewards:n,isOwner:s,isAdmin:i,readerMode:l,previewReader:d,isArchived:f}){if(f)return{canManage:!1,collabCanWrite:!1,canReviewDocs:!1,canEditDocs:!1,isReadOnly:!0,isReaderView:!!l};const y=s||i||((...S)=>e.some(C=>S.includes(C)))("owner","admin"),v=t==="owner"||t==="admin"||t==="write",p=y||n.some(S=>S.role==="reviewer"),x=y||v||n.some(S=>S.role==="editor"&&S.scope==="nest"),b=!x&&!p&&!y;return{canManage:y,collabCanWrite:v,canReviewDocs:p,canEditDocs:x,isReadOnly:b,isReaderView:!!l&&(b||!!d)}}function fF(e,t){return!t&&(e==="editor"||e==="admin")}function xp(e){const t=e.startsWith("nodes/")?e.slice(6):e;return(t.includes("/")?t.slice(t.lastIndexOf("/")+1):t).toLowerCase()}function pF(e,t){return(e==null?void 0:e.id)===t||xp((e==null?void 0:e.id)||"")===xp(t)}function mF(e){return[xp((e==null?void 0:e.id)||""),String((e==null?void 0:e.title)||"").toLowerCase()]}const LP=["board","ontology-graph","definitions"];function Rx(e){return LP.includes(e)}function Tf(e,t){return!!t&&Rx(e)}const Bn="__uncategorized__",zP=["draft","pending_review","approved","published","rejected","external_edit_pending"],FP={draft:"Draft",pending_review:"Pending Review",approved:"Approved",published:"Published",rejected:"Rejected",external_edit_pending:"External Edit"};function UP(e,t=28){if(e.length<=t)return e;const n=e.split("/");for(let s=1;s<n.length;s++){const i=`…/${n.slice(s).join("/")}`;if(i.length<=t||s===n.length-1)return i}return e}function lm(e){const t=e.startsWith("nodes/")?e.slice(6):e,n=t.lastIndexOf("/");return n===-1?"":t.slice(0,n)}function cm(e){return(e.tagNamespace??"").trim().split(":")[0].trim()}const Ox=e=>e.startsWith("#")?e.slice(1):e,mv=e=>e.startsWith("#")?e:`#${e}`;function BP(e){return e.dimension==="tag"?`tag:${cm(e)}`:e.dimension}function hF(e,t){if(!e.startsWith("tag:"))return t;const n=s=>s&&[...new Set(s.map(Ox))];return{columnOrder:n(t.columnOrder),hiddenColumns:n(t.hiddenColumns)}}function gF(e){const t=e.layouts[BP(e)]??{};return{dimension:e.dimension,tagNamespace:e.tagNamespace,columnOrder:t.columnOrder??(e.dimension==="status"?zP:void 0),hiddenColumns:t.hiddenColumns,explicitColumns:e.dimension==="tag"&&t.columnOrder!==void 0}}function Ax(e,t){switch(t.dimension){case"folder":return[lm(e.id)];case"status":return[e.status||Bn];case"tag":{const n=cm(t),s=e.tags.map(Ox),i=n?s.filter(l=>l.startsWith(`${n}:`)).map(l=>l.slice(n.length+1)).filter(Boolean):s.filter(Boolean);return i.length>0?[...new Set(i)]:[Bn]}}}function VP(e,t){return Ax(e,t)[0]}function Mx(e,t,n){const s=Ax(e,t).filter(i=>!n.has(i));if(t.explicitColumns){const i=new Set((t.columnOrder??[]).filter(l=>!n.has(l)));return s.filter(l=>i.has(l))}return s.length>0?s:[Bn]}function hv(e,t){return e===Bn?"Uncategorized":e===""&&t.dimension==="folder"?"(root)":t.dimension==="status"?FP[e]??e.replace(/_/g," "):t.dimension==="folder"?UP(e):e}function yF(e){return e!=="tag"}function gv(e,t){return e===Bn?"Uncategorized":e===""&&t.dimension==="folder"?"(root)":e}function HP(e,t){const n=new Set(t.hiddenColumns??[]);if(t.explicitColumns){const y=new Set,v=[];for(const p of t.columnOrder??[])n.has(p)||p===Bn||y.has(p)||(y.add(p),v.push(p));return v.map(p=>({key:p,label:hv(p,t),title:gv(p,t)}))}const s=new Set;for(const y of e)for(const v of Mx(y,t,n))s.add(v);const i=s.has(Bn);s.delete(Bn);const l=[],d=new Set;for(const y of t.columnOrder??[])n.has(y)||y===Bn||d.has(y)||(d.add(y),l.push(y),s.delete(y));const f=[...s].sort(),g=[...l,...f];return i&&g.push(Bn),g.map(y=>({key:y,label:hv(y,t),title:gv(y,t)}))}function vF(e,t){const n=new Set(t.hiddenColumns??[]),s=HP(e,t),i={};for(const l of s)i[l.key]=[];for(const l of e)for(const d of Mx(l,t,n))(i[d]??(i[d]=[])).push(l);return{columns:s,byColumn:i}}function wF(e,t,n,s){switch(n.dimension){case"folder":return VP(e,n)===t?{kind:"unsupported",reason:"Already in this column."}:{kind:"move-folder",folder:t};case"tag":{if(t===Bn)return{kind:"unsupported",reason:"Drop onto a tag column to add that tag."};if(s&&s===t)return{kind:"unsupported",reason:"Already in this column."};const i=cm(n),l=y=>mv(i?`${i}:${y}`:y),d=s&&s!==Bn?l(s):null,f=l(t),g=new Set(e.tags.map(mv));return d&&g.delete(d),!d&&g.has(f)?{kind:"unsupported",reason:"Already in this column."}:(g.add(f),{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 WP={path:"board",label:"Board",icon:Xw,order:1,viewPage:"board"},qP=Object.freeze(Object.defineProperty({__proto__:null,meta:WP},Symbol.toStringTag,{value:"Module"})),KP={path:"definitions",label:"Definitions",icon:uN,order:3,viewPage:"definitions"},GP=Object.freeze(Object.defineProperty({__proto__:null,meta:KP},Symbol.toStringTag,{value:"Module"})),QP={path:"graph",label:"Graph",icon:nE,order:2,viewPage:"ontology-graph"},ZP=Object.freeze(Object.defineProperty({__proto__:null,meta:QP},Symbol.toStringTag,{value:"Module"})),YP={path:"workflows",label:"Workflows",icon:RE,order:4,viewPage:"workflows",beta:!0,visible:e=>e.workflowPlaneEnabled&&e.canEditDocs},JP=Object.freeze(Object.defineProperty({__proto__:null,meta:YP},Symbol.toStringTag,{value:"Module"})),XP=Object.assign({"../pages/nest/board/meta.ts":qP,"../pages/nest/definitions/meta.ts":GP,"../pages/nest/graph/meta.ts":ZP,"../pages/nest/workflows/meta.ts":JP}),ej=Object.assign({"../pages/nest/board/page.tsx":()=>jt(()=>import("./page-CJWO06dN.js"),__vite__mapDeps([0,1,2,3,4,5])),"../pages/nest/definitions/page.tsx":()=>jt(()=>import("./page-B6pkc9cd.js"),__vite__mapDeps([6,1,2,7])),"../pages/nest/graph/page.tsx":()=>jt(()=>import("./page-DzKwP5Ds.js"),__vite__mapDeps([8,1,2,9])),"../pages/nest/workflows/page.tsx":()=>jt(()=>import("./page-Dh57L0RG.js"),__vite__mapDeps([10,11,5,12,2,7,4,13,14,15,16,1,17,18,19,9,20,21,22,23,24,25,26]))}),tj=e=>e.split("/").slice(-2,-1)[0],au=Object.entries(XP).map(([e,t])=>{const n=tj(e),s=ej[e.replace(/meta\.ts$/,"page.tsx")];if(!s)throw new Error(`pages/nest/${n}: meta.ts has no page.tsx beside it`);return{id:n,...t.meta,Component:Zp(s)}}).sort((e,t)=>e.order-t.order),xa=e=>au.find(t=>t.viewPage===e),nj=e=>e?au.find(t=>t.path===e):void 0,rj=e=>au.filter(t=>!t.visible||t.visible(e));function oj(e){if(e==="new")return[];const t=lm(e);if(!t)return[];const n=t.split("/");return n.map((s,i)=>n.slice(0,i+1).join("/"))}function sj(e){const t=new Map;for(const s of e){const i=lm(s.id),l=t.get(i);l?l.push(s):t.set(i,[s])}const n=new Intl.Collator(void 0,{sensitivity:"base"});return[...t.entries()].sort(([s],[i])=>n.compare(s,i)).map(([s,i])=>({folder:s,items:[...i].sort((l,d)=>n.compare(l.title??l.id,d.title??d.id))}))}function xF(e,t){return e||!!t.initialThreadId||!!t.commentMode||!!t.pendingAnchor||!!t.activeThreadId}const Ix="contextnest:doc-page",ti={sidebarCollapsed:!1,commentsOpen:!1,viewsOpen:!1,closedGroups:[]};function lu(e){try{const t=e.getItem(Ix);if(!t)return{...ti};const n=JSON.parse(t);return{sidebarCollapsed:typeof(n==null?void 0:n.sidebarCollapsed)=="boolean"?n.sidebarCollapsed:ti.sidebarCollapsed,commentsOpen:typeof(n==null?void 0:n.commentsOpen)=="boolean"?n.commentsOpen:ti.commentsOpen,viewsOpen:typeof(n==null?void 0:n.viewsOpen)=="boolean"?n.viewsOpen:ti.viewsOpen,closedGroups:Array.isArray(n==null?void 0:n.closedGroups)?n.closedGroups.filter(s=>typeof s=="string"):[...ti.closedGroups]}}catch{return{...ti}}}function um(e,t){try{const n={...lu(e),...t};e.setItem(Ix,JSON.stringify(n))}catch{}}function ij(e,t){const n=[{id:"overview",label:"Overview",page:"nest",tab:"overview"}];if(e.isReaderView)return n;!e.isReadOnly&&(t.stewardshipEnabled||t.hasPending)&&n.push({id:"review",label:"Review queue",page:"nest",tab:"review"});for(const s of rj({...e,workflowPlaneEnabled:t.workflowPlaneEnabled}))n.push({id:s.id,label:s.label,icon:s.icon,page:s.viewPage,group:"views"});return n}function bp(e){return e==="Root"?"Root":e.split(/[-_]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function bF(e){return e==="Root"?"Root":e.split("/").map(bp).join(" / ")}function aj(e,t="",n){const s={path:t,name:"",label:"",depth:-1,count:0,total:0,docs:[],children:[]},i=new Map([[t,s]]),l=y=>{const v=i.get(y);if(v)return v;const x=(t&&y.startsWith(`${t}/`)?y.slice(t.length+1):y).split("/"),b=x.length>1?`${t?`${t}/`:""}${x.slice(0,-1).join("/")}`:t,N=l(b),S={path:y,name:x[x.length-1],label:bp(x[x.length-1]),depth:N.depth+1,count:0,total:0,docs:[],children:[]};return N.children.push(S),i.set(y,S),S},d=new Map;for(const y of n??[])!y.path||y.path===t||t&&!y.path.startsWith(`${t}/`)||(l(y.path),d.set(y.path,y.total));for(const y of e){const v=y.folder;if(!v||v===t||v==="Root"){s.docs.push(...y.items);continue}l(v).docs.push(...y.items)}const f=y=>{y.count=y.docs.length,y.children.sort((p,x)=>p.name.localeCompare(x.name));let v=y.count;for(const p of y.children)v+=f(p);return y.total=Math.max(v,d.get(y.path)??0),y.total};f(s);const g=(y,v)=>{const p=[y.name];let x=y;for(;x.count===0&&x.children.length===1;)x=x.children[0],p.push(x.name);return{path:x.path,name:x.name,label:p.map(bp).join(" / "),depth:v,count:x.count,total:x.total,docs:x.docs,children:x.children.map(b=>g(b,v+1))}};return s.children=n?s.children:s.children.map(y=>g(y,0)),s}function lj({groups:e,baseFolder:t="",known:n,indentRem:s=1.25,isCollapsed:i,renderFolder:l,renderDoc:d,className:f}){const g=m.useMemo(()=>aj(e,t,n),[e,t,n]),y=[],v=x=>x>0?{marginLeft:`${x*s}rem`}:void 0,p=x=>{const b=x.depth+1;for(const N of x.docs)y.push(c.jsx("div",{style:v(b),children:d(N,{depth:b,parent:x})},`doc:${N.id}`));for(const N of x.children){const S=i?i(N.path):!1;y.push(c.jsx("div",{style:v(N.depth),children:l(N,{collapsed:S,depth:N.depth})},`folder:${N.path}`)),S||p(N)}};return p(g),c.jsx("div",{className:f,children:y})}const cj={path:"/account",label:"Account",icon:nx,order:40,hidden:!0},uj=Object.freeze(Object.defineProperty({__proto__:null,meta:cj},Symbol.toStringTag,{value:"Module"})),dj={path:"/api-keys",label:"API keys",icon:Xp,order:11,group:"workspace"},fj=Object.freeze(Object.defineProperty({__proto__:null,meta:dj},Symbol.toStringTag,{value:"Module"})),pj={path:"/guide",label:"How it works",icon:Gw,order:30,group:"help"},mj=Object.freeze(Object.defineProperty({__proto__:null,meta:pj},Symbol.toStringTag,{value:"Module"})),hj={path:"/my-drafts",label:"My Drafts",icon:cE,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"}},gj=Object.freeze(Object.defineProperty({__proto__:null,meta:hj},Symbol.toStringTag,{value:"Module"})),yj={path:"/my-work",label:"My Work",icon:UN,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"}},vj=Object.freeze(Object.defineProperty({__proto__:null,meta:yj},Symbol.toStringTag,{value:"Module"})),wj={path:"/",label:"Nests",icon:Qw,order:1},xj=Object.freeze(Object.defineProperty({__proto__:null,meta:wj},Symbol.toStringTag,{value:"Module"})),bj={path:"/settings",label:"Server settings",icon:su,order:21,group:"admin",visible:({isAdmin:e})=>e},Sj=Object.freeze(Object.defineProperty({__proto__:null,meta:bj},Symbol.toStringTag,{value:"Module"})),kj={path:"/teammates",label:"Teammates",icon:rx,order:20,group:"admin",visible:({isAdmin:e})=>e},_j=Object.freeze(Object.defineProperty({__proto__:null,meta:kj},Symbol.toStringTag,{value:"Module"})),Cj={path:"/teams",label:"Teams",icon:rx,order:10,group:"workspace"},Nj=Object.freeze(Object.defineProperty({__proto__:null,meta:Cj},Symbol.toStringTag,{value:"Module"})),Ej={path:"/trace",label:"Activity trace",icon:gE,order:22,group:"admin",visible:({isAdmin:e})=>e},Pj=Object.freeze(Object.defineProperty({__proto__:null,meta:Ej},Symbol.toStringTag,{value:"Module"})),jj=[{id:"work",label:"Work"},{id:"workspace",label:"Workspace"},{id:"admin",label:"Admin"},{id:"help",label:"Help"}],Tj=Object.assign({"../pages/app/account/meta.ts":uj,"../pages/app/api-keys/meta.ts":fj,"../pages/app/guide/meta.ts":mj,"../pages/app/my-drafts/meta.ts":gj,"../pages/app/my-work/meta.ts":vj,"../pages/app/nests/meta.ts":xj,"../pages/app/settings/meta.ts":Sj,"../pages/app/teammates/meta.ts":_j,"../pages/app/teams/meta.ts":Nj,"../pages/app/trace/meta.ts":Pj}),Rj=Object.assign({"../pages/app/account/page.tsx":()=>jt(()=>import("./page-Bgy9Ng9p.js"),__vite__mapDeps([27,28])),"../pages/app/api-keys/page.tsx":()=>jt(()=>import("./page-CptuAPJc.js"),__vite__mapDeps([29,28,30,7])),"../pages/app/guide/page.tsx":()=>jt(()=>import("./page-Dwbp4Seu.js"),__vite__mapDeps([31,28,30,20,24])),"../pages/app/my-drafts/page.tsx":()=>jt(()=>import("./page-DPY01SOj.js"),__vite__mapDeps([32,28,33,34,16,22,7,15])),"../pages/app/my-work/page.tsx":()=>jt(()=>import("./page-BJrFCKXB.js"),__vite__mapDeps([35,28,21,22,23,7,15])),"../pages/app/nests/page.tsx":()=>jt(()=>import("./page-YxjrE5b5.js"),__vite__mapDeps([36,37,17,7,18,28,16,22])),"../pages/app/settings/page.tsx":()=>jt(()=>import("./page-Dea2SblF.js"),__vite__mapDeps([38,28,12,37,7])),"../pages/app/teammates/page.tsx":()=>jt(()=>import("./page-Deq6IKiN.js"),__vite__mapDeps([39,28,20])),"../pages/app/teams/page.tsx":()=>jt(()=>import("./page-Dfjg8p7Z.js"),__vite__mapDeps([40,28,19,7,22,23,4,20])),"../pages/app/trace/page.tsx":()=>jt(()=>import("./page-C2zoxumw.js"),__vite__mapDeps([41,42,28,43,2,15]))}),Oj=e=>e.split("/").slice(-2,-1)[0],Oa=Object.entries(Tj).map(([e,t])=>{const n=Oj(e),s=Rj[e.replace(/meta\.ts$/,"page.tsx")];if(!s)throw new Error(`pages/app/${n}: meta.ts has no page.tsx beside it`);return{id:n,...t.meta,Component:Zp(s)}}).sort((e,t)=>e.order-t.order),Lc="nests";function Sp(e){return Oa.find(t=>t.id===e)??Oa.find(t=>t.id===Lc)??Oa[0]}function Aj(e){return Sp(e).path}function Mj(e){var n;const t=e.length>1?e.replace(/\/+$/,""):e;return((n=Oa.find(s=>s.path===t))==null?void 0:n.id)??null}const $x=(e,t)=>!e.visible||e.visible(t);function Rf(e,t){const n=Sp(e);return $x(n,t)?n:Sp(Lc)}function Ij(e){const t=Oa.filter(n=>!n.hidden&&$x(n,e));return{top:t.filter(n=>!n.group),groups:jj.map(n=>({...n,pages:t.filter(s=>s.group===n.id)})).filter(n=>n.pages.length>0)}}function Dx(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Dx(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Lx(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Dx(e))&&(s&&(s+=" "),s+=t);return s}const $j=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},Dj=(e,t)=>({classGroupId:e,validator:t}),zx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),zc="-",yv=[],Lj="arbitrary..",zj=e=>{const t=Uj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return Fj(d);const f=d.split(zc),g=f[0]===""&&f.length>1?1:0;return Fx(f,g,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const g=s[d],y=n[d];return g?y?$j(y,g):g:y||yv}return n[d]||yv}}},Fx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const y=Fx(e,t+1,l);if(y)return y}const d=n.validators;if(d===null)return;const f=t===0?e.join(zc):e.slice(t).join(zc),g=d.length;for(let y=0;y<g;y++){const v=d[y];if(v.validator(f))return v.classGroupId}},Fj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?Lj+s:void 0})(),Uj=e=>{const{theme:t,classGroups:n}=e;return Bj(n,t)},Bj=(e,t)=>{const n=zx();for(const s in e){const i=e[s];dm(i,n,s,t)}return n},dm=(e,t,n,s)=>{const i=e.length;for(let l=0;l<i;l++){const d=e[l];Vj(d,t,n,s)}},Vj=(e,t,n,s)=>{if(typeof e=="string"){Hj(e,t,n);return}if(typeof e=="function"){Wj(e,t,n,s);return}qj(e,t,n,s)},Hj=(e,t,n)=>{const s=e===""?t:Ux(t,e);s.classGroupId=n},Wj=(e,t,n,s)=>{if(Kj(e)){dm(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Dj(n,e))},qj=(e,t,n,s)=>{const i=Object.entries(e),l=i.length;for(let d=0;d<l;d++){const[f,g]=i[d];dm(g,Ux(t,f),n,s)}},Ux=(e,t)=>{let n=e;const s=t.split(zc),i=s.length;for(let l=0;l<i;l++){const d=s[l];let f=n.nextPart.get(d);f||(f=zx(),n.nextPart.set(d,f)),n=f}return n},Kj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(l,d)=>{n[l]=d,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(l){let d=n[l];if(d!==void 0)return d;if((d=s[l])!==void 0)return i(l,d),d},set(l,d){l in n?n[l]=d:i(l,d)}}},kp="!",vv=":",Qj=[],wv=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),Zj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const l=[];let d=0,f=0,g=0,y;const v=i.length;for(let S=0;S<v;S++){const C=i[S];if(d===0&&f===0){if(C===vv){l.push(i.slice(g,S)),g=S+1;continue}if(C==="/"){y=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const p=l.length===0?i:i.slice(g);let x=p,b=!1;p.endsWith(kp)?(x=p.slice(0,-1),b=!0):p.startsWith(kp)&&(x=p.slice(1),b=!0);const N=y&&y>g?y-g:void 0;return wv(l,b,x,N)};if(t){const i=t+vv,l=s;s=d=>d.startsWith(i)?l(d.slice(i.length)):wv(Qj,!1,d,void 0,!0)}if(n){const i=s;s=l=>n({className:l,parseClassName:i})}return s},Yj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let l=0;l<n.length;l++){const d=n[l],f=d[0]==="[",g=t.has(d);f||g?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(d)):i.push(d)}return i.length>0&&(i.sort(),s.push(...i)),s}},Jj=e=>({cache:Gj(e.cacheSize),parseClassName:Zj(e),sortModifiers:Yj(e),...zj(e)}),Xj=/\s+/,eT=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:l}=t,d=[],f=e.trim().split(Xj);let g="";for(let y=f.length-1;y>=0;y-=1){const v=f[y],{isExternal:p,modifiers:x,hasImportantModifier:b,baseClassName:N,maybePostfixModifierPosition:S}=n(v);if(p){g=v+(g.length>0?" "+g:g);continue}let C=!!S,_=s(C?N.substring(0,S):N);if(!_){if(!C){g=v+(g.length>0?" "+g:g);continue}if(_=s(N),!_){g=v+(g.length>0?" "+g:g);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:l(x).join(":"),T=b?E+kp:E,j=T+_;if(d.indexOf(j)>-1)continue;d.push(j);const q=i(_,C);for(let V=0;V<q.length;++V){const D=q[V];d.push(T+D)}g=v+(g.length>0?" "+g:g)}return g},tT=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=Bx(n))&&(i&&(i+=" "),i+=s);return i},Bx=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Bx(e[s]))&&(n&&(n+=" "),n+=t);return n},nT=(e,...t)=>{let n,s,i,l;const d=g=>{const y=t.reduce((v,p)=>p(v),e());return n=Jj(y),s=n.cache.get,i=n.cache.set,l=f,f(g)},f=g=>{const y=s(g);if(y)return y;const v=eT(g,n);return i(g,v),v};return l=d,(...g)=>l(tT(...g))},rT=[],Pt=e=>{const t=n=>n[e]||rT;return t.isThemeGetter=!0,t},Vx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iT=/\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$/,aT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,go=e=>oT.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),yo=e=>!!e&&Number.isInteger(Number(e)),Of=e=>e.endsWith("%")&&He(e.slice(0,-1)),zr=e=>sT.test(e),Wx=()=>!0,uT=e=>iT.test(e)&&!aT.test(e),fm=()=>!1,dT=e=>lT.test(e),fT=e=>cT.test(e),pT=e=>!Ne(e)&&!je(e),mT=e=>zo(e,Gx,fm),Ne=e=>Vx.test(e),rs=e=>zo(e,Qx,uT),xv=e=>zo(e,ST,He),hT=e=>zo(e,Yx,Wx),gT=e=>zo(e,Zx,fm),bv=e=>zo(e,qx,fm),yT=e=>zo(e,Kx,fT),yc=e=>zo(e,Jx,dT),je=e=>Hx.test(e),ba=e=>Ps(e,Qx),vT=e=>Ps(e,Zx),Sv=e=>Ps(e,qx),wT=e=>Ps(e,Gx),xT=e=>Ps(e,Kx),vc=e=>Ps(e,Jx,!0),bT=e=>Ps(e,Yx,!0),zo=(e,t,n)=>{const s=Vx.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Ps=(e,t,n=!1)=>{const s=Hx.exec(e);return s?s[1]?t(s[1]):n:!1},qx=e=>e==="position"||e==="percentage",Kx=e=>e==="image"||e==="url",Gx=e=>e==="length"||e==="size"||e==="bg-size",Qx=e=>e==="length",ST=e=>e==="number",Zx=e=>e==="family-name",Yx=e=>e==="number"||e==="weight",Jx=e=>e==="shadow",kT=()=>{const e=Pt("color"),t=Pt("font"),n=Pt("text"),s=Pt("font-weight"),i=Pt("tracking"),l=Pt("leading"),d=Pt("breakpoint"),f=Pt("container"),g=Pt("spacing"),y=Pt("radius"),v=Pt("shadow"),p=Pt("inset-shadow"),x=Pt("text-shadow"),b=Pt("drop-shadow"),N=Pt("blur"),S=Pt("perspective"),C=Pt("aspect"),_=Pt("ease"),E=Pt("animate"),T=()=>["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"],q=()=>[...j(),je,Ne],V=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],$=()=>[je,Ne,g],F=()=>[go,"full","auto",...$()],I=()=>[yo,"none","subgrid",je,Ne],re=()=>["auto",{span:["full",yo,je,Ne]},yo,je,Ne],fe=()=>[yo,"auto",je,Ne],de=()=>["auto","min","max","fr",je,Ne],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...$()],ie=()=>[go,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],G=()=>[go,"screen","full","dvw","lvw","svw","min","max","fit",...$()],Z=()=>[go,"screen","full","lh","dvh","lvh","svh","min","max","fit",...$()],U=()=>[e,je,Ne],R=()=>[...j(),Sv,bv,{position:[je,Ne]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",wT,mT,{size:[je,Ne]}],Y=()=>[Of,ba,rs],L=()=>["","none","full",y,je,Ne],ne=()=>["",He,ba,rs],X=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[He,Of,Sv,bv],Te=()=>["","none",N,je,Ne],Fe=()=>["none",He,je,Ne],ye=()=>["none",He,je,Ne],Ve=()=>[He,je,Ne],Ge=()=>[go,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zr],breakpoint:[zr],color:[Wx],container:[zr],"drop-shadow":[zr],ease:["in","out","in-out"],font:[pT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zr],shadow:[zr],spacing:["px",He],text:[zr],"text-shadow":[zr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",go,Ne,je,C]}],container:["container"],columns:[{columns:[He,Ne,je,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:q()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[yo,"auto",je,Ne]}],basis:[{basis:[go,"full","auto",f,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,go,"auto","initial","none",Ne]}],grow:[{grow:["",He,je,Ne]}],shrink:[{shrink:["",He,je,Ne]}],order:[{order:[yo,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pbs:[{pbs:$()}],pbe:[{pbe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[f,"screen",...ie()]}],"min-w":[{"min-w":[f,"screen","none",...ie()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,ba,rs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,bT,hT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Of,Ne]}],"font-family":[{font:[vT,gT,t]}],"font-features":[{"font-features":[Ne]}],"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:[i,je,Ne]}],"line-clamp":[{"line-clamp":[He,"none",je,xv]}],leading:[{leading:[l,...$()]}],"list-image":[{"list-image":["none",je,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",je,rs]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[He,"auto",je,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Ne]}],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",je,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yo,je,Ne],radial:["",je,Ne],conic:[yo,je,Ne]},xT,yT]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,je,Ne]}],"outline-w":[{outline:["",He,ba,rs]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",v,vc,yc]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,vc,yc]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[He,rs]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",x,vc,yc]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[He,je,Ne]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[je,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:Te()}],brightness:[{brightness:[He,je,Ne]}],contrast:[{contrast:[He,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",b,vc,yc]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",He,je,Ne]}],"hue-rotate":[{"hue-rotate":[He,je,Ne]}],invert:[{invert:["",He,je,Ne]}],saturate:[{saturate:[He,je,Ne]}],sepia:[{sepia:["",He,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[He,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[He,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",He,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[He,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[He,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",He,je,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",je,Ne]}],ease:[{ease:["linear","initial",_,je,Ne]}],delay:[{delay:[He,je,Ne]}],animate:[{animate:["none",E,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,je,Ne]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[je,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",je,Ne]}],"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":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mbs":[{"scroll-mbs":$()}],"scroll-mbe":[{"scroll-mbe":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pbs":[{"scroll-pbs":$()}],"scroll-pbe":[{"scroll-pbe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",je,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[He,ba,rs,xv]}],stroke:[{stroke:["none",...U()]}],"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"]}},_T=nT(kT);var kv;function ze(e,t,n){function s(f,g){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,g);const y=d.prototype,v=Object.keys(y);for(let p=0;p<v.length;p++){const x=v[p];x in f||(f[x]=y[x].bind(f))}}const i=(n==null?void 0:n.Parent)??Object;class l extends i{}Object.defineProperty(l,"name",{value:e});function d(f){var g;const y=n!=null&&n.Parent?new l:this;s(y,f),(g=y._zod).deferred??(g.deferred=[]);for(const v of y._zod.deferred)v();return y}return Object.defineProperty(d,"init",{value:s}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>{var g,y;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(y=(g=f==null?void 0:f._zod)==null?void 0:g.traits)==null?void 0:y.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class ci extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xx extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(kv=globalThis).__zod_globalConfig??(kv.__zod_globalConfig={});const CT=globalThis.__zod_globalConfig;function xs(e){return CT}function _p(e,t){return typeof t=="bigint"?t.toString():t}function pm(e){return e==null}function mm(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const _v=Symbol("evaluating");function ot(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==_v)return s===void 0&&(s=_v,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function NT(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function ET(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const e0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cp(e){if(Cv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Cv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function t0(e){return Cp(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function hm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function PT(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(s._zod.parent=e),s}function rn(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 li(e,t=0){var n;if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(((n=e.issues[s])==null?void 0:n.continue)!==!0)return!0;return!1}function jT(e,t=0){var n;if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(((n=e.issues[s])==null?void 0:n.continue)===!1)return!0;return!1}function TT(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function wc(e){return typeof e=="string"?e:e==null?void 0:e.message}function bs(e,t,n){var g,y,v,p,x,b;const s=e.message?e.message:wc((v=(y=(g=e.inst)==null?void 0:g._zod.def)==null?void 0:y.error)==null?void 0:v.call(y,e))??wc((p=t==null?void 0:t.error)==null?void 0:p.call(t,e))??wc((x=n.customError)==null?void 0:x.call(n,e))??wc((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",{inst:i,continue:l,input:d,...f}=e;return f.path??(f.path=[]),f.message=s,t!=null&&t.reportInput&&(f.input=d),f}function gm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Da(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const n0=(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,_p,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},r0=ze("$ZodError",n0),o0=ze("$ZodError",n0,{Parent:Error});function RT(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function OT(e,t=n=>n.message){const n={_errors:[]},s=(i,l=[])=>{for(const d of i.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>s({issues:f},[...l,...d.path]));else if(d.code==="invalid_key")s({issues:d.issues},[...l,...d.path]);else if(d.code==="invalid_element")s({issues:d.issues},[...l,...d.path]);else{const f=[...l,...d.path];if(f.length===0)n._errors.push(t(d));else{let g=n,y=0;for(;y<f.length;){const v=f[y];y===f.length-1?(g[v]=g[v]||{_errors:[]},g[v]._errors.push(t(d))):g[v]=g[v]||{_errors:[]},g=g[v],y++}}}};return s(e),n}const ym=e=>(t,n,s,i)=>{const l=s?{...s,async:!1}:{async:!1},d=t._zod.run({value:n,issues:[]},l);if(d instanceof Promise)throw new ci;if(d.issues.length){const f=new((i==null?void 0:i.Err)??e)(d.issues.map(g=>bs(g,l,xs())));throw e0(f,i==null?void 0:i.callee),f}return d.value},vm=e=>async(t,n,s,i)=>{const l=s?{...s,async:!0}:{async:!0};let d=t._zod.run({value:n,issues:[]},l);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new((i==null?void 0:i.Err)??e)(d.issues.map(g=>bs(g,l,xs())));throw e0(f,i==null?void 0:i.callee),f}return d.value},cu=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw new ci;return l.issues.length?{success:!1,error:new(e??r0)(l.issues.map(d=>bs(d,i,xs())))}:{success:!0,data:l.value}},AT=cu(o0),uu=e=>async(t,n,s)=>{const i=s?{...s,async:!0}:{async:!0};let l=t._zod.run({value:n,issues:[]},i);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(d=>bs(d,i,xs())))}:{success:!0,data:l.value}},MT=uu(o0),IT=e=>(t,n,s)=>{const i=s?{...s,direction:"backward"}:{direction:"backward"};return ym(e)(t,n,i)},$T=e=>(t,n,s)=>ym(e)(t,n,s),DT=e=>async(t,n,s)=>{const i=s?{...s,direction:"backward"}:{direction:"backward"};return vm(e)(t,n,i)},LT=e=>async(t,n,s)=>vm(e)(t,n,s),zT=e=>(t,n,s)=>{const i=s?{...s,direction:"backward"}:{direction:"backward"};return cu(e)(t,n,i)},FT=e=>(t,n,s)=>cu(e)(t,n,s),UT=e=>async(t,n,s)=>{const i=s?{...s,direction:"backward"}:{direction:"backward"};return uu(e)(t,n,i)},BT=e=>async(t,n,s)=>uu(e)(t,n,s),VT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HT=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}$`)},WT=/^[^A-Z]*$/,qT=/^[^a-z]*$/,Er=ze("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),KT=ze("$ZodCheckMaxLength",(e,t)=>{var n;Er.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!pm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const d=gm(i);s.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),GT=ze("$ZodCheckMinLength",(e,t)=>{var n;Er.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!pm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const d=gm(i);s.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),QT=ze("$ZodCheckLengthEquals",(e,t)=>{var n;Er.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!pm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,l=i.length;if(l===t.length)return;const d=gm(i),f=l>t.length;s.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),du=ze("$ZodCheckStringFormat",(e,t)=>{var n,s;Er.init(e,t),e._zod.onattach.push(i=>{const l=i._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),ZT=ze("$ZodCheckRegex",(e,t)=>{du.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),YT=ze("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=WT),du.init(e,t)}),JT=ze("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qT),du.init(e,t)}),XT=ze("$ZodCheckIncludes",(e,t)=>{Er.init(e,t);const n=hm(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),eR=ze("$ZodCheckStartsWith",(e,t)=>{Er.init(e,t);const n=new RegExp(`^${hm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),tR=ze("$ZodCheckEndsWith",(e,t)=>{Er.init(e,t);const n=new RegExp(`.*${hm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),nR=ze("$ZodCheckOverwrite",(e,t)=>{Er.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),rR={major:4,minor:4,patch:3},on=ze("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rR;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const l of s)for(const d of l._zod.onattach)d(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const l=(f,g,y)=>{let v=li(f),p;for(const x of g){if(x._zod.def.when){if(jT(f)||!x._zod.def.when(f))continue}else if(v)continue;const b=f.issues.length,N=x._zod.check(f);if(N instanceof Promise&&(y==null?void 0:y.async)===!1)throw new ci;if(p||N instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await N,f.issues.length!==b&&(v||(v=li(f,b)))});else{if(f.issues.length===b)continue;v||(v=li(f,b))}}return p?p.then(()=>f):f},d=(f,g,y)=>{if(li(f))return f.aborted=!0,f;const v=l(g,s,y);if(v instanceof Promise){if(y.async===!1)throw new ci;return v.then(p=>e._zod.parse(p,y))}return e._zod.parse(v,y)};e._zod.run=(f,g)=>{if(g.skipChecks)return e._zod.parse(f,g);if(g.direction==="backward"){const v=e._zod.parse({value:f.value,issues:[]},{...g,skipChecks:!0});return v instanceof Promise?v.then(p=>d(p,f,g)):d(v,f,g)}const y=e._zod.parse(f,g);if(y instanceof Promise){if(g.async===!1)throw new ci;return y.then(v=>l(v,s,g))}return l(y,s,g)}}ot(e,"~standard",()=>({validate:l=>{var d;try{const f=AT(e,l);return f.success?{value:f.data}:{issues:(d=f.error)==null?void 0:d.issues}}catch{return MT(e,l).then(g=>{var y;return g.success?{value:g.data}:{issues:(y=g.error)==null?void 0:y.issues}})}},vendor:"zod",version:1}))}),s0=ze("$ZodString",(e,t)=>{var n;on.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??HT(e._zod.bag),e._zod.parse=(s,i)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),i0=ze("$ZodStringFormat",(e,t)=>{du.init(e,t),s0.init(e,t)}),oR=ze("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=VT),i0.init(e,t)});function Nv(e,t,n){e.issues.length&&t.issues.push(...TT(n,e.issues)),t.value[n]=e.value}const sR=ze("$ZodArray",(e,t)=>{on.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const l=[];for(let d=0;d<i.length;d++){const f=i[d],g=t.element._zod.run({value:f,issues:[]},s);g instanceof Promise?l.push(g.then(y=>Nv(y,n,d))):Nv(g,n,d)}return l.length?Promise.all(l).then(()=>n):n}});function Ev(e,t,n,s){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const i=e.filter(l=>!li(l));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(l=>l.issues.map(d=>bs(d,s,xs())))}),t)}const iR=ze("$ZodUnion",(e,t)=>{on.init(e,t),ot(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),ot(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>mm(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(s,i)=>{if(n)return n(s,i);let l=!1;const d=[];for(const f of t.options){const g=f._zod.run({value:s.value,issues:[]},i);if(g instanceof Promise)d.push(g),l=!0;else{if(g.issues.length===0)return g;d.push(g)}}return l?Promise.all(d).then(f=>Ev(f,s,e,i)):Ev(d,s,e,i)}}),aR=ze("$ZodIntersection",(e,t)=>{on.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,l=t.left._zod.run({value:i,issues:[]},s),d=t.right._zod.run({value:i,issues:[]},s);return l instanceof Promise||d instanceof Promise?Promise.all([l,d]).then(([g,y])=>Pv(n,g,y)):Pv(n,l,d)}});function Np(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(Cp(e)&&Cp(t)){const n=Object.keys(t),s=Object.keys(e).filter(l=>n.indexOf(l)!==-1),i={...e,...t};for(const l of s){const d=Np(e[l],t[l]);if(!d.valid)return{valid:!1,mergeErrorPath:[l,...d.mergeErrorPath]};i[l]=d.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],l=t[s],d=Np(i,l);if(!d.valid)return{valid:!1,mergeErrorPath:[s,...d.mergeErrorPath]};n.push(d.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Pv(e,t,n){const s=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const g of f.keys)s.has(g)||s.set(g,{}),s.get(g).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const g of f.keys)s.has(g)||s.set(g,{}),s.get(g).r=!0;else e.issues.push(f);const l=[...s].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(l.length&&i&&e.issues.push({...i,keys:l}),li(e))return e;const d=Np(t.value,n.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const lR=ze("$ZodTransform",(e,t)=>{on.init(e,t),e._zod.optin="optional",e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new Xx(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(d=>(n.value=d,n.fallback=!0,n));if(i instanceof Promise)throw new ci;return n.value=i,n.fallback=!0,n}});function jv(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const a0=ze("$ZodOptional",(e,t)=>{on.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${mm(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=n.value,l=t.innerType._zod.run(n,s);return l instanceof Promise?l.then(d=>jv(d,i)):jv(l,i)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),cR=ze("$ZodExactOptional",(e,t)=>{a0.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),uR=ze("$ZodNullable",(e,t)=>{on.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${mm(n.source)}|null)$`):void 0}),ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),dR=ze("$ZodDefault",(e,t)=>{on.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(l=>Tv(l,t)):Tv(i,t)}});function Tv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fR=ze("$ZodPrefault",(e,t)=>{on.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),pR=ze("$ZodNonOptional",(e,t)=>{on.init(e,t),ot(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(l=>Rv(l,e)):Rv(i,e)}});function Rv(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 mR=ze("$ZodCatch",(e,t)=>{on.init(e,t),e._zod.optin="optional",ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(l=>(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(d=>bs(d,s,xs()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(l=>bs(l,s,xs()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),hR=ze("$ZodPipe",(e,t)=>{on.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const l=t.out._zod.run(n,s);return l instanceof Promise?l.then(d=>xc(d,t.in,s)):xc(l,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(l=>xc(l,t.out,s)):xc(i,t.out,s)}});function xc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const gR=ze("$ZodReadonly",(e,t)=>{on.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>{var n,s;return(s=(n=t.innerType)==null?void 0:n._zod)==null?void 0:s.optin}),ot(e._zod,"optout",()=>{var n,s;return(s=(n=t.innerType)==null?void 0:n._zod)==null?void 0:s.optout}),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(Ov):Ov(i)}});function Ov(e){return e.value=Object.freeze(e.value),e}const yR=ze("$ZodCustom",(e,t)=>{Er.init(e,t),on.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(l=>Av(l,n,s,e));Av(i,n,s,e)}});function Av(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(Da(i))}}var Mv;class vR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function wR(){return new vR}(Mv=globalThis).__zod_globalRegistry??(Mv.__zod_globalRegistry=wR());const Na=globalThis.__zod_globalRegistry;function xR(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...rn(t)})}function l0(e,t){return new KT({check:"max_length",...rn(t),maximum:e})}function Fc(e,t){return new GT({check:"min_length",...rn(t),minimum:e})}function c0(e,t){return new QT({check:"length_equals",...rn(t),length:e})}function bR(e,t){return new ZT({check:"string_format",format:"regex",...rn(t),pattern:e})}function SR(e){return new YT({check:"string_format",format:"lowercase",...rn(e)})}function kR(e){return new JT({check:"string_format",format:"uppercase",...rn(e)})}function _R(e,t){return new XT({check:"string_format",format:"includes",...rn(t),includes:e})}function CR(e,t){return new eR({check:"string_format",format:"starts_with",...rn(t),prefix:e})}function NR(e,t){return new tR({check:"string_format",format:"ends_with",...rn(t),suffix:e})}function $i(e){return new nR({check:"overwrite",tx:e})}function ER(e){return $i(t=>t.normalize(e))}function PR(){return $i(e=>e.trim())}function jR(){return $i(e=>e.toLowerCase())}function TR(){return $i(e=>e.toUpperCase())}function RR(){return $i(e=>ET(e))}function OR(e,t,n){return new e({type:"array",element:t,...rn(n)})}function AR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...rn(n)})}function MR(e,t){const n=IR(s=>(s.addIssue=i=>{if(typeof i=="string")s.issues.push(Da(i,s.value,n._zod.def));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=s.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),s.issues.push(Da(l))}},e(s.value,s)),t);return n}function IR(e,t){const n=new Er({check:"custom",...rn(t)});return n._zod.check=e,n}function u0(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)??Na,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 nn(e,t,n={path:[],schemaPath:[]}){var v,p;var s;const i=e._zod.def,l=t.seen.get(e);if(l)return l.count++,n.schemaPath.includes(e)&&(l.cycle=n.path),l.schema;const d={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,d);const f=(p=(v=e._zod).toJSONSchema)==null?void 0:p.call(v);if(f)d.schema=f;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,x);else{const N=d.schema,S=t.processors[i.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);S(e,t,N,x)}const b=e._zod.parent;b&&(d.ref||(d.ref=b),nn(b,t,x),t.seen.get(b).isParent=!0)}const g=t.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),t.io==="input"&&Xt(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&"_prefault"in d.schema&&((s=d.schema).default??(s.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function d0(e,t){var d,f,g,y;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const v of e.seen.entries()){const p=(d=e.metadataRegistry.get(v[0]))==null?void 0:d.id;if(p){const x=s.get(p);if(x&&x!==v[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(p,v[0])}}const i=v=>{var S;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(S=e.external.registry.get(v[0]))==null?void 0:S.id,_=e.external.uri??(T=>T);if(C)return{ref:_(C)};const E=v[1].defId??v[1].schema.id??`schema${e.counter++}`;return v[1].defId=E,{defId:E,ref:`${_("__shared")}#/${p}/${E}`}}if(v[1]===n)return{ref:"#"};const b=`#/${p}/`,N=v[1].schema.id??`__schema${e.counter++}`;return{defId:N,ref:b+N}},l=v=>{if(v[1].schema.$ref)return;const p=v[1],{ref:x,defId:b}=i(v);p.def={...p.schema},b&&(p.defId=b);const N=p.schema;for(const S in N)delete N[S];N.$ref=x};if(e.cycles==="throw")for(const v of e.seen.entries()){const p=v[1];if(p.cycle)throw new Error(`Cycle detected: #/${(f=p.cycle)==null?void 0:f.join("/")}/<root>
342
-
343
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const v of e.seen.entries()){const p=v[1];if(t===v[0]){l(v);continue}if(e.external){const b=(g=e.external.registry.get(v[0]))==null?void 0:g.id;if(t!==v[0]&&b){l(v);continue}}if((y=e.metadataRegistry.get(v[0]))==null?void 0:y.id){l(v);continue}if(p.cycle){l(v);continue}if(p.count>1&&e.reused==="ref"){l(v);continue}}}function f0(e,t){var f,g,y,v;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=p=>{const x=e.seen.get(p);if(x.ref===null)return;const b=x.def??x.schema,N={...b},S=x.ref;if(x.ref=null,S){s(S);const _=e.seen.get(S),E=_.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(b.allOf=b.allOf??[],b.allOf.push(E)):Object.assign(b,E),Object.assign(b,N),p._zod.parent===S)for(const j in b)j==="$ref"||j==="allOf"||j in N||delete b[j];if(E.$ref&&_.def)for(const j in b)j==="$ref"||j==="allOf"||j in _.def&&JSON.stringify(b[j])===JSON.stringify(_.def[j])&&delete b[j]}const C=p._zod.parent;if(C&&C!==S){s(C);const _=e.seen.get(C);if(_!=null&&_.schema.$ref&&(b.$ref=_.schema.$ref,_.def))for(const E in b)E==="$ref"||E==="allOf"||E in _.def&&JSON.stringify(b[E])===JSON.stringify(_.def[E])&&delete b[E]}e.override({zodSchema:p,jsonSchema:b,path:x.path??[]})};for(const p of[...e.seen.entries()].reverse())s(p[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(f=e.external)!=null&&f.uri){const p=(g=e.external.registry.get(t))==null?void 0:g.id;if(!p)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(p)}Object.assign(i,n.def??n.schema);const l=(y=e.metadataRegistry.get(t))==null?void 0:y.id;l!==void 0&&i.id===l&&delete i.id;const d=((v=e.external)==null?void 0:v.defs)??{};for(const p of e.seen.entries()){const x=p[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"?i.$defs=d:i.definitions=d);try{const p=JSON.parse(JSON.stringify(i));return Object.defineProperty(p,"~standard",{value:{...t["~standard"],jsonSchema:{input:Uc(t,"input",e.processors),output:Uc(t,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Xt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Xt(s.element,n);if(s.type==="set")return Xt(s.valueType,n);if(s.type==="lazy")return Xt(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Xt(s.innerType,n);if(s.type==="intersection")return Xt(s.left,n)||Xt(s.right,n);if(s.type==="record"||s.type==="map")return Xt(s.keyType,n)||Xt(s.valueType,n);if(s.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Xt(s.in,n)||Xt(s.out,n);if(s.type==="object"){for(const i in s.shape)if(Xt(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(Xt(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(Xt(i,n))return!0;return!!(s.rest&&Xt(s.rest,n))}return!1}const $R=(e,t={})=>n=>{const s=u0({...n,processors:t});return nn(e,s),d0(s,e),f0(s,e)},Uc=(e,t,n={})=>s=>{const{libraryOptions:i,target:l}=s??{},d=u0({...i??{},target:l,io:t,processors:n});return nn(e,d),d0(d,e),f0(d,e)},DR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},LR=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:l,maximum:d,format:f,patterns:g,contentEncoding:y}=e._zod.bag;if(typeof l=="number"&&(i.minLength=l),typeof d=="number"&&(i.maxLength=d),f&&(i.format=DR[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),y&&(i.contentEncoding=y),g&&g.size>0){const v=[...g];v.length===1?i.pattern=v[0].source:v.length>1&&(i.allOf=[...v.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},zR=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},FR=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},UR=(e,t,n,s)=>{const i=n,l=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(i.minItems=d),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=nn(l.element,t,{...s,path:[...s.path,"items"]})},BR=(e,t,n,s)=>{const i=e._zod.def,l=i.inclusive===!1,d=i.options.map((f,g)=>nn(f,t,{...s,path:[...s.path,l?"oneOf":"anyOf",g]}));l?n.oneOf=d:n.anyOf=d},VR=(e,t,n,s)=>{const i=e._zod.def,l=nn(i.left,t,{...s,path:[...s.path,"allOf",0]}),d=nn(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=y=>"allOf"in y&&Object.keys(y).length===1,g=[...f(l)?l.allOf:[l],...f(d)?d.allOf:[d]];n.allOf=g},HR=(e,t,n,s)=>{const i=e._zod.def,l=nn(i.innerType,t,s),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=i.innerType,n.nullable=!0):n.anyOf=[l,{type:"null"}]},WR=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType},qR=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},KR=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},GR=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType;let d;try{d=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=d},QR=(e,t,n,s)=>{const i=e._zod.def,l=i.in._zod.traits.has("$ZodTransform"),d=t.io==="input"?l?i.out:i.in:i.out;nn(d,t,s);const f=t.seen.get(e);f.ref=d},ZR=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType,n.readOnly=!0},p0=(e,t,n,s)=>{const i=e._zod.def;nn(i.innerType,t,s);const l=t.seen.get(e);l.ref=i.innerType},YR=(e,t)=>{r0.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>OT(e,n)},flatten:{value:n=>RT(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,_p,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,_p,2)}},isEmpty:{get(){return e.issues.length===0}}})},Hn=ze("ZodError",YR,{Parent:Error}),JR=ym(Hn),XR=vm(Hn),eO=cu(Hn),tO=uu(Hn),nO=IT(Hn),rO=$T(Hn),oO=DT(Hn),sO=LT(Hn),iO=zT(Hn),aO=FT(Hn),lO=UT(Hn),cO=BT(Hn),Iv=new WeakMap;function wm(e,t,n){const s=Object.getPrototypeOf(e);let i=Iv.get(s);if(i||(i=new Set,Iv.set(s,i)),!i.has(t)){i.add(t);for(const l in n){const d=n[l];Object.defineProperty(s,l,{configurable:!0,enumerable:!1,get(){const f=d.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:f}),f},set(f){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:f})}})}}}const sn=ze("ZodType",(e,t)=>(on.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Uc(e,"input"),output:Uc(e,"output")}}),e.toJSONSchema=$R(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,s)=>JR(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>eO(e,n,s),e.parseAsync=async(n,s)=>XR(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>tO(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>nO(e,n,s),e.decode=(n,s)=>rO(e,n,s),e.encodeAsync=async(n,s)=>oO(e,n,s),e.decodeAsync=async(n,s)=>sO(e,n,s),e.safeEncode=(n,s)=>iO(e,n,s),e.safeDecode=(n,s)=>aO(e,n,s),e.safeEncodeAsync=async(n,s)=>lO(e,n,s),e.safeDecodeAsync=async(n,s)=>cO(e,n,s),wm(e,"ZodType",{check(...n){const s=this.def;return this.clone(NT(s,{checks:[...s.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,s){return PT(this,n,s)},brand(){return this},register(n,s){return n.add(this,s),this},refine(n,s){return this.check(LO(n,s))},superRefine(n,s){return this.check(zO(n,s))},overwrite(n){return this.check($i(n))},optional(){return $v(this)},exactOptional(){return _O(this)},nullable(){return Dv(this)},nullish(){return $v(Dv(this))},nonoptional(n){return RO(this,n)},array(){return hO(this)},or(n){return yO([this,n])},and(n){return wO(this,n)},transform(n){return Lv(this,bO(n))},default(n){return EO(this,n)},prefault(n){return jO(this,n)},catch(n){return AO(this,n)},pipe(n){return Lv(this,n)},readonly(){return $O(this)},describe(n){const s=this.clone();return Na.add(s,{description:n}),s},meta(...n){if(n.length===0)return Na.get(this);const s=this.clone();return Na.add(s,n[0]),s},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=Na.get(e))==null?void 0:n.description},configurable:!0}),e)),uO=ze("_ZodString",(e,t)=>{s0.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(s,i,l)=>LR(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,wm(e,"_ZodString",{regex(...s){return this.check(bR(...s))},includes(...s){return this.check(_R(...s))},startsWith(...s){return this.check(CR(...s))},endsWith(...s){return this.check(NR(...s))},min(...s){return this.check(Fc(...s))},max(...s){return this.check(l0(...s))},length(...s){return this.check(c0(...s))},nonempty(...s){return this.check(Fc(1,...s))},lowercase(s){return this.check(SR(s))},uppercase(s){return this.check(kR(s))},trim(){return this.check(PR())},normalize(...s){return this.check(ER(...s))},toLowerCase(){return this.check(jR())},toUpperCase(){return this.check(TR())},slugify(){return this.check(RR())}})}),dO=ze("ZodStringFormat",(e,t)=>{i0.init(e,t),uO.init(e,t)}),fO=ze("ZodEmail",(e,t)=>{oR.init(e,t),dO.init(e,t)});function pO(e){return xR(fO,e)}const mO=ze("ZodArray",(e,t)=>{sR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>UR(e,n,s,i),e.element=t.element,wm(e,"ZodArray",{min(n,s){return this.check(Fc(n,s))},nonempty(n){return this.check(Fc(1,n))},max(n,s){return this.check(l0(n,s))},length(n,s){return this.check(c0(n,s))},unwrap(){return this.element}})});function hO(e,t){return OR(mO,e,t)}const gO=ze("ZodUnion",(e,t)=>{iR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>BR(e,n,s,i),e.options=t.options});function yO(e,t){return new gO({type:"union",options:e,...rn(t)})}const vO=ze("ZodIntersection",(e,t)=>{aR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>VR(e,n,s,i)});function wO(e,t){return new vO({type:"intersection",left:e,right:t})}const xO=ze("ZodTransform",(e,t)=>{lR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>FR(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new Xx(e.constructor.name);n.addIssue=l=>{if(typeof l=="string")n.issues.push(Da(l,n.value,t));else{const d=l;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=n.value),d.inst??(d.inst=e),n.issues.push(Da(d))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(l=>(n.value=l,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function bO(e){return new xO({type:"transform",transform:e})}const SO=ze("ZodOptional",(e,t)=>{a0.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>p0(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function $v(e){return new SO({type:"optional",innerType:e})}const kO=ze("ZodExactOptional",(e,t)=>{cR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>p0(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function _O(e){return new kO({type:"optional",innerType:e})}const CO=ze("ZodNullable",(e,t)=>{uR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>HR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function Dv(e){return new CO({type:"nullable",innerType:e})}const NO=ze("ZodDefault",(e,t)=>{dR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>qR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function EO(e,t){return new NO({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t0(t)}})}const PO=ze("ZodPrefault",(e,t)=>{fR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>KR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function jO(e,t){return new PO({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t0(t)}})}const TO=ze("ZodNonOptional",(e,t)=>{pR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>WR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function RO(e,t){return new TO({type:"nonoptional",innerType:e,...rn(t)})}const OO=ze("ZodCatch",(e,t)=>{mR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>GR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AO(e,t){return new OO({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const MO=ze("ZodPipe",(e,t)=>{hR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>QR(e,n,s,i),e.in=t.in,e.out=t.out});function Lv(e,t){return new MO({type:"pipe",in:e,out:t})}const IO=ze("ZodReadonly",(e,t)=>{gR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>ZR(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function $O(e){return new IO({type:"readonly",innerType:e})}const DO=ze("ZodCustom",(e,t)=>{yR.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,s,i)=>zR(e,n)});function LO(e,t={}){return AR(DO,e,t)}function zO(e,t){return MR(e,t)}function _e(...e){return _T(Lx(e))}const FO=pO();function SF(e){return FO.safeParse(e.trim()).success}const zv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fv=Lx,fu=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return Fv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:l}=t,d=Object.keys(i).map(y=>{const v=n==null?void 0:n[y],p=l==null?void 0:l[y];if(v===null)return null;const x=zv(v)||zv(p);return i[y][x]}),f=n&&Object.entries(n).reduce((y,v)=>{let[p,x]=v;return x===void 0||(y[p]=x),y},{}),g=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((y,v)=>{let{class:p,className:x,...b}=v;return Object.entries(b).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...l,...f}[S]):{...l,...f}[S]===C})?[...y,p,x]:y},[]);return Fv(e,d,g,n==null?void 0:n.class,n==null?void 0:n.className)},UO=fu("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 xm({className:e,variant:t,...n}){return c.jsx("div",{className:_e(UO({variant:t}),e),...n})}const vs="flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm hover:bg-muted",ws="text-foreground/80 hover:text-foreground",bm="bg-muted font-medium text-foreground",Hr="h-4 w-4 shrink-0",BO="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",bc=e=>({nestId:e.id,nestName:e.name,isOwner:e.is_owner??e.permission==="owner",isAnonOwned:e.user_id===Tx});function VO({nestId:e,nodeId:t,activeView:n=null,onCollapse:s,onOpenDocument:i,onOpenNest:l,onOpenView:d,onConnect:f,onOpenDashboard:g,logoUrl:y,dashboardTab:v=null,onOpenDashboardTab:p,onNewDocument:x}){var q,V;const b=Wr({...Bt.nestList(),enabled:e!==null}),{isAdmin:N,workflowPlaneEnabled:S}=Ja(),[C,_]=m.useState(()=>new Set(e?[e]:[]));m.useEffect(()=>{e&&_(D=>D.has(e)?D:new Set([...D,e]))},[e]);const[E,T]=m.useState(""),j=m.useMemo(()=>{var F;const D=((F=b.data)==null?void 0:F.nests)??[],$=E.trim().toLowerCase();return D.filter(I=>!$||I.id===e||String(I.name).toLowerCase().includes($)).sort((I,re)=>I.id===e?-1:re.id===e?1:String(I.name).localeCompare(String(re.name)))},[b.data,e,E]);return c.jsxs("nav",{"aria-label":"Nests and documents",className:"flex h-full flex-col bg-muted/30 text-sm","data-testid":"document-sidebar",children:[c.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between gap-1 border-b border-border px-4",children:[c.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:[c.jsx("img",{src:y,alt:"ContextNest",className:"h-7 w-7 object-contain"}),c.jsx("span",{className:"font-semibold",children:"ContextNest"}),c.jsx(xm,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]}),c.jsx("button",{type:"button",onClick:s,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:c.jsx(sE,{className:"h-4 w-4"})})]}),e!==null&&c.jsxs("button",{type:"button",onClick:g,className:_e(vs,ws,"mx-2 mt-3 w-auto"),title:"All nests",children:[c.jsx(Xw,{className:Hr}),"All nests"]}),e!==null&&(((V=(q=b.data)==null?void 0:q.nests)==null?void 0:V.length)??0)>1&&c.jsxs("div",{className:"relative mx-2 mt-1 mb-2",children:[c.jsx(em,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),c.jsx("input",{type:"search",value:E,onChange:D=>T(D.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"})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-4",children:[e===null&&c.jsx(HO,{active:v,isAdmin:N,onOpen:p}),e!==null&&b.isLoading&&c.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"Loading…"}),e!==null&&j.map(D=>{const $=C.has(D.id),F=D.id===e;return c.jsxs("div",{className:_e("mb-1",F&&"mb-3"),children:[c.jsxs("div",{className:_e("group flex items-center gap-1 rounded px-1.5 py-1",F?"text-foreground":"text-muted-foreground"),children:[c.jsx("button",{type:"button",onClick:()=>_(I=>{const re=new Set(I);return re.has(D.id)?re.delete(D.id):re.add(D.id),re}),className:"rounded p-0.5 hover:bg-muted","aria-label":$?`Collapse ${D.name}`:`Expand ${D.name}`,"aria-expanded":$,children:$?c.jsx(Ro,{className:"h-3.5 w-3.5"}):c.jsx(Ya,{className:"h-3.5 w-3.5"})}),c.jsxs("button",{type:"button",onClick:()=>l(bc(D)),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 ${D.name}`,children:[c.jsx("span",{className:"truncate",children:D.name}),c.jsx(WO,{visibility:D.visibility})]}),F&&x&&c.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:c.jsx(tx,{className:"h-3.5 w-3.5"})})]}),$&&F&&c.jsx(KO,{nestId:D.id,isOwner:bc(D).isOwner,isAdmin:N,workflowPlaneEnabled:S,activeView:n,onOpen:I=>d(bc(D),I),onConnect:f}),$&&c.jsx(GO,{nestId:D.id,currentNodeId:F?t:null,onOpen:I=>i({...bc(D),nodeId:I}),onNewDocument:F?x:void 0})]},D.id)})]})]})}function HO({active:e,isAdmin:t,onOpen:n}){const s=Ij({isAdmin:t}),[i,l]=m.useState(()=>lu(localStorage).closedGroups),d=(f,g)=>{const y=g?i.filter(v=>v!==f):[...i,f];l(y),um(localStorage,{closedGroups:y})};return c.jsxs("div",{className:"mt-3 space-y-0.5","data-testid":"document-sidebar-dashboard",children:[s.top.map(f=>c.jsx(Uv,{page:f,active:f.id===e,onOpen:n},f.id)),s.groups.map(f=>{const g=f.pages.some(v=>v.id===e),y=!i.includes(f.id)||g;return c.jsxs("div",{className:"pt-2",children:[c.jsxs("button",{type:"button",onClick:()=>d(f.id,!y),"aria-expanded":y,className:BO,"data-testid":`document-sidebar-group-${f.id}`,children:[y?c.jsx(Ro,{className:"h-3.5 w-3.5 shrink-0"}):c.jsx(Ya,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"truncate",children:f.label})]}),y&&c.jsx("div",{className:"space-y-0.5",children:f.pages.map(v=>c.jsx(Uv,{page:v,active:v.id===e,onOpen:n,indent:!0},v.id))})]},f.id)})]})}function Uv({page:e,active:t,indent:n=!1,onOpen:s}){var f,g;const i=Wr({...((f=e.badge)==null?void 0:f.options())??{queryKey:["page-badge",e.id,"none"],queryFn:async()=>null},enabled:!!e.badge}),l=e.badge?e.badge.count(i.data):0,d=e.icon;return c.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(e.id),"aria-current":t?"page":void 0,className:_e(vs,n&&"pl-7",t?bm:ws),"data-testid":`document-sidebar-dashboard-${e.id}`,children:[c.jsx(d,{className:Hr}),c.jsx("span",{className:"truncate",children:e.label}),l>0&&c.jsx("span",{className:_e("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:l})]})}function WO({visibility:e}){return e==="public"?c.jsx(LN,{className:"h-3 w-3 shrink-0 text-green-600","aria-label":"Public"}):e==="org"?c.jsx(hN,{className:"h-3 w-3 shrink-0 text-blue-600","aria-label":"Organization"}):c.jsx(ZN,{className:"h-3 w-3 shrink-0 opacity-60","aria-label":"Private"})}const qO={overview:Jw,review:CN};function KO({nestId:e,isOwner:t,isAdmin:n,workflowPlaneEnabled:s,activeView:i,onOpen:l,onConnect:d}){var q,V,D,$,F;const f=IP(e),g=m.useMemo(()=>{var re;const I=f.data;return I?wp({roles:I.roles??[],permission:I.permission??null,myStewards:I.myStewards??[],isOwner:t,isAdmin:n,readerMode:!!((re=I.nest)!=null&&re.reader_mode),isArchived:DP(I.nest)}):null},[f.data,t,n]),y=Wr({...Bt.reviewQueue(e),enabled:!!g&&!g.isReadOnly&&!g.isReaderView}),v=((q=y.data)==null?void 0:q.total)??((D=(V=y.data)==null?void 0:V.requests)==null?void 0:D.length)??0,p=!!((F=($=f.data)==null?void 0:$.nest)!=null&&F.stewardship_enabled),x=m.useMemo(()=>g?ij(g,{workflowPlaneEnabled:s,stewardshipEnabled:p,hasPending:v>0}):[],[g,s,p,v]),[b,N]=m.useState(()=>lu(localStorage).viewsOpen),S=I=>{N(I),um(localStorage,{viewsOpen:I})},C=x.some(I=>I.group==="views"&&I.id===i),_=b||C,E=x.filter(I=>!I.group),T=x.filter(I=>I.group==="views");if(x.length===0)return null;const j=(I,re=!1)=>{const fe=I.icon??qO[I.id]??Jw,de=I.id===i;return c.jsxs("button",{type:"button",onClick:()=>l(I),"aria-current":de?"page":void 0,className:_e(vs,re&&"pl-7",de?bm:ws),"data-testid":`document-sidebar-view-${I.id}`,children:[c.jsx(fe,{className:Hr}),c.jsx("span",{className:"truncate",children:I.label}),I.id==="review"&&v>0&&c.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:`${v} awaiting review`,"data-testid":"document-sidebar-review-badge",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500","aria-hidden":!0}),v]})]},I.id)};return c.jsxs("div",{className:"mb-1 ml-2 pl-1","data-testid":"document-sidebar-views",children:[E.map(I=>j(I)),T.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>S(!_),"aria-expanded":_,className:_e(vs,ws),"data-testid":"document-sidebar-views-group",children:[_?c.jsx(Ro,{className:Hr}):c.jsx(Ya,{className:Hr}),c.jsx("span",{className:"truncate",children:"Views"})]}),_&&T.map(I=>j(I,!0))]}),d&&c.jsxs("button",{type:"button",onClick:d,className:_e(vs,ws),title:"Connect a CLI, MCP client or API caller to this nest","data-testid":"document-sidebar-connect",children:[c.jsx(dE,{className:Hr}),c.jsx("span",{className:"truncate",children:"Connect"})]})]})}function GO({nestId:e,currentNodeId:t,onOpen:n,onNewDocument:s}){var C;const[i,l]=m.useState(()=>new Map),d=m.useMemo(()=>new Set(t?oj(t):[]),[t]),f=_=>i.get(_)??!d.has(_),g=Wr(Bt.census(e)),y=m.useMemo(()=>{var _;return(((_=g.data)==null?void 0:_.census.folders)??[]).map(E=>({path:E.path,total:E.total??0}))},[g.data]),v=m.useMemo(()=>["",...y.map(E=>E.path).filter(E=>!f(E))],[y,i,d]),p=PP({queries:v.map(_=>Bt.folderNodes(e,_))}),x=p[0],b=p.flatMap(_=>{var E;return((E=_.data)==null?void 0:E.nodes)??[]}),N=b.map(_=>_.id).join("|"),S=m.useMemo(()=>sj(b),[N]);return x!=null&&x.isLoading&&g.isLoading?c.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"Loading…"}):x!=null&&x.isError?c.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&&y.length===0?c.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:"No documents yet"}):c.jsx(lj,{groups:S,known:y,indentRem:.75,isCollapsed:f,className:"ml-2 border-l border-border/60 pl-1",renderFolder:(_,{collapsed:E})=>c.jsxs("div",{className:"group flex items-center",children:[c.jsxs("button",{type:"button",onClick:()=>l(T=>new Map(T).set(_.path,!E)),className:_e(vs,ws),"aria-expanded":!E,title:_.path,children:[E?c.jsx($N,{className:Hr}):c.jsx(MN,{className:Hr}),c.jsx("span",{className:"truncate",children:_.label}),_.total>0&&c.jsx("span",{className:"ml-auto text-[10px] tabular-nums opacity-70",children:_.total})]}),s&&c.jsx("button",{type:"button",onClick:()=>s(_.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:c.jsx(tx,{className:"h-3.5 w-3.5"})})]}),renderDoc:_=>{const E=_.id===t;return c.jsxs("button",{type:"button",onClick:()=>n(_.id),"aria-current":E?"page":void 0,className:_e(vs,E?bm:ws),title:_.title,"data-testid":"document-sidebar-doc",children:[c.jsx(Jp,{className:Hr}),c.jsx("span",{className:"truncate",children:_.title||"Untitled"})]})}})}function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Bv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vn(...e){return t=>{let n=!1;const s=e.map(i=>{const l=Bv(i,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<s.length;i++){const l=s[i];typeof l=="function"?l():Bv(e[i],null)}}}}function qe(...e){return m.useCallback(vn(...e),e)}function QO(e,t){const n=m.createContext(t),s=l=>{const{children:d,...f}=l,g=m.useMemo(()=>f,Object.values(f));return c.jsx(n.Provider,{value:g,children:d})};s.displayName=e+"Provider";function i(l){const d=m.useContext(n);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,i]}function cr(e,t=[]){let n=[];function s(l,d){const f=m.createContext(d),g=n.length;n=[...n,d];const y=p=>{var _;const{scope:x,children:b,...N}=p,S=((_=x==null?void 0:x[e])==null?void 0:_[g])||f,C=m.useMemo(()=>N,Object.values(N));return c.jsx(S.Provider,{value:C,children:b})};y.displayName=l+"Provider";function v(p,x){var S;const b=((S=x==null?void 0:x[e])==null?void 0:S[g])||f,N=m.useContext(b);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[y,v]}const i=()=>{const l=n.map(d=>m.createContext(d));return function(f){const g=(f==null?void 0:f[e])||l;return m.useMemo(()=>({[`__scope${e}`]:{...f,[e]:g}}),[f,g])}};return i.scopeName=e,[s,ZO(i,...t)]}function ZO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const d=s.reduce((f,{useScope:g,scopeName:y})=>{const p=g(l)[`__scope${y}`];return{...f,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return n.scopeName=t.scopeName,n}var _t=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},YO=Qp[" useId ".trim().toString()]||(()=>{}),JO=0;function Qt(e){const[t,n]=m.useState(YO());return _t(()=>{n(s=>s??String(JO++))},[e]),e||(t?`radix-${t}`:"")}var XO=Qp[" useInsertionEffect ".trim().toString()]||_t;function Oo({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,l,d]=eA({defaultProp:t,onChange:n}),f=e!==void 0,g=f?e:i;{const v=m.useRef(e!==void 0);m.useEffect(()=>{const p=v.current;p!==f&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${f?"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.`),v.current=f},[f,s])}const y=m.useCallback(v=>{var p;if(f){const x=tA(v)?v(e):v;x!==e&&((p=d.current)==null||p.call(d,x))}else l(v)},[f,e,l,d]);return[g,y]}function eA({defaultProp:e,onChange:t}){const[n,s]=m.useState(e),i=m.useRef(n),l=m.useRef(t);return XO(()=>{l.current=t},[t]),m.useEffect(()=>{var d;i.current!==n&&((d=l.current)==null||d.call(l,n),i.current=n)},[n,i]),[n,s,l]}function tA(e){return typeof e=="function"}function nA(e){const t=rA(e),n=m.forwardRef((s,i)=>{const{children:l,...d}=s,f=m.Children.toArray(l),g=f.find(sA);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function rA(e){const t=m.forwardRef((n,s)=>{const{children:i,...l}=n;if(m.isValidElement(i)){const d=aA(i),f=iA(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oA=Symbol("radix.slottable");function sA(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oA}function iA(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function aA(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=lA.reduce((e,t)=>{const n=nA(`Primitive.${t}`),s=m.forwardRef((i,l)=>{const{asChild:d,...f}=i,g=d?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...f,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function m0(e,t){e&&Za.flushSync(()=>e.dispatchEvent(t))}function Dt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function cA(e,t=globalThis==null?void 0:globalThis.document){const n=Dt(e);m.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var uA="DismissableLayer",Ep="dismissableLayer.update",dA="dismissableLayer.pointerDownOutside",fA="dismissableLayer.focusOutside",Vv,h0=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:d,onDismiss:f,...g}=e,y=m.useContext(h0),[v,p]=m.useState(null),x=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),N=qe(t,D=>p(D)),S=Array.from(y.layers),[C]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),_=S.indexOf(C),E=v?S.indexOf(v):-1,T=y.layersWithOutsidePointerEventsDisabled.size>0,j=E>=_,q=hA(D=>{const $=D.target,F=[...y.branches].some(I=>I.contains($));!j||F||(i==null||i(D),d==null||d(D),D.defaultPrevented||f==null||f())},x),V=gA(D=>{const $=D.target;[...y.branches].some(I=>I.contains($))||(l==null||l(D),d==null||d(D),D.defaultPrevented||f==null||f())},x);return cA(D=>{E===y.layers.size-1&&(s==null||s(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},x),m.useEffect(()=>{if(v)return n&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Vv=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Hv(),()=>{n&&y.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Vv)}},[v,x,n,y]),m.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Hv())},[v,y]),m.useEffect(()=>{const D=()=>b({});return document.addEventListener(Ep,D),()=>document.removeEventListener(Ep,D)},[]),c.jsx(Ae.div,{...g,ref:N,style:{pointerEvents:T?j?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,V.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,q.onPointerDownCapture)})});pu.displayName=uA;var pA="DismissableLayerBranch",mA=m.forwardRef((e,t)=>{const n=m.useContext(h0),s=m.useRef(null),i=qe(t,s);return m.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),c.jsx(Ae.div,{...e,ref:i})});mA.displayName=pA;function hA(e,t=globalThis==null?void 0:globalThis.document){const n=Dt(e),s=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const l=f=>{if(f.target&&!s.current){let g=function(){g0(dA,n,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=g,t.addEventListener("click",i.current,{once:!0})):g()}else t.removeEventListener("click",i.current);s.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function gA(e,t=globalThis==null?void 0:globalThis.document){const n=Dt(e),s=m.useRef(!1);return m.useEffect(()=>{const i=l=>{l.target&&!s.current&&g0(fA,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Hv(){const e=new CustomEvent(Ep);document.dispatchEvent(e)}function g0(e,t,n,{discrete:s}){const i=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?m0(i,l):i.dispatchEvent(l)}var Af="focusScope.autoFocusOnMount",Mf="focusScope.autoFocusOnUnmount",Wv={bubbles:!1,cancelable:!0},yA="FocusScope",mu=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...d}=e,[f,g]=m.useState(null),y=Dt(i),v=Dt(l),p=m.useRef(null),x=qe(t,S=>g(S)),b=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let S=function(T){if(b.paused||!f)return;const j=T.target;f.contains(j)?p.current=j:wo(p.current,{select:!0})},C=function(T){if(b.paused||!f)return;const j=T.relatedTarget;j!==null&&(f.contains(j)||wo(p.current,{select:!0}))},_=function(T){if(document.activeElement===document.body)for(const q of T)q.removedNodes.length>0&&wo(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(_);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[s,f,b.paused]),m.useEffect(()=>{if(f){Kv.add(b);const S=document.activeElement;if(!f.contains(S)){const _=new CustomEvent(Af,Wv);f.addEventListener(Af,y),f.dispatchEvent(_),_.defaultPrevented||(vA(kA(y0(f)),{select:!0}),document.activeElement===S&&wo(f))}return()=>{f.removeEventListener(Af,y),setTimeout(()=>{const _=new CustomEvent(Mf,Wv);f.addEventListener(Mf,v),f.dispatchEvent(_),_.defaultPrevented||wo(S??document.body,{select:!0}),f.removeEventListener(Mf,v),Kv.remove(b)},0)}}},[f,y,v,b]);const N=m.useCallback(S=>{if(!n&&!s||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(C&&_){const E=S.currentTarget,[T,j]=wA(E);T&&j?!S.shiftKey&&_===j?(S.preventDefault(),n&&wo(T,{select:!0})):S.shiftKey&&_===T&&(S.preventDefault(),n&&wo(j,{select:!0})):_===E&&S.preventDefault()}},[n,s,b.paused]);return c.jsx(Ae.div,{tabIndex:-1,...d,ref:x,onKeyDown:N})});mu.displayName=yA;function vA(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(wo(s,{select:t}),document.activeElement!==n)return}function wA(e){const t=y0(e),n=qv(t,e),s=qv(t.reverse(),e);return[n,s]}function y0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qv(e,t){for(const n of e)if(!xA(n,{upTo:t}))return n}function xA(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 bA(e){return e instanceof HTMLInputElement&&"select"in e}function wo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bA(e)&&t&&e.select()}}var Kv=SA();function SA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Gv(e,t),e.unshift(t)},remove(t){var n;e=Gv(e,t),(n=e[0])==null||n.resume()}}}function Gv(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function kA(e){return e.filter(t=>t.tagName!=="A")}var _A="Portal",hu=m.forwardRef((e,t)=>{var f;const{container:n,...s}=e,[i,l]=m.useState(!1);_t(()=>l(!0),[]);const d=n||i&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return d?qw.createPortal(c.jsx(Ae.div,{...s,ref:t}),d):null});hu.displayName=_A;function CA(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var wn=e=>{const{present:t,children:n}=e,s=NA(t),i=typeof n=="function"?n({present:s.isPresent}):m.Children.only(n),l=qe(s.ref,EA(i));return typeof n=="function"||s.isPresent?m.cloneElement(i,{ref:l}):null};wn.displayName="Presence";function NA(e){const[t,n]=m.useState(),s=m.useRef(null),i=m.useRef(e),l=m.useRef("none"),d=e?"mounted":"unmounted",[f,g]=CA(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const y=Sc(s.current);l.current=f==="mounted"?y:"none"},[f]),_t(()=>{const y=s.current,v=i.current;if(v!==e){const x=l.current,b=Sc(y);e?g("MOUNT"):b==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,g]),_t(()=>{if(t){let y;const v=t.ownerDocument.defaultView??window,p=b=>{const S=Sc(s.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(g("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",y=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=b=>{b.target===t&&(l.current=Sc(s.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{v.clearTimeout(y),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else g("ANIMATION_END")},[t,g]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:m.useCallback(y=>{s.current=y?getComputedStyle(y):null,n(y)},[])}}function Sc(e){return(e==null?void 0:e.animationName)||"none"}function EA(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var If=0;function Sm(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qv()),document.body.insertAdjacentElement("beforeend",e[1]??Qv()),If++,()=>{If===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),If--}},[])}function Qv(){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 _r=function(){return _r=Object.assign||function(t){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},_r.apply(this,arguments)};function v0(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n}function PA(e,t,n){if(n||arguments.length===2)for(var s=0,i=t.length,l;s<i;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var Rc="right-scroll-bar-position",Oc="width-before-scroll-bar",jA="with-scroll-bars-hidden",TA="--removed-body-scroll-bar-size";function $f(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function RA(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=t,n.facade}var OA=typeof window<"u"?m.useLayoutEffect:m.useEffect,Zv=new WeakMap;function AA(e,t){var n=RA(null,function(s){return e.forEach(function(i){return $f(i,s)})});return OA(function(){var s=Zv.get(n);if(s){var i=new Set(s),l=new Set(e),d=n.current;i.forEach(function(f){l.has(f)||$f(f,null)}),l.forEach(function(f){i.has(f)||$f(f,d)})}Zv.set(n,e)},[e]),n}function MA(e){return e}function IA(e,t){t===void 0&&(t=MA);var n=[],s=!1,i={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var d=t(l,s);return n.push(d),function(){n=n.filter(function(f){return f!==d})}},assignSyncMedium:function(l){for(s=!0;n.length;){var d=n;n=[],d.forEach(l)}n={push:function(f){return l(f)},filter:function(){return n}}},assignMedium:function(l){s=!0;var d=[];if(n.length){var f=n;n=[],f.forEach(l),d=n}var g=function(){var v=d;d=[],v.forEach(l)},y=function(){return Promise.resolve().then(g)};y(),n={push:function(v){d.push(v),y()},filter:function(v){return d=d.filter(v),n}}}};return i}function $A(e){e===void 0&&(e={});var t=IA(null);return t.options=_r({async:!0,ssr:!1},e),t}var w0=function(e){var t=e.sideCar,n=v0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,_r({},n))};w0.isSideCarExport=!0;function DA(e,t){return e.useMedium(t),w0}var x0=$A(),Df=function(){},gu=m.forwardRef(function(e,t){var n=m.useRef(null),s=m.useState({onScrollCapture:Df,onWheelCapture:Df,onTouchMoveCapture:Df}),i=s[0],l=s[1],d=e.forwardProps,f=e.children,g=e.className,y=e.removeScrollBar,v=e.enabled,p=e.shards,x=e.sideCar,b=e.noRelative,N=e.noIsolation,S=e.inert,C=e.allowPinchZoom,_=e.as,E=_===void 0?"div":_,T=e.gapMode,j=v0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),q=x,V=AA([n,t]),D=_r(_r({},j),i);return m.createElement(m.Fragment,null,v&&m.createElement(q,{sideCar:x0,removeScrollBar:y,shards:p,noRelative:b,noIsolation:N,inert:S,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:T}),d?m.cloneElement(m.Children.only(f),_r(_r({},D),{ref:V})):m.createElement(E,_r({},D,{className:g,ref:V}),f))});gu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gu.classNames={fullWidth:Oc,zeroRight:Rc};var LA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=LA();return t&&e.setAttribute("nonce",t),e}function FA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var BA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zA())&&(FA(t,n),UA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VA=function(){var e=BA();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},b0=function(){var e=VA(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},HA={left:0,top:0,right:0,gap:0},Lf=function(e){return parseInt(e||"",10)||0},WA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Lf(n),Lf(s),Lf(i)]},qA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return HA;var t=WA(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},KA=b0(),ui="data-scroll-locked",GA=function(e,t,n,s){var i=e.left,l=e.top,d=e.right,f=e.gap;return n===void 0&&(n="margin"),`
344
- .`.concat(jA,` {
345
- overflow: hidden `).concat(s,`;
346
- padding-right: `).concat(f,"px ").concat(s,`;
347
- }
348
- body[`).concat(ui,`] {
349
- overflow: hidden `).concat(s,`;
350
- overscroll-behavior: contain;
351
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
352
- padding-left: `.concat(i,`px;
353
- padding-top: `).concat(l,`px;
354
- padding-right: `).concat(d,`px;
355
- margin-left:0;
356
- margin-top:0;
357
- margin-right: `).concat(f,"px ").concat(s,`;
358
- `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(s,";")].filter(Boolean).join(""),`
359
- }
360
-
361
- .`).concat(Rc,` {
362
- right: `).concat(f,"px ").concat(s,`;
363
- }
364
-
365
- .`).concat(Oc,` {
366
- margin-right: `).concat(f,"px ").concat(s,`;
367
- }
368
-
369
- .`).concat(Rc," .").concat(Rc,` {
370
- right: 0 `).concat(s,`;
371
- }
372
-
373
- .`).concat(Oc," .").concat(Oc,` {
374
- margin-right: 0 `).concat(s,`;
375
- }
376
-
377
- body[`).concat(ui,`] {
378
- `).concat(TA,": ").concat(f,`px;
379
- }
380
- `)},Yv=function(){var e=parseInt(document.body.getAttribute(ui)||"0",10);return isFinite(e)?e:0},QA=function(){m.useEffect(function(){return document.body.setAttribute(ui,(Yv()+1).toString()),function(){var e=Yv()-1;e<=0?document.body.removeAttribute(ui):document.body.setAttribute(ui,e.toString())}},[])},ZA=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;QA();var l=m.useMemo(function(){return qA(i)},[i]);return m.createElement(KA,{styles:GA(l,!t,i,n?"":"!important")})},Pp=!1;if(typeof window<"u")try{var kc=Object.defineProperty({},"passive",{get:function(){return Pp=!0,!0}});window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{Pp=!1}var ni=Pp?{passive:!1}:!1,YA=function(e){return e.tagName==="TEXTAREA"},S0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YA(e)&&n[t]==="visible")},JA=function(e){return S0(e,"overflowY")},XA=function(e){return S0(e,"overflowX")},Jv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=k0(e,s);if(i){var l=_0(e,s),d=l[1],f=l[2];if(d>f)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},eM=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},tM=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},k0=function(e,t){return e==="v"?JA(t):XA(t)},_0=function(e,t){return e==="v"?eM(t):tM(t)},nM=function(e,t){return e==="h"&&t==="rtl"?-1:1},rM=function(e,t,n,s,i){var l=nM(e,window.getComputedStyle(t).direction),d=l*s,f=n.target,g=t.contains(f),y=!1,v=d>0,p=0,x=0;do{if(!f)break;var b=_0(e,f),N=b[0],S=b[1],C=b[2],_=S-C-l*N;(N||_)&&k0(e,f)&&(p+=_,x+=N);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!g&&f!==document.body||g&&(t.contains(f)||t===f));return(v&&Math.abs(p)<1||!v&&Math.abs(x)<1)&&(y=!0),y},_c=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xv=function(e){return[e.deltaX,e.deltaY]},ew=function(e){return e&&"current"in e?e.current:e},oM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sM=function(e){return`
381
- .block-interactivity-`.concat(e,` {pointer-events: none;}
382
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
383
- `)},iM=0,ri=[];function aM(e){var t=m.useRef([]),n=m.useRef([0,0]),s=m.useRef(),i=m.useState(iM++)[0],l=m.useState(b0)[0],d=m.useRef(e);m.useEffect(function(){d.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=PA([e.lockRef.current],(e.shards||[]).map(ew),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=m.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var _=_c(S),E=n.current,T="deltaX"in S?S.deltaX:E[0]-_[0],j="deltaY"in S?S.deltaY:E[1]-_[1],q,V=S.target,D=Math.abs(T)>Math.abs(j)?"h":"v";if("touches"in S&&D==="h"&&V.type==="range")return!1;var $=window.getSelection(),F=$&&$.anchorNode,I=F?F===V||F.contains(V):!1;if(I)return!1;var re=Jv(D,V);if(!re)return!0;if(re?q=D:(q=D==="v"?"h":"v",re=Jv(D,V)),!re)return!1;if(!s.current&&"changedTouches"in S&&(T||j)&&(s.current=q),!q)return!0;var fe=s.current||q;return rM(fe,C,S,fe==="h"?T:j)},[]),g=m.useCallback(function(S){var C=S;if(!(!ri.length||ri[ri.length-1]!==l)){var _="deltaY"in C?Xv(C):_c(C),E=t.current.filter(function(q){return q.name===C.type&&(q.target===C.target||C.target===q.shadowParent)&&oM(q.delta,_)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var T=(d.current.shards||[]).map(ew).filter(Boolean).filter(function(q){return q.contains(C.target)}),j=T.length>0?f(C,T[0]):!d.current.noIsolation;j&&C.cancelable&&C.preventDefault()}}},[]),y=m.useCallback(function(S,C,_,E){var T={name:S,delta:C,target:_,should:E,shadowParent:lM(_)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(j){return j!==T})},1)},[]),v=m.useCallback(function(S){n.current=_c(S),s.current=void 0},[]),p=m.useCallback(function(S){y(S.type,Xv(S),S.target,f(S,e.lockRef.current))},[]),x=m.useCallback(function(S){y(S.type,_c(S),S.target,f(S,e.lockRef.current))},[]);m.useEffect(function(){return ri.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",g,ni),document.addEventListener("touchmove",g,ni),document.addEventListener("touchstart",v,ni),function(){ri=ri.filter(function(S){return S!==l}),document.removeEventListener("wheel",g,ni),document.removeEventListener("touchmove",g,ni),document.removeEventListener("touchstart",v,ni)}},[]);var b=e.removeScrollBar,N=e.inert;return m.createElement(m.Fragment,null,N?m.createElement(l,{styles:sM(i)}):null,b?m.createElement(ZA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cM=DA(x0,aM);var yu=m.forwardRef(function(e,t){return m.createElement(gu,_r({},e,{ref:t,sideCar:cM}))});yu.classNames=gu.classNames;var uM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},oi=new WeakMap,Cc=new WeakMap,Nc={},zf=0,C0=function(e){return e&&(e.host||C0(e.parentNode))},dM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=C0(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fM=function(e,t,n,s){var i=dM(t,Array.isArray(e)?e:[e]);Nc[n]||(Nc[n]=new WeakMap);var l=Nc[n],d=[],f=new Set,g=new Set(i),y=function(p){!p||f.has(p)||(f.add(p),y(p.parentNode))};i.forEach(y);var v=function(p){!p||g.has(p)||Array.prototype.forEach.call(p.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(s),N=b!==null&&b!=="false",S=(oi.get(x)||0)+1,C=(l.get(x)||0)+1;oi.set(x,S),l.set(x,C),d.push(x),S===1&&N&&Cc.set(x,!0),C===1&&x.setAttribute(n,"true"),N||x.setAttribute(s,"true")}catch(_){console.error("aria-hidden: cannot operate on ",x,_)}})};return v(t),f.clear(),zf++,function(){d.forEach(function(p){var x=oi.get(p)-1,b=l.get(p)-1;oi.set(p,x),l.set(p,b),x||(Cc.has(p)||p.removeAttribute(s),Cc.delete(p)),b||p.removeAttribute(n)}),zf--,zf||(oi=new WeakMap,oi=new WeakMap,Cc=new WeakMap,Nc={})}},km=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=uM(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),fM(s,i,n,"aria-hidden")):function(){return null}};function pM(e){const t=mM(e),n=m.forwardRef((s,i)=>{const{children:l,...d}=s,f=m.Children.toArray(l),g=f.find(gM);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function mM(e){const t=m.forwardRef((n,s)=>{const{children:i,...l}=n;if(m.isValidElement(i)){const d=vM(i),f=yM(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hM=Symbol("radix.slottable");function gM(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hM}function yM(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function vM(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vu="Dialog",[N0,kF]=cr(vu),[wM,ur]=N0(vu),E0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:l,modal:d=!0}=e,f=m.useRef(null),g=m.useRef(null),[y,v]=Oo({prop:s,defaultProp:i??!1,onChange:l,caller:vu});return c.jsx(wM,{scope:t,triggerRef:f,contentRef:g,contentId:Qt(),titleId:Qt(),descriptionId:Qt(),open:y,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(p=>!p),[v]),modal:d,children:n})};E0.displayName=vu;var P0="DialogTrigger",j0=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=ur(P0,n),l=qe(t,i.triggerRef);return c.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Nm(i.open),...s,ref:l,onClick:Se(e.onClick,i.onOpenToggle)})});j0.displayName=P0;var _m="DialogPortal",[xM,T0]=N0(_m,{forceMount:void 0}),R0=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,l=ur(_m,t);return c.jsx(xM,{scope:t,forceMount:n,children:m.Children.map(s,d=>c.jsx(wn,{present:n||l.open,children:c.jsx(hu,{asChild:!0,container:i,children:d})}))})};R0.displayName=_m;var Bc="DialogOverlay",O0=m.forwardRef((e,t)=>{const n=T0(Bc,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=ur(Bc,e.__scopeDialog);return l.modal?c.jsx(wn,{present:s||l.open,children:c.jsx(SM,{...i,ref:t})}):null});O0.displayName=Bc;var bM=pM("DialogOverlay.RemoveScroll"),SM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=ur(Bc,n);return c.jsx(yu,{as:bM,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(Ae.div,{"data-state":Nm(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Ss="DialogContent",A0=m.forwardRef((e,t)=>{const n=T0(Ss,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=ur(Ss,e.__scopeDialog);return c.jsx(wn,{present:s||l.open,children:l.modal?c.jsx(kM,{...i,ref:t}):c.jsx(_M,{...i,ref:t})})});A0.displayName=Ss;var kM=m.forwardRef((e,t)=>{const n=ur(Ss,e.__scopeDialog),s=m.useRef(null),i=qe(t,n.contentRef,s);return m.useEffect(()=>{const l=s.current;if(l)return km(l)},[]),c.jsx(M0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{var d;l.preventDefault(),(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,l=>{const d=l.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&l.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault())})}),_M=m.forwardRef((e,t)=>{const n=ur(Ss,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return c.jsx(M0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var d,f;(d=e.onCloseAutoFocus)==null||d.call(e,l),l.defaultPrevented||(s.current||(f=n.triggerRef.current)==null||f.focus(),l.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:l=>{var g,y;(g=e.onInteractOutside)==null||g.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const d=l.target;((y=n.triggerRef.current)==null?void 0:y.contains(d))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),M0=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,...d}=e,f=ur(Ss,n),g=m.useRef(null),y=qe(t,g);return Sm(),c.jsxs(c.Fragment,{children:[c.jsx(mu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:l,children:c.jsx(pu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Nm(f.open),...d,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(CM,{titleId:f.titleId}),c.jsx(EM,{contentRef:g,descriptionId:f.descriptionId})]})]})}),Cm="DialogTitle",I0=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=ur(Cm,n);return c.jsx(Ae.h2,{id:i.titleId,...s,ref:t})});I0.displayName=Cm;var $0="DialogDescription",D0=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=ur($0,n);return c.jsx(Ae.p,{id:i.descriptionId,...s,ref:t})});D0.displayName=$0;var L0="DialogClose",z0=m.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=ur(L0,n);return c.jsx(Ae.button,{type:"button",...s,ref:t,onClick:Se(e.onClick,()=>i.onOpenChange(!1))})});z0.displayName=L0;function Nm(e){return e?"open":"closed"}var F0="DialogTitleWarning",[_F,U0]=QO(F0,{contentName:Ss,titleName:Cm,docsSlug:"dialog"}),CM=({titleId:e})=>{const t=U0(F0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
384
-
385
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
386
-
387
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},NM="DialogDescriptionWarning",EM=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${U0(NM).contentName}}.`;return m.useEffect(()=>{var l;const i=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},B0=E0,CF=j0,V0=R0,Em=O0,Pm=A0,H0=I0,W0=D0,PM=z0;function q0(e,t){if(e==null)return{};var n={},s=Object.keys(e),i,l;for(l=0;l<s.length;l++)i=s[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var jM=["color"],TM=m.forwardRef(function(e,t){var n=e.color,s=n===void 0?"currentColor":n,i=q0(e,jM);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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:s,fillRule:"evenodd",clipRule:"evenodd"}))}),RM=["color"],OM=m.forwardRef(function(e,t){var n=e.color,s=n===void 0?"currentColor":n,i=q0(e,RM);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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:s,fillRule:"evenodd",clipRule:"evenodd"}))});const ks=B0,AM=V0,K0=m.forwardRef(({className:e,...t},n)=>c.jsx(Em,{ref:n,className:_e("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}));K0.displayName=Em.displayName;const Ao=m.forwardRef(({className:e,children:t,hideCloseButton:n,...s},i)=>c.jsxs(AM,{children:[c.jsx(K0,{}),c.jsxs(Pm,{ref:i,className:_e("fixed left-[50%] top-[50%] z-50 grid grid-cols-[minmax(0,1fr)] 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),...s,children:[t,!n&&c.jsxs(PM,{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:[c.jsx(TM,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ao.displayName=Pm.displayName;const Mo=({className:e,...t})=>c.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Mo.displayName="DialogHeader";const wu=({className:e,...t})=>c.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});wu.displayName="DialogFooter";const Io=m.forwardRef(({className:e,...t},n)=>c.jsx(H0,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));Io.displayName=H0.displayName;const $o=m.forwardRef(({className:e,...t},n)=>c.jsx(W0,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));$o.displayName=W0.displayName;var MM=Symbol.for("react.lazy"),Vc=Qp[" use ".trim().toString()];function IM(e){return typeof e=="object"&&e!==null&&"then"in e}function G0(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===MM&&"_payload"in e&&IM(e._payload)}function jm(e){const t=DM(e),n=m.forwardRef((s,i)=>{let{children:l,...d}=s;G0(l)&&typeof Vc=="function"&&(l=Vc(l._payload));const f=m.Children.toArray(l),g=f.find(zM);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}var $M=jm("Slot");function DM(e){const t=m.forwardRef((n,s)=>{let{children:i,...l}=n;if(G0(i)&&typeof Vc=="function"&&(i=Vc(i._payload)),m.isValidElement(i)){const d=UM(i),f=FM(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LM=Symbol("radix.slottable");function zM(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LM}function FM(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function UM(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const BM=fu("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"}}),Ye=m.forwardRef(({className:e,variant:t="default",size:n="default",asChild:s=!1,...i},l)=>{const d=s?$M:"button";return c.jsx(d,{className:_e(BM({variant:t,size:n,className:e})),ref:l,...i})});Ye.displayName="Button";function VM(e,t=[]){let n=[];function s(l,d){const f=m.createContext(d);f.displayName=l+"Context";const g=n.length;n=[...n,d];const y=p=>{var _;const{scope:x,children:b,...N}=p,S=((_=x==null?void 0:x[e])==null?void 0:_[g])||f,C=m.useMemo(()=>N,Object.values(N));return c.jsx(S.Provider,{value:C,children:b})};y.displayName=l+"Provider";function v(p,x){var S;const b=((S=x==null?void 0:x[e])==null?void 0:S[g])||f,N=m.useContext(b);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[y,v]}const i=()=>{const l=n.map(d=>m.createContext(d));return function(f){const g=(f==null?void 0:f[e])||l;return m.useMemo(()=>({[`__scope${e}`]:{...f,[e]:g}}),[f,g])}};return i.scopeName=e,[s,HM(i,...t)]}function HM(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const d=s.reduce((f,{useScope:g,scopeName:y})=>{const p=g(l)[`__scope${y}`];return{...f,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return n.scopeName=t.scopeName,n}var WM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tm=WM.reduce((e,t)=>{const n=jm(`Primitive.${t}`),s=m.forwardRef((i,l)=>{const{asChild:d,...f}=i,g=d?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...f,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),Ff={exports:{}},Uf={};/**
388
- * @license React
389
- * use-sync-external-store-shim.production.js
390
- *
391
- * Copyright (c) Meta Platforms, Inc. and affiliates.
392
- *
393
- * This source code is licensed under the MIT license found in the
394
- * LICENSE file in the root directory of this source tree.
395
- */var tw;function qM(){if(tw)return Uf;tw=1;var e=ou();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,l=e.useLayoutEffect,d=e.useDebugValue;function f(p,x){var b=x(),N=s({inst:{value:b,getSnapshot:x}}),S=N[0].inst,C=N[1];return l(function(){S.value=b,S.getSnapshot=x,g(S)&&C({inst:S})},[p,b,x]),i(function(){return g(S)&&C({inst:S}),p(function(){g(S)&&C({inst:S})})},[p]),d(b),b}function g(p){var x=p.getSnapshot;p=p.value;try{var b=x();return!n(p,b)}catch{return!0}}function y(p,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return Uf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Uf}var nw;function KM(){return nw||(nw=1,Ff.exports=qM()),Ff.exports}var GM=KM();function QM(){return GM.useSyncExternalStore(ZM,()=>!0,()=>!1)}function ZM(){return()=>{}}var Rm="Avatar",[YM]=VM(Rm),[JM,Q0]=YM(Rm),Z0=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...s}=e,[i,l]=m.useState("idle");return c.jsx(JM,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:c.jsx(Tm.span,{...s,ref:t})})});Z0.displayName=Rm;var Y0="AvatarImage",J0=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...l}=e,d=Q0(Y0,n),f=XM(s,l),g=Dt(y=>{i(y),d.onImageLoadingStatusChange(y)});return _t(()=>{f!=="idle"&&g(f)},[f,g]),f==="loaded"?c.jsx(Tm.img,{...l,ref:t,src:s}):null});J0.displayName=Y0;var X0="AvatarFallback",eb=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:s,...i}=e,l=Q0(X0,n),[d,f]=m.useState(s===void 0);return m.useEffect(()=>{if(s!==void 0){const g=window.setTimeout(()=>f(!0),s);return()=>window.clearTimeout(g)}},[s]),d&&l.imageLoadingStatus!=="loaded"?c.jsx(Tm.span,{...i,ref:t}):null});eb.displayName=X0;function rw(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function XM(e,{referrerPolicy:t,crossOrigin:n}){const s=QM(),i=m.useRef(null),l=s?(i.current||(i.current=new window.Image),i.current):null,[d,f]=m.useState(()=>rw(l,e));return _t(()=>{f(rw(l,e))},[l,e]),_t(()=>{const g=p=>()=>{f(p)};if(!l)return;const y=g("loaded"),v=g("error");return l.addEventListener("load",y),l.addEventListener("error",v),t&&(l.referrerPolicy=t),typeof n=="string"&&(l.crossOrigin=n),()=>{l.removeEventListener("load",y),l.removeEventListener("error",v)}},[l,n,t]),d}var tb=Z0,nb=J0,rb=eb;const jp=m.forwardRef(({className:e,...t},n)=>c.jsx(tb,{ref:n,className:_e("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));jp.displayName=tb.displayName;const eI=m.forwardRef(({className:e,...t},n)=>c.jsx(nb,{ref:n,className:_e("aspect-square h-full w-full",e),...t}));eI.displayName=nb.displayName;const Tp=m.forwardRef(({className:e,...t},n)=>c.jsx(rb,{ref:n,className:_e("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Tp.displayName=rb.displayName;function ow(e){const t=tI(e),n=m.forwardRef((s,i)=>{const{children:l,...d}=s,f=m.Children.toArray(l),g=f.find(rI);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function tI(e){const t=m.forwardRef((n,s)=>{const{children:i,...l}=n;if(m.isValidElement(i)){const d=sI(i),f=oI(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nI=Symbol("radix.slottable");function rI(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nI}function oI(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function sI(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Om(e){const t=e+"CollectionProvider",[n,s]=cr(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:C,children:_}=S,E=me.useRef(null),T=me.useRef(new Map).current;return c.jsx(i,{scope:C,itemMap:T,collectionRef:E,children:_})};d.displayName=t;const f=e+"CollectionSlot",g=ow(f),y=me.forwardRef((S,C)=>{const{scope:_,children:E}=S,T=l(f,_),j=qe(C,T.collectionRef);return c.jsx(g,{ref:j,children:E})});y.displayName=f;const v=e+"CollectionItemSlot",p="data-radix-collection-item",x=ow(v),b=me.forwardRef((S,C)=>{const{scope:_,children:E,...T}=S,j=me.useRef(null),q=qe(C,j),V=l(v,_);return me.useEffect(()=>(V.itemMap.set(j,{ref:j,...T}),()=>void V.itemMap.delete(j))),c.jsx(x,{[p]:"",ref:q,children:E})});b.displayName=v;function N(S){const C=l(e+"CollectionConsumer",S);return me.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const T=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((V,D)=>T.indexOf(V.ref.current)-T.indexOf(D.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:y,ItemSlot:b},N,s]}var iI=m.createContext(void 0);function el(e){const t=m.useContext(iI);return e||t||"ltr"}const ob=["top","right","bottom","left"],sw=["start","end"],iw=ob.reduce((e,t)=>e.concat(t,t+"-"+sw[0],t+"-"+sw[1]),[]),sr=Math.min,Gt=Math.max,Hc=Math.round,Ec=Math.floor,Nr=e=>({x:e,y:e}),aI={left:"right",right:"left",bottom:"top",top:"bottom"};function Rp(e,t,n){return Gt(e,sr(t,n))}function ir(e,t){return typeof e=="function"?e(t):e}function Rn(e){return e.split("-")[0]}function or(e){return e.split("-")[1]}function Am(e){return e==="x"?"y":"x"}function Mm(e){return e==="y"?"height":"width"}function rr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Im(e){return Am(rr(e))}function sb(e,t,n){n===void 0&&(n=!1);const s=or(e),i=Im(e),l=Mm(i);let d=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(d=qc(d)),[d,qc(d)]}function lI(e){const t=qc(e);return[Wc(e),t,Wc(t)]}function Wc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const aw=["left","right"],lw=["right","left"],cI=["top","bottom"],uI=["bottom","top"];function dI(e,t,n){switch(e){case"top":case"bottom":return n?t?lw:aw:t?aw:lw;case"left":case"right":return t?cI:uI;default:return[]}}function fI(e,t,n,s){const i=or(e);let l=dI(Rn(e),n==="start",s);return i&&(l=l.map(d=>d+"-"+i),t&&(l=l.concat(l.map(Wc)))),l}function qc(e){const t=Rn(e);return aI[t]+e.slice(t.length)}function pI(e){return{top:0,right:0,bottom:0,left:0,...e}}function $m(e){return typeof e!="number"?pI(e):{top:e,right:e,bottom:e,left:e}}function Ti(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function cw(e,t,n){let{reference:s,floating:i}=e;const l=rr(t),d=Im(t),f=Mm(d),g=Rn(t),y=l==="y",v=s.x+s.width/2-i.width/2,p=s.y+s.height/2-i.height/2,x=s[f]/2-i[f]/2;let b;switch(g){case"top":b={x:v,y:s.y-i.height};break;case"bottom":b={x:v,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:p};break;case"left":b={x:s.x-i.width,y:p};break;default:b={x:s.x,y:s.y}}switch(or(t)){case"start":b[d]-=x*(n&&y?-1:1);break;case"end":b[d]+=x*(n&&y?-1:1);break}return b}async function mI(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:l,rects:d,elements:f,strategy:g}=e,{boundary:y="clippingAncestors",rootBoundary:v="viewport",elementContext:p="floating",altBoundary:x=!1,padding:b=0}=ir(t,e),N=$m(b),C=f[x?p==="floating"?"reference":"floating":p],_=Ti(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:y,rootBoundary:v,strategy:g})),E=p==="floating"?{x:s,y:i,width:d.floating.width,height:d.floating.height}:d.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),j=await(l.isElement==null?void 0:l.isElement(T))?await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1}:{x:1,y:1},q=Ti(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:T,strategy:g}):E);return{top:(_.top-q.top+N.top)/j.y,bottom:(q.bottom-_.bottom+N.bottom)/j.y,left:(_.left-q.left+N.left)/j.x,right:(q.right-_.right+N.right)/j.x}}const hI=50,gI=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:l=[],platform:d}=n,f=d.detectOverflow?d:{...d,detectOverflow:mI},g=await(d.isRTL==null?void 0:d.isRTL(t));let y=await d.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:p}=cw(y,s,g),x=s,b=0;const N={};for(let S=0;S<l.length;S++){const C=l[S];if(!C)continue;const{name:_,fn:E}=C,{x:T,y:j,data:q,reset:V}=await E({x:v,y:p,initialPlacement:s,placement:x,strategy:i,middlewareData:N,rects:y,platform:f,elements:{reference:e,floating:t}});v=T??v,p=j??p,N[_]={...N[_],...q},V&&b<hI&&(b++,typeof V=="object"&&(V.placement&&(x=V.placement),V.rects&&(y=V.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:i}):V.rects),{x:v,y:p}=cw(y,x,g)),S=-1)}return{x:v,y:p,placement:x,strategy:i,middlewareData:N}},yI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:l,platform:d,elements:f,middlewareData:g}=t,{element:y,padding:v=0}=ir(e,t)||{};if(y==null)return{};const p=$m(v),x={x:n,y:s},b=Im(i),N=Mm(b),S=await d.getDimensions(y),C=b==="y",_=C?"top":"left",E=C?"bottom":"right",T=C?"clientHeight":"clientWidth",j=l.reference[N]+l.reference[b]-x[b]-l.floating[N],q=x[b]-l.reference[b],V=await(d.getOffsetParent==null?void 0:d.getOffsetParent(y));let D=V?V[T]:0;(!D||!await(d.isElement==null?void 0:d.isElement(V)))&&(D=f.floating[T]||l.floating[N]);const $=j/2-q/2,F=D/2-S[N]/2-1,I=sr(p[_],F),re=sr(p[E],F),fe=I,de=D-S[N]-re,ge=D/2-S[N]/2+$,ce=Rp(fe,ge,de),te=!g.arrow&&or(i)!=null&&ge!==ce&&l.reference[N]/2-(ge<fe?I:re)-S[N]/2<0,ie=te?ge<fe?ge-fe:ge-de:0;return{[b]:x[b]+ie,data:{[b]:ce,centerOffset:ge-ce-ie,...te&&{alignmentOffset:ie}},reset:te}}});function vI(e,t,n){return(e?[...n.filter(i=>or(i)===e),...n.filter(i=>or(i)!==e)]:n.filter(i=>Rn(i)===i)).filter(i=>e?or(i)===e||(t?Wc(i)!==i:!1):!0)}const wI=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,s,i;const{rects:l,middlewareData:d,placement:f,platform:g,elements:y}=t,{crossAxis:v=!1,alignment:p,allowedPlacements:x=iw,autoAlignment:b=!0,...N}=ir(e,t),S=p!==void 0||x===iw?vI(p||null,b,x):x,C=await g.detectOverflow(t,N),_=((n=d.autoPlacement)==null?void 0:n.index)||0,E=S[_];if(E==null)return{};const T=sb(E,l,await(g.isRTL==null?void 0:g.isRTL(y.floating)));if(f!==E)return{reset:{placement:S[0]}};const j=[C[Rn(E)],C[T[0]],C[T[1]]],q=[...((s=d.autoPlacement)==null?void 0:s.overflows)||[],{placement:E,overflows:j}],V=S[_+1];if(V)return{data:{index:_+1,overflows:q},reset:{placement:V}};const D=q.map(I=>{const re=or(I.placement);return[I.placement,re&&v?I.overflows.slice(0,2).reduce((fe,de)=>fe+de,0):I.overflows[0],I.overflows]}).sort((I,re)=>I[1]-re[1]),F=((i=D.filter(I=>I[2].slice(0,or(I[0])?2:3).every(re=>re<=0))[0])==null?void 0:i[0])||D[0][0];return F!==f?{data:{index:_+1,overflows:q},reset:{placement:F}}:{}}}},xI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:l,rects:d,initialPlacement:f,platform:g,elements:y}=t,{mainAxis:v=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:S=!0,...C}=ir(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const _=Rn(i),E=rr(f),T=Rn(f)===f,j=await(g.isRTL==null?void 0:g.isRTL(y.floating)),q=x||(T||!S?[qc(f)]:lI(f)),V=N!=="none";!x&&V&&q.push(...fI(f,S,N,j));const D=[f,...q],$=await g.detectOverflow(t,C),F=[];let I=((s=l.flip)==null?void 0:s.overflows)||[];if(v&&F.push($[_]),p){const ge=sb(i,d,j);F.push($[ge[0]],$[ge[1]])}if(I=[...I,{placement:i,overflows:F}],!F.every(ge=>ge<=0)){var re,fe;const ge=(((re=l.flip)==null?void 0:re.index)||0)+1,ce=D[ge];if(ce&&(!(p==="alignment"?E!==rr(ce):!1)||I.every(G=>rr(G.placement)===E?G.overflows[0]>0:!0)))return{data:{index:ge,overflows:I},reset:{placement:ce}};let te=(fe=I.filter(ie=>ie.overflows[0]<=0).sort((ie,G)=>ie.overflows[1]-G.overflows[1])[0])==null?void 0:fe.placement;if(!te)switch(b){case"bestFit":{var de;const ie=(de=I.filter(G=>{if(V){const Z=rr(G.placement);return Z===E||Z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Z=>Z>0).reduce((Z,U)=>Z+U,0)]).sort((G,Z)=>G[1]-Z[1])[0])==null?void 0:de[0];ie&&(te=ie);break}case"initialPlacement":te=f;break}if(i!==te)return{reset:{placement:te}}}return{}}}};function uw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dw(e){return ob.some(t=>e[t]>=0)}const bI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...l}=ir(e,t);switch(i){case"referenceHidden":{const d=await s.detectOverflow(t,{...l,elementContext:"reference"}),f=uw(d,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:dw(f)}}}case"escaped":{const d=await s.detectOverflow(t,{...l,altBoundary:!0}),f=uw(d,n.floating);return{data:{escapedOffsets:f,escaped:dw(f)}}}default:return{}}}}};function ib(e){const t=sr(...e.map(l=>l.left)),n=sr(...e.map(l=>l.top)),s=Gt(...e.map(l=>l.right)),i=Gt(...e.map(l=>l.bottom));return{x:t,y:n,width:s-t,height:i-n}}function SI(e){const t=e.slice().sort((i,l)=>i.y-l.y),n=[];let s=null;for(let i=0;i<t.length;i++){const l=t[i];!s||l.y-s.y>s.height/2?n.push([l]):n[n.length-1].push(l),s=l}return n.map(i=>Ti(ib(i)))}const kI=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:s,rects:i,platform:l,strategy:d}=t,{padding:f=2,x:g,y}=ir(e,t),v=Array.from(await(l.getClientRects==null?void 0:l.getClientRects(s.reference))||[]),p=SI(v),x=Ti(ib(v)),b=$m(f);function N(){if(p.length===2&&p[0].left>p[1].right&&g!=null&&y!=null)return p.find(C=>g>C.left-b.left&&g<C.right+b.right&&y>C.top-b.top&&y<C.bottom+b.bottom)||x;if(p.length>=2){if(rr(n)==="y"){const I=p[0],re=p[p.length-1],fe=Rn(n)==="top",de=I.top,ge=re.bottom,ce=fe?I.left:re.left,te=fe?I.right:re.right,ie=te-ce,G=ge-de;return{top:de,bottom:ge,left:ce,right:te,width:ie,height:G,x:ce,y:de}}const C=Rn(n)==="left",_=Gt(...p.map(I=>I.right)),E=sr(...p.map(I=>I.left)),T=p.filter(I=>C?I.left===E:I.right===_),j=T[0].top,q=T[T.length-1].bottom,V=E,D=_,$=D-V,F=q-j;return{top:j,bottom:q,left:V,right:D,width:$,height:F,x:V,y:j}}return x}const S=await l.getElementRects({reference:{getBoundingClientRect:N},floating:s.floating,strategy:d});return i.reference.x!==S.reference.x||i.reference.y!==S.reference.y||i.reference.width!==S.reference.width||i.reference.height!==S.reference.height?{reset:{rects:S}}:{}}}},ab=new Set(["left","top"]);async function _I(e,t){const{placement:n,platform:s,elements:i}=e,l=await(s.isRTL==null?void 0:s.isRTL(i.floating)),d=Rn(n),f=or(n),g=rr(n)==="y",y=ab.has(d)?-1:1,v=l&&g?-1:1,p=ir(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:N}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&typeof N=="number"&&(b=f==="end"?N*-1:N),g?{x:b*v,y:x*y}:{x:x*y,y:b*v}}const CI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:l,placement:d,middlewareData:f}=t,g=await _I(t,e);return d===((n=f.offset)==null?void 0:n.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:i+g.x,y:l+g.y,data:{...g,placement:d}}}}},NI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:l}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:g={fn:_=>{let{x:E,y:T}=_;return{x:E,y:T}}},...y}=ir(e,t),v={x:n,y:s},p=await l.detectOverflow(t,y),x=rr(Rn(i)),b=Am(x);let N=v[b],S=v[x];if(d){const _=b==="y"?"top":"left",E=b==="y"?"bottom":"right",T=N+p[_],j=N-p[E];N=Rp(T,N,j)}if(f){const _=x==="y"?"top":"left",E=x==="y"?"bottom":"right",T=S+p[_],j=S-p[E];S=Rp(T,S,j)}const C=g.fn({...t,[b]:N,[x]:S});return{...C,data:{x:C.x-n,y:C.y-s,enabled:{[b]:d,[x]:f}}}}}},EI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:l,middlewareData:d}=t,{offset:f=0,mainAxis:g=!0,crossAxis:y=!0}=ir(e,t),v={x:n,y:s},p=rr(i),x=Am(p);let b=v[x],N=v[p];const S=ir(f,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(g){const T=x==="y"?"height":"width",j=l.reference[x]-l.floating[T]+C.mainAxis,q=l.reference[x]+l.reference[T]-C.mainAxis;b<j?b=j:b>q&&(b=q)}if(y){var _,E;const T=x==="y"?"width":"height",j=ab.has(Rn(i)),q=l.reference[p]-l.floating[T]+(j&&((_=d.offset)==null?void 0:_[p])||0)+(j?0:C.crossAxis),V=l.reference[p]+l.reference[T]+(j?0:((E=d.offset)==null?void 0:E[p])||0)-(j?C.crossAxis:0);N<q?N=q:N>V&&(N=V)}return{[x]:b,[p]:N}}}},PI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:l,platform:d,elements:f}=t,{apply:g=()=>{},...y}=ir(e,t),v=await d.detectOverflow(t,y),p=Rn(i),x=or(i),b=rr(i)==="y",{width:N,height:S}=l.floating;let C,_;p==="top"||p==="bottom"?(C=p,_=x===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(_=p,C=x==="end"?"top":"bottom");const E=S-v.top-v.bottom,T=N-v.left-v.right,j=sr(S-v[C],E),q=sr(N-v[_],T),V=!t.middlewareData.shift;let D=j,$=q;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&($=T),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(D=E),V&&!x){const I=Gt(v.left,0),re=Gt(v.right,0),fe=Gt(v.top,0),de=Gt(v.bottom,0);b?$=N-2*(I!==0||re!==0?I+re:Gt(v.left,v.right)):D=S-2*(fe!==0||de!==0?fe+de:Gt(v.top,v.bottom))}await g({...t,availableWidth:$,availableHeight:D});const F=await d.getDimensions(f.floating);return N!==F.width||S!==F.height?{reset:{rects:!0}}:{}}}};function xu(){return typeof window<"u"}function Di(e){return lb(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(lb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lb(e){return xu()?e instanceof Node||e instanceof Tn(e).Node:!1}function ar(e){return xu()?e instanceof Element||e instanceof Tn(e).Element:!1}function qr(e){return xu()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function fw(e){return!xu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function tl(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&i!=="inline"&&i!=="contents"}function jI(e){return/^(table|td|th)$/.test(Di(e))}function bu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const TI=/transform|translate|scale|rotate|perspective|filter/,RI=/paint|layout|strict|content/,os=e=>!!e&&e!=="none";let Bf;function Dm(e){const t=ar(e)?lr(e):e;return os(t.transform)||os(t.translate)||os(t.scale)||os(t.rotate)||os(t.perspective)||!Lm()&&(os(t.backdropFilter)||os(t.filter))||TI.test(t.willChange||"")||RI.test(t.contain||"")}function OI(e){let t=Do(e);for(;qr(t)&&!Ri(t);){if(Dm(t))return t;if(bu(t))return null;t=Do(t)}return null}function Lm(){return Bf==null&&(Bf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bf}function Ri(e){return/^(html|body|#document)$/.test(Di(e))}function lr(e){return Tn(e).getComputedStyle(e)}function Su(e){return ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Do(e){if(Di(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fw(e)&&e.host||Pr(e);return fw(t)?t.host:t}function cb(e){const t=Do(e);return Ri(t)?e.ownerDocument?e.ownerDocument.body:e.body:qr(t)&&tl(t)?t:cb(t)}function La(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=cb(e),l=i===((s=e.ownerDocument)==null?void 0:s.body),d=Tn(i);if(l){const f=Op(d);return t.concat(d,d.visualViewport||[],tl(i)?i:[],f&&n?La(f):[])}else return t.concat(i,La(i,[],n))}function Op(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ub(e){const t=lr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=qr(e),l=i?e.offsetWidth:n,d=i?e.offsetHeight:s,f=Hc(n)!==l||Hc(s)!==d;return f&&(n=l,s=d),{width:n,height:s,$:f}}function zm(e){return ar(e)?e:e.contextElement}function di(e){const t=zm(e);if(!qr(t))return Nr(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:l}=ub(t);let d=(l?Hc(n.width):n.width)/s,f=(l?Hc(n.height):n.height)/i;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const AI=Nr(0);function db(e){const t=Tn(e);return!Lm()||!t.visualViewport?AI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function _s(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=zm(e);let d=Nr(1);t&&(s?ar(s)&&(d=di(s)):d=di(e));const f=MI(l,n,s)?db(l):Nr(0);let g=(i.left+f.x)/d.x,y=(i.top+f.y)/d.y,v=i.width/d.x,p=i.height/d.y;if(l){const x=Tn(l),b=s&&ar(s)?Tn(s):s;let N=x,S=Op(N);for(;S&&s&&b!==N;){const C=di(S),_=S.getBoundingClientRect(),E=lr(S),T=_.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,j=_.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;g*=C.x,y*=C.y,v*=C.x,p*=C.y,g+=T,y+=j,N=Tn(S),S=Op(N)}}return Ti({width:v,height:p,x:g,y})}function ku(e,t){const n=Su(e).scrollLeft;return t?t.left+n:_s(Pr(e)).left+n}function fb(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ku(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function II(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const l=i==="fixed",d=Pr(s),f=t?bu(t.floating):!1;if(s===d||f&&l)return n;let g={scrollLeft:0,scrollTop:0},y=Nr(1);const v=Nr(0),p=qr(s);if((p||!p&&!l)&&((Di(s)!=="body"||tl(d))&&(g=Su(s)),p)){const b=_s(s);y=di(s),v.x=b.x+s.clientLeft,v.y=b.y+s.clientTop}const x=d&&!p&&!l?fb(d,g):Nr(0);return{width:n.width*y.x,height:n.height*y.y,x:n.x*y.x-g.scrollLeft*y.x+v.x+x.x,y:n.y*y.y-g.scrollTop*y.y+v.y+x.y}}function $I(e){return Array.from(e.getClientRects())}function DI(e){const t=Pr(e),n=Su(e),s=e.ownerDocument.body,i=Gt(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=Gt(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let d=-n.scrollLeft+ku(e);const f=-n.scrollTop;return lr(s).direction==="rtl"&&(d+=Gt(t.clientWidth,s.clientWidth)-i),{width:i,height:l,x:d,y:f}}const pw=25;function LI(e,t){const n=Tn(e),s=Pr(e),i=n.visualViewport;let l=s.clientWidth,d=s.clientHeight,f=0,g=0;if(i){l=i.width,d=i.height;const v=Lm();(!v||v&&t==="fixed")&&(f=i.offsetLeft,g=i.offsetTop)}const y=ku(s);if(y<=0){const v=s.ownerDocument,p=v.body,x=getComputedStyle(p),b=v.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,N=Math.abs(s.clientWidth-p.clientWidth-b);N<=pw&&(l-=N)}else y<=pw&&(l+=y);return{width:l,height:d,x:f,y:g}}function zI(e,t){const n=_s(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,l=qr(e)?di(e):Nr(1),d=e.clientWidth*l.x,f=e.clientHeight*l.y,g=i*l.x,y=s*l.y;return{width:d,height:f,x:g,y}}function mw(e,t,n){let s;if(t==="viewport")s=LI(e,n);else if(t==="document")s=DI(Pr(e));else if(ar(t))s=zI(t,n);else{const i=db(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ti(s)}function pb(e,t){const n=Do(e);return n===t||!ar(n)||Ri(n)?!1:lr(n).position==="fixed"||pb(n,t)}function FI(e,t){const n=t.get(e);if(n)return n;let s=La(e,[],!1).filter(f=>ar(f)&&Di(f)!=="body"),i=null;const l=lr(e).position==="fixed";let d=l?Do(e):e;for(;ar(d)&&!Ri(d);){const f=lr(d),g=Dm(d);!g&&f.position==="fixed"&&(i=null),(l?!g&&!i:!g&&f.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||tl(d)&&!g&&pb(e,d))?s=s.filter(v=>v!==d):i=f,d=Do(d)}return t.set(e,s),s}function UI(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const d=[...n==="clippingAncestors"?bu(t)?[]:FI(t,this._c):[].concat(n),s],f=mw(t,d[0],i);let g=f.top,y=f.right,v=f.bottom,p=f.left;for(let x=1;x<d.length;x++){const b=mw(t,d[x],i);g=Gt(b.top,g),y=sr(b.right,y),v=sr(b.bottom,v),p=Gt(b.left,p)}return{width:y-p,height:v-g,x:p,y:g}}function BI(e){const{width:t,height:n}=ub(e);return{width:t,height:n}}function VI(e,t,n){const s=qr(t),i=Pr(t),l=n==="fixed",d=_s(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const g=Nr(0);function y(){g.x=ku(i)}if(s||!s&&!l)if((Di(t)!=="body"||tl(i))&&(f=Su(t)),s){const b=_s(t,!0,l,t);g.x=b.x+t.clientLeft,g.y=b.y+t.clientTop}else i&&y();l&&!s&&i&&y();const v=i&&!s&&!l?fb(i,f):Nr(0),p=d.left+f.scrollLeft-g.x-v.x,x=d.top+f.scrollTop-g.y-v.y;return{x:p,y:x,width:d.width,height:d.height}}function Vf(e){return lr(e).position==="static"}function hw(e,t){if(!qr(e)||lr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function mb(e,t){const n=Tn(e);if(bu(e))return n;if(!qr(e)){let i=Do(e);for(;i&&!Ri(i);){if(ar(i)&&!Vf(i))return i;i=Do(i)}return n}let s=hw(e,t);for(;s&&jI(s)&&Vf(s);)s=hw(s,t);return s&&Ri(s)&&Vf(s)&&!Dm(s)?n:s||OI(e)||n}const HI=async function(e){const t=this.getOffsetParent||mb,n=this.getDimensions,s=await n(e.floating);return{reference:VI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function WI(e){return lr(e).direction==="rtl"}const qI={convertOffsetParentRelativeRectToViewportRelativeRect:II,getDocumentElement:Pr,getClippingRect:UI,getOffsetParent:mb,getElementRects:HI,getClientRects:$I,getDimensions:BI,getScale:di,isElement:ar,isRTL:WI};function hb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KI(e,t){let n=null,s;const i=Pr(e);function l(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function d(f,g){f===void 0&&(f=!1),g===void 0&&(g=1),l();const y=e.getBoundingClientRect(),{left:v,top:p,width:x,height:b}=y;if(f||t(),!x||!b)return;const N=Ec(p),S=Ec(i.clientWidth-(v+x)),C=Ec(i.clientHeight-(p+b)),_=Ec(v),T={rootMargin:-N+"px "+-S+"px "+-C+"px "+-_+"px",threshold:Gt(0,sr(1,g))||1};let j=!0;function q(V){const D=V[0].intersectionRatio;if(D!==g){if(!j)return d();D?d(!1,D):s=setTimeout(()=>{d(!1,1e-7)},1e3)}D===1&&!hb(y,e.getBoundingClientRect())&&d(),j=!1}try{n=new IntersectionObserver(q,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(q,T)}n.observe(e)}return d(!0),l}function GI(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:g=!1}=s,y=zm(e),v=i||l?[...y?La(y):[],...t?La(t):[]]:[];v.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),l&&_.addEventListener("resize",n)});const p=y&&f?KI(y,n):null;let x=-1,b=null;d&&(b=new ResizeObserver(_=>{let[E]=_;E&&E.target===y&&b&&t&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),y&&!g&&b.observe(y),t&&b.observe(t));let N,S=g?_s(e):null;g&&C();function C(){const _=_s(e);S&&!hb(S,_)&&n(),S=_,N=requestAnimationFrame(C)}return n(),()=>{var _;v.forEach(E=>{i&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),p==null||p(),(_=b)==null||_.disconnect(),b=null,g&&cancelAnimationFrame(N)}}const QI=CI,NF=wI,ZI=NI,YI=xI,JI=PI,XI=bI,gw=yI,EF=kI,e$=EI,t$=(e,t,n)=>{const s=new Map,i={platform:qI,...n},l={...i.platform,_c:s};return gI(e,t,{...i,platform:l})};var n$=typeof document<"u",r$=function(){},Ac=n$?m.useLayoutEffect:r$;function Kc(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 n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Kc(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const l=i[s];if(!(l==="_owner"&&e.$$typeof)&&!Kc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function gb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yw(e,t){const n=gb(e);return Math.round(t*n)/n}function Hf(e){const t=m.useRef(e);return Ac(()=>{t.current=e}),t}function o$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:l,floating:d}={},transform:f=!0,whileElementsMounted:g,open:y}=e,[v,p]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=m.useState(s);Kc(x,s)||b(s);const[N,S]=m.useState(null),[C,_]=m.useState(null),E=m.useCallback(G=>{G!==V.current&&(V.current=G,S(G))},[]),T=m.useCallback(G=>{G!==D.current&&(D.current=G,_(G))},[]),j=l||N,q=d||C,V=m.useRef(null),D=m.useRef(null),$=m.useRef(v),F=g!=null,I=Hf(g),re=Hf(i),fe=Hf(y),de=m.useCallback(()=>{if(!V.current||!D.current)return;const G={placement:t,strategy:n,middleware:x};re.current&&(G.platform=re.current),t$(V.current,D.current,G).then(Z=>{const U={...Z,isPositioned:fe.current!==!1};ge.current&&!Kc($.current,U)&&($.current=U,Za.flushSync(()=>{p(U)}))})},[x,t,n,re,fe]);Ac(()=>{y===!1&&$.current.isPositioned&&($.current.isPositioned=!1,p(G=>({...G,isPositioned:!1})))},[y]);const ge=m.useRef(!1);Ac(()=>(ge.current=!0,()=>{ge.current=!1}),[]),Ac(()=>{if(j&&(V.current=j),q&&(D.current=q),j&&q){if(I.current)return I.current(j,q,de);de()}},[j,q,de,I,F]);const ce=m.useMemo(()=>({reference:V,floating:D,setReference:E,setFloating:T}),[E,T]),te=m.useMemo(()=>({reference:j,floating:q}),[j,q]),ie=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!te.floating)return G;const Z=yw(te.floating,v.x),U=yw(te.floating,v.y);return f?{...G,transform:"translate("+Z+"px, "+U+"px)",...gb(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:U}},[n,f,te.floating,v.x,v.y]);return m.useMemo(()=>({...v,update:de,refs:ce,elements:te,floatingStyles:ie}),[v,de,ce,te,ie])}const s$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:i}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?gw({element:s.current,padding:i}).fn(n):{}:s?gw({element:s,padding:i}).fn(n):{}}}},i$=(e,t)=>{const n=QI(e);return{name:n.name,fn:n.fn,options:[e,t]}},a$=(e,t)=>{const n=ZI(e);return{name:n.name,fn:n.fn,options:[e,t]}},l$=(e,t)=>({fn:e$(e).fn,options:[e,t]}),c$=(e,t)=>{const n=YI(e);return{name:n.name,fn:n.fn,options:[e,t]}},u$=(e,t)=>{const n=JI(e);return{name:n.name,fn:n.fn,options:[e,t]}},d$=(e,t)=>{const n=XI(e);return{name:n.name,fn:n.fn,options:[e,t]}},f$=(e,t)=>{const n=s$(e);return{name:n.name,fn:n.fn,options:[e,t]}};var p$="Arrow",yb=m.forwardRef((e,t)=>{const{children:n,width:s=10,height:i=5,...l}=e;return c.jsx(Ae.svg,{...l,ref:t,width:s,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});yb.displayName=p$;var m$=yb;function Fm(e){const[t,n]=m.useState(void 0);return _t(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let d,f;if("borderBoxSize"in l){const g=l.borderBoxSize,y=Array.isArray(g)?g[0]:g;d=y.inlineSize,f=y.blockSize}else d=e.offsetWidth,f=e.offsetHeight;n({width:d,height:f})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var Um="Popper",[vb,_u]=cr(Um),[h$,wb]=vb(Um),xb=e=>{const{__scopePopper:t,children:n}=e,[s,i]=m.useState(null);return c.jsx(h$,{scope:t,anchor:s,onAnchorChange:i,children:n})};xb.displayName=Um;var bb="PopperAnchor",Sb=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...i}=e,l=wb(bb,n),d=m.useRef(null),f=qe(t,d),g=m.useRef(null);return m.useEffect(()=>{const y=g.current;g.current=(s==null?void 0:s.current)||d.current,y!==g.current&&l.onAnchorChange(g.current)}),s?null:c.jsx(Ae.div,{...i,ref:f})});Sb.displayName=bb;var Bm="PopperContent",[g$,y$]=vb(Bm),kb=m.forwardRef((e,t)=>{var X,oe,ue,Te,Fe,ye;const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:v=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:N,...S}=e,C=wb(Bm,n),[_,E]=m.useState(null),T=qe(t,Ve=>E(Ve)),[j,q]=m.useState(null),V=Fm(j),D=(V==null?void 0:V.width)??0,$=(V==null?void 0:V.height)??0,F=s+(l!=="center"?"-"+l:""),I=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},re=Array.isArray(y)?y:[y],fe=re.length>0,de={padding:I,boundary:re.filter(w$),altBoundary:fe},{refs:ge,floatingStyles:ce,placement:te,isPositioned:ie,middlewareData:G}=o$({strategy:"fixed",placement:F,whileElementsMounted:(...Ve)=>GI(...Ve,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[i$({mainAxis:i+$,alignmentAxis:d}),g&&a$({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?l$():void 0,...de}),g&&c$({...de}),u$({...de,apply:({elements:Ve,rects:Ge,availableWidth:Lt,availableHeight:Zt})=>{const{width:ut,height:qn}=Ge.reference,wt=Ve.floating.style;wt.setProperty("--radix-popper-available-width",`${Lt}px`),wt.setProperty("--radix-popper-available-height",`${Zt}px`),wt.setProperty("--radix-popper-anchor-width",`${ut}px`),wt.setProperty("--radix-popper-anchor-height",`${qn}px`)}}),j&&f$({element:j,padding:f}),x$({arrowWidth:D,arrowHeight:$}),x&&d$({strategy:"referenceHidden",...de})]}),[Z,U]=Nb(te),R=Dt(N);_t(()=>{ie&&(R==null||R())},[ie,R]);const A=(X=G.arrow)==null?void 0:X.x,ee=(oe=G.arrow)==null?void 0:oe.y,Y=((ue=G.arrow)==null?void 0:ue.centerOffset)!==0,[L,ne]=m.useState();return _t(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),c.jsx("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:ie?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(Te=G.transformOrigin)==null?void 0:Te.x,(Fe=G.transformOrigin)==null?void 0:Fe.y].join(" "),...((ye=G.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(g$,{scope:n,placedSide:Z,onArrowChange:q,arrowX:A,arrowY:ee,shouldHideArrow:Y,children:c.jsx(Ae.div,{"data-side":Z,"data-align":U,...S,ref:T,style:{...S.style,animation:ie?void 0:"none"}})})})});kb.displayName=Bm;var _b="PopperArrow",v$={top:"bottom",right:"left",bottom:"top",left:"right"},Cb=m.forwardRef(function(t,n){const{__scopePopper:s,...i}=t,l=y$(_b,s),d=v$[l.placedSide];return c.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:c.jsx(m$,{...i,ref:n,style:{...i.style,display:"block"}})})});Cb.displayName=_b;function w$(e){return e!==null}var x$=e=>({name:"transformOrigin",options:e,fn(t){var C,_,E;const{placement:n,rects:s,middlewareData:i}=t,d=((C=i.arrow)==null?void 0:C.centerOffset)!==0,f=d?0:e.arrowWidth,g=d?0:e.arrowHeight,[y,v]=Nb(n),p={start:"0%",center:"50%",end:"100%"}[v],x=(((_=i.arrow)==null?void 0:_.x)??0)+f/2,b=(((E=i.arrow)==null?void 0:E.y)??0)+g/2;let N="",S="";return y==="bottom"?(N=d?p:`${x}px`,S=`${-g}px`):y==="top"?(N=d?p:`${x}px`,S=`${s.floating.height+g}px`):y==="right"?(N=`${-g}px`,S=d?p:`${b}px`):y==="left"&&(N=`${s.floating.width+g}px`,S=d?p:`${b}px`),{data:{x:N,y:S}}}});function Nb(e){const[t,n="center"]=e.split("-");return[t,n]}var Eb=xb,Pb=Sb,jb=kb,Tb=Cb,Wf="rovingFocusGroup.onEntryFocus",b$={bubbles:!1,cancelable:!0},nl="RovingFocusGroup",[Ap,Rb,S$]=Om(nl),[k$,Cu]=cr(nl,[S$]),[_$,C$]=k$(nl),Ob=m.forwardRef((e,t)=>c.jsx(Ap.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ap.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(N$,{...e,ref:t})})}));Ob.displayName=nl;var N$=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:l,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:v=!1,...p}=e,x=m.useRef(null),b=qe(t,x),N=el(l),[S,C]=Oo({prop:d,defaultProp:f??null,onChange:g,caller:nl}),[_,E]=m.useState(!1),T=Dt(y),j=Rb(n),q=m.useRef(!1),[V,D]=m.useState(0);return m.useEffect(()=>{const $=x.current;if($)return $.addEventListener(Wf,T),()=>$.removeEventListener(Wf,T)},[T]),c.jsx(_$,{scope:n,orientation:s,dir:N,loop:i,currentTabStopId:S,onItemFocus:m.useCallback($=>C($),[C]),onItemShiftTab:m.useCallback(()=>E(!0),[]),onFocusableItemAdd:m.useCallback(()=>D($=>$+1),[]),onFocusableItemRemove:m.useCallback(()=>D($=>$-1),[]),children:c.jsx(Ae.div,{tabIndex:_||V===0?-1:0,"data-orientation":s,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{q.current=!0}),onFocus:Se(e.onFocus,$=>{const F=!q.current;if($.target===$.currentTarget&&F&&!_){const I=new CustomEvent(Wf,b$);if($.currentTarget.dispatchEvent(I),!I.defaultPrevented){const re=j().filter(te=>te.focusable),fe=re.find(te=>te.active),de=re.find(te=>te.id===S),ce=[fe,de,...re].filter(Boolean).map(te=>te.ref.current);Ib(ce,v)}}q.current=!1}),onBlur:Se(e.onBlur,()=>E(!1))})})}),Ab="RovingFocusGroupItem",Mb=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:l,children:d,...f}=e,g=Qt(),y=l||g,v=C$(Ab,n),p=v.currentTabStopId===y,x=Rb(n),{onFocusableItemAdd:b,onFocusableItemRemove:N,currentTabStopId:S}=v;return m.useEffect(()=>{if(s)return b(),()=>N()},[s,b,N]),c.jsx(Ap.ItemSlot,{scope:n,id:y,focusable:s,active:i,children:c.jsx(Ae.span,{tabIndex:p?0:-1,"data-orientation":v.orientation,...f,ref:t,onMouseDown:Se(e.onMouseDown,C=>{s?v.onItemFocus(y):C.preventDefault()}),onFocus:Se(e.onFocus,()=>v.onItemFocus(y)),onKeyDown:Se(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){v.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const _=j$(C,v.orientation,v.dir);if(_!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let T=x().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")T.reverse();else if(_==="prev"||_==="next"){_==="prev"&&T.reverse();const j=T.indexOf(C.currentTarget);T=v.loop?T$(T,j+1):T.slice(j+1)}setTimeout(()=>Ib(T))}}),children:typeof d=="function"?d({isCurrentTabStop:p,hasTabStop:S!=null}):d})})});Mb.displayName=Ab;var E$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function P$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j$(e,t,n){const s=P$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return E$[s]}function Ib(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function T$(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var $b=Ob,Db=Mb;function R$(e){const t=O$(e),n=m.forwardRef((s,i)=>{const{children:l,...d}=s,f=m.Children.toArray(l),g=f.find(M$);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function O$(e){const t=m.forwardRef((n,s)=>{const{children:i,...l}=n;if(m.isValidElement(i)){const d=$$(i),f=I$(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var A$=Symbol("radix.slottable");function M$(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A$}function I$(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function $$(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mp=["Enter"," "],D$=["ArrowDown","PageUp","Home"],Lb=["ArrowUp","PageDown","End"],L$=[...D$,...Lb],z$={ltr:[...Mp,"ArrowRight"],rtl:[...Mp,"ArrowLeft"]},F$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rl="Menu",[za,U$,B$]=Om(rl),[js,zb]=cr(rl,[B$,_u,Cu]),Nu=_u(),Fb=Cu(),[V$,Ts]=js(rl),[H$,ol]=js(rl),Ub=e=>{const{__scopeMenu:t,open:n=!1,children:s,dir:i,onOpenChange:l,modal:d=!0}=e,f=Nu(t),[g,y]=m.useState(null),v=m.useRef(!1),p=Dt(l),x=el(i);return m.useEffect(()=>{const b=()=>{v.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},N=()=>v.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),c.jsx(Eb,{...f,children:c.jsx(V$,{scope:t,open:n,onOpenChange:p,content:g,onContentChange:y,children:c.jsx(H$,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:v,dir:x,modal:d,children:s})})})};Ub.displayName=rl;var W$="MenuAnchor",Vm=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,i=Nu(n);return c.jsx(Pb,{...i,...s,ref:t})});Vm.displayName=W$;var Hm="MenuPortal",[q$,Bb]=js(Hm,{forceMount:void 0}),Vb=e=>{const{__scopeMenu:t,forceMount:n,children:s,container:i}=e,l=Ts(Hm,t);return c.jsx(q$,{scope:t,forceMount:n,children:c.jsx(wn,{present:n||l.open,children:c.jsx(hu,{asChild:!0,container:i,children:s})})})};Vb.displayName=Hm;var Vn="MenuContent",[K$,Wm]=js(Vn),Hb=m.forwardRef((e,t)=>{const n=Bb(Vn,e.__scopeMenu),{forceMount:s=n.forceMount,...i}=e,l=Ts(Vn,e.__scopeMenu),d=ol(Vn,e.__scopeMenu);return c.jsx(za.Provider,{scope:e.__scopeMenu,children:c.jsx(wn,{present:s||l.open,children:c.jsx(za.Slot,{scope:e.__scopeMenu,children:d.modal?c.jsx(G$,{...i,ref:t}):c.jsx(Q$,{...i,ref:t})})})})}),G$=m.forwardRef((e,t)=>{const n=Ts(Vn,e.__scopeMenu),s=m.useRef(null),i=qe(t,s);return m.useEffect(()=>{const l=s.current;if(l)return km(l)},[]),c.jsx(qm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Q$=m.forwardRef((e,t)=>{const n=Ts(Vn,e.__scopeMenu);return c.jsx(qm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Z$=R$("MenuContent.ScrollLock"),qm=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:g,onEscapeKeyDown:y,onPointerDownOutside:v,onFocusOutside:p,onInteractOutside:x,onDismiss:b,disableOutsideScroll:N,...S}=e,C=Ts(Vn,n),_=ol(Vn,n),E=Nu(n),T=Fb(n),j=U$(n),[q,V]=m.useState(null),D=m.useRef(null),$=qe(t,D,C.onContentChange),F=m.useRef(0),I=m.useRef(""),re=m.useRef(0),fe=m.useRef(null),de=m.useRef("right"),ge=m.useRef(0),ce=N?yu:m.Fragment,te=N?{as:Z$,allowPinchZoom:!0}:void 0,ie=Z=>{var X,oe;const U=I.current+Z,R=j().filter(ue=>!ue.disabled),A=document.activeElement,ee=(X=R.find(ue=>ue.ref.current===A))==null?void 0:X.textValue,Y=R.map(ue=>ue.textValue),L=lD(Y,U,ee),ne=(oe=R.find(ue=>ue.textValue===L))==null?void 0:oe.ref.current;(function ue(Te){I.current=Te,window.clearTimeout(F.current),Te!==""&&(F.current=window.setTimeout(()=>ue(""),1e3))})(U),ne&&setTimeout(()=>ne.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),Sm();const G=m.useCallback(Z=>{var R,A;return de.current===((R=fe.current)==null?void 0:R.side)&&uD(Z,(A=fe.current)==null?void 0:A.area)},[]);return c.jsx(K$,{scope:n,searchRef:I,onItemEnter:m.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),onItemLeave:m.useCallback(Z=>{var U;G(Z)||((U=D.current)==null||U.focus(),V(null))},[G]),onTriggerLeave:m.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),pointerGraceTimerRef:re,onPointerGraceIntentChange:m.useCallback(Z=>{fe.current=Z},[]),children:c.jsx(ce,{...te,children:c.jsx(mu,{asChild:!0,trapped:i,onMountAutoFocus:Se(l,Z=>{var U;Z.preventDefault(),(U=D.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:c.jsx(pu,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:y,onPointerDownOutside:v,onFocusOutside:p,onInteractOutside:x,onDismiss:b,children:c.jsx($b,{asChild:!0,...T,dir:_.dir,orientation:"vertical",loop:s,currentTabStopId:q,onCurrentTabStopIdChange:V,onEntryFocus:Se(g,Z=>{_.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(jb,{role:"menu","aria-orientation":"vertical","data-state":i1(C.open),"data-radix-menu-content":"",dir:_.dir,...E,...S,ref:$,style:{outline:"none",...S.style},onKeyDown:Se(S.onKeyDown,Z=>{const R=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,A=Z.ctrlKey||Z.altKey||Z.metaKey,ee=Z.key.length===1;R&&(Z.key==="Tab"&&Z.preventDefault(),!A&&ee&&ie(Z.key));const Y=D.current;if(Z.target!==Y||!L$.includes(Z.key))return;Z.preventDefault();const ne=j().filter(X=>!X.disabled).map(X=>X.ref.current);Lb.includes(Z.key)&&ne.reverse(),iD(ne)}),onBlur:Se(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(F.current),I.current="")}),onPointerMove:Se(e.onPointerMove,Fa(Z=>{const U=Z.target,R=ge.current!==Z.clientX;if(Z.currentTarget.contains(U)&&R){const A=Z.clientX>ge.current?"right":"left";de.current=A,ge.current=Z.clientX}}))})})})})})})});Hb.displayName=Vn;var Y$="MenuGroup",Km=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return c.jsx(Ae.div,{role:"group",...s,ref:t})});Km.displayName=Y$;var J$="MenuLabel",Wb=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return c.jsx(Ae.div,{...s,ref:t})});Wb.displayName=J$;var Gc="MenuItem",vw="menu.itemSelect",Eu=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:s,...i}=e,l=m.useRef(null),d=ol(Gc,e.__scopeMenu),f=Wm(Gc,e.__scopeMenu),g=qe(t,l),y=m.useRef(!1),v=()=>{const p=l.current;if(!n&&p){const x=new CustomEvent(vw,{bubbles:!0,cancelable:!0});p.addEventListener(vw,b=>s==null?void 0:s(b),{once:!0}),m0(p,x),x.defaultPrevented?y.current=!1:d.onClose()}};return c.jsx(qb,{...i,ref:g,disabled:n,onClick:Se(e.onClick,v),onPointerDown:p=>{var x;(x=e.onPointerDown)==null||x.call(e,p),y.current=!0},onPointerUp:Se(e.onPointerUp,p=>{var x;y.current||(x=p.currentTarget)==null||x.click()}),onKeyDown:Se(e.onKeyDown,p=>{const x=f.searchRef.current!=="";n||x&&p.key===" "||Mp.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Eu.displayName=Gc;var qb=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:s=!1,textValue:i,...l}=e,d=Wm(Gc,n),f=Fb(n),g=m.useRef(null),y=qe(t,g),[v,p]=m.useState(!1),[x,b]=m.useState("");return m.useEffect(()=>{const N=g.current;N&&b((N.textContent??"").trim())},[l.children]),c.jsx(za.ItemSlot,{scope:n,disabled:s,textValue:i??x,children:c.jsx(Db,{asChild:!0,...f,focusable:!s,children:c.jsx(Ae.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...l,ref:y,onPointerMove:Se(e.onPointerMove,Fa(N=>{s?d.onItemLeave(N):(d.onItemEnter(N),N.defaultPrevented||N.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,Fa(N=>d.onItemLeave(N))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),X$="MenuCheckboxItem",Kb=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:s,...i}=e;return c.jsx(Jb,{scope:e.__scopeMenu,checked:n,children:c.jsx(Eu,{role:"menuitemcheckbox","aria-checked":Qc(n)?"mixed":n,...i,ref:t,"data-state":Qm(n),onSelect:Se(i.onSelect,()=>s==null?void 0:s(Qc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Kb.displayName=X$;var Gb="MenuRadioGroup",[eD,tD]=js(Gb,{value:void 0,onValueChange:()=>{}}),Qb=m.forwardRef((e,t)=>{const{value:n,onValueChange:s,...i}=e,l=Dt(s);return c.jsx(eD,{scope:e.__scopeMenu,value:n,onValueChange:l,children:c.jsx(Km,{...i,ref:t})})});Qb.displayName=Gb;var Zb="MenuRadioItem",Yb=m.forwardRef((e,t)=>{const{value:n,...s}=e,i=tD(Zb,e.__scopeMenu),l=n===i.value;return c.jsx(Jb,{scope:e.__scopeMenu,checked:l,children:c.jsx(Eu,{role:"menuitemradio","aria-checked":l,...s,ref:t,"data-state":Qm(l),onSelect:Se(s.onSelect,()=>{var d;return(d=i.onValueChange)==null?void 0:d.call(i,n)},{checkForDefaultPrevented:!1})})})});Yb.displayName=Zb;var Gm="MenuItemIndicator",[Jb,nD]=js(Gm,{checked:!1}),Xb=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:s,...i}=e,l=nD(Gm,n);return c.jsx(wn,{present:s||Qc(l.checked)||l.checked===!0,children:c.jsx(Ae.span,{...i,ref:t,"data-state":Qm(l.checked)})})});Xb.displayName=Gm;var rD="MenuSeparator",e1=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return c.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});e1.displayName=rD;var oD="MenuArrow",t1=m.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,i=Nu(n);return c.jsx(Tb,{...i,...s,ref:t})});t1.displayName=oD;var sD="MenuSub",[PF,n1]=js(sD),Ea="MenuSubTrigger",r1=m.forwardRef((e,t)=>{const n=Ts(Ea,e.__scopeMenu),s=ol(Ea,e.__scopeMenu),i=n1(Ea,e.__scopeMenu),l=Wm(Ea,e.__scopeMenu),d=m.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:g}=l,y={__scopeMenu:e.__scopeMenu},v=m.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return m.useEffect(()=>v,[v]),m.useEffect(()=>{const p=f.current;return()=>{window.clearTimeout(p),g(null)}},[f,g]),c.jsx(Vm,{asChild:!0,...y,children:c.jsx(qb,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":i1(n.open),...e,ref:vn(t,i.onTriggerChange),onClick:p=>{var x;(x=e.onClick)==null||x.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,Fa(p=>{l.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!d.current&&(l.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:Se(e.onPointerLeave,Fa(p=>{var b,N;v();const x=(b=n.content)==null?void 0:b.getBoundingClientRect();if(x){const S=(N=n.content)==null?void 0:N.dataset.side,C=S==="right",_=C?-5:5,E=x[C?"left":"right"],T=x[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:E,y:x.top},{x:T,y:x.top},{x:T,y:x.bottom},{x:E,y:x.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{var b;const x=l.searchRef.current!=="";e.disabled||x&&p.key===" "||z$[s.dir].includes(p.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),p.preventDefault())})})})});r1.displayName=Ea;var o1="MenuSubContent",s1=m.forwardRef((e,t)=>{const n=Bb(Vn,e.__scopeMenu),{forceMount:s=n.forceMount,...i}=e,l=Ts(Vn,e.__scopeMenu),d=ol(Vn,e.__scopeMenu),f=n1(o1,e.__scopeMenu),g=m.useRef(null),y=qe(t,g);return c.jsx(za.Provider,{scope:e.__scopeMenu,children:c.jsx(wn,{present:s||l.open,children:c.jsx(za.Slot,{scope:e.__scopeMenu,children:c.jsx(qm,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:y,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var p;d.isUsingKeyboardRef.current&&((p=g.current)==null||p.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Se(e.onFocusOutside,v=>{v.target!==f.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:Se(e.onKeyDown,v=>{var b;const p=v.currentTarget.contains(v.target),x=F$[d.dir].includes(v.key);p&&x&&(l.onOpenChange(!1),(b=f.trigger)==null||b.focus(),v.preventDefault())})})})})})});s1.displayName=o1;function i1(e){return e?"open":"closed"}function Qc(e){return e==="indeterminate"}function Qm(e){return Qc(e)?"indeterminate":e?"checked":"unchecked"}function iD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function aD(e,t){return e.map((n,s)=>e[(t+s)%e.length])}function lD(e,t,n){const i=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let d=aD(e,Math.max(l,0));i.length===1&&(d=d.filter(y=>y!==n));const g=d.find(y=>y.toLowerCase().startsWith(i.toLowerCase()));return g!==n?g:void 0}function cD(e,t){const{x:n,y:s}=e;let i=!1;for(let l=0,d=t.length-1;l<t.length;d=l++){const f=t[l],g=t[d],y=f.x,v=f.y,p=g.x,x=g.y;v>s!=x>s&&n<(p-y)*(s-v)/(x-v)+y&&(i=!i)}return i}function uD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cD(n,t)}function Fa(e){return t=>t.pointerType==="mouse"?e(t):void 0}var dD=Ub,fD=Vm,pD=Vb,mD=Hb,hD=Km,gD=Wb,yD=Eu,vD=Kb,wD=Qb,xD=Yb,bD=Xb,SD=e1,kD=t1,_D=r1,CD=s1,Pu="DropdownMenu",[ND]=cr(Pu,[zb]),an=zb(),[ED,a1]=ND(Pu),l1=e=>{const{__scopeDropdownMenu:t,children:n,dir:s,open:i,defaultOpen:l,onOpenChange:d,modal:f=!0}=e,g=an(t),y=m.useRef(null),[v,p]=Oo({prop:i,defaultProp:l??!1,onChange:d,caller:Pu});return c.jsx(ED,{scope:t,triggerId:Qt(),triggerRef:y,contentId:Qt(),open:v,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(x=>!x),[p]),modal:f,children:c.jsx(dD,{...g,open:v,onOpenChange:p,dir:s,modal:f,children:n})})};l1.displayName=Pu;var c1="DropdownMenuTrigger",u1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...i}=e,l=a1(c1,n),d=an(n);return c.jsx(fD,{asChild:!0,...d,children:c.jsx(Ae.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...i,ref:vn(t,l.triggerRef),onPointerDown:Se(e.onPointerDown,f=>{!s&&f.button===0&&f.ctrlKey===!1&&(l.onOpenToggle(),l.open||f.preventDefault())}),onKeyDown:Se(e.onKeyDown,f=>{s||(["Enter"," "].includes(f.key)&&l.onOpenToggle(),f.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});u1.displayName=c1;var PD="DropdownMenuPortal",d1=e=>{const{__scopeDropdownMenu:t,...n}=e,s=an(t);return c.jsx(pD,{...s,...n})};d1.displayName=PD;var f1="DropdownMenuContent",p1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=a1(f1,n),l=an(n),d=m.useRef(!1);return c.jsx(mD,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...s,ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,f=>{var g;d.current||(g=i.triggerRef.current)==null||g.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,f=>{const g=f.detail.originalEvent,y=g.button===0&&g.ctrlKey===!0,v=g.button===2||y;(!i.modal||v)&&(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)"}})});p1.displayName=f1;var jD="DropdownMenuGroup",TD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(hD,{...i,...s,ref:t})});TD.displayName=jD;var RD="DropdownMenuLabel",m1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(gD,{...i,...s,ref:t})});m1.displayName=RD;var OD="DropdownMenuItem",h1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(yD,{...i,...s,ref:t})});h1.displayName=OD;var AD="DropdownMenuCheckboxItem",g1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(vD,{...i,...s,ref:t})});g1.displayName=AD;var MD="DropdownMenuRadioGroup",ID=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(wD,{...i,...s,ref:t})});ID.displayName=MD;var $D="DropdownMenuRadioItem",y1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(xD,{...i,...s,ref:t})});y1.displayName=$D;var DD="DropdownMenuItemIndicator",v1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(bD,{...i,...s,ref:t})});v1.displayName=DD;var LD="DropdownMenuSeparator",w1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(SD,{...i,...s,ref:t})});w1.displayName=LD;var zD="DropdownMenuArrow",FD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(kD,{...i,...s,ref:t})});FD.displayName=zD;var UD="DropdownMenuSubTrigger",x1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(_D,{...i,...s,ref:t})});x1.displayName=UD;var BD="DropdownMenuSubContent",b1=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,i=an(n);return c.jsx(CD,{...i,...s,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)"}})});b1.displayName=BD;var VD=l1,HD=u1,WD=d1,S1=p1,k1=m1,_1=h1,C1=g1,N1=y1,E1=v1,P1=w1,j1=x1,T1=b1;const qD=VD,KD=HD,GD=m.forwardRef(({className:e,inset:t,children:n,...s},i)=>c.jsxs(j1,{ref:i,className:_e("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),...s,children:[n,c.jsx(Ya,{className:"ml-auto h-4 w-4"})]}));GD.displayName=j1.displayName;const QD=m.forwardRef(({className:e,...t},n)=>c.jsx(T1,{ref:n,className:_e("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}));QD.displayName=T1.displayName;const R1=m.forwardRef(({className:e,sideOffset:t=4,...n},s)=>c.jsx(WD,{children:c.jsx(S1,{ref:s,sideOffset:t,className:_e("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),...n})}));R1.displayName=S1.displayName;const Mc=m.forwardRef(({className:e,inset:t,...n},s)=>c.jsx(_1,{ref:s,className:_e("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),...n}));Mc.displayName=_1.displayName;const ZD=m.forwardRef(({className:e,children:t,checked:n,...s},i)=>c.jsxs(C1,{ref:i,className:_e("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:n,...s,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(E1,{children:c.jsx(Mi,{className:"h-4 w-4"})})}),t]}));ZD.displayName=C1.displayName;const YD=m.forwardRef(({className:e,children:t,...n},s)=>c.jsxs(N1,{ref:s,className:_e("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),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(E1,{children:c.jsx(kN,{className:"h-2 w-2 fill-current"})})}),t]}));YD.displayName=N1.displayName;const JD=m.forwardRef(({className:e,inset:t,...n},s)=>c.jsx(k1,{ref:s,className:_e("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));JD.displayName=k1.displayName;const Ip=m.forwardRef(({className:e,...t},n)=>c.jsx(P1,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));Ip.displayName=P1.displayName;var XD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eL=XD.reduce((e,t)=>{const n=jm(`Primitive.${t}`),s=m.forwardRef((i,l)=>{const{asChild:d,...f}=i,g=d?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...f,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),tL="Label",O1=m.forwardRef((e,t)=>c.jsx(eL.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));O1.displayName=tL;var A1=O1;const nL=fu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oi=m.forwardRef(({className:e,...t},n)=>c.jsx(A1,{ref:n,className:_e(nL(),e),...t}));Oi.displayName=A1.displayName;function $p(e,[t,n]){return Math.min(n,Math.max(t,e))}function rL(e){const t=oL(e),n=m.forwardRef((s,i)=>{const{children:l,...d}=s,f=m.Children.toArray(l),g=f.find(iL);if(g){const y=g.props.children,v=f.map(p=>p===g?m.Children.count(y)>1?m.Children.only(null):m.isValidElement(y)?y.props.children:null:p);return c.jsx(t,{...d,ref:i,children:m.isValidElement(y)?m.cloneElement(y,void 0,v):null})}return c.jsx(t,{...d,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function oL(e){const t=m.forwardRef((n,s)=>{const{children:i,...l}=n;if(m.isValidElement(i)){const d=lL(i),f=aL(l,i.props);return i.type!==m.Fragment&&(f.ref=s?vn(s,d):d),m.cloneElement(i,f)}return m.Children.count(i)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sL=Symbol("radix.slottable");function iL(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sL}function aL(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...f)=>{const g=l(...f);return i(...f),g}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function lL(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zm(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var M1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cL="VisuallyHidden",I1=m.forwardRef((e,t)=>c.jsx(Ae.span,{...e,ref:t,style:{...M1,...e.style}}));I1.displayName=cL;var jF=I1,uL=[" ","Enter","ArrowUp","ArrowDown"],dL=[" ","Enter"],Cs="Select",[ju,Tu,fL]=Om(Cs),[Li]=cr(Cs,[fL,_u]),Ru=_u(),[pL,Fo]=Li(Cs),[mL,hL]=Li(Cs),$1=e=>{const{__scopeSelect:t,children:n,open:s,defaultOpen:i,onOpenChange:l,value:d,defaultValue:f,onValueChange:g,dir:y,name:v,autoComplete:p,disabled:x,required:b,form:N}=e,S=Ru(t),[C,_]=m.useState(null),[E,T]=m.useState(null),[j,q]=m.useState(!1),V=el(y),[D,$]=Oo({prop:s,defaultProp:i??!1,onChange:l,caller:Cs}),[F,I]=Oo({prop:d,defaultProp:f,onChange:g,caller:Cs}),re=m.useRef(null),fe=C?N||!!C.closest("form"):!0,[de,ge]=m.useState(new Set),ce=Array.from(de).map(te=>te.props.value).join(";");return c.jsx(Eb,{...S,children:c.jsxs(pL,{required:b,scope:t,trigger:C,onTriggerChange:_,valueNode:E,onValueNodeChange:T,valueNodeHasChildren:j,onValueNodeHasChildrenChange:q,contentId:Qt(),value:F,onValueChange:I,open:D,onOpenChange:$,dir:V,triggerPointerDownPosRef:re,disabled:x,children:[c.jsx(ju.Provider,{scope:t,children:c.jsx(mL,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(te=>{ge(ie=>new Set(ie).add(te))},[]),onNativeOptionRemove:m.useCallback(te=>{ge(ie=>{const G=new Set(ie);return G.delete(te),G})},[]),children:n})}),fe?c.jsxs(iS,{"aria-hidden":!0,required:b,tabIndex:-1,name:v,autoComplete:p,value:F,onChange:te=>I(te.target.value),disabled:x,form:N,children:[F===void 0?c.jsx("option",{value:""}):null,Array.from(de)]},ce):null]})})};$1.displayName=Cs;var D1="SelectTrigger",L1=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:s=!1,...i}=e,l=Ru(n),d=Fo(D1,n),f=d.disabled||s,g=qe(t,d.onTriggerChange),y=Tu(n),v=m.useRef("touch"),[p,x,b]=lS(S=>{const C=y().filter(T=>!T.disabled),_=C.find(T=>T.value===d.value),E=cS(C,S,_);E!==void 0&&d.onValueChange(E.value)}),N=S=>{f||(d.onOpenChange(!0),b()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return c.jsx(Pb,{asChild:!0,...l,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":aS(d.value)?"":void 0,...i,ref:g,onClick:Se(i.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&N(S)}),onPointerDown:Se(i.onPointerDown,S=>{v.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(N(S),S.preventDefault())}),onKeyDown:Se(i.onKeyDown,S=>{const C=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(C&&S.key===" ")&&uL.includes(S.key)&&(N(),S.preventDefault())})})})});L1.displayName=D1;var z1="SelectValue",F1=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:i,children:l,placeholder:d="",...f}=e,g=Fo(z1,n),{onValueNodeHasChildrenChange:y}=g,v=l!==void 0,p=qe(t,g.onValueNodeChange);return _t(()=>{y(v)},[y,v]),c.jsx(Ae.span,{...f,ref:p,style:{pointerEvents:"none"},children:aS(g.value)?c.jsx(c.Fragment,{children:d}):l})});F1.displayName=z1;var gL="SelectIcon",U1=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:s,...i}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:s||"▼"})});U1.displayName=gL;var yL="SelectPortal",B1=e=>c.jsx(hu,{asChild:!0,...e});B1.displayName=yL;var Ns="SelectContent",V1=m.forwardRef((e,t)=>{const n=Fo(Ns,e.__scopeSelect),[s,i]=m.useState();if(_t(()=>{i(new DocumentFragment)},[]),!n.open){const l=s;return l?Za.createPortal(c.jsx(H1,{scope:e.__scopeSelect,children:c.jsx(ju.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),l):null}return c.jsx(W1,{...e,ref:t})});V1.displayName=Ns;var tr=10,[H1,Uo]=Li(Ns),vL="SelectContentImpl",wL=rL("SelectContent.RemoveScroll"),W1=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:d,side:f,sideOffset:g,align:y,alignOffset:v,arrowPadding:p,collisionBoundary:x,collisionPadding:b,sticky:N,hideWhenDetached:S,avoidCollisions:C,..._}=e,E=Fo(Ns,n),[T,j]=m.useState(null),[q,V]=m.useState(null),D=qe(t,X=>j(X)),[$,F]=m.useState(null),[I,re]=m.useState(null),fe=Tu(n),[de,ge]=m.useState(!1),ce=m.useRef(!1);m.useEffect(()=>{if(T)return km(T)},[T]),Sm();const te=m.useCallback(X=>{const[oe,...ue]=fe().map(ye=>ye.ref.current),[Te]=ue.slice(-1),Fe=document.activeElement;for(const ye of X)if(ye===Fe||(ye==null||ye.scrollIntoView({block:"nearest"}),ye===oe&&q&&(q.scrollTop=0),ye===Te&&q&&(q.scrollTop=q.scrollHeight),ye==null||ye.focus(),document.activeElement!==Fe))return},[fe,q]),ie=m.useCallback(()=>te([$,T]),[te,$,T]);m.useEffect(()=>{de&&ie()},[de,ie]);const{onOpenChange:G,triggerPointerDownPosRef:Z}=E;m.useEffect(()=>{if(T){let X={x:0,y:0};const oe=Te=>{var Fe,ye;X={x:Math.abs(Math.round(Te.pageX)-(((Fe=Z.current)==null?void 0:Fe.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((ye=Z.current)==null?void 0:ye.y)??0))}},ue=Te=>{X.x<=10&&X.y<=10?Te.preventDefault():T.contains(Te.target)||G(!1),document.removeEventListener("pointermove",oe),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ue,{capture:!0})}}},[T,G,Z]),m.useEffect(()=>{const X=()=>G(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[G]);const[U,R]=lS(X=>{const oe=fe().filter(Fe=>!Fe.disabled),ue=oe.find(Fe=>Fe.ref.current===document.activeElement),Te=cS(oe,X,ue);Te&&setTimeout(()=>Te.ref.current.focus())}),A=m.useCallback((X,oe,ue)=>{const Te=!ce.current&&!ue;(E.value!==void 0&&E.value===oe||Te)&&(F(X),Te&&(ce.current=!0))},[E.value]),ee=m.useCallback(()=>T==null?void 0:T.focus(),[T]),Y=m.useCallback((X,oe,ue)=>{const Te=!ce.current&&!ue;(E.value!==void 0&&E.value===oe||Te)&&re(X)},[E.value]),L=s==="popper"?Dp:q1,ne=L===Dp?{side:f,sideOffset:g,align:y,alignOffset:v,arrowPadding:p,collisionBoundary:x,collisionPadding:b,sticky:N,hideWhenDetached:S,avoidCollisions:C}:{};return c.jsx(H1,{scope:n,content:T,viewport:q,onViewportChange:V,itemRefCallback:A,selectedItem:$,onItemLeave:ee,itemTextRefCallback:Y,focusSelectedItem:ie,selectedItemText:I,position:s,isPositioned:de,searchRef:U,children:c.jsx(yu,{as:wL,allowPinchZoom:!0,children:c.jsx(mu,{asChild:!0,trapped:E.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Se(i,X=>{var oe;(oe=E.trigger)==null||oe.focus({preventScroll:!0}),X.preventDefault()}),children:c.jsx(pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:c.jsx(L,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:X=>X.preventDefault(),..._,...ne,onPlaced:()=>ge(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Se(_.onKeyDown,X=>{const oe=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!oe&&X.key.length===1&&R(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let Te=fe().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Fe=X.target,ye=Te.indexOf(Fe);Te=Te.slice(ye+1)}setTimeout(()=>te(Te)),X.preventDefault()}})})})})})})});W1.displayName=vL;var xL="SelectItemAlignedPosition",q1=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:s,...i}=e,l=Fo(Ns,n),d=Uo(Ns,n),[f,g]=m.useState(null),[y,v]=m.useState(null),p=qe(t,D=>v(D)),x=Tu(n),b=m.useRef(!1),N=m.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:_,focusSelectedItem:E}=d,T=m.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&y&&S&&C&&_){const D=l.trigger.getBoundingClientRect(),$=y.getBoundingClientRect(),F=l.valueNode.getBoundingClientRect(),I=_.getBoundingClientRect();if(l.dir!=="rtl"){const Fe=I.left-$.left,ye=F.left-Fe,Ve=D.left-ye,Ge=D.width+Ve,Lt=Math.max(Ge,$.width),Zt=window.innerWidth-tr,ut=$p(ye,[tr,Math.max(tr,Zt-Lt)]);f.style.minWidth=Ge+"px",f.style.left=ut+"px"}else{const Fe=$.right-I.right,ye=window.innerWidth-F.right-Fe,Ve=window.innerWidth-D.right-ye,Ge=D.width+Ve,Lt=Math.max(Ge,$.width),Zt=window.innerWidth-tr,ut=$p(ye,[tr,Math.max(tr,Zt-Lt)]);f.style.minWidth=Ge+"px",f.style.right=ut+"px"}const re=x(),fe=window.innerHeight-tr*2,de=S.scrollHeight,ge=window.getComputedStyle(y),ce=parseInt(ge.borderTopWidth,10),te=parseInt(ge.paddingTop,10),ie=parseInt(ge.borderBottomWidth,10),G=parseInt(ge.paddingBottom,10),Z=ce+te+de+G+ie,U=Math.min(C.offsetHeight*5,Z),R=window.getComputedStyle(S),A=parseInt(R.paddingTop,10),ee=parseInt(R.paddingBottom,10),Y=D.top+D.height/2-tr,L=fe-Y,ne=C.offsetHeight/2,X=C.offsetTop+ne,oe=ce+te+X,ue=Z-oe;if(oe<=Y){const Fe=re.length>0&&C===re[re.length-1].ref.current;f.style.bottom="0px";const ye=y.clientHeight-S.offsetTop-S.offsetHeight,Ve=Math.max(L,ne+(Fe?ee:0)+ye+ie),Ge=oe+Ve;f.style.height=Ge+"px"}else{const Fe=re.length>0&&C===re[0].ref.current;f.style.top="0px";const Ve=Math.max(Y,ce+S.offsetTop+(Fe?A:0)+ne)+ue;f.style.height=Ve+"px",S.scrollTop=oe-Y+S.offsetTop}f.style.margin=`${tr}px 0`,f.style.minHeight=U+"px",f.style.maxHeight=fe+"px",s==null||s(),requestAnimationFrame(()=>b.current=!0)}},[x,l.trigger,l.valueNode,f,y,S,C,_,l.dir,s]);_t(()=>T(),[T]);const[j,q]=m.useState();_t(()=>{y&&q(window.getComputedStyle(y).zIndex)},[y]);const V=m.useCallback(D=>{D&&N.current===!0&&(T(),E==null||E(),N.current=!1)},[T,E]);return c.jsx(SL,{scope:n,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:V,children:c.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:c.jsx(Ae.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});q1.displayName=xL;var bL="SelectPopperPosition",Dp=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:s="start",collisionPadding:i=tr,...l}=e,d=Ru(n);return c.jsx(jb,{...d,...l,ref:t,align:s,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Dp.displayName=bL;var[SL,Ym]=Li(Ns,{}),Lp="SelectViewport",K1=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:s,...i}=e,l=Uo(Lp,n),d=Ym(Lp,n),f=qe(t,l.onViewportChange),g=m.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),c.jsx(ju.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Se(i.onScroll,y=>{const v=y.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=d;if(x!=null&&x.current&&p){const b=Math.abs(g.current-v.scrollTop);if(b>0){const N=window.innerHeight-tr*2,S=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),_=Math.max(S,C);if(_<N){const E=_+b,T=Math.min(N,E),j=E-T;p.style.height=T+"px",p.style.bottom==="0px"&&(v.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}g.current=v.scrollTop})})})]})});K1.displayName=Lp;var G1="SelectGroup",[kL,_L]=Li(G1),CL=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,i=Qt();return c.jsx(kL,{scope:n,id:i,children:c.jsx(Ae.div,{role:"group","aria-labelledby":i,...s,ref:t})})});CL.displayName=G1;var Q1="SelectLabel",Z1=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,i=_L(Q1,n);return c.jsx(Ae.div,{id:i.id,...s,ref:t})});Z1.displayName=Q1;var Zc="SelectItem",[NL,Y1]=Li(Zc),J1=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:l,...d}=e,f=Fo(Zc,n),g=Uo(Zc,n),y=f.value===s,[v,p]=m.useState(l??""),[x,b]=m.useState(!1),N=qe(t,E=>{var T;return(T=g.itemRefCallback)==null?void 0:T.call(g,E,s,i)}),S=Qt(),C=m.useRef("touch"),_=()=>{i||(f.onValueChange(s),f.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(NL,{scope:n,value:s,disabled:i,textId:S,isSelected:y,onItemTextChange:m.useCallback(E=>{p(T=>T||((E==null?void 0:E.textContent)??"").trim())},[]),children:c.jsx(ju.ItemSlot,{scope:n,value:s,disabled:i,textValue:v,children:c.jsx(Ae.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":y&&x,"data-state":y?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...d,ref:N,onFocus:Se(d.onFocus,()=>b(!0)),onBlur:Se(d.onBlur,()=>b(!1)),onClick:Se(d.onClick,()=>{C.current!=="mouse"&&_()}),onPointerUp:Se(d.onPointerUp,()=>{C.current==="mouse"&&_()}),onPointerDown:Se(d.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:Se(d.onPointerMove,E=>{var T;C.current=E.pointerType,i?(T=g.onItemLeave)==null||T.call(g):C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(d.onPointerLeave,E=>{var T;E.currentTarget===document.activeElement&&((T=g.onItemLeave)==null||T.call(g))}),onKeyDown:Se(d.onKeyDown,E=>{var j;((j=g.searchRef)==null?void 0:j.current)!==""&&E.key===" "||(dL.includes(E.key)&&_(),E.key===" "&&E.preventDefault())})})})})});J1.displayName=Zc;var Pa="SelectItemText",X1=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:i,...l}=e,d=Fo(Pa,n),f=Uo(Pa,n),g=Y1(Pa,n),y=hL(Pa,n),[v,p]=m.useState(null),x=qe(t,_=>p(_),g.onItemTextChange,_=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,_,g.value,g.disabled)}),b=v==null?void 0:v.textContent,N=m.useMemo(()=>c.jsx("option",{value:g.value,disabled:g.disabled,children:b},g.value),[g.disabled,g.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=y;return _t(()=>(S(N),()=>C(N)),[S,C,N]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:g.textId,...l,ref:x}),g.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Za.createPortal(l.children,d.valueNode):null]})});X1.displayName=Pa;var eS="SelectItemIndicator",tS=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return Y1(eS,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...s,ref:t}):null});tS.displayName=eS;var zp="SelectScrollUpButton",nS=m.forwardRef((e,t)=>{const n=Uo(zp,e.__scopeSelect),s=Ym(zp,e.__scopeSelect),[i,l]=m.useState(!1),d=qe(t,s.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let f=function(){const y=g.scrollTop>0;l(y)};const g=n.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(oS,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=n;f&&g&&(f.scrollTop=f.scrollTop-g.offsetHeight)}}):null});nS.displayName=zp;var Fp="SelectScrollDownButton",rS=m.forwardRef((e,t)=>{const n=Uo(Fp,e.__scopeSelect),s=Ym(Fp,e.__scopeSelect),[i,l]=m.useState(!1),d=qe(t,s.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let f=function(){const y=g.scrollHeight-g.clientHeight,v=Math.ceil(g.scrollTop)<y;l(v)};const g=n.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?c.jsx(oS,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=n;f&&g&&(f.scrollTop=f.scrollTop+g.offsetHeight)}}):null});rS.displayName=Fp;var oS=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=e,l=Uo("SelectScrollButton",n),d=m.useRef(null),f=Tu(n),g=m.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return m.useEffect(()=>()=>g(),[g]),_t(()=>{var v;const y=f().find(p=>p.ref.current===document.activeElement);(v=y==null?void 0:y.ref.current)==null||v.scrollIntoView({block:"nearest"})},[f]),c.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Se(i.onPointerMove,()=>{var y;(y=l.onItemLeave)==null||y.call(l),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{g()})})}),EL="SelectSeparator",sS=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...s,ref:t})});sS.displayName=EL;var Up="SelectArrow",PL=m.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,i=Ru(n),l=Fo(Up,n),d=Uo(Up,n);return l.open&&d.position==="popper"?c.jsx(Tb,{...i,...s,ref:t}):null});PL.displayName=Up;var jL="SelectBubbleInput",iS=m.forwardRef(({__scopeSelect:e,value:t,...n},s)=>{const i=m.useRef(null),l=qe(s,i),d=Zm(t);return m.useEffect(()=>{const f=i.current;if(!f)return;const g=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(g,"value").set;if(d!==t&&v){const p=new Event("change",{bubbles:!0});v.call(f,t),f.dispatchEvent(p)}},[d,t]),c.jsx(Ae.select,{...n,style:{...M1,...n.style},ref:l,defaultValue:t})});iS.displayName=jL;function aS(e){return e===""||e===void 0}function lS(e){const t=Dt(e),n=m.useRef(""),s=m.useRef(0),i=m.useCallback(d=>{const f=n.current+d;t(f),(function g(y){n.current=y,window.clearTimeout(s.current),y!==""&&(s.current=window.setTimeout(()=>g(""),1e3))})(f)},[t]),l=m.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,i,l]}function cS(e,t,n){const i=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let d=TL(e,Math.max(l,0));i.length===1&&(d=d.filter(y=>y!==n));const g=d.find(y=>y.textValue.toLowerCase().startsWith(i.toLowerCase()));return g!==n?g:void 0}function TL(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var RL=$1,uS=L1,OL=F1,AL=U1,ML=B1,dS=V1,IL=K1,fS=Z1,pS=J1,$L=X1,DL=tS,mS=nS,hS=rS,gS=sS;const TF=RL,RF=OL,LL=m.forwardRef(({className:e,children:t,...n},s)=>c.jsxs(uS,{ref:s,className:_e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(AL,{asChild:!0,children:c.jsx(Ro,{className:"h-4 w-4 opacity-50"})})]}));LL.displayName=uS.displayName;const yS=m.forwardRef(({className:e,...t},n)=>c.jsx(mS,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(xN,{className:"h-4 w-4"})}));yS.displayName=mS.displayName;const vS=m.forwardRef(({className:e,...t},n)=>c.jsx(hS,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Ro,{className:"h-4 w-4"})}));vS.displayName=hS.displayName;const zL=m.forwardRef(({className:e,children:t,position:n="popper",...s},i)=>c.jsx(ML,{children:c.jsxs(dS,{ref:i,className:_e("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[c.jsx(yS,{}),c.jsx(IL,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(vS,{})]})}));zL.displayName=dS.displayName;const FL=m.forwardRef(({className:e,...t},n)=>c.jsx(fS,{ref:n,className:_e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));FL.displayName=fS.displayName;const UL=m.forwardRef(({className:e,children:t,...n},s)=>c.jsxs(pS,{ref:s,className:_e("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(DL,{children:c.jsx(Mi,{className:"h-4 w-4"})})}),c.jsx($L,{children:t})]}));UL.displayName=pS.displayName;const BL=m.forwardRef(({className:e,...t},n)=>c.jsx(gS,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));BL.displayName=gS.displayName;const VL=fu("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"}}),Yc=m.forwardRef(({className:e,variant:t,...n},s)=>c.jsx("div",{ref:s,role:"alert",className:_e(VL({variant:t}),e),...n}));Yc.displayName="Alert";const HL=m.forwardRef(({className:e,...t},n)=>c.jsx("h5",{ref:n,className:_e("mb-1 font-medium leading-none tracking-tight",e),...t}));HL.displayName="AlertTitle";const Jc=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:_e("text-sm [&_p]:leading-relaxed",e),...t}));Jc.displayName="AlertDescription";var ww=1,WL=.9,qL=.8,KL=.17,qf=.1,Kf=.999,GL=.9999,QL=.99,ZL=/[\\\/_+.#"@\[\(\{&]/,YL=/[\\\/_+.#"@\[\(\{&]/g,JL=/[\s-]/,wS=/[\s-]/g;function Bp(e,t,n,s,i,l,d){if(l===t.length)return i===e.length?ww:QL;var f=`${i},${l}`;if(d[f]!==void 0)return d[f];for(var g=s.charAt(l),y=n.indexOf(g,i),v=0,p,x,b,N;y>=0;)p=Bp(e,t,n,s,y+1,l+1,d),p>v&&(y===i?p*=ww:ZL.test(e.charAt(y-1))?(p*=qL,b=e.slice(i,y-1).match(YL),b&&i>0&&(p*=Math.pow(Kf,b.length))):JL.test(e.charAt(y-1))?(p*=WL,N=e.slice(i,y-1).match(wS),N&&i>0&&(p*=Math.pow(Kf,N.length))):(p*=KL,i>0&&(p*=Math.pow(Kf,y-i))),e.charAt(y)!==t.charAt(l)&&(p*=GL)),(p<qf&&n.charAt(y-1)===s.charAt(l+1)||s.charAt(l+1)===s.charAt(l)&&n.charAt(y-1)!==s.charAt(l))&&(x=Bp(e,t,n,s,y+1,l+2,d),x*qf>p&&(p=x*qf)),p>v&&(v=p),y=n.indexOf(g,y+1);return d[f]=v,v}function xw(e){return e.toLowerCase().replace(wS," ")}function XL(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Bp(e,t,xw(e),xw(t),0,0,{})}var Sa='[cmdk-group=""]',Gf='[cmdk-group-items=""]',e5='[cmdk-group-heading=""]',xS='[cmdk-item=""]',bw=`${xS}:not([aria-disabled="true"])`,Vp="cmdk-item-select",si="data-value",t5=(e,t,n)=>XL(e,t,n),bS=m.createContext(void 0),sl=()=>m.useContext(bS),SS=m.createContext(void 0),Jm=()=>m.useContext(SS),kS=m.createContext(void 0),_S=m.forwardRef((e,t)=>{let n=ii(()=>{var A,ee;return{search:"",value:(ee=(A=e.value)!=null?A:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=ii(()=>new Set),i=ii(()=>new Map),l=ii(()=>new Map),d=ii(()=>new Set),f=CS(e),{label:g,children:y,value:v,onValueChange:p,filter:x,shouldFilter:b,loop:N,disablePointerSelection:S=!1,vimBindings:C=!0,..._}=e,E=Qt(),T=Qt(),j=Qt(),q=m.useRef(null),V=f5();Es(()=>{if(v!==void 0){let A=v.trim();n.current.value=A,D.emit()}},[v]),Es(()=>{V(6,de)},[]);let D=m.useMemo(()=>({subscribe:A=>(d.current.add(A),()=>d.current.delete(A)),snapshot:()=>n.current,setState:(A,ee,Y)=>{var L,ne,X,oe;if(!Object.is(n.current[A],ee)){if(n.current[A]=ee,A==="search")fe(),I(),V(1,re);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ue=document.getElementById(j);ue?ue.focus():(L=document.getElementById(E))==null||L.focus()}if(V(7,()=>{var ue;n.current.selectedItemId=(ue=ge())==null?void 0:ue.id,D.emit()}),Y||V(5,de),((ne=f.current)==null?void 0:ne.value)!==void 0){let ue=ee??"";(oe=(X=f.current).onValueChange)==null||oe.call(X,ue);return}}D.emit()}},emit:()=>{d.current.forEach(A=>A())}}),[]),$=m.useMemo(()=>({value:(A,ee,Y)=>{var L;ee!==((L=l.current.get(A))==null?void 0:L.value)&&(l.current.set(A,{value:ee,keywords:Y}),n.current.filtered.items.set(A,F(ee,Y)),V(2,()=>{I(),D.emit()}))},item:(A,ee)=>(s.current.add(A),ee&&(i.current.has(ee)?i.current.get(ee).add(A):i.current.set(ee,new Set([A]))),V(3,()=>{fe(),I(),n.current.value||re(),D.emit()}),()=>{l.current.delete(A),s.current.delete(A),n.current.filtered.items.delete(A);let Y=ge();V(4,()=>{fe(),(Y==null?void 0:Y.getAttribute("id"))===A&&re(),D.emit()})}),group:A=>(i.current.has(A)||i.current.set(A,new Set),()=>{l.current.delete(A),i.current.delete(A)}),filter:()=>f.current.shouldFilter,label:g||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:E,inputId:j,labelId:T,listInnerRef:q}),[]);function F(A,ee){var Y,L;let ne=(L=(Y=f.current)==null?void 0:Y.filter)!=null?L:t5;return A?ne(A,n.current.search,ee):0}function I(){if(!n.current.search||f.current.shouldFilter===!1)return;let A=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(L=>{let ne=i.current.get(L),X=0;ne.forEach(oe=>{let ue=A.get(oe);X=Math.max(ue,X)}),ee.push([L,X])});let Y=q.current;ce().sort((L,ne)=>{var X,oe;let ue=L.getAttribute("id"),Te=ne.getAttribute("id");return((X=A.get(Te))!=null?X:0)-((oe=A.get(ue))!=null?oe:0)}).forEach(L=>{let ne=L.closest(Gf);ne?ne.appendChild(L.parentElement===ne?L:L.closest(`${Gf} > *`)):Y.appendChild(L.parentElement===Y?L:L.closest(`${Gf} > *`))}),ee.sort((L,ne)=>ne[1]-L[1]).forEach(L=>{var ne;let X=(ne=q.current)==null?void 0:ne.querySelector(`${Sa}[${si}="${encodeURIComponent(L[0])}"]`);X==null||X.parentElement.appendChild(X)})}function re(){let A=ce().find(Y=>Y.getAttribute("aria-disabled")!=="true"),ee=A==null?void 0:A.getAttribute(si);D.setState("value",ee||void 0)}function fe(){var A,ee,Y,L;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=s.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let X of s.current){let oe=(ee=(A=l.current.get(X))==null?void 0:A.value)!=null?ee:"",ue=(L=(Y=l.current.get(X))==null?void 0:Y.keywords)!=null?L:[],Te=F(oe,ue);n.current.filtered.items.set(X,Te),Te>0&&ne++}for(let[X,oe]of i.current)for(let ue of oe)if(n.current.filtered.items.get(ue)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=ne}function de(){var A,ee,Y;let L=ge();L&&(((A=L.parentElement)==null?void 0:A.firstChild)===L&&((Y=(ee=L.closest(Sa))==null?void 0:ee.querySelector(e5))==null||Y.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function ge(){var A;return(A=q.current)==null?void 0:A.querySelector(`${xS}[aria-selected="true"]`)}function ce(){var A;return Array.from(((A=q.current)==null?void 0:A.querySelectorAll(bw))||[])}function te(A){let ee=ce()[A];ee&&D.setState("value",ee.getAttribute(si))}function ie(A){var ee;let Y=ge(),L=ce(),ne=L.findIndex(oe=>oe===Y),X=L[ne+A];(ee=f.current)!=null&&ee.loop&&(X=ne+A<0?L[L.length-1]:ne+A===L.length?L[0]:L[ne+A]),X&&D.setState("value",X.getAttribute(si))}function G(A){let ee=ge(),Y=ee==null?void 0:ee.closest(Sa),L;for(;Y&&!L;)Y=A>0?u5(Y,Sa):d5(Y,Sa),L=Y==null?void 0:Y.querySelector(bw);L?D.setState("value",L.getAttribute(si)):ie(A)}let Z=()=>te(ce().length-1),U=A=>{A.preventDefault(),A.metaKey?Z():A.altKey?G(1):ie(1)},R=A=>{A.preventDefault(),A.metaKey?te(0):A.altKey?G(-1):ie(-1)};return m.createElement(Ae.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:A=>{var ee;(ee=_.onKeyDown)==null||ee.call(_,A);let Y=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||Y))switch(A.key){case"n":case"j":{C&&A.ctrlKey&&U(A);break}case"ArrowDown":{U(A);break}case"p":case"k":{C&&A.ctrlKey&&R(A);break}case"ArrowUp":{R(A);break}case"Home":{A.preventDefault(),te(0);break}case"End":{A.preventDefault(),Z();break}case"Enter":{A.preventDefault();let L=ge();if(L){let ne=new Event(Vp);L.dispatchEvent(ne)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:m5},g),Ou(e,A=>m.createElement(SS.Provider,{value:D},m.createElement(bS.Provider,{value:$},A))))}),n5=m.forwardRef((e,t)=>{var n,s;let i=Qt(),l=m.useRef(null),d=m.useContext(kS),f=sl(),g=CS(e),y=(s=(n=g.current)==null?void 0:n.forceMount)!=null?s:d==null?void 0:d.forceMount;Es(()=>{if(!y)return f.item(i,d==null?void 0:d.id)},[y]);let v=NS(i,l,[e.value,e.children,l],e.keywords),p=Jm(),x=Lo(V=>V.value&&V.value===v.current),b=Lo(V=>y||f.filter()===!1?!0:V.search?V.filtered.items.get(i)>0:!0);m.useEffect(()=>{let V=l.current;if(!(!V||e.disabled))return V.addEventListener(Vp,N),()=>V.removeEventListener(Vp,N)},[b,e.onSelect,e.disabled]);function N(){var V,D;S(),(D=(V=g.current).onSelect)==null||D.call(V,v.current)}function S(){p.setState("value",v.current,!0)}if(!b)return null;let{disabled:C,value:_,onSelect:E,forceMount:T,keywords:j,...q}=e;return m.createElement(Ae.div,{ref:vn(l,t),...q,id:i,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!x,"data-disabled":!!C,"data-selected":!!x,onPointerMove:C||f.getDisablePointerSelection()?void 0:S,onClick:C?void 0:N},e.children)}),r5=m.forwardRef((e,t)=>{let{heading:n,children:s,forceMount:i,...l}=e,d=Qt(),f=m.useRef(null),g=m.useRef(null),y=Qt(),v=sl(),p=Lo(b=>i||v.filter()===!1?!0:b.search?b.filtered.groups.has(d):!0);Es(()=>v.group(d),[]),NS(d,f,[e.value,e.heading,g]);let x=m.useMemo(()=>({id:d,forceMount:i}),[i]);return m.createElement(Ae.div,{ref:vn(f,t),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:y},n),Ou(e,b=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?y:void 0},m.createElement(kS.Provider,{value:x},b))))}),o5=m.forwardRef((e,t)=>{let{alwaysRender:n,...s}=e,i=m.useRef(null),l=Lo(d=>!d.search);return!n&&!l?null:m.createElement(Ae.div,{ref:vn(i,t),...s,"cmdk-separator":"",role:"separator"})}),s5=m.forwardRef((e,t)=>{let{onValueChange:n,...s}=e,i=e.value!=null,l=Jm(),d=Lo(y=>y.search),f=Lo(y=>y.selectedItemId),g=sl();return m.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),m.createElement(Ae.input,{ref:t,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":f,id:g.inputId,type:"text",value:i?e.value:d,onChange:y=>{i||l.setState("search",y.target.value),n==null||n(y.target.value)}})}),i5=m.forwardRef((e,t)=>{let{children:n,label:s="Suggestions",...i}=e,l=m.useRef(null),d=m.useRef(null),f=Lo(y=>y.selectedItemId),g=sl();return m.useEffect(()=>{if(d.current&&l.current){let y=d.current,v=l.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=y.offsetHeight;v.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(y),()=>{cancelAnimationFrame(p),x.unobserve(y)}}},[]),m.createElement(Ae.div,{ref:vn(l,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":s,id:g.listId},Ou(e,y=>m.createElement("div",{ref:vn(d,g.listInnerRef),"cmdk-list-sizer":""},y)))}),a5=m.forwardRef((e,t)=>{let{open:n,onOpenChange:s,overlayClassName:i,contentClassName:l,container:d,...f}=e;return m.createElement(B0,{open:n,onOpenChange:s},m.createElement(V0,{container:d},m.createElement(Em,{"cmdk-overlay":"",className:i}),m.createElement(Pm,{"aria-label":e.label,"cmdk-dialog":"",className:l},m.createElement(_S,{ref:t,...f}))))}),l5=m.forwardRef((e,t)=>Lo(n=>n.filtered.count===0)?m.createElement(Ae.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),c5=m.forwardRef((e,t)=>{let{progress:n,children:s,label:i="Loading...",...l}=e;return m.createElement(Ae.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Ou(e,d=>m.createElement("div",{"aria-hidden":!0},d)))}),xn=Object.assign(_S,{List:i5,Item:n5,Input:s5,Group:r5,Separator:o5,Dialog:a5,Empty:l5,Loading:c5});function u5(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function d5(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function CS(e){let t=m.useRef(e);return Es(()=>{t.current=e}),t}var Es=typeof window>"u"?m.useEffect:m.useLayoutEffect;function ii(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Lo(e){let t=Jm(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function NS(e,t,n,s=[]){let i=m.useRef(),l=sl();return Es(()=>{var d;let f=(()=>{var y;for(let v of n){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(y=v.current.textContent)==null?void 0:y.trim():i.current}})(),g=s.map(y=>y.trim());l.value(e,f,g),(d=t.current)==null||d.setAttribute(si,f),i.current=f}),i}var f5=()=>{let[e,t]=m.useState(),n=ii(()=>new Map);return Es(()=>{n.current.forEach(s=>s()),n.current=new Map},[e]),(s,i)=>{n.current.set(s,i),t({})}};function p5(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ou({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(p5(t),{ref:t.ref},n(t.props.children)):n(t)}var m5={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const h5=m.forwardRef(({className:e,...t},n)=>c.jsx(xn,{ref:n,className:_e("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));h5.displayName=xn.displayName;const g5=m.forwardRef(({className:e,...t},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(OM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(xn.Input,{ref:n,className:_e("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));g5.displayName=xn.Input.displayName;const y5=m.forwardRef(({className:e,...t},n)=>c.jsx(xn.List,{ref:n,className:_e("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));y5.displayName=xn.List.displayName;const v5=m.forwardRef((e,t)=>c.jsx(xn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));v5.displayName=xn.Empty.displayName;const w5=m.forwardRef(({className:e,...t},n)=>c.jsx(xn.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));w5.displayName=xn.Group.displayName;const x5=m.forwardRef(({className:e,...t},n)=>c.jsx(xn.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));x5.displayName=xn.Separator.displayName;const b5=m.forwardRef(({className:e,...t},n)=>c.jsx(xn.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));b5.displayName=xn.Item.displayName;const Xc=m.forwardRef(({className:e,type:t,...n},s)=>c.jsx("input",{type:t,className:_e("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:s,...n}));Xc.displayName="Input";const S5=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));S5.displayName="Card";const k5=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));k5.displayName="CardHeader";const _5=m.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));_5.displayName="CardTitle";const C5=m.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));C5.displayName="CardDescription";const N5=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));N5.displayName="CardContent";const E5=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));E5.displayName="CardFooter";var Au="Checkbox",[P5]=cr(Au),[j5,Xm]=P5(Au);function T5(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:i,disabled:l,form:d,name:f,onCheckedChange:g,required:y,value:v="on",internal_do_not_use_render:p}=e,[x,b]=Oo({prop:n,defaultProp:i??!1,onChange:g,caller:Au}),[N,S]=m.useState(null),[C,_]=m.useState(null),E=m.useRef(!1),T=N?!!d||!!N.closest("form"):!0,j={checked:x,disabled:l,setChecked:b,control:N,setControl:S,name:f,form:d,value:v,hasConsumerStoppedPropagationRef:E,required:y,defaultChecked:To(i)?!1:i,isFormControl:T,bubbleInput:C,setBubbleInput:_};return c.jsx(j5,{scope:t,...j,children:R5(p)?p(j):s})}var ES="CheckboxTrigger",PS=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...s},i)=>{const{control:l,value:d,disabled:f,checked:g,required:y,setControl:v,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:N}=Xm(ES,e),S=qe(i,v),C=m.useRef(g);return m.useEffect(()=>{const _=l==null?void 0:l.form;if(_){const E=()=>p(C.current);return _.addEventListener("reset",E),()=>_.removeEventListener("reset",E)}},[l,p]),c.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":To(g)?"mixed":g,"aria-required":y,"data-state":AS(g),"data-disabled":f?"":void 0,disabled:f,value:d,...s,ref:S,onKeyDown:Se(t,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:Se(n,_=>{p(E=>To(E)?!0:!E),N&&b&&(x.current=_.isPropagationStopped(),x.current||_.stopPropagation())})})});PS.displayName=ES;var eh=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:s,checked:i,defaultChecked:l,required:d,disabled:f,value:g,onCheckedChange:y,form:v,...p}=e;return c.jsx(T5,{__scopeCheckbox:n,checked:i,defaultChecked:l,disabled:f,required:d,onCheckedChange:y,name:s,form:v,value:g,internal_do_not_use_render:({isFormControl:x})=>c.jsxs(c.Fragment,{children:[c.jsx(PS,{...p,ref:t,__scopeCheckbox:n}),x&&c.jsx(OS,{__scopeCheckbox:n})]})})});eh.displayName=Au;var jS="CheckboxIndicator",TS=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:s,...i}=e,l=Xm(jS,n);return c.jsx(wn,{present:s||To(l.checked)||l.checked===!0,children:c.jsx(Ae.span,{"data-state":AS(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});TS.displayName=jS;var RS="CheckboxBubbleInput",OS=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:s,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:d,required:f,disabled:g,name:y,value:v,form:p,bubbleInput:x,setBubbleInput:b}=Xm(RS,e),N=qe(n,b),S=Zm(l),C=Fm(s);m.useEffect(()=>{const E=x;if(!E)return;const T=window.HTMLInputElement.prototype,q=Object.getOwnPropertyDescriptor(T,"checked").set,V=!i.current;if(S!==l&&q){const D=new Event("click",{bubbles:V});E.indeterminate=To(l),q.call(E,To(l)?!1:l),E.dispatchEvent(D)}},[x,S,l,i]);const _=m.useRef(To(l)?!1:l);return c.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??_.current,required:f,disabled:g,name:y,value:v,form:p,...t,tabIndex:-1,ref:N,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});OS.displayName=RS;function R5(e){return typeof e=="function"}function To(e){return e==="indeterminate"}function AS(e){return To(e)?"indeterminate":e?"checked":"unchecked"}const O5=m.forwardRef(({className:e,...t},n)=>c.jsx(eh,{ref:n,className:_e("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(TS,{className:_e("flex items-center justify-center text-current"),children:c.jsx(Mi,{className:"h-4 w-4"})})}));O5.displayName=eh.displayName;function MS(e){if(!e)return null;const t=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d+)?$/.test(e)?`${e.replace(" ","T")}Z`:e,n=new Date(t);return isNaN(n.getTime())?null:n}function Sw(e){var t;return((t=MS(e))==null?void 0:t.toLocaleString())??""}function OF(e){var l;const t=(l=MS(e))==null?void 0:l.getTime();if(t==null)return"";const n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"just now";const s=Math.floor(n/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}const IS=m.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:_e("flex min-h-[82px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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:n,...t}));IS.displayName="Textarea";function A5({open:e,onOpenChange:t,title:n,description:s,warning:i,label:l,optionalReason:d,placeholder:f,confirmLabel:g,destructive:y,priorDecline:v,secondaryLabel:p,onSecondary:x,onConfirm:b}){const[N,S]=m.useState(""),[C,_]=m.useState(null),E=C!==null,[T,j]=m.useState(null),q=F=>{E||(F||(S(""),j(null)),t(F))},V=async(F,I)=>{_(F),j(null);try{await I(N.trim()),S(""),t(!1)}catch(re){j((re==null?void 0:re.message)||"Something went wrong")}finally{_(null)}},D=()=>V("confirm",b),$=E||!!l&&!d&&!N.trim();return c.jsx(ks,{open:e,onOpenChange:q,children:c.jsxs(Ao,{className:"sm:max-w-[440px]",children:[c.jsxs(Mo,{children:[c.jsx(Io,{children:n}),s&&c.jsx($o,{children:s})]}),i&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-medium text-amber-900",role:"alert","data-testid":"reason-dialog-warning",children:[c.jsx(EE,{className:"h-4 w-4 shrink-0"}),i]}),v&&c.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 space-y-1","data-testid":"reason-dialog-prior-decline",children:[c.jsxs("p",{className:"font-medium",children:["Rejected",v.resolvedBy?` by ${v.resolvedBy}`:"",Sw(v.resolvedAt)?` · ${Sw(v.resolvedAt)}`:""]}),v.resolutionNote&&c.jsxs("p",{children:["“",v.resolutionNote,"”"]}),v.reason&&c.jsxs("p",{className:"text-amber-800/80",children:["Asked before: “",v.reason,"”"]})]}),l&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oi,{htmlFor:"reason-dialog-input",children:l}),c.jsx(IS,{id:"reason-dialog-input",autoFocus:!0,rows:3,value:N,placeholder:f,onChange:F=>S(F.target.value),"data-testid":"reason-dialog-input"})]}),T&&c.jsxs(Yc,{variant:"destructive",children:[c.jsx(Ta,{className:"h-4 w-4"}),c.jsx(Jc,{children:T})]}),c.jsxs(wu,{children:[c.jsx(Ye,{variant:"outline",onClick:()=>q(!1),disabled:E,children:"Cancel"}),p&&x&&c.jsxs(Ye,{variant:"outline",onClick:()=>V("secondary",x),disabled:$,"data-testid":"reason-dialog-secondary",children:[C==="secondary"&&c.jsx(Cr,{className:"h-4 w-4 mr-2 animate-spin"}),p]}),c.jsxs(Ye,{onClick:D,disabled:$,variant:y?"destructive":"default","data-testid":"reason-dialog-confirm",children:[C==="confirm"&&c.jsx(Cr,{className:"h-4 w-4 mr-2 animate-spin"}),g]})]})]})})}function M5(e,t){return m.useReducer((n,s)=>t[n][s]??n,e)}var th="ScrollArea",[$S]=cr(th),[I5,Wn]=$S(th),DS=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:l=600,...d}=e,[f,g]=m.useState(null),[y,v]=m.useState(null),[p,x]=m.useState(null),[b,N]=m.useState(null),[S,C]=m.useState(null),[_,E]=m.useState(0),[T,j]=m.useState(0),[q,V]=m.useState(!1),[D,$]=m.useState(!1),F=qe(t,re=>g(re)),I=el(i);return c.jsx(I5,{scope:n,type:s,dir:I,scrollHideDelay:l,scrollArea:f,viewport:y,onViewportChange:v,content:p,onContentChange:x,scrollbarX:b,onScrollbarXChange:N,scrollbarXEnabled:q,onScrollbarXEnabledChange:V,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:D,onScrollbarYEnabledChange:$,onCornerWidthChange:E,onCornerHeightChange:j,children:c.jsx(Ae.div,{dir:I,...d,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});DS.displayName=th;var LS="ScrollAreaViewport",zS=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:s,nonce:i,...l}=e,d=Wn(LS,n),f=m.useRef(null),g=qe(t,f,d.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),c.jsx(Ae.div,{"data-radix-scroll-area-viewport":"",...l,ref:g,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});zS.displayName=LS;var jr="ScrollAreaScrollbar",nh=m.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=Wn(jr,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:d}=i,f=e.orientation==="horizontal";return m.useEffect(()=>(f?l(!0):d(!0),()=>{f?l(!1):d(!1)}),[f,l,d]),i.type==="hover"?c.jsx($5,{...s,ref:t,forceMount:n}):i.type==="scroll"?c.jsx(D5,{...s,ref:t,forceMount:n}):i.type==="auto"?c.jsx(FS,{...s,ref:t,forceMount:n}):i.type==="always"?c.jsx(rh,{...s,ref:t}):null});nh.displayName=jr;var $5=m.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=Wn(jr,e.__scopeScrollArea),[l,d]=m.useState(!1);return m.useEffect(()=>{const f=i.scrollArea;let g=0;if(f){const y=()=>{window.clearTimeout(g),d(!0)},v=()=>{g=window.setTimeout(()=>d(!1),i.scrollHideDelay)};return f.addEventListener("pointerenter",y),f.addEventListener("pointerleave",v),()=>{window.clearTimeout(g),f.removeEventListener("pointerenter",y),f.removeEventListener("pointerleave",v)}}},[i.scrollArea,i.scrollHideDelay]),c.jsx(wn,{present:n||l,children:c.jsx(FS,{"data-state":l?"visible":"hidden",...s,ref:t})})}),D5=m.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=Wn(jr,e.__scopeScrollArea),l=e.orientation==="horizontal",d=Iu(()=>g("SCROLL_END"),100),[f,g]=M5("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(f==="idle"){const y=window.setTimeout(()=>g("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(y)}},[f,i.scrollHideDelay,g]),m.useEffect(()=>{const y=i.viewport,v=l?"scrollLeft":"scrollTop";if(y){let p=y[v];const x=()=>{const b=y[v];p!==b&&(g("SCROLL"),d()),p=b};return y.addEventListener("scroll",x),()=>y.removeEventListener("scroll",x)}},[i.viewport,l,g,d]),c.jsx(wn,{present:n||f!=="hidden",children:c.jsx(rh,{"data-state":f==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>g("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>g("POINTER_LEAVE"))})})}),FS=m.forwardRef((e,t)=>{const n=Wn(jr,e.__scopeScrollArea),{forceMount:s,...i}=e,[l,d]=m.useState(!1),f=e.orientation==="horizontal",g=Iu(()=>{if(n.viewport){const y=n.viewport.offsetWidth<n.viewport.scrollWidth,v=n.viewport.offsetHeight<n.viewport.scrollHeight;d(f?y:v)}},10);return Ai(n.viewport,g),Ai(n.content,g),c.jsx(wn,{present:s||l,children:c.jsx(rh,{"data-state":l?"visible":"hidden",...i,ref:t})})}),rh=m.forwardRef((e,t)=>{const{orientation:n="vertical",...s}=e,i=Wn(jr,e.__scopeScrollArea),l=m.useRef(null),d=m.useRef(0),[f,g]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),y=WS(f.viewport,f.content),v={...s,sizes:f,onSizesChange:g,hasThumb:y>0&&y<1,onThumbChange:x=>l.current=x,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:x=>d.current=x};function p(x,b){return V5(x,d.current,f,b)}return n==="horizontal"?c.jsx(L5,{...v,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const x=i.viewport.scrollLeft,b=kw(x,f,i.dir);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollLeft=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollLeft=p(x,i.dir))}}):n==="vertical"?c.jsx(z5,{...v,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const x=i.viewport.scrollTop,b=kw(x,f);l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollTop=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollTop=p(x))}}):null}),L5=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:s,...i}=e,l=Wn(jr,e.__scopeScrollArea),[d,f]=m.useState(),g=m.useRef(null),y=qe(t,g,l.onScrollbarXChange);return m.useEffect(()=>{g.current&&f(getComputedStyle(g.current))},[g]),c.jsx(BS,{"data-orientation":"horizontal",...i,ref:y,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Mu(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,p)=>{if(l.viewport){const x=l.viewport.scrollLeft+v.deltaX;e.onWheelScroll(x),KS(x,p)&&v.preventDefault()}},onResize:()=>{g.current&&l.viewport&&d&&s({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:g.current.clientWidth,paddingStart:tu(d.paddingLeft),paddingEnd:tu(d.paddingRight)}})}})}),z5=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:s,...i}=e,l=Wn(jr,e.__scopeScrollArea),[d,f]=m.useState(),g=m.useRef(null),y=qe(t,g,l.onScrollbarYChange);return m.useEffect(()=>{g.current&&f(getComputedStyle(g.current))},[g]),c.jsx(BS,{"data-orientation":"vertical",...i,ref:y,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Mu(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,p)=>{if(l.viewport){const x=l.viewport.scrollTop+v.deltaY;e.onWheelScroll(x),KS(x,p)&&v.preventDefault()}},onResize:()=>{g.current&&l.viewport&&d&&s({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:g.current.clientHeight,paddingStart:tu(d.paddingTop),paddingEnd:tu(d.paddingBottom)}})}})}),[F5,US]=$S(jr),BS=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:l,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:g,onDragScroll:y,onWheelScroll:v,onResize:p,...x}=e,b=Wn(jr,n),[N,S]=m.useState(null),C=qe(t,F=>S(F)),_=m.useRef(null),E=m.useRef(""),T=b.viewport,j=s.content-s.viewport,q=Dt(v),V=Dt(g),D=Iu(p,10);function $(F){if(_.current){const I=F.clientX-_.current.left,re=F.clientY-_.current.top;y({x:I,y:re})}}return m.useEffect(()=>{const F=I=>{const re=I.target;(N==null?void 0:N.contains(re))&&q(I,j)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[T,N,j,q]),m.useEffect(V,[s,V]),Ai(N,D),Ai(b.content,D),c.jsx(F5,{scope:n,scrollbar:N,hasThumb:i,onThumbChange:Dt(l),onThumbPointerUp:Dt(d),onThumbPositionChange:V,onThumbPointerDown:Dt(f),children:c.jsx(Ae.div,{...x,ref:C,style:{position:"absolute",...x.style},onPointerDown:Se(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),_.current=N.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),$(F))}),onPointerMove:Se(e.onPointerMove,$),onPointerUp:Se(e.onPointerUp,F=>{const I=F.target;I.hasPointerCapture(F.pointerId)&&I.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=E.current,b.viewport&&(b.viewport.style.scrollBehavior=""),_.current=null})})})}),eu="ScrollAreaThumb",VS=m.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=US(eu,e.__scopeScrollArea);return c.jsx(wn,{present:n||i.hasThumb,children:c.jsx(U5,{ref:t,...s})})}),U5=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:s,...i}=e,l=Wn(eu,n),d=US(eu,n),{onThumbPositionChange:f}=d,g=qe(t,p=>d.onThumbChange(p)),y=m.useRef(void 0),v=Iu(()=>{y.current&&(y.current(),y.current=void 0)},100);return m.useEffect(()=>{const p=l.viewport;if(p){const x=()=>{if(v(),!y.current){const b=H5(p,f);y.current=b,f()}};return f(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[l.viewport,v,f]),c.jsx(Ae.div,{"data-state":d.hasThumb?"visible":"hidden",...i,ref:g,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Se(e.onPointerDownCapture,p=>{const b=p.target.getBoundingClientRect(),N=p.clientX-b.left,S=p.clientY-b.top;d.onThumbPointerDown({x:N,y:S})}),onPointerUp:Se(e.onPointerUp,d.onThumbPointerUp)})});VS.displayName=eu;var oh="ScrollAreaCorner",HS=m.forwardRef((e,t)=>{const n=Wn(oh,e.__scopeScrollArea),s=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&s?c.jsx(B5,{...e,ref:t}):null});HS.displayName=oh;var B5=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...s}=e,i=Wn(oh,n),[l,d]=m.useState(0),[f,g]=m.useState(0),y=!!(l&&f);return Ai(i.scrollbarX,()=>{var p;const v=((p=i.scrollbarX)==null?void 0:p.offsetHeight)||0;i.onCornerHeightChange(v),g(v)}),Ai(i.scrollbarY,()=>{var p;const v=((p=i.scrollbarY)==null?void 0:p.offsetWidth)||0;i.onCornerWidthChange(v),d(v)}),y?c.jsx(Ae.div,{...s,ref:t,style:{width:l,height:f,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function tu(e){return e?parseInt(e,10):0}function WS(e,t){const n=e/t;return isNaN(n)?0:n}function Mu(e){const t=WS(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-n)*t;return Math.max(s,18)}function V5(e,t,n,s="ltr"){const i=Mu(n),l=i/2,d=t||l,f=i-d,g=n.scrollbar.paddingStart+d,y=n.scrollbar.size-n.scrollbar.paddingEnd-f,v=n.content-n.viewport,p=s==="ltr"?[0,v]:[v*-1,0];return qS([g,y],p)(e)}function kw(e,t,n="ltr"){const s=Mu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-i,d=t.content-t.viewport,f=l-s,g=n==="ltr"?[0,d]:[d*-1,0],y=$p(e,g);return qS([0,d],[0,f])(y)}function qS(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(n-e[0])}}function KS(e,t){return e>0&&e<t}var H5=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},s=0;return(function i(){const l={left:e.scrollLeft,top:e.scrollTop},d=n.left!==l.left,f=n.top!==l.top;(d||f)&&t(),n=l,s=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(s)};function Iu(e,t){const n=Dt(e),s=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(s.current),[]),m.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(n,t)},[n,t])}function Ai(e,t){const n=Dt(t);_t(()=>{let s=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(s),i.unobserve(e)}}},[e,n])}var GS=DS,W5=zS,q5=HS;const K5=m.forwardRef(({className:e,children:t,...n},s)=>c.jsxs(GS,{ref:s,className:_e("relative overflow-hidden",e),...n,children:[c.jsx(W5,{className:"h-full w-full rounded-[inherit] [&>div]:!block [&>div]:!min-w-0",children:t}),c.jsx(QS,{}),c.jsx(q5,{})]}));K5.displayName=GS.displayName;const QS=m.forwardRef(({className:e,orientation:t="vertical",...n},s)=>c.jsx(nh,{ref:s,orientation:t,className:_e("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:c.jsx(VS,{className:"relative flex-1 rounded-full bg-border"})}));QS.displayName=nh.displayName;var $u="Switch",[G5]=cr($u),[Q5,Z5]=G5($u),ZS=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:l,required:d,disabled:f,value:g="on",onCheckedChange:y,form:v,...p}=e,[x,b]=m.useState(null),N=qe(t,T=>b(T)),S=m.useRef(!1),C=x?v||!!x.closest("form"):!0,[_,E]=Oo({prop:i,defaultProp:l??!1,onChange:y,caller:$u});return c.jsxs(Q5,{scope:n,checked:_,disabled:f,children:[c.jsx(Ae.button,{type:"button",role:"switch","aria-checked":_,"aria-required":d,"data-state":ek(_),"data-disabled":f?"":void 0,disabled:f,value:g,...p,ref:N,onClick:Se(e.onClick,T=>{E(j=>!j),C&&(S.current=T.isPropagationStopped(),S.current||T.stopPropagation())})}),C&&c.jsx(XS,{control:x,bubbles:!S.current,name:s,value:g,checked:_,required:d,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});ZS.displayName=$u;var YS="SwitchThumb",JS=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...s}=e,i=Z5(YS,n);return c.jsx(Ae.span,{"data-state":ek(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})});JS.displayName=YS;var Y5="SwitchBubbleInput",XS=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:s=!0,...i},l)=>{const d=m.useRef(null),f=qe(d,l),g=Zm(n),y=Fm(t);return m.useEffect(()=>{const v=d.current;if(!v)return;const p=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(p,"checked").set;if(g!==n&&b){const N=new Event("click",{bubbles:s});b.call(v,n),v.dispatchEvent(N)}},[g,n,s]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:f,style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});XS.displayName=Y5;function ek(e){return e?"checked":"unchecked"}var tk=ZS,J5=JS;const nk=m.forwardRef(({className:e,...t},n)=>c.jsx(tk,{className:_e("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:n,children:c.jsx(J5,{className:_e("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")})}));nk.displayName=tk.displayName;var Du="Tabs",[X5]=cr(Du,[Cu]),rk=Cu(),[e4,sh]=X5(Du),ok=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:i,defaultValue:l,orientation:d="horizontal",dir:f,activationMode:g="automatic",...y}=e,v=el(f),[p,x]=Oo({prop:s,onChange:i,defaultProp:l??"",caller:Du});return c.jsx(e4,{scope:n,baseId:Qt(),value:p,onValueChange:x,orientation:d,dir:v,activationMode:g,children:c.jsx(Ae.div,{dir:v,"data-orientation":d,...y,ref:t})})});ok.displayName=Du;var sk="TabsList",ik=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...i}=e,l=sh(sk,n),d=rk(n);return c.jsx($b,{asChild:!0,...d,orientation:l.orientation,dir:l.dir,loop:s,children:c.jsx(Ae.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});ik.displayName=sk;var ak="TabsTrigger",lk=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:i=!1,...l}=e,d=sh(ak,n),f=rk(n),g=dk(d.baseId,s),y=fk(d.baseId,s),v=s===d.value;return c.jsx(Db,{asChild:!0,...f,focusable:!i,active:v,children:c.jsx(Ae.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":y,"data-state":v?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:g,...l,ref:t,onMouseDown:Se(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?d.onValueChange(s):p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&d.onValueChange(s)}),onFocus:Se(e.onFocus,()=>{const p=d.activationMode!=="manual";!v&&!i&&p&&d.onValueChange(s)})})})});lk.displayName=ak;var ck="TabsContent",uk=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:i,children:l,...d}=e,f=sh(ck,n),g=dk(f.baseId,s),y=fk(f.baseId,s),v=s===f.value,p=m.useRef(v);return m.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),c.jsx(wn,{present:i||v,children:({present:x})=>c.jsx(Ae.div,{"data-state":v?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":g,hidden:!x,id:y,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&l})})});uk.displayName=ck;function dk(e,t){return`${e}-trigger-${t}`}function fk(e,t){return`${e}-content-${t}`}var t4=ok,pk=ik,mk=lk,hk=uk;const gk=t4,ih=m.forwardRef(({className:e,...t},n)=>c.jsx(pk,{ref:n,className:_e("inline-flex min-h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ih.displayName=pk.displayName;const ss=m.forwardRef(({className:e,...t},n)=>c.jsx(mk,{ref:n,className:_e("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}));ss.displayName=mk.displayName;const ai=m.forwardRef(({className:e,...t},n)=>c.jsx(hk,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ai.displayName=hk.displayName;const n4="__all__",r4=60;function AF(e,t){var s;return e.nest_id?{kind:"nest",label:`Nest: ${((s=t==null?void 0:t.find(i=>i.id===e.nest_id))==null?void 0:s.name)||`${e.nest_id} (not in your list)`}`,nestId:e.nest_id}:{kind:"all",label:"All your nests"}}function MF(e,t){const n=e.trim();return t===n4?{label:n}:{label:n,nest_id:t}}function o4(e,t){const n=new Set(t.map(s=>(s??"").trim().toLowerCase()));for(let s=1;;s++){const i=s===1?" only":` only ${s}`,d=`${e.trim().slice(0,r4-i.length)}${i}`;if(!n.has(d.toLowerCase()))return d}}const Ur="<paste-your-api-key-here>";function IF(e){const t=e.reduce((n,s)=>{const i=Number(s.document_count??0);return n+(Number.isFinite(i)?i:0)},0);return{nestCount:e.length,documentCount:t}}function s4(e){return`${e.replace(/\/+$/,"")}/mcp`}function $F(e,t=!1){return["Connect to all my ContextNest nests and treat them as my source of truth.","",`Add one MCP server "contextnest" at: ${s4(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(`
396
- `)}function i4(e){const{serverUrl:t,apiKey:n,nestId:s}=e;return["# ContextNest — keep this secret. Do not commit this file.",`CONTEXTNEST_SERVER=${t.replace(/\/+$/,"")}`,s?`CONTEXTNEST_NEST=${s}`:null,`CONTEXTNEST_API_KEY=${n}`,""].filter(Boolean).join(`
397
- `)}function a4(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(`
398
- `)}function il(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"nest"}function yk(e,t,n,s=!1){const i=e.replace(/\/+$/,""),l=il(n);return[`ctx vault add ${l} --url ${i}/nests/${t}/mcp${s?"":" --bearer-env CONTEXTNEST_API_KEY"}`,`ctx query "#tag" --vault ${l}`].join(`
399
- `)}function l4(e,t,n,s=!1){const i=t.replace(/\/+$/,""),l=`${i}/nests/${n}/mcp`,d=s?"":'-H "Authorization: Bearer $CONTEXTNEST_API_KEY" ',f=s?"":` ${d.trimEnd()}`;return[`Connect to my ContextNest nest "${e}" and treat it as my source of truth.`,"",s?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.",s?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 ${i}/nests/${n}/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' "${i}/nests/${n}/export?format=markdown"${f}`," 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' "${i}/nests/${n}/nodes"${f}`,` curl -s -w '\\nHTTP_STATUS:%{http_code}\\n' "${i}/nests/${n}/nodes/<id-from-the-list>"${f}`," 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.",s?null:" 401 the key is missing or wrong. Also check you did not send the literal text",s?null:" `$CONTEXTNEST_API_KEY`: that happens when the command runs without a shell to",s?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 ${i}/nests/${n}/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 ${l}${s?"":" (Bearer header)"}`,...yk(i,n,e,s).split(`
400
- `).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(`
401
- `)}function c4(e,t,n=!1){return JSON.stringify({mcpServers:{[il(e)]:{command:"npx",args:["-y","mcp-remote",t,...n?[]:["--header",`Authorization: Bearer ${Ur}`]]}}},null,2)}function u4(e,t,n=!1){return`claude mcp add --transport http ${il(e)} ${t}${n?"":` --header "Authorization: Bearer ${Ur}"`}`}function d4(e,t,n=!1){return JSON.stringify({mcpServers:{[il(e)]:{url:t,...n?{}:{headers:{Authorization:`Bearer ${Ur}`}}}}},null,2)}function f4({isOpen:e,onClose:t,nestId:n,nestName:s,onManageKeys:i}){const{authenticated:l,authMode:d}=Ja(),f=typeof window<"u"?window.location.origin:"http://localhost:3838",g=`${f}/nests/${n}/mcp`,y=`${f}/nests/${n}/export?format=markdown`,[v,p]=m.useState(!1),[x,b]=m.useState(!1),[N,S]=m.useState(!1),[C,_]=m.useState(!1),[E,T]=m.useState(!1),[j,q]=m.useState(!1),[V,D]=m.useState(null),$=Xa(),F=l&&d!=="open",{data:I}=$P({enabled:e&&F}),[re,fe]=m.useState(null),[de,ge]=m.useState(null),[ce,te]=m.useState(null),ie=((I==null?void 0:I.keys)??[]).filter(ye=>ye.nest_id===n),G=async ye=>{D(null),fe(ye??"new");try{if(ye){const Ve=await WE({key_id:ye});ge({key:Ve.api_key,kind:"rotated"})}else{const Ve=o4(s,((I==null?void 0:I.keys)??[]).map(Lt=>Lt.label)),Ge=await HE({label:Ve,nest_id:n});ge({key:Ge.api_key,kind:"generated"})}}catch(Ve){D((Ve==null?void 0:Ve.message)||"Couldn't create a key for this nest.")}finally{$.invalidateQueries({queryKey:Bt.apiKeys().queryKey}),fe(null)}};m.useEffect(()=>{e||D(null)},[e]);const Z=async()=>{D(null),b(!0);try{await u2(n,{nestName:s,includeDrafts:C}),S(!1)}catch(ye){D((ye==null?void 0:ye.message)||"Bundle export failed")}finally{b(!1)}},U=async()=>{D(null),p(!0);try{const ye=await c2(n),Ve=URL.createObjectURL(new Blob([ye],{type:"text/markdown"})),Ge=document.createElement("a");Ge.href=Ve,Ge.download=`${il(s)}.md`,document.body.appendChild(Ge),Ge.click(),Ge.remove(),URL.revokeObjectURL(Ve)}catch(ye){D((ye==null?void 0:ye.message)||"Export failed")}finally{p(!1)}},R=d==="open",A=c4(s,g,R),ee=u4(s,g,R),Y=d4(s,g,R),L=R,ne=!l&&d==="key",X=L?"":` \\
402
- -H "Authorization: Bearer ${Ur}"`,oe=`curl -X POST ${f}/nests/${n}/context \\
403
- -H "Content-Type: application/json"${X} \\
404
- -d '{"selector": "#gtm", "hops": 2, "max_tokens": 4000}'`,ue=`curl "${f}/nests/${n}/nodes/nodes/<slug>?format=markdown"${X}`,Te=yk(f,n,s,L),Fe=L?`ctx push --server ${f} --nest ${n}`:`CONTEXTNEST_API_KEY=${Ur} ctx push --server ${f} --nest ${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(ks,{open:e,onOpenChange:t,children:c.jsxs(Ao,{className:"sm:max-w-[640px] max-h-[85vh] flex flex-col overflow-hidden [&>*]:min-w-0",children:[c.jsxs(Mo,{children:[c.jsxs(Io,{children:["Connect to ",s]}),c.jsx($o,{children:"Use this nest in the app you already have. New to this? Start on the Hootie tab — it's the quickest way in."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden min-w-0 space-y-4",children:[c.jsxs("div",{className:"rounded-lg border-2 border-primary/30 bg-primary/5 p-3.5",children:[c.jsx("p",{className:"text-sm font-semibold",children:"Now paste into your AI agent or harness"}),c.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."}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(Ye,{size:"sm",onClick:()=>Pi(a4(s),"Chat prompt copied"),children:[c.jsx(XN,{className:"mr-1.5 h-3.5 w-3.5"}),"Chat with this nest"]}),c.jsxs(Ye,{size:"sm",onClick:()=>Pi(l4(s,f,n,L),"Setup prompt copied"),children:[c.jsx(_E,{className:"mr-1.5 h-3.5 w-3.5"}),"Set up an agent"]})]})]}),ne&&c.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:[c.jsx(Ta,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),c.jsx("span",{children:"You're not logged in. Login from the header to generate an API key for external clients."})]}),L&&c.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:[c.jsx(Ta,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),c.jsxs("span",{children:["Server is in ",c.jsx("strong",{children:"open"})," mode — anyone on the network can read/write without a key. The snippets below omit the Authorization header."]})]}),V&&c.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:[c.jsx(Ta,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),c.jsx("span",{children:V})]}),l&&!L&&c.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2",children:[c.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[c.jsx(tv,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"font-medium truncate",children:"External-client API key"})]}),i&&c.jsx(Ye,{variant:"outline",size:"sm",className:"shrink-0",onClick:i,children:"Manage API keys"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the key you already have — an all-nests key works here too. Handing this nest to an agent or integration that shouldn't see anything else? Create a key for this nest only: it works with this nest's MCP URL below, and every other nest, your account and your API keys answer 403. Revoke keys on the API keys page; a key is shown only once, when it's created or rotated."}),ie.length>0?ie.map(ye=>c.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border px-2.5 py-1.5",children:[c.jsxs("div",{className:"min-w-0 text-xs",children:[c.jsx("span",{className:"font-medium",children:ye.label||"Untitled key"})," ",c.jsxs("code",{className:"font-mono text-muted-foreground",children:[ye.key_prefix,"…"]})]}),c.jsxs(Ye,{size:"sm",variant:"outline",className:"shrink-0",disabled:re!==null,onClick:()=>te({id:ye.id,name:ye.label||"Untitled key"}),children:[re===ye.id?c.jsx(Cr,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(mE,{className:"mr-1.5 h-3.5 w-3.5"}),"Rotate"]})]},ye.id)):c.jsx("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:c.jsxs(Ye,{size:"sm",variant:"secondary",className:"shrink-0",disabled:re!==null||!I,onClick:()=>G(),children:[re?c.jsx(Cr,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):c.jsx(tv,{className:"mr-1.5 h-3.5 w-3.5"}),"Create a key for this nest only"]})}),c.jsx(mn,{label:"This nest's MCP URL",value:g})]}),c.jsxs("button",{type:"button",onClick:()=>T(ye=>!ye),"aria-expanded":E,className:"flex w-full items-center justify-between rounded-lg border px-3 py-2.5 text-sm hover:bg-muted/40",children:[c.jsx("span",{className:"font-medium",children:"Configure a specific client"}),c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Hootie · Claude · Cursor · CLI",c.jsx(Ro,{className:`h-4 w-4 transition-transform ${E?"rotate-180":""}`})]})]}),E&&c.jsxs(gk,{defaultValue:"hootie",className:"w-full min-w-0",children:[c.jsxs(ih,{className:"grid w-full grid-cols-5 sticky top-0 z-10",children:[c.jsxs(ss,{value:"hootie",children:[c.jsx(pN,{className:"h-3.5 w-3.5 mr-1"}),"Hootie"]}),c.jsxs(ss,{value:"claude",children:[c.jsx(nv,{className:"h-3.5 w-3.5 mr-1"}),"Claude"]}),c.jsx(ss,{value:"mcp",children:"MCP"}),c.jsx(ss,{value:"api",children:"API"}),c.jsxs(ss,{value:"cli",children:[c.jsx(rv,{className:"h-3.5 w-3.5 mr-1"}),"CLI"]})]}),c.jsxs(ai,{value:"hootie",className:"space-y-4 pt-4",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm mb-3",children:["In Hootie, open"," ",c.jsx("strong",{children:"Settings → ContextNest Vault → Remote Server"})," ","and paste:"]}),c.jsx(mn,{label:"Server URL",value:f}),!L&&c.jsx(mn,{label:"API Key (paste your generated key)",value:Ur})]}),c.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1 list-decimal list-inside",children:[c.jsx("li",{children:"Open Hootie"}),c.jsx("li",{children:"Click the gear icon (Settings)"}),c.jsx("li",{children:"Scroll to ContextNest Vault"}),c.jsx("li",{children:'Switch tab to "Remote Server"'}),c.jsxs("li",{children:["Paste the URL",!L&&" + your API Key"," ","above, click Test Vault"]})]})]}),c.jsxs(ai,{value:"claude",className:"space-y-4 pt-4",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm mb-3",children:[c.jsx("strong",{children:"Claude Code"})," (the CLI) registers a server with one command — it persists the config itself, no file to find or edit.",!L&&c.jsxs(c.Fragment,{children:[" ","Replace"," ",c.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Ur})," ","with your generated key."]})]}),c.jsx(mn,{label:"Run in your terminal (Claude Code CLI)",value:ee,multiline:!0}),c.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."})]}),c.jsxs("div",{className:"border-t pt-3",children:[c.jsxs("p",{className:"text-sm mb-3",children:["Using ",c.jsx("strong",{children:"Claude Desktop"})," (the GUI app) instead? It has no CLI, so add this to your"," ",c.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"claude_desktop_config.json"}),!L&&c.jsxs(c.Fragment,{children:[" ","(replace"," ",c.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Ur})," ","with your generated key):"]})]}),c.jsx(mn,{label:"Claude Desktop config (via mcp-remote bridge)",value:A,multiline:!0}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Location:"," ",c.jsx("code",{className:"text-[10px]",children:"%APPDATA%\\Claude\\claude_desktop_config.json"})," ","(Windows) or"," ",c.jsx("code",{className:"text-[10px]",children:"~/Library/Application Support/Claude/claude_desktop_config.json"})," ","(Mac)"]}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Claude Desktop config runs a local command, so this uses"," ",c.jsx("code",{className:"text-[10px]",children:"mcp-remote"})," to bridge to the server's HTTP endpoint — you need"," ",c.jsx("a",{href:"https://nodejs.org",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Node.js"})," ","installed (it provides"," ",c.jsx("code",{className:"text-[10px]",children:"npx"}),"). Restart Claude Desktop after editing; the nest's context tools then appear in the tools panel."]})]})]}),c.jsxs(ai,{value:"mcp",className:"space-y-4 pt-4",children:[c.jsxs("div",{children:[c.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.",!L&&c.jsxs(c.Fragment,{children:[" ","Replace"," ",c.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:Ur})," ","with your generated key."]})]}),c.jsx(mn,{label:"Direct HTTP config (Cursor, VS Code, Claude Code — not Claude Desktop)",value:Y,multiline:!0}),c.jsx(mn,{label:`From the ctx CLI (2.2+)${L?"":" — export CONTEXTNEST_API_KEY first"}`,value:Te,multiline:!0})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[c.jsx("p",{className:"font-medium",children:"Available tools:"}),c.jsxs("div",{className:"grid grid-cols-2 gap-x-4 font-mono text-[11px]",children:[c.jsx("span",{children:"context_init"}),c.jsx("span",{children:"context_resolve"}),c.jsx("span",{children:"context_overview"}),c.jsx("span",{children:"context_create"}),c.jsx("span",{children:"context_search"}),c.jsx("span",{children:"context_update"}),c.jsx("span",{children:"context_query"}),c.jsx("span",{children:"context_export"}),c.jsx("span",{children:"context_get"}),c.jsx("span",{children:"context_comments"}),c.jsx("span",{children:"context_list"}),c.jsx("span",{children:"context_stewards"}),c.jsx("span",{children:"context_review_queue"}),c.jsx("span",{children:"context_my_drafts"}),c.jsx("span",{children:"context_submit_review"}),c.jsx("span",{children:"context_approve"}),c.jsx("span",{children:"context_reject"}),c.jsx("span",{children:"context_versions"}),c.jsx("span",{children:"context_assign_steward"}),c.jsx("span",{children:"context_request_deletion"}),c.jsx("span",{children:"context_deletion_queue"}),c.jsx("span",{children:"context_resolve_deletion"}),c.jsx("span",{children:"context_share_nest"}),c.jsx("span",{children:"context_unsynced_list"}),c.jsx("span",{children:"context_sync_folder"})]})]})]}),c.jsxs(ai,{value:"api",className:"space-y-4 pt-4",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm mb-3",children:["Deterministic retrieval over plain HTTP — the same selector and ",c.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 (",c.jsx("code",{className:"text-[11px]",children:"hops_used"}),","," ",c.jsx("code",{className:"text-[11px]",children:"nodes_traversed"}),") so you can audit exactly what was pulled."]}),c.jsx(mn,{label:"Query + N-hop graph context (POST /context)",value:oe,multiline:!0}),c.jsx(mn,{label:"Single document (GET, deterministic by id)",value:ue,multiline:!0})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[c.jsx("p",{className:"font-medium",children:"Selector grammar:"}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[11px]",children:[c.jsx("span",{children:"#tag"}),c.jsx("span",{className:"font-sans",children:"nodes carrying a tag"}),c.jsx("span",{children:"type:document"}),c.jsx("span",{className:"font-sans",children:"nodes of a type"}),c.jsx("span",{children:"[[Title]]"}),c.jsx("span",{className:"font-sans",children:"a node by title"}),c.jsx("span",{children:"scope:team"}),c.jsx("span",{className:"font-sans",children:"nodes by visibility scope"}),c.jsx("span",{children:"+AND · |OR · -NOT"}),c.jsx("span",{className:"font-sans",children:"combine selectors"})]}),c.jsxs("p",{className:"pt-1",children:[c.jsx("span",{className:"font-medium",children:"Hops"})," controls graph traversal from the matches:"," ",c.jsx("code",{className:"text-[11px]",children:"1"})," = matches + directly linked nodes (single hop),"," ",c.jsx("code",{className:"text-[11px]",children:"2"})," (default) and up follow wiki-links further out for multi-hop context."," ",c.jsx("code",{className:"text-[11px]",children:"max_tokens"})," caps the payload; the response reports what was truncated."]}),c.jsxs("p",{children:["Also useful:"," ",c.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"POST /query"})," ","(matches + snippets, no bodies),"," ",c.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"," ",c.jsxs("code",{className:"text-[11px] bg-muted px-1 rounded",children:["/nests/","<nest-id>","/…"]})]})]})]}),c.jsxs(ai,{value:"cli",className:"space-y-4 pt-4",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm mb-3",children:["Read this nest from the shell, or push a local vault into it, with the"," ",c.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"ctx"})," ","CLI",!L&&c.jsxs(c.Fragment,{children:[" ","(export"," ",c.jsx("code",{className:"text-[11px] bg-muted px-1 rounded",children:"CONTEXTNEST_API_KEY"})," ","first — the key never goes on the command line)"]}),":"]}),c.jsx(mn,{label:"Install",value:"npm i -g @promptowl/contextnest-cli"}),c.jsx(mn,{label:"Register this nest as a vault alias, then query it",value:Te,multiline:!0}),c.jsx(mn,{label:"Push a local vault into this nest",value:Fe,multiline:!0})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.jsx("code",{className:"text-[10px]",children:"query"}),","," ",c.jsx("code",{className:"text-[10px]",children:"read"}),","," ",c.jsx("code",{className:"text-[10px]",children:"list"})," and"," ",c.jsx("code",{className:"text-[10px]",children:"search"})," accept"," ",c.jsx("code",{className:"text-[10px]",children:"--vault <alias>"})," ","once the alias exists (ctx 2.2+). Full CLI reference lives in the ContextNest docs."]})]})]}),E&&c.jsxs("div",{className:"border-t pt-3",children:[c.jsx("p",{className:"mb-2 text-sm font-medium",children:"Get the apps"}),c.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[c.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:[c.jsx(nv,{className:"h-4 w-4 shrink-0"})," Desktop app"]}),c.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:[c.jsx(rv,{className:"h-4 w-4 shrink-0"})," ctx CLI"]}),c.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:[c.jsx(hc,{className:"h-4 w-4 shrink-0"})," Self-hosted"]})]})]}),c.jsxs("button",{type:"button",onClick:()=>q(ye=>!ye),"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:[c.jsx("span",{className:"font-medium",children:"Export & nest details"}),c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Markdown · .zip · Nest ID",c.jsx(Ro,{className:`h-4 w-4 transition-transform ${j?"rotate-180":""}`})]})]}),j&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"border-t pt-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[c.jsx(Tc,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"font-medium truncate",children:"Export as markdown"})]}),c.jsx(Ye,{variant:"outline",size:"sm",className:"shrink-0",onClick:U,disabled:v,"aria-label":"Download this nest as a single markdown file",children:v?c.jsx(Cr,{className:"h-3.5 w-3.5 animate-spin"}):c.jsxs(c.Fragment,{children:[c.jsx(Tc,{className:"h-3.5 w-3.5 mr-1"}),"Download .md"]})})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Frontmatter + body, one file. Approved versions only. Agents can fetch this URL directly."}),c.jsx(mn,{label:"Export URL (text/markdown)",value:y})]}),c.jsxs("div",{className:"border-t pt-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[c.jsx(hc,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"font-medium truncate",children:"Portability bundle"})]}),c.jsxs(Ye,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>S(!0),"aria-label":"Export this nest as a portable .zip bundle",children:[c.jsx(hc,{className:"h-3.5 w-3.5 mr-1"}),"Export .zip"]})]}),c.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."})]}),c.jsx("div",{className:"border-t pt-3",children:c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx("span",{children:"Nest ID:"}),c.jsx("code",{className:"flex-1 bg-muted px-2 py-1 rounded text-[11px] font-mono truncate",children:n}),c.jsx(vk,{value:n})]})})]})]})]})}),c.jsx(ks,{open:N,onOpenChange:ye=>!x&&S(ye),children:c.jsxs(Ao,{className:"sm:max-w-[420px]",children:[c.jsxs(Mo,{children:[c.jsxs(Io,{className:"flex items-center gap-2",children:[c.jsx(hc,{className:"h-5 w-5"}),"Export portability bundle"]}),c.jsxs($o,{children:["Downloads a ",c.jsx("code",{children:".zip"})," of this nest's documents. On another ContextNest host, unzip it and bring it in with the existing"," ",c.jsx("strong",{children:"Import Folder"})," button."]})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 py-2",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(Oi,{htmlFor:"include-drafts",className:"text-sm font-medium",children:"Include draft documents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Off: approved / published documents only. On: also export unapproved drafts."})]}),c.jsx(nk,{id:"include-drafts",checked:C,onCheckedChange:_})]}),V&&c.jsx("p",{className:"text-sm text-destructive",children:V}),c.jsxs(wu,{children:[c.jsx(Ye,{variant:"outline",onClick:()=>S(!1),disabled:x,children:"Cancel"}),c.jsxs(Ye,{onClick:Z,disabled:x,children:[x?c.jsx(Cr,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(Tc,{className:"h-4 w-4 mr-2"}),"Download .zip"]})]})]})}),de&&c.jsx(m4,{apiKey:de.key,kind:de.kind,nestId:n,scopedTo:{nestName:s,mcpUrl:g},onClose:()=>ge(null)}),c.jsx(p4,{target:ce,onConfirm:ye=>G(ye),onClose:()=>te(null)})]})}function p4({target:e,onConfirm:t,onClose:n}){return e?c.jsx(A5,{open:!0,onOpenChange:s=>!s&&n(),title:`Rotate "${e.name}"?`,description:"The current key stops working immediately — anything still using it needs the new one.",confirmLabel:"Rotate key",destructive:!0,onConfirm:async()=>{await t(e.id)}}):null}function m4({apiKey:e,kind:t,onClose:n,nestId:s,scopedTo:i}){const[l,d]=m.useState(!1),f=async()=>{await Pi(e)&&(d(!0),setTimeout(()=>d(!1),1500))},g=()=>{const y=typeof window<"u"?window.location.origin:"http://localhost:3838",v=URL.createObjectURL(new Blob([i4({serverUrl:y,apiKey:e,nestId:s})],{type:"text/plain"})),p=document.createElement("a");p.href=v,p.download="contextnest.env",document.body.appendChild(p),p.click(),p.remove(),URL.revokeObjectURL(v)};return c.jsx(ks,{open:!0,onOpenChange:n,children:c.jsxs(Ao,{className:"sm:max-w-[480px]",children:[c.jsxs(Mo,{children:[c.jsxs(Io,{className:"flex items-center gap-2",children:[c.jsx(wE,{className:"h-4 w-4 text-amber-700"}),t==="generated"?"API key generated":"API key rotated"]}),c.jsxs($o,{children:["This key is shown ",c.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"&&c.jsxs(c.Fragment,{children:[" ","Your previous key has been invalidated and will stop working immediately."]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"flex-1 bg-muted px-3 py-2 rounded text-xs font-mono break-all",children:e}),c.jsx(Ye,{size:"sm",variant:"outline",onClick:f,children:l?c.jsx(Mi,{className:"h-3.5 w-3.5 text-green-600"}):c.jsx(Yp,{className:"h-3.5 w-3.5"})})]}),c.jsxs(Ye,{variant:"outline",size:"sm",className:"w-full",onClick:g,children:[c.jsx(Tc,{className:"mr-1.5 h-3.5 w-3.5"}),"Download .env"]}),i&&c.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 p-2 text-xs text-amber-900",children:[c.jsxs("p",{className:"mb-1.5",children:["This key works for ",c.jsx("strong",{children:i.nestName})," only. Use it with this nest's MCP URL — other nests, your account and your API keys refuse it."]}),c.jsx(mn,{label:"MCP URL",value:i.mcpUrl})]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Copy it, or download a ready"," ",c.jsx("code",{className:"text-[11px]",children:".env"})," (server URL + key) to hand your agent. Keep it secret — don't commit it."]})]}),c.jsx("div",{className:"flex justify-end pt-2",children:c.jsx(Ye,{onClick:n,children:"I've saved it — close"})})]})})}function mn({label:e,value:t,multiline:n}){return c.jsxs("div",{className:"mb-3 min-w-0",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1 min-w-0",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground truncate",children:e}),c.jsx(vk,{value:t})]}),c.jsx("pre",{className:`${n?"p-3":"px-3 py-2"} bg-muted rounded text-xs font-mono min-w-0 ${n?"whitespace-pre overflow-x-auto":"whitespace-pre-wrap break-all"}`,children:t})]})}function vk({value:e}){const[t,n]=m.useState(!1),s=async()=>{await Pi(e)&&(n(!0),setTimeout(()=>n(!1),1500))};return c.jsx(Ye,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:s,children:t?c.jsx(Mi,{className:"h-3 w-3 text-green-600"}):c.jsx(Yp,{className:"h-3 w-3"})})}function h4(e){return e==="new"}function g4({existingAdmin:e,onClose:t}){const{loginSuccess:n}=Ja(),[s,i]=m.useState("promptowl"),[l,d]=m.useState(""),[f,g]=m.useState(""),[y,v]=m.useState(!1),[p,x]=m.useState(null),[b,N]=m.useState(null),[S,C]=m.useState(null),[_,E]=m.useState(!1),[T,j]=m.useState(!1),[q,V]=m.useState(null),[D,$]=m.useState("open"),F=typeof window<"u"&&new URLSearchParams(window.location.search).has("admin"),I=D==="open"||D==="admin-only"&&F,re=I?s:"password";m.useEffect(()=>{let ce=!1;return Ma().then(te=>{ce||$(te.promptowl_sign_in_gate??"open")}).catch(()=>{}),()=>{ce=!0}},[]);const fe=async()=>{S&&await Pi(S)&&(E(!0),setTimeout(()=>E(!1),1500))},de=async()=>{x(null),v(!0);try{const ce=await ax();N(ce.verificationUrl),C(ce.deviceCode),window.open(ce.verificationUrl,"_blank","noopener,noreferrer");for(let te=0;te<180;te++){await new Promise(Z=>setTimeout(Z,2e3));const ie=await lx(ce.deviceCode,ce.clientSecret);if(ie.status==="approved"&&ie.token){const Z=await cx(ie.token);if(n(Z.user?{email:Z.user.email,name:Z.user.name,is_admin:!!Z.user.is_admin}:void 0),Z.claim_blocked&&!Z.user.is_admin){V({info:Z.claim_blocked,attemptedEmail:Z.user.email}),N(null),C(null),v(!1);return}t();return}if(ie.status==="pending")continue;const G=ie.status==="denied"||ie.status==="rejected"?"Login request was denied. Please try again to create a new authentication request.":ie.status==="expired"?"Login expired. Try again.":ie.status==="cancelled"?"Login cancelled. Try again.":`Login failed (status: ${ie.status}). Try again.`;x(G),N(null),C(null),v(!1);return}x("Login timed out waiting for approval. Try again."),N(null),C(null),v(!1)}catch(ce){x(ce.message),N(null),C(null),v(!1)}},ge=async ce=>{ce.preventDefault(),x(null),v(!0);try{const te=await ix(l,f);n(te.user?{email:te.user.email,name:te.user.name,is_admin:!!te.user.is_admin}:void 0),t()}catch(te){x(te.message),v(!1)}};return c.jsx(ks,{open:!0,onOpenChange:t,children:c.jsxs(Ao,{className:"sm:max-w-[420px]",children:[c.jsxs(Mo,{children:[c.jsxs(Io,{className:"flex items-center gap-2",children:[c.jsx(su,{className:"h-4 w-4"}),"Login"]}),c.jsx($o,{children:e?`This server is administered by ${e}. Login to manage settings and teammates.`:"Login with your account."})]}),c.jsxs("div",{className:"space-y-4 pt-2",children:[p&&c.jsxs(Yc,{variant:"destructive",children:[c.jsx(Ta,{className:"h-4 w-4"}),c.jsx(Jc,{children:p})]}),q&&c.jsxs(Yc,{variant:"destructive",children:[c.jsx(Xp,{className:"h-4 w-4"}),c.jsx(Jc,{children:q.info.reason==="license_required"?c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"font-medium",children:"Admin claim blocked — no license installed."}),c.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."}),c.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",c.jsx(Jf,{className:"h-3 w-3"})]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"font-medium",children:"Admin claim blocked — email does not match license owner."}),c.jsxs("p",{className:"text-xs",children:["License owner:"," ",c.jsx("code",{className:"font-mono",children:q.info.license_owner_email||"(unknown)"})]}),c.jsxs("p",{className:"text-xs",children:["You logged in as:"," ",c.jsx("code",{className:"font-mono",children:q.attemptedEmail})]}),c.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."})]})})]}),re==="promptowl"?c.jsxs(c.Fragment,{children:[c.jsx(Ye,{onClick:de,disabled:y,className:"w-full",children:y&&b?c.jsxs(c.Fragment,{children:[c.jsx(Cr,{className:"h-4 w-4 mr-2 animate-spin"}),"Waiting for approval..."]}):"Login with PromptOwl"}),b&&c.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs text-muted-foreground",children:["A new tab opened at"," ",c.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary underline",children:["PromptOwl",c.jsx(Jf,{className:"h-3 w-3"})]}),". If it asks for a verification code, use this:"]}),S&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"flex-1 bg-background border rounded px-2 py-1.5 text-xs font-mono break-all",children:S}),c.jsx(Ye,{size:"sm",variant:"outline",onClick:fe,children:_?c.jsx(Mi,{className:"h-3.5 w-3.5 text-green-600"}):c.jsx(Yp,{className:"h-3.5 w-3.5"})})]})]}),!b&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("div",{className:"w-full border-t border-border"})}),c.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),c.jsx(Ye,{variant:"outline",className:"w-full",onClick:()=>i("password"),children:"Use email + password"})]})]}):c.jsxs("form",{onSubmit:ge,className:"space-y-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Oi,{children:"Email"}),c.jsx(Xc,{type:"email",value:l,onChange:ce=>d(ce.target.value),required:!0,autoFocus:!0})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx(Oi,{children:"Password"}),c.jsxs("div",{className:"relative",children:[c.jsx(Xc,{type:T?"text":"password",value:f,onChange:ce=>g(ce.target.value),required:!0,className:"pr-9"}),c.jsx("button",{type:"button",onClick:()=>j(ce=>!ce),"aria-label":T?"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:T?c.jsx(Zw,{className:"h-4 w-4"}):c.jsx(Yw,{className:"h-4 w-4"})})]})]}),c.jsx(Ye,{type:"submit",disabled:y,className:"w-full",children:y?c.jsx(Cr,{className:"h-4 w-4 animate-spin"}):"Login"}),I&&c.jsx("button",{type:"button",onClick:()=>i("promptowl"),className:"w-full text-xs text-muted-foreground hover:text-foreground",children:"← Back to PromptOwl login"})]})]})]})})}function y4({onActivated:e}){const[t,n]=m.useState(""),[s,i]=m.useState(!1),[l,d]=m.useState(null),[f,g]=m.useState(null),y=async()=>{const v=t.trim();if(!v.startsWith("pk_")){d("License key must start with pk_");return}d(null),g(null),i(!0);try{const p=await zE(v);if(!p.valid){d(p.error||"PromptOwl rejected this key.");return}if(p.warning){g(p.warning);return}e()}catch(p){d(p instanceof Error?p.message:"Failed to install key")}finally{i(!1)}};return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:c.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[c.jsxs("div",{className:"text-center space-y-2",children:[c.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-primary/10",children:c.jsx(bE,{className:"h-6 w-6 text-primary"})}),c.jsx("h1",{className:"text-2xl font-bold",children:"Activate ContextNest Community"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"This server is in setup mode. Paste a PromptOwl license key to unlock write access."})]}),c.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oi,{htmlFor:"license-key",children:"License key"}),c.jsx(Xc,{id:"license-key","data-testid":"license-setup-key-input",placeholder:"pk_...",value:t,autoFocus:!0,onChange:v=>{n(v.target.value),l&&d(null)},onKeyDown:v=>{v.key==="Enter"&&!s&&y()},className:"font-mono"}),l&&c.jsx("p",{className:"text-sm text-destructive","data-testid":"license-setup-error",children:l}),f&&c.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:[c.jsx("p",{className:"font-medium",children:"License not saved"}),c.jsx("p",{children:f})]})]}),f?c.jsx(Ye,{className:"w-full",variant:"outline",onClick:e,"data-testid":"license-setup-continue",children:"Continue anyway (key lost on restart)"}):c.jsx(Ye,{className:"w-full",onClick:y,disabled:s||!t.trim(),"data-testid":"license-setup-submit",children:s?c.jsxs(c.Fragment,{children:[c.jsx(Cr,{className:"h-4 w-4 mr-2 animate-spin"}),"Validating..."]}):c.jsxs(c.Fragment,{children:[c.jsx(Xp,{className:"h-4 w-4 mr-2"}),"Activate Server"]})})]}),c.jsxs("div",{className:"text-sm text-muted-foreground space-y-2 border rounded-lg p-4 bg-muted/30",children:[c.jsx("p",{className:"font-medium text-foreground",children:"Need a key?"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[c.jsxs("li",{children:["Sign up free at"," ",c.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",c.jsx(Jf,{className:"h-3 w-3"})]})]}),c.jsx("li",{children:"Open Overview > Community License"}),c.jsx("li",{children:"Generate a key and paste it above"})]}),c.jsx("p",{className:"text-xs pt-2",children:"Reads stay available without a license. Writes (nest/node create, update, delete) require activation."})]})]})})}function v4(e,t){const n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?[]:e.filter(s=>{const i=`${s.name??""} ${s.description??""} ${s.id??""}`.toLowerCase();return n.every(l=>i.includes(l))}).sort((s,i)=>+!!i.pinned-+!!s.pinned).map(s=>({id:s.id,title:s.name??s.id,description:s.description??null}))}const Qf=20;function w4(e,t){const n=t.trim().split(/\s+/).filter(Boolean);if(n.length===0)return e;const s=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi"),i=n.map(l=>l.toLowerCase());return e.split(s).map((l,d)=>l&&i.includes(l.toLowerCase())?c.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-700/60 rounded-sm px-0.5",children:l},d):l)}function _w({active:e,onClick:t,label:n}){return c.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:n})}function x4({nestId:e,nestName:t,nestOnly:n=!1,onSelect:s,onClose:i}){const[l,d]=m.useState(""),[f,g]=m.useState(!1),[y,v]=m.useState([]),[p,x]=m.useState(0),[b,N]=m.useState(!1),[S,C]=m.useState(0),_=m.useRef(null),E=m.useRef(null),T=Xa(),j=!e||f,q=!!e&&!n;m.useEffect(()=>{var F;(F=_.current)==null||F.focus()},[]),m.useEffect(()=>{const F=I=>{I.key==="Escape"&&i()};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[i]),m.useEffect(()=>(E.current&&clearTimeout(E.current),E.current=setTimeout(async()=>{const F=l.trim();if(!F){v([]),C(0);return}N(!0);try{if(j){const[I,re]=await Promise.all([T.fetchQuery(Bt.nestList()).then(fe=>v4((fe==null?void 0:fe.nests)??[],F).map(de=>({...de,kind:"nest"}))).catch(()=>[]),T.fetchQuery(Bt.globalSearch(F,Qf)).then(fe=>(C(fe.count),fe.nodes.map(de=>({...de,kind:"node"})))).catch(()=>(C(0),[]))]);v([...I.slice(0,4),...re.slice(0,Qf)])}else{const I=await i2(e,F);C(I.nodes.length),v(I.nodes.slice(0,Qf).map(re=>({...re,kind:"node",nest_id:re.nest_id??e,nest_name:re.nest_name??t})))}x(0)}catch{v([]),C(0)}finally{N(!1)}},l.trim()?250:0),()=>{E.current&&clearTimeout(E.current)}),[e,t,j,l,T]);const V=F=>{const I=y[F];I&&s(I.id,I)},D=y.filter(F=>F.kind==="node").length,$=()=>b?"Searching…":l.trim()?!j&&q?c.jsxs(c.Fragment,{children:["No matches in ",t??"this nest","."," ",c.jsx("button",{type:"button",onClick:()=>g(!0),className:"font-medium text-foreground underline underline-offset-2 hover:no-underline","data-testid":"quick-open-widen-scope",children:"Search all nests"})]}):"No matches":j?"Type to search nests and documents…":`Type to search ${t??"this nest"}…`;return c.jsx("div",{className:"fixed inset-0 z-50 bg-black/30 flex items-start justify-center pt-[15vh]",onClick:i,children:c.jsxs("div",{className:"w-full max-w-lg rounded-lg border bg-background shadow-xl overflow-hidden",onClick:F=>F.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[b?c.jsx(Cr,{className:"h-4 w-4 text-muted-foreground animate-spin"}):c.jsx(em,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("input",{ref:_,value:l,onChange:F=>d(F.target.value),onKeyDown:F=>{F.key==="Tab"&&q&&(F.preventDefault(),g(I=>!I)),F.key==="ArrowDown"&&(F.preventDefault(),x(I=>Math.min(I+1,y.length-1))),F.key==="ArrowUp"&&(F.preventDefault(),x(I=>Math.max(I-1,0))),F.key==="Enter"&&(F.preventDefault(),V(p))},placeholder:j?"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"}),c.jsx("kbd",{className:"text-[10px] text-muted-foreground border rounded px-1",children:"esc"})]}),c.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-1.5 text-xs text-muted-foreground",children:[c.jsx("span",{children:"Searching"}),e&&!q?c.jsx("span",{className:"font-medium text-foreground",children:t??"this nest"}):e?c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(_w,{active:!f,onClick:()=>g(!1),label:t?`This nest — ${t}`:"This nest"}),c.jsx(_w,{active:f,onClick:()=>g(!0),label:"All nests"}),c.jsx("kbd",{className:"rounded border px-1 text-[10px]",children:"tab"})]}):c.jsx("span",{className:"font-medium text-foreground",children:"all nests"})]}),c.jsx("div",{className:"max-h-72 overflow-y-auto py-1",children:y.length===0?c.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:$()}):y.map((F,I)=>{var re;return c.jsxs(m.Fragment,{children:[F.kind!==((re=y[I-1])==null?void 0:re.kind)&&c.jsx("div",{className:"px-3 pb-0.5 pt-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:F.kind==="nest"?"Nests":"Documents"}),c.jsxs("button",{type:"button",className:`flex w-full items-start gap-2 px-3 py-2 text-left text-sm ${I===p?"bg-muted":"hover:bg-muted/50"}`,onMouseEnter:()=>x(I),onClick:()=>V(I),children:[F.kind==="nest"?c.jsx(Qw,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}):c.jsx(Jp,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate font-medium",children:F.title}),F.kind==="nest"?c.jsx("span",{className:"ml-auto text-xs text-muted-foreground shrink-0",children:"Nest"}):j&&F.nest_name?c.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground shrink-0",children:F.nest_name}):F.tags&&F.tags.length>0&&c.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:F.tags.slice(0,3).join(" ")})]}),F.kind==="node"&&F.snippet&&l.trim()&&c.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:w4(F.snippet,l)})]})]})]},`${F.kind}:${F.nest_id??""}${F.id}`)})}),D>0&&S>D&&c.jsxs("div",{className:"border-t px-3 py-2 text-xs text-muted-foreground",children:["Showing ",D," of ",S," matching documents — keep typing to narrow."]})]})})}const ka=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl",b4=[{title:"Anywhere",items:[[`${ka} 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:[[`${ka} B`,"Bold"],[`${ka} I`,"Italic"],[`${ka} Z`,"Undo"],[`${ka} ⇧ Z`,"Redo"],["# / ## / ###","Heading, typed at the start of a line"],["[[","Link to another document"],["@","Mention a person"]]}];function S4({onClose:e}){return c.jsx(ks,{open:!0,onOpenChange:e,children:c.jsxs(Ao,{className:"sm:max-w-[480px]",children:[c.jsxs(Mo,{children:[c.jsx(Io,{children:"Keyboard shortcuts"}),c.jsxs($o,{children:["Press ",c.jsx("kbd",{className:"rounded border px-1",children:"?"})," anywhere to bring this back."]})]}),c.jsx("div",{className:"space-y-4",children:b4.map(t=>c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t.title}),c.jsx("dl",{className:"space-y-1",children:t.items.map(([n,s])=>c.jsxs("div",{className:"flex items-baseline gap-3 text-sm",children:[c.jsx("dt",{className:"w-32 shrink-0",children:c.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 text-xs",children:n})}),c.jsx("dd",{className:"text-muted-foreground",children:s})]},n))})]},t.title))})]})})}let Hp=null,Wp=!1;function DF(e){Hp=e}function k4(e){!Wp&&Hp&&Hp(e)||e()}function LF(e){Wp=!0;try{e()}finally{Wp=!1}}function _4(e,t){return e!==null&&t!==null&&t!==e?"push":"replace"}const wk=/^\/nest\/([^/]+)(?:\/([^/]+))?\/?$/;function C4(e){try{return decodeURIComponent(e)}catch{return e}}function Zf(e=window.location){const t=e.pathname.match(wk);return t?C4(t[1]):new URLSearchParams(e.search).get("nest")}function Cw(e=window.location){const t=e.pathname.match(wk);return t!=null&&t[2]?t[2]:new URLSearchParams(e.search).get("view")}function Nw(e,t){if(!e)return"/";const n=`/nest/${encodeURIComponent(e)}`;return t?`${n}/${t}`:n}const xk=m.createContext(null),N4=xk.Provider;function zF(){const e=m.useContext(xk);if(!e)throw new Error("useNestPage: no NestPageProvider above this page");return e}const bk=m.createContext(null),E4=bk.Provider;function FF(){const e=m.useContext(bk);if(!e)throw new Error("useAppNav: no AppNavProvider above this page");return e}const ah=m.createContext(null);function P4({children:e}){const[t,n]=m.useState([]);return c.jsx(ah.Provider,{value:{tail:t,setTail:n},children:e})}function UF(e){const t=m.useContext(ah),n=e.map(s=>s.label).join("\0");m.useEffect(()=>{if(t)return t.setTail(e),()=>t.setTail([])},[n])}function j4(){var e;return((e=m.useContext(ah))==null?void 0:e.tail)??[]}function Ew(e){return e?"min-w-0 truncate text-base font-semibold":"min-w-0 truncate text-muted-foreground"}const Pc="/assets/hootie-_U3ECslt.svg";function T4({branding:e,className:t=""}){const{footer_text:n,footer_link_url:s,footer_link_label:i,hide_powered_by:l}=e;return!n&&!s&&l?null:c.jsxs("footer",{className:`${t} flex flex-wrap items-center justify-center gap-x-4 gap-y-1 px-4 py-4 text-center text-xs text-muted-foreground`,"data-testid":"reader-brand-footer",children:[n&&c.jsx("span",{children:n}),s&&c.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",style:{color:"var(--reader-accent-text, inherit)"},children:i||s.replace(/^https:\/\//,"").replace(/\/$/,"")}),!l&&c.jsx("a",{href:"https://promptowl.ai/contextnest/",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground/80 hover:text-foreground",children:"Powered by ContextNest"})]})}const Pw={site_title:120,banner_headline:120,banner_subtext:280,footer_text:280,footer_link_label:80,url:2048},R4=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,O4=/\.(?:png|jpe?g|gif|webp)$/i,A4=/^[0-9a-f-]{36}\.(?:png|jpe?g|gif|webp)$/,M4={light:"#ffffff",dark:"#09090b"};function fi(e){if(typeof e!="string"||!R4.test(e))return null;let t=e.slice(1).toLowerCase();return t.length===3&&(t=t.split("").map(n=>n+n).join("")),"#"+t}function nu(e){const t=fi(e).slice(1);return[0,2,4].map(n=>parseInt(t.slice(n,n+2),16))}function I4(e){return"#"+e.map(t=>Math.round(Math.max(0,Math.min(255,t))).toString(16).padStart(2,"0")).join("")}function jw(e){const[t,n,s]=nu(e).map(i=>{const l=i/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)});return .2126*t+.7152*n+.0722*s}function ru(e,t){const n=jw(e),s=jw(t);return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}function ja(e){return ru("#000000",e)>=ru("#ffffff",e)?"#000000":"#ffffff"}function qp(e,t,n){const s=nu(e),i=nu(t);return I4([0,1,2].map(l=>s[l]*n+i[l]*(1-n)))}function Tw(e,t,n=4.5){const s=fi(e);if(ru(s,t)>=n)return s;const i=ja(t);for(let l=.05;l<=1.0001;l+=.05){const d=qp(i,s,l);if(ru(d,t)>=n)return d}return i}function _a(e){const[t,n,s]=nu(e).map(v=>v/255),i=Math.max(t,n,s),l=Math.min(t,n,s),d=(i+l)/2;let f=0,g=0;if(i!==l){const v=i-l;g=d>.5?v/(2-i-l):v/(i+l),i===t?f=(n-s)/v+(n<s?6:0):i===n?f=(s-t)/v+2:f=(t-n)/v+4,f*=60}const y=v=>Math.round(v*10)/10;return`${y(f)} ${y(g*100)}% ${y(d*100)}%`}function $4(e){return e?Object.entries(e).some(([,t])=>typeof t=="string"?t.trim()!=="":t===!0):!1}function D4(e,t="light"){const n={};if(!e)return n;const s=M4[t],i=fi(e.page_tint_color),l=i?qp(i,s,t==="light"?.1:.14):s;i&&(n["--background"]=_a(l),n["--reader-page-bg"]=l);const d=fi(e.accent_color);if(d){const g=Tw(Tw(d,l),s),y=qp(d,s,t==="light"?.12:.22);n["--reader-accent"]=d,n["--reader-accent-fg"]=ja(d),n["--reader-accent-text"]=g,n["--primary"]=_a(g),n["--primary-foreground"]=_a(ja(g)),n["--ring"]=n["--primary"],n["--accent"]=_a(y),n["--accent-foreground"]=_a(ja(y)==="#000000"?"#18181b":"#fafafa")}const f=fi(e.header_bg_color);return f&&(n["--reader-header-bg"]=f,n["--reader-header-fg"]=ja(f)),n}function L4(e,t){const n=`/nests/${t}/assets/`;if(e.startsWith(n))return A4.test(e.slice(n.length));if(!/^https:\/\//i.test(e))return!1;try{const s=new URL(e);return s.protocol==="https:"&&!s.username&&!s.password&&!!s.hostname&&O4.test(s.pathname)}catch{return!1}}function z4(e){if(!/^https:\/\//i.test(e))return!1;try{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!!t.hostname}catch{return!1}}function BF(e,t){var i,l;const n={};for(const d of["accent_color","header_bg_color","page_tint_color"]){const f=e[d];f&&!fi(f)&&(n[d]="Use a hex color like #1e40af")}for(const d of["logo_url","banner_url","favicon_url"]){const f=(i=e[d])==null?void 0:i.trim();f&&!L4(f,t)&&(n[d]="Upload an image, or use an https:// link ending in .png, .jpg, .gif or .webp")}const s=(l=e.footer_link_url)==null?void 0:l.trim();s&&!z4(s)&&(n.footer_link_url="Use an https:// link");for(const d of["site_title","banner_headline","banner_subtext","footer_text","footer_link_label"]){const f=e[d];f&&f.length>Pw[d]&&(n[d]=`At most ${Pw[d]} characters`)}return n}function VF(e,t,n){var i;const s=((i=t==null?void 0:t.site_title)==null?void 0:i.trim())||n;return e?`${e} · ${s}`:s}function HF(e){return`url("${e.replace(/["'()\\\s\u0000-\u001f\u007f]/g,n=>"%"+n.charCodeAt(0).toString(16).padStart(2,"0").toUpperCase())}")`}function F4({className:e}){return c.jsx("span",{className:_e("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"})}const Lu=(e,t)=>Zp(()=>e().then(n=>({default:n[t]}))),U4=Lu(()=>jt(()=>import("./NestView-EW-sraEb.js").then(e=>e.j),__vite__mapDeps([14,11,5,12,2,7,4,13,15,16,1,17,18,19,9,20,21,22,23,24])),"NestView"),B4=Lu(()=>jt(()=>import("./DocumentEditor-C2CP2fiE.js"),__vite__mapDeps([44,11,5,12,2,7,4,13,45,16,19,20,46,47,43,22,23,18,25,48,21,34,26,33,49])),"DocumentEditor"),V4=Lu(()=>jt(()=>import("./AgentDocsPage-ixP2UdAE.js"),__vite__mapDeps([50,28,48,12])),"AgentDocsPage"),H4=Lu(()=>jt(()=>import("./ActivityTracePage-DzwWIjjx.js"),__vite__mapDeps([42,28,43,2,15])),"ActivityTracePage"),Sk=[{page:"nest",label:"Nest",icon:Jp,beta:!1},...au.map(e=>({page:e.viewPage,label:e.label,icon:e.icon,beta:!!e.beta}))],W4={overview:"Overview",documents:"Documents",review:"Review queue","external-edits":"External edits",stewards:"Stewards",collaborators:"Collaborators"},q4=["overview","documents","review","external-edits","stewards","collaborators"],jc=e=>Sk.some(t=>t.page===e.page),Rw=e=>e.page==="document"?`${e.nestId}/${e.nodeId}`:e.page==="nest"&&e.readerMode&&e.readerDoc?`${e.nestId}/${e.readerDoc}`:null;let Ow=!1;function K4(){var Bo,Vo;const{authMode:e,logoUrl:t,serverVersion:n,adminStatus:s,authenticated:i,isAdmin:l,workflowPlaneEnabled:d,subagentRunsEnabled:f,loading:g,error:y,logout:v}=Ja(),[p,x]=m.useState(()=>({page:"dashboard",...typeof window<"u"?{tab:Mj(window.location.pathname)??Lc}:{}})),b=m.useCallback(H=>k4(()=>x(H)),[]),N=m.useRef(null);m.useEffect(()=>{G2("$pageview",{page:p.page})},[p.page]);const[S,C]=m.useState(!1),[_,E]=m.useState(()=>typeof window>"u"?{status:"idle"}:Zf()?{status:"loading"}:{status:"idle"}),[T,j]=m.useState(null),[q,V]=m.useState(!0),[D,$]=m.useState(!1),[F,I]=m.useState(!1),[re,fe]=m.useState(!1),[de,ge]=m.useState(()=>lu(localStorage).sidebarCollapsed),ce=H=>{ge(H),um(localStorage,{sidebarCollapsed:H})},[te,ie]=m.useState(!1);m.useEffect(()=>{ie(!1)},[p]);const[G,Z]=m.useState(!1),U=m.useCallback(()=>$(!0),[]),R=Xa(),A=m.useCallback(async H=>{var xt;const se=await R.fetchQuery(Bt.nestList()).catch(()=>null),xe=H.kind==="nest"?H.id:H.nest_id,we=(xt=se==null?void 0:se.nests)==null?void 0:xt.find(et=>et.id===xe),Ee={isOwner:(we==null?void 0:we.is_owner)??!1,isAnonOwned:(we==null?void 0:we.user_id)===Tx},nt=H.kind==="nest"?H.title:H.nest_name;b(H.kind==="nest"?{page:"nest",nestId:xe,nestName:nt,...Ee}:{page:"document",nestId:xe,nestName:nt,nodeId:H.id,...Ee})},[R]),ee=p.page==="nest"||p.page==="document"||p.page==="dashboard";m.useEffect(()=>{if(!ee){fe(!1);return}const H=se=>{(se.metaKey||se.ctrlKey)&&se.key.toLowerCase()==="k"&&(se.preventDefault(),fe(xe=>!xe))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[ee]);const[Y,L]=m.useState(!1);m.useEffect(()=>{const H=se=>{if(se.key!=="?"||se.metaKey||se.ctrlKey||se.altKey)return;const xe=se.target;xe!=null&&xe.isContentEditable||(xe==null?void 0:xe.tagName)==="INPUT"||(xe==null?void 0:xe.tagName)==="TEXTAREA"||(xe==null?void 0:xe.tagName)==="SELECT"||(se.preventDefault(),L(!0))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[]);const ne=m.useCallback(async()=>{I(!0);try{await v(),$(!1),Aa.success("Logged out successfully")}finally{I(!1)}},[v]),X=m.useCallback(async()=>{try{const H=await ux();j(H)}catch{j(null)}finally{V(!1)}},[]);m.useEffect(()=>{if(_.status!=="loading")return;const H=new URLSearchParams(window.location.search),se=_.nestId??Zf();if(!se){E({status:"missing"});return}if(g&&Cw()==="workflows")return;let xe=!1;return(async()=>{try{const{nest:we,permission:Ee,roles:nt,myStewards:xt}=await R.fetchQuery(Bt.nest(se));if(xe)return;const et=Ee==="owner",Rt=wp({roles:nt??[],permission:Ee,myStewards:xt??[],isOwner:et,isAdmin:l,readerMode:!!we.reader_mode}).isReaderView;E({status:"ok",nestId:we.id,nestName:we.name});const Me=H.get("doc");if(Me&&Me!=="new"&&Rt){b({page:"nest",nestId:we.id,nestName:we.name,isOwner:et,isAnonOwned:!1,readerMode:Rt,readerDoc:Me});return}if(Me&&Me!=="new"){b({page:"document",nestId:we.id,nestName:we.name,nodeId:Me,isOwner:et,isAnonOwned:!1,initialThreadId:H.get("thread")||void 0});return}const tt=Cw(),lt=nj(tt),gt=lt?lt.visible&&!lt.visible({isReadOnly:!1,isReaderView:!1,canEditDocs:!0,workflowPlaneEnabled:d})?null:lt.viewPage:tt==="trace"?"nest-trace":null;if(gt&&Tf(gt,Rt)){b({page:"nest",nestId:we.id,nestName:we.name,isOwner:et,isAnonOwned:!1,readerMode:Rt});return}if(gt){b({page:gt,nestId:we.id,nestName:we.name,isOwner:et,isAnonOwned:!1,readerMode:Rt});return}b({page:"nest",nestId:we.id,nestName:we.name,isOwner:et,isAnonOwned:!1,readerMode:Rt,tab:q4.includes(H.get("tab")??"")?H.get("tab"):void 0})}catch{xe||E({status:"unreachable",nestId:se})}})(),()=>{xe=!0}},[_.status,d,g]),m.useEffect(()=>{var Rt;if(typeof window>"u"||_.status==="loading")return;const H=new URLSearchParams(window.location.search);H.delete("nest");let se=null,xe=null;p.page==="document"?(se=p.nestId,p.nodeId&&p.nodeId!=="new"?H.set("doc",p.nodeId):H.delete("doc"),p.initialThreadId?H.set("thread",p.initialThreadId):H.delete("thread"),H.delete("view"),H.delete("tab")):p.page==="nest"?(se=p.nestId,p.readerMode&&p.readerDoc?H.set("doc",p.readerDoc):H.delete("doc"),H.delete("thread"),H.delete("view"),p.tab&&p.tab!=="overview"?H.set("tab",p.tab):H.delete("tab")):p.page==="ontology-graph"||p.page==="workflows"||p.page==="definitions"||p.page==="board"||p.page==="nest-trace"?(se=p.nestId,xe=p.page==="nest-trace"?"trace":((Rt=xa(p.page))==null?void 0:Rt.path)??null,H.delete("doc"),H.delete("thread"),H.delete("tab"),H.delete("view")):(H.delete("doc"),H.delete("thread"),H.delete("view"),H.delete("tab"));const we=H.toString(),nt=(p.page==="dashboard"?Aj(p.tab):Nw(se,xe))+(we?`?${we}`:"")+window.location.hash,xt=window.location.pathname+window.location.search+window.location.hash,et=Rw(p);nt!==xt&&(_4(N.current,et)==="push"?window.history.pushState(p,"",nt):window.history.replaceState(p,"",nt)),N.current=et},[p,_.status]),m.useEffect(()=>{const H=se=>{const xe=se.state;xe&&typeof xe=="object"&&"page"in xe&&(N.current=Rw(xe),x(xe))};return window.addEventListener("popstate",H),()=>window.removeEventListener("popstate",H)},[]);const[oe,ue]=m.useState(null),[Te,Fe]=m.useState(null),ye=jc(p)?oe??p.readerMode??!1:!1;m.useEffect(()=>{jc(p)&&Tf(p.page,ye)&&b({page:"nest",nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned,readerMode:ye})},[p,ye]);const Ve="nestId"in p?p.nestId:null,Ge="nestId"in p?p.isOwner:!1,[Lt,Zt]=m.useState(null);m.useEffect(()=>{if(Zt(null),ue(null),Fe(null),!Ve)return;let H=!1;return R.fetchQuery(Bt.nest(Ve)).then(se=>{var we,Ee;if(H)return;const xe=wp({roles:(se==null?void 0:se.roles)??[],permission:(se==null?void 0:se.permission)??null,myStewards:(se==null?void 0:se.myStewards)??[],isOwner:Ge,isAdmin:l,readerMode:!!((we=se==null?void 0:se.nest)!=null&&we.reader_mode)});Zt(xe.canEditDocs),ue(xe.isReaderView),Fe(((Ee=se==null?void 0:se.nest)==null?void 0:Ee.branding)??null)}).catch(()=>{H||(Zt(!1),ue(!1))}),()=>{H=!0}},[Ve,Ge,l]),m.useEffect(()=>{p.page==="workflows"&&Lt===!1&&b({page:"nest",nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned})},[p,Lt]);const ut=j4(),qn=m.useMemo(()=>{var se;const H={label:"Home",go:()=>b({page:"dashboard"})};if(p.page==="dashboard"){const xe=Rf(p.tab,{isAdmin:l});return ut.length?[H,...ut]:xe.id===Lc?[{label:xe.label}]:[H,{label:xe.label}]}if("nestId"in p){const xe={label:p.nestName,go:()=>b({page:"nest",nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned,tab:"overview"})};if(ut.length)return[H,xe,...ut];const we=p.page==="nest"?W4[p.tab??"overview"]??"Overview":p.page==="document"?"Document":p.page==="nest-trace"?"Trace":((se=xa(p.page))==null?void 0:se.label)??"";return[H,xe,{label:we}]}return p.page==="docs"?[H,{label:"Docs"}]:ut.length?[H,...ut]:[]},[p,b,ut]),wt=m.useMemo(()=>({openNest:(H,se,xe,we,Ee)=>b({page:"nest",nestId:H,nestName:se,isOwner:xe,isAnonOwned:we,isArchived:Ee}),openReview:(H,se,xe)=>b({page:"document",nestId:H,nestName:se,nodeId:xe,isOwner:!0,isAnonOwned:!0}),manageKeys:()=>b({page:"dashboard",tab:"api-keys"})}),[b]),dr=m.useCallback(()=>{if(typeof window<"u"&&Zf()){const H=new URLSearchParams(window.location.search);H.delete("nest");const se=H.toString();window.history.replaceState({},"",Nw(null)+(se?`?${se}`:"")+window.location.hash)}!i&&e==="key"&&E({status:"missing"}),b({page:"dashboard"})},[i,e]);m.useEffect(()=>{if(typeof window>"u"||Ow)return;const H=new URLSearchParams(window.location.search),se=H.get("sso_error");if(!se)return;Ow=!0,H.delete("sso_error");const xe=H.toString();window.history.replaceState({},"",window.location.pathname+(xe?`?${xe}`:"")+window.location.hash);const Ee={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."}[se]??"Sign-in failed. Please try again.";setTimeout(()=>Aa.error(Ee),0)},[]),m.useEffect(()=>{X();const H=setInterval(X,900*1e3),se=()=>{X()};return window.addEventListener("auth:unauthorized",se),()=>{clearInterval(H),window.removeEventListener("auth:unauthorized",se)}},[X]);const bn=((Bo=s==null?void 0:s.me)==null?void 0:Bo.email)??null,ht=m.useRef(bn);if(m.useEffect(()=>{if(ht.current===bn)return;const H=ht.current!==null;ht.current=bn,H&&x({page:"dashboard"})},[bn]),y)return c.jsx("div",{className:"min-h-screen flex items-center justify-center",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-lg font-medium text-destructive",children:y}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Check that the community server is running."})]})});if(g||e===null||q||_.status==="loading")return c.jsx("div",{className:"min-h-screen flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[c.jsx("img",{src:t??Pc,alt:"",className:"h-10 w-10"}),c.jsx("span",{className:"text-sm font-medium",children:"ContextNest"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading your nests…"})]})});if(T&&!T.valid)return c.jsx(y4,{onActivated:X});const On=c.jsxs(c.Fragment,{children:[c.jsx(ks,{open:D,onOpenChange:H=>{!H&&!F&&$(!1)},children:c.jsxs(Ao,{className:"sm:max-w-[400px]",children:[c.jsxs(Mo,{children:[c.jsxs(Io,{className:"flex items-center gap-2",children:[c.jsx(ex,{className:"h-4 w-4 text-muted-foreground"}),"Log out?"]}),c.jsx($o,{children:"You'll be signed out of this browser. Any unsaved edits in other tabs may be lost — save your work first."})]}),c.jsxs(wu,{className:"gap-2",children:[c.jsx(Ye,{variant:"outline",onClick:()=>$(!1),disabled:F,children:"Cancel"}),c.jsx(Ye,{variant:"destructive",onClick:ne,disabled:F,children:F?"Logging out...":"Log out"})]})]})}),re&&ee&&c.jsx(x4,{nestId:p.page==="nest"||p.page==="document"?p.nestId:void 0,nestName:p.page==="nest"||p.page==="document"?p.nestName:void 0,nestOnly:!i&&e==="key",onClose:()=>fe(!1),onSelect:(H,se)=>{if(fe(!1),p.page==="nest"&&oe&&se.kind==="node"&&(se.nest_id??p.nestId)===p.nestId){b({...p,readerDoc:H});return}if((p.page==="nest"||p.page==="document")&&se.kind==="node"&&(se.nest_id??p.nestId)===p.nestId){b({page:"document",nestId:p.nestId,nestName:p.nestName,nodeId:H,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned});return}A(se)}}),Y&&c.jsx(S4,{onClose:()=>L(!1)})]});if(!i&&e==="key"&&(_.status!=="ok"||!("nestId"in p||p.page==="docs")))return c.jsxs(c.Fragment,{children:[c.jsx(Z2,{}),On]});const Rs=p.page==="document",Os="nestId"in p&&oe!==!0,Ct=(i||e!=="key")&&(Os||p.page==="dashboard"||p.page==="docs"),fr=Ct&&(!de||te),Tr=p.page==="board"?"max-w-[1800px]":"max-w-6xl",An=Ct?"w-full max-w-none":`${Tr} mx-auto`,st=ye&&$4(Te)?Te:null,pr=st?D4(st,document.documentElement.classList.contains("dark")?"dark":"light"):void 0,Kn=st!=null&&st.header_bg_color?{backgroundColor:"var(--reader-header-bg)",color:"var(--reader-header-fg)",borderColor:"transparent"}:void 0;return c.jsxs("div",{className:Ct?"flex min-h-screen items-stretch bg-background":"min-h-screen bg-background",style:pr,children:[Ct&&c.jsxs(c.Fragment,{children:[Ct&&te&&c.jsx("button",{type:"button",className:"fixed inset-0 z-40 bg-black/30 md:hidden","aria-label":"Close sidebar",onClick:()=>ie(!1)}),fr&&(()=>{var xe,we;const H=p,se=Ee=>"nestId"in Ee?Ee:null;return c.jsx("div",{className:te?"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:c.jsx("div",{className:"sticky top-0 h-screen max-h-screen",children:c.jsx(VO,{logoUrl:t??Pc,nestId:((xe=se(H))==null?void 0:xe.nestId)??null,nodeId:H.page==="document"?H.nodeId:null,activeView:H.page==="nest"?H.tab==="review"?"review":"overview":((we=xa(H.page))==null?void 0:we.id)??null,onCollapse:()=>te?ie(!1):ce(!0),onOpenDashboard:()=>b({page:"dashboard"}),dashboardTab:H.page==="dashboard"?Rf(H.tab,{isAdmin:l}).id:null,onOpenDashboardTab:Ee=>b({page:"dashboard",tab:Ee}),onOpenNest:Ee=>b({page:"nest",nestId:Ee.nestId,nestName:Ee.nestName,isOwner:Ee.isOwner,isAnonOwned:Ee.isAnonOwned,tab:"documents"}),onOpenView:(Ee,nt)=>b({page:nt.page,nestId:Ee.nestId,nestName:Ee.nestName,isOwner:Ee.isOwner,isAnonOwned:Ee.isAnonOwned,readerMode:ye,...nt.page==="nest"&&nt.tab?{tab:nt.tab}:{}}),onConnect:()=>Z(!0),onOpenDocument:Ee=>{H.page==="document"&&Ee.nestId===H.nestId&&Ee.nodeId===H.nodeId||b({page:"document",nestId:Ee.nestId,nestName:Ee.nestName,nodeId:Ee.nodeId,isOwner:Ee.isOwner,isAnonOwned:Ee.isAnonOwned})},onNewDocument:!("nestId"in H)||H.page==="document"&&H.nodeId==="new"?void 0:Ee=>b({page:"document",nestId:H.nestId,nestName:H.nestName,nodeId:"new",isOwner:H.isOwner,isAnonOwned:H.isAnonOwned,initialFolder:Ee})})})})})()]}),c.jsxs("div",{className:Ct?"flex min-w-0 flex-1 flex-col":"",children:[c.jsxs("header",{className:"contents",children:[c.jsx("div",{className:"sticky top-0 z-40 border-b border-border bg-card",style:Kn,"data-reader-brand-header":Kn?"":void 0,children:c.jsxs("div",{className:`${An} h-16 px-4 flex items-center justify-between gap-2`,children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[Ct&&c.jsx(Ye,{variant:"ghost",size:"icon",className:`h-8 w-8 shrink-0${fr?" md:hidden":""}`,title:"Show sidebar","aria-label":"Show sidebar","data-testid":"nest-sidebar-expand",onClick:()=>{window.matchMedia("(max-width: 767px)").matches?ie(!0):ce(!1)},children:c.jsx(aE,{className:"h-4 w-4"})}),c.jsx("button",{onClick:()=>b(p.page==="nest"&&oe?{...p,readerDoc:void 0}:{page:"dashboard"}),className:`flex shrink-0 items-center gap-2 hover:opacity-80${fr?" md:hidden":""}${Ct?" max-sm:hidden":""}`,children:st?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:st.logo_url||t||Pc,alt:"",className:`h-8 w-auto max-w-[9rem] object-contain${st.logo_url?"":" hidden min-[480px]:block"}`}),c.jsx("span",{className:`max-w-[40vw] truncate font-semibold sm:max-w-[24rem]${st.logo_url?" hidden min-[480px]:inline":""}`,children:st.site_title||("nestName"in p?p.nestName:"")})]}):c.jsxs(c.Fragment,{children:[c.jsx("img",{src:t??Pc,alt:"ContextNest",className:"h-7 w-7 object-contain"}),c.jsx("span",{className:"font-semibold",children:"ContextNest"}),c.jsx(xm,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"Community"})]})}),Ct&&qn.length>0&&c.jsx("nav",{"aria-label":"Breadcrumb",className:"ml-1 flex min-w-0 items-center gap-1 text-sm","data-testid":"header-breadcrumb",children:qn.map((H,se)=>{const xe=se===qn.length-1;return c.jsxs("span",{className:`flex min-w-0 items-center gap-1${xe?"":" max-sm:hidden"}`,children:[se>0&&c.jsx(Ya,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60${xe?" max-sm:hidden":""}`,"aria-hidden":!0}),xe||!H.go?c.jsx("span",{className:Ew(xe),"aria-current":xe?"page":void 0,children:H.label}):c.jsx("button",{type:"button",onClick:H.go,className:`${Ew(!1)} hover:text-foreground`,children:H.label})]},se)})})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[ee&&c.jsxs("button",{onClick:()=>fe(!0),title:p.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","aria-label":"Search","data-testid":"global-search-trigger",children:[c.jsx(em,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"hidden sm:inline",children:"Search"}),c.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"&&!(s!=null&&s.me)&&c.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:[c.jsx(ev,{className:"h-3 w-3"}),"Open mode"]}),e==="key"&&!i&&c.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:[c.jsx(ev,{className:"h-3 w-3"}),"Public read-only"]}),p.page!=="docs"&&c.jsxs(Ye,{variant:"ghost",size:"sm",onClick:()=>b({page:"docs"}),title:"API, MCP & CLI docs for agents","aria-label":"Docs",children:[c.jsx(Gw,{className:"h-3.5 w-3.5 sm:mr-1"}),c.jsx("span",{className:"hidden sm:inline",children:"Docs"})]}),s!=null&&s.me?c.jsx(G4,{me:s.me,isAdmin:l,onShortcuts:()=>L(!0),onAccount:()=>b({page:"dashboard",tab:"account"}),onLogout:U}):c.jsxs(Ye,{variant:"outline",size:"sm",onClick:()=>C(!0),children:[c.jsx(su,{className:"h-3.5 w-3.5 mr-1"}),"Login"]})]})]})}),jc(p)&&!ye&&c.jsx("div",{className:`${An} px-4 py-2 overflow-x-auto flex items-center gap-2${fr?" md:hidden":""}`,children:c.jsx(gk,{value:p.page,onValueChange:H=>b({page:H,nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned,readerMode:ye,isArchived:p.isArchived}),children:c.jsx(ih,{children:Sk.filter(H=>{const se=xa(H.page);return!(se!=null&&se.visible)||se.visible({isReadOnly:Lt===!1,isReaderView:!!ye,canEditDocs:Lt===!0,workflowPlaneEnabled:d})}).filter(H=>!ye||!Rx(H.page)).map(H=>{const se=H.icon;return c.jsxs(ss,{value:H.page,className:"gap-1.5",children:[c.jsx(se,{className:"h-3.5 w-3.5"}),H.label,H.beta&&c.jsx(F4,{})]},H.page)})})})})]}),c.jsx("main",{className:`${An} min-w-0 overflow-x-clip${Ct?"":" px-4 py-4"}`,children:_.status==="unreachable"?c.jsxs("div",{className:"py-20 text-center",children:[c.jsx("p",{className:"text-lg font-medium",children:"This nest doesn't exist or you don't have access."}),c.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."}),c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[c.jsx(Ye,{variant:"outline",onClick:()=>E({status:"loading",nestId:_.nestId}),children:"Try again"}),c.jsx(Ye,{onClick:()=>E({status:"missing"}),children:"Back to dashboard"})]})]}):c.jsx("div",{className:Ct&&!Rs?"px-8 py-6":"",children:c.jsxs(m.Suspense,{fallback:c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:[p.page==="dashboard"&&(()=>{const H=Rf(p.tab,{isAdmin:l}).Component;return c.jsx(E4,{value:wt,children:c.jsx(m.Suspense,{fallback:c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:c.jsx(H,{})})})})(),p.page==="nest"&&c.jsx(U4,{nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned,isArchived:p.isArchived,initialSearch:p.initialSearch,initialTags:p.initialTags,initialFolder:p.initialFolder,initialTab:p.tab,initialDoc:p.readerDoc??null,onReaderDocChange:H=>b({...p,readerDoc:H??void 0}),onManageKeys:()=>b({page:"dashboard",tab:"api-keys"}),onTabChange:H=>b({...p,tab:H}),onBack:dr,onOpenDocument:(H,se)=>b({page:"document",nestId:p.nestId,nestName:p.nestName,nodeId:H,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned,initialFolder:se==null?void 0:se.folder,initialThreadId:se==null?void 0:se.thread}),onOpenTrace:()=>b({page:"nest-trace",nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned})}),p.page==="nest-trace"&&c.jsx(H4,{nestId:p.nestId,onBack:()=>b({page:"nest",nestId:p.nestId,nestName:p.nestName,isOwner:p.isOwner,isAnonOwned:p.isAnonOwned})}),p.page==="document"&&(()=>{const H=p,se=we=>b({page:"document",...we}),xe=we=>b({page:"nest",nestId:H.nestId,nestName:H.nestName,isOwner:H.isOwner,isAnonOwned:H.isAnonOwned,...we});return c.jsx(B4,{sidebarCollapsed:de,onToggleSidebar:()=>{window.matchMedia("(max-width: 767px)").matches?ie(!0):ce(!1)},nestId:H.nestId,nestName:H.nestName,nodeId:H.nodeId,initialFolder:H.initialFolder,initialThreadId:H.initialThreadId,isOwner:H.isOwner,breadcrumb:H.breadcrumb,onBack:()=>{const we=H.breadcrumb??[];if(we.length>0){const Ee=we[we.length-1];se({...Ee,breadcrumb:we.slice(0,-1)});return}xe({tab:"documents"})},onJumpBreadcrumb:we=>{const Ee=H.breadcrumb??[],nt=Ee[we];nt&&se({...nt,breadcrumb:Ee.slice(0,we)})},onSaved:()=>{h4(H.nodeId)&&xe()},onNavigateDocument:(we,Ee,nt)=>{const xt=H.breadcrumb??[],et=we===H.nestId;if(we===H.nestId&&Ee===H.nodeId)return;const Rt=xt.findIndex(tt=>tt.nestId===we&&tt.nodeId===Ee);if(Rt!==-1){se({nestId:we,nestName:et?H.nestName:"Document",nodeId:Ee,isOwner:et?H.isOwner:!1,isAnonOwned:et?H.isAnonOwned:!1,breadcrumb:xt.slice(0,Rt)});return}const Me=H.nodeId!=="new"?[...xt,{nestId:H.nestId,nestName:H.nestName,nodeId:H.nodeId,title:(nt==null?void 0:nt.trim())||"Untitled",isOwner:H.isOwner,isAnonOwned:H.isAnonOwned}]:xt;se({nestId:we,nestName:et?H.nestName:"Document",nodeId:Ee,isOwner:et?H.isOwner:!1,isAnonOwned:et?H.isAnonOwned:!1,breadcrumb:Me})},onTagClick:we=>xe({initialTags:[we]}),onOpenNest:()=>xe(),onOpenFolder:we=>xe({initialFolder:we}),onCreateDocument:(we,Ee)=>se({nestId:we,nestName:H.nestName,nodeId:"new",isOwner:H.isOwner,isAnonOwned:H.isAnonOwned,initialTitle:Ee}),initialTitle:H.initialTitle},`${H.nestId}/${H.nodeId}/${H.initialFolder??""}`)})(),jc(p)&&p.page!=="nest"&&(()=>{const H=xa(p.page);if(!H||Tf(p.page,ye))return null;const se=p,xe={nestId:se.nestId,nestName:se.nestName,isOwner:se.isOwner,isAnonOwned:se.isAnonOwned,isArchived:se.isArchived,openDocument:we=>b({page:"document",nestId:se.nestId,nestName:se.nestName,nodeId:we,isOwner:se.isOwner,isAnonOwned:se.isAnonOwned}),openNest:we=>b({page:"nest",nestId:se.nestId,nestName:se.nestName,isOwner:se.isOwner,isAnonOwned:se.isAnonOwned,...we!=null&&we.tags?{initialTags:we.tags}:{}}),leaveNest:dr};return c.jsx(N4,{value:xe,children:c.jsx(m.Suspense,{fallback:c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Loading..."}),children:c.jsx(H.Component,{})})})})(),p.page==="docs"&&c.jsx(V4,{onOpenGuide:()=>b({page:"dashboard",tab:"guide"})})]})})}),p.page!=="document"&&(st?c.jsx(T4,{branding:st,className:An}):c.jsxs("footer",{className:`${An} px-4 py-4 text-xs text-muted-foreground text-center`,children:["ContextNest Community",n?` v${n}`:""]}))]}),G&&"nestId"in p&&c.jsx(f4,{isOpen:!0,onClose:()=>Z(!1),nestId:p.nestId,nestName:p.nestName,onManageKeys:()=>{Z(!1),b({page:"dashboard",tab:"api-keys"})}}),S&&c.jsx(g4,{existingAdmin:((Vo=s==null?void 0:s.admin)==null?void 0:Vo.email)||null,onClose:()=>C(!1)}),On]})}function G4({me:e,isAdmin:t,onShortcuts:n,onAccount:s,onLogout:i}){var f;const l=((f=e.name)==null?void 0:f.trim())||e.email,d=l.charAt(0);return c.jsxs(qD,{modal:!1,children:[c.jsx(KD,{asChild:!0,children:c.jsxs(Ye,{variant:"ghost",size:"sm",className:"group h-9 gap-2 px-2","data-testid":"user-menu-trigger",children:[c.jsx(jp,{className:"h-[1.8rem] w-[1.8rem] rounded-sm shrink-0",children:c.jsx(Tp,{className:"rounded-sm",children:d})}),c.jsx("span",{className:"hidden sm:inline max-w-[140px] truncate text-sm font-medium",children:l}),c.jsx(Ro,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),c.jsxs(R1,{align:"end",className:"min-w-56",children:[c.jsxs("div",{className:"flex items-center gap-2 p-2",children:[c.jsx(jp,{className:"h-8 w-8 rounded-sm shrink-0",children:c.jsx(Tp,{className:"rounded-sm",children:d})}),c.jsxs("div",{className:"grid gap-0.5 leading-none min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-semibold truncate",children:l}),t&&c.jsxs(xm,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[c.jsx(su,{className:"h-2.5 w-2.5"}),"Admin"]})]}),c.jsx("div",{className:"text-sm text-muted-foreground truncate",children:e.email})]})]}),c.jsx(Ip,{}),c.jsxs(Mc,{onSelect:s,className:"cursor-pointer","data-testid":"user-menu-account",children:[c.jsx(nx,{className:"h-3.5 w-3.5 mr-2"}),"Account"]}),c.jsxs(Mc,{onSelect:n,className:"cursor-pointer",children:[c.jsx(qN,{className:"h-3.5 w-3.5 mr-2"}),"Keyboard shortcuts"]}),c.jsx(Ip,{}),c.jsxs(Mc,{onSelect:i,className:"cursor-pointer text-red-600 focus:text-red-700","data-testid":"user-menu-logout",children:[c.jsx(ex,{className:"h-3.5 w-3.5 mr-2"}),"Logout"]})]})]})}class Q4 extends m.Component{constructor(){super(...arguments);Fy(this,"state",{error:null,info:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,s){console.error("[ui] render crash:",n,s.componentStack),this.setState({info:s})}render(){const{error:n,info:s}=this.state;return n?c.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",children:c.jsxs("div",{className:"max-w-2xl w-full space-y-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-semibold text-destructive",children:"Something broke while rendering this page"}),c.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."})]}),c.jsx("pre",{className:"text-xs bg-muted rounded-md p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:n.message}),(s==null?void 0:s.componentStack)&&c.jsxs("details",{className:"text-xs",children:[c.jsx("summary",{className:"cursor-pointer text-muted-foreground",children:"Component stack"}),c.jsx("pre",{className:"mt-2 bg-muted rounded-md p-3 overflow-auto max-h-60 whitespace-pre-wrap",children:s.componentStack})]}),c.jsxs("div",{className:"flex gap-2",children:[c.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"}),c.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 Z4({children:e}){const[t]=m.useState(()=>{const n=RP();return MP(n),n});return c.jsx(_P,{client:t,children:e})}EC.createRoot(document.getElementById("root")).render(c.jsx(me.StrictMode,{children:c.jsx(Q4,{children:c.jsx(Z4,{children:c.jsxs(Q2,{children:[c.jsx(P4,{children:c.jsx(K4,{})}),c.jsx(eN,{richColors:!0,position:"bottom-right"})]})})})}));export{lF as $,Yc as A,Ye as B,Mi as C,ks as D,Yw as E,Jp as F,Mo as G,Io as H,Xc as I,$o as J,wu as K,Cr as L,Oi as M,Ta as N,Az as O,Oz as P,Ja as Q,mE as R,gk as S,IS as T,rx as U,ih as V,ss as W,ai as X,Wr as Y,nk as Z,IP as _,Jc as a,yF as a$,cF as a0,UF as a1,DP as a2,lu as a3,xF as a4,bp as a5,pN as a6,X4 as a7,AE as a8,Mz as a9,R3 as aA,$3 as aB,B3 as aC,K3 as aD,Pi as aE,J3 as aF,Y3 as aG,um as aH,Q3 as aI,uF as aJ,MN as aK,Z3 as aL,LF as aM,Nw as aN,O3 as aO,Gw as aP,dE as aQ,rv as aR,JE as aS,wp as aT,BP as aU,gF as aV,vF as aW,wF as aX,Bn as aY,Ax as aZ,tx as a_,DF as aa,e3 as ab,B as ac,LN as ad,hN as ae,ZN as af,A5 as ag,TF as ah,LL as ai,RF as aj,zL as ak,UL as al,bF as am,D3 as an,AP as ao,aE as ap,cE as aq,OF as ar,qD as as,KD as at,Ro as au,R1 as av,JD as aw,Mc as ax,Ip as ay,Yp as az,cz as b,k5 as b$,hF as b0,Qw as b1,zF as b2,j3 as b3,T3 as b4,M2 as b5,ev as b6,L2 as b7,D2 as b8,e2 as b9,oF as bA,SF as bB,_E as bC,tv as bD,su as bE,g3 as bF,$4 as bG,pF as bH,mF as bI,em as bJ,Ya as bK,D4 as bL,s2 as bM,lj as bN,$N as bO,VF as bP,HF as bQ,BF as bR,Pw as bS,fi as bT,Pc as bU,ja as bV,ru as bW,P3 as bX,S3 as bY,A3 as bZ,S5 as b_,z2 as ba,F2 as bb,V2 as bc,iF as bd,Bz as be,Vz as bf,Uz as bg,Yz as bh,Zz as bi,Wz as bj,Hz as bk,nF as bl,rF as bm,B2 as bn,Ma as bo,Gz as bp,H2 as bq,Xz as br,eF as bs,Jz as bt,Qz as bu,Lz as bv,zz as bw,Fz as bx,Dz as by,sF as bz,Le as c,F4 as c$,C5 as c0,_5 as c1,N5 as c2,f4 as c3,L3 as c4,H3 as c5,Zp as c6,jt as c7,G3 as c8,E3 as c9,XI as cA,EF as cB,t$ as cC,Za as cD,Gp as cE,xN as cF,Xp as cG,Zw as cH,u3 as cI,nx as cJ,jp as cK,Tp as cL,c3 as cM,$P as cN,aF as cO,n4 as cP,AF as cQ,p4 as cR,m4 as cS,h3 as cT,HE as cU,MF as cV,WE as cW,MS as cX,FF as cY,bE as cZ,Xw as c_,z3 as ca,U3 as cb,F3 as cc,W3 as cd,q3 as ce,N3 as cf,h5 as cg,g5 as ch,y5 as ci,v5 as cj,w5 as ck,b5 as cl,M3 as cm,Tc as cn,i2 as co,ou as cp,KM as cq,GM as cr,me as cs,qw as ct,YI as cu,ZI as cv,QI as cw,gw as cx,JI as cy,NF as cz,uz as d,Tb as d$,O5 as d0,dF as d1,UN as d2,Kz as d3,Iz as d4,$z as d5,X3 as d6,IF as d7,s4 as d8,$F as d9,Em as dA,cr as dB,CF as dC,BM as dD,LE as dE,t3 as dF,a3 as dG,i3 as dH,l3 as dI,n3 as dJ,m3 as dK,p3 as dL,o3 as dM,s3 as dN,r3 as dO,hz as dP,Qt as dQ,Oo as dR,Eb as dS,Pb as dT,Ae as dU,_u as dV,wn as dW,hu as dX,pu as dY,jb as dZ,jF as d_,XN as da,J4 as db,jm as dc,k3 as dd,nv as de,Tx as df,x3 as dg,_3 as dh,C3 as di,v3 as dj,b3 as dk,fF as dl,qz as dm,w3 as dn,GE as dp,B0 as dq,kF as dr,V0 as ds,qe as dt,_F as du,Pm as dv,Se as dw,H0 as dx,W0 as dy,PM as dz,xm as e,Tz as e0,Pz as e1,Rz as e2,jz as e3,_z as e4,bz as e5,Sz as e6,Cz as e7,kz as e8,Nz as e9,Ez as ea,f3 as eb,d3 as ec,gE as ed,az as ee,gz as ef,yz as eg,BL as eh,y3 as ei,V3 as ej,K5 as ek,dz as el,fz as em,pz as en,mz as eo,vz as ep,wz as eq,xz as er,Sw as f,lz as g,EE as h,Aa as i,c as j,w2 as k,Bt as l,ez as m,I3 as n,nz as o,rz as p,oz as q,m as r,sz as s,tF as t,Xa as u,iz as v,_e as w,Jf as x,tz as y,Ao as z};