@kidlat-dakila/flightplan 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/backend/main.js +944 -2316
  2. package/backend/plugin/skills/live/SKILL.md +79 -0
  3. package/backend/plugin/skills/review/SKILL.md +8 -5
  4. package/frontend/assets/_branchId-7x6qWn3I.js +1 -0
  5. package/frontend/assets/_branchId-OMHvVhfT.js +1 -0
  6. package/frontend/assets/_id-1eTNGJK9.js +1 -0
  7. package/frontend/assets/_id-CHxZrl-p.js +1 -0
  8. package/frontend/assets/agents-C9xHqVQD.js +1 -0
  9. package/frontend/assets/agents-KKXkUQ27.js +1 -0
  10. package/frontend/assets/create-B3JUVzoL.js +1 -0
  11. package/frontend/assets/create-CriuRRQV.js +1 -0
  12. package/frontend/assets/create-CsL8aMCo.js +1 -0
  13. package/frontend/assets/create-DhWyrgF0.js +1 -0
  14. package/frontend/assets/download-B00Se_e0.js +1 -0
  15. package/frontend/assets/forges-BMb9Pcn1.js +1 -0
  16. package/frontend/assets/forges-BOVWBO1B.js +1 -0
  17. package/frontend/assets/index-4USZJYGF.js +1 -0
  18. package/frontend/assets/index-B4xFHIrG.js +1 -0
  19. package/frontend/assets/index-BA8Qwprc.js +6 -0
  20. package/frontend/assets/index-BUcr0tJt.js +1 -0
  21. package/frontend/assets/index-Ba3RqmDE.js +1 -0
  22. package/frontend/assets/index-CFZ7PaJE.js +1 -0
  23. package/frontend/assets/index-COS3U9jZ.js +1 -0
  24. package/frontend/assets/index-COdzqD_M.js +1 -0
  25. package/frontend/assets/index-CTKqkqZN.css +1 -0
  26. package/frontend/assets/index-CZ3Rr8-h.js +1 -0
  27. package/frontend/assets/index-CikPFj0e.js +1 -0
  28. package/frontend/assets/index-Cl1Gcfks.js +1 -0
  29. package/frontend/assets/index-CmrDaRXW.js +1 -0
  30. package/frontend/assets/index-CrCss1qG.js +1 -0
  31. package/frontend/assets/index-D8-ze-TP.js +1 -0
  32. package/frontend/assets/index-DB42uFFk.js +1 -0
  33. package/frontend/assets/index-DGsH5lbQ.js +170 -0
  34. package/frontend/assets/index-DQyWuir1.js +1 -0
  35. package/frontend/assets/index-DRndyOxR.js +463 -0
  36. package/frontend/assets/index-DaFaImds.js +1 -0
  37. package/frontend/assets/index-DbJECumi.js +1 -0
  38. package/frontend/assets/index-DpY8OPAr.js +1 -0
  39. package/frontend/assets/index-DvuJKeYS.js +1 -0
  40. package/frontend/assets/index-paF1osGm.js +1 -0
  41. package/frontend/assets/repositories-AJnxH9f7.js +1 -0
  42. package/frontend/assets/repositories-Dy8KRYwV.js +1 -0
  43. package/frontend/assets/review-B9u6XA77.js +1 -0
  44. package/frontend/assets/review-M5J-BQx7.js +1 -0
  45. package/frontend/assets/route-BLz_XVsx.js +1 -0
  46. package/frontend/index.html +2 -2
  47. package/package.json +1 -2
  48. package/published-review/app.css +1 -1
  49. package/published-review/app.js +114 -108
  50. package/frontend/assets/_branchId-438YLxpk.js +0 -1
  51. package/frontend/assets/_branchId-PhBseeXo.js +0 -1
  52. package/frontend/assets/_id-yAHjl11v.js +0 -1
  53. package/frontend/assets/_id-z15a_Wqg.js +0 -1
  54. package/frontend/assets/agents-CF_BNYuU.js +0 -1
  55. package/frontend/assets/agents-CUULznCR.js +0 -1
  56. package/frontend/assets/create-Byti8N1q.js +0 -1
  57. package/frontend/assets/create-DHjp2cB6.js +0 -1
  58. package/frontend/assets/create-DiPNM_Jx.js +0 -1
  59. package/frontend/assets/create-t6MxPYs8.js +0 -1
  60. package/frontend/assets/download-kIOYm7yl.js +0 -1
  61. package/frontend/assets/forges-5NgJFexV.js +0 -1
  62. package/frontend/assets/forges-Dz31lZmK.js +0 -1
  63. package/frontend/assets/index-9MPLrKh9.js +0 -170
  64. package/frontend/assets/index-BDgPH-og.js +0 -1
  65. package/frontend/assets/index-BDhIIxnY.js +0 -1
  66. package/frontend/assets/index-BUtsWXGk.js +0 -1
  67. package/frontend/assets/index-BrL94etp.js +0 -1
  68. package/frontend/assets/index-C8_4U9zA.js +0 -457
  69. package/frontend/assets/index-CAt5Gv5u.js +0 -1
  70. package/frontend/assets/index-CBObEG9P.js +0 -1
  71. package/frontend/assets/index-CRQLJ5uq.js +0 -1
  72. package/frontend/assets/index-CSy69oc4.js +0 -1
  73. package/frontend/assets/index-Cjx98rmL.js +0 -1
  74. package/frontend/assets/index-CmW92SdM.js +0 -1
  75. package/frontend/assets/index-Cmg8rxUj.css +0 -1
  76. package/frontend/assets/index-DVMDfdCW.js +0 -1
  77. package/frontend/assets/index-DYy-kFEi.js +0 -1
  78. package/frontend/assets/index-Dk3p64fP.js +0 -1
  79. package/frontend/assets/index-Dq71dq4Z.js +0 -1
  80. package/frontend/assets/index-Dz-E4Hhc.js +0 -1
  81. package/frontend/assets/index-EFsgiJx1.js +0 -1
  82. package/frontend/assets/index-EItMs0kz.js +0 -1
  83. package/frontend/assets/index-N0J0txvy.js +0 -1
  84. package/frontend/assets/index-Qxg2C8CP.js +0 -1
  85. package/frontend/assets/index-RYSZy-Ra.js +0 -6
  86. package/frontend/assets/index-WOMODjD2.js +0 -1
  87. package/frontend/assets/repositories-BrbB16PW.js +0 -1
  88. package/frontend/assets/repositories-VWl6aq7K.js +0 -1
  89. package/frontend/assets/review-BMO-QDpl.js +0 -1
  90. package/frontend/assets/review-CXzRf1jk.js +0 -1
  91. package/frontend/assets/route--z3gnt4z.js +0 -1
@@ -0,0 +1,463 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DaFaImds.js","assets/index-s0xxzhVW.js","assets/index-paF1osGm.js","assets/index-COS3U9jZ.js","assets/index-COdzqD_M.js","assets/agents-KKXkUQ27.js","assets/index-Cl1Gcfks.js","assets/agents-C9xHqVQD.js","assets/index-CikPFj0e.js","assets/index-CFZ7PaJE.js","assets/index-BA8Qwprc.js","assets/index-DvuJKeYS.js","assets/forges-BMb9Pcn1.js","assets/forges-BOVWBO1B.js","assets/index-DpY8OPAr.js","assets/repositories-AJnxH9f7.js","assets/repositories-Dy8KRYwV.js","assets/index-BUcr0tJt.js","assets/review-M5J-BQx7.js","assets/review-B9u6XA77.js","assets/index-CZ3Rr8-h.js","assets/index-DQyWuir1.js","assets/index-CqVakH8R.js","assets/index-CmrDaRXW.js","assets/index-Ba3RqmDE.js","assets/index-DGsH5lbQ.js","assets/index-CrCss1qG.js","assets/index-D8-ze-TP.js","assets/index-DB42uFFk.js","assets/index-B4xFHIrG.js","assets/index-DbJECumi.js","assets/index-4USZJYGF.js","assets/_id-CHxZrl-p.js","assets/_id-1eTNGJK9.js","assets/create-DhWyrgF0.js","assets/create-CriuRRQV.js"])))=>i.map(i=>d[i]);
2
+ var XV=Object.defineProperty;var KR=t=>{throw TypeError(t)};var QV=(t,e,n)=>e in t?XV(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ut=(t,e,n)=>QV(t,typeof e!="symbol"?e+"":e,n),gv=(t,e,n)=>e.has(t)||KR("Cannot "+n);var oe=(t,e,n)=>(gv(t,e,"read from private field"),n?n.call(t):e.get(t)),it=(t,e,n)=>e.has(t)?KR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ve=(t,e,n,s)=>(gv(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),kt=(t,e,n)=>(gv(t,e,"access private method"),n);var x0=(t,e,n,s)=>({set _(i){Ve(t,e,i,n)},get _(){return oe(t,e,s)}});function ZV(t,e){for(var n=0;n<e.length;n++){const s=e[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(s,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function oC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yv={exports:{}},Dh={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and 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 YR;function JV(){if(YR)return Dh;YR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var r=null;if(o!==void 0&&(r=""+o),i.key!==void 0&&(r=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:r,ref:i!==void 0?i:null,props:o}}return Dh.Fragment=e,Dh.jsx=n,Dh.jsxs=n,Dh}var XR;function eq(){return XR||(XR=1,yv.exports=JV()),yv.exports}var b=eq(),bv={exports:{}},yt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and 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 QR;function tq(){if(QR)return yt;QR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),r=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.for("react.view_transition"),g=Symbol.iterator;function y(q){return q===null||typeof q!="object"?null:(q=g&&q[g]||q["@@iterator"],typeof q=="function"?q:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function N(q,X,Z){this.props=q,this.context=X,this.refs=w,this.updater=Z||v}N.prototype.isReactComponent={},N.prototype.setState=function(q,X){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,X,"setState")},N.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function C(){}C.prototype=N.prototype;function T(q,X,Z){this.props=q,this.context=X,this.refs=w,this.updater=Z||v}var R=T.prototype=new C;R.constructor=T,S(R,N.prototype),R.isPureReactComponent=!0;var A=Array.isArray;function k(){}var M={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function j(q,X,Z){var te=Z.ref;return{$$typeof:t,type:q,key:X,ref:te!==void 0?te:null,props:Z}}function D(q,X){return j(q.type,X,q.props)}function P(q){return typeof q=="object"&&q!==null&&q.$$typeof===t}function B(q){var X={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(Z){return X[Z]})}var I=/\/+/g;function F(q,X){return typeof q=="object"&&q!==null&&q.key!=null?B(""+q.key):X.toString(36)}function z(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(k,k):(q.status="pending",q.then(function(X){q.status==="pending"&&(q.status="fulfilled",q.value=X)},function(X){q.status==="pending"&&(q.status="rejected",q.reason=X)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function U(q,X,Z,te,Q){var se=typeof q;(se==="undefined"||se==="boolean")&&(q=null);var ae=!1;if(q===null)ae=!0;else switch(se){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(q.$$typeof){case t:case e:ae=!0;break;case f:return ae=q._init,U(ae(q._payload),X,Z,te,Q)}}if(ae)return Q=Q(q),ae=te===""?"."+F(q,0):te,A(Q)?(Z="",ae!=null&&(Z=ae.replace(I,"$&/")+"/"),U(Q,X,Z,"",function(fe){return fe})):Q!=null&&(P(Q)&&(Q=D(Q,Z+(Q.key==null||q&&q.key===Q.key?"":(""+Q.key).replace(I,"$&/")+"/")+ae)),X.push(Q)),1;ae=0;var le=te===""?".":te+":";if(A(q))for(var ne=0;ne<q.length;ne++)te=q[ne],se=le+F(te,ne),ae+=U(te,X,Z,se,Q);else if(ne=y(q),typeof ne=="function")for(q=ne.call(q),ne=0;!(te=q.next()).done;)te=te.value,se=le+F(te,ne++),ae+=U(te,X,Z,se,Q);else if(se==="object"){if(typeof q.then=="function")return U(z(q),X,Z,te,Q);throw X=String(q),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(q,X,Z){if(q==null)return q;var te=[],Q=0;return U(q,te,"","",function(se){return X.call(Z,se,Q++)}),te}function V(q){if(q._status===-1){var X=q._result,Z=X();Z.then(function(te){(q._status===0||q._status===-1)&&(q._status=1,q._result=te,Z.status===void 0&&(Z.status="fulfilled",Z.value=te))},function(te){(q._status===0||q._status===-1)&&(q._status=2,q._result=te,Z.status===void 0&&(Z.status="rejected",Z.reason=te))}),q._status===-1&&(q._status=0,q._result=Z)}if(q._status===1)return q._result.default;throw q._result}var W=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)};function G(q){var X=M.T,Z={};Z.types=X!==null?X.types:null,M.T=Z;try{var te=q(),Q=M.S;Q!==null&&Q(Z,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(k,W)}catch(se){W(se)}finally{X!==null&&Z.types!==null&&(X.types=Z.types),M.T=X}}function Y(q){var X=M.T;if(X!==null){var Z=X.types;Z===null?X.types=[q]:Z.indexOf(q)===-1&&Z.push(q)}else G(Y.bind(null,q))}var J={map:H,forEach:function(q,X,Z){H(q,function(){X.apply(this,arguments)},Z)},count:function(q){var X=0;return H(q,function(){X++}),X},toArray:function(q){return H(q,function(X){return X})||[]},only:function(q){if(!P(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return yt.Activity=p,yt.Children=J,yt.Component=N,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=T,yt.StrictMode=s,yt.Suspense=c,yt.ViewTransition=m,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,yt.__COMPILER_RUNTIME={__proto__:null,c:function(q){return M.H.useMemoCache(q)}},yt.addTransitionType=Y,yt.cache=function(q){return function(){return q.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(q,X,Z){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var te=S({},q.props),Q=q.key;if(X!=null)for(se in X.key!==void 0&&(Q=""+X.key),X)!L.call(X,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&X.ref===void 0||(te[se]=X[se]);var se=arguments.length-2;if(se===1)te.children=Z;else if(1<se){for(var ae=Array(se),le=0;le<se;le++)ae[le]=arguments[le+2];te.children=ae}return j(q.type,Q,te)},yt.createContext=function(q){return q={$$typeof:r,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:o,_context:q},q},yt.createElement=function(q,X,Z){var te,Q={},se=null;if(X!=null)for(te in X.key!==void 0&&(se=""+X.key),X)L.call(X,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(Q[te]=X[te]);var ae=arguments.length-2;if(ae===1)Q.children=Z;else if(1<ae){for(var le=Array(ae),ne=0;ne<ae;ne++)le[ne]=arguments[ne+2];Q.children=le}if(q&&q.defaultProps)for(te in ae=q.defaultProps,ae)Q[te]===void 0&&(Q[te]=ae[te]);return j(q,se,Q)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(q){return{$$typeof:a,render:q}},yt.isValidElement=P,yt.lazy=function(q){return{$$typeof:f,_payload:{_status:-1,_result:q},_init:V}},yt.memo=function(q,X){return{$$typeof:d,type:q,compare:X===void 0?null:X}},yt.startTransition=G,yt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},yt.use=function(q){return M.H.use(q)},yt.useActionState=function(q,X,Z){return M.H.useActionState(q,X,Z)},yt.useCallback=function(q,X){return M.H.useCallback(q,X)},yt.useContext=function(q){return M.H.useContext(q)},yt.useDebugValue=function(){},yt.useDeferredValue=function(q,X){return M.H.useDeferredValue(q,X)},yt.useEffect=function(q,X){return M.H.useEffect(q,X)},yt.useEffectEvent=function(q){return M.H.useEffectEvent(q)},yt.useId=function(){return M.H.useId()},yt.useImperativeHandle=function(q,X,Z){return M.H.useImperativeHandle(q,X,Z)},yt.useInsertionEffect=function(q,X){return M.H.useInsertionEffect(q,X)},yt.useLayoutEffect=function(q,X){return M.H.useLayoutEffect(q,X)},yt.useMemo=function(q,X){return M.H.useMemo(q,X)},yt.useOptimistic=function(q,X){return M.H.useOptimistic(q,X)},yt.useReducer=function(q,X,Z){return M.H.useReducer(q,X,Z)},yt.useRef=function(q){return M.H.useRef(q)},yt.useState=function(q){return M.H.useState(q)},yt.useSyncExternalStore=function(q,X,Z){return M.H.useSyncExternalStore(q,X,Z)},yt.useTransition=function(){return M.H.useTransition()},yt.version="19.3.0",yt}var ZR;function Af(){return ZR||(ZR=1,bv.exports=tq()),bv.exports}var _=Af();const Oo=oC(_),nq=ZV({__proto__:null,default:Oo},[_]),GI=_.createContext(void 0),Io=t=>{const e=_.useContext(GI);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},sq=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),b.jsx(GI.Provider,{value:t,children:e})),iq={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var ma,iC,DI,oq=(DI=class{constructor(){it(this,ma,iq);it(this,iC,!1)}setTimeoutProvider(t){Ve(this,ma,t)}setTimeout(t,e){return oe(this,ma).setTimeout(t,e)}clearTimeout(t){oe(this,ma).clearTimeout(t)}setInterval(t,e){return oe(this,ma).setInterval(t,e)}clearInterval(t){oe(this,ma).clearInterval(t)}},ma=new WeakMap,iC=new WeakMap,DI);const Pc=new oq;function rq(t){setTimeout(t,0)}const lq=typeof window>"u"||"Deno"in globalThis;function ii(){}function aq(t,e){return typeof t=="function"?t(e):t}function KI(t){return typeof t=="number"&&t>=0&&t!==1/0}function YI(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mn(t,e){return typeof t=="function"?t(e):t}function JR(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:r,stale:a}=t;if(r){if(s){if(e.queryHash!==rC(r,e.options))return!1}else if(!cf(e.queryKey,r))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||o&&!o(e))}function ek(t,e){const{exact:n,status:s,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(za(e.options.mutationKey)!==za(o))return!1}else if(!cf(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function rC(t,e){return((e==null?void 0:e.queryKeyHashFn)||za)(t)}function za(t){return JSON.stringify(t,(e,n)=>qS(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function cf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let s=0;s<e.length;s++)if(!cf(t[s],e[s]))return!1;return!0}const n=Object.keys(e);for(const s of n)if(!cf(t[s],e[s]))return!1;return!0}return!1}const cq=Object.prototype.hasOwnProperty;function XI(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=tk(t)&&tk(e);if(!s&&!(qS(t)&&qS(e)))return e;const i=(s?t:Object.keys(t)).length,o=s?e:Object.keys(e),r=o.length,a=s?new Array(r):{};let c=0;for(let d=0;d<r;d++){const f=s?d:o[d],p=t[f],m=e[f];if(p===m){a[f]=p,(s?d<i:cq.call(t,f))&&c++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){a[f]=m;continue}const g=XI(p,m,n+1);a[f]=g,g===p&&c++}return i===r&&c===i?t:a}function d1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function tk(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function qS(t){if(!nk(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const s=n.prototype;return!(!nk(s)||!s.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function nk(t){return Object.prototype.toString.call(t)==="[object Object]"}function uq(t){return new Promise(e=>{Pc.setTimeout(e,t)})}function WS(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?XI(t,e):e}function jy(t){return t}function dq(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function fq(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}const uo=Symbol();function QI(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===uo?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function lC(t,e){return typeof t=="function"?t(...e):!!t}function hq(t,e,n){let s=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}let pq=()=>lq;const aC=()=>pq();var _f=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vc,ga,Yd,jI,mq=(jI=class extends _f{constructor(){super();it(this,Vc);it(this,ga);it(this,Yd);Ve(this,Yd,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,ga)||this.setEventListener(oe(this,Yd))}onUnsubscribe(){var e;this.hasListeners()||((e=oe(this,ga))==null||e.call(this),Ve(this,ga,void 0))}setEventListener(e){var n;Ve(this,Yd,e),(n=oe(this,ga))==null||n.call(this),Ve(this,ga,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){oe(this,Vc)!==e&&(Ve(this,Vc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof oe(this,Vc)=="boolean"?oe(this,Vc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Vc=new WeakMap,ga=new WeakMap,Yd=new WeakMap,jI);const cC=new mq,gq=rq;function yq(){let t=[],e=0,n=a=>{a()},s=a=>{a()},i=gq;const o=a=>{e?t.push(a):i(()=>{n(a)})},r=()=>{const a=t;t=[],a.length&&i(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||r()}return c},batchCalls:a=>(...c)=>{o(()=>{a(...c)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{i=a}}}const fs=yq();var Xd,ya,Qd,PI,bq=(PI=class extends _f{constructor(){super();it(this,Xd,!0);it(this,ya);it(this,Qd);Ve(this,Qd,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){oe(this,ya)||this.setEventListener(oe(this,Qd))}onUnsubscribe(){var e;this.hasListeners()||((e=oe(this,ya))==null||e.call(this),Ve(this,ya,void 0))}setEventListener(e){var n;Ve(this,Qd,e),(n=oe(this,ya))==null||n.call(this),Ve(this,ya,e(this.setOnline.bind(this)))}setOnline(e){oe(this,Xd)!==e&&(Ve(this,Xd,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return oe(this,Xd)}},Xd=new WeakMap,ya=new WeakMap,Qd=new WeakMap,PI);const D1=new bq;function xq(t){return Math.min(1e3*2**t,3e4)}function ZI(t){return(t??"online")==="online"?D1.isOnline():!0}var GS=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function JI(t){let e=!1,n=0,s,i="pending",o,r;const a=new Promise((N,C)=>{o=N,r=C});a.catch(ii);const c=()=>i!=="pending",d=N=>{var C;if(!c()){const T=new GS(N);v(T),(C=t.onCancel)==null||C.call(t,T)}},f=()=>{e=!0},p=()=>{e=!1},m=()=>cC.isFocused()&&(t.networkMode==="always"||D1.isOnline())&&t.canRun(),g=()=>ZI(t.networkMode)&&t.canRun(),y=N=>{c()||(s==null||s(),i="resolved",o(N))},v=N=>{c()||(s==null||s(),i="rejected",r(N))},S=()=>new Promise(N=>{var C;s=T=>{(c()||m())&&N(T)},(C=t.onPause)==null||C.call(t)}).then(()=>{var N;s=void 0,c()||(N=t.onContinue)==null||N.call(t)}),w=()=>{if(c())return;let N;const C=n===0?t.initialPromise:void 0;try{N=C??t.fn()}catch(T){N=Promise.reject(T)}Promise.resolve(N).then(y).catch(T=>{var L;if(c())return;const R=t.retry??(aC()?0:3),A=t.retryDelay??xq,k=typeof A=="function"?A(n,T):A,M=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,T);if(e||!M){v(T);return}n++,(L=t.onFail)==null||L.call(t,n,T),uq(k).then(()=>m()?void 0:S()).then(()=>{e?v(T):w()})})};return{promise:a,status:()=>i,cancel:d,continue:()=>(s==null||s(),a),cancelRetry:f,continueRetry:p,canStart:g,start:()=>(g()?w():S().then(w),a)}}var qc,zI,e6=(zI=class{constructor(){it(this,qc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KI(this.gcTime)&&Ve(this,qc,Pc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(aC()?1/0:3e5))}clearGcTimeout(){oe(this,qc)!==void 0&&(Pc.clearTimeout(oe(this,qc)),Ve(this,qc,void 0))}},qc=new WeakMap,zI);function vq(t){return{onFetch:(e,n)=>{var f,p,m,g,y;const s=e.options,i=(m=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,o=((g=e.state.data)==null?void 0:g.pages)||[],r=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let v=!1;const S=C=>{hq(C,()=>e.signal,()=>v=!0)},w=QI(e.options,e.fetchOptions),N=async(C,T,R)=>{if(v)return Promise.reject(e.signal.reason);if(T==null&&C.pages.length)return Promise.resolve(C);const k=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:T,direction:R?"backward":"forward",meta:e.options.meta};return S(D),D})(),M=await w(k),{maxPages:L}=e.options,j=R?fq:dq;return{pages:j(C.pages,M,L),pageParams:j(C.pageParams,T,L)}};if(i&&o.length){const C=i==="backward",T=C?Sq:sk,R={pages:o,pageParams:r};a=await N(R,T(s,R),C)}else{const C=t??o.length;do{const T=c===0?r[0]??s.initialPageParam:sk(s,a);if(c>0&&T==null)break;a=await N(a,T),c++}while(c<C)}return a};e.options.persister?e.fetchFn=()=>{var v,S;return(S=(v=e.options).persister)==null?void 0:S.call(v,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function sk(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function Sq(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}var Zd,Wc,Jd,so,Gc,ds,am,Kc,wo,$r,BI,wq=(BI=class extends e6{constructor(e){super();it(this,wo);it(this,Zd);it(this,Wc);it(this,Jd);it(this,so);it(this,Gc);it(this,ds);it(this,am);it(this,Kc);Ve(this,Kc,!1),Ve(this,am,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ve(this,Gc,e.client),Ve(this,so,oe(this,Gc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ve(this,Wc,ok(this.options)),this.state=e.state??oe(this,Wc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return oe(this,Zd)}get promise(){var e;return(e=oe(this,ds))==null?void 0:e.promise}setOptions(e){if(this.options={...oe(this,am),...e},e!=null&&e._type&&Ve(this,Zd,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ok(this.options);n.data!==void 0&&(this.setState(ik(n.data,n.dataUpdatedAt)),Ve(this,Wc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,so).remove(this)}setData(e,n){const s=WS(this.state.data,e,this.options);return kt(this,wo,$r).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e){kt(this,wo,$r).call(this,{type:"setState",state:e})}cancel(e){var s,i;const n=(s=oe(this,ds))==null?void 0:s.promise;return(i=oe(this,ds))==null||i.cancel(e),n?n.then(ii).catch(ii):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return oe(this,Wc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Mn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===uo||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Mn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!YI(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(s=>s.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=oe(this,ds))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(s=>s.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=oe(this,ds))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),oe(this,so).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(oe(this,ds)&&(oe(this,Kc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?oe(this,ds).cancel({revert:!0}):oe(this,ds).cancelRetry()),this.scheduleGc()),oe(this,so).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||kt(this,wo,$r).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,m,g,y,v,S,w,N,C,T;if(this.state.fetchStatus!=="idle"&&((d=oe(this,ds))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,ds))return oe(this,ds).continueRetry(),oe(this,ds).promise}if(e&&this.setOptions(e),!this.options.queryFn){const R=this.observers.find(A=>A.options.queryFn);R&&this.setOptions(R.options)}const s=new AbortController,i=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(Ve(this,Kc,!0),s.signal)})},o=()=>{const R=QI(this.options,n),k=(()=>{const M={client:oe(this,Gc),queryKey:this.queryKey,meta:this.meta};return i(M),M})();return Ve(this,Kc,!1),this.options.persister?this.options.persister(R,k,this):R(k)},a=(()=>{const R={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:oe(this,Gc),state:this.state,fetchFn:o};return i(R),R})();(f=oe(this,Zd)==="infinite"?vq(this.options.pages):this.options.behavior)==null||f.onFetch(a,this),Ve(this,Jd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&kt(this,wo,$r).call(this,{type:"fetch",meta:(m=a.fetchOptions)==null?void 0:m.meta});const c=Ve(this,ds,JI({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:R=>{R instanceof GS&&R.revert&&this.setState({...oe(this,Jd),fetchStatus:"idle"}),s.abort()},onFail:(R,A)=>{kt(this,wo,$r).call(this,{type:"failed",failureCount:R,error:A})},onPause:()=>{kt(this,wo,$r).call(this,{type:"pause"})},onContinue:()=>{kt(this,wo,$r).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const R=await c.start();if(R===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(R),(y=(g=oe(this,so).config).onSuccess)==null||y.call(g,R,this),(S=(v=oe(this,so).config).onSettled)==null||S.call(v,R,this.state.error,this),R}catch(R){if(R instanceof GS){if(R.silent)return oe(this,ds).promise;if(R.revert){if(this.state.data===void 0)throw R;return this.state.data}}throw kt(this,wo,$r).call(this,{type:"error",error:R}),(N=(w=oe(this,so).config).onError)==null||N.call(w,R,this),(T=(C=oe(this,so).config).onSettled)==null||T.call(C,this.state.data,R,this),R}finally{oe(this,ds)===c&&Ve(this,ds,void 0),this.scheduleGc()}}},Zd=new WeakMap,Wc=new WeakMap,Jd=new WeakMap,so=new WeakMap,Gc=new WeakMap,ds=new WeakMap,am=new WeakMap,Kc=new WeakMap,wo=new WeakSet,$r=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...t6(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...ik(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ve(this,Jd,e.manual?i:void 0),i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),fs.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),oe(this,so).notify({query:this,type:"updated",action:e})})},BI);function t6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZI(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ik(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ok(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 ni,qt,cm,si,Yc,ef,Ur,um,tf,nf,Xc,Qc,ba,sf,on,Qh,KS,YS,XS,QS,ZS,JS,ew,tw,$I,n6=($I=class extends _f{constructor(e,n){super();it(this,on);it(this,ni);it(this,qt);it(this,cm);it(this,si);it(this,Yc);it(this,ef);it(this,Ur);it(this,um);it(this,tf);it(this,nf);it(this,Xc);it(this,Qc);it(this,ba);it(this,sf,new Set);this.options=n,Ve(this,ni,e),Ve(this,Ur,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,qt).addObserver(this),rk(oe(this,qt),this.options)?kt(this,on,Qh).call(this):this.updateResult(),kt(this,on,ZS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nw(oe(this,qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nw(oe(this,qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,kt(this,on,JS).call(this),kt(this,on,ew).call(this),oe(this,qt).removeObserver(this)}setOptions(e){const n=this.options,s=oe(this,qt);if(this.options=oe(this,ni).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Mn(this.options.enabled,oe(this,qt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");kt(this,on,tw).call(this),oe(this,qt).setOptions(this.options),n._defaulted&&!d1(this.options,n)&&oe(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,qt),observer:this});const i=this.hasListeners();i&&lk(oe(this,qt),s,this.options,n)&&kt(this,on,Qh).call(this),this.updateResult(),i&&(oe(this,qt)!==s||Mn(this.options.enabled,oe(this,qt))!==Mn(n.enabled,oe(this,qt))||Mn(this.options.staleTime,oe(this,qt))!==Mn(n.staleTime,oe(this,qt)))&&kt(this,on,YS).call(this);const o=kt(this,on,XS).call(this);i&&(oe(this,qt)!==s||Mn(this.options.enabled,oe(this,qt))!==Mn(n.enabled,oe(this,qt))||o!==oe(this,ba))&&kt(this,on,QS).call(this,o)}getOptimisticResult(e){const n=oe(this,ni).getQueryCache().build(oe(this,ni),e),s=this.createResult(n,e);return d1(this.getCurrentResult(),s)||(Ve(this,si,s),Ve(this,ef,this.options),Ve(this,Yc,oe(this,qt).state)),s}getCurrentResult(){return oe(this,si)}trackResult(e,n){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(s,i))})}trackProp(e){oe(this,sf).add(e)}getCurrentQuery(){return oe(this,qt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=oe(this,ni).defaultQueryOptions(e),s=oe(this,ni).getQueryCache().build(oe(this,ni),n);let i=()=>{},o;const r=new Promise(a=>{o=a,i=oe(this,ni).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,n)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,n);return o==null||o(a),a}).finally(()=>{i()}),r])}fetch(e){return kt(this,on,Qh).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,si)))}createResult(e,n){var A;const s=oe(this,qt),i=this.options,o=oe(this,si),r=oe(this,Yc),a=oe(this,ef),c=e!==s?e.state:oe(this,cm),{state:d}=e;let f={...d},p=!1,m;if(n._optimisticResults){const k=this.hasListeners(),M=!k&&rk(e,n),L=k&&lk(e,s,n,i);(M||L)&&(f={...f,...t6(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:v}=f;m=f.data;let S=!1;if(n.placeholderData!==void 0&&m===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(k=o.data,S=!0):k=typeof n.placeholderData=="function"?n.placeholderData((A=oe(this,nf))==null?void 0:A.state.data,oe(this,nf)):n.placeholderData,k!==void 0&&(v="success",m=WS(o==null?void 0:o.data,k,n),p=!0)}if(n.select&&m!==void 0&&!S)if(o&&m===(r==null?void 0:r.data)&&n.select===oe(this,um))m=oe(this,tf);else try{Ve(this,um,n.select),m=n.select(m),m=WS(o==null?void 0:o.data,m,n),Ve(this,tf,m),Ve(this,Ur,null)}catch(k){Ve(this,Ur,k)}else m===void 0&&Ve(this,Ur,null);oe(this,Ur)&&(g=oe(this,Ur),m=oe(this,tf),y=Date.now(),v="error",p=!1);const w=f.fetchStatus==="fetching",N=v==="pending",C=v==="error",T=N&&w,R=m!==void 0;return{status:v,fetchStatus:f.fetchStatus,isPending:N,isSuccess:v==="success",isError:C,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!N,isLoadingError:C&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&R,isStale:uC(e,n),refetch:this.refetch,isEnabled:Mn(n.enabled,e)!==!1}}updateResult(){const e=oe(this,si),n=this.createResult(oe(this,qt),this.options);if(Ve(this,Yc,oe(this,qt).state),Ve(this,ef,this.options),oe(this,Yc).data!==void 0&&Ve(this,nf,oe(this,qt)),d1(n,e))return;Ve(this,si,n);const i=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,r=typeof o=="function"?o():o;if(r==="all"||!r&&!oe(this,sf).size)return!0;const a=new Set(r??oe(this,sf));return this.options.throwOnError&&a.add("error"),Object.keys(oe(this,si)).some(c=>{const d=c;return oe(this,si)[d]!==e[d]&&a.has(d)})})();fs.batch(()=>{i&&this.listeners.forEach(o=>{o(oe(this,si))}),oe(this,ni).getQueryCache().notify({query:oe(this,qt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&kt(this,on,ZS).call(this)}},ni=new WeakMap,qt=new WeakMap,cm=new WeakMap,si=new WeakMap,Yc=new WeakMap,ef=new WeakMap,Ur=new WeakMap,um=new WeakMap,tf=new WeakMap,nf=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,ba=new WeakMap,sf=new WeakMap,on=new WeakSet,Qh=function(e){kt(this,on,tw).call(this);let n=oe(this,qt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ii)),n},KS=function(e){return!aC()&&Mn(this.options.enabled,oe(this,qt))!==!1&&KI(e)},YS=function(){kt(this,on,JS).call(this);const e=Mn(this.options.staleTime,oe(this,qt));if(oe(this,si).isStale||!kt(this,on,KS).call(this,e))return;const n=YI(oe(this,si).dataUpdatedAt,e)+1;Ve(this,Xc,Pc.setTimeout(()=>{oe(this,si).isStale||this.updateResult()},n))},XS=function(){return Mn(this.options.refetchInterval,oe(this,qt))??!1},QS=function(e){kt(this,on,ew).call(this),Ve(this,ba,e),!(oe(this,ba)===0||!kt(this,on,KS).call(this,oe(this,ba)))&&Ve(this,Qc,Pc.setInterval(()=>{(this.options.refetchIntervalInBackground||cC.isFocused())&&kt(this,on,Qh).call(this)},oe(this,ba)))},ZS=function(){kt(this,on,YS).call(this),kt(this,on,QS).call(this,kt(this,on,XS).call(this))},JS=function(){oe(this,Xc)!==void 0&&(Pc.clearTimeout(oe(this,Xc)),Ve(this,Xc,void 0))},ew=function(){oe(this,Qc)!==void 0&&(Pc.clearInterval(oe(this,Qc)),Ve(this,Qc,void 0))},tw=function(){const e=oe(this,ni).getQueryCache().build(oe(this,ni),this.options);if(e===oe(this,qt))return;const n=oe(this,qt);Ve(this,qt,e),Ve(this,cm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},$I);function Eq(t,e){return Mn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Mn(e.retryOnMount,t)===!1)}function rk(t,e){return Eq(t,e)||t.state.data!==void 0&&nw(t,e,e.refetchOnMount)}function nw(t,e,n){if(Mn(e.enabled,t)!==!1&&Mn(e.staleTime,t)!=="static"){const s=Mn(n,t);return s==="always"||s!==!1&&uC(t,e)}return!1}function lk(t,e,n,s){return(t!==e||Mn(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&uC(t,n)}function uC(t,e){return Mn(e.enabled,t)!==!1&&t.isStaleByTime(Mn(e.staleTime,t))}var dm,tr,Hs,Zc,nr,ra,FI,Cq=(FI=class extends e6{constructor(e){super();it(this,nr);it(this,dm);it(this,tr);it(this,Hs);it(this,Zc);Ve(this,dm,e.client),this.mutationId=e.mutationId,Ve(this,Hs,e.mutationCache),Ve(this,tr,[]),this.state=e.state||s6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){oe(this,tr).includes(e)||(oe(this,tr).push(e),this.clearGcTimeout(),oe(this,Hs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ve(this,tr,oe(this,tr).filter(n=>n!==e)),this.scheduleGc(),oe(this,Hs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){oe(this,tr).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Hs).remove(this))}continue(){var e;return((e=oe(this,Zc))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var a,c,d,f,p,m,g,y,v,S,w,N,C,T,R,A,k,M;const n=()=>{kt(this,nr,ra).call(this,{type:"continue"})},s={client:oe(this,dm),meta:this.options.meta,mutationKey:this.options.mutationKey},i=Ve(this,Zc,JI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(L,j)=>{kt(this,nr,ra).call(this,{type:"failed",failureCount:L,error:j})},onPause:()=>{kt(this,nr,ra).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Hs).canRun(this)})),o=this.state.status==="pending",r=!i.canStart();try{if(o)n();else{kt(this,nr,ra).call(this,{type:"pending",variables:e,isPaused:r}),oe(this,Hs).config.onMutate&&await oe(this,Hs).config.onMutate(e,this,s);const j=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,e,s));j!==this.state.context&&kt(this,nr,ra).call(this,{type:"pending",context:j,variables:e,isPaused:r})}const L=await i.start();return await((f=(d=oe(this,Hs).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,s)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,L,e,this.state.context,s)),await((y=(g=oe(this,Hs).config).onSettled)==null?void 0:y.call(g,L,null,this.state.variables,this.state.context,this,s)),await((S=(v=this.options).onSettled)==null?void 0:S.call(v,L,null,e,this.state.context,s)),kt(this,nr,ra).call(this,{type:"success",data:L}),L}catch(L){try{await((N=(w=oe(this,Hs).config).onError)==null?void 0:N.call(w,L,e,this.state.context,this,s))}catch(j){Promise.reject(j)}try{await((T=(C=this.options).onError)==null?void 0:T.call(C,L,e,this.state.context,s))}catch(j){Promise.reject(j)}try{await((A=(R=oe(this,Hs).config).onSettled)==null?void 0:A.call(R,void 0,L,this.state.variables,this.state.context,this,s))}catch(j){Promise.reject(j)}try{await((M=(k=this.options).onSettled)==null?void 0:M.call(k,void 0,L,e,this.state.context,s))}catch(j){Promise.reject(j)}throw kt(this,nr,ra).call(this,{type:"error",error:L}),L}finally{oe(this,Zc)===i&&Ve(this,Zc,void 0),oe(this,Hs).runNext(this)}}},dm=new WeakMap,tr=new WeakMap,Hs=new WeakMap,Zc=new WeakMap,nr=new WeakSet,ra=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),fs.batch(()=>{oe(this,tr).forEach(s=>{s.onMutationUpdate(e)}),oe(this,Hs).notify({mutation:this,type:"updated",action:e})})},FI);function s6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vr,Eo,fm,HI,Nq=(HI=class extends _f{constructor(e={}){super();it(this,Vr);it(this,Eo);it(this,fm);this.config=e,Ve(this,Vr,new Set),Ve(this,Eo,new Map),Ve(this,fm,0)}build(e,n,s){const i=new Cq({client:e,mutationCache:this,mutationId:++x0(this,fm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){oe(this,Vr).add(e);const n=v0(e);if(typeof n=="string"){const s=oe(this,Eo).get(n);s?s.push(e):oe(this,Eo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(oe(this,Vr).delete(e)){const n=v0(e);if(typeof n=="string"){const s=oe(this,Eo).get(n);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&oe(this,Eo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var s;const n=v0(e);if(typeof n=="string"){const i=(s=oe(this,Eo).get(n))==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var s,i;const n=v0(e);return typeof n=="string"?((i=(s=oe(this,Eo).get(n))==null?void 0:s.find(o=>o!==e&&o.state.isPaused))==null?void 0:i.continue())??Promise.resolve():Promise.resolve()}clear(){fs.batch(()=>{oe(this,Vr).forEach(e=>{this.notify({type:"removed",mutation:e})}),oe(this,Vr).clear(),oe(this,Eo).clear()})}getAll(){return Array.from(oe(this,Vr))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>ek(n,s))}findAll(e={}){return this.getAll().filter(n=>ek(e,n))}notify(e){fs.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return fs.batch(()=>Promise.all(e.map(n=>n.continue().catch(ii))))}},Vr=new WeakMap,Eo=new WeakMap,fm=new WeakMap,HI);function v0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var qr,xa,Us,Wr,ar,Zh,sw,UI,Tq=(UI=class extends _f{constructor(n,s){super();it(this,ar);it(this,qr);it(this,xa);it(this,Us);it(this,Wr);Ve(this,qr,n),this.setOptions(s),this.bindMethods(),kt(this,ar,Zh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const s=this.options;this.options=oe(this,qr).defaultMutationOptions(n),d1(this.options,s)||oe(this,qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:oe(this,Us),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&za(s.mutationKey)!==za(this.options.mutationKey)?this.reset():((i=oe(this,Us))==null?void 0:i.state.status)==="pending"&&oe(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&oe(this,Us)&&(oe(this,Us).addObserver(this),kt(this,ar,Zh).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=oe(this,Us))==null||n.removeObserver(this)}onMutationUpdate(n){kt(this,ar,Zh).call(this),kt(this,ar,sw).call(this,n)}getCurrentResult(){return oe(this,xa)}reset(){var n;(n=oe(this,Us))==null||n.removeObserver(this),Ve(this,Us,void 0),kt(this,ar,Zh).call(this),kt(this,ar,sw).call(this)}mutate(n,s){var i;return Ve(this,Wr,s),(i=oe(this,Us))==null||i.removeObserver(this),Ve(this,Us,oe(this,qr).getMutationCache().build(oe(this,qr),this.options)),oe(this,Us).addObserver(this),oe(this,Us).execute(n)}},qr=new WeakMap,xa=new WeakMap,Us=new WeakMap,Wr=new WeakMap,ar=new WeakSet,Zh=function(){var s;const n=((s=oe(this,Us))==null?void 0:s.state)??s6();Ve(this,xa,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},sw=function(n){fs.batch(()=>{var s,i,o,r,a,c,d,f;if(oe(this,Wr)&&this.hasListeners()){const p=oe(this,xa).variables,m=oe(this,xa).context,g={client:oe(this,qr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=oe(this,Wr)).onSuccess)==null||i.call(s,n.data,p,m,g)}catch(y){Promise.reject(y)}try{(r=(o=oe(this,Wr)).onSettled)==null||r.call(o,n.data,null,p,m,g)}catch(y){Promise.reject(y)}}else if((n==null?void 0:n.type)==="error"){try{(c=(a=oe(this,Wr)).onError)==null||c.call(a,n.error,p,m,g)}catch(y){Promise.reject(y)}try{(f=(d=oe(this,Wr)).onSettled)==null||f.call(d,void 0,n.error,p,m,g)}catch(y){Promise.reject(y)}}}this.listeners.forEach(p=>{p(oe(this,xa))})})},UI),sr,VI,Oq=(VI=class extends _f{constructor(e={}){super();it(this,sr);this.config=e,Ve(this,sr,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??rC(i,n);let r=this.get(o);return r||(r=new wq({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(r)),r}add(e){oe(this,sr).has(e.queryHash)||(oe(this,sr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){oe(this,sr).get(e.queryHash)===e&&(e.destroy(),oe(this,sr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){fs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return oe(this,sr).get(e)}getAll(){return[...oe(this,sr).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>JR(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>JR(e,s)):n}notify(e){fs.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){fs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},sr=new WeakMap,VI),$n,va,Sa,of,rf,wa,lf,af,qI,Rq=(qI=class{constructor(t={}){it(this,$n);it(this,va);it(this,Sa);it(this,of);it(this,rf);it(this,wa);it(this,lf);it(this,af);Ve(this,$n,t.queryCache||new Oq),Ve(this,va,t.mutationCache||new Nq),Ve(this,Sa,t.defaultOptions||{}),Ve(this,of,new Map),Ve(this,rf,new Map),Ve(this,wa,0)}mount(){x0(this,wa)._++,oe(this,wa)===1&&(Ve(this,lf,cC.subscribe(async t=>{t&&(await this.resumePausedMutations(),oe(this,$n).onFocus())})),Ve(this,af,D1.subscribe(async t=>{t&&(await this.resumePausedMutations(),oe(this,$n).onOnline())})))}unmount(){var t,e;x0(this,wa)._--,oe(this,wa)===0&&((t=oe(this,lf))==null||t.call(this),Ve(this,lf,void 0),(e=oe(this,af))==null||e.call(this),Ve(this,af,void 0))}isFetching(t){return oe(this,$n).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return oe(this,va).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=oe(this,$n).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=oe(this,$n).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Mn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return oe(this,$n).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var r;const s=this.defaultQueryOptions({queryKey:t}),i=(r=oe(this,$n).get(s.queryHash))==null?void 0:r.state.data,o=aq(e,i);if(o!==void 0)return oe(this,$n).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return fs.batch(()=>oe(this,$n).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=oe(this,$n).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=oe(this,$n);fs.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=oe(this,$n);return fs.batch(()=>{const s=n.findAll(t),i=new Set(s);return s.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>i.has(o)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},s=fs.batch(()=>oe(this,$n).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(ii).catch(ii)}invalidateQueries(t,e={}){return fs.batch(()=>(oe(this,$n).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=fs.batch(()=>oe(this,$n).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ii)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(ii)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=oe(this,$n).build(this,e),s=n.isStaleByTime(Mn(e.staleTime,n))?await n.fetch(e):n.state.data,i=e.select;return i?i(s):s}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=oe(this,$n).build(this,e);return n.isStaleByTime(Mn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ii).catch(ii)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ii).catch(ii)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return D1.isOnline()?oe(this,va).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,$n)}getMutationCache(){return oe(this,va)}getDefaultOptions(){return oe(this,Sa)}setDefaultOptions(t){Ve(this,Sa,t)}setQueryDefaults(t,e){oe(this,of).set(za(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...oe(this,of).values()],n={};return e.forEach(s=>{cf(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){oe(this,rf).set(za(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...oe(this,rf).values()],n={};return e.forEach(s=>{cf(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...oe(this,Sa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=rC(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===uo&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...oe(this,Sa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){oe(this,$n).clear(),oe(this,va).clear()}},$n=new WeakMap,va=new WeakMap,Sa=new WeakMap,of=new WeakMap,rf=new WeakMap,wa=new WeakMap,lf=new WeakMap,af=new WeakMap,qI);const i6=_.createContext(!1),kq=()=>_.useContext(i6);i6.Provider;function Aq(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const _q=_.createContext(Aq()),Mq=()=>_.useContext(_q),Lq=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?lC(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||s)&&(e.isReset()||(t.retryOnMount=!1))},Iq=t=>{_.useEffect(()=>{t.clearReset()},[t])},Dq=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||lC(n,[t.error,s])),jq=(t,e)=>e.state.data===void 0,Pq=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},zq=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Bq=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function o6(t,e,n){const s=kq(),i=Mq(),o=Io(),r=o.defaultQueryOptions(t),a=o.getQueryCache().get(r.queryHash),c=t.subscribed!==!1;r._optimisticResults=s?"isRestoring":c?"optimistic":void 0,Pq(r),Lq(r,i,a),Iq(i);const[d]=_.useState(()=>new e(o,r)),f=d.getOptimisticResult(r),p=!s&&c;if(_.useSyncExternalStore(_.useCallback(m=>{const g=p?d.subscribe(fs.batchCalls(m)):ii;return d.updateResult(),g},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),_.useEffect(()=>{d.setOptions(r)},[r,d]),zq(r,f))throw Bq(r,d,i);if(Dq({result:f,errorResetBoundary:i,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw f.error;return r.notifyOnChangeProps?f:d.trackResult(f)}function fr(t,e){return o6(t,n6)}function $q(t,e){return o6({...t,enabled:!0,suspense:!0,throwOnError:jq,placeholderData:void 0},n6)}function Wn(t,e){const n=Io(),[s]=_.useState(()=>new Tq(n,t));_.useEffect(()=>{s.setOptions(t)},[s,t]);const i=_.useSyncExternalStore(_.useCallback(r=>s.subscribe(fs.batchCalls(r)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=_.useCallback((...r)=>{s.mutate(r[0],r[1]).catch(ii)},[s]);if(i.error&&lC(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var xv={exports:{}},jh={},vv={exports:{}},Sv={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and 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 ak;function Fq(){return ak||(ak=1,(function(t){function e(z,U){var H=z.length;z.push(U);e:for(;0<H;){var V=H-1>>>1,W=z[V];if(0<i(W,U))z[V]=U,z[H]=W,H=V;else break e}}function n(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var U=z[0],H=z.pop();if(H!==U){z[0]=H;e:for(var V=0,W=z.length,G=W>>>1;V<G;){var Y=2*(V+1)-1,J=z[Y],q=Y+1,X=z[q];if(0>i(J,H))q<W&&0>i(X,J)?(z[V]=X,z[q]=H,V=q):(z[V]=J,z[Y]=H,V=Y);else if(q<W&&0>i(X,H))z[V]=X,z[q]=H,V=q;else break e}}return U}function i(z,U){var H=z.sortIndex-U.sortIndex;return H!==0?H:z.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var r=Date,a=r.now();t.unstable_now=function(){return r.now()-a}}var c=[],d=[],f=1,p=null,m=3,g=!1,y=!1,v=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function T(z){for(var U=n(d);U!==null;){if(U.callback===null)s(d);else if(U.startTime<=z)s(d),U.sortIndex=U.expirationTime,e(c,U);else break;U=n(d)}}function R(z){if(v=!1,T(z),!y)if(n(c)!==null)y=!0,A||(A=!0,P());else{var U=n(d);U!==null&&F(R,U.startTime-z)}}var A=!1,k=-1,M=5,L=-1;function j(){return S?!0:!(t.unstable_now()-L<M)}function D(){if(S=!1,A){var z=t.unstable_now();L=z;var U=!0;try{e:{y=!1,v&&(v=!1,N(k),k=-1),g=!0;var H=m;try{t:{for(T(z),p=n(c);p!==null&&!(p.expirationTime>z&&j());){var V=p.callback;if(typeof V=="function"){p.callback=null,m=p.priorityLevel;var W=V(p.expirationTime<=z);if(z=t.unstable_now(),typeof W=="function"){p.callback=W,T(z),U=!0;break t}p===n(c)&&s(c),T(z)}else s(c);p=n(c)}if(p!==null)U=!0;else{var G=n(d);G!==null&&F(R,G.startTime-z),U=!1}}break e}finally{p=null,m=H,g=!1}U=void 0}}finally{U?P():A=!1}}}var P;if(typeof C=="function")P=function(){C(D)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,I=B.port2;B.port1.onmessage=D,P=function(){I.postMessage(null)}}else P=function(){w(D,0)};function F(z,U){k=w(function(){z(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(z){switch(m){case 1:case 2:case 3:var U=3;break;default:U=m}var H=m;m=U;try{return z()}finally{m=H}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(z,U){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var H=m;m=z;try{return U()}finally{m=H}},t.unstable_scheduleCallback=function(z,U,H){var V=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?V+H:V):H=V,z){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=H+W,z={id:f++,callback:U,priorityLevel:z,startTime:H,expirationTime:W,sortIndex:-1},H>V?(z.sortIndex=H,e(d,z),n(c)===null&&z===n(d)&&(v?(N(k),k=-1):v=!0,F(R,H-V))):(z.sortIndex=W,e(c,z),y||g||(y=!0,A||(A=!0,P()))),z},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(z){var U=m;return function(){var H=m;m=U;try{return z.apply(this,arguments)}finally{m=H}}}})(Sv)),Sv}var ck;function Hq(){return ck||(ck=1,vv.exports=Fq()),vv.exports}var wv={exports:{}},_s={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and 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 uk;function Uq(){if(uk)return _s;uk=1;var t=Af();function e(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),r=Symbol.for("react.optimistic_key");function a(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:g===r?r:""+g,children:f,containerInfo:p,implementation:m}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return _s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,_s.browser=function(f){return{$$typeof:o,_reason:f}},_s.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return a(f,p,null,m)},_s.flushSync=function(f){var p=c.T,m=s.p;try{if(c.T=null,s.p=2,f)return f()}finally{c.T=p,s.p=m,s.d.f()}},_s.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(f,p))},_s.prefetchDNS=function(f){typeof f=="string"&&s.d.D(f)},_s.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?s.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):m==="script"&&s.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},_s.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);s.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&s.d.M(f)},_s.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin);s.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},_s.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(p.as,p.crossOrigin);s.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else s.d.m(f)},_s.requestFormReset=function(f){s.d.r(f)},_s.unstable_batchedUpdates=function(f,p){return f(p)},_s.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},_s.useFormStatus=function(){return c.H.useHostTransitionStatus()},_s.version="19.3.0",_s}var dk;function r6(){if(dk)return wv.exports;dk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),wv.exports=Uq(),wv.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var fk;function Vq(){if(fk)return jh;fk=1;var t=Hq(),e=Af(),n=r6();function s(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function o(l){for(var u=l,h=u;h&&!h.alternate;)u=h,(u.flags&4098)!==0&&(l=u.return),h=u.return;for(;u.return;)u=u.return;return u.tag===3?l:null}function r(l){if(l.tag===13){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function a(l){if(l.tag===31){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function c(l){if(o(l)!==l)throw Error(s(188))}function d(l){var u=l.alternate;if(!u){if(u=o(l),u===null)throw Error(s(188));return u!==l?null:l}for(var h=l,x=u;;){var E=h.return;if(E===null)break;var O=E.alternate;if(O===null){if(x=E.return,x!==null){h=x;continue}break}if(E.child===O.child){for(O=E.child;O;){if(O===h)return c(E),l;if(O===x)return c(E),u;O=O.sibling}throw Error(s(188))}if(h.return!==x.return)h=E,x=O;else{for(var $=!1,K=E.child;K;){if(K===h){$=!0,h=E,x=O;break}if(K===x){$=!0,x=E,h=O;break}K=K.sibling}if(!$){for(K=O.child;K;){if(K===h){$=!0,h=O,x=E;break}if(K===x){$=!0,x=O,h=E;break}K=K.sibling}if(!$)throw Error(s(189))}}if(h.alternate!==x)throw Error(s(190))}if(h.tag!==3)throw Error(s(188));return h.stateNode.current===h?l:u}function f(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(u=f(l),u!==null)return u;l=l.sibling}return null}function p(l,u,h,x,E,O){for(;l!==null;){if((l.tag===5||l.tag===27||l.tag===6)&&h(l,x,E,O)||(l.tag!==22||l.memoizedState===null)&&(u||l.tag!==5&&l.tag!==27)&&p(l.child,u,h,x,E,O))return!0;l=l.sibling}return!1}function m(l){for(l=l.return;l!==null;){if(l.tag===3||l.tag===5||l.tag===27)return l;l=l.return}return null}function g(l){var u=!1;for(l=l.return;l!==null&&(l.tag===4&&(u=!0),!(l.tag===3||l.tag===5||l.tag===27));)l=l.return;return u}function y(l){var u=[null,null],h=m(l);return h===null||v(u,l,h.child,{foundSelf:!1}),u}function v(l,u,h,x){for(;h!==null;){if(h===u)x.foundSelf=!0;else if(h.tag===5||h.tag===27||h.tag===6){if(x.foundSelf)return l[1]=h,!0;l[0]=h}else if((h.tag!==22||h.memoizedState===null)&&v(l,u,h.child,x))return!0;h=h.sibling}return!1}function S(l){switch(l.tag){case 5:case 27:case 6:return l.stateNode;case 3:return l.stateNode.containerInfo;default:throw Error(s(559))}}var w=null,N=null;function C(l,u,h){return l===h?!0:l===u?(w=l,!0):!1}function T(l,u,h){return l===h?(N=l,!1):l===u?(N!==null&&(w=l),!0):!1}function R(l){if(l===null)return null;do l=l===null?null:l.return;while(l&&l.tag!==5&&l.tag!==27&&l.tag!==3);return l||null}function A(l,u,h){for(var x=0,E=l;E;E=h(E))x++;E=0;for(var O=u;O;O=h(O))E++;for(;0<x-E;)l=h(l),x--;for(;0<E-x;)u=h(u),E--;for(;x--;){if(l===u||u!==null&&l===u.alternate)return l;l=h(l),u=h(u)}return null}var k=Object.assign,M=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),F=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),Y=Symbol.for("react.legacy_hidden"),J=Symbol.for("react.memo_cache_sentinel"),q=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),Z=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Symbol.for("react.client.reference");function se(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Q?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case D:return"Fragment";case B:return"Profiler";case P:return"StrictMode";case U:return"Suspense";case H:return"SuspenseList";case G:return"Activity";case q:return"ViewTransition"}if(typeof l=="object")switch(l.$$typeof){case j:return"Portal";case F:return l.displayName||"Context";case I:return(l._context.displayName||"Context")+".Consumer";case z:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case V:return u=l.displayName||null,u!==null?u:se(l.type)||"Memo";case W:u=l._payload,l=l._init;try{return se(l(u))}catch{}}return null}var ae=Array.isArray,le=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},ve=[],we=-1;function Ce(l){return{current:l}}function ye(l){0>we||(l.current=ve[we],ve[we]=null,we--)}function Oe(l,u){we++,ve[we]=l.current,l.current=u}var be=Ce(null),_e=Ce(null),Me=Ce(null),Be=Ce(null);function He(l,u){switch(Oe(Me,u),Oe(_e,l),Oe(be,null),u.nodeType){case 9:case 11:l=(l=u.documentElement)&&(l=l.namespaceURI)?sR(l):0;break;default:if(l=u.tagName,u=u.namespaceURI)u=sR(u),l=iR(u,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}ye(be),Oe(be,l)}function Ae(){ye(be),ye(_e),ye(Me)}function Ee(l){var u=l.memoizedState;u!==null&&(md._currentValue=u.memoizedState,Oe(Be,l)),u=be.current;var h=iR(u,l.type);u!==h&&(Oe(_e,l),Oe(be,h))}function Ne(l){_e.current===l&&(ye(be),ye(_e)),Be.current===l&&(ye(Be),md._currentValue=fe)}var xe,Pe;function We(l){if(xe===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);xe=u&&u[1]||"",Pe=-1<h.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+xe+l+Pe}var et=!1;function At(l,u){if(!l||et)return"";et=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){var ke=function(){throw Error()};if(Object.defineProperty(ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ke,[])}catch(Fe){var ce=Fe}Reflect.construct(l,[],ke)}else{try{ke.call()}catch(Fe){ce=Fe}ke=!1;try{var pe=Object.getOwnPropertyDescriptor(l.prototype,"props");Object.defineProperty(l.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ke=!0,new l}finally{ke&&(pe!==void 0?Object.defineProperty(l.prototype,"props",pe):delete l.prototype.props)}}}else{try{throw Error()}catch(Fe){ce=Fe}(ke=l())&&typeof ke.catch=="function"&&ke.catch(function(){})}}catch(Fe){if(Fe&&ce&&typeof Fe.stack=="string")return[Fe.stack,ce.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=x.DetermineComponentFrameRoot(),$=O[0],K=O[1];if($&&K){var ie=$.split(`
45
+ `),de=K.split(`
46
+ `);for(E=x=0;x<ie.length&&!ie[x].includes("DetermineComponentFrameRoot");)x++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(x===ie.length||E===de.length)for(x=ie.length-1,E=de.length-1;1<=x&&0<=E&&ie[x]!==de[E];)E--;for(;1<=x&&0<=E;x--,E--)if(ie[x]!==de[E]){if(x!==1||E!==1)do if(x--,E--,0>E||ie[x]!==de[E]){var ge=`
47
+ `+ie[x].replace(" at new "," at ");return l.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",l.displayName)),ge}while(1<=x&&0<=E);break}}}finally{et=!1,Error.prepareStackTrace=h}return(h=l?l.displayName||l.name:"")?We(h):""}function ze(l,u){switch(l.tag){case 26:case 27:case 5:return We(l.type);case 16:return We("Lazy");case 13:return l.child!==u&&u!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return At(l.type,!1);case 11:return At(l.type.render,!1);case 1:return At(l.type,!0);case 31:return We("Activity");case 30:return We("ViewTransition");default:return""}}function Te(l){try{var u="",h=null;do u+=ze(l,h),h=l,l=l.return;while(l);return u}catch(x){return`
48
+ Error generating stack: `+x.message+`
49
+ `+x.stack}}var qe=Object.prototype.hasOwnProperty,ot=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,Ct=t.unstable_shouldYield,En=t.unstable_requestPaint,Mt=t.unstable_now,jt=t.unstable_getCurrentPriorityLevel,rn=t.unstable_ImmediatePriority,Cn=t.unstable_UserBlockingPriority,nn=t.unstable_NormalPriority,st=t.unstable_LowPriority,St=t.unstable_IdlePriority,dn=t.log,rt=t.unstable_setDisableYieldValue,Wt=null,_t=null;function It(l){if(typeof dn=="function"&&rt(l),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(Wt,l)}catch{}}var Zt=Math.clz32?Math.clz32:ln,Nn=Math.log,bn=Math.LN2;function ln(l){return l>>>=0,l===0?32:31-(Nn(l)/bn|0)|0}var $e=256,Tt=262144,Gt=4194304;function Ie(l){var u=l&42;if(u!==0)return u;switch(l&-l){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&-l;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Xe(l,u,h){var x=l.pendingLanes;if(x===0)return 0;var E=0,O=l.suspendedLanes,$=l.pingedLanes;l=l.warmLanes;var K=x&134217727;return K!==0?(x=K&~O,x!==0?E=Ie(x):($&=K,$!==0?E=Ie($):h||(h=K&~l,h!==0&&(E=Ie(h))))):(K=x&~O,K!==0?E=Ie(K):$!==0?E=Ie($):h||(h=x&~l,h!==0&&(E=Ie(h)))),E===0?0:u!==0&&u!==E&&(u&O)===0&&(O=E&-E,h=u&-u,O>=h||O===32&&(h&4194048)!==0)?u:E}function mt(l,u){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&u)===0}function jn(l,u){(u&8)!==0&&(u|=u&32);var h=l.entangledLanes;if(h!==0)for(l=l.entanglements,h&=u;0<h;){var x=31-Zt(h),E=1<<x;u|=l[x],h&=~E}return u}function po(l,u){switch(l){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Es(){var l=Gt;return Gt<<=1,(Gt&62914560)===0&&(Gt=4194304),l}function zo(l){for(var u=[],h=0;31>h;h++)u.push(l);return u}function Ni(l,u){l.pendingLanes|=u,u!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Cl(l,u,h,x,E,O){var $=l.pendingLanes;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=h,l.entangledLanes&=h,l.errorRecoveryDisabledLanes&=h,l.shellSuspendCounter=0;var K=l.entanglements,ie=l.expirationTimes,de=l.hiddenUpdates;for(h=$&~h;0<h;){var ge=31-Zt(h),ke=1<<ge;K[ge]=0,ie[ge]=-1;var ce=de[ge];if(ce!==null)for(de[ge]=null,ge=0;ge<ce.length;ge++){var pe=ce[ge];pe!==null&&(pe.lane&=-536870913)}h&=~ke}x!==0&&Ti(l,x,0),O!==0&&E===0&&l.tag!==0&&(l.suspendedLanes|=O&~($&~u))}function Ti(l,u,h){l.pendingLanes|=u,l.suspendedLanes&=~u;var x=31-Zt(u);l.entangledLanes|=u,l.entanglements[x]=l.entanglements[x]|1073741824|h&261930}function Nl(l,u){var h=l.entangledLanes|=u;for(l=l.entanglements;h;){var x=31-Zt(h),E=1<<x;E&u|l[x]&u&&(l[x]|=u),h&=~E}}function br(l,u){var h=u&-u;return h=(h&42)!==0?1:mo(h),(h&(l.suspendedLanes|u))!==0?0:h}function mo(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function fi(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function hi(){var l=ne.p;return l!==0?l:(l=window.event,l===void 0?32:FR(l.type))}function xr(l,u){var h=ne.p;try{return ne.p=l,u()}finally{ne.p=h}}var Pn=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Pn,as="__reactProps$"+Pn,Ys="__reactContainer$"+Pn,sc="__reactEvents$"+Pn,vr="__reactListeners$"+Pn,Tl="__reactHandles$"+Pn,Bo="__reactResources$"+Pn,Sr="__reactMarker$"+Pn,Ol="__reactLoad$"+Pn;function Rl(l){delete l[Rn],delete l[as],delete l[vr],delete l[Tl]}function Oi(l){var u;if(u=l[Rn])return u;for(var h=l.parentNode;h;){if(u=h[Ys]||h[Rn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(l=SR(l);l!==null;){if(h=l[Rn])return h;l=SR(l)}return u}l=h,h=l.parentNode}return null}function wr(l){if(l=l[Rn]||l[Ys]){var u=l.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return l}return null}function me(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l.stateNode;throw Error(s(33))}function Le(l){var u=l[Bo];return u||(u=l[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function De(l){l[Sr]=!0}function Je(l){l[Ol]=void 0}var gt=new Set,pt={};function wt(l,u){an(l,u),an(l+"Capture",u)}function an(l,u){for(pt[l]=u,l=0;l<u.length;l++)gt.add(u[l])}var tn=RegExp("^[: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]*$"),lt={},Nt={};function Jt(l){return qe.call(Nt,l)?!0:qe.call(lt,l)?!1:tn.test(l)?Nt[l]=!0:(lt[l]=!0,!1)}var dt=!1;function cs(){var l=dt;return dt=!1,l}function zn(l,u,h){if(Jt(u))if(h===null)l.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":l.removeAttribute(u);return;case"boolean":var x=u.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){l.removeAttribute(u);return}}l.setAttribute(u,h)}}function Ri(l,u,h){if(h===null)l.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(u);return}l.setAttribute(u,h)}}function Qn(l,u,h,x){if(x===null)l.removeAttribute(h);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(h);return}l.setAttributeNS(u,h,x)}}function Zn(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Lu(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Vf(l,u,h){var x=Object.getOwnPropertyDescriptor(l.constructor.prototype,u);if(!l.hasOwnProperty(u)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var E=x.get,O=x.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return E.call(this)},set:function($){h=""+$,O.call(this,$)}}),Object.defineProperty(l,u,{enumerable:x.enumerable}),{getValue:function(){return h},setValue:function($){h=""+$},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Er(l){if(!l._valueTracker){var u=Lu(l)?"checked":"value";l._valueTracker=Vf(l,u,""+l[u])}}function Iu(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var h=u.getValue(),x="";return l&&(x=Lu(l)?l.checked?"true":"false":l.value),l=x,l!==h?(u.setValue(l),!0):!1}var tg=/[\n"\\]/g;function kn(l){return l.replace(tg,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function $s(l,u,h,x,E,O,$,K){l.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?l.type=$:l.removeAttribute("type"),u!=null?$==="number"?(u===0&&l.value===""||l.value!=u)&&(l.value=""+Zn(u)):l.value!==""+Zn(u)&&(l.value=""+Zn(u)):$!=="submit"&&$!=="reset"||l.removeAttribute("value"),u!=null?$==="number"&&l.value==u?Du(l,Zn(l.value)):Du(l,Zn(u)):h!=null?Du(l,Zn(h)):x!=null&&l.removeAttribute("value"),E==null&&O!=null&&(l.defaultChecked=!!O),E!=null&&(l.checked=E&&typeof E!="function"&&typeof E!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?l.name=""+Zn(K):l.removeAttribute("name")}function kl(l,u,h,x,E,O,$,K){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(l.type=O),u!=null||h!=null){if(!(O!=="submit"&&O!=="reset"||u!=null)){Er(l);return}h=h!=null?""+Zn(h):"",u=u!=null?""+Zn(u):h,K||u===l.value||(l.value=u),l.defaultValue=u}x=x??E,x=typeof x!="function"&&typeof x!="symbol"&&!!x,l.checked=K?l.checked:!!x,l.defaultChecked=!!x,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(l.name=$),Er(l)}function Du(l,u){l.defaultValue!==""+u&&(l.defaultValue=""+u)}function pi(l,u,h,x){if(l=l.options,u){u={};for(var E=0;E<h.length;E++)u["$"+h[E]]=!0;for(h=0;h<l.length;h++)E=u.hasOwnProperty("$"+l[h].value),l[h].selected!==E&&(l[h].selected=E),E&&x&&(l[h].defaultSelected=!0)}else{for(h=""+Zn(h),u=null,E=0;E<l.length;E++){if(l[E].value===h){l[E].selected=!0,x&&(l[E].defaultSelected=!0);return}u!==null||l[E].disabled||(u=l[E])}u!==null&&(u.selected=!0)}}function ju(l,u,h){if(u!=null&&(u=""+Zn(u),u!==l.value&&(l.value=u),h==null)){l.defaultValue!==u&&(l.defaultValue=u);return}l.defaultValue=h!=null?""+Zn(h):""}function ki(l,u,h,x){if(u==null){if(x!=null){if(h!=null)throw Error(s(92));if(ae(x)){if(1<x.length)throw Error(s(93));x=x[0]}h=x}h==null&&(h=""),u=h}h=Zn(u),l.defaultValue=h,x=l.textContent,x===h&&x!==""&&x!==null&&(l.value=x),Er(l)}function Xs(l,u){if(u){var h=l.firstChild;if(h&&h===l.lastChild&&h.nodeType===3){h.nodeValue=u;return}}l.textContent=u}var Al=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qf(l,u,h){var x=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?x?l.setProperty(u,""):u==="float"?l.cssFloat="":l[u]="":x?l.setProperty(u,h):typeof h!="number"||h===0||Al.has(u)?u==="float"?l.cssFloat=h:l[u]=(""+h).trim():l[u]=h+"px"}function Ai(l,u,h){if(u!=null&&typeof u!="object")throw Error(s(62));if(l=l.style,h!=null){for(var x in h)!h.hasOwnProperty(x)||u!=null&&u.hasOwnProperty(x)||(x.indexOf("--")===0?l.setProperty(x,""):x==="float"?l.cssFloat="":l[x]="",dt=!0);for(var E in u)x=u[E],u.hasOwnProperty(E)&&h[E]!==x&&(qf(l,E,x),dt=!0)}else for(var O in u)u.hasOwnProperty(O)&&qf(l,O,u[O])}function ic(l){if(l.indexOf("-")===-1)return!1;switch(l){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 Wf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Gf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Cs(l){return Gf.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Qs(){}var oc=null;function rc(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Kt=null,ps=null;function Ki(l){var u=wr(l);if(u&&(l=u.stateNode)){var h=l[as]||null;e:switch(l=u.stateNode,u.type){case"input":if($s(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=l;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+kn(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var x=h[u];if(x!==l&&x.form===l.form){var E=x[as]||null;if(!E)throw Error(s(90));$s(x,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<h.length;u++)x=h[u],x.form===l.form&&Iu(x)}break e;case"textarea":ju(l,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&pi(l,!!h.multiple,u,!1)}}}var _i=!1;function lc(l,u,h){if(_i)return l(u,h);_i=!0;try{var x=l(u);return x}finally{if(_i=!1,(Kt!==null||ps!==null)&&(t0(),Kt&&(u=Kt,l=ps,ps=Kt=null,Ki(u),l)))for(u=0;u<l.length;u++)Ki(l[u])}}function Cr(l,u){var h=l.stateNode;if(h===null)return null;var x=h[as]||null;if(x===null)return null;h=x[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(l=l.type,x=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!x;break e;default:l=!1}if(l)return null;if(h&&typeof h!="function")throw Error(s(231,u,typeof h));return h}var Ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ac=!1;if(Ns)try{var Kf={};Object.defineProperty(Kf,"passive",{get:function(){ac=!0}}),window.addEventListener("test",Kf,Kf),window.removeEventListener("test",Kf,Kf)}catch{ac=!1}var _l=null,ex=null,ng=null;function JN(){if(ng)return ng;var l,u=ex,h=u.length,x,E="value"in _l?_l.value:_l.textContent,O=E.length;for(l=0;l<h&&u[l]===E[l];l++);var $=h-l;for(x=1;x<=$&&u[h-x]===E[O-x];x++);return ng=E.slice(l,1<x?1-x:void 0)}function sg(l){var u=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&u===13&&(l=13)):l=u,l===10&&(l=13),32<=l||l===13?l:0}function ig(){return!0}function e4(){return!1}function Zs(l){function u(h,x,E,O,$){this._reactName=h,this._targetInst=E,this.type=x,this.nativeEvent=O,this.target=$,this.currentTarget=null;for(var K in l)l.hasOwnProperty(K)&&(h=l[K],this[K]=h?h(O):O[K]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?ig:e4,this.isPropagationStopped=e4,this}return k(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=ig)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=ig)},persist:function(){},isPersistent:ig}),u}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},og=Zs(Ml),Yf=k({},Ml,{view:0,detail:0}),SH=Zs(Yf),tx,nx,Xf,rg=k({},Yf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ix,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Xf&&(Xf&&l.type==="mousemove"?(tx=l.screenX-Xf.screenX,nx=l.screenY-Xf.screenY):nx=tx=0,Xf=l),tx)},movementY:function(l){return"movementY"in l?l.movementY:nx}}),t4=Zs(rg),wH=k({},rg,{dataTransfer:0}),EH=Zs(wH),CH=k({},Yf,{relatedTarget:0}),sx=Zs(CH),NH=k({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),TH=Zs(NH),OH=k({},Ml,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),RH=Zs(OH),kH=k({},Ml,{data:0}),n4=Zs(kH),AH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_H={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"},MH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LH(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=MH[l])?!!u[l]:!1}function ix(){return LH}var IH=k({},Yf,{key:function(l){if(l.key){var u=AH[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=sg(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?_H[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ix,charCode:function(l){return l.type==="keypress"?sg(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?sg(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),DH=Zs(IH),jH=k({},rg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s4=Zs(jH),PH=k({},Ml,{submitter:0}),zH=Zs(PH),BH=k({},Yf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ix}),$H=Zs(BH),FH=k({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),HH=Zs(FH),UH=k({},rg,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),VH=Zs(UH),qH=k({},Ml,{newState:0,oldState:0,source:0}),WH=Zs(qH),GH=[9,13,27,32],ox=Ns&&"CompositionEvent"in window,Qf=null;Ns&&"documentMode"in document&&(Qf=document.documentMode);var KH=Ns&&"TextEvent"in window&&!Qf,i4=Ns&&(!ox||Qf&&8<Qf&&11>=Qf),o4=" ",r4=!1;function l4(l,u){switch(l){case"keyup":return GH.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a4(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Pu=!1;function YH(l,u){switch(l){case"compositionend":return a4(u);case"keypress":return u.which!==32?null:(r4=!0,o4);case"textInput":return l=u.data,l===o4&&r4?null:l;default:return null}}function XH(l,u){if(Pu)return l==="compositionend"||!ox&&l4(l,u)?(l=JN(),ng=ex=_l=null,Pu=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return i4&&u.locale!=="ko"?null:u.data;default:return null}}var QH={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 c4(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!QH[l.type]:u==="textarea"}function u4(l,u,h,x){Kt?ps?ps.push(x):ps=[x]:Kt=x,u=l0(u,"onChange"),0<u.length&&(h=new og("onChange","change",null,h,x),l.push({event:h,listeners:u}))}var Zf=null,Jf=null;function ZH(l){QO(l,0)}function lg(l){var u=me(l);if(Iu(u))return l}function d4(l,u){if(l==="change")return u}var f4=!1;if(Ns){var rx;if(Ns){var lx="oninput"in document;if(!lx){var h4=document.createElement("div");h4.setAttribute("oninput","return;"),lx=typeof h4.oninput=="function"}rx=lx}else rx=!1;f4=rx&&(!document.documentMode||9<document.documentMode)}function p4(){Zf&&(Zf.detachEvent("onpropertychange",m4),Jf=Zf=null)}function m4(l){if(l.propertyName==="value"&&lg(Jf)){var u=[];u4(u,Jf,l,rc(l)),lc(ZH,u)}}function JH(l,u,h){l==="focusin"?(p4(),Zf=u,Jf=h,Zf.attachEvent("onpropertychange",m4)):l==="focusout"&&p4()}function eU(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return lg(Jf)}function tU(l,u){if(l==="click")return lg(u)}function nU(l,u){if(l==="input"||l==="change")return lg(u)}function sU(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Mi=typeof Object.is=="function"?Object.is:sU;function eh(l,u){if(Mi(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var h=Object.keys(l),x=Object.keys(u);if(h.length!==x.length)return!1;for(x=0;x<h.length;x++){var E=h[x];if(!qe.call(u,E)||!Mi(l[E],u[E]))return!1}return!0}function ax(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function g4(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function y4(l,u){var h=g4(l);l=0;for(var x;h;){if(h.nodeType===3){if(x=l+h.textContent.length,l<=u&&x>=u)return{node:h,offset:u-l};l=x}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=g4(h)}}function b4(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?b4(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function x4(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var u=ax(l.document);u instanceof l.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)l=u.contentWindow;else break;u=ax(l.document)}return u}function cx(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}var iU=Ns&&"documentMode"in document&&11>=document.documentMode,zu=null,ux=null,th=null,dx=!1;function v4(l,u,h){var x=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;dx||zu==null||zu!==ax(x)||(x=zu,"selectionStart"in x&&cx(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),th&&eh(th,x)||(th=x,x=l0(ux,"onSelect"),0<x.length&&(u=new og("onSelect","select",null,u,h),l.push({event:u,listeners:x}),u.target=zu)))}function cc(l,u){var h={};return h[l.toLowerCase()]=u.toLowerCase(),h["Webkit"+l]="webkit"+u,h["Moz"+l]="moz"+u,h}var Bu={animationend:cc("Animation","AnimationEnd"),animationiteration:cc("Animation","AnimationIteration"),animationstart:cc("Animation","AnimationStart"),transitionrun:cc("Transition","TransitionRun"),transitionstart:cc("Transition","TransitionStart"),transitioncancel:cc("Transition","TransitionCancel"),transitionend:cc("Transition","TransitionEnd")},fx={},S4={};Ns&&(S4=document.createElement("div").style,"AnimationEvent"in window||(delete Bu.animationend.animation,delete Bu.animationiteration.animation,delete Bu.animationstart.animation),"TransitionEvent"in window||delete Bu.transitionend.transition);function uc(l){if(fx[l])return fx[l];if(!Bu[l])return l;var u=Bu[l],h;for(h in u)if(u.hasOwnProperty(h)&&h in S4)return fx[l]=u[h];return l}var w4=uc("animationend"),E4=uc("animationiteration"),C4=uc("animationstart"),oU=uc("transitionrun"),rU=uc("transitionstart"),lU=uc("transitioncancel"),N4=uc("transitionend"),T4=new Map,hx="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");hx.push("scrollEnd");function go(l,u){T4.set(l,u),wt(u,[l])}var aU=0;function Nr(l,u){if(l.name!=null&&l.name!=="auto")return l.name;if(u.autoName!==null)return u.autoName;l=vo.identifierPrefix;var h=aU++;return l="_"+l+"t_"+h.toString(32)+"_",u.autoName=l}function O4(l){if(l==null||typeof l=="string")return l;var u=null,h=od;if(h!==null)for(var x=0;x<h.length;x++){var E=l[h[x]];if(E!=null){if(E==="none")return"none";u=u==null?E:u+(" "+E)}}return u??l.default}function Tr(l,u){return l=O4(l),u=O4(u),u==null?l==="auto"?null:l:u==="auto"?null:u}var ag=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Yi=[],$u=0,px=0;function cg(){for(var l=$u,u=px=$u=0;u<l;){var h=Yi[u];Yi[u++]=null;var x=Yi[u];Yi[u++]=null;var E=Yi[u];Yi[u++]=null;var O=Yi[u];if(Yi[u++]=null,x!==null&&E!==null){var $=x.pending;$===null?E.next=E:(E.next=$.next,$.next=E),x.pending=E}O!==0&&R4(h,E,O)}}function ug(l,u,h,x){Yi[$u++]=l,Yi[$u++]=u,Yi[$u++]=h,Yi[$u++]=x,px|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function mx(l,u,h,x){return ug(l,u,h,x),dg(l)}function dc(l,u){return ug(l,null,null,u),dg(l)}function R4(l,u,h){l.lanes|=h;var x=l.alternate;x!==null&&(x.lanes|=h);for(var E=!1,O=l.return;O!==null;)O.childLanes|=h,x=O.alternate,x!==null&&(x.childLanes|=h),O.tag===22&&(l=O.stateNode,l===null||l._visibility&1||(E=!0)),l=O,O=O.return;return l.tag===3?(O=l.stateNode,E&&u!==null&&(E=31-Zt(h),l=O.hiddenUpdates,x=l[E],x===null?l[E]=[u]:x.push(u),u.lane=h|536870912),O):null}function dg(l){if(50<Eh)throw Eh=0,e0=null,Error(s(185));for(var u=l.return;u!==null;)l=u,u=l.return;return l.tag===3?l.stateNode:null}var Fu={};function cU(l,u,h,x){this.tag=l,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(l,u,h,x){return new cU(l,u,h,x)}function gx(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Or(l,u){var h=l.alternate;return h===null?(h=mi(l.tag,u,l.key,l.mode),h.elementType=l.elementType,h.type=l.type,h.stateNode=l.stateNode,h.alternate=l,l.alternate=h):(h.pendingProps=u,h.type=l.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=l.flags&1206910976,h.childLanes=l.childLanes,h.lanes=l.lanes,h.child=l.child,h.memoizedProps=l.memoizedProps,h.memoizedState=l.memoizedState,h.updateQueue=l.updateQueue,u=l.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=l.sibling,h.index=l.index,h.ref=l.ref,h.refCleanup=l.refCleanup,h}function k4(l,u){l.flags&=1206910978;var h=l.alternate;return h===null?(l.childLanes=0,l.lanes=u,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=h.childLanes,l.lanes=h.lanes,l.child=h.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=h.memoizedProps,l.memoizedState=h.memoizedState,l.updateQueue=h.updateQueue,l.type=h.type,u=h.dependencies,l.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),l}function fg(l,u,h,x,E,O){var $=0;if(x=l,typeof x=="function")gx(x)&&($=1);else if(typeof x=="string")$=PV(l,h,be.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(x){case G:return l=mi(31,h,u,E),l.elementType=G,l.lanes=O,l;case D:return fc(h.children,E,O,u);case P:$=8,E|=24;break;case B:return l=mi(12,h,u,E|2),l.elementType=B,l.lanes=O,l;case U:return l=mi(13,h,u,E),l.elementType=U,l.lanes=O,l;case H:return l=mi(19,h,u,E),l.elementType=H,l.lanes=O,l;case Y:case q:return l=E|32,l=mi(30,h,u,l),l.elementType=q,l.lanes=O,l.stateNode={autoName:null,paired:null,clones:null,ref:null},l;default:if(typeof x=="object"&&x!==null)switch(x.$$typeof){case F:$=10;break e;case I:$=9;break e;case z:$=11;break e;case V:$=14;break e;case W:$=16,x=null;break e}$=29,h=Error(s(130,l===null?"null":typeof l,"")),x=null}return u=mi($,h,u,E),u.elementType=l,u.type=x,u.lanes=O,u}function fc(l,u,h,x){return l=mi(7,l,x,u),l.lanes=h,l}function yx(l,u,h){return l=mi(6,l,null,u),l.lanes=h,l}function A4(l){var u=mi(18,null,null,0);return u.stateNode=l,u}function bx(l,u,h){return u=mi(4,l.children!==null?l.children:[],l.key,u),u.lanes=h,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}var _4=new WeakMap;function Xi(l,u){if(typeof l=="object"&&l!==null){var h=_4.get(l);return h!==void 0?h:(u={value:l,source:u,stack:Te(u)},_4.set(l,u),u)}return{value:l,source:u,stack:Te(u)}}var Hu=[],Uu=0,hg=null,nh=0,Qi=[],Zi=0,Ll=null,$o=1,Fo="";function Rr(l,u){Hu[Uu++]=nh,Hu[Uu++]=hg,hg=l,nh=u}function M4(l,u,h){Qi[Zi++]=$o,Qi[Zi++]=Fo,Qi[Zi++]=Ll,Ll=l;var x=$o;l=Fo;var E=32-Zt(x)-1;x&=~(1<<E),h+=1;var O=32-Zt(u)+E;if(30<O){var $=E-E%5;O=(x&(1<<$)-1).toString(32),x>>=$,E-=$,$o=1<<32-Zt(u)+E|h<<E|x,Fo=O+l}else $o=1<<O|h<<E|x,Fo=l}function pg(l){l.return!==null&&(Rr(l,1),M4(l,1,0))}function xx(l){for(;l===hg;)hg=Hu[--Uu],Hu[Uu]=null,nh=Hu[--Uu],Hu[Uu]=null;for(;l===Ll;)Ll=Qi[--Zi],Qi[Zi]=null,Fo=Qi[--Zi],Qi[Zi]=null,$o=Qi[--Zi],Qi[Zi]=null}function L4(l,u){Qi[Zi++]=$o,Qi[Zi++]=Fo,Qi[Zi++]=Ll,$o=u.id,Fo=u.overflow,Ll=l}var ms=null,Tn=null,Dt=!1,Il=null,Ji=!1,vx=Error(s(519));function Dl(l){var u=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sh(Xi(u,l)),vx}function I4(l){var u=l.stateNode,h=l.type,x=l.memoizedProps;switch(u[Rn]=l,u[as]=x,h){case"dialog":Bt("cancel",u),Bt("close",u);break;case"iframe":case"object":case"embed":Bt("load",u);break;case"video":case"audio":for(h=0;h<Nh.length;h++)Bt(Nh[h],u);break;case"source":Bt("error",u);break;case"img":case"image":case"link":Bt("error",u),Bt("load",u);break;case"details":Bt("toggle",u);break;case"input":Bt("invalid",u),kl(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":Bt("invalid",u);break;case"textarea":Bt("invalid",u),ki(u,x.value,x.defaultValue,x.children)}h=x.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||x.suppressHydrationWarning===!0||tR(u.textContent,h)?(x.popover!=null&&(Bt("beforetoggle",u),Bt("toggle",u)),x.onScroll!=null&&Bt("scroll",u),x.onScrollEnd!=null&&Bt("scrollend",u),x.onClick!=null&&(u.onclick=Qs),u=!0):u=!1,u||Dl(l,!0)}function mg(l){for(ms=l.return;ms;)switch(ms.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:ms=ms.return}}function Vu(l){if(l!==ms)return!1;if(!Dt)return mg(l),Dt=!0,!1;var u=l.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=l.type,h=!(h!=="form"&&h!=="button")||X2(l.type,l.memoizedProps)),h=!h),h&&Tn&&Dl(l),mg(l),u===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(317));Tn=vR(l)}else if(u===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(317));Tn=vR(l)}else u===27?(u=Tn,Ql(l.type)?(l=ov,ov=null,Tn=l):Tn=u):Tn=ms?to(l.stateNode.nextSibling):null;return!0}function hc(){Tn=ms=null,Dt=!1}function Sx(){var l=Il;return l!==null&&(bi===null?bi=l:bi.push.apply(bi,l),Il=null),l}function sh(l){Il===null?Il=[l]:Il.push(l)}var wx=Ce(null),pc=null,kr=null;function jl(l,u,h){Oe(wx,u._currentValue),u._currentValue=h}function Ar(l){l._currentValue=wx.current,ye(wx)}function gg(l,u,h){for(;l!==null;){var x=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),l===h)break;l=l.return}}function Ex(l,u,h,x){var E=l.child;for(E!==null&&(E.return=l);E!==null;){var O=E.dependencies;if(O!==null){var $=E.child;O=O.firstContext;e:for(;O!==null;){var K=O;O=E;for(var ie=0;ie<u.length;ie++)if(K.context===u[ie]){O.lanes|=h,K=O.alternate,K!==null&&(K.lanes|=h),gg(O.return,h,l),x||($=null);break e}O=K.next}}else if(E.tag===18){if($=E.return,$===null)throw Error(s(341));$.lanes|=h,O=$.alternate,O!==null&&(O.lanes|=h),gg($,h,l),$=null}else E.tag===13&&E.memoizedState!==null&&E.memoizedState.dehydrated===null?(E.lanes|=h,$=E.alternate,$!==null&&($.lanes|=h),gg(E.return,h,l),$=E.child,$=$!==null?$.sibling:null):$=E.child;if($!==null)$.return=E;else for($=E;$!==null;){if($===l){$=null;break}if(E=$.sibling,E!==null){E.return=$.return,$=E;break}$=$.return}E=$}}function mc(l,u,h,x){l=null;for(var E=u,O=!1;E!==null;){if(!O){if((E.flags&524288)!==0)O=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var $=E.alternate;if($===null)throw Error(s(387));if($=$.memoizedProps,$!==null){var K=E.type;Mi(E.pendingProps.value,$.value)||(l!==null?l.push(K):l=[K])}}else if(E===Be.current){if($=E.alternate,$===null)throw Error(s(387));$.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(l!==null?l.push(md):l=[md])}E=E.return}return l!==null&&Ex(u,l,h,x),u.flags|=262144,l!==null}function yg(l){for(l=l.firstContext;l!==null;){if(!Mi(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function gc(l){pc=l,kr=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Ts(l){return D4(pc,l)}function bg(l,u){return pc===null&&gc(l),D4(l,u)}function D4(l,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},kr===null){if(l===null)throw Error(s(308));kr=u,l.dependencies={lanes:0,firstContext:u},l.flags|=524288}else kr=kr.next=u;return h}var uU=typeof AbortController<"u"?AbortController:function(){var l=[],u=this.signal={aborted:!1,addEventListener:function(h,x){l.push(x)}};this.abort=function(){u.aborted=!0,l.forEach(function(h){return h()})}},dU=t.unstable_scheduleCallback,fU=t.unstable_NormalPriority,Jn={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cx(){return{controller:new uU,data:new Map,refCount:0}}function ih(l){l.refCount--,l.refCount===0&&dU(fU,function(){l.controller.abort()})}function j4(l,u){if((l.pendingLanes&4194048)!==0){var h=l.transitionTypes;for(h===null&&(h=l.transitionTypes=[]),l=0;l<u.length;l++){var x=u[l];h.indexOf(x)===-1&&h.push(x)}}}var oh=null;function hU(l){var u=l.transitionTypes;return l.transitionTypes=null,u}var rh=null,Nx=0,yc=0,qu=null;function pU(l,u){if(rh===null){var h=rh=[];Nx=0,yc=F2(),qu={status:"pending",value:void 0,then:function(x){h.push(x)}}}return Nx++,u.then(P4,P4),u}function P4(){if(--Nx===0&&(oh=null,rh!==null)){qu!==null&&(qu.status="fulfilled");var l=rh;rh=null,yc=0,qu=null;for(var u=0;u<l.length;u++)(0,l[u])()}}function mU(l,u){var h=[],x={status:"pending",value:null,reason:null,then:function(E){h.push(E)}};return l.then(function(){x.status="fulfilled",x.value=u;for(var E=0;E<h.length;E++)(0,h[E])(u)},function(E){for(x.status="rejected",x.reason=E,E=0;E<h.length;E++)(0,h[E])(void 0)}),x}var z4=le.S;le.S=function(l,u){if(AO=Mt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&pU(l,u),oh!==null)for(var h=cd;h!==null;)j4(h,oh),h=h.next;if(h=l.types,h!==null){for(var x=cd;x!==null;)j4(x,h),x=x.next;if(yc!==0){x=oh,x===null&&(x=oh=[]);for(var E=0;E<h.length;E++){var O=h[E];x.indexOf(O)===-1&&x.push(O)}}}z4!==null&&z4(l,u)};var bc=Ce(null);function Tx(){var l=bc.current;return l!==null?l:Sn.pooledCache}function xg(l,u){u===null?Oe(bc,bc.current):Oe(bc,u.pool)}function B4(){var l=Tx();return l===null?null:{parent:Jn._currentValue,pool:l}}var Wu=Error(s(460)),Ox=Error(s(474)),vg=Error(s(542)),Sg={then:function(){}};function $4(l){return l=l.status,l==="fulfilled"||l==="rejected"}function F4(l,u,h){switch(h=l[h],h===void 0?l.push(u):h!==u&&(u.then(Qs,Qs),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,U4(l),l===void 0&&!("reason"in u)?Error(s(600)):l;default:if(typeof u.status=="string")u.then(Qs,Qs);else{if(l=Sn,l!==null&&100<l.shellSuspendCounter)throw Error(s(482));l=u,l.status="pending",l.then(function(x){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=x}},function(x){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,U4(l),l}throw vc=u,Wu}}function xc(l){try{var u=l._init;return u(l._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(vc=h,Wu):h}}var vc=null;function H4(){if(vc===null)throw Error(s(459));var l=vc;return vc=null,l}function U4(l){if(l===Wu||l===vg)throw Error(s(483))}var Gu=null,lh=0;function wg(l){var u=lh;return lh+=1,Gu===null&&(Gu=[]),F4(Gu,l,u)}function Pl(l,u){u=u.props.ref,l.ref=u!==void 0?u:null}function Eg(l,u){throw u.$$typeof===M?Error(s(525)):(l=Object.prototype.toString.call(u),Error(s(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l)))}function V4(l){function u(ue,re){if(l){var he=ue.deletions;he===null?(ue.deletions=[re],ue.flags|=16):he.push(re)}}function h(ue,re){if(!l)return null;for(;re!==null;)u(ue,re),re=re.sibling;return null}function x(ue){for(var re=new Map;ue!==null;)ue.key===null?re.set(ue.index,ue):re.set(ue.key,ue),ue=ue.sibling;return re}function E(ue,re){return ue=Or(ue,re),ue.index=0,ue.sibling=null,ue}function O(ue,re,he){return ue.index=he,l?(he=ue.alternate,he!==null?(he=he.index,he<re?(ue.flags|=2,re):he):(ue.flags|=134217730,re)):(ue.flags|=1048576,re)}function $(ue){return l&&ue.alternate===null&&(ue.flags|=134217730),ue}function K(ue,re,he,Re){return re===null||re.tag!==6?(re=yx(he,ue.mode,Re),re.return=ue,re):(re=E(re,he),re.return=ue,re)}function ie(ue,re,he,Re){var Ge=he.type;return Ge===D?(ue=ge(ue,re,he.props.children,Re,he.key),Pl(ue,he),ue):re!==null&&(re.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===W&&xc(Ge)===re.type)?(re=E(re,he.props),Pl(re,he),re.return=ue,re):(re=fg(he.type,he.key,he.props,null,ue.mode,Re),Pl(re,he),re.return=ue,re)}function de(ue,re,he,Re){return re===null||re.tag!==4||re.stateNode.containerInfo!==he.containerInfo||re.stateNode.implementation!==he.implementation?(re=bx(he,ue.mode,Re),re.return=ue,re):(re=E(re,he.children||[]),re.return=ue,re)}function ge(ue,re,he,Re,Ge){return re===null||re.tag!==7?(re=fc(he,ue.mode,Re,Ge),re.return=ue,re):(re=E(re,he),re.return=ue,re)}function ke(ue,re,he){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=yx(""+re,ue.mode,he),re.return=ue,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case L:return he=fg(re.type,re.key,re.props,null,ue.mode,he),Pl(he,re),he.return=ue,he;case j:return re=bx(re,ue.mode,he),re.return=ue,re;case W:return re=xc(re),ke(ue,re,he)}if(ae(re)||te(re))return re=fc(re,ue.mode,he,null),re.return=ue,re;if(typeof re.then=="function")return ke(ue,wg(re),he);if(re.$$typeof===F)return ke(ue,bg(ue,re),he);Eg(ue,re)}return null}function ce(ue,re,he,Re){var Ge=re!==null?re.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Ge!==null?null:K(ue,re,""+he,Re);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case L:return he.key===Ge?ie(ue,re,he,Re):null;case j:return he.key===Ge?de(ue,re,he,Re):null;case W:return he=xc(he),ce(ue,re,he,Re)}if(ae(he)||te(he))return Ge!==null?null:ge(ue,re,he,Re,null);if(typeof he.then=="function")return ce(ue,re,wg(he),Re);if(he.$$typeof===F)return ce(ue,re,bg(ue,he),Re);Eg(ue,he)}return null}function pe(ue,re,he,Re,Ge){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return ue=ue.get(he)||null,K(re,ue,""+Re,Ge);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case L:return ue=ue.get(Re.key===null?he:Re.key)||null,ie(re,ue,Re,Ge);case j:return ue=ue.get(Re.key===null?he:Re.key)||null,de(re,ue,Re,Ge);case W:return Re=xc(Re),pe(ue,re,he,Re,Ge)}if(ae(Re)||te(Re))return ue=ue.get(he)||null,ge(re,ue,Re,Ge,null);if(typeof Re.then=="function")return pe(ue,re,he,wg(Re),Ge);if(Re.$$typeof===F)return pe(ue,re,he,bg(re,Re),Ge);Eg(re,Re)}return null}function Fe(ue,re,he,Re){for(var Ge=null,Ht=null,nt=re,ht=re=0,ns=null;nt!==null&&ht<he.length;ht++){nt.index>ht?(ns=nt,nt=null):ns=nt.sibling;var Yt=ce(ue,nt,he[ht],Re);if(Yt===null){nt===null&&(nt=ns);break}l&&nt&&Yt.alternate===null&&u(ue,nt),re=O(Yt,re,ht),Ht===null?Ge=Yt:Ht.sibling=Yt,Ht=Yt,nt=ns}if(ht===he.length)return h(ue,nt),Dt&&Rr(ue,ht),Ge;if(nt===null){for(;ht<he.length;ht++)nt=ke(ue,he[ht],Re),nt!==null&&(re=O(nt,re,ht),Ht===null?Ge=nt:Ht.sibling=nt,Ht=nt);return Dt&&Rr(ue,ht),Ge}for(nt=x(nt);ht<he.length;ht++)ns=pe(nt,ue,ht,he[ht],Re),ns!==null&&(l&&(Yt=ns.alternate,Yt!==null&&nt.delete(Yt.key===null?ht:Yt.key)),re=O(ns,re,ht),Ht===null?Ge=ns:Ht.sibling=ns,Ht=ns);return l&&nt.forEach(function(na){return u(ue,na)}),Dt&&Rr(ue,ht),Ge}function Qe(ue,re,he,Re){if(he==null)throw Error(s(151));for(var Ge=null,Ht=null,nt=re,ht=re=0,ns=null,Yt=he.next();nt!==null&&!Yt.done;ht++,Yt=he.next()){nt.index>ht?(ns=nt,nt=null):ns=nt.sibling;var na=ce(ue,nt,Yt.value,Re);if(na===null){nt===null&&(nt=ns);break}l&&nt&&na.alternate===null&&u(ue,nt),re=O(na,re,ht),Ht===null?Ge=na:Ht.sibling=na,Ht=na,nt=ns}if(Yt.done)return h(ue,nt),Dt&&Rr(ue,ht),Ge;if(nt===null){for(;!Yt.done;ht++,Yt=he.next())Yt=ke(ue,Yt.value,Re),Yt!==null&&(re=O(Yt,re,ht),Ht===null?Ge=Yt:Ht.sibling=Yt,Ht=Yt);return Dt&&Rr(ue,ht),Ge}for(nt=x(nt);!Yt.done;ht++,Yt=he.next())Yt=pe(nt,ue,ht,Yt.value,Re),Yt!==null&&(l&&(ns=Yt.alternate,ns!==null&&nt.delete(ns.key===null?ht:ns.key)),re=O(Yt,re,ht),Ht===null?Ge=Yt:Ht.sibling=Yt,Ht=Yt);return l&&nt.forEach(function(YV){return u(ue,YV)}),Dt&&Rr(ue,ht),Ge}function Rt(ue,re,he,Re){if(typeof he=="object"&&he!==null&&he.type===D&&he.key===null&&he.props.ref===void 0&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case L:e:{for(var Ge=he.key;re!==null;){if(re.key===Ge){if(Ge=he.type,Ge===D){if(re.tag===7){h(ue,re.sibling),Re=E(re,he.props.children),Pl(Re,he),Re.return=ue,ue=Re;break e}}else if(re.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===W&&xc(Ge)===re.type){h(ue,re.sibling),Re=E(re,he.props),Pl(Re,he),Re.return=ue,ue=Re;break e}h(ue,re);break}else u(ue,re);re=re.sibling}he.type===D?(Re=fc(he.props.children,ue.mode,Re,he.key),Pl(Re,he),Re.return=ue,ue=Re):(Re=fg(he.type,he.key,he.props,null,ue.mode,Re),Pl(Re,he),Re.return=ue,ue=Re)}return $(ue);case j:e:{for(Ge=he.key;re!==null;){if(re.key===Ge)if(re.tag===4&&re.stateNode.containerInfo===he.containerInfo&&re.stateNode.implementation===he.implementation){h(ue,re.sibling),Re=E(re,he.children||[]),Re.return=ue,ue=Re;break e}else{h(ue,re);break}else u(ue,re);re=re.sibling}Re=bx(he,ue.mode,Re),Re.return=ue,ue=Re}return $(ue);case W:return he=xc(he),Rt(ue,re,he,Re)}if(ae(he))return Fe(ue,re,he,Re);if(te(he)){if(Ge=te(he),typeof Ge!="function")throw Error(s(150));return he=Ge.call(he),Qe(ue,re,he,Re)}if(typeof he.then=="function")return Rt(ue,re,wg(he),Re);if(he.$$typeof===F)return Rt(ue,re,bg(ue,he),Re);Eg(ue,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,re!==null&&re.tag===6?(h(ue,re.sibling),Re=E(re,he),Re.return=ue,ue=Re):(h(ue,re),Re=yx(he,ue.mode,Re),Re.return=ue,ue=Re),$(ue)):h(ue,re)}return function(ue,re,he,Re){try{lh=0;var Ge=Rt(ue,re,he,Re);return Gu=null,Ge}catch(nt){if(nt===Wu||nt===vg)throw nt;var Ht=mi(29,nt,null,ue.mode);return Ht.lanes=Re,Ht.return=ue,Ht}finally{}}}var Sc=V4(!0),q4=V4(!1),zl=!1;function Rx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kx(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Bl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function $l(l,u,h){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(sn&2)!==0){var E=x.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),x.pending=u,u=dg(l),R4(l,null,h),u}return ug(l,x,u,h),dg(l)}function ah(l,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var x=u.lanes;x&=l.pendingLanes,h|=x,u.lanes=h,Nl(l,h)}}function Ax(l,u){var h=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,h===x)){var E=null,O=null;if(h=h.firstBaseUpdate,h!==null){do{var $={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};O===null?E=O=$:O=O.next=$,h=h.next}while(h!==null);O===null?E=O=u:O=O.next=u}else E=O=u;h={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:O,shared:x.shared,callbacks:x.callbacks},l.updateQueue=h;return}l=h.lastBaseUpdate,l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=u}var _x=!1;function ch(){if(_x){var l=qu;if(l!==null)throw l}}function uh(l,u,h,x){_x=!1;var E=l.updateQueue;zl=!1;var O=E.firstBaseUpdate,$=E.lastBaseUpdate,K=E.shared.pending;if(K!==null){E.shared.pending=null;var ie=K,de=ie.next;ie.next=null,$===null?O=de:$.next=de,$=ie;var ge=l.alternate;ge!==null&&(ge=ge.updateQueue,K=ge.lastBaseUpdate,K!==$&&(K===null?ge.firstBaseUpdate=de:K.next=de,ge.lastBaseUpdate=ie))}if(O!==null){var ke=E.baseState;$=0,ge=de=ie=null,K=O;do{var ce=K.lane&-536870913,pe=ce!==K.lane;if(pe?(Ft&ce)===ce:(x&ce)===ce){ce!==0&&ce===yc&&(_x=!0),ge!==null&&(ge=ge.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var Fe=l,Qe=K;ce=u;var Rt=h;switch(Qe.tag){case 1:if(Fe=Qe.payload,typeof Fe=="function"){ke=Fe.call(Rt,ke,ce);break e}ke=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=Qe.payload,ce=typeof Fe=="function"?Fe.call(Rt,ke,ce):Fe,ce==null)break e;ke=k({},ke,ce);break e;case 2:zl=!0}}ce=K.callback,ce!==null&&(l.flags|=64,pe&&(l.flags|=8192),pe=E.callbacks,pe===null?E.callbacks=[ce]:pe.push(ce))}else pe={lane:ce,tag:K.tag,payload:K.payload,callback:K.callback,next:null},ge===null?(de=ge=pe,ie=ke):ge=ge.next=pe,$|=ce;if(K=K.next,K===null){if(K=E.shared.pending,K===null)break;pe=K,K=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);ge===null&&(ie=ke),E.baseState=ie,E.firstBaseUpdate=de,E.lastBaseUpdate=ge,O===null&&(E.shared.lanes=0),Gl|=$,l.lanes=$,l.memoizedState=ke}}function W4(l,u){if(typeof l!="function")throw Error(s(191,l));l.call(u)}function G4(l,u){var h=l.callbacks;if(h!==null)for(l.callbacks=null,l=0;l<h.length;l++)W4(h[l],u)}var Fl=Ce(null),Cg=Ce(0);function K4(l,u){l=Dr,Oe(Cg,l),Oe(Fl,u),Dr=l|u.baseLanes}function Mx(){Oe(Cg,Dr),Oe(Fl,Fl.current)}function Lx(){Dr=Cg.current,ye(Fl),ye(Cg)}var Os=Ce(null),Fs=null;function Hl(l){var u=l.alternate;Oe(Rs,Rs.current&1),Oe(Os,l),Fs===null&&(u===null||Fl.current!==null||u.memoizedState!==null)&&(Fs=l)}function Ix(l){Oe(Rs,Rs.current),Oe(Os,l),Fs===null&&(Fs=l)}function Y4(l){l.tag===22?(Oe(Rs,Rs.current),Oe(Os,l),Fs===null&&(Fs=l)):Ul()}function Ul(){Oe(Rs,Rs.current),Oe(Os,Os.current)}function Li(l){ye(Os),Fs===l&&(Fs=null),ye(Rs)}var Rs=Ce(0);function dh(l,u){Oe(Os,Os.current),Oe(Rs,u)}function Dx(l){ye(Rs),ye(Os),Fs===l&&(Fs=null)}function Ng(l){for(var u=l;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||sv(h)||iv(h)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!=="independent"){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var _r=0,Ot=null,xn=null,es=null,Tg=!1,Ku=!1,wc=!1,Og=0,fh=0,Yu=null,gU=0;function Vn(){throw Error(s(321))}function jx(l,u){if(u===null)return!1;for(var h=0;h<u.length&&h<l.length;h++)if(!Mi(l[h],u[h]))return!1;return!0}function Px(l,u,h,x,E,O){return _r=O,Ot=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,le.H=l===null||l.memoizedState===null?MT:LT,wc=!1,O=h(x,E),wc=!1,Ku&&(O=Q4(u,h,x,E)),X4(l),O}function X4(l){le.H=Ig;var u=xn!==null&&xn.next!==null;if(_r=0,es=xn=Ot=null,Tg=!1,fh=0,Yu=null,u)throw Error(s(300));l===null||ts||(l=l.dependencies,l!==null&&yg(l)&&(ts=!0))}function Q4(l,u,h,x){Ot=l;var E=0;do{if(Ku&&(Yu=null),fh=0,Ku=!1,25<=E)throw Error(s(301));if(E+=1,es=xn=null,l.updateQueue!=null){var O=l.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}le.H=CU,O=u(h,x)}while(Ku);return O}function yU(){var l=le.H,u=l.useState()[0];return u=typeof u.then=="function"?hh(u):u,l=l.useState()[0],(xn!==null?xn.memoizedState:null)!==l&&(Ot.flags|=1024),u}function zx(){var l=Og!==0;return Og=0,l}function Bx(l,u,h){u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~h}function $x(l){if(Tg){for(l=l.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}Tg=!1}_r=0,es=xn=Ot=null,Ku=!1,fh=Og=0,Yu=null}function Js(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return es===null?Ot.memoizedState=es=l:es=es.next=l,es}function Gn(){if(xn===null){var l=Ot.alternate;l=l!==null?l.memoizedState:null}else l=xn.next;var u=es===null?Ot.memoizedState:es.next;if(u!==null)es=u,xn=l;else{if(l===null)throw Ot.alternate===null?Error(s(467)):Error(s(310));xn=l,l={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},es===null?Ot.memoizedState=es=l:es=es.next=l}return es}function Rg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hh(l){var u=fh;return fh+=1,Yu===null&&(Yu=[]),l=F4(Yu,l,u),u=Ot,(es===null?u.memoizedState:es.next)===null&&(u=u.alternate,le.H=u===null||u.memoizedState===null?MT:LT),l}function kg(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return hh(l);if(l.$$typeof===X)return;if(l.$$typeof===F)return Ts(l)}throw Error(s(438,String(l)))}function Fx(l){var u=null,h=Ot.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var x=Ot.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Rg(),Ot.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(l),x=0;x<l;x++)h[x]=J;return u.index++,h}function Mr(l,u){return typeof u=="function"?u(l):u}function Ag(l){var u=Gn();return Hx(u,xn,l)}function Hx(l,u,h){var x=l.queue;if(x===null)throw Error(s(311));x.lastRenderedReducer=h;var E=l.baseQueue,O=x.pending;if(O!==null){if(E!==null){var $=E.next;E.next=O.next,O.next=$}u.baseQueue=E=O,x.pending=null}if(O=l.baseState,E===null)l.memoizedState=O;else{u=E.next;var K=$=null,ie=null,de=u,ge=!1;do{var ke=de.lane&-536870913;if(ke!==de.lane?(Ft&ke)===ke:(_r&ke)===ke){var ce=de.revertLane;if(ce===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),ke===yc&&(ge=!0);else if((_r&ce)===ce){de=de.next,ce===yc&&(ge=!0);continue}else ke={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ie===null?(K=ie=ke,$=O):ie=ie.next=ke,Ot.lanes|=ce,Gl|=ce;ke=de.action,wc&&h(O,ke),O=de.hasEagerState?de.eagerState:h(O,ke)}else ce={lane:ke,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ie===null?(K=ie=ce,$=O):ie=ie.next=ce,Ot.lanes|=ke,Gl|=ke;de=de.next}while(de!==null&&de!==u);if(ie===null?$=O:ie.next=K,!Mi(O,l.memoizedState)&&(ts=!0,ge&&(h=qu,h!==null)))throw h;l.memoizedState=O,l.baseState=$,l.baseQueue=ie,x.lastRenderedState=O}return E===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function Ux(l){var u=Gn(),h=u.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=l;var x=h.dispatch,E=h.pending,O=u.memoizedState;if(E!==null){h.pending=null;var $=E=E.next;do O=l(O,$.action),$=$.next;while($!==E);Mi(O,u.memoizedState)||(ts=!0),u.memoizedState=O,u.baseQueue===null&&(u.baseState=O),h.lastRenderedState=O}return[O,x]}function Z4(l,u,h){var x=Ot,E=Gn(),O=Dt;if(O){if(h===void 0)throw Error(s(407));h=h()}else h=u();var $=!Mi((xn||E).memoizedState,h);if($&&(E.memoizedState=h,ts=!0),E=E.queue,Wx(tT.bind(null,x,E,l),[l]),l=E.getSnapshot!==u||$||es!==null&&(es.memoizedState.tag&1)!==0,Xu(l?9:8,{destroy:void 0},eT.bind(null,x,E,h,u),null),l){if(x.flags|=2048,Sn===null)throw Error(s(349));O||(_r&127)!==0||J4(x,u,h)}return h}function J4(l,u,h){l.flags|=16384,l={getSnapshot:u,value:h},u=Ot.updateQueue,u===null?(u=Rg(),Ot.updateQueue=u,u.stores=[l]):(h=u.stores,h===null?u.stores=[l]:h.push(l))}function eT(l,u,h,x){u.value=h,u.getSnapshot=x,nT(u)&&sT(l)}function tT(l,u,h){return h(function(){nT(u)&&sT(l)})}function nT(l){var u=l.getSnapshot;l=l.value;try{var h=u();return!Mi(l,h)}catch{return!0}}function sT(l){var u=dc(l,2);u!==null&&xi(u,l,2)}function Vx(l){var u=Js();if(typeof l=="function"){var h=l;if(l=h(),wc){It(!0);try{h()}finally{It(!1)}}}return u.memoizedState=u.baseState=l,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:l},u}function iT(l,u,h,x){return l.baseState=h,Hx(l,xn,typeof x=="function"?x:Mr)}function bU(l,u,h,x,E){if(Lg(l))throw Error(s(485));if(l=u.action,l!==null){var O={payload:E,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){O.listeners.push($)}};le.T!==null?h(!0):O.isTransition=!1,x(O),h=u.pending,h===null?(O.next=u.pending=O,oT(u,O)):(O.next=h.next,u.pending=h.next=O)}}function oT(l,u){var h=u.action,x=u.payload,E=l.state;if(u.isTransition){var O=le.T,$={};$.types=O!==null?O.types:null,le.T=$;try{var K=h(E,x),ie=le.S;ie!==null&&ie($,K),rT(l,u,K)}catch(de){qx(l,u,de)}finally{O!==null&&$.types!==null&&(O.types=$.types),le.T=O}}else try{O=h(E,x),rT(l,u,O)}catch(de){qx(l,u,de)}}function rT(l,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(x){lT(l,u,x)},function(x){return qx(l,u,x)}):lT(l,u,h)}function lT(l,u,h){u.status="fulfilled",u.value=h,aT(u),l.state=h,u=l.pending,u!==null&&(h=u.next,h===u?l.pending=null:(h=h.next,u.next=h,oT(l,h)))}function qx(l,u,h){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=h,aT(u),u=u.next;while(u!==x)}l.action=null}function aT(l){l=l.listeners;for(var u=0;u<l.length;u++)(0,l[u])()}function cT(l,u){return u}function uT(l,u){if(Dt){var h=Sn.formState;if(h!==null){e:{var x=Ot;if(Dt){if(Tn){t:{for(var E=Tn,O=Ji;E.nodeType!==8;){if(!O){E=null;break t}if(E=to(E.nextSibling),E===null){E=null;break t}}O=E.data,E=O==="F!"||O==="F"?E:null}if(E){Tn=to(E.nextSibling),x=E.data==="F!";break e}}Dl(x)}x=!1}x&&(u=h[0])}}return h=Js(),h.memoizedState=h.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cT,lastRenderedState:u},h.queue=x,h=kT.bind(null,Ot,x),x.dispatch=h,x=Vx(!1),O=Qx.bind(null,Ot,!1,x.queue),x=Js(),E={state:u,dispatch:null,action:l,pending:null},x.queue=E,h=bU.bind(null,Ot,E,O,h),E.dispatch=h,x.memoizedState=l,[u,h,!1]}function dT(l){var u=Gn();return fT(u,xn,l)}function fT(l,u,h){if(u=Hx(l,u,cT)[0],l=Ag(Mr)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=hh(u)}catch($){throw $===Wu?vg:$}else x=u;u=Gn();var E=u.queue,O=E.dispatch;return h!==u.memoizedState&&(Ot.flags|=2048,Xu(9,{destroy:void 0},xU.bind(null,E,h),null)),[x,O,l]}function xU(l,u){l.action=u}function hT(l){var u=Gn(),h=xn;if(h!==null)return fT(u,h,l);Gn(),u=u.memoizedState,h=Gn();var x=h.queue.dispatch;return h.memoizedState=l,[u,x,!1]}function Xu(l,u,h,x){return l={tag:l,create:h,deps:x,inst:u,next:null},u=Ot.updateQueue,u===null&&(u=Rg(),Ot.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=l.next=l:(x=h.next,h.next=l,l.next=x,u.lastEffect=l),l}function pT(){return Gn().memoizedState}function _g(l,u,h,x){var E=Js();Ot.flags|=l,E.memoizedState=Xu(1|u,{destroy:void 0},h,x===void 0?null:x)}function Mg(l,u,h,x){var E=Gn();x=x===void 0?null:x;var O=E.memoizedState.inst;xn!==null&&x!==null&&jx(x,xn.memoizedState.deps)?E.memoizedState=Xu(u,O,h,x):(Ot.flags|=l,E.memoizedState=Xu(1|u,O,h,x))}function mT(l,u){_g(8390656,8,l,u)}function Wx(l,u){Mg(2048,8,l,u)}function vU(l){Ot.flags|=4;var u=Ot.updateQueue;if(u===null)u=Rg(),Ot.updateQueue=u,u.events=[l];else{var h=u.events;h===null?u.events=[l]:h.push(l)}}function gT(l){var u=Gn().memoizedState;return vU({ref:u,nextImpl:l}),function(){if((sn&2)!==0)throw Error(s(440));return u.impl.apply(void 0,arguments)}}function yT(l,u){return Mg(4,2,l,u)}function bT(l,u){return Mg(4,4,l,u)}function xT(l,u){if(typeof u=="function"){l=l();var h=u(l);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function vT(l,u,h){h=h!=null?h.concat([l]):null,Mg(4,4,xT.bind(null,u,l),h)}function Gx(){}function ST(l,u){var h=Gn();u=u===void 0?null:u;var x=h.memoizedState;return u!==null&&jx(u,x[1])?x[0]:(h.memoizedState=[l,u],l)}function wT(l,u){var h=Gn();u=u===void 0?null:u;var x=h.memoizedState;if(u!==null&&jx(u,x[1]))return x[0];if(x=l(),wc){It(!0);try{l()}finally{It(!1)}}return h.memoizedState=[x,u],x}function Kx(l,u,h){return h===void 0||(_r&1073741824)!==0&&(Ft&261930)===0?l.memoizedState=u:(l.memoizedState=h,l=MO(),Ot.lanes|=l,Gl|=l,h)}function ET(l,u,h,x){return Mi(h,u)?h:Fl.current!==null?(l=Kx(l,h,x),Mi(l,u)||(ts=!0),l):(_r&106)===0||(_r&1073741824)!==0&&(Ft&261930)===0?(ts=!0,l.memoizedState=h):(l=MO(),Ot.lanes|=l,Gl|=l,u)}function CT(l,u,h,x,E){var O=ne.p;ne.p=O!==0&&8>O?O:8;var $=le.T,K={};K.types=$!==null?$.types:null,le.T=K,Qx(l,!1,u,h);try{var ie=E(),de=le.S;if(de!==null&&de(K,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var ge=mU(ie,x);ph(l,u,ge,Pi(l))}else ph(l,u,x,Pi(l))}catch(ke){ph(l,u,{then:function(){},status:"rejected",reason:ke},Pi())}finally{ne.p=O,$!==null&&K.types!==null&&($.types=K.types),le.T=$}}function SU(){}function Yx(l,u,h,x){if(l.tag!==5)throw Error(s(476));var E=NT(l).queue;CT(l,E,u,fe,h===null?SU:function(){return TT(l),h(x)})}function NT(l){var u=l.memoizedState;if(u!==null)return u;u={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:fe},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:h},next:null},l.memoizedState=u,l=l.alternate,l!==null&&(l.memoizedState=u),u}function TT(l){var u=NT(l);u.next===null&&(u=l.alternate.memoizedState),ph(l,u.next.queue,{},Pi())}function Xx(){return Ts(md)}function OT(){return Gn().memoizedState}function RT(){return Gn().memoizedState}function wU(l){for(var u=l.return;u!==null;){switch(u.tag){case 24:case 3:var h=Pi();l=Bl(h);var x=$l(u,l,h);x!==null&&(xi(x,u,h),ah(x,u,h)),u={cache:Cx()},l.payload=u;return}u=u.return}}function EU(l,u,h){var x=Pi();h={lane:x,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lg(l)?AT(u,h):(h=mx(l,u,h,x),h!==null&&(xi(h,l,x),_T(h,u,x)))}function kT(l,u,h){var x=Pi();ph(l,u,h,x)}function ph(l,u,h,x){var E={lane:x,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Lg(l))AT(u,E);else{var O=l.alternate;if(l.lanes===0&&(O===null||O.lanes===0)&&(O=u.lastRenderedReducer,O!==null))try{var $=u.lastRenderedState,K=O($,h);if(E.hasEagerState=!0,E.eagerState=K,Mi(K,$))return ug(l,u,E,0),Sn===null&&cg(),!1}catch{}finally{}if(h=mx(l,u,E,x),h!==null)return xi(h,l,x),_T(h,u,x),!0}return!1}function Qx(l,u,h,x){if(x={lane:2,revertLane:F2(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Lg(l)){if(u)throw Error(s(479))}else u=mx(l,h,x,2),u!==null&&xi(u,l,2)}function Lg(l){var u=l.alternate;return l===Ot||u!==null&&u===Ot}function AT(l,u){Ku=Tg=!0;var h=l.pending;h===null?u.next=u:(u.next=h.next,h.next=u),l.pending=u}function _T(l,u,h){if((h&4194048)!==0){var x=u.lanes;x&=l.pendingLanes,h|=x,u.lanes=h,Nl(l,h)}}var Ig={readContext:Ts,use:kg,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useLayoutEffect:Vn,useInsertionEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useSyncExternalStore:Vn,useId:Vn,useHostTransitionStatus:Vn,useFormState:Vn,useActionState:Vn,useOptimistic:Vn,useMemoCache:Vn,useCacheRefresh:Vn,useEffectEvent:Vn},MT={readContext:Ts,use:kg,useCallback:function(l,u){return Js().memoizedState=[l,u===void 0?null:u],l},useContext:Ts,useEffect:mT,useImperativeHandle:function(l,u,h){h=h!=null?h.concat([l]):null,_g(4194308,4,xT.bind(null,u,l),h)},useLayoutEffect:function(l,u){return _g(4194308,4,l,u)},useInsertionEffect:function(l,u){_g(4,2,l,u)},useMemo:function(l,u){var h=Js();u=u===void 0?null:u;var x=l();if(wc){It(!0);try{l()}finally{It(!1)}}return h.memoizedState=[x,u],x},useReducer:function(l,u,h){var x=Js();if(h!==void 0){var E=h(u);if(wc){It(!0);try{h(u)}finally{It(!1)}}}else E=u;return x.memoizedState=x.baseState=E,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:E},x.queue=l,l=l.dispatch=EU.bind(null,Ot,l),[x.memoizedState,l]},useRef:function(l){var u=Js();return l={current:l},u.memoizedState=l},useState:function(l){l=Vx(l);var u=l.queue,h=kT.bind(null,Ot,u);return u.dispatch=h,[l.memoizedState,h]},useDebugValue:Gx,useDeferredValue:function(l,u){var h=Js();return Kx(h,l,u)},useTransition:function(){var l=Vx(!1);return l=CT.bind(null,Ot,l.queue,!0,!1),Js().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,u,h){var x=Ot,E=Js();if(Dt){if(h===void 0)throw Error(s(407));h=h()}else{if(h=u(),Sn===null)throw Error(s(349));(Ft&127)!==0||J4(x,u,h)}E.memoizedState=h;var O={value:h,getSnapshot:u};return E.queue=O,mT(tT.bind(null,x,O,l),[l]),x.flags|=2048,Xu(9,{destroy:void 0},eT.bind(null,x,O,h,u),null),h},useId:function(){var l=Js(),u=Sn.identifierPrefix;if(Dt){var h=Fo,x=$o;h=(x&~(1<<32-Zt(x)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Og++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=gU++,u="_"+u+"r_"+h.toString(32)+"_";return l.memoizedState=u},useHostTransitionStatus:Xx,useFormState:uT,useActionState:uT,useOptimistic:function(l){var u=Js();u.memoizedState=u.baseState=l;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=Qx.bind(null,Ot,!0,h),h.dispatch=u,[l,u]},useMemoCache:Fx,useCacheRefresh:function(){return Js().memoizedState=wU.bind(null,Ot)},useEffectEvent:function(l){var u=Js(),h={impl:l};return u.memoizedState=h,function(){if((sn&2)!==0)throw Error(s(440));return h.impl.apply(void 0,arguments)}}},LT={readContext:Ts,use:kg,useCallback:ST,useContext:Ts,useEffect:Wx,useImperativeHandle:vT,useInsertionEffect:yT,useLayoutEffect:bT,useMemo:wT,useReducer:Ag,useRef:pT,useState:function(){return Ag(Mr)},useDebugValue:Gx,useDeferredValue:function(l,u){var h=Gn();return ET(h,xn.memoizedState,l,u)},useTransition:function(){var l=Ag(Mr)[0],u=Gn().memoizedState;return[typeof l=="boolean"?l:hh(l),u]},useSyncExternalStore:Z4,useId:OT,useHostTransitionStatus:Xx,useFormState:dT,useActionState:dT,useOptimistic:function(l,u){var h=Gn();return iT(h,xn,l,u)},useMemoCache:Fx,useCacheRefresh:RT,useEffectEvent:gT},CU={readContext:Ts,use:kg,useCallback:ST,useContext:Ts,useEffect:Wx,useImperativeHandle:vT,useInsertionEffect:yT,useLayoutEffect:bT,useMemo:wT,useReducer:Ux,useRef:pT,useState:function(){return Ux(Mr)},useDebugValue:Gx,useDeferredValue:function(l,u){var h=Gn();return xn===null?Kx(h,l,u):ET(h,xn.memoizedState,l,u)},useTransition:function(){var l=Ux(Mr)[0],u=Gn().memoizedState;return[typeof l=="boolean"?l:hh(l),u]},useSyncExternalStore:Z4,useId:OT,useHostTransitionStatus:Xx,useFormState:hT,useActionState:hT,useOptimistic:function(l,u){var h=Gn();return xn!==null?iT(h,xn,l,u):(h.baseState=l,[l,h.queue.dispatch])},useMemoCache:Fx,useCacheRefresh:RT,useEffectEvent:gT};function Zx(l,u,h,x){u=l.memoizedState,h=h(x,u),h=h==null?u:k({},u,h),l.memoizedState=h,l.lanes===0&&(l.updateQueue.baseState=h)}var Jx={enqueueSetState:function(l,u,h){l=l._reactInternals;var x=Pi(),E=Bl(x);E.payload=u,h!=null&&(E.callback=h),u=$l(l,E,x),u!==null&&(xi(u,l,x),ah(u,l,x))},enqueueReplaceState:function(l,u,h){l=l._reactInternals;var x=Pi(),E=Bl(x);E.tag=1,E.payload=u,h!=null&&(E.callback=h),u=$l(l,E,x),u!==null&&(xi(u,l,x),ah(u,l,x))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var h=Pi(),x=Bl(h);x.tag=2,u!=null&&(x.callback=u),u=$l(l,x,h),u!==null&&(xi(u,l,h),ah(u,l,h))}};function IT(l,u,h,x,E,O,$){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,O,$):u.prototype&&u.prototype.isPureReactComponent?!eh(h,x)||!eh(E,O):!0}function DT(l,u,h,x){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,x),u.state!==l&&Jx.enqueueReplaceState(u,u.state,null)}function Ec(l,u){var h=u;if("ref"in u){h={};for(var x in u)x!=="ref"&&(h[x]=u[x])}if(l=l.defaultProps){h===u&&(h=k({},h));for(var E in l)h[E]===void 0&&(h[E]=l[E])}return h}function jT(l){ag(l)}function PT(l){console.error(l)}function zT(l){ag(l)}function Dg(l,u){try{var h=l.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function BT(l,u,h){try{var x=l.onCaughtError;x(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function e2(l,u,h){return h=Bl(h),h.tag=3,h.payload={element:null},h.callback=function(){Dg(l,u)},h}function $T(l){return l=Bl(l),l.tag=3,l}function FT(l,u,h,x){var E=h.type.getDerivedStateFromError;if(typeof E=="function"){var O=x.value;l.payload=function(){return E(O)},l.callback=function(){BT(u,h,x)}}var $=h.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(l.callback=function(){BT(u,h,x),typeof E!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var K=x.stack;this.componentDidCatch(x.value,{componentStack:K!==null?K:""})})}function NU(l,u,h,x,E){if(h.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=h.alternate,u!==null&&mc(u,h,E,!0),h=Os.current,h!==null){switch(h.tag){case 31:case 13:case 19:return Fs===null?n0():h.alternate===null&&qn===0&&(qn=3),h.flags&=-257,h.flags|=65536,h.lanes=E,x===Sg?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([x]):u.add(x),z2(l,x,E)),!1;case 22:return h.flags|=65536,x===Sg?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([x]):h.add(x)),z2(l,x,E)),!1}throw Error(s(435,h.tag))}return z2(l,x,E),n0(),!1}if(Dt)return u=Os.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,x!==vx&&(l=Error(s(422),{cause:x}),sh(Xi(l,h)))):(x!==vx&&(u=Error(s(423),{cause:x}),sh(Xi(u,h))),l=l.current.alternate,l.flags|=65536,E&=-E,l.lanes|=E,x=Xi(x,h),E=e2(l.stateNode,x,E),Ax(l,E),qn!==4&&(qn=2)),!1;var O=Error(s(520),{cause:x});if(O=Xi(O,h),wh===null?wh=[O]:wh.push(O),qn!==4&&(qn=2),u===null)return!0;x=Xi(x,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,l=E&-E,h.lanes|=l,l=e2(h.stateNode,x,l),Ax(h,l),!1;case 1:if(u=h.type,O=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Kl===null||!Kl.has(O))))return h.flags|=65536,E&=-E,h.lanes|=E,E=$T(E),FT(E,l,h,x),Ax(h,E),!1;break;case 22:if(h.memoizedState!==null)return h.flags|=65536,!1}h=h.return}while(h!==null);return!1}var t2=Error(s(461)),ts=!1;function us(l,u,h,x){u.child=l===null?q4(u,null,h,x):Sc(u,l.child,h,x)}function HT(l,u,h,x,E){h=h.render;var O=u.ref;if("ref"in x){var $={};for(var K in x)K!=="ref"&&($[K]=x[K])}else $=x;return gc(u),x=Px(l,u,h,$,O,E),K=zx(),l!==null&&!ts?(Bx(l,u,E),Lr(l,u,E)):(Dt&&K&&pg(u),u.flags|=1,us(l,u,x,E),u.child)}function UT(l,u,h,x,E){if(l===null){var O=h.type;return typeof O=="function"&&!gx(O)&&O.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=O,VT(l,u,O,x,E)):(l=fg(h.type,null,x,u,u.mode,E),l.ref=u.ref,l.return=u,u.child=l)}if(O=l.child,!c2(l,E)){var $=O.memoizedProps;if(h=h.compare,h=h!==null?h:eh,h($,x)&&l.ref===u.ref)return Lr(l,u,E)}return u.flags|=1,l=Or(O,x),l.ref=u.ref,l.return=u,u.child=l}function VT(l,u,h,x,E){if(l!==null){var O=l.memoizedProps;if(eh(O,x)&&l.ref===u.ref)if(ts=!1,u.pendingProps=x=O,c2(l,E))(l.flags&131072)!==0&&(ts=!0);else return u.lanes=l.lanes,Lr(l,u,E)}return n2(l,u,h,x,E)}function qT(l,u,h,x){var E=x.children,O=l!==null?l.memoizedState:null;if(l===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(O=O!==null?O.baseLanes|h:h,l!==null){for(x=u.child=l.child,E=0;x!==null;)E=E|x.lanes|x.childLanes,x=x.sibling;x=E&~O}else x=0,u.child=null;return WT(l,u,O,h,x)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},l!==null&&xg(u,O!==null?O.cachePool:null),O!==null?K4(u,O):Mx(),Y4(u);else return x=u.lanes=536870912,WT(l,u,O!==null?O.baseLanes|h:h,h,x)}else O!==null?(xg(u,O.cachePool),K4(u,O),Ul(),u.memoizedState=null):(l!==null&&xg(u,null),Mx(),Ul());return us(l,u,E,h),u.child}function mh(l,u){return l!==null&&l.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function WT(l,u,h,x,E){var O=Tx();return O=O===null?null:{parent:Jn._currentValue,pool:O},u.memoizedState={baseLanes:h,cachePool:O},l!==null&&xg(u,null),Mx(),Y4(u),l!==null&&mc(l,u,x,!0),u.childLanes=E,null}function jg(l,u){return u=Pg({mode:u.mode,children:u.children},l.mode),u.ref=l.ref,l.child=u,u.return=l,u}function GT(l,u,h){return Sc(u,l.child,null,h),l=jg(u,u.pendingProps),l.flags|=2,Li(u),u.memoizedState=null,l}function TU(l,u,h){var x=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,l===null){if(Dt){if(x.mode==="hidden")return l=jg(u,x),u.lanes=536870912,l.memoizedState={baseLanes:0,cachePool:null},mh(null,l);if(Ix(u),(l=Tn)?(l=xR(l,Ji),l=l!==null&&l.data==="&"?l:null,l!==null&&(u.memoizedState={dehydrated:l,treeContext:Ll!==null?{id:$o,overflow:Fo}:null,retryLane:536870912,hydrationErrors:null},h=A4(l),h.return=u,u.child=h,ms=u,Tn=null)):l=null,l===null)throw Dl(u);return u.lanes=536870912,null}return jg(u,x)}var O=l.memoizedState;if(O!==null){var $=O.dehydrated;if(Ix(u),E)if(u.flags&256)u.flags&=-257,u=GT(l,u,h);else if(u.memoizedState!==null)u.child=l.child,u.flags|=128,u=null;else throw Error(s(558));else if(ts||mc(l,u,h,!1),E=(h&l.childLanes)!==0,ts||E){if(Fl.current===null){if(x=Sn,x!==null&&($=br(x,h),$!==0&&$!==O.retryLane))throw O.retryLane=$,dc(l,$),xi(x,l,$),t2;n0()}u=GT(l,u,h)}else l=O.treeContext,Tn=to($.nextSibling),ms=u,Dt=!0,Il=null,Ji=!1,l!==null&&L4(u,l),u=jg(u,x),u.flags|=134221824;return u}return l=Or(l.child,{mode:x.mode,children:x.children}),l.ref=u.ref,u.child=l,l.return=u,l}function Qu(l,u){var h=u.ref;if(h===null)l!==null&&l.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(s(284));(l===null||l.ref!==h)&&(u.flags|=4194816)}}function n2(l,u,h,x,E){return gc(u),h=Px(l,u,h,x,void 0,E),x=zx(),l!==null&&!ts?(Bx(l,u,E),Lr(l,u,E)):(Dt&&x&&pg(u),u.flags|=1,us(l,u,h,E),u.child)}function KT(l,u,h,x,E,O){return gc(u),u.updateQueue=null,h=Q4(u,x,h,E),X4(l),x=zx(),l!==null&&!ts?(Bx(l,u,O),Lr(l,u,O)):(Dt&&x&&pg(u),u.flags|=1,us(l,u,h,O),u.child)}function YT(l,u,h,x,E){if(gc(u),u.stateNode===null){var O=Fu,$=h.contextType;typeof $=="object"&&$!==null&&(O=Ts($)),O=new h(x,O),u.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Jx,u.stateNode=O,O._reactInternals=u,O=u.stateNode,O.props=x,O.state=u.memoizedState,O.refs={},Rx(u),$=h.contextType,O.context=typeof $=="object"&&$!==null?Ts($):Fu,O.state=u.memoizedState,$=h.getDerivedStateFromProps,typeof $=="function"&&(Zx(u,h,$,x),O.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||($=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),$!==O.state&&Jx.enqueueReplaceState(O,O.state,null),uh(u,x,O,E),ch(),O.state=u.memoizedState),typeof O.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(l===null){O=u.stateNode;var K=u.memoizedProps,ie=Ec(h,K);O.props=ie;var de=O.context,ge=h.contextType;$=Fu,typeof ge=="object"&&ge!==null&&($=Ts(ge));var ke=h.getDerivedStateFromProps;ge=typeof ke=="function"||typeof O.getSnapshotBeforeUpdate=="function",K=u.pendingProps!==K,ge||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(K||de!==$)&&DT(u,O,x,$),zl=!1;var ce=u.memoizedState;O.state=ce,uh(u,x,O,E),ch(),de=u.memoizedState,K||ce!==de||zl?(typeof ke=="function"&&(Zx(u,h,ke,x),de=u.memoizedState),(ie=zl||IT(u,h,ie,x,ce,de,$))?(ge||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(u.flags|=4194308)):(typeof O.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=de),O.props=x,O.state=de,O.context=$,x=ie):(typeof O.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{O=u.stateNode,kx(l,u),$=u.memoizedProps,ge=Ec(h,$),O.props=ge,ke=u.pendingProps,ce=O.context,de=h.contextType,ie=Fu,typeof de=="object"&&de!==null&&(ie=Ts(de)),K=h.getDerivedStateFromProps,(de=typeof K=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||($!==ke||ce!==ie)&&DT(u,O,x,ie),zl=!1,ce=u.memoizedState,O.state=ce,uh(u,x,O,E),ch();var pe=u.memoizedState;$!==ke||ce!==pe||zl||l!==null&&l.dependencies!==null&&yg(l.dependencies)?(typeof K=="function"&&(Zx(u,h,K,x),pe=u.memoizedState),(ge=zl||IT(u,h,ge,x,ce,pe,ie)||l!==null&&l.dependencies!==null&&yg(l.dependencies))?(de||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(x,pe,ie),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(x,pe,ie)),typeof O.componentDidUpdate=="function"&&(u.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof O.componentDidUpdate!="function"||$===l.memoizedProps&&ce===l.memoizedState||(u.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&ce===l.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=pe),O.props=x,O.state=pe,O.context=ie,x=ge):(typeof O.componentDidUpdate!="function"||$===l.memoizedProps&&ce===l.memoizedState||(u.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||$===l.memoizedProps&&ce===l.memoizedState||(u.flags|=1024),x=!1)}return O=x,Qu(l,u),x=(u.flags&128)!==0,O||x?(O=u.stateNode,h=x&&typeof h.getDerivedStateFromError!="function"?null:O.render(),u.flags|=1,l!==null&&x?(u.child=Sc(u,l.child,null,E),u.child=Sc(u,null,h,E)):us(l,u,h,E),u.memoizedState=O.state,l=u.child):l=Lr(l,u,E),l}function XT(l,u,h,x){return hc(),u.flags|=256,us(l,u,h,x),u.child}var s2={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function i2(l){return{baseLanes:l,cachePool:B4()}}function o2(l,u,h){return l=l!==null?l.childLanes&~h:0,u&&(l|=ji),l}function QT(l,u,h){var x=u.pendingProps,E=!1,O=(u.flags&128)!==0,$;if(($=O)||($=l!==null&&l.memoizedState===null?!1:(Rs.current&2)!==0),$&&(E=!0,u.flags&=-129),$=(u.flags&32)!==0,u.flags&=-33,l===null){if(Dt){if(E?Hl(u):Ul(),(l=Tn)?(l=xR(l,Ji),l=l!==null&&l.data!=="&"?l:null,l!==null&&(u.memoizedState={dehydrated:l,treeContext:Ll!==null?{id:$o,overflow:Fo}:null,retryLane:536870912,hydrationErrors:null},h=A4(l),h.return=u,u.child=h,ms=u,Tn=null)):l=null,l===null)throw Dl(u);return iv(l)?u.lanes=32:u.lanes=536870912,null}return O=x.children,x=x.fallback,E?(Ul(),E=u.mode,O=Pg({mode:"hidden",children:O},E),x=fc(x,E,h,null),O.return=u,x.return=u,O.sibling=x,u.child=O,x=u.child,x.memoizedState=i2(h),x.childLanes=o2(l,$,h),u.memoizedState=s2,mh(null,x)):(Hl(u),r2(u,O))}var K=l.memoizedState;if(K!==null){var ie=K.dehydrated;if(ie!==null)return OU(l,u,O,$,x,ie,K,h)}return E?(Ul(),E=x.fallback,O=u.mode,K=l.child,ie=K.sibling,x=Or(K,{mode:"hidden",children:x.children}),x.subtreeFlags=K.subtreeFlags&1206910976,ie!==null?E=Or(ie,E):(E=fc(E,O,h,null),E.flags|=2),E.return=u,x.return=u,x.sibling=E,u.child=x,mh(null,x),x=u.child,E=l.child.memoizedState,E===null?E=i2(h):(O=E.cachePool,O!==null?(K=Jn._currentValue,O=O.parent!==K?{parent:K,pool:K}:O):O=B4(),E={baseLanes:E.baseLanes|h,cachePool:O}),x.memoizedState=E,x.childLanes=o2(l,$,h),u.memoizedState=s2,mh(l.child,x)):(Hl(u),h=l.child,l=h.sibling,h=Or(h,{mode:"visible",children:x.children}),h.return=u,h.sibling=null,l!==null&&($=u.deletions,$===null?(u.deletions=[l],u.flags|=16):$.push(l)),u.child=h,u.memoizedState=null,h)}function r2(l,u){return u=Pg({mode:"visible",children:u},l.mode),u.return=l,l.child=u}function Pg(l,u){return l=mi(22,l,null,u),l.lanes=0,l}function zg(l,u,h){return Sc(u,l.child,null,h),l=r2(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function OU(l,u,h,x,E,O,$,K){if(h)return u.flags&256?(Hl(u),u.flags&=-257,zg(l,u,K)):u.memoizedState!==null?(Ul(),u.child=l.child,u.flags|=128,null):(Ul(),O=E.fallback,$=u.mode,E=Pg({mode:"visible",children:E.children},$),O=fc(O,$,K,null),O.flags|=2,E.return=u,O.return=u,E.sibling=O,u.child=E,Sc(u,l.child,null,K),E=u.child,E.memoizedState=i2(K),E.childLanes=o2(l,x,K),u.memoizedState=s2,mh(null,E));if(Hl(u),iv(O)){if(x=O.nextSibling&&O.nextSibling.dataset,x)var ie=x.dgst;return x=ie,x!==""&&(E=Error(s(419)),E.stack="",E.digest=x,sh({value:E,source:null,stack:null})),zg(l,u,K)}if(ts||mc(l,u,K,!1),x=(K&l.childLanes)!==0,ts||x){if(Fl.current!==null)return zg(l,u,K);if(x=Sn,x!==null&&(E=br(x,K),E!==0&&E!==$.retryLane))throw $.retryLane=E,dc(l,E),xi(x,l,E),t2;return sv(O)||n0(),zg(l,u,K)}return sv(O)?(u.flags|=192,u.child=l.child,null):(l=$.treeContext,Tn=to(O.nextSibling),ms=u,Dt=!0,Il=null,Ji=!1,l!==null&&L4(u,l),u=r2(u,E.children),u.flags|=134221824,u)}function ZT(l,u,h){l.lanes|=u;var x=l.alternate;x!==null&&(x.lanes|=u),gg(l.return,u,h)}function JT(l){for(var u=null;l!==null;){var h=l.alternate;h!==null&&Ng(h)===null&&(u=l),l=l.sibling}return u}function Bg(l,u,h,x,E,O){var $=l.memoizedState;$===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:h,tailMode:E,treeForkCount:O}:($.isBackwards=u,$.rendering=null,$.renderingStartTime=0,$.last=x,$.tail=h,$.tailMode=E,$.treeForkCount=O)}function l2(l){var u=l.child;for(l.child=null;u!==null;){var h=u.sibling;u.sibling=l.child,l.child=u,u=h}}function a2(l,u,h){var x=u.pendingProps,E=x.revealOrder,O=x.tail;x=x.children;var $=Rs.current;if(u.flags&128)return dh(u,$),null;var K=($&2)!==0;if(K?($=$&1|2,u.flags|=128):$&=1,dh(u,$),E==="backwards"&&l!==null?(l2(l),us(l,u,x,h),l2(l)):us(l,u,x,h),x=Dt?nh:0,!K&&l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&ZT(l,h,u);else if(l.tag===19)ZT(l,h,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(E){case"backwards":h=JT(u.child),h===null?(E=u.child,u.child=null):(E=h.sibling,h.sibling=null,l2(u)),Bg(u,!0,E,null,O,x);break;case"unstable_legacy-backwards":for(h=null,E=u.child,u.child=null;E!==null;){if(l=E.alternate,l!==null&&Ng(l)===null){u.child=E;break}l=E.sibling,E.sibling=h,h=E,E=l}Bg(u,!0,h,null,O,x);break;case"together":Bg(u,!1,null,null,void 0,x);break;case"independent":u.memoizedState=null;break;default:h=JT(u.child),h===null?(E=u.child,u.child=null):(E=h.sibling,h.sibling=null),Bg(u,!1,E,h,O,x)}return u.child}function eO(l,u,h){var x=u.pendingProps;return jl(u,u.type,x.value),us(l,u,x.children,h),u.child}function Lr(l,u,h){if(l!==null&&(u.dependencies=l.dependencies),Gl|=u.lanes,(h&u.childLanes)===0)if(l!==null){if(mc(l,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(l!==null&&u.child!==l.child)throw Error(s(153));if(u.child!==null){for(l=u.child,h=Or(l,l.pendingProps),u.child=h,h.return=u;l.sibling!==null;)l=l.sibling,h=h.sibling=Or(l,l.pendingProps),h.return=u;h.sibling=null}return u.child}function c2(l,u){return(l.lanes&u)!==0?!0:(l=l.dependencies,!!(l!==null&&yg(l)))}function RU(l,u,h){switch(u.tag){case 3:He(u,u.stateNode.containerInfo),jl(u,Jn,l.memoizedState.cache),hc();break;case 27:case 5:Ee(u);break;case 4:He(u,u.stateNode.containerInfo);break;case 10:jl(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Ix(u),null;break;case 13:var x=u.memoizedState;if(x!==null){if(x.dehydrated!==null)return Hl(u),u.flags|=128,null;x=mc(l,u,h,!1);var E=u.child.childLanes;return x||(h&E)!==0?QT(l,u,h):(Hl(u),l=Lr(l,u,h),l!==null?l.sibling:null)}Hl(u);break;case 19:if(u.flags&128)return a2(l,u,h);if(E=(l.flags&128)!==0,x=(h&u.childLanes)!==0,x||(mc(l,u,h,!1),x=(h&u.childLanes)!==0),E){if(x)return a2(l,u,h);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),dh(u,Rs.current),x)break;return null;case 22:return u.lanes=0,qT(l,u,h,u.pendingProps);case 24:jl(u,Jn,l.memoizedState.cache)}return Lr(l,u,h)}function tO(l,u,h){if(l!==null)if(l.memoizedProps!==u.pendingProps)ts=!0;else{if(!c2(l,h)&&(u.flags&128)===0)return ts=!1,RU(l,u,h);ts=(l.flags&131072)!==0}else ts=!1,Dt&&(u.flags&1048576)!==0&&M4(u,nh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(l=xc(u.elementType),u.type=l,typeof l=="function")gx(l)?(x=Ec(l,x),u.tag=1,u=YT(null,u,l,x,h)):(u.tag=0,u=n2(null,u,l,x,h));else{if(l!=null){var E=l.$$typeof;if(E===z){u.tag=11,u=HT(null,u,l,x,h);break e}else if(E===V){u.tag=14,u=UT(null,u,l,x,h);break e}else if(E===F){u.tag=10,u.type=l,u=eO(null,u,h);break e}}throw u=se(l)||l,Error(s(306,u,""))}}return u;case 0:return n2(l,u,u.type,u.pendingProps,h);case 1:return x=u.type,E=Ec(x,u.pendingProps),YT(l,u,x,E,h);case 3:e:{if(He(u,u.stateNode.containerInfo),l===null)throw Error(s(387));x=u.pendingProps;var O=u.memoizedState;E=O.element,kx(l,u),uh(u,x,null,h);var $=u.memoizedState;if(x=$.cache,jl(u,Jn,x),x!==O.cache&&Ex(u,[Jn],h,!0),ch(),x=$.element,O.isDehydrated)if(O={element:x,isDehydrated:!1,cache:$.cache},u.updateQueue.baseState=O,u.memoizedState=O,u.flags&256){u=XT(l,u,x,h);break e}else if(x!==E){E=Xi(Error(s(424)),u),sh(E),u=XT(l,u,x,h);break e}else{switch(l=u.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(Tn=to(l.firstChild),ms=u,Dt=!0,Il=null,Ji=!0,h=q4(u,null,x,h),u.child=h;h;)h.flags=h.flags&-3|134221824,h=h.sibling}else{if(hc(),x===E){u=Lr(l,u,h);break e}us(l,u,x,h)}u=u.child}return u;case 26:return Qu(l,u),l===null?(h=TR(u.type,null,u.pendingProps,null))?u.memoizedState=h:Dt||(u.stateNode=oR(u.type,u.pendingProps,Me.current,u)):u.memoizedState=TR(u.type,l.memoizedProps,u.pendingProps,l.memoizedState),null;case 27:return Ee(u),l===null&&Dt&&(x=u.stateNode=wR(u.type,u.pendingProps,Me.current),ms=u,Ji=!0,E=Tn,Ql(u.type)?(ov=E,Tn=to(x.firstChild)):Tn=E),us(l,u,u.pendingProps.children,h),Qu(l,u),l===null&&(u.flags|=4194304),u.child;case 5:return l===null&&Dt&&((E=x=Tn)&&(x=wV(x,u.type,u.pendingProps,Ji),x!==null?(u.stateNode=x,ms=u,Tn=to(x.firstChild),Ji=!1,E=!0):E=!1),E||Dl(u)),Ee(u),E=u.type,O=u.pendingProps,$=l!==null?l.memoizedProps:null,x=O.children,X2(E,O)?x=null:$!==null&&X2(E,$)&&(u.flags|=32),u.memoizedState!==null&&(E=Px(l,u,yU,null,null,h),md._currentValue=E),Qu(l,u),us(l,u,x,h),u.child;case 6:return l===null&&Dt&&((l=h=Tn)&&(h=EV(h,u.pendingProps,Ji),h!==null?(u.stateNode=h,ms=u,Tn=null,l=!0):l=!1),l||Dl(u)),null;case 13:return QT(l,u,h);case 4:return He(u,u.stateNode.containerInfo),x=u.pendingProps,l===null?u.child=Sc(u,null,x,h):us(l,u,x,h),u.child;case 11:return HT(l,u,u.type,u.pendingProps,h);case 7:return x=u.pendingProps,Qu(l,u),us(l,u,x,h),u.child;case 8:return us(l,u,u.pendingProps.children,h),u.child;case 12:return us(l,u,u.pendingProps.children,h),u.child;case 10:return eO(l,u,h);case 9:return E=u.type._context,x=u.pendingProps.children,gc(u),E=Ts(E),x=x(E),u.flags|=1,us(l,u,x,h),u.child;case 14:return UT(l,u,u.type,u.pendingProps,h);case 15:return VT(l,u,u.type,u.pendingProps,h);case 19:return a2(l,u,h);case 31:return TU(l,u,h);case 22:return qT(l,u,h,u.pendingProps);case 24:return gc(u),x=Ts(Jn),l===null?(E=Tx(),E===null&&(E=Sn,O=Cx(),E.pooledCache=O,O.refCount++,O!==null&&(E.pooledCacheLanes|=h),E=O),u.memoizedState={parent:x,cache:E},Rx(u),jl(u,Jn,E)):((l.lanes&h)!==0&&(kx(l,u),uh(u,null,null,h),ch()),E=l.memoizedState,O=u.memoizedState,E.parent!==x?(E={parent:x,cache:x},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),jl(u,Jn,x)):(x=O.cache,jl(u,Jn,x),x!==E.cache&&Ex(u,[Jn],h,!0))),us(l,u,u.pendingProps.children,h),u.child;case 30:return u.stateNode===null&&(u.stateNode={autoName:null,paired:null,clones:null,ref:null}),x=u.pendingProps,x.name!=null&&x.name!=="auto"?u.flags|=l===null?18882560:18874368:Dt&&pg(u),l!==null&&l.memoizedProps.name!==x.name?u.flags|=4194816:Qu(l,u),us(l,u,x.children,h),u.child;case 29:throw u.pendingProps}throw Error(s(156,u.tag))}function Ir(l){l.flags|=4}function u2(l,u,h,x,E){var O;if((O=(l.mode&32)!==0)&&(O=h===null?AR(u,x):AR(u,x)&&(x.src!==h.src||x.srcSet!==h.srcSet)),O){if(l.flags|=16777216,(E&335544128)===E)if(l.stateNode.complete)l.flags|=8192;else if(jO())l.flags|=8192;else throw vc=Sg,Ox}else l.flags&=-16777217}function nO(l,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!_R(u))if(jO())l.flags|=8192;else throw vc=Sg,Ox}function $g(l,u){u!==null&&(l.flags|=4),l.flags&16384&&(u=l.tag!==22?Es():536870912,l.lanes|=u,nd|=u)}function gh(l,u){if(!Dt)switch(l.tailMode){case"visible":break;case"collapsed":for(var h=l.tail,x=null;h!==null;)h.alternate!==null&&(x=h),h=h.sibling;x===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null;break;default:for(u=l.tail,h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l.tail=null:h.sibling=null}}function On(l){var u=l.alternate!==null&&l.alternate.child===l.child,h=0,x=0;if(u)for(var E=l.child;E!==null;)h|=E.lanes|E.childLanes,x|=E.subtreeFlags&1206910976,x|=E.flags&1206910976,E.return=l,E=E.sibling;else for(E=l.child;E!==null;)h|=E.lanes|E.childLanes,x|=E.subtreeFlags,x|=E.flags,E.return=l,E=E.sibling;return l.subtreeFlags|=x,l.childLanes=h,u}function kU(l,u,h){var x=u.pendingProps;switch(xx(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return On(u),null;case 1:return On(u),null;case 3:return h=u.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),Ar(Jn),Ae(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(l===null||l.child===null)&&(Vu(u)?Ir(u):l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Sx())),On(u),null;case 26:var E=u.type,O=u.memoizedState;return l===null?(Ir(u),O!==null?(On(u),nO(u,O)):(On(u),u2(u,E,null,x,h))):O?O!==l.memoizedState?(Ir(u),On(u),nO(u,O)):(On(u),u.flags&=-16777217):(l=l.memoizedProps,l!==x&&Ir(u),On(u),u2(u,E,l,x,h)),null;case 27:if(Ne(u),h=Me.current,E=u.type,l!==null&&u.stateNode!=null)l.memoizedProps!==x&&Ir(u);else{if(!x){if(u.stateNode===null)throw Error(s(166));return On(u),u.subtreeFlags&=-33554433,null}l=be.current,Vu(u)?I4(u):(l=wR(E,x,h),u.stateNode=l,Ir(u))}return On(u),u.subtreeFlags&=-33554433,null;case 5:if(Ne(u),E=u.type,l!==null&&u.stateNode!=null)l.memoizedProps!==x&&Ir(u);else{if(!x){if(u.stateNode===null)throw Error(s(166));return On(u),u.subtreeFlags&=-33554433,null}if(O=be.current,Vu(u))I4(u);else{var $=Oh(Me.current);switch(O){case 1:O=$.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:O=$.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":O=$.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":O=$.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":O=$.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof x.is=="string"?$.createElement("select",{is:x.is}):$.createElement("select"),x.multiple?O.multiple=!0:x.size&&(O.size=x.size);break;default:O=typeof x.is=="string"?$.createElement(E,{is:x.is}):$.createElement(E)}}O[Rn]=u,O[as]=x;e:for($=u.child;$!==null;){if($.tag===5||$.tag===6)O.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===u)break e;for(;$.sibling===null;){if($.return===null||$.return===u)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}u.stateNode=O;e:switch(As(O,E,x),E){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Ir(u)}}return On(u),u.subtreeFlags&=-33554433,u2(u,u.type,l===null?null:l.memoizedProps,u.pendingProps,h),null;case 6:if(l&&u.stateNode!=null)l.memoizedProps!==x&&Ir(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(s(166));if(l=Me.current,Vu(u)){if(l=u.stateNode,h=u.memoizedProps,x=null,E=ms,E!==null)switch(E.tag){case 27:case 5:x=E.memoizedProps}l[Rn]=u,l=!!(l.nodeValue===h||x!==null&&x.suppressHydrationWarning===!0||tR(l.nodeValue,h)),l||Dl(u,!0)}else l=Oh(l).createTextNode(x),l[Rn]=u,u.stateNode=l}return On(u),null;case 31:if(h=u.memoizedState,l===null||l.memoizedState!==null){if(x=Vu(u),h!==null){if(l===null){if(!x)throw Error(s(318));if(l=u.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(557));l[Rn]=u}else hc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;On(u),l=!1}else h=Sx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=h),l=!0;if(!l)return u.flags&256?(Li(u),u):(Li(u),null);if((u.flags&128)!==0)throw Error(s(558))}return On(u),null;case 13:if(x=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(E=Vu(u),x!==null&&x.dehydrated!==null){if(l===null){if(!E)throw Error(s(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(s(317));E[Rn]=u}else hc(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;On(u),E=!1}else E=Sx(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(Li(u),u):(Li(u),null)}return Li(u),(u.flags&128)!==0?(u.lanes=h,u):(h=x!==null,l=l!==null&&l.memoizedState!==null,h&&(x=u.child,E=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(E=x.alternate.memoizedState.cachePool.pool),O=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(O=x.memoizedState.cachePool.pool),O!==E&&(x.flags|=2048)),h!==l&&h&&(u.child.flags|=8192),$g(u,u.updateQueue),On(u),null);case 4:return Ae(),l===null&&q2(u.stateNode.containerInfo),u.flags|=67108864,On(u),null;case 10:return Ar(u.type),On(u),null;case 19:if(Dx(u),x=u.memoizedState,x===null)return On(u),null;if(E=(u.flags&128)!==0,O=x.rendering,O===null)if(E)gh(x,!1);else{if(qn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(O=Ng(l),O!==null){for(u.flags|=128,gh(x,!1),l=O.updateQueue,u.updateQueue=l,$g(u,l),u.subtreeFlags=0,l=h,h=u.child;h!==null;)k4(h,l),h=h.sibling;return dh(u,Rs.current&1|2),Dt&&Rr(u,x.treeForkCount),u.child}l=l.sibling}x.tail!==null&&Mt()>Zg&&(u.flags|=128,E=!0,gh(x,!1),u.lanes=4194304)}else{if(!E)if(l=Ng(O),l!==null){if(u.flags|=128,E=!0,l=l.updateQueue,u.updateQueue=l,$g(u,l),gh(x,!0),x.tail===null&&x.tailMode!=="collapsed"&&x.tailMode!=="visible"&&!O.alternate&&!Dt)return On(u),null}else 2*Mt()-x.renderingStartTime>Zg&&h!==536870912&&(u.flags|=128,E=!0,gh(x,!1),u.lanes=4194304);x.isBackwards?(O.sibling=u.child,u.child=O):(l=x.last,l!==null?l.sibling=O:u.child=O,x.last=O)}if(x.tail!==null){l=x.tail;e:{for(h=l;h!==null;){if(h.alternate!==null){h=!1;break e}h=h.sibling}h=!0}return x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Mt(),l.sibling=null,O=Rs.current,O=E?O&1|2:O&1,x.tailMode==="visible"||x.tailMode==="collapsed"||!h||Dt?dh(u,O):(h=O,Oe(Os,u),Oe(Rs,h),Fs===null&&(Fs=u)),Dt&&Rr(u,x.treeForkCount),l}return On(u),null;case 22:case 23:return Li(u),Lx(),x=u.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(h&536870912)!==0&&(u.flags&128)===0&&(On(u),u.subtreeFlags&6&&(u.flags|=8192)):On(u),h=u.updateQueue,h!==null&&$g(u,h.retryQueue),h=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==h&&(u.flags|=2048),l!==null&&ye(bc),null;case 24:return h=null,l!==null&&(h=l.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),Ar(Jn),On(u),null;case 25:return null;case 30:return u.flags|=33554432,On(u),null}throw Error(s(156,u.tag))}function AU(l,u){switch(xx(u),u.tag){case 1:return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Ar(Jn),Ae(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 26:case 27:case 5:return Ne(u),null;case 31:if(u.memoizedState!==null){if(Li(u),u.alternate===null)throw Error(s(340));hc()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 13:if(Li(u),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(s(340));hc()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return Dx(u),l=u.flags,l&65536?(u.flags=l&-65537|128,l=u.memoizedState,l!==null&&(l.rendering=null,l.tail=null),u.flags|=4,u):null;case 4:return Ae(),null;case 10:return Ar(u.type),null;case 22:case 23:return Li(u),Lx(),l!==null&&ye(bc),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 24:return Ar(Jn),null;case 25:return null;default:return null}}function sO(l,u){switch(xx(u),u.tag){case 3:Ar(Jn),Ae();break;case 26:case 27:case 5:Ne(u);break;case 4:Ae();break;case 31:u.memoizedState!==null&&Li(u);break;case 13:Li(u);break;case 19:Dx(u);break;case 10:Ar(u.type);break;case 22:case 23:Li(u),Lx(),l!==null&&ye(bc);break;case 24:Ar(Jn)}}function yh(l,u){try{var h=u.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var E=x.next;h=E;do{if((h.tag&l)===l){x=void 0;var O=h.create,$=h.inst;x=O(),$.destroy=x}h=h.next}while(h!==E)}}catch(K){hn(u,u.return,K)}}function Vl(l,u,h){try{var x=u.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var O=E.next;x=O;do{if((x.tag&l)===l){var $=x.inst,K=$.destroy;if(K!==void 0){$.destroy=void 0,E=u;var ie=h,de=K;try{de()}catch(ge){hn(E,ie,ge)}}}x=x.next}while(x!==O)}}catch(ge){hn(u,u.return,ge)}}function iO(l){var u=l.updateQueue;if(u!==null){var h=l.stateNode;try{G4(u,h)}catch(x){hn(l,l.return,x)}}}function oO(l,u,h){h.props=Ec(l.type,l.memoizedProps),h.state=l.memoizedState;try{h.componentWillUnmount()}catch(x){hn(l,u,x)}}function Ho(l,u){try{var h=l.ref;if(h!==null){switch(l.tag){case 26:case 27:case 5:var x=l.stateNode;break;case 30:var E=l.stateNode,O=Nr(l.memoizedProps,E);(E.ref===null||E.ref.name!==O)&&(E.ref=fR(O)),x=E.ref;break;case 7:if(l.stateNode===null){var $=new zi(l);p(l.child,!1,vV,$,void 0,void 0),l.stateNode=$}x=l.stateNode;break;default:x=l.stateNode}typeof h=="function"?l.refCleanup=h(x):h.current=x}}catch(K){hn(l,u,K)}}function ks(l,u){var h=l.ref,x=l.refCleanup;if(h!==null)if(typeof x=="function")try{x()}catch(E){hn(l,u,E)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(E){hn(l,u,E)}else h.current=null}function Fg(l,u){if((l.tag===5||l.tag===27||l.tag===6)&&l.alternate===null&&u!==null)for(var h=0;h<u.length;h++)bR(l.stateNode,u[h])}function rO(l){for(var u=l.return;u!==null&&(f2(u)&&bR(l.stateNode,u.stateNode),!d2(u));)u=u.return}function bh(l){for(var u=l.return;u!==null&&(f2(u)&&SV(l.stateNode,u.stateNode),!d2(u));)u=u.return}function d2(l){return l.tag===5||l.tag===3||l.tag===27}function f2(l){return l&&l.tag===7&&l.stateNode!==null}function h2(l){var u=l.type,h=l.memoizedProps,x=l.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&x.focus();break e;case"img":h.src?x.src=h.src:h.srcSet&&(x.srcset=h.srcSet)}}catch(E){hn(l,l.return,E)}}function p2(l,u,h){try{var x=l.stateNode;nV(x,l.type,h,u),x[as]=u}catch(E){hn(l,l.return,E)}}function lO(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Ql(l.type)||l.tag===4}function m2(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||lO(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Ql(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function g2(l,u,h,x){var E=l.tag;if(E===5||E===6)E=l.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(E,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(E),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=Qs)),Fg(l,x),dt=!0;else if(E!==4&&(E===27&&(Fg(l,x),x=null,Ql(l.type)&&(h=l.stateNode,u=null)),l=l.child,l!==null))for(g2(l,u,h,x),l=l.sibling;l!==null;)g2(l,u,h,x),l=l.sibling}function Hg(l,u,h,x){var E=l.tag;if(E===5||E===6)E=l.stateNode,u?h.insertBefore(E,u):h.appendChild(E),Fg(l,x),dt=!0;else if(E!==4&&(E===27&&(Fg(l,x),x=null,Ql(l.type)&&(h=l.stateNode)),l=l.child,l!==null))for(Hg(l,u,h,x),l=l.sibling;l!==null;)Hg(l,u,h,x),l=l.sibling}function aO(l){var u=l.stateNode,h=l.memoizedProps;try{for(var x=l.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);As(u,x,h),u[Rn]=l,u[as]=h}catch(O){hn(l,l.return,O)}}var Ug=!1,Ii=null;function cO(l){(l.tag===30||(l.subtreeFlags&33554432)!==0)&&(Ug=!0)}var Uo=null;function uO(){var l=Uo;return Uo=null,l}var gi=0;function Zu(l,u,h,x,E){return gi=0,dO(l.child,u,h,x,E)}function dO(l,u,h,x,E){for(var O=!1;l!==null;){if(l.tag===5){var $=l.stateNode;if(x!==null){var K=J2($);x.push(K),K.view&&(O=!0)}else O||J2($).view&&(O=!0);Ug=!0,uR($,gi===0?u:u+"_"+gi,h),gi++}else(l.tag!==22||l.memoizedState===null)&&(l.tag===30&&E||dO(l.child,u,h,x,E)&&(O=!0));l=l.sibling}return O}function Vo(l,u){for(;l!==null;)l.tag===5?dR(l.stateNode,l.memoizedProps):(l.tag!==22||l.memoizedState===null)&&(l.tag===30&&u||Vo(l.child,u)),l=l.sibling}function Vg(l){if((l.subtreeFlags&18874368)!==0)for(l=l.child;l!==null;){if((l.tag!==22||l.memoizedState===null)&&(Vg(l),l.tag===30&&(l.flags&18874368)!==0&&l.stateNode.paired)){var u=l.memoizedProps;if(u.name==null||u.name==="auto")throw Error(s(544));var h=u.name;u=Tr(u.default,u.share),u!=="none"&&(Zu(l,h,u,null,!1)||Vo(l.child,!1))}l=l.sibling}}function y2(l,u){if(l.tag===30){var h=l.stateNode,x=l.memoizedProps,E=Nr(x,h),O=Tr(x.default,h.paired?x.share:x.enter);O!=="none"?Zu(l,E,O,null,!1)?(Vg(l),h.paired||u||rd(l,x.onEnter)):Vo(l.child,!1):Vg(l)}else if((l.subtreeFlags&33554432)!==0)for(l=l.child;l!==null;)y2(l,u),l=l.sibling;else Vg(l)}function b2(l){if(Ii!==null&&Ii.size!==0){var u=Ii;if((l.subtreeFlags&18874368)!==0)for(l=l.child;l!==null;){if(l.tag!==22||l.memoizedState===null){if(l.tag===30&&(l.flags&18874368)!==0){var h=l.memoizedProps,x=h.name;if(x!=null&&x!=="auto"){var E=u.get(x);if(E!==void 0){var O=Tr(h.default,h.share);if(O!=="none"&&(Zu(l,x,O,null,!1)?(O=l.stateNode,E.paired=O,O.paired=E,rd(l,h.onShare)):Vo(l.child,!1)),u.delete(x),u.size===0)break}}}b2(l)}l=l.sibling}}}function x2(l){if(l.tag===30){var u=l.memoizedProps,h=Nr(u,l.stateNode),x=Ii!==null?Ii.get(h):void 0,E=Tr(u.default,x!==void 0?u.share:u.exit);E!=="none"&&(Zu(l,h,E,null,!1)?x!==void 0?(E=l.stateNode,x.paired=E,E.paired=x,Ii.delete(h),rd(l,u.onShare)):rd(l,u.onExit):Vo(l.child,!1)),Ii!==null&&b2(l)}else if((l.subtreeFlags&33554432)!==0)for(l=l.child;l!==null;)x2(l),l=l.sibling;else Ii!==null&&b2(l)}function fO(l){for(l=l.child;l!==null;){if(l.tag===30){var u=l.memoizedProps,h=Nr(u,l.stateNode);u=Tr(u.default,u.update),l.flags&=-5,u!=="none"&&Zu(l,h,u,l.memoizedState=[],!1)}else(l.subtreeFlags&33554432)!==0&&fO(l);l=l.sibling}}function v2(l){if((l.subtreeFlags&18874368)!==0)for(l=l.child;l!==null;){if(l.tag!==22||l.memoizedState===null){if(l.tag===30&&(l.flags&18874368)!==0){var u=l.stateNode;u.paired!==null&&(u.paired=null,Vo(l.child,!1))}v2(l)}l=l.sibling}}function qg(l){if(l.tag===30)l.stateNode.paired=null,Vo(l.child,!1),v2(l);else if((l.subtreeFlags&33554432)!==0)for(l=l.child;l!==null;)qg(l),l=l.sibling;else v2(l)}function hO(l){for(l=l.child;l!==null;)l.tag===30?Vo(l.child,!1):(l.subtreeFlags&33554432)!==0&&hO(l),l=l.sibling}function S2(l,u,h,x,E,O,$){for(var K=!1;u!==null;){if(u.tag===5){var ie=u.stateNode;if(O!==null&&gi<O.length){var de=O[gi],ge=J2(ie);(de.view||ge.view)&&(K=!0);var ke;if(ke=(l.flags&4)===0)if(ge.clip)ke=!0;else{ke=de.rect;var ce=ge.rect;ke=ke.y!==ce.y||ke.x!==ce.x||ke.height!==ce.height||ke.width!==ce.width}ke&&(l.flags|=4),ge.abs?ge=!de.abs:(de=de.rect,ge=ge.rect,ge=de.height!==ge.height||de.width!==ge.width),ge&&(l.flags|=32)}else l.flags|=32;(l.flags&4)!==0&&uR(ie,gi===0?h:h+"_"+gi,E),K&&(l.flags&4)!==0||(Uo===null&&(Uo=[]),Uo.push(ie,gi===0?x:x+"_"+gi,u.memoizedProps)),gi++}else(u.tag!==22||u.memoizedState===null)&&(u.tag===30&&$?l.flags|=u.flags&32:S2(l,u.child,h,x,E,O,$)&&(K=!0));u=u.sibling}return K}function pO(l,u){for(l=l.child;l!==null;){if(l.tag===30){var h=l.memoizedProps,x=l.stateNode,E=Nr(h,x),O=Tr(h.default,h.update),$;$=l.memoizedState,l.memoizedState=null,x=l;var K=l.child;gi=0,E=S2(x,K,E,E,O,$,!1),(l.flags&4)!==0&&E&&rd(l,h.onUpdate)}else(l.subtreeFlags&33554432)!==0&&pO(l);l=l.sibling}}var gs=!1,cn=!1,qo=!1,w2=!1,mO=typeof WeakSet=="function"?WeakSet:Set,ys=null,Wo=!1,xh=!1,Wg=!1,E2=!1;function _U(l,u,h){if(l=l.containerInfo,K2=gd,l=x4(l),cx(l)){if("selectionStart"in l)var x={start:l.selectionStart,end:l.selectionEnd};else e:{x=(x=l.ownerDocument)&&x.defaultView||window;var E=x.getSelection&&x.getSelection();if(E&&E.rangeCount!==0){x=E.anchorNode;var O=E.anchorOffset,$=E.focusNode;E=E.focusOffset;try{x.nodeType,$.nodeType}catch{x=null;break e}var K=0,ie=-1,de=-1,ge=0,ke=0,ce=l,pe=null;t:for(;;){for(var Fe;ce!==x||O!==0&&ce.nodeType!==3||(ie=K+O),ce!==$||E!==0&&ce.nodeType!==3||(de=K+E),ce.nodeType===3&&(K+=ce.nodeValue.length),(Fe=ce.firstChild)!==null;)pe=ce,ce=Fe;for(;;){if(ce===l)break t;if(pe===x&&++ge===O&&(ie=K),pe===$&&++ke===E&&(de=K),(Fe=ce.nextSibling)!==null)break;ce=pe,pe=ce.parentNode}ce=Fe}x=ie===-1||de===-1?null:{start:ie,end:de}}else x=null}x=x||{start:0,end:0}}else x=null;for(Y2={focusedElem:l,selectionRange:x},gd=!1,h=(h&335544064)===h,ys=u,u=h?9270:1024;ys!==null;){if(l=ys,h&&(x=l.deletions,x!==null))for(O=0;O<x.length;O++)h&&x2(x[O]);if(l.alternate===null&&(l.flags&2)!==0)h&&cO(l),Gg(h);else{if(l.tag===22){if(x=l.alternate,l.memoizedState!==null){x!==null&&x.memoizedState===null&&h&&x2(x),Gg(h);continue}else if(x!==null&&x.memoizedState!==null){h&&cO(l),Gg(h);continue}}x=l.child,(l.subtreeFlags&u)!==0&&x!==null?(x.return=l,ys=x):(h&&fO(l),Gg(h))}}Ii=null}function Gg(l){for(;ys!==null;){var u=ys,h=l,x=u.alternate,E=u.flags;switch(u.tag){case 0:case 11:case 15:break;case 1:if((E&1024)!==0&&x!==null){h=void 0,E=x.memoizedProps,x=x.memoizedState;var O=u.stateNode;try{var $=Ec(u.type,E);h=O.getSnapshotBeforeUpdate($,x),O.__reactInternalSnapshotBeforeUpdate=h}catch(K){hn(u,u.return,K)}}break;case 3:if((E&1024)!==0){if(x=u.stateNode.containerInfo,h=x.nodeType,h===9)nv(x);else if(h===1)switch(x.nodeName){case"HEAD":case"HTML":case"BODY":nv(x);break;default:x.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:h&&x!==null&&(h=Nr(x.memoizedProps,x.stateNode),E=u.memoizedProps,E=Tr(E.default,E.update),E!=="none"&&Zu(x,h,E,x.memoizedState=[],!0));break;default:if((E&1024)!==0)throw Error(s(163))}if(x=u.sibling,x!==null){x.return=u.return,ys=x;break}ys=u.return}}function gO(l,u,h){var x=h.flags;switch(h.tag){case 0:case 11:case 15:Go(l,h),x&4&&yh(5,h);break;case 1:if(Go(l,h),x&4)if(l=h.stateNode,u===null)try{l.componentDidMount()}catch($){hn(h,h.return,$)}else{var E=Ec(h.type,u.memoizedProps);u=u.memoizedState;try{l.componentDidUpdate(E,u,l.__reactInternalSnapshotBeforeUpdate)}catch($){hn(h,h.return,$)}}x&64&&iO(h),x&512&&Ho(h,h.return);break;case 3:if(Go(l,h),x&64&&(l=h.updateQueue,l!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{G4(l,u)}catch($){hn(h,h.return,$)}}break;case 27:u===null&&x&4&&aO(h);case 26:case 5:Go(l,h),u===null&&x&4&&h2(h),x&512&&Ho(h,h.return);break;case 12:Go(l,h);break;case 31:Go(l,h),x&4&&vO(l,h);break;case 13:Go(l,h),x&4&&SO(l,h),x&64&&(l=h.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(h=UU.bind(null,h),CV(l,h))));break;case 22:if(x=h.memoizedState!==null||gs,!x){var O=u!==null&&u.memoizedState!==null||cn;u=gs,E=cn,gs=x,(cn=O)&&!E?(x=2,(h.subtreeFlags&8772)!==0&&(x|=1),xo(l,h,x)):Go(l,h),gs=u,cn=E}break;case 30:Go(l,h),x&512&&Ho(h,h.return);break;case 7:x&512&&Ho(h,h.return);default:Go(l,h)}}function C2(l,u){for(l=l.child;l!==null;)yO(l,u),l=l.sibling}function yO(l,u){switch(l.tag){case 5:case 26:try{var h=l.stateNode;if(u){var x=h.style;typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"}else{var E=l.stateNode,O=l.memoizedProps.style,$=O!=null&&O.hasOwnProperty("display")?O.display:null;E.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ie){hn(l,l.return,ie)}N2(l,u);break;case 6:try{l.stateNode.nodeValue=u?"":l.memoizedProps,dt=!0}catch(ie){hn(l,l.return,ie)}break;case 18:try{var K=l.stateNode;u?cR(K,!0):cR(l.stateNode,!1)}catch(ie){hn(l,l.return,ie)}break;case 22:case 23:l.memoizedState===null&&C2(l,u);break;default:C2(l,u)}}function N2(l,u){if(l.subtreeFlags&67108864)for(l=l.child;l!==null;){e:{var h=l,x=u;switch(h.tag){case 4:yO(h,x);break e;case 22:h.memoizedState===null&&N2(h,x);break e;default:N2(h,x)}}l=l.sibling}}function bO(l){var u=l.alternate;u!==null&&(l.alternate=null,bO(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&Rl(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var _n=null,yi=!1;function yo(l,u,h){for(h=h.child;h!==null;)xO(l,u,h),h=h.sibling}function xO(l,u,h){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(Wt,h)}catch{}switch(h.tag){case 26:cn||ks(h,u),yo(l,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&!cn&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:cn||ks(h,u),bh(h);var x=_n,E=yi;Ql(h.type)&&(_n=h.stateNode,yi=!1),yo(l,u,h),ER(h.stateNode,h.type,h.memoizedProps),_n=x,yi=E;break;case 5:cn||ks(h,u),bh(h);case 6:if(h.tag===6&&bh(h),x=_n,E=yi,_n=null,yo(l,u,h),_n=x,yi=E,_n!==null)if(yi)try{(_n.nodeType===9?_n.body:_n.nodeName==="HTML"?_n.ownerDocument.body:_n).removeChild(h.stateNode),dt=!0}catch(O){hn(h,u,O)}else try{_n.removeChild(h.stateNode),dt=!0}catch(O){hn(h,u,O)}break;case 18:_n!==null&&(yi?(l=_n,aR(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,h.stateNode),yd(l)):aR(_n,h.stateNode));break;case 4:x=_n,E=yi,_n=h.stateNode.containerInfo,yi=!0,yo(l,u,h),_n=x,yi=E;break;case 0:case 11:case 14:case 15:Vl(2,h,u),cn||Vl(4,h,u),yo(l,u,h);break;case 1:cn||(ks(h,u),x=h.stateNode,typeof x.componentWillUnmount=="function"&&oO(h,u,x)),yo(l,u,h);break;case 21:yo(l,u,h);break;case 22:cn=(x=cn)||h.memoizedState!==null,yo(l,u,h),cn=x;break;case 30:ks(h,u),yo(l,u,h);break;case 7:cn||ks(h,u),yo(l,u,h);break;default:yo(l,u,h)}}function vO(l,u){if(u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{yd(l)}catch(h){hn(u,u.return,h)}}}function SO(l,u){if(u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{yd(l)}catch(h){hn(u,u.return,h)}}function MU(l){switch(l.tag){case 31:case 13:case 19:var u=l.stateNode;return u===null&&(u=l.stateNode=new mO),u;case 22:return l=l.stateNode,u=l._retryCache,u===null&&(u=l._retryCache=new mO),u;default:throw Error(s(435,l.tag))}}function Kg(l,u){var h=MU(l);u.forEach(function(x){if(!h.has(x)){h.add(x);var E=VU.bind(null,l,x);x.then(E,E)}})}function ei(l,u,h){var x=u.deletions;if(x!==null)for(var E=0;E<x.length;E++){var O=x[E],$=l,K=u,ie=K;e:for(;ie!==null;){switch(ie.tag){case 27:if(Ql(ie.type)){_n=ie.stateNode,yi=!1;break e}break;case 5:_n=ie.stateNode,yi=!1;break e;case 3:case 4:_n=ie.stateNode.containerInfo,yi=!0;break e}ie=ie.return}if(_n===null)throw Error(s(160));xO($,K,O),_n=null,yi=!1,$=O.alternate,$!==null&&($.return=null),O.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)wO(u,l,h),u=u.sibling}var bo=null;function wO(l,u,h){var x=l.alternate,E=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(E&4&&(x=l.updateQueue,x=x!==null?x.events:null,x!==null))for(var O=0;O<x.length;O++){var $=x[O];$.ref.impl=$.nextImpl}ei(u,l,h),ti(l),E&4&&(Vl(3,l,l.return),yh(3,l),Vl(5,l,l.return));break;case 1:ei(u,l,h),ti(l),E&512&&(cn||x===null||ks(x,x.return)),E&64&&gs&&(l=l.updateQueue,l!==null&&(u=l.callbacks,u!==null&&(h=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=h===null?u:h.concat(u))));break;case 26:if(O=bo,ei(u,l,h),ti(l),E&512&&(cn||x===null||ks(x,x.return)),E&4)if(E=x!==null?x.memoizedState:null,h=l.memoizedState,x===null)if(h===null)if(l.stateNode===null)if(gs)l.stateNode=oR(l.type,l.memoizedProps,u.containerInfo,l);else{e:{u=l.type,h=l.memoizedProps,E=O.ownerDocument||O;t:switch(u){case"title":x=E.getElementsByTagName("title")[0],(!x||x[Sr]||x[Rn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=E.createElement(u),E.head.insertBefore(x,E.querySelector("head > title"))),As(x,u,h),x[Rn]=l,De(x),u=x;break e;case"link":if(O=kR("link","href",E).get(u+(h.href||""))){for($=0;$<O.length;$++)if(x=O[$],x.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&x.getAttribute("rel")===(h.rel==null?null:h.rel)&&x.getAttribute("title")===(h.title==null?null:h.title)&&x.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){O.splice($,1);break t}}x=E.createElement(u),As(x,u,h),E.head.appendChild(x);break;case"meta":if(O=kR("meta","content",E).get(u+(h.content||""))){for($=0;$<O.length;$++)if(x=O[$],x.getAttribute("content")===(h.content==null?null:""+h.content)&&x.getAttribute("name")===(h.name==null?null:h.name)&&x.getAttribute("property")===(h.property==null?null:h.property)&&x.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&x.getAttribute("charset")===(h.charSet==null?null:h.charSet)){O.splice($,1);break t}}x=E.createElement(u),As(x,u,h),E.head.appendChild(x);break;default:throw Error(s(468,u))}x[Rn]=l,De(x),u=x}l.stateNode=u}else gs||cv(O,l.type,l.stateNode);else l.stateNode=RR(O,h,l.memoizedProps);else E!==h?(E===null?(u=x.stateNode,u===null||cn||u.parentNode.removeChild(u)):E.count--,h===null?gs||cv(O,l.type,l.stateNode):RR(O,h,l.memoizedProps)):h===null&&l.stateNode!==null&&p2(l,l.memoizedProps,x.memoizedProps);break;case 27:ei(u,l,h),ti(l),E&512&&(cn||x===null||ks(x,x.return)),x!==null&&E&4&&p2(l,l.memoizedProps,x.memoizedProps);break;case 5:if(O=qo,qo=!1,ei(u,l,h),qo=O,ti(l),E&512&&(cn||x===null||ks(x,x.return)),l.flags&32){u=l.stateNode;try{Xs(u,""),dt=!0}catch(ge){hn(l,l.return,ge)}}E&4&&l.stateNode!=null&&(u=l.memoizedProps,p2(l,u,x!==null?x.memoizedProps:u)),E&1024&&(w2=!0);break;case 6:if(ei(u,l,h),ti(l),E&4){if(l.stateNode===null)throw Error(s(162));u=l.memoizedProps,h=l.stateNode;try{h.nodeValue=u,dt=!0}catch(ge){hn(l,l.return,ge)}}break;case 3:if(dt=!1,c0=null,O=bo,bo=Rh(u.containerInfo),ei(u,l,h),bo=O,ti(l),E&4&&x!==null&&x.memoizedState.isDehydrated)try{yd(u.containerInfo)}catch(ge){hn(l,l.return,ge)}w2&&(w2=!1,EO(l)),dt=!1;break;case 4:E=qo,qo=gs,x=cs(),O=bo,bo=Rh(l.stateNode.containerInfo),ei(u,l,h),ti(l),bo=O,dt&&xh&&(Wg=!0),dt=x,qo=E;break;case 12:ei(u,l,h),ti(l);break;case 31:ei(u,l,h),ti(l),E&4&&(u=l.updateQueue,u!==null&&(l.updateQueue=null,Kg(l,u)));break;case 13:ei(u,l,h),ti(l),l.child.flags&8192&&l.memoizedState!==null!=(x!==null&&x.memoizedState!==null)&&(Qg=Mt()),E&4&&(u=l.updateQueue,u!==null&&(l.updateQueue=null,Kg(l,u)));break;case 22:O=l.memoizedState!==null,$=x!==null&&x.memoizedState!==null;var K=gs,ie=cn,de=qo;gs=K||O,qo=de||O,cn=ie||$,ei(u,l,h),cn=ie,qo=de,gs=K,ti(l),E&8192&&(u=l.stateNode,u._visibility=O?u._visibility&-2:u._visibility|1,!O||x===null||$||gs||cn||(u=$||cn,h=gs,x=cn,gs=O||gs,cn=u,ql(l,2),gs=h,cn=x),!O&&qo||C2(l,O)),E&4&&(u=l.updateQueue,u!==null&&(h=u.retryQueue,h!==null&&(u.retryQueue=null,Kg(l,h))));break;case 19:ei(u,l,h),ti(l),E&4&&(u=l.updateQueue,u!==null&&(l.updateQueue=null,Kg(l,u)));break;case 30:E&512&&(cn||x===null||ks(x,x.return)),E=cs(),O=xh,$=(h&335544064)===h,K=l.memoizedProps,xh=$&&Tr(K.default,K.update)!=="none",ei(u,l,h),ti(l),$&&x!==null&&dt&&(l.flags|=4),xh=O,dt=E;break;case 21:break;case 7:E&512&&(cn||x===null||ks(x,x.return)),x&&x.stateNode!==null&&(x.stateNode._fragmentFiber=l);default:ei(u,l,h),ti(l)}}function ti(l){var u=l.flags;if(u&2){try{for(var h,x=l.return;x!==null;){if(lO(x)){h=x;break}x=x.return}x=null;for(var E=l.return;E!==null;){if(f2(E)){var O=E.stateNode;x===null?x=[O]:x.push(O)}if(d2(E))break;E=E.return}var $=x;if(h==null)throw Error(s(160));switch(h.tag){case 27:var K=h.stateNode,ie=m2(l);Hg(l,ie,K,$);break;case 5:var de=h.stateNode;h.flags&32&&(Xs(de,""),h.flags&=-33);var ge=m2(l);Hg(l,ge,de,$);break;case 3:case 4:var ke=h.stateNode.containerInfo,ce=m2(l);g2(l,ce,ke,$);break;default:throw Error(s(161))}}catch(pe){hn(l,l.return,pe)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function EO(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var u=l;EO(u),u.tag===5&&u.flags&1024&&(u=u.stateNode,gd=!0,u.reset(),gd=!1),l=l.sibling}}function Ju(l,u){if(u.subtreeFlags&9270)for(u=u.child;u!==null;)CO(u,l),u=u.sibling;else pO(u)}function CO(l,u){var h=l.alternate;if(h===null)y2(l,!1);else switch(l.tag){case 3:if(E2=Wo=!1,uO(),Ju(u,l),!Wo&&!Wg){if(l=Uo,l!==null)for(var x=0;x<l.length;x+=3){h=l[x];var E=l[x+1];dR(h,l[x+2]),h=h.ownerDocument.documentElement,h!==null&&h.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+E+")"})}l=u.containerInfo,l=l.nodeType===9?l.documentElement:l.ownerDocument.documentElement,l!==null&&l.style.viewTransitionName===""&&(l.style.viewTransitionName="none",l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),l.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),E2=!0}Uo=null;break;case 5:Ju(u,l);break;case 4:x=Wo,Wo=!1,Ju(u,l),Wo&&(Wg=!0),Wo=x;break;case 22:l.memoizedState===null&&(h.memoizedState!==null?y2(l,!1):Ju(u,l));break;case 30:x=Wo,E=uO(),Wo=!1,Ju(u,l),Wo&&(l.flags|=4);var O=l.memoizedProps,$=l.stateNode;u=Nr(O,$),$=Nr(h.memoizedProps,$);var K=Tr(O.default,O.update);K==="none"?u=!1:(O=h.memoizedState,h.memoizedState=null,h=l.child,gi=0,u=S2(l,h,u,$,K,O,!0),gi!==(O===null?0:O.length)&&(l.flags|=32)),(l.flags&4)!==0&&u?(rd(l,l.memoizedProps.onUpdate),Uo=E):E!==null&&(E.push.apply(E,Uo),Uo=E),Wo=(l.flags&32)!==0?!0:x;break;default:Ju(u,l)}}function Go(l,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)gO(l,u.alternate,u),u=u.sibling}function ql(l,u){for(l=l.child;l!==null;){var h=l,x=u;switch(h.tag){case 0:case 11:case 14:case 15:Vl(4,h,h.return),ql(h,x);break;case 1:ks(h,h.return);var E=h.stateNode;typeof E.componentWillUnmount=="function"&&oO(h,h.return,E),ql(h,x);break;case 27:(x&2)!==0&&ER(h.stateNode,h.type,h.memoizedProps);case 5:ks(h,h.return),h.tag!==5&&h.tag!==27||bh(h),ql(h,x);break;case 6:bh(h);break;case 26:ks(h,h.return),E=h.stateNode,h.memoizedState!==null||E===null||cn||E.parentNode.removeChild(E),ql(h,x);break;case 22:h.memoizedState===null&&ql(h,x);break;case 30:ks(h,h.return),ql(h,x);break;case 7:ks(h,h.return);default:ql(h,x)}l=l.sibling}}function xo(l,u,h){for(h=(u.subtreeFlags&8772)!==0?h:h&-2,u=u.child;u!==null;){var x=u.alternate,E=l,O=u,$=O.flags,K=(h&1)!==0;switch(O.tag){case 0:case 11:case 15:xo(E,O,h),yh(4,O);break;case 1:if(xo(E,O,h),x=O,E=x.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ge){hn(x,x.return,ge)}if(x=O,E=x.updateQueue,E!==null){var ie=x.stateNode;try{var de=E.shared.hiddenCallbacks;if(de!==null)for(E.shared.hiddenCallbacks=null,E=0;E<de.length;E++)W4(de[E],ie)}catch(ge){hn(x,x.return,ge)}}K&&$&64&&iO(O),Ho(O,O.return);break;case 27:(h&2)!==0&&aO(O);case 5:O.tag!==5&&O.tag!==27||rO(O),xo(E,O,h),K&&x===null&&$&4&&h2(O),Ho(O,O.return);break;case 6:rO(O);break;case 26:ie=O.stateNode,O.memoizedState!==null||ie===null||gs||cv(Rh(ie.ownerDocument),O.type,ie),xo(E,O,h),K&&x===null&&$&4&&h2(O),Ho(O,O.return);break;case 12:xo(E,O,h);break;case 31:xo(E,O,h),K&&$&4&&vO(E,O);break;case 13:xo(E,O,h),K&&$&4&&SO(E,O);break;case 22:O.memoizedState===null&&xo(E,O,h),Ho(O,O.return);break;case 30:xo(E,O,h),Ho(O,O.return);break;case 7:Ho(O,O.return);default:xo(E,O,h)}u=u.sibling}}function T2(l,u){var h=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),l=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(l=u.memoizedState.cachePool.pool),l!==h&&(l!=null&&l.refCount++,h!=null&&ih(h))}function O2(l,u){l=null,u.alternate!==null&&(l=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==l&&(u.refCount++,l!=null&&ih(l))}function eo(l,u,h,x){var E=(h&335544064)===h;if(u.subtreeFlags&(E?10262:10256))for(u=u.child;u!==null;)NO(l,u,h,x),u=u.sibling;else E&&hO(u)}function NO(l,u,h,x){var E=(h&335544064)===h;E&&u.alternate===null&&u.return!==null&&u.return.alternate!==null&&qg(u);var O=u.flags;switch(u.tag){case 0:case 11:case 15:eo(l,u,h,x),O&2048&&yh(9,u);break;case 1:eo(l,u,h,x);break;case 3:eo(l,u,h,x),E&&E2&&(l=l.containerInfo,l=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,l.style.viewTransitionName==="root"&&(l.style.viewTransitionName=""),l=l.ownerDocument.documentElement,l!==null&&l.style.viewTransitionName==="none"&&(l.style.viewTransitionName="")),O&2048&&(O=null,u.alternate!==null&&(O=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==O&&(u.refCount++,O!=null&&ih(O)));break;case 12:if(O&2048){eo(l,u,h,x),O=u.stateNode;try{var $=u.memoizedProps,K=$.id,ie=$.onPostCommit;typeof ie=="function"&&ie(K,u.alternate===null?"mount":"update",O.passiveEffectDuration,-0)}catch(de){hn(u,u.return,de)}}else eo(l,u,h,x);break;case 31:eo(l,u,h,x);break;case 13:eo(l,u,h,x);break;case 23:break;case 22:$=u.stateNode,K=u.alternate,u.memoizedState!==null?(E&&K!==null&&K.memoizedState===null&&qg(K),$._visibility&2?eo(l,u,h,x):vh(l,u)):(E&&K!==null&&K.memoizedState!==null&&qg(u),$._visibility&2?eo(l,u,h,x):($._visibility|=2,ed(l,u,h,x,(u.subtreeFlags&10256)!==0||!1))),O&2048&&T2(K,u);break;case 24:eo(l,u,h,x),O&2048&&O2(u.alternate,u);break;case 30:E&&(O=u.alternate,O!==null&&(Vo(O.child,!0),Vo(u.child,!0))),eo(l,u,h,x);break;default:eo(l,u,h,x)}}function ed(l,u,h,x,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var O=l,$=u,K=h,ie=x,de=$.flags;switch($.tag){case 0:case 11:case 15:ed(O,$,K,ie,E),yh(8,$);break;case 23:break;case 22:var ge=$.stateNode;$.memoizedState!==null?ge._visibility&2?ed(O,$,K,ie,E):vh(O,$):(ge._visibility|=2,ed(O,$,K,ie,E)),E&&de&2048&&T2($.alternate,$);break;case 24:ed(O,$,K,ie,E),E&&de&2048&&O2($.alternate,$);break;default:ed(O,$,K,ie,E)}u=u.sibling}}function vh(l,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=l,x=u,E=x.flags;switch(x.tag){case 22:vh(h,x),E&2048&&T2(x.alternate,x);break;case 24:vh(h,x),E&2048&&O2(x.alternate,x);break;default:vh(h,x)}u=u.sibling}}var Cc=8192;function Nc(l,u,h){if(l.subtreeFlags&Cc)for(l=l.child;l!==null;)TO(l,u,h),l=l.sibling}function TO(l,u,h){switch(l.tag){case 26:Nc(l,u,h),l.flags&Cc&&(l.memoizedState!==null?zV(h,bo,l.memoizedState,l.memoizedProps):(l=l.stateNode,(u&335544128)===u&&LR(h,l)));break;case 5:Nc(l,u,h),l.flags&Cc&&(l=l.stateNode,(u&335544128)===u&&LR(h,l));break;case 3:case 4:var x=bo;bo=Rh(l.stateNode.containerInfo),Nc(l,u,h),bo=x;break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=Cc,Cc=16777216,Nc(l,u,h),Cc=x):Nc(l,u,h));break;case 30:if((l.flags&Cc)!==0&&(x=l.memoizedProps.name,x!=null&&x!=="auto")){var E=l.stateNode;E.paired=null,Ii===null&&(Ii=new Map),Ii.set(x,E)}Nc(l,u,h);break;default:Nc(l,u,h)}}function OO(l){var u=l.alternate;if(u!==null&&(l=u.child,l!==null)){u.child=null;do u=l.sibling,l.sibling=null,l=u;while(l!==null)}}function Sh(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var x=u[h];ys=x,kO(x,l)}OO(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)RO(l),l=l.sibling}function RO(l){switch(l.tag){case 0:case 11:case 15:Sh(l),l.flags&2048&&Vl(9,l,l.return);break;case 3:Sh(l);break;case 12:Sh(l);break;case 22:var u=l.stateNode;l.memoizedState!==null&&u._visibility&2&&(l.return===null||l.return.tag!==13)?(u._visibility&=-3,Yg(l)):Sh(l);break;default:Sh(l)}}function Yg(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var x=u[h];ys=x,kO(x,l)}OO(l)}for(l=l.child;l!==null;){switch(u=l,u.tag){case 0:case 11:case 15:Vl(8,u,u.return),Yg(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,Yg(u));break;default:Yg(u)}l=l.sibling}}function kO(l,u){for(;ys!==null;){var h=ys;switch(h.tag){case 0:case 11:case 15:Vl(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var x=h.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:ih(h.memoizedState.cache)}if(x=h.child,x!==null)x.return=h,ys=x;else e:for(h=l;ys!==null;){x=ys;var E=x.sibling,O=x.return;if(bO(x),x===h){ys=null;break e}if(E!==null){E.return=O,ys=E;break e}ys=O}}}var LU={getCacheForType:function(l){var u=Ts(Jn),h=u.data.get(l);return h===void 0&&(h=l(),u.data.set(l,h)),h},cacheSignal:function(){return Ts(Jn).controller.signal}},IU=typeof WeakMap=="function"?WeakMap:Map,sn=0,Sn=null,zt=null,Ft=0,fn=0,Di=null,Wl=!1,td=!1,R2=!1,Dr=0,qn=0,Gl=0,Tc=0,Xg=0,ji=0,nd=0,wh=null,bi=null,k2=!1,Qg=0,AO=0,Zg=1/0,Jg=null,Kl=null,Bn=0,vo=null,Oc=null,Ko=0,A2=0,_2=null,_O=null,sd=null,id=null,od=null,Eh=0,e0=null;function Pi(){return(sn&2)!==0&&Ft!==0?Ft&-Ft:le.T!==null?F2():hi()}function MO(){if(ji===0)if((Ft&536870912)===0||Dt){var l=Tt;Tt<<=1,(Tt&3932160)===0&&(Tt=262144),ji=l}else ji=536870912;return l=Os.current,l!==null&&(l.flags|=32),ji}function rd(l,u){if(u!=null){var h=l.stateNode,x=h.ref;x===null&&(x=h.ref=fR(Nr(l.memoizedProps,h))),id===null&&(id=[]),id.push(u.bind(null,x))}}function xi(l,u,h){(l===Sn&&(fn===2||fn===9)||l.cancelPendingCommit!==null)&&(ld(l,0),Yl(l,Ft,ji,!1)),Ni(l,h),((sn&2)===0||l!==Sn)&&(l===Sn&&((sn&2)===0&&(Tc|=h),qn===4&&Yl(l,Ft,ji,!1)),Yo(l))}function LO(l,u,h){if((sn&6)!==0)throw Error(s(327));var x=!h&&(u&127)===0&&(u&l.expiredLanes)===0||mt(l,u),E=x?PU(l,u):L2(l,u,!0),O=x;do{if(E===0){td&&!x&&Yl(l,u,0,!1);break}else{if(h=l.current.alternate,O&&!DU(h)){E=L2(l,u,!1),O=!1;continue}if(E===2){if(O=u,l.errorRecoveryDisabledLanes&O)var $=0;else $=l.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){u=$;e:{var K=l;E=wh;var ie=K.current.memoizedState.isDehydrated;if(ie&&(ld(K,$).flags|=256),$=L2(K,$,!1),$!==2&&$!==6){if(R2&&!ie){K.errorRecoveryDisabledLanes|=O,Tc|=O,E=4;break e}O=bi,bi=E,O!==null&&(bi===null?bi=O:bi.push.apply(bi,O))}E=$}if(O=!1,E!==2)continue}}if(E===1){ld(l,0),Yl(l,u,0,!0);break}e:{switch(x=l,O=E,O){case 0:case 1:throw Error(s(345));case 4:if((u&4194048)!==u&&(u&62914560)!==u)break;case 6:Yl(x,u,ji,!Wl);break e;case 2:bi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((u&62914560)===u&&(E=Qg+300-Mt(),10<E)){if(Yl(x,u,ji,!Wl),Xe(x,0,!0)!==0)break e;Ko=u,x.timeoutHandle=Z2(IO.bind(null,x,h,bi,Jg,k2,u,ji,Tc,nd,Wl,O,"Throttled",-0,0),E);break e}IO(x,h,bi,Jg,k2,u,ji,Tc,nd,Wl,O,null,-0,0)}}break}while(!0);Yo(l)}function IO(l,u,h,x,E,O,$,K,ie,de,ge,ke,ce,pe){l.timeoutHandle=-1;var Fe=u.subtreeFlags,Qe=(O&335544064)===O;if(ke=null,(Qe||Fe&8192||(Fe&16785408)===16785408)&&(ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qs},Ii=null,TO(u,O,ke),Qe&&(Fe=ke,Qe=l.containerInfo,Qe=(Qe.nodeType===9?Qe:Qe.ownerDocument).__reactViewTransition,Qe!=null&&(Fe.count++,Fe.waitingForViewTransition=!0,Fe=_h.bind(Fe),Qe.finished.then(Fe,Fe))),Fe=(O&62914560)===O?Qg-Mt():(O&4194048)===O?AO-Mt():0,Fe=BV(ke,Fe),Fe!==null)){Ko=O,l.cancelPendingCommit=Fe(HO.bind(null,l,u,O,h,x,E,$,K,ie,de,ge,ke,null,ce,pe)),Yl(l,O,$,!de);return}HO(l,u,O,h,x,E,$,K,ie,de,ge,ke)}function DU(l){for(var u=l;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var x=0;x<h.length;x++){var E=h[x],O=E.getSnapshot;E=E.value;try{if(!Mi(O(),E))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Yl(l,u,h,x){u=jn(l,u),u&=~Xg,u&=~Tc,l.suspendedLanes|=u,l.pingedLanes&=~u,x&&(l.warmLanes|=u),x=l.expirationTimes;for(var E=u;0<E;){var O=31-Zt(E),$=1<<O;x[O]=-1,E&=~$}h!==0&&Ti(l,h,u)}function t0(){return(sn&6)===0?(Ch(0),!1):!0}function M2(){if(zt!==null){if(fn===0)var l=zt.return;else l=zt,kr=pc=null,$x(l),Gu=null,lh=0,l=zt;for(;l!==null;)sO(l.alternate,l),l=l.return;zt=null}}function ld(l,u){var h=l.timeoutHandle;return h!==-1&&(l.timeoutHandle=-1,oV(h)),h=l.cancelPendingCommit,h!==null&&(l.cancelPendingCommit=null,h()),Ko=0,M2(),Sn=l,zt=h=Or(l.current,null),Ft=u,fn=0,Di=null,Wl=!1,td=mt(l,u),R2=!1,nd=ji=Xg=Tc=Gl=qn=0,bi=wh=null,k2=!1,Dr=jn(l,u),cg(),h}function DO(l,u){Ot=null,le.H=Ig,u===Wu||u===vg?(u=H4(),fn=3):u===Ox?(u=H4(),fn=4):fn=u===t2?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Di=u,zt===null&&(qn=1,Dg(l,Xi(u,l.current)))}function jO(){var l=Os.current;return l===null?!0:(Ft&4194048)===Ft?Fs===null:(Ft&62914560)===Ft||(Ft&536870912)!==0?l===Fs:!1}function PO(){var l=le.H;return le.H=Ig,l===null?Ig:l}function zO(){var l=le.A;return le.A=LU,l}function n0(){qn=4,Wl||(Ft&4194048)!==Ft&&Os.current!==null||(td=!0),(Gl&134217727)===0&&(Tc&134217727)===0||Sn===null||Yl(Sn,Ft,ji,!1)}function L2(l,u,h){var x=sn;sn|=2;var E=PO(),O=zO();(Sn!==l||Ft!==u)&&(Jg=null,ld(l,u)),u=!1;var $=qn;e:do try{if(fn!==0&&zt!==null){var K=zt,ie=Di;switch(fn){case 8:M2(),$=6;break e;case 3:case 2:case 9:case 6:Os.current===null&&(u=!0);var de=fn;if(fn=0,Di=null,ad(l,K,ie,de),h&&td){$=0;break e}break;default:de=fn,fn=0,Di=null,ad(l,K,ie,de)}}jU(),$=qn;break}catch(ge){DO(l,ge)}while(!0);return u&&l.shellSuspendCounter++,kr=pc=null,sn=x,le.H=E,le.A=O,zt===null&&(Sn=null,Ft=0,cg()),$}function jU(){for(;zt!==null;)BO(zt)}function PU(l,u){var h=sn;sn|=2;var x=PO(),E=zO();Sn!==l||Ft!==u?(Jg=null,Zg=Mt()+500,ld(l,u)):td=mt(l,u);e:do try{if(fn!==0&&zt!==null){u=zt;var O=Di;t:switch(fn){case 1:fn=0,Di=null,ad(l,u,O,1);break;case 2:case 9:if($4(O)){fn=0,Di=null,$O(u);break}u=function(){fn!==2&&fn!==9||Sn!==l||(fn=7),Yo(l)},O.then(u,u);break e;case 3:fn=7;break e;case 4:fn=5;break e;case 7:$4(O)?(fn=0,Di=null,$O(u)):(fn=0,Di=null,ad(l,u,O,7));break;case 5:var $=null;switch(zt.tag){case 26:$=zt.memoizedState;case 5:case 27:var K=zt;if($?_R($):K.stateNode.complete){fn=0,Di=null;var ie=K.sibling;if(ie!==null)zt=ie;else{var de=K.return;de!==null?(zt=de,s0(de)):zt=null}break t}}fn=0,Di=null,ad(l,u,O,5);break;case 6:fn=0,Di=null,ad(l,u,O,6);break;case 8:M2(),qn=6;break e;default:throw Error(s(462))}}zU();break}catch(ge){DO(l,ge)}while(!0);return kr=pc=null,le.H=x,le.A=E,sn=h,zt!==null?0:(Sn=null,Ft=0,cg(),qn)}function zU(){for(;zt!==null&&!Ct();)BO(zt)}function BO(l){var u=tO(l.alternate,l,Dr);l.memoizedProps=l.pendingProps,u===null?s0(l):zt=u}function $O(l){var u=l,h=u.alternate;switch(u.tag){case 15:case 0:u=KT(h,u,u.pendingProps,u.type,void 0,Ft);break;case 11:u=KT(h,u,u.pendingProps,u.type.render,u.ref,Ft);break;case 5:$x(u);var x=u;x===ms&&(Dt?(mg(x),x.tag===5&&x.stateNode!=null&&(Tn=x.stateNode)):(mg(x),Dt=!0));default:sO(h,u),u=zt=k4(u,Dr),u=tO(h,u,Dr)}l.memoizedProps=l.pendingProps,u===null?s0(l):zt=u}function ad(l,u,h,x){kr=pc=null,$x(u),Gu=null,lh=0;var E=u.return;try{if(NU(l,E,u,h,Ft)){qn=1,Dg(l,Xi(h,l.current)),zt=null;return}}catch(O){if(E!==null)throw zt=E,O;qn=1,Dg(l,Xi(h,l.current)),zt=null;return}u.flags&32768?(Dt||x===1?l=!0:td||(Ft&536870912)!==0?l=!1:(Wl=l=!0,(x===2||x===9||x===3||x===6)&&(x=Os.current,x!==null&&x.tag===13&&(x.flags|=16384))),FO(u,l)):s0(u)}function s0(l){var u=l;do{if((u.flags&32768)!==0){FO(u,Wl);return}l=u.return;var h=kU(u.alternate,u,Dr);if(h!==null){zt=h;return}if(u=u.sibling,u!==null){zt=u;return}zt=u=l}while(u!==null);qn===0&&(qn=5)}function FO(l,u){do{var h=AU(l.alternate,l);if(h!==null){h.flags&=32767,zt=h;return}if(h=l.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(l=l.sibling,l!==null)){zt=l;return}zt=l=h}while(l!==null);qn=6,zt=null}function HO(l,u,h,x,E,O,$,K,ie,de,ge,ke){l.cancelPendingCommit=null;do i0();while(Bn!==0);if((sn&6)!==0)throw Error(s(327));if(u!==null){if(u===l.current)throw Error(s(177));l===Sn&&(zt=Sn=null,Ft=0),Oc=u,vo=l,Ko=h,_2=E,_O=x,BU(l,u,h,$,K,ie,ke)}}function BU(l,u,h,x,E,O,$){var K=u.lanes|u.childLanes;if(A2=K,K|=px,Cl(l,h,K,x,E,O),id=null,(h&335544064)===h?(od=hU(l),x=10262):(od=null,x=10256),(u.subtreeFlags&x)!==0||(u.flags&x)!==0?(l.callbackNode=null,l.callbackPriority=0,qU(nn,function(){return P2(),null})):(l.callbackNode=null,l.callbackPriority=0),Ug=!1,x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=le.T,le.T=null,E=ne.p,ne.p=2,O=sn,sn|=4;try{_U(l,u,h)}finally{sn=O,ne.p=E,le.T=x}}Bn=1,Ug?sd=dV($,l.containerInfo,od,I2,D2,FU,j2,P2,$U):(I2(),D2(),j2())}function $U(l){if(Bn!==0){var u=vo.onRecoverableError;u(l,{componentStack:null})}}function FU(){Bn===3&&(Bn=0,CO(Oc,vo),Bn=4)}function I2(){if(Bn===1){Bn=0;var l=vo,u=Oc,h=Ko,x=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||x){x=le.T,le.T=null;var E=ne.p;ne.p=2;var O=sn;sn|=4;try{xh=Wg=!1,wO(u,l,h),h=Y2;var $=x4(l.containerInfo),K=h.focusedElem,ie=h.selectionRange;if($!==K&&K&&K.ownerDocument&&b4(K.ownerDocument.documentElement,K)){if(ie!==null&&cx(K)){var de=ie.start,ge=ie.end;if(ge===void 0&&(ge=de),"selectionStart"in K)K.selectionStart=de,K.selectionEnd=Math.min(ge,K.value.length);else{var ke=K.ownerDocument||document,ce=ke&&ke.defaultView||window;if(ce.getSelection){var pe=ce.getSelection(),Fe=K.textContent.length,Qe=Math.min(ie.start,Fe),Rt=ie.end===void 0?Qe:Math.min(ie.end,Fe);!pe.extend&&Qe>Rt&&($=Rt,Rt=Qe,Qe=$);var ue=y4(K,Qe),re=y4(K,Rt);if(ue&&re&&(pe.rangeCount!==1||pe.anchorNode!==ue.node||pe.anchorOffset!==ue.offset||pe.focusNode!==re.node||pe.focusOffset!==re.offset)){var he=ke.createRange();he.setStart(ue.node,ue.offset),pe.removeAllRanges(),Qe>Rt?(pe.addRange(he),pe.extend(re.node,re.offset)):(he.setEnd(re.node,re.offset),pe.addRange(he))}}}}for(ke=[],pe=K;pe=pe.parentNode;)pe.nodeType===1&&ke.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;K<ke.length;K++){var Re=ke[K];Re.element.scrollLeft=Re.left,Re.element.scrollTop=Re.top}}gd=!!K2,Y2=K2=null}finally{sn=O,ne.p=E,le.T=x}}l.current=u,Bn=2}}function D2(){if(Bn===2){Bn=0;var l=vo,u=Oc,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=le.T,le.T=null;var x=ne.p;ne.p=2;var E=sn;sn|=4;try{gO(l,u.alternate,u)}finally{sn=E,ne.p=x,le.T=h}}Bn=3}}function j2(){if(Bn===4||Bn===3){Bn=0;var l=sd;sd=null,En();var u=vo,h=Oc,x=Ko,E=_O,O=(x&335544064)===x?10262:10256;if((h.subtreeFlags&O)!==0||(h.flags&O)!==0?Bn=5:(Bn=0,Oc=vo=null,UO(u,u.pendingLanes)),O=u.pendingLanes,O===0&&(Kl=null),fi(x),h=h.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(Wt,h,void 0,(h.current.flags&128)===128)}catch{}if(E!==null){h=le.T,O=ne.p,ne.p=2,le.T=null;try{for(var $=u.onRecoverableError,K=0;K<E.length;K++){var ie=E[K];$(ie.value,{componentStack:ie.stack})}}finally{le.T=h,ne.p=O}}if(E=id,$=od,od=null,E!==null&&(id=null,$===null&&($=[]),l!==null))for(ie=0;ie<E.length;ie++)h=(0,E[ie])($),h!==void 0&&l.finished.finally(h);(Ko&3)!==0&&i0(),Yo(u),O=u.pendingLanes,(x&261930)!==0&&(O&42)!==0?u===e0?Eh++:(Eh=0,e0=u):(Eh=0,e0=null),Ch(0)}}function UO(l,u){(l.pooledCacheLanes&=u)===0&&(u=l.pooledCache,u!=null&&(l.pooledCache=null,ih(u)))}function i0(){return sd!==null&&(sd.skipTransition(),sd=null),I2(),D2(),j2(),P2()}function P2(){if(Bn!==5)return!1;var l=vo,u=A2;A2=0;var h=fi(Ko),x=le.T,E=ne.p;try{ne.p=32>h?32:h,le.T=null,h=_2,_2=null;var O=vo,$=Ko;if(Bn=0,Oc=vo=null,Ko=0,(sn&6)!==0)throw Error(s(331));var K=sn;if(sn|=4,RO(O.current),NO(O,O.current,$,h),sn=K,Ch(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(Wt,O)}catch{}return!0}finally{ne.p=E,le.T=x,UO(l,u)}}function VO(l,u,h){u=Xi(h,u),u=e2(l.stateNode,u,2),l=$l(l,u,2),l!==null&&(Ni(l,2),Yo(l))}function hn(l,u,h){if(l.tag===3)VO(l,l,h);else for(;u!==null;){if(u.tag===3){VO(u,l,h);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Kl===null||!Kl.has(x))){l=Xi(h,l),h=$T(2),x=$l(u,h,2),x!==null&&(FT(h,x,u,l),Ni(x,2),Yo(x));break}}u=u.return}}function z2(l,u,h){var x=l.pingCache;if(x===null){x=l.pingCache=new IU;var E=new Set;x.set(u,E)}else E=x.get(u),E===void 0&&(E=new Set,x.set(u,E));E.has(h)||(R2=!0,E.add(h),l=HU.bind(null,l,u,h),u.then(l,l))}function HU(l,u,h){var x=l.pingCache;x!==null&&x.delete(u),l.pingedLanes|=l.suspendedLanes&h,l.warmLanes&=~h,Sn===l&&(Ft&h)===h&&((qn===4||qn===3&&(Ft&62914560)===Ft&&300>Mt()-Qg)&&(sn&2)===0?ld(l,0):Xg|=h,nd===Ft&&(nd=0)),Yo(l)}function qO(l,u){u===0&&(u=Es()),l=dc(l,u),l!==null&&(Ni(l,u),Yo(l))}function UU(l){var u=l.memoizedState,h=0;u!==null&&(h=u.retryLane),qO(l,h)}function VU(l,u){var h=0;switch(l.tag){case 31:case 13:var x=l.stateNode,E=l.memoizedState;E!==null&&(h=E.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(s(314))}x!==null&&x.delete(u),qO(l,h)}function qU(l,u){return ot(l,u)}var cd=null,ud=null,B2=!1,o0=!1,$2=!1,Xl=0;function Yo(l){l!==ud&&l.next===null&&(ud===null?cd=ud=l:ud=ud.next=l),o0=!0,B2||(B2=!0,GU())}function Ch(l,u){if(!$2&&o0){$2=!0;do for(var h=!1,x=cd;x!==null;){if(l!==0){var E=x.pendingLanes;if(E===0)var O=0;else{var $=x.suspendedLanes,K=x.pingedLanes;O=(1<<31-Zt(42|l)+1)-1,O&=E&~($&~K),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(h=!0,YO(x,O))}else O=Ft,O=Xe(x,x===Sn?O:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(O&3)===0||mt(x,O)||(h=!0,YO(x,O));x=x.next}while(h);$2=!1}}function WU(){WO()}function WO(){o0=B2=!1;var l=0;Xl!==0&&iV()&&(l=Xl);for(var u=Mt(),h=null,x=cd;x!==null;){var E=x.next,O=GO(x,u);O===0?(x.next=null,h===null?cd=E:h.next=E,E===null&&(ud=h)):(h=x,(l!==0||(O&3)!==0)&&(o0=!0)),x=E}Bn!==0&&Bn!==5||Ch(l),Xl!==0&&(Xl=0)}function GO(l,u){for(var h=l.suspendedLanes,x=l.pingedLanes,E=l.expirationTimes,O=l.pendingLanes&-62914561;0<O;){var $=31-Zt(O),K=1<<$,ie=E[$];ie===-1?((K&h)===0||(K&x)!==0)&&(E[$]=po(K,u)):ie<=u&&(l.expiredLanes|=K),O&=~K}if(u=Sn,h=Ft,h=Xe(l,l===u?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x=l.callbackNode,h===0||l===u&&(fn===2||fn===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&bt(x),l.callbackNode=null,l.callbackPriority=0;if((h&3)===0||mt(l,h)){if(u=h&-h,u===l.callbackPriority)return u;switch(x!==null&&bt(x),fi(h)){case 2:case 8:h=Cn;break;case 32:h=nn;break;case 268435456:h=St;break;default:h=nn}return x=KO.bind(null,l),h=ot(h,x),l.callbackPriority=u,l.callbackNode=h,u}return x!==null&&x!==null&&bt(x),l.callbackPriority=2,l.callbackNode=null,2}function KO(l,u){if(Bn!==0&&Bn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var h=l.callbackNode;if(i0()&&l.callbackNode!==h)return null;var x=Ft;return x=Xe(l,l===Sn?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x===0?null:(LO(l,x,u),GO(l,Mt()),l.callbackNode!=null&&l.callbackNode===h?KO.bind(null,l):null)}function YO(l,u){if(i0())return null;LO(l,u,!0)}function GU(){rV(function(){(sn&6)!==0?ot(rn,WU):WO()})}function F2(){if(Xl===0){var l=yc;l===0&&(l=$e,$e<<=1,($e&261888)===0&&($e=256)),Xl=l}return Xl}function XO(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:Cs(l)}function KU(l,u,h,x,E){if(u==="submit"&&h&&h.stateNode===E){var O=XO((E[as]||null).action),$=x.submitter;$&&(u=(u=$[as]||null)?XO(u.formAction):$.getAttribute("formAction"),u!==null&&(O=u,$=null));var K=new og("action","action",null,x,E);l.push({event:K,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(Xl!==0){var ie=new FormData(E,$);Yx(h,{pending:!0,data:ie,method:E.method,action:O},null,ie)}}else typeof O=="function"&&(K.preventDefault(),ie=new FormData(E,$),Yx(h,{pending:!0,data:ie,method:E.method,action:O},O,ie))},currentTarget:E}]})}}for(var H2=0;H2<hx.length;H2++){var U2=hx[H2],YU=U2.toLowerCase(),XU=U2[0].toUpperCase()+U2.slice(1);go(YU,"on"+XU)}go(w4,"onAnimationEnd"),go(E4,"onAnimationIteration"),go(C4,"onAnimationStart"),go("dblclick","onDoubleClick"),go("focusin","onFocus"),go("focusout","onBlur"),go(oU,"onTransitionRun"),go(rU,"onTransitionStart"),go(lU,"onTransitionCancel"),go(N4,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),wt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wt("onBeforeInput",["compositionend","keypress","textInput","paste"]),wt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nh="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(" "),QU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nh));function QO(l,u){u=(u&4)!==0;for(var h=0;h<l.length;h++){var x=l[h],E=x.event;x=x.listeners;e:{var O=void 0;if(u)for(var $=x.length-1;0<=$;$--){var K=x[$],ie=K.instance,de=K.currentTarget;if(K=K.listener,ie!==O&&E.isPropagationStopped())break e;O=K,E.currentTarget=de;try{O(E)}catch(ge){ag(ge)}E.currentTarget=null,O=ie}else for($=0;$<x.length;$++){if(K=x[$],ie=K.instance,de=K.currentTarget,K=K.listener,ie!==O&&E.isPropagationStopped())break e;O=K,E.currentTarget=de;try{O(E)}catch(ge){ag(ge)}E.currentTarget=null,O=ie}}}}function Bt(l,u){var h=u[sc];h===void 0&&(h=u[sc]=new Set);var x=l+"__bubble";h.has(x)||(ZO(u,l,2,!1),h.add(x))}function V2(l,u,h){var x=0;u&&(x|=4),ZO(h,l,x,u)}var r0="_reactListening"+Math.random().toString(36).slice(2);function q2(l){if(!l[r0]){l[r0]=!0,gt.forEach(function(h){h!=="selectionchange"&&(QU.has(h)||V2(h,!1,l),V2(h,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[r0]||(u[r0]=!0,V2("selectionchange",!1,u))}}function ZO(l,u,h,x){switch(FR(u)){case 2:var E=UV;break;case 8:E=VV;break;default:E=dv}h=E.bind(null,u,h,l),E=void 0,!ac||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),x?E!==void 0?l.addEventListener(u,h,{capture:!0,passive:E}):l.addEventListener(u,h,!0):E!==void 0?l.addEventListener(u,h,{passive:E}):l.addEventListener(u,h,!1)}function W2(l,u,h,x,E){var O=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var $=x.tag;if($===3||$===4){var K=x.stateNode.containerInfo;if(K===E)break;if($===4)for($=x.return;$!==null;){var ie=$.tag;if((ie===3||ie===4)&&$.stateNode.containerInfo===E)return;$=$.return}for(;K!==null;){if($=Oi(K),$===null)return;if(ie=$.tag,ie===5||ie===6||ie===26||ie===27){x=O=$;continue e}K=K.parentNode}}x=x.return}lc(function(){var de=O,ge=rc(h),ke=[];e:{var ce=T4.get(l);if(ce!==void 0){var pe=og,Fe=l;switch(l){case"keypress":if(sg(h)===0)break e;case"keydown":case"keyup":pe=DH;break;case"focusin":Fe="focus",pe=sx;break;case"focusout":Fe="blur",pe=sx;break;case"beforeblur":case"afterblur":pe=sx;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=t4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=EH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=$H;break;case w4:case E4:case C4:pe=TH;break;case N4:pe=HH;break;case"scroll":case"scrollend":pe=SH;break;case"wheel":pe=VH;break;case"copy":case"cut":case"paste":pe=RH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=s4;break;case"submit":pe=zH;break;case"toggle":case"beforetoggle":pe=WH}var Qe=(u&4)!==0,Rt=!Qe&&(l==="scroll"||l==="scrollend"),ue=Qe?ce!==null?ce+"Capture":null:ce;Qe=[];for(var re=de,he;re!==null;){var Re=re;if(he=Re.stateNode,Re=Re.tag,Re!==5&&Re!==26&&Re!==27||he===null||ue===null||(Re=Cr(re,ue),Re!=null&&Qe.push(Th(re,Re,he))),Rt)break;re=re.return}0<Qe.length&&(ce=new pe(ce,Fe,null,h,ge),ke.push({event:ce,listeners:Qe}))}}if((u&7)===0){e:{if(pe=l==="mouseover"||l==="pointerover",ce=l==="mouseout"||l==="pointerout",pe&&h!==oc&&(Fe=h.relatedTarget||h.fromElement)&&(Oi(Fe)||Fe[Ys]))break e;(ce||pe)&&(Fe=ge.window===ge?ge:(pe=ge.ownerDocument)?pe.defaultView||pe.parentWindow:window,ce?(pe=h.relatedTarget||h.toElement,ce=de,pe=pe?Oi(pe):null,pe!==null&&(Rt=o(pe),Qe=pe.tag,pe!==Rt||Qe!==5&&Qe!==27&&Qe!==6)&&(pe=null)):(ce=null,pe=de),ce!==pe&&(Qe=t4,Re="onMouseLeave",ue="onMouseEnter",re="mouse",(l==="pointerout"||l==="pointerover")&&(Qe=s4,Re="onPointerLeave",ue="onPointerEnter",re="pointer"),Rt=ce==null?Fe:me(ce),he=pe==null?Fe:me(pe),Fe=new Qe(Re,re+"leave",ce,h,ge),Fe.target=Rt,Fe.relatedTarget=he,Re=null,Oi(ge)===de&&(Qe=new Qe(ue,re+"enter",pe,h,ge),Qe.target=he,Qe.relatedTarget=Rt,Re=Qe),Rt=Re,Qe=ce&&pe?A(ce,pe,ZU):null,ce!==null&&JO(ke,Fe,ce,Qe,!1),pe!==null&&Rt!==null&&JO(ke,Rt,pe,Qe,!0)))}e:{if(ce=de?me(de):window,pe=ce.nodeName&&ce.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ce.type==="file")var Ge=d4;else if(c4(ce))if(f4)Ge=nU;else{Ge=eU;var Ht=JH}else pe=ce.nodeName,!pe||pe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?de&&ic(de.elementType)&&(Ge=d4):Ge=tU;if(Ge&&(Ge=Ge(l,de))){u4(ke,Ge,h,ge);break e}Ht&&Ht(l,ce,de)}switch(Ht=de?me(de):window,l){case"focusin":(c4(Ht)||Ht.contentEditable==="true")&&(zu=Ht,ux=de,th=null);break;case"focusout":th=ux=zu=null;break;case"mousedown":dx=!0;break;case"contextmenu":case"mouseup":case"dragend":dx=!1,v4(ke,h,ge);break;case"selectionchange":if(iU)break;case"keydown":case"keyup":v4(ke,h,ge)}var nt;if(ox)e:{switch(l){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Pu?l4(l,h)&&(ht="onCompositionEnd"):l==="keydown"&&h.keyCode===229&&(ht="onCompositionStart");ht&&(i4&&h.locale!=="ko"&&(Pu||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Pu&&(nt=JN()):(_l=ge,ex="value"in _l?_l.value:_l.textContent,Pu=!0)),Ht=l0(de,ht),0<Ht.length&&(ht=new n4(ht,l,null,h,ge),ke.push({event:ht,listeners:Ht}),nt?ht.data=nt:(nt=a4(h),nt!==null&&(ht.data=nt)))),(nt=KH?YH(l,h):XH(l,h))&&(ht=l0(de,"onBeforeInput"),0<ht.length&&(Ht=new n4("onBeforeInput","beforeinput",null,h,ge),ke.push({event:Ht,listeners:ht}),Ht.data=nt)),KU(ke,l,de,h,ge)}QO(ke,u)})}function Th(l,u,h){return{instance:l,listener:u,currentTarget:h}}function l0(l,u){for(var h=u+"Capture",x=[];l!==null;){var E=l,O=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||O===null||(E=Cr(l,h),E!=null&&x.unshift(Th(l,E,O)),E=Cr(l,u),E!=null&&x.push(Th(l,E,O))),l.tag===3)return x;l=l.return}return[]}function ZU(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function JO(l,u,h,x,E){for(var O=u._reactName,$=[];h!==null&&h!==x;){var K=h,ie=K.alternate,de=K.stateNode;if(K=K.tag,ie!==null&&ie===x)break;K!==5&&K!==26&&K!==27||de===null||(ie=de,E?(de=Cr(h,O),de!=null&&$.unshift(Th(h,de,ie))):E||(de=Cr(h,O),de!=null&&$.push(Th(h,de,ie)))),h=h.return}$.length!==0&&l.push({event:u,listeners:$})}var JU=/\r\n?/g,eV=/\u0000|\uFFFD/g;function eR(l){return(typeof l=="string"?l:""+l).replace(JU,`
50
+ `).replace(eV,"")}function tR(l,u){return u=eR(u),eR(l)===u}function pn(l,u,h,x,E,O){switch(h){case"children":if(typeof x=="string")u==="body"||u==="textarea"&&x===""||Xs(l,x);else if(typeof x=="number"||typeof x=="bigint")u!=="body"&&Xs(l,""+x);else return;break;case"className":Ri(l,"class",x);break;case"tabIndex":Ri(l,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(l,h,x);break;case"style":Ai(l,x,O);return;case"data":if(u!=="object"){Ri(l,"data",x);break}case"src":case"href":if(x===""&&(u!=="a"||h!=="href")){l.removeAttribute(h);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(h);break}x=Cs(x),l.setAttribute(h,x);break;case"action":case"formAction":if(typeof x=="function"){l.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(h==="formAction"?(u!=="input"&&pn(l,u,"name",E.name,E,null),pn(l,u,"formEncType",E.formEncType,E,null),pn(l,u,"formMethod",E.formMethod,E,null),pn(l,u,"formTarget",E.formTarget,E,null)):(pn(l,u,"encType",E.encType,E,null),pn(l,u,"method",E.method,E,null),pn(l,u,"target",E.target,E,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(h);break}x=Cs(x),l.setAttribute(h,x);break;case"onClick":x!=null&&(l.onclick=Qs);return;case"onScroll":x!=null&&Bt("scroll",l);return;case"onScrollEnd":x!=null&&Bt("scrollend",l);return;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(s(61));if(h=x.__html,h!=null){if(E.children!=null)throw Error(s(60));(O!=null?O.__html:void 0)!==h&&(l.innerHTML=h)}}break;case"multiple":l.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":l.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){l.removeAttribute("xlink:href");break}h=Cs(x),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(h,x):l.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(h,""):l.removeAttribute(h);break;case"capture":case"download":x===!0?l.setAttribute(h,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(h,x):l.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?l.setAttribute(h,x):l.removeAttribute(h);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?l.removeAttribute(h):l.setAttribute(h,x);break;case"popover":Bt("beforetoggle",l),Bt("toggle",l),zn(l,"popover",x);break;case"xlinkActuate":Qn(l,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Qn(l,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Qn(l,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Qn(l,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Qn(l,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Qn(l,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Qn(l,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Qn(l,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Qn(l,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":zn(l,"is",x);break;case"innerText":case"textContent":return;default:if(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")h=Wf.get(h)||h,zn(l,h,x);else return}dt=!0}function G2(l,u,h,x,E,O){switch(h){case"style":Ai(l,x,O);return;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(s(61));if(h=x.__html,h!=null){if(E.children!=null)throw Error(s(60));(O!=null?O.__html:void 0)!==h&&(l.innerHTML=h)}}break;case"children":if(typeof x=="string")Xs(l,x);else if(typeof x=="number"||typeof x=="bigint")Xs(l,""+x);else return;break;case"onScroll":x!=null&&Bt("scroll",l);return;case"onScrollEnd":x!=null&&Bt("scrollend",l);return;case"onClick":x!=null&&(l.onclick=Qs);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!pt.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(E=h.endsWith("Capture"),O=h.slice(2,E?h.length-7:void 0),u=l[as]||null,u=u!=null?u[h]:null,typeof u=="function"&&l.removeEventListener(O,u,E),typeof x=="function")){typeof u!="function"&&u!==null&&(h in l?l[h]=null:l.hasAttribute(h)&&l.removeAttribute(h)),l.addEventListener(O,x,E);break e}dt=!0,h in l?l[h]=x:x===!0?l.setAttribute(h,""):zn(l,h,x)}return}dt=!0}function As(l,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",l),Bt("load",l);var x=!1,E=!1,O;for(O in h)if(h.hasOwnProperty(O)){var $=h[O];if($!=null)switch(O){case"src":x=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,u));default:pn(l,u,O,$,h,null)}}E&&pn(l,u,"srcSet",h.srcSet,h,null),x&&pn(l,u,"src",h.src,h,null);return;case"input":Bt("invalid",l);var K=O=$=E=null,ie=null,de=null;for(x in h)if(h.hasOwnProperty(x)){var ge=h[x];if(ge!=null)switch(x){case"name":E=ge;break;case"type":$=ge;break;case"checked":ie=ge;break;case"defaultChecked":de=ge;break;case"value":O=ge;break;case"defaultValue":K=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,u));break;default:pn(l,u,x,ge,h,null)}}kl(l,O,K,ie,de,$,E,!1);return;case"select":Bt("invalid",l),x=$=O=null;for(E in h)if(h.hasOwnProperty(E)&&(K=h[E],K!=null))switch(E){case"value":O=K;break;case"defaultValue":$=K;break;case"multiple":x=K;default:pn(l,u,E,K,h,null)}u=O,h=$,l.multiple=!!x,u!=null?pi(l,!!x,u,!1):h!=null&&pi(l,!!x,h,!0);return;case"textarea":Bt("invalid",l),O=E=x=null;for($ in h)if(h.hasOwnProperty($)&&(K=h[$],K!=null))switch($){case"value":x=K;break;case"defaultValue":E=K;break;case"children":O=K;break;case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(91));break;default:pn(l,u,$,K,h,null)}ki(l,x,E,O);return;case"option":for(ie in h)if(h.hasOwnProperty(ie)&&(x=h[ie],x!=null))switch(ie){case"selected":l.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:pn(l,u,ie,x,h,null)}return;case"dialog":Bt("beforetoggle",l),Bt("toggle",l),Bt("cancel",l),Bt("close",l);break;case"iframe":case"object":Bt("load",l);break;case"video":case"audio":for(x=0;x<Nh.length;x++)Bt(Nh[x],l);break;case"image":Bt("error",l),Bt("load",l);break;case"details":Bt("toggle",l);break;case"embed":case"source":case"link":Bt("error",l),Bt("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in h)if(h.hasOwnProperty(de)&&(x=h[de],x!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,u));default:pn(l,u,de,x,h,null)}return;default:if(ic(u)){for(ge in h)h.hasOwnProperty(ge)&&(x=h[ge],x!==void 0&&G2(l,u,ge,x,h,void 0));return}}for(K in h)h.hasOwnProperty(K)&&(x=h[K],x!=null&&pn(l,u,K,x,h,null))}var tV={};function nV(l,u,h,x){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,O=null,$=null,K=null,ie=null,de=null,ge=null;for(pe in h){var ke=h[pe];if(h.hasOwnProperty(pe)&&ke!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":ie=ke;default:x.hasOwnProperty(pe)||pn(l,u,pe,null,x,ke)}}for(var ce in x){var pe=x[ce];if(ke=h[ce],x.hasOwnProperty(ce)&&(pe!=null||ke!=null))switch(ce){case"type":pe!==ke&&(dt=!0),O=pe;break;case"name":pe!==ke&&(dt=!0),E=pe;break;case"checked":pe!==ke&&(dt=!0),de=pe;break;case"defaultChecked":pe!==ke&&(dt=!0),ge=pe;break;case"value":pe!==ke&&(dt=!0),$=pe;break;case"defaultValue":pe!==ke&&(dt=!0),K=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,u));break;default:pe!==ke&&pn(l,u,ce,pe,x,ke)}}$s(l,$,K,ie,de,ge,O,E);return;case"select":pe=$=K=ce=null;for(O in h)if(ie=h[O],h.hasOwnProperty(O)&&ie!=null)switch(O){case"value":break;case"multiple":pe=ie;default:x.hasOwnProperty(O)||pn(l,u,O,null,x,ie)}for(E in x)if(O=x[E],ie=h[E],x.hasOwnProperty(E)&&(O!=null||ie!=null))switch(E){case"value":O!==ie&&(dt=!0),ce=O;break;case"defaultValue":O!==ie&&(dt=!0),K=O;break;case"multiple":O!==ie&&(dt=!0),$=O;default:O!==ie&&pn(l,u,E,O,x,ie)}u=K,h=$,x=pe,ce!=null?pi(l,!!h,ce,!1):!!x!=!!h&&(u!=null?pi(l,!!h,u,!0):pi(l,!!h,h?[]:"",!1));return;case"textarea":pe=ce=null;for(K in h)if(E=h[K],h.hasOwnProperty(K)&&E!=null&&!x.hasOwnProperty(K))switch(K){case"value":break;case"children":break;default:pn(l,u,K,null,x,E)}for($ in x)if(E=x[$],O=h[$],x.hasOwnProperty($)&&(E!=null||O!=null))switch($){case"value":E!==O&&(dt=!0),ce=E;break;case"defaultValue":E!==O&&(dt=!0),pe=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:E!==O&&pn(l,u,$,E,x,O)}ju(l,ce,pe);return;case"option":for(var Fe in h)if(ce=h[Fe],h.hasOwnProperty(Fe)&&ce!=null&&!x.hasOwnProperty(Fe))switch(Fe){case"selected":l.selected=!1;break;default:pn(l,u,Fe,null,x,ce)}for(ie in x)if(ce=x[ie],pe=h[ie],x.hasOwnProperty(ie)&&ce!==pe&&(ce!=null||pe!=null))switch(ie){case"selected":ce!==pe&&(dt=!0),l.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:pn(l,u,ie,ce,x,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Qe in h)ce=h[Qe],h.hasOwnProperty(Qe)&&ce!=null&&!x.hasOwnProperty(Qe)&&pn(l,u,Qe,null,x,ce);for(de in x)if(ce=x[de],pe=h[de],x.hasOwnProperty(de)&&ce!==pe&&(ce!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,u));break;default:pn(l,u,de,ce,x,pe)}return;default:if(ic(u)){for(var Rt in h)ce=h[Rt],h.hasOwnProperty(Rt)&&ce!==void 0&&!x.hasOwnProperty(Rt)&&G2(l,u,Rt,void 0,x,ce);for(ge in x)ce=x[ge],pe=h[ge],!x.hasOwnProperty(ge)||ce===pe||ce===void 0&&pe===void 0||G2(l,u,ge,ce,x,pe);return}}for(var ue in h)ce=h[ue],h.hasOwnProperty(ue)&&ce!=null&&!x.hasOwnProperty(ue)&&pn(l,u,ue,null,x,ce);for(ke in x)ce=x[ke],pe=h[ke],!x.hasOwnProperty(ke)||ce===pe||ce==null&&pe==null||pn(l,u,ke,ce,x,pe)}function nR(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sV(){if(typeof performance.getEntriesByType=="function"){for(var l=0,u=0,h=performance.getEntriesByType("resource"),x=0;x<h.length;x++){var E=h[x],O=E.transferSize,$=E.initiatorType,K=E.duration;if(O&&K&&nR($)){for($=0,K=E.responseEnd,x+=1;x<h.length;x++){var ie=h[x],de=ie.startTime;if(de>K)break;var ge=ie.transferSize,ke=ie.initiatorType;ge&&nR(ke)&&(ie=ie.responseEnd,$+=ge*(ie<K?1:(K-de)/(ie-de)))}if(--x,u+=8*(O+$)/(E.duration/1e3),l++,10<l)break}}if(0<l)return u/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var K2=null,Y2=null;function Oh(l){return l.nodeType===9?l:l.ownerDocument}function sR(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iR(l,u){if(l===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&u==="foreignObject"?0:l}function oR(l,u,h,x){return h=Oh(h).createElement(l),h[Rn]=x,h[as]=u,As(h,l,u),De(h),h}function X2(l,u){return l==="textarea"||l==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Q2=null;function iV(){var l=window.event;return l&&l.type==="popstate"?l===Q2?!1:(Q2=l,!0):(Q2=null,!1)}var Z2=typeof setTimeout=="function"?setTimeout:void 0,oV=typeof clearTimeout=="function"?clearTimeout:void 0,rR=typeof Promise=="function"?Promise:void 0,lR=typeof requestAnimationFrame=="function"?requestAnimationFrame:Z2,rV=typeof queueMicrotask=="function"?queueMicrotask:typeof rR<"u"?function(l){return rR.resolve(null).then(l).catch(lV)}:Z2;function lV(l){setTimeout(function(){throw l})}function Ql(l){return l==="head"}function aR(l,u){var h=u,x=0;do{var E=h.nextSibling;if(l.removeChild(h),E&&E.nodeType===8)if(h=E.data,h==="/$"||h==="/&"){if(x===0){l.removeChild(E),yd(u);return}x--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")x++;else if(h==="html")rv(l.ownerDocument.documentElement);else if(h==="head"){h=l.ownerDocument.head,rv(h);for(var O=h.firstChild;O;){var $=O.nextSibling,K=O.nodeName;O[Sr]||K==="SCRIPT"||K==="STYLE"||K==="LINK"&&O.rel.toLowerCase()==="stylesheet"||h.removeChild(O),O=$}}else h==="body"&&rv(l.ownerDocument.body);h=E}while(h);yd(u)}function cR(l,u){var h=l;l=0;do{var x=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),x&&x.nodeType===8)if(h=x.data,h==="/$"){if(l===0)break;l--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||l++;h=x}while(h)}function uR(l,u,h){if(u=CSS.escape(u)!==u?"r-"+btoa(u).replace(/=/g,""):u,l.style.viewTransitionName=u,h!=null&&(l.style.viewTransitionClass=h),h=getComputedStyle(l),h.display==="inline"){if(u=l.getClientRects(),u.length===1)var x=1;else for(var E=x=0;E<u.length;E++){var O=u[E];0<O.width&&0<O.height&&x++}x===1&&(l=l.style,l.display=u.length===1?"inline-block":"block",l.marginTop="-"+h.paddingTop,l.marginBottom="-"+h.paddingBottom)}}function dR(l,u){l=l.style,u=u.style;var h=u!=null?u.hasOwnProperty("viewTransitionName")?u.viewTransitionName:u.hasOwnProperty("view-transition-name")?u["view-transition-name"]:null:null;l.viewTransitionName=h==null||typeof h=="boolean"?"":(""+h).trim(),h=u!=null?u.hasOwnProperty("viewTransitionClass")?u.viewTransitionClass:u.hasOwnProperty("view-transition-class")?u["view-transition-class"]:null:null,l.viewTransitionClass=h==null||typeof h=="boolean"?"":(""+h).trim(),l.display==="inline-block"&&(u==null?l.display=l.margin="":(h=u.display,l.display=h==null||typeof h=="boolean"?"":h,h=u.margin,h!=null?l.margin=h:(h=u.hasOwnProperty("marginTop")?u.marginTop:u["margin-top"],l.marginTop=h==null||typeof h=="boolean"?"":h,u=u.hasOwnProperty("marginBottom")?u.marginBottom:u["margin-bottom"],l.marginBottom=u==null||typeof u=="boolean"?"":u)))}function aV(l,u,h){return h=h.ownerDocument.defaultView,{rect:l,abs:u.position==="absolute"||u.position==="fixed",clip:u.clipPath!=="none"||u.overflow!=="visible"||u.filter!=="none"||u.mask!=="none"||u.mask!=="none"||u.borderRadius!=="0px",view:0<=l.bottom&&0<=l.right&&l.top<=h.innerHeight&&l.left<=h.innerWidth}}function J2(l){var u=l.getBoundingClientRect(),h=getComputedStyle(l);return aV(u,h,l)}function cV(l){return l.documentElement.clientHeight}function uV(l){this.addEventListener("load",l),this.addEventListener("error",l)}function dV(l,u,h,x,E,O,$,K,ie){var de=u.nodeType===9?u:u.ownerDocument;try{var ge=de.startViewTransition({update:function(){var ce=de.defaultView,pe=ce.navigation&&ce.navigation.transition,Fe=de.fonts.status;x();var Qe=[];if(Fe==="loaded"&&(cV(de),de.fonts.status==="loading"&&Qe.push(de.fonts.ready)),Fe=Qe.length,l!==null)for(var Rt=l.suspenseyImages,ue=0,re=0;re<Rt.length;re++){var he=Rt[re];if(!he.complete){var Re=he.getBoundingClientRect();if(0<Re.bottom&&0<Re.right&&Re.top<ce.innerHeight&&Re.left<ce.innerWidth){if(ue+=MR(he),ue>u0){Qe.length=Fe;break}he=new Promise(uV.bind(he)),Qe.push(he)}}}if(0<Qe.length)return ce=Promise.race([Promise.all(Qe),new Promise(function(Ge){return setTimeout(Ge,500)})]).then(E,E),(pe?Promise.allSettled([pe.finished,ce]):ce).then(O,O);if(E(),pe)return pe.finished.then(O,O);O()},types:h});de.__reactViewTransition=ge;var ke=[];return ge.ready.then(function(){for(var ce=de.documentElement.getAnimations({subtree:!0}),pe=0;pe<ce.length;pe++){var Fe=ce[pe],Qe=Fe.effect,Rt=Qe.pseudoElement;if(Rt!=null&&Rt.startsWith("::view-transition")){ke.push(Fe),Fe=Qe.getKeyframes();for(var ue=Rt=void 0,re=!0,he=0;he<Fe.length;he++){var Re=Fe[he],Ge=Re.width;if(Rt===void 0)Rt=Ge;else if(Rt!==Ge){re=!1;break}if(Ge=Re.height,ue===void 0)ue=Ge;else if(ue!==Ge){re=!1;break}delete Re.width,delete Re.height,Re.transform==="none"&&delete Re.transform}re&&Rt!==void 0&&ue!==void 0&&(Qe.setKeyframes(Fe),re=getComputedStyle(Qe.target,Qe.pseudoElement),re.width!==Rt||re.height!==ue)&&(re=Fe[0],re.width=Rt,re.height=ue,re=Fe[Fe.length-1],re.width=Rt,re.height=ue,Qe.setKeyframes(Fe))}}$()},function(ce){de.__reactViewTransition===ge&&(de.__reactViewTransition=null);try{if(typeof ce=="object"&&ce!==null)switch(ce.name){case"InvalidStateError":(ce.message==="View transition was skipped because document visibility state is hidden."||ce.message==="Skipping view transition because document visibility state has become hidden."||ce.message==="Skipping view transition because viewport size changed."||ce.message==="Transition was aborted because of invalid state")&&(ce=null)}ce!==null&&ie(ce)}finally{x(),E(),$()}}),ge.finished.finally(function(){for(var ce=0;ce<ke.length;ce++)ke[ce].cancel();de.__reactViewTransition===ge&&(de.__reactViewTransition=null),K()}),ge}catch{return x(),E(),$(),null}}function Rc(l,u){this._scope=document.documentElement,this._selector="::view-transition-"+l+"("+u+")"}Rc.prototype.animate=function(l,u){return u=typeof u=="number"?{duration:u}:k({},u),u.pseudoElement=this._selector,this._scope.animate(l,u)},Rc.prototype.getAnimations=function(){for(var l=this._scope,u=this._selector,h=l.getAnimations({subtree:!0}),x=[],E=0;E<h.length;E++){var O=h[E].effect;O!==null&&O.target===l&&O.pseudoElement===u&&x.push(h[E])}return x},Rc.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function fR(l){return{name:l,group:new Rc("group",l),imagePair:new Rc("image-pair",l),old:new Rc("old",l),new:new Rc("new",l)}}function zi(l){this._fragmentFiber=l,this._observers=this._eventListeners=null}zi.prototype.addEventListener=function(l,u,h){var x=null,E=null;if(!(h!=null&&typeof h!="boolean"&&(x=h.signal||null,x!==null&&x.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var O=this._eventListeners;if(pR(O,l,u,h)===-1){var $=this,K=u;h!=null&&typeof h!="boolean"&&h.once===!0&&(K=function(ie){$.removeEventListener(l,u,h),typeof u=="function"?u.call(this,ie):u.handleEvent(ie)}),x!==null&&(E=$.removeEventListener.bind($,l,u,h),x.addEventListener("abort",E,{once:!0}),E=x.removeEventListener.bind(x,"abort",E)),x=dd(h),O.push({type:l,listener:u,optionsOrUseCapture:h,attachedListener:K,cleanup:E}),p(this._fragmentFiber.child,!1,fV,l,K,x)}this._eventListeners=O}};function fV(l,u,h,x){return S(l).addEventListener(u,h,x),!1}zi.prototype.removeEventListener=function(l,u,h){var x=this._eventListeners;if(x!==null&&(u=pR(x,l,u,h),u!==-1)){var E=x[u];h=E.attachedListener;var O=E.cleanup;E=dd(E.optionsOrUseCapture),p(this._fragmentFiber.child,!1,hV,l,h,E),x.splice(u,1),O!==null&&O()}};function hV(l,u,h,x){return S(l).removeEventListener(u,h,x),!1}function dd(l){return l!=null&&typeof l!="boolean"&&(l.once===!0||l.signal instanceof AbortSignal)?{capture:l.capture,passive:l.passive}:l}function hR(l){return l==null?"c=0":typeof l=="boolean"?"c="+(l?"1":"0"):"c="+(l.capture?"1":"0")}function pR(l,u,h,x){if(l.length===0)return-1;x=hR(x);for(var E=0;E<l.length;E++){var O=l[E];if(O.type===u&&O.listener===h&&hR(O.optionsOrUseCapture)===x)return E}return-1}zi.prototype.dispatchEvent=function(l){var u=m(this._fragmentFiber);if(u===null)return!0;u=S(u);var h=this._eventListeners;if(h!==null&&0<h.length||!l.bubbles){var x=u.nodeType===9?u.createComment(""):document.createTextNode("");if(h)for(var E=0;E<h.length;E++){var O=h[E];x.addEventListener(O.type,O.attachedListener,dd(O.optionsOrUseCapture))}if(u.appendChild(x),l=x.dispatchEvent(l),h)for(E=0;E<h.length;E++)O=h[E],x.removeEventListener(O.type,O.attachedListener,dd(O.optionsOrUseCapture));return u.removeChild(x),l}return u.dispatchEvent(l)},zi.prototype.focus=function(l){p(this._fragmentFiber.child,!0,mR,l,void 0,void 0)};function mR(l,u){return l.tag===6?!1:(l=S(l),NV(l,u))}zi.prototype.focusLast=function(l){var u=[];p(this._fragmentFiber.child,!0,ev,u,void 0,void 0);for(var h=u.length-1;0<=h&&!mR(u[h],l);h--);};function ev(l,u){return u.push(l),!1}zi.prototype.blur=function(){var l=m(this._fragmentFiber);l!==null&&(l=S(l),l=Oh(l).activeElement,l!==null&&p(this._fragmentFiber.child,!1,pV,l,void 0,void 0))};function pV(l,u){return l.tag===6?!1:(l=S(l),l===u||l.contains(u)?(u.blur(),!0):!1)}zi.prototype.observeUsing=function(l){this._observers===null&&(this._observers=new Set),this._observers.add(l),p(this._fragmentFiber.child,!1,mV,l,void 0,void 0)};function mV(l,u){return l.tag===6||(l=S(l),u.observe(l)),!1}zi.prototype.unobserveUsing=function(l){var u=this._observers;if(u!==null&&u.has(l)){u.delete(l),p(this._fragmentFiber.child,!1,gV,l,void 0,void 0);for(var h=u=0;h<So.length;h++){var x=So[h];x.fragmentInstance===this&&x.observer===l?l.unobserve(x.instance):So[u++]=x}So.length=u}};function gV(l,u){return l.tag===6||(l=S(l),u.unobserve(l)),!1}var So=[],tv=!1;function yV(l,u,h){So.push({fragmentInstance:l,observer:u,instance:h}),tv||(tv=!0,TV(function(){tv=!1;var x=So;So=[];for(var E=0;E<x.length;E++){var O=x[E];O.observer.unobserve(O.instance)}}))}zi.prototype.getClientRects=function(){var l=[];return p(this._fragmentFiber.child,!1,bV,l,void 0,void 0),l};function bV(l,u){if(l.tag===6){l=l.stateNode;var h=l.ownerDocument.createRange();h.selectNodeContents(l),u.push.apply(u,h.getClientRects())}else l=S(l),u.push.apply(u,l.getClientRects());return!1}zi.prototype.getRootNode=function(l){var u=m(this._fragmentFiber);return u===null?this:S(u).getRootNode(l)},zi.prototype.compareDocumentPosition=function(l){var u=m(this._fragmentFiber);if(u===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var h=[];p(this._fragmentFiber.child,!1,ev,h,void 0,void 0);var x=S(u);if(h.length===0){if(h=x,g(this._fragmentFiber)){e:{for(u=this._fragmentFiber.return;u!==null;){if(u.tag===4){u=u.stateNode.containerInfo;break e}if(u.tag===3||u.tag===5||u.tag===27)break;u=u.return}u=null}u!=null&&(h=u)}u=this._fragmentFiber;var E=x=h.compareDocumentPosition(l);return h===l?E=Node.DOCUMENT_POSITION_CONTAINS:x&Node.DOCUMENT_POSITION_CONTAINED_BY&&(h=y(u)[1],h===null?E=Node.DOCUMENT_POSITION_PRECEDING:(l=S(h).compareDocumentPosition(l),E=l===0||l&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),E|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}u=S(h[0]),E=S(h[h.length-1]);var O=g(this._fragmentFiber)?u.parentElement:x;if(O==null)return Node.DOCUMENT_POSITION_DISCONNECTED;x=O.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY,O=O.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY;var $=u.compareDocumentPosition(l),K=E.compareDocumentPosition(l),ie=$&Node.DOCUMENT_POSITION_CONTAINED_BY||K&Node.DOCUMENT_POSITION_CONTAINED_BY;return K=x&&O&&$&Node.DOCUMENT_POSITION_FOLLOWING&&K&Node.DOCUMENT_POSITION_PRECEDING,u=x&&u===l||O&&E===l||ie||K?Node.DOCUMENT_POSITION_CONTAINED_BY:!x&&u===l||!O&&E===l?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:$,u&Node.DOCUMENT_POSITION_DISCONNECTED||u&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||xV(u,this._fragmentFiber,h[0],h[h.length-1],l)?u:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function xV(l,u,h,x,E){var O=Oi(E);if(l&Node.DOCUMENT_POSITION_CONTAINED_BY){if(h=!!O)e:{for(;O!==null;){if(O.tag===7&&(O===u||O.alternate===u)){h=!0;break e}O=O.return}h=!1}return h}if(l&Node.DOCUMENT_POSITION_CONTAINS){if(O===null)return O=E.ownerDocument,E===O||E===O.documentElement||E===O.body;e:{for(O=u,u=m(u);O!==null;){if(!(O.tag!==5&&O.tag!==3&&O.tag!==27||O!==u&&O.alternate!==u)){O=!0;break e}O=O.return}O=!1}return O}return l&Node.DOCUMENT_POSITION_PRECEDING?((u=!!O)&&!(u=O===h)&&(u=A(h,O,R),u===null?u=!1:(p(u,!0,C,O,h),O=w,w=null,u=O!==null)),u):l&Node.DOCUMENT_POSITION_FOLLOWING?((u=!!O)&&!(u=O===x)&&(u=A(x,O,R),u===null?u=!1:(p(u,!0,T,O,x),O=w,N=w=null,u=O!==null)),u):!1}function gR(l,u){var h=l.ownerDocument.createRange();h.selectNodeContents(l),l=h.getBoundingClientRect(),window.scrollTo(window.scrollX+l.left,u?window.scrollY+l.top:window.scrollY+l.bottom-window.innerHeight)}zi.prototype.scrollIntoView=function(l){if(typeof l=="object")throw Error(s(566));var u=[];p(this._fragmentFiber.child,!1,ev,u,void 0,void 0);var h=l!==!1;if(u.length===0){var x=y(this._fragmentFiber);if(x=h?x[1]||x[0]||m(this._fragmentFiber):x[0]||x[1],x===null)return;if(x.tag===6){l=S(x),gR(l,h);return}if(x=S(x),x.nodeType!==9){if(x.nodeType===11){h="host"in x?x.host:null,h!==null&&h.scrollIntoView(l);return}x.scrollIntoView(l)}}for(x=h?u.length-1:0;x!==(h?-1:u.length);){var E=u[x];E.tag===6?(E=S(E),gR(E,h)):S(E).scrollIntoView(l),x+=h?-1:1}};function vV(l,u){return l=S(l),yR(l,u),!1}function yR(l,u){l.reactFragments==null&&(l.reactFragments=new Set),l.reactFragments.add(u)}function bR(l,u){var h=u._eventListeners;if(h!==null)for(var x=0;x<h.length;x++){var E=h[x];l.addEventListener(E.type,E.attachedListener,dd(E.optionsOrUseCapture))}l.nodeType!==3&&(h=u._observers,h!==null&&h.forEach(function(O){for(var $=0,K=0;K<So.length;K++){var ie=So[K];(ie.fragmentInstance!==u||ie.observer!==O||ie.instance!==l)&&(So[$++]=ie)}So.length=$,O.observe(l)}),yR(l,u))}function SV(l,u){var h=u._eventListeners;if(h!==null)for(var x=0;x<h.length;x++){var E=h[x];l.removeEventListener(E.type,E.attachedListener,dd(E.optionsOrUseCapture))}l.nodeType!==3&&(h=u._observers,h!==null&&h.forEach(function(O){typeof O.rootMargin=="string"?yV(u,O,l):O.unobserve(l)}),l.reactFragments!=null&&l.reactFragments.delete(u))}function nv(l){var u=l.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":nv(h),Rl(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}l.removeChild(h)}}function wV(l,u,h,x){for(;l.nodeType===1;){var E=h;if(l.nodeName.toLowerCase()!==u.toLowerCase()){if(!x&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(x){if(!l[Sr])switch(u){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(O=l.getAttribute("rel"),O==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(O!==E.rel||l.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||l.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||l.getAttribute("title")!==(E.title==null?null:E.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(O=l.getAttribute("src"),(O!==(E.src==null?null:E.src)||l.getAttribute("type")!==(E.type==null?null:E.type)||l.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&O&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(u==="input"&&l.type==="hidden"){var O=E.name==null?null:""+E.name;if(E.type==="hidden"&&l.getAttribute("name")===O)return l}else return l;if(l=to(l.nextSibling),l===null)break}return null}function EV(l,u,h){if(u==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!h||(l=to(l.nextSibling),l===null))return null;return l}function xR(l,u){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!u||(l=to(l.nextSibling),l===null))return null;return l}function sv(l){return l.data==="$?"||l.data==="$~"}function iv(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function CV(l,u){var h=l.ownerDocument;if(l.data==="$~")l._reactRetry=u;else if(l.data!=="$?"||h.readyState!=="loading")u();else{var x=function(){u(),h.removeEventListener("DOMContentLoaded",x)};h.addEventListener("DOMContentLoaded",x),l._reactRetry=x}}function to(l){for(;l!=null;l=l.nextSibling){var u=l.nodeType;if(u===1||u===3)break;if(u===8){if(u=l.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return l}var ov=null;function vR(l){l=l.nextSibling;for(var u=0;l;){if(l.nodeType===8){var h=l.data;if(h==="/$"||h==="/&"){if(u===0)return to(l.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}l=l.nextSibling}return null}function SR(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var h=l.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return l;u--}else h!=="/$"&&h!=="/&"||u++}l=l.previousSibling}return null}function NV(l,u){function h(){x=!0}if(l.ownerDocument.activeElement===l)return!0;var x=!1;try{l.ownerDocument.addEventListener("focus",h,!0),(l.focus||HTMLElement.prototype.focus).call(l,u)}finally{l.ownerDocument.removeEventListener("focus",h,!0)}return x}function TV(l){lR(function(){lR(function(u){return l(u)})})}function wR(l,u,h){switch(u=Oh(h),l){case"html":if(l=u.documentElement,!l)throw Error(s(452));return l;case"head":if(l=u.head,!l)throw Error(s(453));return l;case"body":if(l=u.body,!l)throw Error(s(454));return l;default:throw Error(s(451))}}function ER(l,u,h){for(var x in h){var E=h[x];h.hasOwnProperty(x)&&E!=null&&pn(l,u,x,null,tV,E)}h.dangerouslySetInnerHTML!=null&&(l.textContent=""),l.onclick===Qs&&(l.onclick=null),Rl(l)}function rv(l){for(var u=l.attributes;u.length;)l.removeAttributeNode(u[0]);Rl(l)}var no=new Map,CR=new Set;function Rh(l){if(typeof l.getRootNode=="function"){var u=l.getRootNode();if(u.nodeType===9||u.nodeType===11)return u}return l.nodeType===9?l:l.ownerDocument}var jr=ne.d;ne.d={f:OV,r:RV,D:kV,C:AV,L:_V,m:MV,X:IV,S:LV,M:DV};function OV(){var l=jr.f(),u=t0();return l||u}function RV(l){var u=wr(l);u!==null&&u.tag===5&&u.type==="form"?TT(u):jr.r(l)}var fd=typeof document>"u"?null:document;function NR(l,u,h){var x=fd;if(x&&typeof u=="string"&&u){var E=kn(u);E='link[rel="'+l+'"][href="'+E+'"]',typeof h=="string"&&(E+='[crossorigin="'+h+'"]'),CR.has(E)||(CR.add(E),l={rel:l,crossOrigin:h,href:u},x.querySelector(E)===null&&(u=x.createElement("link"),As(u,"link",l),De(u),x.head.appendChild(u)))}}function kV(l){jr.D(l),NR("dns-prefetch",l,null)}function AV(l,u){jr.C(l,u),NR("preconnect",l,u)}function _V(l,u,h){jr.L(l,u,h);var x=fd;if(x&&l&&u){var E='link[rel="preload"][as="'+kn(u)+'"]';u==="image"&&h&&h.imageSrcSet?(E+='[imagesrcset="'+kn(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(E+='[imagesizes="'+kn(h.imageSizes)+'"]')):E+='[href="'+kn(l)+'"]';var O=E;switch(u){case"style":O=hd(l);break;case"script":O=pd(l)}if(!(no.has(O)||(l=k({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:l,as:u},h),no.set(O,l),x.querySelector(E)!==null||u==="style"&&x.querySelector(kh(O))||u==="script"&&x.querySelector(Ah(O))))){var $=x.createElement("link");As($,"link",l),u==="style"&&($[Ol]=!0,$.onload=$.onerror=function(){Je($)}),De($),x.head.appendChild($)}}}function MV(l,u){jr.m(l,u);var h=fd;if(h&&l){var x=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+kn(x)+'"][href="'+kn(l)+'"]',O=E;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=pd(l)}if(!no.has(O)&&(l=k({rel:"modulepreload",href:l},u),no.set(O,l),h.querySelector(E)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Ah(O)))return}x=h.createElement("link"),As(x,"link",l),De(x),h.head.appendChild(x)}}}function LV(l,u,h){jr.S(l,u,h);var x=fd;if(x&&l){var E=Le(x).hoistableStyles,O=hd(l);u=u||"default";var $=E.get(O);if(!$){var K={loading:0,preload:null};if($=x.querySelector(kh(O)))K.loading=5;else{l=k({rel:"stylesheet",href:l,"data-precedence":u},h),(h=no.get(O))&&lv(l,h);var ie=$=x.createElement("link");De(ie),As(ie,"link",l),ie._p=new Promise(function(de,ge){ie.onload=de,ie.onerror=ge}),ie.addEventListener("load",function(){K.loading|=1}),ie.addEventListener("error",function(){K.loading|=2}),K.loading|=4,a0($,u,x)}$={type:"stylesheet",instance:$,count:1,state:K},E.set(O,$)}}}function IV(l,u){jr.X(l,u);var h=fd;if(h&&l){var x=Le(h).hoistableScripts,E=pd(l),O=x.get(E);O||(O=h.querySelector(Ah(E)),O||(l=k({src:l,async:!0},u),(u=no.get(E))&&av(l,u),O=h.createElement("script"),De(O),As(O,"link",l),h.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},x.set(E,O))}}function DV(l,u){jr.M(l,u);var h=fd;if(h&&l){var x=Le(h).hoistableScripts,E=pd(l),O=x.get(E);O||(O=h.querySelector(Ah(E)),O||(l=k({src:l,async:!0,type:"module"},u),(u=no.get(E))&&av(l,u),O=h.createElement("script"),De(O),As(O,"link",l),h.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},x.set(E,O))}}function TR(l,u,h,x){var E=(E=Me.current)?Rh(E):null;if(!E)throw Error(s(446));switch(l){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(h=hd(h.href),u=Le(E).hoistableStyles,x=u.get(h),x||(x={type:"style",instance:null,count:0,state:null},u.set(h,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){l=hd(h.href);var O=Le(E).hoistableStyles,$=O.get(l);if($||(E=E.ownerDocument||E,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(l,$),(O=E.querySelector(kh(l)))?O._p||($.instance=O,$.state.loading=5):(O=no.get(l),O||(O={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},no.set(l,O)),jV(E,l,O,$.state))),u&&x===null)throw Error(s(528,""));return $}if(u&&x!==null)throw Error(s(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(h=pd(h),u=Le(E).hoistableScripts,x=u.get(h),x||(x={type:"script",instance:null,count:0,state:null},u.set(h,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,l))}}function hd(l){return'href="'+kn(l)+'"'}function kh(l){return'link[rel="stylesheet"]['+l+"]"}function OR(l){return k({},l,{"data-precedence":l.precedence,precedence:null})}function jV(l,u,h,x){if(u=l.querySelector('link[rel="preload"][as="style"]['+u+"]")){if(u[Ol]!==!0){x.loading=1;return}}else u=l.createElement("link"),u[Ol]=!0,u.onload=u.onerror=Je.bind(null,u),As(u,"link",h),De(u),l.head.appendChild(u);x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2})}function pd(l){return'[src="'+kn(l)+'"]'}function Ah(l){return"script[async]"+l}function RR(l,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var x=l.querySelector('style[data-href~="'+kn(h.href)+'"]');if(x)return u.instance=x,De(x),x;var E=k({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return x=(l.ownerDocument||l).createElement("style"),De(x),As(x,"style",E),a0(x,h.precedence,l),u.instance=x;case"stylesheet":E=hd(h.href);var O=l.querySelector(kh(E));if(O)return u.state.loading|=4,u.instance=O,De(O),O;x=OR(h),(E=no.get(E))&&lv(x,E),O=(l.ownerDocument||l).createElement("link"),De(O);var $=O;return $._p=new Promise(function(K,ie){$.onload=K,$.onerror=ie}),As(O,"link",x),u.state.loading|=4,a0(O,h.precedence,l),u.instance=O;case"script":return O=pd(h.src),(E=l.querySelector(Ah(O)))?(u.instance=E,De(E),E):(x=h,(E=no.get(O))&&(x=k({},h),av(x,E)),l=l.ownerDocument||l,E=l.createElement("script"),De(E),As(E,"link",x),l.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(s(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,a0(x,h.precedence,l));return u.instance}function a0(l,u,h){for(var x=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=x.length?x[x.length-1]:null,O=E,$=0;$<x.length;$++){var K=x[$];if(K.dataset.precedence===u)O=K;else if(O!==E)break}O?O.parentNode.insertBefore(l,O.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(l,u.firstChild))}function lv(l,u){l.crossOrigin==null&&(l.crossOrigin=u.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=u.referrerPolicy),l.title==null&&(l.title=u.title)}function av(l,u){l.crossOrigin==null&&(l.crossOrigin=u.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=u.referrerPolicy),l.integrity==null&&(l.integrity=u.integrity)}var c0=null;function kR(l,u,h){if(c0===null){var x=new Map,E=c0=new Map;E.set(h,x)}else E=c0,x=E.get(h),x||(x=new Map,E.set(h,x));if(x.has(l))return x;for(x.set(l,null),h=h.getElementsByTagName(l),E=0;E<h.length;E++){var O=h[E];if(!(O[Sr]||O[Rn]||l==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var $=O.getAttribute(u)||"";$=l+$;var K=x.get($);K?K.push(O):x.set($,[O])}}return x}function cv(l,u,h){l=l.ownerDocument||l,l.head.insertBefore(h,u==="title"?l.querySelector("head > title"):null)}function PV(l,u,h){if(h===1||u.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return l=u.disabled,typeof u.precedence=="string"&&l==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function AR(l,u){return l==="img"&&u.src!=null&&u.src!==""&&u.onLoad==null&&u.loading!=="lazy"}function _R(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function MR(l){return(l.width||100)*(l.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function LR(l,u){typeof u.decode=="function"&&(l.imgCount++,u.complete||(l.imgBytes+=MR(u),l.suspenseyImages.push(u)),l=$V.bind(l),u.decode().then(l,l))}function zV(l,u,h,x){if(h.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var E=hd(x.href),O=u.querySelector(kh(E));if(O){u=O._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(l.count++,l=_h.bind(l),u.then(l,l)),h.state.loading|=4,h.instance=O,De(O);return}O=u.ownerDocument||u,x=OR(x),(E=no.get(E))&&lv(x,E),O=O.createElement("link"),De(O);var $=O;$._p=new Promise(function(K,ie){$.onload=K,$.onerror=ie}),As(O,"link",x),h.instance=O}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(l.count++,h=_h.bind(l),u.addEventListener("load",h),u.addEventListener("error",h))}}var u0=0;function BV(l,u){return l.stylesheets&&l.count===0&&f0(l,l.stylesheets),0<l.count||0<l.imgCount?function(h){var x=setTimeout(function(){if(l.stylesheets&&f0(l,l.stylesheets),l.unsuspend){var O=l.unsuspend;l.unsuspend=null,O()}},6e4+u);0<l.imgBytes&&u0===0&&(u0=62500*sV());var E=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&f0(l,l.stylesheets),l.unsuspend)){var O=l.unsuspend;l.unsuspend=null,O()}},(l.imgBytes>u0?50:800)+u);return l.unsuspend=h,function(){l.unsuspend=null,clearTimeout(x),clearTimeout(E)}}:null}function IR(l){if(l.count===0&&(l.imgCount===0||!l.waitingForImages)){if(l.stylesheets)f0(l,l.stylesheets);else if(l.unsuspend){var u=l.unsuspend;l.unsuspend=null,u()}}}function _h(){this.count--,IR(this)}function $V(){this.imgCount--,IR(this)}var d0=null;function f0(l,u){l.stylesheets=null,l.unsuspend!==null&&(l.count++,d0=new Map,u.forEach(FV,l),d0=null,_h.call(l))}function FV(l,u){if(!(u.state.loading&4)){var h=d0.get(l);if(h)var x=h.get(null);else{h=new Map,d0.set(l,h);for(var E=l.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<E.length;O++){var $=E[O];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(h.set($.dataset.precedence,$),x=$)}x&&h.set(null,x)}E=u.instance,$=E.getAttribute("data-precedence"),O=h.get($)||x,O===x&&h.set(null,E),h.set($,E),this.count++,x=_h.bind(this),E.addEventListener("load",x),E.addEventListener("error",x),O?O.parentNode.insertBefore(E,O.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(E,l.firstChild)),u.state.loading|=4}}var md={$$typeof:F,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function HV(l,u,h,x,E,O,$,K,ie){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zo(0),this.hiddenUpdates=zo(null),this.identifierPrefix=x,this.onUncaughtError=E,this.onCaughtError=O,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.transitionTypes=null,this.incompleteTransitions=new Map}function DR(l,u,h,x,E,O,$,K,ie,de,ge,ke){return l=new HV(l,u,h,$,ie,de,ge,ke,K),u=1,O===!0&&(u|=24),O=mi(3,null,null,u),l.current=O,O.stateNode=l,u=Cx(),u.refCount++,l.pooledCache=u,u.refCount++,O.memoizedState={element:x,isDehydrated:h,cache:u},Rx(O),l}function jR(l){return l?(l=Fu,l):Fu}function PR(l,u,h,x,E,O){E=jR(E),x.context===null?x.context=E:x.pendingContext=E,x=Bl(u),x.payload={element:h},O=O===void 0?null:O,O!==null&&(x.callback=O),h=$l(l,x,u),h!==null&&(xi(h,l,u),ah(h,l,u))}function zR(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var h=l.retryLane;l.retryLane=h!==0&&h<u?h:u}}function uv(l,u){zR(l,u),(l=l.alternate)&&zR(l,u)}function BR(l){if(l.tag===13||l.tag===31){var u=dc(l,67108864);u!==null&&xi(u,l,67108864),uv(l,67108864)}}function $R(l){if(l.tag===13||l.tag===31){var u=Pi();u=mo(u);var h=dc(l,u);h!==null&&xi(h,l,u),uv(l,u)}}var gd=!0;function UV(l,u,h,x){var E=le.T;le.T=null;var O=ne.p;try{ne.p=2,dv(l,u,h,x)}finally{ne.p=O,le.T=E}}function VV(l,u,h,x){var E=le.T;le.T=null;var O=ne.p;try{ne.p=8,dv(l,u,h,x)}finally{ne.p=O,le.T=E}}function dv(l,u,h,x){if(gd){var E=fv(x);if(E===null)W2(l,u,x,h0,h),HR(l,x);else if(WV(E,l,u,h,x))x.stopPropagation();else if(HR(l,x),u&4&&-1<qV.indexOf(l)){for(;E!==null;){var O=wr(E);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var $=Ie(O.pendingLanes);if($!==0){var K=O;for(K.pendingLanes|=2,K.entangledLanes|=2;$;){var ie=1<<31-Zt($);K.entanglements[1]|=ie,$&=~ie}Yo(O),(sn&6)===0&&(Zg=Mt()+500,Ch(0))}}break;case 31:case 13:K=dc(O,2),K!==null&&xi(K,O,2),t0(),uv(O,2)}if(O=fv(x),O===null&&W2(l,u,x,h0,h),O===E)break;E=O}E!==null&&x.stopPropagation()}else W2(l,u,x,null,h)}}function fv(l){return l=rc(l),hv(l)}var h0=null;function hv(l){if(h0=null,l=Oi(l),l!==null){var u=o(l);if(u===null)l=null;else{var h=u.tag;if(h===13){if(l=r(u),l!==null)return l;l=null}else if(h===31){if(l=a(u),l!==null)return l;l=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null)}}return h0=l,null}function FR(l){switch(l){case"beforetoggle":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"seeked":case"submit":case"toggle":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"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jt()){case rn:return 2;case Cn:return 8;case nn:case st:return 32;case St:return 268435456;default:return 32}default:return 32}}var pv=!1,Zl=null,Jl=null,ea=null,Mh=new Map,Lh=new Map,ta=[],qV="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".split(" ");function HR(l,u){switch(l){case"focusin":case"focusout":Zl=null;break;case"dragenter":case"dragleave":Jl=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":Mh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lh.delete(u.pointerId)}}function Ih(l,u,h,x,E,O){return l===null||l.nativeEvent!==O?(l={blockedOn:u,domEventName:h,eventSystemFlags:x,nativeEvent:O,targetContainers:[E]},u!==null&&(u=wr(u),u!==null&&BR(u)),l):(l.eventSystemFlags|=x,u=l.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),l)}function WV(l,u,h,x,E){switch(u){case"focusin":return Zl=Ih(Zl,l,u,h,x,E),!0;case"dragenter":return Jl=Ih(Jl,l,u,h,x,E),!0;case"mouseover":return ea=Ih(ea,l,u,h,x,E),!0;case"pointerover":var O=E.pointerId;return Mh.set(O,Ih(Mh.get(O)||null,l,u,h,x,E)),!0;case"gotpointercapture":return O=E.pointerId,Lh.set(O,Ih(Lh.get(O)||null,l,u,h,x,E)),!0}return!1}function UR(l){var u=Oi(l.target);if(u!==null){var h=o(u);if(h!==null){if(u=h.tag,u===13){if(u=r(h),u!==null){l.blockedOn=u,xr(l.priority,function(){$R(h)});return}}else if(u===31){if(u=a(h),u!==null){l.blockedOn=u,xr(l.priority,function(){$R(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){l.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}l.blockedOn=null}function p0(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var h=fv(l.nativeEvent);if(h===null){h=l.nativeEvent;var x=new h.constructor(h.type,h);oc=x,h.target.dispatchEvent(x),oc=null}else return u=wr(h),u!==null&&BR(u),l.blockedOn=h,!1;u.shift()}return!0}function VR(l,u,h){p0(l)&&h.delete(u)}function GV(){pv=!1,Zl!==null&&p0(Zl)&&(Zl=null),Jl!==null&&p0(Jl)&&(Jl=null),ea!==null&&p0(ea)&&(ea=null),Mh.forEach(VR),Lh.forEach(VR)}function m0(l,u){l.blockedOn===u&&(l.blockedOn=null,pv||(pv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,GV)))}var g0=null;function qR(l){g0!==l&&(g0=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){g0===l&&(g0=null);for(var u=0;u<l.length;u+=3){var h=l[u],x=l[u+1],E=l[u+2];if(typeof x!="function"){if(hv(x||h)===null)continue;break}var O=wr(h);O!==null&&(l.splice(u,3),u-=3,Yx(O,{pending:!0,data:E,method:h.method,action:x},x,E))}}))}function yd(l){function u(ie){return m0(ie,l)}Zl!==null&&m0(Zl,l),Jl!==null&&m0(Jl,l),ea!==null&&m0(ea,l),Mh.forEach(u),Lh.forEach(u);for(var h=0;h<ta.length;h++){var x=ta[h];x.blockedOn===l&&(x.blockedOn=null)}for(;0<ta.length&&(h=ta[0],h.blockedOn===null);)UR(h),h.blockedOn===null&&ta.shift();if(h=(l.ownerDocument||l).$$reactFormReplay,h!=null)for(x=0;x<h.length;x+=3){var E=h[x],O=h[x+1],$=E[as]||null;if(typeof O=="function")$||qR(h);else if($){var K=null;if(O&&O.hasAttribute("formAction")){if(E=O,$=O[as]||null)K=$.formAction;else if(hv(E)!==null)continue}else K=$.action;typeof K=="function"?h[x+1]=K:(h.splice(x,3),x-=3),qR(h)}}}function WR(){function l(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function($){return E=$})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),x||setTimeout(h,20)}function h(){if(!x&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,E=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){x=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function mv(l){this._internalRoot=l}y0.prototype.render=mv.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(s(409));var h=u.current,x=Pi();PR(h,x,l,u,null,null)},y0.prototype.unmount=mv.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;PR(l.current,2,null,l,null,null),t0(),u[Ys]=null}};function y0(l){this._internalRoot=l}y0.prototype.unstable_scheduleHydration=function(l){if(l){var u=hi();l={blockedOn:null,target:l,priority:u};for(var h=0;h<ta.length&&u!==0&&u<ta[h].priority;h++);ta.splice(h,0,l),h===0&&UR(l)}};var GR=e.version;if(GR!=="19.3.0")throw Error(s(527,GR,"19.3.0"));ne.findDOMNode=function(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(s(188)):(l=Object.keys(l).join(","),Error(s(268,l)));return l=d(u),l=l!==null?f(l):null,l=l===null?null:l.stateNode,l};var KV={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var b0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b0.isDisabled&&b0.supportsFiber)try{Wt=b0.inject(KV),_t=b0}catch{}}return jh.createRoot=function(l,u){if(!i(l))throw Error(s(299));var h=!1,x="",E=jT,O=PT,$=zT;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&($=u.onRecoverableError)),u=DR(l,1,!1,null,null,h,x,null,E,O,$,WR),l[Ys]=u.current,q2(l),new mv(u)},jh.hydrateRoot=function(l,u,h){if(!i(l))throw Error(s(299));var x=!1,E="",O=jT,$=PT,K=zT,ie=null;return h!=null&&(h.unstable_strictMode===!0&&(x=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onUncaughtError!==void 0&&(O=h.onUncaughtError),h.onCaughtError!==void 0&&($=h.onCaughtError),h.onRecoverableError!==void 0&&(K=h.onRecoverableError),h.formState!==void 0&&(ie=h.formState)),u=DR(l,1,!0,u,h??null,x,E,ie,O,$,K,WR),u.context=jR(null),h=u.current,x=Pi(),x=mo(x),E=Bl(x),E.callback=null,$l(h,E,x),h=x,u.current.lanes=h,Ni(u,h),Yo(u),l[Ys]=u.current,q2(l),new y0(u)},jh.version="19.3.0",jh}var hk;function qq(){if(hk)return xv.exports;hk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),xv.exports=Vq(),xv.exports}var Wq=qq();const pk=!1;var mk=_.use,dC=_.useLayoutEffect;function Ba(t){return t[t.length-1]}function l6(t,e){return typeof t=="function"?t(e):t}const fC=Object.prototype.hasOwnProperty;function a6(t){for(const e in t)if(fC.call(t,e))return!0;return!1}const f1=()=>Object.create(null),bd=(t,e)=>Ra(t,e,!0);function Ra(t,e,n,s=0){if(t===e)return t;if(s++>500)return e;const i=Array.isArray(t)&&Array.isArray(e);if(!i&&!(j1(t)&&j1(e)))return e;const o=Object.keys(t),r=o.length,a=Object.keys(e),c=a.length;if(i?r!==t.length||c!==e.length||r&&Ba(o)!==`${r-1}`||c&&Ba(a)!==`${c-1}`:r!==Object.getOwnPropertyNames(t).length||c!==Object.getOwnPropertyNames(e).length||Object.getOwnPropertySymbols(e).length)return e;let d=0,f,p,m;if(i){for(;d<c&&(m=d,p=t[m],f=e[m],f=p===f?p:typeof p=="object"?Ra(p,f,n,s):f,f===p);d++);if(d===c&&r===c)return t}else{let y=r===c,v=!0;for(;d<c;d++){m=a[d],p=t[m];const S=e[m];f=p===S?p:typeof p=="object"?Ra(p,S,n,s):S,y&&(y=f===p&&(o[d]===m||fC.call(t,m))),v&&(v=Object.is(f,S)),o[d]=f}if(y)return Object.getOwnPropertySymbols(t).length?e:t;if(v)return e}const g=i?a.fill(0):n?f1():{};for(let y=0;y<c;y++)m=i?y:a[y],i?(p=t[m],y>d&&(f=e[m],f=p===f?p:typeof p=="object"?Ra(p,f,n,s):f),g[m]=y<d?p:f):g[m]=o[y];return g}function j1(t){var e;return!t||typeof t!="object"?!1:(((e=Object.getPrototypeOf(t))==null?void 0:e.constructor)??Object)===Object}function Jr(t,e,n,s){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let i=0,o=t.length;i<o;i++){const r=t[i],a=e[i];if(r!==a&&!Jr(r,a,n,s))return!1}return!0}if(j1(t)&&j1(e)){if(n){for(const o in e)if((s||e[o]!==void 0)&&!Jr(t[o],e[o],n,s))return!1;return!0}let i=0;if(s)i=Object.keys(t).length;else for(const o in t)t[o]!==void 0&&i++;for(const o in e)if((s||e[o]!==void 0)&&(i--===0||!Jr(t[o],e[o],n,s)))return!1;return i===0}return!1}function Gq(t){return typeof(t==null?void 0:t.message)!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}const Kq=/[\x00-\x1f\x7f"<>`{}]/g;function Yq(t){return t.replace(Kq,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function gk(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Yq(e)}const Xq=["http:","https:","mailto:","tel:"];function Cp(t){var e,n;if(t[0]!=="/"&&t.includes(":"))return(n=(e=/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(t))==null?void 0:e[1])==null?void 0:n.replace(/[\t\n\r]/g,"").toLowerCase()}const c6=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function u6(t,e){if(!t)return!1;if(c6.test(t))return!0;const n=Cp(t);return n?!e.has(n):!1}function Ph(t){if(!t)return t;let e=t;if(/[%\\\x00-\x1f\x7f]/.test(t)){const n=/%25|%5C/gi;let s=0,i;for(e="";(i=n.exec(t))!==null;)e+=gk(t.slice(s,i.index))+i[0],s=n.lastIndex;e+=gk(s?t.slice(s):t)}return e}function Qq(t){return/[\s\u0080-\uFFFF]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}function Zq(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function hC(){throw new Error("Invariant failed")}function Dd(t){return t.replace(/\/{2,}/g,"/")}function d6(t){return t==="/"?t:t.replace(/^\/+/,"")}function or(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/+$/,""):t}function f6(t){return or(d6(t))}function yk(t,e){return t!=null&&t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function bk(t,e,n="never",s){if(e.includes("//")&&(e=Dd(e)),e.startsWith("/"))return e.length===1||n==="preserve"?e:n==="always"?e.endsWith("/")?e:`${e}/`:e.endsWith("/")?e.slice(0,-1):e;const i=e===".";let o;if(s){o=i?t:t+"\0"+e;const d=s.get(o);if(d)return d}let r;if(i)r=t.split("/");else{for(t.includes("//")&&(t=Dd(t)),r=t.split("/");r.length>1&&Ba(r)==="";)r.pop();const d=e.split("/");for(let f=0,p=d.length;f<p;f++){const m=d[f];m===""?f?f===p-1&&r.push(m):r=[m]:m===".."?r.length>1?r.pop():r=[""]:m==="."||r.push(m)}}r.length>1&&(Ba(r)===""?n==="never"&&r.pop():n==="always"&&r.push(""));const a=r.join("/"),c=(i?Dd(a):a)||"/";return o&&s&&s.set(o,c),c}function Jq(t){const e=new Map(t.map(s=>[encodeURIComponent(s),s])),n=new RegExp([...e.keys()].join("|").replace(/[.*()]/g,"\\$&"),"g");return s=>s.replace(n,i=>e.get(i)??i)}function eW(t){return t==null||t===""}function tW(t,e,n){if(typeof e!="string")return""+(e??void 0);const s=t==="_splat";if(s&&(!e||/^[a-zA-Z0-9\-._~!/]*$/.test(e)))return e;let i=encodeURIComponent(e);return s&&(i=i.replaceAll("%2F","/")),n?n(i):i}function xk(t,e,n,s,i){const o=t.endsWith("/")?"/":"";let r="";for(const a of e){if(typeof a=="string"){r+=a;continue}const[c,d,f,p]=a,m=c===2,g=m&&p!==void 0?p+o:p;let y=n[d];if(!(c===3&&y==null)){if(i&&(i[d]=y,m&&(i["*"]=y)),m&&eW(y)){if(f==="/"&&!g)continue;y=""}r+=f+tW(d,y,s)+(g||"")}}return r+o||"/"}function uf(t){return(t==null?void 0:t.isNotFound)===!0}function nW(){try{return sessionStorage}catch{return}}const sW="tsr-scroll-restoration-v1_3",jd=nW();function iW(){try{return JSON.parse((jd==null?void 0:jd.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function oW(){try{jd==null||jd.setItem(sW,JSON.stringify(la))}catch{}}const la=iW(),vk="data-scroll-restoration-id",rW=t=>t.state.__TSR_key||t.href;function lW(t){const e=t.getAttribute(vk);if(e)return`[${vk}="${e}"]`;let n="",s=t,i;for(;i=s.parentNode;){let o=1,r=s;for(;r=r.previousElementSibling;)o++;const a=`${s.localName}:nth-child(${o})`;n=n?`${a} > ${n}`:a,s=i}return n}let S0=!1;const h1="window";function iw(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}function Sk(t){const e=new Set;for(const n of t){if(n===h1)continue;const s=iw(n);s&&e.add(s)}return e}function aW(t,e){const n=t.options.scrollRestoration,s=t._scroll;n&&(s.restoring=!0);const i=t.options.getScrollRestorationKey||rW,o=new Set,r=a=>{const c=la[a]||(la[a]={});for(const d of o)d===document?c[h1]={scrollX,scrollY}:d.isConnected&&(c[lW(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})};n&&!s.restoration&&(s.restoration=!0,S0=!1,history.scrollRestoration="manual",document.addEventListener("scroll",a=>{S0||o.add(a.target)},!0),t.subscribe("onBeforeLoad",a=>{a.fromLocation&&r(i(a.fromLocation)),o.clear()}),addEventListener("pagehide",()=>{r(i(t.stores.resolvedLocation.get()??t.stores.location.get())),oW()})),!s.reset&&(s.reset=!0,t.subscribe("onRendered",a=>{var v;const c=t.options.scrollRestorationBehavior,d=t.options.scrollToTopSelectors,f=s.next,p=s.hash;let m;if(o.clear(),s.next=!0,s.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;const g=i(a.toLocation),y=a.fromLocation&&i(a.fromLocation);if(s.restoring&&y&&y!==g){const S=la[y];if(S){let w=la[g];for(const N in S){if(N===h1){if(f)continue}else{const C=iw(N);if(!C||f&&d&&(m??(m=Sk(d)),m.has(C)))continue}w||(w=la[g]={}),w[N]??(w[N]=S[N])}}}S0=!0;try{const S=a.toLocation.hash,w=a.toLocation.state.__hashScrollIntoViewOptions??!0;let N=!1;if(f){!S&&d&&(m??(m=Sk(d)));const C=S&&w&&p,T=s.restoring?la[g]:void 0;if(T)for(const R in T){const{scrollX:A,scrollY:k}=T[R];if(R===h1){if(C)continue;scrollTo({top:k,left:A,behavior:c}),N=!0}else{const M=iw(R);M&&(M.scrollLeft=A,M.scrollTop=k,m==null||m.delete(M))}}if(!S){const R={top:0,left:0,behavior:c};if(N||scrollTo(R),m)for(const A of m)A.scrollTo(R)}}!N&&S&&w&&((v=document.getElementById(S))==null||v.scrollIntoView(w))}finally{S0=!1}}))}function cW(t,e=String){let n;for(const s in t){const i=t[s];i!==void 0&&(n||(n=new URLSearchParams)).set(s,e(i))}return n?n.toString():""}function Ev(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function uW(t){const e=new URLSearchParams(t),n=Object.create(null);for(const[s,i]of e.entries()){const o=n[s];o==null?n[s]=Ev(i):Array.isArray(o)?o.push(Ev(i)):n[s]=[o,Ev(i)]}return n}const h6=/^(?:\s|["[{\d-]|fa|nu|tr)/,dW=hW(JSON.parse),fW=pW(JSON.stringify,JSON.parse);function hW(t){const e=t===JSON.parse;return n=>{n[0]==="?"&&(n=n.substring(1));const s=uW(n);for(const i in s){const o=s[i];if(typeof o=="string"){if(e&&!h6.test(o))continue;try{s[i]=t(o)}catch{}}}return s}}function pW(t,e){const n=e===JSON.parse;function s(i){if(i&&typeof i=="object")try{return t(i)}catch{}else if(e&&typeof i=="string"){if(n&&!h6.test(i))return i;try{return e(i),t(i)}catch{}}return i}return i=>{const o=cW(i,s);return o?`?${o}`:""}}const Pd="__root__";function Py(t){t.statusCode=t.statusCode||t.code||307;const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function p6(t){return t instanceof Response&&!!t.options}function P1(t){const e=new Map;let n,s;return{get(i){const o=e.get(i);if(o)return o.visited=!0,o.value},set(i,o){const r=e.get(i);if(r){r.value=o;return}if(e.size>=t){let c=n==null?void 0:n.next().value;for(;!c||c.visited;)c?c.visited=!1:n=e.values(),c=n.next().value;c===s&&(n=void 0),e.delete(c.key)}const a={key:i,value:o,visited:!1};s=a,e.set(i,a)},clear(){e.clear(),n=void 0,s=void 0}}}const Ea=4,m6=5;function mW(t){const e=t.names;if(e)return e;const n=[];for(const s of t)typeof s!="string"&&n.push(s[1]);return t.names=n}function gW(t,e,n){const s=t.substring(e,n);if(s.charCodeAt(0)===36)return s.length===1?[2,"_splat","",void 0]:[1,s.substring(1),"",""];const i=s.indexOf("{");if(i>=0){const o=s.indexOf("}",i),r=s.charCodeAt(i+1)===45,a=i+(r?3:2);if(o>=0&&s.charCodeAt(a-1)===36&&(!r||a<o)){const c=s.substring(a,o);return[r?3:c?1:2,c||"_splat",s.substring(0,i),t.substring(e+o+1,c?n:t.length)]}}return s}function Np(t,e,n,s,i,o){var w,N;let r=n;const a=e.fullPath??e.from,c=e.options,d=a.length,f=a.endsWith("/")?d-1:d,p=(c==null?void 0:c.caseSensitive)??t,m=((w=c==null?void 0:c.params)==null?void 0:w.parse)??(c==null?void 0:c.parseParams);let g,y=o?n-1:0;if(!s||a.includes("$")){g=(o==null?void 0:o.slice())??[];const C=Ba(g);C&&typeof C!="string"&&C[0]===2&&(g[g.length-1]=[C[0],C[1],C[2],C[3]===void 0?void 0:C[3]+a.substring(n-(a[n-2]==="/"?2:1),f)],y=d)}for(;r<d;){const C=r,T=a.indexOf("/",C);let R=T===-1?d:T;const A=gW(a,C,R);r=R+1;let k;if(typeof A=="string"){if(!s)continue;let M=A,L;p?L=s.static??(s.static=new Map):(M=A.toLowerCase(),L=s.staticInsensitive??(s.staticInsensitive=new Map));const j=L.get(M);if(j)k=j;else{const D=zc(s);k=D,L.set(M,D)}}else{const M=A[0];let L=A[2],j=A[3]??"";if(M===2&&(R=d,r=R+1),g&&y<R&&(y<C-1&&g.push(a.substring(y,C-1)),A[2]="/"+L,M===2&&A[3]!==void 0&&f<d&&(A[3]=j.slice(0,-1)),g.push(A),y=R),!s)continue;const D=p&&!!(L||j);p||(L=L.toLowerCase(),j=j.toLowerCase());const P=M===1?s.dynamic??(s.dynamic=[]):M===3?s.optional??(s.optional=[]):s.wildcard??(s.wildcard=[]),B=M!==2&&!m&&P.find(I=>!I.parse&&I.caseSensitive===D&&I.prefix===L&&I.suffix===j);if(B)k=B;else{const I=zc(s,M,D,L,j);k=I,P.push(I),P.length===2&&(i==null||i.push(P))}}s=k}g&&y<f&&g.push(a.substring(y,f));const v=g==null?void 0:g.slice();if(!s)return v;if(m&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){const C=zc(s,m6);(s.pathless??(s.pathless=[])).push(C),s=C}const S=(e.path||!e.children)&&!e.isRoot;if(S&&f<d){const C=zc(s,Ea);s.index=C,s=C}return s.parse=m??null,s.priority=((N=c==null?void 0:c.params)==null?void 0:N.priority)??0,s.route||(s.data=v,S&&(s.route=e)),[s,r,v]}function g6(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function zc(t,e=0,n,s,i){return{kind:e,depth:t?t.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:t,parse:null,priority:0,caseSensitive:n,prefix:s,suffix:i}}function yW(t,e){const n=zc(),s=[];function i(o,r,a,c){const[d,f,p]=Np(!1,o,r,a,s,c);if(o.children)for(const m of o.children)i(m,f,d,p)}for(const o of t)i(o,1,n);for(const o of s)o.sort(g6);e.masksTree=n,e.flatCache=P1(1e3)}function bW(t,e){t||(t="/");const n=e.flatCache.get(t);if(n!==void 0)return n;const s=pC(t,e.masksTree);return e.flatCache.set(t,s),s}function xW(t,e,n,s,i){t||(t="/"),s||(s="/");const o=e?`case\0${t}`:t;let r=i.singleCache.get(o);return r||(r=zc(),Np(e,{from:t},1,r),i.singleCache.set(o,r)),pC(s,r,n)}function vW(t,e,n=!1){const s=n?t:`nofuzz\0${t}`,i=e.matchCache.get(s);if(i!==void 0)return i;t||(t="/");let o;try{o=pC(t,e.segmentTree,n)}catch(r){if(r instanceof URIError)o=null;else throw r}return o&&(o.branch=b6(o.route)),e.matchCache.set(s,o),o}function SW(t,e=!1){const n=zc(),s=[],i={},o={};let r=0;function a(c,d,f,p){if(c.init(r),c.id in i&&hC(),i[c.id]=c,r!==0&&c.path){const v=or(c.fullPath);(!o[v]||c.fullPath.endsWith("/"))&&(o[v]=c)}r++;const[m,g,y]=Np(e,c,d,f,s,p);if(c._interpolation=y,c.children)for(const v of c.children)a(v,g,m,y)}a(t,1,n);for(const c of s)c.sort(g6);return{processedTree:{segmentTree:n,singleCache:P1(1e3),matchCache:P1(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:o}}function pC(t,e,n=!1){const s=t.split("/"),i=EW(t,s,e,n);if(!i)return null;const[o]=y6(t,s,i);return{route:i.node.route,rawParams:o}}function y6(t,e,n){var f,p,m,g;const s=wW(n.node),i=n.node.data&&mW(n.node.data),o=Object.create(null);let r=((f=n.extract)==null?void 0:f.part)??0,a=((p=n.extract)==null?void 0:p.node)??0,c=((m=n.extract)==null?void 0:m.path)??0,d=((g=n.extract)==null?void 0:g.param)??0;for(;a<s.length;r++,a++,c++){const y=s[a];if(y.kind===Ea)break;if(y.kind===m6){r--,c--;continue}const v=e[r],S=c;if(v&&(c+=v.length),y.kind===1||y.kind===3){const w=i[d++];if(y.kind===3&&n.skipped&1<<a){r--,c=S-1;continue}const N=y.suffix||y.prefix?v.substring(y.prefix.length,v.length-y.suffix.length):v;(N||y.kind===1)&&(o[w]=decodeURIComponent(N))}else if(y.kind===2){const w=y,N=t.substring(S+w.prefix.length,t.length-w.suffix.length),C=decodeURIComponent(N);o["*"]=C,o._splat=C;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:r,node:a,path:c,param:d}]}function b6(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function wW(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function EW(t,e,n,s){if(t==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ba(e),o=i&&t!=="/",r=e.length-(i?1:0),a=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}];let c=null,d=null;for(;a.length;){const f=a.pop(),{node:p,index:m,skipped:g,statics:y,dynamics:v,optionals:S}=f;let{extract:w,rawParams:N}=f;if(p.kind===2&&p.route&&!E0(d,f))continue;if(p.parse){if(!wk(t,e,f))continue;N=f.rawParams,w=f.extract}s&&p.route&&p.kind!==Ea&&E0(c,f)&&(c=f);const C=m===r;if(C&&(p.route&&(!o||p.kind===Ea||p.kind===2)&&E0(d,f)&&(d=f),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const T=C?void 0:e[m];let R;if(C&&p.index){const A={node:p.index,index:m,skipped:g,statics:y,dynamics:v,optionals:S,extract:w,rawParams:N};let k=!0;if(p.index.parse&&(wk(t,e,A)||(k=!1)),k){if(!v&&!S&&!g&&CW(y,r))return A;E0(d,A)&&(d=A)}}if(p.wildcard)for(let A=p.wildcard.length-1;A>=0;A--){const k=p.wildcard[A],{prefix:M,suffix:L}=k;if(!(M&&(C||!(k.caseSensitive?T:R??(R=T.toLowerCase())).startsWith(M)))){if(L){if(C)continue;const j=e.slice(m).join("/"),D=j.slice(-L.length);if((k.caseSensitive?D:D.toLowerCase())!==L||j.length-L.length<M.length)continue}a.push({node:k,index:r,skipped:g,statics:y,dynamics:v,optionals:S,extract:w,rawParams:N})}}if(p.optional){const A=g|1<<p.depth+1;for(let k=p.optional.length-1;k>=0;k--){const M=p.optional[k];a.push({node:M,index:m,skipped:A,statics:y,dynamics:v,optionals:S,extract:w,rawParams:N})}if(!C)for(let k=p.optional.length-1;k>=0;k--){const M=p.optional[k],{prefix:L,suffix:j}=M;if(L||j){const D=M.caseSensitive?T:R??(R=T.toLowerCase());if(L&&!D.startsWith(L)||j&&D.indexOf(j,D.length-j.length)<L.length)continue}a.push({node:M,index:m+1,skipped:g,statics:y,dynamics:v,optionals:S+w0(r,m),extract:w,rawParams:N})}}if(!C&&p.dynamic&&T)for(let A=p.dynamic.length-1;A>=0;A--){const k=p.dynamic[A],{prefix:M,suffix:L}=k;if(M||L){const j=k.caseSensitive?T:R??(R=T.toLowerCase());if(M&&!j.startsWith(M)||L&&j.indexOf(L,j.length-L.length)<M.length)continue}a.push({node:k,index:m+1,skipped:g,statics:y,dynamics:v+w0(r,m),optionals:S,extract:w,rawParams:N})}if(!C&&p.staticInsensitive){const A=p.staticInsensitive.get(R??(R=T.toLowerCase()));A&&a.push({node:A,index:m+1,skipped:g,statics:y+w0(r,m),dynamics:v,optionals:S,extract:w,rawParams:N})}if(!C&&p.static){const A=p.static.get(T);A&&a.push({node:A,index:m+1,skipped:g,statics:y+w0(r,m),dynamics:v,optionals:S,extract:w,rawParams:N})}if(p.pathless)for(let A=p.pathless.length-1;A>=0;A--){const k=p.pathless[A];a.push({node:k,index:m,skipped:g,statics:y,dynamics:v,optionals:S,extract:w,rawParams:N})}}if(d)return d;if(s&&c){let f=c.index;for(let m=0;m<c.index;m++)f+=e[m].length;const p=f===t.length?"/":t.slice(f);return c.rawParams??(c.rawParams=Object.create(null)),c.rawParams["**"]=decodeURIComponent(p),c}return null}function w0(t,e){return 2**(t-e-1)}function CW(t,e){return t===2**(e-1)-1}function wk(t,e,n){let s,i;try{[s,i]=y6(t,e,n)}catch{return null}if(n.rawParams=s,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(s)===!1)return null}catch{}return!0}function E0(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Ea)>(t.node.kind===Ea)||e.node.kind===Ea==(t.node.kind===Ea)&&e.node.depth>t.node.depth))):!0}function NW(t,e,n){const s=f6(t),i=`/${s}`,o=e?i:i.toLowerCase(),r=`${o}/`,a={input:({url:c})=>{const d=e?c.pathname:c.pathname.toLowerCase();return d===o?c.pathname="/":d.startsWith(r)&&(c.pathname=c.pathname.slice(i.length)),c},output:({url:c})=>(c.pathname=Dd(`/${s}${c.pathname}`),c)};return n?{input:({url:c})=>ow(n,a.input({url:c})),output:({url:c})=>a.output({url:x6(n,c)})}:a}function ow(t,e){var s;const n=(s=t==null?void 0:t.input)==null?void 0:s.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function x6(t,e){var s;const n=(s=t==null?void 0:t.output)==null?void 0:s.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function TW(t,e){const{createMutableStore:n,createReadonlyStore:s,batch:i}=e,o=new Map,r=n("idle"),a=n(t),c=n(void 0),d=n([]),f=s(()=>d.get().map(v=>o.get(v).get())),p=s(()=>({status:r.get(),isLoading:r.get()==="pending",matches:f.get(),location:a.get(),resolvedLocation:c.get()}));function m(v){let S=o.get(v);return S||(S=n(void 0),o.set(v,S)),S}const g={status:r,location:a,resolvedLocation:c,ids:d,matches:f,byRoute:o,__store:p,getMatchStore:m,setMatches:y};function y(v){const S=d.get(),w=v.map(N=>N.routeId);i(()=>{Zq(S,w)||d.set(w);for(const N of S)w.includes(N)||o.get(N).set(()=>{});for(const N of v){const C=m(N.routeId);C.get()!==N&&C.set(N)}})}return g}var ka="__TSR_index",Ek="popstate",Ck="beforeunload",OW=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function p1(t){const e=OW.exec(t);return e?"/"+t.slice(e[0].length):t}function v6(t){return/[\x00-\x1f\x7f]/.test(t)&&(t=t.replace(/[\x00-\x1f\x7f]/g,e=>`
51
+ \r`.includes(e)?"":encodeURIComponent(e))),p1(t)}function RW(t){let e=t.getLocation();const n=new Set,s=r=>{e=t.getLocation(),n.forEach(a=>a({location:e,action:r}))},i=r=>{t.notifyOnIndexChange??!0?s(r):e=t.getLocation()},o=async({task:r,navigateOpts:a,...c})=>{var p,m;if((a==null?void 0:a.ignoreBlocker)??!1){r();return}const d=((p=t.getBlockers)==null?void 0:p.call(t))??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(const g of d){const y=z1(c.path,c.state);if(await g.blockerFn({currentLocation:e,nextLocation:y,action:c.type})){(m=t.onBlocked)==null||m.call(t);return}}r()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:r=>(n.add(r),()=>{n.delete(r)}),push:(r,a,c)=>{const d=e.state[ka];a=Nk(d+1,a),o({task:()=>{t.pushState(r,a),s({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:r,state:a})},replace:(r,a,c)=>{const d=e.state[ka];a=Nk(d,a),o({task:()=>{t.replaceState(r,a),s({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:r,state:a})},go:(r,a)=>{o({task:()=>{t.go(r,(a==null?void 0:a.ignoreBlocker)??!1),i({type:"GO",index:r})},navigateOpts:a,type:"GO"})},back:r=>{o({task:()=>{t.back((r==null?void 0:r.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:r,type:"BACK"})},forward:r=>{o({task:()=>{t.forward((r==null?void 0:r.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:r,type:"FORWARD"})},canGoBack:()=>e.state[ka]!==0,createHref:r=>t.createHref(r),block:r=>{var c;if(!t.setBlockers)return()=>{};const a=((c=t.getBlockers)==null?void 0:c.call(t))??[];return t.setBlockers([...a,r]),()=>{var f,p;const d=((f=t.getBlockers)==null?void 0:f.call(t))??[];(p=t.setBlockers)==null||p.call(t,d.filter(m=>m!==r))}},flush:()=>{var r;return(r=t.flush)==null?void 0:r.call(t)},destroy:()=>{var r;return(r=t.destroy)==null?void 0:r.call(t)},notify:s,_getBlockers:()=>{var r;return((r=t.getBlockers)==null?void 0:r.call(t))??[]}}}function Nk(t,e){const n=mC();return{...e,key:n,__TSR_key:n,[ka]:t}}function kW(t){var k,M;const e=typeof document<"u"?window:void 0,n=e.history.pushState,s=e.history.replaceState;let i=[];const o=()=>i,r=L=>i=L,a=L=>v6(L),c=(()=>z1(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!((k=e.history.state)!=null&&k.__TSR_key)&&!((M=e.history.state)!=null&&M.key)){const L=mC();e.history.replaceState({[ka]:0,key:L,__TSR_key:L},"")}let d=c(),f,p=!1,m=!1,g=!1,y=!1;const v=()=>d;let S;const w=()=>{S&&(A._ignoreSubscribers=!0,(S[2]?e.history.pushState:e.history.replaceState)(S[1],"",S[0]),A._ignoreSubscribers=!1,S=void 0,f=void 0)},N=(L,j,D)=>{const P=!!S;P||(f=d),d=z1(j,D),S=[d.href,D,(S==null?void 0:S[2])||L],P||queueMicrotask(()=>w())},C=L=>{d=c(),A.notify({type:L})},T=async()=>{if(y=!1,m){m=!1;return}const L=c(),j=L.state[ka]-d.state[ka],D=j===1,P=j===-1,B=!D&&!P||p;p=!1;const I=B?"GO":P?"BACK":"FORWARD",F=B?{type:"GO",index:j}:{type:P?"BACK":"FORWARD"};if(g)g=!1;else{const z=o();if(typeof document<"u"&&z.length){for(const U of z)if(await U.blockerFn({currentLocation:d,nextLocation:L,action:I})){m=!0,e.history.go(-j),A.notify(F);return}}}d=c(),A.notify(F)},R=L=>{if(y){y=!1;return}let j=!1;const D=o();if(typeof document<"u"&&D.length)for(const P of D){const B=P.enableBeforeUnload??!0;if(B===!0){j=!0;break}if(typeof B=="function"&&B()===!0){j=!0;break}}if(j)return L.preventDefault(),L.returnValue=""},A=RW({getLocation:v,getLength:()=>e.history.length,pushState:(L,j)=>N(!0,L,j),replaceState:(L,j)=>N(!1,L,j),back:L=>(L&&(g=!0,y=!0),e.history.back()),forward:L=>{L&&(g=!0,y=!0),e.history.forward()},go:(L,j)=>{p=!0,j&&(g=!0,y=!0),e.history.go(L)},createHref:L=>a(L),flush:w,destroy:()=>{e.history.pushState=n,e.history.replaceState=s,e.removeEventListener(Ck,R,{capture:!0}),e.removeEventListener(Ek,T)},onBlocked:()=>{f&&d!==f&&(d=f)},getBlockers:o,setBlockers:r,notifyOnIndexChange:!1});return A._ignoreNextBeforeUnload=L=>{y=!1;try{L=new URL(L,e.document.baseURI).href,y=/^https?:/.test(L)&&(!L.includes("#")||L.split("#")[0]!==e.location.href.split("#")[0])}catch{}},e.addEventListener(Ck,R,{capture:!0}),e.addEventListener(Ek,T),e.history.pushState=function(...L){const j=n.apply(e.history,L);return A._ignoreSubscribers||C("PUSH"),j},e.history.replaceState=function(...L){const j=s.apply(e.history,L);return A._ignoreSubscribers||C("REPLACE"),j},A}function z1(t,e){const n=v6(t),s=n.indexOf("#"),i=n.indexOf("?");if(!e){const o=mC();e={[ka]:0,key:o,__TSR_key:o}}return{href:n,pathname:n.substring(0,s>0?i>0?Math.min(s,i):s:i>0?i:n.length),hash:s>-1?n.substring(s):"",search:i>-1?n.slice(i,s===-1?void 0:s):"",state:e}}function mC(){return(Math.random()+1).toString(36).substring(7)}function Cv(t,e){return t.protocol!=="http:"&&t.protocol!=="https:"||t.origin!==e||!!t.username||!!t.password}function Nv(t){return t.pathname+t.search+t.hash}function Tk(t){var e,n;return t.options.loader||t.options.beforeLoad||t.lazyFn||((e=t.options.component)==null?void 0:e.preload)||((n=t.options.pendingComponent)==null?void 0:n.preload)}function zy(t,e){return{fromLocation:e,toLocation:t,pathChanged:(e==null?void 0:e.pathname)!==t.pathname,hrefChanged:(e==null?void 0:e.href)!==t.href,hashChanged:(e==null?void 0:e.hash)!==t.hash}}function Ok({key:t,__TSR_key:e,__TSR_index:n,__hashScrollIntoViewOptions:s,...i}){return i}function AW(t){return t.findIndex(e=>e.status==="error"||e.status==="notFound"||e._notFound)+1}function _W(t,e,n,s,i,o){var r,a,c,d;s&&(e=e.slice(0,s)),i&&(n=n.slice(0,i));for(const f of e){if(o&&t._tx!==o)return;n.some(p=>p.routeId===f.routeId)||(a=(r=t.routesById[f.routeId].options).onLeave)==null||a.call(r,f)}for(const f of n){if(o&&t._tx!==o)return;(d=(c=t.routesById[f.routeId].options)[e.some(p=>p.routeId===f.routeId)?"onStay":"onEnter"])==null||d.call(c,f)}}var MW=class{constructor(t,e){var n;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async s=>(s(),!1),this.update=s=>{const i=this.options;this.options={...i,...s},this.isServer=this.options.isServer??pk??typeof document>"u",this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=kW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost");const o=this.options.basepath??"/",r=this.options.rewrite,a=this.basepath!==o||(i==null?void 0:i.rewrite)!==r||(i==null?void 0:i.caseSensitive)!==this.options.caseSensitive;if(a&&(this.basepath=o,this.rewrite=o!=="/"&&f6(o)?NW(o,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree||pk){this.routeTree=this.options.routeTree;let c;c=this.buildRouteTree(),this.setRoutes(c)}if(this.stores)a&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){const c=this.getStoreConfig(this);this.batch=c.batch,this.stores=TW(this.latestLocation,c),aW(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=SW(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&yW(this.options.routeMasks,s.processedTree),{...s,resolvePathCache:P1(1e3)}},this.subscribe=(s,i)=>{const o={eventType:s,fn:i};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=s=>{for(const i of this.subscribers)if(i.eventType===s.type)try{i.fn(s)}catch(o){console.error(o)}},this.parseLocation=(s,i)=>{const o=({pathname:d,search:f,hash:p,href:m},g)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const w=this.options.parseSearch(f),N=this.options.stringifySearch(w);return{href:d+N+p,publicHref:d+N+p,pathname:Ph(d),external:!1,searchStr:N,search:bd(i==null?void 0:i.search,w),hash:Ph(p.slice(1)),state:Ra(i==null?void 0:i.state,g)}}const y=ow(this.rewrite,new URL(m,this.origin)),v=this.options.parseSearch(y.search),S=this.options.stringifySearch(v);return y.search=S,{href:y.href.replace(y.origin,""),publicHref:m,pathname:Ph(p1(y.pathname)),external:!!this.rewrite&&Cv(y,this.origin),searchStr:S,search:bd(i==null?void 0:i.search,v),hash:Ph(y.hash.slice(1)),state:Ra(i==null?void 0:i.state,g)}},r=o(s,s.state),{__tempLocation:a,__tempKey:c}=r.state;if(a&&(!c||c===this.tempLocationKey)){const d=o(a,{...a.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return d.maskedLocation=r,d}return r},this.matchRoutes=(s,i,o)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:i},o):this.matchRoutesInternal(s,i),this.getMatchedRoutes=s=>{const i=Object.create(null),o=vW(or(s),this.processedTree,!0);return o&&Object.assign(i,o.rawParams),[(o==null?void 0:o.branch)||[this.routesById.__root__],i,o==null?void 0:o.route]},this.buildLocation=s=>{{const a=this.staticLocations.get(s);if(a)return a}let i=!1;const o=(a={})=>{var F;if(a.href){const z=z1(a.href,{});a={...a,to:ow(this.rewrite,new URL(z.pathname,this.origin)).pathname,search:this.options.parseSearch(z.search),hash:z.hash.slice(1)}}const c=a._fromLocation||this._pendingLocation||this.latestLocation;let d;const f=()=>(i=!0,c),p=()=>(i=!0,d??(d=this.matchRoutesLightweight(c))),m=a.to?`${a.to}`:".",g=bk(m[0]==="/"?"":a.unsafeRelative==="path"?f().pathname:a.from??p()[1],m,this.options.trailingSlash,this.resolvePathCache),y=this.routesByPath[or(g)],v=g.includes("$");let S;if(y)S=y._branch??(y._branch=b6(y));else if(v)S=[];else{const[z,U,H]=this.getMatchedRoutes(g);S=z,this.options.notFoundRoute&&(!H||H.path!=="/"&&U["**"])&&(S=[...S,this.options.notFoundRoute])}const w=v?(y==null?void 0:y._interpolation)??Np(!1,{fullPath:g},0):void 0;let N;for(const z of S){const U=((F=z.options.params)==null?void 0:F.stringify)??z.options.stringifyParams;if(U){const H=p()[3];if(N??(N=Tv(a.params,H)),!a6(N))break;N===H&&(N=Object.assign(f1(),N));try{Object.assign(N,U(N))}catch{}}}N??(N=Tv(a.params,IW(a.params,w)?p()[3]:Ov));const C=s.leaveParams?g:p1(Ph(w?xk(g,w,N,this.pathParamsDecoder):g)),T=DW(S,s._includeValidateSearch),R=()=>{var U;let z=p()[2];if(s._includeValidateSearch&&((U=this.options.search)!=null&&U.strict)){const H={};S.forEach(V=>{if(V.options.validateSearch)try{Object.assign(H,m1(V.options.validateSearch,{...H,...z}))}catch{}}),z=H}return z},A=T.length?jW(T,R(),a):a.search===!0?R():typeof a.search=="function"?a.search(R()):a.search||Ov,k=this.options.stringifySearch(A),M=a.hash===!0?f().hash:typeof a.hash=="function"?a.hash(f().hash):a.hash||void 0,L=M?`#${M}`:"",j=a.state?a.state===!0?f().state:typeof a.state=="function"?a.state(f().state):a.state:Ov,D=`${C}${k}${L}`;let P,B,I=!1;if(this.rewrite){const z=new URL(D,this.origin),U=z.origin,H=x6(this.rewrite,z);P=Nv(z),Cv(H,U)?(B=H.href,I=!0):B=p1(Nv(H))}else P=Qq(D),B=P;return{publicHref:B,href:P,pathname:C,search:A,searchStr:k,state:j,hash:M??"",external:I,unmaskOnReload:a.unmaskOnReload}},r=o(s);if(s.mask)r.maskedLocation=o({from:s.from,...s.mask});else if(this.options.routeMasks){const a=bW(r.pathname,this.processedTree);if(a){const c=Object.assign(f1(),a.rawParams),{from:d,params:f,...p}=a.route,m=Tv(f,c);r.maskedLocation=o({from:s.from,...p,params:m})}}return!i&&s._fromLocation&&!r.maskedLocation&&this.staticLocations.set(s,r),r},this.commitLocation=async({viewTransition:s,ignoreBlocker:i,...o})=>{const r=o.maskedLocation??o;if(r.external)return Rk(this,r.publicHref,{replace:o.replace,ignoreBlocker:i});let a;const c=or(this.latestLocation.href)===or(o.href)&&Jr(Ok(o.state),Ok(this.latestLocation.state)),d=this._commitPromise;let f;const p=new Promise(m=>{f=m});if(p.resolve=()=>{f(),d==null||d.resolve()},this._commitPromise=p,c)this.load();else{let{maskedLocation:m,hashScrollIntoView:g,...y}=o;m&&(y={...m,state:{...m.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state={...y.state,__hashScrollIntoViewOptions:g??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=s,a=o.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:i}),this.history.subscribers.size||this.load({action:{type:a}})}return this._scroll.next=o.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:s,resetScroll:i,hashScrollIntoView:o,viewTransition:r,ignoreBlocker:a,...c}={})=>{const d=this.buildLocation({...c,_includeValidateSearch:!0});this._pendingLocation=d;const f=this.commitLocation({...d,viewTransition:r,replace:s,resetScroll:i,hashScrollIntoView:o,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===d&&(this._pendingLocation=void 0)}),f},this.navigate=async({to:s,reloadDocument:i,href:o,publicHref:r,...a})=>{const c=o?Cp(o):void 0;if(c||i){if(s!==void 0||!o){const f=this.buildLocation({to:s,...a}),p=f.maskedLocation??f;o??(o=p.publicHref),r??(r=p.publicHref)}return Rk(this,!c&&r?r:o,a)}return this.buildAndCommitLocation({...a,href:o,to:s,_isNavigate:!0})},this.load=async s=>{this.updateLatestLocation(),s!=null&&s.action&&(this._scroll.hash=s.action.type==="PUSH"||s.action.type==="REPLACE"),await qW(this,s)},this.startViewTransition=s=>{var o,r;const i=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,i&&typeof document.startViewTransition=="function"){let a;if(typeof i=="object"&&((r=(o=window.CSS)==null?void 0:o.supports)!=null&&r.call(o,"selector(:active-view-transition-type(a))"))){const c=this.latestLocation,d=this.stores.resolvedLocation.get(),f=typeof i.types=="function"?i.types(zy(c,d)):i.types;if(f===!1)return s();a={update:s,types:f}}else a=s;return document.startViewTransition(a).updateCallbackDone}return s()},this.invalidate=s=>{var p,m;const i=this._committed,o=s==null?void 0:s.filter,r=this._preloads,a=new Set,c=g=>{(!o||o(g))&&a.add(g.id)};i.forEach(c),this._cache.forEach(c),r==null||r.forEach(g=>g.forEach(c)),(p=this._tx)==null||p[3].forEach(c);const d=[];for(const[g,y]of r??[])y.some(v=>a.has(v.id))&&(r.delete(g),d.push(g));const f=g=>{if(a.has(g.id)){const y=this.routesById[g.routeId],v={...g,invalid:!0,...(s!=null&&s.forcePending||g.status==="error"||g.status==="notFound")&&Tk(y)?{status:"pending",error:void 0}:void 0};return g._flight=void 0,v}return g};this._committed=i.map(f);for(const[g,y]of this._cache)a.has(g)&&(y.invalid=!0,s!=null&&s.forcePending&&(y.status="pending"));for(const g of a)(m=this._flights)==null||m.delete(g);for(const g of d)g.abort();return this.shouldViewTransition=!1,this.load({sync:s==null?void 0:s.sync})},this.resolveRedirect=s=>{const i=s.options;let o=s.headers.get("Location")||i.href;if(!o){const a=this.buildLocation(i);o=(a.maskedLocation??a).publicHref||"/"}let r;if(c6.test(o)||(r=Cp(o))&&!this.protocolAllowlist.has(r))throw new Error("Redirect blocked: unsafe protocol");if(r==="http:"||r==="https:"){const a=new URL(o);a.pathname.startsWith("//")?o=a.href:Cv(a,this.origin)||(o=Nv(a),r=void 0)}return r&&(i.reloadDocument=!0),i.href=o,s.headers.set("Location",o),s},this.clearCache=s=>{var f;const i=this._cache,o=this._preloads,r=s==null?void 0:s.filter,a=[],c=[];for(const[p,m]of i)(!r||r(m))&&(c.push(p),a.push(m));const d=[];for(const[p,m]of o??[])(!r||m.some(r))&&(d.push(p),a.push(...m));for(const p of c)i.delete(p);for(const p of d)o.delete(p);for(const p of a){const m=p._flight;p._flight=void 0,m&&!--m[2]&&(((f=this._flights)==null?void 0:f.get(p.id))===m&&this._flights.delete(p.id),d.push(m[1]))}for(const p of d)p.abort()},this.loadRouteChunk=zd,this.preloadRoute=s=>WW(this,s),this.matchRoute=(s,i)=>{const o={...s,to:s.to?bk(s.from||"",s.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:s.params||{},leaveParams:!0},r=this.buildLocation(o),a=this.stores.status.get()==="pending";if(i!=null&&i.pending&&!a)return!1;const c=(i==null?void 0:i.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=xW(r.pathname,(i==null?void 0:i.caseSensitive)??!1,(i==null?void 0:i.fuzzy)??!1,c.pathname,this.processedTree);return!d||s.params&&!Jr(d.rawParams,s.params,!0)?!1:(i==null?void 0:i.includeSearch)??!0?Jr(c.search,r.search,!0)?d.rawParams:!1:d.rawParams},this.getStoreConfig=e,(n=t.pathParamsAllowedCharacters)!=null&&n.length&&(this.pathParamsDecoder=Jq(t.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??fW,parseSearch:t.parseSearch??dW,protocolAllowlist:t.protocolAllowlist??Xq}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(t){Object.assign(this,t),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;const e=this.options.notFoundRoute;e&&(e.init(99999999999),this.routesById[e.id]!==e&&(e._interpolation=Np(!1,e,0)),this.routesById[e.id]=e)}matchRoutesInternal(t,e){var m,g;const[n,s,i]=this.getMatchedRoutes(t.pathname);let o=n,r=!1;(i?i.path!=="/"&&s["**"]:or(t.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:r=!0);const a=r?PW(this.options.notFoundMode,o):void 0,c=new Array(o.length),d=this._committed,f=(y,v)=>{const S=d[v];return(S==null?void 0:S.routeId)===y.id?S:y===this.options.notFoundRoute?d.find(w=>w.routeId===y.id):void 0};let p;for(let y=0;y<o.length;y++){const v=o[y],S=c[y-1];let w,N,C;{const F=(S==null?void 0:S.search)??t.search,z=(S==null?void 0:S._strictSearch)??void 0;try{const U=m1(v.options.validateSearch,{...F})??void 0;w={...F,...U},N={...z,...U}}catch(U){let H=U;if(U instanceof B1||(H=new B1(U.message,{cause:U})),e!=null&&e.throwOnError)throw H;w=F,N={},C=H}}let T="",R="";try{T=((g=(m=v.options).loaderDeps)==null?void 0:g.call(m,{search:w}))??"",R=T&&JSON.stringify(T)||""}catch(F){if(e!=null&&e.throwOnError)throw F;C??(C=F)}const A=f1(),k=v._interpolation?xk(v.fullPath,v._interpolation,s,this.pathParamsDecoder,A):v.fullPath,M=v.id+k+R,L=f(v,y),j=this._cache.get(M)??((L==null?void 0:L.id)===M?L:void 0);p=(j==null?void 0:j._strictParams)??Object.assign(A,p);let D;if(!j)try{kk(v,p)}catch(F){if(uf(F)||p6(F)?D=F:D=new LW(F.message,{cause:F}),e!=null&&e.throwOnError)throw D}const P=L?"stay":"enter";let B;if(j)B={...j,cause:P,search:bd(L?L.search:j.search,w),_strictSearch:N,searchError:C};else{const F=Tk(v)?"pending":"success";B={id:M,ssr:v.options.ssr,index:y,routeId:v.id,params:(L==null?void 0:L.params)??p,_strictParams:p,pathname:k,updatedAt:Date.now(),search:L?bd(L.search,w):w,_strictSearch:N,searchError:C,status:F,isFetching:!1,error:void 0,paramsError:D,context:{},abortController:(e==null?void 0:e._controller)??new AbortController,cause:P,loaderDeps:L?Ra(L.loaderDeps,T):T,invalid:!1,preload:!1,staticData:v.options.staticData||{},fullPath:v.fullPath}}const I=a===v.id;B._notFound&&!I&&(B.error=void 0),B._notFound=I,c[y]=B}for(let y=0;y<c.length;y++){const v=c[y];v.params=v.cause==="stay"?bd(v.params,p):p,e!=null&&e._controller&&(v.context={})}return c}matchRoutesLightweight(t){const e=Ba(this.stores.ids.get()),n=e?this.stores.byRoute.get(e).get():void 0,s=n==null?void 0:n.id,i=this.lightweightCache.get(t);if(i&&i[0]===s)return i[1];const[o,r]=this.getMatchedRoutes(t.pathname),a=Ba(o),c={...t.search};for(const m of o)try{Object.assign(c,m1(m.options.validateSearch,c))}catch{}const d=n&&n.routeId===a.id&&n.pathname===t.pathname;let f;if(d)f=n.params;else{const m=r;for(const g of o)try{kk(g,m)}catch{}f=m}const p=[o,a.fullPath,c,f];return this.lightweightCache.set(t,[s,p]),p}};async function Rk(t,e,{replace:n,ignoreBlocker:s}){var i,o;if(!u6(e,t.protocolAllowlist)){if(!s){const r=t.history._getBlockers();for(const a of r)if(a!=null&&a.blockerFn&&await a.blockerFn({currentLocation:t.history.location,nextLocation:t.history.location,action:n?"REPLACE":"PUSH"}))return}(o=(i=t.history)._ignoreNextBeforeUnload)==null||o.call(i,e),n?window.location.replace(e):window.location.href=e}}var B1=class extends Error{},LW=class extends Error{};function m1(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new B1("Async validation not supported");if(n.issues)throw new B1(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function Tv(t,e){if(t===void 0||t===!0)return e;const n=Object.create(null);return t===!1||t===null?n:typeof t=="function"?(Object.assign(n,e),Object.assign(n,t(n))):Object.assign(n,e,t)}function IW(t,e){return typeof t=="function"?!0:!e||t===!1||t===null?!1:t===void 0||t===!0||e.some(n=>typeof n!="string"&&!fC.call(t,n[1]))}const Ov=Object.freeze({});function DW(t,e){var s;const n=[];for(let i=0;i<t.length;i++){const o=t[i].options;if("search"in o)(s=o.search)!=null&&s.middlewares&&n.push(...o.search.middlewares);else if(o.preSearchFilters||o.postSearchFilters){const a=({search:c,next:d})=>{const f=d(o.preSearchFilters?o.preSearchFilters.reduce((p,m)=>m(p),c):c);return o.postSearchFilters?o.postSearchFilters.reduce((p,m)=>m(p),f):f};n.push(a)}const r=o.validateSearch;if(e&&r){const a=({search:c,next:d,meta:f})=>{const p=d(c);try{const m=m1(r,p);if(f&&m)for(const g in m)g in p||(f.defaulted||(f.defaulted=new Map)).set(g,m[g]);return{...p,...m}}catch{}return p};n.push(a)}}return n}function jW(t,e,n){const s=(i,o,r)=>{if(i>=t.length){if(!n.search)return{};if(n.search===!0)return o;const c=l6(n.search,o);return r&&(r.explicit=c),c}const a=(c,d)=>{if(d){const f=r||{};return{search:s(i+1,c,f),meta:f}}return s(i+1,c,r)};return t[i]({search:o,next:a,meta:r})};return s(0,e)}function PW(t,e){if(t!=="root"){let n;for(let s=e.length-1;s>=0;s--){const i=e[s];if(i.options.notFoundComponent)return i.id;n||(n=i.children&&i.id)}if(n)return n}return Pd}function kk(t,e){var s;const n=((s=t.options.params)==null?void 0:s.parse)??t.options.parseParams;n&&Object.assign(e,n(e))}function rw(t,e){var n,s;return(s=(n=t.options[e])==null?void 0:n.preload)==null?void 0:s.call(n)}function zW(t,e){const n=rw(t,"component");let s=rw(t,"pendingComponent");return e&&(s?s=s.then(e):e()),n&&s?Promise.all([n,s]).then(()=>{}):n??s}function zd(t,e,n){const s=()=>e===!1?void 0:e?rw(t,e):zW(t,n),i=t._lazy;if(i)return i===!0?s():i.then(s);if(!t.lazyFn)return s();const o=t.lazyFn().then(r=>{{const{id:a,...c}=r.options;Object.assign(t.options,c),t._lazy=!0}},r=>{throw t._lazy=void 0,r});return t._lazy=o,o.then(s)}function gC(t){const e=t.findIndex(n=>n.status!=="success"||n._notFound)+1;return e&&e<t.length?t.slice(0,e):t}const cr=0,el=1,By=2,ri=3,$a=[4];function Tp(t){return typeof t[0]=="number"}function Su(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((n,s)=>{const i=()=>s(e);e.addEventListener("abort",i,{once:!0}),Promise.resolve(t).then(n,s).then(()=>e.removeEventListener("abort",i))})}function wu(t,e){return t.routesById[e.routeId]}function Op(t,e,n){return p6(t)?[ri,t]:uf(t)?(t.routeId||(t.routeId=n),[By,t]):e?(typeof(t==null?void 0:t.then)=="function"&&(t=new Error("A Promise was thrown",{cause:t})),[el,t]):[cr,t]}function yC(t,e){var s,i;let n=Op(e,!0,t.id);if(n[0]!==el)return n;try{(i=(s=t.options).onError)==null||i.call(s,n[1])}catch(o){n=Op(o,!0,t.id)}return n}function up(t,e,n,s,i){return i[0].signal.aborted?$a:vC(t,e,n,yC(n,s),i)}async function BW(t,e,n,s,i,o){var f,p;const[r,a]=e,c=n[0].signal,d=!!n[3];for(let m=n[6]??0;m<s;m++){const g=a[m],y=wu(t,g);g.abortController=n[0];const v=((f=a[m-1])==null?void 0:f.context)??t.options.context??{},S={params:g.params,location:r,navigate:T=>t.navigate({...T,_fromLocation:r}),buildLocation:t.buildLocation,cause:d?"preload":g.cause,abortController:n[0],preload:d,matches:a,routeId:y.id};try{const T=g._ctx||(g._ctx=y.options.context?y.options.context({...S,deps:g.loaderDeps,context:v})||{}:void 0);g.context={...v,...T}}catch(T){return Gr(t,g),[m,up(t,e,y,T,n)]}if(c.aborted)return[m,$a];const w=g.paramsError??g.searchError;if(w!==void 0)return Gr(t,g),[m,up(t,e,y,w,n)];const N=y.options.beforeLoad;if(!N)continue;const C=g.status;m>=o&&(g.status="pending",(p=n[7])==null||p.call(n));try{Rp(t,g,"beforeLoad",n[0]);const T=N({...S,search:g.search,context:g.context,...t.options.additionalContext}),R=await(typeof(T==null?void 0:T.then)=="function"?Su(T,c):T);if(c.aborted)return[m,$a];const A=vC(t,e,y,Op(R,!1,y.id),n);if(A[0]!==cr)return Gr(t,g),[m,A];g.context={...g.context,...R}}catch(T){return Gr(t,g),[m,up(t,e,y,T,n)]}finally{g.status=C,Rp(t,g,!1,n[0])}}i()}function bC(t,e,n){var s;if(!(!n||--n[2])){if(((s=t._flights)==null?void 0:s.get(e.id))===n){const i=t._tx;if(i&&!i[0].signal.aborted&&!i[3].includes(e)&&i[3].some(o=>o.id===e.id)&&i[3].some(o=>o.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return n[1]}}function Gr(t,e){var s;const n=e._flight;e._flight=void 0,(s=bC(t,e,n))==null||s.abort()}function Si(t,e,n,s){var o;const i=[];for(const r of e)if(!(n!=null&&n.includes(r))){const a=r._flight;if(r._flight=void 0,s&&(a==null?void 0:a[2])===1&&((o=t._flights)==null?void 0:o.get(r.id))===a&&(n!=null&&n.some(c=>c.id===r.id)))a[2]=0;else{const c=bC(t,r,a);c&&i.push(c)}}for(const r of i)r.abort()}function xC(t){for(const e of t){const n=e._flight;n&&n[2]++}}function Rp(t,e,n,s){var r;if(e.isFetching=n,s&&((r=t._tx)==null?void 0:r[0])!==s)return;const i=t.stores.byRoute.get(e.routeId),o=i==null?void 0:i.get();(o==null?void 0:o.id)===e.id&&i.set({...o,isFetching:n})}function S6(t,e,n,s,i,o,r){const a=e[0];return{params:n.params,location:a,navigate:c=>t.navigate({...c,_fromLocation:a}),cause:r?"preload":n.cause,abortController:i,preload:r,deps:n.loaderDeps,parentMatchPromise:o,context:n.context,route:s,...t.options.additionalContext}}async function Ak(t,e,n,s,i,o,r){const a=r[0],c=a.signal;if(c.aborted)return $a;if(!i)return[cr,void 0];let d=n._flight;Rp(t,n,"loader",a);try{if(!d){const f=new AbortController;d=[Promise.resolve().then(()=>i(S6(t,e,n,s,f,o,!!r[3]))).then(p=>Op(p,!1,s.id),p=>Op(p,!0,s.id)).then(p=>{var m;return p[0]!==cr&&((m=t._flights)==null?void 0:m.get(n.id))===d&&(t._flights.delete(n.id),d[2]||f.abort()),p[0]===el&&d[2]?yC(s,p[1]):p}),f,1],(t._flights??(t._flights=new Map)).set(n.id,d)}return n._flight=d,n.abortController=d[1],vC(t,e,s,await Su(d[0],c),r)}catch(f){if(f!==c||!c.aborted)throw f;return Gr(t,n),$a}finally{Rp(t,n,!1,a)}}function _k(t,e,n){e[0]!==ri&&(t.status="success",t.error=void 0,e[0]===cr?(t.loaderData=e[1],t.invalid=!1,t.updatedAt=Date.now(),t.preload=n):t.invalid=!0)}function $W(t,e,n){const s=t._cache.get(e.id);if(s!==n||t._committed.some(o=>o.id===e.id&&o._flight===e._flight))return;const i={...e,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,t._cache.set(e.id,i),s&&Gr(t,s)}function Mk(t,e){return e[0]===el||e[0]===By?{...t,status:e[0]===el?"error":"notFound",error:e[1],_flight:void 0}:t}function FW(t,e,n,s,i,o,r){var P,B;const a=e[1][n],c=wu(t,a),d=!!o[3],f=t._cache.get(a.id);let p,m=!1,g;try{if(a.status==="success"&&(p=c.options.shouldReload,typeof p=="function"&&(p=p(S6(t,e,a,c,o[0],i,d))),o[0].signal.aborted&&(g=$a)),!g)if(a.status!=="success")m=!0;else{const I=d||a.preload?c.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:c.options.staleTime??t.options.defaultStaleTime??0;m=!!(a.invalid||p||p===void 0&&Date.now()-a.updatedAt>=I&&(o[5]||a.cause==="enter"||o[2].some(F=>F.routeId===a.routeId&&F.id!==a.id)))}}catch(I){a.invalid=!0,Gr(t,a),g=up(t,e,c,I,o)}const y=c.options.loader,v=typeof y=="function",S=v?y:y==null?void 0:y.handler,w=!d||c.options.preload!==!1;let N=w&&y?(P=t._flights)==null?void 0:P.get(a.id):void 0;N===a._flight||g?N=void 0:N&&!m&&!d&&p===void 0?m=!0:m||(N=void 0);const C=!!(y&&m&&a.status==="success"&&!d&&!o[4]&&((v?void 0:y.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),T=m&&w,R=T&&!C&&(a.status!=="success"||!!y),A=n>=r?o[7]:void 0,k=c.lazyFn&&c._lazy!==!0?A:void 0;if(T&&!y&&(a.invalid=!1,a.updatedAt=Date.now()),N&&N[2]++,R){const I=a._flight;a._flight=N,(B=bC(t,a,I))==null||B.abort(),n>=r&&(a.status="pending"),A==null||A()}T||(a.isFetching=!1);const M=!g&&R?Ak(t,e,a,c,S,i,o).then(I=>(_k(a,I,d),I[0]===cr&&(y&&!o[0].signal.aborted&&$W(t,a,f),n>=r&&(a.status="pending")),I)):Promise.resolve(g??[cr,a.loaderData]),L=(async()=>{try{const F=zd(c,void 0,k);F&&await Su(F,o[0].signal)}catch(F){if(!e[1].some((z,U)=>U<=n&&(z.status==="error"||z.status==="notFound"||z._notFound)))return[n,up(t,e,c,F,o)]}const I=await M;R&&I[0]===cr&&a.status==="pending"&&!o[0].signal.aborted&&(a.status="success",A==null||A())})();if(s.push([n,M,L]),!C)return M.then(I=>Mk(a,I));const j={...a,status:"pending",preload:!1,_flight:N};a.invalid=!1,a.isFetching="loader";const D=Ak(t,e,j,c,S,i,o).then(I=>(a.isFetching=!1,_k(j,I,!1),I));return(e[2]??(e[2]=[])).push([n,D,L,j]),D.then(I=>Mk(j,I))}async function lw(t,e,n,s,i=0){const o=n==null?void 0:n[1][1];let r=o!=null&&o.routeId?e.findIndex(a=>a.routeId===o.routeId):(n==null?void 0:n[0])??e.length-1;r<0&&(r=0);for(let a=r;a>=0;a--){const c=wu(t,e[a]);try{const d=zd(c,!1);d&&await Su(d,s)}catch(d){if(d===s&&s.aborted)throw d}if(c.options.notFoundComponent)return a}return o!=null&&o.routeId?r:i}function Jc(t,e){e[2]&&(Si(t,e[2].map(n=>n[3])),e[2]=void 0)}async function Lk(t,e,n,s){let i;try{await Promise.all(t.map(o=>o[1].then(async r=>{const a=o[0];if(!(s&&a>=await s)){if(r[0]>=ri)throw[a,r];!i&&r[0]!==cr&&(i=[a,r],await Promise.all((n??[]).map(c=>{if(!(c[0]<=a))return c[1].then(d=>{if(d[0]===ri)throw[c[0],d]})})))}})))}catch(o){return o}return e??i}function vC(t,e,n,s,i,o){for(;s[0]===ri;){const r=s[1],a=r.options;try{if((a.href||r.headers.has("Location"))&&(t.resolveRedirect(r),a.reloadDocument)||(a.reloadDocument?i[3]:i[1]>=20))return s;const c=t.buildLocation({...a,_fromLocation:e[0],_includeValidateSearch:!0}),d=c.maskedLocation??c;if(d.external){const f=r.clone();return f.options={...a},f.headers.set("Location",d.publicHref),t.resolveRedirect(f),i[3]?[ri,f]:[ri,f,d]}return[ri,r,c]}catch(c){s=o?[el,c]:yC(n,c),o=!0}}return s}async function w6(t,e,n,s,i,o){const r=e[1];let a=await i,c=!1;const d=r.findIndex(g=>g._notFound),f=g=>g[1][0]===By?lw(t,r,g,s.signal):g[0];let p=d<0?r.length:d;if(((a==null?void 0:a[1][0])??0)>=ri)p=0;else if(a){p=a[2]??(a[2]=await f(a));for(const g of n){if(g[0]>=p)break;const y=await g[1];if(y[0]!==cr&&y[0]<ri&&!("loaderData"in r[g[0]])){a=[g[0],y],p=a[2]=await f(a);break}}}for(const g of n){if(g[0]>=p)break;const y=await g[2];if(y){a=y;break}}if(((a==null?void 0:a[1][0])??0)>=ri){const g=a[1];if(g[0]!==ri||g[1].options.reloadDocument||g[2])return Jc(t,e),g;c=!0,a=[0,[el,new Error("Too many redirects")]]}const m=a?a[2]??await f(a):d;if(m>=0){const g=a==null?void 0:a[1],y=g==null?void 0:g[0],v=r[m],S=g==null?void 0:g[1],w=()=>{g&&(v._notFound=void 0,y===el?v.status="error":(S.routeId=v.routeId,v.routeId===t.routeTree.id?(v.status="success",v._notFound=!0):v.status="notFound"),v.error=S,v.isFetching=!1)};w(),g||o==null||o();const N=wu(t,v);try{await Su(g?Promise.resolve().then(()=>zd(N,y===el?"errorComponent":"notFoundComponent")):Promise.all([zd(N),zd(N,"notFoundComponent")]),s.signal)}catch(C){if(C===s.signal&&s.signal.aborted)return Jc(t,e),$a}g?c&&(s.abort(),await Promise.all([...n.map(C=>C[1]),...n.map(C=>C[2]),...(e[2]??[]).map(C=>C[1])]),Jc(t,e),Si(t,r),w()):v.status="success"}return e}async function E6(t,e,n,s=0,i=e[1].length){var r,a;const o=e[1];for(let c=s;c<i;c++){const d=o[c],f=wu(t,d).options;if(f.head||f.scripts)try{const p={ssr:t.options.ssr,matches:o,match:d,params:d.params,loaderData:d.loaderData},[m,g]=await Su(Promise.all([(r=f.head)==null?void 0:r.call(f,p),(a=f.scripts)==null?void 0:a.call(f,p)]),n);d.meta=m==null?void 0:m.meta,d.links=m==null?void 0:m.links,d.headScripts=m==null?void 0:m.scripts,d.styles=m==null?void 0:m.styles,d.scripts=g}catch(p){if(p===n&&n.aborted)break;console.error(p)}if(d.status!=="success"||d._notFound)break}return e}async function C6(t,e,n,s){var a;const i=[e,n],o=s[0].signal;let r;try{const c=t.stores.matches.get();let d=n.findIndex(N=>N._notFound);if(t.options.notFoundMode!=="root"&&d>=0){const N=await lw(t,n,void 0,o,d);n[d]._notFound=void 0,n[N]._notFound=!0,d=N}let f=d<0?n.length:d+1,p=0;for(;p<f&&p!==d;){const N=n[p],C=s[2][p],T=c[p];if((C==null?void 0:C.id)!==N.id||C.status!=="success"||N.preload||(T==null?void 0:T.id)!==N.id||T.status!=="success"||(p++,C._notFound||T._notFound))break}const m=[],g=s[6]??0;let y=g?Promise.resolve(n[g-1]):void 0;const v=()=>{for(let N=g;N<f&&!o.aborted;N++)y=FW(t,i,N,m,y,s,p)},S=await BW(t,i,s,f,v,p);if(S){if(s[4]=!0,f=S[0],S[1][0]===By){const N=await lw(t,n,S,o);S[2]=N,f=Math.min(f,N+1)}else S[1][0]>=ri&&(f=0);v()}if(!o.aborted&&!s[3]){const N=[];for(const[C,T]of t._flights??[])T[2]||(t._flights.delete(C),N.push(T[1]));for(const C of N)C.abort()}const w=w6(t,i,m,s[0],Lk(m,S,i[2]),s[7]);(a=i[2])!=null&&a.length&&(i[3]=Lk(i[2],void 0,void 0,w.then(N=>Tp(N)?0:gC(n).length,()=>0))),r=await w}catch(c){if(Jc(t,i),c===o&&o.aborted)return $a;throw c}return Tp(r)?r:E6(t,r,o,s[6]===n.length?s[6]:0)}function aw(t,e){var o,r;if(t._tx!==e)return;const n=e[3],s=t.stores.matches.get();let i=t._pending;for(let a=0;a<n.length;a++){const c=n[a],d=c.status==="success"&&!c._notFound,f=((o=s[a])==null?void 0:o.id)===c.id&&((r=s[a])==null?void 0:r.status)==="pending";if(d&&!f)continue;const p=wu(t,c),m=d||c.invalid?0:p.options.pendingMs??t.options.defaultPendingMs,g=p.options.pendingComponent??t.options.defaultPendingComponent;if(!g||typeof m!="number"||m===1/0){i&&(i[0]=e,i[2]=0,i[4]=!0);return}const y=p.options.pendingMinMs??t.options.defaultPendingMinMs??0;let v=!1;if((i==null?void 0:i[1])===c.id?(v=i[0]!==e,i[0]=e):(clearTimeout(i==null?void 0:i[3]),t._pending=i=void 0),i||(t._pending=i=[e,c.id,f?Date.now()+y:e[4]+m,void 0,f||void 0,g]),i[4]&&!v&&i[5]===g)return;if(i[5]=g,!i[4]){clearTimeout(i[3]);const N=i[2]-Date.now();if(N>0){i[3]=setTimeout(()=>aw(t,e),N);return}i[2]=0}const S=n.map(N=>({...N,_flight:void 0}));S[a].status="pending";const w=i[4]=t.startTransition(()=>t.stores.setMatches(S),S).then(N=>(N&&t._pending===i&&i[4]===w&&!i[2]&&(i[2]=Date.now()+y),N));return}}function zh(t,e){var s;const n=t._pending;(t._tx===e||!((s=t._tx)!=null&&s[3].some(i=>i.id===(n==null?void 0:n[1]))))&&(clearTimeout(n==null?void 0:n[3]),t._pending=void 0)}async function Ik(t,e){const n=t._pending;if(!n)return;clearTimeout(n[3]);const s=n[2]-Date.now();if(!n[4]||s<=0||!gC(e[3]).some(o=>o.id===n[1]))return;let i;try{await Su(new Promise(o=>{i=setTimeout(o,s)}),e[0].signal)}catch{}clearTimeout(i)}function N6(t,e){t._committed=e,t.stores.setMatches(e)}function HW(t,e,n,s){const i=t._committed,o=t._lifecycleEnd,r=t._cache;for(const f of n)f.preload=!1,s&&(f._assetEnd=void 0);const a=gC(n).length,c=new Map;{const f=Date.now(),p=new Set;for(let m=0;m<n.length;m++){const g=n[m];(m<a||g.status==="success")&&p.add(g.id)}for(const m of[...i,...r.values()]){if(m.status!=="success"||p.has(m.id))continue;const g=wu(t,m);!g.options.loader||f-m.updatedAt>=(m.preload?g.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:g.options.gcTime??t.options.defaultGcTime??3e5)||c.set(m.id,r.get(m.id)===m?m:{...m,_flight:void 0,isFetching:!1,context:{}})}}e[3]=[],t._cache=c;const d=t._lifecycleEnd=AW(n);N6(t,n),Si(t,[...r.values(),...i].filter(f=>f._flight&&c.get(f.id)!==f),n),_W(t,i,n,o,d,e)}async function C0(t,e){let n=t._tx;for(;n&&n!==e;)e=n,await n[5],n=t._tx}function T6(t,e,n){const s=n[1].options,i=n[2];if(!i)return t.navigate({...s,replace:!0,ignoreBlocker:!0});if(s.reloadDocument)return t.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=e[1]+1,t._pendingLocation=i;const o=t.commitLocation({...i,viewTransition:s.viewTransition,replace:!0,resetScroll:s.resetScroll,hashScrollIntoView:s.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{t._pendingLocation===i&&(t._pendingLocation=void 0)}),o}async function UW(t,e,n,s,i){const o=n.map(c=>({...c}));xC(o);for(const c of s)Gr(t,o[c[0]]),o[c[0]]=c[3];const r=[e[2],o];let a;try{a=await w6(t,r,s,e[0],i)}catch(c){throw Si(t,o),c}if(Tp(a)){Si(t,o),a[0]===ri&&t._tx===e&&t._committed===n&&await T6(t,e,a);return}if(await E6(t,a,e[0].signal),t._tx!==e||t._committed!==n){Si(t,o);return}for(const c of o){const d=t._cache.get(c.id);d!=null&&d._flight&&d._flight===c._flight&&(t._cache.delete(c.id),Gr(t,d))}N6(t,o),Si(t,n,o)}async function VW(t,e,n,s,i,o){const r=await C6(t,e[2],e[3],[e[0],e[1],t._committed,void 0,i,n,o,s]);if(Tp(r)){const p=r[0]===ri&&t._tx===e;if((!p||r[1].options.reloadDocument)&&zh(t,e),Si(t,e[3]),e[3]=[],!p)return;if(t._tx!==e){zh(t,e);return}await T6(t,e,r);return}const a=r[1];if(t._tx===e&&await Ik(t,e),t._tx!==e){zh(t,e),Si(t,a),Jc(t,r);return}const c=e[2],d=zy(c,t.stores.resolvedLocation.get()),f=r[2];await t.startViewTransition(async()=>{var g;if(t._tx===e&&await Ik(t,e),t._tx!==e){zh(t,e),Si(t,a),Jc(t,r);return}const p=()=>{zh(t,e),HW(t,e,a,o),t._tx===e&&(t.emit({type:"onLoad",...d}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...d}))},m=await t.startTransition(p,a);if(t._tx!==e){Jc(t,r);return}f!=null&&f.length&&UW(t,e,a,f,r[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(c),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...d}),m&&t._tx===e&&t.emit({type:"onRendered",...d})}),t._tx===e&&((g=t._commitPromise)==null||g.resolve(),t._commitPromise=void 0)})}async function qW(t,e){var T;const n=t._tx,s=t.stores.resolvedLocation.get(),i=s??t.stores.location.get(),o=t.latestLocation,r=t._pendingLocation,a=(r==null?void 0:r.href)===o.href?r._redirects??0:0,c=t._handoff,d=c==null?void 0:c[0](),f=new AbortController,p=t._preflight;if(t._preflight=f,d||c==null||c[1](),p==null||p.abort(),!f.signal.aborted){const R=zy(o,s);t.emit({type:"onBeforeNavigate",...R}),f.signal.aborted||t.emit({type:"onBeforeLoad",...R})}if(f.signal.aborted){await C0(t,n);return}const m=i.href===o.href;let g=f;const y=t.matchRoutes(o,{_controller:f});xC(y);const v=d?c[1](y):void 0;if(v?g=d:d==null||d.abort(),f.signal.aborted){Si(t,y),await C0(t,n);return}t._preflight=void 0;let S;const w=()=>VW(t,C,m,()=>aw(t,C),e==null?void 0:e.sync,v),N=e!=null&&e.sync?new Promise(R=>S=R):Promise.resolve().then(w),C=[g,a,o,y,Date.now(),N.then(()=>C0(t,C))];if(t._tx=C,n){for(const R of t.stores.matches.get()){if(t._tx!==C)break;R.isFetching&&Rp(t,R,!1)}n[0].abort(),Si(t,n[3],C[3],!0)}if(t._tx!==C){Si(t,C[3]),C[3]=[],S==null||S(),await C0(t,C);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(o)}),(v||!t._committed.length&&((T=y[0])==null?void 0:T.status)!=="success"&&!y.some(R=>R._notFound))&&aw(t,C),S==null||S(w()),await C[5]}async function WW(t,e){let n=t.buildLocation(e);for(let s=0;;s++){const i=t._committed,o=new AbortController;let r,a,c;try{try{r=t.matchRoutes(n,{_controller:o}),xC(r),a=(t._preloads??(t._preloads=new Map)).set(o,r),c=await C6(t,n,r,[o,s,i,!0])}finally{a&&(a=a.delete(o),Si(t,r)),o.abort()}if(!Tp(c))return c[1];if(!a||c.length<3)return;n=c[2]}catch(d){uf(d)||console.error(d);return}}}const GW="Error preloading route! ☝️";var O6=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{var c,d;this.originalIndex=e,this._branch=void 0;const n=this.options,s=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(d=(c=this.options).getParentRoute)==null?void 0:d.call(c),s?this._path=Pd:this.parentRoute||hC();let i=s?Pd:n==null?void 0:n.path;i&&i!=="/"&&(i=d6(i));const o=(n==null?void 0:n.id)||i,r=s?Pd:Dd((this.parentRoute.id==="__root__"?"":this.parentRoute.id)+"/"+(o??""));i==="__root__"&&(i="/");const a=r==="__root__"?"/":i===void 0?this.parentRoute.fullPath:Dd(this.parentRoute.fullPath+"/"+i);this._path=i,this._id=r,this._fullPath=a,this._to=or(a)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Py({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},KW=class extends O6{constructor(t){super(t)}},SC=class extends _.Component{constructor(...t){super(...t),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(t,e){const n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(t){return{error:[t]}}componentDidCatch(t,e){var n,s;(s=(n=this.props).onCatch)==null||s.call(n,t,e)}render(){const t=this.state.error;return t?_.createElement(this.props.errorComponent??YW,{error:t[0],reset:this.reset}):this.props.children}};function YW({error:t}){const[e,n]=_.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:e?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),e?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t!=null&&t.message?b.jsx("code",{children:t.message}):null})}):null]})}var XW=()=>!0,QW=()=>!1;function ZW({children:t,fallback:e=null}){return b.jsx(Oo.Fragment,{children:R6()?t:e})}function R6(){return Oo.useSyncExternalStore(JW,XW,QW)}function JW(){return()=>{}}var k6=_.createContext(null);function Wi(t){return _.useContext(k6)}var $y=_.createContext(void 0),eG=_.createContext(void 0);function tG({update:t,notify:e,unwatched:n}){return{link:s,unlink:i,propagate:o,checkDirty:r,shallowPropagate:a};function s(d,f,p){const m=f.depsTail;if(m!==void 0&&m.dep===d)return;const g=m!==void 0?m.nextDep:f.deps;if(g!==void 0&&g.dep===d){g.version=p,f.depsTail=g;return}const y=d.subsTail;if(y!==void 0&&y.version===p&&y.sub===f)return;const v=f.depsTail=d.subsTail={version:p,dep:d,sub:f,prevDep:m,nextDep:g,prevSub:y,nextSub:void 0};g!==void 0&&(g.prevDep=v),m!==void 0?m.nextDep=v:f.deps=v,y!==void 0?y.nextSub=v:d.subs=v}function i(d,f=d.sub){const p=d.dep,m=d.prevDep,g=d.nextDep,y=d.nextSub,v=d.prevSub;return g!==void 0?g.prevDep=m:f.depsTail=m,m!==void 0?m.nextDep=g:f.deps=g,y!==void 0?y.prevSub=v:p.subsTail=v,v!==void 0?v.nextSub=y:(p.subs=y)===void 0&&n(p),g}function o(d){let f=d.nextSub,p;e:do{const m=d.sub;let g=m.flags;if(g&60?g&12?g&4?!(g&48)&&c(d,m)?(m.flags=g|40,g&=1):g=0:m.flags=g&-9|32:g=0:m.flags=g|32,g&2&&e(m),g&1){const y=m.subs;if(y!==void 0){const v=(d=y).nextSub;v!==void 0&&(p={value:f,prev:p},f=v);continue}}if((d=f)!==void 0){f=d.nextSub;continue}for(;p!==void 0;)if(d=p.value,p=p.prev,d!==void 0){f=d.nextSub;continue e}break}while(!0)}function r(d,f){let p,m=0,g=!1;e:do{const y=d.dep,v=y.flags;if(f.flags&16)g=!0;else if((v&17)===17){if(t(y)){const S=y.subs;S.nextSub!==void 0&&a(S),g=!0}}else if((v&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(p={value:d,prev:p}),d=y.deps,f=y,++m;continue}if(!g){const S=d.nextDep;if(S!==void 0){d=S;continue}}for(;m--;){const S=f.subs,w=S.nextSub!==void 0;if(w?(d=p.value,p=p.prev):d=S,g){if(t(f)){w&&a(S),f=d.sub;continue}g=!1}else f.flags&=-33;f=d.sub;const N=d.nextDep;if(N!==void 0){d=N;continue e}}return g}while(!0)}function a(d){do{const f=d.sub,p=f.flags;(p&48)===32&&(f.flags=p|16,(p&6)===2&&e(f))}while((d=d.nextSub)!==void 0)}function c(d,f){let p=f.depsTail;for(;p!==void 0;){if(p===d)return!0;p=p.prevDep}return!1}}function nG(t,e,n){var o,r,a;const s=typeof t=="object",i=s?t:void 0;return{next:(o=s?t.next:t)==null?void 0:o.bind(i),error:(r=s?t.error:e)==null?void 0:r.bind(i),complete:(a=s?t.complete:n)==null?void 0:a.bind(i)}}const cw=[];let g1=0;const{link:Dk,unlink:sG,propagate:iG,checkDirty:A6,shallowPropagate:jk}=tG({update(t){return t._update()},notify(t){cw[uw++]=t,t.flags&=-3},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,$1(t))}});let N0=0,uw=0,Jo,dw=0;function oG(t){try{++dw,t()}finally{--dw||_6()}}function $1(t){const e=t.depsTail;let n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=sG(n,t)}function _6(){if(!(dw>0)){for(;N0<uw;){const t=cw[N0];cw[N0++]=void 0,t.notify()}N0=0,uw=0}}function Pk(t,e){const n=typeof t=="function",s=t,i={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?0:1,get(){return Jo!==void 0&&Dk(i,Jo,g1),i._snapshot},subscribe(o){const r=nG(o),a={current:!1},c=rG(()=>{var d;i.get(),a.current?(d=r.next)==null||d.call(r,i._snapshot):a.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(o){const r=Jo,a=(e==null?void 0:e.compare)??Object.is;if(n)Jo=i,++g1,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=5);try{const c=i._snapshot,d=typeof o=="function"?o(c):o===void 0&&n?s(c):o;return c===void 0||!a(c,d)?(i._snapshot=d,!0):!1}finally{Jo=r,n&&(i.flags&=-5),$1(i)}}};return n?(i.flags=17,i.get=function(){const o=i.flags;if(o&16||o&32&&A6(i.deps,i)){if(i._update()){const r=i.subs;r!==void 0&&jk(r)}}else o&32&&(i.flags=o&-33);return Jo!==void 0&&Dk(i,Jo,g1),i._snapshot}):i.set=function(o){if(i._update(o)){const r=i.subs;r!==void 0&&(iG(r),jk(r),_6())}},i}function rG(t){const e=()=>{const s=Jo;Jo=n,++g1,n.depsTail=void 0,n.flags=6;try{return t()}finally{Jo=s,n.flags&=-5,$1(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const s=this.flags;s&16||s&32&&A6(this.deps,this)?e():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,$1(this)}};return e(),n}var Rv={exports:{}},kv={},Av={exports:{}},_v={};/**
52
+ * @license React
53
+ * use-sync-external-store-shim.production.js
54
+ *
55
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
56
+ *
57
+ * This source code is licensed under the MIT license found in the
58
+ * LICENSE file in the root directory of this source tree.
59
+ */var zk;function lG(){if(zk)return _v;zk=1;var t=Af();function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:e,s=t.useState,i=t.useEffect,o=t.useLayoutEffect,r=t.useDebugValue;function a(p,m){var g=m(),y=s({inst:{value:g,getSnapshot:m}}),v=y[0].inst,S=y[1];return o(function(){v.value=g,v.getSnapshot=m,c(v)&&S({inst:v})},[p,g,m]),i(function(){return c(v)&&S({inst:v}),p(function(){c(v)&&S({inst:v})})},[p]),r(g),g}function c(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!n(p,g)}catch{return!0}}function d(p,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return _v.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,_v}var Bk;function M6(){return Bk||(Bk=1,Av.exports=lG()),Av.exports}/**
60
+ * @license React
61
+ * use-sync-external-store-shim/with-selector.production.js
62
+ *
63
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
64
+ *
65
+ * This source code is licensed under the MIT license found in the
66
+ * LICENSE file in the root directory of this source tree.
67
+ */var $k;function aG(){if($k)return kv;$k=1;var t=Af(),e=M6();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var s=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,r=t.useEffect,a=t.useMemo,c=t.useDebugValue;return kv.useSyncExternalStoreWithSelector=function(d,f,p,m,g){var y=o(null);if(y.current===null){var v={hasValue:!1,value:null};y.current=v}else v=y.current;y=a(function(){function w(A){if(!N){if(N=!0,C=A,A=m(A),g!==void 0&&v.hasValue){var k=v.value;if(g(k,A))return T=k}return T=A}if(k=T,s(C,A))return k;var M=m(A);return g!==void 0&&g(k,M)?(C=A,k):(C=A,T=M)}var N=!1,C,T,R=p===void 0?null:p;return[function(){return w(f())},R===null?void 0:function(){return w(R())}]},[f,p,m,g]);var S=i(d,y[0],y[1]);return r(function(){v.hasValue=!0,v.value=S},[S]),c(S),S},kv}var Fk;function cG(){return Fk||(Fk=1,Rv.exports=aG()),Rv.exports}var wC=cG();const uG=oC(wC);function dG(t,e){return t===e}function cl(t,e=s=>s,n){const s=(n==null?void 0:n.compare)??dG,i=_.useCallback(r=>{const{unsubscribe:a}=t.subscribe(r);return a},[t]),o=_.useCallback(()=>t.get(),[t]);return wC.useSyncExternalStoreWithSelector(i,o,o,e,s)}var Hk={};function L6(t,e){const n=_.useRef();return s=>{const i=t!=null&&t.select?t.select(s):s;return(t==null?void 0:t.structuralSharing)??e.options.defaultStructuralSharing?n.current=Ra(n.current,i):i}}function Eu(t){const e=Wi(),n=_.useContext(t.from?eG:$y),s=t.from??n,i=e.stores.getMatchStore(s),o=L6(t,e),r=cl(i,a=>a?o(a):Hk);if(r!==Hk)return r;(t.shouldThrow??!0)&&hC()}function I6(t){return Eu({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function D6(t){const{select:e,...n}=t;return Eu({...n,select:s=>e?e(s.loaderDeps):s.loaderDeps})}function j6(t){return Eu({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n}})}function P6(t){return Eu({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function hm(t){const e=Wi();return _.useCallback(n=>e.navigate({...n,from:n.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}function w_e(t){const e=Wi(),n=hm(),s=_.useRef(null);return dC(()=>{s.current!==t&&(n(t),s.current=t)},[e,t,n]),null}function z6(t){return Eu({...t,select:e=>t.select?t.select(e.context):e.context})}function fG(...t){const e=_.useRef(t),n=e.current;return t.forEach((s,i)=>{Jr(n[i],s,!1,!0)||(n[i]=s)}),e.current}function T0(t,e){t.preloadRoute(e).catch(n=>{console.warn(n),console.warn(GW)})}var hG={compare:(t,e)=>t[0]===e[0]&&t[1]===e[1]};function pG(t,e){const n=typeof t=="string"&&Cp(t);if(n)return e.has(n)?t:null}function mG(t,e,n,s,i){const o=yk(t.pathname,s),r=yk(e.pathname,s);return(n!=null&&n.exact?o!==r:!(o.startsWith(r)&&(o.length===r.length||o[r.length]==="/")))||((n==null?void 0:n.includeSearch)??!0)&&!Jr(t.search,e.search,!(n!=null&&n.exact),n==null?void 0:n.explicitUndefined)?!1:n!=null&&n.includeHash?i&&t.hash===e.hash:!0}function gG(t,e,n){const s=Wi(),i=_.useRef(null),o=_.useCallback(te=>{if(i.current=te,typeof e=="function")return e(te);e&&(e.current=te)},[e]),{activeOptions:r,to:a,preload:c,preloadDelay:d,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:g,viewTransition:y,ignoreBlocker:v,disabled:S,target:w,onClick:N,onBlur:C,onFocus:T,onMouseEnter:R,onMouseLeave:A,onTouchStart:k}=t,M=R6(),[L,j,D]=fG(t.search,t.params,r),[P,B]=_.useMemo(()=>[t,{...t}],[s,t.from,t._fromLocation,t.hash,t.to,L,j,t.state,t.mask,t.unsafeRelative]),I=_.useCallback(te=>{const Q=pG(a,s.protocolAllowlist);if(Q!==void 0)return[Q??void 0];P._fromLocation||(B._fromLocation=te);const se=s.buildLocation(B),ae=SG(se,s,S);return[ae,!S&&(!ae||Cp(ae))?void 0:mG(te,se,D,s.basepath,M)]},[D,S,M,P,B,s,a]),[F,z]=cl(s.stores.location,I,hG),U=z===void 0?F:void 0,H=S||F===void 0,V=_.useRef(!1),W=t.reloadDocument||U||H?!1:c??s.options.defaultPreload,G=d??s.options.defaultPreloadDelay??0,Y=_.useCallback(te=>{const Q=te==null?void 0:te.isIntersecting;if(!(Q??W==="intent")){Q===!1&&Mv(i);return}if(!G){T0(s,P);return}dp.has(i)||dp.set(i,setTimeout(()=>{dp.delete(i),T0(s,P)},G))},[s,P,i,W,G]);_.useEffect(()=>{W==="render"&&!V.current&&(V.current=!0,T0(s,P));let te;return W==="viewport"&&i.current&&typeof IntersectionObserver=="function"&&(te=new IntersectionObserver(Q=>Y(Q.pop()),{rootMargin:"100px"}),te.observe(i.current)),()=>{te==null||te.disconnect(),Mv(i)}},[s,P,W,Y,i]);const J=xG(t,n);if(J.ref=e?o:i,U)return J.href=U,J;const q=te=>{const Q=w??te.currentTarget.getAttribute("target");!H&&!(te.metaKey||te.altKey||te.ctrlKey||te.shiftKey)&&!te.defaultPrevented&&(!Q||Q==="_self")&&te.button===0&&(te.preventDefault(),s.navigate({...P,replace:p,resetScroll:g,hashScrollIntoView:f,startTransition:m,viewTransition:y,ignoreBlocker:v}))},X=()=>{W==="intent"&&T0(s,P)},Z=()=>{W==="intent"&&Mv(i)};return J.onClick=xd(N,q),J.onBlur=xd(C,Z),J.onFocus=xd(T,Y),J.onMouseEnter=xd(R,Y),J.onMouseLeave=xd(A,Z),J.onTouchStart=xd(k,X),vG(J,t,z,F,H,n)}var yG={},bG={className:"active"},B6=new Set(["to","params","search","hash","state","mask","from","unsafeRelative","_fromLocation","reloadDocument","preload","preloadDelay","preloadIntentProximity","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","ignoreBlocker","activeProps","inactiveProps","activeOptions","_asChild"]);function xG(t,e){const n={};for(const s in t)B6.has(s)||s==="type"&&e!==void 0||s==="disabled"&&e==="a"||(n[s]=t[s]);return n}function vG(t,e,n,s,i,o){const{activeProps:r,inactiveProps:a,className:c,style:d,target:f}=e,p=l6(n?r:a,{})??(n?bG:yG);Object.assign(t,p),t.href=s,o!=="a"&&(t.disabled=i),t.target=f;const m=p.style;(d||m)&&(t.style=d&&m?{...d,...m}:d||m);const g=p.className;return(c||g)&&(t.className=c?g?`${c} ${g}`:c:g),i&&(t.role="link",t["aria-disabled"]=!0),n&&(t["data-status"]="active",t["aria-current"]="page"),t}var dp=new WeakMap,Mv=t=>{clearTimeout(dp.get(t)),dp.delete(t)},xd=(t,e)=>t?n=>n.defaultPrevented||(t(n),n.defaultPrevented||e(n)):e;function SG(t,e,n){if(n)return;const s=t.maskedLocation??t,i=s.external?s.publicHref:e.history.createHref(s.publicHref)||"/";if(!((s.external||i!==s.publicHref)&&u6(i,e.protocolAllowlist)))return i}var rr=_.memo(_.forwardRef((t,e)=>{const n=t._asChild||"a",s=gG(t,e,n),i=typeof t.children=="function"?t.children({isActive:s["data-status"]==="active"}):t.children;return _.createElement(n,s,i)}),wG);function wG(t,e){let n=0;for(const s in e)if(n++,t[s]!==e[s]&&(!B6.has(s)||!Jr(t[s],e[s],!1,!0)))return!1;for(const s in t)n--;return n===0}var EG=class extends O6{constructor(e){super(e),this.useMatch=n=>Eu({...n,from:this.id}),this.useRouteContext=n=>z6({...n,from:this.id}),this.useSearch=n=>P6({...n,from:this.id}),this.useParams=n=>j6({...n,from:this.id}),this.useLoaderDeps=n=>D6({...n,from:this.id}),this.useLoaderData=n=>I6({...n,from:this.id}),this.useNavigate=()=>hm({from:this.fullPath}),this.Link=Oo.forwardRef((n,s)=>b.jsx(rr,{ref:s,from:this.fullPath,...n}))}};function CG(t){return new EG(t)}function NG(){return t=>OG(t)}var TG=class extends KW{constructor(t){super(t),this.useMatch=e=>Eu({...e,from:this.id}),this.useRouteContext=e=>z6({...e,from:this.id}),this.useSearch=e=>P6({...e,from:this.id}),this.useParams=e=>j6({...e,from:this.id}),this.useLoaderDeps=e=>D6({...e,from:this.id}),this.useLoaderData=e=>I6({...e,from:this.id}),this.useNavigate=()=>hm({from:this.fullPath}),this.Link=Oo.forwardRef((e,n)=>b.jsx(rr,{ref:n,from:this.fullPath,...e}))}};function OG(t){return new TG(t)}function Ci(t){return e=>{const n=CG(e);return n.isRoot=!1,n}}function Dn(t,e){let n,s,i;const o=()=>(n||(i=void 0,n=t().then(a=>{n=void 0,r.preload=void 0,s=a[e??"default"]}).catch(a=>{n=void 0,i=a})),n),r=function(c){if(i){if(Gq(i)&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(d))throw sessionStorage.setItem(d,"1"),window.location.reload(),new Promise(()=>{})}throw i}if(!s)if(mk)mk(o());else throw o();return _.createElement(s,c)};return r.preload=o,r}function RG(t){const e=Wi(),n=`not-found-${cl(e.stores.location,s=>s.pathname)}-${cl(e.stores.status)}`;return b.jsx(SC,{getResetKey:()=>n,onCatch:(s,i)=>{var o;if(uf(s))(o=t.onCatch)==null||o.call(t,s,i);else throw s},errorComponent:({error:s})=>{var i;if(uf(s))return(i=t.fallback)==null?void 0:i.call(t,s);throw s},children:t.children})}function kG(){return b.jsx("p",{children:"Not Found"})}function Td(t){return b.jsx(b.Fragment,{children:t.children})}function $6(t,e,n){return e.options.notFoundComponent?b.jsx(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?b.jsx(t.options.defaultNotFoundComponent,{...n}):b.jsx(kG,{})}function Fy(t,e){const n=(e==null?void 0:e.options.pendingComponent)??t.options.defaultPendingComponent;return n?b.jsx(n,{}):null}var AG=(t,e)=>t[0]===e[0]&&t[1]===e[1],F6=(t,e,n)=>!e.isRoot||e.options.shellComponent||e.options.wrapInSuspense||n===!1||n==="data-only"||!t.ssr,H6=_.memo(function({routeId:e}){const n=Wi();return b.jsx(_G,{router:n,match:cl(n.stores.getMatchStore(e))})});function _G({router:t,match:e}){var p,m;const n=t.routesById[e.routeId],s=Fy(t,n),i=n.options.errorComponent??t.options.defaultErrorComponent,o=n.options.onCatch??t.options.defaultOnCatch,r=n.isRoot?n.options.notFoundComponent??((p=t.options.notFoundRoute)==null?void 0:p.options.component):n.options.notFoundComponent,a=e.ssr===!1||e.ssr==="data-only",c=F6(t,n,e.ssr)&&(n.options.wrapInSuspense??s??(((m=n.options.errorComponent)==null?void 0:m.preload)||a))?_.Suspense:Td,d=i?SC:Td,f=r?RG:Td;return b.jsxs(n.isRoot?n.options.shellComponent??Td:Td,{children:[b.jsx($y.Provider,{value:e.routeId,children:b.jsx(c,{fallback:s,children:b.jsx(d,{getResetKey:()=>e,errorComponent:i,onCatch:(g,y)=>{if(uf(g))throw g.routeId??(g.routeId=e.routeId),g;o==null||o(g,y)},children:b.jsx(f,{fallback:g=>{if(g.routeId??(g.routeId=e.routeId),g.routeId!==e.routeId)throw g;return _.createElement(r,g)},children:a?b.jsx(ZW,{fallback:s,children:b.jsx(Uk,{match:e})}):b.jsx(Uk,{match:e})})})})}),null]})}var Uk=_.memo(function({match:e}){const n=Wi(),s=e.routeId,i=n.routesById[s],o=_.useMemo(()=>{var c;const a=(c=i.options.remountDeps??n.options.defaultRemountDeps)==null?void 0:c({routeId:s,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return a?JSON.stringify(a):void 0},[s,e.loaderDeps,e._strictParams,e._strictSearch,i.options.remountDeps,n.options.defaultRemountDeps]),r=_.useMemo(()=>{const a=i.options.component??n.options.defaultComponent;return a?b.jsx(a,{},o):b.jsx(U6,{})},[o,i.options.component,n.options.defaultComponent]);if(e.status==="pending"){if(n.ssr&&!F6(n,i,e.ssr))return r;if(n._tx)throw n._tx[5];return Fy(n,i)}if(e.status==="notFound")return $6(n,i,e.error);if(e.status==="error")throw e.error;return r}),U6=_.memo(function(){const e=Wi(),n=_.useContext($y);let s,i,o;{const a=e.stores.getMatchStore(n);[s,i]=cl(a,c=>[!!c._notFound,c.error],{compare:AG}),o=cl(e.stores.ids,c=>c[c.indexOf(n)+1])}if(s)return $6(e,e.routesById[n],i);if(!o)return null;const r=b.jsx(H6,{routeId:o});return n===Pd?b.jsx(_.Suspense,{fallback:Fy(e),children:r}):r});function V6(t,e){const n=t[1];t.length=0,n==null||n(e)}function MG({t}){const e=Wi(),n=e._rendered??(e._rendered=[]);return e.startTransition=(s,i)=>new Promise(o=>{V6(n,!1),n.push(i,o),t(e),_.startTransition(s)}),dC(()=>{const s=e.history.subscribe(e.load);e.updateLatestLocation();const i=e.latestLocation,o=e.buildLocation({to:i.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(or(i.publicHref)!==or(o.publicHref))return e.commitLocation({...o,replace:!0,ignoreBlocker:!0}),s;const r=e.stores.resolvedLocation.get();return(r==null?void 0:r.href)===i.href&&r.state.__TSR_key===i.state.__TSR_key?n.push(e.stores.matches.get(),a=>{a&&e.emit({type:"onRendered",...zy(r,r)})}):e._tx||e.load({sync:!0}).catch(console.error),s},[e,e.history]),null}function LG(){const t=Wi(),e=t.routesById[Pd],n=Fy(t,e),s=t.ssr?Td:_.Suspense,i=b.jsxs(b.Fragment,{children:[b.jsx(MG,{t:_.useState()[1]}),b.jsx(s,{fallback:n,children:b.jsx(IG,{})})]});return t.options.InnerWrap?b.jsx(t.options.InnerWrap,{children:i}):i}function IG(){const t=Wi(),e=t._rendered,n=cl(t.stores.matches,r=>e[0]??r),s=n[0],i=s==null?void 0:s.routeId;dC(()=>{e[0]===n&&V6(e,!0)},[e,n]);const o=i?b.jsx(H6,{routeId:i}):null;return b.jsx($y.Provider,{value:i,children:t.options.disableGlobalCatchBoundary?o:b.jsx(SC,{getResetKey:()=>s,onCatch:void 0,children:o})})}function Lv(t){const e=Wi();return cl(e.stores.matches,L6(t,e))}var DG=t=>({createMutableStore:Pk,createReadonlyStore:Pk,batch:oG}),jG=t=>new PG(t),PG=class extends MW{constructor(t){super(t,DG)}};function zG({router:t,children:e,...n}){a6(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const s=b.jsx(k6.Provider,{value:t,children:e});return t.options.Wrap?b.jsx(t.options.Wrap,{children:s}):s}function BG({router:t,...e}){return b.jsx(zG,{router:t,...e,children:b.jsx(LG,{})})}var Iv={exports:{}},Dv={};/**
68
+ * @license React
69
+ * react-compiler-runtime.production.js
70
+ *
71
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var Vk;function $G(){if(Vk)return Dv;Vk=1;var t=Af().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Dv.c=function(e){return t.H.useMemoCache(e)},Dv}var qk;function FG(){return qk||(qk=1,Iv.exports=$G()),Iv.exports}var ee=FG();const q6=_.createContext(null),HG="flightplan.color-theme",EC="data-theme",W6="(prefers-color-scheme: dark)",UG=t=>t==="light"||t==="dark",VG=t=>{try{return localStorage.setItem(HG,t),!0}catch{return!1}},qG=t=>{document.documentElement.setAttribute(EC,t)},WG=t=>t==="dark"?"light":"dark",GG=t=>{const e=new MutationObserver(t);return e.observe(document.documentElement,{attributeFilter:[EC]}),()=>{e.disconnect()}},KG=()=>{const t=document.documentElement.getAttribute(EC);return UG(t)?t:null},YG=t=>{const e=window.matchMedia(W6);return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},XG=()=>window.matchMedia(W6).matches?"dark":"light",G6=()=>{const t=ee.c(5),e=_.useSyncExternalStore(GG,KG),n=_.useSyncExternalStore(YG,XG),s=e??n;let i;t[0]!==s?(i=()=>{const r=WG(s);VG(r),qG(r)},t[0]=s,t[1]=i):i=t[1];let o;return t[2]!==i||t[3]!==s?(o={theme:s,onToggle:i},t[2]=i,t[3]=s,t[4]=o):o=t[4],o},Wk=160,K6=t=>{const e=ee.c(2),{src:n}=t;let s;return e[0]!==n?(s=b.jsx("img",{src:n,alt:"",width:Wk,height:Wk,className:"size-40"}),e[0]=n,e[1]=s):s=e[1],s};function Hy(){return typeof window<"u"}function zs(t){return CC(t)?(t.nodeName||"").toLowerCase():"#document"}function In(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hl(t){var e;return(e=(CC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function CC(t){return Hy()?t instanceof Node||t instanceof In(t).Node:!1}function Pt(t){return Hy()?t instanceof Element||t instanceof In(t).Element:!1}function gn(t){return Hy()?t instanceof HTMLElement||t instanceof In(t).HTMLElement:!1}function df(t){return!Hy()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof In(t).ShadowRoot}function pm(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=Ui(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function QG(t){return/^(table|td|th)$/.test(zs(t))}function Uy(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const ZG=/transform|translate|scale|rotate|perspective|filter/,JG=/paint|layout|strict|content/,kc=t=>!!t&&t!=="none";let jv;function NC(t){const e=Pt(t)?Ui(t):t;return kc(e.transform)||kc(e.translate)||kc(e.scale)||kc(e.rotate)||kc(e.perspective)||!TC()&&(kc(e.backdropFilter)||kc(e.filter))||ZG.test(e.willChange||"")||JG.test(e.contain||"")}function eK(t){let e=ul(t);for(;gn(e)&&!tl(e);){if(NC(e))return e;if(Uy(e))return null;e=ul(e)}return null}function TC(){return jv==null&&(jv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),jv}function tl(t){return/^(html|body|#document)$/.test(zs(t))}function Ui(t){return In(t).getComputedStyle(t)}function Vy(t){return Pt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ul(t){if(zs(t)==="html")return t;const e=t.assignedSlot||t.parentNode||df(t)&&t.host||hl(t);return df(e)?e.host:e}function Y6(t){const e=ul(t);return tl(e)?(t.ownerDocument||t).body:gn(e)&&pm(e)?e:Y6(e)}function kp(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Y6(t),o=i===((s=t.ownerDocument)==null?void 0:s.body),r=In(i);if(o){const a=fw(r);return e.concat(r,r.visualViewport||[],pm(i)?i:[],a&&n?kp(a):[])}else return e.concat(i,kp(i,[],n))}function fw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const OC={...nq},Gk={};function Bs(t,e){const n=_.useRef(Gk);return n.current===Gk&&(n.current=t(e)),n}const Pv=OC.useInsertionEffect,tK=Pv&&Pv!==OC.useLayoutEffect?Pv:t=>t();function Ye(t){const e=Bs(nK).current;return e.next=t,tK(e.effect),e.trampoline}function nK(){const t={next:void 0,callback:sK,trampoline:(...e)=>{var n;return(n=t.callback)==null?void 0:n.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function sK(){}const iK=()=>{},Ue=typeof document<"u"?_.useLayoutEffect:iK;function hw(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const RC={};function nl(t,e,n,s,i){if(!n&&!s&&!i&&!t)return F1(e);let o=F1(t);return e&&(o=Jh(o,e)),n&&(o=Jh(o,n)),s&&(o=Jh(o,s)),i&&(o=Jh(o,i)),o}function oK(t){if(t.length===0)return RC;if(t.length===1)return F1(t[0]);let e=F1(t[0]);for(let n=1;n<t.length;n+=1)e=Jh(e,t[n]);return e}function F1(t){return kC(t)?{...Q6(t,RC)}:rK(t)}function Jh(t,e){return kC(e)?Q6(e,t):lK(t,e)}function rK(t){const e={...t};for(const n in e){const s=e[n];X6(n,s)&&(e[n]=Z6(s))}return e}function lK(t,e){if(!e)return t;for(const n in e){const s=e[n];switch(n){case"style":{t[n]=hw(t.style,s);break}case"className":{t[n]=J6(t.className,s);break}default:X6(n,s)?t[n]=aK(t[n],s):t[n]=s}}return t}function X6(t,e){const n=t.charCodeAt(0),s=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&s===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function kC(t){return typeof t=="function"}function Q6(t,e){return kC(t)?t(e):t??RC}function aK(t,e){return e?t?(...n)=>{const s=n[0];if(eD(s)){const o=s;H1(o);const r=e(...n);return o.baseUIHandlerPrevented||t==null||t(...n),r}const i=e(...n);return t==null||t(...n),i}:Z6(e):t}function Z6(t){return t&&((...e)=>{const n=e[0];return eD(n)&&H1(n),t(...e)})}function H1(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function J6(t,e){return e?t?e+" "+t:e:t}function eD(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function cK(t,e){return function(s,...i){const o=new URL(t);return o.searchParams.set("code",s.toString()),i.forEach(r=>o.searchParams.append("args[]",r)),`${e} error #${s}; visit ${o} for the full message.`}}const yn=cK("https://base-ui.com/production-error","Base UI"),tD=_.createContext(void 0);function AC(t=!1){const e=_.useContext(tD);if(e===void 0&&!t)throw new Error(yn(16));return e}function uK(t){const{focusableWhenDisabled:e,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:o}=t,r=s&&e!==!1,a=s&&e===!1;return{props:_.useMemo(()=>{const d={onKeyDown(f){n&&e&&f.key!=="Tab"&&f.preventDefault()}};return s||(d.tabIndex=i,!o&&n&&(d.tabIndex=e?i:-1)),(o&&(e||r)||!o&&n)&&(d["aria-disabled"]=n),o&&(!e||a)&&(d.disabled=n),d},[s,n,e,r,a,o,i])}}function en(t){return(t==null?void 0:t.ownerDocument)||document}function y1(t,e,{detail:n=0}={}){t.dispatchEvent(new(In(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function Cu(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0,composite:o}=t,r=_.useRef(null),a=AC(!0),c=o??a!==void 0,{props:d}=uK({focusableWhenDisabled:n,disabled:e,composite:c,tabIndex:s,isNativeButton:i}),f=_.useCallback(()=>{const g=r.current;zv(g)&&c&&e&&d.disabled===void 0&&g.disabled&&(g.disabled=!1)},[e,d.disabled,c]);Ue(f,[f]);const p=_.useCallback((g={})=>{const{onClick:y,onMouseDown:v,onKeyUp:S,onKeyDown:w,onPointerDown:N,...C}=g;return nl({onClick(T){if(e){T.preventDefault();return}y==null||y(T)},onMouseDown(T){e||v==null||v(T)},onKeyDown(T){if(e||(H1(T),w==null||w(T),T.baseUIHandlerPrevented))return;const R=T.target===T.currentTarget,A=T.currentTarget,k=zv(A),M=!i&&dK(A),L=R&&(i?k:!M),j=T.key==="Enter",D=T.key===" ",P=A.getAttribute("role"),B=(P==null?void 0:P.startsWith("menuitem"))||P==="option"||P==="gridcell";if(R&&c&&D){if(T.defaultPrevented&&B)return;T.preventDefault(),(!i||k)&&(T.preventBaseUIHandler(),y1(A,T));return}if(!L||i||!D&&!j){R&&M&&D&&T.preventDefault();return}T.defaultPrevented||(T.preventDefault(),j&&(T.preventBaseUIHandler(),y1(A,T)))},onKeyUp(T){if(!e){if(H1(T),S==null||S(T),T.target===T.currentTarget&&i&&c&&zv(T.currentTarget)&&T.key===" "){T.preventDefault();return}T.baseUIHandlerPrevented||T.target===T.currentTarget&&!i&&!c&&!T.defaultPrevented&&T.key===" "&&(T.preventBaseUIHandler(),y1(T.currentTarget,T))}},onPointerDown(T){if(e){T.preventDefault();return}N==null||N(T)}},i?{type:"button"}:{role:"button"},d,C)},[e,d,c,i]),m=Ye(g=>{r.current=g,f()});return{getButtonProps:p,buttonRef:m}}function zv(t){return gn(t)&&t.tagName==="BUTTON"}function dK(t){return gn(t)&&t.tagName==="A"&&!!t.href}function Fa(t,e,n,s){const i=Bs(nD).current;return hK(i,t,e,n,s)&&sD(i,[t,e,n,s]),i.callback}function fK(t){const e=Bs(nD).current;return pK(e,t)&&sD(e,t),e.callback}function nD(){return{callback:null,cleanup:null,refs:[]}}function hK(t,e,n,s,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==s||t.refs[3]!==i}function pK(t,e){return t.refs.length!==e.length||t.refs.some((n,s)=>n!==e[s])}function sD(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const s=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const o=e[i];if(o!=null)switch(typeof o){case"function":{const r=o(n);typeof r=="function"&&(s[i]=r);break}case"object":{o.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const o=e[i];if(o!=null)switch(typeof o){case"function":{const r=s[i];typeof r=="function"?r():o(null);break}case"object":{o.current=null;break}}}}}}}const mK=parseInt(_.version,10);function _C(t){return mK>=t}function Kk(t){if(!_.isValidElement(t))return null;const e=t,n=e.props;return(_C(19)?n==null?void 0:n.ref:e.ref)??null}function ss(){}const Ha=Object.freeze([]),Ln=Object.freeze({});function gK(t,e){const n={};for(const s in t){const i=t[s];if(e!=null&&e.hasOwnProperty(s)){const o=e[s](i);o!=null&&Object.assign(n,o);continue}i===!0?n[`data-${s.toLowerCase()}`]="":i&&(n[`data-${s.toLowerCase()}`]=i.toString())}return n}function yK(t,e){return typeof t=="function"?t(e):t}function iD(t,e){return typeof t=="function"?t(e):t}function Qt(t,e,n={}){let s=e.render;n.enabled!==!1&&(s=SK(s));const i=bK(e,n,s);if(n.enabled===!1)return null;const o=n.state??Ln;return wK(t,s,i,o)}function bK(t,e,n){const{className:s,style:i}=t,{state:o=Ln,ref:r,props:a,stateAttributesMapping:c,enabled:d=!0}=e,f=d?yK(s,o):void 0,p=d?iD(i,o):void 0,m=d?gK(o,c):Ln,g=d&&a?xK(a):void 0,y=d?hw(m,g)??{}:Ln;return typeof document<"u"&&(d?Array.isArray(r)?y.ref=fK([y.ref,Kk(n),...r]):y.ref=Fa(y.ref,Kk(n),r):Fa(null,null)),d?(f!==void 0&&(y.className=J6(y.className,f)),p!==void 0&&(y.style=hw(y.style,p)),y):Ln}function xK(t){return Array.isArray(t)?oK(t):nl(void 0,t)}const vK=Symbol.for("react.lazy");function SK(t){if((t==null?void 0:t.$$typeof)!==vK)return t;const e=_.Children.toArray(t)[0];return _.isValidElement(e)?e:t}function wK(t,e,n,s){if(e){if(typeof e=="function")return e(n,s);const i=nl(n,e.props);return i.ref=n.ref,_.cloneElement(e,i)}if(t&&typeof t=="string")return EK(t,n);throw new Error(yn(8))}function EK(t,e){return t==="button"?_.createElement("button",{type:"button",...e,key:e.key}):t==="img"?_.createElement("img",{alt:"",...e,key:e.key}):_.createElement(t,e)}const CK=_.forwardRef(function(e,n){const{render:s,className:i,disabled:o=!1,focusableWhenDisabled:r=!1,nativeButton:a=!0,style:c,...d}=e,{getButtonProps:f,buttonRef:p}=Cu({disabled:o,focusableWhenDisabled:r,native:a});return Qt("button",e,{state:{disabled:o},ref:[n,p],props:[d,f]})});function oD(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=oD(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function NK(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=oD(t))&&(s&&(s+=" "),s+=e);return s}const Yk=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Xk=NK,TK=(t,e)=>n=>{var s;if((e==null?void 0:e.variants)==null)return Xk(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,r=Object.keys(i).map(d=>{const f=n==null?void 0:n[d],p=o==null?void 0:o[d];if(f===null)return null;const m=Yk(f)||Yk(p);return i[d][m]}),a=n&&Object.entries(n).reduce((d,f)=>{let[p,m]=f;return m===void 0||(d[p]=m),d},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((d,f)=>{let{class:p,className:m,...g}=f;return Object.entries(g).every(y=>{let[v,S]=y;return Array.isArray(S)?S.includes({...o,...a}[v]):{...o,...a}[v]===S})?[...d,p,m]:d},[]);return Xk(t,r,c,n==null?void 0:n.class,n==null?void 0:n.className)},rD=48,mr=(t,e=0)=>{const n=new Int32Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s)-rD-e;return n},qy=t=>{const e=new Int32Array(t.length+1);for(let n=0;n<t.length;n++)e[n+1]=e[n]+t[n];return e},Ua=t=>{const e=new Int32Array(t.length);let n=0;for(let s=0;s<t.length;s++){const i=t.charCodeAt(s)-rD;n+=i>>>1^-(i&1),e[s]=n}return e},OK=384,RK=[],Mc=qy(mr("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),kK=qy(mr(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),AK="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",_K=(()=>{const t=Mc.length-1,e=new Int32Array(t);for(let i=t-1;i>=0;i--){let o=1,r=i+1;for(let a=Mc[i];a<Mc[i+1];a++)o+=e[r],r+=e[r];e[i]=o}const n=new Int32Array(Mc[t]);let s=0;for(let i=0;i<t;i++){let o=i+1;for(let r=Mc[i];r<Mc[i+1];r++)n[s++]=o,o+=e[o]}return n})(),MK=mr("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),LK=qy(mr("123333359346463635126536711576")),IK=mr("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),DK=mr("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),jK=Ua("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),PK=(()=>{const t=new Int32Array(319).fill(-1),e=Ua("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),n=Ua("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let s=0;s<e.length;s++)t[e[s]]=n[s];return t})(),zK="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(t=>{const e=t.split(" "),n=e.shift();for(let s=0;s<e.length;s++)e[s]=n+e[s];return e}),Qk=Ua("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),BK=Ua("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),$K=Ua("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),lD=new Int32Array(995),aD=new Int32Array(995),cD=new Int32Array(995);let pw="";const mw=new Int32Array(1038);{const t=new Map;let e=0,n=0;for(let s=0;s<Qk.length;s++)for(const i of zK[$K[s]]){let o=t.get(i);o===void 0&&(o=e++,t.set(i,o),mw[o*2]=pw.length,mw[o*2+1]=i.length,pw+=i),lD[n]=Qk[s],aD[n]=BK[s],cD[n]=o,n++}}const FK=Ua("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),HK=qy(mr("1::24444432:442:44:44>222222:44:4421322511111311111114")),UK=Ua("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),VK=mr("ij"),qK=mr("—"),WK=mr("1"),GK="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var KK={GROUP_COUNT:OK,customValidatorNames:RK,edgeStart:Mc,labelStart:kK,labelText:AK,edgeTarget:_K,nodeGroup:MK,nodeVlist:PK,vlistPat:LK,vlistOps:IK,vlistRef:DK,vlistGroup:jK,litAnchor:lD,litGroup:aD,litPool:cD,poolOffsets:mw,poolText:pw,adjGid:FK,adjStart:HK,adjTgt:UK,patGid:VK,patTgt:qK,postfixLookupGroups:WK,orderSensitiveModifiers:GK};const YK="line"in new Error,Xo=-1,Ac=-1,Bv=(t,e,n)=>{let s=2166136261;for(let i=e;i<n;i++)s=Math.imul(s^t.charCodeAt(i),16777619);return s},b1=(t,e,n)=>{const s=n-e;let i=Math.imul(s,2654435761)^t.charCodeAt(e);if(s>3){const o=s>>2,r=s>>1;i=Math.imul(i^t.charCodeAt(e+1)<<8^t.charCodeAt(e+2)<<16^t.charCodeAt(e+o),2246822507),i=Math.imul(i^t.charCodeAt(e+r)<<8^t.charCodeAt(e+r+o)<<16^t.charCodeAt(n-3),3266489909),i^=t.charCodeAt(n-2)<<8^t.charCodeAt(n-1)<<16;for(let a=e+3,c=n-4;a<e+8&&a<c;a++,c--)i=Math.imul(i^t.charCodeAt(a)^t.charCodeAt(c)<<8,16777619)}return i^i>>>15|0},XK=(t,e,n={})=>{const{GROUP_COUNT:s,edgeStart:i,labelStart:o,labelText:r,edgeTarget:a,nodeGroup:c,nodeVlist:d,vlistPat:f,vlistOps:p,vlistRef:m,vlistGroup:g,litAnchor:y,litGroup:v,litPool:S,poolOffsets:w,poolText:N,adjGid:C,adjStart:T,adjTgt:R,patGid:A,patTgt:k,postfixLookupGroups:M,customValidatorNames:L,orderSensitiveModifiers:j}=t,D=new Int32Array(s).fill(-1);for(let me=0;me<C.length;me++)D[C[me]]=me;let P=0;for(let me=0;me+1<T.length;me++){const Le=T[me+1]-T[me];Le>P&&(P=Le)}let B=32;for(;B<2*(1+P+A.length);)B<<=1;const I=new Int32Array(m.length+1);for(let me=0;me<m.length;me++)I[me+1]=I[me]+f[m[me]+1]-f[m[me]];const F=new Uint8Array(s);for(let me=0;me<M.length;me++)F[M[me]]=1;const z=i.length-1,U=new Uint8Array(z);let H=0,V=!0;for(let me=0;me<y.length;me++){U[y[me]]=1;const Le=w[S[me]*2+1];Le>H&&(H=Le);const De=N.charCodeAt(w[S[me]*2]);(De===91||De===40)&&(V=!1)}let W=1;for(;W<y.length*2;)W<<=1;const G=new Int32Array(W).fill(-1);for(let me=0;me<y.length;me++){const Le=w[S[me]*2];let De=(Bv(N,Le,Le+w[S[me]*2+1])^Math.imul(y[me],2654435761)|0)&W-1;for(;G[De]!==-1;)De=De+1&W-1;G[De]=me}const Y=(me,Le,De,Je)=>{let gt=(Bv(Le,De,Je)^Math.imul(me,2654435761)|0)&W-1;const pt=Je-De;for(;;){const wt=G[gt];if(wt===-1)return-1;if(y[wt]===me&&w[S[wt]*2+1]===pt){const an=w[S[wt]*2];let tn=!0;for(let lt=0;lt<pt;lt++)if(N.charCodeAt(an+lt)!==Le.charCodeAt(De+lt)){tn=!1;break}if(tn)return v[wt]}gt=gt+1&W-1}},J=n.cacheSize??8192,q=n.prefix??t.prefix??"",X=q===""?"":q+":",Z=X.length,te=(L??[]).map(me=>{throw new Error("cn: missing validator "+me)}),Q=/\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$/,se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,le=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let ne=0,fe=-1,ve=-1,we=-1,Ce=-1;const ye=me=>me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95,Oe=me=>/\s/.test(String.fromCharCode(me)),be=(me,Le,De)=>{if(ne=0,fe=-1,De-Le<3)return;const Je=me.charCodeAt(Le),gt=me.charCodeAt(De-1);if(Je===91&&gt===93)ne=1;else if(Je===40&&gt===41)ne=2;else return;we=Le+1,Ce=De-1;let pt=Le+1;if(ye(me.charCodeAt(pt))){for(pt++;pt<De-1;){const wt=me.charCodeAt(pt);if(!ye(wt)&&wt!==45)break;pt++}pt<De-2&&me.charCodeAt(pt)===58&&(fe=Le+1,ve=pt,we=pt+1)}},_e=(me,Le,De,Je)=>{if(De-Le!==Je.length)return!1;for(let gt=0;gt<Je.length;gt++)if(me.charCodeAt(Le+gt)!==Je.charCodeAt(gt))return!1;return!0},Me=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,He=me=>!!me&&!Number.isNaN(Number(me)),Ae=(me,Le,De)=>{if(De-Le<11||!_e(me,Le,Le+10,"@container"))return!1;if(me.charCodeAt(Le+10)===47)return De-Le>=12;const Je=me.charCodeAt(Le+11);return Je===115&&De-Le>=17&&_e(me,Le+10,Le+16,"-size/")||Je===110&&De-Le>=19&&_e(me,Le+10,Le+18,"-normal/")},Ee=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ne="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(me=>me.split(" ")),xe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Pe=(me,Le,De,Je)=>{if(me>=10){if(me>=25)return te[me-25](Le.slice(De,Je));const gt=me-10;if(ne!==Ee[gt])return!1;if(fe>=0){for(const pt of Ne[gt])if(_e(Le,fe,ve,pt))return!0;return!1}switch(xe[gt]){case 0:return!1;case 1:return!0;case 2:{const pt=Le.slice(we,Ce);return Q.test(pt)&&!se.test(pt)}case 3:return He(Le.slice(we,Ce));case 4:return le.test(Le.slice(we,Ce));default:return ae.test(Le.slice(we,Ce))}}switch(me){case 0:return!0;case 1:return ne===0;case 2:return ne===1;case 3:return ne===2;case 4:return Me.test(Le.slice(De,Je));case 5:return He(Le.slice(De,Je));case 6:{const gt=Le.slice(De,Je);return!!gt&&Number.isInteger(Number(gt))}case 7:return Je>De&&Le.charCodeAt(Je-1)===37&&He(Le.slice(De,Je-1));case 8:return Be.test(Le.slice(De,Je));default:return Ae(Le,De,Je)}},We=new Set(typeof j=="string"?j.split(" "):j),et=(me,Le,De,Je,gt,pt)=>{const wt=Bv(Le,De,Je)^(gt?2654435769:0)|0;let an=me.get(wt);if(an!==void 0)e:for(let Nt=0;Nt<an.length;Nt++){const Jt=an[Nt];if(!(Jt.imp!==gt||Jt.k.length!==Je-De)){for(let dt=0;dt<Jt.k.length;dt++)if(Jt.k.charCodeAt(dt)!==Le.charCodeAt(De+dt))continue e;return Jt.id}}else me.set(wt,an=[]);const tn=Le.slice(De,Je),lt=pt(tn);return an.push({k:tn,imp:gt,id:lt}),lt};let At=new Map,ze=new Map,Te=2;const qe=4096,ot=(me,Le)=>{const De=[];let Je=0,gt=0,pt=0;for(let lt=0;lt<me.length;lt++){const Nt=me.charCodeAt(lt);Je===0&&gt===0&&Nt===58?(De.push(me.slice(pt,lt)),pt=lt+1):Nt===91?Je++:Nt===93?Je--:Nt===40?gt++:Nt===41&&gt--}De.push(me.slice(pt));let wt=De[0];if(De.length>1){const lt=[];let Nt=[];for(const Jt of De)Jt.charCodeAt(0)===91||We.has(Jt)?(Nt.length&&(lt.push(...Nt.sort()),Nt=[]),lt.push(Jt)):Nt.push(Jt);Nt.length&&lt.push(...Nt.sort()),wt=lt.join(":")}const an=Le?wt+" !":wt;let tn=ze.get(an);return tn===void 0&&ze.set(an,tn=Te++),tn};let bt=new Map,Ct=s;const En=s+4096,Mt=()=>Ct++,jt=2097152,rn=8192,Cn=new Int32Array(rn),nn=new Array(rn).fill(null),st=new Int32Array(rn),St=new Int32Array(rn),dn=new Uint8Array(rn);let rt=0;const Wt=(me,Le,De,Je,gt,pt,wt,an)=>{let tn=me;if(nn[me]!==null)if(nn[me|1]===null)tn=me|1;else if((rt++&3)===0)tn=me|rt>>2&1;else return;nn[tn]=Le.slice(De,Je),Cn[tn]=gt,st[tn]=pt,St[tn]=wt,dn[tn]=an},_t=()=>nn.fill(null);let It=256,Zt=[new Int32Array(It),new Int32Array(It),new Int32Array(It),new Int32Array(It)],[Nn,bn,ln,$e]=Zt,Tt=new Uint8Array(It),Gt=new Uint8Array(It);const Ie=()=>{It*=2,Zt=Zt.map(Le=>{const De=new Int32Array(It);return De.set(Le),De}),[Nn,bn,ln,$e]=Zt;const me=new Uint8Array(It);me.set(Tt),Tt=me,Gt=new Uint8Array(It)};let Xe=64,mt=new Int32Array(Xe),jn=new Int32Array(Xe);const po=new Int32Array(s);let Es=2048,zo=21,Ni=new Float64Array(Es),Cl=new Int32Array(Es),Ti=0;const Nl=(me,Le)=>{if(me===0&&Le<s)return po[Le]===Ti?1:(po[Le]=Ti,0);const De=me*2097152+Le+1;let Je=Math.imul(De,2654435761)>>>zo;for(;Cl[Je]===Ti;){if(Ni[Je]===De)return 1;Je=Je+1&Es-1}return Ni[Je]=De,Cl[Je]=Ti,0},br=(me,Le,De,Je,gt)=>{if(De-Le>=2&&me.charCodeAt(Le)===91&&me.charCodeAt(De-1)===93){let pt=-1;for(let wt=Le+1;wt<De-1;wt++)if(me.charCodeAt(wt)===58){pt=wt;break}return pt===-1||pt===Le+1?Xo:et(bt,me,Le+1,pt,0,Mt)}if(Je>=0&&c[Je]>=0)return c[Je];for(let pt=gt-1;pt>=0;pt--){const wt=jn[pt];if(wt>De)continue;const an=mt[pt],tn=De-wt;if(U[an]===1&&tn>0&&tn<=H){const zn=me.charCodeAt(wt);if(V===!1||zn!==91&&zn!==40){const Ri=Y(an,me,wt,De);if(Ri>=0)return Ri}}const lt=d[an];if(lt<0)continue;const Nt=m[lt],Jt=f[Nt],dt=f[Nt+1];if(Jt===dt)continue;be(me,wt,De);const cs=I[lt]-Jt;for(let zn=Jt;zn<dt;zn++)if(Pe(p[zn],me,wt,De))return g[cs+zn]}return Xo},mo=me=>{const Le=me.length;let De=0,Je=0,gt=!1;(Te>qe||At.size>qe)&&(At=new Map,ze=new Map,Te=2,_t()),Ct>En&&(bt=new Map,Ct=s,_t());let pt=0;for(;pt<Le;){let lt=me.charCodeAt(pt);if(lt===32||lt>=9&&lt<=13||lt>=160&&Oe(lt)){lt!==32&&(gt=!0),pt++;continue}const Nt=pt;let Jt=0;for(;pt<Le;){if(lt=me.charCodeAt(pt),lt<=32){if(lt===32)break;if(lt>=9&&lt<=13){gt=!0;break}}else if(lt>=160&&Oe(lt)){gt=!0;break}Jt=Math.imul(Jt^lt,16777619),pt++}const dt=pt,cs=dt-Nt;De===It&&Ie();const zn=De++;Nn[zn]=Nt,bn[zn]=dt,Je+=cs,Jt^=Math.imul(cs,2654435761);const Ri=Jt^Jt>>>15|0,Qn=Ri&8190;{let Kt=-1;if(Cn[Qn]===Ri&&nn[Qn]!==null&&nn[Qn].length===cs?Kt=Qn:Cn[Qn|1]===Ri&&nn[Qn|1]!==null&&nn[Qn|1].length===cs&&(Kt=Qn|1),Kt>=0){const ps=nn[Kt];let Ki=!0;for(let _i=0;_i<cs;_i++)if(ps.charCodeAt(_i)!==me.charCodeAt(Nt+_i)){Ki=!1;break}if(Ki){ln[zn]=st[Kt],$e[zn]=St[Kt],Tt[zn]=dn[Kt];continue}}}let Zn=Nt;if(Z!==0){if(dt-Nt<=Z||!me.startsWith(X,Nt)){ln[zn]=Xo,Wt(Qn,me,Nt,dt,Ri,Xo,0,0);continue}Zn=Nt+Z}let Lu=0,Vf=0,Er=-1,Iu=-1;for(let Kt=Zn;Kt<dt;Kt++){const ps=me.charCodeAt(Kt);if(Lu===0&&Vf===0){if(ps===58){Er=Kt;continue}if(ps===47){Iu=Kt;continue}}ps===91?Lu++:ps===93?Lu--:ps===40?Vf++:ps===41&&Vf--}const tg=Er>=Zn?Er+1:Zn;let kn=tg,$s=dt,kl=!1,Du=0;$s>kn&&me.charCodeAt($s-1)===33?(kl=!0,$s--):$s>kn&&me.charCodeAt(kn)===33&&(kl=!0,kn++,Du=1);let pi=-1;Iu>tg&&(pi=Iu+Du,pi>=$s&&(pi=-1));let ju=kn;$s-kn>1&&me.charCodeAt(kn)===45&&(ju=kn+1);let ki=0,Xs=0,Al=0,qf=-1,Ai=0;(d[0]>=0||U[0]===1)&&(mt[0]=0,jn[0]=ju,Ai=1);let ic=Ac,Wf=0;for(let Kt=ju;Kt<$s;Kt++)if(Kt===pi&&(ic=Xs<Al?Ac:ki,Wf=Ai),ki!==Ac){const ps=me.charCodeAt(Kt);let Ki=-1;if(Xs<Al)r.charCodeAt(Xs)===ps?(Xs++,Xs===Al&&(Ki=ki=qf)):ki=Ac;else{const _i=i[ki],lc=i[ki+1];let Cr=Ac;for(let Ns=_i;Ns<lc;Ns++){const ac=o[Ns];if(r.charCodeAt(ac)===ps){o[Ns+1]-ac===1?Ki=Cr=a[Ns]:(Xs=ac+1,Al=o[Ns+1],qf=a[Ns],Cr=ki);break}}ki=Cr}if(Ki>=0&&(d[Ki]>=0||U[Ki]===1)&&Kt+1<$s&&me.charCodeAt(Kt+1)===45){if(Ai===Xe){Xe*=2;const _i=new Int32Array(Xe);_i.set(mt),mt=_i;const lc=new Int32Array(Xe);lc.set(jn),jn=lc}mt[Ai]=Ki,jn[Ai]=Kt+2,Ai++}}pi===$s&&(ic=Xs<Al?Ac:ki,Wf=Ai);const Gf=Xs<Al?Ac:ki;let Cs,Qs=!1;if(pi>=0)if(Qs=!0,Cs=br(me,kn,pi,ic,Wf),Cs!==Xo&&Cs<s&&F[Cs]){const Kt=br(me,kn,$s,Gf,Ai);Kt!==Xo&&Kt!==Cs&&(Cs=Kt,Qs=!1)}else Cs===Xo&&(Cs=br(me,kn,$s,Gf,Ai),Qs=!1);else Cs=br(me,kn,$s,Gf,Ai);let oc=0,rc=0;Cs===Xo?ln[zn]=Xo:(rc=Qs?1:0,oc=Zn>=Er?kl?1:0:et(At,me,Zn,Er,kl?1:0,Kt=>ot(Kt,kl)),ln[zn]=Cs,Tt[zn]=rc,$e[zn]=oc),Wt(Qn,me,Nt,dt,Ri,Cs,oc,rc)}if(De===0)return"";if(De===1)return Nn[0]===0&&bn[0]===Le?me:me.slice(Nn[0],bn[0]);if(De*B>Es){for(;De*B>Es;)Es<<=1,zo--;Ni=new Float64Array(Es),Cl=new Int32Array(Es)}if(Te>=jt||Ct>=jt)throw new Error("cn: too many distinct classes in one merge");Ti=Ti+1|0,Ti===0&&(po.fill(0),Cl.fill(0),Ti=1);let wt=!1;for(let lt=De-1;lt>=0;lt--){const Nt=ln[lt];if(Nt===Xo){Gt[lt]=1;continue}const Jt=$e[lt];if(Nl(Jt,Nt)===1){Gt[lt]=0,wt=!0;continue}if(Gt[lt]=1,Nt<s){const dt=D[Nt];if(dt>=0)for(let cs=T[dt];cs<T[dt+1];cs++)Nl(Jt,R[cs]);if(Tt[lt]&1)for(let cs=0;cs<A.length;cs++)A[cs]===Nt&&Nl(Jt,k[cs])}}if(!wt&&!gt&&Le===Je+De-1)return me;let an="",tn=0;for(;tn<De;){if(!Gt[tn]){tn++;continue}const lt=Nn[tn];let Nt=bn[tn],Jt=tn+1;for(;Jt<De&&Gt[Jt]&&Nn[Jt]===Nt+1&&me.charCodeAt(Nt)===32;)Nt=bn[Jt],Jt++;an.length>0&&(an+=" "),an+=me.slice(lt,Nt),tn=Jt}return an},fi=16384,hi=new Int32Array(fi*2);let xr=0,Pn=1,Rn=Object.create(null),as=Object.create(null),Ys=new Map,sc=new Map,vr=0,Tl=0;const Bo=()=>{xr^=fi,Pn=Pn+1|0,Tl=0},Sr=me=>{let Le=Rn[me];if(Le!==void 0)return Le;const De=b1(me,0,me.length),Je=(De&16383)+xr,gt=hi[Je]===(De^Pn)||hi[Je^fi]===(De^Pn-1);return gt&&(Le=as[me],Le!==void 0)?(Rn[me]=Le,Le):(Le=mo(me),gt?(Rn[me]=Le,++vr>J&&(vr=0,as=Rn,Rn=Object.create(null),Bo())):(hi[Je]=De^Pn,++Tl>fi&&Bo()),Le)},Ol=me=>{let Le=Ys.get(me);if(Le!==void 0)return Le;const De=b1(me,0,me.length),Je=(De&16383)+xr,gt=hi[Je]===(De^Pn)||hi[Je^fi]===(De^Pn-1);return gt&&(Le=sc.get(me),Le!==void 0)?(Ys.set(me,Le),Le):(Le=mo(me),gt?(Ys.set(me,Le),++vr>J&&(vr=0,sc=Ys,Ys=new Map,Bo())):(hi[Je]=De^Pn,++Tl>fi&&Bo()),Le)},Rl=me=>{const Le=b1(me,0,me.length),De=(Le&16383)+xr;return hi[De]===(Le^Pn)||hi[De^fi]===(Le^Pn-1)?!0:(hi[De]=Le^Pn,++Tl>fi&&Bo(),!1)},Oi=J===0?mo:YK?me=>{const Le=Ys.get(me);return Le!==void 0?Le:Ol(me)}:Sr;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Oi(arguments[0]):Oi(ZK.apply(null,arguments))},mergeString:Oi,seenBefore:J===0?()=>!1:Rl,mergeUncached:mo}},U1=(t,e)=>{if(!t)return"";if(typeof t=="string")return t;let n="";if(typeof t.length=="number"&&(!e||Array.isArray(t))){const s=t;for(let i=0;i<s.length;i++){const o=s[i];if(!o)continue;const r=typeof o=="string"?o:U1(o,e);r&&(n&&(n+=" "),n+=r)}return n}if(e){if(typeof t=="number")return""+t;if(typeof t=="object")for(const s in t)t[s]&&(n&&(n+=" "),n+=s)}return n},QK=(t,e)=>{let n="";for(let s=0;s<t.length;s++){const i=t[s];if(!i)continue;const o=typeof i=="string"?i:U1(i,e);o&&(n&&(n+=" "),n+=o)}return n},ZK=function(){return QK(arguments,!1)},JK=256,Zk=16,eY=1024,$v=4096,tY=(t,e)=>{const n=e===void 0?()=>!0:e.seenBefore,s=e===void 0?t:e.mergeUncached;let i=new Map,o=new Map,r=0,a=null,c=null,d=[],f=[],p=0;const m=(w,N,C)=>{c===null&&(c=new Array($v).fill(""),d=new Array($v).fill(""),f=new Array($v).fill(""));const T=b1(w,0,w.length)&4094;if(c[T]===w&&d[T]===N)return f[T];if(c[T|1]===w&&d[T|1]===N)return f[T|1];const R=t(C?N+" "+w:w),A=c[T]===""?T:T|(c[T|1]===""?1:p++&1);return c[A]=w,d[A]=N,f[A]=R,R},g=(w,N,C,T)=>{let R=0;if(N){if(N!==w.a0)return!1;R=1}if(C){if(C!==(R===0?w.a0:w.a1))return!1;R++}if(T){if(T!==(R===0?w.a0:R===1?w.a1:w.a2))return!1;R++}return R===w.t},y=(w,N)=>{const C=w.a;let T=0;for(let R=0;R<N.length;R++){const A=N[R];if(A){if(A!==C[T])return!1;T++}}return T===w.t},v=(w,N)=>{const C=w.length,T=a===null?null:a.n;if(!N){if(T!==null&&y(T,w))return a=T,T.r;if(a!==null&&a!==T&&y(a,w))return a.r}let R="",A=-1,k=0,M=!1;for(let D=0;D<C;D++){let P=w[D];if(P){if(typeof P!="string"){if(P=w[D]=U1(P,!0),!P)continue;M=!0}A<0&&(R=P,A=D),k++}}if(k===0)return"";if(k===1)return t(R);if(M){if(T!==null&&y(T,w))return a=T,T.r;if(a!==null&&a!==T&&y(a,w))return a.r}let L=i.get(R);L===void 0&&(L=o.get(R),L!==void 0&&i.set(R,L));let j=null;if(L!==void 0){if(L.skip>0){L.skip--,a=null;let P=R;for(let B=A+1;B<C;B++){const I=w[B];I&&(P+=" "+I)}return m(P,"",!1)}const D=L.e;e:for(let P=0;P<D.length;P++){const B=D[P];if(B.t!==k)continue;const I=B.a;let F=1;for(let z=A+1;z<C;z++){const U=w[z];if(U&&U!==I[F++])continue e}j=B;break}j!==null&&(L.miss=0)}if(j===null){let D=R;const P=[R];for(let I=A+1;I<C;I++){const F=w[I];F&&(D+=" "+F,P.push(F))}if(!n(D))return s(D);j={r:t(D),t:P.length,a0:P[0],a1:P[1],a2:P[2]??"",a:P,n:null},L===void 0?i.set(R,L={e:[],miss:0,skip:0,at:0}):++L.miss>Zk&&(L.miss=Zk,L.skip=eY,L.e.length=0,L.at=0);const B=L.e;B.length<JK?B.push(j):(B[L.at]=j,L.at=L.at+1&255),++r>1e3&&(r=0,o=i,i=new Map)}return a!==null&&a!==j&&(a.n=j),a=j,j.r},S=w=>Array.isArray(w)?v(w.slice(),!1):t(U1(w,!0));return function(w,N,C){const T=arguments.length;if((T|1)===3){const k=a;if(k!==null){const M=k.n;if(M!==null&&g(M,w,N,C))return a=M,M.r;if(k!==M&&g(k,w,N,C))return k.r}if(T===2&&typeof N=="string"&&N!==""){const M=i.get(w);if(M!==void 0&&M.skip>0)return M.skip--,a=null,m(N,w,!0)}return v([w,N,C],!0)}if(T===1)return typeof w=="string"?t(w):S(w);const R=a;if(R!==null){const k=R.n;if(k!==null){const M=k.a;let L=0,j=!0;for(let D=0;D<T;D++){const P=arguments[D];if(P){if(P!==M[L]){j=!1;break}L++}}if(j&&L===k.t)return a=k,k.r}if(R!==k){const M=R.a;let L=0,j=!0;for(let D=0;D<T;D++){const P=arguments[D];if(P){if(P!==M[L]){j=!1;break}L++}}if(j&&L===R.t)return R.r}}const A=[];for(let k=0;k<T;k++)A.push(arguments[k]);return v(A,!0)}},Jk=XK(KK),Se=tY(Jk.mergeString,Jk),nY=TK("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-normal whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary font-bold text-primary-foreground hover:bg-[color-mix(in_oklch,var(--primary),var(--foreground)_12%)]",outline:"border-input bg-card hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-foreground underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ft(t){const e=ee.c(16);let n,s,i,o,r;e[0]!==t?({className:s,variant:o,size:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=r):(n=e[1],s=e[2],i=e[3],o=e[4],r=e[5]);const a=o===void 0?"default":o,c=r===void 0?"default":r;let d;e[6]!==s||e[7]!==c||e[8]!==a?(d=Se(nY({variant:a,size:c,className:s})),e[6]=s,e[7]=c,e[8]=a,e[9]=d):d=e[9];let f;e[10]!==n?(f=typeof n=="string"?b.jsx("span",{className:"text-box-cap",children:n}):n,e[10]=n,e[11]=f):f=e[11];let p;return e[12]!==i||e[13]!==d||e[14]!==f?(p=b.jsx(CK,{"data-slot":"button",className:d,...i,children:f}),e[12]=i,e[13]=d,e[14]=f,e[15]=p):p=e[15],p}const sY="/server-error.svg",iY="The backend did not say what went wrong.",oY=t=>t instanceof Error?t.message:iY,uD=t=>{const e=ee.c(19),{heading:n,error:s,className:i,children:o}=t,r=Wi();let a;e[0]!==i?(a=Se("mx-auto flex max-w-prose flex-col items-center text-center",i),e[0]=i,e[1]=a):a=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=b.jsx(K6,{src:sY}),e[2]=c):c=e[2];let d;e[3]!==n?(d=b.jsx("h1",{className:"mt-4 text-2xl font-bold tracking-[-0.01em]",children:n}),e[3]=n,e[4]=d):d=e[4];let f;e[5]!==s?(f=oY(s),e[5]=s,e[6]=f):f=e[6];let p;e[7]!==f?(p=b.jsx("p",{className:"mt-2 text-muted-foreground",children:f}),e[7]=f,e[8]=p):p=e[8];let m;e[9]!==r?(m=b.jsx(ft,{onClick:()=>{r.invalidate()},children:"Try again"}),e[9]=r,e[10]=m):m=e[10];let g;e[11]!==o||e[12]!==m?(g=b.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[m,o]}),e[11]=o,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==a||e[15]!==d||e[16]!==p||e[17]!==g?(y=b.jsxs("section",{role:"alert",className:a,children:[c,d,p,g]}),e[14]=a,e[15]=d,e[16]=p,e[17]=g,e[18]=y):y=e[18],y};function Mf(t){const e={subscribe(n){let s=null,i=!1,o=!1,r=!1;function a(){if(s===null){r=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(c){var d;i||(d=n.next)===null||d===void 0||d.call(n,c)},error(c){var d;i||(i=!0,(d=n.error)===null||d===void 0||d.call(n,c),a())},complete(){var c;i||(i=!0,(c=n.complete)===null||c===void 0||c.call(n),a())}}),r&&a(),{unsubscribe:a}},pipe(...n){return n.reduce(rY,e)}};return e}function rY(t,e){return e(t)}function lY(t){const e=new AbortController;return new Promise((n,s)=>{let i=!1;function o(){i||(i=!0,r.unsubscribe())}e.signal.addEventListener("abort",()=>{s(e.signal.reason)});const r=t.subscribe({next(a){i=!0,n(a),o()},error(a){s(a)},complete(){e.abort(),o()}})})}function aY(t){return e=>{let n=0,s=null;const i=[];function o(){s||(s=e.subscribe({next(a){for(const d of i){var c;(c=d.next)===null||c===void 0||c.call(d,a)}},error(a){for(const d of i){var c;(c=d.error)===null||c===void 0||c.call(d,a)}},complete(){for(const c of i){var a;(a=c.complete)===null||a===void 0||a.call(c)}}}))}function r(){if(n===0&&s){const a=s;s=null,a.unsubscribe()}}return Mf(a=>(n++,i.push(a),o(),{unsubscribe(){n--,r();const c=i.findIndex(d=>d===a);c>-1&&i.splice(c,1)}}))}}function dD(t){let e=t;const n=[],s=r=>{e!==void 0&&r.next(e),n.push(r)},i=r=>{n.splice(n.indexOf(r),1)},o=Mf(r=>(s(r),()=>{i(r)}));return o.next=r=>{if(e!==r){e=r;for(const a of n)a.next(r)}},o.get=()=>e,o}function fD(t){return Mf(e=>{function n(s=0,i=t.op){const o=t.links[s];if(!o)throw new Error("No more links to execute - did you forget to add an ending link?");return o({op:i,next(r){return n(s+1,r)}})}return n().subscribe(e)})}function eA(t){return Array.isArray(t)?t:[t]}function cY(t){return e=>{const n=eA(t.true).map(i=>i(e)),s=eA(t.false).map(i=>i(e));return i=>Mf(o=>{const r=t.condition(i.op)?n:s;return fD({op:i.op,links:r}).subscribe(o)})}}function Ap(t){"@babel/helpers - typeof";return Ap=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ap(t)}function uY(t,e){if(Ap(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e);if(Ap(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dY(t){var e=uY(t,"string");return Ap(e)=="symbol"?e:e+""}function qs(t,e,n){return(e=dY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tA(Object(n),!0).forEach(function(s){qs(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function Va(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function fY(t){return typeof t=="function"}function hD(){return Object.create(null)}const hY=typeof Symbol=="function"&&!!Symbol.asyncIterator;function pY(t){return hY&&Va(t)&&Symbol.asyncIterator in t}const MC=t=>t(),O0={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},mY=[O0.BAD_GATEWAY,O0.SERVICE_UNAVAILABLE,O0.GATEWAY_TIMEOUT,O0.INTERNAL_SERVER_ERROR],pD=()=>{},nA=t=>{Object.freeze&&Object.freeze(t)};function mD(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(pD,{get(o,r){if(!(typeof r!="string"||r==="then"))return mD(t,[...e,r],n)},apply(o,r,a){const c=e[e.length-1];if(c==="valueOf"||c==="toString"||c==="toJSON")return`tRPC.proxy(${e.slice(0,-1).join(".")})`;let d={args:a,path:e};return c==="call"?d={args:a.length>=2?[a[1]]:[],path:e.slice(0,-1)}:c==="apply"&&(d={args:a.length>=2?a[1]:[],path:e.slice(0,-1)}),nA(d.args),nA(d.path),t(d)}})),n[i]}const gD=t=>mD(t,[],hD()),gY=t=>new Proxy(pD,{get(e,n){if(n!=="then")return t(n)}});function _p(t){"@babel/helpers - typeof";return _p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_p(t)}function yY(t,e){if(_p(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e);if(_p(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bY(t){var e=yY(t,"string");return _p(e)=="symbol"?e:e+""}function Bc(t,e,n){return(e=bY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function R0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sA(Object(n),!0).forEach(function(s){Bc(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sA(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var xY=class extends Error{constructor(t){super(vY(t)),Object.assign(this,t)}};function vY(t){if("message"in t)return String(t.message)}function SY(t){if(t instanceof Error)return t;const e=typeof t;if(!(e==="undefined"||e==="function"||t===null)){if(e!=="object")return new Error(String(t));if(Va(t))return new xY(t)}}var iA=class extends Error{constructor(t){var e,n,s;const i=SY(t.cause),o=(e=(n=t.message)!==null&&n!==void 0?n:i==null?void 0:i.message)!==null&&e!==void 0?e:t.code;super(o,{cause:i}),Bc(this,"cause",void 0),Bc(this,"code",void 0),this.code=t.code,this.name="TRPCError",(s=this.cause)!==null&&s!==void 0||(this.cause=i)}};function wY(t,e){if("error"in t){const n=e.deserialize(t.error);return{ok:!1,error:R0(R0({},t),{},{error:n})}}return{ok:!0,result:R0(R0({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var Fv=class extends Error{constructor(){super("Unable to transform response from server")}};function EY(t,e){let n;try{n=wY(t,e)}catch{throw new Fv}if(!n.ok&&(!Va(n.error.error)||typeof n.error.error.code!="number"))throw new Fv;if(n.ok&&!Va(n.result))throw new Fv;return n}function CY(t){return typeof t=="function"}async function NY(t,e){const{_def:n}=t;let s=n.procedures[e];for(;!s;){const i=Object.keys(n.lazy).find(o=>e===o||e.startsWith(o+"."));if(!i)return null;await n.lazy[i].load(),s=n.procedures[e]}return s}async function TY(t){const{type:e,path:n}=t,s=await NY(t.router,n);if(!s||!CY(s)||s._def.type!==e&&!t.allowMethodOverride)throw new iA({code:"NOT_FOUND",message:`No "${e}"-procedure on path "${n}"`});/* istanbul ignore if -- @preserve */if(s._def.type!==e&&t.allowMethodOverride&&s._def.type==="subscription")throw new iA({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return s(t)}let yD;const Hv=new WeakMap,OY=()=>{};yD=Symbol.toStringTag;var bD=class Lc{constructor(e){Bc(this,"promise",void 0),Bc(this,"subscribers",[]),Bc(this,"settlement",null),Bc(this,yD,"Unpromise"),typeof e=="function"?this.promise=new Promise(e):this.promise=e;const n=this.promise.then(s=>{const{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:s},i==null||i.forEach(({resolve:o})=>{o(s)})});"catch"in n&&n.catch(s=>{const{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:s},i==null||i.forEach(({reject:o})=>{o(s)})})}subscribe(){let e,n;const{settlement:s}=this;if(s===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const i=kY();this.subscribers=AY(this.subscribers,i),e=i.promise,n=()=>{this.subscribers!==null&&(this.subscribers=MY(this.subscribers,i))}}else{const{status:i}=s;i==="fulfilled"?e=Promise.resolve(s.value):e=Promise.reject(s.reason),n=OY}return Object.assign(e,{unsubscribe:n})}then(e,n){const s=this.subscribe(),{unsubscribe:i}=s;return Object.assign(s.then(e,n),{unsubscribe:i})}catch(e){const n=this.subscribe(),{unsubscribe:s}=n;return Object.assign(n.catch(e),{unsubscribe:s})}finally(e){const n=this.subscribe(),{unsubscribe:s}=n;return Object.assign(n.finally(e),{unsubscribe:s})}static proxy(e){const n=Lc.getSubscribablePromise(e);return typeof n<"u"?n:Lc.createSubscribablePromise(e)}static createSubscribablePromise(e){const n=new Lc(e);return Hv.set(e,n),Hv.set(n,n),n}static getSubscribablePromise(e){return Hv.get(e)}static resolve(e){const n=typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"?e:Promise.resolve(e);return Lc.proxy(n).subscribe()}static async any(e){const n=(Array.isArray(e)?e:[...e]).map(Lc.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:s})=>{s()})}}static async race(e){const n=(Array.isArray(e)?e:[...e]).map(Lc.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:s})=>{s()})}}static async raceReferences(e){const n=e.map(RY);try{return await Promise.race(n)}finally{for(const s of n)s.unsubscribe()}}};function RY(t){return bD.proxy(t).then(()=>[t])}function kY(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}function AY(t,e){return[...t,e]}function _Y(t,e){return[...t.slice(0,e),...t.slice(e+1)]}function MY(t,e){const n=t.indexOf(e);return n!==-1?_Y(t,n):t}var oA,rA,lA,aA;(rA=(oA=Symbol).dispose)!==null&&rA!==void 0||(oA.dispose=Symbol());(aA=(lA=Symbol).asyncDispose)!==null&&aA!==void 0||(lA.asyncDispose=Symbol());function LY(t,e){const n=t,s=n[Symbol.dispose];return n[Symbol.dispose]=()=>{e(),s==null||s.call(n)},n}function IY(t,e){const n=t,s=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await e(),await(s==null?void 0:s.call(n))},n}const xD=Symbol();function DY(t){let e=null;return LY({start(){if(e)throw new Error("Timer already started");return new Promise(n=>{e=setTimeout(()=>n(xD),t)})}},()=>{e&&clearTimeout(e)})}function vD(){var t=typeof SuppressedError=="function"?SuppressedError:function(i,o){var r=Error();return r.name="SuppressedError",r.error=i,r.suppressed=o,r},e={},n=[];function s(i,o){if(o!=null){if(Object(o)!==o)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(i)var r=o[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(r===void 0&&(r=o[Symbol.dispose||Symbol.for("Symbol.dispose")],i))var a=r;if(typeof r!="function")throw new TypeError("Object is not disposable.");a&&(r=function(){try{a.call(o)}catch(d){return Promise.reject(d)}}),n.push({v:o,d:r,a:i})}else i&&n.push({d:o,a:i});return o}return{e,u:s.bind(null,!1),a:s.bind(null,!0),d:function(){var o,r=this.e,a=0;function c(){for(;o=n.pop();)try{if(!o.a&&a===1)return a=0,n.push(o),Promise.resolve().then(c);if(o.d){var f=o.d.call(o.v);if(o.a)return a|=2,Promise.resolve(f).then(c,d)}else a|=1}catch(p){return d(p)}if(a===1)return r!==e?Promise.reject(r):Promise.resolve();if(r!==e)throw r}function d(f){return r=r!==e?new t(f,r):f,c()}return c()}}}function SD(t,e){this.v=t,this.k=e}function cA(t){return new SD(t,0)}function jY(t){return function(){return new ep(t.apply(this,arguments))}}function ep(t){var e,n;function s(o,r){try{var a=t[o](r),c=a.value,d=c instanceof SD;Promise.resolve(d?c.v:c).then(function(f){if(d){var p=o==="return"?"return":"next";if(!c.k||f.done)return s(p,f);f=t[p](f).value}i(a.done?"return":"normal",f)},function(f){s("throw",f)})}catch(f){i("throw",f)}}function i(o,r){switch(o){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?s(e.key,e.arg):n=null}this._invoke=function(o,r){return new Promise(function(a,c){var d={key:o,arg:r,resolve:a,reject:c,next:null};n?n=n.next=d:(e=n=d,s(o,r))})},typeof t.return!="function"&&(this.return=void 0)}ep.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ep.prototype.next=function(t){return this._invoke("next",t)},ep.prototype.throw=function(t){return this._invoke("throw",t)},ep.prototype.return=function(t){return this._invoke("return",t)};const PY="ping",zY="serialized-error",BY="connected",$Y="return";async function FY(t){try{var e=vD();const n=e.u(DY(t.timeoutMs)),s=await bD.race([t.promise,n.start()]);return s===xD?await t.onTimeout():s}catch(n){e.e=n}finally{e.d()}}function HY(t){const{deserialize:e=a=>a}=t;let n=hD();const s=t.signal;let i=null;const o=()=>new ReadableStream({async start(a){const[c,d]=await Promise.all([t.url(),t.init()]),f=i=new t.EventSource(c,d);a.enqueue({type:"connecting",eventSource:i,event:null}),f.addEventListener(BY,m=>{const g=JSON.parse(m.data);n=g,a.enqueue({type:"connected",options:g,eventSource:f})}),f.addEventListener(zY,m=>{const g=m;a.enqueue({type:"serialized-error",error:e(JSON.parse(g.data)),eventSource:f})}),f.addEventListener(PY,()=>{a.enqueue({type:"ping",eventSource:f})}),f.addEventListener($Y,()=>{f.close(),a.close(),i=null}),f.addEventListener("error",m=>{f.readyState===f.CLOSED?a.error(m):a.enqueue({type:"connecting",eventSource:f,event:m})}),f.addEventListener("message",m=>{const g=m,y={data:e(JSON.parse(g.data))};g.lastEventId&&(y.id=g.lastEventId),a.enqueue({type:"data",data:y,eventSource:f})});const p=()=>{try{f.close(),a.close()}catch{}};s.aborted?p():s.addEventListener("abort",p)},cancel(){i==null||i.close()}}),r=()=>{let a=o(),c=a.getReader();async function d(){await c.cancel(),i=null}return IY({read(){return c.read()},async recreate(){await d(),a=o(),c=a.getReader()}},d)};return MC(jY(function*(){try{var a=vD();const c=a.a(r());for(;;){let d=c.read();const f=n.reconnectAfterInactivityMs;f&&(d=FY({promise:d,timeoutMs:f,onTimeout:async()=>{const m={value:{type:"timeout",ms:f,eventSource:i},done:!1};return await c.recreate(),m}}));const p=yield cA(d);if(p.done)return p.value;yield p.value}}catch(c){a.e=c}finally{yield cA(a.d())}}))}function UY(t){return t instanceof Ca}function VY(t){return Va(t)&&Va(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function qY(t,e){return typeof t=="string"?t:Va(t)&&typeof t.message=="string"?t.message:e}var Ca=class x1 extends Error{constructor(e,n){var s,i;const o=n==null?void 0:n.cause;super(e,{cause:o}),qs(this,"cause",void 0),qs(this,"shape",void 0),qs(this,"data",void 0),qs(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=o,this.shape=n==null||(s=n.result)===null||s===void 0?void 0:s.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,x1.prototype)}static from(e,n={}){const s=e;return UY(s)?(n.meta&&(s.meta=Yn(Yn({},s.meta),n.meta)),s):VY(s)?new x1(s.error.message,Yn(Yn({},n),{},{result:s,cause:n.cause})):new x1(qY(s,"Unknown error"),Yn(Yn({},n),{},{cause:s}))}};function wD(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const uA=t=>typeof t=="function";function WY(t){if(t)return t;if(typeof window<"u"&&uA(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&uA(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function GY(...t){const e=new AbortController,n=t.length;let s=0;const i=()=>{++s===n&&e.abort()};for(const o of t)o!=null&&o.aborted?i():o==null||o.addEventListener("abort",i,{once:!0});return e.signal}function ED(...t){const e=new AbortController;for(const n of t)n!=null&&n.aborted?e.abort():n==null||n.addEventListener("abort",()=>e.abort(),{once:!0});return e.signal}function KY(t){return{url:t.url.toString(),fetch:t.fetch,transformer:wD(t.transformer),methodOverride:t.methodOverride}}function YY(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const XY={query:"GET",mutation:"POST",subscription:"PATCH"};function CD(t){return"input"in t?t.transformer.input.serialize(t.input):YY(t.inputs.map(e=>t.transformer.input.serialize(e)))}const LC=t=>{const e=t.url.split("?");let n=e[0].replace(/\/$/,"")+"/"+t.path;const s=[];if(e[1]&&s.push(e[1]),"inputs"in t&&s.push("batch=1"),t.type==="query"||t.type==="subscription"){const i=CD(t);i!==void 0&&t.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return s.length&&(n+="?"+s.join("&")),n},QY=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=CD(t);return e!==void 0?JSON.stringify(e):void 0},ZY=t=>nX(Yn(Yn({},t),{},{contentTypeHeader:"application/json",getUrl:LC,getBody:QY}));var JY=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const eX=t=>{var e;if(t!=null&&t.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new JY};async function tX(t){var e,n;eX(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:XY[t.type],r=await(async()=>{const c=await t.headers();return Symbol.iterator in c?Object.fromEntries(c):c})(),a=Yn(Yn(Yn({},t.contentTypeHeader&&o!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{[(n=t.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:t.trpcAcceptHeader}:void 0),r);return WY(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:a})}async function nX(t){const e={},n=await tX(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}const dA=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function fA(t){let e=null,n=null;const s=()=>{clearTimeout(n),n=null,e=null};function i(a){const c=[[]];let d=0;for(;;){const m=a[d];if(!m)break;const g=c[c.length-1];if(m.aborted){var f;(f=m.reject)===null||f===void 0||f.call(m,new Error("Aborted")),d++;continue}if(t.validate(g.concat(m).map(y=>y.key))){g.push(m),d++;continue}if(g.length===0){var p;(p=m.reject)===null||p===void 0||p.call(m,new Error("Input is too big for a single dispatch")),d++;continue}c.push([])}return c}function o(){const a=i(e);s();for(const c of a){if(!c.length)continue;const d={items:c};for(const f of c)f.batch=d;t.fetch(d.items.map(f=>f.key)).then(async f=>{await Promise.all(f.map(async(m,g)=>{const y=d.items[g];try{var v;const w=await Promise.resolve(m);(v=y.resolve)===null||v===void 0||v.call(y,w)}catch(w){var S;(S=y.reject)===null||S===void 0||S.call(y,w)}y.batch=null,y.reject=null,y.resolve=null}));for(const m of d.items){var p;(p=m.reject)===null||p===void 0||p.call(m,new Error("Missing result")),m.batch=null}}).catch(f=>{for(const m of d.items){var p;(p=m.reject)===null||p===void 0||p.call(m,f),m.batch=null}})}}function r(a){var c;const d={aborted:!1,key:a,batch:null,resolve:dA,reject:dA},f=new Promise((p,m)=>{var g;d.reject=m,d.resolve=p,(g=e)!==null&&g!==void 0||(e=[]),e.push(d)});return(c=n)!==null&&c!==void 0||(n=setTimeout(o)),f}return{load:r}}function sX(t){var e,n;const s=KY(t),i=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,o=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const r=c=>({validate(d){if(i===1/0&&o===1/0)return!0;if(d.length>o)return!1;const f=d.map(m=>m.path).join(","),p=d.map(m=>m.input);return LC(Yn(Yn({},s),{},{type:c,path:f,inputs:p,signal:null})).length<=i},async fetch(d){const f=d.map(y=>y.path).join(","),p=d.map(y=>y.input),m=GY(...d.map(y=>y.signal)),g=await ZY(Yn(Yn({},s),{},{path:f,inputs:p,type:c,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:d}):t.headers:{}},signal:m}));return(Array.isArray(g.json)?g.json:d.map(()=>g.json)).map(y=>({meta:g.meta,json:y}))}}),a={query:fA(r("query")),mutation:fA(r("mutation"))};return({op:c})=>Mf(d=>{/* istanbul ignore if -- @preserve */if(c.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const f=new AbortController,p=a[c.type].load(Yn(Yn({},c),{},{signal:ED(c.signal,f.signal)}));let m=!1,g;return p.then(y=>{m=!0,g=y;const v=EY(y.json,s.transformer.output);if(!v.ok){d.error(Ca.from(v.error,{meta:y.meta}));return}d.next({context:y.meta,result:v.result}),d.complete()}).catch(y=>{m=!0,d.error(Ca.from(y,{meta:g==null?void 0:g.meta}))}),()=>{m||f.abort()}})}}const Mp=(t,...e)=>typeof t=="function"?t(...e):t;function iX(){let t,e;return{promise:new Promise((n,s)=>{t=n,e=s}),resolve:t,reject:e}}async function oX(t){const e=await Mp(t.url);return t.connectionParams?e+`${e.includes("?")?"&":"?"}connectionParams=1`:e}async function rX(t,e){const n={method:"connectionParams",data:await Mp(t)};return e.encode(n)}function lX(t){const{promise:e,resolve:n,reject:s}=iX();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function aX(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function r(){clearTimeout(s),o()}function a(){clearTimeout(i),r()}t.addEventListener("open",o),t.addEventListener("message",({data:c})=>{clearTimeout(s),o(),c==="PONG"&&a()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var cX=class gw{constructor(e){var n;if(qs(this,"id",++gw.connectCount),qs(this,"WebSocketPonyfill",void 0),qs(this,"urlOptions",void 0),qs(this,"keepAliveOpts",void 0),qs(this,"encoder",void 0),qs(this,"wsObservable",dD(null)),qs(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++gw.connectCount;const e=oX(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=e.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&aX(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await lX(n),this.urlOptions.connectionParams&&n.send(await rX(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var e;(e=this.ws)===null||e===void 0||e.close()}}};qs(cX,"connectCount",0);var ND=class{constructor(t){qs(this,"links",void 0),qs(this,"runtime",void 0),qs(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return fD({links:this.links,op:Yn(Yn({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(aY())}async requestAsPromise(t){try{const e=this.$request(t);return(await lY(e)).result.data}catch(e){throw Ca.from(e)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(s){switch(s.result.type){case"state":var i;(i=n.onConnectionStateChange)===null||i===void 0||i.call(n,s.result);break;case"started":var o;(o=n.onStarted)===null||o===void 0||o.call(n,{context:s.context});break;case"stopped":var r;(r=n.onStopped)===null||r===void 0||r.call(n);break;case"data":case void 0:var a;(a=n.onData)===null||a===void 0||a.call(n,s.result.data)}},error(s){var i;(i=n.onError)===null||i===void 0||i.call(n,s)},complete(){var s;(s=n.onComplete)===null||s===void 0||s.call(n)}})}};const TD=Symbol.for("trpc_untypedClient"),uX={query:"query",mutate:"mutation",subscribe:"subscription"},dX=t=>uX[t];function fX(t){const e=gD(({path:n,args:s})=>{const i=[...n],o=dX(i.pop()),r=i.join(".");return t[o](r,...s)});return gY(n=>n===TD?t:e[n])}function hX(t){return fX(new ND(t))}function pX(t){return t[TD]}function mX(t,e){return!e||t!=null&&typeof t!="object"?t:Yn(Yn({},t??{}),{},{lastEventId:e})}function gX(t){var e,n,s,i=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(n&&(e=t[n])!=null)return e.call(t);if(s&&(e=t[s])!=null)return new v1(e.call(t));n="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function v1(t){function e(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var s=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:s}})}return v1=function(s){this.s=s,this.n=s.next},v1.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(s){var i=this.s.return;return i===void 0?Promise.resolve({value:s,done:!0}):e(i.apply(this.s,arguments))},throw:function(s){var i=this.s.return;return i===void 0?Promise.reject(s):e(i.apply(this.s,arguments))}},new v1(t)}async function yX(t){let e=await Mp(t.url);if(t.connectionParams){const n=await Mp(t.connectionParams),s=e.includes("?")?"&":"?";e+=s+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return e}function bX(t){const e=wD(t.transformer);return()=>({op:n})=>Mf(s=>{var i;const{type:o,path:r,input:a}=n;/* istanbul ignore if -- @preserve */if(o!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let c;const d=new AbortController,f=ED(n.signal,d.signal),p=HY({url:async()=>LC({transformer:e,url:await yX(t),input:mX(a,c),path:r,type:o,signal:null}),init:()=>Mp(t.eventSourceOptions,{op:n}),signal:f,deserialize:y=>e.output.deserialize(y),EventSource:(i=t.EventSource)!==null&&i!==void 0?i:globalThis.EventSource}),m=dD({type:"state",state:"connecting",error:null}),g=m.subscribe({next(y){s.next({result:y})}});return MC(async()=>{var y=!1,v=!1,S;try{for(var w=gX(p),N;y=!(N=await w.next()).done;y=!1){const C=N.value;switch(C.type){case"ping":break;case"data":const T=C.data;let R;T.id?(c=T.id,R={id:T.id,data:T}):R={data:T.data},s.next({result:R,context:{eventSource:C.eventSource}});break;case"connected":s.next({result:{type:"started"},context:{eventSource:C.eventSource}}),m.next({type:"state",state:"pending",error:null});break;case"serialized-error":{const A=Ca.from({error:C.error});if(mY.includes(C.error.code)){m.next({type:"state",state:"connecting",error:A});break}throw A}case"connecting":{const A=m.get(),k=C.event&&Ca.from(C.event);if(!k&&A.state==="connecting")break;m.next({type:"state",state:"connecting",error:k});break}case"timeout":m.next({type:"state",state:"connecting",error:new Ca(`Timeout of ${C.ms}ms reached while waiting for a response`)})}}}catch(C){v=!0,S=C}finally{try{y&&w.return!=null&&await w.return()}finally{if(v)throw S}}s.next({result:{type:"stopped"}}),m.next({type:"state",state:"idle",error:null}),s.complete()}).catch(y=>{s.error(Ca.from(y))}),()=>{s.complete(),d.abort(),g.unsubscribe()}})}function Lp(t){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function xX(t,e){if(Lp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e);if(Lp(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vX(t){var e=xX(t,"string");return Lp(e)=="symbol"?e:e+""}function SX(t,e,n){return(e=vX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function $t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hA(Object(n),!0).forEach(function(s){SX(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hA(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function wX(t){var e,n,s,i=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(n&&(e=t[n])!=null)return e.call(t);if(s&&(e=t[s])!=null)return new S1(e.call(t));n="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function S1(t){function e(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var s=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:s}})}return S1=function(s){this.s=s,this.n=s.next},S1.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(s){var i=this.s.return;return i===void 0?Promise.resolve({value:s,done:!0}):e(i.apply(this.s,arguments))},throw:function(s){var i=this.s.return;return i===void 0?Promise.reject(s):e(i.apply(this.s,arguments))}},new S1(t)}function EX(t,e){if(t==null)return{};var n={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.includes(s))continue;n[s]=t[s]}return n}function CX(t,e){if(t==null)return{};var n,s,i=EX(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)n=o[s],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}const NX=["cursor","direction"];function Wy(t){return{path:t.path.join(".")}}function TX(t){return t.length>=3}function OX(t){return TX(t)?{type:"prefixed",prefix:t[0],path:t[1],args:t[2]}:{type:"unprefixed",prefix:void 0,path:t[0],args:t[1]}}function IC(t,e,n){var s;const i=OX(t);let o=(s=i.args)===null||s===void 0?void 0:s.input;if(n){var r,a;o=$t($t($t({},(r=(a=i.args)===null||a===void 0?void 0:a.input)!==null&&r!==void 0?r:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[i.path.join("."),o,e==null?void 0:e.trpc]}async function RX(t,e,n){const s=e.getQueryCache().build(e,{queryKey:n});s.setState({data:[],status:"success"});const i=[];var o=!1,r=!1,a;try{for(var c=wX(t),d;o=!(d=await c.next()).done;o=!1){const f=d.value;i.push(f),s.setState({data:[...i]})}}catch(f){r=!0,a=f}finally{try{o&&c.return!=null&&await c.return()}finally{if(r)throw a}}return i}function Pr(t){const e=MC(()=>{const{input:n,type:s}=t,i=t.path.flatMap(o=>o.split("."));if(!n&&s==="any")return i.length?[i]:[];if(s==="infinite"&&Va(n)&&("direction"in n||"cursor"in n)){const{cursor:o,direction:r}=n;return[i,{input:CX(n,NX),type:"infinite"}]}return[i,$t($t({},typeof n<"u"&&n!==uo&&{input:n}),s&&s!=="any"&&{type:s})]});return t.prefix&&e.unshift([t.prefix]),e}function OD(t){const e=[t.path.flatMap(n=>n.split("."))];return t.prefix&&e.unshift([t.prefix]),e}function DC(t){return fY(t)?t():t}function kX(t){var e;const{input:n,query:s,path:i,queryKey:o,opts:r}=t,a=n===uo,c=async d=>{var f;const p=$t($t({},r),{},{trpc:$t($t({},r==null?void 0:r.trpc),!(r==null||(f=r.trpc)===null||f===void 0)&&f.abortOnUnmount?{signal:d.signal}:{signal:null})});return await s(...IC(o,p,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign($t($t({},r??{}),{},{queryKey:o,queryFn:a?uo:c,initialPageParam:(e=r==null?void 0:r.initialCursor)!==null&&e!==void 0?e:n==null?void 0:n.cursor}),{trpc:Wy({path:i})})}function AX(t){var e,n;const{mutate:s,path:i,prefix:o,opts:r,overrides:a}=t,c=DC(t.queryClient),d=OD({path:i,prefix:(e=r==null?void 0:r.keyPrefix)!==null&&e!==void 0?e:o}),f=c.defaultMutationOptions(c.getMutationDefaults(d)),p=(n=a==null?void 0:a.onSuccess)!==null&&n!==void 0?n:(g=>g.originalFn()),m=async g=>await s(...IC([...d,{input:g}],r));return $t($t({},r),{},{mutationKey:d,mutationFn:m,onSuccess(...g){var y,v;return p({originalFn:()=>{var w,N,C;return(w=r==null||(N=r.onSuccess)===null||N===void 0?void 0:N.call(r,...g))!==null&&w!==void 0?w:f==null||(C=f.onSuccess)===null||C===void 0?void 0:C.call(f,...g)},queryClient:c,meta:(y=(v=r==null?void 0:r.meta)!==null&&v!==void 0?v:f==null?void 0:f.meta)!==null&&y!==void 0?y:{}})},trpc:Wy({path:i})})}function _X(t){const{input:e,query:n,path:s,queryKey:i,opts:o}=t,r=DC(t.queryClient),a=e===uo,c=async d=>{var f;const p=$t($t({},o),{},{trpc:$t($t({},o==null?void 0:o.trpc),!(o==null||(f=o.trpc)===null||f===void 0)&&f.abortOnUnmount?{signal:d.signal}:{signal:null})}),m=d.queryKey,g=await n(...IC(m,p));return pY(g)?RX(g,r,m):g};return Object.assign($t($t({},o),{},{queryKey:i,queryFn:a?uo:c}),{trpc:Wy({path:s})})}const MX=t=>{const{subscribe:e,path:n,queryKey:s,input:i,opts:o={}}=t,r="enabled"in o?!!o.enabled:i!==uo,a=c=>e(n.join("."),i===uo?void 0:i,c);return $t($t({},o),{},{enabled:r,subscribe:a,queryKey:s,trpc:Wy({path:n})})};function LX(t){const e=_.useRef(t);e.current=t;const n=_.useRef(new Set([])),s=_.useCallback(p=>{n.current.add(p)},[]),i=_.useRef(()=>{}),o=_.useCallback(()=>{var p;if((p=i.current)===null||p===void 0||p.call(i),f(r),!t.enabled)return;const m=t.subscribe({onStarted:()=>{var g,y;(g=(y=e.current).onStarted)===null||g===void 0||g.call(y),f(v=>$t($t({},v),{},{status:"pending",error:null}))},onData:g=>{var y,v;(y=(v=e.current).onData)===null||y===void 0||y.call(v,g),f(S=>$t($t({},S),{},{status:"pending",data:g,error:null}))},onError:g=>{var y,v;(y=(v=e.current).onError)===null||y===void 0||y.call(v,g),f(S=>$t($t({},S),{},{status:"error",error:g}))},onConnectionStateChange:g=>{var y,v;(y=(v=e.current).onConnectionStateChange)===null||y===void 0||y.call(v,g),f(S=>{switch(g.state){case"connecting":return $t($t({},S),{},{status:"connecting",error:g.error});case"pending":return S;case"idle":return $t($t({},S),{},{status:"idle",data:void 0,error:null})}})}});i.current=()=>{m.unsubscribe()}},[za(t.queryKey),t.enabled]),r=_.useCallback(()=>t.enabled?{data:void 0,error:null,status:"connecting",reset:o}:{data:void 0,error:null,status:"idle",reset:o},[t.enabled,o]),a=_.useRef(r()),[c,d]=_.useState(pA(a,s));c.reset=o;const f=_.useCallback(p=>{const m=a.current,g=a.current=p(m);let y=!1;for(const v of n.current)if(m[v]!==g[v]){y=!0;break}y&&d(pA(a,s))},[s]);return _.useEffect(()=>{if(t.enabled)return o(),()=>{var p;(p=i.current)===null||p===void 0||p.call(i)}},[o,t.enabled]),c}function pA(t,e){return new Proxy(t.current,{get(n,s){return e(s),t.current[s]}})}function RD(t){const e=t.keyPrefix,n=s=>(i,o,r)=>"router"in t?Promise.resolve(DC(t.ctx)).then(a=>TY({router:t.router,path:i,getRawInput:async()=>o,ctx:a,type:s,signal:void 0,batchIndex:0})):(t.client instanceof ND?t.client:pX(t.client))[s](i,o,r);return gD(({args:s,path:i})=>{const o=[...i],r=o.pop(),[a,c]=s;return{"~types":void 0,pathKey:()=>Pr({path:o,type:"any",prefix:e}),pathFilter:()=>$t($t({},a),{},{queryKey:Pr({path:o,type:"any",prefix:e})}),queryOptions:()=>_X({input:a,opts:c,path:o,queryClient:t.queryClient,queryKey:Pr({path:o,input:a,type:"query",prefix:e}),query:n("query")}),queryKey:()=>Pr({path:o,input:a,type:"query",prefix:e}),queryFilter:()=>$t($t({},c),{},{queryKey:Pr({path:o,input:a,type:"query",prefix:e})}),infiniteQueryOptions:()=>kX({input:a,opts:c,path:o,queryClient:t.queryClient,queryKey:Pr({path:o,input:a,type:"infinite",prefix:e}),query:n("query")}),infiniteQueryKey:()=>Pr({path:o,input:a,type:"infinite",prefix:e}),infiniteQueryFilter:()=>$t($t({},c),{},{queryKey:Pr({path:o,input:a,type:"infinite",prefix:e})}),mutationOptions:()=>{var d;return AX({opts:a,path:o,prefix:e,queryClient:t.queryClient,mutate:n("mutation"),overrides:(d=t.overrides)===null||d===void 0?void 0:d.mutations})},mutationKey:()=>OD({path:o,prefix:e}),subscriptionOptions:()=>MX({opts:c,path:o,input:a,queryKey:Pr({path:o,input:a,type:"any",prefix:e}),subscribe:n("subscription")})}[r]()})}function IX(){const t=_.createContext(null),e=_.createContext(null),n=o=>{const r=_.useMemo(()=>RD({client:o.trpcClient,queryClient:o.queryClient,keyPrefix:o.keyPrefix}),[o.trpcClient,o.queryClient,o.keyPrefix]);return _.createElement(t.Provider,{value:o.trpcClient},_.createElement(e.Provider,{value:r},o.children))};n.displayName="TRPCProvider";function s(){const o=_.useContext(e);if(!o)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return o}function i(){const o=_.useContext(t);if(!o)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return o}return{TRPCProvider:n,useTRPC:s,useTRPCClient:i}}const mA="/api/trpc",{TRPCProvider:DX,useTRPC:ui}=IX(),jX=()=>[cY({condition:t=>t.type==="subscription",true:bX({url:mA}),false:sX({url:mA})})],PX=t=>hX({links:t}),zX=(t,e)=>RD({client:t,queryClient:e}),BX=2e4,$X=()=>{const t=ee.c(10),e=ui(),n=fr({...e.updateNotice.queryOptions({}),staleTime:"static"}).data??null,[s,i]=_.useState(!1),[o,r]=_.useState(!1),a=n!==null&&!s;let c,d;t[0]!==a?(c=()=>{if(!a)return;const S=window.setTimeout(()=>{i(!0)},BX);return()=>{window.clearTimeout(S)}},d=[a],t[0]=a,t[1]=c,t[2]=d):(c=t[1],d=t[2]),_.useEffect(c,d);let f;t[3]!==n?(f=()=>{n!==null&&navigator.clipboard.writeText(n.command).then(()=>{r(!0)},()=>{r(!1)})},t[3]=n,t[4]=f):f=t[4];const p=f;let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{i(!0)},t[5]=m):m=t[5];const g=m,y=a?n:null;let v;return t[6]!==p||t[7]!==o||t[8]!==y?(v={notice:y,isCopied:o,copy:p,close:g},t[6]=p,t[7]=o,t[8]=y,t[9]=v):v=t[9],v},yw=[{label:"Agent integration",icon:"agents",link:b.jsx(rr,{to:"/settings/agents"})},{label:"Git integration",icon:"forges",link:b.jsx(rr,{to:"/settings/forges"})},{label:"Prompt configurations",icon:"configurations",link:b.jsx(rr,{to:"/settings/profiles"})},{label:"Repositories",icon:"repositories",link:b.jsx(rr,{to:"/settings/repositories"})},{label:"Review configuration",icon:"review",link:b.jsx(rr,{to:"/settings/review"})}],FX=t=>{const e=ee.c(3),{logoSrc:n,name:s}=t;let i;return e[0]!==n||e[1]!==s?(i=b.jsx("img",{src:n,alt:s,width:"32",height:"32",className:"size-8"}),e[0]=n,e[1]=s,e[2]=i):i=e[2],i};/**
76
+ * @license lucide-react v1.49.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const HX=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
81
+ * @license lucide-react v1.49.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */function UX(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:HX(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
86
+ * @license lucide-react v1.49.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const VX=t=>{let e="",n=!1;for(const s of t){if(s==="-"||s==="_"||s<=" "){n=e.length>0;continue}e.length===0?e+=s.toLowerCase():e+=n?s.toUpperCase():s,n=!1}return e};/**
91
+ * @license lucide-react v1.49.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const qX=t=>{const e=VX(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
96
+ * @license lucide-react v1.49.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const bw=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();/**
101
+ * @license lucide-react v1.49.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const _c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
106
+ * @license lucide-react v1.49.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */function Uv(t){return t!=null}function WX(t,e={}){var m,g;const n=e.attributeNames??{},s=y=>n[y]??y,i=t.size??t.width??_c.width,o=t.size??t.height??_c.height,r=((m=t.aliases)==null?void 0:m.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`))??[],a=[...t.name?[`lucide-${t.name}`]:[],...r],c=((g=e.className)==null?void 0:g.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?bw(...c):bw("lucide",...a,...c),f=e.absoluteStrokeWidth?Number(e.strokeWidth??_c["stroke-width"])*Number(t.size??t.width??_c.width)/Number(e.size??e.width??_c.width):e.strokeWidth??_c["stroke-width"];return["svg",{...Object.entries(_c).reduce((y,[v,S])=>(y[s(v)]=S,y),{}),..."color"in e&&e.color&&{[s("stroke")]:e.color},..."size"in e&&Uv(e.size)&&{[s("width")]:e.size,[s("height")]:e.size},..."width"in e&&Uv(e.width)&&{[s("width")]:e.width},..."height"in e&&Uv(e.height)&&{[s("height")]:e.height},[s("stroke-width")]:f,...d&&{[s("class")]:d},[s("viewBox")]:`0 0 ${i} ${o}`,...e.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(y=>{const[v,S,w]=y,N=e.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...S}:S;return w?[v,N,w]:[v,N]})]}/**
111
+ * @license lucide-react v1.49.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */function GX(t,e={}){return WX(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
116
+ * @license lucide-react v1.49.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const KX=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},YX=_.createContext({}),XX=()=>_.useContext(YX),QX=_.forwardRef(({color:t,size:e,width:n,height:s,strokeWidth:i,absoluteStrokeWidth:o,nonScalingStroke:r,className:a="",children:c,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...p},m)=>{const{size:g=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,nonScalingStroke:S=!1,color:w="currentColor",className:N=""}=XX()??{},C=!!c||KX(p),[T,R,A=[]]=GX(f,{color:t??w,width:n??e??g,height:s??e??g,strokeWidth:i??y,absoluteStrokeWidth:o??v,nonScalingStroke:r??S,className:bw(N,a),hasA11yProp:C,attributes:p});return _.createElement(T,{ref:m,...R},[...A.map(([k,M])=>_.createElement(k,M)),...Array.isArray(c)?c:[c]])});/**
121
+ * @license lucide-react v1.49.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */function vt(t,e=[],n=[]){const s=typeof t=="string"?UX(t,e,n):t,i=_.forwardRef(({className:o,...r},a)=>_.createElement(QX,{ref:a,icon:s,className:o,...r}));return s.name&&(i.displayName=qX(s.name)),i}/**
126
+ * @license lucide-react v1.49.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const kD={name:"anchor",size:24,node:[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]};kD.node;const AD=vt(kD);/**
131
+ * @license lucide-react v1.49.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const _D={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};_D.node;const ZX=vt(_D);/**
136
+ * @license lucide-react v1.49.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const MD={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};MD.node;const JX=vt(MD);/**
141
+ * @license lucide-react v1.49.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const LD={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};LD.node;const xw=vt(LD);/**
146
+ * @license lucide-react v1.49.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const ID={name:"bot",size:24,node:[["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"}]]};ID.node;const eQ=vt(ID);/**
151
+ * @license lucide-react v1.49.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const DD={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};DD.node;const tQ=vt(DD);/**
156
+ * @license lucide-react v1.49.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const jD={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};jD.node;const Nu=vt(jD);/**
161
+ * @license lucide-react v1.49.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const PD={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};PD.node;const lu=vt(PD);/**
166
+ * @license lucide-react v1.49.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const zD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};zD.node;const Gy=vt(zD);/**
171
+ * @license lucide-react v1.49.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const BD={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};BD.node;const $D=vt(BD);/**
176
+ * @license lucide-react v1.49.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const FD={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};FD.node;const nQ=vt(FD);/**
181
+ * @license lucide-react v1.49.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const HD={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};HD.node;const UD=vt(HD);/**
186
+ * @license lucide-react v1.49.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const VD={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};VD.node;const sQ=vt(VD);/**
191
+ * @license lucide-react v1.49.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const qD={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};qD.node;const iQ=vt(qD);/**
196
+ * @license lucide-react v1.49.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const WD={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};WD.node;const oQ=vt(WD);/**
201
+ * @license lucide-react v1.49.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const GD={name:"copy",size:24,node:[["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"}]]};GD.node;const rQ=vt(GD);/**
206
+ * @license lucide-react v1.49.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const KD={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};KD.node;const lQ=vt(KD);/**
211
+ * @license lucide-react v1.49.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const YD={name:"database",size:24,node:[["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"}]]};YD.node;const Od=vt(YD);/**
216
+ * @license lucide-react v1.49.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const XD={name:"external-link",size:24,node:[["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"}]]};XD.node;const QD=vt(XD);/**
221
+ * @license lucide-react v1.49.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const ZD={name:"file-text",size:24,node:[["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"}]]};ZD.node;const aQ=vt(ZD);/**
226
+ * @license lucide-react v1.49.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const JD={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]};JD.node;const cQ=vt(JD);/**
231
+ * @license lucide-react v1.49.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const ej={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};ej.node;const uQ=vt(ej);/**
236
+ * @license lucide-react v1.49.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const tj={name:"git-merge",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]};tj.node;const dQ=vt(tj);/**
241
+ * @license lucide-react v1.49.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const nj={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};nj.node;const vw=vt(nj);/**
246
+ * @license lucide-react v1.49.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const sj={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};sj.node;const fQ=vt(sj);/**
251
+ * @license lucide-react v1.49.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const ij={name:"message-square",size:24,node:[["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"}]]};ij.node;const hQ=vt(ij);/**
256
+ * @license lucide-react v1.49.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const oj={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};oj.node;const pQ=vt(oj);/**
261
+ * @license lucide-react v1.49.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const rj={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};rj.node;const mQ=vt(rj);/**
266
+ * @license lucide-react v1.49.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const lj={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};lj.node;const gQ=vt(lj);/**
271
+ * @license lucide-react v1.49.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const aj={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};aj.node;const gA=vt(aj);/**
276
+ * @license lucide-react v1.49.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const cj={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],aliases:["edit-3"]};cj.node;const yQ=vt(cj);/**
281
+ * @license lucide-react v1.49.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const uj={name:"pencil",size:24,node:[["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"}]]};uj.node;const dj=vt(uj);/**
286
+ * @license lucide-react v1.49.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const fj={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};fj.node;const jC=vt(fj);/**
291
+ * @license lucide-react v1.49.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const hj={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};hj.node;const Vv=vt(hj);/**
296
+ * @license lucide-react v1.49.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const pj={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};pj.node;const mj=vt(pj);/**
301
+ * @license lucide-react v1.49.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const gj={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};gj.node;const Bd=vt(gj);/**
306
+ * @license lucide-react v1.49.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const yj={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};yj.node;const bQ=vt(yj);/**
311
+ * @license lucide-react v1.49.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const bj={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};bj.node;const PC=vt(bj);/**
316
+ * @license lucide-react v1.49.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const xj={name:"triangle-alert",size:24,node:[["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"}]],aliases:["alert-triangle"]};xj.node;const xQ=vt(xj);/**
321
+ * @license lucide-react v1.49.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const vj={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};vj.node;const vQ=vt(vj);/**
326
+ * @license lucide-react v1.49.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const Sj={name:"workflow",size:24,node:[["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"}]]};Sj.node;const zC=vt(Sj);/**
331
+ * @license lucide-react v1.49.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const wj={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};wj.node;const Ky=vt(wj);/**
336
+ * @license lucide-react v1.49.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const Ej={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};Ej.node;const Sw=vt(Ej);/**
341
+ * @license lucide-react v1.49.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const Cj={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};Cj.node;const SQ=vt(Cj);/**
346
+ * @license lucide-react v1.49.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const Nj={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};Nj.node;const wQ=vt(Nj),Tj=_.createContext(void 0);function Yy(t){const e=_.useContext(Tj);if(e===void 0&&!t)throw new Error(yn(33));return e}const Oj=_.createContext(void 0);function pl(t){const e=_.useContext(Oj);if(e===void 0&&!t)throw new Error(yn(36));return e}const BC="data-starting-style",EQ="data-ending-style",CQ={[BC]:""},NQ={[EQ]:""},mm={transitionStatus(t){return t==="starting"?CQ:t==="ending"?NQ:null}},TQ="data-open",OQ="data-closed",RQ="data-anchor-hidden",Rj="data-popup-open",kQ="data-pressed",AQ={[Rj]:""},_Q={[Rj]:"",[kQ]:""},MQ={[TQ]:""},LQ={[OQ]:""},IQ={[RQ]:""},gm={open(t){return t?AQ:null}},ww={open(t){return t?_Q:null}},Lf={open(t){return t?MQ:LQ},anchorHidden(t){return t?IQ:null}},ym={...Lf,...mm},DQ=_.createContext(void 0);function $C(t=!0){const e=_.useContext(DQ);if(e===void 0&&!t)throw new Error(yn(25));return e}const bm="none",hr="trigger-press",Fn="trigger-hover",$d="trigger-focus",FC="outside-press",HC="item-press",kj="close-press",au="focus-out",xm="escape-key",Ip="list-navigation",jQ="cancel-open",_d="sibling-open",PQ="disabled",cu="imperative-action";function UC({controlled:t,default:e,name:n,state:s="value"}){const{current:i}=_.useRef(t!==void 0),[o,r]=_.useState(e),a=i&&t!==void 0?t:o,c=_.useCallback(d=>{i||r(d)},[]);return[a,c]}const Aj=_.createContext(void 0);function zQ(){const t=_.useContext(Aj);if(t===void 0)throw new Error(yn(30));return t}function BQ(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:$Q,platform:FQ,maxTouchPoints:HQ}=BQ(),Xy=$Q.toLowerCase(),Dp=FQ.toLowerCase(),Qy=/^i(os$|p)/.test(Dp)||Dp==="macintel"&&HQ>1,yA="android",Ew=Dp===yA||Xy.includes(yA),VC=!Qy&&Dp.startsWith("mac");Dp.startsWith("win");const UQ=VC||Qy;var WI;const Ya=typeof CSS<"u"&&!!((WI=CSS.supports)!=null&&WI.call(CSS,"-webkit-backdrop-filter:none"));!Ya&&Xy.includes("firefox");!Ya&&Xy.includes("chrom");const _j=UQ,qC=/jsdom|happydom/.test(Xy);function VQ(t){const{closeOnClick:e,highlighted:n,id:s,nodeId:i,store:o,typingRef:r,itemRef:a,itemMetadata:c}=t,{events:d}=o.useState("floatingTreeRoot"),f=o.useState("open"),p=$C(!0),m=p!==void 0;return _.useMemo(()=>({id:s,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(g){g.key===" "&&(r!=null&&r.current)&&g.preventDefault()},onMouseMove(g){i&&d.emit("itemhover",{nodeId:i,target:g.currentTarget})},onClick(g){e&&d.emit("close",{domEvent:g,reason:HC})},onMouseUp(g){if(p){const y=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,m&&y&&Math.abs(g.clientX-y.x)<=1&&Math.abs(g.clientY-y.y)<=1||m&&!VC&&g.button===2)return}a.current&&o.context.allowMouseUpTriggerRef.current&&(!m||g.button===2)&&c.type==="regular-item"&&y1(a.current,g,{detail:1})}}),[e,n,s,d,i,f,o,r,a,p,m,c])}const Mj={type:"regular-item"};function WC(t){const{closeOnClick:e,disabled:n,highlighted:s,id:i,store:o,typingRef:r=o.context.typingRef,nativeButton:a,itemMetadata:c,nodeId:d}=t,f=_.useRef(null),{getButtonProps:p,buttonRef:m}=Cu({disabled:n,focusableWhenDisabled:!0,native:a,composite:!0}),g=VQ({closeOnClick:e,highlighted:s,id:i,nodeId:d,store:o,typingRef:r,itemRef:f,itemMetadata:c}),y=_.useCallback(S=>nl(g,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},S,p),[g,p,c]),v=Fa(f,m);return _.useMemo(()=>({getItemProps:y,itemRef:v}),[y,v])}const Lj=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function qQ(){return _.useContext(Lj)}function Zy(t={}){const{guess:e,label:n,metadata:s,textRef:i,index:o}=t,{register:r,unregister:a,subscribeMapChange:c,nextIndexRef:d}=qQ(),f=_.useRef(-1),[p,m]=_.useState(o==null&&e?()=>{if(f.current===-1){const S=d.current;d.current+=1,f.current=S}return f.current}:-1),g=o??p,y=_.useRef(null),v=_.useCallback(S=>{const w=y.current;w&&a(w),y.current=S,S&&r(S,{metadata:s??null,index:o??null,label:n,textRef:i})},[o,r,a,s,n,i]);return Ue(()=>{if(o==null)return c(S=>{var N;const w=y.current?(N=S.get(y.current))==null?void 0:N.index:null;w!=null&&m(w)})},[o,c]),{ref:v,index:g}}let bA=0;function WQ(t,e="mui"){const[n,s]=_.useState(t),i=t||n;return _.useEffect(()=>{n==null&&(bA+=1,s(`${e}-${bA}`))},[n,e]),i}const xA=OC.useId;function ff(t,e){if(xA!==void 0){const n=xA();return t??(e?`${e}-${n}`:n)}return WQ(t,e)}function di(t){return ff(t,"base-ui")}const GQ="data-checked",KQ="data-unchecked",Ij={checked(t){return t?{[GQ]:""}:{[KQ]:""}},...mm};function xt(t,e,n,s){let i=!1,o=!1;const r=s??Ln;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...r}}const Dj=_.forwardRef(function(e,n){const{render:s,className:i,id:o,label:r,nativeButton:a=!1,disabled:c=!1,closeOnClick:d=!1,checked:f,defaultChecked:p,onCheckedChange:m,style:g,...y}=e,v=Zy({guess:!0,label:r}),S=Yy(!0),w=di(o),{store:N}=pl(),C=N.useState("disabled"),T=c||C,R=N.useState("isActive",v.index),A=N.useState("itemProps"),[k,M]=UC({controlled:f,default:p??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:L,itemRef:j}=WC({closeOnClick:d,disabled:T,highlighted:R,id:w,store:N,nativeButton:a,nodeId:S==null?void 0:S.context.nodeId,itemMetadata:Mj}),D=_.useMemo(()=>({disabled:T,highlighted:R,checked:k}),[T,R,k]);function P(I){const F=xt(HC,I.nativeEvent,void 0,{preventUnmountOnClose:ss});m==null||m(!k,F),!F.isCanceled&&M(z=>!z)}const B=Qt("div",e,{state:D,stateAttributesMapping:Ij,props:[A,{role:"menuitemcheckbox","aria-checked":k,onClick:P},y,L],ref:[j,n,v.ref]});return b.jsx(Aj.Provider,{value:D,children:B})});function GC(t){_.useEffect(t,Ha)}const k0=null;class YQ{constructor(){Ut(this,"callbacks",[]);Ut(this,"callbacksCount",0);Ut(this,"nextId",1);Ut(this,"startId",1);Ut(this,"isScheduled",!1);Ut(this,"tick",e=>{var i;this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)(i=n[o])==null||i.call(n,e)})}request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let A0=new YQ;class vi{constructor(){Ut(this,"currentId",k0);Ut(this,"cancel",()=>{this.currentId!==k0&&(A0.cancel(this.currentId),this.currentId=k0)});Ut(this,"disposeEffect",()=>this.cancel)}static create(){return new vi}static request(e){return A0.request(e)}static cancel(e){return A0.cancel(e)}request(e){this.cancel(),this.currentId=A0.request(()=>{this.currentId=k0,e()})}}function jp(){const t=Bs(vi.create).current;return GC(t.disposeEffect),t}function KC(t,e=!1,n=!1,s=!1){const[i,o]=_.useState(t&&e?"idle":void 0),[r,a]=_.useState(t&&!s);return t&&!r&&(a(!0),o("starting")),!t&&r&&i!=="ending"&&!n&&o("ending"),!t&&!r&&i==="ending"&&o(void 0),Ue(()=>{if(!t&&r&&i!=="ending"&&n){const c=vi.request(()=>{o("ending")});return()=>{vi.cancel(c)}}},[t,r,i,n]),Ue(()=>{if(!t||e)return;const c=vi.request(()=>{o(void 0)});return()=>{vi.cancel(c)}},[e,t]),Ue(()=>{if(!t||!e)return;t&&r&&i!=="idle"&&o("starting");const c=vi.request(()=>{o("idle")});return()=>{vi.cancel(c)}},[e,t,r,i]),{mounted:r,setMounted:a,transitionStatus:i}}var Vi=r6();const C_e=oC(Vi);function Fr(t){return t==null?t:"current"in t?t.current:t}let _0=null;function XQ(t){if(!_0){const e=[];_0=e,queueMicrotask(()=>{_0=null,Vi.flushSync(()=>{for(const n of e)n()})})}_0.push(t)}function vm(t,e=!1,n=!1){const s=jp();return Ye((i,o=null)=>{s.cancel();const r=Fr(t);if(r==null)return;const a=r,c=()=>{if(!n){Vi.flushSync(i);return}XQ(()=>{o!=null&&o.aborted||i()})};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function d(){Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{o!=null&&o.aborted||c()},()=>{if(o!=null&&o.aborted)return;if(a.getAnimations().some(p=>p.pending||p.playState!=="finished")){d();return}c()})}if(e){const f=BC;if(!a.hasAttribute(f)){s.request(d);return}const p=new MutationObserver(()=>{a.hasAttribute(f)||(p.disconnect(),d())});p.observe(a,{attributes:!0,attributeFilter:[f]}),o==null||o.addEventListener("abort",()=>p.disconnect(),{once:!0});return}s.request(d)})}function Xa(t){const{enabled:e=!0,open:n,ref:s,batch:i=!1,onComplete:o}=t,r=Ye(o),a=vm(s,n,i);_.useEffect(()=>{if(!e)return;const c=new AbortController;return a(r,c.signal),()=>{c.abort()}},[e,n,r,a])}const jj=_.forwardRef(function(e,n){const{render:s,className:i,style:o,keepMounted:r=!1,...a}=e,c=zQ(),d=_.useRef(null),{transitionStatus:f,mounted:p,setMounted:m}=KC(c.checked);Xa({batch:!0,enabled:!c.checked,open:c.checked,ref:d,onComplete(){c.checked||m(!1)}});const g={checked:c.checked,disabled:c.disabled,highlighted:c.highlighted,transitionStatus:f};return Qt("span",e,{state:g,ref:[n,d],stateAttributesMapping:Ij,props:{"aria-hidden":!0,...a},enabled:r||p})}),Pj=_.createContext(void 0);function QQ(){const t=_.useContext(Pj);if(t===void 0)throw new Error(yn(31));return t}const ZQ=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,[a,c]=_.useState(void 0),d=Qt("div",e,{ref:n,props:{role:"group","aria-labelledby":a,...r}});return b.jsx(Pj.Provider,{value:c,children:d})}),JQ=_.forwardRef(function(e,n){const{render:s,className:i,style:o,id:r,...a}=e,c=di(r),d=QQ();return Ue(()=>(d(c),()=>{d(f=>f===c?void 0:f)}),[d,c]),Qt("div",e,{ref:n,props:{id:c,"aria-hidden":!0,...a}})}),zj=_.forwardRef(function(e,n){const{render:s,className:i,id:o,label:r,nativeButton:a=!1,disabled:c=!1,closeOnClick:d=!0,style:f,...p}=e,m=Zy({guess:!0,label:r}),g=Yy(!0),y=di(o),{store:v}=pl(),S=v.useState("disabled"),w=c||S,N=v.useState("isActive",m.index),C=v.useState("itemProps"),{getItemProps:T,itemRef:R}=WC({closeOnClick:d,disabled:w,highlighted:N,id:y,store:v,nativeButton:a,nodeId:g==null?void 0:g.context.nodeId,itemMetadata:Mj});return Qt("div",e,{state:{disabled:w,highlighted:N},props:[C,p,T],ref:[R,n,m.ref]})}),Bh=0;class fo{constructor(){Ut(this,"currentId",Bh);Ut(this,"clear",()=>{this.currentId!==Bh&&(clearTimeout(this.currentId),this.currentId=Bh)});Ut(this,"disposeEffect",()=>this.clear)}static create(){return new fo}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Bh,n()},e)}isStarted(){return this.currentId!==Bh}}function li(){const t=Bs(fo.create).current;return GC(t.disposeEffect),t}function er(t){t.preventDefault(),t.stopPropagation()}function eZ(t){return"nativeEvent"in t}function YC(t){return t.pointerType===""&&t.isTrusted?!0:Ew&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function XC(t){return qC?!1:!Ew&&t.width===0&&t.height===0||Ew&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Aa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function tZ(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function oi(t){var n;let e=t.activeElement;for(;((n=e==null?void 0:e.shadowRoot)==null?void 0:n.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function at(t,e){var s;if(!t||!e)return!1;const n=(s=e.getRootNode)==null?void 0:s.call(e);if(t.contains(e))return!0;if(n&&df(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Ps(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const Cw="data-base-ui-focusable",Bj="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Jy="ArrowLeft",eb="ArrowRight",$j="ArrowUp",QC="ArrowDown",Nw="data-trigger-disabled";function V1(t,e){if(!Pt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute(Nw);for(const[,s]of e.entries())if(at(s,n))return!s.hasAttribute(Nw);return!1}function qv(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function nZ(t){return t.matches("html,body")}function tb(t){return gn(t)&&t.matches(Bj)}function sZ(t){return(t==null?void 0:t.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Bj}`))!=null}function Tw(t){return t?t.getAttribute("role")==="combobox"&&tb(t):!1}function iZ(t){if(!t||qC)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Ow(t){return t?t.hasAttribute(Cw)?t:t.querySelector(`[${Cw}]`)||t:null}function oZ(t,e){return e!=null&&!Aa(e)?0:typeof t=="function"?t():t}function Pp(t,e,n){const s=oZ(t,n);return typeof s=="number"?s:s==null?void 0:s[e]}function vA(t){return typeof t=="function"?t():t}function Fj(t,e){return e||t==="click"||t==="mousedown"}function rZ(t){return(t==null?void 0:t.includes("mouse"))&&t!=="mousedown"}const lZ=_.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new fo,currentIdRef:{current:null},currentContextRef:{current:null}});function aZ(t,e){t.current=e.current}function cZ(t,e={open:!1}){const{open:n}=e,s="rootStore"in t?t.rootStore:t,i=s.useState("floatingId"),o=_.useContext(lZ),{currentIdRef:r,delayRef:a,timeoutMs:c,initialDelayRef:d,currentContextRef:f,hasProvider:p,timeout:m}=o,[g,y]=_.useState(!1),v=_.useRef(n);return Ue(()=>{v.current=n},[n]),Ue(()=>{function S(){var w;(w=f.current)==null||w.setIsInstantPhase(!1),r.current=null,f.current=null,a.current=d.current,m.clear()}if(r.current&&!n&&r.current===i){if(y(!1),c){const w=i;return m.start(c,()=>{s.select("open")||r.current&&r.current!==w||S()}),()=>{(v.current||r.current!==w)&&m.clear()}}S()}},[n,i,r,a,c,d,f,m,s]),Ue(()=>{if(!n)return;const S=f.current,w=r.current;m.clear(),f.current={onOpenChange:s.setOpen,setIsInstantPhase:y},r.current=i,a.current={open:0,close:Pp(d.current,"close")},w!==null&&w!==i?(y(!0),S==null||S.setIsInstantPhase(!0),S==null||S.onOpenChange(!1,xt(bm))):(y(!1),S==null||S.setIsInstantPhase(!1))},[n,i,s,r,a,d,f,m]),Ue(()=>()=>{if(r.current===i){if(f.current=null,!v.current)return;r.current=null,aZ(a,d),m.clear()}},[f,r,a,i,d,m]),_.useMemo(()=>({activeIdRef:r,hasProvider:p,delayRef:a,isInstantPhase:g}),[r,p,a,g])}function Lt(t,e,n,s){return t.addEventListener(e,n,s),()=>{t.removeEventListener(e,n,s)}}function ur(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Xn(t){const e=Bs(uZ,t).current;return e.next=t,Ue(e.effect),e}function uZ(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const dZ={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},fZ={...dZ,position:"fixed",top:0,left:0},qa=_.forwardRef(function(e,n){const[s,i]=_.useState();Ue(()=>{_j&&Ya&&i("button")},[]);const o={tabIndex:0,role:s};return b.jsx("span",{...e,ref:n,style:fZ,"aria-hidden":s?void 0:!0,...o,"data-base-ui-focus-guard":""})}),hf=Math.min,sl=Math.max,q1=Math.round,M0=Math.floor,il=t=>({x:t,y:t}),hZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Hj(t,e,n){return sl(t,hf(e,n))}function Wa(t,e){return typeof t=="function"?t(e):t}function lo(t){return t.split("-")[0]}function dl(t){return t.split("-")[1]}function ZC(t){return t==="x"?"y":"x"}function JC(t){return t==="y"?"height":"width"}function ro(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function e3(t){return ZC(ro(t))}function pZ(t,e,n){n===void 0&&(n=!1);const s=dl(t),i=e3(t),o=JC(i);let r=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=W1(r)),[r,W1(r)]}function mZ(t){const e=W1(t);return[Rw(t),e,Rw(e)]}function Rw(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const SA=["left","right"],wA=["right","left"],gZ=["top","bottom"],yZ=["bottom","top"];function bZ(t,e,n){switch(t){case"top":case"bottom":return n?e?wA:SA:e?SA:wA;case"left":case"right":return e?gZ:yZ;default:return[]}}function xZ(t,e,n,s){const i=dl(t);let o=bZ(lo(t),n==="start",s);return i&&(o=o.map(r=>r+"-"+i),e&&(o=o.concat(o.map(Rw)))),o}function W1(t){const e=lo(t);return hZ[e]+t.slice(e.length)}function vZ(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function Uj(t){return typeof t!="number"?vZ(t):{top:t,right:t,bottom:t,left:t}}function G1(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function fp(t,e){return e<0||e>=t.length}function w1(t,e){return Kr(t.current,{disabledIndices:e})}function kw(t,e){return Kr(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Kr(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:s,amount:i=1}={}){let o=e;do o+=n?-i:i;while(o>=0&&o<=t.length-1&&Fd(t,o,s));return o}function Fd(t,e,n){if(typeof n=="function"?n(e):(n==null?void 0:n.includes(e))??!1)return!0;const i=t[e];return i?!nb(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function SZ(t){return t.visibility==="hidden"||t.visibility==="collapse"}function nb(t,e=t?Ui(t):null){return!t||!t.isConnected||!e||SZ(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const wZ='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function EZ(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return df(n)?n.host:null}function Aw(t){for(const e of Array.from(t.children))if(zs(e)==="summary")return e;return null}function CZ(t,e){const n=Aw(e);return!!n&&(t===n||at(n,t))}function Vj(t){const e=t?zs(t):"";return t!=null&&t.matches(wZ)&&(e!=="summary"||t.parentElement!=null&&zs(t.parentElement)==="details"&&Aw(t.parentElement)===t)&&(e!=="details"||Aw(t)==null)&&(e!=="input"||t.type!=="hidden")}function qj(t){if(!Vj(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=EZ(e)){const n=e!==t,s=zs(e)==="slot";if(e.hasAttribute("inert")||n&&zs(e)==="details"&&!e.open&&!CZ(t,e)||e.hasAttribute("hidden")||!s&&!NZ(e,n))return!1}return!0}function NZ(t,e){const n=Ui(t);return e?n.display!=="none":nb(t,n)}function Wj(t){const e=t.tabIndex;if(e<0){const n=zs(t);if(n==="details"||n==="audio"||n==="video"||gn(t)&&t.isContentEditable)return 0}return e}function Wv(t){if(zs(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function TZ(t,e){const n=Wv(t);if(!n)return!0;const s=e.find(i=>{const o=Wv(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return s?s===n:e.find(i=>{const o=Wv(i);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function Gj(t){if(gn(t)&&zs(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return gn(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function Kj(t,e){Gj(t).forEach(n=>{Vj(n)&&e.push(n),Kj(n,e)})}function Yj(t,e,n){Gj(t).forEach(s=>{gn(s)&&s.matches(e)&&n.push(s),Yj(s,e,n)})}function t3(t){return qj(t)&&Wj(t)>=0}function Xj(t){const e=[];return Kj(t,e),e.filter(qj)}function Sm(t){const e=Xj(t);return e.filter(n=>Wj(n)>=0&&TZ(n,e))}function Qj(t,e){const n=Sm(t),s=n.length;if(s===0)return;const i=oi(en(t)),o=n.indexOf(i),r=o===-1?e===1?0:s-1:o+e;return n[r]}function n3(t){return Qj(en(t).body,1)||t}function Zj(t){return Qj(en(t).body,-1)||t}function Jj(t,e){if(!t)return null;const n=Sm(en(t).body),s=n.length;if(s===0)return null;const i=n.indexOf(t);if(i===-1)return null;const o=(i+e+s)%s;return n[o]}function OZ(t){return Jj(t,1)}function RZ(t){return Jj(t,-1)}function Hd(t,e){const n=e||t.currentTarget,s=t.relatedTarget;return!s||!at(n,s)}function kZ(t){Sm(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function EA(t){const e=[];Yj(t,"[data-tabindex]",e),e.forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function Ga(t,e,n=!0){return t.filter(i=>i.parentId===e).flatMap(i=>{var o;return[...!n||(o=i.context)!=null&&o.open?[i]:[],...Ga(t,i.id,n)]})}function CA(t,e){var i;let n=[],s=(i=t.find(o=>o.id===e))==null?void 0:i.parentId;for(;s;){const o=t.find(r=>r.id===s);s=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function zp(t){return`data-base-ui-${t}`}let L0=0;function E1(t,e={}){const{preventScroll:n=!1,sync:s=!1,shouldFocus:i}=e;cancelAnimationFrame(L0);function o(){i&&!i()||t==null||t.focus({preventScroll:n})}if(s)return o(),ss;const r=requestAnimationFrame(o);return L0=r,()=>{L0===r&&(cancelAnimationFrame(r),L0=0)}}const Gv={inert:new WeakMap,"aria-hidden":new WeakMap},NA="data-base-ui-inert",_w={inert:new WeakSet,"aria-hidden":new WeakSet};let $h=new WeakMap,Kv=0;function AZ(t){return _w[t]}function eP(t){return t?df(t)?t.host:eP(t.parentNode):null}const TA=(t,e)=>e.map(n=>{if(t.contains(n))return n;const s=eP(n);return t.contains(s)?s:null}).filter(n=>n!=null),OA=t=>{const e=new Set;return t.forEach(n=>{let s=n;for(;s&&!e.has(s);)e.add(s),s=s.parentNode}),e},RA=(t,e,n)=>{const s=[],i=o=>{!o||n.has(o)||Array.from(o.children).forEach(r=>{zs(r)!=="script"&&(e.has(r)?i(r):s.push(r))})};return i(t),s};function _Z(t,e,n,s,{mark:i=!0}){let o=null;s?o="inert":n&&(o="aria-hidden");let r=null,a=null;const c=TA(e,t),d=i?RA(e,OA(c),new Set(c)):[],f=[],p=[];if(o){const m=Gv[o],g=AZ(o);a=g,r=m;const y=TA(e,Array.from(e.querySelectorAll("[aria-live]"))),v=c.concat(y);RA(e,OA(v),new Set(v)).forEach(w=>{const N=w.getAttribute(o),C=N!==null&&N!=="false",T=(m.get(w)||0)+1;m.set(w,T),f.push(w),T===1&&C&&g.add(w),C||w.setAttribute(o,o==="inert"?"":"true")})}return i&&d.forEach(m=>{const g=($h.get(m)||0)+1;$h.set(m,g),p.push(m),g===1&&m.setAttribute(NA,"")}),Kv+=1,()=>{r&&f.forEach(m=>{const y=(r.get(m)||0)-1;r.set(m,y),y||(!(a!=null&&a.has(m))&&o&&m.removeAttribute(o),a==null||a.delete(m))}),i&&p.forEach(m=>{const g=($h.get(m)||0)-1;$h.set(m,g),g||m.removeAttribute(NA)}),Kv-=1,Kv||(Gv.inert=new WeakMap,Gv["aria-hidden"]=new WeakMap,_w.inert=new WeakSet,_w["aria-hidden"]=new WeakSet,$h=new WeakMap)}}function kA(t,e={}){const{ariaHidden:n=!1,inert:s=!1,mark:i=!0}=e,o=en(t[0]).body;return _Z(t,o,n,s,{mark:i})}const MZ=500,tP=500,LZ={style:{transition:"none"}},s3="data-base-ui-click-trigger",IZ={fallbackAxisSide:"none"},sb={fallbackAxisSide:"end"},DZ={clipPath:"inset(50%)",position:"fixed",top:0,left:0},nP=_.createContext(null),sP=()=>_.useContext(nP),jZ=zp("portal");function iP(t={}){const{ref:e,container:n,componentProps:s=Ln,elementProps:i}=t,o=ff(),r=sP(),a=r==null?void 0:r.portalNode,[c,d]=_.useState(null),[f,p]=_.useState(null),m=Ye(S=>{S!==null&&p(S)}),g=_.useRef(null);Ue(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}const S=(n&&(CC(n)?n:n.current))??a??document.body;if(S==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==S&&(g.current=S,p(null),d(S))},[n,a]);const y=Qt("div",s,{ref:[e,m],props:[{id:o,[jZ]:""},i]}),v=c&&y?Vi.createPortal(y,c):null;return{node:f,nodeId:_.isValidElement(y)?y.props.id:void 0,subtree:v}}const i3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,children:r,container:a,portalOwnerRole:c,...d}=e,{node:f,nodeId:p,subtree:m}=iP({container:a,ref:n,componentProps:e,elementProps:d}),g=_.useRef(null),y=_.useRef(null),v=_.useRef(null),S=_.useRef(null),[w,N]=_.useState(null),C=_.useRef(!1),T=w==null?void 0:w.modal,R=w==null?void 0:w.open,A=!!w&&!w.modal&&w.open&&!!f;_.useEffect(()=>{if(!f||T)return;function M(L){f&&L.relatedTarget&&Hd(L)&&(L.type==="focusin"?C.current&&(EA(f),C.current=!1):(kZ(f),C.current=!0))}return ur(Lt(f,"focusin",M,!0),Lt(f,"focusout",M,!0))},[f,T]),Ue(()=>{!f||R!==!0||!C.current||(EA(f),C.current=!1)},[R,f]);const k=_.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:y,beforeInsideRef:v,afterInsideRef:S,portalNode:f,setFocusManagerState:N}),[f]);return b.jsxs(_.Fragment,{children:[m,b.jsxs(nP.Provider,{value:k,children:[A&&f&&b.jsx(qa,{"data-type":"outside",ref:g,onFocus:M=>{var L;if(Hd(M,f))(L=v.current)==null||L.focus();else{const j=w?w.domReference:null,D=Zj(j);D==null||D.focus()}}}),A&&f&&b.jsx("span",{role:c,"aria-owns":p,style:DZ}),f&&Vi.createPortal(r,f),A&&f&&b.jsx(qa,{"data-type":"outside",ref:y,onFocus:M=>{var L;if(Hd(M,f))(L=S.current)==null||L.focus();else{const j=w?w.domReference:null,D=n3(j);D==null||D.focus(),w!=null&&w.closeOnFocusOut&&(w==null||w.onOpenChange(!1,xt(au,M.nativeEvent)))}}})]})]})});function oP(){const t=new Map;return{emit(e,n){var s;(s=t.get(e))==null||s.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var s;(s=t.get(e))==null||s.delete(n)}}}class o3{constructor(){Ut(this,"nodesRef",{current:[]});Ut(this,"events",oP())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(s=>s===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const rP=_.createContext(null),lP=_.createContext(null),Tu=()=>{var t;return((t=_.useContext(rP))==null?void 0:t.id)||null},ml=t=>{const e=_.useContext(lP);return t??e};function wm(t){const e=ff(),n=ml(t),s=Tu();return Ue(()=>{if(!e)return;const i={id:e,parentId:s};return n==null||n.addNode(i),()=>{n==null||n.removeNode(i)}},[n,e,s]),e}function ib(t){const{children:e,id:n}=t,s=Tu();return b.jsx(rP.Provider,{value:_.useMemo(()=>({id:n,parentId:s}),[n,s]),children:e})}function ob(t){const{children:e,externalTree:n}=t,s=Bs(()=>n??new o3).current;return b.jsx(lP.Provider,{value:s,children:e})}function PZ(t,e){const n=In(Ps(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const AA=20;let Na=[];function r3(){Na=Na.filter(t=>{var e;return(e=t.deref())==null?void 0:e.isConnected})}function _A(t){r3(),t&&zs(t)!=="body"&&(Na.push(new WeakRef(t)),Na.length>AA&&(Na=Na.slice(-AA)))}function MA(){var t;return r3(),(t=Na[Na.length-1])==null?void 0:t.deref()}function zZ(t){return t?t3(t)?t:Sm(t)[0]||t:null}function LA(t){var i;if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!((i=t.getAttribute("role"))!=null&&i.includes("dialog")))return;const n=Xj(t).filter(o=>{const r=o.getAttribute("data-tabindex")||"";return t3(o)||o.hasAttribute("data-tabindex")&&!r.startsWith("-")}),s=t.getAttribute("tabindex");n.length===0?s!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(s!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function l3(t){const{context:e,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:o=!0,restoreFocus:r=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:d="",nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:g,getInsideElements:y}=t,v="rootStore"in e?e.rootStore:e,S=v.useState("open"),w=v.useState("domReferenceElement"),N=v.useState("floatingElement"),{events:C,dataRef:T}=v.context,R=Ye(()=>{var ne;return(ne=T.current.floatingContext)==null?void 0:ne.nodeId}),A=i===!1,k=Tw(w)&&A,M=Xn(i),L=Xn(o),j=Xn(d),D=Xn(S),P=ml(g),B=sP(),I=_.useRef(!1),F=_.useRef(!1),z=_.useRef(!1),U=_.useRef(null),H=_.useRef(""),V=_.useRef(""),W=_.useRef(null),G=_.useRef(null),Y=Fa(W,m,B==null?void 0:B.beforeInsideRef),J=Fa(G,B==null?void 0:B.afterInsideRef),q=li(),X=li(),Z=jp(),te=B!=null,Q=Ow(N),se=Ye((ne=Q)=>ne?Sm(ne):[]),ae=Ye(()=>(y==null?void 0:y().filter(ne=>ne!=null))??[]);_.useEffect(()=>{if(s||!a)return;function ne(ve){ve.key==="Tab"&&at(Q,oi(en(Q)))&&se().length===0&&!k&&er(ve)}const fe=en(Q);return Lt(fe,"keydown",ne)},[s,Q,a,k,se]),_.useEffect(()=>{if(s||!S)return;const ne=en(Q);function fe(){z.current=!1}function ve(Ce){const ye=Ps(Ce),Oe=ae(),be=at(N,ye)||at(w,ye)||at(B==null?void 0:B.portalNode,ye)||Oe.some(_e=>_e===ye||at(_e,ye));z.current=!be,V.current=Ce.pointerType||"keyboard",ye!=null&&ye.closest(`[${s3}]`)&&(F.current=!0,X.start(0,()=>{F.current=!1}))}function we(){V.current="keyboard"}return ur(Lt(ne,"pointerdown",ve,!0),Lt(ne,"pointerup",fe,!0),Lt(ne,"pointercancel",fe,!0),Lt(ne,"keydown",we,!0),fe)},[s,N,w,Q,S,B,X,ae]),_.useEffect(()=>{if(s||!c)return;const ne=en(Q);function fe(){F.current=!0,X.start(0,()=>{F.current=!1})}function ve(Oe){const be=Ps(Oe);t3(be)&&(U.current=be)}function we(Oe){const be=Oe.relatedTarget,_e=Oe.currentTarget,Me=Ps(Oe);a&&be==null&&Me!=null&&at(N,Me)&&_A(Me),queueMicrotask(()=>{const Be=R(),He=v.context.triggerElements,Ae=ae(),Ee=(be==null?void 0:be.hasAttribute(zp("focus-guard")))&&[W.current,G.current,B==null?void 0:B.beforeInsideRef.current,B==null?void 0:B.afterInsideRef.current,B==null?void 0:B.beforeOutsideRef.current,B==null?void 0:B.afterOutsideRef.current,Fr(p),Fr(f)].includes(be),Ne=!(at(w,be)||at(N,be)||at(be,N)||at(B==null?void 0:B.portalNode,be)||Ae.some(xe=>xe===be||at(xe,be))||He.hasMatchingElement(xe=>at(xe,be))||Ee||P&&(Ga(P.nodesRef.current,Be).find(xe=>{var Pe,We;return at((Pe=xe.context)==null?void 0:Pe.elements.floating,be)||at((We=xe.context)==null?void 0:We.elements.domReference,be)})||CA(P.nodesRef.current,Be).find(xe=>{var Pe,We,et;return[(Pe=xe.context)==null?void 0:Pe.elements.floating,Ow((We=xe.context)==null?void 0:We.elements.floating)].includes(be)||((et=xe.context)==null?void 0:et.elements.domReference)===be})));if(_e===w&&Q&&LA(Q),r&&_e!==w&&!nb(Me)&&oi(ne)===ne.body){if(gn(Q)&&(Q.focus(),r==="popup")){Z.request(()=>{Q.focus()});return}const xe=se(),Pe=U.current,We=(Pe&&xe.includes(Pe)?Pe:null)||xe[xe.length-1]||Q;gn(We)&&We.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(k||!a)&&be&&Ne&&!F.current&&(k||be!==MA())&&(I.current=!0,v.setOpen(!1,xt(au,Oe)))})}function Ce(){z.current||(T.current.insideReactTree=!0,q.start(0,()=>{T.current.insideReactTree=!1}))}const ye=gn(w)?w:null;if(!(!N&&!ye))return ur(ye&&Lt(ye,"focusout",we),ye&&Lt(ye,"pointerdown",fe),N&&Lt(N,"focusin",ve),N&&Lt(N,"focusout",we),N&&B&&Lt(N,"focusout",Ce,!0))},[s,w,N,Q,a,P,B,v,c,r,se,k,R,T,q,X,Z,f,p,ae]),_.useEffect(()=>{var _e,Me,Be;if(s||!N||!S)return;const ne=Array.from(((_e=B==null?void 0:B.portalNode)==null?void 0:_e.querySelectorAll(`[${zp("portal")}]`))||[]),ve=(Be=(Me=(P?CA(P.nodesRef.current,R()):[]).find(He=>{var Ae;return Tw(((Ae=He.context)==null?void 0:Ae.elements.domReference)||null)}))==null?void 0:Me.context)==null?void 0:Be.elements.domReference,Ce=[...[N,...ne,W.current,G.current,B==null?void 0:B.beforeOutsideRef.current,B==null?void 0:B.afterOutsideRef.current,...ae()],ve,Fr(p),Fr(f),k?w:null].filter(He=>He!=null),ye=kA(Ce,{ariaHidden:a||k,mark:!1}),Oe=[N,...ne].filter(He=>He!=null),be=kA(Oe);return()=>{be(),ye()}},[S,s,w,N,a,B,k,P,R,f,p,ae]),Ue(()=>{if(!S||s||!gn(Q))return;H.current="",V.current="";const ne=en(Q),fe=oi(ne);queueMicrotask(()=>{const ve=M.current,we=typeof ve=="function"?ve(j.current||""):ve;if(we===void 0||we===!1||at(Q,fe))return;let ye=null;const Oe=()=>(ye==null&&(ye=se(Q)),ye[0]||Q);let be;we===!0||we===null?be=Oe():be=Fr(we),be=be||Oe();const _e=at(Q,oi(ne));E1(be,{preventScroll:be===Q,shouldFocus(){if(!D.current)return!1;if(_e)return!0;const Me=oi(ne);return!(Me!==be&&at(Q,Me))}})})},[s,S,Q,se,M,j,D]),Ue(()=>{if(s||!Q)return;const ne=en(Q),fe=oi(ne),ve=j.current==null;_A(fe);function we(ye){if(ye.open||(H.current=PZ(ye.nativeEvent,V.current)),ye.reason===Fn&&ye.nativeEvent.type==="mouseleave"&&(I.current=!0),ye.reason===FC)if(ye.nested)I.current=!1;else if(YC(ye.nativeEvent)||XC(ye.nativeEvent))I.current=!1;else{let Oe=!1;en(Q).createElement("div").focus({get preventScroll(){return Oe=!0,!1}}),Oe?I.current=!1:I.current=!0}}C.on("openchange",we);function Ce(ye){const Oe=L.current;let be=typeof Oe=="function"?Oe(ye):Oe;if(be===void 0||be===!1)return null;be===null&&(be=!0);const _e=w!=null&&w.isConnected?w:null,Me=fe!=null&&fe.isConnected&&zs(fe)!=="body"?fe:null;let Be=ve?Me||_e:_e||Me;return Be||(Be=MA()||null),typeof be=="boolean"?Be:Fr(be)||Be||null}return()=>{C.off("openchange",we);const ye=oi(ne),Oe=ae(),be=at(N,ye)||Oe.some(He=>He===ye||at(He,ye))||P&&Ga(P.nodesRef.current,R(),!1).some(He=>{var Ae;return at((Ae=He.context)==null?void 0:Ae.elements.floating,ye)}),_e=L.current,Me=H.current,Be=Ce(Me);queueMicrotask(()=>{const He=zZ(Be),Ae=typeof _e!="boolean";if(_e&&!I.current&&gn(He)&&(!(!Ae&&He!==ye&&ye!==ne.body)||be)){const Ee={preventScroll:!0};Me==="keyboard"&&(Ee.focusVisible=!0),He.focus(Ee)}I.current=!1})}},[s,N,Q,L,j,C,P,w,R,ae]),Ue(()=>{if(!Ya||S||!N)return;const ne=oi(en(N));!gn(ne)||!tb(ne)||at(N,ne)&&ne.blur()},[S,N]),Ue(()=>{if(!(s||!B))return B.setFocusManagerState({modal:a,closeOnFocusOut:c,open:S,onOpenChange:v.setOpen,domReference:w}),()=>{B.setFocusManagerState(null)}},[s,B,a,S,v,c,w]),Ue(()=>{if(!(s||!Q))return LA(Q),()=>{queueMicrotask(r3)}},[s,Q]);const le=!s&&(a?!k:!0)&&(te||a);return b.jsxs(_.Fragment,{children:[le&&b.jsx(qa,{"data-type":"inside",ref:Y,onFocus:ne=>{var fe;if(a){const ve=se();E1(ve[ve.length-1])}else if(B!=null&&B.portalNode)if(I.current=!1,Hd(ne,B.portalNode)){const ve=n3(w);ve==null||ve.focus()}else(fe=Fr(p??B.beforeOutsideRef))==null||fe.focus()}}),n,le&&b.jsx(qa,{"data-type":"inside",ref:J,onFocus:ne=>{var fe;if(a)E1(se()[0]);else if(B!=null&&B.portalNode)if(c&&(I.current=!0),Hd(ne,B.portalNode)){const ve=Zj(w);ve==null||ve.focus()}else(fe=Fr(f??B.afterOutsideRef))==null||fe.focus()}})]})}function rb(t,e={}){const{enabled:n=!0,event:s="click",toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:r=!0,touchOpenDelay:a=0,reason:c=hr}=e,d="rootStore"in t?t.rootStore:t,f=d.context.dataRef,p=_.useRef(void 0),m=jp(),g=li(),y=_.useMemo(()=>{function v(w,N,C,T){const R=xt(c,N,C);w&&T==="touch"&&a>0?g.start(a,()=>{d.setOpen(!0,R)}):d.setOpen(w,R)}function S(w,N,C){const T=f.current.openEvent,R=d.select("domReferenceElement")!==N;return w&&R||!w||!i?!0:T&&r?!C(T.type):!1}return{onPointerDown(w){p.current=Aa(w.pointerType,!0)&&XC(w.nativeEvent)?"virtual":w.pointerType},onMouseDown(w){const N=p.current,C=w.nativeEvent,T=d.select("open");if(w.button!==0||s==="click"||Aa(N,!0)&&o)return;const R=S(T,w.currentTarget,M=>M==="click"||M==="mousedown"),A=Ps(C);if(tb(A)){v(R,C,A,N);return}const k=w.currentTarget;m.request(()=>{v(R,C,k,N)})},onClick(w){if(s==="mousedown-only")return;const N=p.current;if(s==="mousedown"&&N){p.current=void 0;return}if(Aa(N,!0)&&o)return;const C=d.select("open"),T=S(C,w.currentTarget,R=>R==="click"||R==="mousedown"||R==="keydown"||R==="keyup");v(T,w.nativeEvent,w.currentTarget,N)},onKeyDown(){p.current=void 0}}},[f,s,o,c,d,r,i,m,g,a]);return _.useMemo(()=>n?{reference:y}:Ln,[n,y])}function BZ(t,e){let n=null,s=null,i=!1;return{contextElement:t||void 0,getBoundingClientRect(){var g;const o=(t==null?void 0:t.getBoundingClientRect())||{width:0,height:0,x:0,y:0},r=e.axis==="x"||e.axis==="both",a=e.axis==="y"||e.axis==="both",c=["mouseenter","mousemove"].includes(((g=e.dataRef.current.openEvent)==null?void 0:g.type)||"")&&e.pointerType!=="touch";let d=o.width,f=o.height,p=o.x,m=o.y;return n==null&&e.x&&r&&(n=o.x-e.x),s==null&&e.y&&a&&(s=o.y-e.y),p-=n||0,m-=s||0,d=0,f=0,!i||c?(d=e.axis==="y"?o.width:0,f=e.axis==="x"?o.height:0,p=r&&e.x!=null?e.x:p,m=a&&e.y!=null?e.y:m):i&&!c&&(f=e.axis==="x"?o.height:f,d=e.axis==="y"?o.width:d),i=!0,{width:d,height:f,x:p,y:m,top:m,right:p+d,bottom:m+f,left:p}}}}function IA(t){return t!=null&&t.clientX!=null}function $Z(t,e={}){const{enabled:n=!0,axis:s="both"}=e,i="rootStore"in t?t.rootStore:t,o=i.useState("open"),r=i.useState("floatingElement"),a=i.useState("domReferenceElement"),c=i.context.dataRef,d=_.useRef(!1),f=_.useRef(null),[p,m]=_.useState(),[g,y]=_.useState([]),v=Ye(T=>{i.set("positionReference",T)}),S=Ye((T,R,A)=>{d.current||c.current.openEvent&&!IA(c.current.openEvent)||i.set("positionReference",BZ(A??a,{x:T,y:R,axis:s,dataRef:c,pointerType:p}))}),w=Ye(T=>{o?f.current||(S(T.clientX,T.clientY,T.currentTarget),y([])):S(T.clientX,T.clientY,T.currentTarget)}),N=Aa(p)?r:o;_.useEffect(()=>{if(!n){v(a);return}if(!N)return;function T(){var k;(k=f.current)==null||k.call(f),f.current=null}const R=In(r);function A(k){const M=Ps(k);at(r,M)?T():S(k.clientX,k.clientY)}return!c.current.openEvent||IA(c.current.openEvent)?f.current=Lt(R,"mousemove",A):v(a),T},[N,n,r,c,a,i,S,v,g]),_.useEffect(()=>()=>{i.set("positionReference",null)},[i]),_.useEffect(()=>{n&&!r&&(d.current=!1)},[n,r]),_.useEffect(()=>{!n&&o&&(d.current=!0)},[n,o]);const C=_.useMemo(()=>{function T(R){m(R.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:w,onMouseEnter:w}},[w]);return _.useMemo(()=>n?{reference:C,trigger:C}:{},[n,C])}function FZ(){return!1}function HZ(t){return{escapeKey:typeof t=="boolean"?t:(t==null?void 0:t.escapeKey)??!1,outsidePress:typeof t=="boolean"?t:(t==null?void 0:t.outsidePress)??!0}}function Em(t,e={}){const{enabled:n=!0,escapeKey:s=!0,outsidePress:i=!0,outsidePressEvent:o="sloppy",referencePress:r=FZ,bubbles:a,externalTree:c}=e,d="rootStore"in t?t.rootStore:t,f=d.useState("open"),p=d.useState("floatingElement"),{dataRef:m,events:g}=d.context,y=ml(c),v=Ye(typeof i=="function"?i:()=>!1),S=typeof i=="function"?v:i,w=S!==!1,N=Ye(()=>o),{escapeKey:C,outsidePress:T}=HZ(a),R=_.useRef(!1),A=_.useRef(!1),k=_.useRef(!1),M=_.useRef(!1),L=_.useRef(!1),j=_.useRef(""),D=_.useRef(null),P=li(),B=li(),I=Ye(()=>{B.clear(),m.current.insideReactTree=!1}),F=Ye(q=>{var te;const X=(te=m.current.floatingContext)==null?void 0:te.nodeId;return(y?Ga(y.nodesRef.current,X):[]).some(Q=>{var se;return((se=Q.context)==null?void 0:se.open)&&!Q.context.dataRef.current[q]})}),z=Ye(q=>qv(q,d.select("floatingElement"))||qv(q,d.select("domReferenceElement"))),U=Ye(q=>{r()&&d.setOpen(!1,xt(hr,q.nativeEvent))}),H=Ye(q=>{if(!f||!n||!s||q.key!=="Escape"||L.current||!C&&F("__escapeKeyBubbles"))return;const X=eZ(q)?q.nativeEvent:q,Z=xt(xm,X);d.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!C&&!Z.isPropagationAllowed&&q.stopPropagation()}),V=Ye(()=>{m.current.insideReactTree=!0,B.start(0,I)}),W=Ye(q=>{if(!f||!n||q.button!==0)return;const X=Ps(q.nativeEvent);at(d.select("floatingElement"),X)&&(R.current||(R.current=!0,A.current=!1))}),G=Ye(q=>{!f||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&R.current&&(A.current=!0)});_.useEffect(()=>{function q(X){X.open||(M.current=!1)}return g.on("openchange",q),()=>{g.off("openchange",q)}},[g]),_.useEffect(()=>{if(!f||!n)return f||(M.current=!1),I;m.current.__escapeKeyBubbles=C,m.current.__outsidePressBubbles=T;const q=new fo,X=new fo,Z=en(p);function te(){q.clear(),L.current=!0}function Q(){q.start(Ya?5:0,()=>{L.current=!1})}function se(){k.current=!0,X.start(0,()=>{k.current=!1})}function ae(){R.current=!1,A.current=!1}function le(){const Ne=j.current,xe=Ne==="pen"||!Ne?"mouse":Ne,Pe=N(),We=typeof Pe=="function"?Pe():Pe;return typeof We=="string"?We:We[xe]}function ne(Ne){const xe=le();return xe==="intentional"&&Ne.type!=="click"||xe==="sloppy"&&Ne.type==="click"}function fe(Ne){var We;const xe=(We=m.current.floatingContext)==null?void 0:We.nodeId,Pe=y&&Ga(y.nodesRef.current,xe).some(et=>{var At;return qv(Ne,(At=et.context)==null?void 0:At.elements.floating)});return z(Ne)||Pe}function ve(Ne){if(ne(Ne)){Ne.type!=="click"&&!z(Ne)&&(X.clear(),k.current=!1),I();return}if(m.current.insideReactTree){I();return}const xe=Ps(Ne),Pe=`[${zp("inert")}]`,We=Pt(xe)?xe.getRootNode():null,et=Array.from((df(We)?We:en(d.select("floatingElement"))).querySelectorAll(Pe)),At=d.context.triggerElements;if(xe&&(At.hasElement(xe)||At.hasMatchingElement(Te=>at(Te,xe))))return;let ze=Pt(xe)?xe:null;for(;ze&&!tl(ze);){const Te=ul(ze);if(tl(Te)||!Pt(Te))break;ze=Te}if(!(et.length&&Pt(xe)&&!nZ(xe)&&!at(xe,d.select("floatingElement"))&&et.every(Te=>!at(ze,Te)))){if(gn(xe)&&!("touches"in Ne)){const Te=tl(xe),qe=Ui(xe),ot=/auto|scroll/,bt=Te||ot.test(qe.overflowX),Ct=Te||ot.test(qe.overflowY),En=bt&&xe.clientWidth>0&&xe.scrollWidth>xe.clientWidth,Mt=Ct&&xe.clientHeight>0&&xe.scrollHeight>xe.clientHeight,jt=qe.direction==="rtl",rn=Mt&&(jt?Ne.offsetX<=xe.offsetWidth-xe.clientWidth:Ne.offsetX>xe.clientWidth),Cn=En&&Ne.offsetY>xe.clientHeight;if(rn||Cn)return}if(!fe(Ne)){if(le()==="intentional"){if(Ne.detail!==0&&!YC(Ne)&&!M.current)return;if(k.current){X.clear(),k.current=!1;return}}typeof S=="function"&&!S(Ne)||F("__outsidePressBubbles")||(d.setOpen(!1,xt(FC,Ne)),I())}}}function we(Ne){le()!=="sloppy"||Ne.pointerType==="touch"||!d.select("open")||!n||z(Ne)||ve(Ne)}function Ce(Ne){if(le()!=="sloppy"||!d.select("open")||!n||z(Ne))return;const xe=Ne.touches[0];xe&&(D.current={startTime:Date.now(),startX:xe.clientX,startY:xe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function ye(Ne,xe){const Pe=Ps(Ne);if(!Pe)return;const We=Lt(Pe,Ne.type,()=>{xe(Ne),We()})}function Oe(Ne){j.current="touch",ye(Ne,Ce)}function be(Ne){P.clear(),Ne.type==="pointerdown"&&(Ne.button===0&&(M.current=!0),j.current=Ne.pointerType),!(Ne.type==="mousedown"&&D.current&&!D.current.dismissOnMouseDown)&&ye(Ne,xe=>{xe.type==="pointerdown"?we(xe):ve(xe)})}function _e(Ne){if(Ne.type==="pointercancel"&&(M.current=!1),!R.current)return;const xe=A.current;if(ae(),le()==="intentional"){if(Ne.type==="pointercancel"){xe&&se();return}if(!fe(Ne)){if(xe){se();return}typeof S=="function"&&!S(Ne)||(X.clear(),k.current=!0,I())}}}function Me(Ne){if(le()!=="sloppy"||!D.current||z(Ne))return;const xe=Ne.touches[0];if(!xe)return;const Pe=Math.abs(xe.clientX-D.current.startX),We=Math.abs(xe.clientY-D.current.startY),et=Math.sqrt(Pe*Pe+We*We);et>5&&(D.current.dismissOnTouchEnd=!0),et>10&&(ve(Ne),P.clear(),D.current=null)}function Be(Ne){ye(Ne,Me)}function He(Ne){le()!=="sloppy"||!D.current||z(Ne)||(D.current.dismissOnTouchEnd&&ve(Ne),P.clear(),D.current=null)}function Ae(Ne){ye(Ne,He)}const Ee=ur(s&&ur(Lt(Z,"keydown",H),Lt(Z,"compositionstart",te),Lt(Z,"compositionend",Q)),w&&ur(Lt(Z,"click",be,!0),Lt(Z,"pointerdown",be,!0),Lt(Z,"pointerup",_e,!0),Lt(Z,"pointercancel",_e,!0),Lt(Z,"mousedown",be,!0),Lt(Z,"mouseup",_e,!0),Lt(Z,"touchstart",Oe,{capture:!0,passive:!0}),Lt(Z,"touchmove",Be,{capture:!0,passive:!0}),Lt(Z,"touchend",Ae,{capture:!0,passive:!0})));return()=>{Ee(),q.clear(),X.clear(),ae(),k.current=!1,I()}},[m,p,s,w,S,f,n,C,T,H,I,N,F,z,y,d,P]);const Y=_.useMemo(()=>({onKeyDown:H,onPointerDown:U,onClick:U}),[H,U]),J=_.useMemo(()=>({onKeyDown:H,onPointerDown:G,onMouseDown:G,onClickCapture:V,onMouseDownCapture(q){V(),W(q)},onPointerDownCapture(q){V(),W(q)},onMouseUpCapture:V,onTouchEndCapture:V,onTouchMoveCapture:V}),[H,V,W,G]);return _.useMemo(()=>n?{reference:Y,floating:J,trigger:Y}:{},[n,Y,J])}function DA(t,e,n){let{reference:s,floating:i}=t;const o=ro(e),r=e3(e),a=JC(r),c=lo(e),d=o==="y",f=s.x+s.width/2-i.width/2,p=s.y+s.height/2-i.height/2,m=s[a]/2-i[a]/2;let g;switch(c){case"top":g={x:f,y:s.y-i.height};break;case"bottom":g={x:f,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:p};break;case"left":g={x:s.x-i.width,y:p};break;default:g={x:s.x,y:s.y}}const y=dl(e);return y&&(g[r]+=m*(y==="end"?1:-1)*(n&&d?-1:1)),g}async function UZ(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Wa(e,t),y=Uj(g),S=a[m?p==="floating"?"reference":"floating":p],w=G1(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:f,strategy:c})),N=p==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),T=await(o.isElement==null?void 0:o.isElement(C))&&await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1},R=G1(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:N,offsetParent:C,strategy:c}):N);return{top:(w.top-R.top+y.top)/T.y,bottom:(R.bottom-w.bottom+y.bottom)/T.y,left:(w.left-R.left+y.left)/T.x,right:(R.right-w.right+y.right)/T.x}}const VZ=50,qZ=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=r.detectOverflow?r:{...r,detectOverflow:UZ},c=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=DA(d,s,c),m=s,g=0;const y={};for(let v=0;v<o.length;v++){const S=o[v];if(!S)continue;const{name:w,fn:N}=S,{x:C,y:T,data:R,reset:A}=await N({x:f,y:p,initialPlacement:s,placement:m,strategy:i,middlewareData:y,rects:d,platform:a,elements:{reference:t,floating:e}});f=C??f,p=T??p,y[w]={...y[w],...R},A&&g<VZ&&(g++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(d=A.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:f,y:p}=DA(d,m,c)),v=-1)}return{x:f,y:p,placement:m,strategy:i,middlewareData:y}},WZ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:o,rects:r,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...S}=Wa(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=lo(i),N=ro(a),C=lo(a)===a,T=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(C||!v?[W1(a)]:mZ(a)),A=y!=="none";!m&&A&&R.push(...xZ(a,v,y,T));const k=[a,...R],M=await c.detectOverflow(e,S),L=[];let j=((s=o.flip)==null?void 0:s.overflows)||[];if(f&&L.push(M[w]),p){const I=pZ(i,r,T);L.push(M[I[0]],M[I[1]])}if(j=[...j,{placement:i,overflows:L}],!L.every(I=>I<=0)){var D,P;const I=(((D=o.flip)==null?void 0:D.index)||0)+1,F=k[I];if(F&&(!(p==="alignment"?N!==ro(F):!1)||j.every(H=>ro(H.placement)===N?H.overflows[0]>0:!0)))return{data:{index:I,overflows:j},reset:{placement:F}};let z=(P=j.filter(U=>U.overflows[0]<=0).sort((U,H)=>U.overflows[1]-H.overflows[1])[0])==null?void 0:P.placement;if(!z)switch(g){case"bestFit":{var B;const U=(B=j.filter(H=>{if(A){const V=ro(H.placement);return V===N||V==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(V=>V>0).reduce((V,W)=>V+W,0)]).sort((H,V)=>H[1]-V[1])[0])==null?void 0:B[0];U&&(z=U);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}},aP=new Set(["left","top"]);async function GZ(t,e){const{placement:n,platform:s,elements:i}=t,o=await(s.isRTL==null?void 0:s.isRTL(i.floating)),r=lo(n),a=dl(n),c=ro(n)==="y",d=aP.has(r)?-1:1,f=o&&c?-1:1,p=Wa(e,t);let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),c?{x:g*f,y:m*d}:{x:m*d,y:g*f}}const KZ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:o,placement:r,middlewareData:a}=e,c=await GZ(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:r}}}}},YZ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:c={fn:N=>{let{x:C,y:T}=N;return{x:C,y:T}}},...d}=Wa(t,e),f={x:n,y:s},p=await o.detectOverflow(e,d),m=ro(i),g=ZC(m);let y=f[g],v=f[m];const S=(N,C)=>Hj(C+p[N==="y"?"top":"left"],C,C-p[N==="y"?"bottom":"right"]);r&&(y=S(g,y)),a&&(v=S(m,v));const w=c.fn({...e,[g]:y,[m]:v});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[g]:r,[m]:a}}}}}},XZ=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,s;const{x:i,y:o,placement:r,rects:a,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Wa(t,e),m={x:i,y:o},g=ro(r),y=ZC(g);let v=m[y],S=m[g];const w=Wa(d,e),N=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(s=w.crossAxis)!=null?s:0};if(f){const R=y==="y"?"height":"width",A=a.reference[y]-a.floating[R]+N.mainAxis,k=a.reference[y]+a.reference[R]-N.mainAxis;v<A?v=A:v>k&&(v=k)}if(p){var C,T;const R=y==="y"?"width":"height",A=aP.has(lo(r)),k=a.reference[g]-a.floating[R]+(A&&((C=c.offset)==null?void 0:C[g])||0)+(A?0:N.crossAxis),M=a.reference[g]+a.reference[R]+(A?0:((T=c.offset)==null?void 0:T[g])||0)-(A?N.crossAxis:0);S<k?S=k:S>M&&(S=M)}return{[y]:v,[g]:S}}}},QZ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:o}=e,{apply:r=()=>{},...a}=Wa(t,e),c=await i.detectOverflow(e,a),d=lo(n),f=dl(n),p=ro(n)==="y",{width:m,height:g}=s.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,y=f==="end"?"top":"bottom");const S=g-c.top-c.bottom,w=m-c.left-c.right,N=hf(g-c[y],S),C=hf(m-c[v],w),T=e.middlewareData.shift,R=!T;let A=N,k=C;T!=null&&T.enabled.x&&(k=w),T!=null&&T.enabled.y&&(A=S),R&&!f&&(p?k=m-2*sl(c.left,c.right):A=g-2*sl(c.top,c.bottom)),await r({...e,availableWidth:k,availableHeight:A});const M=await i.getDimensions(o.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function cP(t){const e=Ui(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=gn(t),o=i?t.offsetWidth:n,r=i?t.offsetHeight:s,a=q1(n)!==o||q1(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function a3(t){return Pt(t)?t:t.contextElement}function Ud(t){const e=a3(t);if(!gn(e))return il(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:o}=cP(e);let r=(o?q1(n.width):n.width)/s,a=(o?q1(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const ZZ=il(0);function uP(t){const e=In(t);return!TC()||!e.visualViewport?ZZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function JZ(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===In(t)}function uu(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=a3(t);let r=il(1);e&&(s?Pt(s)&&(r=Ud(s)):r=Ud(t));const a=JZ(o,n,s)?uP(o):il(0);let c=(i.left+a.x)/r.x,d=(i.top+a.y)/r.y,f=i.width/r.x,p=i.height/r.y;if(o&&s){const m=In(o),g=Pt(s)?In(s):s;let y=m,v=fw(y);for(;v&&g!==y;){const S=Ud(v),w=v.getBoundingClientRect(),N=Ui(v),C=w.left+(v.clientLeft+parseFloat(N.paddingLeft))*S.x,T=w.top+(v.clientTop+parseFloat(N.paddingTop))*S.y;c*=S.x,d*=S.y,f*=S.x,p*=S.y,c+=C,d+=T,y=In(v),v=fw(y)}}return G1({width:f,height:p,x:c,y:d})}function lb(t,e){const n=Vy(t).scrollLeft;return e?e.left+n:uu(hl(t)).left+n}function dP(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-lb(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function eJ(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const o=i==="fixed",r=hl(s),a=e?Uy(e.floating):!1;if(s===r||a&&o)return n;let c={scrollLeft:0,scrollTop:0},d=il(1);const f=il(0),p=gn(s);if((p||!o)&&((zs(s)!=="body"||pm(r))&&(c=Vy(s)),p)){const g=uu(s);d=Ud(s),f.x=g.x+s.clientLeft,f.y=g.y+s.clientTop}const m=r&&!p&&!o?dP(r,c):il(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function tJ(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function nJ(t){const e=Vy(t),n=t.ownerDocument.body,s=sl(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=sl(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-e.scrollLeft+lb(t);const r=-e.scrollTop;return Ui(n).direction==="rtl"&&(o+=sl(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:r}}const sJ=25;function iJ(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=In(t),o=hl(t),r=i.visualViewport;let a=o.clientWidth,c=o.clientHeight,d=0,f=0;if(r){const m=!TC()||e==="fixed";s?m||(d=-r.offsetLeft,f=-r.offsetTop):(a=r.width,c=r.height,m&&(d=r.offsetLeft,f=r.offsetTop))}if(lb(o)<=0){const m=o.ownerDocument,g=m.body,y=getComputedStyle(g),v=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(o.clientWidth-g.clientWidth-v),w=getComputedStyle(o).scrollbarGutter==="stable both-edges"?S/2:S;w<=sJ&&(a-=w)}return{width:a,height:c,x:d,y:f}}function oJ(t,e){const n=uu(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ud(t),r=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,d=s*o.y;return{width:r,height:a,x:c,y:d}}function jA(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=iJ(t,n,e);else if(e==="document")s=nJ(hl(t));else if(Pt(e))s=oJ(e,n);else{const i=uP(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return G1(s)}function rJ(t,e){const n=e.get(t);if(n)return n;let s=kp(t,[],!1).filter(a=>Pt(a)&&zs(a)!=="body"),i=null;const o=Ui(t).position==="fixed";let r=o?ul(t):t;for(;Pt(r)&&!tl(r);){const a=Ui(r),c=NC(r),d=i?i.position:o?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(p=>p!==r):i=a,r=ul(r)}return e.set(t,s),s}function lJ(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const r=[...n==="clippingAncestors"?Uy(e)?[]:rJ(e,this._c):[].concat(n),s],a=jA(e,r[0],i);let c=a.top,d=a.right,f=a.bottom,p=a.left;for(let m=1;m<r.length;m++){const g=jA(e,r[m],i);c=sl(g.top,c),d=hf(g.right,d),f=hf(g.bottom,f),p=sl(g.left,p)}return{width:d-p,height:f-c,x:p,y:c}}function aJ(t){const{width:e,height:n}=cP(t);return{width:e,height:n}}function cJ(t,e,n){const s=gn(e),i=hl(e),o=n==="fixed",r=uu(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=il(0);if((s||!o)&&((zs(e)!=="body"||pm(i))&&(a=Vy(e)),s)){const m=uu(e,!0,o,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!s&&i&&(c.x=lb(i));const d=i&&!s&&!o?dP(i,a):il(0),f=r.left+a.scrollLeft-c.x-d.x,p=r.top+a.scrollTop-c.y-d.y;return{x:f,y:p,width:r.width,height:r.height}}function Yv(t){return Ui(t).position==="static"}function PA(t,e){if(!gn(t)||Ui(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hl(t)===n&&(n=n.ownerDocument.body),n}function fP(t,e){const n=In(t);if(Uy(t))return n;if(!gn(t)){let i=ul(t);for(;i&&!tl(i);){if(Pt(i)&&!Yv(i))return i;i=ul(i)}return n}let s=PA(t,e);for(;s&&QG(s)&&Yv(s);)s=PA(s,e);return s&&tl(s)&&Yv(s)&&!NC(s)?n:s||eK(t)||n}const uJ=async function(t){const e=this.getOffsetParent||fP,n=this.getDimensions,s=await n(t.floating);return{reference:cJ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function dJ(t){return Ui(t).direction==="rtl"}const fJ={convertOffsetParentRelativeRectToViewportRelativeRect:eJ,getDocumentElement:hl,getClippingRect:lJ,getOffsetParent:fP,getElementRects:uJ,getClientRects:tJ,getDimensions:aJ,getScale:Ud,isElement:Pt,isRTL:dJ};function hP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function hJ(t,e,n){let s=null,i;const o=hl(t);function r(){var f;clearTimeout(i),(f=s)==null||f.disconnect(),s=null}function a(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),r();const m=t.getBoundingClientRect(),{left:g,top:y,width:v,height:S}=m;if(f||e(),!v||!S)return;const w=M0(y),N=M0(o.clientWidth-(g+v)),C=M0(o.clientHeight-(y+S)),T=M0(g),A={rootMargin:-w+"px "+-N+"px "+-C+"px "+-T+"px",threshold:sl(0,hf(1,p))||1};let k=!0;function M(L){const j=L[0].intersectionRatio;if(!hP(m,t.getBoundingClientRect()))return a();if(j!==p){if(!k)return a();j?a(!1,j):i=setTimeout(()=>{a(!1,1e-7)},1e3)}k=!1}try{s=new IntersectionObserver(M,{...A,root:o.ownerDocument})}catch{s=new IntersectionObserver(M,A)}s.observe(t)}const c=In(t),d=()=>a(n);return c.addEventListener("resize",d),a(!0),()=>{c.removeEventListener("resize",d),r()}}function zA(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=a3(t),f=i||o?[...d?kp(d):[],...e?kp(e):[]]:[];f.forEach(w=>{i&&w.addEventListener("scroll",n),o&&w.addEventListener("resize",n)});const p=d&&a?hJ(d,n,o):null;let m=-1,g=null;r&&(g=new ResizeObserver(w=>{let[N]=w;N&&N.target===d&&g&&e&&(g.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(e)})),n()}),d&&!c&&g.observe(d),e&&g.observe(e));let y,v=c?uu(t):null;c&&S();function S(){const w=uu(t);v&&!hP(v,w)&&n(),v=w,y=requestAnimationFrame(S)}return n(),()=>{var w;f.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),p==null||p(),(w=g)==null||w.disconnect(),g=null,c&&cancelAnimationFrame(y)}}const pJ=KZ,mJ=YZ,gJ=WZ,yJ=QZ,bJ=XZ,xJ=(t,e,n)=>{const s=new Map,i=n??{},o={...fJ,...i.platform,_c:s};return qZ(t,e,{...i,platform:o})};var vJ=typeof document<"u",SJ=function(){},C1=vJ?_.useLayoutEffect:SJ;function K1(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!K1(t[s],e[s]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&t.$$typeof)&&!K1(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function pP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function BA(t,e){const n=pP(t);return Math.round(e*n)/n}function Xv(t){const e=_.useRef(t);return C1(()=>{e.current=t}),e}function wJ(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:c,open:d}=t,[f,p]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,g]=_.useState(s);K1(m,s)||g(s);const[y,v]=_.useState(null),[S,w]=_.useState(null),N=_.useCallback(H=>{H!==A.current&&(A.current=H,v(H))},[]),C=_.useCallback(H=>{H!==k.current&&(k.current=H,w(H))},[]),T=o||y,R=r||S,A=_.useRef(null),k=_.useRef(null),M=_.useRef(f),L=c!=null,j=Xv(c),D=Xv(i),P=Xv(d),B=_.useCallback(()=>{if(!A.current||!k.current)return;const H={placement:e,strategy:n,middleware:m};D.current&&(H.platform=D.current),xJ(A.current,k.current,H).then(V=>{const W={...V,isPositioned:P.current!==!1};I.current&&!K1(M.current,W)&&(M.current=W,Vi.flushSync(()=>{p(W)}))})},[m,e,n,D,P]);C1(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const I=_.useRef(!1);C1(()=>(I.current=!0,()=>{I.current=!1}),[]),C1(()=>{if(T&&(A.current=T),R&&(k.current=R),T&&R){if(j.current)return j.current(T,R,B);B()}},[T,R,B,j,L]);const F=_.useMemo(()=>({reference:A,floating:k,setReference:N,setFloating:C}),[N,C]),z=_.useMemo(()=>({reference:T,floating:R}),[T,R]),U=_.useMemo(()=>{const H={position:n,left:0,top:0};if(!z.floating)return H;const V=BA(z.floating,f.x),W=BA(z.floating,f.y);return a?{...H,transform:"translate("+V+"px, "+W+"px)",...pP(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:W}},[n,a,z.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:B,refs:F,elements:z,floatingStyles:U}),[f,B,F,z,U])}const EJ=(t,e)=>{const n=pJ(t);return{name:n.name,fn:n.fn,options:[t,e]}},CJ=(t,e)=>{const n=mJ(t);return{name:n.name,fn:n.fn,options:[t,e]}},NJ=(t,e)=>({fn:bJ(t).fn,options:[t,e]}),TJ=(t,e)=>{const n=gJ(t);return{name:n.name,fn:n.fn,options:[t,e]}},OJ=(t,e)=>{const n=yJ(t);return{name:n.name,fn:n.fn,options:[t,e]}};function Y1(t,e,n,s){return{left:t,top:e,right:n,bottom:s,x:t,y:e,width:n-t,height:s-e}}function RJ(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}function mP(t){const e=[];let n,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(const a of Array.from(t).sort((c,d)=>c.top-d.top)){if(s=Math.min(s,a.left),i=Math.min(i,a.top),o=Math.max(o,a.right),r=Math.max(r,a.bottom),!n||a.top-n.top>n.height/2)e.push(RJ(a));else{const c=e[e.length-1];c.left=Math.min(c.left,a.left),c.right=Math.max(c.right,a.right),c.bottom=Math.max(c.bottom,a.bottom),c.width=c.right-c.left,c.height=c.bottom-c.top}n=a}return{lines:e,fallback:Y1(s,i,o,r)}}function gP(t,e,n){return t.findIndex(s=>e>s.left-2&&e<s.right+2&&n>s.top-2&&n<s.bottom+2)}function $A(t){return Y1(t.left,t.top,t.right,t.bottom)}function kJ(t,e,n){const{lines:s}=mP(t.getClientRects());if(s.length<2)return;const i=gP(s,e,n);return{x:e,y:n,lineIndex:i===-1?void 0:i,element:t}}function AJ(t,e,n){const{lines:s,fallback:i}=mP(t.getClientRects());if(s.length<2)return null;const o=n==null?void 0:n.x,r=n==null?void 0:n.y,a=e[0];if((n==null?void 0:n.lineIndex)!=null&&s[n.lineIndex])return $A(s[n.lineIndex]);if(o!=null&&r!=null){const y=gP(s,o,r);if(y!==-1)return $A(s[y])}if(s.length===2&&s[0].left>s[1].right&&o!=null&&r!=null)return i;if(a==="t"||a==="b"){const y=s[0],v=s[s.length-1],S=a==="t"?y:v;return Y1(S.left,y.top,S.right,v.bottom)}const c=a==="l";let d=s[0].left,f=s[0].right,p=c?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,m=s[0],g=s[0];for(const y of s){d=Math.min(d,y.left),f=Math.max(f,y.right);const v=c?y.left:y.right;c&&v<p||!c&&v>p?(p=v,m=y,g=y):v===p&&(g=y)}return Y1(d,m.top,f,g.bottom)}function _J(t){return"contextElement"in t&&t.contextElement?t.contextElement:Pt(t)?t:void 0}function MJ(t,e){function n(i){yP(t,i.currentTarget,i.clientX,i.clientY)}function s(i){e||n(i)}return{onFocus(){t.current=void 0},onMouseEnter:s,onMouseMove:s}}function yP(t,e,n,s){const i=kJ(e,n,s);return t.current=i,i}function LJ(t){return{name:"inline",async fn(e){const n=e.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!="function")return{};const s=_J(n),i=t.current,o=(i==null?void 0:i.element)===n||(i==null?void 0:i.element)===s?i:void 0,r=AJ(n,e.placement,o);if(!r||typeof e.platform.getElementRects!="function")return{};const a=await e.platform.getElementRects({reference:{contextElement:s,getBoundingClientRect(){return r}},floating:e.elements.floating,strategy:e.strategy});return e.rects.reference.x===a.reference.x&&e.rects.reference.y===a.reference.y&&e.rects.reference.width===a.reference.width&&e.rects.reference.height===a.reference.height?{}:{reset:{rects:a}}}}}class IJ{constructor(e,n,s=!0){Ut(this,"attachedStores",[]);Ut(this,"attachedStoreValue",null);Ut(this,"storeListeners",new Set);this.fallbackStore=e,this.componentName=n,this.throwOnMissingTrigger=s}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{const n=this.attachedStores.lastIndexOf(e);n!==-1&&this.attachedStores.splice(n,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(n=>{n()}))}openByTrigger(e){const n=this.attachedStore;if(n===null)return;let s;if(e){for(let i=this.attachedStores.length-1;i>=0&&!s;i-=1)s=this.attachedStores[i].context.triggerElements.getById(e);s??(s=this.fallbackStore.context.triggerElements.getById(e))}if(e&&!s&&this.throwOnMissingTrigger)throw new Error(yn(99,this.componentName,e,this.componentName));n.setOpen(!0,xt(cu,void 0,s))}closePopup(){const e=this.attachedStore;e!==null&&e.setOpen(!1,xt(cu))}}var c3=M6();const Mw=[];let Lw;function DJ(){return Lw}function jJ(t){Mw.push(t)}function If(t){const e=(n,s)=>{const i=Bs(PJ).current;let o;try{Lw=i;for(const r of Mw)r.before(i);o=t(n,s);for(const r of Mw)r.after(i);i.didInitialize=!0}finally{Lw=void 0}return o};return e.displayName=t.displayName||t.name,e}function Cm(t){return _.forwardRef(If(t))}function PJ(){return{didInitialize:!1}}const zJ=_C(19),BJ=zJ?FJ:HJ;function bP(t,e,n,s,i){return BJ(t,e,n,s,i)}function $J(t,e,n,s,i){const o=_.useCallback(()=>e(t.getSnapshot(),n,s,i),[t,e,n,s,i]);return c3.useSyncExternalStore(t.subscribe,o,o)}jJ({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const s=t.syncHooks[n],i=s.selector(s.store.state,s.a1,s.a2,s.a3);Object.is(s.value,i)||(e=!0,s.value=i)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const i of t.syncHooks)n.add(i.store);const s=[];for(const i of n)s.push(i.subscribe(e));return()=>{for(const i of s)i()}}),c3.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function FJ(t,e,n,s,i){const o=DJ();if(!o)return $J(t,e,n,s,i);const r=o.syncIndex;o.syncIndex+=1;let a;return o.didInitialize?(a=o.syncHooks[r],(a.store!==t||a.selector!==e||!Object.is(a.a1,n)||!Object.is(a.a2,s)||!Object.is(a.a3,i))&&(a.store!==t&&(o.didChangeStore=!0),a.store=t,a.selector=e,a.a1=n,a.a2=s,a.a3=i,a.value=e(t.getSnapshot(),n,s,i))):(a={store:t,selector:e,a1:n,a2:s,a3:i,value:e(t.getSnapshot(),n,s,i)},o.syncHooks.push(a)),a.value}function HJ(t,e,n,s,i){return wC.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,s,i))}class UJ{constructor(e){Ut(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));Ut(this,"getSnapshot",()=>this.state);this.state=e,this.listeners=new Set,this.updateTick=0}static create(e){return new this(e)}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,s,i){return bP(this,e,n,s,i)}}class Ou extends UJ{constructor(e,n={},s){super(e),this.context=n,this.selectors=s}useSyncedValue(e,n){_.useDebugValue(e);const s=this;Ue(()=>{s.state[e]!==n&&s.set(e,n)},[s,e,n])}useSyncedValueWithCleanup(e,n){const s=this;Ue(()=>(s.state[e]!==n&&s.set(e,n),()=>{s.set(e,void 0)}),[s,e,n])}useSyncedValues(e){const n=this,s=Object.values(e);Ue(()=>{n.update(e)},[n,...s])}useControlledProp(e,n){_.useDebugValue(e);const s=this,i=n!==void 0;Ue(()=>{i&&!Object.is(s.state[e],n)&&s.setState({...s.state,[e]:n})},[s,e,n,i])}select(e,n,s,i){const o=this.selectors[e];return o(this.state,n,s,i)}useState(e,n,s,i){return _.useDebugValue(e),bP(this,this.selectors[e],n,s,i)}useContextCallback(e,n){_.useDebugValue(e);const s=Ye(n??ss);this.context[e]=s}useStateSetter(e){const n=_.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(e,s)}),n.current}observe(e,n){let s;typeof e=="function"?s=e:s=this.selectors[e];let i=s(this.state);return n(i,i,this),this.subscribe(o=>{const r=s(o);if(!Object.is(i,r)){const a=i;i=r,n(r,a,this)}})}}const VJ={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class xP extends Ou{constructor(n){const{syncOnly:s,nested:i,onOpenChange:o,triggerElements:r,...a}=n;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:oP(),nested:i,triggerElements:r},VJ);Ut(this,"syncOpenEvent",(n,s)=>{(!n||!this.state.open||s!=null&&tZ(s))&&(this.context.dataRef.current.openEvent=n?s:void 0)});Ut(this,"dispatchOpenChange",(n,s)=>{this.syncOpenEvent(n,s.event);const i={open:n,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",i)});Ut(this,"setOpen",(n,s)=>{var i,o,r,a;if(this.syncOnly){(o=(i=this.context).onOpenChange)==null||o.call(i,n,s);return}this.dispatchOpenChange(n,s),(a=(r=this.context).onOpenChange)==null||a.call(r,n,s)});this.syncOnly=s}}function vP(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:s,floatingId:i,nested:o,onOpenChange:r}=t,a=e.useState("open"),c=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),f=e.context.triggerElements,p=r,m=_.useRef(null);s===void 0&&m.current===null&&(m.current=new xP({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:d,triggerElements:f,onOpenChange:p,floatingId:i,syncOnly:!0,nested:o}));const g=s??m.current;return e.useSyncedValue("floatingId",i),Ue(()=>{const y={open:a,floatingId:i,referenceElement:c,floatingElement:d};Pt(c)&&(y.domReferenceElement=c),g.state.positionReference===g.state.referenceElement&&(y.positionReference=c),g.update(y)},[a,i,c,d,g]),g.context.onOpenChange=p,g.context.nested=o,g}const Nm={tabIndex:-1,[Cw]:""};function SP(t){return e=>e==="touch"?t.current:!0}function ab(t,e=!1){const n=ff(),s=Tu()!=null,i=Bs(()=>t(n,s)).current;return vP({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:s,onOpenChange:i.setOpen}),i}function Tm({handle:t,store:e}){return Ue(()=>t.attachStore(e),[t,e]),null}function FA(t){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}function wP(t,e){const n=_.useRef(null);return Ye(s=>{const i=n.current;if(i!==null){if(i.element===s&&i.store===e&&i.id===t)return;n.current=null;const o=i.store;o.context.triggerElements.getById(i.id)===i.element&&(o.context.triggerElements.delete(i.id),FA(o))}s!==null&&t!==void 0&&(n.current={store:e,id:t,element:s},e.context.triggerElements.add(t,s),FA(e))})}function cb(t,e,n,s=!1){let i=t.preventUnmountingOnClose;e?i=!1:s&&(i=!0);const o=(n==null?void 0:n.id)??null;let r=t.activeTriggerId,a=t.activeTriggerElement;return(o||e)&&(r=o,a=n??null),{open:e,preventUnmountingOnClose:i,activeTriggerId:r,activeTriggerElement:a}}function u3(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function EP(t,e,n,s={}){var f,p,m;const i=n.reason,o=i===Fn,r=e&&i===$d,a=!e&&(i===hr||i===xm),c=u3(n);if((p=(f=t.context).onOpenChange)==null||p.call(f,e,n),n.isCanceled)return;(m=s.onBeforeDispatch)==null||m.call(s),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const g=cb(t.state,e,n.trigger,c()),y={...s.extraState,...g};r?y.instantType="focus":a?y.instantType="dismiss":o&&(y.instantType=void 0),t.update(y)};o?Vi.flushSync(d):d()}function Om(t,e,n,s){const i=n.useState("isMountedByTrigger",t),o=wP(t,n),r=Ye(c=>{const d=n.select("open"),f=n.select("activeTriggerId");if(f===t){const p={activeTriggerElement:c,...d?s:null};n.update(p);return}if(f==null&&d){const p={activeTriggerId:t??null,activeTriggerElement:c,...s};n.update(p)}}),a=Ye(c=>{o(c),c&&r(c)});return Ue(()=>(a(e.current),()=>a(null)),[a,e,n,t]),Ue(()=>{if(i){const c={activeTriggerElement:e.current,...s};n.update(c)}},[i,n,e,...Object.values(s)]),{registerTrigger:a,isMountedByThisTrigger:i}}function Rm(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,s=_.useRef(null),i=t.useState("open"),o=t.useState("triggerCount"),r=t.useState("activeTriggerId"),a=t.useState("activeTriggerElement");Ue(()=>{if(!i){s.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const c=t.context.triggerElements.size,d={};t.state.triggerCount!==c&&(d.triggerCount=c);const f=t.select("activeTriggerId");let p=null;if(f){const m=t.context.triggerElements.getById(f);if(m)s.current=f,m!==t.state.activeTriggerElement&&(d.activeTriggerElement=m);else{for(const[g,y]of t.context.triggerElements.entries())if(y===t.state.activeTriggerElement){d.activeTriggerId=g,d.activeTriggerElement=y,s.current=g;break}d.activeTriggerId===void 0&&(s.current===f?p=f:s.current=null)}}else s.current=null;if(!p&&!f&&c===1){const m=t.context.triggerElements.entries().next();if(!m.done){const[g,y]=m.value;d.activeTriggerId=g,d.activeTriggerElement=y,s.current=g}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const m=xt(bm);t.setOpen(!1,m),m.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,o,r,a,n])}function km(t,e,n,s){const{mounted:i,setMounted:o,transitionStatus:r}=KC(t,!1,!1,s),a=e.useState("preventUnmountingOnClose"),c=t?!1:a;e.useSyncedValues({mounted:i,transitionStatus:r,preventUnmountingOnClose:c});const d=Ye(()=>{var f,p;o(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(p=(f=e.context).onOpenChangeComplete)==null||p.call(f,!1)});return Xa({enabled:i&&!t&&!c,open:t,ref:e.context.popupRef,onComplete(){t||d()}}),{forceUnmount:d,transitionStatus:r}}function Am(t,e){t.useSyncedValues(e),Ue(()=>()=>{t.update({activeTriggerProps:Ln,inactiveTriggerProps:Ln,popupProps:Ln})},[t])}function CP(t,e){Ue(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Ue(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class Df{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function _m(t,e,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new xP({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:e,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ln,inactiveTriggerProps:Ln,popupProps:Ln}}const hp=t=>t.triggerIdProp??t.activeTriggerId,d3=t=>t.openProp??t.open,HA=t=>{var n;return(((n=t.popupElement)==null?void 0:n.id)??t.floatingId)||void 0};function NP(t,e){return e!==void 0&&d3(t)&&hp(t)===e}function qJ(t,e){return NP(t,e)?!0:e!==void 0&&d3(t)&&hp(t)==null&&t.triggerCount===1}const Mm={open:d3,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:hp,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:HA,isTriggerActive:(t,e)=>e!==void 0&&hp(t)===e,isOpenedByTrigger:(t,e)=>NP(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&hp(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>qJ(t,e)?HA(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function Lm(t){const e=_.useCallback(s=>t===void 0?ss:t.subscribeStore(s),[t]),n=_.useCallback(()=>t===void 0?void 0:t.store,[t]);return c3.useSyncExternalStore(e,n,()=>t==null?void 0:t.serverStore)}function WJ(t){return GJ(t,t.rootContext)}function GJ(t,e){const{nodeId:n,externalTree:s}=t,i=e.useState("referenceElement"),o=e.useState("floatingElement"),r=e.useState("domReferenceElement"),a=e.useState("open"),c=e.useState("floatingId"),[d,f]=_.useState(null),[p,m]=_.useState(void 0),[g,y]=_.useState(void 0),v=_.useRef(null),S=ml(s),w=_.useMemo(()=>({reference:i,floating:o,domReference:r}),[i,o,r]),N=wJ({...t,elements:{...w,...d&&{reference:d}}}),C=Pt(p)?p:null,T=g===void 0?e.state.floatingElement:g;e.useSyncedValue("referenceElement",p??null),e.useSyncedValue("domReferenceElement",p===void 0?r:C),e.useSyncedValue("floatingElement",T);const R=_.useCallback(D=>{const P=Pt(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;f(P),N.refs.setReference(P)},[N.refs]),A=_.useCallback(D=>{(Pt(D)||D===null)&&(v.current=D,m(D)),(Pt(N.refs.reference.current)||N.refs.reference.current===null||D!==null&&!Pt(D))&&N.refs.setReference(D)},[N.refs,m]),k=_.useCallback(D=>{y(D),N.refs.setFloating(D)},[N.refs]),M=_.useMemo(()=>({...N.refs,setReference:A,setFloating:k,setPositionReference:R,domReference:v}),[N.refs,A,k,R]),L=_.useMemo(()=>({...N.elements,domReference:r}),[N.elements,r]),j=_.useMemo(()=>({...N,dataRef:e.context.dataRef,open:a,onOpenChange:e.setOpen,events:e.context.events,floatingId:c,refs:M,elements:L,nodeId:n,rootStore:e}),[N,M,L,n,e,a,c]);return Ue(()=>{r&&(v.current=r)},[r]),Ue(()=>{e.context.dataRef.current.floatingContext=j;const D=S==null?void 0:S.nodesRef.current.find(P=>P.id===n);D&&(D.context=j)}),_.useMemo(()=>({...N,context:j,refs:M,elements:L,rootStore:e}),[N,M,L,j,e])}const Qv=VC&&Ya;function f3(t,e={}){const{enabled:n=!0,delay:s}=e,i="rootStore"in t?t.rootStore:t,{events:o,dataRef:r}=i.context,a=_.useRef(!1),c=_.useRef(null),d=_.useRef(!0),f=li();_.useEffect(()=>{const m=i.select("domReferenceElement");if(!n)return;const g=In(m);function y(){const w=i.select("domReferenceElement");!i.select("open")&&gn(w)&&w===oi(en(w))&&(a.current=!0,c.current=w)}function v(){d.current=!0}function S(){d.current=!1}return ur(Lt(g,"blur",y),Qv&&Lt(g,"keydown",v,!0),Qv&&Lt(g,"pointerdown",S,!0))},[i,n]),_.useEffect(()=>{if(!n)return;function m(g){if(g.reason===hr||g.reason===xm){const y=i.select("domReferenceElement");Pt(y)&&(c.current=y,a.current=!0)}}return o.on("openchange",m),()=>{o.off("openchange",m)}},[o,n,i]);const p=_.useMemo(()=>{function m(){a.current=!1,c.current=null}return{onMouseLeave(){m()},onFocus(g){const y=g.currentTarget;if(a.current){if(c.current===y)return;m()}const v=Ps(g.nativeEvent);if(Pt(v)){if(Qv&&!g.relatedTarget){if(!d.current&&!tb(v))return}else if(!iZ(v))return}const S=V1(g.relatedTarget,i.context.triggerElements),{nativeEvent:w,currentTarget:N}=g,C=typeof s=="function"?s():s;if(i.select("open")&&S||C===0||C===void 0){i.setOpen(!0,xt($d,w,N));return}f.start(C,()=>{a.current||i.setOpen(!0,xt($d,w,N))})},onBlur(g){m();const y=g.relatedTarget,v=g.nativeEvent,S=Pt(y)&&y.hasAttribute(zp("focus-guard"))&&y.getAttribute("data-type")==="outside";f.start(0,()=>{var T;const w=i.select("domReferenceElement"),N=oi(en(w));!y&&N===w||at((T=r.current.floatingContext)==null?void 0:T.refs.floating.current,N)||at(w,N)||S||V1(y??N,i.context.triggerElements)||i.setOpen(!1,xt($d,v))})}}},[r,s,i,f]);return _.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class h3{constructor(){Ut(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Ut(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new fo,this.restTimeout=new fo,this.handleCloseOptions=void 0}static create(){return new h3}}const X1=new WeakMap;function Q1(t){var n,s,i;if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&X1.get(e)===t&&((n=t.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(s=t.pointerEventsReferenceElement)==null||s.style.removeProperty("pointer-events"),(i=t.pointerEventsFloatingElement)==null||i.style.removeProperty("pointer-events"),X1.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function TP(t,e){const{scopeElement:n,referenceElement:s,floatingElement:i}=e,o=X1.get(n);o&&o!==t&&Q1(o),Q1(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=s,t.pointerEventsFloatingElement=i,X1.set(n,t),n.style.pointerEvents="none",s.style.pointerEvents="auto",i.style.pointerEvents="auto"}function p3(t){const e=t.context.dataRef.current,n=Bs(()=>e.hoverInteractionState??h3.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),GC(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function ub(t,e={}){const{enabled:n=!0,closeDelay:s=0,nodeId:i}=e,o="rootStore"in t?t.rootStore:t,r=o.useState("open"),a=o.useState("floatingElement"),c=o.useState("domReferenceElement"),{dataRef:d}=o.context,f=ml(),p=Tu(),m=p3(o),g=li(),y=Ye(()=>{var w;return Fj((w=d.current.openEvent)==null?void 0:w.type,m.interactedInside)}),v=Ye(()=>{var w;return rZ((w=d.current.openEvent)==null?void 0:w.type)}),S=Ye(()=>{Q1(m)});Ue(()=>{r||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S())},[r,m,S]),_.useEffect(()=>S,[S]),Ue(()=>{var w,N,C,T,R;if(n&&r&&(w=m.handleCloseOptions)!=null&&w.blockPointerEvents&&v()&&Pt(c)&&a){const A=c,k=a,M=en(a),L=(C=(N=f==null?void 0:f.nodesRef.current.find(B=>B.id===p))==null?void 0:N.context)==null?void 0:C.elements.floating;L&&(L.style.pointerEvents="");const j=m.pointerEventsScopeElement!==k?m.pointerEventsScopeElement:null,D=L!==k?L:null,P=((R=(T=m.handleCloseOptions)==null?void 0:T.getScope)==null?void 0:R.call(T))??j??D??A.closest("[data-rootownerid]")??M.body;return TP(m,{scopeElement:P,referenceElement:A,floatingElement:k}),()=>{S()}}},[n,r,c,a,m,v,f,p,S]),_.useEffect(()=>{if(!n)return;function w(){return!!(f&&p&&Ga(f.nodesRef.current,p).length>0)}function N(M){const L=Pp(s,"close",m.pointerType),j=()=>{o.setOpen(!1,xt(Fn,M)),f==null||f.events.emit("floating.closed",M)};L?m.openChangeTimeout.start(L,j):(m.openChangeTimeout.clear(),j())}function C(M){const L=Ps(M);if(!sZ(L)){m.interactedInside=!1;return}m.interactedInside=(L==null?void 0:L.closest("[aria-haspopup]"))!=null}function T(){m.openChangeTimeout.clear(),g.clear(),f==null||f.events.off("floating.closed",A),S()}function R(M){var P;if(w()&&f){f.events.on("floating.closed",A);return}if(V1(M.relatedTarget,o.context.triggerElements))return;const L=((P=d.current.floatingContext)==null?void 0:P.nodeId)??i,j=M.relatedTarget;if(!(f&&L&&Pt(j)&&Ga(f.nodesRef.current,L,!1).some(B=>{var I;return at((I=B.context)==null?void 0:I.elements.floating,j)}))){if(m.handler){m.handler(M);return}S(),v()&&!y()&&N(M)}}function A(M){!f||!p||w()||g.start(0,()=>{f.events.off("floating.closed",A),o.setOpen(!1,xt(Fn,M)),f.events.emit("floating.closed",M)})}const k=a;return ur(k&&Lt(k,"mouseenter",T),k&&Lt(k,"mouseleave",R),k&&Lt(k,"pointerdown",C,!0),()=>{f==null||f.events.off("floating.closed",A)})},[n,a,o,d,s,i,v,y,S,m,f,p,g])}const KJ={current:null};function Im(t,e={}){const{enabled:n=!0,delay:s=0,handleClose:i=null,mouseOnly:o=!1,restMs:r=0,move:a=!0,triggerElementRef:c=KJ,externalTree:d,isActiveTrigger:f=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:g,guardStaleOpen:y=!1}=e,v="rootStore"in t?t.rootStore:t,{dataRef:S,events:w}=v.context,N=ml(d),C=p3(v),T=_.useRef(!1),R=Xn(i),A=Xn(s),k=Xn(r),M=Xn(n),L=Xn(g),j=Xn(m),D=Ye(()=>{var z;return Fj((z=S.current.openEvent)==null?void 0:z.type,C.interactedInside)}),P=Ye(()=>{var z;return((z=L.current)==null?void 0:z.call(L))!==!1}),B=Ye((z,U,H)=>{const V=v.context.triggerElements;if(V.hasElement(U))return!z||!at(z,U);if(!Pt(H))return!1;const W=H;return V.hasMatchingElement(G=>at(G,W))&&(!z||!at(z,W))}),I=Ye(()=>{if(!C.handler)return;en(v.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),F=Ye(()=>{Q1(C)});return f&&(C.handleCloseOptions=i==null?void 0:i.__options),_.useEffect(()=>I,[I]),_.useEffect(()=>{if(!n)return;function z(U){U.open?T.current=!1:(T.current=U.reason===Fn,I(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return w.on("openchange",z),()=>{w.off("openchange",z)}},[n,w,C,I]),_.useEffect(()=>{if(!n)return;function z(Y,J=!0){const q=Pp(A.current,"close",C.pointerType);q?C.openChangeTimeout.start(q,()=>{v.setOpen(!1,xt(Fn,Y)),N==null||N.events.emit("floating.closed",Y)}):J&&(C.openChangeTimeout.clear(),v.setOpen(!1,xt(Fn,Y)),N==null||N.events.emit("floating.closed",Y))}const U=c.current??(f?v.select("domReferenceElement"):null);if(!Pt(U))return;function H(Y){var ye;if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,o&&!Aa(C.pointerType))return;const J=vA(k.current),q=Pp(A.current,"open",C.pointerType),X=Ps(Y),Z=Y.currentTarget??null,te=v.select("domReferenceElement");let Q=Z;if(Pt(X)&&!v.context.triggerElements.hasElement(X)){for(const Oe of v.context.triggerElements.elements())if(at(Oe,X)){Q=Oe;break}}Pt(Z)&&Pt(te)&&!v.context.triggerElements.hasElement(Z)&&at(Z,te)&&(Q=te);const se=Q==null?!1:B(te,Q,X),ae=v.select("open"),le=((ye=j.current)==null?void 0:ye.call(j))??v.select("transitionStatus")==="ending",ne=!ae&&le&&T.current,fe=!se&&Pt(Q)&&Pt(te)&&at(te,Q)&&ne,ve=J>0&&!q,we=se&&(ae||ne)||fe,Ce=!ae||se;if(we){P()&&v.setOpen(!0,xt(Fn,Y,Q));return}ve||(q?C.openChangeTimeout.start(q,()=>{Ce&&P()&&v.setOpen(!0,xt(Fn,Y,Q))}):Ce&&P()&&v.setOpen(!0,xt(Fn,Y,Q)))}function V(Y){if(D()){F();return}I();const J=v.select("domReferenceElement"),q=en(J);C.restTimeout.clear(),C.restTimeoutPending=!1;const X=S.current.floatingContext??(p==null?void 0:p());if(V1(Y.relatedTarget,v.context.triggerElements))return;if(R.current&&X){v.select("open")||C.openChangeTimeout.clear();const te=c.current;C.handler=R.current({...X,tree:N,x:Y.clientX,y:Y.clientY,onClose(){F(),I(),M.current&&!D()&&te===v.select("domReferenceElement")&&z(Y,!0)}}),q.addEventListener("mousemove",C.handler),C.handler(Y);return}(C.pointerType==="touch"?!at(v.select("floatingElement"),Y.relatedTarget):!0)&&z(Y)}function W(Y){at(U,Y.relatedTarget)||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.restTimeoutPending=!1)}const G=y?Lt(U,"mouseout",W):void 0;return a?ur(Lt(U,"mousemove",H,{once:!0}),Lt(U,"mouseenter",H),Lt(U,"mouseleave",V),G):ur(Lt(U,"mouseenter",H),Lt(U,"mouseleave",V),G)},[I,F,S,A,v,n,R,C,f,B,D,o,a,k,c,N,M,p,j,P,y]),_.useMemo(()=>{if(!n)return;function z(U){C.pointerType=U.pointerType}return{onPointerDown:z,onPointerEnter:z,onMouseMove(U){var X,Z,te;const{nativeEvent:H}=U,V=U.currentTarget,W=v.select("domReferenceElement"),G=v.select("open"),Y=B(W,V,U.target);if(o&&!Aa(C.pointerType))return;if(G&&Y&&((X=C.handleCloseOptions)!=null&&X.blockPointerEvents)){const Q=v.select("floatingElement");if(Q){const se=((te=(Z=C.handleCloseOptions)==null?void 0:Z.getScope)==null?void 0:te.call(Z))??V.ownerDocument.body;TP(C,{scopeElement:se,referenceElement:V,floatingElement:Q})}}const J=vA(k.current);if(G&&!Y||J===0||!Y&&C.restTimeoutPending&&U.movementX**2+U.movementY**2<2)return;C.restTimeout.clear();function q(){if(C.restTimeoutPending=!1,D())return;const Q=v.select("open");!C.blockMouseMove&&(!Q||Y)&&P()&&v.setOpen(!0,xt(Fn,H,V))}C.pointerType==="touch"?Vi.flushSync(()=>{q()}):Y&&G?q():(C.restTimeoutPending=!0,C.restTimeout.start(J,q))}}},[n,C,D,B,o,v,k,P])}const YJ="Escape";function UA(t){return Ya&&t.movementX===0&&t.movementY===0}function db(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function I0(t,e){return db(e,t===$j||t===QC,t===Jy||t===eb)}function Zv(t,e,n){return db(e,t===QC,n?t===Jy:t===eb)||t==="Enter"||t===" "||t===""}function XJ(t,e,n){return db(e,n?t===Jy:t===eb,t===QC)}function QJ(t,e,n,s){const i=n?t===eb:t===Jy,o=t===$j;return e==="both"||e==="horizontal"&&s?t===YJ:db(e,i,o)}function ZJ(t,e){const{listRef:n,activeIndex:s,onNavigate:i=()=>{},enabled:o=!0,selectedIndex:r=null,allowEscape:a=!1,loopFocus:c=!1,nested:d=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:y=!0,disabledIndices:v=void 0,orientation:S="vertical",parentOrientation:w,id:N,resetOnPointerLeave:C=!0,externalTree:T,grid:R}=e,A=R!=null,k="rootStore"in t?t.rootStore:t,M=k.useState("open"),L=k.useState("floatingElement"),j=k.useState("domReferenceElement"),D=k.context.dataRef,P=Ow(L),B=Tw(j),I=Xn(P),F=Tu(),z=ml(T),U=_.useRef(m),H=_.useRef(r??-1),V=_.useRef(null),W=_.useRef(!0),G=Ye(Ae=>{i(H.current===-1?null:H.current,Ae)}),Y=_.useRef(!!L),J=_.useRef(M),q=_.useRef(!1),X=_.useRef(!1),Z=_.useRef(null),te=Xn(v),Q=Xn(M),se=Xn(r),ae=Xn(C),le=jp(),ne=jp(),fe=Ye(()=>{function Ae(Pe){p?z==null||z.events.emit("virtualfocus",Pe):Z.current=E1(Pe,{sync:q.current,preventScroll:!0})}const Ee=n.current[H.current],Ne=X.current;Ee&&Ae(Ee),(q.current?Pe=>Pe():Pe=>le.request(Pe))(()=>{var et;const Pe=n.current[H.current]||Ee;if(!Pe)return;Ee||Ae(Pe),be&&(Ne||!W.current)&&((et=Pe.scrollIntoView)==null||et.call(Pe,{block:"nearest",inline:"nearest"}))})});Ue(()=>{D.current.orientation=S},[D,S]),Ue(()=>{o&&(M&&L?(H.current=r??-1,U.current&&r!=null&&(X.current=!0,G())):Y.current&&(H.current=-1,G()))},[o,M,L,r,G]),Ue(()=>{if(o){if(!M){q.current=!1;return}if(L)if(s==null){if(q.current=!1,se.current!=null)return;if(Y.current&&(H.current=-1,fe()),(!J.current||!Y.current)&&U.current&&(V.current!=null||U.current===!0&&V.current==null)){let Ae=0;const Ee=()=>{n.current[0]==null?(Ae<2&&(Ae?xe=>ne.request(xe):queueMicrotask)(Ee),Ae+=1):(H.current=V.current==null||Zv(V.current,S,f)||d?w1(n):kw(n),V.current=null,G())};Ee()}}else fp(n.current,s)||(H.current=s,fe(),X.current=!1)}},[o,M,L,s,se,d,n,S,f,G,fe,ne]),Ue(()=>{var Pe,We;if(!o||L||!z||p||!Y.current)return;const Ae=z.nodesRef.current,Ee=(We=(Pe=Ae.find(et=>et.id===F))==null?void 0:Pe.context)==null?void 0:We.elements.floating,Ne=oi(en(j??Ee??null)),xe=Ae.some(et=>et.context&&at(et.context.elements.floating,Ne));Ee&&!xe&&W.current&&Ee.focus({preventScroll:!0})},[o,L,j,z,F,p]),Ue(()=>{J.current=M,Y.current=!!L}),Ue(()=>{M||(V.current=null,U.current=m)},[M,m]);const ve=s!=null,we=Ye(Ae=>{if(!Q.current)return;const Ee=n.current.indexOf(Ae.currentTarget);Ee!==-1&&(H.current!==Ee||s!==Ee)&&(H.current=Ee,G(Ae))}),Ce=Ye(()=>{var Ae,Ee,Ne;return w??((Ne=(Ee=(Ae=z==null?void 0:z.nodesRef.current.find(xe=>xe.id===F))==null?void 0:Ae.context)==null?void 0:Ee.dataRef)==null?void 0:Ne.current.orientation)}),ye=Ye(()=>w1(n,te.current)),Oe=Ye(Ae=>{if(W.current=!1,q.current=!0,Ae.which===229||!Q.current&&Ae.currentTarget===I.current)return;if(d&&QJ(Ae.key,S,f,A)){I0(Ae.key,Ce())||er(Ae),k.setOpen(!1,xt(Ip,Ae.nativeEvent)),gn(j)&&(p?z==null||z.events.emit("virtualfocus",j):j.focus());return}const Ee=H.current,Ne=w1(n,v),xe=kw(n,v);if(B||(Ae.key==="Home"&&(er(Ae),H.current=Ne,G(Ae)),Ae.key==="End"&&(er(Ae),H.current=xe,G(Ae))),R!=null){const Pe=R(Ae,H.current,n,S,c,f,v,Ne,xe);if(Pe!=null&&(H.current=Pe,G(Ae)),S==="both")return}if(I0(Ae.key,S)){if(er(Ae),M&&!p&&oi(Ae.currentTarget.ownerDocument)===Ae.currentTarget){H.current=Zv(Ae.key,S,f)?Ne:xe,G(Ae);return}Zv(Ae.key,S,f)?c?Ee>=xe?a&&Ee!==n.current.length?H.current=-1:(q.current=!1,H.current=Ne):H.current=Kr(n.current,{startingIndex:Ee,disabledIndices:v}):H.current=Math.min(xe,Kr(n.current,{startingIndex:Ee,disabledIndices:v})):c?Ee<=Ne?a&&Ee!==-1?H.current=n.current.length:(q.current=!1,H.current=xe):H.current=Kr(n.current,{startingIndex:Ee,decrement:!0,disabledIndices:v}):H.current=Math.max(Ne,Kr(n.current,{startingIndex:Ee,decrement:!0,disabledIndices:v})),fp(n.current,H.current)&&(H.current=-1),G(Ae)}}),be=_.useMemo(()=>({onFocus(Ee){q.current=!0,we(Ee)},onClick:({currentTarget:Ee})=>Ee.focus({preventScroll:!0}),onMouseMove(Ee){UA(Ee)||(q.current=!0,X.current=!1,g&&we(Ee))},onPointerLeave(Ee){var xe;if(!Q.current||!W.current||Ee.pointerType==="touch")return;q.current=!0;const Ne=Ee.relatedTarget;if(!(!g||n.current.includes(Ne))&&ae.current&&((xe=Z.current)==null||xe.call(Z),Z.current=null,H.current=-1,G(Ee),!p)){const Pe=I.current,We=oi(en(Pe));Pe&&at(Pe,We)&&Pe.focus({preventScroll:!0})}}}),[we,Q,I,g,n,G,ae,p]),_e=_.useMemo(()=>p&&M&&ve&&{"aria-activedescendant":`${N}-${s}`},[p,M,ve,N,s]),Me=_.useMemo(()=>({...B?{}:_e,onKeyDown(Ae){if(Ae.key==="Tab"&&Ae.shiftKey&&M&&!p){const Ee=Ps(Ae.nativeEvent);if(Ee&&!at(I.current,Ee))return;er(Ae),k.setOpen(!1,xt(au,Ae.nativeEvent)),gn(j)&&j.focus();return}Oe(Ae)},onPointerMove(Ae){UA(Ae)||(W.current=!0)}}),[_e,Oe,I,B,k,M,p,j]),Be=_.useMemo(()=>{function Ae(xe){k.setOpen(!0,xt(Ip,xe.nativeEvent,xe.currentTarget))}function Ee(xe){m==="auto"&&YC(xe.nativeEvent)&&(U.current=!p)}function Ne(xe){U.current=m,m==="auto"&&XC(xe.nativeEvent)&&(U.current=!0)}return{onKeyDown(xe){const Pe=k.select("open");W.current=!1;const We=xe.key.startsWith("Arrow"),et=XJ(xe.key,Ce(),f),At=I0(xe.key,S),ze=(d?et:At)||xe.key==="Enter"||xe.key.trim()==="";if(p&&Pe)return Oe(xe);if(!(!Pe&&!y&&We)){if(ze){const Te=I0(xe.key,Ce());V.current=d&&Te?null:xe.key}if(d){et&&(er(xe),Pe?(H.current=ye(),G(xe)):Ae(xe));return}At&&(se.current!=null&&(H.current=se.current),er(xe),!Pe&&y?Ae(xe):Oe(xe),Pe&&G(xe))}},onFocus(xe){k.select("open")&&!p&&(H.current=-1,G(xe))},onPointerDown:Ne,onPointerEnter:Ne,onMouseDown:Ee,onClick:Ee}},[Oe,m,ye,d,G,k,y,S,Ce,f,se,p]),He=_.useMemo(()=>({..._e,...Be}),[_e,Be]);return _.useMemo(()=>o?{reference:He,floating:Me,item:be,trigger:Be}:{},[o,He,Me,Be,be])}function JJ(t,e){const{listRef:n,elementsRef:s,activeIndex:i,onMatch:o,disabledIndices:r,onTyping:a,enabled:c=!0,resetMs:d=750,selectedIndex:f=null}=e,p="rootStore"in t?t.rootStore:t,m=p.useState("open"),g=li(),y=_.useRef(""),v=_.useRef(f??i??-1),S=_.useRef(null),w=Ye(T=>{function R(I){return s==null?void 0:s.current[I]}function A(I){const F=R(I);return F&&!nb(F)||F!=null&&F.matches(":disabled")?!1:r==null||!Fd(Ha,I,r)}function k(I,F,z=0){if(I.length===0)return-1;const U=(z%I.length+I.length)%I.length,H=F.toLowerCase();for(let V=0;V<I.length;V+=1){const W=(U+V)%I.length,G=I[W];if(!(!(G!=null&&G.toLowerCase().startsWith(H))||!A(W)))return W}return-1}const M=n.current;if(y.current.length>0&&T.key===" "&&(er(T),a==null||a(!0)),y.current.length>0&&y.current[0]!==" "&&k(M,y.current)===-1&&T.key!==" "&&(a==null||a(!1)),M==null||T.key.length!==1||T.ctrlKey||T.metaKey||T.altKey)return;m&&T.key!==" "&&(er(T),a==null||a(!0));const L=y.current==="";L&&(v.current=f??i??-1),M.every((I,F)=>{var z,U;return I&&A(F)?((z=I[0])==null?void 0:z.toLowerCase())!==((U=I[1])==null?void 0:U.toLowerCase()):!0})&&y.current===T.key&&(y.current="",v.current=S.current),y.current+=T.key,g.start(d,()=>{y.current="",v.current=S.current,a==null||a(!1)});const P=((L?f??i??-1:v.current)??0)+1,B=k(M,y.current,P);B!==-1?(o==null||o(B),S.current=B):T.key!==" "&&(y.current="",a==null||a(!1))}),N=Ye(T=>{const R=T.relatedTarget,A=p.select("domReferenceElement"),k=p.select("floatingElement");at(A,R)||at(k,R)||(g.clear(),y.current="",v.current=S.current,a==null||a(!1))});Ue(()=>{!m&&f!==null||(g.clear(),S.current=null,y.current!==""&&(y.current=""))},[m,f,g]);const C=_.useMemo(()=>({onKeyDown:w,onBlur:N}),[w,N]);return _.useMemo(()=>c?{reference:C,floating:C}:{},[c,C])}const VA=.1,eee=VA*VA,vn=.5;function D0(t,e,n,s,i,o){return s>=e!=o>=e&&t<=(i-n)*(e-s)/(o-s)+n}function j0(t,e,n,s,i,o,r,a,c,d){let f=!1;return D0(t,e,n,s,i,o)&&(f=!f),D0(t,e,i,o,r,a)&&(f=!f),D0(t,e,r,a,c,d)&&(f=!f),D0(t,e,c,d,n,s)&&(f=!f),f}function tee(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function P0(t,e,n,s,i,o){const r=Math.min(n,i),a=Math.max(n,i),c=Math.min(s,o),d=Math.max(s,o);return t>=r&&t<=a&&e>=c&&e<=d}function Dm(t={}){const{blockPointerEvents:e=!1}=t,n=new fo,s=({x:i,y:o,placement:r,elements:a,onClose:c,nodeId:d,tree:f})=>{const p=r==null?void 0:r.split("-")[0];let m=!1,g=null,y=null,v=typeof performance<"u"?performance.now():0;function S(N,C){const T=performance.now(),R=T-v;if(g===null||y===null||R===0)return g=N,y=C,v=T,!1;const A=N-g,k=C-y,M=A*A+k*k,L=R*R*eee;return g=N,y=C,v=T,M<L}function w(){n.clear(),c()}return function(C){n.clear();const T=a.domReference,R=a.floating;if(!T||!R||p==null||i==null||o==null)return;const{clientX:A,clientY:k}=C,M=Ps(C),L=C.type==="mouseleave",j=at(R,M),D=at(T,M);if(j&&(m=!0,!L))return;if(D&&(m=!1,!L)){m=!0;return}if(L&&Pt(C.relatedTarget)&&at(R,C.relatedTarget))return;function P(){return!!(f&&Ga(f.nodesRef.current,d).length>0)}function B(){P()||w()}if(P())return;const I=T.getBoundingClientRect(),F=R.getBoundingClientRect(),z=i>F.right-F.width/2,U=o>F.bottom-F.height/2,H=F.width>I.width,V=F.height>I.height,W=(H?I:F).left,G=(H?I:F).right,Y=(V?I:F).top,J=(V?I:F).bottom;if(p==="top"&&o>=I.bottom-1||p==="bottom"&&o<=I.top+1||p==="left"&&i>=I.right-1||p==="right"&&i<=I.left+1){B();return}let q=!1;switch(p){case"top":q=P0(A,k,W,I.top+1,G,F.bottom-1);break;case"bottom":q=P0(A,k,W,F.top+1,G,I.bottom-1);break;case"left":q=P0(A,k,F.right-1,J,I.left+1,Y);break;case"right":q=P0(A,k,I.right-1,J,F.left+1,Y);break}if(q)return;if(m&&!tee(A,k,I)){B();return}if(!L&&S(A,k)){B();return}let X=!1;switch(p){case"top":{const Z=H?vn/2:vn*4,te=H||z?i+Z:i-Z,Q=H?i-Z:z?i+Z:i-Z,se=o+vn+1,ae=z||H?F.bottom-vn:F.top,le=z?H?F.bottom-vn:F.top:F.bottom-vn;X=j0(A,k,te,se,Q,se,F.left,ae,F.right,le);break}case"bottom":{const Z=H?vn/2:vn*4,te=H||z?i+Z:i-Z,Q=H?i-Z:z?i+Z:i-Z,se=o-vn,ae=z||H?F.top+vn:F.bottom,le=z?H?F.top+vn:F.bottom:F.top+vn;X=j0(A,k,te,se,Q,se,F.left,ae,F.right,le);break}case"left":{const Z=V?vn/2:vn*4,te=V||U?o+Z:o-Z,Q=V?o-Z:U?o+Z:o-Z,se=i+vn+1,ae=U||V?F.right-vn:F.left,le=U?V?F.right-vn:F.left:F.right-vn;X=j0(A,k,ae,F.top,le,F.bottom,se,te,se,Q);break}case"right":{const Z=V?vn/2:vn*4,te=V||U?o+Z:o-Z,Q=V?o-Z:U?o+Z:o-Z,se=i-vn,ae=U||V?F.left+vn:F.right,le=U?V?F.left+vn:F.right:F.left+vn;X=j0(A,k,se,te,se,Q,ae,F.top,le,F.bottom);break}}X?m||n.start(40,B):B()}};return s.__options={...t,blockPointerEvents:e},s}const nee=_.createContext(void 0);function OP(t){return _.useContext(nee)}const Iw="ArrowUp",Dw="ArrowDown",jw="ArrowLeft",Pw="ArrowRight",zw="Home",Bw="End",fb=new Set([Iw,Dw,jw,Pw,zw,Bw]),see="Shift",iee=[see,"Control","Alt","Meta"];function oee(t){return gn(t)&&t.tagName==="INPUT"}function qA(t){return!!(oee(t)&&t.selectionStart!=null||gn(t)&&t.tagName==="TEXTAREA")}function WA(t,e,n,s){if(!t||!e||!e.scrollTo)return;let i=t.scrollLeft,o=t.scrollTop;const r=t.clientWidth<t.scrollWidth,a=t.clientHeight<t.scrollHeight;if(r&&s!=="vertical"){const c=GA(t,e,"left"),d=z0(t),f=z0(e);n==="ltr"&&(c+e.offsetWidth+f.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?i=c+e.offsetWidth+f.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:c-f.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(i=c-f.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(c-f.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?i=c-f.scrollMarginLeft-d.scrollPaddingLeft:c+e.offsetWidth+f.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(i=c+e.offsetWidth+f.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(a&&s!=="horizontal"){const c=GA(t,e,"top"),d=z0(t),f=z0(e);c-f.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?o=c-f.scrollMarginTop-d.scrollPaddingTop:c+e.offsetHeight+f.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(o=c+e.offsetHeight+f.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:i,top:o,behavior:"auto"})}function GA(t,e,n){const s=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[s],e.offsetParent!==t);)e=e.offsetParent;return i}function z0(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}function jm(t){return t==="starting"?LZ:Ln}const m3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,finalFocus:r,...a}=e,{store:c}=pl(),{side:d,align:f}=Yy(),p=OP()!=null,m=c.useState("open"),g=c.useState("transitionStatus"),y=c.useState("popupProps"),v=c.useState("mounted"),S=c.useState("instantType"),w=c.useState("activeTriggerElement"),N=c.useState("parent"),C=c.useState("lastOpenChangeReason"),T=c.useState("rootId"),R=c.useState("floatingRootContext"),A=c.useState("floatingTreeRoot"),k=c.useState("closeDelay"),M=c.useState("hoverEnabled"),L=c.useState("disabled"),j=c.useState("openMethod"),D=N.type==="context-menu";Xa({open:m,ref:c.context.popupRef,onComplete(){var z,U;m&&((U=(z=c.context).onOpenChangeComplete)==null||U.call(z,!0))}}),_.useEffect(()=>{function z(U){c.setOpen(!1,xt(U.reason,U.domEvent))}return A.events.on("close",z),()=>{A.events.off("close",z)}},[A.events,c]),ub(R,{enabled:M&&!L&&!D&&N.type!=="menubar",closeDelay:k});const P=c.useStateSetter("popupElement"),B={transitionStatus:g,side:d,align:f,open:m,nested:N.type==="menu",instant:S},I=Qt("div",e,{state:B,ref:[n,c.context.popupRef,P],stateAttributesMapping:ym,props:[y,{onKeyDown(z){p&&fb.has(z.key)&&z.stopPropagation()}},jm(g),a,{"data-rootownerid":T}]});let F=N.type===void 0||D;return(w||N.type==="menubar"&&C!==FC)&&(F=!0),b.jsx(l3,{context:R,openInteractionType:j,modal:D,disabled:!v,returnFocus:r===void 0?F:r,initialFocus:N.type!=="menu",restoreFocus:!0,externalTree:N.type!=="menubar"?A:void 0,previousFocusableElement:w,nextFocusableElement:N.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:N.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:I})}),RP=_.createContext(void 0);function ree(){const t=_.useContext(RP);if(t===void 0)throw new Error(yn(32));return t}const g3=_.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e,{store:o,parent:r}=pl();if(!(o.useState("mounted")||s))return null;const d=r.type==="menu"||r.type==="menubar"?"group":void 0;return b.jsx(RP.Provider,{value:s,children:b.jsx(i3,{ref:n,...i,portalOwnerRole:d})})});function y3(t){return _C(19)?t:t?"true":void 0}const lee=_.createContext(void 0);function b3(){const t=_.useContext(lee);return(t==null?void 0:t.direction)??"ltr"}const aee=t=>({name:"arrow",options:t,async fn(e){var V,W;const{x:n,y:s,placement:i,rects:o,platform:r,elements:a,middlewareData:c}=e,{element:d,padding:f=0,offsetParent:p="real"}=Wa(t,e)||{};if(d==null)return{};const m=Uj(f),g={x:n,y:s},y=e3(i),v=JC(y),S=await r.getDimensions(d),w=y==="y",N=w?"top":"left",C=w?"bottom":"right",T=w?"clientHeight":"clientWidth",R=o.reference[v]+o.reference[y]-g[y]-o.floating[v],A=g[y]-o.reference[y],k=p==="real"?await((V=r.getOffsetParent)==null?void 0:V.call(r,d)):a.floating;let M=a.floating[T]||o.floating[v];(!M||!await((W=r.isElement)==null?void 0:W.call(r,k)))&&(M=a.floating[T]||o.floating[v]);const L=R/2-A/2,j=M/2-S[v]/2-1,D=Math.min(m[N],j),P=Math.min(m[C],j),B=D,I=M-S[v]-P,F=M/2-S[v]/2+L,z=Hj(B,F,I),U=!c.arrow&&dl(i)!=null&&F!==z&&o.reference[v]/2-(F<B?D:P)-S[v]/2<0,H=U?F<B?F-B:F-I:0;return{[y]:g[y]+H,data:{[y]:z,centerOffset:F-z-H,...U&&{alignmentOffset:H}},reset:U}}}),cee=(t,e)=>{const{name:n,fn:s}=aee(t);return{name:n,fn:s,options:[t,e]}},uee={name:"hide",async fn(t){const{width:e,height:n,x:s,y:i}=t.rects.reference,o=e===0&&n===0&&s===0&&i===0,r=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-e>=0||r.bottom-n>=0||r.left-e>=0||o}}}},dee={sideX:"left",sideY:"top"},fee="--available-width",hee="--available-height",pee="--anchor-width",mee="--anchor-height",gee="--transform-origin",KA=fee,YA=hee;function kP(t,e,n){const s=t==="inline-start"||t==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[e]}function XA(t,e,n){const{rects:s,placement:i}=t;return{side:kP(e,lo(i),n),align:dl(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function hb(t){return yee(t,WJ)}function yee(t,e){var Cn,nn;const{anchor:n,positionMethod:s="absolute",side:i="bottom",sideOffset:o=0,align:r="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:d=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:g,keepMounted:y=!1,floatingRootContext:v,mounted:S,collisionAvoidance:w,shift:N,nodeId:C,adaptiveOrigin:T,lazyFlip:R=!1,externalTree:A}=t,[k,M]=_.useState(null);!S&&k!==null&&M(null);const L=w.side||"flip",j=w.align||"flip",D=w.fallbackAxisSide||"end",P=(N==null?void 0:N.crossAxis)??!1,B=N==null?void 0:N.rootBoundary,I=typeof n=="function"?n:void 0,F=Ye(I),z=I?F:n,U=Xn(n),H=Xn(S),W=b3()==="rtl",G=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":W?"left":"right","inline-start":W?"right":"left"}[i],Y=r==="center"?G:`${G}-${r}`;let J=d;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const q=1,X=i==="bottom"?q:0,Z=i==="top"?q:0,te=i==="right"?q:0,Q=i==="left"?q:0,se={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:J},ae=_.useRef(null),le=Xn(o),ne=Xn(a),fe=typeof o!="function"?o:0,ve=typeof a!="function"?a:0,we=[];g&&we.push(g),we.push(EJ(st=>{const St=XA(st,i,W),dn=typeof le.current=="function"?le.current(St):le.current,rt=typeof ne.current=="function"?ne.current(St):ne.current;return{mainAxis:dn,crossAxis:rt,alignmentAxis:rt}},[fe,ve,W,i]));const Ce=j==="none"&&L!=="shift",ye=!Ce&&(f||P||L==="shift"),Oe=L==="none"?null:TJ({...se,padding:{top:J.top+q+X,right:J.right+q+Q,bottom:J.bottom+q+Z,left:J.left+q+te},mainAxis:!P&&L==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),be=Ce?null:CJ({...se,rootBoundary:B,mainAxis:j!=="none",crossAxis:ye,limiter:f||P?void 0:NJ(st=>{if(!ae.current)return{};const{width:St,height:dn}=ae.current.getBoundingClientRect(),rt=ro(lo(st.placement)),Wt=rt==="y"?St:dn,_t=rt==="y"?J.left+J.right:J.top+J.bottom;return{offset:Wt/2+_t/2}})},[se,f,P,B,J,j]);L==="shift"||j==="shift"||r==="center"?we.push(be,Oe):we.push(Oe,be),we.push(OJ({...se,apply({elements:{floating:st},availableWidth:St,availableHeight:dn,rects:rt}){if(!H.current)return;const Wt=st.style;Wt.setProperty(KA,`${St}px`),Wt.setProperty(YA,`${dn}px`);const _t=In(st).devicePixelRatio||1,{x:It,y:Zt,width:Nn,height:bn}=rt.reference,ln=(Math.round((It+Nn)*_t)-Math.round(It*_t))/_t,$e=(Math.round((Zt+bn)*_t)-Math.round(Zt*_t))/_t;Wt.setProperty(pee,`${ln}px`),Wt.setProperty(mee,`${$e}px`)}}),cee(st=>({element:ae.current||en(st.elements.floating).createElement("div"),padding:ae.current?p:0,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(st){var Ie,Xe,mt,jn,po,Es;const{elements:{floating:St},middlewareData:dn,placement:rt,platform:Wt,rects:_t,y:It}=st,Zt=lo(rt),Nn=dl(rt),bn=ro(Zt)==="y",ln=ae.current,$e=typeof o=="function"?o(XA(st,i,W)):o;let Tt;if(!ln&&Nn&&Math.abs(bn?((Ie=dn.shift)==null?void 0:Ie.x)||0:((Xe=dn.shift)==null?void 0:Xe.y)||0)<=1)Tt=Nn==="start"===(bn&&((mt=Wt.isRTL)==null?void 0:mt.call(Wt,St))===!0)?"100%":"0%";else{const zo=bn?((jn=dn.arrow)==null?void 0:jn.x)||0:((po=dn.arrow)==null?void 0:po.y)||0,Ni=bn?(ln==null?void 0:ln.clientWidth)||0:(ln==null?void 0:ln.clientHeight)||0;Tt=`${zo+Ni/2}px`}let Gt=Zt==="top"||Zt==="left"?`calc(100% + ${$e}px)`:`${-$e}px`;return ye&&bn&&Math.abs(((Es=dn.shift)==null?void 0:Es.y)||0)>$e&&(Gt=`${_t.reference.y+_t.reference.height/2-It}px`),St.style.setProperty(gee,bn?`${Tt} ${Gt}`:`${Gt} ${Tt}`),{}}},uee,T),Ue(()=>{!S&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[S,v]);const _e=_.useMemo(()=>({ancestorScroll:!m,elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Me,elements:Be,x:He,y:Ae,middlewareData:Ee,update:Ne,placement:xe,context:Pe,isPositioned:We,floatingStyles:et}=e({rootContext:v,open:y?S:void 0,placement:Y,middleware:we,strategy:s,whileElementsMounted:y?void 0:(...st)=>zA(...st,_e),nodeId:C,externalTree:A}),{sideX:At,sideY:ze}=Ee.adaptiveOrigin||dee,Te=We?s:"fixed",qe=_.useMemo(()=>{let st;return We?T?st={position:Te,[At]:He,[ze]:Ae}:st={...et,position:Te}:st={position:Te,top:0,left:0},st[KA]="100vw",st[YA]="100vh",We||(st.opacity=0),st},[T,Te,At,He,ze,Ae,et,We]),ot=_.useRef(null);Ue(()=>{if(!S)return;const st=U.current,St=typeof st=="function"?st():st,rt=(QA(St)?St.current:St)||null||null;rt!==ot.current&&(Me.setPositionReference(rt),ot.current=rt)},[S,Me,z,U]),_.useEffect(()=>{if(!S)return;const st=U.current;typeof st!="function"&&QA(st)&&st.current!==ot.current&&(Me.setPositionReference(st.current),ot.current=st.current)},[S,Me,z,U]),_.useEffect(()=>{if(y&&S&&Be.reference&&Be.floating)return zA(Be.reference,Be.floating,Ne,_e)},[y,S,Be,Ne,_e]);const bt=lo(xe),Ct=kP(i,bt,W),En=dl(xe)||"center",Mt=!!((Cn=Ee.hide)!=null&&Cn.referenceHidden);Ue(()=>{R&&S&&We&&bt!==G&&M(bt)},[R,S,We,bt,G]);const jt=_.useMemo(()=>{var st,St;return{position:"absolute",top:(st=Ee.arrow)==null?void 0:st.y,left:(St=Ee.arrow)==null?void 0:St.x}},[Ee.arrow]),rn=((nn=Ee.arrow)==null?void 0:nn.centerOffset)!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:jt,arrowRef:ae,arrowUncentered:rn,side:Ct,align:En,physicalSide:bt,anchorHidden:Mt,refs:Me,context:Pe,isPositioned:We,update:Ne}),[qe,jt,ae,rn,Ct,En,bt,Mt,Me,Pe,We,Ne])}function QA(t){return t!=null&&"current"in t}function AP(t){const{children:e,elementsRef:n,labelsRef:s,onMapChange:i}=t,o=Ye(i),[,r]=_.useState(!1),a=Bs(xee).current,c=Bs(bee).current,d=_.useRef(0),f=_.useRef(!0),p=_.useRef(null),m=_.useRef(null),g=Ye(()=>{f.current||(f.current=!0,r(R=>!R))}),y=Ye((R,A)=>{c.set(R,A),g()}),v=Ye(R=>{c.delete(R),g()}),S=Ye(R=>{const A=new Map;return n.current.length=0,s&&(s.current.length=0),R.forEach(k=>{var M,L;A.set(k.element,{...k.registration.metadata??{},index:k.index}),n.current[k.index]=k.element,s&&(s.current[k.index]=k.registration.label!==void 0?k.registration.label:((L=(M=k.registration.textRef)==null?void 0:M.current)==null?void 0:L.textContent)??k.element.textContent)}),d.current=n.current.length,A});function w(R){var M;if((M=m.current)==null||M.disconnect(),m.current=null,typeof MutationObserver!="function"||R.length<2)return;const A=new MutationObserver(L=>{if(!wee(L))return;let j=null;for(const D of R)if(D.isConnected){if(j&&_P(j,D)>0){A.disconnect(),g();return}j=D}});m.current=A;const k=new Set;for(let L=1;L<R.length;L+=1){const j=See(R[L-1],R[L]);j&&k.add(j)}k.forEach(L=>A.observe(L,{childList:!0}))}const N=Ye(()=>{const[R,A]=vee(c),k=S(R),M=p.current,L=!M||M.length!==R.length||R.some((j,D)=>{const P=M[D];return j.index!==P.index||j.element!==P.element||j.registration.index!==P.registration.index||j.registration.metadata!==P.registration.metadata});w(A),p.current=R,f.current=!1,L&&(a.forEach(j=>j(k)),o(k))});Ue(()=>(!f.current&&p.current&&S(p.current),()=>{n.current=[],s&&(s.current=[])}),[n,s,S]),Ue(()=>{f.current&&N()}),Ue(()=>()=>{var R;(R=m.current)==null||R.disconnect(),f.current=!0},[]);const C=Ye(R=>(a.add(R),()=>{a.delete(R)})),T=_.useMemo(()=>({register:y,unregister:v,subscribeMapChange:C,nextIndexRef:d}),[y,v,C,d]);return b.jsx(Lj.Provider,{value:T,children:e})}function bee(){return new Map}function xee(){return new Set}function vee(t){const e=new Set,n=[],s=[];t.forEach((o,r)=>{if(!r.isConnected)return;const a=o.index,c={index:a??-1,element:r,registration:o};a===null?s.push(c):a>=0&&(e.add(a),n.push(c))});let i=0;return s.sort((o,r)=>_P(o.element,r.element)),s.forEach(o=>{for(;e.has(i);)i+=1;o.index=i,n.push(o),i+=1}),e.size>0&&n.sort((o,r)=>o.index-r.index),[n,s.map(o=>o.element)]}function See(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function wee(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function _P(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const x3=_.forwardRef(function(e,n){const{cutout:s,...i}=e;let o;if(s){const r=s.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${r.left}px ${r.top}px,${r.left}px ${r.bottom}px,${r.right}px ${r.bottom}px,${r.right}px ${r.top}px,${r.left}px ${r.top}px)`}return b.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function pb(t,e,{styles:n,transitionStatus:s,props:i,refs:o,hidden:r,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),Qt("div",t,{state:e,ref:o,props:[{role:"presentation",hidden:r,style:c},jm(s),i],stateAttributesMapping:Lf})}let ZA={},JA={},e_="";function mb(t,e){return pm(t)?t:e}function t_(t,e,n){return/hidden|clip/.test(t.getComputedStyle(mb(e,n)).overflowY)}function Eee(t){if(typeof document>"u")return!1;const e=en(t);return In(e).innerWidth-e.documentElement.clientWidth>0}function Cee(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=en(t),s=n.documentElement,i=n.body,o=mb(s,i),r=o.style.overflowY,a=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",o.style.overflowY="scroll";const c=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=r,s.style.scrollbarGutter=a,c===d}function Nee(t){const e=en(t),n=e.documentElement,s=e.body,i=mb(n,s),o={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,o)}}function Tee(t){var g;const e=en(t),n=e.documentElement,s=e.body,i=In(n);let o=0,r=0,a=!1;const c=vi.create();if(Ya&&(((g=i.visualViewport)==null?void 0:g.scale)??1)!==1)return()=>{};function d(){const y=i.getComputedStyle(n),v=i.getComputedStyle(s),N=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,r=n.scrollLeft,ZA={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},e_=n.style.scrollBehavior,JA={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,R=y.overflowY==="scroll"||v.overflowY==="scroll",A=y.overflowX==="scroll"||v.overflowX==="scroll",k=Math.max(0,i.innerWidth-s.clientWidth),M=Math.max(0,i.innerHeight-s.clientHeight),L=parseFloat(v.marginTop)+parseFloat(v.marginBottom),j=parseFloat(v.marginLeft)+parseFloat(v.marginRight),D=mb(n,s);if(a=Cee(t),a){n.style.scrollbarGutter=N,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:N,overflowY:"hidden",overflowX:"hidden"}),(C||R)&&(n.style.overflowY="scroll"),(T||A)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:L||M?`calc(100dvh - ${L+M}px)`:"100dvh",width:j||k?`calc(100vw - ${j+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),s.scrollTop=o,s.scrollLeft=r,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,ZA),Object.assign(s.style,JA),a||(n.scrollTop=o,n.scrollLeft=r,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=e_)}function p(){f(),c.request(d)}d();const m=Lt(i,"resize",p);return()=>{c.cancel(),f(),typeof i.removeEventListener=="function"&&m()}}class Oee{constructor(){Ut(this,"lockCount",0);Ut(this,"restore",null);Ut(this,"timeoutLock",fo.create());Ut(this,"timeoutUnlock",fo.create());Ut(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ut(this,"unlock",()=>{var e;this.lockCount===0&&this.restore&&((e=this.restore)==null||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;const n=en(e),s=n.documentElement,i=n.body,o=In(s);if(t_(o,s,i)){const a=new o.MutationObserver(()=>{t_(o,s,i)||(a.disconnect(),this.restore=null,this.lock(e))}),c={attributes:!0};a.observe(s,c),a.observe(i,c),this.restore=()=>a.disconnect();return}const r=Qy||!Eee(e);this.restore=r?Nee(e):Tee(e)}}const Ree=new Oee;function MP(t=!0,e=null){Ue(()=>{if(t)return Ree.acquire(e)},[t,e])}const kee=20;function LP(t,e,n,s){const[i,o]=_.useState(!1);Ue(()=>{if(!t||!e||n==null){o(!1);return}const r=en(n).documentElement.clientWidth,a=n.offsetWidth;o(r>0&&a>0&&a>=r-kee)},[t,e,n]),MP(t&&(!e||i),s)}const v3=_.forwardRef(function(e,n){var _e;const{anchor:s,positionMethod:i="absolute",className:o,render:r,side:a,align:c,sideOffset:d=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:S=IZ,style:w,...N}=e,{store:C}=pl(),T=ree(),R=$C(!0),A=C.useState("parent"),k=C.useState("floatingRootContext"),M=C.useState("floatingTreeRoot"),L=C.useState("mounted"),j=C.useState("open"),D=C.useState("modal"),P=C.useState("openMethod"),B=C.useState("activeTriggerElement"),I=C.useState("transitionStatus"),F=C.useState("positionerElement"),z=C.useState("instantType"),U=C.useState("adaptiveOrigin"),H=C.useState("lastOpenChangeReason"),V=C.useState("floatingNodeId"),W=C.useState("floatingParentNodeId"),G=k.useState("domReferenceElement"),Y=_.useRef(null),J=vm(F);let q=s,X=d,Z=f,te=c,Q=S;A.type==="context-menu"&&(q=s??((_e=A.context)==null?void 0:_e.anchor),te=te??"start",!a&&te!=="center"&&(Z=e.alignOffset??2,X=e.sideOffset??-5));let se=a,ae=te;A.type==="menu"?(se=se??"inline-end",ae=ae??"start",Q=e.collisionAvoidance??sb):A.type==="menubar"&&(se=se??(A.context.orientation==="vertical"?"inline-end":"bottom"),ae=ae??"start");const le=A.type==="context-menu",ne=hb({anchor:q,floatingRootContext:k,positionMethod:R?"fixed":i,mounted:L,side:se,sideOffset:X,align:ae,alignOffset:Z,arrowPadding:le?0:g,collisionBoundary:p,collisionPadding:m,sticky:y,nodeId:V,keepMounted:T,disableAnchorTracking:v,collisionAvoidance:Q,shift:le?{crossAxis:!("side"in Q&&Q.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:M,adaptiveOrigin:U});_.useEffect(()=>{function Me(Be){Be.open&&(Be.parentNodeId===V&&C.set("hoverEnabled",!1),Be.nodeId!==V&&Be.parentNodeId===C.select("floatingParentNodeId")&&C.setOpen(!1,xt(_d)))}return M.events.on("menuopenchange",Me),()=>{M.events.off("menuopenchange",Me)}},[C,M.events,V]),_.useEffect(()=>{if(C.select("floatingParentNodeId")==null)return;function Me(Be){if(Be.open||Be.nodeId!==C.select("floatingParentNodeId"))return;const He=Be.reason??_d;C.setOpen(!1,xt(He))}return M.events.on("menuopenchange",Me),()=>{M.events.off("menuopenchange",Me)}},[M.events,C]);const fe=li();_.useEffect(()=>{j||fe.clear()},[j,fe]),_.useEffect(()=>{function Me(Be){if(!(!j||Be.nodeId!==C.select("floatingParentNodeId")))if(Be.target&&B&&B!==Be.target){const He=C.select("closeDelay");He>0?fe.isStarted()||fe.start(He,()=>{C.setOpen(!1,xt(_d))}):C.setOpen(!1,xt(_d))}else fe.clear()}return M.events.on("itemhover",Me),()=>{M.events.off("itemhover",Me)}},[M.events,j,B,C,fe]),_.useEffect(()=>{const Me={open:j,nodeId:V,parentNodeId:W,reason:C.select("lastOpenChangeReason")};M.events.emit("menuopenchange",Me)},[M.events,j,C,V,W]),Ue(()=>{const Me=G,Be=Y.current;if(Me&&(Y.current=Me),Be&&Me&&Me!==Be){C.set("instantType",void 0);const He=new AbortController;return J(()=>{C.set("instantType","trigger-change")},He.signal),()=>{He.abort()}}},[G,J,C]);const ve={open:j,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:A.type==="menu",instant:z},we=A.type==="menubar"&&A.context.modal;LP(j&&(we||D&&H!==Fn),P==="touch",F,B);const ye=pb(e,ve,{styles:ne.positionerStyles,transitionStatus:I,props:N,refs:[n,C.useStateSetter("positionerElement")],hidden:!L,inert:!j}),Oe=L&&A.type!=="menu"&&(A.type!=="menubar"&&D&&H!==Fn||A.type==="menubar"&&A.context.modal);let be=null;return A.type==="menubar"?be=A.context.contentElement:A.type===void 0&&(be=B),b.jsxs(Tj.Provider,{value:ne,children:[Oe&&b.jsx(x3,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:y3(!j),cutout:be}),b.jsx(ib,{id:V,children:b.jsx(AP,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,children:ye})})]})}),IP=_.createContext(null);function S3(t){const e=_.useContext(IP);if(e===null&&!t)throw new Error(yn(5));return e}function Aee(t){const e=_.useRef(""),n=_.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:_.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:n}}function DP(t,e){const n=_.useRef(t),s=Ye(e);Ue(()=>{n.current!==t&&s(n.current),n.current=t},[t,s])}function w3(t,e){const n=Ye((o,r)=>{(typeof t=="function"?t():t)||e(r||(Qy?"touch":""))}),{onClick:s,onPointerDown:i}=Aee(n);return _.useMemo(()=>({onClick:s,onPointerDown:i}),[s,i])}function _ee(t){const[e,n]=_.useState(null),s=w3(t,n);return DP(t,i=>{i&&!t&&n(null)}),_.useMemo(()=>({openMethod:e,triggerProps:s}),[e,s])}class Mee extends Ou{setState(e){}update(e){}set(e,n){}notifyAll(){}}const Lee={...Mm,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,e)=>t.activeIndex===e,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class Iee extends Ou{constructor(n,s,i=!1){const o=new Df,r=jee(o,s,i,n);super(r,Dee(o),Lee);Ut(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",a=>{var c;if((c=this.unsubscribeParentListener)==null||c.call(this),a.type==="menu"){let d=a.store.select("rootId"),f=a.store.select("floatingTreeRoot"),p=a.store.select("keyboardEventRelay");this.unsubscribeParentListener=a.store.subscribe(()=>{const m=a.store.select("rootId"),g=a.store.select("floatingTreeRoot"),y=a.store.select("keyboardEventRelay");d===m&&f===g&&p===y||(d=m,f=g,p=y,this.notifyAll())}),this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;return}a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,s){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:s})}}function Dee(t){return{positionerRef:_.createRef(),popupRef:_.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function jee(t,e,n=!1,s){return{..._m(t,e,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new o3,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ln,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...s}}const jP=_.createContext(void 0);function PP(){return _.useContext(jP)}const E3=If(function(e){const{children:n,open:s,onOpenChange:i,onOpenChangeComplete:o,defaultOpen:r=!1,disabled:a=!1,modal:c,loopFocus:d=!0,orientation:f="vertical",actionsRef:p,closeParentOnEsc:m=!1,handle:g,triggerId:y,defaultTriggerId:v=null,highlightItemOnHover:S=!0}=e,w=$C(!0),N=pl(!0),C=S3(!0),T=PP(),R=_.useMemo(()=>T&&N?{type:"menu",store:N.store}:C?{type:"menubar",context:C}:w&&!N?{type:"context-menu",context:w}:{type:void 0},[w,N,C,T]),A=ff(),k=ff(),M=Tu(),L=R.type==="menu"?R.store:void 0,j=(s??r)&&(L==null?void 0:L.state.transitionStatus)==="starting",D=Bs(()=>j?L==null?void 0:L.state.instantType:void 0).current,P=Pee({open:r,openProp:s,activeTriggerId:v,triggerIdProp:y,parent:R,disabled:a,highlightItemOnHover:S,modal:R.type===void 0?c:void 0,rootId:A,instantType:D},k,M!=null);P.useControlledProp("openProp",s),P.useControlledProp("triggerIdProp",y),P.useContextCallback("onOpenChangeComplete",o);const B=P.useState("floatingTreeRoot"),I=wm(B),F=P.useState("open"),z=P.useState("activeTriggerElement"),U=P.useState("positionerElement"),H=P.useState("hoverEnabled"),V=P.useState("disabled"),W=P.useState("lastOpenChangeReason"),G=P.useState("parent"),Y=P.useState("activeIndex"),J=P.useState("payload"),q=P.useState("floatingParentNodeId"),X=_.useRef(null),Z=_.useRef(G.type!=="context-menu"),te=li(),Q=_.useRef(!0),se=li(),ae=q!=null,{openMethod:le,triggerProps:ne}=_ee(F);P.useSyncedValues({disabled:a,highlightItemOnHover:S,modal:G.type===void 0?c:void 0,openMethod:le,rootId:A}),Rm(P);const{forceUnmount:fe,transitionStatus:ve}=km(F,P,()=>{P.set("allowMouseEnter",!1)},j),we=vm(P.context.popupRef);_.useEffect(()=>{if(D===void 0)return;const Te=()=>{P.state.instantType===D&&P.set("instantType",void 0)};if(!F){Te();return}if(ve!==void 0)return;if(P.context.popupRef.current==null){Te();return}const qe=new AbortController;return we(Te,qe.signal),()=>{qe.abort()}},[D,F,ve,we,P]),Ue(()=>{w&&!N?P.update({parent:{type:"context-menu",context:w},floatingNodeId:I,floatingParentNodeId:M}):N&&P.update({floatingNodeId:I,floatingParentNodeId:M})},[w,N,I,M,P]),_.useEffect(()=>{if(F||(X.current=null),G.type==="context-menu"){if(!F){te.clear(),Z.current=!1;return}te.start(500,()=>{Z.current=!0})}},[te,F,G.type]),Ue(()=>{!F&&!H&&P.set("hoverEnabled",!0)},[F,H,P]);const Ce=Ye((Te,qe)=>{const ot=qe.reason;if(!Te&&!P.select("open")||F===Te&&qe.trigger===z&&W===ot)return;const bt=u3(qe);if(!Te&&qe.trigger==null&&(qe.trigger=z??void 0),i==null||i(Te,qe),qe.isCanceled)return;P.state.floatingRootContext.dispatchOpenChange(Te,qe);const Ct=qe.event;if(Te===!1&&(Ct==null?void 0:Ct.type)==="click"&&Ct.pointerType==="touch"&&!Q.current)return;Te&&ot===$d?(Q.current=!1,se.start(300,()=>{Q.current=!0})):(Q.current=!0,se.clear());const En=(ot===hr||ot===HC)&&Ct.detail===0,Mt=!Te&&(ot===xm||ot==null);X.current=qe.event;const jt=cb(P.state,Te,qe.trigger,bt());jt.openChangeReason=ot,G.type==="menubar"&&(ot===$d||ot===au||ot===Fn||ot===Ip||ot===_d)?jt.instantType="group":En||Mt?jt.instantType=En?"click":"dismiss":jt.instantType=void 0,P.update(jt)}),ye=vP({popupStore:P,floatingRootContext:P.state.floatingRootContext,floatingId:k,nested:M!=null,onOpenChange:Ce}),Oe=ye.context.events;Ue(()=>{const Te=({open:qe,eventDetails:ot})=>Ce(qe,ot);return Oe.on("setOpen",Te),()=>{Oe==null||Oe.off("setOpen",Te)}},[Oe,Ce]);const be=_.useCallback(()=>{P.setOpen(!1,xt(cu))},[P]);_.useImperativeHandle(p,()=>({unmount:fe,close:be}),[fe,be]);let _e;G.type==="context-menu"&&(_e=G.context),_.useImperativeHandle(_e==null?void 0:_e.positionerRef,()=>U,[U]),_.useImperativeHandle(_e==null?void 0:_e.actionsRef,()=>({setOpen:Ce}),[Ce]);const Me=Em(ye,{enabled:!V,bubbles:{escapeKey:m&&G.type==="menu"},outsidePress(){var Te;return G.type!=="context-menu"||((Te=X.current)==null?void 0:Te.type)==="contextmenu"?!0:Z.current},externalTree:ae?B:void 0}),Be=b3(),He=_.useCallback(Te=>{P.select("activeIndex")!==Te&&P.set("activeIndex",Te)},[P]),Ae=ZJ(ye,{enabled:!V,listRef:P.context.itemDomElements,activeIndex:Y,nested:G.type!==void 0,loopFocus:d,orientation:f,parentOrientation:G.type==="menubar"?G.context.orientation:void 0,rtl:Be==="rtl",disabledIndices:Ha,onNavigate:He,openOnArrowKeyDown:G.type!=="context-menu",externalTree:ae?B:void 0,focusItemOnHover:S}),Ee=_.useCallback(Te=>{P.context.typingRef.current=Te},[P]),Ne=JJ(ye,{enabled:!V,listRef:P.context.itemLabels,elementsRef:P.context.itemDomElements,activeIndex:Y,resetMs:MZ,onMatch:Te=>{F&&Te!==Y&&P.set("activeIndex",Te)},onTyping:Ee}),xe=_.useMemo(()=>{const Te=nl(Ne.reference,Ae.reference,Me.reference,{onMouseMove(){P.set("allowMouseEnter",!0)}},ne);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=F,Te},[P,Ne.reference,Ae.reference,Me.reference,ne,F]),Pe=_.useMemo(()=>{const Te=nl(Ae.trigger,Me.trigger,ne);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=!1,Te},[Ae.trigger,Me.trigger,ne]);Bs(()=>(P.update({inactiveTriggerProps:Pe}),null));const We=_.useMemo(()=>nl(Nm,{id:k,role:"menu","aria-orientation":f==="horizontal"?"horizontal":void 0,"aria-labelledby":z==null?void 0:z.id,onMouseMove(){P.set("allowMouseEnter",!0),G.type==="menu"&&P.set("hoverEnabled",!1)},onClick(){P.select("hoverEnabled")&&P.set("hoverEnabled",!1)},onKeyDown(Te){const qe=P.select("keyboardEventRelay");qe&&!Te.isPropagationStopped()&&qe(Te)}},Ne.floating,Ae.floating,Me.floating),[z,k,f,G.type,P,Ne.floating,Ae.floating,Me.floating]),et=Ae.item??Ln;Am(P,{floatingRootContext:ye,activeTriggerProps:xe,inactiveTriggerProps:Pe,popupProps:We,itemProps:et});const At=_.useMemo(()=>({store:P,parent:R}),[P,R]),ze=b.jsxs(Oj.Provider,{value:At,children:[g&&b.jsx(Tm,{handle:g,store:P}),typeof n=="function"?n({payload:J}):n]});return G.type===void 0||G.type==="context-menu"?b.jsx(ob,{externalTree:B,children:ze}):ze});function Pee(t,e,n){return Bs(()=>new Iee(t,e,n)).current}function zee(t){const e=pl().store,n=_.useMemo(()=>({parentMenu:e}),[e]);return b.jsx(jP.Provider,{value:n,children:b.jsx(E3,{...t})})}const B0=5;function Bee(t,e){const n=$ee(e);return t.clientX>=n.left-B0&&t.clientX<=n.right+B0&&t.clientY>=n.top-B0&&t.clientY<=n.bottom+B0}function $ee(t){const e=t.getBoundingClientRect(),n=In(t);if(qC)return e;const s=n.getComputedStyle(t,"::before"),i=n.getComputedStyle(t,"::after");if(!(s.content!=="none"||i.content!=="none"))return e;const r=parseFloat(s.width)||0,a=parseFloat(s.height)||0,c=parseFloat(i.width)||0,d=parseFloat(i.height)||0,f=Math.max(e.width,r,c),p=Math.max(e.height,a,d),m=f-e.width,g=p-e.height;return{left:e.left-m/2,right:e.right+m/2,top:e.top-g/2,bottom:e.bottom+g/2}}function Fee(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:s}=AC(),{ref:i,index:o}=Zy(t),r=n===o,a=_.useRef(null),c=Fa(i,a);return{compositeProps:{tabIndex:r?0:-1,onFocus(){s(o)},onMouseMove(){const f=a.current;if(!e||!f)return;const p=f.hasAttribute("disabled")||f.ariaDisabled==="true";!r&&!p&&f.focus()}},compositeRef:c,index:o}}function Hee(t){const{render:e,className:n,style:s,state:i=Ln,props:o=Ha,refs:r=Ha,metadata:a,stateAttributesMapping:c,tag:d="div",...f}=t,{compositeProps:p,compositeRef:m}=Fee({metadata:a});return Qt(d,t,{state:i,ref:[m,...r],props:[p,...o,f],stateAttributesMapping:c})}function zP(t){if(gn(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!tl(t))return zP(ul(t))}function BP(t,e){const n=_.useRef(null);function s(o){Vi.flushSync(()=>{t.setOpen(!1,xt(au,o.nativeEvent,o.currentTarget))});const r=RZ(n.current);r==null||r.focus()}function i(o){var a;const r=t.select("positionerElement");if(r&&Hd(o,r))(a=t.context.beforeContentFocusGuardRef.current)==null||a.focus();else{Vi.flushSync(()=>{t.setOpen(!1,xt(au,o.nativeEvent,o.currentTarget))});let c=OZ(t.context.triggerFocusTargetRef.current||e.current);for(;c!==null&&at(r,c);){const d=c;if(c=n3(c),c===d)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:s,handleFocusTargetFocus:i}}function Uee(t){const{enabled:e=!0,mouseDownAction:n,open:s}=t,i=_.useRef(!1);return _.useMemo(()=>e?{onMouseDown:o=>{(n==="open"&&!s||n==="close"&&s)&&(i.current=!0,en(o.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:o=>{i.current&&(i.current=!1,o.preventBaseUIHandler())}}:Ln,[e,n,s])}const $P=Cm(function(e,n){const{render:s,className:i,style:o,disabled:r=!1,nativeButton:a=!0,id:c,openOnHover:d,delay:f=100,closeDelay:p=0,handle:m,payload:g,...y}=e,v=pl(!0),w=Lm(m)??(v==null?void 0:v.store);if(!w)throw new Error(yn(85));const N=di(c),C=w.useState("isTriggerActive",N),T=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",N),A=w.useState("triggerPopupId",N),k=_.useRef(null),M=qee(),L=AC(!0),j=ml(),D=_.useMemo(()=>j??new o3,[j]),P=wm(D),B=Tu(),{registerTrigger:I,isMountedByThisTrigger:F}=Om(N,k,w,{payload:g,closeDelay:p,parent:M,floatingTreeRoot:D,floatingNodeId:P,floatingParentNodeId:B,keyboardEventRelay:L==null?void 0:L.relayKeyboardEvent}),z=M.type==="menubar",U=w.useState("disabled"),H=r||U||z&&M.context.disabled,{getButtonProps:V,buttonRef:W}=Cu({disabled:H,native:a});_.useEffect(()=>{!R&&M.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,R,M.type]);const G=_.useRef(null),Y=li(),J=Ye(_e=>{if(!G.current)return;Y.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Me=_e.target;at(G.current,Me)||at(w.select("positionerElement"),Me)||Me===G.current||Me!=null&&zP(Me)===w.select("rootId")||Bee(_e,G.current)||D.events.emit("close",{domEvent:_e,reason:jQ})});_.useEffect(()=>{R&&w.select("lastOpenChangeReason")===Fn&&en(G.current).addEventListener("mouseup",J,{once:!0})},[R,J,w]);const q=z&&M.context.hasSubmenuOpen,Z=Im(T,{enabled:(d??q)&&!H&&(!z||q&&!F),handleClose:Dm({blockPointerEvents:!z}),mouseOnly:!0,move:!1,restMs:M.type===void 0?f:void 0,delay:{close:p},triggerElementRef:k,externalTree:D,isActiveTrigger:C,isClosing:()=>w.select("transitionStatus")==="ending"}),te=Vee(R,w.select("lastOpenChangeReason")),Q=rb(T,{enabled:!H,event:R&&z?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?te:!1}),se=f3(T,{enabled:!H&&q}),ae=Uee({open:R,enabled:z,mouseDownAction:"open"}),le=_.useMemo(()=>nl(se.reference,Q.reference),[se.reference,Q.reference]),ne=w.useState("triggerProps",F),{preFocusGuardRef:fe,handlePreFocusGuardFocus:ve,handleFocusTargetFocus:we}=BP(w,k),Ce={disabled:H,open:R},ye=[G,n,W,I,k],Oe=[le,Z??Ln,ne,{"aria-haspopup":"menu","aria-controls":A,id:N,onMouseDown:_e=>{if(w.select("open"))return;Y.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),en(_e.currentTarget).addEventListener("mouseup",J,{once:!0})}},z?{role:"menuitem"}:{},ae,y,V],be=Qt("button",e,{enabled:!z,stateAttributesMapping:ww,state:Ce,ref:ye,props:Oe});return z?b.jsx(Hee,{tag:"button",render:s,className:i,style:o,state:Ce,refs:ye,props:Oe,stateAttributesMapping:ww}):R?b.jsxs(_.Fragment,{children:[b.jsx(qa,{ref:fe,onFocus:ve},`${N}-pre-focus-guard`),b.jsx(_.Fragment,{children:be},N),b.jsx(qa,{ref:w.context.triggerFocusTargetRef,onFocus:we},`${N}-post-focus-guard`)]}):b.jsx(_.Fragment,{children:be},N)});function Vee(t,e){const n=li(),[s,i]=_.useState(!1);return Ue(()=>{t&&e===Fn?(i(!0),n.start(tP,()=>{i(!1)})):t||(n.clear(),i(!1))},[t,e,n]),s}function qee(){const t=S3(!0);return _.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const FP=_.forwardRef(function(e,n){const{className:s,render:i,orientation:o="horizontal",style:r,...a}=e;return Qt("div",e,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},a]})});function Wee(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const Gee={"aria-expanded":void 0},Kee=_.forwardRef(function(e,n){const{render:s,className:i,style:o,label:r,id:a,nativeButton:c=!1,openOnHover:d=!0,delay:f=100,closeDelay:p=0,disabled:m=!1,...g}=e,y=PP();if(!(y!=null&&y.parentMenu))throw new Error(yn(37));const v=Zy({guess:!0,label:r}),S=Yy(),{store:w}=pl(),N=di(a),C=w.useState("open"),T=w.useState("floatingRootContext"),R=w.useState("floatingTreeRoot"),A=w.useState("triggerPopupId",N),k=wP(N,w),M=Ye(le=>{k(le),le!==null&&w.select("open")&&w.select("activeTriggerId")==null&&w.update({activeTriggerId:N??null,activeTriggerElement:le,closeDelay:p})}),L=_.useRef(null),j=_.useCallback(le=>{L.current=le,w.set("activeTriggerElement",le)},[w]);Ue(()=>(M(L.current),()=>M(null)),[M,N,w]),w.useSyncedValue("closeDelay",p);const D=y.parentMenu,P=w.useState("disabled"),B=D.useState("disabled"),I=m||P||B,F=D.useState("itemProps"),z=D.useState("isActive",v.index),U=_.useMemo(()=>({type:"submenu-trigger",setActive(){D.select("highlightItemOnHover")&&D.set("activeIndex",v.index)}}),[D,v.index]),{getItemProps:H,itemRef:V}=WC({closeOnClick:!1,disabled:I,highlighted:z,id:N,store:w,typingRef:D.context.typingRef,nativeButton:c,itemMetadata:U,nodeId:S==null?void 0:S.context.nodeId}),W=w.useState("hoverEnabled"),G=Im(T,{enabled:W&&d&&!I,handleClose:Dm({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:f,delay:{open:f,close:p},shouldOpen:f>0?()=>D.select("allowMouseEnter"):void 0,triggerElementRef:L,externalTree:R,isClosing:()=>w.select("transitionStatus")==="ending",guardStaleOpen:!0}),J=rb(T,{enabled:!I,event:"mousedown",toggle:!d,ignoreMouse:d,stickIfOpen:!1}).reference??Ln,q=w.useState("triggerProps",!0);delete q.id;const X={disabled:I,highlighted:z,open:C},Z=w.useState("openMethod"),Q=w.useState("lastOpenChangeReason")===Ip||Z==="keyboard";return Qt("div",e,{state:X,stateAttributesMapping:gm,props:[J,G,q,F,C&&Q&&_j?Gee:void 0,{"aria-controls":A,tabIndex:C||z?0:-1,onBlur(){z&&D.set("activeIndex",null)}},g,H],ref:[n,v.ref,V,M,j]})}),HP="relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";function UP(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(E3,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=s):s=e[3],s}function VP(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx($P,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function qP(t){const e=ee.c(18);let n,s,i,o,r,a;e[0]!==t?({align:i,alignOffset:o,side:r,sideOffset:a,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=r,e[6]=a):(n=e[1],s=e[2],i=e[3],o=e[4],r=e[5],a=e[6]);const c=i===void 0?"start":i,d=o===void 0?0:o,f=r===void 0?"bottom":r,p=a===void 0?4:a;let m;e[7]!==n?(m=Se("z-50 max-h-(--available-height) min-w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[7]=n,e[8]=m):m=e[8];let g;e[9]!==s||e[10]!==m?(g=b.jsx(m3,{"data-slot":"dropdown-menu-content",className:m,...s}),e[9]=s,e[10]=m,e[11]=g):g=e[11];let y;return e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==p||e[16]!==g?(y=b.jsx(g3,{children:b.jsx(v3,{className:"isolate z-50 outline-none",align:c,alignOffset:d,side:f,sideOffset:p,children:g})}),e[12]=c,e[13]=d,e[14]=f,e[15]=p,e[16]=g,e[17]=y):y=e[17],y}function Vd(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se(HP,n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(zj,{"data-slot":"dropdown-menu-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function N_e(t){const e=ee.c(13);let n,s,i,o;e[0]!==t?({className:i,children:s,checked:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o):(n=e[1],s=e[2],i=e[3],o=e[4]);let r;e[5]!==i?(r=Se(HP,i),e[5]=i,e[6]=r):r=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx("span",{className:"pointer-events-none flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card","data-slot":"dropdown-menu-checkbox-item-indicator",children:b.jsx(jj,{children:b.jsx(Nu,{className:"size-3",strokeWidth:3})})}),e[7]=a):a=e[7];let c;return e[8]!==n||e[9]!==s||e[10]!==o||e[11]!==r?(c=b.jsxs(Dj,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:n,...o,children:[a,s]}),e[8]=n,e[9]=s,e[10]=o,e[11]=r,e[12]=c):c=e[12],c}function WP(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("-mx-1 my-1 h-px bg-border",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(FP,{"data-slot":"dropdown-menu-separator",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}const n_="Settings",Yee="Explain this review",Xee="Delete",Qee="Switch to dark mode",Zee="Switch to light mode",Jee="flex size-8 shrink-0 items-center justify-center rounded-md text-sign-muted hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-sign-foreground aria-expanded:bg-sign-foreground/15 aria-expanded:text-sign-foreground",ete={agents:eQ,forges:dQ,configurations:aQ,repositories:cQ,review:Bd},tte=t=>{const e=ee.c(6),{theme:n,onToggle:s}=t,i=n==="dark"?bQ:gQ;let o;e[0]!==i?(o=b.jsx(i,{"aria-hidden":"true",className:"size-3.5"}),e[0]=i,e[1]=o):o=e[1];const r=n==="dark"?Zee:Qee;let a;return e[2]!==s||e[3]!==o||e[4]!==r?(a=b.jsxs(Vd,{onClick:s,children:[o,r]}),e[2]=s,e[3]=o,e[4]=r,e[5]=a):a=e[5],a},nte=t=>{const e=ee.c(12),{actions:n}=t;let s;e[0]!==n.forgeLink?(s=n.forgeLink===null?null:b.jsxs(Vd,{render:b.jsx("a",{href:n.forgeLink.href,target:"_blank",rel:"noreferrer","aria-label":n.forgeLink.label}),children:[b.jsx(QD,{"aria-hidden":"true",className:"size-3.5"}),n.forgeLink.label]}),e[0]=n.forgeLink,e[1]=s):s=e[1];let i;e[2]!==n.onWriteUp?(i=n.onWriteUp===null?null:b.jsxs(Vd,{onClick:n.onWriteUp,children:[b.jsx(yQ,{"aria-hidden":"true",className:"size-3.5"}),Yee]}),e[2]=n.onWriteUp,e[3]=i):i=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(PC,{"aria-hidden":"true",className:"size-3.5"}),e[4]=o):o=e[4];let r;e[5]!==n.onDelete?(r=b.jsxs(Vd,{className:"text-destructive focus:bg-destructive/10",onClick:n.onDelete,children:[o,Xee]}),e[5]=n.onDelete,e[6]=r):r=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx(WP,{}),e[7]=a):a=e[7];let c;return e[8]!==s||e[9]!==i||e[10]!==r?(c=b.jsxs(b.Fragment,{children:[s,i,r,a]}),e[8]=s,e[9]=i,e[10]=r,e[11]=c):c=e[11],c},$w=t=>{const e=ee.c(12),{links:n,themeToggle:s,reviewActions:i}=t,o=i===void 0?null:i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=b.jsx(VP,{"aria-label":n_,title:n_,className:Jee,children:b.jsx(mj,{"aria-hidden":"true",className:"size-4"})}),e[0]=r):r=e[0];let a;e[1]!==o?(a=o===null?null:b.jsx(nte,{actions:o}),e[1]=o,e[2]=a):a=e[2];let c;e[3]!==s?(c=b.jsx(tte,{...s}),e[3]=s,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=b.jsx(WP,{}),e[5]=d):d=e[5];let f;e[6]!==n?(f=n.map(ste),e[6]=n,e[7]=f):f=e[7];let p;return e[8]!==a||e[9]!==c||e[10]!==f?(p=b.jsxs(UP,{children:[r,b.jsxs(qP,{align:"end",children:[a,c,d,f]})]}),e[8]=a,e[9]=c,e[10]=f,e[11]=p):p=e[11],p};function ste(t){const{label:e,icon:n,link:s}=t,i=ete[n];return b.jsxs(Vd,{render:s,children:[b.jsx(i,{"aria-hidden":"true",className:"size-3.5"}),e]},e)}const ite={column:"max-w-5xl px-4 sm:px-6",full:"px-6"},ote=t=>{const e=ee.c(6),{brand:n,width:s,children:i}=t,r=ite[s===void 0?"column":s];let a;e[0]!==r?(a=Se("mx-auto flex h-14 w-full items-center justify-between gap-6",r),e[0]=r,e[1]=a):a=e[1];let c;return e[2]!==n||e[3]!==i||e[4]!==a?(c=b.jsx("header",{className:"sticky top-0 z-40 bg-sign text-sign-foreground",children:b.jsxs("div",{className:a,children:[n,i]})}),e[2]=n,e[3]=i,e[4]=a,e[5]=c):c=e[5],c},GP=_.createContext(void 0);function Pm(t){const e=_.useContext(GP);if(e===void 0&&!t)throw new Error(yn(72));return e}const rte={...Mm,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class lte extends Ou{constructor(n,s,i){const o=new Df;super(ate(n,o,s,i),cte(o),rte);Ut(this,"setOpen",(n,s)=>{EP(this,n,s,{extraState:{openChangeReason:s.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,xt(hr,n))}}function ate(t,e,n,s=!1){return{..._m(e,n,s),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function cte(t){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const ute=If(function(e){const{disabled:n=!1,defaultOpen:s=!1,open:i,disableHoverablePopup:o=!1,trackCursorAxis:r="none",actionsRef:a,onOpenChange:c,onOpenChangeComplete:d,handle:f,triggerId:p,defaultTriggerId:m=null,children:g}=e,y=ab((D,P)=>new lte({open:s,openProp:i,activeTriggerId:m,triggerIdProp:p},D,P));y.useControlledProp("openProp",i),y.useControlledProp("triggerIdProp",p),y.useContextCallback("onOpenChange",c),y.useContextCallback("onOpenChangeComplete",d);const v=y.useState("open"),S=!n&&v,w=y.useState("activeTriggerId"),N=y.useState("mounted"),C=y.useState("payload");y.useSyncedValues({trackCursorAxis:r,disableHoverablePopup:o,disabled:n}),Rm(y,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:T,transitionStatus:R}=km(S,y),A=y.useState("isInstantPhase"),k=y.useState("instantType"),M=y.useState("lastOpenChangeReason"),L=_.useRef(null);Ue(()=>{v&&n&&y.setOpen(!1,xt(PQ))},[v,n,y]),Ue(()=>{R==="ending"&&M===bm||R!=="ending"&&A?(k!=="delay"&&(L.current=k),y.set("instantType","delay")):L.current!==null&&(y.set("instantType",L.current),L.current=null)},[R,A,M,k,y]),Ue(()=>{S&&w==null&&y.set("payload",void 0)},[y,w,S]),_.useImperativeHandle(a,()=>({unmount:T,close:()=>y.setOpen(!1,xt(cu))}),[T,y]);const j=S||N||!n&&r!=="none";return b.jsxs(GP.Provider,{value:y,children:[f&&b.jsx(Tm,{handle:f,store:y}),j&&b.jsx(dte,{store:y,disabled:n,trackCursorAxis:r}),typeof g=="function"?g({payload:C}):g]})});function dte({store:t,disabled:e,trackCursorAxis:n}){const s=t.useState("floatingRootContext"),i=Em(s,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),o=$Z(s,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),r=_.useMemo(()=>nl(o.reference,i.reference),[o.reference,i.reference]);return Am(t,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i.floating??Ln}),null}const fte=_.createContext(void 0);function hte(){return _.useContext(fte)}const pte=600,KP="data-base-ui-tooltip-trigger";function s_(t){if("composedPath"in t){const n=t.composedPath();for(let s=0;s<n.length;s+=1){const i=n[s];if(Pt(i))return i}}const e=t.target;return Pt(e)?e:null}function mte(t){let e=t;for(;e;){const n=e.closest(`[${KP}]`);if(n)return n;const s=e.getRootNode();e="host"in s&&Pt(s.host)?s.host:null}return null}const gte=Cm(function(e,n){const{render:s,className:i,style:o,handle:r,payload:a,disabled:c,delay:d,closeOnClick:f=!0,closeDelay:p,id:m,...g}=e,y=Pm(!0),S=Lm(r)??y;if(!S)throw new Error(yn(82));const w=di(m),N=S.useState("isTriggerActive",w),C=S.useState("isOpenedByTrigger",w),T=S.useState("floatingRootContext"),R=_.useRef(null),A=p??0,{registerTrigger:k,isMountedByThisTrigger:M}=Om(w,R,S,{payload:a,closeOnClick:f,closeDelay:A}),L=hte(),{activeIdRef:j,delayRef:D,isInstantPhase:P,hasProvider:B}=cZ(T,{open:C}),I=p3(T);S.useSyncedValue("isInstantPhase",P);const F=S.useState("disabled"),z=c??F,U=Xn(z),H=S.useState("trackCursorAxis"),V=S.useState("disableHoverablePopup"),W=_.useRef(!1),G=li(),Y=_.useRef(void 0);function J(){return B&&j.current!=null?0:d??L??pte}function q(fe){const ve=R.current;if(!ve||!fe)return!1;const we=mte(fe);return we!==null&&we!==ve&&at(ve,we)}function X(fe){const ve=q(fe);return W.current=ve,ve&&(I.openChangeTimeout.clear(),I.restTimeout.clear(),I.restTimeoutPending=!1,G.clear()),ve}const Z=Im(T,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!V&&H!=="both"?Dm():null,restMs:J,delay(){return p==null&&B?{close:Pp(D.current,"close")}:{close:A}},triggerElementRef:R,isActiveTrigger:N,isClosing:()=>S.select("transitionStatus")==="ending",shouldOpen(){return!W.current}}),te=f3(T,{enabled:!z}).reference,Q=fe=>{const ve=W.current,we=s_(fe),Ce=X(we),ye=R.current,Oe=ye&&we&&at(ye,we);if(Ce&&S.select("open")&&S.select("lastOpenChangeReason")===Fn){S.setOpen(!1,xt(Fn,fe));return}if(ve&&!Ce&&Oe&&!U.current&&!S.select("open")&&ye&&Aa(Y.current)){const be=()=>{!W.current&&!U.current&&!S.select("open")&&S.setOpen(!0,xt(Fn,fe,ye))},_e=J();_e===0?(G.clear(),be()):G.start(_e,be)}},se=S.useState("triggerProps",M);return Qt("button",e,{state:{open:C},ref:[n,k,R],props:[Z,te,M||H!=="none"?se:void 0,{onMouseOver(fe){Q(fe.nativeEvent)},onFocus(fe){q(s_(fe.nativeEvent))&&fe.preventBaseUIHandler()},onMouseLeave(){W.current=!1,G.clear(),Y.current=void 0},onPointerEnter(fe){Y.current=fe.pointerType},onPointerDown(fe){Y.current=fe.pointerType,S.set("closeOnClick",f),f&&!S.select("open")&&S.cancelPendingOpen(fe.nativeEvent)},onClick(fe){f&&!S.select("open")&&S.cancelPendingOpen(fe.nativeEvent)},id:w,[Nw]:z?"":void 0,[KP]:z?void 0:""},g],stateAttributesMapping:gm})}),YP=_.createContext(void 0);function yte(){const t=_.useContext(YP);if(t===void 0)throw new Error(yn(70));return t}const XP=_.forwardRef(function(e,n){const{children:s,container:i,className:o,render:r,style:a,...c}=e,{node:d,subtree:f}=iP({container:i,ref:n,componentProps:e,elementProps:c});return!f&&!d?null:b.jsxs(_.Fragment,{children:[f,d&&Vi.createPortal(s,d)]})}),bte=_.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e;return Pm().useState("mounted")||s?b.jsx(YP.Provider,{value:s,children:b.jsx(XP,{ref:n,...i})}):null}),QP=_.createContext(void 0);function ZP(){const t=_.useContext(QP);if(t===void 0)throw new Error(yn(71));return t}const xte=_.forwardRef(function(e,n){const{render:s,className:i,anchor:o,positionMethod:r="absolute",side:a="top",align:c="center",sideOffset:d=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:S=sb,style:w,...N}=e,C=Pm(),T=yte(),R=C.useState("open"),A=C.useState("mounted"),k=C.useState("trackCursorAxis"),M=C.useState("disableHoverablePopup"),L=C.useState("floatingRootContext"),j=C.useState("instantType"),D=C.useState("transitionStatus"),P=C.useState("adaptiveOrigin"),B=hb({anchor:o,positionMethod:r,floatingRootContext:L,mounted:A,side:a,sideOffset:d,align:c,alignOffset:f,collisionBoundary:p,collisionPadding:m,sticky:y,arrowPadding:g,disableAnchorTracking:v,keepMounted:T,collisionAvoidance:S,adaptiveOrigin:P}),I=_.useMemo(()=>({open:R,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:k!=="none"?"tracking-cursor":j}),[R,B.side,B.align,B.anchorHidden,k,j]),F=pb(e,I,{styles:B.positionerStyles,transitionStatus:D,props:N,refs:[n,C.useStateSetter("positionerElement")],hidden:!A,inert:!R||k==="both"||M});return b.jsx(QP.Provider,{value:B,children:F})}),vte=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,a=Pm(),{side:c,align:d}=ZP(),f=a.useState("open"),p=a.useState("instantType"),m=a.useState("transitionStatus"),g=a.useState("popupProps"),y=a.useState("floatingRootContext"),v=a.useState("disabled"),S=a.useState("closeDelay");Xa({open:f,ref:a.context.popupRef,onComplete(){var T,R;f&&((R=(T=a.context).onOpenChangeComplete)==null||R.call(T,!0))}}),ub(y,{enabled:!v,closeDelay:S});const w=a.useStateSetter("popupElement");return Qt("div",e,{state:{open:f,side:c,align:d,instant:p,transitionStatus:m},ref:[n,a.context.popupRef,w],props:[Nm,g,jm(m),r],stateAttributesMapping:ym})}),Ste=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,a=Pm(),{arrowRef:c,side:d,align:f,arrowUncentered:p,arrowStyles:m}=ZP(),g=a.useState("open"),y=a.useState("instantType");return Qt("div",e,{state:{open:g,side:d,align:f,uncentered:p,instant:y},ref:[n,c],props:[{style:m,"aria-hidden":!0},r],stateAttributesMapping:Lf})});function JP(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(ute,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=s):s=e[3],s}function e8(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(gte,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function t8(t){const e=ee.c(21);let n,s,i,o,r,a,c;e[0]!==t?({className:s,side:o,sideOffset:r,align:a,alignOffset:c,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=r,e[6]=a,e[7]=c):(n=e[1],s=e[2],i=e[3],o=e[4],r=e[5],a=e[6],c=e[7]);const d=o===void 0?"top":o,f=r===void 0?4:r,p=a===void 0?"center":a,m=c===void 0?0:c;let g;e[8]!==s?(g=Se("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",s),e[8]=s,e[9]=g):g=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx(Ste,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"}),e[10]=y):y=e[10];let v;e[11]!==n||e[12]!==i||e[13]!==g?(v=b.jsxs(vte,{"data-slot":"tooltip-content",className:g,...i,children:[n,y]}),e[11]=n,e[12]=i,e[13]=g,e[14]=v):v=e[14];let S;return e[15]!==p||e[16]!==m||e[17]!==d||e[18]!==f||e[19]!==v?(S=b.jsx(bte,{children:b.jsx(xte,{align:p,alignOffset:m,side:d,sideOffset:f,className:"isolate z-50",children:v})}),e[15]=p,e[16]=m,e[17]=d,e[18]=f,e[19]=v,e[20]=S):S=e[20],S}const wte={previous:$D,next:lu,fold:lu,unfold:Gy,close:Ky,settings:mj,edit:dj,delete:PC,add:jC,remove:oQ,copy:rQ,copied:Nu,zoomIn:SQ,zoomOut:wQ,fullScreen:fQ,leaveFullScreen:mQ},Ete=/[A-Z]/g,Cte=t=>`${t.replace(Ete,e=>`-${e.toLowerCase()}`)}-icon-action`,xs=t=>{const e=ee.c(20),{icon:n,label:s,isDisabled:i,variant:o,className:r,actionId:a,onClick:c}=t,d=i===void 0?!1:i,f=o===void 0?"ghost":o,p=wte[n];let m;e[0]!==a||e[1]!==n?(m=a??Cte(n),e[0]=a,e[1]=n,e[2]=m):m=e[2];let g;e[3]!==r||e[4]!==d||e[5]!==s||e[6]!==c||e[7]!==m||e[8]!==f?(g=b.jsx(ft,{variant:f,size:"icon-sm","aria-label":s,disabled:d,"data-user-action-id":m,className:r,onClick:c}),e[3]=r,e[4]=d,e[5]=s,e[6]=c,e[7]=m,e[8]=f,e[9]=g):g=e[9];let y;e[10]!==p?(y=b.jsx(p,{"aria-hidden":"true"}),e[10]=p,e[11]=y):y=e[11];let v;e[12]!==g||e[13]!==y?(v=b.jsx(e8,{render:g,children:y}),e[12]=g,e[13]=y,e[14]=v):v=e[14];let S;e[15]!==s?(S=b.jsx(t8,{children:s}),e[15]=s,e[16]=S):S=e[16];let w;return e[17]!==v||e[18]!==S?(w=b.jsxs(JP,{children:[v,S]}),e[17]=v,e[18]=S,e[19]=w):w=e[19],w},Qa=t=>{const e=ee.c(9),{href:n,label:s,className:i}=t;let o;e[0]!==i?(o=Se("inline-flex items-center gap-1 rounded-sm text-sm text-[var(--line,var(--muted-foreground))] hover:text-foreground",i),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=b.jsx("span",{children:s}),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx(QD,{"aria-hidden":"true",className:"size-3.5"}),e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==o||e[7]!==r?(c=b.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:o,children:[r,a]}),e[5]=n,e[6]=o,e[7]=r,e[8]=c):c=e[8],c},Nte=t=>{const e=ee.c(30),{notice:n,isCopied:s,onCopy:i,onClose:o}=t;let r;e[0]!==n.title?(r=b.jsx("p",{className:"font-bold",children:n.title}),e[0]=n.title,e[1]=r):r=e[1];let a;e[2]!==n.description?(a=b.jsx("p",{className:"text-muted-foreground",children:n.description}),e[2]=n.description,e[3]=a):a=e[3];let c;e[4]!==r||e[5]!==a?(c=b.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[r,a]}),e[4]=r,e[5]=a,e[6]=c):c=e[6];let d;e[7]!==n.closeLabel||e[8]!==o?(d=b.jsx(xs,{icon:"close",label:n.closeLabel,actionId:"close-update-toast",onClick:o}),e[7]=n.closeLabel,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==c||e[11]!==d?(f=b.jsxs("div",{className:"flex items-start gap-2",children:[c,d]}),e[10]=c,e[11]=d,e[12]=f):f=e[12];let p;e[13]!==n.command?(p=b.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-[0.8125rem] leading-5 select-all",children:b.jsx("code",{children:n.command})}),e[13]=n.command,e[14]=p):p=e[14];const m=s?"copied":"copy",g=s?n.copiedLabel:n.copyLabel;let y;e[15]!==i||e[16]!==m||e[17]!==g?(y=b.jsx(xs,{icon:m,label:g,actionId:"copy-update-command",onClick:i}),e[15]=i,e[16]=m,e[17]=g,e[18]=y):y=e[18];let v;e[19]!==p||e[20]!==y?(v=b.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-muted py-1 pr-1 pl-3",children:[p,y]}),e[19]=p,e[20]=y,e[21]=v):v=e[21];let S;e[22]!==n.releaseNotesLabel||e[23]!==n.releaseNotesUrl?(S=b.jsx(Qa,{href:n.releaseNotesUrl,label:n.releaseNotesLabel,className:"self-start"}),e[22]=n.releaseNotesLabel,e[23]=n.releaseNotesUrl,e[24]=S):S=e[24];let w;return e[25]!==n.title||e[26]!==v||e[27]!==S||e[28]!==f?(w=b.jsxs("section",{role:"status","aria-label":n.title,className:"fixed right-4 bottom-4 z-[60] flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2 rounded-lg border border-foreground bg-popover p-3 text-sm text-popover-foreground duration-150 animate-in fade-in-0",children:[f,v,S]}),e[25]=n.title,e[26]=v,e[27]=S,e[28]=f,e[29]=w):w=e[29],w},Tte="/logo.svg",Ote="Flight Plan",Rte="/setup/",kte="mx-auto max-w-5xl px-4 pt-8 pb-16 sm:px-6",Ate="/not-found.svg",_te=()=>{const t=ee.c(29),[e,n]=_.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:Dte},t[0]=s):s=t[0];const i=Lv(s);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={select:Pte},t[1]=o):o=t[1];const r=Lv(o);let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a={select:Bte},t[2]=a):a=t[2];const c=Lv(a),d=$X(),f=G6(),p=i?"full":"column";let m,g;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=b.jsx(rr,{to:"/",className:"shrink-0 rounded-sm",children:b.jsx(FX,{logoSrc:Tte,name:Ote})}),g=b.jsx("div",{ref:n,className:"flex min-w-0 flex-1 items-center border-l border-sign-foreground/20 pl-6 empty:hidden"}),t[3]=m,t[4]=g):(m=t[3],g=t[4]);let y;t[5]!==f||t[6]!==c||t[7]!==r?(y=r||c?null:b.jsx($w,{links:yw,themeToggle:f}),t[5]=f,t[6]=c,t[7]=r,t[8]=y):y=t[8];let v;t[9]!==p||t[10]!==y?(v=b.jsxs(ote,{width:p,brand:m,children:[g,y]}),t[9]=p,t[10]=y,t[11]=v):v=t[11];const S=i?"":kte;let w;t[12]!==S?(w=Se("w-full",S),t[12]=S,t[13]=w):w=t[13];let N;t[14]===Symbol.for("react.memo_cache_sentinel")?(N=b.jsx(U6,{}),t[14]=N):N=t[14];let C;t[15]!==w?(C=b.jsx("main",{className:w,children:N}),t[15]=w,t[16]=C):C=t[16];let T;t[17]!==d.close||t[18]!==d.copy||t[19]!==d.isCopied||t[20]!==d.notice?(T=d.notice===null?null:b.jsx(Nte,{notice:d.notice,isCopied:d.isCopied,onCopy:d.copy,onClose:d.close}),t[17]=d.close,t[18]=d.copy,t[19]=d.isCopied,t[20]=d.notice,t[21]=T):T=t[21];let R;t[22]!==C||t[23]!==T||t[24]!==v?(R=b.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[v,C,T]}),t[22]=C,t[23]=T,t[24]=v,t[25]=R):R=t[25];let A;return t[26]!==e||t[27]!==R?(A=b.jsx(q6,{value:e,children:R}),t[26]=e,t[27]=R,t[28]=A):A=t[28],A},Mte=()=>{const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsxs("section",{className:"mx-auto flex max-w-prose flex-col items-center text-center",children:[b.jsx(K6,{src:Ate}),b.jsx("h1",{className:"mt-4 text-2xl font-bold tracking-[-0.01em]",children:"PAN-PAN! We couldn't locate this page!"}),b.jsx("p",{className:"mt-2 text-muted-foreground",children:"The address does not match any page of Flight Plan."}),b.jsx(rr,{to:"/",className:"mt-4 inline-block underline",children:"Go to your repositories"})]}),t[0]=e):e=t[0],e},Lte=t=>{const e=ee.c(2),{error:n}=t;let s;return e[0]!==n?(s=b.jsx("main",{className:"min-h-screen bg-background px-4 pt-16 text-foreground",children:b.jsx(uD,{heading:"MAYDAY! MAYDAY! Flight Plan could not start",error:n})}),e[0]=n,e[1]=s):s=e[1],s},Ru=NG()({beforeLoad:async({context:{queryClient:t,trpc:e},location:n})=>{const s=await t.query({...e.setup.gate.queryOptions({path:n.pathname}),staleTime:"static"});s.redirectTo!==null&&Py({to:s.redirectTo,throw:!0})},component:_te,notFoundComponent:Mte,errorComponent:Lte});function Ite(t){return t.staticData.isFullWidth===!0}function Dte(t){return t.some(Ite)}function jte(t){return t.routeId===Rte}function Pte(t){return t.some(jte)}function zte(t){return t.staticData.hasPageSettingsMenu===!0}function Bte(t){return t.some(zte)}const $te="modulepreload",Fte=function(t){return"/"+t},i_={},un=function(e,n,s){let i=Promise.resolve();if(n&&n.length>0){let r=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=r(n.map(d=>{if(d=Fte(d),d in i_)return;i_[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":$te,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),f)return new Promise((g,y)=>{m.addEventListener("load",g),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return i.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},Hte=[{id:"first",stopWidths:["w-3/5","w-2/5","w-1/2"]},{id:"second",stopWidths:["w-2/5","w-3/5"]}],Ute=()=>{const t=ee.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{className:"sr-only",children:"Loading your repositories"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=b.jsxs("div",{role:"status","aria-busy":"true",children:[e,b.jsxs("div",{"aria-hidden":"true",className:"motion-safe:animate-pulse",children:[b.jsx("div",{className:"mb-6 h-9 w-48 rounded-sm bg-muted"}),Hte.map(qte)]})]}),t[1]=n):n=t[1],n};function Vte(t){return b.jsx("span",{className:`h-5 rounded-sm bg-muted ${t}`},t)}function qte(t){return b.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] border-t-2 border-foreground pt-5 pb-6",children:[b.jsxs("span",{className:"flex flex-col items-center",children:[b.jsx("span",{className:"size-7 rounded-full bg-muted"}),b.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),b.jsxs("div",{className:"flex flex-col gap-4 pb-1",children:[b.jsx("span",{className:"h-6 w-40 rounded-sm bg-muted"}),t.stopWidths.map(Vte)]})]},t.id)}const Wte=()=>un(()=>import("./index-DaFaImds.js"),__vite__mapDeps([0,1])),Gte=()=>un(()=>import("./index-paF1osGm.js"),__vite__mapDeps([2,1,3,4])),o_=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):void 0,Kte=Ci()({validateSearch:t=>({status:o_(t.status),author:o_(t.author),fixtureCase:typeof t.fixtureCase=="string"?t.fixtureCase:void 0}),loaderDeps:({search:t})=>({statuses:t.status??null,authors:t.author??null,fixtureCase:t.fixtureCase}),loader:async({context:{queryClient:t,trpc:e},deps:n})=>{await t.query({...e.repository.list.queryOptions(n),staleTime:"static"})},component:Dn(Gte,"component"),pendingComponent:Ute,errorComponent:Dn(Wte,"errorComponent")}),Yte=()=>un(()=>import("./route-BLz_XVsx.js"),[]),Xte=Ci()({component:Dn(Yte,"component")}),Qte=Ci()({beforeLoad:()=>{Py({to:"/settings/agents",throw:!0})}}),Zte={section:"agents"},Jte=["w-2/5","w-3/5","w-1/2"],ku=()=>{const t=ee.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{className:"sr-only",children:"Loading the settings"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=b.jsxs("div",{role:"status","aria-busy":"true",children:[e,b.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-4 motion-safe:animate-pulse",children:[b.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),b.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),Jte.map(ene)]})]}),t[1]=n):n=t[1],n};function ene(t){return b.jsx("span",{className:`h-6 rounded-sm bg-muted ${t}`},t)}const tne=()=>un(()=>import("./agents-KKXkUQ27.js"),__vite__mapDeps([5,6])),nne=()=>un(()=>import("./agents-C9xHqVQD.js"),__vite__mapDeps([7,8,9,10,4,11])),sne=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.settings.get.queryOptions(Zte),staleTime:"static"})},component:Dn(nne,"component"),pendingComponent:ku,errorComponent:Dn(tne,"errorComponent")}),ine={section:"forges"},one=()=>un(()=>import("./forges-BMb9Pcn1.js"),__vite__mapDeps([12,6])),rne=()=>un(()=>import("./forges-BOVWBO1B.js"),__vite__mapDeps([13,8,14,11])),lne=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.settings.get.queryOptions(ine),staleTime:"static"})},component:Dn(rne,"component"),pendingComponent:ku,errorComponent:Dn(one,"errorComponent")}),ane={section:"repositories"},cne=()=>un(()=>import("./repositories-AJnxH9f7.js"),__vite__mapDeps([15,6])),une=()=>un(()=>import("./repositories-Dy8KRYwV.js"),__vite__mapDeps([16,3,4,17,11])),dne=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.settings.get.queryOptions(ane),staleTime:"static"})},component:Dn(une,"component"),pendingComponent:ku,errorComponent:Dn(cne,"errorComponent")}),fne={section:"review"},hne=()=>un(()=>import("./review-M5J-BQx7.js"),__vite__mapDeps([18,6])),pne=()=>un(()=>import("./review-B9u6XA77.js"),__vite__mapDeps([19,8,20,10,11])),mne=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.settings.get.queryOptions(fne),staleTime:"static"})},component:Dn(pne,"component"),pendingComponent:ku,errorComponent:Dn(hne,"errorComponent")}),gne=["first","second","third","fourth"],yne=["w-2/5","w-3/5","w-1/2"],bne=()=>{const t=ee.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{className:"sr-only",children:"Loading the setup"}),t[0]=e):e=t[0];let n,s;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=b.jsx("span",{className:"h-9 w-64 rounded-sm bg-muted lg:col-span-2"}),s=b.jsx("div",{children:gne.map(xne)}),t[1]=n,t[2]=s):(n=t[1],s=t[2]);let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsxs("div",{role:"status","aria-busy":"true",children:[e,b.jsxs("div",{"aria-hidden":"true",className:"grid gap-x-10 gap-y-8 motion-safe:animate-pulse lg:grid-cols-[17rem_minmax(0,1fr)]",children:[n,s,b.jsxs("div",{className:"flex flex-col gap-4",children:[b.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),b.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),yne.map(vne)]})]})]}),t[3]=i):i=t[3],i};function xne(t){return b.jsxs("div",{className:"grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[b.jsxs("span",{className:"flex flex-col items-center",children:[b.jsx("span",{className:"size-5 rounded-full bg-muted"}),b.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),b.jsx("span",{className:"h-5 w-32 rounded-sm bg-muted"})]},t)}function vne(t){return b.jsx("span",{className:`h-6 rounded-sm bg-muted ${t}`},t)}const Sne=()=>un(()=>import("./index-DQyWuir1.js"),__vite__mapDeps([21,22])),wne=()=>un(()=>import("./index-CmrDaRXW.js"),__vite__mapDeps([23,22,3,4,17,9,10,20,14])),Ene=Ci()({validateSearch:t=>({step:typeof t.step=="string"?t.step:void 0}),loaderDeps:({search:t})=>({step:t.step??null}),loader:async({context:{queryClient:t,trpc:e},deps:n})=>{const s=await t.query({...e.setup.get.queryOptions(n),staleTime:"static"});n.step!==s.form.step&&(t.setQueryData(e.setup.get.queryKey({step:s.form.step}),s),Py({to:"/setup",search:{step:s.form.step},replace:!0,throw:!0}))},component:Dn(wne,"component"),pendingComponent:bne,errorComponent:Dn(Sne,"errorComponent")}),Cne=t=>({artifactUrl:t.artifact,repositoryName:t.repository,targetId:t.target}),Nne=()=>un(()=>import("./download-B00Se_e0.js"),[]),Jv=t=>typeof t=="string"?t:"",Tne=Ci()({validateSearch:t=>({artifact:Jv(t.artifact),repository:Jv(t.repository),target:Jv(t.target)}),loaderDeps:({search:t})=>t,loader:async({context:{queryClient:t,trpc:e},deps:n})=>{const s=Cne(n),i=await t.query({...e.review.importForm.queryOptions(s),staleTime:"static"});if(!i.startsAtOnce)return{importId:i.isImporting?i.importId:null,refusal:null};const o=await t.getMutationCache().build(t,e.review.import.mutationOptions()).execute(s);return await t.invalidateQueries(e.review.importForm.pathFilter()),{importId:o.importId,refusal:o.importId===null?o.message:null}},component:Dn(Nne,"component")}),Qo="rounded-sm bg-muted motion-safe:animate-pulse",One=()=>{const t=ee.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"col-span-2 border-b pb-3",children:b.jsx("div",{className:`h-5 w-64 ${Qo}`})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=b.jsxs("div",{className:"flex flex-col gap-4 pt-6",children:[b.jsx("div",{className:`h-5 w-28 ${Qo}`}),b.jsx("div",{className:`h-5 w-40 ${Qo}`}),b.jsx("div",{className:`h-5 w-32 ${Qo}`}),b.jsx("div",{className:`h-5 w-36 ${Qo}`})]}),t[1]=n):n=t[1];let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=b.jsxs("div",{"aria-busy":"true","aria-label":"Opening the review",className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8 px-6 pt-4",children:[e,n,b.jsxs("div",{className:"flex flex-col gap-3 pt-6",children:[b.jsx("div",{className:`h-6 w-32 ${Qo}`}),b.jsx("div",{className:`h-5 w-full max-w-[70ch] ${Qo}`}),b.jsx("div",{className:`h-5 w-full max-w-[64ch] ${Qo}`}),b.jsx("div",{className:`h-5 w-full max-w-[52ch] ${Qo}`}),b.jsx("div",{className:`mt-8 h-64 w-full ${Qo}`})]})]}),t[2]=s):s=t[2],s},Rne={blue:"[--line:var(--line-blue)]",green:"[--line:var(--line-green)]",magenta:"[--line:var(--line-magenta)]",violet:"[--line:var(--line-violet)]",teal:"[--line:var(--line-teal)]",lime:"[--line:var(--line-lime)]"},kne={...Rne,primary:"[--line:var(--primary)]"},Ane=t=>{const e=ee.c(4),{lineColor:n}=t,s=kne[n];let i;e[0]!==s?(i=Se("pointer-events-none absolute inset-x-0 bottom-0 h-1 bg-(--line)",s),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==i?(o=b.jsx("span",{"aria-hidden":"true",className:i}),e[2]=i,e[3]=o):o=e[3],o},n8=3,_ne=1,jf=2,C3=.5,Mne=.3,Lne=1.5,eS={added:"var(--diff-added)",modified:"var(--line-blue)",deleted:"var(--diff-removed)"},s8=t=>(t+n8+_ne)*jf,r_=t=>t==="plain",Ine=t=>Math.max(Lne,t*Mne),i8=({centre:t,radius:e})=>{const n=e*C3;return`M${String(t-n)} ${String(t)}h${String(n*jf)}`},Dne=t=>{const e=t.radius*C3;return`${i8(t)}M${String(t.centre)} ${String(t.centre-e)}v${String(e*jf)}`},jne=({centre:t,radius:e})=>{const n=e*C3,s=n*jf;return`M${String(t-n)} ${String(t-n)}l${String(s)} ${String(s)}m0 ${String(-s)}l${String(-s)} ${String(s)}`},Pne=({centre:t,radius:e})=>`M${String(t)} ${String(t-e)}a${String(e)} ${String(e)} 0 0 1 0 ${String(e*jf)}z`,tS=t=>{const e=ee.c(5),{path:n,radius:s}=t;let i;e[0]!==s?(i=Ine(s),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=b.jsx("path",{d:n,strokeWidth:i,className:"fill-none stroke-background [stroke-linecap:round]"}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o},nS=t=>{const e=ee.c(12),{shape:n,ink:s,children:i}=t,{centre:o,radius:r}=n,a=i===void 0?null:i;let c;e[0]!==o||e[1]!==s||e[2]!==r?(c=b.jsx("circle",{cx:o,cy:o,r,fill:s}),e[0]=o,e[1]=s,e[2]=r,e[3]=c):c=e[3];const d=r+n8;let f;e[4]!==o||e[5]!==s||e[6]!==d?(f=b.jsx("circle",{cx:o,cy:o,r:d,stroke:s,className:"fill-none [stroke-width:1.5]"}),e[4]=o,e[5]=s,e[6]=d,e[7]=f):f=e[7];let p;return e[8]!==a||e[9]!==c||e[10]!==f?(p=b.jsxs(b.Fragment,{children:[c,f,a]}),e[8]=a,e[9]=c,e[10]=f,e[11]=p):p=e[11],p},zne=(t,e)=>{const{centre:n,radius:s}=e;switch(t){case"added":return b.jsx(nS,{shape:e,ink:eS.added,children:b.jsx(tS,{path:Dne(e),radius:s})});case"modified":return b.jsx(nS,{shape:e,ink:eS.modified});case"deleted":return b.jsx(nS,{shape:e,ink:eS.deleted,children:b.jsx(tS,{path:i8(e),radius:s})});case"breaks":return b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:n,cy:n,r:s,className:"fill-destructive"}),b.jsx(tS,{path:jne(e),radius:s})]});case"behaviour-changes":return b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:n,cy:n,r:s,className:"fill-background stroke-foreground [stroke-width:2]"}),b.jsx("path",{d:Pne(e),className:"fill-foreground"})]});case"plain":return b.jsx("circle",{cx:n,cy:n,r:s,className:"fill-muted-foreground"})}},N3=t=>{const e=ee.c(12),{mark:n,radius:s,className:i}=t,o=s8(s),r=`0 0 ${String(o)} ${String(o)}`;let a;e[0]!==i?(a=Se("shrink-0",i),e[0]=i,e[1]=a):a=e[1];const c=o/jf;let d;e[2]!==n||e[3]!==s||e[4]!==c?(d=zne(n,{centre:c,radius:s}),e[2]=n,e[3]=s,e[4]=c,e[5]=d):d=e[5];let f;return e[6]!==n||e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==d?(f=b.jsx("svg",{"aria-hidden":"true",width:o,height:o,viewBox:r,"data-mark":n,className:a,children:d}),e[6]=n,e[7]=o,e[8]=r,e[9]=a,e[10]=d,e[11]=f):f=e[11],f},o8=_.createContext(void 0);function Za(t){const e=_.useContext(o8);if(!t&&e===void 0)throw new Error(yn(27));return e}const Bne=_.forwardRef(function(e,n){const{render:s,className:i,style:o,forceRender:r=!1,...a}=e,c=Za(),d=c.useState("open"),f=c.useState("nested"),p=c.useState("mounted"),m=c.useState("transitionStatus");return Qt("div",e,{state:{open:d,transitionStatus:m},ref:[c.context.backdropRef,n],stateAttributesMapping:ym,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:r||!f})}),T3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,disabled:r=!1,nativeButton:a=!0,...c}=e,d=Za(),f=d.useState("open"),{getButtonProps:p,buttonRef:m}=Cu({disabled:r,native:a}),g={disabled:r};function y(v){f&&d.setOpen(!1,xt(kj,v.nativeEvent))}return Qt("button",e,{state:g,ref:[n,m],props:[{onClick:y},c,p]})}),$ne=_.forwardRef(function(e,n){const{render:s,className:i,style:o,id:r,...a}=e,c=Za(),d=di(r);return c.useSyncedValueWithCleanup("descriptionElementId",d),Qt("p",e,{ref:n,props:[{id:d},a]})}),r8=_.createContext(void 0);function Fne(){const t=_.useContext(r8);if(t===void 0)throw new Error(yn(26));return t}const Hne="--nested-dialogs",Une="data-nested-dialog-open",Vne={...Lf,...mm,nestedDialogOpen(t){return t?{[Une]:""}:null}},l8=_.forwardRef(function(e,n){const{render:s,className:i,style:o,finalFocus:r,initialFocus:a,...c}=e,d=Za(),f=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),g=d.useState("popupProps"),y=d.useState("modal"),v=d.useState("mounted"),S=d.useState("nested"),w=d.useState("nestedOpenDialogCount"),N=d.useState("open"),C=d.useState("openMethod"),T=d.useState("titleElementId"),R=d.useState("transitionStatus"),A=d.useState("role"),k=m.useState("floatingId");Fne(),Xa({open:N,ref:d.context.popupRef,onComplete(){var B,I;N&&((I=(B=d.context).onOpenChangeComplete)==null||I.call(B,!0))}});const M=a===void 0?SP(d.context.popupRef):a,L=w>0,j=d.useStateSetter("popupElement"),P=Qt("div",e,{state:{open:N,nested:S,transitionStatus:R,nestedDialogOpen:L},props:[g,{id:k,"aria-labelledby":T,"aria-describedby":f,role:A,...Nm,hidden:!v,onKeyDown(B){fb.has(B.key)&&B.stopPropagation()},style:{[Hne]:w}},c],ref:[n,d.context.popupRef,j],stateAttributesMapping:Vne});return b.jsx(l3,{context:m,openInteractionType:C,disabled:!v,closeOnFocusOut:!p,initialFocus:M,returnFocus:r,modal:y!==!1,restoreFocus:"popup",children:P})}),a8=_.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e,o=Za(),r=o.useState("mounted"),a=o.useState("modal"),c=o.useState("open");return r||s?b.jsx(r8.Provider,{value:s,children:b.jsxs(i3,{ref:n,...i,children:[r&&a===!0&&b.jsx(x3,{ref:o.context.internalBackdropRef,inert:y3(!c)}),e.children]})}):null});function qne({store:t,parentContext:e,isDrawer:n}){const s=t.useState("open"),i=t.useState("disablePointerDismissal"),o=t.useState("modal"),r=t.useState("popupElement"),a=t.useState("floatingRootContext"),[c,d]=_.useState(0),[f,p]=_.useState(0),m=c===0,g=Em(a,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(y){if(!t.context.outsidePressEnabledRef.current||"button"in y&&y.button!==0)return!1;if("touches"in y){if(y.type==="touchend"){if(y.changedTouches.length!==1||y.touches.length!==0)return!1}else if(y.touches.length!==1)return!1}const v=Ps(y);if(m&&!i){if(o){const S=t.context.internalBackdropRef.current,w=t.context.backdropRef.current;return S||w?S===v||w===v||at(v,r)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:m});return MP(s&&o===!0,r),t.useContextCallback("onNestedDialogOpen",(y,v)=>{d(y),p(v)}),Ue(()=>(e!=null&&e.onNestedDialogOpen&&(s?e.onNestedDialogOpen(c+1,f+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e!=null&&e.onNestedDialogOpen&&s&&e.onNestedDialogOpen(0,0)}),[n,s,c,f,e]),Am(t,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:f}),null}const Wne={...Mm,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class Gne extends Ou{constructor(n,s,i){const o=new Df,r=Kne(n,o,s,i);super(r,Yne(o),Wne);Ut(this,"setOpen",(n,s)=>{var i,o;s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),(o=(i=this.context).onOpenChange)==null||o.call(i,n,s),!s.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,s),this.update(cb(this.state,n,s.trigger)))})}}function Kne(t,e,n,s=!1){return{..._m(e,n,s),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function Yne(t){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Xne(t,e){const{children:n,open:s,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:r,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:d,handle:f,triggerId:p,defaultTriggerId:m=null}=e,g=t==="drawer",y=c,v=a,S="dialog",w=Za(!0),N=w!=null,C={modal:y,disablePointerDismissal:v,nested:N,role:S},T=ab((j,D)=>new Gne({open:i,openProp:s,activeTriggerId:m,triggerIdProp:p,...C},j,D),!0);T.useControlledProp("openProp",s),T.useControlledProp("triggerIdProp",p),T.useSyncedValues(C),T.useContextCallback("onOpenChange",o),T.useContextCallback("onOpenChangeComplete",r);const R=T.useState("open"),A=T.useState("mounted"),k=T.useState("payload");CP(T,R),Rm(T);const{forceUnmount:M}=km(R,T);_.useImperativeHandle(d,()=>({unmount:M,close:()=>T.setOpen(!1,xt(cu))}),[M,T]);const L=R||A;return b.jsxs(o8.Provider,{value:T,children:[f&&b.jsx(Tm,{handle:f,store:T}),L&&b.jsx(qne,{store:T,parentContext:w==null?void 0:w.context,isDrawer:g}),typeof n=="function"?n({payload:k}):n]})}const c8=If(function(e){return Xne("dialog",e)}),Qne=_.forwardRef(function(e,n){const{render:s,className:i,style:o,id:r,...a}=e,c=Za(),d=di(r);return c.useSyncedValueWithCleanup("titleElementId",d),Qt("h2",e,{ref:n,props:[{id:d},a]})}),Zne=Cm(function(e,n){const{render:s,className:i,style:o,disabled:r=!1,nativeButton:a=!0,id:c,payload:d,handle:f,...p}=e,m=Za(!0),y=Lm(f)??m;if(!y)throw new Error(yn(79));const v=di(c),S=y.useState("floatingRootContext"),w=y.useState("isOpenedByTrigger",v),N=y.useState("triggerPopupId",v),C=_.useRef(null),{registerTrigger:T,isMountedByThisTrigger:R}=Om(v,C,y,{payload:d}),{getButtonProps:A,buttonRef:k}=Cu({disabled:r,native:a}),M=rb(S),L=w3(()=>y.select("open"),P=>{y.set("openMethod",P)}),j={disabled:r,open:w},D=y.useState("triggerProps",R);return Qt("button",e,{state:j,ref:[k,n,T,C],props:[M.reference,D,L,{[s3]:"",id:v,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":N},p,A],stateAttributesMapping:gm})}),u8="data-composite-item-active";function Jne(t){const{loopFocus:e=!0,orientation:n="both",grid:s,onLoop:i,direction:o,highlightedIndex:r,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:d=!1,stopEventPropagation:f,disabledIndices:p,modifierKeys:m=Ha}=t,[g,y]=_.useState(0),v=s!=null,S=_.useRef(null),w=Fa(S,c),N=_.useRef([]),C=_.useRef(!1),T=_.useRef(null),R=r??g,A=Ye((D,P=!1)=>{if(T.current=N.current[D]??null,(a??y)(D),P){const B=N.current[D];WA(S.current,B,o,n)}}),k=Ye(D=>{var F;if(D.size===0)return;if(C.current){const z=N.current,U=z.indexOf(T.current);if(U===-1){const H=z[R];!H||Fd(z,R,p)?A(ese(z,p)):T.current=H}else U!==R&&A(U);return}C.current=!0;const P=Array.from(D.keys()),B=P.find(z=>z==null?void 0:z.hasAttribute(u8))??null,I=B?((F=D.get(B))==null?void 0:F.index)??-1:-1;if(I!==-1)A(I);else if(Fd(P,R,p)){const z=Kr(P,{disabledIndices:p});fp(P,z)||A(z)}WA(S.current,B,o,n)});Ue(()=>{if(p==null||r!=null||!C.current)return;const D=N.current;if(Fd(D,R,p)){const P=Kr(D,{disabledIndices:p});fp(D,P)||A(P)}},[p,r,R,N,A]);const M=Ye((D,P,B)=>i?i(D,P,B,N):B),L=Ye(D=>{const P=D.key===zw||D.key===Bw;if(!fb.has(D.key)||!d&&P||tse(D,m)||!S.current)return;const I=o==="rtl",F=I?jw:Pw,z=I?Pw:jw,U=n==="vertical"?Dw:F,H=n==="vertical"?Iw:z,V=Ps(D.nativeEvent);if(V!=null&&qA(V)&&!Wee(V)){const X=V.selectionStart,Z=V.selectionEnd,te=V.value;if(X==null||D.shiftKey||X!==Z||D.key!==H&&X<te.length||D.key!==U&&X>0)return}let W=R;const G=w1(N,p),Y=kw(N,p);s!=null&&(W=s({disabledIndices:p,elementsRef:N,event:D,highlightedIndex:R,loopFocus:e,maxIndex:Y,minIndex:G,onLoop:M,orientation:n,rtl:I}));const J=n!=="vertical"&&D.key===F||n!=="horizontal"&&D.key===Dw,q=n!=="vertical"&&D.key===z||n!=="horizontal"&&D.key===Iw;d&&(D.key===zw?W=G:D.key===Bw&&(W=Y)),W===R&&(J||q)&&(e&&W===Y&&J?(W=G,i&&(W=i(D,R,W,N))):e&&W===G&&q?(W=Y,i&&(W=i(D,R,W,N))):W=Kr(N.current,{startingIndex:W,decrement:q,disabledIndices:p})),W!==R&&!fp(N.current,W)&&(f&&D.stopPropagation(),(v||P||J||q)&&D.preventDefault(),A(W,!0),queueMicrotask(()=>{var X;(X=N.current[W])==null||X.focus()}))});return{props:{ref:w,onFocus(D){const P=S.current,B=Ps(D.nativeEvent);!P||B==null||!qA(B)||B.setSelectionRange(0,B.value.length)},onKeyDown:L},highlightedIndex:R,onHighlightedIndexChange:A,elementsRef:N,onMapChange:k,relayKeyboardEvent:L}}function ese(t,e){let n=-1;for(let s=0;s<t.length;s+=1){const i=t[s];if(!(!i||Fd(t,s,e))){if(i.hasAttribute(u8))return s;n===-1&&(n=s)}}return Math.max(n,0)}function tse(t,e){for(const n of iee)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function nse(t){const{render:e,className:n,style:s,refs:i=Ha,props:o=Ha,state:r=Ln,stateAttributesMapping:a,highlightedIndex:c,onHighlightedIndexChange:d,orientation:f,grid:p,loopFocus:m,onLoop:g,enableHomeAndEndKeys:y,onMapChange:v,stopEventPropagation:S=!0,rootRef:w,disabledIndices:N,modifierKeys:C,highlightItemOnHover:T=!1,tag:R="div",...A}=t,k=b3(),{props:M,highlightedIndex:L,onHighlightedIndexChange:j,elementsRef:D,onMapChange:P,relayKeyboardEvent:B}=Jne({grid:p,loopFocus:m,onLoop:g,orientation:f,highlightedIndex:c,onHighlightedIndexChange:d,rootRef:w,stopEventPropagation:S,enableHomeAndEndKeys:y,direction:k,disabledIndices:N,modifierKeys:C}),I=Qt(R,t,{state:r,ref:i,props:[M,...o,A],stateAttributesMapping:a}),F=_.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:j,highlightItemOnHover:T,relayKeyboardEvent:B}),[L,j,T,B]);return b.jsx(tD.Provider,{value:F,children:b.jsx(AP,{elementsRef:D,onMapChange:z=>{v==null||v(z),P(z)},children:I})})}const sse="data-has-submenu-open",ise={hasSubmenuOpen(t){return t?{[sse]:""}:null}},ose=_.forwardRef(function(e,n){const{orientation:s="horizontal",loopFocus:i=!0,render:o,className:r,modal:a=!0,disabled:c=!1,id:d,style:f,...p}=e,[m,g]=_.useState(null),[y,v]=_.useState(!1),S=di(d),w={orientation:s,modal:a,hasSubmenuOpen:y},N=_.useRef(null),C=_.useRef(!1),T=_.useMemo(()=>({contentElement:m,setContentElement:g,setHasSubmenuOpen:v,hasSubmenuOpen:y,modal:a,disabled:c,orientation:s,allowMouseUpTriggerRef:C,rootId:S}),[m,y,a,c,s,S]);return b.jsx(IP.Provider,{value:T,children:b.jsx(ob,{children:b.jsx(rse,{children:b.jsx(nse,{render:o,className:r,style:f,state:w,stateAttributesMapping:ise,refs:[n,g,N],props:[{role:"menubar",id:S,"aria-orientation":s},p],orientation:s,loopFocus:i,enableHomeAndEndKeys:!0,highlightItemOnHover:y})})})})});function rse(t){const e=wm(),{events:n}=ml(),s=S3();return _.useEffect(()=>{function i(o){!o.nodeId||o.parentNodeId!==e||(o.open?s.hasSubmenuOpen||s.setHasSubmenuOpen(!0):o.reason!==_d&&o.reason!==Ip&&s.setHasSubmenuOpen(!1))}return n.on("menuopenchange",i),()=>{n.off("menuopenchange",i)}},[n,e,s]),b.jsx(ib,{id:e,children:t.children})}const O3="relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none data-highlighted:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",d8="z-50 max-h-(--available-height) min-w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0";function f8(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("flex items-center",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(ose,{"data-slot":"menubar",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function h8(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(E3,{"data-slot":"menubar-menu",...n}),e[2]=n,e[3]=s):s=e[3],s}function p8(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx($P,{"data-slot":"menubar-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function m8(t){const e=ee.c(18);let n,s,i,o,r,a;e[0]!==t?({align:i,alignOffset:o,side:r,sideOffset:a,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=r,e[6]=a):(n=e[1],s=e[2],i=e[3],o=e[4],r=e[5],a=e[6]);const c=i===void 0?"start":i,d=o===void 0?0:o,f=r===void 0?"bottom":r,p=a===void 0?8:a;let m;e[7]!==n?(m=Se(d8,n),e[7]=n,e[8]=m):m=e[8];let g;e[9]!==s||e[10]!==m?(g=b.jsx(m3,{"data-slot":"menubar-content",className:m,...s}),e[9]=s,e[10]=m,e[11]=g):g=e[11];let y;return e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==p||e[16]!==g?(y=b.jsx(g3,{children:b.jsx(v3,{className:"isolate z-50 outline-none",align:c,alignOffset:d,side:f,sideOffset:p,children:g})}),e[12]=c,e[13]=d,e[14]=f,e[15]=p,e[16]=g,e[17]=y):y=e[17],y}function pp(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(ZQ,{"data-slot":"menubar-group",...n}),e[2]=n,e[3]=s):s=e[3],s}function mp(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("truncate px-2 pt-2 pb-1 text-xs text-muted-foreground",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(JQ,{"data-slot":"menubar-label",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function lse(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se(O3,n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(zj,{"data-slot":"menubar-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function ase(t){const e=ee.c(13);let n,s,i,o;e[0]!==t?({className:i,children:s,checked:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o):(n=e[1],s=e[2],i=e[3],o=e[4]);let r;e[5]!==i?(r=Se(O3,"group/checkbox",i),e[5]=i,e[6]=r):r=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx("span",{className:"pointer-events-none flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card group-data-checked/checkbox:border-(--line,var(--primary-text)) group-data-checked/checkbox:bg-(--line,var(--primary-text)) group-data-checked/checkbox:text-line-foreground","data-slot":"menubar-checkbox-item-indicator",children:b.jsx(jj,{children:b.jsx(Nu,{className:"size-3",strokeWidth:3})})}),e[7]=a):a=e[7];let c;return e[8]!==n||e[9]!==s||e[10]!==o||e[11]!==r?(c=b.jsxs(Dj,{"data-slot":"menubar-checkbox-item",className:r,checked:n,...o,children:[a,s]}),e[8]=n,e[9]=s,e[10]=o,e[11]=r,e[12]=c):c=e[12],c}function Fw(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("-mx-1 my-1 h-px bg-border",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(FP,{"data-slot":"menubar-separator",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function g8(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(zee,{"data-slot":"menubar-sub",...n}),e[2]=n,e[3]=s):s=e[3],s}function y8(t){const e=ee.c(11);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let o;e[4]!==s?(o=Se(O3,"data-popup-open:bg-muted",s),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=b.jsx(Gy,{"aria-hidden":"true",className:"ml-auto size-4 text-muted-foreground"}),e[6]=r):r=e[6];let a;return e[7]!==n||e[8]!==i||e[9]!==o?(a=b.jsxs(Kee,{"data-slot":"menubar-sub-trigger",className:o,...i,children:[n,r]}),e[7]=n,e[8]=i,e[9]=o,e[10]=a):a=e[10],a}function b8(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se(d8,n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(g3,{children:b.jsx(v3,{className:"isolate z-50 outline-none",side:"right",align:"start",sideOffset:4,alignOffset:-4,children:b.jsx(m3,{"data-slot":"menubar-sub-content",className:i,...s})})}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function x8(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("inline-grid h-[1.125rem] min-w-[1.125rem] place-items-center rounded-sm border border-b-2 border-current/35 px-1 font-mono text-[0.6875rem] leading-none font-bold uppercase opacity-80",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx("kbd",{"data-slot":"menubar-shortcut",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}const l_=t=>{let e;const n=new Set,s=(d,f)=>{const p=typeof d=="function"?d(e):d;if(!Object.is(p,e)){const m=e;e=f??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(g=>g(e,m))}},i=()=>e,a={setState:s,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=e=t(s,i,a);return a},R3=(t=>t?l_(t):l_),cse=t=>t;function oo(t,e=cse){const n=Oo.useSyncExternalStore(t.subscribe,Oo.useCallback(()=>e(t.getState()),[t,e]),Oo.useCallback(()=>e(t.getInitialState()),[t,e]));return Oo.useDebugValue(n),n}function v8(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var o;const r=c=>c===null?null:JSON.parse(c,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(r):r(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Hw=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Hw(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Hw(s)(n)}}}},use=(t,e)=>(n,s,i)=>{let o={storage:v8(()=>window.localStorage),partialize:S=>S,version:0,merge:(S,w)=>({...w,...S}),...e},r=!1,a=0;const c=new Set,d=new Set;let f=o.storage;if(!f)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...S)},s,i);const p=()=>{const S=o.partialize({...s()});return f.setItem(o.name,{state:S,version:o.version})},m=i.setState;i.setState=(S,w)=>(m(S,w),p());const g=t((...S)=>(n(...S),p()),s,i);i.getInitialState=()=>g;let y;const v=()=>{var S,w;if(!f)return;const N=++a;r=!1,c.forEach(T=>{var R;return T((R=s())!=null?R:g)});const C=((w=o.onRehydrateStorage)==null?void 0:w.call(o,(S=s())!=null?S:g))||void 0;return Hw(f.getItem.bind(f))(o.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==o.version){if(o.migrate){const R=o.migrate(T.state,T.version);return R instanceof Promise?R.then(A=>[!0,A]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var R;if(N!==a)return;const[A,k]=T;if(y=o.merge(k,(R=s())!=null?R:g),n(y,!0),A)return p()}).then(()=>{N===a&&(C==null||C(s(),void 0),y=s(),r=!0,d.forEach(T=>T(y)))}).catch(T=>{N===a&&(C==null||C(void 0,T))})};return i.persist={setOptions:S=>{o={...o,...S},S.storage&&(f=S.storage)},clearStorage:()=>{++a,f==null||f.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>v(),hasHydrated:()=>r,onHydrate:S=>(c.add(S),()=>{c.delete(S)}),onFinishHydration:S=>(d.add(S),()=>{d.delete(S)})},o.skipHydration||v(),y||g},dse=use,S8="teammate",fse=864e5,hse={firstSeenAt:null,isOff:!1,tooltips:{},deferredAt:{},actions:{}},pse={clickCount:0,hoverCount:0,firstClickedAt:null,firstHoveredAt:null},w8="click",mse=1,gse="days",yse=["viewVisible","tooltipDependent","preFeatureUse","postFeatureUse","dayBound","tooltipAndDay","reviewMode","dependsOnValues","userDeferred"],E8=t=>"actionIds"in t?t:{actionIds:t},k3=(t,e)=>t.actions[e]??pse,bse=(t,e)=>e==="click"?t.clickCount:e==="hover"?t.hoverCount:t.clickCount+t.hoverCount,xse=(t,e)=>{if(e==="click")return t.firstClickedAt;if(e==="hover")return t.firstHoveredAt;const n=[t.firstClickedAt,t.firstHoveredAt].filter(s=>s!==null);return n.length===0?null:Math.min(...n)},gb=(t,e,n,s)=>{var i,o;return((o=(i=t.tooltips[e])==null?void 0:i[n])==null?void 0:o[s])===!0},Uw=(t,e,n,s)=>{const{actionIds:i,use:o=w8,times:r=mse}=E8(s);return i.some(c=>gb(t,e,n,c))?!0:i.reduce((c,d)=>c+bse(k3(t,d),o),0)>=r},vse=(t,e)=>{const{actionIds:n,use:s=w8}=E8(e),i=n.map(o=>xse(k3(t,o),s)).filter(o=>o!==null);return i.length===0?null:Math.min(...i)},Sse=(t,e,n,s)=>{const i=k3(t,e),o=n==="click"?{...i,clickCount:i.clickCount+1,firstClickedAt:i.firstClickedAt??s}:{...i,hoverCount:i.hoverCount+1,firstHoveredAt:i.firstHoveredAt??s};return{...t,actions:{...t.actions,[e]:o}}},C8=(t,e,n)=>{const s=t.tooltips[e]??{},i=Object.fromEntries(yse.flatMap(o=>{const r=n[o];return r===void 0?[]:[[o,{...s[o],...r}]]}));return{...t,tooltips:{...t.tooltips,[e]:{...s,...i}}}},wse=(t,e,n,s)=>({...C8(t,e,{userDeferred:{[n]:!0}}),deferredAt:{...t.deferredAt,[e]:t.deferredAt[e]??s}}),Ese=(t,e)=>t.firstSeenAt===null?{...t,firstSeenAt:e}:t,N8=(t,e)=>{var n;return Object.values(((n=t.tooltips[e])==null?void 0:n.userDeferred)??{}).some(s=>s)},T8=(t,e,n)=>N8(t,e)||(n==null?void 0:n.preFeatureUse)!==void 0&&Uw(t,e,"preFeatureUse",n.preFeatureUse),Cse=(t,e,n)=>{if(!T8(t,e,n))return null;const s=[t.deferredAt[e]??null,(n==null?void 0:n.preFeatureUse)===void 0?null:vse(t,n.preFeatureUse)].filter(i=>i!==null);return s.length===0?t.firstSeenAt:Math.min(...s)},O8=(t,e,n)=>t!==null&&n-t>=e*fse,Nse=(t,e,n,s)=>n.some(i=>s.visibleViewIds.includes(i)||gb(t,e,"viewVisible",i)),R8=(t,e,n,s,i)=>s.every(o=>gb(t,e,n,o)||T8(t,o,i.triggersById[o])),Tse=(t,e,n,s)=>{if(!R8(t,e,"tooltipAndDay",n.tooltipDependent,s))return!1;const i=n.tooltipDependent.map(r=>Cse(t,r,s.triggersById[r])),o=i.some(r=>r===null)?null:Math.max(...i.filter(r=>r!==null));return O8(o,n.dayBound,s.now)},Ose=t=>Object.values(t).every(e=>e),Rse=(t,e,n,s)=>[["userDeferred",!N8(t,e)],["viewVisible",n.viewVisible===void 0||Nse(t,e,n.viewVisible,s)],["tooltipDependent",n.tooltipDependent===void 0||R8(t,e,"tooltipDependent",n.tooltipDependent,s)],["preFeatureUse",n.preFeatureUse===void 0||!Uw(t,e,"preFeatureUse",n.preFeatureUse)],["postFeatureUse",n.postFeatureUse===void 0||Uw(t,e,"postFeatureUse",n.postFeatureUse)],["dayBound",n.dayBound===void 0||gb(t,e,"dayBound",gse)||O8(t.firstSeenAt,n.dayBound,s.now)],["tooltipAndDay",n.tooltipAndDay===void 0||Tse(t,e,n.tooltipAndDay,s)],["reviewMode",(n.reviewMode??S8)===s.reviewMode],["dependsOnValues",n.dependsOnValues===void 0||Ose(n.dependsOnValues)]].filter(([,o])=>!o).map(([o])=>o),kse=(t,e,n,s)=>!t.isOff&&Rse(t,e,n,s).length===0,Ase="flightplan-guide-tooltips",_se=1,Mse=t=>{try{return window.localStorage.getItem(t)}catch{return null}},Lse=(t,e)=>{try{return window.localStorage.setItem(t,e),!0}catch{return!1}},Ise=t=>{try{return window.localStorage.removeItem(t),!0}catch{return!1}},Dse={getItem:Mse,setItem:Lse,removeItem:Ise},Fh=t=>({firstSeenAt:t.firstSeenAt,isOff:t.isOff,tooltips:t.tooltips,deferredAt:t.deferredAt,actions:t.actions}),jse=(t,e)=>Object.fromEntries(Object.entries(t).filter(([n])=>n!==e)),Pse=(t,e)=>t.includes(e)?t:[...t,e],zse=(t,e)=>t.length===e.length&&t.every((n,s)=>n===e[s]),Ds=R3()(dse((t,e)=>({...hse,visibleViewIds:[],reviewMode:S8,triggersById:{},shownTooltipIds:[],sendEvent:(n,s)=>{if(n==="view"){t(i=>({visibleViewIds:Pse(i.visibleViewIds,s)}));return}t(i=>Sse(Fh(i),s,n==="user-action"?"click":"hover",Date.now()))},updateTooltipState:(n,s)=>{t(i=>C8(Fh(i),n,s))},deferTooltip:(n,s)=>{t(i=>wse(Fh(i),n,s,Date.now()))},turnTipsOff:()=>{t({isOff:!0})},recordFirstVisit:()=>{e().firstSeenAt===null&&t(n=>Ese(Fh(n),Date.now()))},setVisibleViewIds:n=>{zse(e().visibleViewIds,n)||t({visibleViewIds:n})},setReviewMode:n=>{t({reviewMode:n})},registerTriggers:(n,s)=>{t(i=>({triggersById:{...i.triggersById,[n]:s}}))},unregisterTriggers:n=>{t(s=>({triggersById:jse(s.triggersById,n)}))},showTooltip:n=>{t(s=>({shownTooltipIds:[...s.shownTooltipIds.filter(i=>i!==n),n]}))},hideTooltip:n=>{t(s=>({shownTooltipIds:s.shownTooltipIds.filter(i=>i!==n)}))}}),{name:Ase,version:_se,storage:v8(()=>Dse),partialize:Fh})),k8=1500,Bse=6e4,$se="[data-user-action-id]",Fse="data-user-action-id",a_=["scroll","wheel","keydown","pointerdown"],Hse="[data-guide-tooltip]",Use=["Enter","Escape"],Vse=()=>{const t=ee.c(2),[e,n]=_.useState(Qse);let s,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{const o=setInterval(()=>{n(Date.now())},Bse);return()=>{clearInterval(o)}},i=[],t[0]=s,t[1]=i):(s=t[0],i=t[1]),_.useEffect(s,i),e},qse=t=>t instanceof Element&&t.closest(Hse)!==null,Wse=t=>t instanceof KeyboardEvent&&Use.includes(t.key)&&Ds.getState().shownTooltipIds.length>0,Gse=t=>!qse(t.target)&&!Wse(t),Kse=(t,e)=>{const n=ee.c(4),[s,i]=_.useState(!1),o=_.useRef(null);let r,a;return n[0]!==t||n[1]!==e?(r=()=>{if(!t)return;const c=()=>{i(!0)},d=()=>{o.current!==null&&clearTimeout(o.current),o.current=setTimeout(c,e)},f=p=>{Gse(p)&&(i(!1),d())};return d(),a_.forEach(p=>{window.addEventListener(p,f,{capture:!0,passive:!0})}),()=>{a_.forEach(p=>{window.removeEventListener(p,f,{capture:!0})}),o.current!==null&&clearTimeout(o.current),o.current=null,i(!1)}},a=[t,e],n[0]=t,n[1]=e,n[2]=r,n[3]=a):(r=n[2],a=n[3]),_.useEffect(r,a),t&&s},Yse=(t,e)=>{const n=ee.c(18),{delay:s,triggers:i}=e,o=s===void 0?k8:s,r=Vse(),a=_.useRef(i);let c;n[0]!==i?(c=JSON.stringify(i),n[0]=i,n[1]=c):c=n[1];const d=c;let f;n[2]!==i?(f=()=>{a.current=i},n[2]=i,n[3]=f):f=n[3],_.useLayoutEffect(f);let p;n[4]!==t?(p=()=>(Ds.getState().registerTriggers(t,a.current),()=>{Ds.getState().unregisterTriggers(t)}),n[4]=t,n[5]=p):p=n[5];let m;n[6]!==t||n[7]!==d?(m=[t,d],n[6]=t,n[7]=d,n[8]=m):m=n[8],_.useEffect(p,m);let g;n[9]!==r||n[10]!==t||n[11]!==i?(g=N=>kse(N,t,i,{now:r,visibleViewIds:N.visibleViewIds,reviewMode:N.reviewMode,triggersById:N.triggersById}),n[9]=r,n[10]=t,n[11]=i,n[12]=g):g=n[12];const y=oo(Ds,g),v=Kse(y,o);let S;n[13]!==t?(S=N=>{Ds.getState().updateTooltipState(t,N)},n[13]=t,n[14]=S):S=n[14];let w;return n[15]!==v||n[16]!==S?(w={showTooltip:v,updateTooltipState:S},n[15]=v,n[16]=S,n[17]=w):w=n[17],w},Vw=t=>t instanceof Element?t.closest($se):null,A8=t=>(t==null?void 0:t.getAttribute(Fse))??null,_8=t=>{const e=A8(Vw(t.target));e!==null&&Ds.getState().sendEvent("user-action",e)},M8=t=>{const e=Vw(t.target);if(e===null||e===Vw(t.relatedTarget))return;const n=A8(e);n!==null&&Ds.getState().sendEvent("user-hover",n)},sS=t=>{t!==null&&Ds.getState().sendEvent("user-action",t)},Xse=t=>{const e=ee.c(4);let n,s;e[0]!==t?(n=()=>{Ds.getState().setReviewMode(t)},s=[t],e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]),_.useEffect(n,s);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[3]=i):i=e[3],_.useEffect(Jse,i)};function Qse(){return Date.now()}function Zse(){document.removeEventListener("click",_8,!0),document.removeEventListener("pointerover",M8,!0)}function Jse(){return Ds.getState().recordFirstVisit(),document.addEventListener("click",_8,!0),document.addEventListener("pointerover",M8,!0),Zse}const $0=0,c_=(t,e,n,s)=>Math.max(0,Math.min(e,s)-Math.max(t,n)),L8=(t,e)=>{const n=(t.bottom-t.top)*(t.right-t.left);return n<=0?0:c_(t.top,t.bottom,e.top,e.bottom)*c_(t.left,t.right,e.left,e.right)/n},I8=(t,e)=>L8(t,e)>0,eie=(t,e)=>t.reduce((n,s,i)=>{const o=L8(s,e);return o>n.share?{index:i,share:o}:n},{index:null,share:0}).index,tie=t=>t.placement==="dominant"||t.isOnScreen&&(t.placement==="inside-dominant"||t.placement==="free"),nie=t=>[...new Set(t.filter(tie).map(e=>e.viewId))],D8=()=>({top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}),qw=t=>{const{top:e,bottom:n,left:s,right:i}=t.getBoundingClientRect();return{top:e,bottom:n,left:s,right:i}},j8=(t,e,n)=>{const s=ee.c(6),i=n===void 0?"":n,o=_.useEffectEvent(e),r=_.useRef($0);let a;s[0]!==o||s[1]!==t?(a=()=>{if(!t)return;const d=()=>{r.current=$0,o()},f=()=>{r.current===$0&&(r.current=requestAnimationFrame(d))},p=new MutationObserver(f);return p.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("scroll",f,{passive:!0,capture:!0}),window.addEventListener("resize",f),f(),()=>{cancelAnimationFrame(r.current),r.current=$0,p.disconnect(),window.removeEventListener("scroll",f,{capture:!0}),window.removeEventListener("resize",f)}},s[0]=o,s[1]=t,s[2]=a):a=s[2];let c;s[3]!==t||s[4]!==i?(c=[t,i],s[3]=t,s[4]=i,s[5]=c):c=s[5],_.useEffect(a,c)},Ww="[data-view-section-id]",sie="data-view-section-id",iS=`
351
+ `,iie=(t,e)=>e!==""&&t.contains(document.getElementById(e)),oie=(t,e)=>e.has(t.id)||[...e].some(n=>iie(t,n)),rie=(t,e,n)=>{var i;return t===e?"dominant":(e==null?void 0:e.contains(t))===!0?"inside-dominant":(((i=t.parentElement)==null?void 0:i.closest(Ww))??null)===null&&!oie(t,n)?"free":"elsewhere"},lie=(t,e)=>{var i;const n=t===null?null:((i=document.getElementById(t))==null?void 0:i.closest(Ww))??null,s=D8();return[...document.querySelectorAll(Ww)].map(o=>({viewId:o.getAttribute(sie)??"",placement:rie(o,n,e),isOnScreen:I8(qw(o),s)}))},aie=(t,e)=>{const n=ee.c(5);let s;n[0]!==e?(s=e.join(iS),n[0]=e,n[1]=s):s=n[1];const i=s;let o;n[2]!==i||n[3]!==t?(o=()=>{const r=new Set(i.split(iS));Ds.getState().setVisibleViewIds(nie(lie(t,r)))},n[2]=i,n[3]=t,n[4]=o):o=n[4],j8(!0,o,`${t??""}${iS}${i}`)},rs=({key:t,actionId:e=null,label:n,shortLabel:s=null,description:i=null,isPressed:o=!1,isPrimary:r=!1,isDisabled:a=!1,disabledHint:c=null,onRun:d})=>({kind:"button",key:t,actionId:e,label:n,shortLabel:s,description:i,isPressed:o,isPrimary:r,isDisabled:a,disabledHint:c,onRun:d}),u_=t=>[t.id,t.label,t.detailLabel,t.detailTone,t.isChecked,t.isDisabled].join("|"),cie=t=>t.kind==="choice"?u_(t):["submenu",t.id,t.label,t.heading,t.valueLabel,...t.choices.map(u_)].join("|"),uie=t=>{var e;return t.kind==="position"?`position|${t.label}`:t.kind==="button"?["button",t.key,t.label,t.shortLabel,t.description,t.isPressed,t.isPrimary,t.isDisabled,t.disabledHint].join("|"):["menu",t.key,t.label,(e=t.badge)==null?void 0:e.label,t.heading,...t.itemGroups.flat().map(cie)].join("|")},P8=t=>t.map(e=>e.map(uie).join(`
352
+ `)).join(`
353
+
354
+ `),A3=(t,e)=>t.flat().find(n=>n.kind!=="position"&&n.key===e)??null,die={anchorId:null,share:0,height:0},fie=(t,e)=>Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top)),hie=(t,e)=>{const n=fie(t,e),s=n/Math.max(1,e.bottom-e.top),i=n/Math.max(1,t.bottom-t.top);return{anchorId:t.anchorId,share:Math.max(s,i),height:n}},pie=(t,e)=>t.share>e.share||t.share===e.share&&t.height>e.height,mie=(t,e)=>t.map(n=>hie(n,e)).filter(n=>n.height>0).reduce((n,s)=>pie(s,n)?s:n,die).anchorId,gie=t=>[...t.groups.flatMap(e=>e.sections.map(n=>n.anchorId)),...t.sections.map(e=>e.anchorId)],d_=t=>e=>({...e,isHere:e.anchorId===t}),yie=(t,e)=>{const n=t.groups.find(s=>s.sections.some(i=>i.anchorId===e))??t.groups.at(0)??null;return{heading:(n==null?void 0:n.label)??null,sections:((n==null?void 0:n.sections)??[]).map(d_(e)),otherGroups:t.groups.filter(s=>s!==n),looseSections:t.sections.map(d_(e))}},z8="a",_3="d",Pf="g",bie="ctrl+g",xie="Back",vie="Next",B8={back:null,next:null},Sie="Segment",wie=(t,e)=>`${Sie} (${String(t+1)}/${String(e)})`,Eie=t=>[...t.groups.flatMap((e,n)=>e.sections.map(s=>({section:s,segmentLabel:wie(n,t.groups.length)}))),...t.sections.map(e=>({section:e,segmentLabel:null}))],Cie=(t,e)=>t.segmentLabel!==e.segmentLabel&&t.segmentLabel!==null?t.segmentLabel:t.section.label,Nie={key:z8,prefix:xie,actionId:"back-section-action"},Tie={key:_3,prefix:vie,actionId:"next-section-action"},f_=({key:t,prefix:e,actionId:n},s,i,o)=>i===void 0?null:rs({key:t,actionId:n,label:`${e}: ${Cie(i,s)}`,shortLabel:e,onRun:()=>{o(i.section.anchorId)}}),$8=(t,e,n)=>{const s=Eie(t),i=s.findIndex(r=>r.section.anchorId===e);if(i===-1)return B8;const o=s[i];return{back:f_(Nie,o,s[i-1],n),next:f_(Tie,o,s[i+1],n)}},Oie=(t,e)=>{const n=[e.back,e.next].filter(s=>s!==null).filter(s=>A3(t,s.key)===null);return n.length===0?[...t]:[n,...t]},M3=_.createContext(null),yb=_.createContext(null),L3=(t,e)=>{const n=ee.c(13),s=_.use(M3),i=_.useRef(e);let o;n[0]!==e?(o=P8(e),n[0]=e,n[1]=o):o=n[1];const r=o;let a;n[2]!==e?(a=()=>{i.current=e},n[2]=e,n[3]=a):a=n[3],_.useLayoutEffect(a);let c,d;n[4]!==t||n[5]!==s?(c=()=>{if(!(s===null||t===null))return s.register(t,()=>i.current)},d=[s,t],n[4]=t,n[5]=s,n[6]=c,n[7]=d):(c=n[6],d=n[7]),_.useEffect(c,d);let f;n[8]!==s?(f=()=>{s==null||s.notify()},n[8]=s,n[9]=f):f=n[9];let p;n[10]!==s||n[11]!==r?(p=[s,r],n[10]=s,n[11]=r,n[12]=p):p=n[12],_.useEffect(f,p)},Rie=(t,e,n)=>{var d;const s=ee.c(7),i=((d=_.use(M3))==null?void 0:d.onFullScreenOwnerChange)??null,o=_.useRef(n);let r;s[0]!==n?(r=()=>{o.current=n},s[0]=n,s[1]=r):r=s[1],_.useLayoutEffect(r);let a,c;s[2]!==t||s[3]!==i||s[4]!==e?(a=()=>{if(!(i===null||t===null||!e))return i({anchorId:t,onLeave:()=>{o.current()}}),()=>{i(null)}},c=[i,t,e],s[2]=t,s[3]=i,s[4]=e,s[5]=a,s[6]=c):(a=s[5],c=s[6]),_.useEffect(a,c)},kie=t=>{const e=_.use(yb);return e===null?B8:$8(e.rail,t,e.onJump)},Aie="input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='searchbox'], [role='combobox']",_ie="[role='dialog']:not([data-navigator-scope]), [role='alertdialog']",Mie="[aria-modal='true']:not([data-navigator-scope])",Lie="ctrl+",Iie=t=>t instanceof Element&&t.closest(Aie)!==null,Die=t=>t instanceof Element&&t.closest(_ie)!==null,F8=t=>!t.defaultPrevented&&!t.repeat&&!t.isComposing&&!t.metaKey&&!t.altKey&&!Iie(t.target)&&!Die(t.target)&&document.querySelector(Mie)===null,jie=t=>t.ctrlKey?`${Lie}${t.key.toLowerCase()}`:t.key.toLowerCase(),Pie=56,zie="[data-pinned-row]",Bie={"data-pinned-row":""},I3=()=>Math.max(Pie,...[...document.querySelectorAll(zie)].map(t=>t.getBoundingClientRect().bottom)),Md="w",h_="Jump to",H8="jump-to-action",$ie="Review navigator",Fie="Here",Hie="Other segments",Uie=180,Vie=3e3,F0=0,Gw=`
355
+ `,qie=[[["↑","↓"],"move"],[["→"],"sections"],[["↵"],"jump"],[["esc"],"close"]],Wie=[[["↑","↓"],"move"],[["space"],"tick"],[["esc"],"close"]],Gie=[[["↑","↓"],"move"],[["→"],"open"],[["space"],"tick"],[["esc"],"close"]],Kie=new Map,Yie=[],bb="inline-flex h-[1.875rem] shrink-0 cursor-pointer items-center gap-1.5 rounded-[0.3rem] px-[0.4375rem] outline-none transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-45 aria-pressed:bg-sign-foreground aria-pressed:font-bold aria-pressed:text-sign data-[flash=true]:bg-sign-foreground/25",U8="bg-primary font-bold text-primary-foreground hover:bg-[color-mix(in_oklab,var(--primary)_88%,var(--primary-foreground))]",Xie="h-4 min-w-4 text-[0.625rem] normal-case",Qie={added:"font-semibold text-diff-added",modified:"font-semibold text-line-blue",deleted:"font-semibold text-diff-removed"},Zie=(t,e,n)=>new Map([...t,[e,n]]),Jie=(t,e,n)=>t.get(e)===n?new Map([...t].filter(([s])=>s!==e)):t,eoe=t=>t.flatMap(e=>{const n=document.getElementById(e);if(n===null)return[];const{top:s,bottom:i}=n.getBoundingClientRect();return[{anchorId:e,top:s,bottom:i}]}),toe=t=>{const e=ee.c(5),[n,s]=_.useState(null),i=_.useRef(F0);let o;e[0]!==t?(o=t.join(Gw),e[0]=t,e[1]=o):o=e[1];const r=o;let a,c;return e[2]!==r?(a=()=>{const d=r===""?[]:r.split(Gw),f=()=>{i.current=F0,s(mie(eoe(d),{top:I3(),bottom:window.innerHeight}))},p=()=>{i.current===F0&&(i.current=requestAnimationFrame(f))},m=new ResizeObserver(p);return m.observe(document.body),p(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),()=>{cancelAnimationFrame(i.current),i.current=F0,m.disconnect(),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},c=[r],e[2]=r,e[3]=a,e[4]=c):(a=e[3],c=e[4]),_.useEffect(a,c),n},p_=t=>{var e;(e=document.getElementById(t))==null||e.scrollIntoView({block:"start"})},noe=(t,{fullScreenOwner:e,onSectionJump:n},s)=>{if(s(null),n==null||n(t),e===null){p_(t);return}e.onLeave(),requestAnimationFrame(()=>{p_(t)})},soe=t=>{const e=ee.c(41),{rail:n,onSectionJump:s,children:i}=t,[o,r]=_.useState(null),[a,c]=_.useState(Kie),[d,f]=_.useState(null),[p,m]=_.useState(null),[g,y]=_.useState(null);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>({register:(Z,te)=>(c(Q=>Zie(Q,Z,te)),()=>{c(Q=>Jie(Q,Z,te))}),notify:()=>{c(Soe)},onFullScreenOwnerChange:f}),e[0]=v):v=e[0];const[S]=_.useState(v);let w;e[1]!==n?(w=gie(n),e[1]=n,e[2]=w):w=e[2];const N=w,C=toe(N),T=(d==null?void 0:d.anchorId)??C;aie(T,N);let R;if(e[3]!==T||e[4]!==a){const Z=T===null?void 0:a.get(T);R=(Z==null?void 0:Z())??Yie,e[3]=T,e[4]=a,e[5]=R}else R=e[5];const A=R;let k;e[6]!==d||e[7]!==s?(k={fullScreenOwner:d,onSectionJump:s},e[6]=d,e[7]=s,e[8]=k):k=e[8];const M=_.useRef(k);let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=()=>Z=>{noe(Z,M.current,m)},e[9]=L):L=e[9];const[j]=_.useState(L);let D;e[10]!==d||e[11]!==s?(D=()=>{M.current={fullScreenOwner:d,onSectionJump:s}},e[10]=d,e[11]=s,e[12]=D):D=e[12],_.useLayoutEffect(D);let P;e[13]!==T||e[14]!==j||e[15]!==n||e[16]!==A?(P=Oie(A,$8(n,T,j)),e[13]=T,e[14]=j,e[15]=n,e[16]=A,e[17]=P):P=e[17];const B=P;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=Z=>{y(Z),setTimeout(()=>{y(te=>te===Z?null:te)},Uie)},e[18]=I):I=e[18];const F=I;let z;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=Z=>{r(Z),setTimeout(()=>{r(te=>te===Z?null:te)},Vie)},e[19]=z):z=e[19];const U=z;let H;e[20]!==B||e[21]!==p?(H=Z=>{if(!F8(Z))return;const te=jie(Z);if(p!==null){if(te!==p)return;Z.preventDefault(),m(null);return}if(te===Md){Z.preventDefault(),F(te),m(Md),sS(H8);return}const Q=A3(B,te);Q!==null&&(Z.preventDefault(),F(te),Q.kind==="menu"?(m(Q.key),sS(Q.actionId??null)):Q.isDisabled?Q.disabledHint!==null&&U(Q.key):(Q.onRun(),sS(Q.actionId)))},e[20]=B,e[21]=p,e[22]=H):H=e[22];const V=_.useEffectEvent(H);let W;e[23]!==V?(W=()=>{const Z=te=>{V(te)};return window.addEventListener("keydown",Z,!0),()=>{window.removeEventListener("keydown",Z,!0)}},e[23]=V,e[24]=W):W=e[24];let G;e[25]===Symbol.for("react.memo_cache_sentinel")?(G=[],e[25]=G):G=e[25],_.useEffect(W,G);let Y;e[26]!==T||e[27]!==g||e[28]!==d||e[29]!==B||e[30]!==o||e[31]!==j||e[32]!==p||e[33]!==n?(Y={rail:n,dominantAnchorId:T,groups:B,fullScreenOwner:d,openMenuKey:p,flashedKey:g,hintedKey:o,onHintedKeyChange:r,onHint:U,onOpenMenuKeyChange:m,onJump:j},e[26]=T,e[27]=g,e[28]=d,e[29]=B,e[30]=o,e[31]=j,e[32]=p,e[33]=n,e[34]=Y):Y=e[34];const J=Y;let q;e[35]!==i||e[36]!==J?(q=b.jsx(yb,{value:J,children:i}),e[35]=i,e[36]=J,e[37]=q):q=e[37];let X;return e[38]!==S||e[39]!==q?(X=b.jsx(M3,{value:S,children:q}),e[38]=S,e[39]=q,e[40]=X):X=e[40],X},zm=t=>{const e=ee.c(3),{label:n,className:s}=t;let i;return e[0]!==s||e[1]!==n?(i=b.jsx(x8,{"aria-hidden":"true",className:s,children:n}),e[0]=s,e[1]=n,e[2]=i):i=e[2],i},m_=["full","short","keys"],xb=t=>{const e=ee.c(11),{label:n,shortLabel:s,density:i}=t;if(i==="full"){let d;return e[0]!==n?(d=b.jsx("span",{children:n}),e[0]=n,e[1]=d):d=e[1],d}if(i==="keys"){let d;return e[2]!==n?(d=b.jsx("span",{className:"sr-only",children:n}),e[2]=n,e[3]=d):d=e[3],d}const o=s??n;let r;e[4]!==o?(r=b.jsx("span",{"aria-hidden":"true",children:o}),e[4]=o,e[5]=r):r=e[5];let a;e[6]!==n?(a=b.jsx("span",{className:"sr-only",children:n}),e[6]=n,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==a?(c=b.jsxs(b.Fragment,{children:[r,a]}),e[8]=r,e[9]=a,e[10]=c):c=e[10],c},D3=(t,e)=>e==="full"?void 0:t,V8=t=>{const e=ee.c(4),{hints:n}=t;let s;e[0]!==n?(s=n.map(Eoe),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==s?(i=b.jsx("div",{className:"-mx-1 mt-1 flex max-w-[21rem] flex-wrap items-center gap-x-3 gap-y-1.5 border-t px-3 pt-2 pb-1.5 text-[0.6875rem] text-muted-foreground",children:s}),e[2]=s,e[3]=i):i=e[3],i},ioe=()=>{const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{"aria-hidden":"true",className:"mx-1 h-5 w-px shrink-0 bg-sign-foreground/20"}),t[0]=e):e=t[0],e},ooe=t=>{const e=ee.c(4),{isHere:n}=t,s=n&&"border-(--line,var(--primary-text)) bg-(--line,var(--primary-text))";let i;e[0]!==s?(i=Se("size-3.5 shrink-0 rounded-full border-[2.5px] border-muted-foreground",s),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==i?(o=b.jsx("span",{"aria-hidden":"true",className:i}),e[2]=i,e[3]=o):o=e[3],o},roe=()=>{const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{"aria-hidden":"true",className:"size-[11px] shrink-0 rounded-[2px] bg-(--line,var(--primary-text))"}),t[0]=e):e=t[0],e},oS=t=>{const e=ee.c(14),{section:n,onJump:s}=t;let i;e[0]!==s||e[1]!==n.anchorId?(i=()=>{s(n.anchorId)},e[0]=s,e[1]=n.anchorId,e[2]=i):i=e[2];let o;e[3]!==n.isHere?(o=b.jsx(ooe,{isHere:n.isHere}),e[3]=n.isHere,e[4]=o):o=e[4];let r;e[5]!==n.label?(r=b.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.label}),e[5]=n.label,e[6]=r):r=e[6];let a;e[7]!==n.isHere?(a=n.isHere?b.jsx("span",{className:"text-xs text-muted-foreground",children:Fie}):null,e[7]=n.isHere,e[8]=a):a=e[8];let c;return e[9]!==i||e[10]!==o||e[11]!==r||e[12]!==a?(c=b.jsxs(lse,{onClick:i,children:[o,r,a]}),e[9]=i,e[10]=o,e[11]=r,e[12]=a,e[13]=c):c=e[13],c},loe=t=>{const e=ee.c(49),{navigator:n,density:s}=t;let i,o,r,a,c,d,f,p,m,g,y,v,S;if(e[0]!==s||e[1]!==n){const R=yie(n.rail,n.dominantAnchorId),A=n.openMenuKey===Md;r=f8,c=!1,o=h8,y=A,e[15]!==n?(v=I=>{n.onOpenMenuKeyChange(I?Md:null)},e[15]=n,e[16]=v):v=e[16];const k=n.flashedKey===Md;let M;e[17]!==s?(M=D3(h_,s),e[17]=s,e[18]=M):M=e[18];let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=Se(bb,"pl-2.5 data-popup-open:bg-sign-foreground/15"),e[19]=L):L=e[19];let j;e[20]!==s?(j=b.jsx(xb,{label:h_,shortLabel:null,density:s}),e[20]=s,e[21]=j):j=e[21];let D,P;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=b.jsx($D,{"aria-hidden":"true",className:"size-3.5"}),P=b.jsx(zm,{label:Md}),e[22]=D,e[23]=P):(D=e[22],P=e[23]),e[24]!==k||e[25]!==M||e[26]!==j?(S=b.jsxs(p8,{"data-flash":k,"data-user-action-id":H8,title:M,className:L,children:[j,D,P]}),e[24]=k,e[25]=M,e[26]=j,e[27]=S):S=e[27],i=m8,a="top",d=12,f="max-w-[21rem] min-w-[17rem]";let B;e[28]!==n.onJump?(B=I=>b.jsx(oS,{section:I,onJump:n.onJump},I.anchorId),e[28]=n.onJump,e[29]=B):B=e[29],p=b.jsxs(pp,{children:[R.heading===null?null:b.jsx(mp,{children:R.heading}),R.sections.map(B)]}),m=R.otherGroups.length===0?null:b.jsxs(b.Fragment,{children:[b.jsx(Fw,{}),b.jsxs(pp,{children:[b.jsx(mp,{children:Hie}),R.otherGroups.map(I=>b.jsxs(g8,{children:[b.jsxs(y8,{children:[b.jsx(roe,{}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:I.label})]}),b.jsx(b8,{className:"max-w-[21rem] min-w-[15rem]",children:b.jsxs(pp,{children:[I.label===null?null:b.jsx(mp,{children:I.label}),I.sections.map(F=>b.jsx(oS,{section:{...F,isHere:!1},onJump:n.onJump},F.anchorId))]})})]},I.anchorId))]})]}),g=R.looseSections.length===0?null:b.jsxs(b.Fragment,{children:[b.jsx(Fw,{}),R.looseSections.map(I=>b.jsx(oS,{section:I,onJump:n.onJump},I.anchorId))]}),e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=r,e[5]=a,e[6]=c,e[7]=d,e[8]=f,e[9]=p,e[10]=m,e[11]=g,e[12]=y,e[13]=v,e[14]=S}else i=e[2],o=e[3],r=e[4],a=e[5],c=e[6],d=e[7],f=e[8],p=e[9],m=e[10],g=e[11],y=e[12],v=e[13],S=e[14];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=b.jsx(V8,{hints:qie}),e[30]=w):w=e[30];let N;e[31]!==i||e[32]!==a||e[33]!==d||e[34]!==f||e[35]!==p||e[36]!==m||e[37]!==g?(N=b.jsxs(i,{side:a,sideOffset:d,className:f,children:[p,m,g,w]}),e[31]=i,e[32]=a,e[33]=d,e[34]=f,e[35]=p,e[36]=m,e[37]=g,e[38]=N):N=e[38];let C;e[39]!==o||e[40]!==N||e[41]!==y||e[42]!==v||e[43]!==S?(C=b.jsxs(o,{open:y,onOpenChange:v,children:[S,N]}),e[39]=o,e[40]=N,e[41]=y,e[42]=v,e[43]=S,e[44]=C):C=e[44];let T;return e[45]!==r||e[46]!==c||e[47]!==C?(T=b.jsx(r,{modal:c,children:C}),e[45]=r,e[46]=c,e[47]=C,e[48]=T):T=e[48],T},aoe=t=>{const e=ee.c(22),{control:n,isFlashed:s,density:i}=t,o=n.isPrimary?void 0:n.isPressed,r=n.isDisabled;let a;e[0]!==n.description||e[1]!==n.label||e[2]!==i?(a=n.description??D3(n.label,i),e[0]=n.description,e[1]=n.label,e[2]=i,e[3]=a):a=e[3];const c=n.actionId??void 0,d=n.isPrimary&&U8;let f;e[4]!==d?(f=Se(bb,d),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==n.label||e[7]!==n.shortLabel||e[8]!==i?(p=b.jsx(xb,{label:n.label,shortLabel:n.shortLabel,density:i}),e[6]=n.label,e[7]=n.shortLabel,e[8]=i,e[9]=p):p=e[9];let m;e[10]!==n.key?(m=b.jsx(zm,{label:n.key}),e[10]=n.key,e[11]=m):m=e[11];let g;return e[12]!==n.isDisabled||e[13]!==n.onRun||e[14]!==s||e[15]!==o||e[16]!==a||e[17]!==c||e[18]!==f||e[19]!==p||e[20]!==m?(g=b.jsxs("button",{type:"button","aria-pressed":o,disabled:r,title:a,"data-flash":s,"data-user-action-id":c,className:f,onClick:n.onRun,children:[p,m]}),e[12]=n.isDisabled,e[13]=n.onRun,e[14]=s,e[15]=o,e[16]=a,e[17]=c,e[18]=f,e[19]=p,e[20]=m,e[21]=g):g=e[21],g},coe=t=>{const e=ee.c(38),{control:n,isFlashed:s,density:i,hint:o,navigator:r}=t,a=_.useId();let c;e[0]!==o||e[1]!==a?(c=b.jsx("span",{id:a,hidden:!0,children:o}),e[0]=o,e[1]=a,e[2]=c):c=e[2];const d=r.hintedKey===n.key;let f;e[3]!==n.key||e[4]!==r?(f=k=>{r.onHintedKeyChange(k?n.key:null)},e[3]=n.key,e[4]=r,e[5]=f):f=e[5];const p=n.isPrimary?void 0:n.isPressed,m=n.actionId??void 0,g=n.isPrimary&&U8;let y;e[6]!==g?(y=Se(bb,g,"aria-disabled:cursor-default aria-disabled:opacity-45"),e[6]=g,e[7]=y):y=e[7];let v;e[8]!==n.key||e[9]!==r?(v=()=>{r.onHint(n.key)},e[8]=n.key,e[9]=r,e[10]=v):v=e[10];let S;e[11]!==a||e[12]!==s||e[13]!==p||e[14]!==m||e[15]!==y||e[16]!==v?(S=b.jsx("button",{type:"button","aria-pressed":p,"aria-disabled":"true","aria-describedby":a,"data-flash":s,"data-user-action-id":m,className:y,onClick:v}),e[11]=a,e[12]=s,e[13]=p,e[14]=m,e[15]=y,e[16]=v,e[17]=S):S=e[17];let w;e[18]!==n.label||e[19]!==n.shortLabel||e[20]!==i?(w=b.jsx(xb,{label:n.label,shortLabel:n.shortLabel,density:i}),e[18]=n.label,e[19]=n.shortLabel,e[20]=i,e[21]=w):w=e[21];let N;e[22]!==n.key?(N=b.jsx(zm,{label:n.key}),e[22]=n.key,e[23]=N):N=e[23];let C;e[24]!==w||e[25]!==N||e[26]!==S?(C=b.jsxs(e8,{closeOnClick:!1,render:S,children:[w,N]}),e[24]=w,e[25]=N,e[26]=S,e[27]=C):C=e[27];let T;e[28]!==o?(T=b.jsx(t8,{sideOffset:12,children:o}),e[28]=o,e[29]=T):T=e[29];let R;e[30]!==C||e[31]!==T||e[32]!==d||e[33]!==f?(R=b.jsxs(JP,{open:d,onOpenChange:f,children:[C,T]}),e[30]=C,e[31]=T,e[32]=d,e[33]=f,e[34]=R):R=e[34];let A;return e[35]!==c||e[36]!==R?(A=b.jsxs(b.Fragment,{children:[c,R]}),e[35]=c,e[36]=R,e[37]=A):A=e[37],A},q8=t=>{const e=ee.c(14),{choice:n}=t,s=n.isChecked,i=n.isDisabled,o=n.onToggle,r=n.marker;let a;e[0]!==n.label?(a=b.jsx("span",{className:"flex-1",children:n.label}),e[0]=n.label,e[1]=a):a=e[1];const c=n.detailTone===null?"text-muted-foreground":Qie[n.detailTone];let d;e[2]!==c?(d=Se("text-xs tabular-nums",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==n.detailLabel||e[5]!==d?(f=b.jsx("span",{className:d,children:n.detailLabel}),e[4]=n.detailLabel,e[5]=d,e[6]=f):f=e[6];let p;return e[7]!==n.isChecked||e[8]!==n.isDisabled||e[9]!==n.marker||e[10]!==n.onToggle||e[11]!==a||e[12]!==f?(p=b.jsxs(ase,{checked:s,disabled:i,onCheckedChange:o,children:[r,a,f]}),e[7]=n.isChecked,e[8]=n.isDisabled,e[9]=n.marker,e[10]=n.onToggle,e[11]=a,e[12]=f,e[13]=p):p=e[13],p},uoe=t=>{const e=ee.c(17),{submenu:n}=t;let s;e[0]!==n.label?(s=b.jsx("span",{className:"flex-1",children:n.label}),e[0]=n.label,e[1]=s):s=e[1];let i;e[2]!==n.valueLabel?(i=n.valueLabel===null?null:b.jsx("span",{className:"max-w-32 truncate text-xs text-muted-foreground",children:n.valueLabel}),e[2]=n.valueLabel,e[3]=i):i=e[3];let o;e[4]!==s||e[5]!==i?(o=b.jsxs(y8,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6];let r;e[7]!==n.heading?(r=b.jsx(mp,{children:n.heading}),e[7]=n.heading,e[8]=r):r=e[8];let a;e[9]!==n.choices?(a=n.choices.map(Coe),e[9]=n.choices,e[10]=a):a=e[10];let c;e[11]!==r||e[12]!==a?(c=b.jsx(b8,{className:"min-w-[15rem]",children:b.jsxs(pp,{children:[r,a]})}),e[11]=r,e[12]=a,e[13]=c):c=e[13];let d;return e[14]!==o||e[15]!==c?(d=b.jsxs(g8,{children:[o,c]}),e[14]=o,e[15]=c,e[16]=d):d=e[16],d},doe=t=>{const e=ee.c(7),{badge:n}=t;let s;e[0]!==n.count?(s=b.jsx("span",{"aria-hidden":"true",className:"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-sign-foreground px-1 text-[0.625rem] leading-none font-bold text-sign tabular-nums group-data-popup-open:bg-sign group-data-popup-open:text-sign-foreground",children:n.count}),e[0]=n.count,e[1]=s):s=e[1];let i;e[2]!==n.label?(i=b.jsx("span",{className:"sr-only",children:n.label}),e[2]=n.label,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=b.jsxs(b.Fragment,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o},foe=t=>t.itemGroups.flat().some(e=>e.kind==="submenu"),hoe=t=>{const e=ee.c(38),{control:n,navigator:s,density:i}=t,o=s.openMenuKey===n.key;let r;e[0]!==n.key||e[1]!==s?(r=A=>{s.onOpenMenuKeyChange(A?n.key:null)},e[0]=n.key,e[1]=s,e[2]=r):r=e[2];const a=s.flashedKey===n.key,c=n.actionId;let d;e[3]!==n.label||e[4]!==i?(d=D3(n.label,i),e[3]=n.label,e[4]=i,e[5]=d):d=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=Se(bb,"group data-popup-open:bg-sign-foreground data-popup-open:font-bold data-popup-open:text-sign"),e[6]=f):f=e[6];let p;e[7]!==n.label||e[8]!==i?(p=b.jsx(xb,{label:n.label,shortLabel:null,density:i}),e[7]=n.label,e[8]=i,e[9]=p):p=e[9];let m;e[10]!==n.badge?(m=n.badge===null?null:b.jsx(doe,{badge:n.badge}),e[10]=n.badge,e[11]=m):m=e[11];let g;e[12]!==n.key?(g=b.jsx(zm,{label:n.key}),e[12]=n.key,e[13]=g):g=e[13];let y;e[14]!==n.actionId||e[15]!==a||e[16]!==d||e[17]!==p||e[18]!==m||e[19]!==g?(y=b.jsxs(p8,{"data-flash":a,"data-user-action-id":c,title:d,className:f,children:[p,m,g]}),e[14]=n.actionId,e[15]=a,e[16]=d,e[17]=p,e[18]=m,e[19]=g,e[20]=y):y=e[20];let v;e[21]!==n.heading?(v=b.jsx(mp,{children:n.heading}),e[21]=n.heading,e[22]=v):v=e[22];let S;e[23]!==n.itemGroups?(S=n.itemGroups.map(Ooe),e[23]=n.itemGroups,e[24]=S):S=e[24];let w;e[25]!==v||e[26]!==S?(w=b.jsxs(pp,{children:[v,S]}),e[25]=v,e[26]=S,e[27]=w):w=e[27];const N=foe(n)?Gie:Wie;let C;e[28]!==N?(C=b.jsx(V8,{hints:N}),e[28]=N,e[29]=C):C=e[29];let T;e[30]!==w||e[31]!==C?(T=b.jsxs(m8,{side:"top",sideOffset:12,className:"min-w-[17rem]",children:[w,C]}),e[30]=w,e[31]=C,e[32]=T):T=e[32];let R;return e[33]!==o||e[34]!==y||e[35]!==T||e[36]!==r?(R=b.jsx(f8,{modal:!1,children:b.jsxs(h8,{open:o,onOpenChange:r,children:[y,T]})}),e[33]=o,e[34]=y,e[35]=T,e[36]=r,e[37]=R):R=e[37],R},poe=t=>{const e=ee.c(15),{control:n,navigator:s,density:i}=t;if(n.kind==="position"){let a;return e[0]!==n.label?(a=b.jsx("span",{className:"min-w-16 px-1 text-center tabular-nums",children:n.label}),e[0]=n.label,e[1]=a):a=e[1],a}if(n.kind==="menu"){let a;return e[2]!==n||e[3]!==i||e[4]!==s?(a=b.jsx(hoe,{control:n,navigator:s,density:i}),e[2]=n,e[3]=i,e[4]=s,e[5]=a):a=e[5],a}const o=s.flashedKey===n.key;if(n.isDisabled&&n.disabledHint!==null){let a;return e[6]!==n||e[7]!==i||e[8]!==o||e[9]!==s?(a=b.jsx(coe,{control:n,isFlashed:o,density:i,hint:n.disabledHint,navigator:s}),e[6]=n,e[7]=i,e[8]=o,e[9]=s,e[10]=a):a=e[10],a}let r;return e[11]!==n||e[12]!==i||e[13]!==o?(r=b.jsx(aoe,{control:n,isFlashed:o,density:i}),e[11]=n,e[12]=i,e[13]=o,e[14]=r):r=e[14],r},j3="position",g_=t=>t.kind==="position"?j3:t.key,y_="calc(var(--navigator-inset-left, 0px) + (100% - var(--navigator-inset-left, 0px) - var(--navigator-inset-right, 0px)) / 2)",moe="1.5rem",goe=2,yoe="100% - var(--navigator-inset-right, 1.5rem)",boe=t=>{if(t===null)return y_;const e=`${String(t/goe)}px`;return`clamp(calc(${moe} + ${e}), ${y_}, calc(${yoe} - ${e}))`},b_=t=>{const e=ee.c(3),[n,s]=_.useState(null);let i,o;return e[0]!==t?(i=()=>{if(t===null)return;const r=new ResizeObserver(()=>{s(t.offsetWidth)});return r.observe(t),()=>{r.disconnect()}},o=[t],e[0]=t,e[1]=i,e[2]=o):(i=e[1],o=e[2]),_.useEffect(i,o),n},xoe={signature:"",densityIndex:0},voe=(t,e,n)=>{const s=ee.c(6),[i,o]=_.useState(xoe),r=`${n}|${String(e)}`,a=i.signature===r?i.densityIndex:0;let c,d;return s[0]!==e||s[1]!==t||s[2]!==a||s[3]!==r?(c=()=>{if(t===null||e===null||a===m_.length-1)return;const f=new ResizeObserver(()=>{t.offsetWidth>e&&o({signature:r,densityIndex:a+1})});return f.observe(t),()=>{f.disconnect()}},d=[t,e,r,a],s[0]=e,s[1]=t,s[2]=a,s[3]=r,s[4]=c,s[5]=d):(c=s[4],d=s[5]),_.useEffect(c,d),m_[a]},W8=t=>{const e=ee.c(11),{place:n,...s}=t,i=n===void 0?"page":n,o=_.use(yb),[r,a]=_.useState(null),[c,d]=_.useState(null),f=b_(r),p=b_(c),m=((o==null?void 0:o.groups)??[]).filter(Roe),g=voe(r,p,P8(m));if(o===null||i==="page"&&o.fullScreenOwner!==null)return null;let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx("div",{"aria-hidden":"true",ref:d,className:"pointer-events-none fixed bottom-0 left-6 h-0 right-[var(--navigator-inset-right,1.5rem)]"}),e[0]=y):y=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=b.jsx("div",{"aria-hidden":"true",className:"fixed bottom-0 left-0 right-[var(--navigator-band-right,0px)] z-40 h-11 bg-sign",children:b.jsx("span",{className:"absolute inset-x-0 top-0 h-1 bg-(--line,var(--primary-text))"})}),e[1]=v):v=e[1];const S=Se("fixed bottom-0 z-40 flex h-10 -translate-x-1/2 items-center px-1 text-[0.8rem] whitespace-nowrap text-sign-foreground transition-[left] duration-200 ease-out",s.className);let w;e[2]!==g||e[3]!==o?(w=b.jsx(loe,{navigator:o,density:g}),e[2]=g,e[3]=o,e[4]=w):w=e[4];const N=o.dominantAnchorId??"",C="flex items-center duration-[180ms] animate-in fade-in-0";let T;e[5]!==g||e[6]!==o?(T=k=>b.jsxs("div",{className:"flex items-center gap-0.5",children:[b.jsx(ioe,{}),k.map(M=>b.jsx(poe,{control:M,navigator:o,density:g},g_(M)))]},k.map(g_).find(koe)??j3),e[5]=g,e[6]=o,e[7]=T):T=e[7];const R=m.map(T);let A;return e[8]!==N||e[9]!==R?(A=b.jsx("div",{className:C,children:R},N),e[8]=N,e[9]=R,e[10]=A):A=e[10],b.jsxs(b.Fragment,{children:[y,v,b.jsxs("div",{ref:a,role:"toolbar","aria-label":$ie,...s,style:{...s.style,left:boe(f)},className:S,children:[w,A]})]})};function Soe(t){return new Map(t)}function woe(t){return b.jsx(zm,{label:t,className:Xie},t)}function Eoe(t){const[e,n]=t;return b.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.map(woe),n]},n)}function Coe(t){return b.jsx(q8,{choice:t},t.id)}function Noe(t){return t.id}function Toe(t){return t.kind==="choice"?b.jsx(q8,{choice:t},t.id):b.jsx(uoe,{submenu:t},t.id)}function Ooe(t,e){return b.jsxs("div",{children:[e===0?null:b.jsx(Fw,{}),t.map(Toe)]},t.map(Noe).join(Gw))}function Roe(t){return t.length>0}function koe(t){return t!==j3}const vb=1.25,Aoe=1,_oe=3,G8=vb**-4,K8=vb**_oe,Moe=.002,Loe=16,Ioe=1,Doe=2,x_=2,P3=t=>Math.min(K8,Math.max(G8,t)),joe=t=>P3(t*vb),Poe=t=>P3(t/vb),zoe=({deltaY:t,deltaMode:e},n)=>e===Ioe?t*Loe:e===Doe?t*n:t,Boe=(t,e)=>P3(t*Math.exp(-e*Moe)),v_=({paneWidth:t,paneHeight:e,width:n,height:s,isCentred:i},o)=>{const r=(t-n*o)/x_,a=(e-s*o)/x_;return i?{x:r,y:a}:{x:Math.max(0,r),y:0}},$oe=(t,e,n,s,i)=>{const o=v_(i,n),r=v_(i,s),a=s/n,c=(d,f,p)=>d-(d-f)*a-p;return{x:c(t.x,o.x+e.x,r.x),y:c(t.y,o.y+e.y,r.y)}},Y8="escape-key",Foe=t=>t instanceof HTMLElement&&t.getAttribute("aria-expanded")==="true",T_e=t=>(e,n)=>{e||(n.reason===Y8&&Foe(n.event.target)?n.cancel():t())},Hoe={x:0,y:0},Uoe=0,Voe=4,S_=["pointerup","pointercancel"],qoe=(t,e)=>({x:e.x-t.x,y:e.y-t.y}),Woe=(t,e)=>({x:t.x+e.x,y:t.y+e.y}),Goe=({x:t,y:e})=>Math.hypot(t,e)>=Voe,w_=({clientX:t,clientY:e})=>({x:t,y:e}),Koe=()=>{const t=ee.c(7),[e,n]=_.useState(Hoe),[s,i]=_.useState(!1),o=_.useRef(!1);let r;t[0]!==e?(r=p=>{if(p.button!==Uoe)return;o.current=!1;const m=w_(p),g=e,y=S=>{const w=qoe(m,w_(S));!o.current&&!Goe(w)||(o.current=!0,i(!0),n(Woe(g,w)))},v=()=>{window.removeEventListener("pointermove",y),S_.forEach(S=>{window.removeEventListener(S,v)}),i(!1)};window.addEventListener("pointermove",y),S_.forEach(S=>{window.addEventListener(S,v)})},t[0]=e,t[1]=r):r=t[1];const a=r;let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{o.current&&(o.current=!1,p.stopPropagation(),p.preventDefault())},t[2]=c):c=t[2];const d=c;let f;return t[3]!==s||t[4]!==e||t[5]!==a?(f={offset:e,isDragging:s,startDrag:a,swallowClickAfterDrag:d,panTo:n},t[3]=s,t[4]=e,t[5]=a,t[6]=f):f=t[6],f},X8="flight-plan:layout:v1",Q8="flight-plan:layout-saved",E_=[Q8,"storage"],Z1={diagramPanelWidthPx:null},Yoe=t=>{if(typeof t!="object"||t===null||!("diagramPanelWidthPx"in t))return Z1;const{diagramPanelWidthPx:e}=t;return typeof e=="number"&&Number.isFinite(e)?{diagramPanelWidthPx:e}:Z1},Xoe=t=>{try{return t===null?Z1:Yoe(JSON.parse(t))}catch{return Z1}},Qoe=()=>{try{return window.localStorage.getItem(X8)}catch{return null}},Zoe=()=>null,Joe=t=>(E_.forEach(e=>{window.addEventListener(e,t)}),()=>{E_.forEach(e=>{window.removeEventListener(e,t)})}),ere=t=>{try{window.localStorage.setItem(X8,JSON.stringify(t))}catch{return}window.dispatchEvent(new Event(Q8))},tre=()=>{const t=ee.c(2),e=_.useSyncExternalStore(Joe,Qoe,Zoe);let n;return t[0]!==e?(n=Xoe(e),t[0]=e,t[1]=n):n=t[1],n},nre=0,z3=320,sre=.8,C_=32,N_=["pointerup","pointercancel"],T_={ArrowLeft:C_,ArrowRight:-C_},Z8=t=>Math.max(z3,Math.round(t*sre)),O_=(t,e)=>Math.round(Math.min(Z8(e),Math.max(z3,t))),ire=t=>{const e=ee.c(10),{diagramPanelWidthPx:n}=tre(),[s,i]=_.useState(null),o=s!==null,r=ore;let a;e[0]!==t?(a=v=>{if(v.button!==nre)return;v.preventDefault();const S=v.clientX,w=t(),N=R=>O_(w+S-R,window.innerWidth),C=R=>{i(N(R.clientX))},T=R=>{window.removeEventListener("pointermove",C),N_.forEach(A=>{window.removeEventListener(A,T)}),i(null),r(N(R.clientX))};i(Math.round(w)),window.addEventListener("pointermove",C),N_.forEach(R=>{window.addEventListener(R,T)})},e[0]=t,e[1]=a):a=e[1];const c=a;let d;e[2]!==t?(d=v=>{Object.hasOwn(T_,v.key)&&(v.preventDefault(),r(O_(t()+T_[v.key],window.innerWidth)))},e[2]=t,e[3]=d):d=e[3];const f=d;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{r(null)},e[4]=p):p=e[4];const m=p,g=s??n;let y;return e[5]!==o||e[6]!==f||e[7]!==c||e[8]!==g?(y={widthPx:g,isResizing:o,narrowestPx:z3,startResize:c,resizeByKey:f,resetWidth:m},e[5]=o,e[6]=f,e[7]=c,e[8]=g,e[9]=y):y=e[9],y};function ore(t){ere({diagramPanelWidthPx:t})}const rre=2,lre=160,are="70vh",cre="Side panel width",ure=669,dre="Its own width",fre="Drag to resize, double-click to reset",hre="Zoom in",pre="Zoom out",R_="Full screen",k_="Leave full screen",mre="f",J8="--line",gre=t=>t===null?"":getComputedStyle(t).getPropertyValue(J8),yre=t=>e=>{const n=gre(t.current);e!==null&&n!==""&&e.style.setProperty(J8,n)},bre=t=>{const e=ee.c(27),{label:n,width:s,height:i,zoom:o,offset:r,isDragging:a,isCentred:c,children:d,onDragStart:f,onClickCapture:p}=t,m=c&&"flex items-center justify-center";let g;e[0]!==m?(g=Se("size-full cursor-grab touch-none overflow-clip bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[dragging=true]:cursor-grabbing",m),e[0]=m,e[1]=g):g=e[1];const y=`${String(r.x)}px ${String(r.y)}px`;let v;e[2]!==y?(v={backgroundPosition:y},e[2]=y,e[3]=v):v=e[3];const S=c?"shrink-0":"mx-auto",w=s*o,N=i*o,C=`translate(${String(r.x)}px, ${String(r.y)}px)`;let T;e[4]!==w||e[5]!==N||e[6]!==C?(T={width:w,height:N,transform:C},e[4]=w,e[5]=N,e[6]=C,e[7]=T):T=e[7];const R=`scale(${String(o)})`;let A;e[8]!==i||e[9]!==R||e[10]!==s?(A={width:s,height:i,transform:R},e[8]=i,e[9]=R,e[10]=s,e[11]=A):A=e[11];let k;e[12]!==d||e[13]!==A?(k=b.jsx("div",{className:"relative origin-top-left",style:A,children:d}),e[12]=d,e[13]=A,e[14]=k):k=e[14];let M;e[15]!==k||e[16]!==S||e[17]!==T?(M=b.jsx("div",{className:S,style:T,children:k}),e[15]=k,e[16]=S,e[17]=T,e[18]=M):M=e[18];let L;return e[19]!==a||e[20]!==n||e[21]!==p||e[22]!==f||e[23]!==M||e[24]!==g||e[25]!==v?(L=b.jsx("div",{role:"group","aria-label":n,"data-dragging":a,className:g,style:v,onPointerDown:f,onClickCapture:p,children:M}),e[19]=a,e[20]=n,e[21]=p,e[22]=f,e[23]=M,e[24]=g,e[25]=v,e[26]=L):L=e[26],L},e7="pointer-events-none z-10 flex justify-end px-2",xre=`${e7} sticky top-[calc(var(--pinned-height,var(--band-height,0px))+0.5rem)] mt-2`,vre=`${e7} absolute inset-x-0 top-2`,t7=t=>{const e=ee.c(105),{label:n,width:s,height:i,isFullScreen:o,isCentred:r,panel:a,actions:c,navigation:d,renderCanvas:f,children:p,onFullScreenChange:m,onPanelClose:g}=t,y=r===void 0?!1:r,v=c===void 0?null:c,S=d===void 0?null:d,w=f===void 0?null:f,N=p===void 0?null:p,[C,T]=_.useState(Aoe),{offset:R,isDragging:A,startDrag:k,swallowClickAfterDrag:M,panTo:L}=Koe(),j=_.useRef(null),D=_.useRef(null),P=_.useRef(null);let B;e[0]===Symbol.for("react.memo_cache_sentinel")?(B=st=>{P.current=st,yre(j)(st)},e[0]=B):B=e[0];const I=B;let F;e[1]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{var st;return((st=D.current)==null?void 0:st.getBoundingClientRect().width)??0},e[1]=F):F=e[1];const z=F,{widthPx:U,isResizing:H,narrowestPx:V,startResize:W,resizeByKey:G,resetWidth:Y}=ire(z);let J;if(e[2]!==i||e[3]!==y||e[4]!==R||e[5]!==L||e[6]!==s||e[7]!==C){const st=(St,dn)=>{St.preventDefault();const rt=dn.getBoundingClientRect(),Wt=Boe(C,zoe(St,rt.height));if(Wt===C)return;const _t={x:St.clientX-rt.left,y:St.clientY-rt.top};L($oe(_t,R,C,Wt,{paneWidth:rt.width,paneHeight:rt.height,width:s,height:i,isCentred:y})),T(Wt)};J=St=>{if(St===null)return;const dn=rt=>{st(rt,St)};return St.addEventListener("wheel",dn,{passive:!1}),()=>{St.removeEventListener("wheel",dn)}},e[2]=i,e[3]=y,e[4]=R,e[5]=L,e[6]=s,e[7]=C,e[8]=J}else J=e[8];const q=J;let X;e[9]!==m||e[10]!==g||e[11]!==a?(X=(st,St)=>{!st&&St.reason===Y8&&a!==null?g():m(st)},e[9]=m,e[10]=g,e[11]=a,e[12]=X):X=e[12];const Z=X,te=o?k_:R_;let Q;e[13]!==o||e[14]!==m?(Q=()=>{m(!o)},e[13]=o,e[14]=m,e[15]=Q):Q=e[15];let se;e[16]!==o||e[17]!==te||e[18]!==Q?(se=rs({key:mre,actionId:"full-screen-action",label:te,isPressed:o,onRun:Q}),e[16]=o,e[17]=te,e[18]=Q,e[19]=se):se=e[19];let ae;e[20]!==se?(ae=[se],e[20]=se,e[21]=ae):ae=e[21];const le=ae;let ne;e[22]!==le||e[23]!==S?(ne=S===null?[]:[...S.groups,le],e[22]=le,e[23]=S,e[24]=ne):ne=e[24],L3((S==null?void 0:S.anchorId)??null,ne);let fe;e[25]!==m?(fe=()=>{m(!1)},e[25]=m,e[26]=fe):fe=e[26],Rie((S==null?void 0:S.anchorId)??null,o,fe);let ve;e[27]!==v?(ve=v===null?null:b.jsxs(b.Fragment,{children:[v,b.jsx("span",{"aria-hidden":"true",className:"mx-0.5 h-4 w-px bg-border"})]}),e[27]=v,e[28]=ve):ve=e[28];const we=C>=K8;let Ce;e[29]===Symbol.for("react.memo_cache_sentinel")?(Ce=()=>{T(joe)},e[29]=Ce):Ce=e[29];let ye;e[30]!==we?(ye=b.jsx(xs,{icon:"zoomIn",label:hre,isDisabled:we,onClick:Ce}),e[30]=we,e[31]=ye):ye=e[31];const Oe=C<=G8;let be;e[32]===Symbol.for("react.memo_cache_sentinel")?(be=()=>{T(Poe)},e[32]=be):be=e[32];let _e;e[33]!==Oe?(_e=b.jsx(xs,{icon:"zoomOut",label:pre,isDisabled:Oe,onClick:be}),e[33]=Oe,e[34]=_e):_e=e[34];const Me=o?"leaveFullScreen":"fullScreen",Be=o?k_:R_;let He;e[35]!==o||e[36]!==m?(He=()=>{m(!o)},e[35]=o,e[36]=m,e[37]=He):He=e[37];let Ae;e[38]!==Me||e[39]!==Be||e[40]!==He?(Ae=b.jsx(xs,{icon:Me,label:Be,onClick:He}),e[38]=Me,e[39]=Be,e[40]=He,e[41]=Ae):Ae=e[41];let Ee;e[42]!==ve||e[43]!==ye||e[44]!==_e||e[45]!==Ae?(Ee=b.jsxs("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-md border border-input bg-card p-0.5",children:[ve,ye,_e,Ae]}),e[42]=ve,e[43]=ye,e[44]=_e,e[45]=Ae,e[46]=Ee):Ee=e[46];const Ne=Ee;let xe;e[47]!==N||e[48]!==i||e[49]!==y||e[50]!==A||e[51]!==n||e[52]!==R||e[53]!==L||e[54]!==w||e[55]!==k||e[56]!==M||e[57]!==s||e[58]!==C?(xe=w===null?b.jsx(bre,{label:n,width:s,height:i,zoom:C,offset:R,isDragging:A,isCentred:y,onDragStart:k,onClickCapture:M,children:N}):w({zoom:C,offset:R,onPan:L}),e[47]=N,e[48]=i,e[49]=y,e[50]=A,e[51]=n,e[52]=R,e[53]=L,e[54]=w,e[55]=k,e[56]=M,e[57]=s,e[58]=C,e[59]=xe):xe=e[59];const Pe=xe,We=Math.max(lre,i*C+rre);let et;e[60]!==We?(et={height:We,maxHeight:are},e[60]=We,e[61]=et):et=e[61];let At;e[62]!==Pe||e[63]!==o||e[64]!==q||e[65]!==Ne?(At=o?null:b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:q,className:"absolute inset-0",children:Pe}),b.jsx("div",{className:xre,children:Ne})]}),e[62]=Pe,e[63]=o,e[64]=q,e[65]=Ne,e[66]=At):At=e[66];let ze;e[67]!==et||e[68]!==At?(ze=b.jsx("div",{ref:j,className:"relative flex flex-col justify-start rounded-md border",style:et,children:At}),e[67]=et,e[68]=At,e[69]=ze):ze=e[69];let Te;e[70]!==Ne?(Te=b.jsx("div",{className:vre,children:Ne}),e[70]=Ne,e[71]=Te):Te=e[71];let qe;e[72]===Symbol.for("react.memo_cache_sentinel")?(qe=b.jsx(W8,{place:"full-screen"}),e[72]=qe):qe=e[72];let ot;e[73]!==Pe||e[74]!==q||e[75]!==Te?(ot=b.jsxs("div",{ref:q,className:"relative min-w-0 flex-1",children:[Te,Pe,qe]}),e[73]=Pe,e[74]=q,e[75]=Te,e[76]=ot):ot=e[76];let bt;e[77]!==H||e[78]!==V||e[79]!==a||e[80]!==U||e[81]!==Y||e[82]!==G||e[83]!==W?(bt=a===null?null:b.jsx("div",{role:"slider",tabIndex:0,"aria-orientation":"horizontal","aria-label":cre,"aria-valuemin":V,"aria-valuemax":Z8(window.innerWidth),"aria-valuenow":U??ure,"aria-valuetext":U===null?dre:`${String(U)} pixels`,title:fre,"data-resizing":H,className:"relative z-10 w-px shrink-0 cursor-col-resize touch-none bg-border transition-colors duration-[180ms] ease-out after:absolute after:inset-y-0 after:-right-1 after:-left-1 hover:bg-foreground focus-visible:bg-ring focus-visible:outline-2 focus-visible:outline-ring data-[resizing=true]:bg-foreground",onPointerDown:W,onKeyDown:G,onDoubleClick:Y}),e[77]=H,e[78]=V,e[79]=a,e[80]=U,e[81]=Y,e[82]=G,e[83]=W,e[84]=bt):bt=e[84];let Ct;e[85]!==U?(Ct=U===null?void 0:{width:U},e[85]=U,e[86]=Ct):Ct=e[86];const En=a===null?"hidden":"";let Mt;e[87]!==En?(Mt=Se("w-[min(41.8rem,52.8vw)] max-w-[80vw] min-w-80 shrink-0 overflow-y-auto bg-background duration-200 ease-out animate-in slide-in-from-right-8",En),e[87]=En,e[88]=Mt):Mt=e[88];let jt;e[89]!==a||e[90]!==Ct||e[91]!==Mt?(jt=b.jsx("aside",{ref:D,style:Ct,className:Mt,children:a}),e[89]=a,e[90]=Ct,e[91]=Mt,e[92]=jt):jt=e[92];let rn;e[93]!==n||e[94]!==ot||e[95]!==bt||e[96]!==jt?(rn=b.jsx(a8,{children:b.jsxs(l8,{ref:I,initialFocus:P,"aria-label":n,"data-navigator-scope":"",className:"fixed inset-0 z-50 flex bg-background text-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",children:[ot,bt,jt]})}),e[93]=n,e[94]=ot,e[95]=bt,e[96]=jt,e[97]=rn):rn=e[97];let Cn;e[98]!==Z||e[99]!==o||e[100]!==rn?(Cn=b.jsx(c8,{open:o,onOpenChange:Z,children:rn}),e[98]=Z,e[99]=o,e[100]=rn,e[101]=Cn):Cn=e[101];let nn;return e[102]!==ze||e[103]!==Cn?(nn=b.jsxs(b.Fragment,{children:[ze,Cn]}),e[102]=ze,e[103]=Cn,e[104]=nn):nn=e[104],nn};function Sre(t){return!n7(t)}function n7(t){return t.hasOwnProperty("lineNumber")}function wre(t,e,n){if(e==="children")t.children=n||t.children;else if(e==="_ref")t._ref=n||t._ref;else if(e==="data")t.data=t.data?{...t.data,...n}:n;else if(e==="className")t.className=[t.className,n].join(" ").trim();else if(e==="style")t.style={...t.style,...n};else if(typeof n=="function"){const s=t[e];t[e]=s?(...i)=>{s(...i),n(...i)}:n}else{if(n===void 0||typeof n!="object"&&n===t[e])return;if(!(e in t))t[e]=n;else throw new Error(`Didn’t know how to merge prop '${e}'. Only 'className', 'style', and event handlers are supported`)}}function B3(...t){return t.length===1?t[0]:t.reduce((e,n)=>{for(const s in n)wre(e,s,n[s]);return e},{})}const s7=({merge:t,...e})=>{const{_stack:n,...s}=B3(t,e),[i,...o]=n;if(i)return b.jsx(i,{_stack:o,...s});{const{_ref:r,data:a,children:c,...d}=s;return b.jsx("pre",{...d,ref:r,"data-ch":!0,children:b.jsx("div",{style:{minWidth:"fit-content"},children:c})})}},J1=({merge:t,...e})=>{const{_stack:n,...s}=B3(t,e),[i,...o]=n;if(i){const{Component:r,annotation:a}=i;return b.jsx(r,{_stack:o,...s,annotation:a})}else{const{lineNumber:r,totalLines:a,indentation:c,data:d,annotation:f,...p}=s;return b.jsx("div",{...p})}},Ere=({merge:t,...e})=>{const{_stack:n,...s}=B3(t,e),[i,...o]=n;if(i){const{Component:r,annotation:a}=i;return b.jsx(r,{_stack:o,...s,annotation:a})}else{const{value:r,data:a,...c}=s;return b.jsx("span",{...c,children:r})}},Cre=t=>{const e=_.useRef(null),n=t._ref||e;return b.jsx(s7,{merge:t,_ref:n})};function Nre(t,e){let n=t;for(let s=e.length-1;s>=0;s--){const i=e[s];n=Tre(n,i)}return n}function Tre(t,e){const{fromColumn:n,toColumn:s}=e,i=[n,s];let o=Kw(t,i[0]);o=Kw(o,i[1]+1);let r=[],a=[],c=[];return o.forEach(d=>{d.range[1]<i[0]?r.push(d):d.range[0]>i[1]?c.push(d):a.push(d)}),[...r,{annotation:e,content:a,range:[a[0].range[0],a[a.length-1].range[1]]},...c]}function Kw(t,e){const n=t.findIndex(i=>i.range[0]<e&&e<=i.range[1]);if(n===-1)return t;const s=t[n];if(i7(s)){const i=Kw(s.content,e);let o=[],r=[];for(const a of i)a.range[1]<e?o.push(a):r.push(a);return[...t.slice(0,n),{...s,content:o,range:[s.range[0],e-1]},{...s,content:r,range:[e,s.range[1]]},...t.slice(n+1)]}return[...t.slice(0,n),{...s,value:s.value.slice(0,e-s.range[0]),range:[s.range[0],e-1]},{...s,value:s.value.slice(e-s.range[0]),range:[e,s.range[1]]},...t.slice(n+1)]}function i7(t){return t.content!==void 0}function o7({content:t,handlers:e,annotationStack:n}){return t.map((s,i)=>i7(s)?b.jsx(Rre,{annotationStack:n,handlers:e,group:s},i):s.style?b.jsx(Ore,{annotationStack:n,handlers:e,token:s},i):s.value)}function Ore({handlers:t,token:e,annotationStack:n}){const s=kre(t,n);return b.jsx(Ere,{merge:{_stack:s,style:e.style,value:e.value}})}function Rre({group:t,handlers:e,annotationStack:n}){var s;const{annotation:i,content:o}=t,{name:r}=i,a=o7({content:o,handlers:e,annotationStack:[...n,i]}),c=(s=e.find(d=>d.name===r))===null||s===void 0?void 0:s.Inline;return c?b.jsx(c,{annotation:i,children:a}):a}function kre(t,e){const n=[];return t.forEach(({name:s,Token:i,AnnotatedToken:o})=>{const r=e.filter(a=>a.name===s);o&&r.forEach(a=>n.push({Component:o,annotation:a})),i&&(r.length||n.push({Component:i}),r.forEach(a=>n.push({Component:i,annotation:a})))}),n}const Are=" ";function _re(t){const e=[[]],n=t.slice();let s=1;for(;n.length;){const o=n.shift();if(typeof o=="string"){const[r,...a]=o.split(`
356
+ `);if(r){let c=s;s+=r.length,e[e.length-1].push({value:r,range:[c,s]})}a.length&&(e[e.length-1].push({value:`
357
+ `,range:[s,s+1]}),e.push([]),s=1,n.unshift(a.join(`
358
+ `)))}else{const[r,a,c={}]=o;let d=s;s+=r.length,e[e.length-1].push({value:r,style:{color:a,...c},range:[d,s]})}}const i=e.length;return e.map((o,r)=>{var a,c,d;return{tokens:o,range:[r+1,r+1],lineNumber:r+1,indentation:((d=(c=(a=o[0])===null||a===void 0?void 0:a.value)===null||c===void 0?void 0:c.replace(/\t/g,Are).match(/^\s*/))===null||d===void 0?void 0:d[0].length)||0,totalLines:i}})}function Mre(t,e){let n=t;for(let s=e.length-1;s>=0;s--){const i=e[s];n=Lre(n,i)}return n}function Lre(t,e){const{fromLineNumber:n,toLineNumber:s}=e,i=[n,s];let o=Yw(t,i[0]);o=Yw(o,i[1]+1);let r=[],a=[],c=[];return o.forEach(d=>{d.range[1]<i[0]?r.push(d):d.range[0]>i[1]?c.push(d):a.push(d)}),[...r,{annotation:e,lines:a,range:[a[0].range[0],a[a.length-1].range[1]]},...c]}function Yw(t,e){const n=t.findIndex(a=>r7(a)&&a.range[0]<e&&e<=a.range[1]);if(n===-1)return t;const s=t[n],i=Yw(s.lines,e);let o=[],r=[];return i.forEach(a=>{a.range[1]<e?o.push(a):r.push(a)}),[...t.slice(0,n),{...s,lines:o,range:[s.range[0],e-1]},{...s,lines:r,range:[e,s.range[1]]},...t.slice(n+1)]}function r7(t){return t.annotation!==void 0}function l7({linesOrGroups:t,handlers:e,inlineAnnotations:n,annotationStack:s=[]}){return t.map(i=>r7(i)?b.jsx(Dre,{group:i,handlers:e,inlineAnnotations:n,annotationStack:s},i.range[0]):b.jsx(Ire,{line:i,handlers:e,inlineAnnotations:n,annotationStack:s},i.lineNumber))}function Ire({line:t,handlers:e,inlineAnnotations:n,annotationStack:s=[]}){const{lineNumber:i,totalLines:o,indentation:r}=t,a=n.filter(m=>m.lineNumber===i),c=Nre(t.tokens,a),d=jre(e,s);let f=o7({content:c,handlers:e,annotationStack:s});const p={lineNumber:i,indentation:r,totalLines:o,_stack:d};return b.jsx(J1,{merge:p,children:f},i)}function Dre({group:t,handlers:e,inlineAnnotations:n,annotationStack:s}){var i;const{annotation:o,lines:r}=t,{name:a}=o,c=(i=e.find(f=>f.name===a))===null||i===void 0?void 0:i.Block,d=l7({linesOrGroups:r,handlers:e,inlineAnnotations:n,annotationStack:[...s,o]});return c?b.jsx(c,{annotation:o,children:d}):d}function jre(t,e){const n=[];return t.forEach(({name:s,Line:i,AnnotatedLine:o})=>{const r=e.filter(a=>a.name===s);o&&r.forEach(a=>{n.push({Component:o,annotation:a})}),i&&(r.length||n.push({Component:i}),r.forEach(a=>{n.push({Component:i,annotation:a})}))}),n}const Pre=_.forwardRef(({code:t,handlers:e=[],...n},s)=>{let{tokens:i,themeName:o,lang:r,annotations:a}=t;if(!i)throw new Error("Missing tokens in code block. Use the `highlight` function to generate the tokens.");e.filter(m=>m.transform).forEach(m=>{a=a.flatMap(g=>m.name!=g.name?g:m.transform(g)||[])});const c=new Set(a.map(m=>m.name)),d=e.filter(m=>!m.onlyIfAnnotated||c.has(m.name)),p={_stack:Bre(d),_ref:s};return b.jsx(s7,{merge:p,"data-theme":o,"data-lang":r,...n,children:b.jsx(zre,{tokens:i,handlers:d,annotations:a})})});function zre({tokens:t,handlers:e,annotations:n}){const s=_re(t),i=n.filter(Sre),o=n.filter(n7),r=Mre(s,i);return l7({linesOrGroups:r,handlers:e,inlineAnnotations:o})}function Bre(t){const e=t.map(({Pre:s})=>s).filter(Boolean),n=t.map(({PreWithRef:s})=>s).filter(Boolean);return n.length>0&&n.unshift(Cre),[...e,...n]}function $re(t){const{open:e,defaultOpen:n=!1,onOpenChange:s,disabled:i}=t,[o,r]=UC({controlled:e,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:c,transitionStatus:d}=KC(o,!0,!0),f=di(),[p,m]=_.useState(),g=p===null?void 0:p??f,y=Ye(v=>{const S=!o,w=xt(hr,v.nativeEvent);s(S,w),!w.isCanceled&&r(S)});return _.useMemo(()=>({defaultPanelId:f,disabled:i,handleTrigger:y,mounted:a,open:o,panelId:g,setMounted:c,setOpen:r,setPanelIdState:m,transitionStatus:d}),[f,i,y,a,o,g,c,r,m,d])}const a7=_.createContext(void 0);function c7(){const t=_.useContext(a7);if(t===void 0)throw new Error(yn(15));return t}const Fre="data-open",Hre="data-closed",Ure=BC,Vre="data-panel-open",qre={[Fre]:""},Wre={[Hre]:""},Gre={open(t){return t?{[Vre]:""}:null}},Kre={open(t){return t?qre:Wre}},u7={...Kre,...mm},Yre=_.forwardRef(function(e,n){const{render:s,className:i,defaultOpen:o=!1,disabled:r=!1,onOpenChange:a,open:c,style:d,...f}=e,p=Ye(a),m=$re({open:c,defaultOpen:o,onOpenChange:p,disabled:r}),g=_.useMemo(()=>({open:m.open,disabled:m.disabled,transitionStatus:m.transitionStatus}),[m.open,m.disabled,m.transitionStatus]),y=_.useMemo(()=>({...m,onOpenChange:p,state:g}),[m,p,g]),v=Qt("div",e,{state:g,ref:n,props:f,stateAttributesMapping:u7});return b.jsx(a7.Provider,{value:y,children:v})}),Xre={...Gre,...mm},Qre=_.forwardRef(function(e,n){const{panelId:s,open:i,handleTrigger:o,state:r,disabled:a}=c7(),{className:c,disabled:d=a,render:f,nativeButton:p=!0,style:m,...g}=e,{getButtonProps:y,buttonRef:v}=Cu({disabled:d,focusableWhenDisabled:!0,native:p});return Qt("button",e,{state:r,ref:[n,v],props:[{"aria-controls":i?s:void 0,"aria-expanded":i,onClick:o},g,y],stateAttributesMapping:Xre})}),Hh={height:void 0,width:void 0};function Zre(t){const{externalRef:e,hiddenUntilFound:n,id:s,keepMounted:i,mounted:o,onOpenChange:r,open:a,setMounted:c,setOpen:d,transitionStatus:f}=t,p=_.useRef(null),m=_.useRef(null),[g,y]=_.useState(Hh),v=_.useRef(Hh),S=_.useRef(!1),w=_.useRef(a),N=_.useRef(!1),[C,T]=_.useState(!1),R=_.useRef(null),A=Fa(e,p),k=Xn(a),M=vm(p),L=!a&&!o,j=C?"idle":f,D=a&&(w.current||N.current),P=!a&&o&&m.current==="css-animation"&&g.height===void 0&&g.width===void 0?v.current:g,B=n&&L&&m.current!=="css-animation",I=Ye((V,W=!0)=>{W&&(v.current=V),y(V)}),F=Ye(()=>{var V;(V=R.current)==null||V.call(R),R.current=null}),z=Ye(V=>{F(),R.current=()=>{R.current=null,V()}}),U=Ye(()=>{a&&o&&m.current==="css-animation"&&(N.current=!0)});Ue(()=>{!C||f==="starting"||T(!1)},[C,f]),_.useEffect(()=>()=>{U(),F()},[U,F]),Ue(()=>{const V=p.current;if(!V)return;!a&&R.current&&F();const W=Jre(V,D);if(m.current=W,a&&f==="idle"&&w.current&&W==="css-animation"){v.current=vd(V);return}if(a&&f==="starting"){const J=S.current;if(S.current=!1,W==="none"){I(vd(V)),T(!0);return}if(W==="css-transition"){const Z=ele(V);if(I(vd(V)),!J)return Z;const te=H0(V,"transition-duration","0s");return z(te),T(!0),Z}I(vd(V));const q=H0(V,"animation-name","none");if(!J){q();return}const X=H0(V,"animation-duration","0s");q(),z(X),T(!0);return}if(!a&&o&&(f==="idle"||f==="starting")){if(w.current=!1,N.current=!1,W==="none"){I(Hh,!1),c(!1);return}I(vd(V));return}if(f!=="ending")return;if(W==="none"){c(!1);return}const G=vd(V);if(!(G.height>0||G.width>0)){c(!1);return}I(G),W==="css-animation"&&H0(V,"animation-name","none")()},[o,a,F,I,c,z,D,f]),Xa({enabled:a&&o&&j==="idle",open:!0,ref:p,onComplete(){a&&I(Hh,!1)}}),_.useEffect(()=>{if(a||!o||j!=="ending"||!p.current)return;const W=new AbortController;let G=-1;function Y(){k.current||(c(!1),I(Hh,!1))}return G=vi.request(()=>{M(Y,W.signal)}),()=>{vi.cancel(G),W.abort()}},[k,o,a,j,M,I,c]),Ue(()=>{const V=p.current;!V||!n||!L||V.setAttribute("hidden","until-found")},[L,n]),_.useEffect(function(){const W=p.current;if(!W)return;function G(Y){const J=xt(bm,Y);r(!0,J),!J.isCanceled&&(S.current=!0,d(!0))}return Lt(W,"beforematch",G)},[r,d]);const H=i||n||o||a;return{height:P.height,props:{...B?{[Ure]:""}:void 0,hidden:L,id:s},ref:A,shouldPreventOpenAnimation:D,shouldRender:H,transitionStatus:j,width:P.width}}function vd(t){return{height:t.scrollHeight,width:t.scrollWidth}}function Jre(t,e){const n=In(t).getComputedStyle(t),s=(n.animationName.split(",").map(o=>o.trim()).some(o=>o!==""&&o!=="none")||e)&&A_(n.animationDuration),i=A_(n.transitionDuration);return s&&i||i?"css-transition":s?"css-animation":"none"}function A_(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function H0(t,e,n){const s=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);return t.style.setProperty(e,n),()=>{if(s===""){t.style.removeProperty(e);return}t.style.setProperty(e,s,i)}}function ele(t){const e={"justify-content":t.style.justifyContent,"align-items":t.style.alignItems,"align-content":t.style.alignContent,"justify-items":t.style.justifyItems};Object.keys(e).forEach(i=>{t.style.setProperty(i,"initial","important")});function n(){Object.entries(e).forEach(([i,o])=>{if(o===""){t.style.removeProperty(i);return}t.style.setProperty(i,o)})}const s=vi.request(n);return()=>{vi.cancel(s),n()}}const tle="--collapsible-panel-height",nle="--collapsible-panel-width",sle=_.forwardRef(function(e,n){const{className:s,hiddenUntilFound:i,keepMounted:o,render:r,id:a,style:c,...d}=e,{defaultPanelId:f,mounted:p,onOpenChange:m,open:g,setMounted:y,setPanelIdState:v,setOpen:S,state:w,transitionStatus:N}=c7(),C=i??!1,T=o??!1,R=a||void 0,A=R??f;Ue(()=>(v(U=>R??(U===null?void 0:U)),()=>{v(U=>U===R?null:U)}),[R,v]);const{height:k,props:M,ref:L,shouldPreventOpenAnimation:j,shouldRender:D,transitionStatus:P,width:B}=Zre({externalRef:n,hiddenUntilFound:C,id:A,keepMounted:T,mounted:p,onOpenChange:m,open:g,setMounted:y,setOpen:S,transitionStatus:N}),I={...w,transitionStatus:P},F=iD(c,I),z=Qt("div",{...e,style:void 0},{state:I,ref:L,props:[M,{style:{[tle]:k===void 0?"auto":`${k}px`,[nle]:B===void 0?"auto":`${B}px`}},d,F?{style:F}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:u7});return D?z:null});function ile(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(Yre,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=s):s=e[3],s}function ole(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(Qre,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function rle(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(sle,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=s):s=e[3],s}const d7=_.createContext(void 0);function zf(t){const e=_.useContext(d7);if(e===void 0&&!t)throw new Error(yn(50));return e}const lle=600,f7=300,h7={...Mm,instantType:t=>t.instantType,adaptiveOrigin:t=>t.adaptiveOrigin,closeDelay:t=>t.closeDelay};class ale extends Ou{constructor(n,s,i){const o=new Df;super(p7(n,o,s,i),m7(o),h7);Ut(this,"setOpen",(n,s)=>{const{inlineRectCoordsRef:i}=this.context;EP(this,n,s,{onBeforeDispatch(){var r;const o=s.event;n&&s.reason===Fn&&s.trigger&&"clientX"in o&&"clientY"in o&&((r=i.current)==null?void 0:r.element)!==s.trigger&&yP(i,s.trigger,o.clientX,o.clientY)}})})}}function cle(){const t=new Df;return new Mee(Object.freeze(p7(void 0,t)),Object.freeze(m7(t)),h7)}function p7(t,e,n,s=!1){return{..._m(e,n,s),instantType:void 0,adaptiveOrigin:void 0,closeDelay:f7,...t}}function m7(t){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t,inlineRectCoordsRef:{current:void 0}}}function __(t){const{open:e,defaultOpen:n=!1,onOpenChange:s,onOpenChangeComplete:i,actionsRef:o,handle:r,triggerId:a,defaultTriggerId:c=null,children:d}=t,f=ab((w,N)=>new ale({open:n,openProp:e,activeTriggerId:c,triggerIdProp:a},w,N));f.useControlledProp("openProp",e),f.useControlledProp("triggerIdProp",a),f.useContextCallback("onOpenChange",s),f.useContextCallback("onOpenChangeComplete",i);const p=f.useState("open"),m=f.useState("activeTriggerId"),g=f.useState("mounted"),y=f.useState("payload");Rm(f,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v}=km(p,f,()=>{f.context.inlineRectCoordsRef.current=void 0});Ue(()=>{p&&m==null&&f.set("payload",void 0)},[f,m,p]),_.useImperativeHandle(o,()=>({unmount:v,close:()=>f.setOpen(!1,xt(cu))}),[v,f]);const S=p||g;return b.jsxs(d7.Provider,{value:f,children:[r&&b.jsx(Tm,{handle:r,store:f}),S&&b.jsx(ule,{store:f}),typeof d=="function"?d({payload:y}):d]})}function ule({store:t}){const e=t.useState("floatingRootContext"),n=Em(e);return Am(t,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}const dle=If(function(e){return zf(!0)?b.jsx(__,{...e}):b.jsx(ob,{children:b.jsx(__,{...e})})}),g7=_.createContext(void 0);function fle(){const t=_.useContext(g7);if(t===void 0)throw new Error(yn(48));return t}const hle=_.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e;return zf().useState("mounted")||s?b.jsx(g7.Provider,{value:s,children:b.jsx(XP,{ref:n,...i})}):null}),ple=Cm(function(e,n){const{render:s,className:i,delay:o,closeDelay:r,id:a,payload:c,handle:d,style:f,...p}=e,m=zf(!0),y=Lm(d)??m;if(!y)throw new Error(yn(89));const v=di(a),S=y.useState("isTriggerActive",v),w=y.useState("isOpenedByTrigger",v),N=y.useState("floatingRootContext"),C=y.context.inlineRectCoordsRef,T=_.useRef(null),R=o??lle,A=r??f7,{registerTrigger:k,isMountedByThisTrigger:M}=Om(v,T,y,{payload:c,closeDelay:A}),L=Im(N,{mouseOnly:!0,move:!1,handleClose:Dm(),delay:()=>({open:R,close:A}),triggerElementRef:T,isActiveTrigger:S,isClosing:()=>y.select("transitionStatus")==="ending"}),j=f3(N,{delay:R}),D={open:w},P=y.useState("triggerProps",M),B=MJ(C,w);return Qt("a",e,{state:D,ref:[n,k,T],props:[L,j.reference,P,B,{id:v},p],stateAttributesMapping:gm})}),y7=_.createContext(void 0);function b7(){const t=_.useContext(y7);if(t===void 0)throw new Error(yn(49));return t}const mle=_.forwardRef(function(e,n){const{render:s,className:i,anchor:o,positionMethod:r="absolute",side:a="bottom",align:c="center",sideOffset:d=0,alignOffset:f=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:S=sb,style:w,...N}=e,C=zf(),T=fle(),R=wm(),A=C.useState("open"),k=C.useState("mounted"),M=C.useState("floatingRootContext"),L=C.useState("instantType"),j=C.useState("transitionStatus"),D=C.useState("adaptiveOrigin"),P=C.context.inlineRectCoordsRef,B=hb({anchor:o,floatingRootContext:M,positionMethod:r,mounted:k,side:a,sideOffset:d,align:c,alignOffset:f,arrowPadding:g,collisionBoundary:p,collisionPadding:m,sticky:y,disableAnchorTracking:v,keepMounted:T,nodeId:R,collisionAvoidance:S,adaptiveOrigin:D,inline:LJ(P)}),I=B.update;Ue(()=>{A&&k&&I()},[A,k,I]);const F={open:A,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:L},z=pb(e,F,{styles:B.positionerStyles,transitionStatus:j,props:N,refs:[n,C.useStateSetter("positionerElement")],hidden:!k,inert:!A});return b.jsx(y7.Provider,{value:B,children:b.jsx(ib,{id:R,children:z})})}),gle=_.forwardRef(function(e,n){const{className:s,render:i,style:o,...r}=e,a=zf(),{side:c,align:d}=b7(),f=a.useState("open"),p=a.useState("instantType"),m=a.useState("transitionStatus"),g=a.useState("popupProps"),y=a.useState("floatingRootContext"),v=a.useState("closeDelay");return Xa({open:f,ref:a.context.popupRef,onComplete(){var N,C;f&&((C=(N=a.context).onOpenChangeComplete)==null||C.call(N,!0))}}),ub(y,{closeDelay:v}),Qt("div",e,{state:{open:f,side:c,align:d,instant:p,transitionStatus:m},ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],props:[Nm,g,jm(m),r],stateAttributesMapping:ym})}),yle=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,a=zf(),{arrowRef:c,side:d,align:f,arrowUncentered:p,arrowStyles:m}=b7(),y={open:a.useState("open"),side:d,align:f,uncentered:p};return Qt("div",e,{state:y,ref:[c,n],props:[{style:m,"aria-hidden":!0},r],stateAttributesMapping:Lf})});class ble extends IJ{constructor(){super(cle(),"PreviewCard")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){var e;return((e=this.attachedStore)==null?void 0:e.select("open"))??!1}}function xle(){return new ble}const x7=xle;function Bm(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(dle,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function $m(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(ple,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Sb(t){const e=ee.c(24);let n,s,i,o,r,a,c,d,f;e[0]!==t?({className:s,side:r,sideOffset:a,align:c,alignOffset:d,anchor:n,collisionAvoidance:i,collisionPadding:f,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=r,e[6]=a,e[7]=c,e[8]=d,e[9]=f):(n=e[1],s=e[2],i=e[3],o=e[4],r=e[5],a=e[6],c=e[7],d=e[8],f=e[9]);const p=r===void 0?"bottom":r,m=a===void 0?6:a,g=c===void 0?"start":c,y=d===void 0?0:d,v=f===void 0?8:f;let S;e[10]!==s?(S=Se("z-50 origin-(--transform-origin) rounded-lg border border-foreground bg-popover text-sm text-popover-foreground outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",s),e[10]=s,e[11]=S):S=e[11];let w;e[12]!==o||e[13]!==S?(w=b.jsx(gle,{"data-slot":"hover-card-content",className:S,...o}),e[12]=o,e[13]=S,e[14]=w):w=e[14];let N;return e[15]!==g||e[16]!==y||e[17]!==n||e[18]!==i||e[19]!==v||e[20]!==p||e[21]!==m||e[22]!==w?(N=b.jsx(hle,{"data-slot":"hover-card-portal",children:b.jsx(mle,{align:g,alignOffset:y,side:p,sideOffset:m,anchor:n,collisionAvoidance:i,collisionPadding:v,className:"isolate z-50",children:w})}),e[15]=g,e[16]=y,e[17]=n,e[18]=i,e[19]=v,e[20]=p,e[21]=m,e[22]=w,e[23]=N):N=e[23],N}function v7(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("size-2.5 rotate-45 border-foreground bg-popover data-[side=bottom]:-top-[5px] data-[side=bottom]:border-t data-[side=bottom]:border-l data-[side=top]:-bottom-[5px] data-[side=top]:border-r data-[side=top]:border-b",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(yle,{"data-slot":"hover-card-arrow",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}const vle={plain:void 0,keyword:"var(--color-syntax-keyword)",string:"var(--color-syntax-string)",number:"var(--color-syntax-number)",comment:"var(--color-syntax-quiet)",function:"var(--color-syntax-function)",type:"var(--color-syntax-type)",property:void 0,constant:"var(--color-syntax-number)",tag:"var(--color-syntax-type)",punctuation:void 0},Sle={context:"",added:"bg-diff-added/12",removed:"bg-diff-removed/10"},wle={context:"",added:"+",removed:"-"},Ele={context:"",added:"text-diff-added",removed:"text-diff-removed"},M_={context:"",added:"added",removed:"removed"},S7=`
359
+ `,Cle="line",w7="mark",E7="definition",C7="collapse",N7="collapseTrigger",T7="collapseContent",O7="col-[-2/-1] row-start-1",Nle=Se(O7,"sticky right-2 flex items-center gap-1 self-center justify-self-end rounded-md bg-code pl-1 font-sans","opacity-0 transition-opacity duration-[180ms] ease-out group-hover/line:opacity-100 focus-within:opacity-100","data-[open=false]:opacity-100 has-[[aria-pressed=true]]:opacity-100"),Tle=150,Ole={},Rle="group-has-data-[focused=true]/code:opacity-55 data-[focused=true]:opacity-100",kle="flex size-4 items-center justify-center rounded-sm bg-(--line) text-line-foreground opacity-0 group-hover/line:opacity-100 focus-visible:opacity-100",Ale="absolute top-0.5 left-1",_le="mt-1",Mle="grid-cols-[3.25rem_1.25rem_1fr]",Lle="grid-cols-[1.25rem_1.25rem_3.25rem_1.25rem_1fr]",Ile=Se("-ml-1 pl-2 transition-[background-color,box-shadow] duration-[180ms] ease-out","data-[marked=true]:bg-[color-mix(in_oklab,var(--line,var(--color-primary))_6%,transparent)]","data-[marked=true]:shadow-[inset_2px_0_0_color-mix(in_oklab,var(--line,var(--color-primary))_70%,transparent)]"),Dle="rounded-sm bg-[color-mix(in_oklab,var(--line,var(--color-primary))_22%,transparent)] outline outline-1 outline-[var(--line,var(--color-primary))]",jle="max-h-48 shrink-0 overflow-y-auto border-b px-3 py-2.5 text-foreground [contain:inline-size]",Ple="rounded-sm underline decoration-muted-foreground decoration-dotted underline-offset-[0.25em] hover:bg-muted focus-visible:bg-muted",zle="flex max-h-[30rem] w-max min-w-[min(20rem,calc(100vw-2rem))] max-w-[min(64rem,calc(100vw-2rem))] flex-col overflow-hidden font-sans whitespace-normal",R7="flex items-baseline justify-between gap-4 border-b px-3 py-2",Ble="flex flex-wrap items-baseline gap-x-4 gap-y-1 border-t px-3 py-1.5 text-xs [contain:inline-size]",$le="[data-reference]",Fle="[data-code-block]",Hle="[data-reference-scope]",Ule=":",Vle=new Map([["ArrowLeft",-1],["ArrowRight",1]]),qle="data-[selected=true]:bg-primary/20",Wle="data-[commented=true]:shadow-[inset_3px_0_0_var(--line,var(--color-primary))]",Xw="pr-2 text-right text-syntax-quiet tabular-nums select-none",Gle="cursor-pointer hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring aria-pressed:font-bold aria-pressed:text-foreground",k7={},ey=new Set,A7=new Set,Kle=[],_7=new Set,Yle={lines:[],definitions:k7,definitionCard:x7(),isWrapped:!1,selectedLineLabels:ey,commentedLineKeys:ey,markedLines:A7,openRootBlockIds:_7,tabStopReferenceKey:null},Xle=":",M7=({side:t,lineLabel:e})=>`${t}${Xle}${e}`,Qw=t=>t.mark==="removed"?t.removedNumberLabel===""?null:{side:"old",lineLabel:t.removedNumberLabel}:t.numberLabel===""?null:{side:"new",lineLabel:t.numberLabel},Bf=_.createContext(Yle),L7=(t,e)=>`${String(t)}${Ule}${String(e)}`,I7=(t,e)=>t.flatMap((n,s)=>n.references.filter(i=>Object.hasOwn(e,i.definitionId)).map(i=>L7(s+1,i.fromColumn))),Qle=(t,e)=>I7(t,e).length>0,Zle=t=>{const e=Vle.get(t.key),n=t.currentTarget.closest(Hle)??t.currentTarget.closest(Fle);if(e===void 0||n===null)return;const s=[...n.querySelectorAll($le)],i=s.indexOf(t.currentTarget)+e;i<0||i>=s.length||(t.preventDefault(),s[i].focus())},Jle=t=>t.kind==="usages"?t.countLabel:`Defined in ${t.pathLabel}, ${t.rangeLabel}`,eae=({text:t,kind:e})=>[t,vle[e]],tae=t=>t.flatMap((e,n)=>[...e.tokens.map(eae),...n===t.length-1?[]:[S7]]),nae=({rootBlockId:t,fromLine:e,toLine:n,hasTrigger:s})=>({name:C7,query:t,fromLineNumber:e,toLineNumber:n,data:{hasTrigger:s}}),sae=(t,e)=>[...e.map(nae),...t.flatMap((n,s)=>[...n.marks.map(i=>({name:w7,query:"",lineNumber:s+1,...i})),...n.references.map(({definitionId:i,...o})=>({name:E7,query:i,lineNumber:s+1,...o}))])],iae=(t,e)=>{const n=t.map(s=>s.tokens.map(i=>i.text).join("")).join(S7);return{value:n,code:n,annotations:sae(t,e),tokens:tae(t),lang:"",meta:"",themeName:"",style:Ole}},L_=t=>{const e=t.data;return typeof e=="object"&&e!==null&&"hasTrigger"in e&&e.hasTrigger===!0},oae=t=>{const{fromLineNumber:e,toLineNumber:n}=t,s=L_(t)?e+1:e;return[t,...L_(t)?[{...t,name:N7,toLineNumber:e}]:[],...s>n?[]:[{...t,name:T7,fromLineNumber:s}]]},rae=t=>{const e=ee.c(10),{annotation:n,children:s}=t,{openRootBlockIds:i,onRootBlockOpenChange:o}=_.use(Bf);let r;e[0]!==n.query||e[1]!==i?(r=i.has(n.query),e[0]=n.query,e[1]=i,e[2]=r):r=e[2];let a;e[3]!==n.query||e[4]!==o?(a=d=>{o==null||o(n.query,d)},e[3]=n.query,e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==r||e[8]!==a?(c=b.jsx(ile,{open:r,className:"contents",onOpenChange:a,children:s}),e[6]=s,e[7]=r,e[8]=a,e[9]=c):c=e[9],c},lae={name:C7,transform:oae,Block:rae},aae={name:N7,AnnotatedLine:({annotation:t,...e})=>b.jsx(J1,{merge:e,data:{...e.data,triggeredRootBlockId:t.query}})},cae={name:T7,Block:({children:t})=>b.jsx(rle,{children:t})},uae=t=>typeof(t==null?void 0:t.triggeredRootBlockId)=="string"?t.triggeredRootBlockId:null,dae=t=>{const e=ee.c(11),{numberLabel:n,isSelected:s}=t,{selectLineLabel:i,onSelectLine:o}=_.use(Bf);if(o===void 0||i===void 0||n===""){let f;return e[0]!==n?(f=b.jsx("span",{className:Xw,children:n}),e[0]=n,e[1]=f):f=e[1],f}const r=`${i} ${n}`;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=Se(Xw,Gle),e[2]=a):a=e[2];let c;e[3]!==n||e[4]!==o?(c=f=>{o(n,f.shiftKey)},e[3]=n,e[4]=o,e[5]=c):c=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r||e[9]!==c?(d=b.jsx("button",{type:"button","aria-label":r,"aria-pressed":s,className:a,onClick:c,children:n}),e[6]=s,e[7]=n,e[8]=r,e[9]=c,e[10]=d):d=e[10],d},fae={name:Cle,Line:t=>{const{lines:e,isWrapped:n,addCommentLabel:s,selectedLineLabels:i,commentedLineKeys:o,markedLines:r,renderLineExtra:a,renderLineThreads:c,renderWaypointLane:d,renderThreadMark:f,renderCollapseControls:p,openRootBlockIds:m,onAddComment:g}=_.use(Bf),y=e.find((A,k)=>k===t.lineNumber-1),v=uae(t.data);if(y===void 0)return b.jsx(J1,{merge:t});const S=i.has(y.numberLabel),w=Qw(y),N=w===null?"":`${M_[y.mark]} ${w.lineLabel}`.trim(),C=d!==void 0,T=w===null||f===void 0?null:f(w),R=g===void 0||s===void 0||w===null?null:b.jsx("button",{type:"button","aria-label":`${s} ${N}`,title:s,className:Se(kle,C?_le:Ale),onClick:A=>{g(w,A.shiftKey)},children:b.jsx(jC,{"aria-hidden":"true",className:"size-3",strokeWidth:3})});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{"data-line":y.numberLabel,"data-mark":y.mark,"data-focused":y.isFocused,"data-selected":S,"data-commented":w!==null&&o.has(M7(w)),"data-comment-side":g===void 0||w==null?void 0:w.side,"data-comment-line":g===void 0||w==null?void 0:w.lineLabel,className:Se("group/line relative grid min-h-6 pr-4",C?Lle:Mle,Sle[y.mark],Rle,qle,Wle),children:[C?b.jsxs(b.Fragment,{children:[d(y),b.jsx("span",{className:"flex justify-center",children:T??R})]}):null,y.mark==="removed"&&y.removedNumberLabel!==""?b.jsx("span",{className:Xw,children:y.removedNumberLabel}):b.jsx(dae,{numberLabel:y.numberLabel,isSelected:S}),b.jsxs("span",{"data-diff-mark":"",className:Se("text-center font-bold select-none",Ele[y.mark]),children:[b.jsx("span",{"aria-hidden":"true",children:wle[y.mark]}),b.jsx("span",{className:"sr-only",children:M_[y.mark]})]}),b.jsx(J1,{merge:t,"data-marked":r.has(y),className:Se(O7,Ile,n?"wrap-anywhere whitespace-pre-wrap":"whitespace-pre")}),C?null:R,v===null||p===void 0?null:b.jsx("span",{"data-collapse-controls":"","data-open":m.has(v),className:Nle,children:p(v)})]}),a===void 0||y.numberLabel===""?null:a(y.numberLabel),c===void 0||w===null?null:c(w)]})}},hae={name:w7,Inline:({children:t})=>b.jsx("mark",{className:Se("text-inherit",Dle),children:t})},pae=t=>{const e=ee.c(21),{declaration:n}=t,{renderDefinitionDescription:s}=_.use(Bf),i=`${n.pathLabel}, ${n.rangeLabel}`;let o;e[0]!==n.pathLabel?(o=b.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:n.pathLabel}),e[0]=n.pathLabel,e[1]=o):o=e[1];let r;e[2]!==n.rangeLabel?(r=b.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.rangeLabel}),e[2]=n.rangeLabel,e[3]=r):r=e[3];let a;e[4]!==o||e[5]!==r?(a=b.jsxs("div",{className:R7,children:[o,r]}),e[4]=o,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==n.description||e[8]!==s?(c=n.description===null||s===void 0?null:b.jsx("div",{className:jle,children:s(n.description)}),e[7]=n.description,e[8]=s,e[9]=c):c=e[9];let d;e[10]!==n.lines||e[11]!==i?(d=n.lines.length===0?null:b.jsx(Au,{lines:n.lines,label:i,className:"flex-1 overflow-y-auto"}),e[10]=n.lines,e[11]=i,e[12]=d):d=e[12];let f;e[13]!==n.forgeLink||e[14]!==n.note?(f=n.note===null&&n.forgeLink===null?null:b.jsxs("div",{className:Ble,children:[n.note===null?null:b.jsx("span",{className:"text-muted-foreground",children:n.note}),n.forgeLink===null?null:b.jsx(Qa,{href:n.forgeLink.href,label:n.forgeLink.label})]}),e[13]=n.forgeLink,e[14]=n.note,e[15]=f):f=e[15];let p;return e[16]!==a||e[17]!==c||e[18]!==d||e[19]!==f?(p=b.jsxs(b.Fragment,{children:[a,c,d,f]}),e[16]=a,e[17]=c,e[18]=d,e[19]=f,e[20]=p):p=e[20],p},mae=t=>{const e=ee.c(16),{usages:n}=t;let s;e[0]!==n.nameLabel?(s=b.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:n.nameLabel}),e[0]=n.nameLabel,e[1]=s):s=e[1];let i;e[2]!==n.countLabel?(i=b.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.countLabel}),e[2]=n.countLabel,e[3]=i):i=e[3];let o;e[4]!==s||e[5]!==i?(o=b.jsxs("div",{className:R7,children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6];let r;e[7]!==n.files||e[8]!==n.nameLabel?(r=n.files.length===0?null:b.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.files.map(d=>b.jsxs("section",{"aria-label":d.pathLabel,className:"border-b last:border-b-0",children:[b.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-3 py-1.5 text-xs",children:[b.jsx("span",{className:"min-w-0 font-mono wrap-anywhere",children:d.pathLabel}),d.forgeLink===null?null:b.jsx(Qa,{href:d.forgeLink.href,label:d.forgeLink.label})]}),b.jsx(Au,{lines:d.lines,label:`${n.nameLabel} in ${d.pathLabel}`})]},d.pathLabel))}),e[7]=n.files,e[8]=n.nameLabel,e[9]=r):r=e[9];let a;e[10]!==n.note?(a=n.note===null?null:b.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground [contain:inline-size]",children:n.note}),e[10]=n.note,e[11]=a):a=e[11];let c;return e[12]!==o||e[13]!==r||e[14]!==a?(c=b.jsxs(b.Fragment,{children:[o,r,a]}),e[12]=o,e[13]=r,e[14]=a,e[15]=c):c=e[15],c},gae={name:E7,Inline:({annotation:t,children:e})=>{const{definitions:n,definitionCard:s,tabStopReferenceKey:i}=_.use(Bf);if(!Object.hasOwn(n,t.query))return b.jsx(b.Fragment,{children:e});const o=n[t.query],r=L7(t.lineNumber,t.fromColumn)===i;return b.jsx($m,{handle:s,payload:o,delay:Tle,render:b.jsx("span",{}),tabIndex:r?0:-1,"data-reference":"","aria-description":Jle(o),onKeyDown:Zle,className:Ple,children:e})}},yae=t=>{const e=ee.c(2),{handle:n}=t;let s;return e[0]!==n?(s=b.jsx(Bm,{handle:n,children:vae}),e[0]=n,e[1]=s):s=e[1],s},bae=[lae,cae,aae,fae,hae,gae];function Au(t){const e=ee.c(49),{lines:n,definitions:s,label:i,path:o,className:r,isWrapped:a,hasReferenceTabStop:c,addCommentLabel:d,selectLineLabel:f,selectedLineLabels:p,commentedLineKeys:m,markedLines:g,renderLineExtra:y,renderLineThreads:v,renderWaypointLane:S,renderThreadMark:w,renderDefinitionDescription:N,collapses:C,openRootBlockIds:T,renderCollapseControls:R,onRootBlockOpenChange:A,onAddComment:k,onSelectLine:M}=t,L=s===void 0?k7:s,j=a===void 0?!1:a,D=c===void 0?!0:c,P=p===void 0?ey:p,B=m===void 0?ey:m,I=g===void 0?A7:g,F=C===void 0?Kle:C,z=T===void 0?_7:T;let U;e[0]!==L||e[1]!==n?(U=I7(n,L),e[0]=L,e[1]=n,e[2]=U):U=e[2];const H=U;let V;e[3]!==D||e[4]!==H?(V=D?H.at(0)??null:null,e[3]=D,e[4]=H,e[5]=V):V=e[5];const W=V,[G]=_.useState(xae);let Y;e[6]!==d||e[7]!==B||e[8]!==G||e[9]!==L||e[10]!==j||e[11]!==n||e[12]!==I||e[13]!==k||e[14]!==A||e[15]!==M||e[16]!==z||e[17]!==R||e[18]!==N||e[19]!==y||e[20]!==v||e[21]!==w||e[22]!==S||e[23]!==f||e[24]!==P||e[25]!==W?(Y={lines:n,definitions:L,definitionCard:G,tabStopReferenceKey:W,isWrapped:j,addCommentLabel:d,selectLineLabel:f,selectedLineLabels:P,commentedLineKeys:B,markedLines:I,renderLineExtra:y,renderLineThreads:v,renderWaypointLane:S,renderThreadMark:w,renderDefinitionDescription:N,openRootBlockIds:z,renderCollapseControls:R,onRootBlockOpenChange:A,onAddComment:k,onSelectLine:M},e[6]=d,e[7]=B,e[8]=G,e[9]=L,e[10]=j,e[11]=n,e[12]=I,e[13]=k,e[14]=A,e[15]=M,e[16]=z,e[17]=R,e[18]=N,e[19]=y,e[20]=v,e[21]=w,e[22]=S,e[23]=f,e[24]=P,e[25]=W,e[26]=Y):Y=e[26];const J=Y;let q;e[27]!==F||e[28]!==n?(q=iae(n,F),e[27]=F,e[28]=n,e[29]=q):q=e[29];const X=q;let Z;e[30]!==r?(Z=Se("group/code overflow-x-auto bg-code py-2 font-mono text-sm leading-6",r),e[30]=r,e[31]=Z):Z=e[31];const te=j?"":"min-w-max";let Q;e[32]!==te?(Q=Se("m-0 grid",te),e[32]=te,e[33]=Q):Q=e[33];let se;e[34]!==X||e[35]!==Q?(se=b.jsx(Pre,{code:X,handlers:bae,className:Q}),e[34]=X,e[35]=Q,e[36]=se):se=e[36];let ae;e[37]!==G||e[38]!==H.length?(ae=H.length===0?null:b.jsx(yae,{handle:G}),e[37]=G,e[38]=H.length,e[39]=ae):ae=e[39];let le;e[40]!==J||e[41]!==se||e[42]!==ae?(le=b.jsxs(Bf,{value:J,children:[se,ae]}),e[40]=J,e[41]=se,e[42]=ae,e[43]=le):le=e[43];let ne;return e[44]!==i||e[45]!==o||e[46]!==Z||e[47]!==le?(ne=b.jsx("div",{role:"group","aria-label":i,"data-path":o,"data-code-block":"",className:Z,children:le}),e[44]=i,e[45]=o,e[46]=Z,e[47]=le,e[48]=ne):ne=e[48],ne}function xae(){return x7()}function vae(t){const{payload:e}=t;return e===void 0?null:b.jsx(Sb,{className:zle,children:e.kind==="usages"?b.jsx(mae,{usages:e}):b.jsx(pae,{declaration:e})})}const D7=t=>{const e=ee.c(25),{title:n,titleKind:s,kindLabel:i,target:o,codeViews:r,children:a,onClose:c}=t,d=s===void 0?"plain":s,f=r===void 0?null:r;let p;e[0]!==i?(p=b.jsx("p",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=p):p=e[1];const m=d==="code"&&"font-mono text-[0.8125rem] leading-5";let g;e[2]!==m?(g=Se("text-base leading-6 font-bold wrap-anywhere",m),e[2]=m,e[3]=g):g=e[3];let y;e[4]!==g||e[5]!==n?(y=b.jsx("h3",{className:g,children:n}),e[4]=g,e[5]=n,e[6]=y):y=e[6];let v;e[7]!==p||e[8]!==y?(v=b.jsxs("div",{className:"min-w-0 flex-1",children:[p,y]}),e[7]=p,e[8]=y,e[9]=v):v=e[9];let S;e[10]!==c?(S=b.jsx(xs,{icon:"close",label:"Close the code panel",onClick:c}),e[10]=c,e[11]=S):S=e[11];let w;e[12]!==v||e[13]!==S?(w=b.jsxs("div",{className:"sticky top-0 z-10 flex items-start gap-3 border-b bg-background px-4 py-3",children:[v,S]}),e[12]=v,e[13]=S,e[14]=w):w=e[14];let N;e[15]!==a?(N=b.jsx("div",{className:"flex flex-col gap-3 px-4 py-4 text-sm empty:hidden",children:a}),e[15]=a,e[16]=N):N=e[16];let C;e[17]!==o?(C=o===null?null:b.jsxs("div",{className:"border-t",children:[b.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[b.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:o.pathLabel}),b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:o.rangeLabel})]}),b.jsx(Au,{lines:o.lines,label:`${o.pathLabel}, ${o.rangeLabel}`,isWrapped:!0,className:"border-y"}),o.forgeLink===null?null:b.jsx(Qa,{href:o.forgeLink.href,label:o.forgeLink.label,className:"mx-4 my-2 text-xs"})]}),e[17]=o,e[18]=C):C=e[18];let T;return e[19]!==f||e[20]!==N||e[21]!==C||e[22]!==w||e[23]!==n?(T=b.jsxs("section",{"aria-label":n,className:"flex min-h-full flex-col",children:[w,N,f,C]}),e[19]=f,e[20]=N,e[21]=C,e[22]=w,e[23]=n,e[24]=T):T=e[24],T},j7=150,Sae="rounded-sm underline decoration-primary-text/60 decoration-1 underline-offset-[0.3em] transition-colors duration-[180ms] ease-out hover:text-primary-text hover:decoration-primary-text",wae="font-mono text-[0.875em]",Eae=t=>{var e;return t.anchorId===null?(e=t.forgeLink)==null?void 0:e.href:`#${t.anchorId}`},P7=t=>{const e=ee.c(16),{target:n}=t;let s;e[0]!==n.pathLabel?(s=b.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:n.pathLabel}),e[0]=n.pathLabel,e[1]=s):s=e[1];let i;e[2]!==n.rangeLabel?(i=b.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.rangeLabel}),e[2]=n.rangeLabel,e[3]=i):i=e[3];let o;e[4]!==s||e[5]!==i?(o=b.jsxs("div",{className:"flex items-baseline justify-between gap-4 border-b px-3 py-2",children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6];const r=`${n.pathLabel}, ${n.rangeLabel}`;let a;e[7]!==r||e[8]!==n.lines?(a=b.jsx(Au,{lines:n.lines,label:r,className:"min-h-0 flex-1 overflow-y-auto"}),e[7]=r,e[8]=n.lines,e[9]=a):a=e[9];let c;e[10]!==n.forgeLink?(c=n.forgeLink===null?null:b.jsx("div",{className:"border-t px-3 py-1.5",children:b.jsx(Qa,{href:n.forgeLink.href,label:n.forgeLink.label,className:"text-xs"})}),e[10]=n.forgeLink,e[11]=c):c=e[11];let d;return e[12]!==o||e[13]!==a||e[14]!==c?(d=b.jsxs(Sb,{className:"flex max-h-[26.25rem] w-[min(42.5rem,calc(100vw-2rem))] flex-col overflow-hidden",children:[o,a,c]}),e[12]=o,e[13]=a,e[14]=c,e[15]=d):d=e[15],d},Cae=t=>{const e=ee.c(19),{target:n,isCode:s,children:i,onOpen:o}=t,{anchorId:r}=n;let a;e[0]!==n?(a=Eae(n),e[0]=n,e[1]=a):a=e[1];const c=r===null?"_blank":void 0,d=r===null?"noreferrer":void 0,f=s?wae:"";let p;e[2]!==f?(p=Se(Sae,f),e[2]=f,e[3]=p):p=e[3];let m;e[4]!==r||e[5]!==o?(m=S=>{r!==null&&(S.preventDefault(),o(r))},e[4]=r,e[5]=o,e[6]=m):m=e[6];let g;e[7]!==i||e[8]!==a||e[9]!==c||e[10]!==d||e[11]!==p||e[12]!==m?(g=b.jsx($m,{delay:j7,href:a,target:c,rel:d,className:p,onClick:m,children:i}),e[7]=i,e[8]=a,e[9]=c,e[10]=d,e[11]=p,e[12]=m,e[13]=g):g=e[13];let y;e[14]!==n?(y=b.jsx(P7,{target:n}),e[14]=n,e[15]=y):y=e[15];let v;return e[16]!==g||e[17]!==y?(v=b.jsxs(Bm,{children:[g,y]}),e[16]=g,e[17]=y,e[18]=v):v=e[18],v},z7=_.createContext(null),Nae="Expand all",Tae="Collapse all",Oae="q",I_=new Set,B7=t=>t.kind==="accordion"?t.sections.map(e=>e.label):t.kind==="quote"?t.blocks.flatMap(B7):[],Rae=t=>t.flatMap(B7),kae=(t,e)=>new Set(t.has(e)?[...t].filter(n=>n!==e):[...t,e]),Aae=(t,e)=>{const n=ee.c(6),[s,i]=_.useState(I_);let o;if(n[0]!==e||n[1]!==s){const d=Rae(e),f=d.length>0&&d.every(p=>s.has(p));o=d.length===0?[]:[[rs({key:Oae,actionId:"expand-context-action",label:f?Tae:Nae,onRun:()=>{i(f?I_:new Set(d))}})]],n[0]=e,n[1]=s,n[2]=o}else o=n[2];L3(t,o);let a;n[3]===Symbol.for("react.memo_cache_sentinel")?(a=d=>{i(f=>kae(f,d))},n[3]=a):a=n[3];let c;return n[4]!==s?(c={openLabels:s,onToggle:a},n[4]=s,n[5]=c):c=n[5],c},$f=t=>t.map((e,n)=>({key:String(n),item:e})),D_=4,_ae=t=>t.inlines.flatMap(e=>e.kind==="code-link"?[e.text]:[]),Mae=t=>t.inlines.flatMap(e=>e.kind==="code"?[e.text]:[]),Lae=t=>[..._ae(t),...Mae(t)].slice(0,1),Iae=t=>{const e=t.flatMap(s=>s.kind==="list"?s.items:[]);if(e.length===0)return null;const n=e.flatMap(Lae);return{names:n.slice(0,D_),moreCount:Math.max(0,n.length-D_)}},$7="flex flex-wrap items-end gap-x-6 border-b border-border",F7="-mb-px cursor-pointer border-b-2 border-transparent pb-2 text-sm font-bold text-muted-foreground transition-colors duration-[180ms] ease-out hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-selected:border-[var(--line,var(--color-primary))] aria-selected:text-foreground",rS=0,H7=(t,e,n)=>{const s=n-1;return t==="ArrowRight"?e===s?rS:e+1:t==="ArrowLeft"?e===rS?s:e-1:t==="Home"?rS:t==="End"?s:null},Dae="pt-4 text-[1.1875rem] leading-7 font-semibold tracking-[-0.01em] text-foreground first:pt-0",j_="flex flex-col gap-2 pl-5",P_="rounded-sm bg-muted box-decoration-clone px-1.5 py-0.5 font-mono text-[0.875em]",jae="rounded-sm underline decoration-1 underline-offset-[0.3em] hover:text-primary-text",Pae="flex flex-col gap-4 border-l-2 border-border pl-4 text-muted-foreground",zae="overflow-x-auto rounded-md bg-code px-4 py-3 font-mono text-sm leading-6",Bae=t=>{const e=ee.c(17),{inline:n,codeLinks:s,onOpenCodeLink:i}=t;if(n.kind==="text")return n.text;if(n.kind==="strong"){let a;return e[0]!==n.text?(a=b.jsx("strong",{className:"font-bold",children:n.text}),e[0]=n.text,e[1]=a):a=e[1],a}if(n.kind==="emphasis"){let a;return e[2]!==n.text?(a=b.jsx("em",{children:n.text}),e[2]=n.text,e[3]=a):a=e[3],a}if(n.kind==="code"){let a;return e[4]!==n.text?(a=b.jsx("code",{className:P_,children:n.text}),e[4]=n.text,e[5]=a):a=e[5],a}if(n.kind==="link"){let a;return e[6]!==n.href||e[7]!==n.text?(a=b.jsx("a",{href:n.href,target:"_blank",rel:"noreferrer",className:jae,children:n.text}),e[6]=n.href,e[7]=n.text,e[8]=a):a=e[8],a}if(n.linkId===null||!Object.hasOwn(s,n.linkId)){let a;return e[9]!==n.isCode||e[10]!==n.text?(a=n.isCode?b.jsx("code",{className:P_,children:n.text}):n.text,e[9]=n.isCode,e[10]=n.text,e[11]=a):a=e[11],a}const o=s[n.linkId];let r;return e[12]!==n.isCode||e[13]!==n.text||e[14]!==i||e[15]!==o?(r=b.jsx(Cae,{target:o,isCode:n.isCode,onOpen:i,children:n.text}),e[12]=n.isCode,e[13]=n.text,e[14]=i,e[15]=o,e[16]=r):r=e[16],r},pf=({inlines:t,codeLinks:e,onOpenCodeLink:n})=>$f(t).map(({key:s,item:i})=>b.jsx(Bae,{inline:i,codeLinks:e,onOpenCodeLink:n},s)),Fm=({blocks:t,codeLinks:e,onOpenCodeLink:n})=>$f(t).map(({key:s,item:i})=>b.jsx(Kae,{block:i,codeLinks:e,onOpenCodeLink:n},s)),$ae=t=>{const e=ee.c(12),{item:n,codeLinks:s,onOpenCodeLink:i}=t,o=n.blocks.length===0?"":"space-y-2";let r;e[0]!==s||e[1]!==n.inlines||e[2]!==i?(r=n.inlines.length===0?null:b.jsx("span",{children:b.jsx(pf,{inlines:n.inlines,codeLinks:s,onOpenCodeLink:i})}),e[0]=s,e[1]=n.inlines,e[2]=i,e[3]=r):r=e[3];let a;e[4]!==s||e[5]!==n.blocks||e[6]!==i?(a=b.jsx(Fm,{blocks:n.blocks,codeLinks:s,onOpenCodeLink:i}),e[4]=s,e[5]=n.blocks,e[6]=i,e[7]=a):a=e[7];let c;return e[8]!==o||e[9]!==r||e[10]!==a?(c=b.jsxs("li",{className:o,children:[r,a]}),e[8]=o,e[9]=r,e[10]=a,e[11]=c):c=e[11],c},z_=(t,e)=>`${t}-tab-${String(e)}`,B_=(t,e)=>`${t}-panel-${String(e)}`,Fae=t=>{const e=ee.c(31),{tabs:n,codeLinks:s,onOpenCodeLink:i}=t,o=_.useId(),[r,a]=_.useState(0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const d=_.useRef(c);let f;e[1]!==r||e[2]!==n?(f=n.at(r)??n[0],e[1]=r,e[2]=n,e[3]=f):f=e[3];const p=f;let m;e[4]!==r||e[5]!==n.length?(m=R=>{var k;const A=H7(R.key,r,n.length);A!==null&&(R.preventDefault(),a(A),(k=d.current[A])==null||k.focus())},e[4]=r,e[5]=n.length,e[6]=m):m=e[6];const g=m;let y;e[7]!==g||e[8]!==r||e[9]!==n||e[10]!==o?(y=$f(n).map((R,A)=>{const{key:k,item:M}=R;return b.jsx("button",{ref:L=>{d.current[A]=L},type:"button",role:"tab",id:z_(o,A),"aria-selected":A===r,"aria-controls":B_(o,A),tabIndex:A===r?0:-1,className:F7,onClick:()=>{a(A)},onKeyDown:g,children:M.label},k)}),e[7]=g,e[8]=r,e[9]=n,e[10]=o,e[11]=y):y=e[11];let v;e[12]!==y?(v=b.jsx("div",{role:"tablist",className:$7,children:y}),e[12]=y,e[13]=v):v=e[13];let S;e[14]!==r||e[15]!==o?(S=B_(o,r),e[14]=r,e[15]=o,e[16]=S):S=e[16];let w;e[17]!==r||e[18]!==o?(w=z_(o,r),e[17]=r,e[18]=o,e[19]=w):w=e[19];let N;e[20]!==s||e[21]!==i||e[22]!==p.blocks?(N=b.jsx(Fm,{blocks:p.blocks,codeLinks:s,onOpenCodeLink:i}),e[20]=s,e[21]=i,e[22]=p.blocks,e[23]=N):N=e[23];let C;e[24]!==S||e[25]!==w||e[26]!==N?(C=b.jsx("div",{role:"tabpanel",id:S,"aria-labelledby":w,className:"flex flex-col gap-4",children:N}),e[24]=S,e[25]=w,e[26]=N,e[27]=C):C=e[27];let T;return e[28]!==v||e[29]!==C?(T=b.jsxs("div",{className:"flex flex-col gap-4",children:[v,C]}),e[28]=v,e[29]=C,e[30]=T):T=e[30],T},Hae="See change details",Uae="Hide change details",Vae="cursor-pointer rounded-sm text-sm text-foreground underline decoration-1 underline-offset-[0.3em] hover:text-primary-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",qae=t=>{const e=ee.c(9),{summary:n}=t;let s;e[0]!==n.names?(s=n.names.join(", "),e[0]=n.names,e[1]=s):s=e[1];let i;e[2]!==s?(i=b.jsx("span",{className:"font-mono text-[0.875em]",children:s}),e[2]=s,e[3]=i):i=e[3];let o;e[4]!==n.moreCount?(o=n.moreCount>0?b.jsx("span",{children:`+ ${String(n.moreCount)} more`}):null,e[4]=n.moreCount,e[5]=o):o=e[5];let r;return e[6]!==i||e[7]!==o?(r=b.jsxs(b.Fragment,{children:[i,o]}),e[6]=i,e[7]=o,e[8]=r):r=e[8],r},Wae=t=>{const e=ee.c(34),{section:n,codeLinks:s,onOpenCodeLink:i}=t,o=_.useId(),r=_.use(z7),[a,c]=_.useState(!1);let d;e[0]!==a||e[1]!==r||e[2]!==n.label?(d=r===null?a:r.openLabels.has(n.label),e[0]=a,e[1]=r,e[2]=n.label,e[3]=d):d=e[3];const f=d,p=`${o}-name`,m=`${o}-panel`;let g;e[4]!==n.blocks?(g=Iae(n.blocks),e[4]=n.blocks,e[5]=g):g=e[5];const y=g;let v;e[6]!==r||e[7]!==n.label?(v=()=>{r===null?c(Xae):r.onToggle(n.label)},e[6]=r,e[7]=n.label,e[8]=v):v=e[8];const S=f?Uae:Hae;let w;e[9]!==f||e[10]!==m||e[11]!==v||e[12]!==S?(w=b.jsx("button",{type:"button","aria-expanded":f,"aria-controls":m,className:Vae,onClick:v,children:S}),e[9]=f,e[10]=m,e[11]=v,e[12]=S,e[13]=w):w=e[13];const N=w;let C;e[14]!==p||e[15]!==n.label?(C=b.jsx("h4",{id:p,className:"text-sm font-bold text-foreground",children:n.label}),e[14]=p,e[15]=n.label,e[16]=C):C=e[16];let T;e[17]!==f||e[18]!==y?(T=!f&&y!==null?b.jsx(qae,{summary:y}):null,e[17]=f,e[18]=y,e[19]=T):T=e[19];let R;e[20]!==T||e[21]!==N?(R=b.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2 text-sm text-muted-foreground",children:[T,N]}),e[20]=T,e[21]=N,e[22]=R):R=e[22];let A;e[23]!==s||e[24]!==f||e[25]!==i||e[26]!==m||e[27]!==n.blocks?(A=f?b.jsx("div",{id:m,className:"flex flex-col gap-4",children:b.jsx(Fm,{blocks:n.blocks,codeLinks:s,onOpenCodeLink:i})}):null,e[23]=s,e[24]=f,e[25]=i,e[26]=m,e[27]=n.blocks,e[28]=A):A=e[28];let k;return e[29]!==p||e[30]!==C||e[31]!==R||e[32]!==A?(k=b.jsxs("section",{"aria-labelledby":p,className:"flex flex-col gap-2 py-3",children:[C,R,A]}),e[29]=p,e[30]=C,e[31]=R,e[32]=A,e[33]=k):k=e[33],k},Gae=t=>{const e=ee.c(9),{sections:n,codeLinks:s,onOpenCodeLink:i}=t;let o;if(e[0]!==s||e[1]!==i||e[2]!==n){let a;e[4]!==s||e[5]!==i?(a=c=>{const{key:d,item:f}=c;return b.jsx(Wae,{section:f,codeLinks:s,onOpenCodeLink:i},d)},e[4]=s,e[5]=i,e[6]=a):a=e[6],o=$f(n).map(a),e[0]=s,e[1]=i,e[2]=n,e[3]=o}else o=e[3];let r;return e[7]!==o?(r=b.jsx("div",{className:"flex flex-col divide-y divide-border border-y border-border",children:o}),e[7]=o,e[8]=r):r=e[8],r};function Kae(t){const e=ee.c(35),{block:n,codeLinks:s,onOpenCodeLink:i}=t;if(n.kind==="heading"){let c;return e[0]!==n.inlines||e[1]!==s||e[2]!==i?(c=b.jsx("h3",{className:Dae,children:b.jsx(pf,{inlines:n.inlines,codeLinks:s,onOpenCodeLink:i})}),e[0]=n.inlines,e[1]=s,e[2]=i,e[3]=c):c=e[3],c}if(n.kind==="paragraph"){let c;return e[4]!==n.inlines||e[5]!==s||e[6]!==i?(c=b.jsx("p",{children:b.jsx(pf,{inlines:n.inlines,codeLinks:s,onOpenCodeLink:i})}),e[4]=n.inlines,e[5]=s,e[6]=i,e[7]=c):c=e[7],c}if(n.kind==="quote"){let c;return e[8]!==n.blocks||e[9]!==s||e[10]!==i?(c=b.jsx("blockquote",{className:Pae,children:b.jsx(Fm,{blocks:n.blocks,codeLinks:s,onOpenCodeLink:i})}),e[8]=n.blocks,e[9]=s,e[10]=i,e[11]=c):c=e[11],c}if(n.kind==="accordion"){let c;return e[12]!==n.sections||e[13]!==s||e[14]!==i?(c=b.jsx(Gae,{sections:n.sections,codeLinks:s,onOpenCodeLink:i}),e[12]=n.sections,e[13]=s,e[14]=i,e[15]=c):c=e[15],c}if(n.kind==="tabs"){let c;return e[16]!==n.tabs||e[17]!==s||e[18]!==i?(c=b.jsx(Fae,{tabs:n.tabs,codeLinks:s,onOpenCodeLink:i}),e[16]=n.tabs,e[17]=s,e[18]=i,e[19]=c):c=e[19],c}if(n.kind==="code-block"){const c=n.language??void 0;let d;e[20]!==n.text?(d=b.jsx("code",{children:n.text}),e[20]=n.text,e[21]=d):d=e[21];let f;return e[22]!==c||e[23]!==d?(f=b.jsx("pre",{"data-language":c,className:zae,children:d}),e[22]=c,e[23]=d,e[24]=f):f=e[24],f}let o;if(e[25]!==n.items||e[26]!==s||e[27]!==i){let c;e[29]!==s||e[30]!==i?(c=d=>{const{key:f,item:p}=d;return b.jsx($ae,{item:p,codeLinks:s,onOpenCodeLink:i},f)},e[29]=s,e[30]=i,e[31]=c):c=e[31],o=$f(n.items).map(c),e[25]=n.items,e[26]=s,e[27]=i,e[28]=o}else o=e[28];const r=o;let a;return e[32]!==n.isOrdered||e[33]!==r?(a=n.isOrdered?b.jsx("ol",{className:Se(j_,"list-decimal"),children:r}):b.jsx("ul",{className:Se(j_,"list-disc"),children:r}),e[32]=n.isOrdered,e[33]=r,e[34]=a):a=e[34],a}const ho=t=>{const e=ee.c(9),{blocks:n,codeLinks:s,onOpenCodeLink:i,className:o}=t;let r;e[0]!==o?(r=Se("flex max-w-[68ch] flex-col gap-4 text-base leading-[1.7] text-pretty",o),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==s||e[4]!==i?(a=b.jsx(Fm,{blocks:n,codeLinks:s,onOpenCodeLink:i}),e[2]=n,e[3]=s,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==a?(c=b.jsx("div",{className:r,children:a}),e[6]=r,e[7]=a,e[8]=c):c=e[8],c},Yae=t=>{const e=ee.c(4),{blocks:n,codeLinks:s,onOpenCodeLink:i}=t;let o;return e[0]!==n||e[1]!==s||e[2]!==i?(o=b.jsx(ho,{blocks:n,codeLinks:s,onOpenCodeLink:i,className:"gap-2 text-sm leading-6"}),e[0]=n,e[1]=s,e[2]=i,e[3]=o):o=e[3],o};function Xae(t){return!t}const U7=_.createContext(null),Qae="block h-[0.7em] rounded-[0.225rem] bg-foreground/10 motion-safe:animate-pulse",Zae="w-3/5",V7=t=>{const e=ee.c(14),{label:n,lineCount:s,className:i,caption:o}=t,r=s===void 0?1:s,a=o===void 0?null:o;let c;e[0]!==r?(c=Array.from({length:r},Jae),e[0]=r,e[1]=c):c=e[1];const d=c;let f;e[2]!==i?(f=Se("flex min-w-0 flex-col justify-center gap-[0.6em] py-[0.3em]",i),e[2]=i,e[3]=f):f=e[3];let p;e[4]!==n?(p=b.jsx("span",{className:"sr-only",children:n}),e[4]=n,e[5]=p):p=e[5];let m;e[6]!==r||e[7]!==d?(m=d.map(y=>b.jsx("span",{"aria-hidden":"true",className:Se(Qae,r>1&&y===r-1?Zae:"")},y)),e[6]=r,e[7]=d,e[8]=m):m=e[8];let g;return e[9]!==a||e[10]!==f||e[11]!==p||e[12]!==m?(g=b.jsxs("span",{"data-unwritten":"true",className:f,children:[p,m,a]}),e[9]=a,e[10]=f,e[11]=p,e[12]=m,e[13]=g):g=e[13],g},Ja=t=>{const e=ee.c(7),{isPending:n,lineCount:s,className:i,caption:o,children:r}=t,a=_.use(U7);if(!n||a===null){let d;return e[0]!==r?(d=b.jsx(b.Fragment,{children:r}),e[0]=r,e[1]=d):d=e[1],d}let c;return e[2]!==o||e[3]!==i||e[4]!==s||e[5]!==a?(c=b.jsx(V7,{label:a,lineCount:s,className:i,caption:o}),e[2]=o,e[3]=i,e[4]=s,e[5]=a,e[6]=c):c=e[6],c};function Jae(t,e){return e}const ece=3,tce=t=>{const e=ee.c(4),{className:n}=t;let s;e[0]!==n?(s=Se("size-3.5 shrink-0 text-muted-foreground",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==s?(i=b.jsx(iQ,{"aria-hidden":"true",className:s}),e[2]=s,e[3]=i):i=e[3],i},Ff=t=>{const e=ee.c(6),{label:n,className:s}=t;let i;e[0]!==s?(i=Se("inline-flex items-center gap-1.5 text-sm text-muted-foreground",s),e[0]=s,e[1]=i):i=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(tce,{}),e[2]=o):o=e[2];let r;return e[3]!==n||e[4]!==i?(r=b.jsxs("span",{className:i,children:[o,n]}),e[3]=n,e[4]=i,e[5]=r):r=e[5],r},Bp=t=>{const e=ee.c(9),{label:n,keyLabel:s,icon:i,variant:o,actionId:r,onClick:a}=t,c=i===void 0?null:i,d=o===void 0?"outline":o;let f;e[0]!==s?(f=s===null?null:b.jsx("kbd",{"aria-hidden":"true",className:"inline-grid h-4 min-w-4 place-items-center rounded-sm border border-b-2 border-current/35 px-1 font-mono text-[0.625rem] leading-none font-bold uppercase opacity-80",children:s}),e[0]=s,e[1]=f):f=e[1];let p;return e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==a||e[6]!==f||e[7]!==d?(p=b.jsxs(ft,{type:"button",variant:d,size:"xs","data-user-action-id":r,onClick:a,children:[c,n,f]}),e[2]=r,e[3]=c,e[4]=n,e[5]=a,e[6]=f,e[7]=d,e[8]=p):p=e[8],p},q7=t=>{const e=ee.c(2),{label:n}=t;let s;return e[0]!==n?(s=b.jsx(V7,{label:n,lineCount:ece,className:"text-sm"}),e[0]=n,e[1]=s):s=e[1],s},W7=t=>{const e=ee.c(10),{hint:n,label:s,isBeingWritten:i,buttonLabel:o,onWriteUp:r}=t;let a;e[0]!==n?(a=n===null?null:b.jsx("p",{className:"text-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==o||e[3]!==i||e[4]!==s||e[5]!==r?(c=i?b.jsx(q7,{label:s}):b.jsxs(b.Fragment,{children:[b.jsx(Ff,{label:s}),r===null?null:b.jsx("div",{children:b.jsx(Bp,{label:o,keyLabel:Pf,actionId:"explain-part-action",onClick:r})})]}),e[2]=o,e[3]=i,e[4]=s,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=b.jsxs("div",{className:"flex flex-col gap-2",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d},nce=({x:t,y:e})=>`${String(t)} ${String(e)}`,Zw=t=>t.map((e,n)=>`${n===0?"M":"L"} ${nce(e)}`).join(" "),sce={nodeIds:new Set,edgeIds:new Set},Jw=(t,e)=>{if(e===null)return sce;const n=t.filter(s=>s.from===e||s.to===e);return{nodeIds:new Set([e,...n.flatMap(s=>[s.from,s.to])]),edgeIds:new Set(n.map(s=>s.id))}},G7=(t,e,n)=>{if(n.length===0)return e;const s=[...new Set(t.filter(i=>n.includes(i.from)).map(i=>i.to))].filter(i=>!e.has(i));return G7(t,new Set([...e,...s]),s)},ty=(t,e)=>G7(t,new Set(e),e),ice=t=>t.map(({id:e,from:n,to:s})=>({id:e,from:s,to:n})),oce=(t,e)=>new Set([...ty(ice(t),[e]),...ty(t,[e])]),rce=(t,e,n)=>{const s=t.filter(o=>!e.includes(o.from)&&!e.includes(o.to)),i=ty(s,n.filter(o=>!e.includes(o)));return new Set([...ty(t,e)].filter(o=>!i.has(o)))},lce=2,ace="M1 1.5 8 5 1 8.5z",cce="group absolute flex -translate-x-1/2 flex-col items-center rounded-sm text-center transition-opacity duration-[180ms] ease-out data-[standing=far]:opacity-25",uce="mt-0.5 rounded-sm bg-background px-1 font-mono text-[0.6875rem] leading-4 whitespace-nowrap text-muted-foreground transition-colors duration-[180ms] ease-out group-hover:text-foreground group-data-[quiet=false]:text-foreground group-data-[standing=focal]:font-bold group-data-[standing=focal]:text-foreground group-data-[standing=near]:text-foreground",dce="fill-none stroke-current opacity-55 transition-[color,opacity] duration-[180ms] ease-out [stroke-width:1.25] data-[standing=far]:opacity-15 data-[standing=near]:text-foreground data-[standing=near]:opacity-100",fce="Not assessed yet.",hce="The agent is assessing this file.",K7="Assess this file",pce="block w-full rounded-sm px-2 py-1 text-left font-mono text-[0.8125rem] leading-5 wrap-anywhere hover:bg-muted",$_=(t,e,n)=>n?t?"focal":e?"near":"far":"plain",F_=t=>{const e=ee.c(9),{list:n,onSelect:s}=t;let i;e[0]!==n.heading?(i=b.jsx("h4",{className:"text-xs font-bold text-muted-foreground tabular-nums",children:n.heading}),e[0]=n.heading,e[1]=i):i=e[1];let o;e[2]!==n.emptyLabel||e[3]!==n.files||e[4]!==s?(o=n.files.length===0?b.jsx("p",{className:"text-muted-foreground",children:n.emptyLabel}):b.jsx("ul",{className:"-mx-2 flex flex-col",children:n.files.map(a=>b.jsx("li",{children:b.jsx("button",{type:"button",className:pce,onClick:()=>{s(a.id)},children:a.label})},a.id))}),e[2]=n.emptyLabel,e[3]=n.files,e[4]=s,e[5]=o):o=e[5];let r;return e[6]!==i||e[7]!==o?(r=b.jsxs("div",{className:"flex flex-col gap-1",children:[i,o]}),e[6]=i,e[7]=o,e[8]=r):r=e[8],r},eE=t=>t.isUnassessed&&t.assessment!==null,mce=(t,e)=>t===null||e===null||!eE(t)||t.isBeingWritten?[]:[rs({key:Pf,actionId:"explain-blast-file-action",label:K7,onRun:()=>{e(t.path)}})],gce=(t,e)=>t.length===0?[e]:[...t.slice(0,-1),[...t[t.length-1],...e]],yce=t=>{const e=ee.c(23),{title:n,board:s,codeLinks:i,authoring:o,navigation:r,onWriteUpFile:a,onOpenCodeLink:c,onOpenFile:d}=t,f=r===void 0?null:r,p=a===void 0?null:a,m=_.useId(),[g,y]=_.useState(null),[v,S]=_.useState(null),[w,N]=_.useState(!1),[C,T]=_.useState(null);let R;if(e[0]!==o||e[1]!==s.edges||e[2]!==s.height||e[3]!==s.nodes||e[4]!==s.width||e[5]!==i||e[6]!==C||e[7]!==v||e[8]!==w||e[9]!==m||e[10]!==f||e[11]!==c||e[12]!==d||e[13]!==p||e[14]!==g||e[15]!==n){const A=s.nodes.find(W=>W.id===g)??null,k=v??g,M=s.edges.map(bce),L=Jw(M,k),j=k!==null,D=o!==null&&(A==null?void 0:A.assessment)!=null,P=D&&C===g;let B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{T(null)},e[17]=B):B=e[17];const I=B;let F;e[18]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{y(null),I()},e[18]=F):F=e[18];const z=F;let U;e[19]===Symbol.for("react.memo_cache_sentinel")?(U=W=>{N(W),W||z()},e[19]=U):U=e[19];let H;e[20]===Symbol.for("react.memo_cache_sentinel")?(H=b.jsx("path",{d:ace,fill:"context-stroke"}),e[20]=H):H=e[20];let V;e[21]!==m?(V=b.jsx("defs",{children:b.jsx("marker",{id:m,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:H})}),e[21]=m,e[22]=V):V=e[22],R=b.jsxs(t7,{label:n,width:s.width,height:s.height,isFullScreen:w,isCentred:!0,navigation:f===null?null:{...f,groups:gce(f.groups,mce(A,p))},onFullScreenChange:U,onPanelClose:z,panel:A===null?null:b.jsxs(D7,{title:A.path,titleKind:"code",kindLabel:A.markLabel,target:null,onClose:z,children:[P?o.renderImpactEditor(A,I):null,P||!eE(A)?null:b.jsx(W7,{hint:A.impactNote,label:A.isBeingWritten?hce:fce,isBeingWritten:A.isBeingWritten,buttonLabel:K7,onWriteUp:p===null?null:()=>{p(A.path)}}),P||eE(A)||A.impactNote===null?null:b.jsx(Ja,{isPending:A.isUnassessed,lineCount:2,children:b.jsx("p",{className:"text-muted-foreground",children:A.impactNote})}),P||A.impactReason===null?null:b.jsx(ho,{blocks:A.impactReason,codeLinks:i,onOpenCodeLink:c}),D&&!P?b.jsx(ft,{variant:"link",size:"sm",className:"self-start px-0",onClick:()=>{T(A.id)},children:o.editLabel}):null,b.jsx(F_,{list:A.importers,onSelect:y}),b.jsx(F_,{list:A.imports,onSelect:y}),A.fileLink===null?null:b.jsx("button",{type:"button",className:"self-start rounded-md border border-input bg-card px-2.5 py-1 text-[0.8rem] hover:bg-muted",onClick:()=>{const{anchorId:W}=A.fileLink??{anchorId:null};N(!1),z(),W!==null&&d(W)},children:A.fileLink.label})]}),children:[b.jsxs("svg",{"aria-hidden":"true",width:s.width,height:s.height,viewBox:`0 0 ${String(s.width)} ${String(s.height)}`,className:"pointer-events-none absolute inset-0 text-muted-foreground",children:[V,s.edges.map(W=>b.jsx("path",{d:Zw(W.points),"data-standing":$_(!1,L.edgeIds.has(W.id),j),markerEnd:`url(#${m})`,className:dce},W.id))]}),s.nodes.map(W=>b.jsxs("button",{type:"button",title:W.path,"aria-pressed":W.id===g,"data-user-action-id":"blast-diagram-card-action","data-mark":W.mark,"data-quiet":r_(W.mark),"data-standing":$_(W.id===k,L.nodeIds.has(W.id),j),className:cce,style:{left:W.x,top:W.y-s8(W.radius)/lce},onPointerEnter:()=>{S(W.id)},onPointerLeave:()=>{S(null)},onFocus:()=>{S(W.id)},onBlur:()=>{S(null)},onClick:()=>{y(W.id),N(!0)},children:[b.jsx(N3,{mark:W.mark,radius:W.radius}),b.jsx("span",{className:uce,children:W.label}),r_(W.mark)?null:b.jsx("span",{className:"rounded-sm bg-background px-1 text-[0.6875rem] leading-4 text-muted-foreground",children:W.markLabel})]},W.id))]}),e[0]=o,e[1]=s.edges,e[2]=s.height,e[3]=s.nodes,e[4]=s.width,e[5]=i,e[6]=C,e[7]=v,e[8]=w,e[9]=m,e[10]=f,e[11]=c,e[12]=d,e[13]=p,e[14]=g,e[15]=n,e[16]=R}else R=e[16];return R};function bce(t){return{id:t.id,from:t.importerId,to:t.importedId}}const xce={plain:"",code:"font-mono text-[0.94em]"},vce="not-last:after:ml-[0.5em] not-last:after:font-sans not-last:after:content-['•']",mf=t=>{const e=ee.c(7),{segments:n,className:s}=t;let i;e[0]!==s?(i=Se("flex flex-wrap gap-x-[0.5em]",s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==n?(o=n.map(Sce),e[2]=n,e[3]=o):o=e[3];let r;return e[4]!==i||e[5]!==o?(r=b.jsx("span",{className:i,children:o}),e[4]=i,e[5]=o,e[6]=r):r=e[6],r};function Sce(t){return b.jsx("span",{className:Se("min-w-0 wrap-anywhere",vce,xce[t.kind]),children:t.text},`${t.kind}:${t.text}`)}const wce=4,Ece=2,Cce={"export-bound":"e","import-bound":"q"},Nce=t=>{const e=ee.c(62),{anchorId:n,heading:s,defaultViewId:i,assessmentForm:o,views:r,codeLinks:a,writeUpNotice:c,onWriteUpFile:d,renderImpactEditor:f,onOpenCodeLink:p,onOpenFile:m}=t,g=c===void 0?null:c,y=d===void 0?null:d,[v,S]=_.useState(null);let w,N,C,T,R,A,k,M,L,j,D;if(e[0]!==n||e[1]!==v||e[2]!==i||e[3]!==s||e[4]!==r||e[5]!==g){C=Symbol.for("react.early_return_sentinel");e:{if(D=r.find(q=>q.id===(v??i))??r.at(0),D===void 0){C=null;break e}M=n,L=`${n}-heading`,j="blast-diagram-section",w="scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8";const G=`${n}-heading`;let Y;e[17]!==s||e[18]!==G?(Y=b.jsx("h2",{id:G,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:s}),e[17]=s,e[18]=G,e[19]=Y):Y=e[19];let J;e[20]!==g?(J=g===null?null:b.jsx(Ff,{label:g}),e[20]=g,e[21]=J):J=e[21],e[22]!==Y||e[23]!==J?(N=b.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[Y,J]}),e[22]=Y,e[23]=J,e[24]=N):N=e[24],A="flex flex-col gap-y-1 pb-2 text-sm",k=b.jsx(mf,{segments:D.summary.map(Tce),className:"tabular-nums"}),T="flex flex-wrap items-center gap-x-5 gap-y-1 text-muted-foreground",R=D.legend.map(Oce)}e[0]=n,e[1]=v,e[2]=i,e[3]=s,e[4]=r,e[5]=g,e[6]=w,e[7]=N,e[8]=C,e[9]=T,e[10]=R,e[11]=A,e[12]=k,e[13]=M,e[14]=L,e[15]=j,e[16]=D}else w=e[6],N=e[7],C=e[8],T=e[9],R=e[10],A=e[11],k=e[12],M=e[13],L=e[14],j=e[15],D=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=b.jsxs("svg",{"aria-hidden":"true",width:"22",height:"10",viewBox:"0 0 22 10",className:"shrink-0",children:[b.jsx("path",{d:"M1 5h14",className:"fill-none stroke-current [stroke-width:1.25]"}),b.jsx("path",{d:"M14 1.5 21 5 14 8.5z",className:"fill-current"})]}),e[25]=P):P=e[25];let B;e[26]!==D.edgeLegendLabel?(B=b.jsxs("li",{className:"flex items-center gap-1.5",children:[P,D.edgeLegendLabel]}),e[26]=D.edgeLegendLabel,e[27]=B):B=e[27];let I;e[28]!==B||e[29]!==T||e[30]!==R?(I=b.jsxs("ul",{className:T,children:[R,B]}),e[28]=B,e[29]=T,e[30]=R,e[31]=I):I=e[31];let F;e[32]!==I||e[33]!==A||e[34]!==k?(F=b.jsxs("div",{className:A,children:[k,I]}),e[32]=I,e[33]=A,e[34]=k,e[35]=F):F=e[35];let z;e[36]!==D.id||e[37]!==r?(z=r.length<Ece?[]:[r.map(G=>rs({key:Cce[G.id],actionId:"blast-view-action",label:G.label,description:G.description,isPressed:G.id===D.id,onRun:()=>{S(G.id)}}))],e[36]=D.id,e[37]=r,e[38]=z):z=e[38];let U;e[39]!==n||e[40]!==z?(U={anchorId:n,groups:z},e[39]=n,e[40]=z,e[41]=U):U=e[41];let H;e[42]!==o||e[43]!==f?(H=f===null?null:{editLabel:o.editLabel,renderImpactEditor:(G,Y)=>G.assessment===null?null:f({path:G.path,assessment:G.assessment,form:o,onClose:Y})},e[42]=o,e[43]=f,e[44]=H):H=e[44];let V;e[45]!==a||e[46]!==s||e[47]!==p||e[48]!==m||e[49]!==y||e[50]!==U||e[51]!==H||e[52]!==D.board?(V=b.jsx(yce,{title:s,board:D.board,codeLinks:a,onWriteUpFile:y,navigation:U,authoring:H,onOpenCodeLink:p,onOpenFile:m}),e[45]=a,e[46]=s,e[47]=p,e[48]=m,e[49]=y,e[50]=U,e[51]=H,e[52]=D.board,e[53]=V):V=e[53];let W;return e[54]!==w||e[55]!==N||e[56]!==F||e[57]!==V||e[58]!==M||e[59]!==L||e[60]!==j?(W=b.jsxs("section",{id:M,"aria-labelledby":L,"data-view-section-id":j,className:w,children:[N,F,V]}),e[54]=w,e[55]=N,e[56]=F,e[57]=V,e[58]=M,e[59]=L,e[60]=j,e[61]=W):W=e[61],W};function Tce(t){return{text:t,kind:"plain"}}function Oce(t){return b.jsxs("li",{className:"flex items-center gap-1.5",children:[b.jsx(N3,{mark:t.mark,radius:wce}),t.label]},t.mark)}const Rce={pickedLabels:[],text:""},kce="No answer",Ace="mt-0.5 size-4 shrink-0 accent-(--primary)",_ce="min-h-12 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",Mce="max-h-40 overflow-auto rounded-sm bg-muted px-1.5 py-1 font-mono text-[0.6875rem] leading-4 whitespace-pre-wrap wrap-anywhere",Lce={open:"font-bold text-signal-text",answered:"text-muted-foreground",withdrawn:"text-muted-foreground italic"},Ice=(t,e,n,s)=>{if(!n.allowsMultiple)return s?[e]:[];const i=t.filter(o=>o!==e);return s?[...i,e]:i},Dce=(t,e)=>({questionId:t.id,pickedLabels:e.pickedLabels,text:e.text.trim()===""?null:e.text}),Y7=t=>{const e=ee.c(2),{detail:n}=t;let s;return e[0]!==n?(s=n===null?null:b.jsx("pre",{className:Mce,children:n}),e[0]=n,e[1]=s):s=e[1],s},jce=t=>{const e=ee.c(25),{question:n,draft:s,onDraftChange:i}=t,o=_.useId(),r=_.useId();let a;e[0]!==n.prompt?(a=b.jsx("legend",{className:"pb-1 text-sm font-bold",children:n.prompt}),e[0]=n.prompt,e[1]=a):a=e[1];let c;e[2]!==n.detail?(c=b.jsx(Y7,{detail:n.detail}),e[2]=n.detail,e[3]=c):c=e[3];let d;e[4]!==s||e[5]!==o||e[6]!==i||e[7]!==n?(d=n.options.map(y=>b.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-sm",children:[b.jsx("input",{type:n.allowsMultiple?"checkbox":"radio",name:o,checked:s.pickedLabels.includes(y.label),className:Ace,onChange:v=>{i({...s,pickedLabels:Ice(s.pickedLabels,y.label,n,v.target.checked)})}}),b.jsxs("span",{className:"min-w-0",children:[b.jsx("span",{className:"block",children:y.label}),y.description===""?null:b.jsx("span",{className:"block text-xs text-muted-foreground",children:y.description})]})]},y.label)),e[4]=s,e[5]=o,e[6]=i,e[7]=n,e[8]=d):d=e[8];let f;e[9]!==n.textLabel||e[10]!==r?(f=b.jsx("label",{htmlFor:r,className:"text-xs text-muted-foreground",children:n.textLabel}),e[9]=n.textLabel,e[10]=r,e[11]=f):f=e[11];let p;e[12]!==s||e[13]!==i?(p=y=>{i({...s,text:y.target.value})},e[12]=s,e[13]=i,e[14]=p):p=e[14];let m;e[15]!==s.text||e[16]!==p||e[17]!==r?(m=b.jsx("textarea",{id:r,value:s.text,className:_ce,onChange:p}),e[15]=s.text,e[16]=p,e[17]=r,e[18]=m):m=e[18];let g;return e[19]!==a||e[20]!==c||e[21]!==d||e[22]!==f||e[23]!==m?(g=b.jsxs("fieldset",{className:"flex flex-col gap-2",children:[a,c,d,f,m]}),e[19]=a,e[20]=c,e[21]=d,e[22]=f,e[23]=m,e[24]=g):g=e[24],g},Pce=t=>{const e=ee.c(10),{question:n}=t;let s;e[0]!==n.prompt?(s=b.jsx("p",{className:"text-sm font-bold",children:n.prompt}),e[0]=n.prompt,e[1]=s):s=e[1];let i;e[2]!==n.detail?(i=b.jsx(Y7,{detail:n.detail}),e[2]=n.detail,e[3]=i):i=e[3];const o=n.answerLabel??kce;let r;e[4]!==o?(r=b.jsx("p",{className:"text-sm",children:o}),e[4]=o,e[5]=r):r=e[5];let a;return e[6]!==s||e[7]!==i||e[8]!==r?(a=b.jsxs("div",{className:"flex flex-col gap-1",children:[s,i,r]}),e[6]=s,e[7]=i,e[8]=r,e[9]=a):a=e[9],a},zce=t=>{const e=ee.c(34),{batch:n,isAnswering:s,problem:i,onAnswer:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},e[0]=r):r=e[0];const[a,c]=_.useState(r);let d;e[1]!==a?(d=L=>a[L.id]??Rce,e[1]=a,e[2]=d):d=e[2];const f=d,p=n.status==="open",m=n.heading,g=n.status,y=p?"border-signal":"";let v;e[3]!==y?(v=Se("flex flex-col gap-3 rounded-lg border px-3 py-2.5 text-sm",y),e[3]=y,e[4]=v):v=e[4];let S;e[5]!==n.heading?(S=b.jsx("span",{className:"font-bold",children:n.heading}),e[5]=n.heading,e[6]=S):S=e[6];let w;e[7]!==n.timeLabel?(w=b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:n.timeLabel}),e[7]=n.timeLabel,e[8]=w):w=e[8];let N;e[9]!==S||e[10]!==w?(N=b.jsxs("p",{className:"flex items-baseline gap-2",children:[S,w]}),e[9]=S,e[10]=w,e[11]=N):N=e[11];const C=Lce[n.status];let T;e[12]!==C?(T=Se("text-xs",C),e[12]=C,e[13]=T):T=e[13];let R;e[14]!==n.statusLabel||e[15]!==T?(R=b.jsx("p",{className:T,children:n.statusLabel}),e[14]=n.statusLabel,e[15]=T,e[16]=R):R=e[16];let A;e[17]!==R||e[18]!==N?(A=b.jsxs("div",{className:"flex flex-col",children:[N,R]}),e[17]=R,e[18]=N,e[19]=A):A=e[19];let k;e[20]!==n.questions||e[21]!==n.submitLabel||e[22]!==f||e[23]!==s||e[24]!==p||e[25]!==o||e[26]!==i?(k=p?b.jsxs("form",{className:"flex flex-col gap-4",onSubmit:L=>{L.preventDefault(),o(n.questions.map(j=>Dce(j,f(j))))},children:[n.questions.map(L=>b.jsx(jce,{question:L,draft:f(L),onDraftChange:j=>{c(D=>({...D,[L.id]:j}))}},L.id)),i===null?null:b.jsx("p",{role:"alert",className:"text-sm text-destructive",children:i}),b.jsx(ft,{type:"submit",size:"sm",disabled:s,className:"self-end",children:n.submitLabel})]}):n.questions.map(Bce),e[20]=n.questions,e[21]=n.submitLabel,e[22]=f,e[23]=s,e[24]=p,e[25]=o,e[26]=i,e[27]=k):k=e[27];let M;return e[28]!==n.heading||e[29]!==n.status||e[30]!==A||e[31]!==k||e[32]!==v?(M=b.jsxs("section",{"aria-label":m,"data-status":g,className:v,children:[A,k]}),e[28]=n.heading,e[29]=n.status,e[30]=A,e[31]=k,e[32]=v,e[33]=M):M=e[33],M};function Bce(t){return b.jsx(Pce,{question:t},t.id)}const $ce=t=>{const e=ee.c(28),{label:n,options:s,value:i,className:o,errorMessage:r,isLabelHidden:a,onChange:c}=t,d=r===void 0?null:r,f=a===void 0?!1:a,p=_.useId(),m=_.useId();let g;e[0]!==o?(g=Se("grid gap-1.5",o),e[0]=o,e[1]=g):g=e[1];const y=f?"sr-only":"text-sm font-bold";let v;e[2]!==p||e[3]!==n||e[4]!==y?(v=b.jsx("label",{htmlFor:p,className:y,children:n}),e[2]=p,e[3]=n,e[4]=y,e[5]=v):v=e[5];const S=d!==null,w=d===null?void 0:m;let N;e[6]!==c?(N=L=>{c(L.target.value)},e[6]=c,e[7]=N):N=e[7];let C;e[8]!==s?(C=s.map(Fce),e[8]=s,e[9]=C):C=e[9];let T;e[10]!==p||e[11]!==S||e[12]!==w||e[13]!==N||e[14]!==C||e[15]!==i?(T=b.jsx("select",{id:p,value:i,"aria-invalid":S,"aria-describedby":w,className:"h-8 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card pr-8 pl-2.5 text-sm transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",onChange:N,children:C}),e[10]=p,e[11]=S,e[12]=w,e[13]=N,e[14]=C,e[15]=i,e[16]=T):T=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=b.jsx(lu,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"}),e[17]=R):R=e[17];let A;e[18]!==T?(A=b.jsxs("div",{className:"relative",children:[T,R]}),e[18]=T,e[19]=A):A=e[19];let k;e[20]!==m||e[21]!==d?(k=d===null?null:b.jsx("p",{id:m,role:"alert",className:"text-sm text-destructive",children:d}),e[20]=m,e[21]=d,e[22]=k):k=e[22];let M;return e[23]!==A||e[24]!==k||e[25]!==g||e[26]!==v?(M=b.jsxs("div",{className:g,children:[v,A,k]}),e[23]=A,e[24]=k,e[25]=g,e[26]=v,e[27]=M):M=e[27],M};function Fce(t){return b.jsx("option",{value:t.value,children:t.label},t.value)}const Hce="Remove the reference",Uce="min-h-16 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",X7="self-start rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.6875rem] leading-4 wrap-anywhere",Vce={online:"fill-(--line) stroke-(--line) [stroke-width:2]",offline:"fill-background stroke-muted-foreground [stroke-width:2]"},qce=t=>{const e=ee.c(17),{message:n,codeLinks:s,onOpenCodeLink:i}=t;let o;e[0]!==n.authorLabel?(o=b.jsx("span",{className:"font-bold",children:n.authorLabel}),e[0]=n.authorLabel,e[1]=o):o=e[1];let r;e[2]!==n.timeLabel?(r=b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:n.timeLabel}),e[2]=n.timeLabel,e[3]=r):r=e[3];let a;e[4]!==o||e[5]!==r?(a=b.jsxs("p",{className:"flex items-baseline gap-2",children:[o,r]}),e[4]=o,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==n.reference?(c=n.reference===null?null:b.jsx("p",{className:X7,children:n.reference}),e[7]=n.reference,e[8]=c):c=e[8];let d;e[9]!==s||e[10]!==n.body||e[11]!==i?(d=b.jsx(ho,{blocks:n.body,codeLinks:s,onOpenCodeLink:i}),e[9]=s,e[10]=n.body,e[11]=i,e[12]=d):d=e[12];let f;return e[13]!==a||e[14]!==c||e[15]!==d?(f=b.jsxs(b.Fragment,{children:[a,c,d]}),e[13]=a,e[14]=c,e[15]=d,e[16]=f):f=e[16],f},Wce=t=>{var ve;const e=ee.c(82),{conversation:n,modelChoice:s,codeLinks:i,reference:o,isSending:r,sendProblem:a,answering:c,onSend:d,onAnswer:f,onChooseModel:p,onClearReference:m,onOpenCodeLink:g,onClose:y}=t,[v,S]=_.useState(""),w=_.useRef(null),N=((ve=n.entries.at(-1))==null?void 0:ve.id)??null,C=s!==null;let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{const we=w.current;we==null||we.scrollTo({top:we.scrollHeight})},e[0]=T):T=e[0];let R;e[1]!==C||e[2]!==N?(R=[N,C],e[1]=C,e[2]=N,e[3]=R):R=e[3],_.useEffect(T,R);let A;e[4]!==v||e[5]!==d?(A=()=>{d(v),S("")},e[4]=v,e[5]=d,e[6]=A):A=e[6];const k=A,M=n.heading;let L;e[7]!==n.heading?(L=b.jsx("h2",{className:"text-base leading-6 font-bold",children:n.heading}),e[7]=n.heading,e[8]=L):L=e[8];const j=n.agentState,D=Vce[n.agentState];let P;e[9]!==D?(P=Se("transition-[fill,stroke] duration-[180ms] ease-out",D),e[9]=D,e[10]=P):P=e[10];let B;e[11]!==P?(B=b.jsx("circle",{cx:"6",cy:"6",r:"4",className:P}),e[11]=P,e[12]=B):B=e[12];let I;e[13]!==n.agentState||e[14]!==B?(I=b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 12 12","data-state":j,className:"size-3",children:B}),e[13]=n.agentState,e[14]=B,e[15]=I):I=e[15];let F;e[16]!==n.agentStateLabel?(F=b.jsx("span",{role:"status",children:n.agentStateLabel}),e[16]=n.agentStateLabel,e[17]=F):F=e[17];let z;e[18]!==I||e[19]!==F?(z=b.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[I,F]}),e[18]=I,e[19]=F,e[20]=z):z=e[20];let U;e[21]!==z||e[22]!==L?(U=b.jsxs("div",{className:"min-w-0 flex-1",children:[L,z]}),e[21]=z,e[22]=L,e[23]=U):U=e[23];let H;e[24]!==n.closeLabel||e[25]!==y?(H=b.jsx(xs,{icon:"close",label:n.closeLabel,onClick:y}),e[24]=n.closeLabel,e[25]=y,e[26]=H):H=e[26];let V;e[27]!==U||e[28]!==H?(V=b.jsxs("div",{className:"flex items-start gap-3 border-b px-4 py-3",children:[U,H]}),e[27]=U,e[28]=H,e[29]=V):V=e[29];let W;e[30]!==s||e[31]!==p?(W=s===null?null:b.jsxs("div",{className:"flex flex-col gap-1 border-b px-4 py-2",children:[b.jsx($ce,{label:s.label,options:s.options,value:s.selectedModel,onChange:p}),b.jsx("p",{className:"text-xs text-muted-foreground",children:s.hint})]}),e[30]=s,e[31]=p,e[32]=W):W=e[32];let G;e[33]!==n.emptyMessage?(G=n.emptyMessage===null?null:b.jsx("li",{className:"text-sm text-muted-foreground",children:n.emptyMessage}),e[33]=n.emptyMessage,e[34]=G):G=e[34];let Y;if(e[35]!==c||e[36]!==i||e[37]!==n.entries||e[38]!==f||e[39]!==g){let we;e[41]!==c||e[42]!==i||e[43]!==f||e[44]!==g?(we=Ce=>{var ye;return b.jsx("li",{"data-author":Ce.kind==="message"?Ce.author:void 0,className:"flex flex-col gap-1 text-sm",children:Ce.kind==="message"?b.jsx(qce,{message:Ce,codeLinks:i,onOpenCodeLink:g}):b.jsx(zce,{batch:Ce,isAnswering:c.pendingBatchId===Ce.id,problem:((ye=c.rejection)==null?void 0:ye.batchId)===Ce.id?c.rejection.message:null,onAnswer:Oe=>{f(Ce.id,Oe)}})},Ce.id)},e[41]=c,e[42]=i,e[43]=f,e[44]=g,e[45]=we):we=e[45],Y=n.entries.map(we),e[35]=c,e[36]=i,e[37]=n.entries,e[38]=f,e[39]=g,e[40]=Y}else Y=e[40];let J;e[46]!==G||e[47]!==Y?(J=b.jsxs("ol",{ref:w,"aria-live":"polite",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4",children:[G,Y]}),e[46]=G,e[47]=Y,e[48]=J):J=e[48];let q;e[49]!==k?(q=we=>{we.preventDefault(),k()},e[49]=k,e[50]=q):q=e[50];let X;e[51]!==m||e[52]!==o?(X=o===null?null:b.jsxs("p",{className:"flex items-start gap-1",children:[b.jsx("span",{className:Se(X7,"flex-1"),children:o}),b.jsx(xs,{icon:"close",label:Hce,className:"size-5",onClick:m})]}),e[51]=m,e[52]=o,e[53]=X):X=e[53];let Z;e[54]===Symbol.for("react.memo_cache_sentinel")?(Z=we=>{S(we.target.value)},e[54]=Z):Z=e[54];let te;e[55]!==v||e[56]!==k?(te=we=>{we.key!=="Enter"||we.shiftKey||v.trim()===""||(we.preventDefault(),k())},e[55]=v,e[56]=k,e[57]=te):te=e[57];let Q;e[58]!==v||e[59]!==n.placeholder||e[60]!==te?(Q=b.jsx("textarea",{"aria-label":n.placeholder,placeholder:n.placeholder,value:v,className:Uce,onChange:Z,onKeyDown:te}),e[58]=v,e[59]=n.placeholder,e[60]=te,e[61]=Q):Q=e[61];let se;e[62]!==a?(se=a===null?null:b.jsx("p",{role:"alert",className:"text-xs text-destructive",children:a}),e[62]=a,e[63]=se):se=e[63];let ae;e[64]!==v||e[65]!==r?(ae=r||v.trim()==="",e[64]=v,e[65]=r,e[66]=ae):ae=e[66];let le;e[67]!==n.sendLabel||e[68]!==ae?(le=b.jsx(ft,{type:"submit",size:"sm",disabled:ae,className:"self-end",children:n.sendLabel}),e[67]=n.sendLabel,e[68]=ae,e[69]=le):le=e[69];let ne;e[70]!==q||e[71]!==X||e[72]!==Q||e[73]!==se||e[74]!==le?(ne=b.jsxs("form",{className:"flex flex-col gap-2 border-t px-4 py-3",onSubmit:q,children:[X,Q,se,le]}),e[70]=q,e[71]=X,e[72]=Q,e[73]=se,e[74]=le,e[75]=ne):ne=e[75];let fe;return e[76]!==n.heading||e[77]!==V||e[78]!==W||e[79]!==J||e[80]!==ne?(fe=b.jsxs("aside",{"aria-label":M,className:"fixed top-14 right-0 bottom-0 z-30 flex w-(--chat-width) flex-col border-l bg-background duration-200 ease-out animate-in slide-in-from-right-8",children:[V,W,J,ne]}),e[76]=n.heading,e[77]=V,e[78]=W,e[79]=J,e[80]=ne,e[81]=fe):fe=e[81],fe};function gl(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(c8,{"data-slot":"dialog",...n}),e[2]=n,e[3]=s):s=e[3],s}function O_e(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(Zne,{"data-slot":"dialog-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Gce(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(a8,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=s):s=e[3],s}function R_e(t){const e=ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=b.jsx(T3,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=s):s=e[3],s}function Kce(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("fixed inset-0 isolate z-50 bg-sign/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(Bne,{"data-slot":"dialog-overlay",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function yl(t){const e=ee.c(15);let n,s,i,o;e[0]!==t?({className:s,children:n,showCloseButton:o,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o):(n=e[1],s=e[2],i=e[3],o=e[4]);const r=o===void 0?!0:o;let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx(Kce,{}),e[5]=a):a=e[5];let c;e[6]!==s?(c=Se("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-foreground bg-popover p-5 text-sm text-popover-foreground duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",s),e[6]=s,e[7]=c):c=e[7];let d;e[8]!==r?(d=r&&b.jsxs(T3,{"data-slot":"dialog-close",render:b.jsx(ft,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[b.jsx(Ky,{}),b.jsx("span",{className:"sr-only",children:"Close"})]}),e[8]=r,e[9]=d):d=e[9];let f;return e[10]!==n||e[11]!==i||e[12]!==c||e[13]!==d?(f=b.jsxs(Gce,{children:[a,b.jsxs(l8,{"data-slot":"dialog-content",className:c,...i,children:[n,d]})]}),e[10]=n,e[11]=i,e[12]=c,e[13]=d,e[14]=f):f=e[14],f}function bl(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("flex flex-col gap-2",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx("div",{"data-slot":"dialog-header",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function xl(t){const e=ee.c(14);let n,s,i,o;e[0]!==t?({className:s,showCloseButton:o,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o):(n=e[1],s=e[2],i=e[3],o=e[4]);const r=o===void 0?!1:o;let a;e[5]!==s?(a=Se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),e[5]=s,e[6]=a):a=e[6];let c;e[7]!==r?(c=r&&b.jsx(T3,{render:b.jsx(ft,{variant:"outline"}),children:"Close"}),e[7]=r,e[8]=c):c=e[8];let d;return e[9]!==n||e[10]!==i||e[11]!==a||e[12]!==c?(d=b.jsxs("div",{"data-slot":"dialog-footer",className:a,...i,children:[n,c]}),e[9]=n,e[10]=i,e[11]=a,e[12]=c,e[13]=d):d=e[13],d}function vl(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("font-heading text-lg leading-7 font-bold",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx(Qne,{"data-slot":"dialog-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}function Sl(t){const e=ee.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=Se("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==s||e[6]!==i?(o=b.jsx($ne,{"data-slot":"dialog-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=o):o=e[7],o}const Q7="grid gap-2 border-t border-border pt-4",Z7="text-muted-foreground",Yce="copy-launch-agent-prompt",Xce=t=>{const e=ee.c(16),{option:n,isOpening:s,problem:i,onOpenTerminal:o}=t;let r;e[0]!==s?(r=s?b.jsx(vw,{"aria-hidden":"true",className:"motion-safe:animate-spin"}):null,e[0]=s,e[1]=r):r=e[1];let a;e[2]!==s||e[3]!==o||e[4]!==n.label||e[5]!==r?(a=b.jsxs(ft,{type:"button",className:"justify-self-start",disabled:s,"aria-busy":s,onClick:o,children:[r,n.label]}),e[2]=s,e[3]=o,e[4]=n.label,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==n.description?(c=b.jsx("p",{className:Z7,children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==i?(d=i===null?null:b.jsx("p",{role:"alert",className:"text-destructive",children:i}),e[9]=i,e[10]=d):d=e[10];let f;return e[11]!==n.label||e[12]!==a||e[13]!==c||e[14]!==d?(f=b.jsxs("section",{"aria-label":n.label,className:Q7,children:[a,c,d]}),e[11]=n.label,e[12]=a,e[13]=c,e[14]=d,e[15]=f):f=e[15],f},Qce=t=>{const e=ee.c(22),{option:n,onCopy:s}=t,i=_.useId();let o;e[0]!==i||e[1]!==n.label?(o=b.jsx("h3",{id:i,className:"font-bold",children:n.label}),e[0]=i,e[1]=n.label,e[2]=o):o=e[2];let r;e[3]!==n.description?(r=b.jsx("p",{className:Z7,children:n.description}),e[3]=n.description,e[4]=r):r=e[4];let a;e[5]!==n.prompt?(a=b.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-[0.8125rem] leading-5 select-all",children:b.jsx("code",{children:n.prompt})}),e[5]=n.prompt,e[6]=a):a=e[6];let c;e[7]!==s||e[8]!==n.copiedMessage||e[9]!==n.prompt?(c=()=>{s(n.prompt,n.copiedMessage)},e[7]=s,e[8]=n.copiedMessage,e[9]=n.prompt,e[10]=c):c=e[10];let d;e[11]!==n.copyLabel||e[12]!==c?(d=b.jsx(xs,{icon:"copy",label:n.copyLabel,actionId:Yce,onClick:c}),e[11]=n.copyLabel,e[12]=c,e[13]=d):d=e[13];let f;e[14]!==a||e[15]!==d?(f=b.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-muted py-1 pr-1 pl-3",children:[a,d]}),e[14]=a,e[15]=d,e[16]=f):f=e[16];let p;return e[17]!==i||e[18]!==o||e[19]!==r||e[20]!==f?(p=b.jsxs("section",{"aria-labelledby":i,className:Q7,children:[o,r,f]}),e[17]=i,e[18]=o,e[19]=r,e[20]=f,e[21]=p):p=e[21],p},Zce=t=>{const e=ee.c(28),{content:n,isOpening:s,problem:i,onOpenTerminal:o,onCopy:r,onClose:a}=t;let c;e[0]!==a?(c=w=>{w||a()},e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n.title?(d=b.jsx(vl,{children:n.title}),e[2]=n.title,e[3]=d):d=e[3];let f;e[4]!==n.description?(f=b.jsx(Sl,{children:n.description}),e[4]=n.description,e[5]=f):f=e[5];let p;e[6]!==d||e[7]!==f?(p=b.jsxs(bl,{children:[d,f]}),e[6]=d,e[7]=f,e[8]=p):p=e[8];let m;e[9]!==n.terminal||e[10]!==s||e[11]!==o||e[12]!==i?(m=n.terminal===null?null:b.jsx(Xce,{option:n.terminal,isOpening:s,problem:i,onOpenTerminal:o}),e[9]=n.terminal,e[10]=s,e[11]=o,e[12]=i,e[13]=m):m=e[13];let g;e[14]!==n.manual||e[15]!==r?(g=b.jsx(Qce,{option:n.manual,onCopy:r}),e[14]=n.manual,e[15]=r,e[16]=g):g=e[16];let y;e[17]!==n.closeLabel||e[18]!==a?(y=b.jsx(xl,{children:b.jsx(ft,{type:"button",variant:"ghost",onClick:a,children:n.closeLabel})}),e[17]=n.closeLabel,e[18]=a,e[19]=y):y=e[19];let v;e[20]!==p||e[21]!==m||e[22]!==g||e[23]!==y?(v=b.jsxs(yl,{className:"sm:max-w-lg",children:[p,m,g,y]}),e[20]=p,e[21]=m,e[22]=g,e[23]=y,e[24]=v):v=e[24];let S;return e[25]!==c||e[26]!==v?(S=b.jsx(gl,{open:!0,onOpenChange:c,children:v}),e[25]=c,e[26]=v,e[27]=S):S=e[27],S},wb=_.createContext(null),Jce=t=>{const e=ee.c(7),{order:n,sections:s}=t;let i;if(e[0]!==n||e[1]!==s){let r;e[3]!==s?(r=a=>b.jsx(_.Fragment,{children:s[a]},a),e[3]=s,e[4]=r):r=e[4],i=n.map(r),e[0]=n,e[1]=s,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=b.jsx(b.Fragment,{children:i}),e[5]=i,e[6]=o):o=e[6],o},J7=_.createContext(void 0);function _u(t){const e=_.useContext(J7);if(e===void 0&&!t)throw new Error(yn(47));return e}const eue={...Mm,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class tue extends Ou{constructor(n,s,i){const o=new Df;super(nue(n,o,s,i),sue(o),eue);Ut(this,"setOpen",(n,s)=>{var p,m;const i=s.reason===Fn,o=s.reason===hr&&s.event.detail===0,r=!n&&(s.reason===xm||s.reason==null),a=u3(s),c=this.select("activeTriggerId");if(!n&&s.reason===kj&&s.trigger==null&&c!=null&&(s.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(m=(p=this.context).onOpenChange)==null||m.call(p,n,s),s.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,s);const d=()=>{const g=cb(this.state,n,s.trigger,a());g.openChangeReason=s.reason,this.update(g)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(tP,()=>{this.set("stickIfOpen",!1)}),Vi.flushSync(d)):d();let f;o?f="click":r?f="dismiss":s.reason===au&&(f="focus"),this.set("instantType",f)})}}function nue(t,e,n,s=!1){const i={..._m(e,n,s),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return i.open&&(t==null?void 0:t.mounted)===void 0&&(i.mounted=!0),i}function sue(t){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new fo,triggerElements:t}}const H_=If(function({props:e}){const{children:n,open:s,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:r,modal:a=!1,handle:c,triggerId:d,defaultTriggerId:f=null}=e,p=iue(c,{modal:a,open:i,openProp:s,activeTriggerId:f,triggerIdProp:d});p.useControlledProp("openProp",s),p.useControlledProp("triggerIdProp",d);const m=p.useState("open"),g=p.useState("mounted"),y=p.useState("payload");p.useContextCallback("onOpenChange",o),p.useContextCallback("onOpenChangeComplete",r),CP(p,m),Rm(p);const{forceUnmount:v}=km(m,p,()=>{p.update({stickIfOpen:!0,openChangeReason:null})});p.useSyncedValues({modal:a}),_.useEffect(()=>{m||p.context.stickIfOpenTimeout.clear()},[p,m]),_.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:()=>p.setOpen(!1,xt(cu))}),[v,p]);const S=m||g;return b.jsxs(J7.Provider,{value:p,children:[c&&b.jsx(Tm,{handle:c,store:p}),S&&b.jsx(oue,{store:p,modal:a}),typeof n=="function"?n({payload:y}):n]})});function $3(t){return _u(!0)?b.jsx(H_,{props:t}):b.jsx(ob,{children:b.jsx(H_,{props:t})})}function iue(t,e){const n=ab((s,i)=>new tue(e,s,i));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function oue({store:t,modal:e}){const n=t.useState("floatingRootContext"),s=Em(n,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),i=s.reference,o=s.floating;return Am(t,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o}),null}const rue=300,Eb=Cm(function(e,n){const{render:s,className:i,style:o,disabled:r=!1,nativeButton:a=!0,handle:c,payload:d,openOnHover:f=!1,delay:p=rue,closeDelay:m=0,id:g,...y}=e,v=_u(!0),w=Lm(c)??v;if(!w)throw new Error(yn(74));const N=di(g),C=w.useState("isTriggerActive",N),T=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",N),A=w.useState("triggerPopupId",N),k=_.useRef(null),{registerTrigger:M,isMountedByThisTrigger:L}=Om(N,k,w,{payload:d,disabled:r,openOnHover:f,closeDelay:m}),j=w.useState("openChangeReason"),D=w.useState("stickIfOpen"),P=w.useState("openMethod"),B=w.useState("focusManagerModal"),I=Im(T,{enabled:!r&&f&&(P!=="touch"||j!==hr),mouseOnly:!0,move:!1,handleClose:Dm(),restMs:p,delay:{close:m},triggerElementRef:k,isActiveTrigger:C,isClosing:()=>w.select("transitionStatus")==="ending"}),F=rb(T,{stickIfOpen:D}),z=w3(()=>w.select("open"),te=>{w.set("openMethod",te)}),U=w.useState("triggerProps",L),{getButtonProps:H,buttonRef:V}=Cu({disabled:r,native:a}),W={open(te){return te&&j===hr?ww.open(te):gm.open(te)}},{preFocusGuardRef:G,handlePreFocusGuardFocus:Y,handleFocusTargetFocus:J}=BP(w,k),X=Qt("button",e,{state:{disabled:r,open:R},ref:[V,n,M,k],props:[F.reference,I,U,z,{[s3]:"",id:N,"aria-haspopup":"dialog","aria-expanded":R,"aria-controls":A},y,H],stateAttributesMapping:W}),Z=b.jsx(_.Fragment,{children:X},N);return L&&!B?b.jsxs(_.Fragment,{children:[b.jsx(qa,{ref:G,onFocus:Y}),Z,b.jsx(qa,{ref:w.context.triggerFocusTargetRef,onFocus:J})]}):Z}),e9=_.createContext(void 0);function lue(){const t=_.useContext(e9);if(t===void 0)throw new Error(yn(45));return t}const F3=_.forwardRef(function(e,n){const{keepMounted:s=!1,...i}=e;return _u().useState("mounted")||s?b.jsx(e9.Provider,{value:s,children:b.jsx(i3,{ref:n,...i})}):null}),t9=_.createContext(void 0);function n9(){const t=_.useContext(t9);if(!t)throw new Error(yn(46));return t}const H3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,anchor:r,positionMethod:a,side:c,align:d,sideOffset:f,alignOffset:p,collisionBoundary:m="clipping-ancestors",collisionPadding:g,arrowPadding:y,sticky:v,disableAnchorTracking:S=!1,collisionAvoidance:w=sb,...N}=e,C=_u(),T=lue(),R=wm(),A=C.useState("floatingRootContext"),k=C.useState("mounted"),M=C.useState("open"),L=C.useState("openChangeReason"),j=C.useState("activeTriggerElement"),D=C.useState("modal"),P=C.useState("openMethod"),B=C.useState("positionerElement"),I=C.useState("instantType"),F=C.useState("transitionStatus"),z=C.useState("adaptiveOrigin"),U=_.useRef(null),H=vm(B),V=hb({anchor:r,floatingRootContext:A,positionMethod:a,mounted:k,side:c,sideOffset:f,align:d,alignOffset:p,arrowPadding:y,collisionBoundary:m,collisionPadding:g,sticky:v,disableAnchorTracking:S,keepMounted:T,nodeId:R,collisionAvoidance:w,adaptiveOrigin:z}),W=A.useState("domReferenceElement");Ue(()=>{const X=W,Z=U.current;if(X&&(U.current=X),Z&&X&&X!==Z){C.set("instantType",void 0);const te=new AbortController;return H(()=>{C.set("instantType","trigger-change")},te.signal),()=>{te.abort()}}},[W,H,C]);const G=D===!0&&L!==Fn;LP(M&&G,P==="touch",B,j);const Y=C.useStateSetter("positionerElement"),J={open:M,side:V.side,align:V.align,anchorHidden:V.anchorHidden,instant:I},q=pb(e,J,{styles:V.positionerStyles,transitionStatus:F,props:N,refs:[n,Y],hidden:!k,inert:!M});return b.jsxs(t9.Provider,{value:V,children:[k&&G&&b.jsx(x3,{inert:y3(!M),cutout:j}),b.jsx(ib,{id:R,children:q})]})}),aue=_.createContext(void 0);function cue(){const[t,e]=_.useState(0),n=Ye(()=>(e(i=>i+1),()=>{e(i=>Math.max(0,i-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}const U3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,initialFocus:r,finalFocus:a,...c}=e,d=_u(),f=n9(),p=OP()!=null,{context:m,hasClosePart:g}=cue(),y=d.useState("open"),v=d.useState("openMethod"),S=d.useState("instantType"),w=d.useState("transitionStatus"),N=d.useState("popupProps"),C=d.useState("titleElementId"),T=d.useState("descriptionElementId"),R=d.useState("modal"),A=d.useState("mounted"),k=d.useState("openChangeReason"),M=d.useState("activeTriggerElement"),L=d.useState("floatingRootContext"),j=L.useState("floatingId"),D=d.useState("disabled"),P=d.useState("openOnHover"),B=d.useState("closeDelay");Xa({open:y,ref:d.context.popupRef,onComplete(){var V,W;y&&((W=(V=d.context).onOpenChangeComplete)==null||W.call(V,!0))}}),ub(L,{enabled:P&&!D,closeDelay:B});const I=r===void 0?SP(d.context.popupRef):r,F=R!==!1&&g;d.useSyncedValue("focusManagerModal",F);const z=d.useStateSetter("popupElement"),U={open:y,side:f.side,align:f.align,instant:S,transitionStatus:w},H=Qt("div",e,{state:U,ref:[n,d.context.popupRef,z],props:[N,{id:j,role:"dialog",...Nm,"aria-labelledby":C,"aria-describedby":T,onKeyDown(V){p&&fb.has(V.key)&&V.stopPropagation()}},jm(w),c],stateAttributesMapping:ym});return b.jsx(l3,{context:L,openInteractionType:v,modal:F,disabled:!A||k===Fn,initialFocus:I,returnFocus:a,restoreFocus:"popup",previousFocusableElement:gn(M)?M:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:b.jsx(aue.Provider,{value:m,children:H})})}),uue=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,c=_u().useState("open"),{arrowRef:d,side:f,align:p,arrowUncentered:m,arrowStyles:g}=n9();return Qt("div",e,{state:{open:c,side:f,align:p,uncentered:m},ref:[n,d],props:[{style:g,"aria-hidden":!0},r],stateAttributesMapping:Lf})}),V3=_.forwardRef(function(e,n){const{render:s,className:i,style:o,...r}=e,a=_u(),c=di(r.id);return a.useSyncedValueWithCleanup("titleElementId",c),Qt("h2",e,{ref:n,props:[{id:c},r]})}),gf="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10 aria-expanded:bg-sign-foreground/15 aria-pressed:bg-sign-foreground aria-pressed:text-sign disabled:opacity-50",due="border-primary bg-primary font-bold text-primary-foreground hover:bg-primary/85 aria-expanded:bg-primary/85",s9="z-50 flex w-96 origin-(--transform-origin) flex-col gap-3 rounded-lg border border-foreground bg-popover p-4 text-sm text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",fue="max-h-[min(44rem,calc(100vh-5rem))] w-[34rem] overflow-y-auto",hue="shrink-0 text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",q3=t=>{const e=ee.c(11),{trigger:n,children:s,className:i,onOpen:o}=t;let r;e[0]!==o?(r=f=>{f&&(o==null||o())},e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=Se(s9,i),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==a?(c=b.jsx(F3,{children:b.jsx(H3,{align:"end",sideOffset:10,className:"isolate z-50",children:b.jsx(U3,{className:a,children:s})})}),e[4]=s,e[5]=a,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==c||e[9]!==n?(d=b.jsxs($3,{onOpenChange:r,children:[n,c]}),e[7]=r,e[8]=c,e[9]=n,e[10]=d):d=e[10],d},pue=t=>{const e=ee.c(7),{label:n,isPressed:s,onClick:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(pQ,{"aria-hidden":"true",className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==n?(r=b.jsx("span",{className:"text-box-cap",children:n}),e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==s||e[4]!==i||e[5]!==r?(a=b.jsxs("button",{type:"button","aria-pressed":s,"data-user-action-id":"chat-action",className:gf,onClick:i,children:[o,r]}),e[3]=s,e[4]=i,e[5]=r,e[6]=a):a=e[6],a},mue=t=>{const e=ee.c(7),{label:n,isPending:s,onClick:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(sQ,{"aria-hidden":"true",className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==n?(r=b.jsx("span",{className:"text-box-cap",children:n}),e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==s||e[4]!==i||e[5]!==r?(a=b.jsxs("button",{type:"button",disabled:s,"data-user-action-id":"complete-review-action",className:gf,onClick:i,children:[o,r]}),e[3]=s,e[4]=i,e[5]=r,e[6]=a):a=e[6],a},gue=t=>{const e=ee.c(7),{label:n,onClick:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Se(gf,"font-bold text-signal"),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(xQ,{"aria-hidden":"true",className:"size-3.5"}),e[1]=o):o=e[1];let r;e[2]!==n?(r=b.jsx("span",{className:"text-box-cap",children:n}),e[2]=n,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==r?(a=b.jsxs("button",{type:"button","data-user-action-id":"unassigned-files-action",className:i,onClick:s,children:[o,r]}),e[4]=s,e[5]=r,e[6]=a):a=e[6],a},yue=t=>{const e=ee.c(58),{draft:n,isSubmitting:s,isDiscarding:i,errorMessage:o,submissionCount:r,renderEditor:a,onSubmit:c,onDiscard:d}=t,f=_.useId(),[p,m]=_.useState(""),[g,y]=_.useState(null);let v;if(e[0]!==g||e[1]!==n.verdicts){const U=n.verdicts.map(xue);v=U.find(H=>H===g)??U.at(0)??null,e[0]=g,e[1]=n.verdicts,e[2]=v}else v=e[2];const S=v;if(!n.isAvailable||S===null){const U=n.unavailableReason??void 0;let H;e[3]!==n.buttonLabel?(H=b.jsx("span",{className:"text-box-cap",children:n.buttonLabel}),e[3]=n.buttonLabel,e[4]=H):H=e[4];let V;return e[5]!==U||e[6]!==H?(V=b.jsx("button",{type:"button",disabled:!0,title:U,className:gf,children:H}),e[5]=U,e[6]=H,e[7]=V):V=e[7],V}let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=Se(gf,due),e[8]=w):w=e[8];let N;e[9]!==n.buttonLabel?(N=b.jsx("span",{className:"text-box-cap",children:n.buttonLabel}),e[9]=n.buttonLabel,e[10]=N):N=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=b.jsx(lu,{"aria-hidden":"true",className:"size-3.5"}),e[11]=C):C=e[11];let T;e[12]!==N?(T=b.jsxs(Eb,{"data-user-action-id":"submit-review-action",className:w,children:[N,C]}),e[12]=N,e[13]=T):T=e[13];let R;e[14]!==p||e[15]!==c||e[16]!==S?(R=U=>{U.preventDefault(),c(S,p.trim())},e[14]=p,e[15]=c,e[16]=S,e[17]=R):R=e[17];let A;e[18]!==n.heading?(A=b.jsx(V3,{className:"text-base leading-6 font-bold",children:n.heading}),e[18]=n.heading,e[19]=A):A=e[19];let k;e[20]!==n.bodyPlaceholder||e[21]!==a?(k=a({label:n.bodyPlaceholder,shouldFocus:!1,onChange:m}),e[20]=n.bodyPlaceholder,e[21]=a,e[22]=k):k=e[22];let M;e[23]!==r||e[24]!==k?(M=b.jsx("div",{children:k},r),e[23]=r,e[24]=k,e[25]=M):M=e[25];let L;if(e[26]!==n.verdicts||e[27]!==f||e[28]!==S){let U;e[30]!==f||e[31]!==S?(U=H=>b.jsxs("label",{className:"grid cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] gap-x-2",children:[b.jsx("input",{type:"radio",name:f,checked:S===H.key,className:"mt-1 size-3.5 accent-(--primary)",onChange:()=>{y(H.key)}}),b.jsx("span",{className:"font-bold",children:H.label}),b.jsx("span",{className:"col-start-2 text-muted-foreground",children:H.description})]},H.key),e[30]=f,e[31]=S,e[32]=U):U=e[32],L=n.verdicts.map(U),e[26]=n.verdicts,e[27]=f,e[28]=S,e[29]=L}else L=e[29];let j;e[33]!==L?(j=b.jsx("fieldset",{className:"flex flex-col gap-2",children:L}),e[33]=L,e[34]=j):j=e[34];let D;e[35]!==n.pendingLabel?(D=b.jsx("p",{className:"text-muted-foreground tabular-nums",children:n.pendingLabel}),e[35]=n.pendingLabel,e[36]=D):D=e[36];let P;e[37]!==n.pendingComments||e[38]!==i||e[39]!==d?(P=n.pendingComments.length===0?null:b.jsx("ul",{className:"flex flex-col",children:n.pendingComments.map(U=>b.jsxs("li",{className:"flex items-start justify-between gap-3 border-t py-2 first:border-t-0 first:pt-0",children:[b.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[b.jsx("span",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:U.locationLabel}),b.jsx("span",{className:"truncate",children:U.excerpt}),U.staleLabel===null?null:b.jsx("span",{className:"text-destructive",children:U.staleLabel})]}),b.jsx("button",{type:"button","aria-label":`${U.discardLabel}: ${U.locationLabel}`,disabled:i,className:hue,onClick:()=>{d(U.id)},children:U.discardLabel})]},U.id))}),e[37]=n.pendingComments,e[38]=i,e[39]=d,e[40]=P):P=e[40];let B;e[41]!==o?(B=o===null?null:b.jsx("p",{role:"alert",className:"text-destructive",children:o}),e[41]=o,e[42]=B):B=e[42];let I;e[43]!==n.submitLabel||e[44]!==s?(I=b.jsx(ft,{type:"submit",disabled:s,className:"self-end",children:n.submitLabel}),e[43]=n.submitLabel,e[44]=s,e[45]=I):I=e[45];let F;e[46]!==j||e[47]!==D||e[48]!==P||e[49]!==B||e[50]!==I||e[51]!==R||e[52]!==A||e[53]!==M?(F=b.jsxs("form",{className:"flex flex-col gap-3",onSubmit:R,children:[A,M,j,D,P,B,I]}),e[46]=j,e[47]=D,e[48]=P,e[49]=B,e[50]=I,e[51]=R,e[52]=A,e[53]=M,e[54]=F):F=e[54];let z;return e[55]!==F||e[56]!==T?(z=b.jsx(q3,{className:fue,trigger:T,children:F}),e[55]=F,e[56]=T,e[57]=z):z=e[57],z},U_="size-3.5 motion-safe:animate-spin",bue=t=>{const e=ee.c(27),{sharing:n,publishingKey:s,onPublish:i}=t;let o;e[0]!==s?(o=v=>v.isPending||v.key===s,e[0]=s,e[1]=o):o=e[1];const r=o;let a;e[2]!==r||e[3]!==n.options?(a=n.options.some(r),e[2]=r,e[3]=n.options,e[4]=a):a=e[4];const c=a;let d;e[5]!==n.buttonLabel?(d=b.jsx("span",{className:"text-box-cap",children:n.buttonLabel}),e[5]=n.buttonLabel,e[6]=d):d=e[6];let f;e[7]!==c?(f=c?b.jsx(vw,{"aria-hidden":"true",className:U_}):b.jsx(lu,{"aria-hidden":"true",className:"size-3.5"}),e[7]=c,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==d||e[11]!==f?(p=b.jsxs(Eb,{"aria-busy":c,"data-user-action-id":"share-action",className:gf,children:[d,f]}),e[9]=c,e[10]=d,e[11]=f,e[12]=p):p=e[12];let m;if(e[13]!==c||e[14]!==r||e[15]!==i||e[16]!==n.options){let v;e[18]!==c||e[19]!==r||e[20]!==i?(v=S=>b.jsxs("li",{className:"flex flex-col gap-1.5 border-t py-3 first:border-t-0 first:pt-0 last:pb-0",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsx("p",{className:"font-bold",children:S.label}),b.jsxs(ft,{variant:"outline",size:"sm","aria-busy":r(S),disabled:!S.isAvailable||c,onClick:()=>{i(S.key)},children:[r(S)?b.jsx(vw,{"aria-hidden":"true",className:U_}):null,r(S)?S.pendingLabel:S.actionLabel]})]}),b.jsx("p",{className:"text-muted-foreground",children:S.description}),S.statusLabel===null||S.link===null?null:b.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 tabular-nums",children:[S.statusLabel,b.jsx(Qa,{href:S.link.href,label:S.link.label})]})]},S.key),e[18]=c,e[19]=r,e[20]=i,e[21]=v):v=e[21],m=n.options.map(v),e[13]=c,e[14]=r,e[15]=i,e[16]=n.options,e[17]=m}else m=e[17];let g;e[22]!==m?(g=b.jsx("ul",{className:"flex flex-col",children:m}),e[22]=m,e[23]=g):g=e[23];let y;return e[24]!==p||e[25]!==g?(y=b.jsx(q3,{trigger:p,children:g}),e[24]=p,e[25]=g,e[26]=y):y=e[26],y};function xue(t){return t.key}const vue="Okay, got it!",V_="Close this tip",Sue="Keep showing tips?",wue="Tips point out features you have not tried yet. You can stop them for good.",Eue="Keep tips",Cue="Stop tips",q_="↵",Nue="Enter",Tue="Escape",Oue=12,Rue=16,kue="button, a[href], summary, [role='button'], [role='menu'], [role='menuitem'], [role='menubar'], [role='listbox'], [role='option']",Aue="relative w-[22rem] max-w-[calc(100vw-2rem)] rounded-md bg-sign px-4 pt-[1.125rem] pb-3.5 text-sign-foreground outline-none dark:ring-1 dark:ring-sign-foreground/20 duration-[180ms] data-open:animate-in data-open:fade-in-0 motion-reduce:animate-none",_ue="absolute inset-x-0 top-0 h-1 rounded-t-md bg-(--line,var(--primary-text))",Mue="size-2.5 rotate-45 rounded-[2px] bg-sign data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1",Lue="absolute top-3.5 right-2.5 grid size-6 cursor-pointer place-items-center rounded-[0.3rem] text-sign-muted transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",W_="inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-[0.3rem] bg-primary px-2.5 text-[0.8rem] font-bold text-primary-foreground transition-colors duration-[180ms] ease-out hover:bg-[color-mix(in_oklab,var(--primary)_88%,var(--primary-foreground))] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",Iue="inline-flex h-7 cursor-pointer items-center rounded-[0.3rem] px-2.5 text-[0.8rem] text-sign-muted transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",tE=t=>{const e=ee.c(2),{label:n}=t;let s;return e[0]!==n?(s=b.jsx(x8,{"aria-hidden":"true",className:"mx-0.5 align-[0.05rem]",children:n}),e[0]=n,e[1]=s):s=e[1],s},G_=t=>typeof t=="string"?`text:${t}`:`keycap:${t.keycap}`,U0=t=>{const e=ee.c(4),{parts:n}=t;let s;e[0]!==n?(s=n.map(Fue),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==s?(i=b.jsx(b.Fragment,{children:s}),e[2]=s,e[3]=i):i=e[3],i},Due=t=>F8(t)&&!t.ctrlKey&&!t.shiftKey&&!(t.target instanceof Element&&t.target.closest(kue)!==null),jue=t=>Ds.getState().shownTooltipIds.at(-1)===t,Pue=(t,e)=>{const n=[...document.querySelectorAll(t)],s=D8();if(e!==null&&n.includes(e)&&I8(qw(e),s))return e;const i=eie(n.map(qw),s);return i===null?null:n[i]},zue=(t,e)=>{const n=ee.c(2),[s,i]=_.useState(null);let o;return n[0]!==t?(o=()=>{i(r=>Pue(t,r))},n[0]=t,n[1]=o):o=n[1],j8(e,o,t),e?s:null},Bue=(t,e)=>{const n=ee.c(4);let s,i;n[0]!==e||n[1]!==t?(s=()=>{if(e)return Ds.getState().showTooltip(t),()=>{Ds.getState().hideTooltip(t)}},i=[t,e],n[0]=e,n[1]=t,n[2]=s,n[3]=i):(s=n[2],i=n[3]),_.useEffect(s,i)},$ue=(t,e)=>{const n=ee.c(5),s=_.useEffectEvent(e);let i;n[0]!==s||n[1]!==t?(i=()=>{if(!t)return;const r=a=>{s(a)};return window.addEventListener("keydown",r,!0),()=>{window.removeEventListener("keydown",r,!0)}},n[0]=s,n[1]=t,n[2]=i):i=n[2];let o;n[3]!==t?(o=[t],n[3]=t,n[4]=o):o=n[4],_.useEffect(i,o)},sa=t=>{const e=ee.c(41),{id:n,title:s,content:i,anchorSelector:o,side:r,delay:a,triggers:c}=t,d=s===void 0?null:s,f=r===void 0?"top":r,p=a===void 0?k8:a;let m;e[0]!==p||e[1]!==c?(m={delay:p,triggers:c},e[0]=p,e[1]=c,e[2]=m):m=e[2];const{showTooltip:g}=Yse(n,m),[y,v]=_.useState("tip"),S=zue(o,g),w=g&&S!==null;let N;e[3]!==n||e[4]!==y?(N=()=>{Ds.getState().deferTooltip(n,y==="prompt"?"close-button":"got-it")},e[3]=n,e[4]=y,e[5]=N):N=e[5];const C=N;let T;e[6]!==n?(T=()=>{Ds.getState().deferTooltip(n,"close-button"),Ds.getState().turnTipsOff()},e[6]=n,e[7]=T):T=e[7];const R=T;Bue(n,w);let A;e[8]!==n||e[9]!==y||e[10]!==C?(A=G=>{!jue(n)||!Due(G)||(G.key===Nue&&(G.preventDefault(),C()),G.key===Tue&&(G.preventDefault(),y==="tip"?v("prompt"):C()))},e[8]=n,e[9]=y,e[10]=C,e[11]=A):A=e[11],$ue(w,A);const k=y==="tip"?d:Sue,M=k??void 0;let L;e[12]===Symbol.for("react.memo_cache_sentinel")?(L=b.jsx("span",{"aria-hidden":"true",className:_ue}),e[12]=L):L=e[12];let j;e[13]!==y?(j=y==="tip"?b.jsx("button",{type:"button","aria-label":V_,title:V_,"data-user-action-id":"guide-tooltip-close-action",className:Lue,onClick:()=>{v("prompt")},children:b.jsx(Ky,{"aria-hidden":"true",className:"size-3.5"})}):null,e[13]=y,e[14]=j):j=e[14];let D;e[15]!==k?(D=k===null?null:b.jsx("p",{className:"pr-7 text-base leading-6 font-bold",children:k}),e[15]=k,e[16]=D):D=e[16];const P=k!==null&&"mt-1";let B;e[17]!==P?(B=Se("text-sm leading-[1.375rem] text-sign-foreground/88",P),e[17]=P,e[18]=B):B=e[18];const I=y==="tip"?i:wue;let F;e[19]!==B||e[20]!==I?(F=b.jsx("div",{className:B,children:I}),e[19]=B,e[20]=I,e[21]=F):F=e[21];let z;e[22]!==y||e[23]!==C||e[24]!==R?(z=b.jsx("div",{className:"mt-3.5 flex items-center justify-end gap-2",children:y==="tip"?b.jsxs("button",{type:"button","data-user-action-id":"guide-tooltip-got-it-action",className:W_,onClick:C,children:[vue,b.jsx(tE,{label:q_})]}):b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button","data-user-action-id":"guide-tips-stop-action",className:Iue,onClick:R,children:Cue}),b.jsxs("button",{type:"button","data-user-action-id":"guide-tips-keep-action",className:W_,onClick:C,children:[Eue,b.jsx(tE,{label:q_})]})]})}),e[22]=y,e[23]=C,e[24]=R,e[25]=z):z=e[25];let U;e[26]===Symbol.for("react.memo_cache_sentinel")?(U=b.jsx(uue,{className:Mue}),e[26]=U):U=e[26];let H;e[27]!==n||e[28]!==j||e[29]!==D||e[30]!==F||e[31]!==z||e[32]!==M?(H=b.jsxs(U3,{initialFocus:!1,finalFocus:!1,"aria-live":"polite","aria-label":M,"data-guide-tooltip":n,"data-navigator-scope":"",className:Aue,children:[L,j,D,F,z,U]}),e[27]=n,e[28]=j,e[29]=D,e[30]=F,e[31]=z,e[32]=M,e[33]=H):H=e[33];let V;e[34]!==S||e[35]!==f||e[36]!==H?(V=b.jsx(F3,{children:b.jsx(H3,{anchor:S,side:f,sideOffset:Oue,collisionPadding:Rue,className:"isolate z-50 data-[anchor-hidden]:hidden",children:H})}),e[34]=S,e[35]=f,e[36]=H,e[37]=V):V=e[37];let W;return e[38]!==w||e[39]!==V?(W=b.jsx($3,{open:w,modal:!1,children:V}),e[38]=w,e[39]=V,e[40]=W):W=e[40],W};function Fue(t){return typeof t=="string"?b.jsx("span",{children:t},G_(t)):b.jsxs("span",{children:[b.jsx("span",{className:"sr-only",children:t.keycap}),b.jsx(tE,{label:t.keycap})]},G_(t))}const Hue=["core-change","bug","risk","nit","question"],ny="explain-waypoint-action",W3="explain-code-block-action",Uue="s",G3="c",Vue="f",que="q",Wue="e",i9="r",Gue="Add comment",o9="Write description",Kue="Explain this line",Yue="Explain the whole code block",Xue="Explain",Que="Explain block",Zue="Collapse all",Jue="Expand all",ede="Collapse file",tde="Expand file",nde="Expand waypoint",sde="Collapse waypoint",ide="reviewed",Cb=`Pick a waypoint first: press ${_3.toUpperCase()} to step to the next one.`,ode="This waypoint has no lines on the page to comment on.",K_=(t,e,n)=>t||e===null?n:e,rde=t=>{const{stepping:e}=t.controls,n=t.positionLabel===null?[]:[{kind:"position",label:t.positionLabel}];return[K_(t.canStepBack,t.sectionSteps.back,rs({key:z8,actionId:"previous-waypoint-action",label:e.previousLabel,isDisabled:!t.canStepBack,onRun:t.onPrevious})),...n,K_(t.canStepForward,t.sectionSteps.next,rs({key:_3,actionId:"next-waypoint-action",label:e.nextLabel,isDisabled:!t.canStepForward,onRun:t.onNext}))]},lde=t=>{const{onCurrentReviewedChange:e,currentWaypoint:n}=t;if(e===null)return[];const s=(n==null?void 0:n.isReviewed)===!0,{currentReview:i}=t.controls;return[rs({key:Uue,actionId:"mark-reviewed-action",label:s?i.reviewedLabel:i.markLabel,isPressed:s,isPrimary:!s,isDisabled:n===null,disabledHint:Cb,onRun:()=>{e(!s)}})]},ade=(t,e)=>[rs({key:G3,actionId:"write-description-action",label:o9,isDisabled:!e,disabledHint:Cb,onRun:t})],cde=t=>{const{onCommentOnCurrent:e,onDescribeCurrent:n,currentWaypoint:s}=t;return n!==null?ade(n,s!==null):e===null?[]:[rs({key:G3,actionId:"add-comment-action",label:Gue,isDisabled:(s==null?void 0:s.canComment)!==!0,disabledHint:s===null?Cb:ode,onRun:e})]},ude=t=>{const{onWriteUpCurrent:e,currentWaypoint:n}=t;if(e===null||(n==null?void 0:n.canWriteUp)!==!0)return[];const s=rs({key:Pf,actionId:ny,label:t.agentLabel===null?Kue:`Let ${t.agentLabel} explain`,shortLabel:Xue,onRun:()=>{e("line")}}),i=rs({key:bie,actionId:W3,label:Yue,shortLabel:Que,onRun:()=>{e("block")}});return n.canWriteUpBlock?[s,i]:[s]},dde=t=>[...lde(t),...cde(t),...ude(t)],fde=t=>{const{onShowReviewedChange:e}=t,n=t.controls.reviewedToggle;return e===null?[]:[{kind:"choice",id:ide,label:n.label,detailLabel:n.countLabel,detailTone:null,marker:t.markerOf("reviewed"),isChecked:n.isShown,isDisabled:!n.isAvailable&&!n.isShown,onToggle:()=>{e(!n.isShown)}}]},hde=t=>Hue.some(e=>e===t),pde=(t,e)=>n=>({kind:"choice",id:n.key,label:n.label,detailLabel:n.detailLabel,detailTone:n.detailChange,marker:hde(n.key)?t.markerOf(n.key):null,isChecked:n.isSelected,isDisabled:!1,onToggle:()=>{e(n.toggledKeys.length===0?null:n.toggledKeys)}}),mde=t=>{const{onFilterChange:e}=t;if(e===null)return[];const{filter:n}=t.controls,s=pde(t,e),i=r=>({kind:"submenu",id:r.id,label:r.label,heading:r.heading,valueLabel:r.valueLabel,choices:r.options.map(s)}),o=n.groups.map(r=>[...r.options.map(s),...r.more===null?[]:[i(r.more)]]);return[{kind:"menu",key:Vue,actionId:"filter-action",label:n.buttonLabel,badge:n.badge,heading:n.heading,itemGroups:[...o,n.submenus.map(i),fde(t)].filter(r=>r.length>0)}]},gde=t=>{const{isFileCollapsed:e,currentWaypoint:n}=t,s=(n==null?void 0:n.isOpen)===!0,i=e===null?[]:[rs({key:Wue,actionId:"collapse-file-action",label:e?tde:ede,onRun:()=>{t.onFileCollapsedChange(!e)}})];return[rs({key:que,actionId:"collapse-files-action",label:t.areFilesCollapsed?Jue:Zue,onRun:()=>{t.onFilesCollapsedChange(!t.areFilesCollapsed)}}),...i,rs({key:i9,actionId:"expand-waypoint-action",label:s?sde:nde,isDisabled:n===null,disabledHint:Cb,onRun:()=>{t.onCurrentOpenChange(!s)}})]},yde=t=>[rde(t),dde(t),mde(t),gde(t)].filter(e=>e.length>0),bde="the agent",Y_=["next-waypoint-action","previous-waypoint-action"],xde=5,vde="[role='toolbar']",Ic=t=>`[data-user-action-id="${t}"]`,lS=t=>`${vde} ${Ic(t)}`,Sde=t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`,wde=t=>{const e=ee.c(33),{reviewMode:n}=t;Xse(n);const s=_.use(yb),i=_.use(wb),o=(i==null?void 0:i.label)??bde;let r;e[0]!==s?(r=s!==null&&A3(s.groups,Pf)!==null,e[0]=s,e[1]=r):r=e[1];const a=r;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=b.jsx(sa,{id:"jump-to-action-tooltip",title:"Go straight to what matters",content:b.jsx(U0,{parts:["Press ",{keycap:"W"}," to jump to any section of this review."]}),anchorSelector:Ic("jump-to-action"),triggers:{viewVisible:["context-section"],preFeatureUse:["jump-to-action"]}}),e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=b.jsx(sa,{id:"change-overview-card-tooltip",title:"Peek at the code behind each card",content:"Hover a card for a quick look. Press it to read the code in the Code Walkthrough.",anchorSelector:Ic("change-overview-card-action"),triggers:{viewVisible:["change-overview-section"],preFeatureUse:{actionIds:["change-overview-card-action"],use:"click-or-hover"},dayBound:1}}),e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=Ic("trace-diagram-card-action"),e[4]=f):f=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=b.jsx(sa,{id:"trace-diagram-card-tooltip",title:"Curious how this runs?",content:"Press a card to read its code and what it does in this change.",anchorSelector:`${f}[data-change]`,triggers:{viewVisible:["trace-diagram-section"],preFeatureUse:["trace-diagram-card-action"]}}),e[5]=p):p=e[5];let m,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Ic("blast-diagram-card-action"),g=Ic("blast-diagram-card-action"),e[6]=m,e[7]=g):(m=e[6],g=e[7]);let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx(sa,{id:"blast-diagram-card-tooltip",title:"Check what this change can affect",content:"Press a file to see what the change does to it and why.",anchorSelector:`${m}[data-mark="added"], ${g}[data-mark="modified"]`,triggers:{viewVisible:["blast-diagram-section"],preFeatureUse:["blast-diagram-card-action"],postFeatureUse:["trace-diagram-card-action"]}}),e[8]=y):y=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=Ic("waypoint-mark-action"),e[9]=v):v=e[9];let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=b.jsx(sa,{id:"code-view-rail-tooltip",title:"Curious what this line does?",content:"Hover a mark to see what these lines do and any issues found in them.",anchorSelector:v,side:"right",triggers:{viewVisible:["code-walkthrough-section"],preFeatureUse:{actionIds:["waypoint-mark-action"],use:"click-or-hover"}}}),e[10]=S):S=e[10];let w;e[11]!==o?(w=Sde(o),e[11]=o,e[12]=w):w=e[12];const N=`${w} hasn't written anything here yet`;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C={keycap:"G"},e[13]=C):C=e[13];const T=` to ask ${o} to explain this waypoint and check it for potential issues.`;let R;e[14]!==T?(R=b.jsx(U0,{parts:["Press ",C,T]}),e[14]=T,e[15]=R):R=e[15];let A,k,M;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=lS(ny),k=["waypoint-card-section","waypoint-box-section"],M=[ny,W3],e[16]=A,e[17]=k,e[18]=M):(A=e[16],k=e[17],M=e[18]);let L;e[19]!==a?(L={viewVisible:k,preFeatureUse:M,dependsOnValues:{isWaypointMissingDescription:a}},e[19]=a,e[20]=L):L=e[20];let j;e[21]!==N||e[22]!==R||e[23]!==L?(j=b.jsx(sa,{id:"generate-agent-writing",title:N,content:R,anchorSelector:A,triggers:L}),e[21]=N,e[22]=R,e[23]=L,e[24]=j):j=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D={keycap:"D"},e[25]=D):D=e[25];let P,B,I;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=b.jsx(U0,{parts:["Move through the change one waypoint at a time. Press ",D," for the next and ",{keycap:"A"}," to go back."]}),B=lS("next-waypoint-action"),I=["code-walkthrough-section"],e[26]=P,e[27]=B,e[28]=I):(P=e[26],B=e[27],I=e[28]);let F;e[29]===Symbol.for("react.memo_cache_sentinel")?(F=b.jsx(sa,{id:"next-waypoint-tooltip",title:"Navigate the changes step by step",content:P,anchorSelector:B,triggers:{viewVisible:I,preFeatureUse:Y_,postFeatureUse:{actionIds:["waypoint-mark-action"],use:"click-or-hover"}}}),e[29]=F):F=e[29];let z;e[30]===Symbol.for("react.memo_cache_sentinel")?(z=b.jsx(sa,{id:"filter-waypoint-tooltip",title:"Find the part of the change you're looking for",content:b.jsx(U0,{parts:["Press ",{keycap:"F"}," to keep only what matters to you and skip the trivial parts."]}),anchorSelector:lS("filter-action"),triggers:{viewVisible:["code-walkthrough-section"],tooltipDependent:["next-waypoint-tooltip"],preFeatureUse:["filter-action"],postFeatureUse:{actionIds:Y_,times:xde}}}),e[30]=z):z=e[30];let U;return e[31]!==j?(U=b.jsxs(b.Fragment,{children:[c,d,p,y,S,j,F,z]}),e[31]=j,e[32]=U):U=e[32],U},Hf=t=>{const e=ee.c(5),{imageUrl:n,monogram:s,className:i}=t,[o,r]=_.useState(!1);let a;if(e[0]!==i||e[1]!==o||e[2]!==n||e[3]!==s){const c=Se("size-5 shrink-0 rounded-full border border-input bg-card",i);a=n===null||o?b.jsx("span",{"aria-hidden":"true",className:Se(c,"inline-flex items-center justify-center text-[0.625rem] leading-none font-bold"),children:b.jsx("span",{className:"text-box-cap",children:s})}):b.jsx("img",{src:n,alt:"",className:Se(c,"object-cover"),onError:()=>{r(!0)}}),e[0]=i,e[1]=o,e[2]=n,e[3]=s,e[4]=a}else a=e[4];return a},Ede="data-valid",Cde="data-invalid",Nde={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Tde={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ode={disabled:!1,...Tde},Rde={valid(t){return t===null?null:t?{[Ede]:""}:{[Cde]:""}}},kde={invalid:void 0,name:void 0,validityData:{state:Nde,errors:[],error:"",value:"",initialValue:null},setValidityData:ss,disabled:void 0,setTouched:ss,setDirty:ss,setFilled:ss,setFocused:ss,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Ode,registerFieldControl:ss,validation:{getValidationProps:(t,e=Ln)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:ss,getInputControl:()=>null,commit:async()=>{},change:ss}},Ade=_.createContext(kde);function r9(t=!0){const e=_.useContext(Ade);if(e.setValidityData===ss&&!t)throw new Error(yn(28));return e}const _de=_.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ss,validationMode:"onSubmit",submitCountRef:{current:0}});function Mde(){return _.useContext(_de)}const Lde=_.createContext({controlId:void 0,registerControlId:ss,resetControlId:ss,labelId:void 0,setLabelId:ss,messageIds:[],setMessageIds:ss,getDescriptionProps:t=>t});function l9(){return _.useContext(Lde)}function Ide(t={}){const{id:e,enabled:n=!0}=t,{controlId:s,registerControlId:i,resetControlId:o}=l9(),r=di(),a=Bs(()=>Symbol()),c=_.useRef(!1),d=_.useRef(!1),f=Ye(()=>{!c.current||i===ss||(c.current=!1,i(a.current,void 0))});return Ue(()=>{if(!n||i===ss){f();return}let p;if(e!==void 0)d.current=!0,p=e;else if(d.current)p=r;else{o();return}if(p===void 0){f();return}c.current=!0,i(a.current,p)},[e,n,i,o,r,a,f]),Ue(()=>f,[f]),(n?s:void 0)??e??r}function Dde(t,e,n,s,i=!0,o){const{registerFieldControl:r}=r9(),a=Bs(()=>Symbol());Ue(()=>{const c=a.current;if(!i){r(c,void 0);return}r(c,{controlRef:t,getValue:s,id:e,name:o,value:n})},[t,i,s,e,o,r,a,n]),Ue(()=>{const c=a.current;return()=>{r(c,void 0)}},[r,a])}const jde=_.forwardRef(function(e,n){const{render:s,className:i,id:o,name:r,value:a,disabled:c=!1,onValueChange:d,defaultValue:f,autoFocus:p=!1,style:m,...g}=e,{state:y,name:v,disabled:S,setTouched:w,setDirty:N,validityData:C,setFocused:T,setFilled:R,validationMode:A,validation:k}=r9(),{clearErrors:M,elementRef:L,submitCountRef:j}=Mde(),D=S||c,P=v??r,B={...y,disabled:D},{labelId:I}=l9(),F=Ide({id:o}),[z]=UC({controlled:a,default:f,name:"FieldControl",state:"value"}),U=a!==void 0,H=U?z:void 0,V=H==null?void 0:String(H),W=Ye(()=>{var q;return(q=k.inputRef.current)==null?void 0:q.value});Dde(k.inputRef,F,V,W,!D,r),Ue(()=>{var X;const q=V??((X=k.inputRef.current)==null?void 0:X.value);q!==void 0&&R(q!=="")},[V,k.inputRef,R]),DP(V,()=>{V!==void 0&&(M(P),N(V!==(C.initialValue??"")),k.change(V))});const G=_.useRef(null),Y=li();return Ue(()=>{p&&G.current===oi(en(G.current))&&T(!0)},[p,T]),Qt("input",e,{ref:[n,G],state:B,props:[{id:F,disabled:D,name:P,ref:k.inputRef,"aria-labelledby":I,autoFocus:p,...U?{value:H}:{defaultValue:f},onChange(q){const X=q.currentTarget.value,Z=xt(bm,q.nativeEvent);d==null||d(X,Z),!U&&(N(X!==(C.initialValue??"")),R(X!==""),!q.nativeEvent.defaultPrevented&&!Z.isCanceled&&(M(P),k.change(X)))},onFocus(){T(!0)},onBlur(q){if(w(!0),T(!1),A==="onBlur"){const X=q.currentTarget.value;k.commit(X),U&&queueMicrotask(()=>{var te;const Z=(te=k.inputRef.current)==null?void 0:te.value;Z!==void 0&&Z!==X&&Z!==(C.initialValue??"")&&k.commit(Z)})}},onKeyDown(q){if(q.currentTarget.tagName==="INPUT"&&q.key==="Enter"){w(!0);const X=q.currentTarget.value,Z=q.currentTarget.form;if(Z&&Z===L.current&&!q.defaultPrevented){const te=q.currentTarget,Q=j.current;Y.start(0,()=>{j.current===Q&&k.commit(te.value)})}else k.commit(X)}}},g,q=>k.getValidationProps(D,q)],stateAttributesMapping:Rde})}),Pde=_.forwardRef(function(e,n){return b.jsx(jde,{ref:n,...e})});function Hm(t){const e=ee.c(10);let n,s,i;e[0]!==t?({className:n,type:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let o;e[4]!==n?(o=Se("h-8 w-full min-w-0 rounded-lg border border-input bg-card px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm",n),e[4]=n,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==i?(r=b.jsx(Pde,{type:i,"data-slot":"input",className:o,...s}),e[6]=s,e[7]=o,e[8]=i,e[9]=r):r=e[9],r}const V0="transition-[fill,stroke,stroke-dasharray,stroke-width,opacity] duration-[180ms] ease-out",Uh="[stroke-dasharray:44_0] [stroke-width:3]",zde="[stroke-dasharray:4_3.33] [stroke-width:3]",Bde="[stroke-dasharray:44_0] [stroke-width:1.5]",$de={"no-review":Se("fill-background stroke-muted-foreground",Uh),"awaiting-review":Se("fill-background stroke-signal",Uh),"awaiting-reply":Se("fill-background stroke-signal",Uh),stale:Se("fill-background stroke-muted-foreground",zde),draft:Se("fill-background stroke-muted-foreground",Bde),closed:Se("fill-muted-foreground stroke-muted-foreground",Uh),merged:Se("fill-(--line) stroke-(--line)",Uh)},K3="opacity-100",bs="opacity-0",Fde={"no-review":bs,"awaiting-review":K3,"awaiting-reply":bs,stale:bs,draft:bs,closed:bs,merged:bs},Hde={"no-review":bs,"awaiting-review":bs,"awaiting-reply":K3,stale:bs,draft:bs,closed:bs,merged:bs},Ude={"no-review":bs,"awaiting-review":bs,"awaiting-reply":bs,stale:bs,draft:bs,closed:K3,merged:bs},Vde="stroke-signal",X_="font-bold text-signal-text",q0="text-muted-foreground",k_e={"no-review":"text-foreground","awaiting-review":X_,"awaiting-reply":X_,stale:q0,draft:q0,closed:q0,merged:q0},gp=t=>{const e=ee.c(26),{status:n,tone:s,className:i}=t,o=s===void 0?"status":s;let r;e[0]!==i?(r=Se("size-5 shrink-0",i),e[0]=i,e[1]=r):r=e[1];const a=$de[n],c=o==="signal"?Vde:"";let d;e[2]!==a||e[3]!==c?(d=Se(V0,a,c),e[2]=a,e[3]=c,e[4]=d):d=e[4];let f;e[5]!==d?(f=b.jsx("circle",{cx:"10",cy:"10",r:"7",className:d}),e[5]=d,e[6]=f):f=e[6];const p=Fde[n];let m;e[7]!==p?(m=Se("fill-signal",V0,p),e[7]=p,e[8]=m):m=e[8];let g;e[9]!==m?(g=b.jsx("path",{d:"M10 4.5a5.5 5.5 0 0 1 0 11z",className:m}),e[9]=m,e[10]=g):g=e[10];const y=Hde[n];let v;e[11]!==y?(v=Se("fill-signal",V0,y),e[11]=y,e[12]=v):v=e[12];let S;e[13]!==v?(S=b.jsx("circle",{cx:"10",cy:"10",r:"2.75",className:v}),e[13]=v,e[14]=S):S=e[14];const w=Ude[n];let N;e[15]!==w?(N=Se("fill-background",V0,w),e[15]=w,e[16]=N):N=e[16];let C;e[17]!==N?(C=b.jsx("rect",{x:"5",y:"8.5",width:"10",height:"3",rx:"1",className:N}),e[17]=N,e[18]=C):C=e[18];let T;return e[19]!==n||e[20]!==S||e[21]!==C||e[22]!==r||e[23]!==f||e[24]!==g?(T=b.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20","data-status":n,className:r,children:[f,g,S,C]}),e[19]=n,e[20]=S,e[21]=C,e[22]=r,e[23]=f,e[24]=g,e[25]=T):T=e[25],T},qde="flex max-w-full min-w-0 items-center gap-1.5 rounded-md px-1.5 py-0.5 hover:bg-sign-foreground/10 focus-visible:outline-2 focus-visible:outline-sign-foreground data-popup-open:bg-sign-foreground/10",Wde="flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left outline-none hover:bg-muted focus-visible:bg-muted aria-[current=page]:bg-muted",Gde=t=>{const e=ee.c(28),{target:n,isCurrent:s,onSwitch:i}=t,o=s?"page":void 0;let r;e[0]!==i||e[1]!==n.id?(r=()=>{i(n.id)},e[0]=i,e[1]=n.id,e[2]=r):r=e[2];let a;e[3]!==n.branchStatus?(a=b.jsx(gp,{status:n.branchStatus,className:"mt-1 size-3.5"}),e[3]=n.branchStatus,e[4]=a):a=e[4];let c;e[5]!==n.title?(c=b.jsx(mf,{segments:[n.title],className:"font-bold"}),e[5]=n.title,e[6]=c):c=e[6];let d;e[7]!==n.author?(d=n.author===null?null:b.jsxs(b.Fragment,{children:[b.jsx(Hf,{imageUrl:n.author.avatarUrl,monogram:n.author.monogram,className:"size-4"}),b.jsx("span",{className:"shrink-0",children:n.author.name})]}),e[7]=n.author,e[8]=d):d=e[8];let f;e[9]!==n.details?(f=b.jsx(mf,{segments:n.details}),e[9]=n.details,e[10]=f):f=e[10];let p;e[11]!==d||e[12]!==f?(p=b.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[d,f]}),e[11]=d,e[12]=f,e[13]=p):p=e[13];let m;e[14]!==c||e[15]!==p?(m=b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[c,p]}),e[14]=c,e[15]=p,e[16]=m):m=e[16];let g;e[17]!==n.statusLabel?(g=b.jsx("span",{className:"sr-only",children:n.statusLabel}),e[17]=n.statusLabel,e[18]=g):g=e[18];let y;e[19]!==s?(y=s?b.jsx(Nu,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0"}):null,e[19]=s,e[20]=y):y=e[20];let v;return e[21]!==o||e[22]!==y||e[23]!==r||e[24]!==a||e[25]!==m||e[26]!==g?(v=b.jsx("li",{children:b.jsxs("button",{type:"button","aria-current":o,className:Wde,onClick:r,children:[a,m,g,y]})}),e[21]=o,e[22]=y,e[23]=r,e[24]=a,e[25]=m,e[26]=g,e[27]=v):v=e[27],v},Kde=t=>{const e=ee.c(27),{switching:n,onSwitch:s}=t,{switcher:i}=n;if(i===null){let g;return e[0]!==n.placeholder?(g=b.jsx("p",{className:"text-muted-foreground",children:n.placeholder}),e[0]=n.placeholder,e[1]=g):g=e[1],g}let o;e[2]!==i.heading?(o=b.jsx(V3,{className:"text-base leading-6 font-bold",children:i.heading}),e[2]=i.heading,e[3]=o):o=e[3];let r;e[4]!==n?(r=g=>{n.onSearch(g.target.value)},e[4]=n,e[5]=r):r=e[5];let a;e[6]!==i.searchPlaceholder||e[7]!==n.query||e[8]!==r?(a=b.jsx(Hm,{type:"search",value:n.query,placeholder:i.searchPlaceholder,"aria-label":i.searchPlaceholder,onChange:r}),e[6]=i.searchPlaceholder,e[7]=n.query,e[8]=r,e[9]=a):a=e[9];let c;e[10]!==i.emptyLabel?(c=i.emptyLabel===null?null:b.jsx("p",{className:"text-muted-foreground",children:i.emptyLabel}),e[10]=i.emptyLabel,e[11]=c):c=e[11];const d=i.heading;let f;if(e[12]!==s||e[13]!==i.currentTargetId||e[14]!==i.targets){let g;e[16]!==s||e[17]!==i.currentTargetId?(g=y=>b.jsx(Gde,{target:y,isCurrent:y.id===i.currentTargetId,onSwitch:s},y.id),e[16]=s,e[17]=i.currentTargetId,e[18]=g):g=e[18],f=i.targets.map(g),e[12]=s,e[13]=i.currentTargetId,e[14]=i.targets,e[15]=f}else f=e[15];let p;e[19]!==i.heading||e[20]!==f?(p=b.jsx("ul",{"aria-label":d,className:"-mx-2 flex max-h-80 flex-col overflow-y-auto",children:f}),e[19]=i.heading,e[20]=f,e[21]=p):p=e[21];let m;return e[22]!==o||e[23]!==a||e[24]!==c||e[25]!==p?(m=b.jsxs(b.Fragment,{children:[o,a,c,p]}),e[22]=o,e[23]=a,e[24]=c,e[25]=p,e[26]=m):m=e[26],m},nE=t=>{const e=ee.c(33),{title:n,className:s,icon:i,switching:o}=t,r=i===void 0?null:i,[a,c]=_.useState(!1);if(o===null){let T;e[0]!==s?(T=Se("min-w-0 truncate",s),e[0]=s,e[1]=T):T=e[1];let R;e[2]!==T||e[3]!==n?(R=b.jsx("h1",{className:T,title:n,children:n}),e[2]=T,e[3]=n,e[4]=R):R=e[4];let A;return e[5]!==r||e[6]!==R?(A=b.jsxs(b.Fragment,{children:[r,R]}),e[5]=r,e[6]=R,e[7]=A):A=e[7],A}let d;e[8]!==o?(d=T=>{var R;c(!1),T!==((R=o.switcher)==null?void 0:R.currentTargetId)&&o.onSwitch(T)},e[8]=o,e[9]=d):d=e[9];const f=d;let p;e[10]!==s?(p=Se("-mx-1.5 flex min-w-0",s),e[10]=s,e[11]=p):p=e[11];let m;e[12]!==o?(m=T=>{c(T),T&&o.onOpen()},e[12]=o,e[13]=m):m=e[13];let g;e[14]!==n?(g=b.jsx("span",{className:"min-w-0 truncate",children:n}),e[14]=n,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=b.jsx(lu,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-sign-muted"}),e[16]=y):y=e[16];let v;e[17]!==r||e[18]!==g||e[19]!==n?(v=b.jsxs(Eb,{className:qde,title:n,children:[r,g,y]}),e[17]=r,e[18]=g,e[19]=n,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=Se(s9,"max-w-[calc(100vw-2rem)] font-sans font-normal"),e[21]=S):S=e[21];let w;e[22]!==f||e[23]!==o?(w=b.jsx(F3,{children:b.jsx(H3,{align:"start",sideOffset:10,className:"isolate z-50",children:b.jsx(U3,{className:S,children:b.jsx(Kde,{switching:o,onSwitch:f})})})}),e[22]=f,e[23]=o,e[24]=w):w=e[24];let N;e[25]!==a||e[26]!==m||e[27]!==v||e[28]!==w?(N=b.jsxs($3,{open:a,onOpenChange:m,children:[v,w]}),e[25]=a,e[26]=m,e[27]=v,e[28]=w,e[29]=N):N=e[29];let C;return e[30]!==N||e[31]!==p?(C=b.jsx("h1",{className:p,children:N}),e[30]=N,e[31]=p,e[32]=C):C=e[32],C},Yde={pending:null,commented:hQ,approved:Nu,"changes-requested":Ky},Xde={pending:"border-sign-muted bg-sign",commented:"border-sign bg-sign-muted text-sign",approved:"border-sign bg-sign-foreground text-sign","changes-requested":"border-sign bg-destructive text-sign-foreground"},a9="border-sign-foreground bg-sign-foreground text-sign",c9="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10",sE="font-bold text-signal",tp="text-sign-muted",Qde={"no-review":"text-sign-foreground","awaiting-review":sE,"awaiting-reply":sE,stale:tp,draft:tp,closed:tp,merged:tp},Q_=t=>{const e=ee.c(5),{freshness:n}=t,s=n.isOutOfDate?sE:tp;let i;e[0]!==s?(i=Se("shrink-0 text-sm",s),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n.label||e[3]!==i?(o=b.jsx("span",{className:i,children:n.label}),e[2]=n.label,e[3]=i,e[4]=o):o=e[4],o},Z_="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm text-sign-muted",Zde="cursor-pointer hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-sign-foreground",Jde="size-2 shrink-0 rounded-full",efe="bg-diff-added",tfe="bg-sign-muted",J_=t=>{const e=ee.c(8),{status:n}=t,s=n.isOnline,i=n.isOnline?efe:tfe;let o;e[0]!==i?(o=Se(Jde,i),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==n.isOnline||e[3]!==o?(r=b.jsx("span",{"aria-hidden":"true","data-online":s,className:o}),e[2]=n.isOnline,e[3]=o,e[4]=r):r=e[4];let a;return e[5]!==n.label||e[6]!==r?(a=b.jsxs(b.Fragment,{children:[r,n.label]}),e[5]=n.label,e[6]=r,e[7]=a):a=e[7],a},nfe=t=>{const e=ee.c(3),{status:n}=t;if(n===null)return null;const{onClick:s}=n;let i;return e[0]!==s||e[1]!==n?(i=s===null?b.jsx("span",{className:Z_,children:b.jsx(J_,{status:n})}):b.jsx("button",{type:"button",className:Se(Z_,Zde),onClick:s,children:b.jsx(J_,{status:n})}),e[0]=s,e[1]=n,e[2]=i):i=e[2],i},sfe="relative block rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sign-foreground",e5=t=>{const e=ee.c(18),{reviewer:n}=t,s=Yde[n.state],i=n.avatarUrl,o=n.monogram;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Se("size-6",a9),e[0]=r):r=e[0];let a;e[1]!==n.avatarUrl||e[2]!==n.monogram?(a=b.jsx(Hf,{imageUrl:i,monogram:o,className:r}),e[1]=n.avatarUrl,e[2]=n.monogram,e[3]=a):a=e[3];const c=n.state,d=Xde[n.state];let f;e[4]!==d?(f=Se("absolute -right-1 -bottom-1 flex size-3.5 items-center justify-center rounded-full border",d),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==s?(p=s===null?null:b.jsx(s,{className:"size-2.5",strokeWidth:3}),e[6]=s,e[7]=p):p=e[7];let m;e[8]!==n.state||e[9]!==f||e[10]!==p?(m=b.jsx("span",{"aria-hidden":"true","data-state":c,className:f,children:p}),e[8]=n.state,e[9]=f,e[10]=p,e[11]=m):m=e[11];let g;e[12]!==n.stateLabel?(g=b.jsx("span",{className:"sr-only",children:n.stateLabel}),e[12]=n.stateLabel,e[13]=g):g=e[13];let y;return e[14]!==g||e[15]!==a||e[16]!==m?(y=b.jsxs(b.Fragment,{children:[a,m,g]}),e[14]=g,e[15]=a,e[16]=m,e[17]=y):y=e[17],y},ife=t=>{const e=ee.c(21),{reviewer:n,requesting:s}=t,{request:i}=n;if(i===null||s===null){let f;e[0]!==n?(f=b.jsx(e5,{reviewer:n}),e[0]=n,e[1]=f):f=e[1];let p;return e[2]!==n.stateLabel||e[3]!==f?(p=b.jsx("li",{className:"relative",title:n.stateLabel,children:f}),e[2]=n.stateLabel,e[3]=f,e[4]=p):p=e[4],p}let o;e[5]!==n?(o=b.jsx(VP,{className:sfe,children:b.jsx(e5,{reviewer:n})}),e[5]=n,e[6]=o):o=e[6];let r;e[7]!==i.isRemoving||e[8]!==i.login||e[9]!==s?(r=()=>{i.isRemoving?s.onRemove(i.login):s.onRequest(i.login)},e[7]=i.isRemoving,e[8]=i.login,e[9]=s,e[10]=r):r=e[10];let a;e[11]!==i.label||e[12]!==s.isPending||e[13]!==r?(a=b.jsx(qP,{align:"end",children:b.jsx(Vd,{disabled:s.isPending,onClick:r,children:i.label})}),e[11]=i.label,e[12]=s.isPending,e[13]=r,e[14]=a):a=e[14];let c;e[15]!==o||e[16]!==a?(c=b.jsxs(UP,{children:[o,a]}),e[15]=o,e[16]=a,e[17]=c):c=e[17];let d;return e[18]!==n.stateLabel||e[19]!==c?(d=b.jsx("li",{title:n.stateLabel,children:c}),e[18]=n.stateLabel,e[19]=c,e[20]=d):d=e[20],d},ofe=t=>{var N,C,T;const e=ee.c(33),{labels:n,requesting:s}=t,i=s.onOpen,o=n.buttonLabel,r=n.buttonLabel;let a,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Se(c9,"px-1.5"),c=b.jsx(vQ,{"aria-hidden":"true",className:"size-3.5"}),e[0]=a,e[1]=c):(a=e[0],c=e[1]);let d;e[2]!==n.buttonLabel?(d=b.jsx(Eb,{"aria-label":o,title:r,className:a,children:c}),e[2]=n.buttonLabel,e[3]=d):d=e[3];let f;e[4]!==n.heading?(f=b.jsx(V3,{className:"text-base leading-6 font-bold",children:n.heading}),e[4]=n.heading,e[5]=f):f=e[5];let p;e[6]!==s?(p=R=>{s.onSearch(R.target.value)},e[6]=s,e[7]=p):p=e[7];let m;e[8]!==n.searchPlaceholder||e[9]!==s.query||e[10]!==p?(m=b.jsx(Hm,{type:"search",value:s.query,placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder,onChange:p}),e[8]=n.searchPlaceholder,e[9]=s.query,e[10]=p,e[11]=m):m=e[11];let g;e[12]!==n.emptyLabel||e[13]!==((N=s.options)==null?void 0:N.length)?(g=((C=s.options)==null?void 0:C.length)===0?b.jsx("p",{className:"text-muted-foreground",children:n.emptyLabel}):null,e[12]=n.emptyLabel,e[13]=(T=s.options)==null?void 0:T.length,e[14]=g):g=e[14];let y;e[15]!==s.options?(y=s.options??[],e[15]=s.options,e[16]=y):y=e[16];let v;if(e[17]!==n.requestLabel||e[18]!==s||e[19]!==y){let R;e[21]!==n.requestLabel||e[22]!==s?(R=A=>b.jsxs("li",{className:"flex items-center gap-2 border-t py-2 first:border-t-0 first:pt-0 last:pb-0",children:[b.jsx(Hf,{imageUrl:A.avatarUrl,monogram:A.monogram,className:"size-6"}),b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsx("span",{className:"truncate font-bold",children:A.name}),b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:A.detail})]}),b.jsx(ft,{type:"button",variant:"outline",size:"sm","aria-label":`${n.requestLabel} ${A.name}`,disabled:s.isPending,onClick:()=>{s.onRequest(A.login)},children:n.requestLabel})]},A.login),e[21]=n.requestLabel,e[22]=s,e[23]=R):R=e[23],v=y.map(R),e[17]=n.requestLabel,e[18]=s,e[19]=y,e[20]=v}else v=e[20];let S;e[24]!==v?(S=b.jsx("ul",{className:"flex max-h-72 flex-col overflow-y-auto",children:v}),e[24]=v,e[25]=S):S=e[25];let w;return e[26]!==s.onOpen||e[27]!==g||e[28]!==S||e[29]!==d||e[30]!==f||e[31]!==m?(w=b.jsxs(q3,{onOpen:i,trigger:d,children:[f,m,g,S]}),e[26]=s.onOpen,e[27]=g,e[28]=S,e[29]=d,e[30]=f,e[31]=m,e[32]=w):w=e[32],w},iE=t=>{const e=ee.c(2),{segments:n}=t;let s;return e[0]!==n?(s=n===null?null:b.jsx(mf,{segments:n,className:"shrink-0 flex-nowrap text-sm text-sign-muted tabular-nums"}),e[0]=n,e[1]=s):s=e[1],s},u9="font-mono text-[0.94rem] font-bold",d9="text-base font-bold",f9=b.jsx(uQ,{"aria-hidden":"true",className:"size-4 shrink-0 text-sign-muted"}),rfe="shrink-0 rounded-sm border border-sign-foreground/35 px-1.5 py-0.5 text-xs font-bold text-sign-foreground",lfe=t=>{const e=ee.c(15),{title:n,isBranch:s,label:i,changedFiles:o,switching:r,actions:a}=t,c=o===void 0?null:o,d=r===void 0?null:r,f=s?u9:d9,p=s?f9:null;let m;e[0]!==d||e[1]!==f||e[2]!==p||e[3]!==n?(m=b.jsx(nE,{title:n,className:f,icon:p,switching:d}),e[0]=d,e[1]=f,e[2]=p,e[3]=n,e[4]=m):m=e[4];let g;e[5]!==i?(g=b.jsx("span",{className:rfe,children:i}),e[5]=i,e[6]=g):g=e[6];let y;e[7]!==c?(y=b.jsx(iE,{segments:c}),e[7]=c,e[8]=y):y=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=b.jsx("span",{className:"flex-1"}),e[9]=v):v=e[9];let S;return e[10]!==a||e[11]!==m||e[12]!==g||e[13]!==y?(S=b.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[m,g,y,v,a]}),e[10]=a,e[11]=m,e[12]=g,e[13]=y,e[14]=S):S=e[14],S},afe=t=>{const e=ee.c(17),{header:n,changedFiles:s,requesting:i,switching:o,actions:r}=t;let a;return e[0]!==r||e[1]!==s||e[2]!==n.action||e[3]!==n.artifactFreshness||e[4]!==n.author||e[5]!==n.branch||e[6]!==n.forgeMessage||e[7]!==n.kind||e[8]!==n.reviewerRequest||e[9]!==n.reviewers||e[10]!==n.reviewersEmptyLabel||e[11]!==n.status||e[12]!==n.statusLabel||e[13]!==n.title||e[14]!==i||e[15]!==o?(a=n.kind==="branch"?b.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[b.jsx(nE,{title:n.branch,className:u9,icon:f9,switching:o}),n.artifactFreshness===null?null:b.jsx(Q_,{freshness:n.artifactFreshness}),b.jsx(iE,{segments:s}),b.jsx("span",{className:"flex-1"}),b.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:n.forgeMessage}),b.jsx("a",{href:n.action.href,className:c9,children:b.jsx("span",{className:"text-box-cap",children:n.action.label})}),r]}):b.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[b.jsxs("span",{className:"shrink-0",title:n.author.name,children:[b.jsx(Hf,{imageUrl:n.author.avatarUrl,monogram:n.author.monogram,className:Se("size-7 text-xs",a9)}),b.jsx("span",{className:"sr-only",children:n.author.name})]}),b.jsx(nE,{title:n.title,className:d9,switching:o}),b.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[b.jsx(gp,{status:n.status}),b.jsx("span",{className:Se("text-sm",Qde[n.status]),children:n.statusLabel})]}),n.artifactFreshness===null?null:b.jsx(Q_,{freshness:n.artifactFreshness}),b.jsx(iE,{segments:s}),b.jsx("span",{className:"flex-1"}),n.reviewersEmptyLabel===null?b.jsx("ul",{"aria-label":"Reviewers",className:"flex shrink-0 gap-2.5",children:n.reviewers.map(c=>b.jsx(ife,{reviewer:c,requesting:i},c.name))}):b.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:n.reviewersEmptyLabel}),n.reviewerRequest===null||i===null?null:b.jsx(ofe,{labels:n.reviewerRequest,requesting:i}),r]}),e[0]=r,e[1]=s,e[2]=n.action,e[3]=n.artifactFreshness,e[4]=n.author,e[5]=n.branch,e[6]=n.forgeMessage,e[7]=n.kind,e[8]=n.reviewerRequest,e[9]=n.reviewers,e[10]=n.reviewersEmptyLabel,e[11]=n.status,e[12]=n.statusLabel,e[13]=n.title,e[14]=i,e[15]=o,e[16]=a):a=e[16],a},cfe=t=>{const e=ee.c(12),{header:n,changedFiles:s,authorLabel:i,reviewerRequesting:o,targetSwitching:r,agentStatus:a,actions:c}=t,d=s===void 0?null:s,f=i===void 0?null:i,p=o===void 0?null:o,m=r===void 0?null:r,g=a===void 0?null:a;let y;e[0]!==g?(y=b.jsx(nfe,{status:g}),e[0]=g,e[1]=y):y=e[1];let v;e[2]!==c||e[3]!==y?(v=b.jsxs(b.Fragment,{children:[y,c]}),e[2]=c,e[3]=y,e[4]=v):v=e[4];const S=v;let w;return e[5]!==f||e[6]!==d||e[7]!==n||e[8]!==p||e[9]!==m||e[10]!==S?(w=f===null?b.jsx(afe,{header:n,changedFiles:d,requesting:p,switching:m,actions:S}):b.jsx(lfe,{title:n.kind==="branch"?n.branch:n.title,isBranch:n.kind==="branch",label:f,changedFiles:d,switching:m,actions:S}),e[5]=f,e[6]=d,e[7]=n,e[8]=p,e[9]=m,e[10]=S,e[11]=w):w=e[11],w},ufe=t=>{const e=ee.c(4),{message:n}=t;let s;e[0]!==n?(s=n===null?null:b.jsx("p",{className:"rounded-lg border border-foreground bg-popover px-3 py-2 text-sm text-popover-foreground duration-150 animate-in fade-in-0",children:n}),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==s?(i=b.jsx("div",{role:"status",className:"pointer-events-none fixed bottom-4 left-1/2 z-[60] -translate-x-1/2",children:s}),e[2]=s,e[3]=i):i=e[3],i};function ls(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,s;n<t.length;n++)(s=ls(t[n]))!==""&&(e+=(e&&" ")+s);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var dfe={value:()=>{}};function Nb(){for(var t=0,e=arguments.length,n={},s;t<e;++t){if(!(s=arguments[t]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new N1(n)}function N1(t){this._=t}function ffe(t,e){return t.trim().split(/^|\s+/).map(function(n){var s="",i=n.indexOf(".");if(i>=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}N1.prototype=Nb.prototype={constructor:N1,on:function(t,e){var n=this._,s=ffe(t+"",n),i,o=-1,r=s.length;if(arguments.length<2){for(;++o<r;)if((i=(t=s[o]).type)&&(i=hfe(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<r;)if(i=(t=s[o]).type)n[i]=t5(n[i],t.name,e);else if(e==null)for(i in n)n[i]=t5(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new N1(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),s=0,i,o;s<i;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],s=0,i=o.length;s<i;++s)o[s].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],i=0,o=s.length;i<o;++i)s[i].value.apply(e,n)}};function hfe(t,e){for(var n=0,s=t.length,i;n<s;++n)if((i=t[n]).name===e)return i.value}function t5(t,e,n){for(var s=0,i=t.length;s<i;++s)if(t[s].name===e){t[s]=dfe,t=t.slice(0,s).concat(t.slice(s+1));break}return n!=null&&t.push({name:e,value:n}),t}var oE="http://www.w3.org/1999/xhtml";const n5={svg:"http://www.w3.org/2000/svg",xhtml:oE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Tb(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),n5.hasOwnProperty(e)?{space:n5[e],local:t}:t}function pfe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===oE&&e.documentElement.namespaceURI===oE?e.createElement(t):e.createElementNS(n,t)}}function mfe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h9(t){var e=Tb(t);return(e.local?mfe:pfe)(e)}function gfe(){}function Y3(t){return t==null?gfe:function(){return this.querySelector(t)}}function yfe(t){typeof t!="function"&&(t=Y3(t));for(var e=this._groups,n=e.length,s=new Array(n),i=0;i<n;++i)for(var o=e[i],r=o.length,a=s[i]=new Array(r),c,d,f=0;f<r;++f)(c=o[f])&&(d=t.call(c,c.__data__,f,o))&&("__data__"in c&&(d.__data__=c.__data__),a[f]=d);return new qi(s,this._parents)}function bfe(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function xfe(){return[]}function p9(t){return t==null?xfe:function(){return this.querySelectorAll(t)}}function vfe(t){return function(){return bfe(t.apply(this,arguments))}}function Sfe(t){typeof t=="function"?t=vfe(t):t=p9(t);for(var e=this._groups,n=e.length,s=[],i=[],o=0;o<n;++o)for(var r=e[o],a=r.length,c,d=0;d<a;++d)(c=r[d])&&(s.push(t.call(c,c.__data__,d,r)),i.push(c));return new qi(s,i)}function m9(t){return function(){return this.matches(t)}}function g9(t){return function(e){return e.matches(t)}}var wfe=Array.prototype.find;function Efe(t){return function(){return wfe.call(this.children,t)}}function Cfe(){return this.firstElementChild}function Nfe(t){return this.select(t==null?Cfe:Efe(typeof t=="function"?t:g9(t)))}var Tfe=Array.prototype.filter;function Ofe(){return Array.from(this.children)}function Rfe(t){return function(){return Tfe.call(this.children,t)}}function kfe(t){return this.selectAll(t==null?Ofe:Rfe(typeof t=="function"?t:g9(t)))}function Afe(t){typeof t!="function"&&(t=m9(t));for(var e=this._groups,n=e.length,s=new Array(n),i=0;i<n;++i)for(var o=e[i],r=o.length,a=s[i]=[],c,d=0;d<r;++d)(c=o[d])&&t.call(c,c.__data__,d,o)&&a.push(c);return new qi(s,this._parents)}function y9(t){return new Array(t.length)}function _fe(){return new qi(this._enter||this._groups.map(y9),this._parents)}function sy(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}sy.prototype={constructor:sy,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Mfe(t){return function(){return t}}function Lfe(t,e,n,s,i,o){for(var r=0,a,c=e.length,d=o.length;r<d;++r)(a=e[r])?(a.__data__=o[r],s[r]=a):n[r]=new sy(t,o[r]);for(;r<c;++r)(a=e[r])&&(i[r]=a)}function Ife(t,e,n,s,i,o,r){var a,c,d=new Map,f=e.length,p=o.length,m=new Array(f),g;for(a=0;a<f;++a)(c=e[a])&&(m[a]=g=r.call(c,c.__data__,a,e)+"",d.has(g)?i[a]=c:d.set(g,c));for(a=0;a<p;++a)g=r.call(t,o[a],a,o)+"",(c=d.get(g))?(s[a]=c,c.__data__=o[a],d.delete(g)):n[a]=new sy(t,o[a]);for(a=0;a<f;++a)(c=e[a])&&d.get(m[a])===c&&(i[a]=c)}function Dfe(t){return t.__data__}function jfe(t,e){if(!arguments.length)return Array.from(this,Dfe);var n=e?Ife:Lfe,s=this._parents,i=this._groups;typeof t!="function"&&(t=Mfe(t));for(var o=i.length,r=new Array(o),a=new Array(o),c=new Array(o),d=0;d<o;++d){var f=s[d],p=i[d],m=p.length,g=Pfe(t.call(f,f&&f.__data__,d,s)),y=g.length,v=a[d]=new Array(y),S=r[d]=new Array(y),w=c[d]=new Array(m);n(f,p,v,S,w,g,e);for(var N=0,C=0,T,R;N<y;++N)if(T=v[N]){for(N>=C&&(C=N+1);!(R=S[C])&&++C<y;);T._next=R||null}}return r=new qi(r,s),r._enter=a,r._exit=c,r}function Pfe(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function zfe(){return new qi(this._exit||this._groups.map(y9),this._parents)}function Bfe(t,e,n){var s=this.enter(),i=this,o=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),s&&i?s.merge(i).order():i}function $fe(t){for(var e=t.selection?t.selection():t,n=this._groups,s=e._groups,i=n.length,o=s.length,r=Math.min(i,o),a=new Array(i),c=0;c<r;++c)for(var d=n[c],f=s[c],p=d.length,m=a[c]=new Array(p),g,y=0;y<p;++y)(g=d[y]||f[y])&&(m[y]=g);for(;c<i;++c)a[c]=n[c];return new qi(a,this._parents)}function Ffe(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var s=t[e],i=s.length-1,o=s[i],r;--i>=0;)(r=s[i])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function Hfe(t){t||(t=Ufe);function e(p,m){return p&&m?t(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,i=new Array(s),o=0;o<s;++o){for(var r=n[o],a=r.length,c=i[o]=new Array(a),d,f=0;f<a;++f)(d=r[f])&&(c[f]=d);c.sort(e)}return new qi(i,this._parents).order()}function Ufe(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Vfe(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function qfe(){return Array.from(this)}function Wfe(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],i=0,o=s.length;i<o;++i){var r=s[i];if(r)return r}return null}function Gfe(){let t=0;for(const e of this)++t;return t}function Kfe(){return!this.node()}function Yfe(t){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var i=e[n],o=0,r=i.length,a;o<r;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Xfe(t){return function(){this.removeAttribute(t)}}function Qfe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zfe(t,e){return function(){this.setAttribute(t,e)}}function Jfe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ehe(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function the(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function nhe(t,e){var n=Tb(t);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((e==null?n.local?Qfe:Xfe:typeof e=="function"?n.local?the:ehe:n.local?Jfe:Zfe)(n,e))}function b9(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function she(t){return function(){this.style.removeProperty(t)}}function ihe(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ohe(t,e,n){return function(){var s=e.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,n)}}function rhe(t,e,n){return arguments.length>1?this.each((e==null?she:typeof e=="function"?ohe:ihe)(t,e,n??"")):yf(this.node(),t)}function yf(t,e){return t.style.getPropertyValue(e)||b9(t).getComputedStyle(t,null).getPropertyValue(e)}function lhe(t){return function(){delete this[t]}}function ahe(t,e){return function(){this[t]=e}}function che(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function uhe(t,e){return arguments.length>1?this.each((e==null?lhe:typeof e=="function"?che:ahe)(t,e)):this.node()[t]}function x9(t){return t.trim().split(/^|\s+/)}function X3(t){return t.classList||new v9(t)}function v9(t){this._node=t,this._names=x9(t.getAttribute("class")||"")}v9.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function S9(t,e){for(var n=X3(t),s=-1,i=e.length;++s<i;)n.add(e[s])}function w9(t,e){for(var n=X3(t),s=-1,i=e.length;++s<i;)n.remove(e[s])}function dhe(t){return function(){S9(this,t)}}function fhe(t){return function(){w9(this,t)}}function hhe(t,e){return function(){(e.apply(this,arguments)?S9:w9)(this,t)}}function phe(t,e){var n=x9(t+"");if(arguments.length<2){for(var s=X3(this.node()),i=-1,o=n.length;++i<o;)if(!s.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?hhe:e?dhe:fhe)(n,e))}function mhe(){this.textContent=""}function ghe(t){return function(){this.textContent=t}}function yhe(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function bhe(t){return arguments.length?this.each(t==null?mhe:(typeof t=="function"?yhe:ghe)(t)):this.node().textContent}function xhe(){this.innerHTML=""}function vhe(t){return function(){this.innerHTML=t}}function She(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function whe(t){return arguments.length?this.each(t==null?xhe:(typeof t=="function"?She:vhe)(t)):this.node().innerHTML}function Ehe(){this.nextSibling&&this.parentNode.appendChild(this)}function Che(){return this.each(Ehe)}function Nhe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function The(){return this.each(Nhe)}function Ohe(t){var e=typeof t=="function"?t:h9(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Rhe(){return null}function khe(t,e){var n=typeof t=="function"?t:h9(t),s=e==null?Rhe:typeof e=="function"?e:Y3(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Ahe(){var t=this.parentNode;t&&t.removeChild(this)}function _he(){return this.each(Ahe)}function Mhe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Lhe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ihe(t){return this.select(t?Lhe:Mhe)}function Dhe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function jhe(t){return function(e){t.call(this,e,this.__data__)}}function Phe(t){return t.trim().split(/^|\s+/).map(function(e){var n="",s=e.indexOf(".");return s>=0&&(n=e.slice(s+1),e=e.slice(0,s)),{type:e,name:n}})}function zhe(t){return function(){var e=this.__on;if(e){for(var n=0,s=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++s]=o;++s?e.length=s:delete this.__on}}}function Bhe(t,e,n){return function(){var s=this.__on,i,o=jhe(e);if(s){for(var r=0,a=s.length;r<a;++r)if((i=s[r]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},s?s.push(i):this.__on=[i]}}function $he(t,e,n){var s=Phe(t+""),i,o=s.length,r;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,d=a.length,f;c<d;++c)for(i=0,f=a[c];i<o;++i)if((r=s[i]).type===f.type&&r.name===f.name)return f.value}return}for(a=e?Bhe:zhe,i=0;i<o;++i)this.each(a(s[i],e,n));return this}function E9(t,e,n){var s=b9(t),i=s.CustomEvent;typeof i=="function"?i=new i(e,n):(i=s.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Fhe(t,e){return function(){return E9(this,t,e)}}function Hhe(t,e){return function(){return E9(this,t,e.apply(this,arguments))}}function Uhe(t,e){return this.each((typeof e=="function"?Hhe:Fhe)(t,e))}function*Vhe(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],i=0,o=s.length,r;i<o;++i)(r=s[i])&&(yield r)}var C9=[null];function qi(t,e){this._groups=t,this._parents=e}function Um(){return new qi([[document.documentElement]],C9)}function qhe(){return this}qi.prototype=Um.prototype={constructor:qi,select:yfe,selectAll:Sfe,selectChild:Nfe,selectChildren:kfe,filter:Afe,data:jfe,enter:_fe,exit:zfe,join:Bfe,merge:$fe,selection:qhe,order:Ffe,sort:Hfe,call:Vfe,nodes:qfe,node:Wfe,size:Gfe,empty:Kfe,each:Yfe,attr:nhe,style:rhe,property:uhe,classed:phe,text:bhe,html:whe,raise:Che,lower:The,append:Ohe,insert:khe,remove:_he,clone:Ihe,datum:Dhe,on:$he,dispatch:Uhe,[Symbol.iterator]:Vhe};function Bi(t){return typeof t=="string"?new qi([[document.querySelector(t)]],[document.documentElement]):new qi([[t]],C9)}function Whe(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Co(t,e){if(t=Whe(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(e.getScreenCTM().inverse()),[s.x,s.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Ghe={passive:!1},$p={capture:!0,passive:!1};function aS(t){t.stopImmediatePropagation()}function qd(t){t.preventDefault(),t.stopImmediatePropagation()}function N9(t){var e=t.document.documentElement,n=Bi(t).on("dragstart.drag",qd,$p);"onselectstart"in e?n.on("selectstart.drag",qd,$p):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function T9(t,e){var n=t.document.documentElement,s=Bi(t).on("dragstart.drag",null);e&&(s.on("click.drag",qd,$p),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const W0=t=>()=>t;function rE(t,{sourceEvent:e,subject:n,target:s,identifier:i,active:o,x:r,y:a,dx:c,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:f}})}rE.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Khe(t){return!t.ctrlKey&&!t.button}function Yhe(){return this.parentNode}function Xhe(t,e){return e??{x:t.x,y:t.y}}function Qhe(){return navigator.maxTouchPoints||"ontouchstart"in this}function O9(){var t=Khe,e=Yhe,n=Xhe,s=Qhe,i={},o=Nb("start","drag","end"),r=0,a,c,d,f,p=0;function m(T){T.on("mousedown.drag",g).filter(s).on("touchstart.drag",S).on("touchmove.drag",w,Ghe).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(T,R){if(!(f||!t.call(this,T,R))){var A=C(this,e.call(this,T,R),T,R,"mouse");A&&(Bi(T.view).on("mousemove.drag",y,$p).on("mouseup.drag",v,$p),N9(T.view),aS(T),d=!1,a=T.clientX,c=T.clientY,A("start",T))}}function y(T){if(qd(T),!d){var R=T.clientX-a,A=T.clientY-c;d=R*R+A*A>p}i.mouse("drag",T)}function v(T){Bi(T.view).on("mousemove.drag mouseup.drag",null),T9(T.view,d),qd(T),i.mouse("end",T)}function S(T,R){if(t.call(this,T,R)){var A=T.changedTouches,k=e.call(this,T,R),M=A.length,L,j;for(L=0;L<M;++L)(j=C(this,k,T,R,A[L].identifier,A[L]))&&(aS(T),j("start",T,A[L]))}}function w(T){var R=T.changedTouches,A=R.length,k,M;for(k=0;k<A;++k)(M=i[R[k].identifier])&&(qd(T),M("drag",T,R[k]))}function N(T){var R=T.changedTouches,A=R.length,k,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),k=0;k<A;++k)(M=i[R[k].identifier])&&(aS(T),M("end",T,R[k]))}function C(T,R,A,k,M,L){var j=o.copy(),D=Co(L||A,R),P,B,I;if((I=n.call(T,new rE("beforestart",{sourceEvent:A,target:m,identifier:M,active:r,x:D[0],y:D[1],dx:0,dy:0,dispatch:j}),k))!=null)return P=I.x-D[0]||0,B=I.y-D[1]||0,function F(z,U,H){var V=D,W;switch(z){case"start":i[M]=F,W=r++;break;case"end":delete i[M],--r;case"drag":D=Co(H||U,R),W=r;break}j.call(z,T,new rE(z,{sourceEvent:U,subject:I,target:m,identifier:M,active:W,x:D[0]+P,y:D[1]+B,dx:D[0]-V[0],dy:D[1]-V[1],dispatch:j}),k)}}return m.filter=function(T){return arguments.length?(t=typeof T=="function"?T:W0(!!T),m):t},m.container=function(T){return arguments.length?(e=typeof T=="function"?T:W0(T),m):e},m.subject=function(T){return arguments.length?(n=typeof T=="function"?T:W0(T),m):n},m.touchable=function(T){return arguments.length?(s=typeof T=="function"?T:W0(!!T),m):s},m.on=function(){var T=o.on.apply(o,arguments);return T===o?m:T},m.clickDistance=function(T){return arguments.length?(p=(T=+T)*T,m):Math.sqrt(p)},m}function Q3(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function R9(t,e){var n=Object.create(t.prototype);for(var s in e)n[s]=e[s];return n}function Vm(){}var Fp=.7,iy=1/Fp,Wd="\\s*([+-]?\\d+)\\s*",Hp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zhe=/^#([0-9a-f]{3,8})$/,Jhe=new RegExp(`^rgb\\(${Wd},${Wd},${Wd}\\)$`),epe=new RegExp(`^rgb\\(${dr},${dr},${dr}\\)$`),tpe=new RegExp(`^rgba\\(${Wd},${Wd},${Wd},${Hp}\\)$`),npe=new RegExp(`^rgba\\(${dr},${dr},${dr},${Hp}\\)$`),spe=new RegExp(`^hsl\\(${Hp},${dr},${dr}\\)$`),ipe=new RegExp(`^hsla\\(${Hp},${dr},${dr},${Hp}\\)$`),s5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Q3(Vm,du,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:i5,formatHex:i5,formatHex8:ope,formatHsl:rpe,formatRgb:o5,toString:o5});function i5(){return this.rgb().formatHex()}function ope(){return this.rgb().formatHex8()}function rpe(){return k9(this).formatHsl()}function o5(){return this.rgb().formatRgb()}function du(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zhe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?r5(e):n===3?new wi(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?G0(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?G0(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Jhe.exec(t))?new wi(e[1],e[2],e[3],1):(e=epe.exec(t))?new wi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=tpe.exec(t))?G0(e[1],e[2],e[3],e[4]):(e=npe.exec(t))?G0(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=spe.exec(t))?c5(e[1],e[2]/100,e[3]/100,1):(e=ipe.exec(t))?c5(e[1],e[2]/100,e[3]/100,e[4]):s5.hasOwnProperty(t)?r5(s5[t]):t==="transparent"?new wi(NaN,NaN,NaN,0):null}function r5(t){return new wi(t>>16&255,t>>8&255,t&255,1)}function G0(t,e,n,s){return s<=0&&(t=e=n=NaN),new wi(t,e,n,s)}function lpe(t){return t instanceof Vm||(t=du(t)),t?(t=t.rgb(),new wi(t.r,t.g,t.b,t.opacity)):new wi}function lE(t,e,n,s){return arguments.length===1?lpe(t):new wi(t,e,n,s??1)}function wi(t,e,n,s){this.r=+t,this.g=+e,this.b=+n,this.opacity=+s}Q3(wi,lE,R9(Vm,{brighter(t){return t=t==null?iy:Math.pow(iy,t),new wi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Fp:Math.pow(Fp,t),new wi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new wi(eu(this.r),eu(this.g),eu(this.b),oy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:l5,formatHex:l5,formatHex8:ape,formatRgb:a5,toString:a5}));function l5(){return`#${$c(this.r)}${$c(this.g)}${$c(this.b)}`}function ape(){return`#${$c(this.r)}${$c(this.g)}${$c(this.b)}${$c((isNaN(this.opacity)?1:this.opacity)*255)}`}function a5(){const t=oy(this.opacity);return`${t===1?"rgb(":"rgba("}${eu(this.r)}, ${eu(this.g)}, ${eu(this.b)}${t===1?")":`, ${t})`}`}function oy(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function eu(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $c(t){return t=eu(t),(t<16?"0":"")+t.toString(16)}function c5(t,e,n,s){return s<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new No(t,e,n,s)}function k9(t){if(t instanceof No)return new No(t.h,t.s,t.l,t.opacity);if(t instanceof Vm||(t=du(t)),!t)return new No;if(t instanceof No)return t;t=t.rgb();var e=t.r/255,n=t.g/255,s=t.b/255,i=Math.min(e,n,s),o=Math.max(e,n,s),r=NaN,a=o-i,c=(o+i)/2;return a?(e===o?r=(n-s)/a+(n<s)*6:n===o?r=(s-e)/a+2:r=(e-n)/a+4,a/=c<.5?o+i:2-o-i,r*=60):a=c>0&&c<1?0:r,new No(r,a,c,t.opacity)}function cpe(t,e,n,s){return arguments.length===1?k9(t):new No(t,e,n,s??1)}function No(t,e,n,s){this.h=+t,this.s=+e,this.l=+n,this.opacity=+s}Q3(No,cpe,R9(Vm,{brighter(t){return t=t==null?iy:Math.pow(iy,t),new No(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Fp:Math.pow(Fp,t),new No(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*e,i=2*n-s;return new wi(cS(t>=240?t-240:t+120,i,s),cS(t,i,s),cS(t<120?t+240:t-120,i,s),this.opacity)},clamp(){return new No(u5(this.h),K0(this.s),K0(this.l),oy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=oy(this.opacity);return`${t===1?"hsl(":"hsla("}${u5(this.h)}, ${K0(this.s)*100}%, ${K0(this.l)*100}%${t===1?")":`, ${t})`}`}}));function u5(t){return t=(t||0)%360,t<0?t+360:t}function K0(t){return Math.max(0,Math.min(1,t||0))}function cS(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Z3=t=>()=>t;function upe(t,e){return function(n){return t+n*e}}function dpe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(s){return Math.pow(t+s*e,n)}}function fpe(t){return(t=+t)==1?A9:function(e,n){return n-e?dpe(e,n,t):Z3(isNaN(e)?n:e)}}function A9(t,e){var n=e-t;return n?upe(t,n):Z3(isNaN(t)?e:t)}const ry=(function t(e){var n=fpe(e);function s(i,o){var r=n((i=lE(i)).r,(o=lE(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),d=A9(i.opacity,o.opacity);return function(f){return i.r=r(f),i.g=a(f),i.b=c(f),i.opacity=d(f),i+""}}return s.gamma=t,s})(1);function hpe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,s=e.slice(),i;return function(o){for(i=0;i<n;++i)s[i]=t[i]*(1-o)+e[i]*o;return s}}function ppe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function mpe(t,e){var n=e?e.length:0,s=t?Math.min(n,t.length):0,i=new Array(s),o=new Array(n),r;for(r=0;r<s;++r)i[r]=yp(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(a){for(r=0;r<s;++r)o[r]=i[r](a);return o}}function gpe(t,e){var n=new Date;return t=+t,e=+e,function(s){return n.setTime(t*(1-s)+e*s),n}}function ir(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ype(t,e){var n={},s={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=yp(t[i],e[i]):s[i]=e[i];return function(o){for(i in n)s[i]=n[i](o);return s}}var aE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uS=new RegExp(aE.source,"g");function bpe(t){return function(){return t}}function xpe(t){return function(e){return t(e)+""}}function _9(t,e){var n=aE.lastIndex=uS.lastIndex=0,s,i,o,r=-1,a=[],c=[];for(t=t+"",e=e+"";(s=aE.exec(t))&&(i=uS.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[r]?a[r]+=o:a[++r]=o),(s=s[0])===(i=i[0])?a[r]?a[r]+=i:a[++r]=i:(a[++r]=null,c.push({i:r,x:ir(s,i)})),n=uS.lastIndex;return n<e.length&&(o=e.slice(n),a[r]?a[r]+=o:a[++r]=o),a.length<2?c[0]?xpe(c[0].x):bpe(e):(e=c.length,function(d){for(var f=0,p;f<e;++f)a[(p=c[f]).i]=p.x(d);return a.join("")})}function yp(t,e){var n=typeof e,s;return e==null||n==="boolean"?Z3(e):(n==="number"?ir:n==="string"?(s=du(e))?(e=s,ry):_9:e instanceof du?ry:e instanceof Date?gpe:ppe(e)?hpe:Array.isArray(e)?mpe:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ype:ir)(t,e)}var d5=180/Math.PI,cE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function M9(t,e,n,s,i,o){var r,a,c;return(r=Math.sqrt(t*t+e*e))&&(t/=r,e/=r),(c=t*n+e*s)&&(n-=t*c,s-=e*c),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,c/=a),t*s<e*n&&(t=-t,e=-e,c=-c,r=-r),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*d5,skewX:Math.atan(c)*d5,scaleX:r,scaleY:a}}var Y0;function vpe(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?cE:M9(e.a,e.b,e.c,e.d,e.e,e.f)}function Spe(t){return t==null||(Y0||(Y0=document.createElementNS("http://www.w3.org/2000/svg","g")),Y0.setAttribute("transform",t),!(t=Y0.transform.baseVal.consolidate()))?cE:(t=t.matrix,M9(t.a,t.b,t.c,t.d,t.e,t.f))}function L9(t,e,n,s){function i(d){return d.length?d.pop()+" ":""}function o(d,f,p,m,g,y){if(d!==p||f!==m){var v=g.push("translate(",null,e,null,n);y.push({i:v-4,x:ir(d,p)},{i:v-2,x:ir(f,m)})}else(p||m)&&g.push("translate("+p+e+m+n)}function r(d,f,p,m){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),m.push({i:p.push(i(p)+"rotate(",null,s)-2,x:ir(d,f)})):f&&p.push(i(p)+"rotate("+f+s)}function a(d,f,p,m){d!==f?m.push({i:p.push(i(p)+"skewX(",null,s)-2,x:ir(d,f)}):f&&p.push(i(p)+"skewX("+f+s)}function c(d,f,p,m,g,y){if(d!==p||f!==m){var v=g.push(i(g)+"scale(",null,",",null,")");y.push({i:v-4,x:ir(d,p)},{i:v-2,x:ir(f,m)})}else(p!==1||m!==1)&&g.push(i(g)+"scale("+p+","+m+")")}return function(d,f){var p=[],m=[];return d=t(d),f=t(f),o(d.translateX,d.translateY,f.translateX,f.translateY,p,m),r(d.rotate,f.rotate,p,m),a(d.skewX,f.skewX,p,m),c(d.scaleX,d.scaleY,f.scaleX,f.scaleY,p,m),d=f=null,function(g){for(var y=-1,v=m.length,S;++y<v;)p[(S=m[y]).i]=S.x(g);return p.join("")}}}var wpe=L9(vpe,"px, ","px)","deg)"),Epe=L9(Spe,", ",")",")"),Cpe=1e-12;function f5(t){return((t=Math.exp(t))+1/t)/2}function Npe(t){return((t=Math.exp(t))-1/t)/2}function Tpe(t){return((t=Math.exp(2*t))-1)/(t+1)}const T1=(function t(e,n,s){function i(o,r){var a=o[0],c=o[1],d=o[2],f=r[0],p=r[1],m=r[2],g=f-a,y=p-c,v=g*g+y*y,S,w;if(v<Cpe)w=Math.log(m/d)/e,S=function(k){return[a+k*g,c+k*y,d*Math.exp(e*k*w)]};else{var N=Math.sqrt(v),C=(m*m-d*d+s*v)/(2*d*n*N),T=(m*m-d*d-s*v)/(2*m*n*N),R=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(T*T+1)-T);w=(A-R)/e,S=function(k){var M=k*w,L=f5(R),j=d/(n*N)*(L*Tpe(e*M+R)-Npe(R));return[a+j*g,c+j*y,d*L/f5(e*M+R)]}}return S.duration=w*1e3*e/Math.SQRT2,S}return i.rho=function(o){var r=Math.max(.001,+o),a=r*r,c=a*a;return t(r,a,c)},i})(Math.SQRT2,2,4);var bf=0,np=0,Vh=0,I9=1e3,ly,sp,ay=0,fu=0,Ob=0,Up=typeof performance=="object"&&performance.now?performance:Date,D9=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function J3(){return fu||(D9(Ope),fu=Up.now()+Ob)}function Ope(){fu=0}function cy(){this._call=this._time=this._next=null}cy.prototype=j9.prototype={constructor:cy,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?J3():+n)+(e==null?0:+e),!this._next&&sp!==this&&(sp?sp._next=this:ly=this,sp=this),this._call=t,this._time=n,uE()},stop:function(){this._call&&(this._call=null,this._time=1/0,uE())}};function j9(t,e,n){var s=new cy;return s.restart(t,e,n),s}function Rpe(){J3(),++bf;for(var t=ly,e;t;)(e=fu-t._time)>=0&&t._call.call(void 0,e),t=t._next;--bf}function h5(){fu=(ay=Up.now())+Ob,bf=np=0;try{Rpe()}finally{bf=0,Ape(),fu=0}}function kpe(){var t=Up.now(),e=t-ay;e>I9&&(Ob-=e,ay=t)}function Ape(){for(var t,e=ly,n,s=1/0;e;)e._call?(s>e._time&&(s=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ly=n);sp=t,uE(s)}function uE(t){if(!bf){np&&(np=clearTimeout(np));var e=t-fu;e>24?(t<1/0&&(np=setTimeout(h5,t-Up.now()-Ob)),Vh&&(Vh=clearInterval(Vh))):(Vh||(ay=Up.now(),Vh=setInterval(kpe,I9)),bf=1,D9(h5))}}function p5(t,e,n){var s=new cy;return e=e==null?0:+e,s.restart(i=>{s.stop(),t(i+e)},e,n),s}var _pe=Nb("start","end","cancel","interrupt"),Mpe=[],P9=0,m5=1,dE=2,O1=3,g5=4,fE=5,R1=6;function Rb(t,e,n,s,i,o){var r=t.__transition;if(!r)t.__transition={};else if(n in r)return;Lpe(t,n,{name:e,index:s,group:i,on:_pe,tween:Mpe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:P9})}function eN(t,e){var n=Do(t,e);if(n.state>P9)throw new Error("too late; already scheduled");return n}function gr(t,e){var n=Do(t,e);if(n.state>O1)throw new Error("too late; already running");return n}function Do(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Lpe(t,e,n){var s=t.__transition,i;s[e]=n,n.timer=j9(o,0,n.time);function o(d){n.state=m5,n.timer.restart(r,n.delay,n.time),n.delay<=d&&r(d-n.delay)}function r(d){var f,p,m,g;if(n.state!==m5)return c();for(f in s)if(g=s[f],g.name===n.name){if(g.state===O1)return p5(r);g.state===g5?(g.state=R1,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete s[f]):+f<e&&(g.state=R1,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete s[f])}if(p5(function(){n.state===O1&&(n.state=g5,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=dE,n.on.call("start",t,t.__data__,n.index,n.group),n.state===dE){for(n.state=O1,i=new Array(m=n.tween.length),f=0,p=-1;f<m;++f)(g=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=g);i.length=p+1}}function a(d){for(var f=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=fE,1),p=-1,m=i.length;++p<m;)i[p].call(t,f);n.state===fE&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=R1,n.timer.stop(),delete s[e];for(var d in s)return;delete t.__transition}}function k1(t,e){var n=t.__transition,s,i,o=!0,r;if(n){e=e==null?null:e+"";for(r in n){if((s=n[r]).name!==e){o=!1;continue}i=s.state>dE&&s.state<fE,s.state=R1,s.timer.stop(),s.on.call(i?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete n[r]}o&&delete t.__transition}}function Ipe(t){return this.each(function(){k1(this,t)})}function Dpe(t,e){var n,s;return function(){var i=gr(this,t),o=i.tween;if(o!==n){s=n=o;for(var r=0,a=s.length;r<a;++r)if(s[r].name===e){s=s.slice(),s.splice(r,1);break}}i.tween=s}}function jpe(t,e,n){var s,i;if(typeof n!="function")throw new Error;return function(){var o=gr(this,t),r=o.tween;if(r!==s){i=(s=r).slice();for(var a={name:e,value:n},c=0,d=i.length;c<d;++c)if(i[c].name===e){i[c]=a;break}c===d&&i.push(a)}o.tween=i}}function Ppe(t,e){var n=this._id;if(t+="",arguments.length<2){for(var s=Do(this.node(),n).tween,i=0,o=s.length,r;i<o;++i)if((r=s[i]).name===t)return r.value;return null}return this.each((e==null?Dpe:jpe)(n,t,e))}function tN(t,e,n){var s=t._id;return t.each(function(){var i=gr(this,s);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Do(i,s).value[e]}}function z9(t,e){var n;return(typeof e=="number"?ir:e instanceof du?ry:(n=du(e))?(e=n,ry):_9)(t,e)}function zpe(t){return function(){this.removeAttribute(t)}}function Bpe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $pe(t,e,n){var s,i=n+"",o;return function(){var r=this.getAttribute(t);return r===i?null:r===s?o:o=e(s=r,n)}}function Fpe(t,e,n){var s,i=n+"",o;return function(){var r=this.getAttributeNS(t.space,t.local);return r===i?null:r===s?o:o=e(s=r,n)}}function Hpe(t,e,n){var s,i,o;return function(){var r,a=n(this),c;return a==null?void this.removeAttribute(t):(r=this.getAttribute(t),c=a+"",r===c?null:r===s&&c===i?o:(i=c,o=e(s=r,a)))}}function Upe(t,e,n){var s,i,o;return function(){var r,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(r=this.getAttributeNS(t.space,t.local),c=a+"",r===c?null:r===s&&c===i?o:(i=c,o=e(s=r,a)))}}function Vpe(t,e){var n=Tb(t),s=n==="transform"?Epe:z9;return this.attrTween(t,typeof e=="function"?(n.local?Upe:Hpe)(n,s,tN(this,"attr."+t,e)):e==null?(n.local?Bpe:zpe)(n):(n.local?Fpe:$pe)(n,s,e))}function qpe(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Wpe(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Gpe(t,e){var n,s;function i(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&Wpe(t,o)),n}return i._value=e,i}function Kpe(t,e){var n,s;function i(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&qpe(t,o)),n}return i._value=e,i}function Ype(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var s=Tb(t);return this.tween(n,(s.local?Gpe:Kpe)(s,e))}function Xpe(t,e){return function(){eN(this,t).delay=+e.apply(this,arguments)}}function Qpe(t,e){return e=+e,function(){eN(this,t).delay=e}}function Zpe(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xpe:Qpe)(e,t)):Do(this.node(),e).delay}function Jpe(t,e){return function(){gr(this,t).duration=+e.apply(this,arguments)}}function eme(t,e){return e=+e,function(){gr(this,t).duration=e}}function tme(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Jpe:eme)(e,t)):Do(this.node(),e).duration}function nme(t,e){if(typeof e!="function")throw new Error;return function(){gr(this,t).ease=e}}function sme(t){var e=this._id;return arguments.length?this.each(nme(e,t)):Do(this.node(),e).ease}function ime(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;gr(this,t).ease=n}}function ome(t){if(typeof t!="function")throw new Error;return this.each(ime(this._id,t))}function rme(t){typeof t!="function"&&(t=m9(t));for(var e=this._groups,n=e.length,s=new Array(n),i=0;i<n;++i)for(var o=e[i],r=o.length,a=s[i]=[],c,d=0;d<r;++d)(c=o[d])&&t.call(c,c.__data__,d,o)&&a.push(c);return new fl(s,this._parents,this._name,this._id)}function lme(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,s=e.length,i=n.length,o=Math.min(s,i),r=new Array(s),a=0;a<o;++a)for(var c=e[a],d=n[a],f=c.length,p=r[a]=new Array(f),m,g=0;g<f;++g)(m=c[g]||d[g])&&(p[g]=m);for(;a<s;++a)r[a]=e[a];return new fl(r,this._parents,this._name,this._id)}function ame(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function cme(t,e,n){var s,i,o=ame(e)?eN:gr;return function(){var r=o(this,t),a=r.on;a!==s&&(i=(s=a).copy()).on(e,n),r.on=i}}function ume(t,e){var n=this._id;return arguments.length<2?Do(this.node(),n).on.on(t):this.each(cme(n,t,e))}function dme(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function fme(){return this.on("end.remove",dme(this._id))}function hme(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Y3(t));for(var s=this._groups,i=s.length,o=new Array(i),r=0;r<i;++r)for(var a=s[r],c=a.length,d=o[r]=new Array(c),f,p,m=0;m<c;++m)(f=a[m])&&(p=t.call(f,f.__data__,m,a))&&("__data__"in f&&(p.__data__=f.__data__),d[m]=p,Rb(d[m],e,n,m,d,Do(f,n)));return new fl(o,this._parents,e,n)}function pme(t){var e=this._name,n=this._id;typeof t!="function"&&(t=p9(t));for(var s=this._groups,i=s.length,o=[],r=[],a=0;a<i;++a)for(var c=s[a],d=c.length,f,p=0;p<d;++p)if(f=c[p]){for(var m=t.call(f,f.__data__,p,c),g,y=Do(f,n),v=0,S=m.length;v<S;++v)(g=m[v])&&Rb(g,e,n,v,m,y);o.push(m),r.push(f)}return new fl(o,r,e,n)}var mme=Um.prototype.constructor;function gme(){return new mme(this._groups,this._parents)}function yme(t,e){var n,s,i;return function(){var o=yf(this,t),r=(this.style.removeProperty(t),yf(this,t));return o===r?null:o===n&&r===s?i:i=e(n=o,s=r)}}function B9(t){return function(){this.style.removeProperty(t)}}function bme(t,e,n){var s,i=n+"",o;return function(){var r=yf(this,t);return r===i?null:r===s?o:o=e(s=r,n)}}function xme(t,e,n){var s,i,o;return function(){var r=yf(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),yf(this,t))),r===c?null:r===s&&c===i?o:(i=c,o=e(s=r,a))}}function vme(t,e){var n,s,i,o="style."+e,r="end."+o,a;return function(){var c=gr(this,t),d=c.on,f=c.value[o]==null?a||(a=B9(e)):void 0;(d!==n||i!==f)&&(s=(n=d).copy()).on(r,i=f),c.on=s}}function Sme(t,e,n){var s=(t+="")=="transform"?wpe:z9;return e==null?this.styleTween(t,yme(t,s)).on("end.style."+t,B9(t)):typeof e=="function"?this.styleTween(t,xme(t,s,tN(this,"style."+t,e))).each(vme(this._id,t)):this.styleTween(t,bme(t,s,e),n).on("end.style."+t,null)}function wme(t,e,n){return function(s){this.style.setProperty(t,e.call(this,s),n)}}function Eme(t,e,n){var s,i;function o(){var r=e.apply(this,arguments);return r!==i&&(s=(i=r)&&wme(t,r,n)),s}return o._value=e,o}function Cme(t,e,n){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(e==null)return this.tween(s,null);if(typeof e!="function")throw new Error;return this.tween(s,Eme(t,e,n??""))}function Nme(t){return function(){this.textContent=t}}function Tme(t){return function(){var e=t(this);this.textContent=e??""}}function Ome(t){return this.tween("text",typeof t=="function"?Tme(tN(this,"text",t)):Nme(t==null?"":t+""))}function Rme(t){return function(e){this.textContent=t.call(this,e)}}function kme(t){var e,n;function s(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Rme(i)),e}return s._value=t,s}function Ame(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,kme(t))}function _me(){for(var t=this._name,e=this._id,n=$9(),s=this._groups,i=s.length,o=0;o<i;++o)for(var r=s[o],a=r.length,c,d=0;d<a;++d)if(c=r[d]){var f=Do(c,e);Rb(c,t,n,d,r,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new fl(s,this._parents,t,n)}function Mme(){var t,e,n=this,s=n._id,i=n.size();return new Promise(function(o,r){var a={value:r},c={value:function(){--i===0&&o()}};n.each(function(){var d=gr(this,s),f=d.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),d.on=e}),i===0&&o()})}var Lme=0;function fl(t,e,n,s){this._groups=t,this._parents=e,this._name=n,this._id=s}function $9(){return++Lme}var zr=Um.prototype;fl.prototype={constructor:fl,select:hme,selectAll:pme,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:rme,merge:lme,selection:gme,transition:_me,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:ume,attr:Vpe,attrTween:Ype,style:Sme,styleTween:Cme,text:Ome,textTween:Ame,remove:fme,tween:Ppe,delay:Zpe,duration:tme,ease:sme,easeVarying:ome,end:Mme,[Symbol.iterator]:zr[Symbol.iterator]};function Ime(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Dme={time:null,delay:0,duration:250,ease:Ime};function jme(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Pme(t){var e,n;t instanceof fl?(e=t._id,t=t._name):(e=$9(),(n=Dme).time=J3(),t=t==null?null:t+"");for(var s=this._groups,i=s.length,o=0;o<i;++o)for(var r=s[o],a=r.length,c,d=0;d<a;++d)(c=r[d])&&Rb(c,t,e,d,r,n||jme(c,e));return new fl(s,this._parents,t,e)}Um.prototype.interrupt=Ipe;Um.prototype.transition=Pme;const X0=t=>()=>t;function zme(t,{sourceEvent:e,target:n,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function Yr(t,e,n){this.k=t,this.x=e,this.y=n}Yr.prototype={constructor:Yr,scale:function(t){return t===1?this:new Yr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Yr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kb=new Yr(1,0,0);F9.prototype=Yr.prototype;function F9(t){for(;!t.__zoom;)if(!(t=t.parentNode))return kb;return t.__zoom}function dS(t){t.stopImmediatePropagation()}function qh(t){t.preventDefault(),t.stopImmediatePropagation()}function Bme(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function $me(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function y5(){return this.__zoom||kb}function Fme(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Hme(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ume(t,e,n){var s=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],r=t.invertY(e[1][1])-n[1][1];return t.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r))}function H9(){var t=Bme,e=$me,n=Ume,s=Fme,i=Hme,o=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],a=250,c=T1,d=Nb("start","zoom","end"),f,p,m,g=500,y=150,v=0,S=10;function w(I){I.property("__zoom",y5).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(I,F,z,U){var H=I.selection?I.selection():I;H.property("__zoom",y5),I!==H?R(I,F,z,U):H.interrupt().each(function(){A(this,arguments).event(U).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},w.scaleBy=function(I,F,z,U){w.scaleTo(I,function(){var H=this.__zoom.k,V=typeof F=="function"?F.apply(this,arguments):F;return H*V},z,U)},w.scaleTo=function(I,F,z,U){w.transform(I,function(){var H=e.apply(this,arguments),V=this.__zoom,W=z==null?T(H):typeof z=="function"?z.apply(this,arguments):z,G=V.invert(W),Y=typeof F=="function"?F.apply(this,arguments):F;return n(C(N(V,Y),W,G),H,r)},z,U)},w.translateBy=function(I,F,z,U){w.transform(I,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof z=="function"?z.apply(this,arguments):z),e.apply(this,arguments),r)},null,U)},w.translateTo=function(I,F,z,U,H){w.transform(I,function(){var V=e.apply(this,arguments),W=this.__zoom,G=U==null?T(V):typeof U=="function"?U.apply(this,arguments):U;return n(kb.translate(G[0],G[1]).scale(W.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof z=="function"?-z.apply(this,arguments):-z),V,r)},U,H)};function N(I,F){return F=Math.max(o[0],Math.min(o[1],F)),F===I.k?I:new Yr(F,I.x,I.y)}function C(I,F,z){var U=F[0]-z[0]*I.k,H=F[1]-z[1]*I.k;return U===I.x&&H===I.y?I:new Yr(I.k,U,H)}function T(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function R(I,F,z,U){I.on("start.zoom",function(){A(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(U).end()}).tween("zoom",function(){var H=this,V=arguments,W=A(H,V).event(U),G=e.apply(H,V),Y=z==null?T(G):typeof z=="function"?z.apply(H,V):z,J=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),q=H.__zoom,X=typeof F=="function"?F.apply(H,V):F,Z=c(q.invert(Y).concat(J/q.k),X.invert(Y).concat(J/X.k));return function(te){if(te===1)te=X;else{var Q=Z(te),se=J/Q[2];te=new Yr(se,Y[0]-Q[0]*se,Y[1]-Q[1]*se)}W.zoom(null,te)}})}function A(I,F,z){return!z&&I.__zooming||new k(I,F)}function k(I,F){this.that=I,this.args=F,this.active=0,this.sourceEvent=null,this.extent=e.apply(I,F),this.taps=0}k.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,F){return this.mouse&&I!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var F=Bi(this.that).datum();d.call(I,this.that,new zme(I,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),F)}};function M(I,...F){if(!t.apply(this,arguments))return;var z=A(this,F).event(I),U=this.__zoom,H=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,s.apply(this,arguments)))),V=Co(I);if(z.wheel)(z.mouse[0][0]!==V[0]||z.mouse[0][1]!==V[1])&&(z.mouse[1]=U.invert(z.mouse[0]=V)),clearTimeout(z.wheel);else{if(U.k===H)return;z.mouse=[V,U.invert(V)],k1(this),z.start()}qh(I),z.wheel=setTimeout(W,y),z.zoom("mouse",n(C(N(U,H),z.mouse[0],z.mouse[1]),z.extent,r));function W(){z.wheel=null,z.end()}}function L(I,...F){if(m||!t.apply(this,arguments))return;var z=I.currentTarget,U=A(this,F,!0).event(I),H=Bi(I.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",J,!0),V=Co(I,z),W=I.clientX,G=I.clientY;N9(I.view),dS(I),U.mouse=[V,this.__zoom.invert(V)],k1(this),U.start();function Y(q){if(qh(q),!U.moved){var X=q.clientX-W,Z=q.clientY-G;U.moved=X*X+Z*Z>v}U.event(q).zoom("mouse",n(C(U.that.__zoom,U.mouse[0]=Co(q,z),U.mouse[1]),U.extent,r))}function J(q){H.on("mousemove.zoom mouseup.zoom",null),T9(q.view,U.moved),qh(q),U.event(q).end()}}function j(I,...F){if(t.apply(this,arguments)){var z=this.__zoom,U=Co(I.changedTouches?I.changedTouches[0]:I,this),H=z.invert(U),V=z.k*(I.shiftKey?.5:2),W=n(C(N(z,V),U,H),e.apply(this,F),r);qh(I),a>0?Bi(this).transition().duration(a).call(R,W,U,I):Bi(this).call(w.transform,W,U,I)}}function D(I,...F){if(t.apply(this,arguments)){var z=I.touches,U=z.length,H=A(this,F,I.changedTouches.length===U).event(I),V,W,G,Y;for(dS(I),W=0;W<U;++W)G=z[W],Y=Co(G,this),Y=[Y,this.__zoom.invert(Y),G.identifier],H.touch0?!H.touch1&&H.touch0[2]!==Y[2]&&(H.touch1=Y,H.taps=0):(H.touch0=Y,V=!0,H.taps=1+!!f);f&&(f=clearTimeout(f)),V&&(H.taps<2&&(p=Y[0],f=setTimeout(function(){f=null},g)),k1(this),H.start())}}function P(I,...F){if(this.__zooming){var z=A(this,F).event(I),U=I.changedTouches,H=U.length,V,W,G,Y;for(qh(I),V=0;V<H;++V)W=U[V],G=Co(W,this),z.touch0&&z.touch0[2]===W.identifier?z.touch0[0]=G:z.touch1&&z.touch1[2]===W.identifier&&(z.touch1[0]=G);if(W=z.that.__zoom,z.touch1){var J=z.touch0[0],q=z.touch0[1],X=z.touch1[0],Z=z.touch1[1],te=(te=X[0]-J[0])*te+(te=X[1]-J[1])*te,Q=(Q=Z[0]-q[0])*Q+(Q=Z[1]-q[1])*Q;W=N(W,Math.sqrt(te/Q)),G=[(J[0]+X[0])/2,(J[1]+X[1])/2],Y=[(q[0]+Z[0])/2,(q[1]+Z[1])/2]}else if(z.touch0)G=z.touch0[0],Y=z.touch0[1];else return;z.zoom("touch",n(C(W,G,Y),z.extent,r))}}function B(I,...F){if(this.__zooming){var z=A(this,F).event(I),U=I.changedTouches,H=U.length,V,W;for(dS(I),m&&clearTimeout(m),m=setTimeout(function(){m=null},g),V=0;V<H;++V)W=U[V],z.touch0&&z.touch0[2]===W.identifier?delete z.touch0:z.touch1&&z.touch1[2]===W.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(W=Co(W,this),Math.hypot(p[0]-W[0],p[1]-W[1])<S)){var G=Bi(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return w.wheelDelta=function(I){return arguments.length?(s=typeof I=="function"?I:X0(+I),w):s},w.filter=function(I){return arguments.length?(t=typeof I=="function"?I:X0(!!I),w):t},w.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:X0(!!I),w):i},w.extent=function(I){return arguments.length?(e=typeof I=="function"?I:X0([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),w):e},w.scaleExtent=function(I){return arguments.length?(o[0]=+I[0],o[1]=+I[1],w):[o[0],o[1]]},w.translateExtent=function(I){return arguments.length?(r[0][0]=+I[0][0],r[1][0]=+I[1][0],r[0][1]=+I[0][1],r[1][1]=+I[1][1],w):[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},w.constrain=function(I){return arguments.length?(n=I,w):n},w.duration=function(I){return arguments.length?(a=+I,w):a},w.interpolate=function(I){return arguments.length?(c=I,w):c},w.on=function(){var I=d.on.apply(d,arguments);return I===d?w:I},w.clickDistance=function(I){return arguments.length?(v=(I=+I)*I,w):Math.sqrt(v)},w.tapDistance=function(I){return arguments.length?(S=+I,w):S},w}const Lo={error001:(t="react")=>`Seems like you have not used ${t==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:s}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Vp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],U9=["Enter"," ","Escape"],V9={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var xf;(function(t){t.Strict="strict",t.Loose="loose"})(xf||(xf={}));var tu;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(tu||(tu={}));var qp;(function(t){t.Partial="partial",t.Full="full"})(qp||(qp={}));const q9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ha;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ha||(ha={}));var uy;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(uy||(uy={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const b5={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top},W9=t=>!!t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t,Vme=t=>!!t&&typeof t=="object"&&"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),nN=t=>!!t&&typeof t=="object"&&"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),qm=(t,e=[0,0])=>{const{width:n,height:s}=jo(t),i=t.origin??e,o=n*i[0],r=s*i[1];return{x:t.position.x-o,y:t.position.y-r}},qme=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const s=t.reduce((i,o)=>{const r=typeof o=="string";let a=!e.nodeLookup&&!r?o:void 0;return e.nodeLookup&&(a=r?e.nodeLookup.get(o):nN(o)?o:e.nodeLookup.get(o.id)),a?(n=!0,Ab(i,dy(a,e.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?_b(s):{x:0,y:0,width:0,height:0}},Wm=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=Ab(n,dy(i)),s=!0)}),s?_b(n):{x:0,y:0,width:0,height:0}},sN=(t,e,[n,s,i]=[0,0,1],o=!1,r=!1)=>{const a=(e.x-n)/i,c=(e.y-s)/i,d=e.width/i,f=e.height/i,p=[];for(const m of t.values()){const{measured:g,selectable:y=!0,hidden:v=!1}=m;if(r&&!y||v)continue;const S=g.width??m.width??m.initialWidth??0,w=g.height??m.height??m.initialHeight??0,{x:N,y:C}=m.internals.positionAbsolute,T=X9(a,c,d,f,N,C,S,w),R=S*w,A=o&&T>0;(!m.internals.handleBounds||A||T>=R||m.dragging)&&p.push(m)}return p},Wme=(t,e)=>{const n=new Set;return t.forEach(s=>{n.add(s.id)}),e.filter(s=>n.has(s.source)||n.has(s.target))};function Gme(t,e){const n=new Map,s=e!=null&&e.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{let o;if(e!=null&&e.includeHiddenNodes){const{width:r,height:a}=jo(i);o=r>0&&a>0}else o=!!(i.measured.width&&i.measured.height&&!i.hidden);o&&(!s||s.has(i.id))&&n.set(i.id,i)}),n}async function Kme({nodes:t,width:e,height:n,panZoom:s,minZoom:i,maxZoom:o},r){if(t.size===0)return!0;const a=Gme(t,r),c=Wm(a),d=oN(c,e,n,(r==null?void 0:r.minZoom)??i,(r==null?void 0:r.maxZoom)??o,(r==null?void 0:r.padding)??.1);return await s.setViewport(d,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),!0}function G9({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:i,onError:o}){const r=n.get(t),a=r.parentId?n.get(r.parentId):void 0,{x:c,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},f=r.origin??s;let p=r.extent||i;if(r.extent==="parent"&&!r.expandParent)if(!a)o==null||o("005",Lo.error005());else{const{width:g,height:y}=jo(a);g&&y&&(p=[[c,d],[c+g,d+y]])}else a&&pu(r.extent)&&(p=[[r.extent[0][0]+c,r.extent[0][1]+d],[r.extent[1][0]+c,r.extent[1][1]+d]]);const m=pu(p)?hu(e,p,r.measured):e;return(r.measured.width===void 0||r.measured.height===void 0)&&(o==null||o("015",Lo.error015())),{position:{x:m.x-c+(r.measured.width??0)*f[0],y:m.y-d+(r.measured.height??0)*f[1]},positionAbsolute:m}}async function Yme({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:s,onBeforeDelete:i}){const o=new Set(t.map(m=>m.id)),r=[];for(const m of n){if(m.deletable===!1)continue;const g=o.has(m.id),y=!g&&m.parentId&&r.find(v=>v.id===m.parentId);(g||y)&&r.push(m)}const a=new Set(e.map(m=>m.id)),c=s.filter(m=>m.deletable!==!1),f=Wme(r,c);for(const m of c)a.has(m.id)&&!f.find(y=>y.id===m.id)&&f.push(m);if(!i)return{edges:f,nodes:r};const p=await i({nodes:r,edges:f});return typeof p=="boolean"?p?{edges:f,nodes:r}:{edges:[],nodes:[]}:p}const vf=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),hu=(t={x:0,y:0},e,n)=>({x:vf(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:vf(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function K9(t,e,n){const{width:s,height:i}=jo(n),{x:o,y:r}=n.internals.positionAbsolute;return hu(t,[[o,r],[o+s,r+i]],e)}const x5=(t,e,n)=>t<e?vf(Math.abs(t-e),1,e)/e:t>n?-vf(Math.abs(t-n),1,e)/e:0,iN=(t,e,n=15,s=40)=>{const i=x5(t.x,s,e.width-s)*n,o=x5(t.y,s,e.height-s)*n;return[i,o]},Ab=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),hE=({x:t,y:e,width:n,height:s})=>({x:t,y:e,x2:t+n,y2:e+s}),_b=({x:t,y:e,x2:n,y2:s})=>({x:t,y:e,width:n-t,height:s-e}),Wp=(t,e=[0,0])=>{var i,o;const{x:n,y:s}=nN(t)?t.internals.positionAbsolute:qm(t,e);return{x:n,y:s,width:((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0,height:((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight??0}},dy=(t,e=[0,0])=>{var i,o;const{x:n,y:s}=nN(t)?t.internals.positionAbsolute:qm(t,e);return{x:n,y:s,x2:n+(((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0),y2:s+(((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight??0)}},Y9=(t,e)=>_b(Ab(hE(t),hE(e))),X9=(t,e,n,s,i,o,r,a)=>{const c=Math.max(0,Math.min(t+n,i+r)-Math.max(t,i)),d=Math.max(0,Math.min(e+s,o+a)-Math.max(e,o));return Math.ceil(c*d)},fy=(t,e)=>X9(t.x,t.y,t.width,t.height,e.x,e.y,e.width,e.height),v5=t=>Ro(t.width)&&Ro(t.height)&&Ro(t.x)&&Ro(t.y),Ro=t=>!isNaN(t)&&isFinite(t),Q9=(t,e)=>(n,s)=>{},Gm=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),Km=({x:t,y:e},[n,s,i],o=!1,r=[1,1])=>{const a={x:(t-n)/i,y:(e-s)/i};return o?Gm(a,r):a},Sf=({x:t,y:e},[n,s,i])=>({x:t*i+n,y:e*i+s});function Sd(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Xme(t,e,n){if(typeof t=="string"||typeof t=="number"){const s=Sd(t,n),i=Sd(t,e);return{top:s,right:i,bottom:s,left:i,x:i*2,y:s*2}}if(typeof t=="object"){const s=Sd(t.top??t.y??0,n),i=Sd(t.bottom??t.y??0,n),o=Sd(t.left??t.x??0,e),r=Sd(t.right??t.x??0,e);return{top:s,right:r,bottom:i,left:o,x:o+r,y:s+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Qme(t,e,n,s,i,o){const{x:r,y:a}=Sf(t,[e,n,s]),{x:c,y:d}=Sf({x:t.x+t.width,y:t.y+t.height},[e,n,s]),f=i-c,p=o-d;return{left:Math.floor(r),top:Math.floor(a),right:Math.floor(f),bottom:Math.floor(p)}}const oN=(t,e,n,s,i,o)=>{const r=Xme(o,e,n),a=(e-r.x)/t.width,c=(n-r.y)/t.height,d=Math.min(a,c),f=vf(d,s,i),p=t.x+t.width/2,m=t.y+t.height/2,g=e/2-p*f,y=n/2-m*f,v=Qme(t,g,y,f,e,n),S={left:Math.min(v.left-r.left,0),top:Math.min(v.top-r.top,0),right:Math.min(v.right-r.right,0),bottom:Math.min(v.bottom-r.bottom,0)};return{x:g-S.left+S.right,y:y-S.top+S.bottom,zoom:f}},Gp=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function pu(t){return t!=null&&t!=="parent"}function jo(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function Z9(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function J9(t,e={width:0,height:0},n,s,i){const o={...t},r=s.get(n);if(r){const a=r.origin||i;o.x+=r.internals.positionAbsolute.x-(e.width??0)*a[0],o.y+=r.internals.positionAbsolute.y-(e.height??0)*a[1]}return o}function S5(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Zme(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}function Jme(t){return{...V9,...t||{}}}function ez(t){return t===null?null:t?"valid":"invalid"}function bp(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:s,containerBounds:i}){const{x:o,y:r}=ko(t),a=Km({x:o-((i==null?void 0:i.left)??0),y:r-((i==null?void 0:i.top)??0)},s),{x:c,y:d}=n?Gm(a,e):a;return{xSnapped:c,ySnapped:d,...a}}const rN=t=>({width:t.offsetWidth,height:t.offsetHeight}),tz=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},ege=["INPUT","SELECT","TEXTAREA"];function nz(t){var s,i;const e=((i=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:i[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:ege.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const sz=t=>"clientX"in t,ko=(t,e)=>{var o,r;const n=sz(t),s=n?t.clientX:(o=t.touches)==null?void 0:o[0].clientX,i=n?t.clientY:(r=t.touches)==null?void 0:r[0].clientY;return{x:s-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}},w5=(t,e,n,s,i)=>{const o=e.querySelectorAll(`.${t}`);return!o||!o.length?null:Array.from(o).map(r=>{const a=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:t,nodeId:i,position:r.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...rN(r)}})};function iz({sourceX:t,sourceY:e,targetX:n,targetY:s,sourceControlX:i,sourceControlY:o,targetControlX:r,targetControlY:a}){const c=t*.125+i*.375+r*.375+n*.125,d=e*.125+o*.375+a*.375+s*.125,f=Math.abs(c-t),p=Math.abs(d-e);return[c,d,f,p]}function Q0(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function E5({pos:t,x1:e,y1:n,x2:s,y2:i,c:o}){switch(t){case Ze.Left:return[e-Q0(e-s,o),n];case Ze.Right:return[e+Q0(s-e,o),n];case Ze.Top:return[e,n-Q0(n-i,o)];case Ze.Bottom:return[e,n+Q0(i-n,o)]}}function oz({sourceX:t,sourceY:e,sourcePosition:n=Ze.Bottom,targetX:s,targetY:i,targetPosition:o=Ze.Top,curvature:r=.25}){const[a,c]=E5({pos:n,x1:t,y1:e,x2:s,y2:i,c:r}),[d,f]=E5({pos:o,x1:s,y1:i,x2:t,y2:e,c:r}),[p,m,g,y]=iz({sourceX:t,sourceY:e,targetX:s,targetY:i,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${t},${e} C${a},${c} ${d},${f} ${s},${i}`,p,m,g,y]}function rz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const i=Math.abs(n-t)/2,o=n<t?n+i:n-i,r=Math.abs(s-e)/2,a=s<e?s+r:s-r;return[o,a,i,r]}function tge({sourceNode:t,targetNode:e,selected:n=!1,zIndex:s=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if(o==="manual")return s;const r=i&&n?s+1e3:s,a=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return r+a}function nge({sourceNode:t,targetNode:e,width:n,height:s,transform:i}){const o=Ab(dy(t),dy(e));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const r={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:s/i[2]};return fy(r,_b(o))>0}const sge=({source:t,sourceHandle:e,target:n,targetHandle:s})=>`xy-edge__${t}${e||""}-${n}${s||""}`,ige=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),oge=(t,e,n={})=>{var o;if(!t.source||!t.target)return(o=n.onError)==null||o.call(n,"006",Lo.error006()),e;const s=n.getEdgeId||sge;let i;return W9(t)?i={...t}:i={...t,id:s(t)},ige(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))};function lz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const[i,o,r,a]=rz({sourceX:t,sourceY:e,targetX:n,targetY:s});return[`M ${t},${e}L ${n},${s}`,i,o,r,a]}const C5={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},rge=({source:t,sourcePosition:e=Ze.Bottom,target:n})=>e===Ze.Left||e===Ze.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},N5=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function lge({source:t,sourcePosition:e=Ze.Bottom,target:n,targetPosition:s=Ze.Top,center:i,offset:o,stepPosition:r}){const a=C5[e],c=C5[s],d={x:t.x+a.x*o,y:t.y+a.y*o},f={x:n.x+c.x*o,y:n.y+c.y*o},p=rge({source:d,sourcePosition:e,target:f}),m=p.x!==0?"x":"y",g=p[m];let y=[],v,S;const w={x:0,y:0},N={x:0,y:0},[,,C,T]=rz({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*c[m]===-1){m==="x"?(v=i.x??d.x+(f.x-d.x)*r,S=i.y??(d.y+f.y)/2):(v=i.x??(d.x+f.x)/2,S=i.y??d.y+(f.y-d.y)*r);const M=[{x:v,y:d.y},{x:v,y:f.y}],L=[{x:d.x,y:S},{x:f.x,y:S}];a[m]===g?y=m==="x"?M:L:y=m==="x"?L:M}else{const M=[{x:d.x,y:f.y}],L=[{x:f.x,y:d.y}];if(m==="x"?y=a.x===g?L:M:y=a.y===g?M:L,e===s){const I=Math.abs(t[m]-n[m]);if(I<=o){const F=Math.min(o-1,o-I);a[m]===g?w[m]=(d[m]>t[m]?-1:1)*F:N[m]=(f[m]>n[m]?-1:1)*F}}if(e!==s){const I=m==="x"?"y":"x",F=a[m]===c[I],z=d[I]>f[I],U=d[I]<f[I];(a[m]===1&&(!F&&z||F&&U)||a[m]!==1&&(!F&&U||F&&z))&&(y=m==="x"?M:L)}const j={x:d.x+w.x,y:d.y+w.y},D={x:f.x+N.x,y:f.y+N.y},P=Math.max(Math.abs(j.x-y[0].x),Math.abs(D.x-y[0].x)),B=Math.max(Math.abs(j.y-y[0].y),Math.abs(D.y-y[0].y));P>=B?(v=(j.x+D.x)/2,S=y[0].y):(v=y[0].x,S=(j.y+D.y)/2)}const R={x:d.x+w.x,y:d.y+w.y},A={x:f.x+N.x,y:f.y+N.y};return[[t,...R.x!==y[0].x||R.y!==y[0].y?[R]:[],...y,...A.x!==y[y.length-1].x||A.y!==y[y.length-1].y?[A]:[],n],v,S,C,T]}function age(t,e,n,s){const i=Math.min(N5(t,e)/2,N5(e,n)/2,s),{x:o,y:r}=e;if(t.x===o&&o===n.x||t.y===r&&r===n.y)return`L${o} ${r}`;if(t.y===r){const d=t.x<n.x?-1:1,f=t.y<n.y?1:-1;return`L ${o+i*d},${r}Q ${o},${r} ${o},${r+i*f}`}const a=t.x<n.x?1:-1,c=t.y<n.y?-1:1;return`L ${o},${r+i*c}Q ${o},${r} ${o+i*a},${r}`}function pE({sourceX:t,sourceY:e,sourcePosition:n=Ze.Bottom,targetX:s,targetY:i,targetPosition:o=Ze.Top,borderRadius:r=5,centerX:a,centerY:c,offset:d=20,stepPosition:f=.5}){const[p,m,g,y,v]=lge({source:{x:t,y:e},sourcePosition:n,target:{x:s,y:i},targetPosition:o,center:{x:a,y:c},offset:d,stepPosition:f});let S=`M${p[0].x} ${p[0].y}`;for(let w=1;w<p.length-1;w++)S+=age(p[w-1],p[w],p[w+1],r);return S+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[S,m,g,y,v]}function T5(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function cge(t){var p;const{sourceNode:e,targetNode:n}=t;if(!T5(e)||!T5(n))return null;const s=e.internals.handleBounds||O5(e.handles),i=n.internals.handleBounds||O5(n.handles),o=R5((s==null?void 0:s.source)??[],t.sourceHandle),r=R5(t.connectionMode===xf.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),t.targetHandle);if(!o||!r)return(p=t.onError)==null||p.call(t,"008",Lo.error008(o?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const a=(o==null?void 0:o.position)||Ze.Bottom,c=(r==null?void 0:r.position)||Ze.Top,d=mu(e,o,a),f=mu(n,r,c);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:a,targetPosition:c}}function O5(t){if(!t)return null;const e=[],n=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?e.push(s):s.type==="target"&&n.push(s);return{source:e,target:n}}function mu(t,e,n=Ze.Left,s=!1){const i=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,o=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:r,height:a}=e??jo(t);if(s)return{x:i+r/2,y:o+a/2};switch((e==null?void 0:e.position)??n){case Ze.Top:return{x:i+r/2,y:o};case Ze.Right:return{x:i+r,y:o+a/2};case Ze.Bottom:return{x:i+r/2,y:o+a};case Ze.Left:return{x:i,y:o+a/2}}}function R5(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function mE(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function uge(t,{id:e,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:i}){const o=new Set;return t.reduce((r,a)=>([a.markerStart||s,a.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const d=mE(c,e);o.has(d)||(r.push({id:d,color:c.color||n,...c}),o.add(d))}}),r),[]).sort((r,a)=>r.id.localeCompare(a.id))}const az=1e3,dge=10,lN={nodeOrigin:[0,0],nodeExtent:Vp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},fge={...lN,checkEquality:!0};function aN(t,e){const n={...t};for(const s in e)e[s]!==void 0&&(n[s]=e[s]);return n}function hge(t,e,n){const s=aN(lN,n);for(const i of t.values())if(i.parentId)uN(i,t,e,s);else{const o=qm(i,s.nodeOrigin),r=pu(i.extent)?i.extent:s.nodeExtent,a=hu(o,r,jo(i));i.internals.positionAbsolute=a}}function pge(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],s=[];for(const i of t.handles){const o={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(o):i.type==="target"&&s.push(o)}return{source:n,target:s}}function cN(t){return t==="manual"}function gE(t,e,n,s={}){var f,p;const i=aN(fge,s),o={i:0},r=new Map(e),a=i!=null&&i.elevateNodesOnSelect&&!cN(i.zIndexMode)?az:0;let c=t.length>0,d=!1;e.clear(),n.clear();for(const m of t){let g=r.get(m.id);if(i.checkEquality&&m===(g==null?void 0:g.internals.userNode))e.set(m.id,g);else{const y=qm(m,i.nodeOrigin),v=pu(m.extent)?m.extent:i.nodeExtent,S=hu(y,v,jo(m));g={...i.defaults,...m,measured:{width:(f=m.measured)==null?void 0:f.width,height:(p=m.measured)==null?void 0:p.height},internals:{positionAbsolute:S,handleBounds:pge(m,g),z:cz(m,a,i.zIndexMode),userNode:m}},e.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),m.parentId&&uN(g,e,n,s,o),d||(d=m.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:d}}function mge(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function uN(t,e,n,s,i){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:a,zIndexMode:c}=aN(lN,s),d=t.parentId,f=e.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mge(t,n),i&&!f.parentId&&f.internals.rootParentIndex===void 0&&c==="auto"&&(f.internals.rootParentIndex=++i.i,f.internals.z=f.internals.z+i.i*dge),i&&f.internals.rootParentIndex!==void 0&&(i.i=f.internals.rootParentIndex);const p=o&&!cN(c)?az:0,{x:m,y:g,z:y}=gge(t,f,r,a,p,c),{positionAbsolute:v}=t.internals,S=m!==v.x||g!==v.y;(S||y!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:S?{x:m,y:g}:v,z:y}})}function cz(t,e,n){const s=Ro(t.zIndex)?t.zIndex:0;return cN(n)?s:s+(t.selected?e:0)}function gge(t,e,n,s,i,o){const{x:r,y:a}=e.internals.positionAbsolute,c=jo(t),d=qm(t,n),f=pu(t.extent)?hu(d,t.extent,c):d;let p=hu({x:r+f.x,y:a+f.y},s,c);t.extent==="parent"&&(p=K9(p,c,e));const m=cz(t,i,o),g=e.internals.z??0;return{x:p.x,y:p.y,z:g>=m?g+1:m}}function dN(t,e,n,s=[0,0]){var r;const i=[],o=new Map;for(const a of t){const c=e.get(a.parentId);if(!c)continue;const d=((r=o.get(a.parentId))==null?void 0:r.expandedRect)??Wp(c),f=Y9(d,a.rect);o.set(a.parentId,{expandedRect:f,parent:c})}return o.size>0&&o.forEach(({expandedRect:a,parent:c},d)=>{var C;const f=c.internals.positionAbsolute,p=jo(c),m=c.origin??s,g=a.x<f.x?Math.round(Math.abs(f.x-a.x)):0,y=a.y<f.y?Math.round(Math.abs(f.y-a.y)):0,v=Math.max(p.width,Math.round(a.width)),S=Math.max(p.height,Math.round(a.height)),w=(v-p.width)*m[0],N=(S-p.height)*m[1];(g>0||y>0||w||N)&&(i.push({id:d,type:"position",position:{x:c.position.x-g+w,y:c.position.y-y+N}}),(C=n.get(d))==null||C.forEach(T=>{t.some(R=>R.id===T.id)||i.push({id:T.id,type:"position",position:{x:T.position.x+g,y:T.position.y+y}})})),(p.width<a.width||p.height<a.height||g||y)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?m[0]*g-w:0),height:S+(y?m[1]*y-N:0)}})}),i}function yge(t,e,n,s,i,o,r){const a=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const d=[],f=window.getComputedStyle(a),{m22:p}=new window.DOMMatrixReadOnly(f.transform),m=[];for(const g of t.values()){const y=e.get(g.id);if(!y)continue;if(y.hidden){e.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),c=!0;continue}const v=rN(g.nodeElement),S=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(S||!y.internals.handleBounds||g.force))){const N=g.nodeElement.getBoundingClientRect(),C=pu(y.extent)?y.extent:o;let{positionAbsolute:T}=y.internals;if(y.parentId&&y.extent==="parent"){const A=e.get(y.parentId);A&&(T=K9(T,v,A))}else C&&(T=hu(T,C,v));const R={...y,measured:v,internals:{...y.internals,positionAbsolute:T,handleBounds:{source:w5("source",g.nodeElement,N,p,y.id),target:w5("target",g.nodeElement,N,p,y.id)}}};e.set(y.id,R),y.parentId&&uN(R,e,n,{nodeOrigin:i,zIndexMode:r}),c=!0,S&&(d.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&m.push({id:y.id,parentId:y.parentId,rect:Wp(R,i)}))}}if(m.length>0){const g=dN(m,e,n,i);d.push(...g)}return{changes:d,updatedInternals:c}}async function bge({delta:t,panZoom:e,transform:n,translateExtent:s,width:i,height:o}){if(!e||!t.x&&!t.y)return!1;const r=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,o]],s);return!!r&&(r.x!==n[0]||r.y!==n[1]||r.k!==n[2])}function k5(t,e,n,s,i,o){let r=i;const a=s.get(r)||new Map;s.set(r,a.set(n,e)),r=`${i}-${t}`;const c=s.get(r)||new Map;if(s.set(r,c.set(n,e)),o){r=`${i}-${t}-${o}`;const d=s.get(r)||new Map;s.set(r,d.set(n,e))}}function uz(t,e,n){t.clear(),e.clear();for(const s of n){const{source:i,target:o,sourceHandle:r=null,targetHandle:a=null}=s,c={edgeId:s.id,source:i,target:o,sourceHandle:r,targetHandle:a},d=`${i}-${r}--${o}-${a}`,f=`${o}-${a}--${i}-${r}`;k5("source",c,f,t,i,r),k5("target",c,d,t,o,a),e.set(s.id,s)}}function dz(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:dz(n,e):!1}function A5(t,e,n){var i;let s=t;do{if((i=s==null?void 0:s.matches)!=null&&i.call(s,e))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function xge(t,e,n,s){const i=new Map;for(const[o,r]of t)if((r.selected||r.id===s)&&(!r.parentId||!dz(r,t))&&(r.draggable||e&&typeof r.draggable>"u")){const a=t.get(o);a&&i.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function fS({nodeId:t,dragItems:e,nodeLookup:n,dragging:s=!0}){var r,a,c;const i=[];for(const[d,f]of e){const p=(r=n.get(d))==null?void 0:r.internals.userNode;p&&i.push({...p,position:f.position,dragging:s})}if(!t)return[i[0],i];const o=(a=n.get(t))==null?void 0:a.internals.userNode;return[o?{...o,position:((c=e.get(t))==null?void 0:c.position)||o.position,dragging:s}:i[0],i]}function vge({dragItems:t,snapGrid:e,x:n,y:s}){const i=t.values().next().value;if(!i)return null;const o={x:n-i.distance.x,y:s-i.distance.y},r=Gm(o,e);return{x:r.x-o.x,y:r.y-o.y}}function Sge({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:s,onDragStop:i}){let o={x:null,y:null},r=0,a=new Map,c=!1,d={x:0,y:0},f=null,p=!1,m=null,g=!1,y=!1,v=null;function S({noDragClassName:N,handleSelector:C,domNode:T,isSelectable:R,nodeId:A,nodeClickDistance:k=0}){m=Bi(T);function M({x:P,y:B}){const{nodeLookup:I,nodeExtent:F,snapGrid:z,snapToGrid:U,nodeOrigin:H,onNodeDrag:V,onSelectionDrag:W,onError:G,updateNodePositions:Y}=e();o={x:P,y:B};let J=!1;const q=a.size>1,X=q&&F?hE(Wm(a)):null,Z=q&&U?vge({dragItems:a,snapGrid:z,x:P,y:B}):null;for(const[te,Q]of a){if(!I.has(te))continue;let se={x:P-Q.distance.x,y:B-Q.distance.y};U&&(se=Z?{x:Math.round(se.x+Z.x),y:Math.round(se.y+Z.y)}:Gm(se,z));let ae=null;if(q&&F&&!Q.extent&&X){const{positionAbsolute:fe}=Q.internals,ve=fe.x-X.x+F[0][0],we=fe.x+Q.measured.width-X.x2+F[1][0],Ce=fe.y-X.y+F[0][1],ye=fe.y+Q.measured.height-X.y2+F[1][1];ae=[[ve,Ce],[we,ye]]}const{position:le,positionAbsolute:ne}=G9({nodeId:te,nextPosition:se,nodeLookup:I,nodeExtent:ae||F,nodeOrigin:H,onError:G});J=J||Q.position.x!==le.x||Q.position.y!==le.y,Q.position=le,Q.internals.positionAbsolute=ne}if(y=y||J,!!J&&(Y(a,!0),v&&(s||V||!A&&W))){const[te,Q]=fS({nodeId:A,dragItems:a,nodeLookup:I});s==null||s(v,a,te,Q),V==null||V(v,te,Q),A||W==null||W(v,Q)}}async function L(){if(!f)return;const{transform:P,panBy:B,autoPanSpeed:I,autoPanOnNodeDrag:F}=e();if(!F){c=!1,cancelAnimationFrame(r);return}const[z,U]=iN(d,f,I);(z!==0||U!==0)&&(o.x=(o.x??0)-z/P[2],o.y=(o.y??0)-U/P[2],await B({x:z,y:U})&&M(o)),r=requestAnimationFrame(L)}function j(P){var q;const{nodeLookup:B,multiSelectionActive:I,nodesDraggable:F,transform:z,snapGrid:U,snapToGrid:H,selectNodesOnDrag:V,onNodeDragStart:W,onSelectionDragStart:G,unselectNodesAndEdges:Y}=e();p=!0,(!V||!R)&&!I&&A&&((q=B.get(A))!=null&&q.selected||Y()),R&&V&&A&&(t==null||t(A));const J=bp(P.sourceEvent,{transform:z,snapGrid:U,snapToGrid:H,containerBounds:f});if(o=J,a=xge(B,F,J,A),a.size>0&&(n||W||!A&&G)){const[X,Z]=fS({nodeId:A,dragItems:a,nodeLookup:B});n==null||n(P.sourceEvent,a,X,Z),W==null||W(P.sourceEvent,X,Z),A||G==null||G(P.sourceEvent,Z)}}const D=O9().clickDistance(k).on("start",P=>{const{domNode:B,nodeDragThreshold:I,transform:F,snapGrid:z,snapToGrid:U}=e();f=(B==null?void 0:B.getBoundingClientRect())||null,g=!1,y=!1,v=P.sourceEvent,I===0&&j(P),o=bp(P.sourceEvent,{transform:F,snapGrid:z,snapToGrid:U,containerBounds:f}),d=ko(P.sourceEvent,f)}).on("drag",P=>{const{autoPanOnNodeDrag:B,transform:I,snapGrid:F,snapToGrid:z,nodeDragThreshold:U,nodeLookup:H}=e(),V=bp(P.sourceEvent,{transform:I,snapGrid:F,snapToGrid:z,containerBounds:f});if(v=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||A&&!H.has(A))&&(g=!0),!g){if(!c&&B&&p&&(c=!0,L()),!p){const W=ko(P.sourceEvent,f),G=W.x-d.x,Y=W.y-d.y;Math.sqrt(G*G+Y*Y)>U&&j(P)}(o.x!==V.xSnapped||o.y!==V.ySnapped)&&a&&p&&(d=ko(P.sourceEvent,f),M(V))}}).on("end",P=>{if(!p||g){g&&a.size>0&&e().updateNodePositions(a,!1);return}if(c=!1,p=!1,cancelAnimationFrame(r),a.size>0){const{nodeLookup:B,updateNodePositions:I,onNodeDragStop:F,onSelectionDragStop:z}=e();if(y&&(I(a,!1),y=!1),i||F||!A&&z){const[U,H]=fS({nodeId:A,dragItems:a,nodeLookup:B,dragging:!1});i==null||i(P.sourceEvent,a,U,H),F==null||F(P.sourceEvent,U,H),A||z==null||z(P.sourceEvent,H)}}}).filter(P=>{const B=P.target;return!P.button&&(!N||!A5(B,`.${N}`,T))&&(!C||A5(B,C,T))});m.call(D)}function w(){m==null||m.on(".drag",null)}return{update:S,destroy:w}}function wge(t,e,n){const s=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const o of e.values())fy(i,Wp(o))>0&&s.push(o);return s}const Ege=250;function Cge(t,e,n,s){var a,c;let i=[],o=1/0;const r=wge(t,n,e+Ege);for(const d of r){const f=[...((a=d.internals.handleBounds)==null?void 0:a.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const p of f){if(s.nodeId===p.nodeId&&s.type===p.type&&s.id===p.id)continue;const{x:m,y:g}=mu(d,p,p.position,!0),y=Math.sqrt(Math.pow(m-t.x,2)+Math.pow(g-t.y,2));y>e||(y<o?(i=[{...p,x:m,y:g}],o=y):y===o&&i.push({...p,x:m,y:g}))}}if(!i.length)return null;if(i.length>1){const d=s.type==="source"?"target":"source";return i.find(f=>f.type===d)??i[0]}return i[0]}function fz(t,e,n,s,i,o=!1){var d,f,p;const r=s.get(t);if(!r)return null;const a=i==="strict"?(d=r.internals.handleBounds)==null?void 0:d[e]:[...((f=r.internals.handleBounds)==null?void 0:f.source)??[],...((p=r.internals.handleBounds)==null?void 0:p.target)??[]],c=(n?a==null?void 0:a.find(m=>m.id===n):a==null?void 0:a[0])??null;return c&&o?{...c,...mu(r,c,c.position,!0)}:c}function hz(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Nge(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const pz=()=>!0;function Tge(t,{connectionMode:e,connectionRadius:n,handleId:s,nodeId:i,edgeUpdaterType:o,isTarget:r,domNode:a,nodeLookup:c,lib:d,autoPanOnConnect:f,flowId:p,panBy:m,cancelConnection:g,onConnectStart:y,onConnect:v,onConnectEnd:S,isValidConnection:w=pz,onReconnectEnd:N,updateConnection:C,getTransform:T,getFromHandle:R,autoPanSpeed:A,dragThreshold:k=1,handleDomNode:M}){const L=tz(t.target);let j=0,D;const{x:P,y:B}=ko(t),I=hz(o,M),F=a==null?void 0:a.getBoundingClientRect();let z=!1;if(!F||!I)return;const U=fz(i,I,s,c,e);if(!U)return;let H=ko(t,F),V=!1,W=null,G=!1,Y=null;function J(){if(!f||!F)return;const[le,ne]=iN(H,F,A);m({x:le,y:ne}),j=requestAnimationFrame(J)}const q={...U,nodeId:i,type:I,position:U.position},X=c.get(i);let te={inProgress:!0,isValid:null,from:mu(X,q,Ze.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:X,to:H,toHandle:null,toPosition:b5[q.position],toNode:null,pointer:H};function Q(){z=!0,C(te),y==null||y(t,{nodeId:i,handleId:s,handleType:I})}k===0&&Q();function se(le){if(!z){const{x:ye,y:Oe}=ko(le),be=ye-P,_e=Oe-B;if(!(be*be+_e*_e>k*k))return;Q()}if(!R()||!q){ae(le);return}const ne=T();H=ko(le,F),D=Cge(Km(H,ne,!1,[1,1]),n,c,q),V||(J(),V=!0);const fe=mz(le,{handle:D,connectionMode:e,fromNodeId:i,fromHandleId:s,fromType:r?"target":"source",isValidConnection:w,doc:L,lib:d,flowId:p,nodeLookup:c});Y=fe.handleDomNode,W=fe.connection,G=Nge(!!D,fe.isValid);const ve=c.get(i),we=ve?mu(ve,q,Ze.Left,!0):te.from,Ce={...te,from:we,isValid:G,to:fe.toHandle&&G?Sf({x:fe.toHandle.x,y:fe.toHandle.y},ne):H,toHandle:fe.toHandle,toPosition:G&&fe.toHandle?fe.toHandle.position:b5[q.position],toNode:fe.toHandle?c.get(fe.toHandle.nodeId):null,pointer:H};C(Ce),te=Ce}function ae(le){if(!("touches"in le&&le.touches.length>0)){if(z){(D||Y)&&W&&G&&(v==null||v(W));const{inProgress:ne,...fe}=te,ve={...fe,toPosition:te.toHandle?te.toPosition:null};S==null||S(le,ve),o&&(N==null||N(le,ve))}g(),cancelAnimationFrame(j),V=!1,G=!1,W=null,Y=null,L.removeEventListener("mousemove",se),L.removeEventListener("mouseup",ae),L.removeEventListener("touchmove",se),L.removeEventListener("touchend",ae)}}L.addEventListener("mousemove",se),L.addEventListener("mouseup",ae),L.addEventListener("touchmove",se),L.addEventListener("touchend",ae)}function mz(t,{handle:e,connectionMode:n,fromNodeId:s,fromHandleId:i,fromType:o,doc:r,lib:a,flowId:c,isValidConnection:d=pz,nodeLookup:f}){const p=o==="target",m=e?r.querySelector(`.${a}-flow__handle[data-id="${c}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:g,y}=ko(t),v=r.elementFromPoint(g,y),S=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:m,w={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const N=hz(void 0,S),C=S.getAttribute("data-nodeid"),T=S.getAttribute("data-handleid"),R=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!C||!N)return w;const k={source:p?C:s,sourceHandle:p?T:i,target:p?s:C,targetHandle:p?i:T};w.connection=k;const L=R&&A&&(n===xf.Strict?p&&N==="source"||!p&&N==="target":C!==s||T!==i);w.isValid=L&&d(k),w.toHandle=fz(C,N,T,f,n,!0)}return w}const yE={onPointerDown:Tge,isValid:mz};function Oge({domNode:t,panZoom:e,getTransform:n,getViewScale:s}){const i=Bi(t);function o({translateExtent:a,width:c,height:d,zoomStep:f=1,pannable:p=!0,zoomable:m=!0,inversePan:g=!1}){const y=C=>{if(C.sourceEvent.type!=="wheel"||!e)return;const T=n(),R=C.sourceEvent.ctrlKey&&Gp()?10:1,A=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*f,k=T[2]*Math.pow(2,A*R);e.scaleTo(k)};let v=[0,0];const S=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(v=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},w=C=>{const T=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!e)return;const R=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],A=[R[0]-v[0],R[1]-v[1]];v=R;const k=s()*Math.max(T[2],Math.log(T[2]))*(g?-1:1),M={x:T[0]-A[0]*k,y:T[1]-A[1]*k},L=[[0,0],[c,d]];e.setViewportConstrained({x:M.x,y:M.y,zoom:T[2]},L,a)},N=H9().on("start",S).on("zoom",p?w:null).on("zoom.wheel",m?y:null);i.call(N,{})}function r(){i.on("zoom",null)}return{update:o,destroy:r,pointer:Co}}const Mb=t=>({x:t.x,y:t.y,zoom:t.k}),hS=({x:t,y:e,zoom:n})=>kb.translate(t,e).scale(n),ca=(t,e)=>t.target.closest(`.${e}`),gz=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),Rge=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,pS=(t,e=0,n=Rge,s=()=>{})=>{const i=typeof e=="number"&&e>0;return i||s(),i?t.transition().duration(e).ease(n).on("end",s):t},yz=t=>{const e=t.ctrlKey&&Gp()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function kge({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:s,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:r,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return f=>{if(ca(f,e))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(f.ctrlKey&&r){const S=Co(f),w=yz(f),N=p*Math.pow(2,w);s.scaleTo(n,N,S,f);return}const m=f.deltaMode===1?20:1;let g=i===tu.Vertical?0:f.deltaX*m,y=i===tu.Horizontal?0:f.deltaY*m;!Gp()&&f.shiftKey&&i!==tu.Vertical&&(g=f.deltaY*m,y=0),s.translateBy(n,-(g/p)*o,-(y/p)*o,{internal:!0});const v=Mb(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?c==null||c(f,v):(t.isPanScrolling=!0,a==null||a(f,v)),t.panScrollTimeout=setTimeout(()=>{d==null||d(f,v),t.isPanScrolling=!1},150)}}function Age({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(s,i){const o=s.type==="wheel",r=!e&&o&&!s.ctrlKey,a=ca(s,t);if(s.ctrlKey&&o&&a&&s.preventDefault(),r||a)return null;s.preventDefault(),n.call(this,s,i)}}function _ge({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return s=>{var o,r,a;if((o=s.sourceEvent)!=null&&o.internal)return;const i=Mb(s.transform);t.mouseButton=((r=s.sourceEvent)==null?void 0:r.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=i,((a=s.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),n&&(n==null||n(s.sourceEvent,i))}}function Mge({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:s,onPanZoom:i}){return o=>{var r,a;t.usedRightMouseButton=!!(n&&gz(e,t.mouseButton??0)),(r=o.sourceEvent)!=null&&r.sync||s([o.transform.x,o.transform.y,o.transform.k]),i&&!((a=o.sourceEvent)!=null&&a.internal)&&(i==null||i(o.sourceEvent,Mb(o.transform)))}}function Lge({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:i,onPaneContextMenu:o}){return r=>{var a;if(!((a=r.sourceEvent)!=null&&a.internal)&&(t.isZoomingOrPanning=!1,o&&gz(e,t.mouseButton??0)&&!t.usedRightMouseButton&&r.sourceEvent&&o(r.sourceEvent),t.usedRightMouseButton=!1,s(!1),i)){const c=Mb(r.transform);t.prevViewport=c,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i==null||i(r.sourceEvent,c)},n?150:0)}}}function Ige({panActivationKeyPressed:t,zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:i,panOnScroll:o,zoomOnDoubleClick:r,userSelectionActive:a,noWheelClassName:c,noPanClassName:d,lib:f,connectionInProgress:p}){return m=>{var w;const g=e||n,y=s&&m.ctrlKey,v=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(ca(m,`${f}-flow__node`)||ca(m,`${f}-flow__edge`)||ca(m,`${f}-flow__selection`)||ca(m,`${f}-flow__nodesselection`)))return!0;if(!i&&!g&&!o&&!r&&!s||a||p&&!v||ca(m,c)&&v||ca(m,d)&&(!v||o&&v&&!e)||!s&&m.ctrlKey&&v)return!1;if(!s&&m.type==="touchstart"&&((w=m.touches)==null?void 0:w.length)>1)return m.preventDefault(),!1;if(!g&&!o&&!y&&v||!i&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(i)&&!i.includes(m.button)&&m.type==="mousedown")return!1;const S=Array.isArray(i)&&i.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||v||t)&&S}}function Dge({domNode:t,minZoom:e,maxZoom:n,translateExtent:s,viewport:i,onPanZoom:o,onPanZoomStart:r,onPanZoomEnd:a,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=t.getBoundingClientRect();let p=[[0,0],[f.width,f.height]];const m=typeof ResizeObserver<"u"?new ResizeObserver(B=>{const I=B[0];I&&(p=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;m==null||m.observe(t);const g=H9().extent(()=>p).scaleExtent([e,n]).translateExtent(s),y=Bi(t).call(g);T({x:i.x,y:i.y,zoom:vf(i.zoom,e,n)},[[0,0],[f.width,f.height]],s);const v=y.on("wheel.zoom"),S=y.on("dblclick.zoom");g.wheelDelta(yz);async function w(B,I){return y?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?yp:T1).transform(pS(y,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),B)}):!1}function N({noWheelClassName:B,noPanClassName:I,onPaneContextMenu:F,userSelectionActive:z,panOnScroll:U,panOnDrag:H,panOnScrollMode:V,panOnScrollSpeed:W,preventScrolling:G,zoomOnPinch:Y,zoomOnScroll:J,zoomOnDoubleClick:q,panActivationKeyPressed:X=!1,zoomActivationKeyPressed:Z,lib:te,onTransformChange:Q,connectionInProgress:se,paneClickDistance:ae,selectionOnDrag:le}){z&&!d.isZoomingOrPanning&&C();const ne=U&&!Z&&!z;g.clickDistance(le?1/0:!Ro(ae)||ae<0?0:ae);const fe=ne?kge({zoomPanValues:d,noWheelClassName:B,d3Selection:y,d3Zoom:g,panOnScrollMode:V,panOnScrollSpeed:W,zoomOnPinch:Y,onPanZoomStart:r,onPanZoom:o,onPanZoomEnd:a}):Age({noWheelClassName:B,preventScrolling:G,d3ZoomHandler:v});y.on("wheel.zoom",fe,{passive:!1});const ve=_ge({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:r});g.on("start",ve);const we=Mge({zoomPanValues:d,panOnDrag:H,onPaneContextMenu:!!F,onPanZoom:o,onTransformChange:Q});g.on("zoom",we);const Ce=Lge({zoomPanValues:d,panOnDrag:H,panOnScroll:U,onPaneContextMenu:F,onPanZoomEnd:a,onDraggingChange:c});g.on("end",Ce);const ye=Ige({panActivationKeyPressed:X,zoomActivationKeyPressed:Z,panOnDrag:H,zoomOnScroll:J,panOnScroll:U,zoomOnDoubleClick:q,zoomOnPinch:Y,userSelectionActive:z,noPanClassName:I,noWheelClassName:B,lib:te,connectionInProgress:se});g.filter(ye),q?y.on("dblclick.zoom",S):y.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function T(B,I,F){const z=hS(B),U=g==null?void 0:g.constrain()(z,I,F);return U&&await w(U),U}async function R(B,I){const F=hS(B);return await w(F,I),F}function A(B){if(y){const I=hS(B),F=y.property("__zoom");(F.k!==B.zoom||F.x!==B.x||F.y!==B.y)&&(g==null||g.transform(y,I,null,{sync:!0}))}}function k(){const B=y?F9(y.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function M(B,I){return y?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?yp:T1).scaleTo(pS(y,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),B)}):!1}async function L(B,I){return y?new Promise(F=>{g==null||g.interpolate((I==null?void 0:I.interpolate)==="linear"?yp:T1).scaleBy(pS(y,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>F(!0)),B)}):!1}function j(B){g==null||g.scaleExtent(B)}function D(B){g==null||g.translateExtent(B)}function P(B){const I=!Ro(B)||B<0?0:B;g==null||g.clickDistance(I)}return{update:N,destroy:C,setViewport:R,setViewportConstrained:T,getViewport:k,scaleTo:M,scaleBy:L,setScaleExtent:j,setTranslateExtent:D,syncViewport:A,setClickDistance:P}}var wf;(function(t){t.Line="line",t.Handle="handle"})(wf||(wf={}));function jge({width:t,prevWidth:e,height:n,prevHeight:s,affectsX:i,affectsY:o}){const r=t-e,a=n-s,c=[r>0?1:r<0?-1:0,a>0?1:a<0?-1:0];return r&&i&&(c[0]=c[0]*-1),a&&o&&(c[1]=c[1]*-1),c}function _5(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),s=t.includes("left"),i=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:s,affectsY:i}}function ia(t,e){return Math.max(0,e-t)}function oa(t,e){return Math.max(0,t-e)}function Z0(t,e,n){return Math.max(0,e-t,t-n)}function M5(t,e){return t?!e:e}function Pge(t,e,n,s,i,o,r,a){let{affectsX:c,affectsY:d}=e;const{isHorizontal:f,isVertical:p}=e,m=f&&p,{xSnapped:g,ySnapped:y}=n,{minWidth:v,maxWidth:S,minHeight:w,maxHeight:N}=s,{x:C,y:T,width:R,height:A,aspectRatio:k}=t;let M=Math.floor(f?g-t.pointerX:0),L=Math.floor(p?y-t.pointerY:0);const j=R+(c?-M:M),D=A+(d?-L:L),P=-o[0]*R,B=-o[1]*A;let I=Z0(j,v,S),F=Z0(D,w,N);if(r){let H=0,V=0;c&&M<0?H=ia(C+M+P,r[0][0]):!c&&M>0&&(H=oa(C+j+P,r[1][0])),d&&L<0?V=ia(T+L+B,r[0][1]):!d&&L>0&&(V=oa(T+D+B,r[1][1])),I=Math.max(I,H),F=Math.max(F,V)}if(a){let H=0,V=0;c&&M>0?H=oa(C+M,a[0][0]):!c&&M<0&&(H=ia(C+j,a[1][0])),d&&L>0?V=oa(T+L,a[0][1]):!d&&L<0&&(V=ia(T+D,a[1][1])),I=Math.max(I,H),F=Math.max(F,V)}if(i){if(f){const H=Z0(j/k,w,N)*k;if(I=Math.max(I,H),r){let V=0;!c&&!d||c&&!d&&m?V=oa(T+B+j/k,r[1][1])*k:V=ia(T+B+(c?M:-M)/k,r[0][1])*k,I=Math.max(I,V)}if(a){let V=0;!c&&!d||c&&!d&&m?V=ia(T+j/k,a[1][1])*k:V=oa(T+(c?M:-M)/k,a[0][1])*k,I=Math.max(I,V)}}if(p){const H=Z0(D*k,v,S)/k;if(F=Math.max(F,H),r){let V=0;!c&&!d||d&&!c&&m?V=oa(C+D*k+P,r[1][0])/k:V=ia(C+(d?L:-L)*k+P,r[0][0])/k,F=Math.max(F,V)}if(a){let V=0;!c&&!d||d&&!c&&m?V=ia(C+D*k,a[1][0])/k:V=oa(C+(d?L:-L)*k,a[0][0])/k,F=Math.max(F,V)}}}L=L+(L<0?F:-F),M=M+(M<0?I:-I),i&&(m?j>D*k?L=(M5(c,d)?-M:M)/k:M=(M5(c,d)?-L:L)*k:f?(L=M/k,d=c):(M=L*k,c=d));const z=c?C+M:C,U=d?T+L:T;return{width:R+(c?-M:M),height:A+(d?-L:L),x:o[0]*M*(c?-1:1)+z,y:o[1]*L*(d?-1:1)+U}}const bz={width:0,height:0,x:0,y:0},zge={...bz,pointerX:0,pointerY:0,aspectRatio:1};function Bge(t,e,n){const s=e.position.x+t.position.x,i=e.position.y+t.position.y,o=t.measured.width??0,r=t.measured.height??0,a=n[0]*o,c=n[1]*r;return[[s-a,i-c],[s+o-a,i+r-c]]}function $ge({domNode:t,nodeId:e,getStoreItems:n,onChange:s,onEnd:i}){const o=Bi(t);let r={controlDirection:_5("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:d,boundaries:f,keepAspectRatio:p,resizeDirection:m,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:S}){let w={...bz},N={...zge};r={boundaries:f,resizeDirection:m,keepAspectRatio:p,controlDirection:_5(d)};let C,T=null,R=[],A,k,M,L=!1;const j=O9().on("start",D=>{const{nodeLookup:P,transform:B,snapGrid:I,snapToGrid:F,nodeOrigin:z,paneDomNode:U}=n();if(C=P.get(e),!C)return;T=(U==null?void 0:U.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:V}=bp(D.sourceEvent,{transform:B,snapGrid:I,snapToGrid:F,containerBounds:T});w={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},N={...w,pointerX:H,pointerY:V,aspectRatio:w.width/w.height},A=void 0,k=pu(C.extent)?C.extent:void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(A=P.get(C.parentId)),A&&C.extent==="parent"&&(k=[[0,0],[A.measured.width,A.measured.height]]),R=[],M=void 0;for(const[W,G]of P)if(G.parentId===e&&(R.push({id:W,position:{...G.position},extent:G.extent}),G.extent==="parent"||G.expandParent)){const Y=Bge(G,C,G.origin??z);M?M=[[Math.min(Y[0][0],M[0][0]),Math.min(Y[0][1],M[0][1])],[Math.max(Y[1][0],M[1][0]),Math.max(Y[1][1],M[1][1])]]:M=Y}g==null||g(D,{...w})}).on("drag",D=>{const{transform:P,snapGrid:B,snapToGrid:I,nodeOrigin:F}=n(),z=bp(D.sourceEvent,{transform:P,snapGrid:B,snapToGrid:I,containerBounds:T}),U=[];if(!C)return;const{x:H,y:V,width:W,height:G}=w,Y={},J=C.origin??F,{width:q,height:X,x:Z,y:te}=Pge(N,r.controlDirection,z,r.boundaries,r.keepAspectRatio,J,k,M),Q=q!==W,se=X!==G,ae=Z!==H&&Q,le=te!==V&&se;if(!ae&&!le&&!Q&&!se)return;if((ae||le||J[0]===1||J[1]===1)&&(Y.x=ae?Z:w.x,Y.y=le?te:w.y,w.x=Y.x,w.y=Y.y,R.length>0)){const we=Z-H,Ce=te-V;for(const ye of R)ye.position={x:ye.position.x-we+J[0]*(q-W),y:ye.position.y-Ce+J[1]*(X-G)},U.push(ye)}if((Q||se)&&(Y.width=Q&&(!r.resizeDirection||r.resizeDirection==="horizontal")?q:w.width,Y.height=se&&(!r.resizeDirection||r.resizeDirection==="vertical")?X:w.height,w.width=Y.width,w.height=Y.height),A&&C.expandParent){const we=J[0]*(Y.width??0);Y.x&&Y.x<we&&(w.x=we,N.x=N.x-(Y.x-we));const Ce=J[1]*(Y.height??0);Y.y&&Y.y<Ce&&(w.y=Ce,N.y=N.y-(Y.y-Ce))}const ne=jge({width:w.width,prevWidth:W,height:w.height,prevHeight:G,affectsX:r.controlDirection.affectsX,affectsY:r.controlDirection.affectsY}),fe={...w,direction:ne};(S==null?void 0:S(D,fe))!==!1&&(L=!0,y==null||y(D,fe),s(Y,U))}).on("end",D=>{L&&(v==null||v(D,{...w}),i==null||i({...w}),L=!1)});o.call(j)}function c(){o.on(".drag",null)}return{update:a,destroy:c}}const Fge={},L5=t=>{let e;const n=new Set,s=(f,p)=>{const m=typeof f=="function"?f(e):f;if(!Object.is(m,e)){const g=e;e=p??(typeof m!="object"||m===null)?m:Object.assign({},e,m),n.forEach(y=>y(e,g))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Fge?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=e=t(s,i,c);return c},Hge=t=>t?L5(t):L5,{useDebugValue:Uge}=Oo,{useSyncExternalStoreWithSelector:Vge}=uG,qge=t=>t;function xz(t,e=qge,n){const s=Vge(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Uge(s),s}const I5=(t,e)=>{const n=Hge(t),s=(i,o=e)=>xz(n,i,o);return Object.assign(s,n),s},Wge=(t,e)=>t?I5(t,e):I5;function Un(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[s,i]of t)if(!Object.is(i,e.get(s)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const s of t)if(!e.has(s))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||!Object.is(t[s],e[s]))return!1;return!0}const Lb=_.createContext(null),Gge=Lb.Provider,vz=Lo.error001("react");function Xt(t,e){const n=_.useContext(Lb);if(n===null)throw new Error(vz);return xz(n,t,e)}function An(){const t=_.useContext(Lb);if(t===null)throw new Error(vz);return _.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const D5={display:"none"},Kge={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sz="react-flow__node-desc",wz="react-flow__edge-desc",Yge="react-flow__aria-live",Xge=t=>t.ariaLiveMessage,Qge=t=>t.ariaLabelConfig;function Zge({rfId:t}){const e=Xt(Xge);return b.jsx("div",{id:`${Yge}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Kge,children:e})}function Jge({rfId:t,disableKeyboardA11y:e}){const n=Xt(Qge);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${Sz}-${t}`,style:D5,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${wz}-${t}`,style:D5,children:n["edge.a11yDescription.default"]}),!e&&b.jsx(Zge,{rfId:t})]})}const Ib=_.forwardRef(({position:t="top-left",children:e,className:n,style:s,...i},o)=>{const r=`${t}`.split("-");return b.jsx("div",{className:ls(["react-flow__panel",n,...r]),style:s,ref:o,...i,children:e})});Ib.displayName="Panel";const j5="https://reactflow.dev?utm_source=attribution";function e0e({proOptions:t,position:e="bottom-right"}){return _.useEffect(()=>{},[]),t!=null&&t.hideAttribution?null:b.jsx(Ib,{position:e,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${j5}`,children:b.jsx("a",{href:j5,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const t0e=t=>{const e=[],n=[];for(const[,s]of t.nodeLookup)s.selected&&e.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&n.push(s);return{selectedNodes:e,selectedEdges:n}},J0=t=>t.id;function n0e(t,e){return Un(t.selectedNodes.map(J0),e.selectedNodes.map(J0))&&Un(t.selectedEdges.map(J0),e.selectedEdges.map(J0))}function s0e({onSelectionChange:t}){const e=An(),{selectedNodes:n,selectedEdges:s}=Xt(t0e,n0e);return _.useEffect(()=>{const i={nodes:n,edges:s};t==null||t(i),e.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,s,t]),null}const i0e=t=>!!t.onSelectionChangeHandlers;function o0e({onSelectionChange:t}){const e=Xt(i0e);return t||e?b.jsx(s0e,{onSelectionChange:t}):null}const Ez=[0,0],r0e={x:0,y:0,zoom:1},l0e=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],P5=[...l0e,"rfId"],a0e=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),z5={translateExtent:Vp,nodeOrigin:Ez,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function c0e(t){const{setNodes:e,setEdges:n,setMinZoom:s,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:r,reset:a,setDefaultNodesAndEdges:c}=Xt(a0e,Un),d=An();_.useEffect(()=>(c(t.defaultNodes,t.defaultEdges),()=>{f.current=z5,a()}),[]);const f=_.useRef(z5);return _.useEffect(()=>{for(const p of P5){const m=t[p],g=f.current[p];m!==g&&(typeof t[p]>"u"||(p==="nodes"?e(m):p==="edges"?n(m):p==="minZoom"?s(m):p==="maxZoom"?i(m):p==="translateExtent"?o(m):p==="nodeExtent"?r(m):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:Jme(m)}):p==="fitView"?d.setState({fitViewQueued:m}):p==="fitViewOptions"?d.setState({fitViewOptions:m}):d.setState({[p]:m})))}f.current=t},P5.map(p=>t[p])),null}function B5(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function u0e(t){var s;const[e,n]=_.useState(t==="system"?null:t);return _.useEffect(()=>{if(t!=="system"){n(t);return}const i=B5(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[t]),e!==null?e:(s=B5())!=null&&s.matches?"dark":"light"}const $5=typeof document<"u"?document:null;function Kp(t=null,e={target:$5,actInsideInputWithModifier:!0}){const[n,s]=_.useState(!1),i=_.useRef(!1),o=_.useRef(new Set([])),[r,a]=_.useMemo(()=>{if(t!==null){const d=(Array.isArray(t)?t:[t]).filter(p=>typeof p=="string").map(p=>p.replace(/\+/g,`
360
+ `).replace(`
361
+
362
+ `,`
363
+ +`).split(`
364
+ `)),f=d.reduce((p,m)=>p.concat(...m),[]);return[d,f]}return[[],[]]},[t]);return _.useEffect(()=>{const c=(e==null?void 0:e.target)??$5,d=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const f=g=>{var S,w;if(i.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!i.current||i.current&&!d)&&nz(g))return!1;const v=H5(g.code,a);if(o.current.add(g[v]),F5(r,o.current,!1)){const N=((w=(S=g.composedPath)==null?void 0:S.call(g))==null?void 0:w[0])||g.target,C=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";e.preventDefault!==!1&&(i.current||!C)&&g.preventDefault(),s(!0)}},p=g=>{const y=H5(g.code,a);F5(r,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(g[y]),g.key==="Meta"&&o.current.clear(),i.current=!1},m=()=>{o.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",f),c==null||c.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",f),c==null||c.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[t,s]),n}function F5(t,e,n){return t.filter(s=>n||s.length===e.size).some(s=>s.every(i=>e.has(i)))}function H5(t,e){return e.includes(t)?"code":"key"}const d0e=()=>{const t=An();return _.useMemo(()=>({zoomIn:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,e):!1},zoomOut:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,e):!1},zoomTo:async(e,n)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(e,n):!1},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[s,i,o],panZoom:r}=t.getState();return r?(await r.setViewport({x:e.x??s,y:e.y??i,zoom:e.zoom??o},n),!0):!1},getViewport:()=>{const[e,n,s]=t.getState().transform;return{x:e,y:n,zoom:s}},setCenter:async(e,n,s)=>t.getState().setCenter(e,n,s),fitBounds:async(e,n)=>{const{width:s,height:i,minZoom:o,maxZoom:r,panZoom:a}=t.getState(),c=oN(e,s,i,o,r,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(e,n={})=>{const{transform:s,snapGrid:i,snapToGrid:o,domNode:r}=t.getState();if(!r)return e;const{x:a,y:c}=r.getBoundingClientRect(),d={x:e.x-a,y:e.y-c},f=n.snapGrid??i,p=n.snapToGrid??o;return Km(d,s,p,f)},flowToScreenPosition:e=>{const{transform:n,domNode:s}=t.getState();if(!s)return e;const{x:i,y:o}=s.getBoundingClientRect(),r=Sf(e,n);return{x:r.x+i,y:r.y+o}}}),[])};function Cz(t,e){const n=[],s=new Map,i=[];for(const o of t)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")s.set(o.id,[o]);else{const r=s.get(o.id);r?r.push(o):s.set(o.id,[o])}for(const o of e){const r=s.get(o.id);if(!r){n.push(o);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){n.push({...r[0].item});continue}const a={...o};for(const c of r)f0e(c,a);n.push(a)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function f0e(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function h0e(t,e){return Cz(t,e)}function p0e(t,e){return Cz(t,e)}function Dc(t,e){return{id:t,type:"select",selected:e}}function Ld(t,e=new Set,n=!1){const s=[];for(const[i,o]of t){const r=e.has(i);!(o.selected===void 0&&!r)&&o.selected!==r&&(n&&(o.selected=r),s.push(Dc(o.id,r)))}return s}function U5({items:t=[],lookup:e}){var i;const n=[],s=new Map(t.map(o=>[o.id,o]));for(const[o,r]of t.entries()){const a=e.get(r.id),c=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;c!==void 0&&c!==r&&n.push({id:r.id,item:r,type:"replace"}),c===void 0&&n.push({item:r,type:"add",index:o})}for(const[o]of e)s.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function V5(t){return{id:t.id,type:"remove"}}const m0e=Q9();function g0e(t,e,n={}){return oge(t,e,{...n,onError:n.onError??m0e})}const q5=t=>Vme(t),y0e=t=>W9(t);function Nz(t){return _.forwardRef(t)}const Tz=typeof window<"u"?_.useLayoutEffect:_.useEffect;function W5(t){const[e,n]=_.useState(BigInt(0)),[s]=_.useState(()=>b0e(()=>n(i=>i+BigInt(1))));return Tz(()=>{const i=s.get();i.length&&(t(i),s.reset())},[e]),s}function b0e(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const Oz=_.createContext(null);function x0e({children:t}){const e=An(),n=_.useCallback(a=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:f,onNodesChange:p,nodeLookup:m,fitViewQueued:g,onNodesChangeMiddlewareMap:y}=e.getState();let v=c;for(const w of a)v=typeof w=="function"?w(v):w;let S=U5({items:v,lookup:m});for(const w of y.values())S=w(S);f&&d(v),S.length>0?p==null||p(S):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:N,setNodes:C}=e.getState();w&&C(N)})},[]),s=W5(n),i=_.useCallback(a=>{const{edges:c=[],setEdges:d,hasDefaultEdges:f,onEdgesChange:p,edgeLookup:m}=e.getState();let g=c;for(const y of a)g=typeof y=="function"?y(g):y;f?d(g):p&&p(U5({items:g,lookup:m}))},[]),o=W5(i),r=_.useMemo(()=>({nodeQueue:s,edgeQueue:o}),[]);return b.jsx(Oz.Provider,{value:r,children:t})}function v0e(){const t=_.useContext(Oz);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const S0e=t=>!!t.panZoom;function Db(){const t=d0e(),e=An(),n=v0e(),s=Xt(S0e),i=_.useMemo(()=>{const o=p=>e.getState().nodeLookup.get(p),r=p=>{n.nodeQueue.push(p)},a=p=>{n.edgeQueue.push(p)},c=p=>{var w,N;const{nodeLookup:m,nodeOrigin:g}=e.getState(),y=q5(p)?p:m.get(p.id),v=y.parentId?J9(y.position,y.measured,y.parentId,m,g):y.position,S={...y,position:v,width:((w=y.measured)==null?void 0:w.width)??y.width,height:((N=y.measured)==null?void 0:N.height)??y.height};return Wp(S)},d=(p,m,g={replace:!1})=>{r(y=>y.map(v=>{if(v.id===p){const S=typeof m=="function"?m(v):m;return g.replace&&q5(S)?S:{...v,...S}}return v}))},f=(p,m,g={replace:!1})=>{a(y=>y.map(v=>{if(v.id===p){const S=typeof m=="function"?m(v):m;return g.replace&&y0e(S)?S:{...v,...S}}return v}))};return{getNodes:()=>e.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=o(p))==null?void 0:m.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:p=[]}=e.getState();return p.map(m=>({...m}))},getEdge:p=>e.getState().edgeLookup.get(p),setNodes:r,setEdges:a,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(g=>[...g,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:g}=e.getState(),[y,v,S]=g;return{nodes:p.map(w=>({...w})),edges:m.map(w=>({...w})),viewport:{x:y,y:v,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:g,edges:y,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:w,triggerEdgeChanges:N,onDelete:C,onBeforeDelete:T}=e.getState(),{nodes:R,edges:A}=await Yme({nodesToRemove:p,edgesToRemove:m,nodes:g,edges:y,onBeforeDelete:T}),k=A.length>0,M=R.length>0;if(k){const L=A.map(V5);S==null||S(A),N(L)}if(M){const L=R.map(V5);v==null||v(R),w(L)}return(M||k)&&(C==null||C({nodes:R,edges:A})),{deletedNodes:R,deletedEdges:A}},getIntersectingNodes:(p,m=!0,g)=>{const y=v5(p),v=y?p:c(p),S=g!==void 0;return v?(g||e.getState().nodes).filter(w=>{const N=e.getState().nodeLookup.get(w.id);if(N&&!y&&(w.id===p.id||!N.internals.positionAbsolute))return!1;const C=Wp(S?w:N),T=fy(C,v);return m&&T>0||T>=C.width*C.height||T>=v.width*v.height}):[]},isNodeIntersecting:(p,m,g=!0)=>{const v=v5(p)?p:c(p);if(!v)return!1;const S=fy(v,m);return g&&S>0||S>=m.width*m.height||S>=v.width*v.height},updateNode:d,updateNodeData:(p,m,g={replace:!1})=>{d(p,y=>{const v=typeof m=="function"?m(y):m;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},updateEdge:f,updateEdgeData:(p,m,g={replace:!1})=>{f(p,y=>{const v=typeof m=="function"?m(y):m;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:g}=e.getState();return qme(p,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:p,id:m,nodeId:g})=>{var y;return Array.from(((y=e.getState().connectionLookup.get(`${g}-${p}${m?`-${m}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:p,handleId:m,nodeId:g})=>{var y;return Array.from(((y=e.getState().connectionLookup.get(`${g}${p?m?`-${p}-${m}`:`-${p}`:""}`))==null?void 0:y.values())??[])},fitView:async p=>{const m=e.getState().fitViewResolver??Zme();return e.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(g=>[...g]),m.promise}}},[]);return _.useMemo(()=>({...i,...t,viewportInitialized:s}),[s])}const G5=t=>t.selected,w0e=typeof window<"u"?window:void 0;function E0e({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=An(),{deleteElements:s}=Db(),i=Kp(t,{actInsideInputWithModifier:!1}),o=Kp(e,{target:w0e});_.useEffect(()=>{if(i){const{edges:r,nodes:a}=n.getState();s({nodes:a.filter(G5),edges:r.filter(G5)}),n.setState({nodesSelectionActive:!1})}},[i]),_.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function C0e(t){const e=An();_.useEffect(()=>{const n=()=>{var i,o,r,a;if(!t.current||!(((o=(i=t.current).checkVisibility)==null?void 0:o.call(i))??!0))return!1;const s=rN(t.current);(s.height===0||s.width===0)&&((a=(r=e.getState()).onError)==null||a.call(r,"004",Lo.error004())),e.setState({width:s.width||500,height:s.height||500})};if(t.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(t.current),()=>{window.removeEventListener("resize",n),s&&t.current&&s.unobserve(t.current)}}},[])}const jb={position:"absolute",width:"100%",height:"100%",top:0,left:0},N0e=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function T0e({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panActivationKeyPressed:i,panOnScrollSpeed:o=.5,panOnScrollMode:r=tu.Free,zoomOnDoubleClick:a=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:f,minZoom:p,maxZoom:m,zoomActivationKeyCode:g,preventScrolling:y=!0,children:v,noWheelClassName:S,noPanClassName:w,onViewportChange:N,isControlledViewport:C,paneClickDistance:T,selectionOnDrag:R}){const A=An(),k=_.useRef(null),{userSelectionActive:M,lib:L,connectionInProgress:j}=Xt(N0e,Un),D=Kp(g),P=_.useRef();C0e(k);const B=_.useCallback(I=>{N==null||N({x:I[0],y:I[1],zoom:I[2]}),C||A.setState({transform:I})},[N,C]);return _.useEffect(()=>{if(k.current){P.current=Dge({domNode:k.current,minZoom:p,maxZoom:m,translateExtent:f,viewport:d,onDraggingChange:U=>A.setState(H=>H.paneDragging===U?H:{paneDragging:U}),onPanZoomStart:(U,H)=>{const{onViewportChangeStart:V,onMoveStart:W}=A.getState();W==null||W(U,H),V==null||V(H)},onPanZoom:(U,H)=>{const{onViewportChange:V,onMove:W}=A.getState();W==null||W(U,H),V==null||V(H)},onPanZoomEnd:(U,H)=>{const{onViewportChangeEnd:V,onMoveEnd:W}=A.getState();W==null||W(U,H),V==null||V(H)}});const{x:I,y:F,zoom:z}=P.current.getViewport();return A.setState({panZoom:P.current,transform:[I,F,z],domNode:k.current.closest(".react-flow")}),()=>{var U;(U=P.current)==null||U.destroy()}}},[]),_.useEffect(()=>{var I;(I=P.current)==null||I.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:s,panActivationKeyPressed:i,panOnScrollSpeed:o,panOnScrollMode:r,zoomOnDoubleClick:a,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:y,noPanClassName:w,userSelectionActive:M,noWheelClassName:S,lib:L,onTransformChange:B,connectionInProgress:j,selectionOnDrag:R,paneClickDistance:T})},[t,e,n,s,i,o,r,a,c,D,y,w,M,S,L,B,j,R,T]),b.jsx("div",{className:"react-flow__renderer",ref:k,style:jb,children:v})}const O0e=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function R0e(){const{userSelectionActive:t,userSelectionRect:e}=Xt(O0e,Un);return t&&e?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const mS=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},k0e=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function A0e({isSelecting:t,selectionKeyPressed:e,selectionMode:n=qp.Full,panOnDrag:s,autoPanOnSelection:i,paneClickDistance:o,selectionOnDrag:r,onSelectionStart:a,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:y,children:v}){const S=_.useRef(0),w=An(),{userSelectionActive:N,elementsSelectable:C,dragging:T,panBy:R,autoPanSpeed:A}=Xt(k0e,Un),k=C&&(t||N),M=_.useRef(null),L=_.useRef(),j=_.useRef(new Set),D=_.useRef(new Set),P=_.useRef(!1),B=_.useRef(!1),I=_.useRef({x:0,y:0}),F=_.useRef(!1),z=Q=>{if(B.current||P.current||w.getState().connection.inProgress){B.current=!1,P.current=!1;return}d==null||d(Q),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=Q=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){Q.preventDefault();return}f==null||f(Q)},H=p?Q=>p(Q):void 0,V=Q=>{B.current&&(Q.stopPropagation(),B.current=!1)},W=Q=>{var ye,Oe;if(Q.pointerType==="touch"&&s!==!1&&!e)return;const{domNode:se,transform:ae}=w.getState();if(L.current=se==null?void 0:se.getBoundingClientRect(),!L.current)return;const le=Q.target===M.current;if(!le&&!!Q.target.closest(".nokey")||!t||!(r&&le||e)||Q.button!==0||!Q.isPrimary)return;(Oe=(ye=Q.target)==null?void 0:ye.setPointerCapture)==null||Oe.call(ye,Q.pointerId),B.current=!1;const{x:ve,y:we}=ko(Q.nativeEvent,L.current),Ce=Km({x:ve,y:we},ae);w.setState({userSelectionRect:{width:0,height:0,startX:Ce.x,startY:Ce.y,x:ve,y:we}}),le||(Q.stopPropagation(),Q.preventDefault())};function G(Q,se){const{userSelectionRect:ae}=w.getState();if(!ae)return;const{transform:le,nodeLookup:ne,edgeLookup:fe,connectionLookup:ve,triggerNodeChanges:we,triggerEdgeChanges:Ce,defaultEdgeOptions:ye}=w.getState(),Oe={x:ae.startX,y:ae.startY},{x:be,y:_e}=Sf(Oe,le),Me={startX:Oe.x,startY:Oe.y,x:Q<be?Q:be,y:se<_e?se:_e,width:Math.abs(Q-be),height:Math.abs(se-_e)},Be=j.current,He=D.current;j.current=new Set(sN(ne,Me,le,n===qp.Partial,!0).map(Ee=>Ee.id)),D.current=new Set;const Ae=(ye==null?void 0:ye.selectable)??!0;for(const Ee of j.current){const Ne=ve.get(Ee);if(Ne)for(const{edgeId:xe}of Ne.values()){const Pe=fe.get(xe);Pe&&(Pe.selectable??Ae)&&D.current.add(xe)}}if(!S5(Be,j.current)){const Ee=Ld(ne,j.current,!0);we(Ee)}if(!S5(He,D.current)){const Ee=Ld(fe,D.current);Ce(Ee)}w.setState({userSelectionRect:Me,userSelectionActive:!0,nodesSelectionActive:!1})}function Y(){if(!i||!L.current)return;const[Q,se]=iN(I.current,L.current,A);R({x:Q,y:se}).then(ae=>{if(!B.current||!ae){S.current=requestAnimationFrame(Y);return}const{x:le,y:ne}=I.current;G(le,ne),S.current=requestAnimationFrame(Y)})}const J=()=>{cancelAnimationFrame(S.current),S.current=0,F.current=!1};_.useEffect(()=>()=>J(),[]);const q=Q=>{const{userSelectionRect:se,transform:ae,resetSelectedElements:le}=w.getState();if(!L.current||!se)return;const{x:ne,y:fe}=ko(Q.nativeEvent,L.current);I.current={x:ne,y:fe};const ve=Sf({x:se.startX,y:se.startY},ae);if(!B.current){const we=e?0:o;if(Math.hypot(ne-ve.x,fe-ve.y)<=we)return;le(),a==null||a(Q)}B.current=!0,F.current||(Y(),F.current=!0),G(ne,fe)},X=Q=>{var se,ae;if(!k){Q.target===M.current&&w.getState().connection.inProgress&&(P.current=!0);return}Q.button===0&&((ae=(se=Q.target)==null?void 0:se.releasePointerCapture)==null||ae.call(se,Q.pointerId),!N&&Q.target===M.current&&w.getState().userSelectionRect&&(z==null||z(Q)),w.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(c==null||c(Q),w.setState({nodesSelectionActive:j.current.size>0})),J())},Z=Q=>{var se,ae;(ae=(se=Q.target)==null?void 0:se.releasePointerCapture)==null||ae.call(se,Q.pointerId),J()},te=s===!0||Array.isArray(s)&&s.includes(0);return b.jsxs("div",{className:ls(["react-flow__pane",{draggable:te,dragging:T,selection:t}]),onClick:k?void 0:mS(z,M),onContextMenu:mS(U,M),onWheel:mS(H,M),onPointerEnter:k?void 0:m,onPointerMove:k?q:g,onPointerUp:X,onPointerCancel:k?Z:void 0,onPointerDownCapture:k?W:void 0,onClickCapture:k?V:void 0,onPointerLeave:y,ref:M,style:jb,children:[v,b.jsx(R0e,{})]})}function bE({id:t,store:e,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:r,nodeLookup:a,onError:c}=e.getState(),d=a.get(t);if(!d){c==null||c("012",Lo.error012(t));return}e.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&r)&&(o({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var f;return(f=s==null?void 0:s.current)==null?void 0:f.blur()})):i([t])}function Rz({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:s,nodeId:i,isSelectable:o,nodeClickDistance:r}){const a=An(),[c,d]=_.useState(!1),f=_.useRef();return _.useEffect(()=>{if(!e)return f.current=Sge({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{bE({id:p,store:a,nodeRef:t})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}}),()=>{var p;(p=f.current)==null||p.destroy(),f.current=void 0}},[e,a,t]),_.useEffect(()=>{e||!t.current||!f.current||f.current.update({noDragClassName:n,handleSelector:s,domNode:t.current,isSelectable:o,nodeId:i,nodeClickDistance:r})},[n,s,e,o,t,i,r]),c}const _0e=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function kz(){const t=An();return _.useCallback(n=>{const{nodeExtent:s,snapToGrid:i,snapGrid:o,nodesDraggable:r,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:f}=t.getState(),p=new Map,m=_0e(r),g=i?o[0]:5,y=i?o[1]:5,v=n.direction.x*g*n.factor,S=n.direction.y*y*n.factor;for(const[,w]of d){if(!m(w))continue;let N={x:w.internals.positionAbsolute.x+v,y:w.internals.positionAbsolute.y+S};i&&(N=Gm(N,o));const{position:C,positionAbsolute:T}=G9({nodeId:w.id,nextPosition:N,nodeLookup:d,nodeExtent:s,nodeOrigin:f,onError:a});w.position=C,w.internals.positionAbsolute=T,p.set(w.id,w)}c(p)},[])}const fN=_.createContext(null),M0e=fN.Provider;fN.Consumer;const Az=()=>_.useContext(fN),L0e=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),_z=_.createContext(null);function I0e({children:t}){const e=Xt(L0e,Un);return b.jsx(_z.Provider,{value:e,children:t})}function D0e(){const t=_.useContext(_z);if(!t)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return t}const j0e={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},P0e=(t,e,n)=>s=>{const{connectionClickStartHandle:i,connectionMode:o,connection:r}=s,{fromHandle:a,toHandle:c,isValid:d}=r;if(!a&&!i)return j0e;const f=(c==null?void 0:c.nodeId)===t&&(c==null?void 0:c.id)===e&&(c==null?void 0:c.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===n,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===t&&(i==null?void 0:i.id)===e&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===xf.Strict?(a==null?void 0:a.type)!==n:t!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!i,valid:f&&d}};function z0e({type:t="source",position:e=Ze.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:r,onConnect:a,children:c,className:d,onMouseDown:f,onTouchStart:p,...m},g){var F,z;const y=r||null,v=t==="target",S=An(),w=Az(),{connectOnClick:N,noPanClassName:C,rfId:T}=D0e(),{connectingFrom:R,connectingTo:A,clickConnecting:k,isPossibleEndHandle:M,connectionInProcess:L,clickConnectionInProcess:j,valid:D}=Xt(P0e(w,y,t),Un);w||(z=(F=S.getState()).onError)==null||z.call(F,"010",Lo.error010());const P=U=>{const{defaultEdgeOptions:H,onConnect:V,hasDefaultEdges:W}=S.getState(),G={...H,...U};if(W){const{edges:Y,setEdges:J,onError:q}=S.getState();J(g0e(G,Y,{onError:q}))}V==null||V(G),a==null||a(G)},B=U=>{if(!w)return;const H=sz(U.nativeEvent);if(i&&(H&&U.button===0||!H)){const V=S.getState();yE.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:v,handleId:y,nodeId:w,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...W)=>{var G,Y;return(Y=(G=S.getState()).onConnectEnd)==null?void 0:Y.call(G,...W)},updateConnection:V.updateConnection,onConnect:P,isValidConnection:n||((...W)=>{var G,Y;return((Y=(G=S.getState()).isValidConnection)==null?void 0:Y.call(G,...W))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}H?f==null||f(U):p==null||p(U)},I=U=>{const{onClickConnectStart:H,onClickConnectEnd:V,connectionClickStartHandle:W,connectionMode:G,isValidConnection:Y,lib:J,rfId:q,nodeLookup:X,connection:Z}=S.getState();if(!w||!W&&!i)return;if(!W){H==null||H(U.nativeEvent,{nodeId:w,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:w,type:t,id:y}});return}const te=tz(U.target),Q=n||Y,{connection:se,isValid:ae}=yE.isValid(U.nativeEvent,{handle:{nodeId:w,id:y,type:t},connectionMode:G,fromNodeId:W.nodeId,fromHandleId:W.id||null,fromType:W.type,isValidConnection:Q,flowId:q,doc:te,lib:J,nodeLookup:X});ae&&se&&P(se);const le=structuredClone(Z);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,V==null||V(U,le),S.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":y,"data-nodeid":w,"data-handlepos":e,"data-id":`${T}-${w}-${y}-${t}`,className:ls(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",C,d,{source:!v,target:v,connectable:s,connectablestart:i,connectableend:o,clickconnecting:k,connectingfrom:R,connectingto:A,valid:D,connectionindicator:s&&(!L||M)&&(L||j?o:i)}]),onMouseDown:B,onTouchStart:B,onClick:N?I:void 0,ref:g,...m,children:c})}const gu=_.memo(Nz(z0e));function B0e({data:t,isConnectable:e,sourcePosition:n=Ze.Bottom}){return b.jsxs(b.Fragment,{children:[t==null?void 0:t.label,b.jsx(gu,{type:"source",position:n,isConnectable:e})]})}function $0e({data:t,isConnectable:e,targetPosition:n=Ze.Top,sourcePosition:s=Ze.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(gu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,b.jsx(gu,{type:"source",position:s,isConnectable:e})]})}function F0e(){return null}function H0e({data:t,isConnectable:e,targetPosition:n=Ze.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(gu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const hy={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},K5={input:B0e,default:$0e,output:H0e,group:F0e};function U0e(t){var e,n,s,i;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((i=t.style)==null?void 0:i.height)}}const V0e=t=>{const{width:e,height:n,x:s,y:i}=Wm(t.nodeLookup,{filter:o=>!!o.selected});return{width:Ro(e)?e:null,height:Ro(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${i}px)`}};function q0e({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const s=An(),{width:i,height:o,transformString:r,userSelectionActive:a}=Xt(V0e,Un),c=kz(),d=_.useRef(null);_.useEffect(()=>{var g;n||(g=d.current)==null||g.focus({preventScroll:!0})},[n]);const f=!a&&i!==null&&o!==null;if(Rz({nodeRef:d,disabled:!f}),!f)return null;const p=t?g=>{const y=s.getState().nodes.filter(v=>v.selected);t(g,y)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(hy,g.key)&&(g.preventDefault(),c({direction:hy[g.key],factor:g.shiftKey?4:1}))};return b.jsx("div",{className:ls(["react-flow__nodesselection","react-flow__container",e]),style:{transform:r},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:i,height:o}})})}const Y5=typeof window<"u"?window:void 0,W0e=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Mz({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:r,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:p,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:w,zoomOnScroll:N,zoomOnPinch:C,panOnScroll:T,panOnScrollSpeed:R,panOnScrollMode:A,zoomOnDoubleClick:k,panOnDrag:M,autoPanOnSelection:L,defaultViewport:j,translateExtent:D,minZoom:P,maxZoom:B,preventScrolling:I,onSelectionContextMenu:F,noWheelClassName:z,noPanClassName:U,disableKeyboardA11y:H,onViewportChange:V,isControlledViewport:W}){const{nodesSelectionActive:G,userSelectionActive:Y}=Xt(W0e,Un),J=Kp(d,{target:Y5}),q=Kp(v,{target:Y5}),X=q||M,Z=q||T,te=f&&X!==!0,Q=J||Y||te;return E0e({deleteKeyCode:c,multiSelectionKeyCode:y}),b.jsx(T0e,{onPaneContextMenu:o,elementsSelectable:w,zoomOnScroll:N,zoomOnPinch:C,panOnScroll:Z,panActivationKeyPressed:q,panOnScrollSpeed:R,panOnScrollMode:A,zoomOnDoubleClick:k,panOnDrag:!J&&X,defaultViewport:j,translateExtent:D,minZoom:P,maxZoom:B,zoomActivationKeyCode:S,preventScrolling:I,noWheelClassName:z,noPanClassName:U,onViewportChange:V,isControlledViewport:W,paneClickDistance:a,selectionOnDrag:te,children:b.jsxs(A0e,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:r,panOnDrag:X,autoPanOnSelection:L,isSelecting:!!Q,selectionMode:p,selectionKeyPressed:J,paneClickDistance:a,selectionOnDrag:te,children:[t,G&&b.jsx(q0e,{onSelectionContextMenu:F,noPanClassName:U,disableKeyboardA11y:H})]})})}Mz.displayName="FlowRenderer";const G0e=_.memo(Mz),K0e=t=>e=>t?sN(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function Y0e(t){return Xt(_.useCallback(K0e(t),[t]),Un)}const X0e=t=>t.updateNodeInternals;function Q0e(){const t=Xt(X0e),[e]=_.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");s.set(o,{id:o,nodeElement:i.target,force:!0})}),t(s)}));return _.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function Z0e({node:t,nodeType:e,hasDimensions:n,resizeObserver:s}){const i=An(),o=_.useRef(null),r=_.useRef(null),a=_.useRef(t.sourcePosition),c=_.useRef(t.targetPosition),d=_.useRef(e),f=n&&!!t.internals.handleBounds;return _.useEffect(()=>{o.current&&!t.hidden&&(!f||r.current!==o.current)&&(r.current&&(s==null||s.unobserve(r.current)),s==null||s.observe(o.current),r.current=o.current)},[f,t.hidden]),_.useEffect(()=>()=>{r.current&&(s==null||s.unobserve(r.current),r.current=null)},[]),_.useEffect(()=>{if(o.current){const p=d.current!==e,m=a.current!==t.sourcePosition,g=c.current!==t.targetPosition;(p||m||g)&&(d.current=e,a.current=t.sourcePosition,c.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:o.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),o}function J0e({id:t,onClick:e,onMouseEnter:n,onMouseMove:s,onMouseLeave:i,onContextMenu:o,onDoubleClick:r,nodesDraggable:a,elementsSelectable:c,nodesConnectable:d,nodesFocusable:f,resizeObserver:p,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:y,rfId:v,nodeTypes:S,nodeClickDistance:w,onError:N}){const{node:C,internals:T,isParent:R}=Xt(Q=>{const se=Q.nodeLookup.get(t),ae=Q.parentLookup.has(t);return{node:se,internals:se.internals,isParent:ae}},Un);let A=C.type||"default",k=(S==null?void 0:S[A])||K5[A];k===void 0&&(N==null||N("003",Lo.error003(A)),A="default",k=(S==null?void 0:S.default)||K5.default);const M=!!(C.draggable||a&&typeof C.draggable>"u"),L=!!(C.selectable||c&&typeof C.selectable>"u"),j=!!(C.connectable||d&&typeof C.connectable>"u"),D=!!(C.focusable||f&&typeof C.focusable>"u"),P=An(),B=Z9(C),I=Z0e({node:C,nodeType:A,hasDimensions:B,resizeObserver:p}),F=Rz({nodeRef:I,disabled:C.hidden||!M,noDragClassName:m,handleSelector:C.dragHandle,nodeId:t,isSelectable:L,nodeClickDistance:w}),z=kz();if(C.hidden)return null;const U=jo(C),H=U0e(C),V=L||M||e||n||s||i,W=n?Q=>n(Q,{...T.userNode}):void 0,G=s?Q=>s(Q,{...T.userNode}):void 0,Y=i?Q=>i(Q,{...T.userNode}):void 0,J=o?Q=>o(Q,{...T.userNode}):void 0,q=r?Q=>r(Q,{...T.userNode}):void 0,X=Q=>{const{selectNodesOnDrag:se,nodeDragThreshold:ae}=P.getState();L&&(!se||!M||ae>0)&&bE({id:t,store:P,nodeRef:I}),e&&e(Q,{...T.userNode})},Z=Q=>{if(!(nz(Q.nativeEvent)||y)){if(U9.includes(Q.key)&&L){const se=Q.key==="Escape";bE({id:t,store:P,unselect:se,nodeRef:I})}else if(M&&C.selected&&Object.prototype.hasOwnProperty.call(hy,Q.key)){Q.preventDefault();const{ariaLabelConfig:se}=P.getState();P.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),z({direction:hy[Q.key],factor:Q.shiftKey?4:1})}}},te=()=>{var ve;if(y||!((ve=I.current)!=null&&ve.matches(":focus-visible")))return;const{transform:Q,width:se,height:ae,autoPanOnNodeFocus:le,setCenter:ne}=P.getState();if(!le)return;sN(new Map([[t,C]]),{x:0,y:0,width:se,height:ae},Q,!0).length>0||ne(C.position.x+U.width/2,C.position.y+U.height/2,{zoom:Q[2]})};return b.jsx("div",{className:ls(["react-flow__node",`react-flow__node-${A}`,{[g]:M},C.className,{selected:C.selected,selectable:L,parent:R,draggable:M,dragging:F}]),ref:I,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:B?"visible":"hidden",...C.style,...H},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:W,onMouseMove:G,onMouseLeave:Y,onContextMenu:J,onClick:X,onDoubleClick:q,onKeyDown:D?Z:void 0,tabIndex:D?0:void 0,onFocus:D?te:void 0,role:C.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Sz}-${v}`,"aria-label":C.ariaLabel,...C.domAttributes,children:b.jsx(M0e,{value:t,children:b.jsx(k,{id:t,data:C.data,type:A,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:C.selected??!1,selectable:L,draggable:M,deletable:C.deletable??!0,isConnectable:j,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:F,dragHandle:C.dragHandle,zIndex:T.z,parentId:C.parentId,...U})})})}var e1e=_.memo(J0e);const t1e=t=>({nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Lz(t){const{nodesConnectable:e,nodesFocusable:n,elementsSelectable:s,onError:i}=Xt(t1e,Un),o=Y0e(t.onlyRenderVisibleElements),r=Q0e();return b.jsx("div",{className:"react-flow__nodes",style:jb,children:o.map(a=>b.jsx(e1e,{id:a,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:r,nodesDraggable:t.nodesDraggable??!0,nodesConnectable:e,nodesFocusable:n,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:i},a))})}Lz.displayName="NodeRenderer";const n1e=_.memo(Lz);function s1e(t){return Xt(_.useCallback(n=>{if(!t)return n.edges.map(i=>i.id);const s=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),r=n.nodeLookup.get(i.target);o&&r&&nge({sourceNode:o,targetNode:r,width:n.width,height:n.height,transform:n.transform})&&s.push(i.id)}return s},[t]),Un)}const i1e=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return b.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},o1e=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return b.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},X5={[uy.Arrow]:i1e,[uy.ArrowClosed]:o1e};function r1e(t){const e=An();return _.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(X5,t)?X5[t]:((o=(i=e.getState()).onError)==null||o.call(i,"009",Lo.error009(t)),null)},[t])}const l1e=({id:t,type:e,color:n,width:s=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:r,orient:a="auto-start-reverse"})=>{const c=r1e(e);return c?b.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:b.jsx(c,{color:n,strokeWidth:r})}):null},Iz=({defaultColor:t,rfId:e})=>{const n=Xt(o=>o.edges),s=Xt(o=>o.defaultEdgeOptions),i=_.useMemo(()=>uge(n,{id:e,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,e,t]);return i.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:i.map(o=>b.jsx(l1e,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Iz.displayName="MarkerDefinitions";var a1e=_.memo(Iz);function Dz({x:t,y:e,label:n,labelStyle:s,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:r=[2,4],labelBgBorderRadius:a=2,children:c,className:d,...f}){const[p,m]=_.useState({x:1,y:0,width:0,height:0}),g=ls(["react-flow__edge-textwrapper",d]),y=_.useRef(null);return _.useEffect(()=>{if(y.current){const v=y.current.getBBox();m({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?b.jsxs("g",{transform:`translate(${t-p.width/2} ${e-p.height/2})`,className:g,visibility:p.width?"visible":"hidden",...f,children:[i&&b.jsx("rect",{width:p.width+2*r[0],x:-r[0],y:-r[1],height:p.height+2*r[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),b.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:y,style:s,children:n}),c]}):null}Dz.displayName="EdgeText";const c1e=_.memo(Dz);function Pb({path:t,labelX:e,labelY:n,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...f}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...f,d:t,fill:"none",className:ls(["react-flow__edge-path",f.className])}),d?b.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,s&&Ro(e)&&Ro(n)?b.jsx(c1e,{x:e,y:n,label:s,labelStyle:i,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Q5({pos:t,x1:e,y1:n,x2:s,y2:i}){return t===Ze.Left||t===Ze.Right?[.5*(e+s),n]:[e,.5*(n+i)]}function jz({sourceX:t,sourceY:e,sourcePosition:n=Ze.Bottom,targetX:s,targetY:i,targetPosition:o=Ze.Top}){const[r,a]=Q5({pos:n,x1:t,y1:e,x2:s,y2:i}),[c,d]=Q5({pos:o,x1:s,y1:i,x2:t,y2:e}),[f,p,m,g]=iz({sourceX:t,sourceY:e,targetX:s,targetY:i,sourceControlX:r,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${t},${e} C${r},${a} ${c},${d} ${s},${i}`,f,p,m,g]}function Pz(t){return _.memo(({id:e,sourceX:n,sourceY:s,targetX:i,targetY:o,sourcePosition:r,targetPosition:a,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,interactionWidth:w})=>{const[N,C,T]=jz({sourceX:n,sourceY:s,sourcePosition:r,targetX:i,targetY:o,targetPosition:a}),R=t.isInternal?void 0:e;return b.jsx(Pb,{id:R,path:N,labelX:C,labelY:T,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,interactionWidth:w})})}const u1e=Pz({isInternal:!1}),zz=Pz({isInternal:!0});u1e.displayName="SimpleBezierEdge";zz.displayName="SimpleBezierEdgeInternal";function Bz(t){return _.memo(({id:e,sourceX:n,sourceY:s,targetX:i,targetY:o,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,sourcePosition:g=Ze.Bottom,targetPosition:y=Ze.Top,markerEnd:v,markerStart:S,pathOptions:w,interactionWidth:N})=>{const[C,T,R]=pE({sourceX:n,sourceY:s,sourcePosition:g,targetX:i,targetY:o,targetPosition:y,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),A=t.isInternal?void 0:e;return b.jsx(Pb,{id:A,path:C,labelX:T,labelY:R,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:S,interactionWidth:N})})}const $z=Bz({isInternal:!1}),Fz=Bz({isInternal:!0});$z.displayName="SmoothStepEdge";Fz.displayName="SmoothStepEdgeInternal";function Hz(t){return _.memo(({id:e,...n})=>{var i;const s=t.isInternal?void 0:e;return b.jsx($z,{...n,id:s,pathOptions:_.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const d1e=Hz({isInternal:!1}),Uz=Hz({isInternal:!0});d1e.displayName="StepEdge";Uz.displayName="StepEdgeInternal";function Vz(t){return _.memo(({id:e,sourceX:n,sourceY:s,targetX:i,targetY:o,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[S,w,N]=lz({sourceX:n,sourceY:s,targetX:i,targetY:o}),C=t.isInternal?void 0:e;return b.jsx(Pb,{id:C,path:S,labelX:w,labelY:N,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:y,interactionWidth:v})})}const f1e=Vz({isInternal:!1}),qz=Vz({isInternal:!0});f1e.displayName="StraightEdge";qz.displayName="StraightEdgeInternal";function Wz(t){return _.memo(({id:e,sourceX:n,sourceY:s,targetX:i,targetY:o,sourcePosition:r=Ze.Bottom,targetPosition:a=Ze.Top,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,pathOptions:w,interactionWidth:N})=>{const[C,T,R]=oz({sourceX:n,sourceY:s,sourcePosition:r,targetX:i,targetY:o,targetPosition:a,curvature:w==null?void 0:w.curvature}),A=t.isInternal?void 0:e;return b.jsx(Pb,{id:A,path:C,labelX:T,labelY:R,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:S,interactionWidth:N})})}const h1e=Wz({isInternal:!1}),Gz=Wz({isInternal:!0});h1e.displayName="BezierEdge";Gz.displayName="BezierEdgeInternal";const Z5={default:Gz,straight:qz,step:Uz,smoothstep:Fz,simplebezier:zz},J5={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},p1e=(t,e,n)=>n===Ze.Left?t-e:n===Ze.Right?t+e:t,m1e=(t,e,n)=>n===Ze.Top?t-e:n===Ze.Bottom?t+e:t,eM="react-flow__edgeupdater";function tM({position:t,centerX:e,centerY:n,radius:s=10,onMouseDown:i,onMouseEnter:o,onMouseOut:r,type:a}){return b.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:r,className:ls([eM,`${eM}-${a}`]),cx:p1e(e,s,t),cy:m1e(n,s,t),r:s,stroke:"transparent",fill:"transparent"})}function g1e({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:s,sourceY:i,targetX:o,targetY:r,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,setReconnecting:m,setUpdateHover:g}){const y=An(),v=(T,R)=>{if(T.button!==0)return;const{autoPanOnConnect:A,domNode:k,connectionMode:M,connectionRadius:L,lib:j,onConnectStart:D,cancelConnection:P,nodeLookup:B,rfId:I,panBy:F,updateConnection:z}=y.getState(),U=R.type==="target",H=(G,Y)=>{m(!1),p==null||p(G,n,R.type,Y)},V=G=>d==null?void 0:d(n,G),W=(G,Y)=>{m(!0),f==null||f(T,n,R.type),D==null||D(G,Y)};yE.onPointerDown(T.nativeEvent,{autoPanOnConnect:A,connectionMode:M,connectionRadius:L,domNode:k,handleId:R.id,nodeId:R.nodeId,nodeLookup:B,isTarget:U,edgeUpdaterType:R.type,lib:j,flowId:I,cancelConnection:P,panBy:F,isValidConnection:(...G)=>{var Y,J;return((J=(Y=y.getState()).isValidConnection)==null?void 0:J.call(Y,...G))??!0},onConnect:V,onConnectStart:W,onConnectEnd:(...G)=>{var Y,J;return(J=(Y=y.getState()).onConnectEnd)==null?void 0:J.call(Y,...G)},onReconnectEnd:H,updateConnection:z,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},S=T=>v(T,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=T=>v(T,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>g(!0),C=()=>g(!1);return b.jsxs(b.Fragment,{children:[(t===!0||t==="source")&&b.jsx(tM,{position:a,centerX:s,centerY:i,radius:e,onMouseDown:S,onMouseEnter:N,onMouseOut:C,type:"source"}),(t===!0||t==="target")&&b.jsx(tM,{position:c,centerX:o,centerY:r,radius:e,onMouseDown:w,onMouseEnter:N,onMouseOut:C,type:"target"})]})}function y1e({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:s,onClick:i,onDoubleClick:o,onContextMenu:r,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,rfId:y,edgeTypes:v,noPanClassName:S,onError:w,disableKeyboardA11y:N}){let C=Xt(ne=>ne.edgeLookup.get(t));const T=Xt(ne=>ne.defaultEdgeOptions);C=T?{...T,...C}:C;let R=C.type||"default",A=(v==null?void 0:v[R])||Z5[R];A===void 0&&(w==null||w("011",Lo.error011(R)),R="default",A=(v==null?void 0:v.default)||Z5.default);const k=!!(C.focusable||e&&typeof C.focusable>"u"),M=typeof p<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),L=!!(C.selectable||s&&typeof C.selectable>"u"),j=_.useRef(null),[D,P]=_.useState(!1),[B,I]=_.useState(!1),F=An(),{zIndex:z=C.zIndex,sourceX:U,sourceY:H,targetX:V,targetY:W,sourcePosition:G,targetPosition:Y}=Xt(_.useCallback(ne=>{const fe=ne.nodeLookup.get(C.source),ve=ne.nodeLookup.get(C.target);if(!fe||!ve)return J5;const we=cge({id:t,sourceNode:fe,targetNode:ve,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:ne.connectionMode,onError:w}),Ce=tge({selected:C.selected,zIndex:C.zIndex,sourceNode:fe,targetNode:ve,elevateOnSelect:ne.elevateEdgesOnSelect,zIndexMode:ne.zIndexMode});return{...we||J5,zIndex:Ce}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex,w]),Un),J=_.useMemo(()=>C.markerStart?`url('#${mE(C.markerStart,y)}')`:void 0,[C.markerStart,y]),q=_.useMemo(()=>C.markerEnd?`url('#${mE(C.markerEnd,y)}')`:void 0,[C.markerEnd,y]);if(C.hidden||U===null||H===null||V===null||W===null)return null;const X=ne=>{var Ce;const{addSelectedEdges:fe,unselectNodesAndEdges:ve,multiSelectionActive:we}=F.getState();L&&(F.setState({nodesSelectionActive:!1}),C.selected&&we?(ve({nodes:[],edges:[C]}),(Ce=j.current)==null||Ce.blur()):fe([t])),i&&i(ne,C)},Z=o?ne=>{o(ne,{...C})}:void 0,te=r?ne=>{r(ne,{...C})}:void 0,Q=a?ne=>{a(ne,{...C})}:void 0,se=c?ne=>{c(ne,{...C})}:void 0,ae=d?ne=>{d(ne,{...C})}:void 0,le=ne=>{var fe;if(!N&&U9.includes(ne.key)&&L){const{unselectNodesAndEdges:ve,addSelectedEdges:we}=F.getState();ne.key==="Escape"?((fe=j.current)==null||fe.blur(),ve({edges:[C]})):we([t])}};return b.jsx("svg",{style:{zIndex:z},children:b.jsxs("g",{className:ls(["react-flow__edge",`react-flow__edge-${R}`,C.className,S,{selected:C.selected,animated:C.animated,inactive:!L&&!i,updating:D,selectable:L}]),onClick:X,onDoubleClick:Z,onContextMenu:te,onMouseEnter:Q,onMouseMove:se,onMouseLeave:ae,onKeyDown:k?le:void 0,tabIndex:k?0:void 0,role:C.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":k?`${wz}-${y}`:void 0,ref:j,...C.domAttributes,children:[!B&&b.jsx(A,{id:t,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:L,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:U,sourceY:H,targetX:V,targetY:W,sourcePosition:G,targetPosition:Y,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:J,markerEnd:q,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),M&&b.jsx(g1e,{edge:C,isReconnectable:M,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,sourceX:U,sourceY:H,targetX:V,targetY:W,sourcePosition:G,targetPosition:Y,setUpdateHover:P,setReconnecting:I})]})})}var b1e=_.memo(y1e);const x1e=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Kz({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:s,noPanClassName:i,onReconnect:o,onEdgeContextMenu:r,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:w,elementsSelectable:N,onError:C}=Xt(x1e,Un),T=s1e(e);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(a1e,{defaultColor:t,rfId:n}),T.map(R=>b.jsx(b1e,{id:R,edgesFocusable:S,edgesReconnectable:w,elementsSelectable:N,noPanClassName:i,onReconnect:o,onContextMenu:r,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,onClick:f,reconnectRadius:p,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:C,edgeTypes:s,disableKeyboardA11y:v},R))]})}Kz.displayName="EdgeRenderer";const v1e=_.memo(Kz),nM=t=>`translate(${t[0]}px,${t[1]}px) scale(${t[2]})`;function S1e({children:t}){const e=An(),n=_.useRef(null),[s]=_.useState(()=>e.getState().transform);return Tz(()=>{let i=null;const o=()=>{const r=e.getState().transform;i&&r[0]===i[0]&&r[1]===i[1]&&r[2]===i[2]||(i=r,n.current&&(n.current.style.transform=nM(r)))};return o(),e.subscribe(o)},[e]),b.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:nM(s)},children:t})}function w1e(t){const e=Db(),n=_.useRef(!1);_.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const E1e=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function C1e(t){const e=Xt(E1e),n=An();return _.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function N1e(t){return t.connection.inProgress?{...t.connection,to:Km(t.connection.to,t.transform)}:{...t.connection}}function T1e(t){return N1e}function O1e(t){const e=T1e();return Xt(e,Un)}const R1e=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function k1e({containerStyle:t,style:e,type:n,component:s}){const{nodesConnectable:i,width:o,height:r,isValid:a,inProgress:c}=Xt(R1e,Un);return!(o&&i&&c)?null:b.jsx("svg",{style:t,width:o,height:r,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:ls(["react-flow__connection",ez(a)]),children:b.jsx(Yz,{style:e,type:n,CustomComponent:s,isValid:a})})})}const Yz=({style:t,type:e=ha.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:i,from:o,fromNode:r,fromHandle:a,fromPosition:c,to:d,toNode:f,toHandle:p,toPosition:m,pointer:g}=O1e();if(!i)return;if(n)return b.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:r,fromHandle:a,fromX:o.x,fromY:o.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:ez(s),toNode:f,toHandle:p,pointer:g});let y="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(e){case ha.Bezier:[y]=oz(v);break;case ha.SimpleBezier:[y]=jz(v);break;case ha.Step:[y]=pE({...v,borderRadius:0});break;case ha.SmoothStep:[y]=pE(v);break;default:[y]=lz(v)}return b.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:t})};Yz.displayName="ConnectionLine";const A1e={};function sM(t=A1e){_.useRef(t),An(),_.useEffect(()=>{},[t])}function _1e(){An(),_.useRef(!1),_.useEffect(()=>{},[])}function Xz({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:s,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:r,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:w,selectionKeyCode:N,selectionOnDrag:C,selectionMode:T,multiSelectionKeyCode:R,panActivationKeyCode:A,zoomActivationKeyCode:k,deleteKeyCode:M,onlyRenderVisibleElements:L,elementsSelectable:j,defaultViewport:D,translateExtent:P,minZoom:B,maxZoom:I,preventScrolling:F,defaultMarkerColor:z,zoomOnScroll:U,zoomOnPinch:H,panOnScroll:V,panOnScrollSpeed:W,panOnScrollMode:G,zoomOnDoubleClick:Y,panOnDrag:J,autoPanOnSelection:q,onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:Q,onPaneScroll:se,onPaneContextMenu:ae,paneClickDistance:le,nodeClickDistance:ne,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:we,onEdgeMouseLeave:Ce,reconnectRadius:ye,onReconnect:Oe,onReconnectStart:be,onReconnectEnd:_e,noDragClassName:Me,noWheelClassName:Be,noPanClassName:He,disableKeyboardA11y:Ae,nodeExtent:Ee,rfId:Ne,viewport:xe,onViewportChange:Pe,nodesDraggable:We}){return sM(t),sM(e),_1e(),w1e(n),C1e(xe),b.jsx(G0e,{onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:Q,onPaneContextMenu:ae,onPaneScroll:se,paneClickDistance:le,deleteKeyCode:M,selectionKeyCode:N,selectionOnDrag:C,selectionMode:T,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:R,panActivationKeyCode:A,zoomActivationKeyCode:k,elementsSelectable:j,zoomOnScroll:U,zoomOnPinch:H,zoomOnDoubleClick:Y,panOnScroll:V,panOnScrollSpeed:W,panOnScrollMode:G,panOnDrag:J,autoPanOnSelection:q,defaultViewport:D,translateExtent:P,minZoom:B,maxZoom:I,onSelectionContextMenu:p,preventScrolling:F,noDragClassName:Me,noWheelClassName:Be,noPanClassName:He,disableKeyboardA11y:Ae,onViewportChange:Pe,isControlledViewport:!!xe,children:b.jsxs(S1e,{children:[b.jsx(v1e,{edgeTypes:e,onEdgeClick:i,onEdgeDoubleClick:r,onReconnect:Oe,onReconnectStart:be,onReconnectEnd:_e,onlyRenderVisibleElements:L,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:we,onEdgeMouseLeave:Ce,reconnectRadius:ye,defaultMarkerColor:z,noPanClassName:He,disableKeyboardA11y:Ae,rfId:Ne}),b.jsx(k1e,{style:v,type:y,component:S,containerStyle:w}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(n1e,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:ne,onlyRenderVisibleElements:L,noPanClassName:He,noDragClassName:Me,disableKeyboardA11y:Ae,nodeExtent:Ee,rfId:Ne,nodesDraggable:We}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xz.displayName="GraphView";const M1e=_.memo(Xz),L1e=Q9(),iM=({nodes:t,edges:e,defaultNodes:n,defaultEdges:s,width:i,height:o,fitView:r,fitViewOptions:a,minZoom:c=.5,maxZoom:d=2,nodeOrigin:f,nodeExtent:p,zIndexMode:m="basic"}={})=>{const g=new Map,y=new Map,v=new Map,S=new Map,w=s??e??[],N=n??t??[],C=f??[0,0],T=p??Vp;uz(v,S,w);const{nodesInitialized:R}=gE(N,g,y,{nodeOrigin:C,nodeExtent:T,zIndexMode:m});let A=[0,0,1];if(r&&i&&o){const k=Wm(g,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:M,y:L,zoom:j}=oN(k,i,o,c,d,(a==null?void 0:a.padding)??.1);A=[M,L,j]}return{rfId:"1",width:i??0,height:o??0,transform:A,nodes:N,nodesInitialized:R,nodeLookup:g,parentLookup:y,edges:w,edgeLookup:S,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:Vp,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:r??!1,fitViewOptions:a,fitViewResolver:null,connection:{...q9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:L1e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:V9,zIndexMode:m,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},I1e=({nodes:t,edges:e,defaultNodes:n,defaultEdges:s,width:i,height:o,fitView:r,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m})=>Wge((g,y)=>{async function v(){const{nodeLookup:S,panZoom:w,fitViewOptions:N,fitViewResolver:C,width:T,height:R,minZoom:A,maxZoom:k}=y();w&&(await Kme({nodes:S,width:T,height:R,panZoom:w,minZoom:A,maxZoom:k},N),C==null||C.resolve(!0),g({fitViewResolver:null}))}return{...iM({nodes:t,edges:e,width:i,height:o,fitView:r,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:p,defaultNodes:n,defaultEdges:s,zIndexMode:m}),setNodes:S=>{const{nodeLookup:w,parentLookup:N,nodeOrigin:C,nodeExtent:T,elevateNodesOnSelect:R,fitViewQueued:A,zIndexMode:k,nodesSelectionActive:M}=y(),{nodesInitialized:L,hasSelectedNodes:j}=gE(S,w,N,{nodeOrigin:C,nodeExtent:T,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:k}),D=M&&j;A&&L?(v(),g({nodes:S,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):g({nodes:S,nodesInitialized:L,nodesSelectionActive:D})},setEdges:S=>{const{connectionLookup:w,edgeLookup:N}=y();uz(w,N,S),g({edges:S})},setDefaultNodesAndEdges:(S,w)=>{if(S){const{setNodes:N}=y();N(S),g({hasDefaultNodes:!0})}if(w){const{setEdges:N}=y();N(w),g({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:w,nodeLookup:N,parentLookup:C,domNode:T,nodeOrigin:R,nodeExtent:A,debug:k,fitViewQueued:M,zIndexMode:L}=y(),{changes:j,updatedInternals:D}=yge(S,N,C,T,R,A,L);D&&(hge(N,C,{nodeOrigin:R,nodeExtent:A,zIndexMode:L}),M?(v(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(j==null?void 0:j.length)>0&&(k&&console.log("React Flow: trigger node changes",j),w==null||w(j)))},updateNodePositions:(S,w=!1)=>{const N=[];let C=[];const{nodeLookup:T,triggerNodeChanges:R,connection:A,updateConnection:k,onNodesChangeMiddlewareMap:M}=y();for(const[L,j]of S){const D=T.get(L),P=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(j!=null&&j.position)),B={id:L,type:"position",position:P?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:w};if(D&&A.inProgress&&A.fromNode.id===D.id){const I=mu(D,A.fromHandle,Ze.Left,!0);k({...A,from:I})}P&&D.parentId&&N.push({id:L,parentId:D.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),C.push(B)}if(N.length>0){const{parentLookup:L,nodeOrigin:j}=y(),D=dN(N,T,L,j);C.push(...D)}for(const L of M.values())C=L(C);R(C)},triggerNodeChanges:S=>{const{onNodesChange:w,setNodes:N,nodes:C,hasDefaultNodes:T,debug:R}=y();if(S!=null&&S.length){if(T){const A=h0e(S,C);N(A)}R&&console.log("React Flow: trigger node changes",S),w==null||w(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:w,setEdges:N,edges:C,hasDefaultEdges:T,debug:R}=y();if(S!=null&&S.length){if(T){const A=p0e(S,C);N(A)}R&&console.log("React Flow: trigger edge changes",S),w==null||w(S)}},addSelectedNodes:S=>{const{multiSelectionActive:w,edgeLookup:N,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:R}=y();if(w){const A=S.map(k=>Dc(k,!0));T(A);return}T(Ld(C,new Set([...S]),!0)),R(Ld(N))},addSelectedEdges:S=>{const{multiSelectionActive:w,edgeLookup:N,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:R}=y();if(w){const A=S.map(k=>Dc(k,!0));R(A);return}R(Ld(N,new Set([...S]))),T(Ld(C,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:w}={})=>{const{edges:N,nodes:C,nodeLookup:T,triggerNodeChanges:R,triggerEdgeChanges:A}=y(),k=S||C,M=w||N,L=[];for(const D of k){if(!D.selected)continue;const P=T.get(D.id);P&&(P.selected=!1),L.push(Dc(D.id,!1))}const j=[];for(const D of M)D.selected&&j.push(Dc(D.id,!1));R(L),A(j)},setMinZoom:S=>{const{panZoom:w,maxZoom:N}=y();w==null||w.setScaleExtent([S,N]),g({minZoom:S})},setMaxZoom:S=>{const{panZoom:w,minZoom:N}=y();w==null||w.setScaleExtent([N,S]),g({maxZoom:S})},setTranslateExtent:S=>{var w;(w=y().panZoom)==null||w.setTranslateExtent(S),g({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:w,triggerNodeChanges:N,triggerEdgeChanges:C,elementsSelectable:T}=y();if(!T)return;const R=w.reduce((k,M)=>M.selected?[...k,Dc(M.id,!1)]:k,[]),A=S.reduce((k,M)=>M.selected?[...k,Dc(M.id,!1)]:k,[]);N(R),C(A)},setNodeExtent:S=>{const{nodes:w,nodeLookup:N,parentLookup:C,nodeOrigin:T,elevateNodesOnSelect:R,nodeExtent:A,zIndexMode:k}=y();S[0][0]===A[0][0]&&S[0][1]===A[0][1]&&S[1][0]===A[1][0]&&S[1][1]===A[1][1]||(gE(w,N,C,{nodeOrigin:T,nodeExtent:S,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:k}),g({nodeExtent:S}))},panBy:S=>{const{transform:w,width:N,height:C,panZoom:T,translateExtent:R}=y();return bge({delta:S,panZoom:T,transform:w,translateExtent:R,width:N,height:C})},setCenter:async(S,w,N)=>{const{width:C,height:T,maxZoom:R,panZoom:A}=y();if(!A)return!1;const k=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:R;return await A.setViewport({x:C/2-S*k,y:T/2-w*k,zoom:k},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),!0},cancelConnection:()=>{g({connection:{...q9}})},updateConnection:S=>{g({connection:S})},reset:()=>g({...iM()})}},Object.is);function Qz({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:s,initialWidth:i,initialHeight:o,initialMinZoom:r,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:g}){const[y]=_.useState(()=>I1e({nodes:t,edges:e,defaultNodes:n,defaultEdges:s,width:i,height:o,fitView:d,minZoom:r,maxZoom:a,fitViewOptions:c,nodeOrigin:f,nodeExtent:p,zIndexMode:m}));return b.jsx(Gge,{value:y,children:b.jsx(x0e,{children:b.jsx(I0e,{children:g})})})}function D1e({children:t,nodes:e,edges:n,defaultNodes:s,defaultEdges:i,width:o,height:r,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:g}){return _.useContext(Lb)?b.jsx(b.Fragment,{children:t}):b.jsx(Qz,{initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:i,initialWidth:o,initialHeight:r,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:g,children:t})}const j1e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function P1e({nodes:t,edges:e,defaultNodes:n,defaultEdges:s,className:i,nodeTypes:o,edgeTypes:r,onNodeClick:a,onEdgeClick:c,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:m,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:w,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:A,onNodeDragStart:k,onNodeDrag:M,onNodeDragStop:L,onNodesDelete:j,onEdgesDelete:D,onDelete:P,onSelectionChange:B,onSelectionDragStart:I,onSelectionDrag:F,onSelectionDragStop:z,onSelectionContextMenu:U,onSelectionStart:H,onSelectionEnd:V,onBeforeDelete:W,connectionMode:G,connectionLineType:Y=ha.Bezier,connectionLineStyle:J,connectionLineComponent:q,connectionLineContainerStyle:X,deleteKeyCode:Z="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:Q=!1,selectionMode:se=qp.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:le=Gp()?"Meta":"Control",zoomActivationKeyCode:ne=Gp()?"Meta":"Control",snapToGrid:fe,snapGrid:ve,onlyRenderVisibleElements:we=!1,selectNodesOnDrag:Ce,nodesDraggable:ye,autoPanOnNodeFocus:Oe,nodesConnectable:be,nodesFocusable:_e,nodeOrigin:Me=Ez,edgesFocusable:Be,edgesReconnectable:He,elementsSelectable:Ae=!0,defaultViewport:Ee=r0e,minZoom:Ne=.5,maxZoom:xe=2,translateExtent:Pe=Vp,preventScrolling:We=!0,nodeExtent:et,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:ze=!0,zoomOnPinch:Te=!0,panOnScroll:qe=!1,panOnScrollSpeed:ot=.5,panOnScrollMode:bt=tu.Free,zoomOnDoubleClick:Ct=!0,panOnDrag:En=!0,onPaneClick:Mt,onPaneMouseEnter:jt,onPaneMouseMove:rn,onPaneMouseLeave:Cn,onPaneScroll:nn,onPaneContextMenu:st,paneClickDistance:St=1,nodeClickDistance:dn=0,children:rt,onReconnect:Wt,onReconnectStart:_t,onReconnectEnd:It,onEdgeContextMenu:Zt,onEdgeDoubleClick:Nn,onEdgeMouseEnter:bn,onEdgeMouseMove:ln,onEdgeMouseLeave:$e,reconnectRadius:Tt=10,onNodesChange:Gt,onEdgesChange:Ie,noDragClassName:Xe="nodrag",noWheelClassName:mt="nowheel",noPanClassName:jn="nopan",fitView:po,fitViewOptions:Es,connectOnClick:zo,attributionPosition:Ni,proOptions:Cl,defaultEdgeOptions:Ti,elevateNodesOnSelect:Nl=!0,elevateEdgesOnSelect:br=!1,disableKeyboardA11y:mo=!1,autoPanOnConnect:fi,autoPanOnNodeDrag:hi,autoPanOnSelection:xr=!0,autoPanSpeed:Pn,connectionRadius:Rn,isValidConnection:as,onError:Ys,style:sc,id:vr,nodeDragThreshold:Tl,connectionDragThreshold:Bo,viewport:Sr,onViewportChange:Ol,width:Rl,height:Oi,colorMode:wr="light",debug:me,onScroll:Le,ariaLabelConfig:De,zIndexMode:Je="basic",...gt},pt){const wt=vr||"1",an=u0e(wr),tn=_.useCallback(lt=>{lt.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Le==null||Le(lt)},[Le]);return b.jsx("div",{"data-testid":"rf__wrapper",...gt,onScroll:tn,style:{...sc,...j1e},ref:pt,className:ls(["react-flow",i,an]),id:vr,role:"application",children:b.jsxs(D1e,{nodes:t,edges:e,width:Rl,height:Oi,fitView:po,fitViewOptions:Es,minZoom:Ne,maxZoom:xe,nodeOrigin:Me,nodeExtent:et,zIndexMode:Je,children:[b.jsx(c0e,{nodes:t,edges:e,defaultNodes:n,defaultEdges:s,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:w,nodesDraggable:ye,autoPanOnNodeFocus:Oe,nodesConnectable:be,nodesFocusable:_e,edgesFocusable:Be,edgesReconnectable:He,elementsSelectable:Ae,elevateNodesOnSelect:Nl,elevateEdgesOnSelect:br,minZoom:Ne,maxZoom:xe,nodeExtent:et,onNodesChange:Gt,onEdgesChange:Ie,snapToGrid:fe,snapGrid:ve,connectionMode:G,translateExtent:Pe,connectOnClick:zo,defaultEdgeOptions:Ti,fitView:po,fitViewOptions:Es,onNodesDelete:j,onEdgesDelete:D,onDelete:P,onNodeDragStart:k,onNodeDrag:M,onNodeDragStop:L,onSelectionDrag:F,onSelectionDragStart:I,onSelectionDragStop:z,onMove:f,onMoveStart:p,onMoveEnd:m,noPanClassName:jn,nodeOrigin:Me,rfId:wt,autoPanOnConnect:fi,autoPanOnNodeDrag:hi,autoPanSpeed:Pn,onError:Ys,connectionRadius:Rn,isValidConnection:as,selectNodesOnDrag:Ce,nodeDragThreshold:Tl,connectionDragThreshold:Bo,onBeforeDelete:W,debug:me,ariaLabelConfig:De,zIndexMode:Je}),b.jsx(M1e,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:R,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:r,connectionLineType:Y,connectionLineStyle:J,connectionLineComponent:q,connectionLineContainerStyle:X,selectionKeyCode:te,selectionOnDrag:Q,selectionMode:se,deleteKeyCode:Z,multiSelectionKeyCode:le,panActivationKeyCode:ae,zoomActivationKeyCode:ne,onlyRenderVisibleElements:we,defaultViewport:Ee,translateExtent:Pe,minZoom:Ne,maxZoom:xe,preventScrolling:We,zoomOnScroll:ze,zoomOnPinch:Te,zoomOnDoubleClick:Ct,panOnScroll:qe,panOnScrollSpeed:ot,panOnScrollMode:bt,panOnDrag:En,autoPanOnSelection:xr,onPaneClick:Mt,onPaneMouseEnter:jt,onPaneMouseMove:rn,onPaneMouseLeave:Cn,onPaneScroll:nn,onPaneContextMenu:st,paneClickDistance:St,nodeClickDistance:dn,onSelectionContextMenu:U,onSelectionStart:H,onSelectionEnd:V,onReconnect:Wt,onReconnectStart:_t,onReconnectEnd:It,onEdgeContextMenu:Zt,onEdgeDoubleClick:Nn,onEdgeMouseEnter:bn,onEdgeMouseMove:ln,onEdgeMouseLeave:$e,reconnectRadius:Tt,defaultMarkerColor:At,noDragClassName:Xe,noWheelClassName:mt,noPanClassName:jn,rfId:wt,disableKeyboardA11y:mo,nodeExtent:et,viewport:Sr,onViewportChange:Ol,nodesDraggable:ye}),b.jsx(o0e,{onSelectionChange:B}),rt,b.jsx(e0e,{proOptions:Cl,position:Ni}),b.jsx(Jge,{rfId:wt,disableKeyboardA11y:mo})]})})}var z1e=Nz(P1e);function B1e({dimensions:t,lineWidth:e,variant:n,className:s}){return b.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ls(["react-flow__background-pattern",n,s])})}function $1e({radius:t,className:e}){return b.jsx("circle",{cx:t,cy:t,r:t,className:ls(["react-flow__background-pattern","dots",e])})}var _a;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(_a||(_a={}));const F1e={[_a.Dots]:1,[_a.Lines]:1,[_a.Cross]:6},H1e=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Zz({id:t,variant:e=_a.Dots,gap:n=20,size:s,lineWidth:i=1,offset:o=0,color:r,bgColor:a,style:c,className:d,patternClassName:f}){const p=_.useRef(null),{transform:m,patternId:g}=Xt(H1e,Un),y=s||F1e[e],v=e===_a.Dots,S=e===_a.Cross,w=Array.isArray(n)?n:[n,n],N=[w[0]*m[2]||1,w[1]*m[2]||1],C=y*m[2],T=Array.isArray(o)?o:[o,o],R=S?[C,C]:N,A=[T[0]*m[2]+R[0]/2,T[1]*m[2]+R[1]/2],k=`${g}${t||""}`;return b.jsxs("svg",{className:ls(["react-flow__background",d]),style:{...c,...jb,"--xy-background-color-props":a,"--xy-background-pattern-color-props":r},ref:p,"data-testid":"rf__background",children:[b.jsx("pattern",{id:k,x:m[0]%N[0],y:m[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:v?b.jsx($1e,{radius:C/2,className:f}):b.jsx(B1e,{dimensions:R,lineWidth:i,variant:e,className:f})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}Zz.displayName="Background";_.memo(Zz);function U1e(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function V1e(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function q1e(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function W1e(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function G1e(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function e1({children:t,className:e,...n}){return b.jsx("button",{type:"button",className:ls(["react-flow__controls-button",e]),...n,children:t})}const K1e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Jz({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:r,onFitView:a,onInteractiveChange:c,className:d,children:f,position:p="bottom-left",orientation:m="vertical","aria-label":g}){const y=An(),{isInteractive:v,minZoomReached:S,maxZoomReached:w,ariaLabelConfig:N}=Xt(K1e,Un),{zoomIn:C,zoomOut:T,fitView:R}=Db(),A=()=>{C(),o==null||o()},k=()=>{T(),r==null||r()},M=()=>{R(i),a==null||a()},L=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},j=m==="horizontal"?"horizontal":"vertical";return b.jsxs(Ib,{className:ls(["react-flow__controls",j,d]),position:p,style:t,"data-testid":"rf__controls","aria-label":g??N["controls.ariaLabel"],children:[e&&b.jsxs(b.Fragment,{children:[b.jsx(e1,{onClick:A,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:w,children:b.jsx(U1e,{})}),b.jsx(e1,{onClick:k,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:S,children:b.jsx(V1e,{})})]}),n&&b.jsx(e1,{className:"react-flow__controls-fitview",onClick:M,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:b.jsx(q1e,{})}),s&&b.jsx(e1,{className:"react-flow__controls-interactive",onClick:L,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:v?b.jsx(G1e,{}):b.jsx(W1e,{})}),f]})}Jz.displayName="Controls";_.memo(Jz);function Y1e({id:t,x:e,y:n,width:s,height:i,style:o,color:r,strokeColor:a,strokeWidth:c,className:d,borderRadius:f,shapeRendering:p,selected:m,onClick:g}){const{background:y,backgroundColor:v}=o||{},S=r||y||v;return b.jsx("rect",{className:ls(["react-flow__minimap-node",{selected:m},d]),x:e,y:n,rx:f,ry:f,width:s,height:i,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:g?w=>g(w,t):void 0})}const X1e=_.memo(Y1e),Q1e=t=>t.nodes.map(e=>e.id),gS=t=>t instanceof Function?t:()=>t;function Z1e({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:o=X1e,onClick:r}){const a=Xt(Q1e,Un),c=gS(e),d=gS(t),f=gS(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:a.map(m=>b.jsx(eye,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:f,nodeBorderRadius:s,nodeStrokeWidth:i,NodeComponent:o,onClick:r,shapeRendering:p},m))})}function J1e({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:r,NodeComponent:a,onClick:c}){const{node:d,x:f,y:p,width:m,height:g}=Xt(y=>{const v=y.nodeLookup.get(t);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const S=v.internals.userNode,{x:w,y:N}=v.internals.positionAbsolute,{width:C,height:T}=jo(S);return{node:S,x:w,y:N,width:C,height:T}},Un);return!d||d.hidden||!Z9(d)?null:b.jsx(a,{x:f,y:p,width:m,height:g,style:d.style,selected:!!d.selected,className:s(d),color:e(d),borderRadius:i,strokeColor:n(d),strokeWidth:o,shapeRendering:r,onClick:c,id:d.id})}const eye=_.memo(J1e);var tye=_.memo(Z1e);const nye=200,sye=150,iye=t=>!t.hidden,oye=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};let n=!1;for(const s of t.nodeLookup.values())if(!s.hidden){n=!0;break}return{viewBB:e,boundingRect:n?Y9(Wm(t.nodeLookup,{filter:iye}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},oM=(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,rye=(t,e)=>oM(t.viewBB,e.viewBB)&&oM(t.boundingRect,e.boundingRect)&&t.rfId===e.rfId&&t.panZoom===e.panZoom&&t.translateExtent===e.translateExtent&&t.flowWidth===e.flowWidth&&t.flowHeight===e.flowHeight&&t.ariaLabelConfig===e.ariaLabelConfig,lye="react-flow__minimap-desc";function eB({style:t,className:e,nodeStrokeColor:n,nodeColor:s,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a,bgColor:c,maskColor:d,maskStrokeColor:f,maskStrokeWidth:p,position:m="bottom-right",onClick:g,onNodeClick:y,pannable:v=!1,zoomable:S=!1,ariaLabel:w,inversePan:N,zoomStep:C=1,offsetScale:T=5}){const R=An(),A=_.useRef(null),{boundingRect:k,panZoom:M,viewBB:L,rfId:j,translateExtent:D,flowWidth:P,flowHeight:B,ariaLabelConfig:I}=Xt(oye,rye),F=(t==null?void 0:t.width)??nye,z=(t==null?void 0:t.height)??sye,U=k.width/F,H=k.height/z,V=Math.max(U,H),W=V*F,G=V*z,Y=T*V,J=k.x-(W-k.width)/2-Y,q=k.y-(G-k.height)/2-Y,X=W+Y*2,Z=G+Y*2,te=`${lye}-${j}`,Q=_.useRef(0),se=_.useRef();Q.current=V,_.useEffect(()=>{const ve=R.getState().panZoom;if(A.current&&ve)return se.current=Oge({domNode:A.current,panZoom:ve,getTransform:()=>R.getState().transform,getViewScale:()=>Q.current}),()=>{var we;(we=se.current)==null||we.destroy()}},[M]),_.useEffect(()=>{var ve;(ve=se.current)==null||ve.update({translateExtent:D,width:P,height:B,inversePan:N,pannable:v,zoomStep:C,zoomable:S})},[v,S,N,C,D,P,B]);const ae=g?ve=>{var ye;const[we,Ce]=((ye=se.current)==null?void 0:ye.pointer(ve))||[0,0];g(ve,{x:we,y:Ce})}:void 0,le=_.useCallback((ve,we)=>{const Ce=R.getState().nodeLookup.get(we).internals.userNode;y==null||y(ve,Ce)},[y]),ne=y?le:void 0,fe=w??I["minimap.ariaLabel"];return b.jsx(Ib,{position:m,style:{...t,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*V:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:ls(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:F,height:z,viewBox:`${J} ${q} ${X} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:A,onClick:ae,children:[fe&&b.jsx("title",{id:te,children:fe}),b.jsx(tye,{onClick:ne,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:r,nodeComponent:a}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${J-Y},${q-Y}h${X+Y*2}v${Z+Y*2}h${-X-Y*2}z
365
+ M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}eB.displayName="MiniMap";_.memo(eB);const aye=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,cye={[wf.Line]:"right",[wf.Handle]:"bottom-right"};function uye({nodeId:t,position:e,variant:n=wf.Handle,className:s,style:i=void 0,children:o,color:r,minWidth:a=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:g=!0,shouldResize:y,onResizeStart:v,onResize:S,onResizeEnd:w}){const N=Az(),C=typeof t=="string"?t:N,T=An(),R=_.useRef(null),A=n===wf.Handle,k=Xt(_.useCallback(aye(A&&g),[A,g]),Un),M=_.useRef(null),L=e??cye[n];_.useEffect(()=>{if(!(!R.current||!C))return M.current||(M.current=$ge({domNode:R.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:D,transform:P,snapGrid:B,snapToGrid:I,nodeOrigin:F,domNode:z}=T.getState();return{nodeLookup:D,transform:P,snapGrid:B,snapToGrid:I,nodeOrigin:F,paneDomNode:z}},onChange:(D,P)=>{const{triggerNodeChanges:B,nodeLookup:I,parentLookup:F,nodeOrigin:z}=T.getState(),U=[],H={x:D.x,y:D.y},V=I.get(C);if(V&&V.expandParent&&V.parentId){const W=V.origin??z,G=D.width??V.measured.width??0,Y=D.height??V.measured.height??0,J={id:V.id,parentId:V.parentId,rect:{width:G,height:Y,...J9({x:D.x??V.position.x,y:D.y??V.position.y},{width:G,height:Y},V.parentId,I,W)}},q=dN([J],I,F,z);U.push(...q),H.x=D.x?Math.max(W[0]*G,D.x):void 0,H.y=D.y?Math.max(W[1]*Y,D.y):void 0}if(H.x!==void 0&&H.y!==void 0){const W={id:C,type:"position",position:{...H}};U.push(W)}if(D.width!==void 0&&D.height!==void 0){const G={id:C,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};U.push(G)}for(const W of P){const G={...W,type:"position"};U.push(G)}B(U)},onEnd:({width:D,height:P})=>{const B={id:C,type:"dimensions",resizing:!1,dimensions:{width:D,height:P}};T.getState().triggerNodeChanges([B])}})),M.current.update({controlPosition:L,boundaries:{minWidth:a,minHeight:c,maxWidth:d,maxHeight:f},keepAspectRatio:p,resizeDirection:m,onResizeStart:v,onResize:S,onResizeEnd:w,shouldResize:y}),()=>{var D;(D=M.current)==null||D.destroy()}},[L,a,c,d,f,p,v,S,w,y]);const j=L.split("-");return b.jsx("div",{className:ls(["react-flow__resize-control","nodrag",...j,n,s]),ref:R,style:{...i,scale:k,...r&&{[A?"backgroundColor":"borderColor"]:r}},children:o})}_.memo(uye);const dye="Cancel",fye=t=>{const e=ee.c(23),{title:n,description:s,confirmLabel:i,onConfirm:o,onCancel:r}=t;let a;e[0]!==r?(a=S=>{S||r()},e[0]=r,e[1]=a):a=e[1];let c;e[2]!==n?(c=b.jsx(vl,{children:n}),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==s?(d=b.jsx(Sl,{children:s}),e[4]=s,e[5]=d):d=e[5];let f;e[6]!==c||e[7]!==d?(f=b.jsxs(bl,{children:[c,d]}),e[6]=c,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==r?(p=b.jsx(ft,{type:"button",variant:"ghost",onClick:r,children:dye}),e[9]=r,e[10]=p):p=e[10];let m;e[11]!==i||e[12]!==o?(m=b.jsx(ft,{type:"button",variant:"destructive",onClick:o,children:i}),e[11]=i,e[12]=o,e[13]=m):m=e[13];let g;e[14]!==p||e[15]!==m?(g=b.jsxs(xl,{children:[p,m]}),e[14]=p,e[15]=m,e[16]=g):g=e[16];let y;e[17]!==f||e[18]!==g?(y=b.jsxs(yl,{showCloseButton:!1,children:[f,g]}),e[17]=f,e[18]=g,e[19]=y):y=e[19];let v;return e[20]!==a||e[21]!==y?(v=b.jsx(gl,{open:!0,onOpenChange:a,children:y}),e[20]=a,e[21]=y,e[22]=v):v=e[22],v},hye={trigger:"",call:"",value:"[stroke-dasharray:7_5]",data:"[stroke-dasharray:1_6] [stroke-linecap:round]"},pye="M1 1 9 5 1 9z",mye="fill-current stroke-current [stroke-linejoin:round] [stroke-width:1.5]",gye="fill-background stroke-current [stroke-linejoin:round] [stroke-width:1.5]",yye=["selected","hovered"],tB={selected:"text-primary",hovered:"text-primary/60"},nB=(t,e)=>e===null?t:`${t}-${e}`,rM=t=>{const e=ee.c(9),{baseId:n,isAssumed:s,emphasis:i}=t;let o;e[0]!==n||e[1]!==i?(o=nB(n,i),e[0]=n,e[1]=i,e[2]=o):o=e[2];const r=i===null?void 0:tB[i],a=s?gye:mye;let c;e[3]!==a?(c=b.jsx("path",{d:pye,className:a}),e[3]=a,e[4]=c):c=e[4];let d;return e[5]!==o||e[6]!==r||e[7]!==c?(d=b.jsx("marker",{id:o,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",className:r,children:c}),e[5]=o,e[6]=r,e[7]=c,e[8]=d):d=e[8],d},bye="fill-none stroke-current [stroke-linejoin:round] [stroke-width:2]",xye=()=>{const t=ee.c(3),e=_.useId(),n=`${e}-proven`,s=`${e}-assumed`;let i;return t[0]!==n||t[1]!==s?(i={proven:n,assumed:s},t[0]=n,t[1]=s,t[2]=i):i=t[2],i},vye=t=>{const e=ee.c(3),{markers:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[null,...yye],e[0]=s):s=e[0];let i;return e[1]!==n?(i=b.jsx("defs",{children:s.map(o=>b.jsxs(_.Fragment,{children:[b.jsx(rM,{baseId:n.proven,isAssumed:!1,emphasis:o}),b.jsx(rM,{baseId:n.assumed,isAssumed:!0,emphasis:o})]},o??"plain"))}),e[1]=n,e[2]=i):i=e[2],i},Sye=t=>{const e=ee.c(15),{path:n,kind:s,isAssumed:i,emphasis:o,hasArrow:r,markers:a}=t,c=o===void 0?null:o,d=r===void 0?!0:r,f=c??void 0;let p;e[0]!==c||e[1]!==d||e[2]!==i||e[3]!==a?(p=d?`url(#${nB(i?a.assumed:a.proven,c)})`:void 0,e[0]=c,e[1]=d,e[2]=i,e[3]=a,e[4]=p):p=e[4];const m=hye[s],g=c!==null&&tB[c];let y;e[5]!==m||e[6]!==g?(y=Se(bye,m,"transition-colors duration-[180ms] ease-out",g),e[5]=m,e[6]=g,e[7]=y):y=e[7];let v;return e[8]!==i||e[9]!==s||e[10]!==n||e[11]!==f||e[12]!==p||e[13]!==y?(v=b.jsx("path",{d:n,"data-kind":s,"data-assumed":i,"data-emphasis":f,markerEnd:p,className:y}),e[8]=i,e[9]=s,e[10]=n,e[11]=f,e[12]=p,e[13]=y,e[14]=v):v=e[14],v},wye={},Eye="Show",Cye="Hide",Nye="my-1.5 mr-4 ml-28 flex max-w-[52rem] flex-col gap-3 rounded-md border border-input bg-card p-3 font-sans whitespace-normal",sB="text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",Tye=()=>{},hN=t=>{const e=ee.c(40),{label:n,submitLabel:s,postNowLabel:i,cancelLabel:o,hint:r,isSubmitting:a,shouldFocus:c,className:d,renderEditor:f,onSubmit:p,onPostNow:m,onCancel:g}=t,y=i===void 0?null:i,v=r===void 0?null:r,S=c===void 0?!1:c,[w,N]=_.useState(""),[C,T]=_.useState(0);let R;e[0]!==w||e[1]!==a?(R=a||w.trim()==="",e[0]=w,e[1]=a,e[2]=R):R=e[2];const A=R;let k;e[3]!==w?(k=V=>{V(w.trim()),N(""),T(Rye)},e[3]=w,e[4]=k):k=e[4];const M=k;let L;e[5]!==d?(L=Se("flex flex-col gap-2",d),e[5]=d,e[6]=L):L=e[6];let j;e[7]!==p||e[8]!==M?(j=V=>{V.preventDefault(),M(p)},e[7]=p,e[8]=M,e[9]=j):j=e[9];let D;e[10]!==n||e[11]!==f||e[12]!==S?(D=f({label:n,shouldFocus:S,onChange:N}),e[10]=n,e[11]=f,e[12]=S,e[13]=D):D=e[13];let P;e[14]!==C||e[15]!==D?(P=b.jsx("div",{children:D},C),e[14]=C,e[15]=D,e[16]=P):P=e[16];let B;e[17]!==v?(B=v===null?null:b.jsx("p",{className:"mr-auto text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=B):B=e[18];let I;e[19]!==o||e[20]!==g?(I=o===null||g===void 0?null:b.jsx(ft,{type:"button",variant:"ghost",size:"sm",onClick:g,children:o}),e[19]=o,e[20]=g,e[21]=I):I=e[21];let F;e[22]!==A||e[23]!==m||e[24]!==y||e[25]!==M?(F=y===null||m===void 0?null:b.jsx(ft,{type:"button",variant:"outline",size:"sm",disabled:A,onClick:()=>{M(m)},children:y}),e[22]=A,e[23]=m,e[24]=y,e[25]=M,e[26]=F):F=e[26];let z;e[27]!==A||e[28]!==s?(z=b.jsx(ft,{type:"submit",size:"sm",disabled:A,children:s}),e[27]=A,e[28]=s,e[29]=z):z=e[29];let U;e[30]!==B||e[31]!==I||e[32]!==F||e[33]!==z?(U=b.jsxs("div",{className:"flex items-center justify-end gap-2",children:[B,I,F,z]}),e[30]=B,e[31]=I,e[32]=F,e[33]=z,e[34]=U):U=e[34];let H;return e[35]!==U||e[36]!==L||e[37]!==j||e[38]!==P?(H=b.jsxs("form",{className:L,onSubmit:j,children:[P,U]}),e[35]=U,e[36]=L,e[37]=j,e[38]=P,e[39]=H):H=e[39],H},iB=t=>{const e=ee.c(36),{comment:n,verdictLabel:s,locationLabel:i,isActionPending:o,className:r,onDiscard:a}=t,c=s===void 0?null:s,d=i===void 0?null:i,f=o===void 0?!1:o;let p;e[0]!==r?(p=Se("grid grid-cols-[1.75rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-sm",r),e[0]=r,e[1]=p):p=e[1];let m;e[2]!==n.author.avatarUrl||e[3]!==n.author.monogram?(m=b.jsx(Hf,{imageUrl:n.author.avatarUrl,monogram:n.author.monogram,className:"mt-0.5 size-6"}),e[2]=n.author.avatarUrl,e[3]=n.author.monogram,e[4]=m):m=e[4];let g;e[5]!==n.author.name?(g=b.jsx("span",{className:"font-bold",children:n.author.name}),e[5]=n.author.name,e[6]=g):g=e[6];let y;e[7]!==c?(y=c===null?null:b.jsx("span",{children:c}),e[7]=c,e[8]=y):y=e[8];let v;e[9]!==n.timeLabel?(v=b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:n.timeLabel}),e[9]=n.timeLabel,e[10]=v):v=e[10];let S;e[11]!==n.pendingLabel?(S=n.pendingLabel===null?null:b.jsx("span",{className:"text-xs font-bold text-signal-text",children:n.pendingLabel}),e[11]=n.pendingLabel,e[12]=S):S=e[12];let w;e[13]!==n.discardLabel||e[14]!==n.id||e[15]!==f||e[16]!==a?(w=n.discardLabel===null||a===void 0?null:b.jsx("button",{type:"button",disabled:f,className:sB,onClick:()=>{a(n.id)},children:n.discardLabel}),e[13]=n.discardLabel,e[14]=n.id,e[15]=f,e[16]=a,e[17]=w):w=e[17];let N;e[18]!==w||e[19]!==g||e[20]!==y||e[21]!==v||e[22]!==S?(N=b.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2",children:[g,y,v,S,w]}),e[18]=w,e[19]=g,e[20]=y,e[21]=v,e[22]=S,e[23]=N):N=e[23];let C;e[24]!==d?(C=d===null?null:b.jsx("p",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:d}),e[24]=d,e[25]=C):C=e[25];let T;e[26]!==n.body?(T=b.jsx(ho,{blocks:n.body,codeLinks:wye,onOpenCodeLink:Tye}),e[26]=n.body,e[27]=T):T=e[27];let R;e[28]!==N||e[29]!==C||e[30]!==T?(R=b.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[N,C,T]}),e[28]=N,e[29]=C,e[30]=T,e[31]=R):R=e[31];let A;return e[32]!==R||e[33]!==p||e[34]!==m?(A=b.jsxs("article",{className:p,children:[m,R]}),e[32]=R,e[33]=p,e[34]=m,e[35]=A):A=e[35],A},Oye=t=>{const e=ee.c(33),{comments:n,label:s,rangeLabel:i,statusLabel:o,resolution:r,canReply:a,replyPlaceholder:c,submitLabel:d,cancelLabel:f,isSubmitting:p,renderEditor:m,onReply:g,onResolve:y,onDiscard:v}=t,[S,w]=_.useState(!1),[N,C]=_.useState(!1),T=o!==null&&!N;let R;e[0]!==T||e[1]!==i||e[2]!==o?(R=i===null&&o===null?null:b.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-3 text-xs text-muted-foreground",children:[i===null?null:b.jsx("span",{className:"tabular-nums",children:i}),o===null?null:b.jsx("span",{className:"font-bold text-foreground",children:o}),o===null?null:b.jsx("button",{type:"button","aria-expanded":!T,className:sB,onClick:()=>{C(kye)},children:T?Eye:Cye})]}),e[0]=T,e[1]=i,e[2]=o,e[3]=R):R=e[3];let A;e[4]!==n||e[5]!==T||e[6]!==p||e[7]!==v?(A=T?null:n.map(j=>b.jsx(iB,{comment:j,isActionPending:p,onDiscard:v},j.id)),e[4]=n,e[5]=T,e[6]=p,e[7]=v,e[8]=A):A=e[8];let k;e[9]!==f||e[10]!==T||e[11]!==S||e[12]!==p||e[13]!==s||e[14]!==g||e[15]!==m||e[16]!==c||e[17]!==d?(k=T||!S?null:b.jsx(hN,{label:`${c}, ${s}`,submitLabel:d,cancelLabel:f,isSubmitting:p,shouldFocus:!0,className:"pl-9",renderEditor:m,onSubmit:j=>{g(j),w(!1)},onCancel:()=>{w(!1)}}),e[9]=f,e[10]=T,e[11]=S,e[12]=p,e[13]=s,e[14]=g,e[15]=m,e[16]=c,e[17]=d,e[18]=k):k=e[18];let M;e[19]!==a||e[20]!==T||e[21]!==S||e[22]!==p||e[23]!==y||e[24]!==c||e[25]!==r?(M=T||S||!a&&r===null?null:b.jsxs("div",{className:"ml-9 flex flex-wrap items-center gap-3",children:[a?b.jsx("button",{type:"button",className:"h-8 min-w-48 flex-1 rounded-lg border border-input bg-background px-2.5 text-left text-sm text-muted-foreground hover:bg-muted",onClick:()=>{w(!0)},children:c}):null,r===null?null:b.jsx(ft,{type:"button",variant:"outline",size:"sm",disabled:p,onClick:()=>{y(r.isResolving)},children:r.label})]}),e[19]=a,e[20]=T,e[21]=S,e[22]=p,e[23]=y,e[24]=c,e[25]=r,e[26]=M):M=e[26];let L;return e[27]!==s||e[28]!==R||e[29]!==A||e[30]!==k||e[31]!==M?(L=b.jsxs("section",{"aria-label":s,className:Nye,children:[R,A,k,M]}),e[27]=s,e[28]=R,e[29]=A,e[30]=k,e[31]=M,e[32]=L):L=e[32],L};function Rye(t){return t+1}function kye(t){return!t}const Aye={bug:"text-destructive",risk:"text-risk-text",nit:"text-nit",question:"text-muted-foreground","core-change":"text-signal-text"},_ye="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1z",Mye="M8 4 4 8l4 4 4-4z",Lye="M8 4.25 4.5 10.5h7z",Iye="M8 5.6 10.4 8 8 10.4 5.6 8z",Dye="M6.45 6.55a1.6 1.6 0 1 1 2.25 1.45c-.45.2-.7.5-.7.95",jye="M5.9 10.1 10.1 5.9",yS=5.75,lM=t=>{const e=ee.c(3),{hole:n,className:s}=t,i=`${_ye}${n}`;let o;return e[0]!==s||e[1]!==i?(o=b.jsx("path",{d:i,fillRule:"evenodd",className:s}),e[0]=s,e[1]=i,e[2]=o):o=e[2],o},oB=t=>{const e=ee.c(5),{kind:n}=t;if(n==="bug"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsx(lM,{hole:Mye,className:"fill-destructive"}),e[0]=i):i=e[0],i}if(n==="core-change"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsx(lM,{hole:Lye,className:"fill-signal"}),e[1]=i):i=e[1],i}if(n==="risk"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:"8",cy:"8",r:yS,className:"fill-none stroke-risk [stroke-width:2.5]"}),b.jsx("path",{d:Iye,className:"fill-risk"})]}),e[2]=i):i=e[2],i}if(n==="question"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:"8",cy:"8",r:yS,className:"fill-none stroke-foreground [stroke-width:2]"}),b.jsx("path",{d:Dye,className:"fill-none stroke-foreground [stroke-linecap:round] [stroke-width:1.5]"}),b.jsx("circle",{cx:"8",cy:"11.05",r:"0.8",className:"fill-foreground"})]}),e[3]=i):i=e[3],i}let s;return e[4]===Symbol.for("react.memo_cache_sentinel")?(s=b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:"8",cy:"8",r:yS,className:"fill-none stroke-nit [stroke-width:1.5]"}),b.jsx("path",{d:jye,className:"fill-none stroke-nit [stroke-linecap:round] [stroke-width:2]"})]}),e[4]=s):s=e[4],s},rB=t=>{const e=ee.c(8),{kind:n,className:s}=t;let i;e[0]!==s?(i=Se("size-3.5 shrink-0",s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==n?(o=b.jsx(oB,{kind:n}),e[2]=n,e[3]=o):o=e[3];let r;return e[4]!==n||e[5]!==i||e[6]!==o?(r=b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16","data-kind":n,className:i,children:o}),e[4]=n,e[5]=i,e[6]=o,e[7]=r):r=e[7],r},Ma=t=>{const e=ee.c(11),{kind:n,label:s,className:i}=t,o=Aye[n];let r;e[0]!==i||e[1]!==o?(r=Se("inline-flex shrink-0 items-center gap-1 text-xs font-bold",o,i),e[0]=i,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==n?(a=b.jsx(rB,{kind:n}),e[3]=n,e[4]=a):a=e[4];let c;e[5]!==s?(c=b.jsx("span",{className:"text-box-cap",children:s}),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=b.jsxs("span",{className:r,children:[a,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d},zb=t=>{const e=ee.c(15),{label:n,accessibleLabel:s,isReviewed:i,isDisabled:o,className:r,onChange:a}=t,c=o===void 0?!1:o;let d;e[0]!==r?(d=Se("group/review inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[0.8rem] hover:bg-muted disabled:opacity-50",r),e[0]=r,e[1]=d):d=e[1];let f;e[2]!==i||e[3]!==a?(f=()=>{a(!i)},e[2]=i,e[3]=a,e[4]=f):f=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=b.jsx("span",{"aria-hidden":"true",className:"inline-flex size-4 items-center justify-center rounded-full border-[1.5px] border-muted-foreground text-line-foreground transition-colors duration-[180ms] ease-out group-aria-pressed/review:border-(--line) group-aria-pressed/review:bg-(--line)",children:b.jsx(Nu,{className:"size-3 opacity-0 transition-opacity duration-[180ms] ease-out group-aria-pressed/review:opacity-100",strokeWidth:3})}),e[5]=p):p=e[5];let m;e[6]!==n?(m=b.jsx("span",{className:"text-box-cap",children:n}),e[6]=n,e[7]=m):m=e[7];let g;return e[8]!==s||e[9]!==c||e[10]!==i||e[11]!==d||e[12]!==f||e[13]!==m?(g=b.jsxs("button",{type:"button","aria-label":s,"aria-pressed":i,disabled:c,"data-user-action-id":"review-toggle-action",className:d,onClick:f,children:[p,m]}),e[8]=s,e[9]=c,e[10]=i,e[11]=d,e[12]=f,e[13]=m,e[14]=g):g=e[14],g},lB="not-last:after:ml-1 not-last:after:font-normal not-last:after:text-muted-foreground not-last:after:content-['•']",py=8,Pye=[[1,1],[-1,1],[-1,-1],[1,-1]],zye=6.25,Bye=8.25,$ye=2,aM=([t,e],n)=>[py+t*n*Math.SQRT1_2,py+e*n*Math.SQRT1_2].map(s=>s.toFixed($ye)).join(" "),Fye=(t,e,n)=>`M${aM(t,e)}L${aM(t,n)}`,aB=t=>{const e=ee.c(8),{innerRadius:n,outerRadius:s,className:i}=t;let o;e[0]!==n||e[1]!==s?(o=Pye.map(c=>Fye(c,n,s)).join(""),e[0]=n,e[1]=s,e[2]=o):o=e[2];let r;e[3]!==i?(r=Se("fill-none stroke-foreground [stroke-linecap:round] [stroke-width:1.6]",i),e[3]=i,e[4]=r):r=e[4];let a;return e[5]!==o||e[6]!==r?(a=b.jsx("path",{d:o,className:r}),e[5]=o,e[6]=r,e[7]=a):a=e[7],a},Hye=t=>{const e=ee.c(6),{className:n}=t;let s;e[0]!==n?(s=Se("size-3.5 shrink-0",n),e[0]=n,e[1]=s):s=e[1];let i,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsx("circle",{cx:py,cy:py,r:"4.5",className:"fill-none stroke-foreground [stroke-width:1.75]"}),o=b.jsx(aB,{innerRadius:zye,outerRadius:Bye,className:"[stroke-width:1.5]"}),e[2]=i,e[3]=o):(i=e[2],o=e[3]);let r;return e[4]!==s?(r=b.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16","data-kind":"spotlight",className:s,children:[i,o]}),e[4]=s,e[5]=r):r=e[5],r},pN=t=>{const e=ee.c(13),{spotlight:n,className:s}=t;let i;e[0]!==s?(i=Se("inline-flex min-w-0 shrink-0 items-center gap-1 text-xs font-bold text-foreground",s),e[0]=s,e[1]=i):i=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(Hye,{}),e[2]=o):o=e[2];let r;e[3]!==n.label?(r=b.jsx("span",{className:lB,children:n.label}),e[3]=n.label,e[4]=r):r=e[4];let a;e[5]!==n.classifications?(a=n.classifications.map(Uye),e[5]=n.classifications,e[6]=a):a=e[6];let c;e[7]!==r||e[8]!==a?(c=b.jsxs("span",{className:"flex flex-wrap gap-x-1 text-box-cap",children:[r,a]}),e[7]=r,e[8]=a,e[9]=c):c=e[9];let d;return e[10]!==i||e[11]!==c?(d=b.jsxs("span",{className:i,children:[o,c]}),e[10]=i,e[11]=c,e[12]=d):d=e[12],d};function Uye(t){return b.jsx("span",{className:Se("font-normal text-muted-foreground",lB),children:t.label},t.key)}const Vye="[data-line]",qye="[data-diff-mark]",cB="[data-reference-scope]",Wye="[data-file-header]",Gye="[data-gutter-mark]",Kye=28,t1=8,Yye=new Map([["ArrowUp",-1],["ArrowDown",1]]),Xye=150,Qye=1e3,xE="data-gutter-card-owner",vE="flight-plan:gutter-card-owner",cM=()=>document.documentElement.getAttribute(xE),Zye=()=>null,uM=t=>{t===null?document.documentElement.removeAttribute(xE):document.documentElement.setAttribute(xE,t),window.dispatchEvent(new Event(vE))},Jye=t=>(window.addEventListener(vE,t),()=>{window.removeEventListener(vE,t)}),uB=t=>{const e=ee.c(8),n=_.useSyncExternalStore(Jye,cM,Zye);let s;e[0]!==t?(s=()=>{uM(t)},e[0]=t,e[1]=s):s=e[1];const i=s;let o;e[2]!==t?(o=()=>{cM()===t&&uM(null)},e[2]=t,e[3]=o):o=e[3];const r=o,a=n===t;let c;return e[4]!==i||e[5]!==r||e[6]!==a?(c={isOwner:a,claim:i,release:r},e[4]=i,e[5]=r,e[6]=a,e[7]=c):c=e[7],c},ebe=t=>{const e=new AbortController,n=()=>{e.signal.aborted||(e.abort(),t())},s=setTimeout(n,Xye),i=()=>{clearTimeout(s),setTimeout(n,Qye)};return window.addEventListener("scroll",i,{once:!0,passive:!0,capture:!0,signal:e.signal}),window.addEventListener("scrollend",n,{once:!0,capture:!0,signal:e.signal}),()=>{clearTimeout(s),e.abort()}},tbe=(t,e)=>{const n=ee.c(5),s=_.useRef(e);let i;n[0]!==e?(i=()=>{s.current=e},n[0]=e,n[1]=i):i=n[1],_.useEffect(i);let o,r;n[2]!==t?(o=()=>{s.current(t)},r=[t],n[2]=t,n[3]=o,n[4]=r):(o=n[3],r=n[4]),_.useEffect(o,r)},dB=8,fB="w-[min(56rem,calc(100vw-2rem))]",hB="max-w-none gap-2 text-sm leading-6",pB={side:"flip",align:"shift",fallbackAxisSide:"none"},nbe=t=>{const e=(t==null?void 0:t.closest(Vye))??null,n=(e==null?void 0:e.querySelector(qye))??null;return e===null||n===null?t:{contextElement:e,getBoundingClientRect:()=>{const s=e.getBoundingClientRect();return new DOMRect(n.getBoundingClientRect().right,s.top,Kye,s.height)}}},sbe=1,ibe=t=>{var i;const e=((i=t==null?void 0:t.closest(cB))==null?void 0:i.querySelector(Wye))??null;if(e===null)return 0;const n=Number.parseFloat(getComputedStyle(e).top)||0,s=e.getBoundingClientRect();return s.top<=n+sbe?s.bottom:n},mB=t=>({anchor:()=>nbe(t),collisionPadding:{top:ibe(t)+t1,right:t1,bottom:t1,left:t1}}),gB=(t,e)=>{const n=ee.c(4);let s,i;n[0]!==t||n[1]!==e?(s=()=>{if(t)return window.addEventListener("scroll",e,{passive:!0,capture:!0}),()=>{window.removeEventListener("scroll",e,{capture:!0})}},i=[t,e],n[0]=t,n[1]=e,n[2]=s,n[3]=i):(s=n[2],i=n[3]),_.useEffect(s,i)},yB=t=>{const e=Yye.get(t.key),n=t.currentTarget.closest(cB);if(e===void 0||n===null)return;const s=[...n.querySelectorAll(Gye)],i=s.indexOf(t.currentTarget)+e;i<0||i>=s.length||(t.preventDefault(),s[i].focus())},obe=150,rbe="Click or press Enter to open",lbe=["pending","open","resolved"],abe={},bS="M3 2.6h8a1.4 1.4 0 0 1 1.4 1.4v4.5a1.4 1.4 0 0 1-1.4 1.4H6.4L4.2 11.7V9.9H3a1.4 1.4 0 0 1-1.4-1.4V4A1.4 1.4 0 0 1 3 2.6z",cbe=Se("relative z-1 grid size-[1.125rem] shrink-0 place-items-center rounded-sm","transition-[background-color] duration-[180ms] ease-out hover:bg-muted aria-expanded:bg-muted","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),ube={open:"font-bold text-foreground",pending:"font-bold text-signal-text",resolved:"font-bold text-foreground"},dbe=()=>{},fbe=t=>lbe.find(e=>t.some(n=>n.mark.kind===e))??"open",hbe=t=>{const e=ee.c(11),{kind:n}=t;let s;e[0]!==n?(s=n==="open"?b.jsx("path",{d:bS,className:"fill-muted-foreground"}):null,e[0]=n,e[1]=s):s=e[1];let i;e[2]!==n?(i=n==="pending"?b.jsxs(b.Fragment,{children:[b.jsx("path",{d:bS,className:"fill-none stroke-signal-text stroke-[1.5]"}),b.jsx("circle",{cx:"7",cy:"6.25",r:"1.6",className:"fill-signal"})]}):null,e[2]=n,e[3]=i):i=e[3];let o;e[4]!==n?(o=n==="resolved"?b.jsx("path",{d:bS,className:"fill-none stroke-muted-foreground stroke-1 [stroke-dasharray:2_1.4]"}):null,e[4]=n,e[5]=o):o=e[5];let r;return e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==o?(r=b.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 14 14","data-kind":n,className:"size-3.5 shrink-0",children:[s,i,o]}),e[6]=n,e[7]=s,e[8]=i,e[9]=o,e[10]=r):r=e[10],r},pbe=t=>{const e=ee.c(15),{thread:n}=t;let s;if(e[0]!==n.comments||e[1]!==n.linesLabel||e[2]!==n.mark.kind||e[3]!==n.mark.label){const i=n.comments.at(0),o=n.mark.label,r=ube[n.mark.kind];let a;e[5]!==r?(a=Se(r,"after:ml-[0.5em] after:font-normal after:text-muted-foreground after:content-['•']"),e[5]=r,e[6]=a):a=e[6];let c;e[7]!==a||e[8]!==n.mark.label?(c=b.jsx("span",{className:a,children:n.mark.label}),e[7]=a,e[8]=n.mark.label,e[9]=c):c=e[9];let d;e[10]!==n.linesLabel?(d=b.jsx("span",{children:n.linesLabel}),e[10]=n.linesLabel,e[11]=d):d=e[11];let f;e[12]!==c||e[13]!==d?(f=b.jsxs("p",{className:"flex flex-wrap gap-x-[0.5em] text-xs text-muted-foreground tabular-nums",children:[c,d]}),e[12]=c,e[13]=d,e[14]=f):f=e[14],s=b.jsxs("section",{"aria-label":o,className:"flex flex-col gap-1.5 px-3 py-2.5 not-first:border-t",children:[f,i===void 0?null:b.jsxs("div",{className:"grid grid-cols-[1.5rem_minmax(0,1fr)] gap-x-2.5",children:[b.jsx(Hf,{imageUrl:i.author.avatarUrl,monogram:i.author.monogram,className:"size-6"}),b.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[b.jsxs("p",{className:"flex items-baseline gap-2 text-sm",children:[b.jsx("span",{className:"font-semibold",children:i.author.name}),b.jsx("span",{className:"text-xs text-muted-foreground",children:i.timeLabel})]}),b.jsx("div",{className:"line-clamp-2",children:b.jsx(ho,{blocks:i.body.slice(0,1),codeLinks:abe,onOpenCodeLink:dbe,className:hB})})]})]})]}),e[0]=n.comments,e[1]=n.linesLabel,e[2]=n.mark.kind,e[3]=n.mark.label,e[4]=s}else s=e[4];return s},mbe=t=>{const e=ee.c(32),{threads:n,isOpen:s,isTabStop:i,onToggle:o}=t,r=_.useRef(null),[a,c]=_.useState(null);let d;e[0]!==n?(d=n.map(gbe).join(" "),e[0]=n,e[1]=d):d=e[1];const{isOwner:f,claim:p,release:m}=uB(`thread:${d}`),g=f&&a!==null&&!s;let y;e[2]!==m?(y=()=>{c(null),m()},e[2]=m,e[3]=y):y=e[3];const v=y;let S;e[4]!==n?(S=fbe(n),e[4]=n,e[5]=S):S=e[5];const w=S;gB(g,v);let N;e[6]!==p||e[7]!==v?(N=D=>{if(!D){v();return}c(mB(r.current)),p()},e[6]=p,e[7]=v,e[8]=N):N=e[8];let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=b.jsx("button",{ref:r,type:"button"}),e[9]=C):C=e[9];let T;e[10]!==n?(T=n.map(ybe).join("; "),e[10]=n,e[11]=T):T=e[11];const R=i?0:-1;let A;e[12]!==v||e[13]!==o?(A=()=>{v(),o()},e[12]=v,e[13]=o,e[14]=A):A=e[14];let k;e[15]!==w?(k=b.jsx(hbe,{kind:w}),e[15]=w,e[16]=k):k=e[16];let M;e[17]!==s||e[18]!==w||e[19]!==T||e[20]!==R||e[21]!==A||e[22]!==k?(M=b.jsx($m,{delay:obe,render:C,"aria-label":T,"aria-expanded":s,tabIndex:R,"data-gutter-mark":"","data-thread-mark":w,className:cbe,onKeyDown:yB,onClick:A,children:k}),e[17]=s,e[18]=w,e[19]=T,e[20]=R,e[21]=A,e[22]=k,e[23]=M):M=e[23];let L;e[24]!==a||e[25]!==n?(L=a===null?null:b.jsxs(Sb,{side:"top",align:"start",sideOffset:dB,anchor:a.anchor,collisionPadding:a.collisionPadding,collisionAvoidance:pB,className:Se("flex flex-col font-sans",fB),children:[b.jsx(v7,{}),n.map(bbe),b.jsx("p",{className:"border-t px-3 py-2 text-xs text-muted-foreground",children:rbe})]}),e[24]=a,e[25]=n,e[26]=L):L=e[26];let j;return e[27]!==g||e[28]!==M||e[29]!==L||e[30]!==N?(j=b.jsxs(Bm,{open:g,onOpenChange:N,children:[M,L]}),e[27]=g,e[28]=M,e[29]=L,e[30]=N,e[31]=j):j=e[31],j};function gbe(t){return t.id}function ybe(t){return`${t.mark.label}, ${t.linesLabel}`}function bbe(t){return b.jsx(pbe,{thread:t},t.id)}const xbe=t=>{const e=ee.c(27),{finding:n,codeLinks:s,onOpenCodeLink:i}=t,[o,r]=_.useState(!1),{solution:a,trace:c}=n;let d;e[0]!==n.kind||e[1]!==n.kindLabel?(d=b.jsx(Ma,{kind:n.kind,label:n.kindLabel,className:"translate-y-px"}),e[0]=n.kind,e[1]=n.kindLabel,e[2]=d):d=e[2];let f;e[3]!==s||e[4]!==n.title||e[5]!==i?(f=b.jsx("span",{className:"font-semibold",children:b.jsx(pf,{inlines:n.title,codeLinks:s,onOpenCodeLink:i})}),e[3]=s,e[4]=n.title,e[5]=i,e[6]=f):f=e[6];let p;e[7]!==d||e[8]!==f?(p=b.jsxs("h4",{className:"flex items-baseline gap-2",children:[d,f]}),e[7]=d,e[8]=f,e[9]=p):p=e[9];let m;e[10]!==s||e[11]!==n.reading||e[12]!==i?(m=b.jsx(ho,{blocks:n.reading,codeLinks:s,onOpenCodeLink:i}),e[10]=s,e[11]=n.reading,e[12]=i,e[13]=m):m=e[13];let g;e[14]!==s||e[15]!==n.traceLabel||e[16]!==i||e[17]!==c?(g=c===null?null:b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:n.traceLabel}),b.jsx("ol",{className:"flex max-w-[66ch] list-decimal flex-col gap-1.5 pl-5 text-base leading-[1.7]",children:$f(c).map(S=>{const{key:w,item:N}=S;return b.jsx("li",{children:b.jsx(pf,{inlines:N,codeLinks:s,onOpenCodeLink:i})},w)})})]}),e[14]=s,e[15]=n.traceLabel,e[16]=i,e[17]=c,e[18]=g):g=e[18];let y;e[19]!==o||e[20]!==a?(y=a===null?null:b.jsxs("div",{className:"flex flex-col items-start gap-2",children:[b.jsx(ft,{variant:"outline",size:"sm","aria-expanded":o,onClick:()=>{r(vbe)},children:o?a.hideLabel:a.showLabel}),o?b.jsx(Au,{lines:a.lines,label:a.showLabel,className:"w-full rounded-md border"}):null]}),e[19]=o,e[20]=a,e[21]=y):y=e[21];let v;return e[22]!==p||e[23]!==m||e[24]!==g||e[25]!==y?(v=b.jsxs("article",{className:"flex flex-col gap-2 border-t pt-3 text-base leading-[1.7]",children:[p,m,g,y]}),e[22]=p,e[23]=m,e[24]=g,e[25]=y,e[26]=v):v=e[26],v};function vbe(t){return!t}const Sbe="#D97757",wbe={claude:Sbe,codex:"currentColor",cursor:"currentColor"},Ebe={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",codex:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"},Cbe=t=>{const e=ee.c(9),{agent:n,className:s}=t;let i;e[0]!==s?(i=Se("size-3.5 shrink-0",s),e[0]=s,e[1]=i):i=e[1];const o=Ebe[n],r=wbe[n];let a;e[2]!==o||e[3]!==r?(a=b.jsx("path",{d:o,fill:r}),e[2]=o,e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==i||e[7]!==a?(c=b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24","data-agent-mark":n,className:i,children:a}),e[5]=n,e[6]=i,e[7]=a,e[8]=c):c=e[8],c},Nbe="This line of code is not explained or checked for issues yet.",Tbe="This waypoint does not have any description or explanation.",Obe="Explain this line",Rbe="Explain the whole code block",kbe="Ctrl+G",Abe=t=>t===null?Nbe:`${t.label} has not explained this line of code or checked it for issues yet.`,_be=t=>`${(t==null?void 0:t.label)??"The agent"} is explaining this line.`,Mbe=t=>t===null?Obe:`Let ${t.label} explain`,Lbe=t=>{const e=ee.c(13),{writeUp:n}=t,s=_.use(wb);let i;e[0]!==s?(i=Mbe(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=s===null?null:b.jsx(Cbe,{agent:s.name}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==i||e[5]!==o||e[6]!==n.onLine?(r=b.jsx(Bp,{label:i,keyLabel:Pf,icon:o,actionId:ny,onClick:n.onLine}),e[4]=i,e[5]=o,e[6]=n.onLine,e[7]=r):r=e[7];let a;e[8]!==n.onBlock?(a=n.onBlock===null?null:b.jsx(Bp,{label:Rbe,keyLabel:kbe,actionId:W3,onClick:n.onBlock}),e[8]=n.onBlock,e[9]=a):a=e[9];let c;return e[10]!==r||e[11]!==a?(c=b.jsxs(b.Fragment,{children:[r,a]}),e[10]=r,e[11]=a,e[12]=c):c=e[12],c},bB=t=>{const e=ee.c(4),{isBeingWritten:n,writeUp:s,onWriteDescription:i}=t;let o;return e[0]!==n||e[1]!==i||e[2]!==s?(o=n?null:b.jsxs(b.Fragment,{children:[s===null?null:b.jsx(Lbe,{writeUp:s}),i===null?null:b.jsx(Bp,{label:o9,keyLabel:G3,actionId:"write-description-action",onClick:i})]}),e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3],o},xB=t=>{const e=ee.c(12),{hint:n,isBeingWritten:s,isAuthored:i,className:o}=t,r=_.use(wb);let a;e[0]!==o?(a=Se("flex flex-col gap-2",o),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==n?(c=n===null?null:b.jsx("p",{className:"text-sm text-foreground",children:n}),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==i||e[6]!==s?(d=s?b.jsx(q7,{label:_be(r)}):b.jsx(Ff,{label:i?Tbe:Abe(r)}),e[4]=r,e[5]=i,e[6]=s,e[7]=d):d=e[7];let f;return e[8]!==a||e[9]!==c||e[10]!==d?(f=b.jsxs("div",{className:a,children:[c,d]}),e[8]=a,e[9]=c,e[10]=d,e[11]=f):f=e[11],f},Ibe=["ml-18","ml-24","ml-30"],Dbe="ml-36",jbe=["ml-28","ml-34","ml-40"],Pbe="ml-46",zbe=(t,e)=>e?jbe.find((n,s)=>s===t)??Pbe:Ibe.find((n,s)=>s===t)??Dbe,Bbe=t=>{const e=ee.c(61),{waypoint:n,isOpen:s,isCurrent:i,isReviewPending:o,isGuttered:r,codeLinks:a,actions:c,writeUp:d,onWriteDescription:f,onOpenCodeLink:p,onToggle:m,onReviewedChange:g}=t,y=r===void 0?!1:r,v=d===void 0?null:d,S=f===void 0?null:f,w=n.anchorId,N=n.title,C=n.isReviewed;let T;e[0]!==y||e[1]!==n.depth?(T=Se("my-1.5 mr-4 scroll-mt-(--waypoint-scroll-margin) rounded-md border border-input bg-background font-sans whitespace-normal transition-[border-color,outline-color,opacity] duration-[180ms] ease-out data-[current=true]:border-(--line) data-[current=true]:outline-1 data-[current=true]:outline-(--line) data-[reviewed=true]:opacity-60",zbe(n.depth,y)),e[0]=y,e[1]=n.depth,e[2]=T):T=e[2];const R=s?"rotate-90":"";let A;e[3]!==R?(A=Se("size-4 shrink-0 text-muted-foreground transition-transform duration-[180ms] ease-out",R),e[3]=R,e[4]=A):A=e[4];let k;e[5]!==A?(k=b.jsx(Gy,{"aria-hidden":"true",className:A}),e[5]=A,e[6]=k):k=e[6];let M;e[7]!==n.chip?(M=n.chip===null?null:b.jsx(Ma,{kind:n.chip.kind,label:n.chip.label}),e[7]=n.chip,e[8]=M):M=e[8];let L;e[9]!==n.coreChangeLabel?(L=n.coreChangeLabel===null?null:b.jsx(Ma,{kind:"core-change",label:n.coreChangeLabel}),e[9]=n.coreChangeLabel,e[10]=L):L=e[10];let j;e[11]!==n.spotlight?(j=n.spotlight===null?null:b.jsx(pN,{spotlight:n.spotlight}),e[11]=n.spotlight,e[12]=j):j=e[12];const D=n.isDraft,P=n.isDraft?"font-mono text-sm text-muted-foreground":"font-semibold";let B;e[13]!==P?(B=Se("min-w-0 truncate text-[0.9375rem]",P),e[13]=P,e[14]=B):B=e[14];let I;e[15]!==B||e[16]!==n.title?(I=b.jsx("span",{className:B,children:n.title}),e[15]=B,e[16]=n.title,e[17]=I):I=e[17];let F;e[18]!==I||e[19]!==n.isDraft?(F=b.jsx(Ja,{isPending:D,className:"w-56 text-[0.9375rem]",children:I}),e[18]=I,e[19]=n.isDraft,e[20]=F):F=e[20];let z;e[21]!==n.positionLabel?(z=b.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:n.positionLabel}),e[21]=n.positionLabel,e[22]=z):z=e[22];let U;e[23]!==s||e[24]!==m||e[25]!==k||e[26]!==M||e[27]!==L||e[28]!==j||e[29]!==F||e[30]!==z?(U=b.jsxs("button",{type:"button","aria-expanded":s,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-2 text-left",onClick:m,children:[k,M,L,j,F,z]}),e[23]=s,e[24]=m,e[25]=k,e[26]=M,e[27]=L,e[28]=j,e[29]=F,e[30]=z,e[31]=U):U=e[31];let H;e[32]!==o||e[33]!==g||e[34]!==n.isReviewed||e[35]!==n.reviewLabel?(H=g===null?null:b.jsx(zb,{label:n.reviewLabel,isReviewed:n.isReviewed,isDisabled:o,onChange:g}),e[32]=o,e[33]=g,e[34]=n.isReviewed,e[35]=n.reviewLabel,e[36]=H):H=e[36];let V;e[37]!==c||e[38]!==U||e[39]!==H?(V=b.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[U,c,H]}),e[37]=c,e[38]=U,e[39]=H,e[40]=V):V=e[40];let W;e[41]!==a||e[42]!==s||e[43]!==p||e[44]!==S||e[45]!==n.coreChange||e[46]!==n.coreChangeLabel||e[47]!==n.findings||e[48]!==n.hint||e[49]!==n.isBeingWritten||e[50]!==n.reading||e[51]!==v?(W=s?b.jsxs("div",{className:"flex flex-col gap-3 border-t px-4 pt-3.5 pb-4 text-base leading-[1.7]",children:[n.reading===null?b.jsxs(b.Fragment,{children:[b.jsx(xB,{hint:n.hint,isBeingWritten:n.isBeingWritten,isAuthored:S!==null}),b.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-xs empty:hidden",children:b.jsx(bB,{isBeingWritten:n.isBeingWritten,writeUp:v,onWriteDescription:S})})]}):b.jsx(ho,{blocks:n.reading,codeLinks:a,onOpenCodeLink:p}),n.coreChange===null||n.coreChangeLabel===null?null:b.jsxs("div",{className:"flex flex-col gap-2 border-t pt-3",children:[b.jsx(Ma,{kind:"core-change",label:n.coreChangeLabel}),b.jsx(ho,{blocks:n.coreChange,codeLinks:a,onOpenCodeLink:p})]}),n.findings.map(Y=>b.jsx(xbe,{finding:Y,codeLinks:a,onOpenCodeLink:p},Y.id))]}):null,e[41]=a,e[42]=s,e[43]=p,e[44]=S,e[45]=n.coreChange,e[46]=n.coreChangeLabel,e[47]=n.findings,e[48]=n.hint,e[49]=n.isBeingWritten,e[50]=n.reading,e[51]=v,e[52]=W):W=e[52];let G;return e[53]!==i||e[54]!==V||e[55]!==W||e[56]!==T||e[57]!==n.anchorId||e[58]!==n.isReviewed||e[59]!==n.title?(G=b.jsxs("section",{id:w,"aria-label":N,"data-current":i,"data-reviewed":C,"data-view-section-id":"waypoint-box-section",className:T,children:[V,W]}),e[53]=i,e[54]=V,e[55]=W,e[56]=T,e[57]=n.anchorId,e[58]=n.isReviewed,e[59]=n.title,e[60]=G):G=e[60],G},$be=150,Fbe="Expand",Hbe="pointer-events-none absolute left-1/2 -ml-px w-0.5 transition-[opacity,background-color] duration-[180ms] ease-out",Ube={solid:"bg-waypoint",faint:"bg-waypoint opacity-50",quiet:"bg-muted-foreground opacity-35"},xS="top-0 h-[0.1875rem]",dM="top-[1.3125rem] bottom-0",Vbe="inset-y-0",qbe="top-0 h-3",Wbe=Se("relative z-1 grid size-[1.125rem] shrink-0 scroll-mt-[calc(var(--waypoint-scroll-margin)+14rem)] place-items-center rounded-full","transition-[background-color,opacity] duration-[180ms] ease-out hover:bg-muted aria-expanded:bg-muted data-[reviewed=true]:opacity-45","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),SE=5.75,Gbe=7,Kbe=2.25,Ybe=8,Xbe=9.5,Qbe=11.75,Zbe="M5 8.25 7.1 10.25 11 5.9",Jbe="[stroke-dasharray:2.4_2.1]",exe=Se("flex flex-col font-sans",fB),txe=({reach:t,isJoinedAbove:e},n)=>{const s=e?[xS]:[];return t==="start"?[...s,dM]:t==="single"?s:t==="middle"?n?[xS,dM]:[Vbe]:[n?xS:qbe]},nxe=t=>{const e=ee.c(10),{stem:n,hasMark:s,children:i}=t;let o,r;if(e[0]!==s||e[1]!==n){const c=n===null?[]:txe(n,s);o="relative flex flex-col items-center gap-0.5 self-stretch pt-[0.1875rem]";let d;e[4]!==n?(d=f=>b.jsx("span",{"aria-hidden":"true",className:Se(Hbe,n===null?null:Ube[n.tone],f)},f),e[4]=n,e[5]=d):d=e[5],r=c.map(d),e[0]=s,e[1]=n,e[2]=o,e[3]=r}else o=e[2],r=e[3];let a;return e[6]!==i||e[7]!==o||e[8]!==r?(a=b.jsxs("span",{className:o,children:[r,i]}),e[6]=i,e[7]=o,e[8]=r,e[9]=a):a=e[9],a},sxe=t=>{const e=ee.c(2),{isCurrent:n}=t;let s;return e[0]!==n?(s=n?b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:"8",cy:"8",r:SE,className:"fill-none stroke-waypoint [stroke-width:2.5]"}),b.jsx("circle",{cx:"8",cy:"8",r:Kbe,className:"fill-waypoint"})]}):b.jsx("circle",{cx:"8",cy:"8",r:SE,className:"fill-none stroke-muted-foreground [stroke-width:2.5]"}),e[0]=n,e[1]=s):s=e[1],s},ixe=()=>{const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsxs(b.Fragment,{children:[b.jsx("circle",{cx:"8",cy:"8",r:Gbe,className:"fill-waypoint"}),b.jsx("path",{"data-reviewed-glyph":"",d:Zbe,className:"fill-none stroke-code [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:2]"})]}),t[0]=e):e=t[0],e},oxe=t=>{const e=ee.c(5),{isBeingWritten:n}=t,s=n?"motion-safe:animate-spin":"";let i;e[0]!==s?(i=Se("origin-center fill-none stroke-muted-foreground [stroke-width:2] [transform-box:fill-box]",Jbe,s),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=b.jsx("circle",{"data-being-written":n,cx:"8",cy:"8",r:SE,className:i}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o},rxe=t=>{const e=ee.c(7),{waypoint:n,isCurrent:s}=t;if(n.isReviewed){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(ixe,{}),e[0]=o):o=e[0],o}if(n.mark.kind!=="plain"){let o;return e[1]!==n.mark.kind?(o=b.jsx(oB,{kind:n.mark.kind}),e[1]=n.mark.kind,e[2]=o):o=e[2],o}let i;return e[3]!==s||e[4]!==n.isBeingWritten||e[5]!==n.reading?(i=n.reading===null?b.jsx(oxe,{isBeingWritten:n.isBeingWritten}):b.jsx(sxe,{isCurrent:s}),e[3]=s,e[4]=n.isBeingWritten,e[5]=n.reading,e[6]=i):i=e[6],i},lxe=t=>!t.isReviewed&&t.mark.kind==="plain"&&t.reading!==null,axe=t=>{const e=ee.c(10),{waypoint:n,isCurrent:s}=t;let i,o;e[0]!==s||e[1]!==n?(i=b.jsx(rxe,{waypoint:n,isCurrent:s}),o=s&&!lxe(n)?b.jsx("circle",{cx:"8",cy:"8",r:Ybe,className:"fill-none stroke-waypoint [stroke-width:1.25]"}):null,e[0]=s,e[1]=n,e[2]=i,e[3]=o):(i=e[2],o=e[3]);let r;e[4]!==n.spotlight?(r=n.spotlight===null?null:b.jsx(aB,{innerRadius:Xbe,outerRadius:Qbe}),e[4]=n.spotlight,e[5]=r):r=e[5];let a;return e[6]!==i||e[7]!==o||e[8]!==r?(a=b.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"size-4 shrink-0 overflow-visible",children:[i,o,r]}),e[6]=i,e[7]=o,e[8]=r,e[9]=a):a=e[9],a},cxe=t=>{var j;const e=ee.c(47),{waypoint:n,isReviewPending:s,codeLinks:i,writeUp:o,onOpenCodeLink:r,onReviewedChange:a,onWriteDescription:c,onExpand:d}=t;let f;e[0]!==n.reading?(f=((j=n.reading)==null?void 0:j.slice(0,1))??null,e[0]=n.reading,e[1]=f):f=e[1];const p=f;let m;e[2]!==n.positionLabel||e[3]!==n.rangeLabel?(m=[n.rangeLabel,n.positionLabel].filter(dxe).map(fxe),e[2]=n.positionLabel,e[3]=n.rangeLabel,e[4]=m):m=e[4];const g=m;let y;e[5]!==n.chip||e[6]!==n.coreChangeLabel||e[7]!==n.spotlight?(y=n.chip===null&&n.coreChangeLabel===null&&n.spotlight===null?null:b.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[n.chip===null?null:b.jsx(Ma,{kind:n.chip.kind,label:n.chip.label}),n.coreChangeLabel===null?null:b.jsx(Ma,{kind:"core-change",label:n.coreChangeLabel}),n.spotlight===null?null:b.jsx(pN,{spotlight:n.spotlight})]}),e[5]=n.chip,e[6]=n.coreChangeLabel,e[7]=n.spotlight,e[8]=y):y=e[8];const v=n.isDraft?"font-mono text-muted-foreground":"font-semibold";let S;e[9]!==v?(S=Se("leading-5",v),e[9]=v,e[10]=S):S=e[10];let w;e[11]!==S||e[12]!==n.title?(w=b.jsx("p",{className:S,children:n.title}),e[11]=S,e[12]=n.title,e[13]=w):w=e[13];let N;e[14]!==g?(N=b.jsx(mf,{segments:g,className:"text-xs text-muted-foreground tabular-nums"}),e[14]=g,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==w||e[18]!==N?(C=b.jsxs("div",{className:"flex flex-col gap-1 px-3 pt-2.5 pb-2",children:[y,w,N]}),e[16]=y,e[17]=w,e[18]=N,e[19]=C):C=e[19];let T;e[20]!==i||e[21]!==p||e[22]!==r||e[23]!==c||e[24]!==n.hint||e[25]!==n.isBeingWritten?(T=p===null?b.jsx(xB,{hint:n.hint,isBeingWritten:n.isBeingWritten,isAuthored:c!==null,className:"border-t px-3 py-2"}):b.jsx("div",{className:"line-clamp-3 border-t px-3 py-2",children:b.jsx(ho,{blocks:p,codeLinks:i,onOpenCodeLink:r,className:hB})}),e[20]=i,e[21]=p,e[22]=r,e[23]=c,e[24]=n.hint,e[25]=n.isBeingWritten,e[26]=T):T=e[26];let R;e[27]!==p||e[28]!==c||e[29]!==n.isBeingWritten||e[30]!==o?(R=p===null?b.jsx(bB,{isBeingWritten:n.isBeingWritten,writeUp:o,onWriteDescription:c}):null,e[27]=p,e[28]=c,e[29]=n.isBeingWritten,e[30]=o,e[31]=R):R=e[31];let A;e[32]!==d?(A=b.jsx(Bp,{label:Fbe,keyLabel:i9,variant:"ghost",actionId:"expand-waypoint-action",onClick:d}),e[32]=d,e[33]=A):A=e[33];let k;e[34]!==s||e[35]!==a||e[36]!==n.isReviewed||e[37]!==n.reviewLabel?(k=a===null?null:b.jsx(zb,{label:n.reviewLabel,isReviewed:n.isReviewed,isDisabled:s,className:"ml-auto text-foreground",onChange:a}),e[34]=s,e[35]=a,e[36]=n.isReviewed,e[37]=n.reviewLabel,e[38]=k):k=e[38];let M;e[39]!==R||e[40]!==A||e[41]!==k?(M=b.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1.5 border-t p-1 text-xs",children:[R,A,k]}),e[39]=R,e[40]=A,e[41]=k,e[42]=M):M=e[42];let L;return e[43]!==M||e[44]!==C||e[45]!==T?(L=b.jsxs(b.Fragment,{children:[C,T,M]}),e[43]=M,e[44]=C,e[45]=T,e[46]=L):L=e[46],L},uxe=t=>{const e=ee.c(44),{waypoint:n,isOpen:s,isCurrent:i,isReviewPending:o,isTabStop:r,previewRequest:a,codeLinks:c,writeUp:d,onWriteDescription:f,onOpenCodeLink:p,onToggle:m,onReviewedChange:g,onPreviewChange:y}=t,v=f===void 0?null:f,S=_.useRef(null),[w,N]=_.useState(null),{isOwner:C,claim:T,release:R}=uB(`waypoint:${n.id}`),A=C&&w!==null&&!s;let k;e[0]!==T?(k=()=>{N(mB(S.current)),T()},e[0]=T,e[1]=k):k=e[1];const M=k;let L;e[2]!==R?(L=()=>{N(null),R()},e[2]=R,e[3]=L):L=e[3];const j=L;let D;e[4]!==j||e[5]!==m?(D=()=>{j(),m()},e[4]=j,e[5]=m,e[6]=D):D=e[6];const P=D;gB(A,j),tbe(A,y);let B,I;e[7]!==M||e[8]!==a?(B=()=>a===null?void 0:ebe(M),I=[a,M],e[7]=M,e[8]=a,e[9]=B,e[10]=I):(B=e[9],I=e[10]),_.useEffect(B,I);let F;e[11]!==j||e[12]!==M?(F=J=>{J?M():j()},e[11]=j,e[12]=M,e[13]=F):F=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=b.jsx("button",{ref:S,type:"button"}),e[14]=z):z=e[14];const U=s?void 0:n.anchorId,H=r?0:-1;let V;e[15]!==i||e[16]!==n?(V=b.jsx(axe,{waypoint:n,isCurrent:i}),e[15]=i,e[16]=n,e[17]=V):V=e[17];let W;e[18]!==P||e[19]!==i||e[20]!==s||e[21]!==H||e[22]!==V||e[23]!==U||e[24]!==n.id||e[25]!==n.isReviewed||e[26]!==n.mark.label?(W=b.jsx($m,{delay:$be,render:z,id:U,"aria-label":n.mark.label,"aria-expanded":s,tabIndex:H,"data-gutter-mark":"","data-waypoint-mark":n.id,"data-user-action-id":"waypoint-mark-action","data-current":i,"data-reviewed":n.isReviewed,className:Wbe,onKeyDown:yB,onClick:P,children:V}),e[18]=P,e[19]=i,e[20]=s,e[21]=H,e[22]=V,e[23]=U,e[24]=n.id,e[25]=n.isReviewed,e[26]=n.mark.label,e[27]=W):W=e[27];let G;e[28]!==j||e[29]!==c||e[30]!==P||e[31]!==o||e[32]!==p||e[33]!==g||e[34]!==v||e[35]!==w||e[36]!==n||e[37]!==d?(G=w===null?null:b.jsxs(Sb,{side:"top",align:"start",sideOffset:dB,anchor:w.anchor,collisionPadding:w.collisionPadding,collisionAvoidance:pB,"data-view-section-id":"waypoint-card-section",className:exe,children:[b.jsx(v7,{}),b.jsx(cxe,{waypoint:n,isReviewPending:o,codeLinks:c,writeUp:d,onWriteDescription:v===null?null:()=>{j(),v()},onOpenCodeLink:p,onReviewedChange:g,onExpand:P})]}),e[28]=j,e[29]=c,e[30]=P,e[31]=o,e[32]=p,e[33]=g,e[34]=v,e[35]=w,e[36]=n,e[37]=d,e[38]=G):G=e[38];let Y;return e[39]!==A||e[40]!==W||e[41]!==G||e[42]!==F?(Y=b.jsxs(Bm,{open:A,onOpenChange:F,children:[W,G]}),e[39]=A,e[40]=W,e[41]=G,e[42]=F,e[43]=Y):Y=e[43],Y};function dxe(t){return t!==null}function fxe(t){return{text:t,kind:"plain"}}const fM={middle:3,start:2,end:1,single:0},hM={solid:2,faint:1,quiet:0},hxe=({placed:t,pending:e},n)=>{if(n.kind==="waypoint")return{placed:t,pending:n.waypoint.lines===null?e:[...e,n.waypoint]};if(n.kind==="gap")return{placed:t,pending:[]};const s=n.lines.at(0);return s===void 0||e.length===0?{placed:t,pending:e}:{placed:new Map([...t,[s,e]]),pending:[]}},pxe=t=>t.reduce(hxe,{placed:new Map,pending:[]}).placed,vB=t=>t.flatMap(e=>e.kind==="lines"?[...e.lines]:e.kind==="gap"?[null]:[]),mxe=(t,e,n)=>{const s=t.slice(e),i=s.indexOf(null),o=i===-1?s:s.slice(0,i),r=o.findIndex(a=>(a==null?void 0:a.numberLabel)===String(n));return e+(r===-1?o.length-1:r)},gxe=(t,e,n)=>e===n?"single":t===e?"start":t===n?"end":"middle",yxe=(t,e)=>({reach:t,tone:e,isJoinedAbove:e==="solid"&&(t==="start"||t==="single")}),bxe=(t,e)=>e===void 0?!0:t.tone!==e.tone?hM[t.tone]>hM[e.tone]:fM[t.reach]>fM[e.reach],pM=(t,e,n)=>{const s=vB(t);return[...e].flatMap(([o,r])=>r.flatMap(a=>{const c=n(a.id);if(c===null||a.lines===null)return[];const d=s.indexOf(o),f=mxe(s,d,a.lines.lineEnd);return s.slice(d,f+1).flatMap((p,m)=>p===null?[]:[[p,yxe(gxe(d+m,d,f),c)]])})).reduce((o,[r,a])=>bxe(a,o.get(r))?new Map([...o,[r,a]]):o,new Map)},mM=10,xxe=new Set,SB=new Set,vxe=new Set,Sxe="[data-waypoint-mark]",wxe=new Set(["auto","scroll"]),Exe="transition-opacity duration-[180ms] ease-out data-[unfocused=true]:opacity-45",Cxe=(t,e)=>{const n=t.findIndex(o=>o.kind==="waypoint"&&o.waypoint.id===e);if(n===-1)return xxe;const s=t.slice(n+1),i=s.findIndex(o=>o.kind!=="lines");return new Set((i===-1?s:s.slice(0,i)).map(o=>o.id))},Nxe=(t,e)=>{var n;return((n=t.find(s=>s.kind==="lines"&&Qle(s.lines,e)))==null?void 0:n.id)??null},Txe=(t,e)=>t.flatMap(n=>n.kind==="waypoint"&&n.waypoint.id===e?[n.rootBlockId]:[]).at(0)??null,gM=(t,e,n)=>{const s=Txe(t,e);return{onLine:()=>{n({kind:"waypoint",waypointId:e})},onBlock:s===null?null:()=>{n({kind:"root-block",rootBlockId:s})}}},Oxe=t=>{const e=Number.parseInt(t.startLineLabel,mM),n=Number.parseInt(t.lineLabel,mM);return Array.from({length:Math.max(n-e,0)+1},(s,i)=>M7({side:t.side,lineLabel:String(e+i)}))},yM=(t,e)=>t.side===e.side&&t.lineLabel===e.lineLabel,bM=t=>t.startLineLabel===t.lineLabel?t.lineLabel:`${t.startLineLabel} to ${t.lineLabel}`,Rxe=(t,e)=>t!==null&&e!==null&&t.side===e.side&&t.lineLabel===e.lineLabel,kxe=(t,e)=>new Set([...[...t].filter(n=>!e.includes(n)),...e.filter(n=>!t.has(n))]),xM=(t,e)=>t.startsOpen!==e.has(t.id),mN=t=>t.isReviewed||t.isFoldedByFilter,Axe=t=>new Set(t.filter(mN).map(e=>e.id)),_xe=(t,e)=>mN(t)?e.has(t.id):!e.has(t.id),Mxe=(t,e,n)=>{const s=[...t].filter(o=>o!==e.id),i=mN(e)?n:!n;return new Set(i?[...s,e.id]:s)},Lxe=(t,e)=>new Set(t.filter(n=>_xe(n,e)).map(n=>n.id)),Ixe=(t,e)=>[...[...t].filter(n=>!e.has(n)),...[...e].filter(n=>!t.has(n))],Dxe=t=>{const e=ee.c(9),n=Axe(t),[s,i]=_.useState({foldedIds:n,toggledIds:SB}),o=Ixe(s.foldedIds,n);o.length>0&&i({foldedIds:n,toggledIds:new Set([...s.toggledIds].filter(d=>!o.includes(d)))});let r;e[0]!==s.toggledIds||e[1]!==t?(r=Lxe(t,s.toggledIds),e[0]=s.toggledIds,e[1]=t,e[2]=r):r=e[2];let a;e[3]!==t||e[4]!==i?(a=(d,f)=>{const p=t.find(m=>m.id===d);p!==void 0&&i(m=>({...m,toggledIds:Mxe(m.toggledIds,p,f)}))},e[3]=t,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==a?(c={openRootBlockIds:r,onRootBlockOpenChange:a},e[6]=r,e[7]=a,e[8]=c):c=e[8],c},jxe=(t,e)=>t!==null&&!e.has(t),vM=(t,e)=>{var n;return((n=[...(t==null?void 0:t.querySelectorAll(Sxe))??[]].find(s=>s.dataset.waypointMark===e))==null?void 0:n.getBoundingClientRect().top)??null},Pxe=t=>wxe.has(getComputedStyle(t).overflowY)&&t.scrollHeight>t.clientHeight,wB=t=>{const e=(t==null?void 0:t.parentElement)??null;return e===null?window:Pxe(e)?e:wB(e)},zxe=(t,e)=>{const n=ee.c(7),s=_.useRef(null);let i;n[0]!==t.current?(i=()=>{const a=s.current;s.current=null;const c=a===null?null:vM(t.current,a.waypointId);a!==null&&c!==null&&wB(t.current).scrollBy(0,c-a.top)},n[0]=t.current,n[1]=i):i=n[1];let o;n[2]!==e||n[3]!==t?(o=[t,e],n[2]=e,n[3]=t,n[4]=o):o=n[4],_.useLayoutEffect(i,o);let r;return n[5]!==t.current?(r=a=>{const c=vM(t.current,a);s.current=c===null?null:{waypointId:a,top:c}},n[5]=t.current,n[6]=r):r=n[6],r},EB=t=>{const e=ee.c(56),{path:n,label:s,rows:i,rootBlocks:o,threads:r,previewVisit:a,openWaypointIds:c,currentWaypointId:d,focusedWaypointId:f,isCollapsed:p,isWrapped:m,isReviewPending:g,commenting:y,codeLinks:v,codeDefinitions:S,onOpenCodeLink:w,onToggleWaypoint:N,onPreviewWaypoint:C,onWaypointReviewedChange:T,onRootBlockReviewedChange:R,onWriteUp:A,authoring:k}=t,M=a===void 0?null:a,L=p===void 0?!1:p,j=m===void 0?!1:m,D=C===void 0?null:C,P=A===void 0?null:A,B=k===void 0?null:k,I=_.useRef(null),[F,z]=_.useState(null),[U,H]=_.useState(SB),{openRootBlockIds:V,onRootBlockOpenChange:W}=Dxe(o),G=zxe(I,c);if(L)return null;let Y,J;if(e[0]!==B||e[1]!==S||e[2]!==v||e[3]!==y||e[4]!==d||e[5]!==f||e[6]!==G||e[7]!==g||e[8]!==j||e[9]!==s||e[10]!==w||e[11]!==D||e[12]!==W||e[13]!==R||e[14]!==N||e[15]!==T||e[16]!==P||e[17]!==V||e[18]!==c||e[19]!==n||e[20]!==M||e[21]!==F||e[22]!==o||e[23]!==i||e[24]!==r||e[25]!==U){const X=pxe(i),Z=ze=>ze===null?vxe:new Set(pM(i,X,Te=>Te===ze?"faint":null).keys()),te=Z(f),Q=te.size===0?Cxe(i,f):new Set(i.filter(ze=>ze.kind==="lines"&&ze.lines.some(Te=>te.has(Te))).map(Bxe));let se;e[28]!==S||e[29]!==i?(se=Nxe(i,S),e[28]=S,e[29]=i,e[30]=se):se=e[30];const ae=se,le=Q.size>0,ne=(y==null?void 0:y.composingRange)??null;let fe;e[31]!==ne||e[32]!==r?(fe=new Set([...r,...ne===null?[]:[ne]].flatMap(Oxe)),e[31]=ne,e[32]=r,e[33]=fe):fe=e[33];const ve=fe,we=new Set([...X.values()].flat().map($xe));let Ce;e[34]!==d||e[35]!==c?(Ce=ze=>c.has(ze)?"solid":ze===d?"faint":"quiet",e[34]=d,e[35]=c,e[36]=Ce):Ce=e[36];const Oe=pM(i,X,Ce),be=Z(F);let _e;e[37]!==r?(_e=ze=>r.filter(Te=>yM(Te,ze)),e[37]=r,e[38]=_e):_e=e[38];const Me=_e,Be=vB(i).find(ze=>{if(ze===null)return!1;const Te=Qw(ze);return X.has(ze)||Te!==null&&Me(Te).length>0})??null,He=Be===null?null:Qw(Be);let Ae;e[39]!==v||e[40]!==w?(Ae=ze=>b.jsx(Yae,{blocks:ze,codeLinks:v,onOpenCodeLink:w}),e[39]=v,e[40]=w,e[41]=Ae):Ae=e[41];const Ee=Ae,Ne=ze=>{const Te=X.get(ze)??[];return b.jsx(nxe,{stem:Oe.get(ze)??null,hasMark:Te.length>0,children:Te.map((qe,ot)=>b.jsx(uxe,{waypoint:qe,isOpen:c.has(qe.id),isCurrent:qe.id===d,isReviewPending:g,isTabStop:ze===Be&&ot===0,previewRequest:(M==null?void 0:M.waypointId)===qe.id?M.count:null,codeLinks:v,writeUp:P===null?null:gM(i,qe.id,P),onWriteDescription:B===null?null:()=>{B.onWriteDescription(qe.id)},onOpenCodeLink:w,onToggle:()=>{G(qe.id),N(qe.id)},onReviewedChange:T===null?null:bt=>{T(qe.id,bt)},onPreviewChange:bt=>{bt&&D!==null&&D(qe.id),z(Ct=>bt?qe.id:Ct===qe.id?null:Ct)}},qe.id))})},xe=ze=>{const Te=y===null?[]:Me(ze);return Te.length===0?null:b.jsx(mbe,{threads:Te,isOpen:Te.some(qe=>xM(qe,U)),isTabStop:Rxe(ze,He)&&Be!==null&&!X.has(Be),onToggle:()=>{H(qe=>kxe(qe,Te.map(Fxe)))}})};let Pe;e[42]!==g||e[43]!==R||e[44]!==V||e[45]!==o?(Pe=ze=>{const Te=o.find(ot=>ot.id===ze);if(Te===void 0)return null;const qe=V.has(ze);return b.jsxs(b.Fragment,{children:[Te.coreChangeLabel===null?null:b.jsx(Ma,{kind:"core-change",label:Te.coreChangeLabel}),Te.spotlight===null?null:b.jsx(pN,{spotlight:Te.spotlight}),R===null?null:b.jsx(zb,{label:Te.reviewLabel,accessibleLabel:Te.reviewName,isReviewed:Te.isReviewed,isDisabled:g,className:"h-6",onChange:ot=>{R(ze,ot)}}),b.jsx(ole,{"aria-label":qe?Te.collapseLabel:Te.expandLabel,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",children:b.jsx(lu,{"aria-hidden":"true",className:Se("size-4 transition-transform duration-[180ms] ease-out",qe?"":"-rotate-90")})})]})},e[42]=g,e[43]=R,e[44]=V,e[45]=o,e[46]=Pe):Pe=e[46];const We=Pe;let et;e[47]!==y||e[48]!==ne||e[49]!==n||e[50]!==Me||e[51]!==U?(et=ze=>y===null?null:b.jsxs(b.Fragment,{children:[Me(ze).filter(Te=>xM(Te,U)).map(Te=>b.jsx(Oye,{comments:Te.comments,label:`${n} ${bM(Te)}`,rangeLabel:Te.rangeLabel,statusLabel:Te.statusLabel,resolution:Te.resolution,canReply:Te.canReply,replyPlaceholder:y.composer.replyPlaceholder,submitLabel:y.composer.replyLabel,cancelLabel:y.composer.cancelLabel,isSubmitting:y.isCommentPending,renderEditor:y.renderCommentEditor,onReply:qe=>{y.onReply(Te.id,qe)},onResolve:qe=>{y.onResolveThread(Te.id,qe)},onDiscard:y.onDiscardComment},Te.id)),ne!==null&&yM(ne,ze)?b.jsx(hN,{label:`${y.composer.placeholder}, ${n} ${bM(ne)}`,submitLabel:y.composer.submitLabel,postNowLabel:y.composer.postNowLabel,cancelLabel:y.composer.cancelLabel,hint:y.composer.rangeHint,isSubmitting:y.isCommentPending,shouldFocus:!0,className:"my-1.5 mr-4 ml-28 max-w-[52rem] rounded-md border border-input bg-card p-3 font-sans whitespace-normal",renderEditor:y.renderCommentEditor,onSubmit:Te=>{y.onAddComment(n,ne,Te)},onPostNow:Te=>{y.onPostComment(n,ne,Te)},onCancel:()=>{y.onStartComment(n,null,!1)}}):null]}),e[47]=y,e[48]=ne,e[49]=n,e[50]=Me,e[51]=U,e[52]=et):et=e[52];const At=et;Y=I,J=i.map(ze=>{if(ze.kind==="lines"){const bt=Q.has(ze.id);return b.jsx("div",{"data-unfocused":le&&!bt,"data-waypoint-focus":bt?f??void 0:void 0,className:Exe,children:b.jsx(Au,{lines:ze.lines,definitions:S,hasReferenceTabStop:ze.id===ae,renderDefinitionDescription:Ee,path:n,label:s,isWrapped:j,className:"py-0",collapses:ze.collapses,openRootBlockIds:V,renderCollapseControls:We,onRootBlockOpenChange:W,commentedLineKeys:ve,markedLines:be,renderLineThreads:At,renderWaypointLane:Ne,renderThreadMark:xe,...y===null?{}:{addCommentLabel:y.composer.addLabel,onAddComment:(Ct,En)=>{y.onStartComment(n,Ct,En)}}})},ze.id)}if(jxe(ze.rootBlockId,V))return null;if(ze.kind==="gap")return b.jsx("p",{className:"border-y bg-muted/60 py-0.5 pl-28 font-mono text-xs text-muted-foreground first-of-type:border-t-0 last:border-b-0",children:ze.label},ze.id);const Te=we.has(ze.waypoint.id),qe=c.has(ze.waypoint.id),ot=(B==null?void 0:B.editedWaypointId)===ze.waypoint.id;return Te&&!qe&&!ot?null:b.jsxs("div",{"data-waypoint-focus":ze.waypoint.id===f?f:void 0,className:"relative bg-code",children:[Te?b.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-5 bottom-0 left-[calc(0.625rem-1px)] w-0.5 bg-(--line)"}):null,ot?B.renderEditor(ze.waypoint.id):b.jsx(Bbe,{waypoint:ze.waypoint,isOpen:qe,isCurrent:ze.waypoint.id===d,isReviewPending:g,isGuttered:!0,codeLinks:v,actions:B==null?void 0:B.renderActions(ze.waypoint.id),writeUp:P===null?null:gM(i,ze.waypoint.id,P),onWriteDescription:B===null?null:()=>{B.onWriteDescription(ze.waypoint.id)},onOpenCodeLink:w,onToggle:()=>{N(ze.waypoint.id)},onReviewedChange:T===null?null:bt=>{T(ze.waypoint.id,bt)}})]},ze.id)}),e[0]=B,e[1]=S,e[2]=v,e[3]=y,e[4]=d,e[5]=f,e[6]=G,e[7]=g,e[8]=j,e[9]=s,e[10]=w,e[11]=D,e[12]=W,e[13]=R,e[14]=N,e[15]=T,e[16]=P,e[17]=V,e[18]=c,e[19]=n,e[20]=M,e[21]=F,e[22]=o,e[23]=i,e[24]=r,e[25]=U,e[26]=Y,e[27]=J}else Y=e[26],J=e[27];let q;return e[53]!==Y||e[54]!==J?(q=b.jsx("div",{ref:Y,children:J}),e[53]=Y,e[54]=J,e[55]=q):q=e[55],q};function Bxe(t){return t.id}function $xe(t){return t.id}function Fxe(t){return t.id}const Hxe=new Set,Uxe=[],Vxe=[],qxe=(t,e)=>new Set(t.has(e)?[...t].filter(n=>n!==e):[...t,e]),Wxe='[data-focused="true"]',Gxe=(t,e)=>{const n=Number.parseInt(t,10);return e.some(([s,i])=>s<=n&&n<=i)},Kxe=(t,e)=>e===null?t:t.map(n=>({...n,isFocused:Gxe(n.numberLabel,e)})),Yxe=({id:t,rows:e},n)=>e.map(s=>s.kind==="lines"?{...s,lines:Kxe(s.lines,n)}:s.kind==="waypoint"?{...s,waypoint:{...s.waypoint,anchorId:`${t}-${s.waypoint.anchorId}`}}:s),Xxe=t=>{const e=ee.c(40),{view:n,focusedLines:s,isReviewPending:i,codeLinks:o,codeDefinitions:r,onOpenCodeLink:a,onWaypointReviewedChange:c}=t,d=s===void 0?null:s,[f,p]=_.useState(Hxe),m=`${n.pathLabel}, ${n.rangeLabel}`,g=_.useRef(null);let y,v;e[0]!==d?(y=()=>{var B,I;d!==null&&((I=(B=g.current)==null?void 0:B.querySelector(Wxe))==null||I.scrollIntoView({block:"center"}))},v=[d],e[0]=d,e[1]=y,e[2]=v):(y=e[1],v=e[2]),_.useEffect(y,v);const S=`${n.heading}, ${m}`;let w;e[3]!==n.heading?(w=b.jsx("span",{className:"font-bold",children:n.heading}),e[3]=n.heading,e[4]=w):w=e[4];let N;e[5]!==n.countLabel?(N=n.countLabel===null?null:b.jsx("span",{className:"tabular-nums",children:` • ${n.countLabel}`}),e[5]=n.countLabel,e[6]=N):N=e[6];let C;e[7]!==w||e[8]!==N?(C=b.jsxs("h4",{className:"px-4 pt-3 text-xs text-muted-foreground",children:[w,N]}),e[7]=w,e[8]=N,e[9]=C):C=e[9];let T;e[10]!==n.pathLabel?(T=b.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:n.pathLabel}),e[10]=n.pathLabel,e[11]=T):T=e[11];let R;e[12]!==n.rangeLabel?(R=b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:n.rangeLabel}),e[12]=n.rangeLabel,e[13]=R):R=e[13];let A;e[14]!==T||e[15]!==R?(A=b.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[T,R]}),e[14]=T,e[15]=R,e[16]=A):A=e[16];const k=n.pathLabel;let M;e[17]!==d||e[18]!==n?(M=Yxe(n,d),e[17]=d,e[18]=n,e[19]=M):M=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=B=>{p(I=>qxe(I,B))},e[20]=L):L=e[20];let j;e[21]!==r||e[22]!==o||e[23]!==i||e[24]!==m||e[25]!==a||e[26]!==c||e[27]!==f||e[28]!==M||e[29]!==n.pathLabel?(j=b.jsx("div",{className:"border-y bg-code",children:b.jsx(EB,{path:k,label:m,rows:M,rootBlocks:Uxe,threads:Vxe,openWaypointIds:f,currentWaypointId:null,focusedWaypointId:null,isWrapped:!0,isReviewPending:i,commenting:null,codeLinks:o,codeDefinitions:r,onOpenCodeLink:a,onToggleWaypoint:L,onWaypointReviewedChange:c,onRootBlockReviewedChange:null})}),e[21]=r,e[22]=o,e[23]=i,e[24]=m,e[25]=a,e[26]=c,e[27]=f,e[28]=M,e[29]=n.pathLabel,e[30]=j):j=e[30];let D;e[31]!==n.forgeLink||e[32]!==n.note?(D=n.note===null&&n.forgeLink===null?null:b.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1 px-4 py-2 text-xs",children:[n.note===null?null:b.jsx("span",{className:"text-muted-foreground",children:n.note}),n.forgeLink===null?null:b.jsx(Qa,{href:n.forgeLink.href,label:n.forgeLink.label})]}),e[31]=n.forgeLink,e[32]=n.note,e[33]=D):D=e[33];let P;return e[34]!==A||e[35]!==j||e[36]!==D||e[37]!==S||e[38]!==C?(P=b.jsxs("section",{ref:g,"aria-label":S,"data-reference-scope":"",className:"border-t",children:[C,A,j,D]}),e[34]=A,e[35]=j,e[36]=D,e[37]=S,e[38]=C,e[39]=P):P=e[39],P},gN=264,ec=96,Qxe=36,Zxe=48,Jxe=16,e2e=20,t2e=4,Ef=24,Yp=18,n2e=6,s2e=6,my=10,i2e=8,yN=96,Ym=32,lr=24,ao=2,CB=gN-my*ao,bN={nodes:[],rows:[],lanes:[]},Bb=t=>t.reduce((e,n)=>e+n,0),o2e={heading:Jxe,row:Qxe,"two-line-row":Zxe},SM=1,NB=({kind:t,lineCount:e=SM})=>t==="parameters"?e*e2e+(e-SM)*t2e:o2e[t],TB="card",r2e=t=>t.kind!==TB,OB=t=>{const e=new Map(t.children.map(s=>[s.id,s])),n=new Set(t.rows.filter(s=>s.kind===TB).map(s=>s.id));return[...t.rows.flatMap(s=>{if(r2e(s))return[{kind:"row",row:s}];const i=e.get(s.id);return i===void 0?[]:[{kind:"card",node:i}]}),...t.children.filter(s=>!n.has(s.id)).map(s=>({kind:"card",node:s}))]},RB=t=>(t.kind==="row"?NB(t.row):Xm(t.node).height)+s2e,Xm=t=>{const e=t.children.map(Xm);return{width:Math.max(gN,...e.map(n=>n.width+my*ao)),height:ec+Bb(OB(t).map(RB))+i2e}},kB=(t,e,n,s)=>{const{height:i}=Xm(t),o={x:e.x+my,width:e.width-my*ao},r=(c,d)=>c.kind==="row"?{nodes:[],rows:[{id:c.row.id,kind:c.row.kind,nodeId:t.id,...o,y:d,height:NB(c.row)}],lanes:[]}:kB(c.node,{...o,y:d},n+1,s),{placed:a}=OB(t).reduce(({top:c,placed:d},f)=>({top:c+RB(f),placed:xN([d,r(f,c)])}),{top:e.y+ec,placed:bN});return{nodes:[{id:t.id,topId:s,depth:n,...e,height:i},...a.nodes],rows:a.rows,lanes:[]}},AB=t=>[t.id,...t.children.flatMap(AB)],xN=t=>({nodes:t.flatMap(e=>e.nodes),rows:t.flatMap(e=>e.rows),lanes:t.flatMap(e=>e.lanes)}),l2e=(t,e)=>{const n=new Map(t.flatMap(s=>AB(s).map(i=>[i,s.id])));return e.flatMap(s=>{const i=n.get(s.from),o=n.get(s.to);return i===void 0||o===void 0||i===o?[]:[{edge:s,from:i,to:o}]})},a2e={visitedIds:new Set,closingLinks:[]},_B=(t,e,n,s)=>{if(s.visitedIds.has(t))return s;const i=[...e,t];return n.filter(o=>o.from===t).reduce((o,r)=>i.includes(r.to)?{...o,closingLinks:[...o.closingLinks,r]}:_B(r.to,i,n,o),{...s,visitedIds:new Set([...s.visitedIds,t])})},c2e=(t,e)=>{const n=new Set(e.map(o=>o.to)),s=[...t.filter(o=>!n.has(o.id)),...t.filter(o=>n.has(o.id))].map(o=>o.id),{closingLinks:i}=s.reduce((o,r)=>_B(r,[],e,o),a2e);return e.filter(o=>!i.includes(o))},u2e=(t,e,n)=>new Map([...t].map(([s,i])=>{const o=e.filter(r=>r.to===s).map(r=>(t.get(r.from)??0)+1);return[s,Math.min(n,Math.max(i,...o))]})),d2e=t=>{const e=[...new Set(t.values())].sort((n,s)=>n-s);return new Map([...t].map(([n,s])=>[n,e.indexOf(s)]))},f2e=(t,e)=>{const n=c2e(t,e);return d2e(t.reduce(s=>u2e(s,n,t.length-1),new Map(t.map(s=>[s.id,0]))))},gy=(t,e)=>t.get(e)??0,h2e=({from:t,to:e},n,s)=>gy(s,t)<n&&n<gy(s,e),wE=t=>t.y+ec/ao,EE=t=>t.y+t.height/ao,p2e=({from:t,fromRowId:e},{nodes:n,rows:s})=>{const i=e===null?void 0:s.find(r=>r.id===e);if(i!==void 0)return EE(i);const o=n.find(r=>r.id===t);return o===void 0?null:wE(o)},CE=({y:t,edgeIds:e},n)=>t+e.indexOf(n)*Yp,yy=t=>(t.length-1)*Yp,MB=(t,e,n)=>{const s=n.lanes.find(i=>i.toId===t.to&&i.column===e-1&&i.edgeIds.includes(t.edge.id));return s===void 0?p2e(t.edge,n):CE(s,t.edge.id)},m2e=(t,e,n,s,i)=>n.filter(o=>o.to===t&&gy(s,o.from)<e).flatMap(o=>MB(o,e,i)??[]),g2e=(t,e,n,s)=>{const i=e.filter(o=>o.to===t).map((o,r)=>({link:o,index:r,comingFrom:MB(o,n,s)??0})).sort((o,r)=>o.comingFrom-r.comingFrom||o.index-r.index).map(({link:o})=>o.edge.id);return{node:null,toId:t,height:yy(i),anchorHeight:yy(i),edgeIds:i}},y2e=(t,e,n,s,i)=>{const o=n.filter(a=>h2e(a,e,s)),r=[...new Set(o.map(a=>a.to))];return[...t.filter(a=>gy(s,a.id)===e).map(a=>({node:a,toId:a.id,height:Xm(a).height,anchorHeight:ec,edgeIds:[]})),...r.map(a=>g2e(a,o,e,i))]},b2e=({toId:t,anchorHeight:e},n)=>{const s=n(t);return s.length===0?lr:Bb(s)/s.length-e/ao},x2e=({node:t,toId:e,edgeIds:n},s,i)=>t===null?{...bN,lanes:[{toId:e,column:s,x:i.x,width:i.width,y:i.y,edgeIds:n}]}:kB(t,i,0,t.id),LB=t=>t.reduce(({bottom:e,offsets:n},{item:s})=>({bottom:e+s.height+Ym,offsets:[...n,e]}),{bottom:0,offsets:[]}).offsets,v2e=({members:t})=>Bb(t.map(({item:e})=>e.height))+Ym*(t.length-1),S2e=t=>{const e=LB(t);return Bb(t.map(({top:n},s)=>n-e[s]))/t.length},w2e=(t,e)=>t.top+v2e(t)+Ym>e.top,E2e=(t,e)=>{const n=[...t.members,...e.members];return{members:n,top:S2e(n)}},IB=(t,e)=>{const n=t.at(-1);return n!==void 0&&w2e(n,e)?IB(t.slice(0,-1),E2e(n,e)):[...t,e]},C2e=t=>t.reduce((e,n)=>IB(e,{members:[n],top:n.top}),[]),N2e=(t,e,n,s)=>{const i=t.map((r,a)=>({item:r,index:a,top:b2e(r,s)})).sort((r,a)=>r.top-a.top||r.index-a.index),o=Math.max(gN,...t.flatMap(({node:r})=>r===null?[]:[Xm(r).width]));return xN(C2e(i).flatMap(r=>{const a=Math.round(r.top),c=LB(r.members);return r.members.map(({item:d},f)=>x2e(d,e,{x:n,y:a+c[f],width:o}))}))},T2e=({nodes:t,lanes:e})=>Math.min(...t.map(n=>n.y),...e.map(n=>n.y)),O2e=({nodes:t,rows:e,lanes:n},s)=>({nodes:t.map(i=>({...i,y:i.y+s})),rows:e.map(i=>({...i,y:i.y+s})),lanes:n.map(i=>({...i,y:i.y+s}))}),R2e=t=>O2e(t,lr-T2e(t)),DB=({nodes:t,lanes:e})=>Math.max(lr-yN,...t.map(n=>n.x+n.width),...e.map(n=>n.x+n.width)),k2e=(t,e,n)=>[...new Set(n.values())].sort((i,o)=>i-o).reduce((i,o)=>{const r=y2e(t,o,e,n,i),a=N2e(r,o,DB(i)+yN,c=>m2e(c,o,e,n,i));return xN([i,a])},bN),A2e=({edge:t},e)=>e.filter(n=>n.edgeIds.includes(t.id)).sort((n,s)=>n.column-s.column).flatMap(n=>[{x:n.x,y:CE(n,t.id)},{x:n.x+n.width,y:CE(n,t.id)}]),_2e=(t,{nodes:e,rows:n,lanes:s})=>{const i=new Map(e.map(r=>[r.id,r])),o=new Map(n.map(r=>[r.id,r]));return t.flatMap(r=>{const{edge:a}=r,c=i.get(a.from),d=i.get(a.to),f=i.get(r.from),p=i.get(r.to);if(c===void 0||d===void 0||f===void 0||p===void 0)return[];const m=a.fromRowId===null?void 0:o.get(a.fromRowId),g=a.toRowId===null?void 0:o.get(a.toRowId);return[{link:r,start:{x:f.x+f.width,y:m===void 0?wE(c):EE(m)},lanePoints:A2e(r,s),end:{x:p.x,y:g===void 0?wE(d):EE(g)},fromRow:m,toRow:g}]})},wM=({link:t,toRow:e})=>(e==null?void 0:e.id)??t.edge.to,EM=({start:t,lanePoints:e})=>e.length===0?t.y:e[e.length-1].y,M2e=(t,e)=>{const n=e.filter(r=>wM(r)===wM(t)).map((r,a)=>({other:r,index:a})).sort((r,a)=>EM(r.other)-EM(a.other)||r.index-a.index),s=(t.toRow===void 0?ec:t.toRow.height)-n2e*ao,i=n.length<ao?0:Math.min(Yp,s/(n.length-1)),o=n.findIndex(({other:r})=>r===t);return Math.round((o-(n.length-1)/ao)*i)},jB=({start:t,end:e})=>t.x>=e.x,L2e=(t,e,{nodes:n,lanes:s})=>Math.max(...n.filter(i=>i.x<e&&i.x+i.width>t).map(i=>i.y+i.height),...s.filter(i=>i.x<e&&i.x+i.width>t).map(i=>i.y+yy(i.edgeIds))),I2e=(t,e,n,s)=>{const i=n.filter(jB),o=t.start.x+Ef+i.indexOf(t)*Yp,r=e.x-Ef,a=Math.max(...i.map(c=>L2e(c.end.x,c.start.x,s)))+Ym/ao+i.indexOf(t)*Yp;return[{x:o,y:t.start.y},{x:o,y:a},{x:r,y:a},{x:r,y:e.y}]},D2e=(t,e,n)=>{const{link:s,start:i,lanePoints:o,fromRow:r,toRow:a}=t,c={x:t.end.x,y:t.end.y+M2e(t,e)},d=jB(t)?I2e(t,c,e,n):[...o,{x:c.x-Ef,y:c.y}];return{...s.edge,points:[i,...d,c],fromRowPoints:r===void 0?null:[{x:r.x+r.width,y:i.y},i],toRowPoints:a===void 0?null:[c,{x:a.x,y:c.y}]}},j2e=(t,e)=>{const n=_2e(t,e);return n.map(s=>D2e(s,n,e))},P2e=(t,e)=>{if(t.length===0)return{width:lr*ao,height:lr*ao,nodes:[],rows:[],edges:[]};const n=l2e(t,e),s=f2e(t,n),i=R2e(k2e(t,n,s)),o=j2e(n,i),r=o.flatMap(a=>a.points);return{width:Math.max(DB(i),...r.map(a=>a.x))+lr,height:Math.max(...i.nodes.map(a=>a.y+a.height),...i.lanes.map(a=>a.y+yy(a.edgeIds)),...r.map(a=>a.y))+lr,nodes:i.nodes,rows:i.rows,edges:o}},PB=2,CM={x:0,y:0},NE="left",NM=({x:t,y:e})=>t===0&&e===0,Id=(t,e)=>({...t,x:t.x+e.x,y:t.y+e.y}),z2e=(t,e,n)=>{const s=e.map(a=>{var c;return(((c=n.get(a.id))==null?void 0:c.x)??a.x)+a.width}),i=Math.max(...s)+yN,o=e.map(a=>{var c;return((c=n.get(a.id))==null?void 0:c.y)??a.y}),r=t.reduce(({bottom:a,positions:c},d)=>({bottom:a+d.height+Ym,positions:[...c,[d.id,{x:i,y:a}]]}),{bottom:Math.max(lr,Math.min(...o)),positions:[]});return new Map(r.positions)},B2e=(t,{x:e,y:n,width:s,height:i})=>{const o=[["left",Math.abs(t.x-e)],["top",Math.abs(t.y-n)],["bottom",Math.abs(t.y-(n+i))]],r=t.x>e+s/PB,[a]=[...o].filter(([c])=>c!=="left"||!r).sort(([,c],[,d])=>c-d);return a[0]},$2e=(t,e)=>{const n=t.nodes.filter(o=>o.depth===0),s=n.filter(o=>e.has(o.id)),i=n.filter(o=>!e.has(o.id));return s.length===0||i.length===0?e:new Map([...e,...z2e(i,s,e)])},F2e=(t,e)=>{const n=t.x+t.width/PB;return e==="top"?[{x:n,y:t.y-Ef},{x:n,y:t.y}]:[{x:n,y:t.y+t.height+Ef},{x:n,y:t.y+t.height}]},H2e=(t,e,n,s,i)=>{const o=Id(t.points[0],e),r=t.fromRowPoints===null?null:t.fromRowPoints.map(c=>Id(c,e));if(s!==NE&&i!==void 0)return{...t,points:[o,...F2e(i,s)],fromRowPoints:r,toRowPoints:null};const a=Id(t.points[t.points.length-1],n);return{...t,points:[o,{x:a.x-Ef,y:a.y},a],fromRowPoints:r,toRowPoints:t.toRowPoints===null?null:t.toRowPoints.map(c=>Id(c,n))}},U2e=(t,e,n)=>{const s=t.nodes.filter(f=>f.depth===0),i=new Map(s.map(f=>{const p=e.get(f.id);return[f.id,p===void 0?CM:{x:p.x-f.x,y:p.y-f.y}]})),o=f=>i.get(f)??CM,r=t.nodes.map(f=>Id(f,o(f.topId))),a=new Map(r.map(f=>[f.id,f])),c=f=>{var p;return o(((p=a.get(f))==null?void 0:p.topId)??f)},d=t.edges.map(f=>{const p=c(f.from),m=c(f.to),g=n.get(f.id)??NE;return NM(p)&&NM(m)&&g===NE?f:H2e(f,p,m,g,a.get(f.to))});return{width:Math.max(t.width,...r.map(f=>f.x+f.width+lr)),height:Math.max(t.height,...r.map(f=>f.y+f.height+lr)),nodes:r,rows:t.rows.map(f=>Id(f,c(f.nodeId))),edges:d}},V2e={x:0,y:0},zB=t=>t.flatMap(e=>[...e.children.map(n=>[n.id,e.id]),...zB(e.children)]),by=(t,e)=>({...t,x:t.x-e.x,y:t.y-e.y}),xy=(t,e)=>`${t}:${e}`,q2e=({id:t,from:e,to:n,points:s,fromRowPoints:i,toRowPoints:o})=>[{id:t,edgeId:t,source:e,target:n,points:s,hasArrow:o===null,isAboveNodes:!1},...i===null?[]:[{id:`${t}:from-row`,edgeId:t,source:e,target:e,points:i,hasArrow:!1,isAboveNodes:!0}],...o===null?[]:[{id:`${t}:to-row`,edgeId:t,source:n,target:n,points:o,hasArrow:!0,isAboveNodes:!0}]],W2e=t=>{const e=t.flatMap(q2e);return[...e.filter(n=>!n.isAboveNodes),...e.filter(n=>n.isAboveNodes)]},G2e=(t,e)=>e.flatMap(({id:n,source:s,target:i,points:o})=>[...s===t.id?[{id:xy(n,"source"),type:"source",...by(o[0],t)}]:[],...i===t.id?[{id:xy(n,"target"),type:"target",...by(o[o.length-1],t)}]:[]]),K2e=({id:t,edgeId:e,source:n,target:s,points:i,hasArrow:o,isAboveNodes:r})=>({id:t,edgeId:e,source:n,target:s,sourceHandleId:xy(t,"source"),targetHandleId:xy(t,"target"),bends:i.slice(1,-1),hasArrow:o,isAboveNodes:r}),Y2e=(t,e)=>{const n=new Map(zB(t)),s=new Map(e.nodes.map(o=>[o.id,o])),i=W2e(e.edges);return{frames:e.nodes.map(o=>{const r=n.get(o.id)??null,a=r===null?void 0:s.get(r);return{id:o.id,parentId:a===void 0?null:a.id,depth:o.depth,position:by({x:o.x,y:o.y},a??V2e),width:o.width,height:o.height,rows:e.rows.filter(c=>c.nodeId===o.id).map(c=>by(c,o)),handles:G2e(o,i)}}),lines:i.map(K2e)}},X2e="Not explained yet.",Q2e="The agent is explaining this card.",BB="Explain this card",vy={"root-argument-value":Bd,call:xw,request:xw,component:ZX,hook:AD,class:tQ,"root-variable":Bd,config:Bd,state:Od,derived:Od,data:Od,"data-fetch":Od,cache:Od,"render-event":gA,"code-event":gA,effect:Sw,"component-effect":Sw,route:Vv,resolver:Vv,middleware:Vv},vN={added:"border-diff-added",modified:"border-line-blue"},Z2e={added:"text-diff-added",modified:"text-line-blue"},J2e={selected:"border-primary outline outline-primary",hovered:"border-primary/60 outline outline-primary/60"},$B={selected:"bg-accent outline outline-primary",hovered:"outline outline-primary/60"},TM={collapsedNodeIds:[],focusedNodeId:null},eve="call",ol=2,FB="trace-node",HB="trace-new-card",TE="trace-new-card",OE="new-card:line-end",OM="trace-new-card-line",ip=32,RM="Create Card",tve="nodrag nopan flex size-full items-center justify-center rounded-full border border-dashed border-primary bg-card text-primary transition-colors duration-[180ms] ease-out hover:bg-accent disabled:opacity-60",RE="trace-line",vS=1e3,nve=4,UB={source:Ze.Right,target:Ze.Left},VB="right-auto bottom-auto size-0 min-h-0 min-w-0 transform-none border-0 bg-transparent",sve="size-full bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[measured=false]:invisible",ive={hideAttribution:!0},kE="text-muted-foreground",kM={pointerEvents:"all"},ove="absolute inset-0 rounded-md transition-colors duration-[180ms] ease-out",rve="flex w-full flex-col rounded-md text-left",lve="flex h-7 shrink-0 items-center gap-2 rounded-t-md border-b border-input bg-foreground/5 px-2.5",ave="flex min-h-0 flex-1 flex-col justify-center gap-1 px-3",AM={argument:Bd,property:Bd,state:Od,hook:AD,effect:Sw,call:xw},qB="absolute flex items-center gap-2 rounded border border-input bg-card px-2 text-left transition-colors duration-[180ms] ease-out hover:bg-accent",cve="absolute top-1 right-1 z-10 hidden gap-0.5 rounded-md border border-input bg-card p-0.5 group-focus-within:flex group-hover:flex data-[pinned=true]:flex",n1="flex size-6 items-center justify-center rounded text-foreground transition-colors duration-[180ms] ease-out hover:bg-accent aria-pressed:text-primary-text",uve="Parameters",dve=":parameters",fve=6.7,hve=14,pve=4,mve="absolute flex flex-wrap content-start gap-1",gve="flex h-5 max-w-full items-center rounded-sm border bg-muted px-1.5 font-mono text-[0.6875rem] leading-4 text-muted-foreground",yve="absolute flex items-end px-0.5 text-[0.625rem] leading-3 font-bold tracking-wide text-muted-foreground uppercase",_M="Show only the paths through this node",bve="Hide the nodes this node leads to",xve="Show the nodes this node leads to again",MM="Modify this card",LM="Delete this card and the cards it points to",vve="Remove the selected line",Sve="Add card",WB="Clear diagram",GB="Remove diagram",wve="This diagram has no card yet.",Eve="c",Cve="k",Nve="l",Tve={clear:{title:"Clear this diagram?",description:"Every card, every line and the description go. The diagram stays, empty.",confirmLabel:WB},remove:{title:"Remove this diagram?",description:"The diagram goes from this segment with its cards, its lines and its description.",confirmLabel:GB}},Ove="Draw a line from this row",KB=["left","top","bottom"],Rve={left:Ze.Left,top:Ze.Top,bottom:Ze.Bottom},kve={left:"End a line on the left of this card",top:"End a line on the top of this card",bottom:"End a line on the bottom of this card"},Xp="row:",Ave="side:",IM=5,DM=10,_ve="nodrag right-auto bottom-auto z-10 size-2.5 min-h-0 min-w-0 transform-none rounded-full border border-primary bg-card opacity-60 transition-opacity duration-[180ms] ease-out hover:opacity-100",Mve="cursor-pointer fill-none stroke-transparent [stroke-width:14]",Lve=new Map,Ive=".react-flow__node",Dve=28,jve={stroke:"var(--primary)",strokeWidth:2},Pve="Collapse all",zve="Expand all",Bve="q",SN=t=>t.flatMap(e=>[e,...SN(e.children)]),$ve=":heading:",YB=(t,e)=>[t.id,String(e)].join($ve),XB=t=>t.blockLists.flatMap(({kind:e,label:n,blocks:s})=>s.map(i=>({kind:e,kindLabel:n,block:i}))),Fve=t=>t.rowGroups.flatMap(({label:e},n)=>e===null?[]:[{id:YB(t,n),label:e}]),Hve=t=>Math.min(CB,t.length*fve+hve),Uve=t=>t.reduce(({lineCount:e,lineWidth:n},s)=>{const i=Hve(s),o=n===0?i:n+pve+i;return o<=CB?{lineCount:e,lineWidth:o}:{lineCount:e+1,lineWidth:i}},{lineCount:1,lineWidth:0}).lineCount,Vve=t=>`${t.id}${dve}`,qve=t=>t.parameters.length===0?[]:[{id:Vve(t),kind:"parameters",lineCount:Uve(t.parameters)}],Wve=({isDraft:t})=>t?"row":"two-line-row",Gve=t=>{const e=new Map([...t.blockLists.flatMap(({blocks:n})=>n),...t.triggerLabels].map(n=>[n.id,n]));return[...qve(t),...t.rowGroups.flatMap(({label:n,rowIds:s,childIds:i},o)=>[...n===null?[]:[{id:YB(t,o),kind:"heading"}],...s.flatMap(r=>{const a=e.get(r);return a===void 0?[]:[{id:r,kind:Wve(a)}]}),...i.map(r=>({id:r,kind:"card"}))])]},QB=t=>({id:t.id,rows:Gve(t),children:t.children.map(QB)}),Kve=t=>new Map(t.flatMap(e=>SN([e]).map(n=>[n.id,e.id]))),Yve=(t,e)=>t.flatMap(n=>{const s=e.get(n.from),i=e.get(n.to);return s===void 0||i===void 0||s===i?[]:[{id:n.id,from:s,to:i}]}),jM=(t,e,{collapsedNodeIds:n,focusedNodeId:s})=>{const i=t.filter(c=>e.every(d=>d.to!==c.id)).map(c=>c.id),o=[...rce(e,n,i)].filter(c=>!n.includes(c)),r=s===null?null:oce(e,s),a=r===null?[]:t.filter(c=>!r.has(c.id)).map(c=>c.id);return new Set([...o,...a])},Xve=(t,e)=>t.includes(e)?t.filter(n=>n!==e):[...t,e],PM=(t,e,n)=>e.has(t)?"selected":n.has(t)?"hovered":null,Qve=(t,e)=>{const n=t===null?"border":"border-2";return e!==null?Se(n,J2e[e]):Se(n,t===null?"border-input":vN[t])},Sy=({x:t,y:e,width:n,height:s})=>({left:t,top:e,width:n,height:s}),Zve=t=>{const e=ee.c(2),{hint:n}=t;let s;return e[0]!==n?(s=n===null?null:b.jsx("span",{className:"line-clamp-2 text-[0.75rem] leading-4 text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s},Jve=(t,e)=>t===null||e===null||!t.isDraft||t.isBeingWritten?[]:[rs({key:Pf,actionId:"explain-trace-card-action",label:BB,onRun:()=>{e(t.id)}})],eSe=(t,e,n)=>t===null?[]:[rs({key:Eve,actionId:"add-card-action",label:Sve,onRun:t.onAddCard}),rs({key:Cve,actionId:"clear-diagram-action",label:WB,isDisabled:t.isPending||e===0,disabledHint:e===0?wve:null,onRun:()=>{n("clear")}}),rs({key:Nve,actionId:"remove-diagram-action",label:GB,isDisabled:t.isPending,onRun:()=>{n("remove")}})],tSe=(t,e)=>e==="clear"?t.onClearDiagram:t.onRemoveDiagram,nSe=t=>{const e=ee.c(71),{node:n,cardActions:s,depth:i,emphasis:o,isSelected:r,isCollapsed:a,isFocusedOn:c,onSelect:d,onHoverChange:f,onFocusToggle:p,onCollapseToggle:m}=t,g=Object.hasOwn(vy,n.type)?vy[n.type]:zC,y=a?UD:nQ,v=a?xve:bve,S=n.id,w=n.type,N=n.change??void 0,C=o??void 0,T=i%ol===1?"bg-muted":"bg-card";let R;e[0]!==o||e[1]!==n.change||e[2]!==T?(R=Se("group",ove,T,Qve(n.change,o)),e[0]=o,e[1]=n.change,e[2]=T,e[3]=R):R=e[3];const A=n.change??void 0;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k={height:ec},e[4]=k):k=e[4];let M,L,j,D;e[5]!==f?(D=()=>{f(!0)},M=()=>{f(!1)},L=()=>{f(!0)},j=()=>{f(!1)},e[5]=f,e[6]=M,e[7]=L,e[8]=j,e[9]=D):(M=e[6],L=e[7],j=e[8],D=e[9]);let P;e[10]!==g?(P=b.jsx(g,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),e[10]=g,e[11]=P):P=e[11];let B;e[12]!==n.name?(B=b.jsx("span",{className:"max-w-[60%] shrink-0 truncate font-mono text-[0.75rem] leading-4 font-bold",children:n.name}),e[12]=n.name,e[13]=B):B=e[13];let I;e[14]!==n.shortPath?(I=b.jsx("span",{title:n.shortPath,className:"ml-auto min-w-0 truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:n.shortPath}),e[14]=n.shortPath,e[15]=I):I=e[15];let F;e[16]!==n.id||e[17]!==P||e[18]!==B||e[19]!==I?(F=b.jsxs("span",{"data-node-header":n.id,className:lve,children:[P,B,I]}),e[16]=n.id,e[17]=P,e[18]=B,e[19]=I,e[20]=F):F=e[20];let z;e[21]!==n.typeLabel?(z=b.jsx("span",{className:"shrink-0",children:n.typeLabel}),e[21]=n.typeLabel,e[22]=z):z=e[22];let U;e[23]!==n.classification.label||e[24]!==n.typeLabel?(U=n.classification.label===n.typeLabel?null:b.jsx("span",{className:"min-w-0 truncate before:mr-1 before:content-['•']",children:n.classification.label}),e[23]=n.classification.label,e[24]=n.typeLabel,e[25]=U):U=e[25];let H;e[26]!==n.change||e[27]!==n.changedLabel?(H=n.change===null||n.changedLabel===null?null:b.jsx("span",{className:Se("ml-auto font-bold",Z2e[n.change]),children:n.changedLabel}),e[26]=n.change,e[27]=n.changedLabel,e[28]=H):H=e[28];let V;e[29]!==z||e[30]!==U||e[31]!==H?(V=b.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-[0.6875rem] leading-4 text-muted-foreground",children:[z,U,H]}),e[29]=z,e[30]=U,e[31]=H,e[32]=V):V=e[32];let W;e[33]!==n.hint||e[34]!==n.isDraft||e[35]!==n.label?(W=n.isDraft?b.jsx(Zve,{hint:n.hint}):b.jsx("span",{className:"line-clamp-2 text-[0.8125rem] leading-4 font-bold",children:n.label}),e[33]=n.hint,e[34]=n.isDraft,e[35]=n.label,e[36]=W):W=e[36];let G;e[37]!==n.isDraft||e[38]!==W?(G=b.jsx(Ja,{isPending:n.isDraft,lineCount:2,className:"w-full gap-1 py-0 text-[0.8125rem] [&>[aria-hidden]]:my-[0.2em]",children:W}),e[37]=n.isDraft,e[38]=W,e[39]=G):G=e[39];let Y;e[40]!==V||e[41]!==G?(Y=b.jsxs("span",{className:ave,children:[V,G]}),e[40]=V,e[41]=G,e[42]=Y):Y=e[42];let J;e[43]!==r||e[44]!==d||e[45]!==M||e[46]!==L||e[47]!==j||e[48]!==F||e[49]!==Y||e[50]!==A||e[51]!==D?(J=b.jsxs("button",{type:"button","aria-pressed":r,"data-user-action-id":"trace-diagram-card-action","data-change":A,className:rve,style:k,onMouseEnter:D,onMouseLeave:M,onFocus:L,onBlur:j,onClick:d,children:[F,Y]}),e[43]=r,e[44]=d,e[45]=M,e[46]=L,e[47]=j,e[48]=F,e[49]=Y,e[50]=A,e[51]=D,e[52]=J):J=e[52];let q;e[53]!==y||e[54]!==s||e[55]!==v||e[56]!==i||e[57]!==a||e[58]!==c||e[59]!==n.label||e[60]!==m||e[61]!==p?(q=i>0&&s===null?null:b.jsxs("div",{role:"toolbar","aria-label":n.label,"data-pinned":c||a,className:Se("nodrag",cve),children:[s===null?null:b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button","aria-label":`${MM}: ${n.label}`,title:MM,className:n1,onClick:s.onEdit,children:b.jsx(dj,{"aria-hidden":"true",className:"size-3.5"})}),b.jsx("button",{type:"button",disabled:s.isPending,"aria-label":`${LM}: ${n.label}`,title:LM,className:n1,onClick:s.onRemove,children:b.jsx(PC,{"aria-hidden":"true",className:"size-3.5"})})]}),i>0?null:b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button","aria-pressed":c,"aria-label":`${_M}: ${n.label}`,title:_M,className:n1,onClick:p,children:b.jsx(lQ,{"aria-hidden":"true",className:"size-3.5"})}),b.jsx("button",{type:"button","aria-pressed":a,"aria-label":`${v}: ${n.label}`,title:v,className:n1,onClick:m,children:b.jsx(y,{"aria-hidden":"true",className:"size-3.5"})})]})]}),e[53]=y,e[54]=s,e[55]=v,e[56]=i,e[57]=a,e[58]=c,e[59]=n.label,e[60]=m,e[61]=p,e[62]=q):q=e[62];let X;return e[63]!==n.id||e[64]!==n.type||e[65]!==J||e[66]!==q||e[67]!==N||e[68]!==C||e[69]!==R?(X=b.jsxs("div",{"data-node-id":S,"data-type":w,"data-change":N,"data-emphasis":C,className:R,children:[J,q]}),e[63]=n.id,e[64]=n.type,e[65]=J,e[66]=q,e[67]=N,e[68]=C,e[69]=R,e[70]=X):X=e[70],X},sSe=t=>{const e=ee.c(40),{trigger:n,placed:s,emphasis:i,onSelect:o,onHoverChange:r}=t,a=Object.hasOwn(vy,n.type)?vy[n.type]:zC,c=n.id,d=n.change??void 0,f=`${n.typeLabel}: ${n.label}`,p=n.isDraft?n.hint??void 0:void 0,m=n.change!==null&&vN[n.change],g=i!==null&&$B[i];let y;e[0]!==m||e[1]!==g?(y=Se(qB,m,g),e[0]=m,e[1]=g,e[2]=y):y=e[2];let v;e[3]!==s?(v=Sy(s),e[3]=s,e[4]=v):v=e[4];let S,w,N,C;e[5]!==r?(C=()=>{r(!0)},S=()=>{r(!1)},w=()=>{r(!0)},N=()=>{r(!1)},e[5]=r,e[6]=S,e[7]=w,e[8]=N,e[9]=C):(S=e[6],w=e[7],N=e[8],C=e[9]);let T;e[10]!==a?(T=b.jsx(a,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),e[10]=a,e[11]=T):T=e[11];const R=n.isDraft,A=n.isDraft?"font-mono text-muted-foreground":"font-bold";let k;e[12]!==A?(k=Se("truncate text-[0.75rem] leading-4",A),e[12]=A,e[13]=k):k=e[13];let M;e[14]!==k||e[15]!==n.label?(M=b.jsx("span",{className:k,children:n.label}),e[14]=k,e[15]=n.label,e[16]=M):M=e[16];let L;e[17]!==M||e[18]!==n.isDraft?(L=b.jsx(Ja,{isPending:R,className:"h-4 w-24 py-0 text-[0.75rem]",children:M}),e[17]=M,e[18]=n.isDraft,e[19]=L):L=e[19];let j;e[20]!==n.isDraft||e[21]!==n.name?(j=n.isDraft?null:b.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:n.name}),e[20]=n.isDraft,e[21]=n.name,e[22]=j):j=e[22];let D;e[23]!==L||e[24]!==j?(D=b.jsxs("span",{className:"flex min-w-0 flex-col",children:[L,j]}),e[23]=L,e[24]=j,e[25]=D):D=e[25];let P;return e[26]!==o||e[27]!==S||e[28]!==w||e[29]!==N||e[30]!==T||e[31]!==d||e[32]!==D||e[33]!==f||e[34]!==p||e[35]!==y||e[36]!==v||e[37]!==C||e[38]!==n.id?(P=b.jsxs("button",{type:"button","data-trigger-id":c,"data-change":d,"aria-label":f,title:p,className:y,style:v,onMouseEnter:C,onMouseLeave:S,onFocus:w,onBlur:N,onClick:o,children:[T,D]}),e[26]=o,e[27]=S,e[28]=w,e[29]=N,e[30]=T,e[31]=d,e[32]=D,e[33]=f,e[34]=p,e[35]=y,e[36]=v,e[37]=C,e[38]=n.id,e[39]=P):P=e[39],P},iSe=t=>{const e=ee.c(41),{row:n,placed:s,emphasis:i,onSelect:o,onHoverChange:r}=t,{kind:a,kindLabel:c,block:d}=n,f=Object.hasOwn(AM,a)?AM[a]:zC,p=d.id,m=d.change??void 0,g=`${c}: ${d.label}`,y=d.isDraft?d.hint??void 0:void 0,v=d.change!==null&&vN[d.change],S=i!==null&&$B[i];let w;e[0]!==v||e[1]!==S?(w=Se(qB,v,S),e[0]=v,e[1]=S,e[2]=w):w=e[2];let N;e[3]!==s?(N=Sy(s),e[3]=s,e[4]=N):N=e[4];let C,T,R,A;e[5]!==r?(C=()=>{r(!0)},T=()=>{r(!1)},R=()=>{r(!0)},A=()=>{r(!1)},e[5]=r,e[6]=C,e[7]=T,e[8]=R,e[9]=A):(C=e[6],T=e[7],R=e[8],A=e[9]);let k;e[10]!==f?(k=b.jsx(f,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),e[10]=f,e[11]=k):k=e[11];const M=d.isDraft,L=d.isDraft?"font-mono text-muted-foreground":"font-bold";let j;e[12]!==L?(j=Se("truncate text-[0.75rem] leading-4",L),e[12]=L,e[13]=j):j=e[13];let D;e[14]!==d.label||e[15]!==j?(D=b.jsx("span",{className:j,children:d.label}),e[14]=d.label,e[15]=j,e[16]=D):D=e[16];let P;e[17]!==d.isDraft||e[18]!==D?(P=b.jsx(Ja,{isPending:M,className:"h-4 w-24 py-0 text-[0.75rem]",children:D}),e[17]=d.isDraft,e[18]=D,e[19]=P):P=e[19];let B;e[20]!==d.isDraft||e[21]!==d.name?(B=d.isDraft?null:b.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:d.name}),e[20]=d.isDraft,e[21]=d.name,e[22]=B):B=e[22];let I;e[23]!==P||e[24]!==B?(I=b.jsxs("span",{className:"flex min-w-0 flex-col",children:[P,B]}),e[23]=P,e[24]=B,e[25]=I):I=e[25];let F;return e[26]!==d.id||e[27]!==a||e[28]!==o||e[29]!==C||e[30]!==T||e[31]!==R||e[32]!==A||e[33]!==k||e[34]!==I||e[35]!==m||e[36]!==g||e[37]!==y||e[38]!==w||e[39]!==N?(F=b.jsxs("button",{type:"button","data-block-id":p,"data-block-kind":a,"data-change":m,"aria-label":g,title:y,className:w,style:N,onMouseEnter:C,onMouseLeave:T,onFocus:R,onBlur:A,onClick:o,children:[k,I]}),e[26]=d.id,e[27]=a,e[28]=o,e[29]=C,e[30]=T,e[31]=R,e[32]=A,e[33]=k,e[34]=I,e[35]=m,e[36]=g,e[37]=y,e[38]=w,e[39]=N,e[40]=F):F=e[40],F},ZB=t=>`${Xp}${t}`,wN=t=>`${Ave}${t}`,oSe=(t,{width:e,height:n})=>t==="left"?{x:0,y:ec/ol}:{x:e/ol,y:t==="top"?0:n},zM=({x:t,y:e})=>({x:t-IM,y:e-IM}),JB=t=>[...t.rows.filter(e=>e.kind!=="heading"&&e.kind!=="parameters").map(e=>({id:ZB(e.id),type:"source",position:Ze.Right,title:Ove,...zM({x:t.width,y:e.y+e.height/ol})})),...KB.map(e=>({id:wN(e),type:"target",position:Rve[e],title:kve[e],...zM(oSe(e,t))}))],rSe=t=>{const e=ee.c(49),{data:n}=t,{node:s,frame:i,cardActions:o,emphasis:r,isSelected:a,isCollapsed:c,isFocusedOn:d,onSelect:f,onHoverChange:p,onFocusToggle:m,onCollapseToggle:g}=n;let y;e[0]!==s?(y=new Map(Fve(s).map(ySe)),e[0]=s,e[1]=y):y=e[1];const v=y;let S;e[2]!==s?(S=new Map(XB(s).map(bSe)),e[2]=s,e[3]=S):S=e[3];const w=S;let N;e[4]!==s.triggerLabels?(N=new Map(s.triggerLabels.map(xSe)),e[4]=s.triggerLabels,e[5]=N):N=e[5];const C=N;let T;e[6]!==f?(T=()=>{f(null)},e[6]=f,e[7]=T):T=e[7];let R;e[8]!==o||e[9]!==r||e[10]!==i.depth||e[11]!==c||e[12]!==d||e[13]!==a||e[14]!==s||e[15]!==g||e[16]!==m||e[17]!==p||e[18]!==T?(R=b.jsx(nSe,{node:s,cardActions:o,depth:i.depth,emphasis:r,isSelected:a,isCollapsed:c,isFocusedOn:d,onSelect:T,onHoverChange:p,onFocusToggle:m,onCollapseToggle:g}),e[8]=o,e[9]=r,e[10]=i.depth,e[11]=c,e[12]=d,e[13]=a,e[14]=s,e[15]=g,e[16]=m,e[17]=p,e[18]=T,e[19]=R):R=e[19];let A;if(e[20]!==w||e[21]!==r||e[22]!==i.rows||e[23]!==v||e[24]!==s.id||e[25]!==s.parameters||e[26]!==p||e[27]!==f||e[28]!==C){let j;e[30]!==w||e[31]!==r||e[32]!==v||e[33]!==s.id||e[34]!==s.parameters||e[35]!==p||e[36]!==f||e[37]!==C?(j=D=>{const P=v.get(D.id),B=w.get(D.id),I=C.get(D.id);if(P!==void 0)return[b.jsx("span",{"data-row-heading":s.id,className:yve,style:Sy(D),children:P.label},D.id)];if(D.kind==="parameters")return[b.jsx("ul",{"aria-label":uve,className:mve,style:Sy(D),children:s.parameters.map(vSe)},D.id)];const F=()=>{f(D.id)};return B!==void 0?[b.jsx(iSe,{row:B,placed:D,emphasis:r,onSelect:F,onHoverChange:p},D.id)]:I===void 0?[]:[b.jsx(sSe,{trigger:I,placed:D,emphasis:r,onSelect:F,onHoverChange:p},D.id)]},e[30]=w,e[31]=r,e[32]=v,e[33]=s.id,e[34]=s.parameters,e[35]=p,e[36]=f,e[37]=C,e[38]=j):j=e[38],A=i.rows.flatMap(j),e[20]=w,e[21]=r,e[22]=i.rows,e[23]=v,e[24]=s.id,e[25]=s.parameters,e[26]=p,e[27]=f,e[28]=C,e[29]=A}else A=e[29];let k;e[39]!==i.handles?(k=i.handles.map(SSe),e[39]=i.handles,e[40]=k):k=e[40];let M;e[41]!==o||e[42]!==i?(M=o===null?null:JB(i).map(wSe),e[41]=o,e[42]=i,e[43]=M):M=e[43];let L;return e[44]!==R||e[45]!==A||e[46]!==k||e[47]!==M?(L=b.jsxs(b.Fragment,{children:[R,A,k,M]}),e[44]=R,e[45]=A,e[46]=k,e[47]=M,e[48]=L):L=e[48],L},BM=({x:t,y:e})=>({x:Math.round(t),y:Math.round(e)}),lSe=t=>{const e=ee.c(6),{sourceX:n,sourceY:s,targetX:i,targetY:o,data:r}=t;let a;return e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==i||e[4]!==o?(a=r===void 0?null:b.jsxs(b.Fragment,{children:[b.jsx(Sye,{path:Zw([{x:n,y:s},...r.bends,{x:i,y:o}].map(BM)),kind:eve,isAssumed:!1,emphasis:r.emphasis,hasArrow:r.hasArrow,markers:r.markers}),r.isSelectable?b.jsx("path",{d:Zw([{x:n,y:s},...r.bends,{x:i,y:o}].map(BM)),className:Mve}):null]}),e[0]=r,e[1]=n,e[2]=s,e[3]=i,e[4]=o,e[5]=a):a=e[5],a},aSe=t=>{const e=ee.c(7),{data:n}=t,{isPending:s,onCreate:i}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(jC,{"aria-hidden":"true",className:"size-4"}),e[0]=o):o=e[0];let r;e[1]!==s||e[2]!==i?(r=b.jsx("button",{type:"button",disabled:s,"aria-label":RM,title:RM,className:tve,onClick:i,children:o}),e[1]=s,e[2]=i,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx(gu,{id:OE,type:"target",position:Ze.Left,isConnectable:!1,className:VB,style:{left:0,top:ip/ol}}),e[4]=a):a=e[4];let c;return e[5]!==r?(c=b.jsxs(b.Fragment,{children:[r,a]}),e[5]=r,e[6]=c):c=e[6],c},cSe={[FB]:rSe,[HB]:aSe},uSe={[RE]:lSe},dSe=t=>t.width,$M=({source:t,target:e})=>t!==e,fSe=t=>{const e="changedTouches"in t?t.changedTouches.item(0):t;return e===null?null:{x:e.clientX,y:e.clientY}},hSe=(t,{isValid:e,fromNode:n,fromHandle:s})=>{var d;const i=fSe(t);if(e===!0||i===null||n===null)return null;const o=s.id??null;if((o==null?void 0:o.startsWith(Xp))!==!0)return null;const r=((d=document.elementFromPoint(i.x,i.y))==null?void 0:d.closest(Ive))??null,a=(r==null?void 0:r.dataset.id)??null;if(r===null||a===null||a===TE)return{kind:"board",line:{from:n.id,fromRowId:o.slice(Xp.length)},point:i};const c=wN(B2e(i,r.getBoundingClientRect()));return{kind:"card",connection:{source:n.id,sourceHandle:o,target:a,targetHandle:c}}},pSe=t=>{const e=ee.c(40),{label:n,authoring:s,moving:i,width:o,view:r,nodes:a,edges:c,markers:d}=t,{zoom:f,offset:p,onPan:m}=r,g=Xt(dSe),{screenToFlowPosition:y}=Db(),v=Math.max(0,(g-o*f)/ol);let S;e[0]!==s||e[1]!==y?(S=(Y,J)=>{const q=hSe(Y,J);(q==null?void 0:q.kind)==="card"&&$M(q.connection)&&(s==null||s.onConnect(q.connection)),(q==null?void 0:q.kind)==="board"&&(s==null||s.onLineDropOnBoard(q.line,q.point,y))},e[0]=s,e[1]=y,e[2]=S):S=e[2];const w=S;let N;e[3]!==i?(N=Y=>{Y.forEach(J=>{J.type==="position"&&J.position!==void 0&&(i==null||i.onCardDrag(J.id,J.position))})},e[3]=i,e[4]=N):N=e[4];const C=N,T=g>0,R=`${String(p.x)}px ${String(p.y)}px`;let A;e[5]!==R?(A={backgroundPosition:R},e[5]=R,e[6]=A):A=e[6];const k=v+p.x;let M;e[7]!==p.y||e[8]!==k||e[9]!==f?(M={x:k,y:p.y,zoom:f},e[7]=p.y,e[8]=k,e[9]=f,e[10]=M):M=e[10];let L;e[11]!==v||e[12]!==m?(L=Y=>{const{x:J,y:q}=Y;m({x:J-v,y:q})},e[11]=v,e[12]=m,e[13]=L):L=e[13];const j=i!==null,D=s!==null,P=i===null?void 0:C;let B;e[14]!==i?(B=i===null?void 0:(Y,J)=>{i.onCardDrop(J.id,J.position)},e[14]=i,e[15]=B):B=e[15];const I=s===null?void 0:s.onConnect,F=s===null?void 0:w;let z;e[16]!==s?(z=s===null?void 0:(Y,J)=>{J.data!==void 0&&s.onLineSelect(J.data.edgeId)},e[16]=s,e[17]=z):z=e[17];const U=s===null?void 0:s.onBoardClick;let H;e[18]===Symbol.for("react.memo_cache_sentinel")?(H=Se("absolute size-0",kE),e[18]=H):H=e[18];let V;e[19]!==d?(V=b.jsx("svg",{"aria-hidden":"true",className:H,children:b.jsx(vye,{markers:d})}),e[19]=d,e[20]=V):V=e[20];let W;e[21]!==c||e[22]!==a||e[23]!==j||e[24]!==D||e[25]!==P||e[26]!==B||e[27]!==I||e[28]!==F||e[29]!==z||e[30]!==U||e[31]!==V||e[32]!==M||e[33]!==L?(W=b.jsx(z1e,{nodes:a,edges:c,nodeTypes:cSe,edgeTypes:uSe,viewport:M,onViewportChange:L,zIndexMode:"manual",paneClickDistance:nve,nodesDraggable:j,nodesConnectable:D,isValidConnection:$M,onNodesChange:P,onNodeDragStop:B,onConnect:I,onConnectEnd:F,connectionRadius:Dve,connectionLineStyle:jve,onEdgeClick:z,onPaneClick:U,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,deleteKeyCode:null,disableKeyboardA11y:!0,proOptions:ive,children:V}),e[21]=c,e[22]=a,e[23]=j,e[24]=D,e[25]=P,e[26]=B,e[27]=I,e[28]=F,e[29]=z,e[30]=U,e[31]=V,e[32]=M,e[33]=L,e[34]=W):W=e[34];let G;return e[35]!==n||e[36]!==W||e[37]!==T||e[38]!==A?(G=b.jsx("div",{role:"group","aria-label":n,"data-measured":T,className:sve,style:A,children:W}),e[35]=n,e[36]=W,e[37]=T,e[38]=A,e[39]=G):G=e[39],G},mSe=({source:t,sourceHandle:e,target:n,targetHandle:s})=>{const i=KB.find(o=>wN(o)===s);return(e==null?void 0:e.startsWith(Xp))!==!0||i===void 0?null:{from:t,fromRowId:e.slice(Xp.length),to:n,toSide:i}},gSe=t=>{var Ae,Ee;const e=ee.c(77),{title:n,nodes:s,edges:i,codeLinks:o,codeDefinitions:r,isReviewPending:a,authoring:c,cardMoving:d,navigatorAnchorId:f,onWriteUpNode:p,onOpenCodeLink:m,onWaypointReviewedChange:g}=t,y=c===void 0?null:c,v=d===void 0?null:d,S=f===void 0?null:f,w=p===void 0?null:p,[N,C]=_.useState(Lve),[T,R]=_.useState(null),[A,k]=_.useState(null),[M,L]=_.useState(null),[j,D]=_.useState(null),[P,B]=_.useState(null),[I,F]=_.useState(TM),[z,U]=_.useState(!1),[H,V]=_.useState(null),W=xye(),{collapsedNodeIds:G,focusedNodeId:Y}=I;let J,q,X,Z,te,Q,se,ae,le,ne,fe,ve,we,Ce,ye,Oe,be;if(e[0]!==y||e[1]!==v||e[2]!==r||e[3]!==o||e[4]!==G||e[5]!==I||e[6]!==N||e[7]!==A||e[8]!==i||e[9]!==Y||e[10]!==P||e[11]!==z||e[12]!==a||e[13]!==W||e[14]!==S||e[15]!==s||e[16]!==m||e[17]!==g||e[18]!==w||e[19]!==T||e[20]!==M||e[21]!==j||e[22]!==n){const Ne=Kve(s),xe=Yve(i,Ne),Pe=jM(s,xe,I),We=s.filter($e=>!Pe.has($e.id)),et=SN(We),At=new Set(et.map(ESe)),ze=i.filter($e=>At.has($e.from)&&At.has($e.to)),Te=We.map(QB),qe=P2e(Te,ze),ot=new Map(s.flatMap(CSe)),bt=new Map([...$2e(qe,ot),...N]);Q=U2e(qe,bt,new Map(ze.map(NSe)));const Ct=ze.find($e=>$e.id===T)??null,En=Q.nodes.filter(TSe).map(OSe);X=v===null?null:{onCardDrag:($e,Tt)=>{C(Gt=>new Map([...Gt,[$e,Tt]]))},onCardDrop:($e,Tt)=>{v.onMoveCards(En.map(Gt=>Gt.nodeId===$e?{nodeId:$e,x:Tt.x,y:Tt.y}:Gt))}};let Mt;e[40]!==y||e[41]!==s.length?(Mt=y===null?null:{onLineDropOnBoard:($e,Tt,Gt)=>{k({...$e,end:Gt(Tt),cardCount:s.length})},onConnect:$e=>{const Tt=mSe($e);Tt!==null&&y.onDrawLine(Tt)},onLineSelect:R,onBoardClick:()=>{R(null),k(null)}},e[40]=y,e[41]=s.length,e[42]=Mt):Mt=e[42],q=Mt;const jt=y!==null&&A!==null&&A.cardCount===s.length&&At.has(A.from)?A:null,rn=Y2e(Te,Q),Cn=new Map(et.map(RSe)),nn=new Map(et.flatMap(ASe)),st=new Map(et.flatMap(MSe)),St=Jw(ze,M),dn=Jw(ze,P),rt=M===null?null:Cn.get(M)??null,Wt=(rt==null?void 0:rt.codeLinkId)==null||!Object.hasOwn(o,rt.codeLinkId)?null:o[rt.codeLinkId],_t=j===null?null:((Ae=nn.get(j))==null?void 0:Ae.block.lines)??((Ee=st.get(j))==null?void 0:Ee.lines)??null;let It;e[43]===Symbol.for("react.memo_cache_sentinel")?(It=($e,Tt)=>{L($e),D(Tt),U(!0)},e[43]=It):It=e[43];const Zt=It,Nn=$e=>{F($e),B(null);const Tt=M===null?void 0:Ne.get(M);Tt!==void 0&&jM(s,xe,$e).has(Tt)&&L(null)},bn=s.filter($e=>xe.some(Tt=>Tt.from===$e.id)).map(LSe);te=rn.frames.flatMap($e=>{const Tt=Cn.get($e.id);return Tt===void 0?[]:[{id:$e.id,type:FB,...$e.parentId===null?{}:{parentId:$e.parentId},position:$e.position,width:$e.width,height:$e.height,zIndex:$e.depth,draggable:v!==null&&$e.depth===0,style:kM,handles:[...$e.handles.map(ISe),...y===null?[]:JB($e).map(DSe)],data:{node:Tt,frame:$e,cardActions:y===null?null:{isPending:y.isPending,onEdit:()=>{y.onEditCard($e.id)},onRemove:()=>{y.onRemoveCard($e.id)}},emphasis:PM($e.id,St.nodeIds,dn.nodeIds),isSelected:$e.id===M,isCollapsed:G.includes($e.id),isFocusedOn:$e.id===Y,onSelect:Gt=>{Zt($e.id,Gt)},onHoverChange:Gt=>{B(Gt?$e.id:null)},onFocusToggle:()=>{Nn({...I,focusedNodeId:$e.id===Y?null:$e.id})},onCollapseToggle:()=>{Nn({...I,collapsedNodeIds:Xve(G,$e.id)})}}}]}),Z=rn.lines.map($e=>({id:$e.id,type:RE,source:$e.source,target:$e.target,sourceHandle:$e.sourceHandleId,targetHandle:$e.targetHandleId,zIndex:$e.isAboveNodes?vS:0,className:Se(kE,y!==null&&$e.isAboveNodes&&"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:$e.edgeId,isSelectable:y!==null&&!$e.isAboveNodes,bends:$e.bends,emphasis:$e.edgeId===T?"selected":PM($e.edgeId,St.edgeIds,dn.edgeIds),hasArrow:$e.hasArrow,markers:W}})),ae=y===null||jt===null?[]:[{id:TE,type:HB,position:{x:jt.end.x,y:jt.end.y-ip/ol},width:ip,height:ip,zIndex:vS,draggable:!1,style:kM,handles:[{id:OE,type:"target",position:Ze.Left,x:0,y:ip/ol,width:0,height:0}],data:{isPending:y.isPending,onCreate:()=>{const{from:$e,fromRowId:Tt,end:Gt}=jt;y.onAddCardAtLineEnd({from:$e,fromRowId:Tt,position:{x:Gt.x,y:Gt.y-ec/ol},places:En})}}}];let ln;e[44]!==jt||e[45]!==W?(ln=jt===null?[]:[{id:OM,type:RE,source:jt.from,target:TE,sourceHandle:ZB(jt.fromRowId),targetHandle:OE,zIndex:vS,className:Se(kE,"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:OM,isSelectable:!1,bends:[],emphasis:null,hasArrow:!0,markers:W}}],e[44]=jt,e[45]=W,e[46]=ln):ln=e[46],se=ln,J=t7,we=n,Ce=Q.width,ye=Q.height,Oe=z,e[47]===Symbol.for("react.memo_cache_sentinel")?(be=$e=>{U($e),$e||L(null)},le=()=>{L(null)},e[47]=le,e[48]=be):(le=e[47],be=e[48]),ne=S===null?null:{anchorId:S,groups:[[rs({key:Bve,actionId:"collapse-trace-cards-action",label:G.length===0?Pve:zve,onRun:()=>{Nn(G.length===0?{collapsedNodeIds:bn,focusedNodeId:null}:TM)}}),...Jve(rt,w)],eSe(y,s.length,V)]},fe=y===null||Ct===null?null:b.jsx(xs,{icon:"delete",label:vve,isDisabled:y.isPending,onClick:()=>{y.onRemoveLine({edgeId:Ct.id,from:Ct.from,to:Ct.to}),R(null)}}),ve=rt===null?null:b.jsxs(D7,{title:rt.label,kindLabel:rt.typeLabel,target:rt.codeViews.length===0?Wt:null,codeViews:rt.codeViews.map($e=>b.jsx(Xxe,{view:$e,focusedLines:_t,isReviewPending:a,codeLinks:o,codeDefinitions:r,onOpenCodeLink:m,onWaypointReviewedChange:g},$e.id)),onClose:()=>{L(null)},children:[rt.isDraft?b.jsx(W7,{hint:rt.hint,label:rt.isBeingWritten?Q2e:X2e,isBeingWritten:rt.isBeingWritten,buttonLabel:BB,onWriteUp:w===null?null:()=>{w(rt.id)}}):null,rt.description===null?null:b.jsx(ho,{blocks:rt.description,codeLinks:o,onOpenCodeLink:m})]}),e[0]=y,e[1]=v,e[2]=r,e[3]=o,e[4]=G,e[5]=I,e[6]=N,e[7]=A,e[8]=i,e[9]=Y,e[10]=P,e[11]=z,e[12]=a,e[13]=W,e[14]=S,e[15]=s,e[16]=m,e[17]=g,e[18]=w,e[19]=T,e[20]=M,e[21]=j,e[22]=n,e[23]=J,e[24]=q,e[25]=X,e[26]=Z,e[27]=te,e[28]=Q,e[29]=se,e[30]=ae,e[31]=le,e[32]=ne,e[33]=fe,e[34]=ve,e[35]=we,e[36]=Ce,e[37]=ye,e[38]=Oe,e[39]=be}else J=e[23],q=e[24],X=e[25],Z=e[26],te=e[27],Q=e[28],se=e[29],ae=e[30],le=e[31],ne=e[32],fe=e[33],ve=e[34],we=e[35],Ce=e[36],ye=e[37],Oe=e[38],be=e[39];let _e;e[49]!==q||e[50]!==X||e[51]!==Z||e[52]!==te||e[53]!==Q.width||e[54]!==W||e[55]!==se||e[56]!==ae||e[57]!==n?(_e=Ne=>b.jsx(Qz,{children:b.jsx(pSe,{label:n,authoring:q,moving:X,width:Q.width,view:Ne,nodes:[...te,...ae],edges:[...Z,...se],markers:W})}),e[49]=q,e[50]=X,e[51]=Z,e[52]=te,e[53]=Q.width,e[54]=W,e[55]=se,e[56]=ae,e[57]=n,e[58]=_e):_e=e[58];let Me;e[59]!==J||e[60]!==le||e[61]!==ne||e[62]!==fe||e[63]!==ve||e[64]!==_e||e[65]!==we||e[66]!==Ce||e[67]!==ye||e[68]!==Oe||e[69]!==be?(Me=b.jsx(J,{label:we,width:Ce,height:ye,isFullScreen:Oe,onFullScreenChange:be,onPanelClose:le,navigation:ne,actions:fe,panel:ve,renderCanvas:_e}),e[59]=J,e[60]=le,e[61]=ne,e[62]=fe,e[63]=ve,e[64]=_e,e[65]=we,e[66]=Ce,e[67]=ye,e[68]=Oe,e[69]=be,e[70]=Me):Me=e[70];let Be;e[71]!==H||e[72]!==y?(Be=y===null||H===null?null:b.jsx(fye,{...Tve[H],onConfirm:()=>{tSe(y,H)(),V(null)},onCancel:()=>{V(null)}}),e[71]=H,e[72]=y,e[73]=Be):Be=e[73];let He;return e[74]!==Me||e[75]!==Be?(He=b.jsxs(b.Fragment,{children:[Me,Be]}),e[74]=Me,e[75]=Be,e[76]=He):He=e[76],He};function ySe(t){return[t.id,t]}function bSe(t){return[t.block.id,t]}function xSe(t){return[t.id,t]}function vSe(t){return b.jsx("li",{title:t,className:gve,children:b.jsx("span",{className:"truncate",children:t})},t)}function SSe(t){return b.jsx(gu,{id:t.id,type:t.type,position:UB[t.type],isConnectable:!1,className:VB,style:{left:t.x,top:t.y}},t.id)}function wSe(t){return b.jsx(gu,{id:t.id,type:t.type,position:t.position,title:t.title,className:_ve,style:{left:t.x,top:t.y}},t.id)}function ESe(t){return t.id}function CSe(t){return t.position===null?[]:[[t.id,t.position]]}function NSe(t){return[t.id,t.toSide]}function TSe(t){return t.depth===0}function OSe(t){return{nodeId:t.id,x:t.x,y:t.y}}function RSe(t){return[t.id,t]}function kSe(t){return[t.block.id,t]}function ASe(t){return XB(t).map(kSe)}function _Se(t){return[t.id,t]}function MSe(t){return t.triggerLabels.map(_Se)}function LSe(t){return t.id}function ISe(t){const{id:e,type:n,x:s,y:i}=t;return{id:e,type:n,position:UB[n],x:s,y:i,width:0,height:0}}function DSe(t){const{id:e,type:n,position:s,x:i,y:o}=t;return{id:e,type:n,position:s,x:i,y:o,width:DM,height:DM}}const jSe="Add a diagram",AE="trace-diagram-section",PSe="Edit",zSe="This segment has no Trace Diagram.",BSe=3,SS="max-w-[55rem] pb-4",$Se=t=>{const e=ee.c(16),{heading:n,diagram:s,codeLinks:i,editing:o,renderEditor:r,onOpenCodeLink:a}=t;if((o==null?void 0:o.isWriting)===!0&&r!==null){const d=`${n} description`;let f;e[0]!==s.descriptionMarkdown||e[1]!==o.errorMessage||e[2]!==o.isSaving||e[3]!==o.onCancel||e[4]!==o.onSave||e[5]!==r||e[6]!==d?(f=r({label:d,markdown:s.descriptionMarkdown,isSaving:o.isSaving,errorMessage:o.errorMessage,onSave:o.onSave,onCancel:o.onCancel}),e[0]=s.descriptionMarkdown,e[1]=o.errorMessage,e[2]=o.isSaving,e[3]=o.onCancel,e[4]=o.onSave,e[5]=r,e[6]=d,e[7]=f):f=e[7];let p;return e[8]!==f?(p=b.jsx("div",{className:"pb-4",children:f}),e[8]=f,e[9]=p):p=e[9],p}let c;return e[10]!==i||e[11]!==s.description||e[12]!==s.descriptionHint||e[13]!==s.unwrittenLabel||e[14]!==a?(c=s.description===null?b.jsx(Ja,{isPending:!0,lineCount:BSe,className:Se(SS,"text-base"),children:b.jsx("p",{className:Se(SS,"text-muted-foreground"),children:s.descriptionHint??s.unwrittenLabel})}):b.jsx(ho,{blocks:s.description,codeLinks:i,className:SS,onOpenCodeLink:a}),e[10]=i,e[11]=s.description,e[12]=s.descriptionHint,e[13]=s.unwrittenLabel,e[14]=a,e[15]=c):c=e[15],c},FSe=[],HSe={authoringOf:()=>null,cardMovingOf:()=>null,writeUpOf:()=>null},e$=t=>{const e=ee.c(23),{anchorId:n,heading:s,diagram:i,codeLinks:o,codeDefinitions:r,isReviewPending:a,authoring:c,cardMoving:d,onWriteUpNode:f,renderDescriptionEditor:p,onOpenCodeLink:m,onWaypointReviewedChange:g}=t,y=(c==null?void 0:c.description)??null;let v;e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==m||e[4]!==p||e[5]!==y?(v=b.jsx($Se,{heading:s,diagram:i,codeLinks:o,editing:y,renderEditor:p,onOpenCodeLink:m}),e[0]=o,e[1]=i,e[2]=s,e[3]=m,e[4]=p,e[5]=y,e[6]=v):v=e[6];const S=(c==null?void 0:c.board)??null;let w;e[7]!==n||e[8]!==d||e[9]!==r||e[10]!==o||e[11]!==i.edges||e[12]!==i.nodes||e[13]!==i.title||e[14]!==a||e[15]!==m||e[16]!==g||e[17]!==f||e[18]!==S?(w=b.jsx(gSe,{title:i.title,nodes:i.nodes,edges:i.edges,codeLinks:o,codeDefinitions:r,isReviewPending:a,authoring:S,cardMoving:d,navigatorAnchorId:n,onWriteUpNode:f,onOpenCodeLink:m,onWaypointReviewedChange:g}),e[7]=n,e[8]=d,e[9]=r,e[10]=o,e[11]=i.edges,e[12]=i.nodes,e[13]=i.title,e[14]=a,e[15]=m,e[16]=g,e[17]=f,e[18]=S,e[19]=w):w=e[19];let N;return e[20]!==v||e[21]!==w?(N=b.jsxs(b.Fragment,{children:[v,w]}),e[20]=v,e[21]=w,e[22]=N):N=e[22],N},USe=t=>{const e=ee.c(46);let n,s,i;e[0]!==t?({tabs:i,tabEditing:s,...n}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);const[o,r]=_.useState(0);let a;e[4]!==o||e[5]!==i?(a=i.at(o)??i[0],e[4]=o,e[5]=i,e[6]=a):a=e[6];const c=a;let d;e[7]!==o||e[8]!==i.length?(d=L=>{var D;const j=H7(L.key,o,i.length);j!==null&&(L.preventDefault(),r(j),(D=L.currentTarget.parentElement)==null||D.querySelectorAll("[role=tab]").item(j).focus())},e[7]=o,e[8]=i.length,e[9]=d):d=e[9];const f=d,p=n.heading;let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=Se($7,"mb-4"),e[10]=m):m=e[10];let g;if(e[11]!==f||e[12]!==o||e[13]!==c.diagram.anchorId||e[14]!==i){let L;e[16]!==f||e[17]!==o||e[18]!==c.diagram.anchorId?(L=(j,D)=>b.jsx("button",{type:"button",role:"tab","aria-selected":D===o,"aria-controls":D===o?c.diagram.anchorId:void 0,tabIndex:D===o?0:-1,className:F7,onClick:()=>{r(D)},onKeyDown:f,children:j.label},j.id),e[16]=f,e[17]=o,e[18]=c.diagram.anchorId,e[19]=L):L=e[19],g=i.map(L),e[11]=f,e[12]=o,e[13]=c.diagram.anchorId,e[14]=i,e[15]=g}else g=e[15];let y;e[20]!==n.heading||e[21]!==g?(y=b.jsx("div",{role:"tablist","aria-label":p,className:m,children:g}),e[20]=n.heading,e[21]=g,e[22]=y):y=e[22];const v=c.diagram.anchorId,S=c.label,w=c.id,N=c.diagram;let C;e[23]!==c.id||e[24]!==s?(C=s.authoringOf(c.id),e[23]=c.id,e[24]=s,e[25]=C):C=e[25];let T;e[26]!==c.id||e[27]!==s?(T=s.cardMovingOf(c.id),e[26]=c.id,e[27]=s,e[28]=T):T=e[28];let R;e[29]!==c.id||e[30]!==s?(R=s.writeUpOf(c.id),e[29]=c.id,e[30]=s,e[31]=R):R=e[31];let A;e[32]!==c.diagram||e[33]!==c.id||e[34]!==n||e[35]!==C||e[36]!==T||e[37]!==R?(A=b.jsx(e$,{...n,diagram:N,authoring:C,cardMoving:T,onWriteUpNode:R},w),e[32]=c.diagram,e[33]=c.id,e[34]=n,e[35]=C,e[36]=T,e[37]=R,e[38]=A):A=e[38];let k;e[39]!==c.diagram.anchorId||e[40]!==c.label||e[41]!==A?(k=b.jsx("section",{id:v,role:"tabpanel","aria-label":S,"data-view-section-id":AE,className:"scroll-mt-(--section-scroll-margin)",children:A}),e[39]=c.diagram.anchorId,e[40]=c.label,e[41]=A,e[42]=k):k=e[42];let M;return e[43]!==k||e[44]!==y?(M=b.jsxs(b.Fragment,{children:[y,k]}),e[43]=k,e[44]=y,e[45]=M):M=e[45],M},VSe=t=>{const e=ee.c(48),{anchorId:n,heading:s,diagram:i,tabs:o,tabEditing:r,codeLinks:a,codeDefinitions:c,isReviewPending:d,writeUpNotice:f,onWriteUpNode:p,authoring:m,cardMoving:g,renderDescriptionEditor:y,onOpenCodeLink:v,onWaypointReviewedChange:S}=t,w=o===void 0?FSe:o,N=r===void 0?null:r,C=f===void 0?null:f,T=p===void 0?null:p,R=m===void 0?null:m,A=g===void 0?null:g,k=y===void 0?null:y,M=R!==null&&i!==null&&k!==null&&!R.description.isWriting;let L;e[0]!==n||e[1]!==c||e[2]!==a||e[3]!==s||e[4]!==d||e[5]!==v||e[6]!==S||e[7]!==k?(L={anchorId:n,heading:s,codeLinks:a,codeDefinitions:c,isReviewPending:d,renderDescriptionEditor:k,onOpenCodeLink:v,onWaypointReviewedChange:S},e[0]=n,e[1]=c,e[2]=a,e[3]=s,e[4]=d,e[5]=v,e[6]=S,e[7]=k,e[8]=L):L=e[8];const j=L,D=`${n}-heading`,P=`${n}-heading`;let B;e[9]!==s||e[10]!==P?(B=b.jsx("h2",{id:P,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:s}),e[9]=s,e[10]=P,e[11]=B):B=e[11];let I;e[12]!==C?(I=C===null?null:b.jsx(Ff,{label:C}),e[12]=C,e[13]=I):I=e[13];let F;e[14]!==R||e[15]!==i||e[16]!==w.length?(F=R!==null&&i===null&&w.length===0?b.jsx(ft,{variant:"link",size:"sm",disabled:R.board.isPending,onClick:R.onAddDiagram,children:jSe}):null,e[14]=R,e[15]=i,e[16]=w.length,e[17]=F):F=e[17];let z;e[18]!==R||e[19]!==M?(z=M?b.jsx(ft,{variant:"link",size:"sm",onClick:R.description.onEdit,children:PSe}):null,e[18]=R,e[19]=M,e[20]=z):z=e[20];let U;e[21]!==B||e[22]!==I||e[23]!==F||e[24]!==z?(U=b.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[B,I,F,z]}),e[21]=B,e[22]=I,e[23]=F,e[24]=z,e[25]=U):U=e[25];let H;e[26]!==R||e[27]!==i||e[28]!==w.length?(H=R!==null&&i===null&&w.length===0?b.jsx("p",{className:"text-muted-foreground",children:zSe}):null,e[26]=R,e[27]=i,e[28]=w.length,e[29]=H):H=e[29];let V;e[30]!==j||e[31]!==N||e[32]!==w?(V=w.length===0?null:b.jsx(USe,{...j,tabs:w,tabEditing:N??HSe}),e[30]=j,e[31]=N,e[32]=w,e[33]=V):V=e[33];let W;e[34]!==R||e[35]!==A||e[36]!==i||e[37]!==T||e[38]!==j||e[39]!==w.length?(W=i===null||w.length>0?null:b.jsx("section",{id:i.anchorId,"aria-label":i.title,"data-view-section-id":AE,className:"scroll-mt-(--section-scroll-margin)",children:b.jsx(e$,{...j,diagram:i,authoring:R,cardMoving:A,onWriteUpNode:T})}),e[34]=R,e[35]=A,e[36]=i,e[37]=T,e[38]=j,e[39]=w.length,e[40]=W):W=e[40];let G;return e[41]!==n||e[42]!==U||e[43]!==H||e[44]!==V||e[45]!==W||e[46]!==D?(G=b.jsxs("section",{id:n,"aria-labelledby":D,"data-view-section-id":AE,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[U,H,V,W]}),e[41]=n,e[42]=U,e[43]=H,e[44]=V,e[45]=W,e[46]=D,e[47]=G):G=e[47],G},qSe="flex w-full max-w-xl cursor-pointer items-start gap-3 rounded-lg border border-input bg-card px-3 py-2.5 text-left transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-expanded:bg-muted",FM=t=>{const e=ee.c(10),{option:n}=t;let s;e[0]!==n.label?(s=b.jsx("span",{className:"block font-bold",children:n.label}),e[0]=n.label,e[1]=s):s=e[1];let i;e[2]!==n.summary?(i=n.summary===null?null:b.jsx("span",{className:"block text-sm",children:n.summary}),e[2]=n.summary,e[3]=i):i=e[3];let o;e[4]!==n.description?(o=b.jsx("span",{className:"block text-sm text-muted-foreground",children:n.description}),e[4]=n.description,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==i||e[8]!==o?(r=b.jsxs(b.Fragment,{children:[s,i,o]}),e[6]=s,e[7]=i,e[8]=o,e[9]=r):r=e[9],r},t$=t=>{const e=ee.c(60),{label:n,dialogTitle:s,dialogDescription:i,chooseLabel:o,cancelLabel:r,options:a,selectedKey:c,onChoose:d}=t,f=_.useId(),[p,m]=_.useState(!1),[g,y]=_.useState(c);let v;if(e[0]!==a||e[1]!==c){let q;e[3]!==c?(q=X=>X.key===c,e[3]=c,e[4]=q):q=e[4],v=a.find(q),e[0]=a,e[1]=c,e[2]=v}else v=e[2];const S=v;let w;e[5]!==c?(w=()=>{y(c),m(!0)},e[5]=c,e[6]=w):w=e[6];const N=w;let C;e[7]!==d||e[8]!==g?(C=()=>{d(g),m(!1)},e[7]=d,e[8]=g,e[9]=C):C=e[9];const T=C,R=S===void 0?n:`${n}, ${S.label}`;let A;e[10]!==S?(A=S===void 0?null:b.jsx(FM,{option:S}),e[10]=S,e[11]=A):A=e[11];let k;e[12]!==A?(k=b.jsx("span",{className:"min-w-0 flex-1",children:A}),e[12]=A,e[13]=k):k=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=b.jsx(UD,{"aria-hidden":"true",className:"mt-1 size-4 shrink-0 text-muted-foreground"}),e[14]=M):M=e[14];let L;e[15]!==p||e[16]!==N||e[17]!==R||e[18]!==k?(L=b.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":p,"aria-label":R,className:qSe,onClick:N,children:[k,M]}),e[15]=p,e[16]=N,e[17]=R,e[18]=k,e[19]=L):L=e[19];let j;e[20]!==s?(j=b.jsx(vl,{children:s}),e[20]=s,e[21]=j):j=e[21];let D;e[22]!==i?(D=b.jsx(Sl,{children:i}),e[22]=i,e[23]=D):D=e[23];let P;e[24]!==D||e[25]!==j?(P=b.jsxs(bl,{children:[j,D]}),e[24]=D,e[25]=j,e[26]=P):P=e[26];let B;e[27]!==n?(B=b.jsx("legend",{className:"sr-only",children:n}),e[27]=n,e[28]=B):B=e[28];let I;if(e[29]!==f||e[30]!==a||e[31]!==g){let q;e[33]!==f||e[34]!==g?(q=X=>b.jsx("li",{className:"border-b border-border py-3",children:b.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[b.jsx("input",{type:"radio",name:f,checked:g===X.key,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{y(X.key)}}),b.jsxs("span",{className:"min-w-0",children:[b.jsx(FM,{option:X}),X.note===null?null:b.jsx("span",{className:"block text-sm text-muted-foreground",children:X.note})]})]})},X.key),e[33]=f,e[34]=g,e[35]=q):q=e[35],I=a.map(q),e[29]=f,e[30]=a,e[31]=g,e[32]=I}else I=e[32];let F;e[36]!==I?(F=b.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:I}),e[36]=I,e[37]=F):F=e[37];let z;e[38]!==B||e[39]!==F?(z=b.jsxs("fieldset",{children:[B,F]}),e[38]=B,e[39]=F,e[40]=z):z=e[40];let U;e[41]===Symbol.for("react.memo_cache_sentinel")?(U=()=>{m(!1)},e[41]=U):U=e[41];let H;e[42]!==r?(H=b.jsx(ft,{type:"button",variant:"ghost",onClick:U,children:r}),e[42]=r,e[43]=H):H=e[43];let V;e[44]!==T||e[45]!==o?(V=b.jsx(ft,{type:"button",onClick:T,children:o}),e[44]=T,e[45]=o,e[46]=V):V=e[46];let W;e[47]!==H||e[48]!==V?(W=b.jsxs(xl,{children:[H,V]}),e[47]=H,e[48]=V,e[49]=W):W=e[49];let G;e[50]!==P||e[51]!==z||e[52]!==W?(G=b.jsxs(yl,{className:"sm:max-w-xl",children:[P,z,W]}),e[50]=P,e[51]=z,e[52]=W,e[53]=G):G=e[53];let Y;e[54]!==p||e[55]!==G?(Y=b.jsx(gl,{open:p,onOpenChange:m,children:G}),e[54]=p,e[55]=G,e[56]=Y):Y=e[56];let J;return e[57]!==Y||e[58]!==L?(J=b.jsxs(b.Fragment,{children:[L,Y]}),e[57]=Y,e[58]=L,e[59]=J):J=e[59],J},WSe="Prompt configuration",GSe="Choose a prompt configuration",KSe="It sets the tone the agent writes in and how it words each part.",YSe="Choose",XSe="Cancel",QSe=t=>({key:t.configurationId,label:t.label,summary:t.bestFor,description:t.description,note:t.note}),ZSe=t=>{const e=ee.c(6),{options:n,value:s,onChange:i}=t;let o;e[0]!==n?(o=n.map(QSe),e[0]=n,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o||e[4]!==s?(r=b.jsx(t$,{label:WSe,dialogTitle:GSe,dialogDescription:KSe,chooseLabel:YSe,cancelLabel:XSe,options:o,selectedKey:s,onChoose:i}),e[2]=i,e[3]=o,e[4]=s,e[5]=r):r=e[5],r},JSe="Code Walkthrough order",ewe="Choose a Code Walkthrough order",twe="It decides which changed file you read first.",nwe="Choose",swe="Cancel",n$=[{value:"imports-bottom-up",label:"Building blocks first",description:"Start with the files the rest of the change depends on, then read the code that uses them."},{value:"imports-top-down",label:"Entry points first",description:"Start where the change is used, like pages and routes, then follow it down to the details."},{value:"important-first",label:"Most important first",description:"Start with the heart of the change and the topics you care about most, then read the rest."}],iwe=n$.map(t=>({key:t.value,label:t.label,summary:null,description:t.description,note:null})),owe=t=>{var e;return((e=n$.find(n=>n.value===t))==null?void 0:e.value)??null},rwe=t=>{const e=ee.c(5),{value:n,onChange:s}=t;let i;e[0]!==s?(i=r=>{const a=owe(r);a!==null&&s(a)},e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==i||e[3]!==n?(o=b.jsx(t$,{label:JSe,dialogTitle:ewe,dialogDescription:twe,chooseLabel:nwe,cancelLabel:swe,options:iwe,selectedKey:n,onChoose:i}),e[2]=i,e[3]=n,e[4]=o):o=e[4],o},s$=t=>e=>{e.preventDefault(),t()},lwe="Configure",awe="Not now",cwe="Explain",uwe="Starting…",dwe="Parts to explain",fwe="Prompt configuration",hwe="Code Walkthrough order",i$="Total",pwe="Split this review into segments",wS="pb-2 font-bold",mwe="border-b border-border py-2.5",HM="pt-2 text-destructive",gwe=t=>`Ask ${t} to explain this review?`,ywe=t=>`Flight Plan built this review from the code. ${t} can write the context, the labels, the explanations and the findings.`,o$=t=>t.sections.filter(e=>e.isChosen).map(e=>e.section),bwe=(t,e,n)=>n?[...t,e]:t.filter(s=>s!==e),_E=(t,e)=>(t==null?void 0:t.field)===e?t.message:null,xwe=t=>{const e=ee.c(8),{plan:n}=t;let s;e[0]!==n.summary?(s=n.summary.map(Ewe),e[0]=n.summary,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=b.jsx("dt",{className:"text-muted-foreground",children:i$}),e[2]=i):i=e[2];let o;e[3]!==n.totalLabel?(o=b.jsx("dd",{className:"font-bold tabular-nums",children:n.totalLabel}),e[3]=n.totalLabel,e[4]=o):o=e[4];let r;return e[5]!==s||e[6]!==o?(r=b.jsxs("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1.5 border-y border-border py-3",children:[s,i,o]}),e[5]=s,e[6]=o,e[7]=r):r=e[7],r},vwe=t=>{const e=ee.c(3),{plan:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=b.jsx("span",{className:"text-muted-foreground",children:i$}),e[0]=s):s=e[0];let i;return e[1]!==n.totalLabel?(i=b.jsxs("p",{className:"flex items-baseline justify-between gap-6 pr-1",children:[s,b.jsx("span",{className:"font-bold tabular-nums",children:n.totalLabel})]}),e[1]=n.totalLabel,e[2]=i):i=e[2],i},Swe=t=>{const e=ee.c(48),{plan:n,problem:s,configurationId:i,walkthroughOrder:o,isSegmented:r,onSectionsChange:a,onConfigurationChange:c,onWalkthroughOrderChange:d,onSegmentedChange:f}=t;let p;e[0]!==s?(p=_E(s,"sections"),e[0]=s,e[1]=p):p=e[1];const m=p;let g;e[2]!==s?(g=_E(s,"configuration"),e[2]=s,e[3]=g):g=e[3];const y=g;let v,S,w,N;if(e[4]!==a||e[5]!==n){const U=o$(n);N="grid max-h-[60dvh] gap-5 overflow-y-auto pr-1",e[10]===Symbol.for("react.memo_cache_sentinel")?(w=b.jsx("legend",{className:wS,children:dwe}),e[10]=w):w=e[10],v="border-t border-border",S=n.sections.map(H=>b.jsx("li",{className:mwe,children:b.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[b.jsx("input",{type:"checkbox",checked:H.isChosen,className:"size-4 shrink-0 accent-(--primary)",onChange:V=>{a(bwe(U,H.section,V.target.checked))}}),b.jsx("span",{className:"flex-1 font-bold",children:H.label}),b.jsx("span",{className:"text-muted-foreground tabular-nums",children:H.countLabel})]})},H.section)),e[4]=a,e[5]=n,e[6]=v,e[7]=S,e[8]=w,e[9]=N}else v=e[6],S=e[7],w=e[8],N=e[9];let C;e[11]!==v||e[12]!==S?(C=b.jsx("ul",{className:v,children:S}),e[11]=v,e[12]=S,e[13]=C):C=e[13];let T;e[14]!==m?(T=m===null?null:b.jsx("p",{role:"alert",className:HM,children:m}),e[14]=m,e[15]=T):T=e[15];let R;e[16]!==w||e[17]!==C||e[18]!==T?(R=b.jsxs("fieldset",{children:[w,C,T]}),e[16]=w,e[17]=C,e[18]=T,e[19]=R):R=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=b.jsx("p",{className:wS,children:fwe}),e[20]=A):A=e[20];let k;e[21]!==i||e[22]!==c||e[23]!==n.configurations?(k=b.jsx(ZSe,{options:n.configurations,value:i,onChange:c}),e[21]=i,e[22]=c,e[23]=n.configurations,e[24]=k):k=e[24];let M;e[25]!==y?(M=y===null?null:b.jsx("p",{role:"alert",className:HM,children:y}),e[25]=y,e[26]=M):M=e[26];let L;e[27]!==k||e[28]!==M?(L=b.jsxs("div",{children:[A,k,M]}),e[27]=k,e[28]=M,e[29]=L):L=e[29];let j;e[30]===Symbol.for("react.memo_cache_sentinel")?(j=b.jsx("p",{className:wS,children:hwe}),e[30]=j):j=e[30];let D;e[31]!==d||e[32]!==o?(D=b.jsxs("div",{children:[j,b.jsx(rwe,{value:o,onChange:d})]}),e[31]=d,e[32]=o,e[33]=D):D=e[33];let P;e[34]!==f?(P=U=>{f(U.target.checked)},e[34]=f,e[35]=P):P=e[35];let B;e[36]!==r||e[37]!==P?(B=b.jsx("input",{type:"checkbox",checked:r,className:"size-4 shrink-0 accent-(--primary)",onChange:P}),e[36]=r,e[37]=P,e[38]=B):B=e[38];let I;e[39]===Symbol.for("react.memo_cache_sentinel")?(I=b.jsx("span",{className:"font-bold",children:pwe}),e[39]=I):I=e[39];let F;e[40]!==B?(F=b.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[B,I]}),e[40]=B,e[41]=F):F=e[41];let z;return e[42]!==L||e[43]!==D||e[44]!==F||e[45]!==N||e[46]!==R?(z=b.jsxs("div",{className:N,children:[R,L,D,F]}),e[42]=L,e[43]=D,e[44]=F,e[45]=N,e[46]=R,e[47]=z):z=e[47],z},wwe=t=>{const e=ee.c(53),{plan:n,problem:s,isPending:i,onSectionsChange:o,onSubmit:r,onClose:a}=t,[c,d]=_.useState(!1),[f,p]=_.useState(n.configurationId),[m,g]=_.useState(n.walkthroughOrder),[y,v]=_.useState(n.isSegmented);let S;e[0]!==s?(S=_E(s,"agent"),e[0]=s,e[1]=S):S=e[1];const w=S,N=c||s!==null&&s.field!=="agent";let C;e[2]!==a?(C=W=>{W||a()},e[2]=a,e[3]=C):C=e[3];let T;e[4]!==n.agentLabel?(T=gwe(n.agentLabel),e[4]=n.agentLabel,e[5]=T):T=e[5];let R;e[6]!==T?(R=b.jsx(vl,{children:T}),e[6]=T,e[7]=R):R=e[7];let A;e[8]!==n.agentLabel?(A=ywe(n.agentLabel),e[8]=n.agentLabel,e[9]=A):A=e[9];let k;e[10]!==A?(k=b.jsx(Sl,{children:A}),e[10]=A,e[11]=k):k=e[11];let M;e[12]!==R||e[13]!==k?(M=b.jsxs(bl,{children:[R,k]}),e[12]=R,e[13]=k,e[14]=M):M=e[14];let L;e[15]!==f||e[16]!==y||e[17]!==r||e[18]!==n||e[19]!==m?(L=s$(()=>{r({sections:o$(n),configurationId:f,walkthroughOrder:m,isSegmented:y})}),e[15]=f,e[16]=y,e[17]=r,e[18]=n,e[19]=m,e[20]=L):L=e[20];let j;e[21]!==f||e[22]!==y||e[23]!==N||e[24]!==o||e[25]!==n||e[26]!==s||e[27]!==m?(j=N?b.jsxs(b.Fragment,{children:[b.jsx(Swe,{plan:n,problem:s,configurationId:f,walkthroughOrder:m,isSegmented:y,onSectionsChange:o,onConfigurationChange:p,onWalkthroughOrderChange:g,onSegmentedChange:v}),b.jsx(vwe,{plan:n})]}):b.jsx(xwe,{plan:n}),e[21]=f,e[22]=y,e[23]=N,e[24]=o,e[25]=n,e[26]=s,e[27]=m,e[28]=j):j=e[28];let D;e[29]!==w?(D=w===null?null:b.jsx("p",{role:"alert",className:"text-destructive",children:w}),e[29]=w,e[30]=D):D=e[30];let P;e[31]!==N?(P=N?null:b.jsx(ft,{type:"button",variant:"link",className:"mr-auto px-0",onClick:()=>{d(!0)},children:lwe}),e[31]=N,e[32]=P):P=e[32];let B;e[33]!==a?(B=b.jsx(ft,{type:"button",variant:"ghost",onClick:a,children:awe}),e[33]=a,e[34]=B):B=e[34];const I=i?uwe:cwe;let F;e[35]!==i||e[36]!==I?(F=b.jsx(ft,{type:"submit",disabled:i,children:I}),e[35]=i,e[36]=I,e[37]=F):F=e[37];let z;e[38]!==P||e[39]!==B||e[40]!==F?(z=b.jsxs(xl,{className:"items-center",children:[P,B,F]}),e[38]=P,e[39]=B,e[40]=F,e[41]=z):z=e[41];let U;e[42]!==D||e[43]!==z||e[44]!==L||e[45]!==j?(U=b.jsxs("form",{className:"grid gap-4",onSubmit:L,children:[j,D,z]}),e[42]=D,e[43]=z,e[44]=L,e[45]=j,e[46]=U):U=e[46];let H;e[47]!==U||e[48]!==M?(H=b.jsxs(yl,{className:"sm:max-w-xl",children:[M,U]}),e[47]=U,e[48]=M,e[49]=H):H=e[49];let V;return e[50]!==H||e[51]!==C?(V=b.jsx(gl,{open:!0,onOpenChange:C,children:H}),e[50]=H,e[51]=C,e[52]=V):V=e[52],V};function Ewe(t){return b.jsxs("div",{className:"contents",children:[b.jsx("dt",{className:"text-muted-foreground",children:t.label}),b.jsx("dd",{className:"font-bold",children:t.value})]},t.label)}const Cwe=[],Nwe="Reading the code blocks…",Twe=(t,e)=>{var d,f,p;const n=ee.c(7),s=ui();let i;n[0]!==e||n[1]!==t||n[2]!==s.review.cardBlocks?(i=s.review.cardBlocks.queryOptions(e===null?uo:{...t,path:e}),n[0]=e,n[1]=t,n[2]=s.review.cardBlocks,n[3]=i):i=n[3];const o=fr(i),r=((d=o.data)==null?void 0:d.blocks)??Cwe,a=((f=o.error)==null?void 0:f.message)??((p=o.data)==null?void 0:p.message)??(o.isPending&&e!==null?Nwe:null);let c;return n[4]!==r||n[5]!==a?(c={blocks:r,message:a},n[4]=r,n[5]=a,n[6]=c):c=n[6],c},Owe="Loading the file…",r$=(t,e)=>{var d,f;const n=ee.c(7),s=ui();let i;n[0]!==e||n[1]!==t||n[2]!==s.review.fileCode?(i=s.review.fileCode.queryOptions(e===null?uo:{...t,path:e}),n[0]=e,n[1]=t,n[2]=s.review.fileCode,n[3]=i):i=n[3];const o=fr(i),r=((d=o.data)==null?void 0:d.lines)??null,a=((f=o.error)==null?void 0:f.message)??(o.isPending&&e!==null?Owe:null);let c;return n[4]!==r||n[5]!==a?(c={lines:r,statusMessage:a},n[4]=r,n[5]=a,n[6]=c):c=n[6],c},Rwe=[],EN=(t,e)=>{var y,v,S;const n=ee.c(12),s=ui(),[i,o]=_.useState(""),r=_.useDeferredValue(i);let a;n[0]!==r||n[1]!==t||n[2]!==e||n[3]!==s.review.searchFiles?(a=s.review.searchFiles.queryOptions({...t,query:r,scope:e}),n[0]=r,n[1]=t,n[2]=e,n[3]=s.review.searchFiles,n[4]=a):a=n[4];let c;n[5]!==a?(c={...a,placeholderData:jy},n[5]=a,n[6]=c):c=n[6];const d=fr(c),f=((y=d.data)==null?void 0:y.options)??Rwe,p=((v=d.data)==null?void 0:v.message)??null,m=((S=d.error)==null?void 0:S.message)??null;let g;return n[7]!==i||n[8]!==f||n[9]!==p||n[10]!==m?(g={query:i,files:f,message:p,errorMessage:m,onQueryChange:o},n[7]=i,n[8]=f,n[9]=p,n[10]=m,n[11]=g):g=n[11],g},kwe=(t,e,n)=>t!==null&&n?{anchorLine:t.anchorLine,headLine:e}:{anchorLine:e,headLine:e},Awe=({anchorLine:t,headLine:e})=>({lineStart:Math.min(t,e),lineEnd:Math.max(t,e)}),_we=(t,e)=>t!==null&&e>=t.lineStart&&e<=t.lineEnd,Mwe=t=>new Set(t===null?[]:Array.from({length:t.lineEnd-t.lineStart+1},(e,n)=>String(t.lineStart+n))),Qp=({lineStart:t,lineEnd:e})=>t===e?`Line ${String(t)}`:`Lines ${String(t)} to ${String(e)}`,Lwe={"toggle-off":{isShownAtFirst:!1,canToggle:!0},"toggle-on":{isShownAtFirst:!0,canToggle:!0},"always-on":{isShownAtFirst:!0,canToggle:!1},"always-off":{isShownAtFirst:!1,canToggle:!1}},Iwe="Show waypoints",Dwe="Hide waypoints",jwe="Select line",Pwe="Clear",zwe="[data-line]",wy=10,l$="my-1.5 mr-4 ml-18 rounded-md border border-input bg-background font-sans whitespace-normal",UM=t=>{const e=t instanceof Element?t:(t==null?void 0:t.parentElement)??null;return(e==null?void 0:e.closest(zwe))??null},VM=t=>Number.parseInt((t==null?void 0:t.dataset.line)??"",wy),Bwe=t=>{const e=window.getSelection();if(t===null||e===null||e.isCollapsed)return null;const n=UM(e.anchorNode),s=UM(e.focusNode);if(n===null||s===null||!t.contains(n)||!t.contains(s))return null;const i=VM(n),o=VM(s);return Number.isNaN(i)||Number.isNaN(o)?null:{anchorLine:i,headLine:o}},$we=(t,e)=>{var n;(n=t==null?void 0:t.querySelector(`[data-line="${String(e)}"]`))==null||n.scrollIntoView({block:"center"})},Fwe=(t,e)=>e===null?t:t.map(n=>({...n,isFocused:_we(e,Number.parseInt(n.numberLabel,wy))})),Hwe=t=>{const e=ee.c(14),{waypoint:n}=t,s=n.title;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Se(l$,"flex items-center gap-2 px-2.5 py-2"),e[0]=i):i=e[0];let o;e[1]!==n.coreChangeLabel?(o=n.coreChangeLabel===null?null:b.jsx(Ma,{kind:"core-change",label:n.coreChangeLabel}),e[1]=n.coreChangeLabel,e[2]=o):o=e[2];let r;e[3]!==n.title?(r=b.jsx("span",{className:"min-w-0 truncate text-[0.9375rem] font-semibold",children:n.title}),e[3]=n.title,e[4]=r):r=e[4];let a;e[5]!==n?(a=Qp(n),e[5]=n,e[6]=a):a=e[6];let c;e[7]!==a?(c=b.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n.title?(d=b.jsxs("section",{"aria-label":s,className:i,children:[o,r,c]}),e[9]=o,e[10]=r,e[11]=c,e[12]=n.title,e[13]=d):d=e[13],d},a$=t=>{const e=ee.c(45),{path:n,lines:s,statusMessage:i,waypoints:o,waypointOptions:r,highlightButtonLabel:a,focusOn:c,className:d,renderWaypoint:f,onHighlightCode:p}=t,m=_.useRef(null),{isShownAtFirst:g,canToggle:y}=Lwe[r],[v,S]=_.useState(g),[w,N]=_.useState(null),C=y?v:g;let T;e[0]!==w?(T=w===null?null:Awe(w),e[0]=w,e[1]=T):T=e[1];const R=T;let A;e[2]!==R?(A=Mwe(R),e[2]=R,e[3]=A):A=e[3];const k=A;let M;e[4]!==c||e[5]!==s?(M=s===null?null:Fwe(s,c),e[4]=c,e[5]=s,e[6]=M):M=e[6];const L=M,j=(c==null?void 0:c.lineStart)??null,D=s!==null;let P,B;e[7]!==j||e[8]!==D?(P=()=>{j!==null&&D&&$we(m.current,j)},B=[j,D],e[7]=j,e[8]=D,e[9]=P,e[10]=B):(P=e[9],B=e[10]),_.useEffect(P,B);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=(Q,se)=>{N(ae=>kwe(ae,Number.parseInt(Q,wy),se))},e[11]=I):I=e[11];const F=I;let z;e[12]!==p?(z=()=>{const Q=p===null?null:Bwe(m.current);Q!==null&&N(Q)},e[12]=p,e[13]=z):z=e[13];const U=z;let H;e[14]!==p?(H=Q=>{p==null||p(Q),N(null)},e[14]=p,e[15]=H):H=e[15];const V=H;let W;e[16]!==C||e[17]!==V||e[18]!==a||e[19]!==f||e[20]!==R||e[21]!==o?(W=Q=>{const se=Number.parseInt(Q,wy);return b.jsxs(b.Fragment,{children:[(R==null?void 0:R.lineEnd)===se?b.jsxs("div",{role:"toolbar","aria-label":Qp(R),className:Se(l$,"flex items-center gap-2 px-2.5 py-1.5"),children:[b.jsx("span",{className:"text-sm text-muted-foreground tabular-nums",children:Qp(R)}),b.jsx("span",{className:"flex-1"}),b.jsx(ft,{type:"button",variant:"ghost",size:"sm",onClick:()=>{N(null)},children:Pwe}),b.jsx(ft,{type:"button",size:"sm",onClick:()=>{V(R)},children:a})]}):null,C?o.filter(ae=>ae.lineEnd===se).map(ae=>f===void 0?b.jsx(Hwe,{waypoint:ae},ae.id):b.jsx("div",{children:f(ae)},ae.id)):null]})},e[16]=C,e[17]=V,e[18]=a,e[19]=f,e[20]=R,e[21]=o,e[22]=W):W=e[22];const G=W;let Y;e[23]!==d?(Y=Se("flex min-h-0 flex-col overflow-hidden rounded-md border",d),e[23]=d,e[24]=Y):Y=e[24];let J;e[25]!==n?(J=b.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:n,children:n}),e[25]=n,e[26]=J):J=e[26];let q;e[27]!==y||e[28]!==v?(q=y?b.jsx(ft,{type:"button",variant:"ghost",size:"sm","aria-pressed":v,onClick:()=>{S(Uwe)},children:v?Dwe:Iwe}):null,e[27]=y,e[28]=v,e[29]=q):q=e[29];let X;e[30]!==J||e[31]!==q?(X=b.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-3 border-b bg-muted pr-1 pl-3",children:[J,q]}),e[30]=J,e[31]=q,e[32]=X):X=e[32];let Z;e[33]!==L||e[34]!==U||e[35]!==p||e[36]!==n||e[37]!==G||e[38]!==k||e[39]!==i?(Z=L===null?b.jsx("p",{role:"status",className:"px-3 py-2.5 text-sm text-muted-foreground",children:i}):b.jsx("div",{ref:m,role:"presentation",className:"min-h-0 flex-1 overflow-y-auto bg-code",onMouseUp:U,children:b.jsx(Au,{lines:L,label:n,path:n,className:"py-0",renderLineExtra:G,...p===null?{}:{selectLineLabel:jwe,selectedLineLabels:k,onSelectLine:F}})}),e[33]=L,e[34]=U,e[35]=p,e[36]=n,e[37]=G,e[38]=k,e[39]=i,e[40]=Z):Z=e[40];let te;return e[41]!==Y||e[42]!==X||e[43]!==Z?(te=b.jsxs("div",{className:Y,children:[X,Z]}),e[41]=Y,e[42]=X,e[43]=Z,e[44]=te):te=e[44],te};function Uwe(t){return!t}const Vwe="flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none aria-disabled:text-muted-foreground aria-selected:bg-muted",qwe=(t,e,n)=>e===0?null:t===null?n===1?0:e-1:(t+n+e)%e,Wwe=({label:t,hint:e,placeholder:n,value:s,suggestions:i,message:o,errorMessage:r,isLiteral:a=!1,className:c,onValueChange:d,onSelect:f,onOpen:p,onEnter:m})=>{const g=_.useId(),y=_.useId(),v=_.useId(),S=_.useId(),[w,N]=_.useState(!1),[C,T]=_.useState(null),R=C===null?void 0:i[C],A=w&&(i.length>0||o!==null),k=r!==null,M=()=>{N(!1),T(null)},L=P=>{P.isDisabled||(f(P.id),M())},j=P=>{N(!0),T(B=>qwe(B,i.length,P))},D=P=>{P.key==="ArrowDown"?(P.preventDefault(),j(1)):P.key==="ArrowUp"?(P.preventDefault(),j(-1)):P.key==="Enter"?(P.preventDefault(),w&&R!==void 0?L(R):m==null||m()):P.key==="Escape"&&M()};return b.jsxs("div",{className:Se("grid gap-1.5",c),children:[b.jsx("label",{htmlFor:g,className:"text-sm font-bold",children:t}),e===null?null:b.jsx("p",{id:v,className:"text-sm text-muted-foreground",children:e}),b.jsxs("div",{className:"relative",children:[b.jsx(Hm,{id:g,role:"combobox",value:s,placeholder:n,autoComplete:"off",spellCheck:!1,"aria-expanded":A,"aria-controls":y,"aria-autocomplete":"list","aria-activedescendant":R===void 0?void 0:`${y}-${R.id}`,"aria-invalid":k,"aria-describedby":Se(e===null?"":v,k?S:"")||void 0,className:a?"font-mono placeholder:font-sans":"",onChange:P=>{d(P.target.value),N(!0),T(null)},onFocus:()=>{N(!0),p==null||p()},onBlur:M,onKeyDown:D}),b.jsxs("div",{id:y,role:"listbox","aria-label":t,hidden:!A,className:"absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground",children:[i.map(P=>b.jsxs("div",{id:`${y}-${P.id}`,role:"option",tabIndex:-1,"aria-selected":P.id===(R==null?void 0:R.id),"aria-disabled":P.isDisabled,className:Vwe,onMouseDown:B=>{B.preventDefault()},onClick:()=>{L(P)},onKeyDown:B=>{B.key==="Enter"&&L(P)},children:[P.marker,b.jsx("span",{className:Se("min-w-0 wrap-anywhere",a?"font-mono text-[0.94em]":""),children:P.label}),P.detail===null?null:b.jsx("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",children:P.detail}),P.stateLabel===null?null:b.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:P.stateLabel})]},P.id)),i.length===0&&o!==null?b.jsx("div",{role:"presentation",className:"px-2 py-1.5 text-sm text-muted-foreground",children:o}):null]})]}),k?b.jsx("p",{id:S,role:"alert",className:"text-sm text-destructive",children:r}):null]})},Gwe="/",Kwe=({path:t,stateLabel:e})=>{const n=t.lastIndexOf(Gwe);return{id:t,label:t.slice(n+1),detail:n<0?null:t.slice(0,n),stateLabel:e,isDisabled:!1}},CN=t=>{const e=ee.c(13),{label:n,hint:s,placeholder:i,query:o,files:r,message:a,errorMessage:c,className:d,onQueryChange:f,onSelect:p}=t;let m;e[0]!==r?(m=r.map(Kwe),e[0]=r,e[1]=m):m=e[1];let g;return e[2]!==d||e[3]!==c||e[4]!==s||e[5]!==n||e[6]!==a||e[7]!==f||e[8]!==p||e[9]!==i||e[10]!==o||e[11]!==m?(g=b.jsx(Wwe,{label:n,hint:s,placeholder:i,value:o,suggestions:m,message:a,errorMessage:c,isLiteral:!0,className:d,onValueChange:f,onSelect:p}),e[2]=d,e[3]=c,e[4]=s,e[5]=n,e[6]=a,e[7]=f,e[8]=p,e[9]=i,e[10]=o,e[11]=m,e[12]=g):g=e[12],g},Ywe="Add a card",qM="Pick a file, then the code the card stands for: one of its code blocks, or the lines you select in the code.",Xwe="File",Qwe="Search the files of the repository",WM="Code blocks",Zwe="Use these lines",Jwe="Pick a code block on the left, or select lines in the code: click a line number, then another with Shift.",eEe="Prefill the rows of the card from the code",tEe="Add card",nEe="Adding…",GM="size-4 accent-(--primary)",sEe="flex w-full flex-col rounded-md border border-input px-2.5 py-1.5 text-left transition-colors duration-[180ms] ease-out hover:bg-accent disabled:cursor-not-allowed disabled:opacity-60 aria-pressed:border-primary aria-pressed:bg-accent",iEe=t=>{const e=ee.c(65),{reviewKey:n,addition:s}=t,{segmentId:i,note:o,isSaving:r,errorMessage:a,onSubmit:c,onClose:d}=s,f=EN(n,"repository"),[p,m]=_.useState(null),[g,y]=_.useState(null),[v,S]=_.useState(!0),[w,N]=_.useState(!1),C=r$(n,p);let T;e[0]!==n||e[1]!==i?(T={...n,segmentId:i},e[0]=n,e[1]=i,e[2]=T):T=e[2];const{blocks:R,message:A}=Twe(T,p);let k;e[3]!==R||e[4]!==g?(k=(g==null?void 0:g.kind)==="block"?R.find(ne=>ne.id===g.blockId)??null:null,e[3]=R,e[4]=g,e[5]=k):k=e[5];const M=k,L=(g==null?void 0:g.kind)==="lines"?g:M;let j;e[6]!==f?(j=ne=>{m(ne),y(null),N(!1),f.onQueryChange(ne)},e[6]=f,e[7]=j):j=e[7];const D=j;let P;e[8]!==w||e[9]!==v||e[10]!==c||e[11]!==p||e[12]!==(M==null?void 0:M.childComponentsLabel)||e[13]!==g?(P=()=>{p===null||g===null||c({path:p,source:g,isPrefilled:v,hasChildComponents:w&&(M==null?void 0:M.childComponentsLabel)!=null})},e[8]=w,e[9]=v,e[10]=c,e[11]=p,e[12]=M==null?void 0:M.childComponentsLabel,e[13]=g,e[14]=P):P=e[14];const B=P;let I;e[15]!==d?(I=ne=>{ne||d()},e[15]=d,e[16]=I):I=e[16];let F;e[17]===Symbol.for("react.memo_cache_sentinel")?(F=b.jsx(vl,{children:Ywe}),e[17]=F):F=e[17];const z=o===null?qM:`${qM} ${o}`;let U;e[18]!==z?(U=b.jsxs(bl,{children:[F,b.jsx(Sl,{children:z})]}),e[18]=z,e[19]=U):U=e[19];let H;e[20]!==f.errorMessage||e[21]!==f.files||e[22]!==f.message||e[23]!==f.onQueryChange||e[24]!==f.query||e[25]!==D?(H=b.jsx(CN,{label:Xwe,hint:null,placeholder:Qwe,query:f.query,files:f.files,message:f.message,errorMessage:f.errorMessage,onQueryChange:f.onQueryChange,onSelect:D}),e[20]=f.errorMessage,e[21]=f.files,e[22]=f.message,e[23]=f.onQueryChange,e[24]=f.query,e[25]=D,e[26]=H):H=e[26];let V;e[27]!==R||e[28]!==A||e[29]!==C||e[30]!==p||e[31]!==(M==null?void 0:M.id)||e[32]!==(M==null?void 0:M.name)||e[33]!==L?(V=p===null?b.jsx("span",{}):b.jsxs("div",{className:"grid min-h-0 grid-cols-[16rem_minmax(0,1fr)] gap-3",children:[b.jsxs("section",{"aria-label":WM,className:"flex min-h-0 flex-col gap-2",children:[b.jsx("h3",{className:"text-sm font-bold",children:WM}),A===null?null:b.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:A}),b.jsx("ul",{className:"grid min-h-0 content-start gap-1 overflow-y-auto",children:R.map(ne=>b.jsx("li",{children:b.jsxs("button",{type:"button","aria-pressed":(M==null?void 0:M.id)===ne.id,disabled:ne.heldLabel!==null,className:sEe,onClick:()=>{y({kind:"block",blockId:ne.id})},children:[b.jsx("span",{className:"truncate font-mono text-[0.8125rem] font-bold",title:ne.name,children:ne.name}),b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:ne.heldLabel??ne.detail})]})},ne.id))})]}),b.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[b.jsx(a$,{path:p,lines:C.lines,statusMessage:C.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:Zwe,focusOn:L,className:"flex-1",onHighlightCode:ne=>{y({kind:"lines",...ne})}}),b.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:L===null?Jwe:[(M==null?void 0:M.name)??null,Qp(L)].filter(oEe).join(", ")})]})]}),e[27]=R,e[28]=A,e[29]=C,e[30]=p,e[31]=M==null?void 0:M.id,e[32]=M==null?void 0:M.name,e[33]=L,e[34]=V):V=e[34];let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=ne=>{S(ne.target.checked)},e[35]=W):W=e[35];let G;e[36]!==v?(G=b.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:v,className:GM,onChange:W}),eEe]}),e[36]=v,e[37]=G):G=e[37];let Y;e[38]!==w||e[39]!==M?(Y=(M==null?void 0:M.childComponentsLabel)==null?null:b.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:w,className:GM,onChange:ne=>{N(ne.target.checked)}}),M.childComponentsLabel]}),e[38]=w,e[39]=M,e[40]=Y):Y=e[40];let J;e[41]!==a?(J=a===null?null:b.jsx("p",{role:"alert",className:"text-sm text-destructive",children:a}),e[41]=a,e[42]=J):J=e[42];let q;e[43]!==G||e[44]!==Y||e[45]!==J?(q=b.jsxs("div",{className:"grid gap-1.5",children:[G,Y,J]}),e[43]=G,e[44]=Y,e[45]=J,e[46]=q):q=e[46];let X;e[47]!==d?(X=b.jsx(ft,{type:"button",variant:"ghost",onClick:d,children:"Cancel"}),e[47]=d,e[48]=X):X=e[48];const Z=p===null||g===null||r,te=r?nEe:tEe;let Q;e[49]!==B||e[50]!==Z||e[51]!==te?(Q=b.jsx(ft,{type:"button",disabled:Z,onClick:B,children:te}),e[49]=B,e[50]=Z,e[51]=te,e[52]=Q):Q=e[52];let se;e[53]!==X||e[54]!==Q?(se=b.jsxs(xl,{children:[X,Q]}),e[53]=X,e[54]=Q,e[55]=se):se=e[55];let ae;e[56]!==H||e[57]!==V||e[58]!==q||e[59]!==se||e[60]!==U?(ae=b.jsxs(yl,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[U,H,V,q,se]}),e[56]=H,e[57]=V,e[58]=q,e[59]=se,e[60]=U,e[61]=ae):ae=e[61];let le;return e[62]!==ae||e[63]!==I?(le=b.jsx(gl,{open:!0,onOpenChange:I,children:ae}),e[62]=ae,e[63]=I,e[64]=le):le=e[64],le};function oEe(t){return t!==null}const rEe="Done",KM=t=>{const e=ee.c(28),{title:n,description:s,entries:i,isPending:o,onMove:r,onClose:a}=t;let c;e[0]!==a?(c=w=>{w||a()},e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=b.jsx(vl,{children:n}),e[2]=n,e[3]=d):d=e[3];let f;e[4]!==s?(f=b.jsx(Sl,{children:s}),e[4]=s,e[5]=f):f=e[5];let p;e[6]!==d||e[7]!==f?(p=b.jsxs(bl,{children:[d,f]}),e[6]=d,e[7]=f,e[8]=p):p=e[8];let m;if(e[9]!==i||e[10]!==o||e[11]!==r){let w;e[13]!==o||e[14]!==r?(w=N=>b.jsxs("li",{className:"flex items-center gap-2 rounded-md border px-2.5 py-1.5",children:[b.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[b.jsx("span",{className:"truncate font-semibold",title:N.heading,children:N.heading}),b.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:N.detailLabel})]}),b.jsx(xs,{icon:"previous",label:`Move ${N.heading} up`,isDisabled:!N.canMoveUp||o,onClick:()=>{r(N.id,"up")}}),b.jsx(xs,{icon:"next",label:`Move ${N.heading} down`,isDisabled:!N.canMoveDown||o,onClick:()=>{r(N.id,"down")}})]},N.id),e[13]=o,e[14]=r,e[15]=w):w=e[15],m=i.map(w),e[9]=i,e[10]=o,e[11]=r,e[12]=m}else m=e[12];let g;e[16]!==m||e[17]!==n?(g=b.jsx("ol",{"aria-label":n,className:"grid max-h-96 gap-1 overflow-y-auto",children:m}),e[16]=m,e[17]=n,e[18]=g):g=e[18];let y;e[19]!==a?(y=b.jsx(xl,{children:b.jsx(ft,{type:"button",onClick:a,children:rEe})}),e[19]=a,e[20]=y):y=e[20];let v;e[21]!==p||e[22]!==g||e[23]!==y?(v=b.jsxs(yl,{children:[p,g,y]}),e[21]=p,e[22]=g,e[23]=y,e[24]=v):v=e[24];let S;return e[25]!==c||e[26]!==v?(S=b.jsx(gl,{open:!0,onOpenChange:c,children:v}),e[25]=c,e[26]=v,e[27]=S):S=e[27],S};var YM=Object.defineProperty,lEe=(t,e)=>{let n={};for(var s in t)YM(n,s,{get:t[s],enumerable:!0});return YM(n,Symbol.toStringTag,{value:"Module"}),n};function Ms(t){this.content=t}Ms.prototype={constructor:Ms,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var s=n&&n!=t?this.remove(n):this,i=s.find(t),o=s.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Ms(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ms(n)},addToStart:function(t,e){return new Ms([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ms(n)},addBefore:function(t,e,n){var s=this.remove(e),i=s.content.slice(),o=s.find(t);return i.splice(o==-1?i.length:o,0,e,n),new Ms(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ms.from(t),t.size?new Ms(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ms.from(t),t.size?new Ms(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ms.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ms.from=function(t){if(t instanceof Ms)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ms(e)};function c$(t,e,n){for(let s=0;;s++){if(s==t.childCount||s==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(s),o=e.child(s);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){let r=i.text,a=o.text,c=0;for(;r[c]==a[c];c++)n++;return c&&c<r.length&&c<a.length&&f$(r.charCodeAt(c-1))&&d$(r.charCodeAt(c))&&n--,n}if(i.content.size||o.content.size){let r=c$(i.content,o.content,n+1);if(r!=null)return r}n+=i.nodeSize}}function u$(t,e,n,s){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:s};let r=t.child(--i),a=e.child(--o),c=r.nodeSize;if(r==a){n-=c,s-=c;continue}if(!r.sameMarkup(a))return{a:n,b:s};if(r.isText&&r.text!=a.text){let d=r.text,f=a.text,p=d.length,m=f.length;for(;p>0&&m>0&&d[p-1]==f[m-1];)p--,m--,n--,s--;return p&&m&&p<d.length&&f$(d.charCodeAt(p-1))&&d$(d.charCodeAt(p))&&(n++,s++),{a:n,b:s}}if(r.content.size||a.content.size){let d=u$(r.content,a.content,n-1,s-1);if(d)return d}n-=c,s-=c}}function d$(t){return t>=56320&&t<57344}function f$(t){return t>=55296&&t<56320}class je{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let s=0;s<e.length;s++)this.size+=e[s].nodeSize}nodesBetween(e,n,s,i=0,o){for(let r=0,a=0;a<n;r++){let c=this.content[r],d=a+c.nodeSize;if(d>e&&s(c,i+a,o||null,r)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,e-f),Math.min(c.content.size,n-f),s,i+f)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,s,i){let o="",r=!0;return this.nodesBetween(e,n,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&s&&(r?r=!1:o+=s),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,s=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(s)&&(i[i.length-1]=n.withText(n.text+s.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new je(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let s=[],i=0;if(n>e)for(let o=0,r=0;r<n;o++){let a=this.content[o],c=r+a.nodeSize;c>e&&((r<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-r),Math.min(a.text.length,n-r)):a=a.cut(Math.max(0,e-r-1),Math.min(a.content.size,n-r-1))),s.push(a),i+=a.nodeSize),r=c}return new je(s,i)}cutByIndex(e,n){return e==n?je.empty:e==0&&n==this.content.length?this:new je(this.content.slice(e,n))}replaceChild(e,n){let s=this.content[e];if(s==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-s.nodeSize;return i[e]=n,new je(i,o)}addToStart(e){return new je([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new je(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,s=0;n<this.content.length;n++){let i=this.content[n];e(i,s,n),s+=i.nodeSize}}findDiffStart(e,n=0){return c$(this,e,n)}findDiffEnd(e,n=this.size,s=e.size){return u$(this,e,n,s)}findIndex(e){if(e==0)return s1(0,e);if(e==this.size)return s1(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,s=0;;n++){let i=this.child(n),o=s+i.nodeSize;if(o>=e)return o==e?s1(n+1,o):s1(n,s);s=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return je.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return je.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return je.empty;let n,s=0;for(let i=0;i<e.length;i++){let o=e[i];s+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new je(n||e,s)}static from(e){if(!e)return je.empty;if(e instanceof je)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new je([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}je.empty=new je([],0);const ES={index:0,offset:0};function s1(t,e){return ES.index=t,ES.offset=e,ES}function Ey(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let s=0;s<t.length;s++)if(!Ey(t[s],e[s]))return!1}else{for(let s in t)if(!(s in e)||!Ey(t[s],e[s]))return!1;for(let s in e)if(!(s in t))return!1}return!0}let wn=class ME{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,s=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!s&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),s=!0),n&&n.push(o)}}return n||(n=e.slice()),s||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ey(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let s=e.marks[n.type];if(!s)throw new RangeError(`There is no mark type ${n.type} in this schema`);return s.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let s=0;s<e.length;s++)if(!e[s].eq(n[s]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ME.none;if(e instanceof ME)return[e];let n=e.slice();return n.sort((s,i)=>s.type.rank-i.type.rank),n}};wn.none=[];class Zp extends Error{}class Ke{constructor(e,n,s){this.content=e,this.openStart=n,this.openEnd=s}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let s=p$(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return s&&new Ke(s,this.openStart,this.openEnd)}removeBetween(e,n){return new Ke(h$(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Ke.empty;let s=n.openStart||0,i=n.openEnd||0;if(typeof s!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ke(je.fromJSON(e,n.content),s,i)}static maxOpen(e,n=!0){let s=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)s++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Ke(e,s,i)}}Ke.empty=new Ke(je.empty,0,0);function h$(t,e,n){let{index:s,offset:i}=t.findIndex(e),o=t.maybeChild(s),{index:r,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(r).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(s!=r)throw new RangeError("Removing non-flat range");return t.replaceChild(s,o.copy(h$(o.content,e-i-1,n-i-1)))}function p$(t,e,n,s,i,o){let{index:r,offset:a}=t.findIndex(e),c=t.maybeChild(r);if(a==e||c.isText)return o&&s<=0&&i<=0&&!o.canReplace(r,r,n)?null:t.cut(0,e).append(n).append(t.cut(e));let d=p$(c.content,e-a-1,n,r==0?s-1:0,r==t.childCount-1?i-1:0,c);return d&&t.replaceChild(r,c.copy(d))}function aEe(t,e,n){if(n.openStart>t.depth)throw new Zp("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zp("Inconsistent open depths");return m$(t,e,n,0)}function m$(t,e,n,s){let i=t.index(s),o=t.node(s);if(i==e.index(s)&&s<t.depth-n.openStart){let r=m$(t,e,n,s+1);return o.copy(o.content.replaceChild(i,r))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==s&&e.depth==s){let r=t.parent,a=r.content;return su(r,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:r,end:a}=cEe(n,t);return su(o,y$(t,r,a,e,s))}else return su(o,Cy(t,e,s))}function g$(t,e){if(!e.type.compatibleContent(t.type))throw new Zp("Cannot join "+e.type.name+" onto "+t.type.name)}function LE(t,e,n){let s=t.node(n);return g$(s,e.node(n)),s}function nu(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function xp(t,e,n,s){let i=(e||t).node(n),o=0,r=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(nu(t.nodeAfter,s),o++));for(let a=o;a<r;a++)nu(i.child(a),s);e&&e.depth==n&&e.textOffset&&nu(e.nodeBefore,s)}function su(t,e){if(!t.type.validContent(e))throw new Zp("Invalid content for node "+t.type.name);return t.copy(e)}function y$(t,e,n,s,i){let o=t.depth>i&&LE(t,e,i+1),r=s.depth>i&&LE(n,s,i+1),a=[];return xp(null,t,i,a),o&&r&&e.index(i)==n.index(i)?(g$(o,r),nu(su(o,y$(t,e,n,s,i+1)),a)):(o&&nu(su(o,Cy(t,e,i+1)),a),xp(e,n,i,a),r&&nu(su(r,Cy(n,s,i+1)),a)),xp(s,null,i,a),new je(a)}function Cy(t,e,n){let s=[];if(xp(null,t,n,s),t.depth>n){let i=LE(t,e,n+1);nu(su(i,Cy(t,e,n+1)),s)}return xp(e,null,n,s),new je(s)}function cEe(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(je.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Jp{constructor(e,n,s){this.pos=e,this.path=n,this.parentOffset=s,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let s=this.pos-this.path[this.path.length-1],i=e.child(n);return s?e.child(n).cut(s):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let s=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=s.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return wn.none;if(this.textOffset)return e.child(n).marks;let s=e.maybeChild(n-1),i=e.maybeChild(n);if(!s){let a=s;s=i,i=a}let o=s.marks;for(var r=0;r<o.length;r++)o[r].type.spec.inclusive===!1&&(!i||!o[r].isInSet(i.marks))&&(o=o[r--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let s=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let s=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);s>=0;s--)if(e.pos<=this.end(s)&&(!n||n(this.node(s))))return new Ny(this,e,s);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let s=[],i=0,o=n;for(let r=e;;){let{index:a,offset:c}=r.content.findIndex(o),d=o-c;if(s.push(r,a,i+c),!d||(r=r.child(a),r.isText))break;o=d-1,i+=c+1}return new Jp(n,s,o)}static resolveCached(e,n){let s=XM.get(e);if(s)for(let o=0;o<s.elts.length;o++){let r=s.elts[o];if(r.pos==n)return r}else XM.set(e,s=new uEe);let i=s.elts[s.i]=Jp.resolve(e,n);return s.i=(s.i+1)%dEe,i}}class uEe{constructor(){this.elts=[],this.i=0}}const dEe=12,XM=new WeakMap;class Ny{constructor(e,n,s){this.$from=e,this.$to=n,this.depth=s}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const fEe=Object.create(null);let iu=class IE{constructor(e,n,s,i=wn.none){this.type=e,this.attrs=n,this.marks=i,this.content=s||je.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,s,i=0){this.content.nodesBetween(e,n,s,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,s,i){return this.content.textBetween(e,n,s,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,s){return this.type==e&&Ey(this.attrs,n||e.defaultAttrs||fEe)&&wn.sameSet(this.marks,s||wn.none)}copy(e=null){return e==this.content?this:new IE(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new IE(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,s=!1){if(e==n)return Ke.empty;let i=this.resolve(e),o=this.resolve(n),r=s?0:i.sharedDepth(n),a=i.start(r),d=i.node(r).content.cut(i.pos-a,o.pos-a);return new Ke(d,i.depth-r,o.depth-r)}replace(e,n,s){return aEe(this.resolve(e),this.resolve(n),s)}nodeAt(e){for(let n=this;;){let{index:s,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(s),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:s}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:s}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:s}=this.content.findIndex(e);if(s<e)return{node:this.content.child(n),index:n,offset:s};let i=this.content.child(n-1);return{node:i,index:n-1,offset:s-i.nodeSize}}resolve(e){return Jp.resolveCached(this,e)}resolveNoCache(e){return Jp.resolve(this,e)}rangeHasMark(e,n,s){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(s.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),b$(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,s=je.empty,i=0,o=s.childCount){let r=this.contentMatchAt(e).matchFragment(s,i,o),a=r&&r.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(s.child(c).marks))return!1;return!0}canReplaceWith(e,n,s,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(s),r=o&&o.matchFragment(this.content,n);return r?r.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),QM(this.type.attrs,this.attrs,"node",this.type.name);let e=wn.none;for(let n=0;n<this.marks.length;n++){let s=this.marks[n];QM(s.type.attrs,s.attrs,"mark",s.type.name),e=s.addToSet(e)}if(!wn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let s;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");s=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,s)}let i=je.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,s)}};iu.prototype.text=void 0;class Ty extends iu{constructor(e,n,s,i){if(super(e,n,null,i),!s)throw new RangeError("Empty text nodes are not allowed");this.text=s}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):b$(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ty(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ty(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function b$(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}function QM(t,e,n,s){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${s}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}class yu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let s=new hEe(e,n);if(s.next==null)return yu.empty;let i=x$(s);s.next&&s.err("Unexpected trailing text");let o=vEe(xEe(i));return SEe(o,s),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,s=e.childCount){let i=this;for(let o=n;i&&o<s;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let s=0;s<e.next.length;s++)if(this.next[n].type==e.next[s].type)return!0;return!1}fillBefore(e,n=!1,s=0){let i=[this];function o(r,a){let c=r.matchFragment(e,s);if(c&&(!n||c.validEnd))return je.from(a.map(d=>d.createAndFill()));for(let d=0;d<r.next.length;d++){let{type:f,next:p}=r.next[d];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let m=o(p,a.concat(f));if(m)return m}}return null}return o(this,[])}findWrapping(e){for(let s=0;s<this.wrapCache.length;s+=2)if(this.wrapCache[s]==e)return this.wrapCache[s+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),s=[{match:this,type:null,via:null}];for(;s.length;){let i=s.shift(),o=i.match;if(o.matchType(e)){let r=[];for(let a=i;a.type;a=a.via)r.push(a.type);return r.reverse()}for(let r=0;r<o.next.length;r++){let{type:a,next:c}=o.next[r];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||c.validEnd)&&(s.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(s){e.push(s);for(let i=0;i<s.next.length;i++)e.indexOf(s.next[i].next)==-1&&n(s.next[i].next)}return n(this),e.map((s,i)=>{let o=i+(s.validEnd?"*":" ")+" ";for(let r=0;r<s.next.length;r++)o+=(r?", ":"")+s.next[r].type.name+"->"+e.indexOf(s.next[r].next);return o}).join(`
366
+ `)}}yu.empty=new yu(!0);class hEe{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function x$(t){let e=[];do e.push(pEe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function pEe(t){let e=[];do e.push(mEe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function mEe(t){let e=bEe(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=gEe(t,e);else break;return e}function ZM(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function gEe(t,e){let n=ZM(t),s=n;return t.eat(",")&&(t.next!="}"?s=ZM(t):s=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:s,expr:e}}function yEe(t,e){let n=t.nodeTypes,s=n[e];if(s)return[s];let i=[];for(let o in n){let r=n[o];r.isInGroup(e)&&i.push(r)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function bEe(t){if(t.eat("(")){let e=x$(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=yEe(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function xEe(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function s(r,a,c){let d={term:c,to:a};return e[r].push(d),d}function i(r,a){r.forEach(c=>c.to=a)}function o(r,a){if(r.type=="choice")return r.exprs.reduce((c,d)=>c.concat(o(d,a)),[]);if(r.type=="seq")for(let c=0;;c++){let d=o(r.exprs[c],a);if(c==r.exprs.length-1)return d;i(d,a=n())}else if(r.type=="star"){let c=n();return s(a,c),i(o(r.expr,c),c),[s(c)]}else if(r.type=="plus"){let c=n();return i(o(r.expr,a),c),i(o(r.expr,c),c),[s(c)]}else{if(r.type=="opt")return[s(a)].concat(o(r.expr,a));if(r.type=="range"){let c=a;for(let d=0;d<r.min;d++){let f=n();i(o(r.expr,c),f),c=f}if(r.max==-1)i(o(r.expr,c),c);else for(let d=r.min;d<r.max;d++){let f=n();s(c,f),i(o(r.expr,c),f),c=f}return[s(c)]}else{if(r.type=="name")return[s(a,void 0,r.value)];throw new Error("Unknown expr type")}}}}function v$(t,e){return e-t}function JM(t,e){let n=[];return s(e),n.sort(v$);function s(i){let o=t[i];if(o.length==1&&!o[0].term)return s(o[0].to);n.push(i);for(let r=0;r<o.length;r++){let{term:a,to:c}=o[r];!a&&n.indexOf(c)==-1&&s(c)}}}function vEe(t){let e=Object.create(null);return n(JM(t,0));function n(s){let i=[];s.forEach(r=>{t[r].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let f=0;f<i.length;f++)i[f][0]==a&&(d=i[f][1]);JM(t,c).forEach(f=>{d||i.push([a,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[s.join(",")]=new yu(s.indexOf(t.length-1)>-1);for(let r=0;r<i.length;r++){let a=i[r][1].sort(v$);o.next.push({type:i[r][0],next:e[a.join(",")]||n(a)})}return o}}function SEe(t,e){for(let n=0,s=[t];n<s.length;n++){let i=s[n],o=!i.validEnd,r=[];for(let a=0;a<i.next.length;a++){let{type:c,next:d}=i.next[a];r.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),s.indexOf(d)==-1&&s.push(d)}o&&e.err("Only non-generatable nodes ("+r.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function S$(t){let e=Object.create(null);for(let n in t){let s=t[n];if(!s.hasDefault)return null;e[n]=s.default}return e}function w$(t,e){let n=Object.create(null);for(let s in t){let i=t[s],o=e&&e[s];if(o===void 0)if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+s);else i.validate&&i.validate(o);n[s]=o}return n}function E$(t,e){let n=Object.create(null);if(e)for(let s in e)n[s]=new EEe(t,s,e[s]);return n}let eL=class C${constructor(e,n,s){this.name=e,this.schema=n,this.spec=s,this.markSet=null,this.groups=s.group?s.group.split(" "):[],this.attrs=E$(e,s.attrs),this.defaultAttrs=S$(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(s.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==yu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:w$(this.attrs,e)}create(e=null,n,s){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new iu(this,this.computeAttrs(e),je.from(n),wn.setFrom(s))}createChecked(e=null,n,s){return n=je.from(n),this.checkContent(n),new iu(this,this.computeAttrs(e),n,wn.setFrom(s))}createAndFill(e=null,n,s){if(e=this.computeAttrs(e),n=je.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(je.empty,!0);return o?new iu(this,e,n.append(o),wn.setFrom(s)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let s=0;s<e.childCount;s++)if(!this.allowsMarks(e.child(s).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let s=0;s<e.length;s++)this.allowsMarkType(e[s].type)?n&&n.push(e[s]):n||(n=e.slice(0,s));return n?n.length?n:wn.none:e}static compile(e,n){let s=Object.create(null);e.forEach((o,r)=>s[o]=new C$(o,n,r));let i=n.spec.topNode||"doc";if(!s[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!s.text)throw new RangeError("Every schema needs a 'text' type");for(let o in s.text.attrs)throw new RangeError("The text node type should not have attributes");return s}};function wEe(t,e,n){let s=n.split("|");return i=>{let o=i===null?"null":typeof i;if(s.indexOf(o)<0)throw new RangeError(`Expected value of type ${s} for attribute ${e} on type ${t}, got ${o}`)}}class EEe{constructor(e,n,s){this.hasDefault=Object.prototype.hasOwnProperty.call(s,"default"),this.default=s.default,this.validate=typeof s.validate=="string"?wEe(e,n,s.validate):s.validate}get isRequired(){return!this.hasDefault}}class $b{constructor(e,n,s,i){this.name=e,this.rank=n,this.schema=s,this.spec=i,this.attrs=E$(e,i.attrs),this.excluded=null;let o=S$(this.attrs);this.instance=o?new wn(this,o):null}create(e=null){return!e&&this.instance?this.instance:new wn(this,w$(this.attrs,e))}static compile(e,n){let s=Object.create(null),i=0;return e.forEach((o,r)=>s[o]=new $b(o,i++,n,r)),s}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class N${constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Ms.from(e.nodes),n.marks=Ms.from(e.marks||{}),this.nodes=eL.compile(this.spec.nodes,this),this.marks=$b.compile(this.spec.marks,this);let s=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],r=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=s[r]||(s[r]=yu.parse(r,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?tL(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],r=o.spec.excludes;o.excluded=r==null?[o]:r==""?[]:tL(this,r.split(" "))}this.nodeFromJSON=i=>iu.fromJSON(this,i),this.markFromJSON=i=>wn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,s,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof eL){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,s,i)}text(e,n){let s=this.nodes.text;return new Ty(s,s.defaultAttrs,e,wn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function tL(t,e){let n=[];for(let s=0;s<e.length;s++){let i=e[s],o=t.marks[i],r=o;if(o)n.push(o);else for(let a in t.marks){let c=t.marks[a];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(r=c)}if(!r)throw new SyntaxError("Unknown mark type: '"+e[s]+"'")}return n}function CEe(t){return t.tag!=null}function NEe(t){return t.style!=null}class rl{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let s=this.matchedStyles=[];n.forEach(i=>{if(CEe(i))this.tags.push(i);else if(NEe(i)){let o=/[^=]*/.exec(i.style)[0];s.indexOf(o)<0&&s.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let s=new sL(this,n,!1);return s.addAll(e,wn.none,n.from,n.to),s.finish()}parseSlice(e,n={}){let s=new sL(this,n,!0);return s.addAll(e,wn.none,n.from,n.to),Ke.maxOpen(s.finish())}matchTag(e,n,s){for(let i=s?this.tags.indexOf(s)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(REe(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let r=o.getAttrs(e);if(r===!1)continue;o.attrs=r||void 0}return o}}}matchStyle(e,n,s,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let r=this.styles[o],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!s.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(r.getAttrs){let c=r.getAttrs(n);if(c===!1)continue;r.attrs=c||void 0}return r}}}static schemaRules(e){let n=[];function s(i){let o=i.priority==null?50:i.priority,r=0;for(;r<n.length;r++){let a=n[r];if((a.priority==null?50:a.priority)<o)break}n.splice(r,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(r=>{s(r=iL(r)),r.mark||r.ignore||r.clearMark||(r.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(r=>{s(r=iL(r)),r.node||r.ignore||r.mark||(r.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new rl(e,rl.schemaRules(e)))}}const T$={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},TEe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},O$={ol:!0,ul:!0},em=1,DE=2,vp=4;function nL(t,e,n){return e!=null?(e?em:0)|(e==="full"?DE:0):t&&t.whitespace=="pre"?em|DE:n&~vp}class i1{constructor(e,n,s,i,o,r){this.type=e,this.attrs=n,this.marks=s,this.solid=i,this.options=r,this.content=[],this.activeMarks=wn.none,this.match=o||(r&vp?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(je.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let s=this.type.contentMatch,i;return(i=s.findWrapping(e.type))?(this.match=s,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&em)){let s=this.content[this.content.length-1],i;if(s&&s.isText&&(i=/[ \t\r\n\u000c]+$/.exec(s.text))){let o=s;s.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=je.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(je.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!T$.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sL{constructor(e,n,s){this.parser=e,this.options=n,this.isOpen=s,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,r=nL(null,n.preserveWhitespace,0)|(s?vp:0);i?o=new i1(i.type,i.attrs,wn.none,!0,n.topMatch||i.type.contentMatch,r):s?o=new i1(null,null,wn.none,!0,null,r):o=new i1(e.schema.topNodeType,null,wn.none,!0,null,r),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let s=e.nodeValue,i=this.top,o=i.options&DE?"full":this.localPreserveWS||(i.options&em)>0,{schema:r}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(s)){if(o)if(o==="full")s=s.replace(/\r\n?/g,`
367
+ `);else if(r.linebreakReplacement&&/[\r\n]/.test(s)&&this.top.findWrapping(r.linebreakReplacement.create())){let a=s.split(/\r?\n|\r/);for(let c=0;c<a.length;c++)c&&this.insertNode(r.linebreakReplacement.create(),n,!0),a[c]&&this.insertNode(r.text(a[c]),n,!/\S/.test(a[c]));s=""}else s=s.replace(/\r?\n|\r/g," ");else if(s=s.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(s)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],c=e.previousSibling;(!a||c&&c.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(s=s.slice(1))}s&&this.insertNode(r.text(s),n,!/\S/.test(s)),this.findInText(e)}else this.findInside(e)}addElement(e,n,s){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let r=e.nodeName.toLowerCase(),a;O$.hasOwnProperty(r)&&this.parser.normalizeLists&&OEe(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,s));e:if(c?c.ignore:TEe.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,f=this.needsBlock;if(T$.hasOwnProperty(r))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=c&&c.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(o),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
368
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let s=e.style;if(s&&s.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],r=s.getPropertyValue(o);if(r)for(let a=void 0;;){let c=this.parser.matchStyle(o,r,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return n}addElementByRule(e,n,s,i){let o,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),s,e.nodeName=="BR")||this.leafFallback(e,s);else{let c=this.enter(r,n.attrs||null,s,n.preserveWhitespace);c&&(o=!0,s=c)}else{let c=this.parser.schema.marks[n.mark];s=s.concat(c.create(n.attrs))}let a=this.top;if(r&&r.isLeaf)this.findInside(e);else if(i)this.addElement(e,s,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,s,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,s),this.findAround(e,c,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,s,i){let o=s||0;for(let r=s?e.childNodes[s]:e.firstChild,a=i==null?null:e.childNodes[i];r!=a;r=r.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(r,n);this.findAtPoint(e,o)}findPlace(e,n,s){let i,o;for(let r=this.open,a=0;r>=0;r--){let c=this.nodes[r],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+a)&&(i=d,o=c,!d.length))break;if(c.solid){if(s)break;a+=2}}if(!i)return null;this.sync(o);for(let r=0;r<i.length;r++)n=this.enterInner(i[r],null,n,!1);return n}insertNode(e,n,s){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(e,n,s);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let r=wn.none;for(let a of i.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):oL(a.type,e.type))&&(r=a.addToSet(r));return o.content.push(e.mark(r)),!0}return!1}enter(e,n,s,i){let o=this.findPlace(e.create(n),s,!1);return o&&(o=this.enterInner(e,n,s,!0,i)),o}enterInner(e,n,s,i=!1,o){this.closeExtra();let r=this.top;r.match=r.match&&r.match.matchType(e);let a=nL(e,o,r.options);r.options&vp&&r.content.length==0&&(a|=vp);let c=wn.none;return s=s.filter(d=>(r.type?r.type.allowsMarkType(d.type):oL(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new i1(e,n,c,i,null,a)),this.open++,s}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=em)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let s=this.nodes[n].content;for(let i=s.length-1;i>=0;i--)e+=s[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].node==e&&this.find[s].offset==n&&(this.find[s].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,s){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(s?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),s=this.options.context,i=!this.isOpen&&(!s||s.parent.type==this.nodes[0].type),o=-(s?s.depth+1:0)+(i?0:1),r=(a,c)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;c>=o;c--)if(r(a-1,c))return!0;return!1}else{let f=c>0||c==0&&i?this.nodes[c].type:s&&c>=o?s.node(c-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;c--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(s&&s.isTextblock&&s.defaultAttrs)return s}for(let n in this.parser.schema.nodes){let s=this.parser.schema.nodes[n];if(s.isTextblock&&s.defaultAttrs)return s}}}function OEe(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let s=e.nodeType==1?e.nodeName.toLowerCase():null;s&&O$.hasOwnProperty(s)&&n?(n.appendChild(e),e=n):s=="li"?n=e:s&&(n=null)}}function REe(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function iL(t){let e={};for(let n in t)e[n]=t[n];return e}function oL(t,e){let n=e.schema.nodes;for(let s in n){let i=n[s];if(!i.allowsMarkType(t))continue;let o=[],r=a=>{o.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:f}=a.edge(c);if(d==e||o.indexOf(f)<0&&r(f))return!0}};if(r(i.contentMatch))return!0}}class Mu{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},s){s||(s=o1(n).createDocumentFragment());let i=s,o=[];return e.forEach(r=>{if(o.length||r.marks.length){let a=0,c=0;for(;a<o.length&&c<r.marks.length;){let d=r.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<o.length;)i=o.pop()[1];for(;c<r.marks.length;){let d=r.marks[c++],f=this.serializeMark(d,r.isInline,n);f&&(o.push([d,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(r,n))}),s}serializeNodeInner(e,n){if(e.isText)return o1(n).createTextNode(e.text);let{dom:s,contentDOM:i}=A1(o1(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return s}serializeNode(e,n={}){let s=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(s),s=o.dom)}return s}serializeMark(e,n,s={}){let i=this.marks[e.type.name];return i&&A1(o1(s),i(e,n),null,e.attrs)}static renderSpec(e,n,s=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:A1(e,n,s,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Mu(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=rL(e.nodes);return n.text||(n.text=s=>s.text),n}static marksFromSchema(e){return rL(e.marks)}}function rL(t){let e={};for(let n in t){let s=t[n].spec.toDOM;s&&(e[n]=s)}return e}function o1(t){return t.document||window.document}const lL=new WeakMap;function kEe(t){let e=lL.get(t);return e===void 0&&lL.set(t,e=AEe(t)),e}function AEe(t){let e=null;function n(s){if(s&&typeof s=="object")if(Array.isArray(s))if(typeof s[0]=="string")e||(e=[]),e.push(s);else for(let i=0;i<s.length;i++)n(s[i]);else for(let i in s)n(s[i])}return n(t),e}function A1(t,e,n,s){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(s&&(o=kEe(s))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=i.indexOf(" ");r>0&&(n=i.slice(0,r),i=i.slice(r+1));let a,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let p in d)if(d[p]!=null){let m=p.indexOf(" ");m>0?c.setAttributeNS(p.slice(0,m),p.slice(m+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=f;p<e.length;p++){let m=e[p];if(m===0){if(p<e.length-1||p>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof m=="string")c.appendChild(t.createTextNode(m));else{let{dom:g,contentDOM:y}=A1(t,m,n,s);if(c.appendChild(g),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:c,contentDOM:a}}const R$=65535,k$=Math.pow(2,16);function _Ee(t,e){return t+e*k$}function aL(t){return t&R$}function MEe(t){return(t-(t&R$))/k$}const A$=1,_$=2,_1=4,M$=8;class jE{constructor(e,n,s){this.pos=e,this.delInfo=n,this.recover=s}get deleted(){return(this.delInfo&M$)>0}get deletedBefore(){return(this.delInfo&(A$|_1))>0}get deletedAfter(){return(this.delInfo&(_$|_1))>0}get deletedAcross(){return(this.delInfo&_1)>0}}class $i{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&$i.empty)return $i.empty}recover(e){let n=0,s=aL(e);if(!this.inverted)for(let i=0;i<s;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[s*3]+n+MEe(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,s){let i=0,o=this.inverted?2:1,r=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[a+o],f=this.ranges[a+r],p=c+d;if(e<=p){let m=d?e==c?-1:e==p?1:n:n,g=c+i+(m<0?0:f);if(s)return g;let y=e==(n<0?c:p)?null:_Ee(a/3,e-c),v=0;return d&&(v|=e==c?_$:e==p?A$:_1,(n<0?e!=c:e!=p)&&(v|=M$)),new jE(g,v,y)}i+=f-d}return s?e+i:new jE(e+i,0,null)}touches(e,n){let s=0,i=aL(n),o=this.inverted?2:1,r=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?s:0);if(c>e)break;let d=this.ranges[a+o],f=c+d;if(e<=f&&a==i*3)return!0;s+=this.ranges[a+r]-d}return!1}forEach(e){let n=this.inverted?2:1,s=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let r=this.ranges[i],a=r-(this.inverted?o:0),c=r+(this.inverted?0:o),d=this.ranges[i+n],f=this.ranges[i+s];e(a,a+d,c,c+f),o+=f-d}}invert(){return new $i(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$i.empty:new $i(e<0?[0,-e,0]:[0,0,e])}}$i.empty=new $i([]);class tm{constructor(e,n,s=0,i=e?e.length:0){this.mirror=n,this.from=s,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new tm(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,s=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?s+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,s=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?s-i-1:void 0)}}invert(){let e=new tm;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let s=this.from;s<this.to;s++)e=this._maps[s].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,s){let i=0;for(let o=this.from;o<this.to;o++){let r=this._maps[o],a=r.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this._maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return s?e:new jE(e,i,null)}}const CS=Object.create(null);class Ks{getMap(){return $i.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let s=CS[n.stepType];if(!s)throw new RangeError(`No step type ${n.stepType} defined`);return s.fromJSON(e,n)}static jsonID(e,n){if(e in CS)throw new RangeError("Duplicate use of step JSON ID "+e);return CS[e]=n,n.prototype.jsonID=e,n}}class is{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new is(e,null)}static fail(e){return new is(null,e)}static fromReplace(e,n,s,i){try{return is.ok(e.replace(n,s,i))}catch(o){if(o instanceof Zp)return is.fail(o.message);throw o}}}function NN(t,e,n){let s=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(NN(o.content,e,o))),o.isInline&&(o=e(o,n,i)),s.push(o)}return je.fromArray(s)}class Ta extends Ks{constructor(e,n,s){super(),this.from=e,this.to=n,this.mark=s}apply(e){let n=e.slice(this.from,this.to),s=e.resolve(this.from),i=s.node(s.sharedDepth(this.to)),o=new Ke(NN(n.content,(r,a)=>!r.isAtom||!a.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),i),n.openStart,n.openEnd);return is.fromReplace(e,this.from,this.to,o)}invert(){return new Ao(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return n.deleted&&s.deleted||n.pos>=s.pos?null:new Ta(n.pos,s.pos,this.mark)}merge(e){return e instanceof Ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ta(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ta(n.from,n.to,e.markFromJSON(n.mark))}}Ks.jsonID("addMark",Ta);class Ao extends Ks{constructor(e,n,s){super(),this.from=e,this.to=n,this.mark=s}apply(e){let n=e.slice(this.from,this.to),s=new Ke(NN(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return is.fromReplace(e,this.from,this.to,s)}invert(){return new Ta(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),s=e.mapResult(this.to,-1);return n.deleted&&s.deleted||n.pos>=s.pos?null:new Ao(n.pos,s.pos,this.mark)}merge(e){return e instanceof Ao&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ao(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ao(n.from,n.to,e.markFromJSON(n.mark))}}Ks.jsonID("removeMark",Ao);class Oa extends Ks{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return is.fail("No node at mark step's position");let s=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return is.fromReplace(e,this.pos,this.pos+1,new Ke(je.from(s),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let s=this.mark.addToSet(n.marks);if(s.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(s))return new Oa(this.pos,n.marks[i]);return new Oa(this.pos,this.mark)}}return new bu(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Oa(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Oa(n.pos,e.markFromJSON(n.mark))}}Ks.jsonID("addNodeMark",Oa);class bu extends Ks{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return is.fail("No node at mark step's position");let s=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return is.fromReplace(e,this.pos,this.pos+1,new Ke(je.from(s),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Oa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new bu(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bu(n.pos,e.markFromJSON(n.mark))}}Ks.jsonID("removeNodeMark",bu);class Kn extends Ks{constructor(e,n,s,i=!1){super(),this.from=e,this.to=n,this.slice=s,this.structure=i}apply(e){return this.structure&&PE(e,this.from,this.to)?is.fail("Structure replace would overwrite content"):is.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $i([this.from,this.to-this.from,this.slice.size])}invert(e){return new Kn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),s=this.from==this.to&&Kn.MAP_BIAS<0?n:e.mapResult(this.from,1);return s.deletedAcross&&n.deletedAcross?null:new Kn(s.pos,Math.max(s.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Kn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Ke.empty:new Ke(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Kn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Ke.empty:new Ke(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Kn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Kn(n.from,n.to,Ke.fromJSON(e,n.slice),!!n.structure)}}Kn.MAP_BIAS=1;Ks.jsonID("replace",Kn);class vs extends Ks{constructor(e,n,s,i,o,r,a=!1){super(),this.from=e,this.to=n,this.gapFrom=s,this.gapTo=i,this.slice=o,this.insert=r,this.structure=a}apply(e){if(this.structure&&(PE(e,this.from,this.gapFrom)||PE(e,this.gapTo,this.to)))return is.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return is.fail("Gap is not a flat range");let s=this.slice.insertAt(this.insert,n.content);return s?is.fromReplace(e,this.from,this.to,s):is.fail("Content does not fit in gap")}getMap(){return new $i([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new vs(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),s=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?s.pos:e.map(this.gapTo,1);return n.deletedAcross&&s.deletedAcross||i<n.pos||o>s.pos?null:new vs(n.pos,s.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new vs(n.from,n.to,n.gapFrom,n.gapTo,Ke.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ks.jsonID("replaceAround",vs);function PE(t,e,n){let s=t.resolve(e),i=n-e,o=s.depth;for(;i>0&&o>0&&s.indexAfter(o)==s.node(o).childCount;)o--,i--;if(i>0){let r=s.node(o).maybeChild(s.indexAfter(o));for(;i>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,i--}}return!1}function LEe(t,e,n,s){let i=[],o=[],r,a;t.doc.nodesBetween(e,n,(c,d,f)=>{if(!c.isInline)return;let p=c.marks;if(!s.isInSet(p)&&f.type.allowsMarkType(s.type)){let m=Math.max(d,e),g=Math.min(d+c.nodeSize,n),y=s.addToSet(p);for(let v=0;v<p.length;v++)p[v].isInSet(y)||(r&&r.to==m&&r.mark.eq(p[v])?r.to=g:i.push(r=new Ao(m,g,p[v])));a&&a.to==m?a.to=g:o.push(a=new Ta(m,g,s))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function IEe(t,e,n,s){let i=[],o=0;t.doc.nodesBetween(e,n,(r,a)=>{if(!r.isInline)return;o++;let c=null;if(s instanceof $b){let d=r.marks,f;for(;f=s.isInSet(d);)(c||(c=[])).push(f),d=f.removeFromSet(d)}else s?s.isInSet(r.marks)&&(c=[s]):c=r.marks;if(c&&c.length){let d=Math.min(a+r.nodeSize,n);for(let f=0;f<c.length;f++){let p=c[f],m;for(let g=0;g<i.length;g++){let y=i[g];y.step==o-1&&p.eq(i[g].style)&&(m=y)}m?(m.to=d,m.step=o):i.push({style:p,from:Math.max(a,e),to:d,step:o})}}}),i.forEach(r=>t.step(new Ao(r.from,r.to,r.style)))}function TN(t,e,n,s=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),r=[],a=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),f=a+d.nodeSize,p=s.matchType(d.type);if(!p)r.push(new Kn(a,f,Ke.empty));else{s=p;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||t.step(new Ao(a,f,d.marks[m]));if(i&&d.isText&&n.whitespace!="pre"){let m,g=/\r?\n|\r/g,y;for(;m=g.exec(d.text);)y||(y=new Ke(je.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),r.push(new Kn(a+m.index,a+m.index+m[0].length,y))}}a=f}if(!s.validEnd){let c=s.fillBefore(je.empty,!0);t.replace(a,a,new Ke(c,0,0))}for(let c=r.length-1;c>=0;c--)t.step(r[c])}function DEe(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Uf(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let s=t.depth,i=0,o=0;;--s){let r=t.$from.node(s),a=t.$from.index(s)+i,c=t.$to.indexAfter(s)-o;if(s<t.depth&&r.canReplace(a,c,n))return s;if(s==0||r.type.spec.isolating||!DEe(r,a,c))break;a&&(i=1),c<r.childCount&&(o=1)}return null}function jEe(t,e,n){let{$from:s,$to:i,depth:o}=e,r=s.before(o+1),a=i.after(o+1),c=r,d=a,f=je.empty,p=0;for(let y=o,v=!1;y>n;y--)v||s.index(y)>0?(v=!0,f=je.from(s.node(y).copy(f)),p++):c--;let m=je.empty,g=0;for(let y=o,v=!1;y>n;y--)v||i.after(y+1)<i.end(y)?(v=!0,m=je.from(i.node(y).copy(m)),g++):d++;t.step(new vs(c,d,r,a,new Ke(f.append(m),p,g),f.size-p,!0))}function ON(t,e,n=null,s=t){let i=PEe(t,e),o=i&&zEe(s,e);return o?i.map(cL).concat({type:e,attrs:n}).concat(o.map(cL)):null}function cL(t){return{type:t,attrs:null}}function PEe(t,e){let{parent:n,startIndex:s,endIndex:i}=t,o=n.contentMatchAt(s).findWrapping(e);if(!o)return null;let r=o.length?o[0]:e;return n.canReplaceWith(s,i,r)?o:null}function zEe(t,e){let{parent:n,startIndex:s,endIndex:i}=t,o=n.child(s),r=e.contentMatch.findWrapping(o.type);if(!r)return null;let c=(r.length?r[r.length-1]:e).contentMatch;for(let d=s;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:r}function BEe(t,e,n){let s=je.empty;for(let r=n.length-1;r>=0;r--){if(s.size){let a=n[r].type.contentMatch.matchFragment(s);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=je.from(n[r].type.create(n[r].attrs,s))}let i=e.start,o=e.end;t.step(new vs(i,o,i,o,new Ke(s,0,0),n.length,!0))}function $Ee(t,e,n,s,i){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(r,a)=>{let c=typeof i=="function"?i(r):i;if(r.isTextblock&&!r.hasMarkup(s,c)&&FEe(t.doc,t.mapping.slice(o).map(a),s)){let d=null;if(s.schema.linebreakReplacement){let g=s.whitespace=="pre",y=!!s.contentMatch.matchType(s.schema.linebreakReplacement);g&&!y?d=!1:!g&&y&&(d=!0)}d===!1&&I$(t,r,a,o),TN(t,t.mapping.slice(o).map(a,1),s,void 0,d===null);let f=t.mapping.slice(o),p=f.map(a,1),m=f.map(a+r.nodeSize,1);return t.step(new vs(p,m,p+1,m-1,new Ke(je.from(s.create(c,null,r.marks)),0,0),1,!0)),d===!0&&L$(t,r,a,o),!1}})}function L$(t,e,n,s){e.forEach((i,o)=>{if(i.isText){let r,a=/\r?\n|\r/g;for(;r=a.exec(i.text);){let c=t.mapping.slice(s).map(n+1+o+r.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function I$(t,e,n,s){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let r=t.mapping.slice(s).map(n+1+o);t.replaceWith(r,r+1,e.type.schema.text(`
369
+ `))}})}function FEe(t,e,n){let s=t.resolve(e),i=s.index();return s.parent.canReplaceWith(i,i+1,n)}function HEe(t,e,n,s,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let r=n.create(s,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,r);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new vs(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Ke(je.from(r),0,0),1,!0))}function ll(t,e,n=1,s){let i=t.resolve(e),o=i.depth-n,r=s&&s[s.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!r.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let p=i.node(d),m=i.index(d);if(p.type.spec.isolating)return!1;let g=p.content.cutByIndex(m,p.childCount),y=s&&s[f+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let v=s&&s[f]||p;if(!p.canReplace(m+1,p.childCount)||!v.type.validContent(g))return!1}let a=i.indexAfter(o),c=s&&s[0];return i.node(o).canReplaceWith(a,a,c?c.type:i.node(o+1).type)}function UEe(t,e,n=1,s){let i=t.doc.resolve(e),o=je.empty,r=je.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=je.from(i.node(a).copy(o));let f=s&&s[d];r=je.from(f?f.type.create(f.attrs,r):i.node(a).copy(r))}t.step(new Kn(e,e,new Ke(o.append(r),n,n),!0))}function tc(t,e){let n=t.resolve(e),s=n.index();return D$(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(s,s+1)}function VEe(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:s}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),r=o.type==s?t.type.schema.nodes.text:o.type;if(n=n.matchType(r),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function D$(t,e){return!!(t&&e&&!t.isLeaf&&VEe(t,e))}function Fb(t,e,n=-1){let s=t.resolve(e);for(let i=s.depth;;i--){let o,r,a=s.index(i);if(i==s.depth?(o=s.nodeBefore,r=s.nodeAfter):n>0?(o=s.node(i+1),a++,r=s.node(i).maybeChild(a)):(o=s.node(i).maybeChild(a-1),r=s.node(i+1)),o&&!o.isTextblock&&D$(o,r)&&s.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?s.before(i):s.after(i)}}function qEe(t,e,n){let s=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),r=o.node().type;if(i&&r.inlineContent){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(i);f&&!p?s=!1:!f&&p&&(s=!0)}let a=t.steps.length;if(s===!1){let f=t.doc.resolve(e+n);I$(t,f.node(),f.before(),a)}r.inlineContent&&TN(t,e+n-1,r,o.node().contentMatchAt(o.index()),s==null);let c=t.mapping.slice(a),d=c.map(e-n);if(t.step(new Kn(d,c.map(e+n,-1),Ke.empty,!0)),s===!0){let f=t.doc.resolve(d);L$(t,f.node(),f.before(),t.steps.length)}return t}function WEe(t,e,n){let s=t.resolve(e);if(s.parent.canReplaceWith(s.index(),s.index(),n))return e;if(s.parentOffset==0)for(let i=s.depth-1;i>=0;i--){let o=s.index(i);if(s.node(i).canReplaceWith(o,o,n))return s.before(i+1);if(o>0)return null}if(s.parentOffset==s.parent.content.size)for(let i=s.depth-1;i>=0;i--){let o=s.indexAfter(i);if(s.node(i).canReplaceWith(o,o,n))return s.after(i+1);if(o<s.node(i).childCount)return null}return null}function GEe(t,e,n){let s=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let r=s.depth;r>=0;r--){let a=r==s.depth?0:s.pos<=(s.start(r+1)+s.end(r+1))/2?-1:1,c=s.index(r)+(a>0?1:0),d=s.node(r),f=!1;if(o==1)f=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);f=p&&d.canReplaceWith(c,c,p[0])}if(f)return a==0?s.pos:a<0?s.before(r+1):s.after(r+1)}return null}function Hb(t,e,n=e,s=Ke.empty){if(e==n&&!s.size)return null;let i=t.resolve(e),o=t.resolve(n);return j$(i,o,s)?new Kn(e,n,s):new KEe(i,o,s).fit()}function j$(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class KEe{constructor(e,n,s){this.$from=e,this.$to=n,this.unplaced=s,this.frontier=[],this.placed=je.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=je.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,s=this.$from,i=this.close(e<0?this.$to:s.doc.resolve(e));if(!i)return null;let o=this.placed,r=s.depth,a=i.depth;for(;r&&a&&o.childCount==1;)o=o.firstChild.content,r--,a--;let c=new Ke(o,r,a);return e>-1?new vs(s.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||s.pos!=this.$to.pos?new Kn(s.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,s=0,i=this.unplaced.openEnd;s<e;s++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=s){e=s;break}n=o.content}for(let n=1;n<=2;n++)for(let s=n==1?e:this.unplaced.openStart;s>=0;s--){let i,o=null;s?(o=uL(this.unplaced.content,s-1).firstChild,i=o.content):i=this.unplaced.content;let r=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:d}=this.frontier[a],f,p=null;if(n==1&&(r?d.matchType(r.type)||(p=d.fillBefore(je.from(r),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:s,frontierDepth:a,parent:o,inject:p};if(n==2&&r&&(f=d.findWrapping(r.type)))return{sliceDepth:s,frontierDepth:a,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:s}=this.unplaced;return dL(e,-1)<=n?!1:(this.unplaced.size>1&&dL(e,1)>s&&s++,this.unplaced=new Ke(e,n+1,s),!0)}dropNode(){let{content:e,openStart:n,openEnd:s}=this.unplaced,i=uL(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Ke(op(e,n-1,1),n-1,o?n-1:s)}else this.unplaced=new Ke(op(e,n,1),n,s)}placeNodes({sliceDepth:e,frontierDepth:n,parent:s,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let r=this.unplaced,a=s?s.content:r.content,c=r.openStart-e,d=0,f=[],{match:p,type:m}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)f.push(i.child(v));p=p.matchFragment(i)}let g=a.size+e-(r.content.size-r.openEnd);for(;d<a.childCount;){let v=a.child(d),S=p.matchType(v.type);if(!S)break;d++,(d>1||c==0||v.content.size)&&(p=S,f.push(P$(v.mark(m.allowedMarks(v.marks)),d==1?c:0,d==a.childCount?g:-1)))}let y=d==a.childCount;y||(g=-1),this.placed=rp(this.placed,n,je.from(f)),this.frontier[n].match=p,y&&g<0&&s&&s.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,S=a;v<g;v++){let w=S.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),S=w.content}this.unplaced=y?e==0?Ke.empty:new Ke(op(r.content,e-1,1),e-1,g<0?r.openEnd:e-1):new Ke(op(r.content,e,d),r.openStart,r.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!NS(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:s}=this.$to,i=this.$to.after(s);for(;s>1&&i==this.$to.end(--s);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:s,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),r=NS(e,n,i,s,o);if(r){for(let a=n-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],f=NS(e,a,d,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:r,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=rp(this.placed,n.depth,n.fit)),e=n.move;for(let s=n.depth+1;s<=e.depth;s++){let i=e.node(s),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(s));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,s){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=rp(this.placed,this.depth,je.from(e.create(n,s))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(je.empty,!0);n.childCount&&(this.placed=rp(this.placed,this.frontier.length,n))}}function op(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(op(t.firstChild.content,e-1,n)))}function rp(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(rp(t.lastChild.content,e-1,n)))}function uL(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function P$(t,e,n){if(e<=0)return t;let s=t.content;return e>1&&(s=s.replaceChild(0,P$(s.firstChild,e-1,s.childCount==1?n-1:0))),e>0&&(s=t.type.contentMatch.fillBefore(s).append(s),n<=0&&(s=s.append(t.type.contentMatch.matchFragment(s).fillBefore(je.empty,!0)))),t.copy(s)}function NS(t,e,n,s,i){let o=t.node(e),r=i?t.indexAfter(e):t.index(e);if(r==o.childCount&&!n.compatibleContent(o.type))return null;let a=s.fillBefore(o.content,!0,r);return a&&!YEe(n,o.content,r)?a:null}function YEe(t,e,n){for(let s=n;s<e.childCount;s++)if(!t.allowsMarks(e.child(s).marks))return!0;return!1}function XEe(t){return t.spec.defining||t.spec.definingForContent}function dL(t,e){for(let n=0;;n++){let s=e<0?t.firstChild:t.lastChild;if(!s||s.isAtom)return n;t=s.content}}function QEe(t,e,n,s){if(!s.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(j$(i,o,s))return t.step(new Kn(e,n,s));let r=B$(i,o);r[r.length-1]==0&&r.pop();let a=-(i.depth+1);r.unshift(a);for(let m=i.depth,g=i.pos-1;m>0;m--,g--){let y=i.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;r.indexOf(m)>-1?a=m:i.before(m)==g&&r.splice(1,0,-m)}let c=r.indexOf(a),d=[],f=s.openStart;for(let m=s.content,g=0;;g++){let y=m.firstChild;if(d.push(y),g==s.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let g=d[m],y=XEe(g.type);if(y&&!g.sameMarkup(i.node(Math.abs(a)-1)))f=m;else if(y||!g.type.isTextblock)break}for(let m=s.openStart;m>=0;m--){let g=(m+f+1)%(s.openStart+1),y=d[g];if(y)for(let v=0;v<r.length;v++){let S=r[(v+c)%r.length],w=!0;S<0&&(w=!1,S=-S);let N=i.node(S-1),C=i.index(S-1);if(N.canReplaceWith(C,C,y.type,y.marks))return t.replace(i.before(S),w?o.after(S):n,new Ke(z$(s.content,0,s.openStart,g),g,s.openEnd))}}let p=t.steps.length;for(let m=r.length-1;m>=0&&(t.replace(e,n,s),!(t.steps.length>p));m--){let g=r[m];g<0||(e=i.before(g),n=o.after(g))}}function z$(t,e,n,s,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(z$(o.content,e+1,n,s,o)))}if(e>s){let o=i.contentMatchAt(0),r=o.fillBefore(t).append(t);t=r.append(o.matchFragment(r).fillBefore(je.empty,!0))}return t}function ZEe(t,e,n,s){if(!s.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=WEe(t.doc,e,s.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Ke(je.from(s),0,0))}function JEe(t,e,n){let s=t.doc.resolve(e),i=t.doc.resolve(n);if(s.parent.isTextblock&&i.parent.isTextblock&&s.start()!=i.start()&&s.parentOffset==0&&i.parentOffset==0){let r=s.sharedDepth(n),a=!1;for(let c=s.depth;c>r;c--)s.node(c).type.spec.isolating&&(a=!0);for(let c=i.depth;c>r;c--)i.node(c).type.spec.isolating&&(a=!0);if(!a){for(let c=s.depth;c>0&&e==s.start(c);c--)e=s.before(c);for(let c=i.depth;c>0&&n==i.start(c);c--)n=i.before(c);s=t.doc.resolve(e),i=t.doc.resolve(n)}}let o=B$(s,i);for(let r=0;r<o.length;r++){let a=o[r],c=r==o.length-1;if(c&&a==0||s.node(a).type.contentMatch.validEnd)return t.delete(s.start(a),i.end(a));if(a>0&&(c||s.node(a-1).canReplace(s.index(a-1),i.indexAfter(a-1))))return t.delete(s.before(a),i.after(a))}for(let r=1;r<=s.depth&&r<=i.depth;r++)if(e-s.start(r)==s.depth-r&&n>s.end(r)&&i.end(r)-n!=i.depth-r&&s.start(r-1)==i.start(r-1)&&s.node(r-1).canReplace(s.index(r-1),i.index(r-1)))return t.delete(s.before(r),n);t.delete(e,n)}function B$(t,e){let n=[],s=Math.min(t.depth,e.depth);for(let i=s;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Gd extends Ks{constructor(e,n,s){super(),this.pos=e,this.attr=n,this.value=s}apply(e){let n=e.nodeAt(this.pos);if(!n)return is.fail("No node at attribute step's position");let s=Object.create(null);for(let o in n.attrs)s[o]=n.attrs[o];s[this.attr]=this.value;let i=n.type.create(s,null,n.marks);return is.fromReplace(e,this.pos,this.pos+1,new Ke(je.from(i),0,n.isLeaf?0:1))}getMap(){return $i.empty}invert(e){return new Gd(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Gd(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Gd(n.pos,n.attr,n.value)}}Ks.jsonID("attr",Gd);class nm extends Ks{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let s=e.type.create(n,e.content,e.marks);return is.ok(s)}getMap(){return $i.empty}invert(e){return new nm(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nm(n.attr,n.value)}}Ks.jsonID("docAttr",nm);let Cf=class extends Error{};Cf=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Cf.prototype=Object.create(Error.prototype);Cf.prototype.constructor=Cf;Cf.prototype.name="TransformError";class $${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tm}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Cf(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let s=0;s<this.mapping.maps.length;s++){let i=this.mapping.maps[s];s&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((o,r,a,c)=>{e=Math.min(e,a),n=Math.max(n,c)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,s=Ke.empty){let i=Hb(this.doc,e,n,s);return i&&this.step(i),this}replaceWith(e,n,s){return this.replace(e,n,new Ke(je.from(s),0,0))}delete(e,n){return this.replace(e,n,Ke.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,s){return QEe(this,e,n,s),this}replaceRangeWith(e,n,s){return ZEe(this,e,n,s),this}deleteRange(e,n){return JEe(this,e,n),this}lift(e,n){return jEe(this,e,n),this}join(e,n=1){return qEe(this,e,n),this}wrap(e,n){return BEe(this,e,n),this}setBlockType(e,n=e,s,i=null){return $Ee(this,e,n,s,i),this}setNodeMarkup(e,n,s=null,i){return HEe(this,e,n,s,i),this}setNodeAttribute(e,n,s){return this.step(new Gd(e,n,s)),this}setDocAttribute(e,n){return this.step(new nm(e,n)),this}addNodeMark(e,n){return this.step(new Oa(e,n)),this}removeNodeMark(e,n){let s=this.doc.nodeAt(e);if(!s)throw new RangeError("No node at position "+e);if(n instanceof wn)n.isInSet(s.marks)&&this.step(new bu(e,n));else{let i=s.marks,o,r=[];for(;o=n.isInSet(i);)r.push(new bu(e,o)),i=o.removeFromSet(i);for(let a=r.length-1;a>=0;a--)this.step(r[a])}return this}split(e,n=1,s){return UEe(this,e,n,s),this}addMark(e,n,s){return LEe(this,e,n,s),this}removeMark(e,n,s){return IEe(this,e,n,s),this}clearIncompatible(e,n,s){return TN(this,e,n,s),this}}const TS=Object.create(null);class Vt{constructor(e,n,s){this.$anchor=e,this.$head=n,this.ranges=s||[new eCe(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Ke.empty){let s=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=s,s=s.lastChild;let o=e.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:c,$to:d}=r[a],f=e.mapping.slice(o);e.replaceRange(f.map(c.pos),f.map(d.pos),a?Ke.empty:n),a==0&&pL(e,o,(s?s.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let s=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:r,$to:a}=i[o],c=e.mapping.slice(s),d=c.map(r.pos),f=c.map(a.pos);o?e.deleteRange(d,f):(e.replaceRangeWith(d,f,n),pL(e,s,n.isInline?-1:1))}}static findFrom(e,n,s=!1){let i=e.parent.inlineContent?new Et(e):Rd(e.node(0),e.parent,e.pos,e.index(),n,s);if(i)return i;for(let o=e.depth-1;o>=0;o--){let r=n<0?Rd(e.node(0),e.node(o),e.before(o+1),e.index(o),n,s):Rd(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,s);if(r)return r}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Fi(e.node(0))}static atStart(e){return Rd(e,e,0,0,1)||new Fi(e)}static atEnd(e){return Rd(e,e,e.content.size,e.childCount,-1)||new Fi(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let s=TS[n.type];if(!s)throw new RangeError(`No selection type ${n.type} defined`);return s.fromJSON(e,n)}static jsonID(e,n){if(e in TS)throw new RangeError("Duplicate use of selection JSON ID "+e);return TS[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Et.between(this.$anchor,this.$head).getBookmark()}}Vt.prototype.visible=!0;class eCe{constructor(e,n){this.$from=e,this.$to=n}}let fL=!1;function hL(t){!fL&&!t.parent.inlineContent&&(fL=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Et extends Vt{constructor(e,n=e){hL(e),hL(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let s=e.resolve(n.map(this.head));if(!s.parent.inlineContent)return Vt.near(s);let i=e.resolve(n.map(this.anchor));return new Et(i.parent.inlineContent?i:s,s)}replace(e,n=Ke.empty){if(super.replace(e,n),n==Ke.empty){let s=this.$from.marksAcross(this.$to);s&&e.ensureMarks(s)}}eq(e){return e instanceof Et&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ub(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Et(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,s=n){let i=e.resolve(n);return new this(i,s==n?i:e.resolve(s))}static between(e,n,s){let i=e.pos-n.pos;if((!s||i)&&(s=i>=0?1:-1),!n.parent.inlineContent){let o=Vt.findFrom(n,s,!0)||Vt.findFrom(n,-s,!0);if(o)n=o.$head;else return Vt.near(n,s)}return e.parent.inlineContent||(i==0?e=n:(e=(Vt.findFrom(e,-s,!0)||Vt.findFrom(e,s,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Et(e,n)}}Vt.jsonID("text",Et);class Ub{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ub(e.map(this.anchor),e.map(this.head))}resolve(e){return Et.between(e.resolve(this.anchor),e.resolve(this.head))}}class ut extends Vt{constructor(e){let n=e.nodeAfter,s=e.node(0).resolve(e.pos+n.nodeSize);super(e,s),this.node=n}map(e,n){let{deleted:s,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return s?Vt.near(o):new ut(o)}content(){return new Ke(je.from(this.node),0,0)}eq(e){return e instanceof ut&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new RN(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ut(e.resolve(n.anchor))}static create(e,n){return new ut(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ut.prototype.visible=!1;Vt.jsonID("node",ut);class RN{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:s}=e.mapResult(this.anchor);return n?new Ub(s,s):new RN(s)}resolve(e){let n=e.resolve(this.anchor),s=n.nodeAfter;return s&&ut.isSelectable(s)?new ut(n):Vt.near(n)}}class Fi extends Vt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Ke.empty){if(n==Ke.empty){e.delete(0,e.doc.content.size);let s=Vt.atStart(e.doc);s.eq(e.selection)||e.setSelection(s)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Fi(e)}map(e){return new Fi(e)}eq(e){return e instanceof Fi}getBookmark(){return tCe}}Vt.jsonID("all",Fi);const tCe={map(){return this},resolve(t){return new Fi(t)}};function Rd(t,e,n,s,i,o=!1){if(e.inlineContent)return Et.create(t,n);for(let r=s-(i>0?0:1);i>0?r<e.childCount:r>=0;r+=i){let a=e.child(r);if(a.isAtom){if(!o&&ut.isSelectable(a))return ut.create(t,n-(i<0?a.nodeSize:0))}else{let c=Rd(t,a,n+i,i<0?a.childCount:0,i,o);if(c)return c}n+=a.nodeSize*i}return null}function pL(t,e,n){let s=t.steps.length-1;if(s<e)return;let i=t.steps[s];if(!(i instanceof Kn||i instanceof vs))return;let o=t.mapping.maps[s],r;o.forEach((a,c,d,f)=>{r==null&&(r=f)}),t.setSelection(Vt.near(t.doc.resolve(r),n))}const mL=1,r1=2,gL=4;class nCe extends $${constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|mL)&~r1,this.storedMarks=null,this}get selectionSet(){return(this.updated&mL)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=r1,this}ensureMarks(e){return wn.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&r1)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~r1,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let s=this.selection;return n&&(e=e.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||wn.none))),s.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,s){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(s==null&&(s=n),!e)return this.deleteRange(n,s);let o=this.storedMarks;if(!o){let r=this.doc.resolve(n);o=s==n?r.marks():r.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(n,s,i.text(e,o)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Vt.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gL,this}get scrolledIntoView(){return(this.updated&gL)>0}}function yL(t,e){return!e||!t?t:t.bind(e)}class lp{constructor(e,n,s){this.name=e,this.init=yL(n.init,s),this.apply=yL(n.apply,s)}}const sCe=[new lp("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new lp("selection",{init(t,e){return t.selection||Vt.atStart(e.doc)},apply(t){return t.selection}}),new lp("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,s){return s.selection.$cursor?t.storedMarks:null}}),new lp("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class OS{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sCe.slice(),n&&n.forEach(s=>{if(this.pluginsByKey[s.key])throw new RangeError("Adding different instances of a keyed plugin ("+s.key+")");this.plugins.push(s),this.pluginsByKey[s.key]=s,s.spec.state&&this.fields.push(new lp(s.key,s.spec.state,s))})}}class Xr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let s=0;s<this.config.plugins.length;s++)if(s!=n){let i=this.config.plugins[s];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],s=this.applyInner(e),i=null;for(;;){let o=!1;for(let r=0;r<this.config.plugins.length;r++){let a=this.config.plugins[r];if(a.spec.appendTransaction){let c=i?i[r].n:0,d=i?i[r].state:this,f=c<n.length&&a.spec.appendTransaction.call(a,c?n.slice(c):n,d,s);if(f&&s.filterTransaction(f,r)){if(f.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<r?{state:s,n:n.length}:{state:this,n:0})}n.push(f),s=s.applyInner(f),o=!0}i&&(i[r]={state:s,n:n.length})}}if(!o)return{state:s,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Xr(this.config),s=this.config.fields;for(let i=0;i<s.length;i++){let o=s[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new nCe(this)}static create(e){let n=new OS(e.doc?e.doc.type.schema:e.schema,e.plugins),s=new Xr(n);for(let i=0;i<n.fields.length;i++)s[n.fields[i].name]=n.fields[i].init(e,s);return s}reconfigure(e){let n=new OS(this.schema,e.plugins),s=n.fields,i=new Xr(n);for(let o=0;o<s.length;o++){let r=s[o].name;i[r]=this.hasOwnProperty(r)?this[r]:s[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(s=>s.toJSON())),e&&typeof e=="object")for(let s in e){if(s=="doc"||s=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[s],o=i.spec.state;o&&o.toJSON&&(n[s]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,s){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new OS(e.schema,e.plugins),o=new Xr(i);return i.fields.forEach(r=>{if(r.name=="doc")o.doc=iu.fromJSON(e.schema,n.doc);else if(r.name=="selection")o.selection=Vt.fromJSON(o.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(s)for(let a in s){let c=s[a],d=c.spec.state;if(c.key==r.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[r.name]=d.fromJSON.call(c,e,n[a],o);return}}o[r.name]=r.init(e,o)}}),o}}function F$(t,e,n){for(let s in t){let i=t[s];i instanceof Function?i=i.bind(e):s=="handleDOMEvents"&&(i=F$(i,e,{})),n[s]=i}return n}class Gi{constructor(e){this.spec=e,this.props={},e.props&&F$(e.props,this,this.props),this.key=e.key?e.key.key:H$("plugin")}getState(e){return e[this.key]}}const RS=Object.create(null);function H$(t){return t in RS?t+"$"+ ++RS[t]:(RS[t]=0,t+"$")}class Po{constructor(e="key"){this.key=H$(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const U$=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function V$(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const q$=(t,e,n)=>{let s=V$(t,n);if(!s)return!1;let i=kN(s);if(!i){let r=s.blockRange(),a=r&&Uf(r);return a==null?!1:(e&&e(t.tr.lift(r,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(eF(t,i,e,-1))return!0;if(s.parent.content.size==0&&(Nf(o,"end")||ut.isSelectable(o)))for(let r=s.depth;;r--){let a=Hb(t.doc,s.before(r),s.after(r),Ke.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Nf(o,"end")?Vt.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):ut.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(r==1||s.node(r-1).childCount>1)break}return o.isAtom&&i.depth==s.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},iCe=(t,e,n)=>{let s=V$(t,n);if(!s)return!1;let i=kN(s);return i?W$(t,i,e):!1},oCe=(t,e,n)=>{let s=K$(t,n);if(!s)return!1;let i=AN(s);return i?W$(t,i,e):!1};function W$(t,e,n){let s=e.nodeBefore,i=s,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let r=e.nodeAfter,a=r,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let f=a.firstChild;if(!f)return!1;a=f}let d=Hb(t.doc,o,c,Ke.empty);if(!d||d.from!=o||d instanceof Kn&&d.slice.size>=c-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(Et.create(f.doc,o)),n(f.scrollIntoView())}return!0}function Nf(t,e,n=!1){for(let s=t;s;s=e=="start"?s.firstChild:s.lastChild){if(s.isTextblock)return!0;if(n&&s.childCount!=1)return!1}return!1}const G$=(t,e,n)=>{let{$head:s,empty:i}=t.selection,o=s;if(!i)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):s.parentOffset>0)return!1;o=kN(s)}let r=o&&o.nodeBefore;return!r||!ut.isSelectable(r)?!1:(e&&e(t.tr.setSelection(ut.create(t.doc,o.pos-r.nodeSize)).scrollIntoView()),!0)};function kN(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function K$(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Y$=(t,e,n)=>{let s=K$(t,n);if(!s)return!1;let i=AN(s);if(!i)return!1;let o=i.nodeAfter;if(eF(t,i,e,1))return!0;if(s.parent.content.size==0&&(Nf(o,"start")||ut.isSelectable(o))){let r=Hb(t.doc,s.before(),s.after(),Ke.empty);if(r&&r.slice.size<r.to-r.from){if(e){let a=t.tr.step(r);a.setSelection(Nf(o,"start")?Vt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ut.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==s.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},X$=(t,e,n)=>{let{$head:s,empty:i}=t.selection,o=s;if(!i)return!1;if(s.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):s.parentOffset<s.parent.content.size)return!1;o=AN(s)}let r=o&&o.nodeAfter;return!r||!ut.isSelectable(r)?!1:(e&&e(t.tr.setSelection(ut.create(t.doc,o.pos)).scrollIntoView()),!0)};function AN(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const rCe=(t,e)=>{let n=t.selection,s=n instanceof ut,i;if(s){if(n.node.isTextblock||!tc(t.doc,n.from))return!1;i=n.from}else if(i=Fb(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);s&&o.setSelection(ut.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},lCe=(t,e)=>{let n=t.selection,s;if(n instanceof ut){if(n.node.isTextblock||!tc(t.doc,n.to))return!1;s=n.to}else if(s=Fb(t.doc,n.to,1),s==null)return!1;return e&&e(t.tr.join(s).scrollIntoView()),!0},aCe=(t,e)=>{let{$from:n,$to:s}=t.selection,i=n.blockRange(s),o=i&&Uf(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Q$=(t,e)=>{let{$head:n,$anchor:s}=t.selection;return!n.parent.type.spec.code||!n.sameParent(s)?!1:(e&&e(t.tr.insertText(`
370
+ `).scrollIntoView()),!0)};function _N(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const cCe=(t,e)=>{let{$head:n,$anchor:s}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(s))return!1;let i=n.node(-1),o=n.indexAfter(-1),r=_N(i.contentMatchAt(o));if(!r||!i.canReplaceWith(o,o,r))return!1;if(e){let a=n.after(),c=t.tr.replaceWith(a,a,r.createAndFill());c.setSelection(Vt.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},Z$=(t,e)=>{let n=t.selection,{$from:s,$to:i}=n;if(n instanceof Fi||s.parent.inlineContent||i.parent.inlineContent)return!1;let o=_N(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let r=(!s.parentOffset&&i.index()<i.parent.childCount?s:i).pos,a=t.tr.insert(r,o.createAndFill());a.setSelection(Et.create(a.doc,r+1)),e(a.scrollIntoView())}return!0},J$=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(ll(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let s=n.blockRange(),i=s&&Uf(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)};function uCe(t){return(e,n)=>{if(e.selection instanceof ut&&e.selection.node.isBlock){let{$from:g}=e.selection;return!g.parentOffset||!ll(e.doc,g.pos)?!1:(n&&n(e.tr.split(g.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let s=e.tr;!e.selection.empty&&(e.selection instanceof Et||e.selection instanceof Fi)&&s.deleteSelection();let{$from:i}=s.selection,o=s.steps.length,r=[],a,c,d=!1,f=!1;for(let g=i.depth;;g--)if(i.node(g).isBlock){d=i.end(g)==i.pos+(i.depth-g),f=i.start(g)==i.pos-(i.depth-g),c=_N(i.node(g-1).contentMatchAt(i.indexAfter(g-1))),r.unshift(d&&c?{type:c}:null),a=g;break}else{if(g==1)return!1;r.unshift(null)}let p=i.pos,m=ll(s.doc,p,r.length,r);if(m||(r[0]=c?{type:c}:null,m=ll(s.doc,p,r.length,r)),!m)return!1;if(s.split(p,r.length,r),!d&&f&&i.node(a).type!=c){let g=s.mapping.slice(o),y=g.map(i.before(a)),v=s.doc.resolve(y);c&&i.node(a-1).canReplaceWith(v.index(),v.index()+1,c)&&s.setNodeMarkup(g.map(i.before(a)),c)}return n&&n(s.scrollIntoView()),!0}}const dCe=uCe(),fCe=(t,e)=>{let{$from:n,to:s}=t.selection,i,o=n.sharedDepth(s);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(ut.create(t.doc,i))),!0)};function hCe(t,e,n){let s=e.nodeBefore,i=e.nodeAfter,o=e.index();return!s||!i||!s.type.compatibleContent(i.type)?!1:!s.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-s.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||tc(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function eF(t,e,n,s){let i=e.nodeBefore,o=e.nodeAfter,r,a,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&hCe(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(r=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(r[0]||o.type).validEnd){if(n){let g=e.pos+o.nodeSize,y=je.empty;for(let w=r.length-1;w>=0;w--)y=je.from(r[w].create(null,y));y=je.from(i.copy(y));let v=t.tr.step(new vs(e.pos-1,g,e.pos,g,new Ke(y,1,0),r.length,!0)),S=v.doc.resolve(g+2*r.length);S.nodeAfter&&S.nodeAfter.type==i.type&&tc(v.doc,S.pos)&&v.join(S.pos),n(v.scrollIntoView())}return!0}let f=o.type.spec.isolating||s>0&&c?null:Vt.findFrom(e,1),p=f&&f.$from.blockRange(f.$to),m=p&&Uf(p);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(p,m).scrollIntoView()),!0;if(d&&Nf(o,"start",!0)&&Nf(i,"end")){let g=i,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let v=o,S=1;for(;!v.isTextblock;v=v.firstChild)S++;if(g.canReplace(g.childCount,g.childCount,v.content)){if(n){let w=je.empty;for(let C=y.length-1;C>=0;C--)w=je.from(y[C].copy(w));let N=t.tr.step(new vs(e.pos-y.length,e.pos+o.nodeSize,e.pos+S,e.pos+o.nodeSize-S,new Ke(w,y.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function tF(t){return function(e,n){let s=e.selection,i=t<0?s.$from:s.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(Et.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const pCe=tF(-1),mCe=tF(1);function gCe(t,e=null){return function(n,s){let{$from:i,$to:o}=n.selection,r=i.blockRange(o),a=r&&ON(r,t,e);return a?(s&&s(n.tr.wrap(r,a).scrollIntoView()),!0):!1}}function bL(t,e=null){return function(n,s){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:r},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(r,a,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let f=n.doc.resolve(d),p=f.index();i=f.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(s){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:c}}=n.selection.ranges[r];o.setBlockType(a,c,t,e)}s(o.scrollIntoView())}return!0}}function MN(...t){return function(e,n,s){for(let i=0;i<t.length;i++)if(t[i](e,n,s))return!0;return!1}}MN(U$,q$,G$);MN(U$,Y$,X$);MN(Q$,Z$,J$,dCe);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function yCe(t,e=null){return function(n,s){let{$from:i,$to:o}=n.selection,r=i.blockRange(o);if(!r)return!1;let a=s?n.tr:null;return bCe(a,r,t,e)?(s&&s(a.scrollIntoView()),!0):!1}}function bCe(t,e,n,s=null){let i=!1,o=e,r=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=r.resolve(e.start-2);o=new Ny(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Ny(e.$from,r.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=ON(o,n,s,e);return a?(t&&xCe(t,e,a,i,n),!0):!1}function xCe(t,e,n,s,i){let o=je.empty;for(let f=n.length-1;f>=0;f--)o=je.from(n[f].type.create(n[f].attrs,o));t.step(new vs(e.start-(s?2:0),e.end,e.start,e.end,new Ke(o,0,0),n.length,!0));let r=0;for(let f=0;f<n.length;f++)n[f].type==i&&(r=f+1);let a=n.length-r,c=e.start+n.length-(s?2:0),d=e.parent;for(let f=e.startIndex,p=e.endIndex,m=!0;f<p;f++,m=!1)!m&&ll(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=d.child(f).nodeSize;return t}function vCe(t){return function(e,n){let{$from:s,$to:i}=e.selection,o=s.blockRange(i,r=>r.childCount>0&&r.firstChild.type==t);return o?n?s.node(o.depth-1).type==t?SCe(e,n,t,o):wCe(e,n,o):!0:!1}}function SCe(t,e,n,s){let i=t.tr,o=s.end,r=s.$to.end(s.depth);o<r&&(i.step(new vs(o-1,r,o,r,new Ke(je.from(n.create(null,s.parent.copy())),1,0),1,!0)),s=new Ny(i.doc.resolve(s.$from.pos),i.doc.resolve(r),s.depth));const a=Uf(s);if(a==null)return!1;i.lift(s,a);let c=i.doc.resolve(i.mapping.map(o,-1)-1);return tc(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),e(i.scrollIntoView()),!0}function wCe(t,e,n){let s=t.tr,i=n.parent;for(let g=n.end,y=n.endIndex-1,v=n.startIndex;y>v;y--)g-=i.child(y).nodeSize,s.delete(g-1,g+1);let o=s.doc.resolve(n.start),r=o.nodeAfter;if(s.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(a?0:1),f+1,r.content.append(c?je.empty:je.from(i))))return!1;let p=o.pos,m=p+r.nodeSize;return s.step(new vs(p-(a?1:0),m+(c?1:0),p+1,m-1,new Ke((a?je.empty:je.from(i.copy(je.empty))).append(c?je.empty:je.from(i.copy(je.empty))),a?0:1,c?0:1),a?0:1)),e(s.scrollIntoView()),!0}function ECe(t){return function(e,n){let{$from:s,$to:i}=e.selection,o=s.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let r=o.startIndex;if(r==0)return!1;let a=o.parent,c=a.child(r-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==a.type,f=je.from(d?t.create():null),p=new Ke(je.from(t.create(null,je.from(a.type.create(null,f)))),d?3:1,0),m=o.start,g=o.end;n(e.tr.step(new vs(m-(d?3:1),g,m,g,p,1,!0)).scrollIntoView())}return!0}}const Ls=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Tf=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let zE=null;const Hr=function(t,e,n){let s=zE||(zE=document.createRange());return s.setEnd(t,n??t.nodeValue.length),s.setStart(t,e||0),s},CCe=function(){zE=null},xu=function(t,e,n,s){return n&&(xL(t,e,n,s,-1)||xL(t,e,n,s,1))},NCe=/^(img|br|input|textarea|hr)$/i;function xL(t,e,n,s,i){for(var o;;){if(t==n&&e==s)return!0;if(e==(i<0?0:Ws(t))){let r=t.parentNode;if(!r||!ct(r)||Qm(t)||NCe.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ls(t)+(i<0?0:1),t=r}else if(ct(t)){let r=t.childNodes[e+(i<0?-1:0)];if(ct(r)&&r.contentEditable=="false")if(!((o=r.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=i;else return!1;else t=r,e=i<0?Ws(t):0}else return!1}}function Ws(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ct(t){return t.nodeType==1}function hs(t){return t.nodeType==3}function vu(t,e){return e?t.contains(ct(e)?e:e.parentNode):!1}function TCe(t,e){for(;;){if(hs(t)&&e)return t;if(ct(t)&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ws(t)}else if(t.parentNode&&!Qm(t))e=Ls(t),t=t.parentNode;else return null}}function OCe(t,e){for(;;){if(hs(t)&&e<t.nodeValue.length)return t;if(ct(t)&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Qm(t))e=Ls(t)+1,t=t.parentNode;else return null}}function RCe(t,e,n){for(let s=e==0,i=e==Ws(t);s||i;){if(t==n)return!0;let o=Ls(t);if(t=t.parentNode,!t)return!1;s=s&&o==0,i=i&&o==Ws(t)}}function Qm(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Vb=function(t){return t.focusNode&&xu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function jc(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function kCe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ACe(t,e,n){if(t.caretPositionFromPoint)try{let s=t.caretPositionFromPoint(e,n);if(s)return{node:s.offsetNode,offset:Math.min(Ws(s.offsetNode),s.offset)}}catch{}if(t.caretRangeFromPoint){let s=t.caretRangeFromPoint(e,n);if(s)return{node:s.startContainer,offset:Math.min(Ws(s.startContainer),s.startOffset)}}}const pr=typeof navigator<"u"?navigator:null,vL=typeof document<"u"?document:null,nc=pr&&pr.userAgent||"",BE=/Edge\/(\d+)/.exec(nc),nF=/MSIE \d/.exec(nc),$E=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nc),Ei=!!(nF||$E||BE),La=nF?document.documentMode:$E?+$E[1]:BE?+BE[1]:0,Hi=!Ei&&/gecko\/(\d+)/i.test(nc);Hi&&+(/Firefox\/(\d+)/.exec(nc)||[0,0])[1];const FE=!Ei&&/Chrome\/(\d+)/.exec(nc),js=!!FE,sF=FE?+FE[1]:0,Gs=!Ei&&!!pr&&/Apple Computer/.test(pr.vendor),Of=Gs&&(/Mobile\/\w+/.test(nc)||!!pr&&pr.maxTouchPoints>2),io=Of||(pr?/Mac/.test(pr.platform):!1),iF=pr?/Win/.test(pr.platform):!1,Qr=/Android \d/.test(nc),qb=!!vL&&"webkitFontSmoothing"in vL.documentElement.style,_Ce=qb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function MCe(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function LCe(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,s=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*s}}function SL(t,e,n){if(!HE(e)&&e.left==0)return;let s=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let r=n||t.dom;r;){if(!ct(r)){r=Tf(r);continue}let a=r==o.body,c=a?MCe(o):LCe(r),d=0,f=0;if(e.top<c.top+Br(s,"top")?f=-(c.top-e.top+Br(i,"top")):e.bottom>c.bottom-Br(s,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Br(i,"top")-c.top:e.bottom-c.bottom+Br(i,"bottom")),e.left<c.left+Br(s,"left")?d=-(c.left-e.left+Br(i,"left")):e.right>c.right-Br(s,"right")&&(d=e.right-c.right+Br(i,"right")),d||f)if(a)o.defaultView.scrollBy(d,f);else{let m=r.scrollLeft,g=r.scrollTop;f&&(r.scrollTop+=f),d&&(r.scrollLeft+=d);let y=r.scrollLeft-m,v=r.scrollTop-g;e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v}}let p=a?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(p))break;r=p=="absolute"?r.offsetParent:Tf(r)}}function ICe(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),s,i;for(let o=(e.left+e.right)/2,r=n+1;r<Math.min(innerHeight,e.bottom);r+=5){let a=t.root.elementFromPoint(o,r);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){s=a,i=c.top;break}}return{refDOM:s,refTop:i,stack:oF(t.dom)}}function oF(t){let e=[],n=t.ownerDocument;for(let s=t;s&&(e.push({dom:s,top:s.scrollTop,left:s.scrollLeft}),t!=n);s=Tf(s));return e}function DCe({refDOM:t,refTop:e,stack:n}){let s=t?t.getBoundingClientRect().top:0;rF(n,s==0?0:s-e)}function rF(t,e){for(let n=0;n<t.length;n++){let{dom:s,top:i,left:o}=t[n];s.scrollTop!=i+e&&(s.scrollTop=i+e),s.scrollLeft!=o&&(s.scrollLeft=o)}}let wd=null;function jCe(t){if(t.setActive)return t.setActive();if(wd)return t.focus(wd);let e=oF(t);t.focus(wd==null?{get preventScroll(){return wd={preventScroll:!0},!0}}:void 0),wd||(wd=!1,rF(e,0))}function lF(t,e){let n,s=2e8,i,o=0,r=e.top,a=e.top,c,d;for(let f=t.firstChild,p=0;f;f=f.nextSibling,p++){let m;if(ct(f))m=f.getClientRects();else if(hs(f))m=Hr(f).getClientRects();else continue;for(let g=0;g<m.length;g++){let y=m[g];if(y.top<=r&&y.bottom>=a){r=Math.max(y.bottom,r),a=Math.min(y.top,a);let v=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(v<s){n=f,s=v,i=v&&hs(n)?{left:y.right<e.left?y.right:y.left,top:e.top}:e,ct(f)&&v&&(o=p+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!c&&y.left<=e.left&&y.right>=e.left&&(c=f,d={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(o=p+1)}}return!n&&c&&(n=c,i=d,s=0),n&&hs(n)?PCe(n,i):!n||s?{node:t,offset:o}:lF(n,i)}function PCe(t,e){let n=t.nodeValue.length,s=document.createRange(),i;for(let o=0;o<n;o++){s.setEnd(t,o+1),s.setStart(t,o);let r=aa(s,1);if(r.top!=r.bottom&&LN(e,r)){i={node:t,offset:o+(e.left>=(r.left+r.right)/2?1:0)};break}}return s.detach(),i||{node:t,offset:0}}function LN(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zCe(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function BCe(t,e,n){let{node:s,offset:i}=lF(e,n),o=-1;if(ct(s)&&!s.firstChild){let r=s.getBoundingClientRect();o=r.left!=r.right&&n.left>(r.left+r.right)/2?1:-1}return t.docView.posFromDOM(s,i,o)}function $Ce(t,e,n,s){let i=-1;for(let o=e,r=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),c;if(!a)return null;if(ct(a.dom)&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!r&&c.left>s.left||c.top>s.top?i=a.posBefore:(!r&&c.right<s.left||c.bottom<s.top)&&(i=a.posAfter),r=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?s.top<(c.top+c.bottom)/2:s.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function aF(t,e,n){let s=t.childNodes.length;if(s&&n.top<n.bottom)for(let i=Math.max(0,Math.min(s-1,Math.floor(s*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let r=t.childNodes[o];if(ct(r)){let a=r.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(LN(e,d))return aF(r,e,d)}}if((o=(o+1)%s)==i)break}return t}function FCe(t,e){let n=t.dom.ownerDocument,s,i=0,o=ACe(n,e.left,e.top);o&&({node:s,offset:i}=o);let r=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!r||!t.dom.contains(r)){let d=t.dom.getBoundingClientRect();if(!LN(e,d)||(r=aF(t.dom,e,d),!r))return null}if(Gs)for(let d=r;s&&d;d=Tf(d))d.draggable&&(s=void 0);if(r=zCe(r,e),s){if(Hi&&ct(s)&&(i=Math.min(i,s.childNodes.length),i<s.childNodes.length)){let f=s.childNodes[i],p;f.nodeName=="IMG"&&(p=f.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&i++}let d;qb&&i&&ct(s)&&ct(d=s.childNodes[i-1])&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,s==t.dom&&i==s.childNodes.length-1&&ct(s.lastChild)&&e.top>s.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||!ct(s)||s.childNodes[i-1].nodeName!="BR")&&(a=$Ce(t,s,i,e))}a==null&&(a=BCe(t,r,e));let c=t.docView.nearestDesc(r,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function HE(t){return t.top<t.bottom||t.left<t.right}function aa(t,e){let n=t.getClientRects();if(n.length){let s=n[e<0?0:n.length-1];if(HE(s))return s}return Array.prototype.find.call(n,HE)||t.getBoundingClientRect()}const HCe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function cF(t,e,n){let{node:s,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),r=qb||Hi;if(hs(s))if(r&&(HCe.test(s.nodeValue)||(n<0?!i:i==s.nodeValue.length))){let c=aa(Hr(s,i,i),n);if(Hi&&i&&/\s/.test(s.nodeValue[i-1])&&i<s.nodeValue.length){let d=aa(Hr(s,i-1,i-1),-1);if(d.top==c.top){let f=aa(Hr(s,i,i+1),-1);if(f.top!=c.top)return Wh(f,f.left<d.left)}}return c}else{let c=i,d=i,f=n<0?1:-1;return n<0&&!i?(d++,f=-1):n>=0&&i==s.nodeValue.length?(c--,f=1):n<0?c--:d++,Wh(aa(Hr(s,c,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Ws(s))){let c=s.childNodes[i-1];if(ct(c))return kS(c.getBoundingClientRect(),!1)}if(o==null&&i<Ws(s)){let c=s.childNodes[i];if(ct(c))return kS(c.getBoundingClientRect(),!0)}return kS(s.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Ws(s))){let c=s.childNodes[i-1],d=hs(c)?Hr(c,Ws(c)-(r?0:1)):ct(c)&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Wh(aa(d,1),!1)}if(o==null&&i<Ws(s)){let c=s.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?hs(c)?Hr(c,0,r?0:1):ct(c)?c:null:null;if(d)return Wh(aa(d,-1),!0)}return Wh(aa(hs(s)?Hr(s):s,-n),n>=0)}function Wh(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function kS(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function uF(t,e,n){let s=t.state,i=t.root.activeElement;s!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{s!=e&&t.updateState(s),i!=t.dom&&i&&i.focus()}}function UCe(t,e,n){let s=e.selection,i=n=="up"?s.$from:s.$to;return uF(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let r=cF(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let c;if(ct(a))c=a.getClientRects();else if(hs(a))c=Hr(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let f=c[d];if(f.bottom>f.top+1&&(n=="up"?r.top-f.top>(f.bottom-r.top)*2:f.bottom-r.bottom>(r.bottom-f.top)*2))return!1}}return!0})}const VCe=/[\u0590-\u08ac]/;function qCe(t,e,n){let{$head:s}=e.selection;if(!s.parent.isTextblock)return!1;let i=s.parentOffset,o=!i,r=i==s.parent.content.size,a=t.domSelection();return a?!VCe.test(s.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:r:uF(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:f,anchorOffset:p}=t.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let g=s.depth?t.docView.domAfterPos(s.before()):t.dom,{focusNode:y,focusOffset:v}=t.domSelectionRange(),S=y&&!vu(g,y)||c==y&&d==v;try{a.collapse(f,p),c&&(c!=f||d!=p)&&a.extend&&a.extend(c,d)}catch{}return m!=null&&(a.caretBidiLevel=m),S}):s.pos==s.start()||s.pos==s.end()}let wL=null,EL=null,CL=!1;function WCe(t,e,n){return wL==e&&EL==n?CL:(wL=e,EL=n,CL=n=="up"||n=="down"?UCe(t,e,n):qCe(t,e,n))}const co=0,NL=1,Fc=2,Mo=3;class Zm{constructor(e,n,s,i){this.parent=e,this.children=n,this.dom=s,this.contentDOM=i,this.dirty=co,s.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,s){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,s=this.posAtStart;;n++){let i=this.children[n];if(i==e)return s;s+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,s){if(this.contentDOM&&vu(this.contentDOM,e))if(s<0){let o,r;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((r=o.pmViewDesc)&&r.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(r)+r.size:this.posAtStart}else{let o,r;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((r=o.pmViewDesc)&&r.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(r):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Ls(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??s>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let s=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),r;if(o&&(!n||o.node))if(s&&(r=o.nodeDOM)&&!(ct(r)?vu(r,e):r==e))s=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let s=n;s;s=s.parent)if(s==this)return n}posFromDOM(e,n,s){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,s)}return-1}descAt(e){for(let n=0,s=0;n<this.children.length;n++){let i=this.children[n],o=s+i.size;if(s==e&&o!=s){for(;!i.border&&i.children.length;)for(let r=0;r<i.children.length;r++){let a=i.children[r];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-s-i.border);s=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let s=0,i=0;for(let o=0;s<this.children.length;s++){let r=this.children[s],a=o+r.size;if(a>e){i=e-o;break}o=a}if(i)return this.children[s].domFromPos(i-this.children[s].border,n);for(;s>0;s--){let o=this.children[s-1];if(o.size||!(o instanceof fF||o instanceof dF&&o.side>=0))break}if(n<=0){let o,r=!0;for(;o=s?this.children[s-1]:null,!(!o||o.dom.parentNode==this.contentDOM);s--,r=!1);return o&&n&&r&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Ls(o.dom)+1:0}}else{let o,r=!0;for(;o=s<this.children.length?this.children[s]:null,!(!o||o.dom.parentNode==this.contentDOM);s++,r=!1);return o&&r&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Ls(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,s=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let r=s,a=0;;a++){let c=this.children[a],d=r+c.size;if(i==-1&&e<=d){let f=r+c.border;if(e>=f&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,f);e=r;for(let p=a;p>0;p--){let m=this.children[p-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=Ls(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let f=a+1;f<this.children.length;f++){let p=this.children[f];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=Ls(p.dom);break}n+=p.size}o==-1&&(o=this.contentDOM.childNodes.length);break}r=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:s}=this.domFromPos(e,0);if(!ct(n)||s==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[s]}setSelection(e,n,s,i=!1){let o=Math.min(e,n),r=Math.max(e,n);for(let g=0,y=0;g<this.children.length;g++){let v=this.children[g],S=y+v.size;if(o>y&&r<S)return v.setSelection(e-y-v.border,n-y-v.border,s,i);y=S}let a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),d=s.root.getSelection(),f=s.domSelectionRange(),p=!1;if((Hi||Gs)&&e==n){let{node:g,offset:y}=a;if(hs(g)){if(p=!!(y&&g.nodeValue[y-1]==`
371
+ `),p&&y==g.nodeValue.length)for(let v=g,S;v;v=v.parentNode){if(S=v.nextSibling){S.nodeName=="BR"&&(a=c={node:S.parentNode,offset:Ls(S)+1});break}let w=v.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let v=g.childNodes[y-1];p=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Hi&&f.focusNode&&f.focusNode!=c.node&&ct(f.focusNode)){let g=f.focusNode.childNodes[f.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||p&&Gs)&&xu(a.node,a.offset,f.anchorNode,f.anchorOffset)&&xu(c.node,c.offset,f.focusNode,f.focusOffset))return;let m=!1;if((d.extend||e==n)&&!(p&&Hi)){d.collapse(a.node,a.offset);try{e!=n&&d.extend(c.node,c.offset),m=!0}catch{}}if(!m){if(e>n){let y=a;a=c,c=y}let g=document.createRange();g.setEnd(c.node,c.offset),g.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let s=0,i=0;i<this.children.length;i++){let o=this.children[i],r=s+o.size;if(s==r?e<=r&&n>=s:e<r&&n>s){let a=s+o.border,c=r-o.border;if(e>=a&&n<=c){this.dirty=e==s||n==r?Fc:NL,e==a&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Mo:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Fc:Mo}s=r}this.dirty=Fc}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let s=e==1?Fc:NL;n.dirty<s&&(n.dirty=s)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class dF extends Zm{constructor(e,n,s,i){let o,r=n.type.toDOM;if(typeof r=="function"&&(r=r(s,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){let a=ct(r)?r:document.createElement("span");a!=r&&a.appendChild(r),a.hasAttribute("contenteditable")||(a.contentEditable="false"),a.classList.add("ProseMirror-widget")}super(e,[],r,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==co&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class GCe extends Zm{constructor(e,n,s,i){super(e,[],n,null),this.textDOM=s,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Ia extends Zm{constructor(e,n,s,i,o){super(e,[],s,i),this.mark=n,this.spec=o}static create(e,n,s,i){let o=i.nodeViews[n.type.name],r=o&&o(n,i,s);return(!r||!r.dom)&&(r=Mu.renderSpec(document,n.type.spec.toDOM(n,s),null,n.attrs)),new Ia(e,n,r.dom,r.contentDOM||r.dom,r)}parseRule(){return this.dirty&Mo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=co){let s=this.parent;for(;!s.node;)s=s.parent;s.dirty<this.dirty&&(s.dirty=this.dirty),this.dirty=co}}slice(e,n,s){let i=Ia.create(this.parent,this.mark,!0,s),o=this.children,r=this.size;n<r&&(o=VE(o,n,r,s)),e>0&&(o=VE(o,0,e,s));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Da extends Zm{constructor(e,n,s,i,o,r,a){super(e,[],o,r),this.node=n,this.outerDeco=s,this.innerDeco=i,this.nodeDOM=a}static create(e,n,s,i,o,r){let a=o.nodeViews[n.type.name],c,d=a&&a(n,o,()=>{if(!c)return r;if(c.parent)return c.parent.posBeforeChild(c)},s,i),f=d&&d.dom,p=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(!hs(f))throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:p}=Mu.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=mF(f,s,n),d?c=new KCe(e,n,s,i,f,p||null,m,d):n.isText?new Wb(e,n,s,i,f,m):new Da(e,n,s,i,f,p||null,m)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let s=this.children.length-1;s>=0;s--){let i=this.children[s];if(this.dom.contains(i.dom.parentNode)){n.contentElement=i.dom.parentNode;break}}if(!n.contentElement){let s=e&&e.find(i=>ct(i)&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));s?n.contentElement=s:n.getContent=()=>je.empty}}return n}matchesNode(e,n,s){return this.dirty==co&&e.eq(this.node)&&Oy(n,this.outerDeco)&&s.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let s=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,r=o&&o.pos>-1?o:null,a=o&&o.pos<0,c=new XCe(this,r&&r.node,e),d=this.node.inlineContent,f=d&&this.node.isBlock;JCe(this.node,this.innerDeco,(p,m,g)=>{p.spec.marks?c.syncToMarks(p.spec.marks,s,e,m):p.type.side>=0&&!g&&c.syncToMarks(m==this.node.childCount?wn.none:this.node.child(m).marks,s,e,m),c.placeWidget(p,e,i)},(p,m,g,y)=>{c.syncToMarks(p.marks,s,e,y),f&&p.isAtom&&!p.isText&&c.addHackNode("IMG",c.top);let v;c.findNodeMatch(p,m,g,y)||a&&e.state.selection.from>i&&e.state.selection.to<i+p.nodeSize&&(v=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(p,m,g,v,e)||c.updateNextNode(p,m,g,e,y,i)||c.addNode(p,m,g,e,i),i+=p.nodeSize,d&&(f=p.isAtom&&!p.isText)}),c.syncToMarks([],s,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Fc)&&(r&&this.protectLocalComposition(e,r),hF(this.contentDOM,this.children,e),Of&&e3e(this.dom))}localCompositionInfo(e,n){let{from:s,to:i}=e.state.selection;if(!(e.state.selection instanceof Et)||s<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let r=o.nodeValue,a=t3e(this.node.content,r,s-n,i-n);return a<0?null:{node:o,pos:a,text:r}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:s,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let r=new GCe(this,o,n,i);e.input.compositionNodes.push(r),this.children=VE(this.children,s,s+i.length,e,r)}update(e,n,s,i){return this.dirty==Mo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,s,i),!0)}updateInner(e,n,s,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=s,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=co}updateOuterDeco(e){if(Oy(e,this.outerDeco))return;let n=!ct(this.nodeDOM),s=this.dom;this.dom=pF(this.dom,this.nodeDOM,UE(this.outerDeco,this.node,n),UE(e,this.node,n)),this.dom!=s&&(s.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){ct(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){ct(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function TL(t,e,n,s,i){mF(s,e,t);let o=new Da(void 0,t,e,n,s,s,s);return o.contentDOM&&o.updateChildren(i,0),o}class Wb extends Da{constructor(e,n,s,i,o,r){super(e,n,s,i,o,null,r)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,s,i){return this.dirty==Mo||this.dirty!=co&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=co||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=co,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,s){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,s)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,s){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Wb(this.parent,i,this.outerDeco,this.innerDeco,o,o)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Mo)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fF extends Zm{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==co&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class KCe extends Da{constructor(e,n,s,i,o,r,a,c){super(e,n,s,i,o,r,a),this.spec=c}update(e,n,s,i){if(this.dirty==Mo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,s);return o&&this.updateInner(e,n,s,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,s,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,s,i){this.spec.setSelection?this.spec.setSelection(e,n,s.root):super.setSelection(e,n,s,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hF(t,e,n){let s=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let r=e[o],a=r.dom;if(a.parentNode==t){for(;a!=s;)s=OL(s),i=!0;s=s.nextSibling}else i=!0,t.insertBefore(a,s);if(r instanceof Ia){let c=s?s.previousSibling:t.lastChild;hF(r.contentDOM,r.children,n),s=c?c.nextSibling:t.firstChild}}for(;s;)s=OL(s),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Sp=function(t){t&&(this.nodeName=t)};Sp.prototype=Object.create(null);const Hc=[new Sp];function UE(t,e,n){if(t.length==0)return Hc;let s=n?Hc[0]:new Sp,i=[s];for(let o=0;o<t.length;o++){let r=t[o].type.attrs;if(r){r.nodeName&&i.push(s=new Sp(r.nodeName));for(let a in r){let c=r[a];c!=null&&(n&&i.length==1&&i.push(s=new Sp(e.isInline?"span":"div")),a=="class"?s.class=(s.class?s.class+" ":"")+c:a=="style"?s.style=(s.style?s.style+";":"")+c:a!="nodeName"&&(s[a]=c))}}}return i}function pF(t,e,n,s){if(n==Hc&&s==Hc)return e;let i=e;for(let o=0;o<s.length;o++){let r=s[o],a=n[o];if(o){let c;a&&a.nodeName==r.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==r.nodeName||(c=document.createElement(r.nodeName),c.pmIsDeco=!0,c.appendChild(i),a=Hc[0]),i=c}YCe(i,a||Hc[0],r)}return i}function YCe(t,e,n){for(let s in e)s!="class"&&s!="style"&&s!="nodeName"&&!(s in n)&&t.removeAttribute(s);for(let s in n)s!="class"&&s!="style"&&s!="nodeName"&&n[s]!=e[s]&&t.setAttribute(s,n[s]);if(e.class!=n.class){let s=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<s.length;o++)i.indexOf(s[o])==-1&&t.classList.remove(s[o]);for(let o=0;o<i.length;o++)s.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let s=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=s.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function mF(t,e,n){return pF(t,t,Hc,UE(e,n,!ct(t)))}function Oy(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function OL(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class XCe{constructor(e,n,s){this.lock=n,this.view=s,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=QCe(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let s=e;s<n;s++)this.top.children[s].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,s,i){let o=0,r=this.stack.length>>1,a=Math.min(r,e.length);for(;o<a&&(o==r-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<r;)this.destroyRest(),this.top.dirty=co,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<e.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let f=this.index;f<d;f++){let p=this.top.children[f];if(p.matchesMark(e[r])&&!this.isLocked(p.dom)){c=f;break}}if(c<0&&this.index<this.top.children.length){let f=this.top.children[this.index];f instanceof Ia&&f.dirty!=Mo&&f.mark.type==e[r].type&&f.spec.update&&!this.isLocked(f.dom)&&f.spec.update(e[r])&&(f.mark=e[r],c=this.index,this.changed=!0)}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let f=Ia.create(this.top,e[r],n,s);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,r++}}findNodeMatch(e,n,s,i){let o=-1,r;if(i>=this.preMatch.index&&(r=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&r.matchesNode(e,n,s))o=this.top.children.indexOf(r,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,n,s)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,s,i,o){let r=this.top.children[i];return r.dirty==Mo&&r.dom==r.contentDOM&&(r.dirty=Fc),r.update(e,n,s,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let s=e.pmViewDesc;if(s){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==s)return i}return-1}e=n}}updateNextNode(e,n,s,i,o,r){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof Da){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let f=c.dom,p,m=this.isLocked(f)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Mo&&Oy(n,c.outerDeco));if(!m&&c.update(e,n,s,i))return this.destroyBetween(this.index,a),c.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(p=this.recreateWrapper(c,e,n,s,i,r)))return this.destroyBetween(this.index,a),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Fc,p.updateChildren(i,r+1),p.dirty=co),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,s,i,o,r){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Oy(s,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Da.create(this.top,n,s,i,o,r);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,s,i,o){let r=Da.create(this.top,e,n,s,i,o);r.contentDOM&&r.updateChildren(i,o+1),this.top.children.splice(this.index++,0,r),this.changed=!0}placeWidget(e,n,s){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new dF(this.top,e,n,s);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Ia;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Wb)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Gs||js)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let s=document.createElement(e);e=="IMG"&&(s.className="ProseMirror-separator",s.alt=""),e=="BR"&&(s.className="ProseMirror-trailingBreak");let i=new fF(this.top,[],s,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||ct(e)&&e.contains(this.lock.parentNode))}}function QCe(t,e){let n=e,s=n.children.length,i=t.childCount,o=new Map,r=[];e:for(;i>0;){let a;for(;;)if(s){let d=n.children[s-1];if(d instanceof Ia)n=d,s=d.children.length;else{a=d,s--;break}}else{if(n==e)break e;s=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(i-1))break;--i,o.set(a,i),r.push(a)}}return{index:i,matched:o,matches:r.reverse()}}function ZCe(t,e){return t.type.side-e.type.side}function JCe(t,e,n,s){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let f=t.child(d);s(f,i,e.forChild(o,f),d),o+=f.nodeSize}return}let r=0,a=[],c=null;for(let d=0;;){let f,p;for(;r<i.length&&i[r].to==o;){let S=i[r++];S.widget&&(f?(p||(p=[f])).push(S):f=S)}if(f)if(p){p.sort(ZCe);for(let S=0;S<p.length;S++)n(p[S],d,!!c)}else n(f,d,!!c);let m,g;if(c)g=-1,m=c,c=null;else if(d<t.childCount)g=d,m=t.child(d++);else break;for(let S=0;S<a.length;S++)a[S].to<=o&&a.splice(S--,1);for(;r<i.length&&i[r].from<=o&&i[r].to>o;)a.push(i[r++]);let y=o+m.nodeSize;if(m.isText){let S=y;r<i.length&&i[r].from<S&&(S=i[r].from);for(let w=0;w<a.length;w++)a[w].to<S&&(S=a[w].to);S<y&&(c=m.cut(S-o),m=m.cut(0,S-o),y=S,g=-1)}else for(;r<i.length&&i[r].to<y;)r++;let v=m.isInline&&!m.isLeaf?a.filter(S=>!S.inline):a.slice();s(m,v,e.forChild(o,m),g),o=y}}function e3e(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function t3e(t,e,n,s){for(let i=0,o=0;i<t.childCount&&o<=s;){let r=t.child(i++),a=o;if(o+=r.nodeSize,!r.isText)continue;let c=r.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=s&&c.slice(s-e.length-a,s-a)==e)return s-e.length;let d=a<s?c.lastIndexOf(e,s-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==s&&c.length>=s+e.length-a&&c.slice(s-a,s-a+e.length)==e)return s}}return-1}function VE(t,e,n,s,i){let o=[];for(let r=0,a=0;r<t.length;r++){let c=t[r],d=a,f=a+=c.size;d>=n||f<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,s)),i&&(o.push(i),i=void 0),f>n&&o.push(c.slice(n-d,c.size,s)))}return o}function IN(t,e=null){let n=t.domSelectionRange(),s=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,r=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(r<0)return null;let a=s.resolve(r),c,d;if(Vb(n)){for(c=r;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&ut.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&RCe(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;d=new ut(r==p?a:s.resolve(p))}else if(Hi&&e=="key"&&r>t.state.selection.to&&ct(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>t.state.selection.to)for(let p=n.focusNode;;p=p.parentNode){if(getComputedStyle(p).overflow!="visible"){d=Vt.findFrom(s.resolve(i.posAtStart),1);break}if(p==i.dom||p.nextSibling||!p.parentNode||!ct(p.parentNode))break}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=r,m=r;for(let g=0;g<n.rangeCount;g++){let y=n.getRangeAt(g);p=Math.min(p,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(p<0)return null;[c,r]=m==t.state.selection.anchor?[m,p]:[p,m],a=s.resolve(r)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let f=s.resolve(c);if(!d){let p=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;d=DN(t,f,a,p)}return d}function gF(t){return t.editable?t.hasFocus():bF(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function al(t,e=!1){let n=t.state.selection;if(yF(t,n),!gF(t))return;let s=t.input.mouseDown;if(!e&&js&&s){let i=t.domSelectionRange(),o=t.domObserver.currentSelection;if(i.anchorNode&&o.anchorNode&&xu(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset)&&s.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)s3e(t);else{let{anchor:i,head:o}=n,r,a;RL&&!(n instanceof Et)&&(n.$from.parent.inlineContent||(r=kL(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=kL(t,n.to))),t.docView.setSelection(i,o,t,e),RL&&(r&&AL(r),a&&AL(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&n3e(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const RL=Gs||js&&sF<63;function kL(t,e){let{node:n,offset:s}=t.docView.domFromPos(e,0),i=s<n.childNodes.length?n.childNodes[s]:null,o=s?n.childNodes[s-1]:null;if(Gs&&i&&i.contentEditable=="false")return AS(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return AS(i);if(o)return AS(o)}}function AS(t){return t.contentEditable="true",Gs&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function AL(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function n3e(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),s=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=s||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!gF(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function s3e(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,s=n.nodeName=="IMG";s?e.collapse(n.parentNode,Ls(n)+1):e.collapse(n,0),!s&&!t.state.selection.visible&&Ei&&La<=11&&(n.disabled=!0,n.disabled=!1)}function yF(t,e){if(e instanceof ut){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(_L(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else _L(t)}function _L(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function DN(t,e,n,s){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Et.between(e,n,s)}function ML(t){return t.editable&&!t.hasFocus()?!1:bF(t)}function bF(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return vu(t.dom,e.anchorNode)&&(t.editable||vu(t.dom,e.focusNode))}catch{return!1}}function i3e(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return xu(e.node,e.offset,n.anchorNode,n.anchorOffset)}function qE(t,e){let{$anchor:n,$head:s}=t.selection,i=e>0?n.max(s):n.min(s),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Vt.findFrom(o,e)}function ua(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function LL(t,e,n){let s=t.state.selection;if(s instanceof Et)if(n.indexOf("s")>-1){let{$head:i}=s,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let r=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ua(t,new Et(s.$anchor,r))}else if(s.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=qE(t.state,e);return i&&i instanceof ut?ua(t,i):!1}else if(!(io&&n.indexOf("m")>-1)){let i=s.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,r;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(r=t.docView.descAt(a))&&!r.contentDOM?ut.isSelectable(o)?ua(t,new ut(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):ua(t,new Et(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1}}else return!1;else{if(s instanceof ut&&s.node.isInline)return ua(t,new Et(e>0?s.$to:s.$from));{let i=qE(t.state,e);return i?ua(t,i):!1}}}function wp(t,e){let n=t.pmViewDesc;return n?n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR"):ct(t)&&t.contentEditable=="false"}function Ed(t,e){return e<0?o3e(t):r3e(t)}function o3e(t){let e=t.domSelectionRange(),n=e.focusNode,s=e.focusOffset;if(!n)return;let i,o,r=!1;for(Hi&&ct(n)&&s<Ws(n)&&wp(n.childNodes[s],-1)&&(r=!0);;)if(s>0){if(!ct(n))break;let a=n.childNodes[s-1];if(wp(a,-1))i=n,o=--s;else if(hs(a))n=a,s=n.nodeValue.length;else break}else{if(xF(n))break;{let a=n.previousSibling;for(;a&&wp(a,-1);)i=n.parentNode,o=Ls(a),a=a.previousSibling;if(a)n=a,s=Ws(n);else{if(n=n.parentNode,n==t.dom)break;s=0}}}r?WE(t,n,s):i&&WE(t,i,o)}function r3e(t){let e=t.domSelectionRange(),n=e.focusNode,s=e.focusOffset;if(!n)return;let i=Ws(n),o,r;for(;;)if(s<i){if(!ct(n))break;let a=n.childNodes[s];if(wp(a,1))o=n,r=++s;else break}else{if(xF(n))break;{let a=n.nextSibling;for(;a&&wp(a,1);)o=a.parentNode,r=Ls(a)+1,a=a.nextSibling;if(a)n=a,s=0,i=Ws(n);else{if(n=n.parentNode,n==t.dom)break;s=i=0}}}o&&WE(t,o,r)}function xF(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function l3e(t,e){for(;t&&e==t.childNodes.length&&!Qm(t);)e=Ls(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(hs(n))return n;if(ct(n)&&n.contentEditable=="false")break;t=n,e=0}}function a3e(t,e){for(;t&&!e&&!Qm(t);)e=Ls(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(hs(n))return n;if(ct(n)&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function WE(t,e,n){if(!hs(e)){let o,r;(r=l3e(e,n))?(e=r,n=0):(o=a3e(e,n))&&(e=o,n=o.nodeValue.length)}let s=t.domSelection();if(!s)return;if(Vb(s)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),s.removeAllRanges(),s.addRange(o)}else s.extend&&s.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&al(t)},50)}function IL(t,e){let n=t.state.doc.resolve(e);if(!(js||iF)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),r=(o.top+o.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),r=(o.top+o.bottom)/2;if(r>i.top&&r<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function DL(t,e,n){let s=t.state.selection;if(s instanceof Et&&!s.empty||n.indexOf("s")>-1||io&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=s;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let r=qE(t.state,e);if(r&&r instanceof ut)return ua(t,r)}if(!i.parent.inlineContent){let r=e<0?i:o,a=s instanceof Fi?Vt.near(r,e):Vt.findFrom(r,e);return a?ua(t,a):!1}return!1}function jL(t,e){if(!(t.state.selection instanceof Et))return!0;let{$head:n,$anchor:s,empty:i}=t.state.selection;if(!n.sameParent(s))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function PL(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function c3e(t){if(!Gs||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&ct(e)&&n==0&&e.firstChild&&ct(e.firstChild)&&e.firstChild.contentEditable=="false"){let s=e.firstChild;PL(t,s,"true"),setTimeout(()=>PL(t,s,"false"),20)}return!1}function u3e(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function d3e(t,e){let n=e.keyCode,s=u3e(e);if(n==8||io&&n==72&&s=="c")return jL(t,-1)||Ed(t,-1);if(n==46&&!e.shiftKey||io&&n==68&&s=="c")return jL(t,1)||Ed(t,1);if(n==13||n==27)return!0;if(n==37||io&&n==66&&s=="c"){let i=n==37?IL(t,t.state.selection.from)=="ltr"?-1:1:-1;return LL(t,i,s)||Ed(t,i)}else if(n==39||io&&n==70&&s=="c"){let i=n==39?IL(t,t.state.selection.from)=="ltr"?1:-1:1;return LL(t,i,s)||Ed(t,i)}else{if(n==38||io&&n==80&&s=="c")return DL(t,-1,s)||Ed(t,-1);if(n==40||io&&n==78&&s=="c")return c3e(t)||DL(t,1,s)||Ed(t,1);if(s==(io?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function jN(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:s,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&s.childCount==1&&s.firstChild.childCount==1;){i--,o--;let g=s.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),s=g.content}let r=t.someProp("clipboardSerializer")||Mu.fromSchema(t.state.schema),a=NF(),c=a.createElement("div");c.appendChild(r.serializeFragment(s,{document:a}));let d=c.firstChild,f,p=0;for(;d&&ct(d)&&(f=CF[d.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let y=a.createElement(f[g]);for(;c.firstChild;)y.appendChild(c.firstChild);c.appendChild(y),p++}d=c.firstChild}d&&ct(d)&&d.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
372
+
373
+ `);return{dom:c,text:m,slice:e}}function vF(t,e,n,s,i){let o=i.parent.type.spec.code,r,a;if(!n&&!e)return null;let c=!!e&&(s||o||!n);if(c){if(t.someProp("transformPastedText",m=>{e=m(e,o||s,t)}),o)return a=new Ke(je.from(t.state.schema.text(e.replace(/\r\n?/g,`
374
+ `))),0,0),t.someProp("transformPasted",m=>{a=m(a,t,!0)}),a;let p=t.someProp("clipboardTextParser",m=>m(e,i,s,t));if(p)a=p;else{let m=i.marks(),{schema:g}=t.state,y=Mu.fromSchema(g);r=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let S=r.appendChild(document.createElement("p"));v&&S.appendChild(y.serializeNode(g.text(v,m)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),r=m3e(n),qb&&g3e(r);let d=r&&r.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let p=+f[3];p>0;p--){let m=r.firstChild;for(;m&&!ct(m);)m=m.nextSibling;if(!m)break;r=m}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||rl.fromSchema(t.state.schema)).parseSlice(r,{preserveWhitespace:!!(c||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!f3e.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)a=y3e(zL(a,+f[1],+f[2]),f[4]);else if(a=Ke.maxOpen(h3e(a.content,i),!0),a.openStart||a.openEnd){let p=0,m=0;for(let g=a.content.firstChild;p<a.openStart&&!g.type.spec.isolating;p++,g=g.firstChild);for(let g=a.content.lastChild;m<a.openEnd&&!g.type.spec.isolating;m++,g=g.lastChild);a=zL(a,p,m)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const f3e=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function h3e(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,r=[];if(t.forEach(a=>{if(!r)return;let c=i.findWrapping(a.type),d;if(!c)return r=null;if(d=r.length&&o.length&&wF(c,o,a,r[r.length-1],0))r[r.length-1]=d;else{r.length&&(r[r.length-1]=EF(r[r.length-1],o.length));let f=SF(a,c);r.push(f),i=i.matchType(f.type),o=c}}),r)return je.from(r)}return t}function SF(t,e,n=0){for(let s=e.length-1;s>=n;s--)t=e[s].create(null,je.from(t));return t}function wF(t,e,n,s,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=wF(t,e,n,s.lastChild,i+1);if(o)return s.copy(s.content.replaceChild(s.childCount-1,o));if(s.contentMatchAt(s.childCount).matchType(i==t.length-1?n.type:t[i+1]))return s.copy(s.content.append(je.from(SF(n,t,i+1))))}}function EF(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,EF(t.lastChild,e-1)),s=t.contentMatchAt(t.childCount).fillBefore(je.empty,!0);return t.copy(n.append(s))}function GE(t,e,n,s,i,o){let r=e<0?t.firstChild:t.lastChild,a=r.content;return t.childCount>1&&(o=0),i<s-1&&(a=GE(a,e,n,s,i+1,o)),i>=n&&(a=e<0?r.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(r.contentMatchAt(r.childCount).fillBefore(je.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,r.copy(a))}function zL(t,e,n){return e<t.openStart&&(t=new Ke(GE(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Ke(GE(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const CF={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function NF(){return document.implementation.createHTMLDocument("title")}let Gh=null;function p3e(t){let e=window.trustedTypes;if(!e)return t;if(!Gh){if(Gh=e.defaultPolicy)try{return Gh.createHTML(t)}catch{}Gh=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return Gh.createHTML(t)}function m3e(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=NF(),s=n.body,i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&CF[i[1].toLowerCase()])&&(t=o.map(r=>"<"+r+">").join("")+t+o.map(r=>"</"+r+">").reverse().join("")),s.innerHTML=p3e(t),o)for(let r=0;r<o.length;r++)s=s.querySelector(o[r])||s;for(let r=0;r<n.styleSheets.length;r++){let a=n.styleSheets[r];for(let c=0;c<a.rules.length;c++){let d=a.rules[c];if(d instanceof CSSStyleRule){let f=s.querySelectorAll(d.selectorText);for(let p=0;p<f.length;p++)f[p].style.cssText+=d.style.cssText}}}return s}function g3e(t){let e=t.querySelectorAll(js?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let s=e[n];s.childNodes.length==1&&s.textContent==" "&&s.parentNode&&s.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),s)}}function y3e(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,s;try{s=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:r}=t;for(let a=s.length-2;a>=0;a-=2){let c=n.nodes[s[a]];if(!c||c.hasRequiredAttrs())break;try{i=je.from(c.create(s[a+1],i))}catch{break}o++,r++}return new Ke(i,o,r)}const ai={},ci={},b3e={touchstart:!0,touchmove:!0};class x3e{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function v3e(t){for(let e in ai){let n=ai[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=s=>{w3e(t,s)&&!PN(t,s)&&(t.editable||!(s.type in ci))&&n(t,s)},b3e[e]?{passive:!0}:void 0)}Gs&&t.dom.addEventListener("input",()=>null),KE(t)}function Zr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function S3e(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function KE(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=s=>PN(t,s))})}function PN(t,e){return t.someProp("handleDOMEvents",n=>{let s=n[e.type];return s?s(t,e)||e.defaultPrevented:!1})}function w3e(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function E3e(t,e){!PN(t,e)&&ai[e.type]&&(t.editable||!(e.type in ci))&&ai[e.type](t,e)}ci.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!kF(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qr&&js&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Of&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let s=Date.now();t.input.lastIOSEnter=s,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==s&&(t.someProp("handleKeyDown",i=>i(t,jc(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",s=>s(t,n))||d3e(t,n)?n.preventDefault():Zr(t,"key")};ci.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ci.keypress=(t,e)=>{let n=e;if(kF(t)||!n.charCode||n.ctrlKey&&!n.altKey||io&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let s=t.state.selection;if(!(s instanceof Et)||!s.$from.sameParent(s.$to)){let i=String.fromCharCode(n.charCode),o=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",r=>r(t,s.$from.pos,s.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault()}};function Jm(t){return{left:t.clientX,top:t.clientY}}function C3e(t,e){let n=e.x-t.clientX,s=e.y-t.clientY;return n*n+s*s<100}function zN(t,e,n,s,i){if(s==-1)return!1;let o=t.state.doc.resolve(s);for(let r=o.depth+1;r>0;r--)if(t.someProp(e,a=>r>o.depth?a(t,n,o.nodeAfter,o.before(r),i,!0):a(t,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function eg(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let s=t.state.tr.setSelection(e);s.setMeta("pointer",!0),t.dispatch(s)}function N3e(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),s=n.nodeAfter;return s&&s.isAtom&&ut.isSelectable(s)?(eg(t,new ut(n)),!0):!1}function T3e(t,e){if(e==-1)return!1;let n=t.state.selection,s,i;n instanceof ut&&(s=n.node);let o=t.state.doc.resolve(e);for(let r=o.depth+1;r>0;r--){let a=r>o.depth?o.nodeAfter:o.node(r);if(ut.isSelectable(a)){s&&n.$from.depth>0&&r>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(r);break}}return i!=null?(eg(t,ut.create(t.state.doc,i)),!0):!1}function O3e(t,e,n,s,i){return zN(t,"handleClickOn",e,n,s)||t.someProp("handleClick",o=>o(t,e,s))||(i?T3e(t,n):N3e(t,n))}function R3e(t,e,n,s){return zN(t,"handleDoubleClickOn",e,n,s)||t.someProp("handleDoubleClick",i=>i(t,e,s))}function k3e(t,e,n,s){return zN(t,"handleTripleClickOn",e,n,s)||t.someProp("handleTripleClick",i=>i(t,e,s))||A3e(t,n,s)}function A3e(t,e,n){if(n.button!=0)return!1;let s=TF(t,e,!0),i=t.state.doc;return s?(eg(t,s),s instanceof Et&&i.eq(t.state.doc)&&(t.input.mouseDown=new M3e(t,s)),!0):!1}function TF(t,e,n){let s=t.state.doc;if(e==-1)return s.inlineContent?Et.create(s,0,s.content.size):null;let i=s.resolve(e);for(let o=i.depth+1;o>0;o--){let r=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(r.inlineContent)return Et.create(s,a+1,a+1+r.content.size);if(n&&ut.isSelectable(r))return ut.create(s,a)}return null}function BN(t){return Ry(t)}const OF=io?"metaKey":"ctrlKey";ai.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let s=BN(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&C3e(n,t.input.lastClick)&&!n[OF]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let r=t.posAtCoords(Jm(n));r&&(o=="singleClick"?t.input.mouseDown=new _3e(t,r,n,!!s):(o=="doubleClick"?R3e:k3e)(t,r.pos,r.inside,n)?n.preventDefault():Zr(t,"pointer"))};class RF{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class _3e extends RF{constructor(e,n,s,i){super(e),this.pos=n,this.event=s,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!s[OF],this.allowDefault=s.shiftKey;let o,r;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),r=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,r=f.depth?f.before():0}const a=i?null:s.target,c=a?e.docView.nearestDesc(a,!0):null;this.target=c&&ct(c.nodeDOM)?c.nodeDOM:null;let{selection:d}=e.state;s.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof ut&&d.from<=r&&d.to>r)&&(this.mightDrag={node:o,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Hi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Zr(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||al(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Jm(e))),this.updateAllowDefault(e),this.allowDefault||!n?Zr(this.view,"pointer"):O3e(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Gs&&this.mightDrag&&!this.mightDrag.node.isAtom||js&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(eg(this.view,Vt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Zr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Zr(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class M3e extends RF{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Zr(this.view,"pointer");let n=this.view.posAtCoords(Jm(e)),s=n&&TF(this.view,n.inside,!1);if(!s)return;let{doc:i}=this.view.state,o=this.startSelection,[r,a]=s.from<o.from?[o.to,s.from]:[o.from,s.to];eg(this.view,Et.create(i,r,a))}}ai.touchstart=t=>{t.input.lastTouch=Date.now(),BN(t),Zr(t,"pointer")};ai.touchmove=t=>{t.input.lastTouch=Date.now(),Zr(t,"pointer")};ai.contextmenu=t=>BN(t);function kF(t,e){return t.composing?!0:Gs&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const L3e=Qr?5e3:-1;ci.compositionstart=ci.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Et&&e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(s=>s.type.spec.inclusive===!1)||js&&iF&&I3e(t)))t.markCursor=t.state.storedMarks||n.marks(),Ry(t,!0),t.markCursor=null;else if(Ry(t,!e.selection.empty),Hi&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let s=t.domSelectionRange();for(let i=s.focusNode,o=s.focusOffset;i&&ct(i)&&o!=0;){let r=o<0?i.lastChild:i.childNodes[o-1];if(!r)break;if(hs(r)){let a=t.domSelection();a&&a.collapse(r,r.nodeValue.length);break}else i=r,o=-1}}t.input.composing=!0}AF(t,L3e)};function I3e(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||!ct(e)||n>=e.childNodes.length)return!1;let s=e.childNodes[n];return ct(s)&&s.contentEditable=="false"}ci.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,AF(t,20))};function AF(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ry(t),e))}function _F(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function D3e(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=TCe(e.focusNode,e.focusOffset),s=OCe(e.focusNode,e.focusOffset);if(n&&s&&n!=s){let i=s.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||s==o)return o;if(!i||!i.isText(s.nodeValue))return s;if(t.input.compositionNode==s){let r=n.pmViewDesc;if(!(!r||!r.isText(n.nodeValue)))return s}}return n||s}function Ry(t,e=!1){if(!(Qr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_F(t),e||t.docView&&t.docView.dirty){let n=IN(t),s=t.state.selection;return n&&!n.eq(s)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!s.$from.node(s.$from.sharedDepth(s.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function j3e(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let s=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),s.removeAllRanges(),s.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const sm=Ei&&La<15||Of&&_Ce<604;ai.copy=ci.cut=(t,e)=>{let n=e,s=t.state.selection,i=n.type=="cut";if(s.empty)return;let o=sm?null:n.clipboardData,r=s.content(),{dom:a,text:c}=jN(t,r);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):j3e(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function P3e(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function z3e(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,s=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(s.contentEditable="true"),s.style.cssText="position: fixed; left: -10000px; top: 10px",s.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),s.parentNode&&s.parentNode.removeChild(s),n?im(t,s.value,null,i,e):im(t,s.textContent,s.innerHTML,i,e)},50)}function im(t,e,n,s,i){let o=vF(t,e,n,s,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||Ke.empty)))return!0;if(!o)return!1;let r=P3e(o),a=r?t.state.tr.replaceSelectionWith(r,s):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function MF(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ci.paste=(t,e)=>{let n=e;if(t.composing&&!Qr)return;let s=sm?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;s&&im(t,MF(s),s.getData("text/html"),i,n)?n.preventDefault():z3e(t,n)};class LF{constructor(e,n,s){this.slice=e,this.move=n,this.node=s}}const B3e=io?"altKey":"ctrlKey";function IF(t,e){let n;return t.someProp("dragCopies",s=>{n=n||s(e)}),n!=null?!n:!e[B3e]}ai.dragstart=(t,e)=>{let n=e,s=t.input.mouseDown;if(s&&s.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Jm(n)),r;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ut?i.to-1:i.to))){if(s&&s.mightDrag)r=ut.create(t.state.doc,s.mightDrag.pos);else if(n.target&&ct(n.target)){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(r=ut.create(t.state.doc,p.posBefore))}}let a=(r||t.state.selection).content(),{dom:c,text:d,slice:f}=jN(t,a);(!n.dataTransfer.files.length||!js||sF>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(sm?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",sm||n.dataTransfer.setData("text/plain",d),t.dragging=new LF(f,IF(t,n),r)};ai.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ci.dragover=ci.dragenter=(t,e)=>e.preventDefault();ci.drop=(t,e)=>{try{$3e(t,e,t.dragging)}finally{t.dragging=null}};function $3e(t,e,n){if(!e.dataTransfer)return;let s=t.posAtCoords(Jm(e));if(!s)return;let i=t.state.doc.resolve(s.pos),o=n&&n.slice;o?t.someProp("transformPasted",g=>{o=g(o,t,!1)}):o=vF(t,MF(e.dataTransfer),sm?null:e.dataTransfer.getData("text/html"),!1,i);let r=!!(n&&IF(t,e));if(t.someProp("handleDrop",g=>g(t,e,o||Ke.empty,r))){e.preventDefault();return}if(!o)return;e.preventDefault();let a=o?GEe(t.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let c=t.state.tr;if(r){let{node:g}=n;g?g.replace(c):c.deleteSelection()}let d=c.mapping.map(a),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(d,d,o.content.firstChild):c.replaceRange(d,d,o),c.doc.eq(p))return;let m=c.doc.resolve(d);if(f&&ut.isSelectable(o.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new ut(m));else{let g=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((y,v,S,w)=>g=w),c.setSelection(DN(t,m,c.doc.resolve(g)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}ai.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&al(t)},20))};ai.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ai.beforeinput=(t,e)=>{if(Qr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:s}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=s||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,jc(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ci)ai[t]=ci[t];function om(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ky{constructor(e,n){this.toDOM=e,this.spec=n||ou,this.side=this.spec.side||0}map(e,n,s,i){let{pos:o,deleted:r}=e.mapResult(n.from+i,this.side<0?-1:1);return r?null:new _o(o-s,o-s,this)}valid(){return!0}eq(e){return this==e||e instanceof ky&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&om(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ja{constructor(e,n){this.attrs=e,this.spec=n||ou}map(e,n,s,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-s,r=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-s;return o>=r?null:new _o(o,r,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ja&&om(this.attrs,e.attrs)&&om(this.spec,e.spec)}static is(e){return e.type instanceof ja}destroy(){}}class $N{constructor(e,n){this.attrs=e,this.spec=n||ou}map(e,n,s,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let r=e.mapResult(n.to+i,-1);return r.deleted||r.pos<=o.pos?null:new _o(o.pos-s,r.pos-s,this)}valid(e,n){let{index:s,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(s)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof $N&&om(this.attrs,e.attrs)&&om(this.spec,e.spec)}destroy(){}}class _o{constructor(e,n,s){this.from=e,this.to=n,this.type=s}copy(e,n){return new _o(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,s){return this.type.map(e,this,n,s)}static widget(e,n,s){return new _o(e,e,new ky(n,s))}static inline(e,n,s,i){return new _o(e,n,new ja(s,i))}static node(e,n,s,i){return new _o(e,n,new $N(s,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ja}get widget(){return this.type instanceof ky}}const kd=[],ou={};class Hn{constructor(e,n){this.local=e.length?e:kd,this.children=n.length?n:kd}static create(e,n){return n.length?Ay(n,e,0,ou):Vs}find(e,n,s){let i=[];return this.findInner(e??0,n??1e9,i,0,s),i}findInner(e,n,s,i,o){for(let r=0;r<this.local.length;r++){let a=this.local[r];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&s.push(a.copy(a.from+i,a.to+i))}for(let r=0;r<this.children.length;r+=3)if(this.children[r]<n&&this.children[r+1]>e){let a=this.children[r]+1;this.children[r+2].findInner(e-a,n-a,s,i+a,o)}}map(e,n,s){return this==Vs||e.maps.length==0?this:this.mapInner(e,n,0,0,s||ou)}mapInner(e,n,s,i,o){let r;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,s,i);c&&c.type.valid(n,c)?(r||(r=[])).push(c):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?F3e(this.children,r||[],e,n,s,i,o):r?new Hn(r.sort(ru),kd):Vs}add(e,n){return n.length?this==Vs?Hn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,s){let i,o=0;e.forEach((a,c)=>{let d=c+s,f;if(f=jF(n,a,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(a,f,d+1):i.splice(o,0,c,c+a.nodeSize,Ay(f,a,d+1,ou)),o+=3}});let r=DF(o?PF(n):n,-s);for(let a=0;a<r.length;a++)r[a].type.valid(e,r[a])||r.splice(a--,1);return new Hn(r.length?this.local.concat(r).sort(ru):this.local,i||this.children)}remove(e){return e.length==0||this==Vs?this:this.removeInner(e,0)}removeInner(e,n){let s=this.children,i=this.local;for(let o=0;o<s.length;o+=3){let r,a=s[o]+n,c=s[o+1]+n;for(let f=0,p;f<e.length;f++)(p=e[f])&&p.from>a&&p.to<c&&(e[f]=null,(r||(r=[])).push(p));if(!r)continue;s==this.children&&(s=this.children.slice());let d=s[o+2].removeInner(r,a+1);d!=Vs?s[o+2]=d:(s.splice(o,3),o-=3)}if(i.length){for(let o=0,r;o<e.length;o++)if(r=e[o])for(let a=0;a<i.length;a++)i[a].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return s==this.children&&i==this.local?this:i.length||s.length?new Hn(i,s):Vs}forChild(e,n){if(this==Vs)return this;if(n.isLeaf)return Hn.empty;let s,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(s=this.children[a+2]);break}let o=e+1,r=o+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<r&&c.to>o&&c.type instanceof ja){let d=Math.max(o,c.from)-o,f=Math.min(r,c.to)-o;d<f&&(i||(i=[])).push(c.copy(d,f))}}if(i){let a=new Hn(i.sort(ru),kd);return s?new pa([a,s]):a}return s||Vs}eq(e){if(this==e)return!0;if(!(e instanceof Hn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return FN(this.localsInner(e))}localsInner(e){if(this==Vs)return kd;if(e.inlineContent||!this.local.some(ja.is))return this.local;let n=[];for(let s=0;s<this.local.length;s++)this.local[s].type instanceof ja||n.push(this.local[s]);return n}forEachSet(e){e(this)}}Hn.empty=new Hn([],[]);Hn.removeOverlap=FN;const Vs=Hn.empty;class pa{constructor(e){this.members=e}map(e,n){const s=this.members.map(i=>i.map(e,n,ou));return pa.from(s)}forChild(e,n){if(n.isLeaf)return Hn.empty;let s=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=Vs&&(o instanceof pa?s=s.concat(o.members):s.push(o))}return pa.from(s)}eq(e){if(!(e instanceof pa)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,s=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{s&&(n=n.slice(),s=!1);for(let r=0;r<o.length;r++)n.push(o[r])}}return n?FN(s?n:n.sort(ru)):kd}static from(e){switch(e.length){case 0:return Vs;case 1:return e[0];default:return new pa(e.every(n=>n instanceof Hn)?e:e.reduce((n,s)=>n.concat(s instanceof Hn?s:s.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function F3e(t,e,n,s,i,o,r){let a=t.slice();for(let d=0,f=o;d<n.maps.length;d++){let p=0;n.maps[d].forEach((m,g,y,v)=>{let S=v-y-(g-m);for(let w=0;w<a.length;w+=3){let N=a[w+1];if(N<0||m>N+f-p)continue;let C=a[w]+f-p;g>=C?a[w+1]=m<=C?-2:-1:m>=f&&S&&(a[w]+=S,a[w+1]+=S)}p+=S}),f=n.maps[d].map(f,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[d+1]=-1;continue}let f=n.map(t[d]+o),p=f-i;if(p<0||p>=s.content.size){c=!0;continue}let m=n.map(t[d+1]+o,-1),g=m-i,{index:y,offset:v}=s.content.findIndex(p),S=s.maybeChild(y);if(S&&v==p&&v+S.nodeSize==g){let w=a[d+2].mapInner(n,S,f+1,t[d]+o+1,r);w!=Vs?(a[d]=p,a[d+1]=g,a[d+2]=w):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=H3e(a,t,e,n,i,o,r),f=Ay(d,s,0,r);e=f.local;for(let p=0;p<a.length;p+=3)a[p+1]<0&&(a.splice(p,3),p-=3);for(let p=0,m=0;p<f.children.length;p+=3){let g=f.children[p];for(;m<a.length&&a[m]<g;)m+=3;a.splice(m,0,f.children[p],f.children[p+1],f.children[p+2])}}return new Hn(e.sort(ru),a)}function DF(t,e){if(!e||!t.length)return t;let n=[];for(let s=0;s<t.length;s++){let i=t[s];n.push(new _o(i.from+e,i.to+e,i.type))}return n}function H3e(t,e,n,s,i,o,r){function a(c,d){for(let f=0;f<c.local.length;f++){let p=c.local[f].map(s,i,d);p?n.push(p):r.onRemove&&r.onRemove(c.local[f].spec)}for(let f=0;f<c.children.length;f+=3)a(c.children[f+2],c.children[f]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+o+1);return n}function jF(t,e,n){if(e.isLeaf)return null;let s=n+e.nodeSize,i=null;for(let o=0,r;o<t.length;o++)(r=t[o])&&r.from>n&&r.to<s&&((i||(i=[])).push(r),t[o]=null);return i}function PF(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ay(t,e,n,s){let i=[],o=!1;e.forEach((a,c)=>{let d=jF(t,a,c+n);if(d){o=!0;let f=Ay(d,a,n+c+1,s);f!=Vs&&i.push(c,c+a.nodeSize,f)}});let r=DF(o?PF(t):t,-n).sort(ru);for(let a=0;a<r.length;a++)r[a].type.valid(e,r[a])||(s.onRemove&&s.onRemove(r[a].spec),r.splice(a--,1));return r.length||i.length?new Hn(r,i):Vs}function ru(t,e){return t.from-e.from||t.to-e.to}function FN(t){let e=t;for(let n=0;n<e.length-1;n++){let s=e[n];if(s.from!=s.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==s.from){o.to!=s.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,s.to),BL(e,i+1,o.copy(s.to,o.to)));continue}else{o.from<s.to&&(e==t&&(e=t.slice()),e[n]=s.copy(s.from,o.from),BL(e,i,s.copy(o.from,s.to)));break}}}return e}function BL(t,e,n){for(;e<t.length&&ru(n,t[e])>0;)e++;t.splice(e,0,n)}function _S(t){let e=[];return t.someProp("decorations",n=>{let s=n(t.state);s&&s!=Vs&&e.push(s)}),t.cursorWrapper&&e.push(Hn.create(t.state.doc,[t.cursorWrapper.deco])),pa.from(e)}const U3e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},V3e=Ei&&La<=11;class q3e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class W3e{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new q3e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(s=>{for(let i=0;i<s.length;i++)this.queue.push(s[i]);Ei&&La<=11&&s.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Gs&&e.composing&&s.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),V3e&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,U3e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ML(this.view)){if(this.suppressingSelectionUpdates)return al(this.view);if(Ei&&La<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,s;for(let o=e.focusNode;o;o=Tf(o))n.add(o);for(let o=e.anchorNode;o;o=Tf(o))if(n.has(o)){s=o;break}let i=s&&this.view.docView.nearestDesc(s);if(i&&i.ignoreMutation({type:"selection",target:hs(s)?s.parentNode:s}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let s=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(s)&&ML(e)&&!this.ignoreSelectionChange(s),o=-1,r=-1,a=!1,c=[];if(e.editable)for(let f=0;f<n.length;f++){let p=this.registerMutation(n[f],c);p&&(o=o<0?p.from:Math.min(p.from,o),r=r<0?p.to:Math.max(p.to,r),p.typeOver&&(a=!0))}if(c.some(f=>f.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||js&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(f=>f.type=="childList"&&f.removedNodes.length))){for(let f of c)if(f.nodeName=="BR"&&f.parentNode){let p=f.nextSibling;for(;p&&ct(p);){if(p.contentEditable=="false"){f.parentNode.removeChild(f);break}p=p.firstChild}}}else if(Hi&&c.length){let f=c.filter(p=>p.nodeName=="BR");if(f.length==2){let[p,m]=f;p.parentNode&&p.parentNode.parentNode==m.parentNode?m.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!p||Y3e(e,p)!=g)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Vb(s)&&(d=IN(e))&&d.eq(Vt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,al(e),this.currentSelection.set(s),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,r),G3e(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,X3e(e,c)),this.handleDOMChange(o,r,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(s)||al(e),this.currentSelection.set(s))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let s=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(s==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!s||s.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let p=e.addedNodes[f];n.push(p),hs(p)&&(this.lastChangedTextNode=p)}if(s.contentDOM&&s.contentDOM!=s.dom&&!s.contentDOM.contains(e.target))return{from:s.posBefore,to:s.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Ei&&La<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:p,nextSibling:m}=e.addedNodes[f];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(o=m)}let r=i&&i.parentNode==e.target?Ls(i)+1:0,a=s.localPosFromDOM(e.target,r,-1),c=o&&o.parentNode==e.target?Ls(o):e.target.childNodes.length,d=s.localPosFromDOM(e.target,c,1);return{from:a,to:d}}else return e.type=="attributes"?{from:s.posAtStart-s.border,to:s.posAtEnd+s.border}:(this.lastChangedTextNode=e.target,{from:s.posAtStart,to:s.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let $L=new WeakMap,FL=!1;function G3e(t){if(!$L.has(t)&&($L.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Hi,FL)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),FL=!0}}function HL(t,e){let n=e.startContainer,s=e.startOffset,i=e.endContainer,o=e.endOffset,r=t.domAtPos(t.state.selection.anchor);return xu(r.node,r.offset,i,o)&&([n,s,i,o]=[i,o,n,s]),{anchorNode:n,anchorOffset:s,focusNode:i,focusOffset:o}}function K3e(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return HL(t,i)}let n;function s(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",s,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",s,!0),n?HL(t,n):null}function Y3e(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let s=t.docView.nearestDesc(n,!0);if(s&&s.node.isBlock)return n}return null}function X3e(t,e){var n;let{focusNode:s,focusOffset:i}=t.domSelectionRange();for(let o of e)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let r=o.nextSibling;for(;r&&r.nodeName!="TD"&&r.nodeName!="TH";)r=r.nextSibling;if(r){let a=r;for(;;){let c=a.firstChild;if(!c||!ct(c)||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;a=c}a.insertBefore(o,a.firstChild),s==o&&t.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function Q3e(t,e,n,s){let{node:i,fromOffset:o,toOffset:r,from:a,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),f,p=d.anchorNode;if(p&&vu(t.dom,p)&&(f=[{node:p,offset:d.anchorOffset}],Vb(d)||f.push({node:d.focusNode,offset:d.focusOffset})),js&&t.input.lastKeyCode===8)for(let w=r;w>o;w--){let N=i.childNodes[w-1],C=N.pmViewDesc;if(N.nodeName=="BR"&&!C){r=w;break}if(!C||C.size)break}let m=t.state.doc,g=t.someProp("domParser")||rl.fromSchema(t.state.schema),y=m.resolve(a),v=null,S=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:r,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:f,ruleFromNode:Z3e(s),context:y});if(f&&f[0].pos!=null){let w=f[0].pos,N=f[1]&&f[1].pos;N==null&&(N=w),v={anchor:w+a,head:N+a}}return{doc:S,sel:v,from:a,to:c}}const Z3e=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(Gs&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let s=document.createElement("div");return s.appendChild(document.createElement("li")),{skip:s}}else if(e.parentNode.lastChild==e||Gs&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},J3e=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function eNe(t,e,n,s,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,M=IN(t,k);if(M&&!t.state.selection.eq(M)){if(js&&Qr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",j=>j(t,jc(13,"Enter"))))return;let L=t.state.tr.setSelection(M);k=="pointer"?L.setMeta("pointer",!0):k=="key"&&L.scrollIntoView(),o&&L.setMeta("composition",o),t.dispatch(L)}return}let r=t.state.doc.resolve(e),a=r.sharedDepth(n);e=r.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,d=Q3e(t,e,n,i),f=t.state.doc,p=f.slice(d.from,d.to),m,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=iNe(p.content,d.doc.content,d.from,m,g);if(y&&t.input.domChangeCount++,(Of&&t.input.lastIOSEnter>Date.now()-225||Qr)&&i.some(k=>ct(k)&&!J3e.test(k.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",k=>k(t,jc(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(s&&c instanceof Et&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let k=UL(t,t.state.doc,d.sel);if(k&&!k.eq(t.state.selection)){let M=t.state.tr.setSelection(k);o&&M.setMeta("composition",o),t.dispatch(M)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Et&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Ei&&La<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let v=d.doc.resolveNoCache(y.start-d.from),S=d.doc.resolveNoCache(y.endB-d.from),w=f.resolve(y.start),N=v.sameParent(S)&&v.parent.inlineContent&&w.end()>=y.endA;if((Of&&t.input.lastIOSEnter>Date.now()-225&&(!N||i.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!N&&sNe(d.doc,v.pos,S.pos))&&t.someProp("handleKeyDown",k=>k(t,jc(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&nNe(f,y.start,y.endA,v,S)&&t.someProp("handleKeyDown",k=>k(t,jc(8,"Backspace")))){Qr&&js&&t.domObserver.suppressSelectionUpdates();return}js&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),Qr&&!N&&v.start()!=S.start()&&S.parentOffset==0&&v.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,S=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,jc(13,"Enter"))})},20));let C=y.start,T=y.endA,R=k=>{let M=k||t.state.tr.replace(C,T,d.doc.slice(y.start-d.from,y.endB-d.from));if(d.sel){let L=UL(t,M.doc,d.sel);L&&!(js&&t.composing&&L.empty&&(y.start!=y.endB||t.input.lastChromeDelete<Date.now()-100)&&(L.head==C||L.head==M.mapping.map(T)-1)||Ei&&L.empty&&L.head==C)&&M.setSelection(L)}return o&&M.setMeta("composition",o),M.scrollIntoView()},A;if(N)if(v.pos==S.pos){Ei&&La<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>al(t),20));let k=R(t.state.tr.delete(C,T)),M=f.resolve(y.start).marksAcross(f.resolve(y.endA));M&&k.ensureMarks(M),t.dispatch(k)}else if(y.endA==y.endB&&(A=tNe(v.parent.content.cut(v.parentOffset,S.parentOffset),w.parent.content.cut(w.parentOffset,y.endA-w.start())))){let k=R(t.state.tr);A.type=="add"?k.addMark(C,T,A.mark):k.removeMark(C,T,A.mark),t.dispatch(k)}else if(v.parent.child(v.index()).isText&&v.index()==S.index()-(S.textOffset?0:1)){let k=v.parent.textBetween(v.parentOffset,S.parentOffset),M=()=>R(t.state.tr.insertText(k,C,T));t.someProp("handleTextInput",L=>L(t,C,T,k,M))||t.dispatch(M())}else t.dispatch(R());else t.dispatch(R())}function UL(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:DN(t,e.resolve(n.anchor),e.resolve(n.head))}function tNe(t,e){let n=t.firstChild.marks,s=e.firstChild.marks,i=n,o=s,r,a,c;for(let f=0;f<s.length;f++)i=s[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],r="add",c=f=>f.mark(a.addToSet(f.marks));else if(i.length==0&&o.length==1)a=o[0],r="remove",c=f=>f.mark(a.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<e.childCount;f++)d.push(c(e.child(f)));if(je.from(d).eq(t))return{mark:a,type:r}}function nNe(t,e,n,s,i){if(n-e<=i.pos-s.pos||MS(s,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!s.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let r=t.resolve(MS(o,!0,!0));return!r.parent.isTextblock||r.pos>n||MS(r,!0,!1)<n?!1:s.parent.content.cut(s.parentOffset).eq(r.parent.content)}function sNe(t,e,n){let s=0,i=0;return t.nodesBetween(e,n,(o,r)=>{o.isTextblock&&r>=e&&r<n?s++:(o.isText?/\S/.test(o.text.slice(Math.max(0,e-r),Math.min(o.nodeSize,n-r))):o.isLeaf)&&i++}),i==0&&s==1}function MS(t,e,n){let s=t.depth,i=e?t.end():t.pos;for(;s>0&&(e||t.indexAfter(s)==t.node(s).childCount);)s--,i++,e=!1;if(n){let o=t.node(s).maybeChild(t.indexAfter(s));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function iNe(t,e,n,s,i){let o=t.findDiffStart(e,n),r=n+t.size,a=n+e.size;if(o==null)return null;let{a:c,b:d}=t.findDiffEnd(e,r,a);if(i=="end"){let f=Math.max(0,o-Math.min(c,d));s-=c+f-o}if(c<o&&r<a){let f=s<=o&&s>=c?o-s:0;o-=f,d=o+(d-c),c=o}else if(d<o){let f=s<=o&&s>=d?o-s:0;o-=f,c=o+(c-d),d=o}return{start:o,endA:c,endB:d}}class zF{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new x3e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(KL),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=WL(this),qL(this),this.nodeViews=GL(this),this.docView=TL(this.state.doc,VL(this),_S(this),this.dom,this),this.domObserver=new W3e(this,(s,i,o,r)=>eNe(this,s,i,o,r)),this.domObserver.start(),v3e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&KE(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(KL),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let s in this._props)n[s]=this._props[s];n.state=this.state;for(let s in e)n[s]=e[s];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var s;let i=this.state,o=!1,r=!1;e.storedMarks&&this.composing&&(_F(this),r=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=GL(this);rNe(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&KE(this),this.editable=WL(this),qL(this);let c=_S(this),d=VL(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=o||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(i.selection))&&(r=!0);let m=f=="preserve"&&r&&this.dom.style.overflowAnchor==null&&ICe(this);if(r){this.domObserver.stop();let g=p&&(Ei||js)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&oNe(i.selection,e.selection);if(p){let v=js?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=D3e(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=TL(e.doc,d,c,this.dom,this)),v&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(g=!0)}let y=this.input.mouseDown;g||!(y&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&i3e(this)&&y.delaySelUpdate())?al(this,g):(yF(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((s=this.dragging)===null||s===void 0)&&s.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&DCe(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!vu(this.dom,e))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ut){let n=this.docView.domAfterPos(this.state.selection.from);ct(n)&&SL(this,n.getBoundingClientRect(),e)}else SL(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let s=this.directPlugins[n];s.spec.view&&this.pluginViews.push(s.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let s=this.state.plugins[n];s.spec.view&&this.pluginViews.push(s.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let s=this.pluginViews[n];s.update&&s.update(this,e)}}updateDraggedNode(e,n){let s=e.node,i=-1;if(s.from<this.state.doc.content.size&&this.state.doc.nodeAt(s.from)==s.node)i=s.from;else{let o=s.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==s.node&&(i=o)}this.dragging=new LF(e.slice,e.move,i<0?void 0:ut.create(this.state.doc,i))}someProp(e,n){let s=this._props&&this._props[e],i;if(s!=null&&(i=n?n(s):s))return i;for(let r=0;r<this.directPlugins.length;r++){let a=this.directPlugins[r].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let a=o[r].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Ei){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&jCe(this.dom),al(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return FCe(this,e)}coordsAtPos(e,n=1){return cF(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,s=-1){let i=this.docView.posFromDOM(e,n,s);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return WCe(this,n||this.state,e)}pasteHTML(e,n){return im(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return im(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return jN(this,e)}destroy(){this.docView&&(S3e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],_S(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,CCe())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return E3e(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?Gs&&this.root.nodeType===11&&kCe(this.dom.ownerDocument)==this.dom&&K3e(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}zF.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function VL(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let s in n)s=="class"?e.class+=" "+n[s]:s=="style"?e.style=(e.style?e.style+";":"")+n[s]:!e[s]&&s!="contenteditable"&&s!="nodeName"&&(e[s]=String(n[s]))}),e.translate||(e.translate="no"),[_o.node(0,t.state.doc.content.size,e)]}function qL(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:_o.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function WL(t){return!t.someProp("editable",e=>e(t.state)===!1)}function oNe(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function GL(t){let e=Object.create(null);function n(s){for(let i in s)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=s[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function rNe(t,e){let n=0,s=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)s++;return n!=s}function KL(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ka={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_y={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lNe=typeof navigator<"u"&&/Mac/.test(navigator.platform),aNe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Is=0;Is<10;Is++)Ka[48+Is]=Ka[96+Is]=String(Is);for(var Is=1;Is<=24;Is++)Ka[Is+111]="F"+Is;for(var Is=65;Is<=90;Is++)Ka[Is]=String.fromCharCode(Is+32),_y[Is]=String.fromCharCode(Is);for(var LS in Ka)_y.hasOwnProperty(LS)||(_y[LS]=Ka[LS]);function cNe(t){var e=lNe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aNe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?_y:Ka)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const uNe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),dNe=typeof navigator<"u"&&/Win/.test(navigator.platform);function fNe(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let s,i,o,r;for(let a=0;a<e.length-1;a++){let c=e[a];if(/^(cmd|meta|m)$/i.test(c))r=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))uNe?r=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(n="Alt-"+n),i&&(n="Ctrl-"+n),r&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function hNe(t){let e=Object.create(null);for(let n in t)e[fNe(n)]=t[n];return e}function IS(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function pNe(t){return new Gi({props:{handleKeyDown:mNe(t)}})}function mNe(t){let e=hNe(t);return function(n,s){let i=cNe(s),o,r=e[IS(i,s)];if(r&&r(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(s.shiftKey){let a=e[IS(i,s,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((s.altKey||s.metaKey||s.ctrlKey)&&!(dNe&&s.ctrlKey&&s.altKey)&&(o=Ka[s.keyCode])&&o!=i){let a=e[IS(o,s)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var My=200,Ss=function(){};Ss.prototype.append=function(e){return e.length?(e=Ss.from(e),!this.length&&e||e.length<My&&this.leafAppend(e)||this.length<My&&e.leafPrepend(this)||this.appendInner(e)):this};Ss.prototype.prepend=function(e){return e.length?Ss.from(e).append(this):this};Ss.prototype.appendInner=function(e){return new gNe(this,e)};Ss.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ss.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ss.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ss.prototype.forEach=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length),n<=s?this.forEachInner(e,n,s,0):this.forEachInvertedInner(e,n,s,0)};Ss.prototype.map=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length);var i=[];return this.forEach(function(o,r){return i.push(e(o,r))},n,s),i};Ss.from=function(e){return e instanceof Ss?e:e&&e.length?new BF(e):Ss.empty};var BF=(function(t){function e(s){t.call(this),this.values=s}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,r,a){for(var c=o;c<r;c++)if(i(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,r,a){for(var c=o-1;c>=r;c--)if(i(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=My)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=My)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(Ss);Ss.empty=new BF([]);var gNe=(function(t){function e(n,s){t.call(this),this.left=n,this.right=s,this.length=n.length+s.length,this.depth=Math.max(n.depth,s.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return s<this.left.length?this.left.get(s):this.right.get(s-this.left.length)},e.prototype.forEachInner=function(s,i,o,r){var a=this.left.length;if(i<a&&this.left.forEachInner(s,i,Math.min(o,a),r)===!1||o>a&&this.right.forEachInner(s,Math.max(i-a,0),Math.min(this.length,o)-a,r+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,r){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(s,i-a,Math.max(o,a)-a,r+a)===!1||o<a&&this.left.forEachInvertedInner(s,Math.min(i,a),o,r)===!1)return!1},e.prototype.sliceInner=function(s,i){if(s==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(s,i):s>=o?this.right.slice(s-o,i-o):this.left.slice(s,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(s){var i=this.right.leafAppend(s);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(s){var i=this.left.leafPrepend(s);if(i)return new e(i,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(Ss);const yNe=500;class To{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let i,o;n&&(i=this.remapping(s,this.items.length),o=i.maps.length);let r=e.tr,a,c,d=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){i||(i=this.remapping(s,m+1),o=i.maps.length),o--,f.push(p);return}if(i){f.push(new Zo(p.map));let g=p.step.map(i.slice(o)),y;g&&r.maybeStep(g).doc&&(y=r.mapping.maps[r.mapping.maps.length-1],d.push(new Zo(y,void 0,void 0,d.length+f.length))),o--,y&&i.appendMap(y,o)}else r.maybeStep(p.step);if(p.selection)return a=i?p.selection.map(i.slice(o)):p.selection,c=new To(this.items.slice(0,s).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:r,selection:a}}addTransform(e,n,s,i){let o=[],r=this.eventCount,a=this.items,c=!i&&a.length?a.get(a.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),m=new Zo(e.mapping.maps[f],p,n),g;(g=c&&c.merge(m))&&(m=g,f?o.pop():a=a.slice(0,a.length-1)),o.push(m),n&&(r++,n=void 0),i||(c=m)}let d=r-s.depth;return d>xNe&&(a=bNe(a,d),r-=d),new To(a.append(o),r)}remapping(e,n){let s=new tm;return this.items.forEach((i,o)=>{let r=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?s.maps.length-i.mirrorOffset:void 0;s.appendMap(i.map,r)},e,n),s}addMaps(e){return this.eventCount==0?this:new To(this.items.append(e.map(n=>new Zo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let s=[],i=this.items.length-n,o=e.mapping,r=e.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},i);let c=n;this.items.forEach(m=>{let g=o.getMirror(--c);if(g==null)return;r=Math.min(r,g);let y=o.maps[g];if(m.step){let v=e.steps[g].invert(e.docs[g]),S=m.selection&&m.selection.map(o.slice(c+1,g));S&&a++,s.push(new Zo(y,v,S))}else s.push(new Zo(y))},i);let d=[];for(let m=n;m<r;m++)d.push(new Zo(o.maps[m]));let f=this.items.slice(0,i).append(d).append(s),p=new To(f,a);return p.emptyItemCount()>yNe&&(p=p.compress(this.items.length-s.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),s=n.maps.length,i=[],o=0;return this.items.forEach((r,a)=>{if(a>=e)i.push(r),r.selection&&o++;else if(r.step){let c=r.step.map(n.slice(s)),d=c&&c.getMap();if(s--,d&&n.appendMap(d,s),c){let f=r.selection&&r.selection.map(n.slice(s));f&&o++;let p=new Zo(d.invert(),c,f),m,g=i.length-1;(m=i.length&&i[g].merge(p))?i[g]=m:i.push(p)}}else r.map&&s--},this.items.length,0),new To(Ss.from(i.reverse()),o)}}To.empty=new To(Ss.empty,0);function bNe(t,e){let n;return t.forEach((s,i)=>{if(s.selection&&e--==0)return n=i,!1}),t.slice(n)}class Zo{constructor(e,n,s,i){this.map=e,this.step=n,this.selection=s,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Zo(n.getMap().invert(),n,this.selection)}}}class da{constructor(e,n,s,i,o){this.done=e,this.undone=n,this.prevRanges=s,this.prevTime=i,this.prevComposition=o}}const xNe=20;function vNe(t,e,n,s){let i=n.getMeta(Pa),o;if(i)return i.historyState;n.getMeta($F)&&(t=new da(t.done,t.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(r&&r.getMeta(Pa))return r.getMeta(Pa).redo?new da(t.done.addTransform(n,void 0,s,M1(e)),t.undone,YL(n.mapping.maps),t.prevTime,t.prevComposition):new da(t.done,t.undone.addTransform(n,void 0,s,M1(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!r&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-s.newGroupDelay||!SNe(n,t.prevRanges)),d=r?DS(t.prevRanges,n.mapping):YL(n.mapping.maps);return new da(t.done.addTransform(n,c?e.selection.getBookmark():void 0,s,M1(e)),To.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new da(t.done.rebased(n,o),t.undone.rebased(n,o),DS(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new da(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),DS(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function SNe(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((s,i)=>{for(let o=0;o<e.length;o+=2)s<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function YL(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((s,i,o,r)=>e.push(o,r));return e}function DS(t,e){if(!t)return null;let n=[];for(let s=0;s<t.length;s+=2){let i=e.map(t[s],1),o=e.map(t[s+1],-1);i<=o&&n.push(i,o)}return n}function wNe(t,e,n){let s=M1(e),i=Pa.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,s);if(!o)return null;let r=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,s),c=new da(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(r).setMeta(Pa,{redo:n,historyState:c})}let jS=!1,XL=null;function M1(t){let e=t.plugins;if(XL!=e){jS=!1,XL=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){jS=!0;break}}return jS}function ENe(t){return t.setMeta($F,!0)}const Pa=new Po("history"),$F=new Po("closeHistory");function A_e(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Gi({key:Pa,state:{init(){return new da(To.empty,To.empty,null,0,-1)},apply(e,n,s){return vNe(n,s,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let s=n.inputType,i=s=="historyUndo"?CNe:s=="historyRedo"?NNe:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function FF(t,e){return(n,s)=>{let i=Pa.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(s){let o=wNe(i,n,t);o&&s(e?o.scrollIntoView():o)}return!0}}const CNe=FF(!1,!0),NNe=FF(!0,!0);function __e(t){return t.getMeta(Pa)!=null}function Gb(t){const{state:e,transaction:n}=t;let{selection:s}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return s},get doc(){return i},get tr(){return s=n.selection,i=n.doc,o=n.storedMarks,n}}}var Kd=class HF{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:s}=this,{view:i}=n,{tr:o}=s,r=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...f)=>{const p=c(...f)(r);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:s,editor:i,state:o}=this,{view:r}=i,a=[],c=!!e,d=e||o.tr,f=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(d),a.every(m=>m===!0)),p={...Object.fromEntries(Object.entries(s).map(([m,g])=>[m,(...v)=>{const S=this.buildProps(d,n),w=g(...v)(S);return a.push(w),p}])),run:f};return p}static createFakeChain(){const e=new Proxy({},{get:(n,s)=>{if(s!=="then")return s==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:n,state:s}=this,i=!1,o=e||s.tr,r=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...d)=>c(...d)({...r,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}static createFallbackCan(){const e=HF.createFakeChain();return new Proxy({chain:()=>e},{get:(n,s)=>{if(s!=="then")return s==="chain"?n.chain:()=>!1}})}buildProps(e,n=!0){const{rawCommands:s,editor:i,state:o}=this,{view:r}=i,a={tr:e,editor:i,view:r,state:Gb({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(s).map(([c,d])=>[c,(...f)=>d(...f)(a)]))}};return a}};const TNe=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var n;e.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),ONe=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),RNe=()=>({state:t,tr:e,dispatch:n})=>{const{selection:s}=e,{ranges:i}=s;return n&&i.forEach(({$from:o,$to:r})=>{t.doc.nodesBetween(o.pos,r.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:f}=e,p=d.resolve(f.map(c)),m=d.resolve(f.map(c+a.nodeSize)),g=p.blockRange(m);if(!g)return;const y=Uf(g);if(a.type.isTextblock){const{defaultType:v}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(g.start,v)}(y||y===0)&&e.lift(g,y)})}),!0},kNe=t=>e=>t(e),ANe=()=>({state:t,dispatch:e})=>Z$(t,e),_Ne=(t,e)=>({editor:n,tr:s})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);s.deleteRange(t.from,t.to);const r=s.mapping.map(e);return s.insert(r,o.content),s.setSelection(new Et(s.doc.resolve(Math.max(r-1,0)))),!0},MNe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,s=n.$anchor.node();if(s.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s.type){if(e){const r=i.before(o),a=i.after(o);t.delete(r,a).scrollIntoView()}return!0}return!1};function ws(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}const LNe=t=>({tr:e,state:n,dispatch:s})=>{const i=ws(t,n.schema),o=e.selection.$anchor;for(let r=o.depth;r>0;r-=1)if(o.node(r).type===i){if(s){const a=o.before(r),c=o.after(r);e.delete(a,c).scrollIntoView()}return!0}return!1},INe=t=>({tr:e,dispatch:n})=>{const{from:s,to:i}=t;return n&&e.delete(s,i),!0},DNe=t=>t.content?/^text(\*|\+)/.test(t.content):!1,QL=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const s=e.nodes[t.parent.type.name].spec;return DNe(s)?n==="left"?t.start()-1:t.end()+1:t.pos},jNe=(t,e,n)=>({from:QL(t,n,"left"),to:QL(e,n,"right")}),PNe=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:s}=t.selection,i=n.steps.length;s.forEach(o=>{const r=n.mapping.slice(i),a=n.doc.resolve(r.map(o.$from.pos)),c=n.doc.resolve(r.map(o.$to.pos)),{from:d,to:f}=jNe(a,c,t.schema);n.deleteRange(d,f)}),n.selection.empty||n.setSelection(Et.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},zNe=()=>({commands:t})=>t.keyboardShortcut("Enter"),BNe=()=>({state:t,dispatch:e})=>cCe(t,e);function HN(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ly(t,e,n={strict:!0}){const s=Object.keys(e);return s.length?s.every(i=>n.strict?e[i]===t[i]:HN(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function UF(t,e,n={}){return t.find(s=>s.type===e&&Ly(Object.fromEntries(Object.keys(n).map(i=>[i,s.attrs[i]])),n))}function ZL(t,e,n={}){return!!UF(t,e,n)}function UN(t,e,n){if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if((!s.node||!s.node.marks.some(c=>c.type===e))&&(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(c=>c.type===e))return;if(!n){const c=s.node.marks.find(d=>d.type===e);c&&(n=c.attrs)}if(!UF([...s.node.marks],e,n))return;let i=s.index,o=t.start()+s.offset,r=i+1,a=o+s.node.nodeSize;for(;i>0&&ZL([...t.parent.child(i-1).marks],e,n);)i-=1,o-=t.parent.child(i).nodeSize;for(;r<t.parent.childCount&&ZL([...t.parent.child(r).marks],e,n);)a+=t.parent.child(r).nodeSize,r+=1;return{from:o,to:a}}function wl(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const $Ne=(t,e)=>({tr:n,state:s,dispatch:i})=>{const o=wl(t,s.schema),{doc:r,selection:a}=n,{$from:c,from:d,to:f}=a;if(i){const p=UN(c,o,e);if(p&&p.from<=d&&p.to>=f){const m=Et.create(r,p.from,p.to);n.setSelection(m)}}return!0},FNe=t=>e=>{const n=typeof t=="function"?t(e):t;for(let s=0;s<n.length;s+=1)if(n[s](e))return!0;return!1};function VF(t){return t instanceof Et}function Uc(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function YE(t,e=null){if(!e)return null;const n=Vt.atStart(t),s=Vt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return s;const i=n.from,o=s.to;return e==="all"?Et.create(t,Uc(0,i,o),Uc(t.content.size,i,o)):Et.create(t,Uc(e,i,o),Uc(e,i,o))}function XE(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function rm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function HNe(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const UNe=(t=null,e={})=>({editor:n,view:s,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const r=()=>{(rm()||XE())&&s.dom.focus(),HNe()&&!rm()&&!XE()&&s.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(s.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(s.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(o&&t===null&&!VF(n.state.selection))return r(),!0;const a=YE(i.doc,t)||n.state.selection,c=n.state.selection.eq(a);return o&&(c||i.setSelection(a),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),r()),!0},VNe=(t,e)=>n=>t.every((s,i)=>e(s,{...n,index:i})),qNe=(t,e)=>({tr:n,commands:s})=>s.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),qF=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const s=e[n];s.nodeType===3&&s.nodeValue&&/^(\n\s\s|\n)$/.test(s.nodeValue)?t.removeChild(s):s.nodeType===1&&qF(s)}return t};function ap(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return qF(n)}function WF(t){return typeof(t==null?void 0:t.nodesBetween)=="function"}function Rf(t,e,n){if(WF(t))return t;const s=typeof t=="object"&&t!==null;n={slice:!0,parseOptions:{},...n};const i=typeof t=="string";if(s)try{if(Array.isArray(t)&&t.length>0)return je.fromArray(t.map(r=>e.nodeFromJSON(r)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Rf("",e,n)}if(i){if(n.errorOnInvalidContent){let r=!1,a="";const c=new N$({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(r=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?rl.fromSchema(c).parseSlice(ap(t),n.parseOptions):rl.fromSchema(c).parse(ap(t),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=rl.fromSchema(e);return n.slice?o.parseSlice(ap(t),n.parseOptions).content:o.parse(ap(t),n.parseOptions)}return Rf("",e,n)}function GF(t){return!("type"in t)}function KF(t,e,n){const s=t.steps.length-1;if(s<e)return;const i=t.steps[s];if(!(i instanceof Kn||i instanceof vs))return;const o=t.mapping.maps[s];let r=0;o.forEach((a,c,d,f)=>{r===0&&(r=f)}),t.setSelection(Vt.near(t.doc.resolve(r),n))}const WNe=(t,e,n)=>({tr:s,dispatch:i,editor:o})=>{if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const c=S=>{o.emit("contentError",{editor:o,error:S,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Rf(e,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(S){c(S)}try{var r;a=Rf(e,o.schema,{parseOptions:d,errorOnInvalidContent:(r=n.errorOnInvalidContent)!==null&&r!==void 0?r:o.options.enableContentCheck})}catch(S){return c(S),!1}let{from:f,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,g=!0;const y=GF(a)?a.content:[a];if(y.forEach(S=>{S.check(),m=m?S.isText&&S.marks.length===0:!1,g=g?S.isBlock:!1}),f===p&&g){const{parent:S}=s.doc.resolve(f);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(f-=1,p+=1)}let v;if(m)Array.isArray(e)?v=e.map(S=>S.text||"").join(""):WF(e)?v=y.map(S=>{var w;return(w=S.text)!==null&&w!==void 0?w:""}).join(""):typeof e=="object"&&e&&e.text?v=e.text:v=e,s.insertText(v,f,p);else{v=je.from(y);const S=s.doc.resolve(f),w=S.node(),N=S.parentOffset===0,C=w.isText||w.isTextblock,T=w.content.size>0;N&&C&&T&&g&&(f=Math.max(0,f-1)),s.replaceWith(f,p,y)}n.updateSelection&&KF(s,s.steps.length-1,-1),n.applyInputRules&&s.setMeta("applyInputRules",{from:f,text:v}),n.applyPasteRules&&s.setMeta("applyPasteRules",{from:f,text:v})}return!0};function YF(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const GNe=(t={})=>({tr:e,dispatch:n,editor:s})=>{const{pos:i,attrs:o,content:r,updateSelection:a=!0}=t;let c;typeof i=="number"?c=e.doc.resolve(i):i?c=i:c=e.selection.$from;const d=YF(c.parent.contentMatchAt(c.index()));if(!d)return!1;const f=Object.keys(d.spec.attrs||{}),p=o?Object.fromEntries(Object.entries(o).filter(([g])=>f.includes(g))):{};let m;if(r){const g=Rf(r,s.schema);m=d.createAndFill(p,g)}else m=d.createAndFill(p);return m?(n&&(e.insert(c.pos,m),a&&KF(e,e.steps.length-1,-1)),!0):!1},KNe=()=>({state:t,dispatch:e})=>rCe(t,e),YNe=()=>({state:t,dispatch:e})=>lCe(t,e),XNe=()=>({state:t,dispatch:e})=>q$(t,e),QNe=()=>({state:t,dispatch:e})=>Y$(t,e),XF=(t,e)=>{const n=t.resolve(e),s=n.nodeBefore,i=n.nodeAfter;return!s||!i?!1:!s.type.spec.isolating&&!i.type.spec.isolating},ZNe=()=>({state:t,dispatch:e,tr:n})=>{try{const s=Fb(t.doc,t.selection.$from.pos,-1);return s==null||!XF(t.doc,s)?!1:(n.join(s,2),e&&e(n),!0)}catch{return!1}},JNe=()=>({state:t,dispatch:e,tr:n})=>{try{const s=Fb(t.doc,t.selection.$from.pos,1);return s==null||!XF(t.doc,s)?!1:(n.join(s,2),e&&e(n),!0)}catch{return!1}},e4e=()=>({state:t,dispatch:e})=>iCe(t,e),t4e=()=>({state:t,dispatch:e})=>oCe(t,e);function QF(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function n4e(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let s,i,o,r;for(let a=0;a<e.length-1;a+=1){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))r=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))rm()||QF()?r=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return s&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),r&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const s4e=t=>({editor:e,view:n,tr:s,dispatch:i})=>{const o=n4e(t).split(/-(?!$)/),r=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:r==="Space"?" ":r,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return c==null||c.steps.forEach(d=>{const f=d.map(s.mapping);f&&i&&s.maybeStep(f)}),!0};function lm(t,e,n={}){const{from:s,to:i,empty:o}=t.selection,r=e?ws(e,t.schema):null,a=[];t.doc.nodesBetween(s,i,(f,p)=>{if(f.isText)return;const m=Math.max(s,p),g=Math.min(i,p+f.nodeSize);a.push({node:f,from:m,to:g})});const c=i-s,d=a.filter(f=>r?r.name===f.node.type.name:!0).filter(f=>Ly(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,p)=>f+p.to-p.from,0)>=c}const i4e=(t,e={})=>({state:n,dispatch:s})=>lm(n,ws(t,n.schema),e)?aCe(n,s):!1,o4e=()=>({state:t,dispatch:e})=>J$(t,e),r4e=t=>({state:e,dispatch:n})=>{const s=ws(t,e.schema);return vCe(s)(e,n)},l4e=()=>({state:t,dispatch:e})=>Q$(t,e);function Kb(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function JL(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((s,i)=>(n.includes(i)||(s[i]=t[i]),s),{})}const a4e=(t,e)=>({tr:n,state:s,dispatch:i})=>{let o=null,r=null;const a=Kb(typeof t=="string"?t:t.name,s.schema);if(!a)return!1;a==="node"&&(o=ws(t,s.schema)),a==="mark"&&(r=wl(t,s.schema));let c=!1;return n.selection.ranges.forEach(d=>{s.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,p)=>{o&&o===f.type&&(c=!0,i&&n.setNodeMarkup(p,void 0,JL(f.attrs,e))),r&&f.marks.length&&f.marks.forEach(m=>{r===m.type&&(c=!0,i&&n.addMark(p,p+f.nodeSize,r.create(JL(m.attrs,e))))})})}),c},c4e=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),u4e=()=>({tr:t,dispatch:e})=>{if(e){const n=new Fi(t.doc);t.setSelection(n)}return!0},d4e=()=>({state:t,dispatch:e})=>G$(t,e),f4e=()=>({state:t,dispatch:e})=>X$(t,e),h4e=()=>({state:t,dispatch:e})=>fCe(t,e),p4e=()=>({state:t,dispatch:e})=>mCe(t,e),m4e=()=>({state:t,dispatch:e})=>pCe(t,e);function QE(t,e,n={},s={}){return Rf(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:s.errorOnInvalidContent})}const g4e=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:s={}}={})=>({editor:i,tr:o,dispatch:r,commands:a})=>{const{doc:c}=o;if(s.preserveWhitespace!=="full"){const d=QE(t,i.schema,s,{errorOnInvalidContent:e??i.options.enableContentCheck});if(r){const f=GF(d)?d.content:[d];o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!n)}return!0}return r&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:s,errorOnInvalidContent:e??i.options.enableContentCheck})};function ZF(t,e){const n=wl(e,t.schema),{from:s,to:i,empty:o}=t.selection,r=[];o?(t.storedMarks&&r.push(...t.storedMarks),r.push(...t.selection.$head.marks())):t.doc.nodesBetween(s,i,c=>{r.push(...c.marks)});const a=r.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function y4e(t,e){const n=new $$(t);return e.forEach(s=>{s.steps.forEach(i=>{n.step(i)})}),n}function M_e(t,e){const n=[];return t.descendants((s,i)=>{e(s)&&n.push({node:s,pos:i})}),n}function L_e(t,e,n){const s=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&s.push({node:i,pos:o})}),s}function b4e(t,e){for(let n=t.depth;n>0;n-=1){const s=t.node(n);if(e(s))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:s}}}function Yb(t){return e=>b4e(e.$from,t)}function tt(t,e,n){return t.config[e]===void 0&&t.parent?tt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?tt(t.parent,e,n):null}):t.config[e]}function VN(t){return t.map(e=>{const n=tt(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...VN(n())]:e}).flat(10)}function qN(t,e){const n=Mu.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function ZE(t){return typeof t=="function"}function mn(t,e=void 0,...n){return ZE(t)?e?t.bind(e)(...n):t(...n):t}function x4e(t={}){return Object.keys(t).length===0&&t.constructor===Object}function kf(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function JF(t){const e=[],{nodeExtensions:n,markExtensions:s}=kf(t),i=[...n,...s],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},r=n.filter(d=>d.name!=="text").map(d=>d.name),a=s.map(d=>d.name),c=[...r,...a];return t.forEach(d=>{const f=tt(d,"addGlobalAttributes",{name:d.name,options:d.options,storage:d.storage,extensions:i});f&&f().forEach(p=>{let m;Array.isArray(p.types)?m=p.types:p.types==="*"?m=c:p.types==="nodes"?m=r:p.types==="marks"?m=a:m=[],m.forEach(g=>{Object.entries(p.attributes).forEach(([y,v])=>{e.push({type:g,name:y,attribute:{...o,...v}})})})})}),i.forEach(d=>{const f=tt(d,"addAttributes",{name:d.name,options:d.options,storage:d.storage});if(!f)return;const p=f();Object.entries(p).forEach(([m,g])=>{const y={...o,...g};typeof(y==null?void 0:y.default)=="function"&&(y.default=y.default()),y!=null&&y.isRequired&&(y==null?void 0:y.default)===void 0&&delete y.default,e.push({type:d.name,name:m,attribute:y})})}),e}function v4e(t){const e=[];let n="",s=!1,i=!1,o=0;const r=t.length;for(let a=0;a<r;a+=1){const c=t[a];if(c==="'"&&!i){s=!s,n+=c;continue}if(c==='"'&&!s){i=!i,n+=c;continue}if(!s&&!i){if(c==="("){o+=1,n+=c;continue}if(c===")"&&o>0){o-=1,n+=c;continue}if(c===";"&&o===0){e.push(n),n="";continue}}n+=c}return n&&e.push(n),e}function eI(t){const e=[],n=v4e(t||""),s=n.length;for(let i=0;i<s;i+=1){const o=n[i],r=o.indexOf(":");if(r===-1)continue;const a=o.slice(0,r).trim(),c=o.slice(r+1).trim();a&&c&&e.push([a,c])}return e}function S4e(...t){return t.filter(e=>!!e).reduce((e,n)=>{const s={...e};return Object.entries(n).forEach(([i,o])=>{if(i==="__proto__"){Object.defineProperty(s,i,{configurable:!0,enumerable:!0,value:o,writable:!0});return}if(!s[i]){s[i]=o;return}if(i==="class"){const r=o?String(o).split(" "):[],a=s[i]?s[i].split(" "):[],c=r.filter(d=>!a.includes(d));s[i]=[...a,...c].join(" ")}else if(i==="style"){const r=new Map([...eI(s[i]),...eI(o)]);s[i]=Array.from(r.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else s[i]=o}),s},{})}function Iy(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,s)=>S4e(n,s),{})}function w4e(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function tI(t,e){return"style"in t?t:{...t,getAttrs:n=>{const s=t.getAttrs?t.getAttrs(n):t.attrs;if(s===!1)return!1;const i=e.reduce((o,r)=>{const a=r.attribute.parseHTML?r.attribute.parseHTML(n):w4e(n.getAttribute(r.name));return a==null?o:{...o,[r.name]:a}},{});return{...s,...i}}}}function nI(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&x4e(n)?!1:n!=null))}function sI(t){var e,n;const s={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(s.default=t.attribute.default),(t==null||(n=t.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(s.validate=t.attribute.validate),[t.name,s]}function eH(t,e){var n;const s=JF(t),{nodeExtensions:i,markExtensions:o}=kf(t),r=(n=i.find(d=>tt(d,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(d=>{const f=s.filter(S=>S.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},m=nI({...t.reduce((S,w)=>{const N=tt(w,"extendNodeSchema",p);return{...S,...N?N(d):{}}},{}),content:mn(tt(d,"content",p)),marks:mn(tt(d,"marks",p)),group:mn(tt(d,"group",p)),inline:mn(tt(d,"inline",p)),atom:mn(tt(d,"atom",p)),selectable:mn(tt(d,"selectable",p)),draggable:mn(tt(d,"draggable",p)),code:mn(tt(d,"code",p)),whitespace:mn(tt(d,"whitespace",p)),linebreakReplacement:mn(tt(d,"linebreakReplacement",p)),defining:mn(tt(d,"defining",p)),isolating:mn(tt(d,"isolating",p)),attrs:Object.fromEntries(f.map(sI))}),g=mn(tt(d,"parseHTML",p));g&&(m.parseDOM=g.map(S=>tI(S,f)));const y=tt(d,"renderHTML",p);y&&(m.toDOM=S=>y({node:S,HTMLAttributes:Iy(S,f)}));const v=tt(d,"renderText",p);return v&&(m.toText=v),[d.name,m]})),c=Object.fromEntries(o.map(d=>{const f=s.filter(v=>v.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},m=nI({...t.reduce((v,S)=>{const w=tt(S,"extendMarkSchema",p);return{...v,...w?w(d):{}}},{}),inclusive:mn(tt(d,"inclusive",p)),excludes:mn(tt(d,"excludes",p)),group:mn(tt(d,"group",p)),spanning:mn(tt(d,"spanning",p)),code:mn(tt(d,"code",p)),attrs:Object.fromEntries(f.map(sI))}),g=mn(tt(d,"parseHTML",p));g&&(m.parseDOM=g.map(v=>tI(v,f)));const y=tt(d,"renderHTML",p);return y&&(m.toDOM=v=>y({mark:v,HTMLAttributes:Iy(v,f)})),[d.name,m]}));return new N$({topNode:r,nodes:a,marks:c})}function E4e(t){const e=t.filter((n,s)=>t.indexOf(n)!==s);return Array.from(new Set(e))}function Ep(t){return t.sort((n,s)=>{const i=tt(n,"priority")||100,o=tt(s,"priority")||100;return i>o?-1:i<o?1:0})}function WN(t){const e=Ep(VN(t)),n=E4e(e.map(s=>s.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),e}function C4e(t,e){return eH(WN(t),e)}function I_e(t,e){const n=C4e(e),s=ap(t);return rl.fromSchema(n).parse(s).toJSON()}function tH(t,e,n){const{from:s,to:i}=e,{blockSeparator:o=`
375
+
376
+ `,textSerializers:r={}}=n||{};let a="";return t.nodesBetween(s,i,(c,d,f,p)=>{c.isBlock&&d>s&&(a+=o);const m=r==null?void 0:r[c.type.name];if(m)return f&&(a+=m({node:c,pos:d,parent:f,index:p,range:e})),!1;if(c.isText){var g;a+=c==null||(g=c.text)===null||g===void 0?void 0:g.slice(Math.max(s,d)-d,i-d)}}),a}function N4e(t,e){return tH(t,{from:0,to:t.content.size},e)}function nH(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function T4e(t,e){const n=ws(e,t.schema),{from:s,to:i}=t.selection,o=[];t.doc.nodesBetween(s,i,a=>{o.push(a)});const r=o.reverse().find(a=>a.type.name===n.name);return r?{...r.attrs}:{}}function O4e(t,e){const n=Kb(typeof e=="string"?e:e.name,t.schema);return n==="node"?T4e(t,e):n==="mark"?ZF(t,e):{}}function R4e(t,e=JSON.stringify){const n={};return t.filter(s=>{const i=e(s);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function k4e(t){const e=R4e(t);return e.length===1?e:e.filter((n,s)=>!e.filter((i,o)=>o!==s).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function sH(t){const{mapping:e,steps:n}=t,s=[];return e.maps.forEach((i,o)=>{const r=[];if(i.ranges.length)i.forEach((a,c)=>{r.push({from:a,to:c})});else{const{from:a,to:c}=n[o];if(a===void 0||c===void 0)return;r.push({from:a,to:c})}r.forEach(({from:a,to:c})=>{const d=e.slice(o).map(a,-1),f=e.slice(o).map(c),p=e.invert().map(d,-1),m=e.invert().map(f);s.push({oldRange:{from:p,to:m},newRange:{from:d,to:f}})})}),k4e(s)}function iH(t,e,n){const s=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=UN(n.resolve(t),i.type);o&&s.push({mark:i,...o})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||s.push(...i.marks.map(r=>({from:o,to:o+i.nodeSize,mark:r})))}),s}const D_e=(t,e,n,s=20)=>{const i=t.doc.resolve(n);let o=s,r=null;for(;o>0&&r===null;){const a=i.node(o);(a==null?void 0:a.type.name)===e?r=a:o-=1}return[r,o]},j_e=t=>{const e=t.depth-1;if(e<0)return null;const n=t.index(e);return n===0?null:t.node(e).child(n-1)};function Cd(t,e){return e.nodes[t]||e.marks[t]||null}function L1(t,e,n){return Object.fromEntries(Object.entries(n).filter(([s])=>{const i=t.find(o=>o.type===e&&o.name===s);return i?i.attribute.keepOnSplit:!1}))}const A4e=(t,e=500)=>{let n="";const s=t.parentOffset;return t.parent.nodesBetween(Math.max(0,s-e),s,(i,o,r,a)=>{var c,d;const f=((c=(d=i.type.spec).toText)===null||c===void 0?void 0:c.call(d,{node:i,pos:o,parent:r,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,s-o))}),n};function JE(t,e,n={}){const{empty:s,ranges:i}=t.selection,o=e?wl(e,t.schema):null;if(s)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ly(f.attrs,n,{strict:!1}));let r=0;const a=[];if(i.forEach(({$from:f,$to:p})=>{const m=f.pos,g=p.pos;t.doc.nodesBetween(m,g,(y,v)=>{if(o&&y.inlineContent&&!y.type.allowsMarkType(o))return!1;if(!y.isText&&!y.marks.length)return;const S=Math.max(m,v),w=Math.min(g,v+y.nodeSize),N=w-S;r+=N,a.push(...y.marks.map(C=>({mark:C,from:S,to:w})))})}),r===0)return!1;const c=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ly(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(c>0?c+d:c)>=r}function _4e(t,e,n={}){if(!e)return lm(t,null,n)||JE(t,null,n);const s=Kb(e,t.schema);return s==="node"?lm(t,e,n):s==="mark"?JE(t,e,n):!1}const P_e=(t,e)=>{const{$from:n,$to:s,$anchor:i}=t.selection;if(e){const o=Yb(a=>a.type.name===e)(t.selection);if(!o)return!1;const r=t.doc.resolve(o.pos+1);return i.pos+1===r.end()}return!(s.parentOffset<s.parent.nodeSize-2||n.pos!==s.pos)},z_e=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function iI(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function PS(t,e){const{nodeExtensions:n}=kf(e),s=n.find(o=>o.name===t);if(!s)return!1;const i=mn(tt(s,"group",{name:s.name,options:s.options,storage:s.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function GN(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name==="hardBreak")return!0;if(t.isText){var s;return!/\S/.test((s=t.text)!==null&&s!==void 0?s:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(GN(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function B_e(t){return t instanceof ut}var oH=class rH{constructor(e){this.position=e}static fromJSON(e){return new rH(e.position)}toJSON(){return{position:this.position}}};function M4e(t,e){const n=e.mapping.mapResult(t.position);return{position:new oH(n.pos),mapResult:n}}function L4e(t){return new oH(t)}function I4e(t,e,n){const{selection:s}=e;let i=null;if(VF(s)&&(i=s.$cursor),i){var o;const a=(o=t.storedMarks)!==null&&o!==void 0?o:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(c=>c.type.excludes(n)))}const{ranges:r}=s;return r.some(({$from:a,$to:c})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,c.pos,(f,p,m)=>{if(d)return!1;if(f.isInline){const g=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(v=>v.type.excludes(n));d=g&&y}return!d}),d})}const D4e=(t,e={})=>({tr:n,state:s,dispatch:i})=>{const{selection:o}=n,{empty:r,ranges:a}=o,c=wl(t,s.schema);if(i)if(r){const d=ZF(s,c);n.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;s.doc.nodesBetween(f,p,(m,g)=>{const y=Math.max(g,f),v=Math.min(g+m.nodeSize,p);m.marks.find(S=>S.type===c)?m.marks.forEach(S=>{c===S.type&&n.addMark(y,v,c.create({...S.attrs,...e}))}):n.addMark(y,v,c.create(e))})});return I4e(s,n,c)},j4e=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),P4e=(t,e={})=>({state:n,dispatch:s,chain:i})=>{const o=ws(t,n.schema);let r;return n.selection.$anchor.sameParent(n.selection.$head)&&(r=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>bL(o,{...r,...e})(n)?!0:a.clearNodes()).command(({state:a})=>bL(o,{...r,...e})(a,s)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},z4e=t=>({tr:e,dispatch:n})=>{if(n){const{doc:s}=e,i=Uc(t,0,s.content.size),o=ut.create(s,i);e.setSelection(o)}return!0},B4e=(t,e)=>({tr:n,state:s,dispatch:i})=>{const{selection:o}=s;let r,a;return typeof e=="number"?(r=e,a=e):e&&"from"in e&&"to"in e?(r=e.from,a=e.to):(r=o.from,a=o.to),i&&n.doc.nodesBetween(r,a,(c,d)=>{c.isText||n.setNodeMarkup(d,void 0,{...c.attrs,dir:t})}),!0},$4e=t=>({tr:e,dispatch:n})=>{if(n){const{doc:s}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,r=Et.atStart(s).from,a=Et.atEnd(s).to,c=Uc(i,r,a),d=Uc(o,r,a),f=Et.create(s,c,d);e.setSelection(f)}return!0},F4e=t=>({state:e,dispatch:n})=>{const s=ws(t,e.schema);return ECe(s)(e,n)};function oI(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const s=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(s)}}const H4e=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:s,editor:i})=>{const{selection:o,doc:r}=e,{$from:a,$to:c}=o,d=i.extensionManager.attributes,f=L1(d,a.node().type.name,a.node().attrs);if(o instanceof ut&&o.node.isBlock)return!a.parentOffset||!ll(r,a.pos)?!1:(s&&(t&&oI(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,m=a.depth===0?void 0:YF(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0;const y=o instanceof Et&&!o.empty?Xr.create({doc:e.doc,selection:o}).tr.deleteSelection():null,v=y?y.doc:e.doc,S=y?y.mapping.map(a.pos):a.pos;let w=ll(v,S,1,g);if(!g&&!w&&ll(v,S,1,m?[{type:m}]:void 0)&&(w=!0,g=m?[{type:m,attrs:f}]:void 0),s){if(w){const N=e.steps.length;if(o instanceof Et&&e.deleteSelection(),e.split(e.mapping.slice(N).map(a.pos),1,g),m&&!p&&!a.parentOffset&&a.parent.type!==m){const C=e.mapping.slice(N).map(a.before()),T=e.doc.resolve(C);a.node(-1).canReplaceWith(T.index(),T.index()+1,m)&&e.setNodeMarkup(e.mapping.slice(N).map(a.before()),m)}}t&&oI(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return w},U4e=(t,e={})=>({tr:n,state:s,dispatch:i,editor:o})=>{const r=ws(t,s.schema),{$from:a,$to:c}=s.selection,d=s.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(c))return!1;const f=a.node(-1);if(f.type!==r)return!1;const p=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==r||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){var m;let T=je.empty;const R=a.index(-1)?1:a.index(-2)?2:3;for(let D=a.depth-R;D>=a.depth-3;D-=1)T=je.from(a.node(D).copy(T));const A=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k={...L1(p,a.node().type.name,a.node().attrs),...e},M=((m=r.contentMatch.defaultType)===null||m===void 0?void 0:m.createAndFill(k))||void 0;T=T.append(je.from(r.createAndFill(null,M)||void 0));const L=a.before(a.depth-(R-1));n.replace(L,a.after(-A),new Ke(T,4-R,0));let j=-1;n.doc.nodesBetween(L,n.doc.content.size,(D,P)=>{if(j>-1)return!1;D.isTextblock&&D.content.size===0&&(j=P+1)}),j>-1&&n.setSelection(Et.near(n.doc.resolve(j))),n.scrollIntoView()}return!0}const g=c.pos===a.end()?f.contentMatchAt(0).defaultType:null,y={...L1(p,f.type.name,f.attrs),...e},v={...L1(p,a.node().type.name,a.node().attrs),...e},S=a.parentOffset===0&&a.index(-1)===0,w=a.before(-1);n.delete(a.pos,c.pos);const N=S?f.attrs:y,C=g?[{type:r,attrs:N},{type:g,attrs:v}]:[{type:r,attrs:N}];if(!ll(n.doc,a.pos,2))return!1;if(i){const{selection:T,storedMarks:R}=s,{splittableMarks:A}=o.extensionManager,k=R||T.$to.parentOffset&&T.$from.marks();if(n.split(a.pos,2,C).scrollIntoView(),S&&n.setNodeMarkup(w,void 0,y),!k||!i)return!0;const M=k.filter(L=>A.includes(L.type.name));n.ensureMarks(M)}return!0};function rI(t){return!t||t==="1"?null:t}function lH(t,e){return rI(t)===rI(e)}const zS=(t,e)=>{const n=Yb(o=>o.type===e)(t.selection);if(!n)return!0;const s=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(s===void 0)return!0;const i=t.doc.nodeAt(s);return!(n.node.type===(i==null?void 0:i.type)&&tc(t.doc,n.pos))||!lH(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n.pos),!0},BS=(t,e)=>{const n=Yb(o=>o.type===e)(t.selection);if(!n)return!0;const s=t.doc.resolve(n.start).after(n.depth);if(s===void 0)return!0;const i=t.doc.nodeAt(s);return!(n.node.type===(i==null?void 0:i.type)&&tc(t.doc,s))||!lH(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(s),!0};function V4e(t){const e=t.doc,n=e.firstChild;if(!n)return null;const s=e.resolve(1),i=e.resolve(n.nodeSize-1);return Et.between(s,i)}const q4e=(t,e,n,s={})=>({editor:i,tr:o,state:r,dispatch:a,chain:c,commands:d,can:f})=>{const{extensions:p,splittableMarks:m}=i.extensionManager,g=ws(t,r.schema),y=ws(e,r.schema),{selection:v,storedMarks:S}=r,{$from:w,$to:N}=v,C=w.blockRange(N),T=S||v.$to.parentOffset&&v.$from.marks();if(!C)return!1;const R=Yb(B=>PS(B.type.name,p))(v),A=v.from===0&&v.to===r.doc.content.size,k=r.doc.content.content,M=k.length===1?k[0]:null,L=A&&M&&PS(M.type.name,p)?{node:M,pos:0}:null,j=R??L,D=!!R&&C.depth>=1&&C.depth-R.depth<=1,P=!!L;if((D||P)&&j){if(j.node.type===g)return A&&P?c().command(({tr:B,dispatch:I})=>{const F=V4e(B);return F?(B.setSelection(F),I&&I(B),!0):!1}).liftListItem(y).run():d.liftListItem(y);if(PS(j.node.type.name,p)&&g.validContent(j.node.content))return c().command(()=>(o.setNodeMarkup(j.pos,g),!0)).command(()=>zS(o,g)).command(()=>BS(o,g)).run()}return!n||!T||!a?c().command(()=>f().wrapInList(g,s)?!0:d.clearNodes()).wrapInList(g,s).command(()=>zS(o,g)).command(()=>BS(o,g)).run():c().command(()=>{const B=f().wrapInList(g,s),I=T.filter(F=>m.includes(F.type.name));return o.ensureMarks(I),B?!0:d.clearNodes()}).wrapInList(g,s).command(()=>zS(o,g)).command(()=>BS(o,g)).run()},W4e=(t,e={},n={})=>({state:s,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,r=wl(t,s.schema);return JE(s,r,e)?i.unsetMark(r,{extendEmptyMarkRange:o}):i.setMark(r,e)},G4e=(t,e,n={})=>({state:s,commands:i})=>{const o=ws(t,s.schema),r=ws(e,s.schema),a=lm(s,o,n);let c;return s.selection.$anchor.sameParent(s.selection.$head)&&(c=s.selection.$anchor.parent.attrs),a?i.setNode(r,c):i.setNode(o,{...c,...n})},K4e=(t,e={})=>({state:n,commands:s})=>{const i=ws(t,n.schema);return lm(n,i,e)?s.lift(i):s.wrapIn(i,e)},Y4e=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let s=0;s<n.length;s+=1){const i=n[s];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const r=t.tr,a=o.transform;for(let c=a.steps.length-1;c>=0;c-=1)r.step(a.steps[c].invert(a.docs[c]));if(o.text){const c=r.doc.resolve(o.from).marks();r.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else r.delete(o.from,o.to)}return!0}}return!1},X4e=(t={})=>({tr:e,dispatch:n,editor:s})=>{const{ignoreClearable:i=!1}=t,{selection:o}=e,{empty:r,ranges:a}=o;if(r)return!0;const{nonClearableMarks:c}=s.extensionManager;if(n){const d=Object.values(s.schema.marks).filter(f=>i||!c.includes(f.name));a.forEach(f=>{for(const p of d)e.removeMark(f.$from.pos,f.$to.pos,p)})}return!0},Q4e=(t,e={})=>({tr:n,state:s,dispatch:i})=>{const{extendEmptyMarkRange:o=!1}=e,{selection:r}=n,a=wl(t,s.schema),{$from:c,empty:d,ranges:f}=r;if(!i)return!0;if(d&&o){var p;let{from:m,to:g}=r;const y=UN(c,a,(p=c.marks().find(v=>v.type===a))===null||p===void 0?void 0:p.attrs);y&&(m=y.from,g=y.to),n.removeMark(m,g,a)}else f.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,a)});return n.removeStoredMark(a),!0},Z4e=t=>({tr:e,state:n,dispatch:s})=>{const{selection:i}=n;let o,r;return typeof t=="number"?(o=t,r=t):t&&"from"in t&&"to"in t?(o=t.from,r=t.to):(o=i.from,r=i.to),s&&e.doc.nodesBetween(o,r,(a,c)=>{if(a.isText)return;const d={...a.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},J4e=(t,e={})=>({tr:n,state:s,dispatch:i})=>{let o=null,r=null;const a=Kb(typeof t=="string"?t:t.name,s.schema);if(!a)return!1;a==="node"&&(o=ws(t,s.schema)),a==="mark"&&(r=wl(t,s.schema));let c=!1;return n.selection.ranges.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;let m,g,y,v;n.selection.empty?s.doc.nodesBetween(f,p,(S,w)=>{o&&o===S.type&&(c=!0,y=Math.max(w,f),v=Math.min(w+S.nodeSize,p),m=w,g=S)}):s.doc.nodesBetween(f,p,(S,w)=>{w<f&&o&&o===S.type&&(c=!0,y=Math.max(w,f),v=Math.min(w+S.nodeSize,p),m=w,g=S),w>=f&&w<=p&&(o&&o===S.type&&(c=!0,i&&n.setNodeMarkup(w,void 0,{...S.attrs,...e})),r&&S.marks.length&&S.marks.forEach(N=>{if(r===N.type&&(c=!0,i)){const C=Math.max(w,f),T=Math.min(w+S.nodeSize,p);n.addMark(C,T,r.create({...N.attrs,...e}))}}))}),g&&(m!==void 0&&i&&n.setNodeMarkup(m,void 0,{...g.attrs,...e}),r&&g.marks.length&&g.marks.forEach(S=>{r===S.type&&i&&n.addMark(y,v,r.create({...S.attrs,...e}))}))}),c},Ad=new Po("__tiptap_decorations__"),eTe=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(Ad,{type:"force",name:t}),!0),tTe=(t,e={})=>({state:n,dispatch:s})=>{const i=ws(t,n.schema);return gCe(i,e)(n,s)},nTe=(t,e={})=>({state:n,dispatch:s})=>{const i=ws(t,n.schema);return yCe(i,e)(n,s)};var sTe=lEe({blur:()=>TNe,clearContent:()=>ONe,clearNodes:()=>RNe,command:()=>kNe,createParagraphNear:()=>ANe,cut:()=>_Ne,deleteCurrentNode:()=>MNe,deleteNode:()=>LNe,deleteRange:()=>INe,deleteSelection:()=>PNe,enter:()=>zNe,exitCode:()=>BNe,extendMarkRange:()=>$Ne,first:()=>FNe,focus:()=>UNe,forEach:()=>VNe,insertContent:()=>qNe,insertContentAt:()=>WNe,insertDefaultBlock:()=>GNe,joinBackward:()=>XNe,joinDown:()=>YNe,joinForward:()=>QNe,joinItemBackward:()=>ZNe,joinItemForward:()=>JNe,joinTextblockBackward:()=>e4e,joinTextblockForward:()=>t4e,joinUp:()=>KNe,keyboardShortcut:()=>s4e,lift:()=>i4e,liftEmptyBlock:()=>o4e,liftListItem:()=>r4e,newlineInCode:()=>l4e,resetAttributes:()=>a4e,scrollIntoView:()=>c4e,selectAll:()=>u4e,selectNodeBackward:()=>d4e,selectNodeForward:()=>f4e,selectParentNode:()=>h4e,selectTextblockEnd:()=>p4e,selectTextblockStart:()=>m4e,setContent:()=>g4e,setMark:()=>D4e,setMeta:()=>j4e,setNode:()=>P4e,setNodeSelection:()=>z4e,setTextDirection:()=>B4e,setTextSelection:()=>$4e,sinkListItem:()=>F4e,splitBlock:()=>H4e,splitListItem:()=>U4e,toggleList:()=>q4e,toggleMark:()=>W4e,toggleNode:()=>G4e,toggleWrap:()=>K4e,undoInputRule:()=>Y4e,unsetAllMarks:()=>X4e,unsetMark:()=>Q4e,unsetTextDirection:()=>Z4e,updateAttributes:()=>J4e,updateDecorations:()=>eTe,wrapIn:()=>tTe,wrapInList:()=>nTe});const Kh=new WeakMap;function iTe(t,e){var n;Kh.set(t,((n=Kh.get(t))!==null&&n!==void 0?n:0)+1);try{return e()}finally{var s;const i=((s=Kh.get(t))!==null&&s!==void 0?s:1)-1;i>0?Kh.set(t,i):Kh.delete(t)}}var oTe=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(s=>s.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(s=>s!==e):delete this.callbacks[t]),this}once(t,e){const n=(...s)=>{this.off(t,n),e.apply(this,s)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function rTe(t){return t.kind==="widget"}function aH(t,e){const n=[],s=new Set;for(const i of t)i.kind==="widget"&&rTe(i)&&s.add(i.key),n.push(i.toPMDecoration(e));return{decorations:n,widgetKeys:s}}function lTe(t,e,n){const{decorations:s,widgetKeys:i}=aH(e,n);return{set:Hn.create(t,s),widgetKeys:i}}function cH({position:t,from:e,to:n,docSize:s}){return t<e?!1:t<n?!0:t===n&&n===s}function aTe({decorations:t,from:e,to:n,docSize:s,extensionName:i,warnedExtensions:o}){return t.filter(r=>cH({position:r.anchor,from:e,to:n,docSize:s})?!0:(r.anchor===n||o.has(i)||(o.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function cTe(t){var e;const n=(e=t.spec)===null||e===void 0?void 0:e.key;return typeof n=="string"?n:void 0}function uH(t){return t.jsonID==="attr"}function uTe(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||uH(t))return!0;const n=t;return typeof n.from=="number"&&typeof n.to=="number"}function dTe(t,e){let n=null,s=0,i=0;for(let o=0;o<t.childCount&&!(i>e.to);o+=1){const r=i+t.child(o).nodeSize;r>=e.from&&(n===null&&(n=i),s=r),i=r}return n===null?null:{from:n,to:s}}function fTe(t,e){if(t.steps.some(o=>!uTe(o)))return{type:"full"};const n=sH(t).map(({newRange:o})=>o);t.steps.forEach((o,r)=>{if(!uH(o))return;const a=t.mapping.slice(r);n.push({from:a.map(o.pos,-1),to:a.map(o.pos+1)})});const s=[];for(const o of n){const r=dTe(e,o);r&&s.push(r)}s.sort((o,r)=>o.from-r.from);const i=[];for(const o of s){const r=i[i.length-1];r&&o.from<=r.to?r.to=Math.max(r.to,o.to):i.push({...o})}return{type:"ranges",ranges:i}}function dH(t,e,n,s){return t.map(e,n,{onRemove:i=>{const o=i==null?void 0:i.key;typeof o=="string"&&s.delete(o)}})}function hTe(t,e,n){var s,i;const o=(s=e.decorationSetsByExtension[t])!==null&&s!==void 0?s:Hn.empty,r=new Set((i=e.widgetKeysByExtension[t])!==null&&i!==void 0?i:[]);return{set:dH(o,n.mapping,n.doc,r),widgetKeys:r}}function lI(t,e){const n=Object.values(e).flatMap(s=>s.find());return Hn.create(t,n)}function aI(t){const e=new Set;for(const n of Object.values(t))for(const s of n)e.add(s);return e}function pTe(t,e){var n;switch((n=e.update)!==null&&n!==void 0?n:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${t}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${t}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function mTe(t,e,n){return n?!0:t.update==="manual"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}const gTe=new Set;var yTe=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const n=Ad.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>pTe(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var t,e;return(t=(e=Ad.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&t!==void 0?t:gTe}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){const e=[];for(const{name:n,addDecorations:s}of t){const i=s();i&&e.push({name:n,spec:i})}return e}createPlugin(){const{editor:t,entries:e}=this;return new Gi({key:Ad,state:{init:(n,s)=>{const i={},o={};for(const{name:a,spec:c}of e){const{set:d,widgetKeys:f}=this.buildFullSet(a,c,s);i[a]=d,o[a]=f}const r={decorationSetsByExtension:i,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(s.doc,i),widgetKeys:aI(o)};return this.warnDuplicateWidgetKeys(r),r},apply:(n,s,i,o)=>{const r=n.getMeta(Ad),a=(r==null?void 0:r.type)==="force"&&!r.name,c=(r==null?void 0:r.type)==="force"?r.name:void 0,d={},f={},p=new Set;return iTe(t,()=>{for(const{name:m,spec:g}of e){const y=a||c===m;if(mTe(g,{editor:t,tr:n,oldState:i,newState:o},y))if(g.update==="changedRanges"&&n.docChanged&&!y){const v=this.applyChangedRangesRecompute(m,g,s,n,o);d[m]=v.set,f[m]=v.widgetKeys,p.add(m)}else{const{set:v,widgetKeys:S}=this.buildFullSet(m,g,o);d[m]=v,f[m]=S,p.add(m)}else{const v=hTe(m,s,n);d[m]=v.set,f[m]=v.widgetKeys}}}),p.size===0&&!n.docChanged?s:{decorationSetsByExtension:d,widgetKeysByExtension:f,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:s,tr:n,decorationSetsByExtension:d,recomputedNames:p}),widgetKeys:aI(f)}}},props:{decorations(n){var s,i;return(s=(i=Ad.getState(n))===null||i===void 0?void 0:i.mergedDecorationSet)!==null&&s!==void 0?s:Hn.empty}}})}applyChangedRangesRecompute(t,e,n,s,i){const o=fTe(s,i.doc);return o.type==="full"?this.buildFullSet(t,e,i):this.rebuildRanges(t,e,n,s,i,o.ranges)}rebuildRanges(t,e,n,s,i,o){var r,a;const c=(r=n.decorationSetsByExtension[t])!==null&&r!==void 0?r:Hn.empty,d=new Set((a=n.widgetKeysByExtension[t])!==null&&a!==void 0?a:[]);let f=dH(c,s.mapping,s.doc,d);const p=i.doc.content.size;for(const{from:m,to:g}of o){const y=f.find(m,g).filter(w=>cH({position:w.from,from:m,to:g,docSize:p}));for(const w of y){const N=cTe(w);N&&d.delete(N)}f=f.remove(y);const{decorations:v,widgetKeys:S}=aH(aTe({decorations:this.runCreate(t,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:m,to:g})),from:m,to:g,docSize:p,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);f=f.add(i.doc,v);for(const w of S)d.add(w)}return{set:f,widgetKeys:d}}buildFullSet(t,e,n){const s=this.runCreate(t,"create",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return lTe(n.doc,s,t)}runCreate(t,e,n){try{return n()}catch(s){return console.error(`[tiptap error]: Extension "${t}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,s),[]}}warnDuplicateWidgetKeys(t){}buildMergedSet(t,e){const n=Object.keys(e);return n.length===1?e[n[0]]:lI(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:s,recomputedNames:i}){return t.length===1?s[t[0].name]:i.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):lI(n.doc,s)}};function bTe(t,e){if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(i=>Object.prototype.hasOwnProperty.call(e,i)&&Object.is(t[i],e[i]))}function $_e(t,e){const{selection:n}=t,{$from:s}=n;if(n instanceof ut){const o=s.index();return s.parent.canReplaceWith(o,o+1,e)}let i=s.depth;for(;i>=0;){const o=s.index(i);if(s.node(i).contentMatchAt(o).matchType(e))return!0;i-=1}return!1}function xTe(t,e,n){const s=document.querySelector("style[data-tiptap-style]");if(s!==null)return s;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}const vTe={lt:"<",gt:">",quot:'"',amp:"&"};function F_e(t){return t.replace(/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(lt|gt|quot|amp));/g,(e,n,s,i)=>n!==void 0?cI(Number(n)):s!==void 0?cI(parseInt(s,16)):vTe[i])}const STe=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function cI(t){var e;return t===0||t>1114111||t>=55296&&t<=57343?"�":String.fromCodePoint((e=STe.get(t))!==null&&e!==void 0?e:t)}function H_e(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wTe(t){return typeof t=="number"}function ETe(t){return Object.prototype.toString.call(t).slice(8,-1)}function l1(t){return ETe(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function U_e(t,e,n){const s=t.split(`
377
+ `),i=[];let o="",r=0;const a=e.baseIndentSize||2;for(;r<s.length;){const f=s[r],p=f.match(e.itemPattern);if(!p){if(i.length>0)break;if(f.trim()===""){r+=1,o=`${o}${f}
378
+ `;continue}else return}const m=e.extractItemData(p),{indentLevel:g,mainContent:y}=m;o=`${o}${f}
379
+ `;const v=[y];for(r+=1;r<s.length;){var c;const C=s[r];if(C.trim()===""){var d;const T=s.slice(r+1).findIndex(R=>R.trim()!=="");if(T===-1)break;if((((d=s[r+1+T].match(/^(\s*)/))===null||d===void 0||(d=d[1])===null||d===void 0?void 0:d.length)||0)>g){v.push(C),o=`${o}${C}
380
+ `,r+=1;continue}else break}if((((c=C.match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>g)v.push(C),o=`${o}${C}
381
+ `,r+=1;else break}let S;const w=v.slice(1);if(w.length>0){const C=w.map(T=>T.slice(g+a)).join(`
382
+ `);C.trim()&&(e.customNestedParser?S=e.customNestedParser(C):S=n.blockTokens(C))}const N=e.createToken(m,S);i.push(N)}if(i.length!==0)return{items:i,raw:o}}const uI=4;function dI(t){let e=0;for(const n of t)e=n===" "?e+uI-e%uI:e+1;return e}function V_e(t,e,n,s,i){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(s):n,[r,...a]=t.content;let c=`${o}${e.renderChildren([r])}`;return a&&a.length>0&&a.forEach((d,f)=>{var p,m;const g=(p=(m=e.renderChild)===null||m===void 0?void 0:m.call(e,d,f+1))!==null&&p!==void 0?p:e.renderChildren([d]);if(g!=null){const y=S=>{if(!(i!=null&&i.alignNestedToPrefix))return e.indent(S);const w=e.indent(""),N=dI(o);return(dI(w)>=N?w:" ".repeat(N))+S},v=g.split(`
383
+ `).map(S=>y(S||"")).join(`
384
+ `);c+=d.type==="paragraph"?`
385
+
386
+ ${v}`:`
387
+ ${v}`}}),c}function fI(t){return typeof t.type=="string"?t.type:t.type.name}function q_e(t,e){if(t.length!==e.length)return!1;const n=Array.from({length:e.length},()=>!1);return t.every(s=>{const i=fI(s),o=e.findIndex((r,a)=>!n[a]&&i===fI(r)&&bTe(s.attrs,r.attrs));return o===-1?!1:(n[o]=!0,!0)})}function fH(t,e){const n={...t};return l1(t)&&l1(e)&&Object.keys(e).forEach(s=>{l1(e[s])&&l1(t[s])?n[s]=fH(t[s],e[s]):n[s]=e[s]}),n}function CTe(t,e,n={}){const{state:s}=e,{doc:i,tr:o}=s,r=t;i.descendants((a,c)=>{const d=o.mapping.map(c),f=o.mapping.map(c)+a.nodeSize;let p=null;if(a.marks.forEach(g=>{if(g!==r)return!1;p=g}),!p)return;let m=!1;if(Object.keys(n).forEach(g=>{n[g]!==p.attrs[g]&&(m=!0)}),m){const g=t.type.create({...t.attrs,...n});o.removeMark(d,f,t.type),o.addMark(d,f,g)}}),o.docChanged&&e.view.dispatch(o)}var Xb=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}};const NTe=(t,e)=>{if(HN(e))return e.exec(t);const n=e(t);if(!n)return null;const s=[n.text];return s.index=n.index,s.input=t,s.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),s.push(n.replaceWith)),s};function TTe(t){const{editor:e,from:n,to:s,text:i,insertText:o}=t;if(!o)return{inputTransaction:null,tr:e.view.state.tr};const r=e.view.state.tr.insertText(i,n,s);return{inputTransaction:r,tr:Xr.create({doc:r.doc,selection:r.selection,storedMarks:r.storedMarks}).tr}}function OTe(t){const{editor:e,from:n,to:s,text:i,rule:o,match:r,plugin:a,insertText:c}=t,{view:d}=e,{inputTransaction:f,tr:p}=TTe({editor:e,from:n,to:s,text:i,insertText:c}),m=f?n+i.length:s,g=Gb({state:d.state,transaction:p}),y={from:n-(r[0].length-i.length),to:m},{commands:v,chain:S,can:w}=new Kd({editor:e,state:g});return o.handler({state:g,range:y,match:r,commands:v,chain:S,can:w})===null||!p.steps.length?!1:(f&&(d.dispatch(f),!d.state.doc.eq(f.doc))||(ENe(p),p.setMeta("inputRule",!0),o.undoable&&p.setMeta(a,{transform:p,from:n,to:m,text:i}),d.dispatch(p)),!0)}function RTe(t,e,n){const s=e[0].length-n.length;if(s<=0)return!0;const i=t.parentOffset-s;return i>=0&&t.parent.textBetween(i,t.parentOffset)===e[0].slice(0,s)}function a1(t){var e;const{editor:n,from:s,to:i,text:o,rules:r,plugin:a,insertText:c}=t,{view:d}=n;if(d.composing)return!1;const f=d.state.doc.resolve(s);if(f.parent.type.spec.code||!((e=f.nodeBefore||f.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;const p=A4e(f)+o;for(const m of r){const g=NTe(p,m.find);if(!(!g||!RTe(f,g,o))&&OTe({editor:n,from:s,to:i,text:o,rule:m,match:g,plugin:a,insertText:c}))return!0}return!1}function kTe(t){const{editor:e,rules:n}=t,s=new Gi({state:{init(){return null},apply(i,o,r){const a=i.getMeta(s);if(a)return a;const c=i.getMeta("applyInputRules");return c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=qN(je.from(d),r.schema);const{from:f}=c,p=f+d.length;a1({editor:e,from:f,to:p,text:d,rules:n,plugin:s})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,r,a){return a1({editor:e,from:o,to:r,text:a,rules:n,plugin:s,insertText:!0})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&a1({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:s})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:r}=i.state.selection;return r?a1({editor:e,from:r.pos,to:r.pos,text:`
388
+ `,rules:n,plugin:s}):!1}},isInputRules:!0});return s}var KN=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...mn(tt(this,"addOptions",{name:this.name}))}}get storage(){return{...mn(tt(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>fH(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ATe=class hH extends KN{constructor(...e){super(...e),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new hH(n)}static handleExit({editor:e,mark:n}){const{tr:s}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!o.find(a=>(a==null?void 0:a.type.name)===n.name))return!1;const r=o.find(a=>(a==null?void 0:a.type.name)===n.name);return r&&s.removeStoredMark(r),s.insertText(" ",i.pos),e.view.dispatch(s),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},_Te=class{constructor(t){this.find=t.find,this.handler=t.handler}};const MTe=(t,e,n)=>{if(HN(e))return[...t.matchAll(e)];const s=e(t,n);return s?s.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function LTe(t){const{editor:e,state:n,from:s,to:i,rule:o,pasteEvent:r,dropEvent:a}=t,{commands:c,chain:d,can:f}=new Kd({editor:e,state:n}),p=[];return n.doc.nodesBetween(s,i,(m,g)=>{var y,v,S,w;if(!((y=m.type)===null||y===void 0||(y=y.spec)===null||y===void 0)&&y.code||!(m.isText||m.isTextblock||m.isInline))return;const N=(v=(S=(w=m.content)===null||w===void 0?void 0:w.size)!==null&&S!==void 0?S:m.nodeSize)!==null&&v!==void 0?v:0,C=Math.max(s,g),T=Math.min(i,g+N);if(C>=T)return;const R=m.isText?m.text||"":m.textBetween(C-g,T-g,void 0,"");MTe(R,o.find,r).forEach(A=>{if(A.index===void 0)return;const k=C+A.index+1,M=k+A[0].length,L={from:n.tr.mapping.map(k),to:n.tr.mapping.map(M)},j=o.handler({state:n,range:L,match:A,commands:c,chain:d,can:f,pasteEvent:r,dropEvent:a});p.push(j)})}),p.every(m=>m!==null)}let Nd=null;const ITe=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function DTe(t){const{editor:e,rules:n}=t;let s=null,i=!1,o=!1,r=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:d,from:f,to:p,rule:m,pasteEvt:g})=>{const y=d.tr,v=Gb({state:d,transaction:y});if(!(!LTe({editor:e,state:v,from:Math.max(f-1,0),to:p.b-1,rule:m,pasteEvent:g,dropEvent:a})||!y.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return r=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return e.on("destroy",()=>{Nd===e&&(Nd=null)}),n.map(d=>new Gi({view(f){const p=g=>{var y;s=!((y=f.dom.parentElement)===null||y===void 0)&&y.contains(g.target)?f.dom.parentElement:null,s&&(Nd=e)},m=()=>{Nd&&(Nd=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(f,p)=>{if(o=s===f.dom.parentElement,a=p,!o){const m=Nd;m!=null&&m.isEditable&&setTimeout(()=>{if(m.isDestroyed)return;const g=m.state.selection;g&&m.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(f,p)=>{var m;const g=(m=p.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return r=p,i=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,m)=>{const g=f[0],y=g.getMeta("uiEvent")==="paste"&&!i,v=g.getMeta("uiEvent")==="drop"&&!o,S=g.getMeta("applyPasteRules"),w=!!S;if(!y&&!v&&!w)return;if(w){let{text:T}=S;typeof T=="string"?T=T:T=qN(je.from(T),m.schema);const{from:R}=S,A=R+T.length,k=ITe(T);return c({rule:d,state:m,from:R,to:{b:A},pasteEvt:k})}const N=p.doc.content.findDiffStart(m.doc.content),C=p.doc.content.findDiffEnd(m.doc.content);if(!(!wTe(N)||!C||N===C.b))return c({rule:d,state:m,from:N,to:C,pasteEvt:r})}}))}var Qb=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=WN(t),this.schema=eH(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=tt(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Cd(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=Ep([...this.extensions].reverse()).flatMap(s=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:t,type:Cd(s.name,this.schema)},o=[],r=tt(s,"addKeyboardShortcuts",i);let a={};if(s.type==="mark"&&tt(s,"exitable",i)&&(a.ArrowRight=()=>ATe.handleExit({editor:t,mark:s})),r){const m=Object.fromEntries(Object.entries(r()).map(([g,y])=>[g,()=>y({editor:t})]));a={...a,...m}}const c=pNe(a);o.push(c);const d=tt(s,"addInputRules",i);if(iI(s,t.options.enableInputRules)&&d){const m=d();if(m&&m.length){const g=kTe({editor:t,rules:m}),y=Array.isArray(g)?g:[g];o.push(...y)}}const f=tt(s,"addPasteRules",i);if(iI(s,t.options.enablePasteRules)&&f){const m=f();if(m&&m.length){const g=DTe({editor:t,rules:m});o.push(...g)}}const p=tt(s,"addProseMirrorPlugins",i);if(p){const m=p();o.push(...m)}return o}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;const{editor:e}=this;(t=this.decorationManager)===null||t===void 0||t.destroy();const n=[];return this.extensions.forEach(s=>{const i=tt(s,"addDecorations",{name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Cd(s.name,this.schema)});i&&n.push({name:s.name,addDecorations:i})}),this.decorationManager=new yTe({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return JF(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=kf(this.extensions);return Object.fromEntries(e.filter(n=>!!tt(n,"addNodeView")).map(n=>{const s=this.attributes.filter(a=>a.type===n.name),i=tt(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ws(n.name,this.schema)});if(!i)return[];const o=i();if(!o)return[];const r=(a,c,d,f,p)=>{const m=Iy(a,s);return o({node:a,view:c,getPos:d,decorations:f,innerDecorations:p,editor:t,extension:n,HTMLAttributes:m})};return[n.name,r]}))}dispatchTransaction(t){const{editor:e}=this;return Ep([...this.extensions].reverse()).reduceRight((n,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Cd(s.name,this.schema)},o=tt(s,"dispatchTransaction",i);return o?r=>{o.call(i,{transaction:r,next:n})}:n},t)}transformPastedHTML(t){const{editor:e}=this;return Ep([...this.extensions]).reduce((n,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Cd(s.name,this.schema)},o=tt(s,"transformPastedHTML",i);return o?(r,a)=>{const c=n(r,a);return o.call(i,c)}:n},t||(n=>n))}get markViews(){const{editor:t}=this,{markExtensions:e}=kf(this.extensions);return Object.fromEntries(e.filter(n=>!!tt(n,"addMarkView")).map(n=>{const s=this.attributes.filter(r=>r.type===n.name),i=tt(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:wl(n.name,this.schema)});if(!i)return[];const o=(r,a,c)=>{const d=Iy(r,s);return i()({mark:r,view:a,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:f=>{CTe(r,t,f)}})};return[n.name,o]}))}destroy(){var t;(t=this.decorationManager)===null||t===void 0||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){const s=n.parent;s.child===n&&(s.child=null),n=s}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Cd(e.name,this.schema)};if(e.type==="mark"){var s,i;(!((s=mn(tt(e,"keepOnSplit",n)))!==null&&s!==void 0)||s)&&this.splittableMarks.push(e.name),!((i=mn(tt(e,"clearable",n)))!==null&&i!==void 0)||i||this.nonClearableMarks.push(e.name)}const o=tt(e,"onBeforeCreate",n),r=tt(e,"onCreate",n),a=tt(e,"onUpdate",n),c=tt(e,"onSelectionUpdate",n),d=tt(e,"onTransaction",n),f=tt(e,"onFocus",n),p=tt(e,"onBlur",n),m=tt(e,"onDestroy",n);o&&this.editor.on("beforeCreate",o),r&&this.editor.on("create",r),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),f&&this.editor.on("focus",f),p&&this.editor.on("blur",p),m&&this.editor.on("destroy",m)})}};Qb.resolve=WN;Qb.sort=Ep;Qb.flatten=VN;var yr=class pH extends KN{constructor(...e){super(...e),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new pH(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};const jTe=yr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Gi({key:new Po("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:s,selection:i}=e,o=nH(n),{blockSeparator:r}=this.options,a={...r!==void 0?{blockSeparator:r}:{},textSerializers:o};return[...i.ranges].sort((c,d)=>c.$from.pos-d.$from.pos).map(({$from:c,$to:d})=>tH(s,{from:c.pos,to:d.pos},a)).join(r??`
389
+
390
+ `)}}})]}}),PTe=yr.create({name:"commands",addCommands(){return{...sTe}}}),zTe=yr.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,s;const i=()=>{var o,r,a;if((o=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0||(a=r.filterTransaction)===null||a===void 0?void 0:a.call(r,t))!==null&&o!==void 0?o:t.getMeta("y-sync$"))return;const c=y4e(t.before,[t,...e]);sH(c).forEach(f=>{c.mapping.mapResult(f.oldRange.from).deletedAfter&&c.mapping.mapResult(f.oldRange.to).deletedBefore&&c.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:c.mapping.map(m),newTo:c.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:c})})});const d=c.mapping;c.steps.forEach((f,p)=>{if(f instanceof Ao){var m,g;const y=d.slice(p).map(f.from,-1),v=d.slice(p).map(f.to),S=d.invert().map(y,-1),w=d.invert().map(v),N=y>0?(m=c.doc.nodeAt(y-1))===null||m===void 0?void 0:m.marks.some(T=>T.eq(f.mark)):!1,C=(g=c.doc.nodeAt(v))===null||g===void 0?void 0:g.marks.some(T=>T.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:S,to:w},newRange:{from:y,to:v},partial:!!(C||N),editor:this.editor,transaction:t,combinedTransform:c})}})};!((n=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0?void 0:s.async)!==null&&n!==void 0)||n?setTimeout(i,0):i()}}),BTe=yr.create({name:"drop",addProseMirrorPlugins(){return[new Gi({key:new Po("tiptapDrop"),props:{handleDrop:(t,e,n,s)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:s})}}})]}}),$Te=yr.create({name:"editable",addProseMirrorPlugins(){return[new Gi({key:new Po("editable"),props:{editable:()=>this.editor.options.editable}})]}}),FTe=new Po("focusEvents"),HTe=yr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Gi({key:FTe,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const s=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(s),!1},blur:(e,n)=>{t.isFocused=!1;const s=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(s),!1}}}})]}}),UTe=yr.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:f,$anchor:p}=c,{pos:m,parent:g}=p,y=p.parent.isTextblock&&m>0?a.doc.resolve(m-1):p,v=y.parent.type.spec.isolating,S=p.pos-p.parentOffset,w=v&&y.parent.childCount===1?S===p.pos:Vt.atStart(d).from===m;return!f||!g.type.isTextblock||g.textContent.length||!w||w&&p.parent.type.name==="paragraph"?!1:r.clearNodes()}),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.deleteCurrentNode(),()=>r.joinForward(),()=>r.selectNodeForward()]),s={Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...s},o={...s,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return rm()||QF()?o:i},addProseMirrorPlugins(){return[new Gi({key:new Po("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const s=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!s||i)return;const{empty:o,from:r,to:a}=e.selection,c=Vt.atStart(e.doc).from,d=Vt.atEnd(e.doc).to;if(o||!(r===c&&a===d)||!GN(n.doc))return;const f=n.tr,p=Gb({state:n,transaction:f}),{commands:m}=new Kd({editor:this.editor,state:p});if(m.clearNodes(),!!f.steps.length)return f}})]}}),VTe=yr.create({name:"paste",addProseMirrorPlugins(){return[new Gi({key:new Po("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),qTe=yr.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Gi({key:new Po("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}}),WTe=yr.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=kf(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Gi({key:new Po("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}});let hI=!1;function GTe(t){if(hI)return;hI=!0;let e;try{e=Kn.fromJSON(t,{from:0,to:0}).slice.content}catch{return}e instanceof je||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var KTe=class cp{get name(){return this.node.type.name}constructor(e,n,s=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=s,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,s=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,s=this.to-1}this.editor.commands.insertContentAt({from:n,to:s},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new cp(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new cp(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new cp(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,s)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,r=n.isInline,a=this.pos+s+(o?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(a);if(!i&&!r&&c.depth<=this.depth)return;const d=new cp(c,this.editor,i,i||r?n:null);i&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let s=null,i=this.parent;for(;i&&!s;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,r=Object.keys(n);for(let a=0;a<r.length;a+=1){const c=r[a];if(o[c]!==n[c])break}}else s=i;i=i.parent}return s}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},s=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(r=>{s&&i.length>0||(r.node.type.name===e&&o.every(a=>n[a]===r.node.attrs[a])&&i.push(r),!(s&&i.length>0)&&(i=i.concat(r.querySelectorAll(e,n,s))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}};const YTe=`.ProseMirror {
391
+ position: relative;
392
+ }
393
+
394
+ .ProseMirror {
395
+ word-wrap: break-word;
396
+ white-space: pre-wrap;
397
+ white-space: break-spaces;
398
+ -webkit-font-variant-ligatures: none;
399
+ font-variant-ligatures: none;
400
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
401
+ }
402
+
403
+ .ProseMirror [contenteditable="false"] {
404
+ white-space: normal;
405
+ }
406
+
407
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
408
+ white-space: pre-wrap;
409
+ }
410
+
411
+ .ProseMirror pre {
412
+ white-space: pre-wrap;
413
+ }
414
+
415
+ img.ProseMirror-separator {
416
+ display: inline !important;
417
+ border: none !important;
418
+ margin: 0 !important;
419
+ width: 0 !important;
420
+ height: 0 !important;
421
+ }
422
+
423
+ .ProseMirror-gapcursor {
424
+ display: none;
425
+ pointer-events: none;
426
+ position: absolute;
427
+ margin: 0;
428
+ }
429
+
430
+ .ProseMirror-gapcursor:after {
431
+ content: "";
432
+ display: block;
433
+ position: absolute;
434
+ top: -2px;
435
+ width: 20px;
436
+ border-top: 1px solid black;
437
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
438
+ }
439
+
440
+ @keyframes ProseMirror-cursor-blink {
441
+ to {
442
+ visibility: hidden;
443
+ }
444
+ }
445
+
446
+ .ProseMirror-hideselection *::selection {
447
+ background: transparent;
448
+ }
449
+
450
+ .ProseMirror-hideselection *::-moz-selection {
451
+ background: transparent;
452
+ }
453
+
454
+ .ProseMirror-hideselection * {
455
+ caret-color: transparent;
456
+ }
457
+
458
+ .ProseMirror-focused .ProseMirror-gapcursor {
459
+ display: block;
460
+ }`;var W_e=class extends oTe{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:M4e,createMappablePosition:L4e},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:s,moved:i})=>this.options.onDrop(n,s,i)),this.on("paste",({event:n,slice:s})=>this.options.onPaste(n,s)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=YE(e,this.options.autofocus);this.editorState=Xr.create({doc:e,schema:this.schema,selection:n||void 0})}GTe(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Kd.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Kd.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=xTe(YTe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=ZE(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(r=>!r.key.startsWith(o))}),e.length===n.length)return;const s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[$Te,jTe.configure({blockSeparator:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),PTe,HTe,UTe,qTe.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),BTe,VTe,zTe,WTe.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Qb(n,this)}createCommandManager(){this.commandManager=new Kd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=QE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=QE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Xr.create({doc:n,schema:this.schema,selection:YE(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}getEditorViewAttributes(){var t;const e=(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes;return ZE(e)?n=>({role:"textbox",...e(n)}):{role:"textbox",...e}}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,s=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(s):s,o=e.transformPastedHTML,r=this.extensionManager.transformPastedHTML(o);this.editorView=new zF(t,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:r,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var f;return(f=this.capturedTransaction)===null||f===void 0?void 0:f.step(d)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),s=!this.state.selection.eq(e.selection),i=n.includes(t),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),s&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),a=r==null?void 0:r.getMeta("focus"),c=r==null?void 0:r.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:r}),c&&this.emit("blur",{editor:this,event:c.event,transaction:r}),!(t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return O4e(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,s=typeof t=="string"?e:t;return _4e(this.state,n,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return qN(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
461
+
462
+ `,textSerializers:n={}}=t||{};return N4e(this.state.doc,{blockSeparator:e,textSerializers:{...nH(this.schema),...n}})}get isEmpty(){return GN(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new KTe(e,this,!1,n)}get $doc(){return this.$pos(0)}};function G_e(t){return new Xb({find:t.find,handler:({state:e,range:n,match:s})=>{const i=mn(t.getAttributes,void 0,s);if(i===!1||i===null)return null;const{tr:o}=e,r=s[s.length-1],a=s[0];if(r){const c=a.search(/\S/),d=n.from+a.indexOf(r),f=d+r.length;if(iH(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+c,d);const p=n.from+c+r.length;o.addMark(n.from+c,p,t.type.create(i||{})),o.removeStoredMark(t.type)}},undoable:t.undoable})}function K_e(t){return new Xb({find:t.find,handler:({state:e,range:n,match:s})=>{const i=mn(t.getAttributes,void 0,s)||{},{tr:o}=e,r=n.from;let a=n.to;const c=t.type.create(i);if(s[1]){let d=r+s[0].lastIndexOf(s[1]);d>a?d=a:a=d+s[1].length;const f=s[0][s[0].length-1];o.insertText(f,r+s[0].length-1),o.replaceWith(d,a,c)}else if(s[0]){const d=t.type.isInline?r:r-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(r),o.mapping.map(a))}o.scrollIntoView()},undoable:t.undoable})}function Y_e(t){return new Xb({find:t.find,handler:({state:e,range:n,match:s})=>{const i=e.doc.resolve(n.from),o=mn(t.getAttributes,void 0,s)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)},undoable:t.undoable})}function X_e(t){return new Xb({find:t.find,handler:({state:e,range:n,match:s,chain:i})=>{const o=mn(t.getAttributes,void 0,s)||{},r=e.tr.delete(n.from,n.to),a=r.doc.resolve(n.from).blockRange(),c=a&&ON(a,t.type,o);if(!c)return null;if(r.wrap(a,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,g=p||f.$to.parentOffset&&f.$from.marks();if(g){const y=g.filter(v=>m.includes(v.type.name));r.ensureMarks(y)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const d=r.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&tc(r.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(s,d))&&r.join(n.from-1)},undoable:t.undoable})}var XTe=class mH extends KN{constructor(...e){super(...e),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new mH(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Q_e=class{constructor(t,e,n){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=()=>{try{return e.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,n;const{view:s}=this.editor,i=t.target,o=i.nodeType===3?(e=i.parentElement)===null||e===void 0?void 0:e.closest("[data-drag-handle]"):i.closest("[data-drag-handle]");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(i)||!o)return;let r=0,a=0;if(this.dom!==o){var c,d,f,p;const N=this.dom.getBoundingClientRect(),C=o.getBoundingClientRect(),T=(c=t.offsetX)!==null&&c!==void 0?c:(d=t.nativeEvent)===null||d===void 0?void 0:d.offsetX,R=(f=t.offsetY)!==null&&f!==void 0?f:(p=t.nativeEvent)===null||p===void 0?void 0:p.offsetY;r=C.x-N.x+T,a=C.y-N.y+R}const m=this.dom.cloneNode(!0);try{const N=this.dom.getBoundingClientRect();m.style.width=`${Math.round(N.width)}px`,m.style.height=`${Math.round(N.height)}px`,m.style.boxSizing="border-box",m.style.pointerEvents="none"}catch{}let g=null;try{var y;g=document.createElement("div"),g.style.position="absolute",g.style.top="-9999px",g.style.left="-9999px",g.style.pointerEvents="none",g.appendChild(m),document.body.appendChild(g),(y=t.dataTransfer)===null||y===void 0||y.setDragImage(m,r,a)}finally{g&&setTimeout(()=>{try{g==null||g.remove()}catch{}},0)}const v=this.getPos();if(typeof v!="number")return;const S=ut.create(s.state.doc,v),w=s.state.tr.setSelection(S);s.dispatch(w)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const n=t.target;if(!(this.dom.contains(n)&&!(!((e=this.contentDOM)===null||e===void 0)&&e.contains(n))))return!1;const s=t.type.startsWith("drag"),i=t.type==="dragover"||t.type==="dragenter",o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!s)return!0;const{isEditable:r}=this.editor,{isDragging:a}=this,c=!!this.node.type.spec.draggable,d=ut.isSelectable(this.node),f=t.type==="copy",p=t.type==="paste",m=t.type==="cut",g=t.type==="mousedown";if(!c&&d&&s&&t.target===this.dom&&t.preventDefault(),c&&s&&!a&&t.target===this.dom)return t.preventDefault(),!1;if(c&&r&&!a&&g){const y=n.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(a||i||o||f||p||m||g&&d)}ignoreMutation(t){return this.dom?this.contentDOM?typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.contentDOM.contains(t.target)&&t.type==="childList"&&(rm()||XE())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target):t.type!=="selection":!0}updateAttributes(t){this.editor.commands.command(({tr:e})=>{const n=this.getPos();return typeof n!="number"?!1:(e.setNodeMarkup(n,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function Z_e(t){return new _Te({find:t.find,handler:({state:e,range:n,match:s,pasteEvent:i})=>{const o=mn(t.getAttributes,void 0,s,i);if(o===!1||o===null)return null;const{tr:r}=e,a=s[s.length-1],c=s[0];let d=n.to;if(a){const f=c.search(/\S/),p=n.from+c.indexOf(a),m=p+a.length;if(iH(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>p).length)return null;m<n.to&&r.delete(m,n.to),p>n.from&&r.delete(n.from+f,p),d=n.from+f+a.length,r.addMark(n.from+f,d,t.type.create(o||{})),s.index!==void 0&&s.input!==void 0&&s.index+s[0].length>=s.input.length||r.removeStoredMark(t.type)}}})}const c1="codeLink",$S="data-code-link",pI="data-code",QTe=/^\[(`?)([^\]`\n]+)\1\]\(code:((?:[^()\s]|\([^()\s]*\))+)\)/,ZTe=/\[[^\]\n]*\]\(code:/,JTe="rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[0.875em] data-code:font-mono",eOe=/^[^\]`\n]+$/,tOe=/^[^)\s]+$/,nOe="#",sOe=({lineStart:t,lineEnd:e})=>t===e?`L${String(t)}`:`L${String(t)}-${String(e)}`,iOe=({path:t,range:e,label:n,isCode:s})=>{const i=n.trim();return eOe.test(i)&&tOe.test(t)?{linkId:`${t}${nOe}${sOe(e)}`,label:i,isCode:s}:null},mI=t=>typeof t=="string"?t:"",FS=t=>({linkId:mI(t==null?void 0:t.linkId),label:mI(t==null?void 0:t.label),isCode:(t==null?void 0:t.isCode)===!0}),oOe=({linkId:t,label:e,isCode:n})=>`[${n?`\`${e}\``:e}](code:${t})`,rOe=t=>{const e=QTe.exec(t);return e===null?null:{raw:e[0],isCode:e[1]!=="",label:e[2],linkId:e[3]}},J_e=XTe.create({name:c1,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes:()=>({linkId:{default:""},label:{default:""},isCode:{default:!1}}),parseHTML:()=>[{tag:`span[${$S}]`,getAttrs:t=>({linkId:t.getAttribute($S)??"",label:t.textContent,isCode:t.hasAttribute(pI)})}],renderHTML:({node:t})=>{const{linkId:e,label:n,isCode:s}=FS(t.attrs);return["span",{[$S]:e,...s?{[pI]:""}:{},class:JTe,title:e},n]},markdownTokenizer:{name:c1,level:"inline",start:t=>t.search(ZTe),tokenize:t=>{const e=rOe(t);return e===null?void 0:{type:c1,...e}}},parseMarkdown:t=>({type:c1,attrs:FS(t)}),renderMarkdown:t=>oOe(FS(t.attrs))}),lOe="Link to code",aOe="Pick a file of the Flight Plan, select the lines the link points at, and name the link.",cOe="File",uOe="Search the files of the Flight Plan",dOe="Link these lines",fOe="Select the lines in the code: click a line number, then another with Shift.",hOe="Label",pOe="Show the label as code",mOe="Write a label without a backtick or a closing square bracket.",Yh=t=>{const e=ee.c(62),{reviewKey:n,selectedText:s,onInsert:i,onClose:o}=t,r=_.useId(),a=EN(n,"flight-plan"),[c,d]=_.useState(null),[f,p]=_.useState(null),[m,g]=_.useState(s),[y,v]=_.useState(!1),S=r$(n,c);let w;e[0]!==y||e[1]!==m||e[2]!==c||e[3]!==f?(w=c===null||f===null?null:iOe({path:c,range:f,label:m,isCode:y}),e[0]=y,e[1]=m,e[2]=c,e[3]=f,e[4]=w):w=e[4];const N=w;let C;e[5]!==N||e[6]!==m||e[7]!==c||e[8]!==f?(C=c!==null&&f!==null&&m.trim()!==""&&N===null,e[5]=N,e[6]=m,e[7]=c,e[8]=f,e[9]=C):C=e[9];const T=C;let R;e[10]!==a?(R=X=>{d(X),p(null),a.onQueryChange(X)},e[10]=a,e[11]=R):R=e[11];const A=R;let k;e[12]!==o?(k=X=>{X||o()},e[12]=o,e[13]=k):k=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=b.jsxs(bl,{children:[b.jsx(vl,{children:lOe}),b.jsx(Sl,{children:aOe})]}),e[14]=M):M=e[14];let L;e[15]!==a.errorMessage||e[16]!==a.files||e[17]!==a.message||e[18]!==a.onQueryChange||e[19]!==a.query||e[20]!==A?(L=b.jsx(CN,{label:cOe,hint:null,placeholder:uOe,query:a.query,files:a.files,message:a.message,errorMessage:a.errorMessage,onQueryChange:a.onQueryChange,onSelect:A}),e[15]=a.errorMessage,e[16]=a.files,e[17]=a.message,e[18]=a.onQueryChange,e[19]=a.query,e[20]=A,e[21]=L):L=e[21];let j;e[22]!==S||e[23]!==c||e[24]!==f?(j=c===null?b.jsx("span",{}):b.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[b.jsx(a$,{path:c,lines:S.lines,statusMessage:S.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:dOe,focusOn:f,className:"flex-1",onHighlightCode:p}),b.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:f===null?fOe:Qp(f)})]}),e[22]=S,e[23]=c,e[24]=f,e[25]=j):j=e[25];let D;e[26]!==r?(D=b.jsx("label",{htmlFor:r,className:"text-sm font-bold",children:hOe}),e[26]=r,e[27]=D):D=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=X=>{g(X.target.value)},e[28]=P):P=e[28];let B;e[29]!==T||e[30]!==m||e[31]!==r?(B=b.jsx(Hm,{id:r,value:m,"aria-invalid":T,onChange:P}),e[29]=T,e[30]=m,e[31]=r,e[32]=B):B=e[32];let I;e[33]!==T?(I=T?b.jsx("p",{role:"alert",className:"text-sm text-destructive",children:mOe}):null,e[33]=T,e[34]=I):I=e[34];let F;e[35]===Symbol.for("react.memo_cache_sentinel")?(F=X=>{v(X.target.checked)},e[35]=F):F=e[35];let z;e[36]!==y?(z=b.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:y,className:"size-4 accent-(--primary)",onChange:F}),pOe]}),e[36]=y,e[37]=z):z=e[37];let U;e[38]!==B||e[39]!==I||e[40]!==z||e[41]!==D?(U=b.jsxs("div",{className:"grid gap-1.5",children:[D,B,I,z]}),e[38]=B,e[39]=I,e[40]=z,e[41]=D,e[42]=U):U=e[42];let H;e[43]!==o?(H=b.jsx(ft,{type:"button",variant:"ghost",onClick:o,children:"Cancel"}),e[43]=o,e[44]=H):H=e[44];const V=N===null;let W;e[45]!==N||e[46]!==i?(W=()=>{N!==null&&i(N)},e[45]=N,e[46]=i,e[47]=W):W=e[47];let G;e[48]!==V||e[49]!==W?(G=b.jsx(ft,{type:"button",disabled:V,onClick:W,children:"Insert"}),e[48]=V,e[49]=W,e[50]=G):G=e[50];let Y;e[51]!==H||e[52]!==G?(Y=b.jsxs(xl,{children:[H,G]}),e[51]=H,e[52]=G,e[53]=Y):Y=e[53];let J;e[54]!==U||e[55]!==Y||e[56]!==L||e[57]!==j?(J=b.jsxs(yl,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[M,L,j,U,Y]}),e[54]=U,e[55]=Y,e[56]=L,e[57]=j,e[58]=J):J=e[58];let q;return e[59]!==J||e[60]!==k?(q=b.jsx(gl,{open:!0,onOpenChange:k,children:J}),e[59]=J,e[60]=k,e[61]=q):q=e[61],q},gOe=t=>{const e=ee.c(41),{choice:n,isPending:s,onComplete:i,onClose:o}=t,r=_.useId(),[a,c]=_.useState(n.selectedId);let d;e[0]!==o?(d=R=>{R||o()},e[0]=o,e[1]=d):d=e[1];let f;e[2]!==n.title?(f=b.jsx(vl,{children:n.title}),e[2]=n.title,e[3]=f):f=e[3];let p;e[4]!==n.description?(p=b.jsx(Sl,{children:n.description}),e[4]=n.description,e[5]=p):p=e[5];let m;e[6]!==f||e[7]!==p?(m=b.jsxs(bl,{children:[f,p]}),e[6]=f,e[7]=p,e[8]=m):m=e[8];let g;e[9]!==n.emptyMessage||e[10]!==n.options||e[11]!==n.title||e[12]!==r||e[13]!==a?(g=n.emptyMessage===null?b.jsxs("fieldset",{children:[b.jsx("legend",{className:"sr-only",children:n.title}),b.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:n.options.map(R=>b.jsxs("li",{className:"border-b border-border py-3",children:[b.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[b.jsx("input",{type:"radio",name:r,checked:a===R.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{c(R.id)}}),b.jsx("span",{className:"min-w-0 font-bold",children:R.label})]}),b.jsx("span",{className:"block pl-7 text-sm text-muted-foreground",children:R.detail})]},R.id))})]}):b.jsx("p",{className:"text-muted-foreground",children:n.emptyMessage}),e[9]=n.emptyMessage,e[10]=n.options,e[11]=n.title,e[12]=r,e[13]=a,e[14]=g):g=e[14];let y;e[15]!==n.cancelLabel||e[16]!==o?(y=b.jsx(ft,{type:"button",variant:"ghost",onClick:o,children:n.cancelLabel}),e[15]=n.cancelLabel,e[16]=o,e[17]=y):y=e[17];let v;e[18]!==i?(v=()=>{i(null)},e[18]=i,e[19]=v):v=e[19];let S;e[20]!==n.skipLabel||e[21]!==s||e[22]!==v?(S=b.jsx(ft,{type:"button",variant:"outline",disabled:s,onClick:v,children:n.skipLabel}),e[20]=n.skipLabel,e[21]=s,e[22]=v,e[23]=S):S=e[23];let w;e[24]!==n.confirmLabel||e[25]!==n.emptyMessage||e[26]!==s||e[27]!==i||e[28]!==a?(w=n.emptyMessage===null?b.jsx(ft,{type:"button",disabled:s||a===null,onClick:()=>{i(a)},children:n.confirmLabel}):null,e[24]=n.confirmLabel,e[25]=n.emptyMessage,e[26]=s,e[27]=i,e[28]=a,e[29]=w):w=e[29];let N;e[30]!==y||e[31]!==S||e[32]!==w?(N=b.jsxs(xl,{children:[y,S,w]}),e[30]=y,e[31]=S,e[32]=w,e[33]=N):N=e[33];let C;e[34]!==N||e[35]!==m||e[36]!==g?(C=b.jsxs(yl,{className:"sm:max-w-xl",children:[m,g,N]}),e[34]=N,e[35]=m,e[36]=g,e[37]=C):C=e[37];let T;return e[38]!==d||e[39]!==C?(T=b.jsx(gl,{open:!0,onOpenChange:d,children:C}),e[38]=d,e[39]=C,e[40]=T):T=e[40],T},yOe=4,HS="change-overview-card-action",bOe={added:"[--change:var(--diff-added)]",modified:"[--change:var(--line-blue)]",deleted:"[--change:var(--diff-removed)]"},xOe="relative grid h-full w-full min-w-0 gap-0.5 rounded-[0.3rem] border border-[color-mix(in_oklab,var(--change)_55%,transparent)] bg-(--plate-fill) px-3 pt-3.5 pb-2.5 text-left [--plate-fill:color-mix(in_oklab,var(--change)_8%,var(--card))]",vOe="cursor-pointer transition-[border-color,box-shadow] duration-[180ms] ease-out hover:border-(--change) hover:ring-1 hover:ring-(--change) focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none",SOe="absolute -top-2 right-2.5 flex items-center gap-1 bg-[linear-gradient(to_bottom,var(--background)_50%,var(--plate-fill)_50%)] px-1.5 text-xs leading-4 font-bold text-(--change)",wOe=t=>{const e=ee.c(22),{card:n}=t;let s;e[0]!==n.change?(s=b.jsx(N3,{mark:n.change,radius:yOe}),e[0]=n.change,e[1]=s):s=e[1];let i;e[2]!==n.changeLabel||e[3]!==s?(i=b.jsxs("span",{className:SOe,children:[s,n.changeLabel]}),e[2]=n.changeLabel,e[3]=s,e[4]=i):i=e[4];let o;e[5]!==n.label?(o=b.jsx("span",{className:"truncate font-mono text-sm font-bold text-foreground",children:n.label}),e[5]=n.label,e[6]=o):o=e[6];let r;e[7]!==n.typeLabel?(r=b.jsx("span",{className:"shrink-0",children:n.typeLabel}),e[7]=n.typeLabel,e[8]=r):r=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a=b.jsx("span",{"aria-hidden":"true",children:"•"}),e[9]=a):a=e[9];let c;e[10]!==n.path?(c=b.jsx("bdi",{children:n.path}),e[10]=n.path,e[11]=c):c=e[11];let d;e[12]!==n.path||e[13]!==c?(d=b.jsx("span",{title:n.path,className:"min-w-0 truncate font-mono [direction:rtl]",children:c}),e[12]=n.path,e[13]=c,e[14]=d):d=e[14];let f;e[15]!==r||e[16]!==d?(f=b.jsxs("span",{className:"flex min-w-0 items-baseline gap-1.5 text-xs leading-4 text-muted-foreground",children:[r,a,d]}),e[15]=r,e[16]=d,e[17]=f):f=e[17];let p;return e[18]!==i||e[19]!==o||e[20]!==f?(p=b.jsxs(b.Fragment,{children:[i,o,f]}),e[18]=i,e[19]=o,e[20]=f,e[21]=p):p=e[21],p},EOe=t=>{const e=ee.c(26),{card:n,onOpenWaypoint:s}=t,{waypointAnchorId:i,change:o,preview:r}=n,a=i!==null,c=bOe[o],d=a?vOe:"";let f;e[0]!==c||e[1]!==d?(f=Se(xOe,c,d),e[0]=c,e[1]=d,e[2]=f):f=e[2];const p=f;let m;e[3]!==a||e[4]!==s||e[5]!==i?(m=a?()=>{s(i)}:void 0,e[3]=a,e[4]=s,e[5]=i,e[6]=m):m=e[6];const g=m;let y;e[7]!==n?(y=b.jsx(wOe,{card:n}),e[7]=n,e[8]=y):y=e[8];const v=y;if(r===null){let T;return e[9]!==p||e[10]!==v||e[11]!==a||e[12]!==g?(T=a?b.jsx("button",{type:"button","data-user-action-id":HS,className:p,onClick:g,children:v}):b.jsx("div",{"data-user-action-id":HS,className:p,children:v}),e[9]=p,e[10]=v,e[11]=a,e[12]=g,e[13]=T):T=e[13],T}let S;e[14]!==a?(S=a?b.jsx("button",{type:"button"}):b.jsx("div",{}),e[14]=a,e[15]=S):S=e[15];let w;e[16]!==p||e[17]!==v||e[18]!==g||e[19]!==S?(w=b.jsx($m,{delay:j7,render:S,"data-user-action-id":HS,className:p,onClick:g,children:v}),e[16]=p,e[17]=v,e[18]=g,e[19]=S,e[20]=w):w=e[20];let N;e[21]!==r?(N=b.jsx(P7,{target:r}),e[21]=r,e[22]=N):N=e[22];let C;return e[23]!==w||e[24]!==N?(C=b.jsxs(Bm,{children:[w,N]}),e[23]=w,e[24]=N,e[25]=C):C=e[25],C},COe=t=>{const e=ee.c(13),{heading:n,emptyMessage:s,rows:i,onOpenWaypoint:o}=t,r=_.useId();let a;e[0]!==n||e[1]!==r?(a=b.jsx("h3",{id:r,className:"pb-3 text-base leading-6 font-bold text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==s?(c=s===null?null:b.jsx("p",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=c):c=e[4];let d;e[5]!==o||e[6]!==i?(d=i.length===0?null:b.jsx("ul",{className:"grid gap-5",children:i.map(p=>b.jsxs("li",{"aria-label":p.classification.label,children:[b.jsx("span",{className:"text-sm leading-5 font-bold text-foreground",children:p.classification.label}),b.jsx("ul",{className:"grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-x-3 gap-y-5 pt-4",children:p.cards.map(m=>b.jsx("li",{className:"min-w-0",children:b.jsx(EOe,{card:m,onOpenWaypoint:o})},m.id))})]},p.classification.key))}),e[5]=o,e[6]=i,e[7]=d):d=e[7];let f;return e[8]!==r||e[9]!==a||e[10]!==c||e[11]!==d?(f=b.jsxs("section",{"aria-labelledby":r,"data-view-section-id":"change-overview-section",className:"pt-6",children:[a,c,d]}),e[8]=r,e[9]=a,e[10]=c,e[11]=d,e[12]=f):f=e[12],f},NOe="max-w-[85ch]",TOe=t=>{const e=ee.c(14),{anchorId:n,heading:s,writeUpNotice:i,action:o,children:r}=t,a=i===void 0?null:i,c=o===void 0?null:o,d=`${n}-heading`,f=`${n}-heading`;let p;e[0]!==s||e[1]!==f?(p=b.jsx("h2",{id:f,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:s}),e[0]=s,e[1]=f,e[2]=p):p=e[2];let m;e[3]!==a?(m=a===null?null:b.jsx(Ff,{label:a}),e[3]=a,e[4]=m):m=e[4];let g;e[5]!==c||e[6]!==p||e[7]!==m?(g=b.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[p,m,c]}),e[5]=c,e[6]=p,e[7]=m,e[8]=g):g=e[8];let y;return e[9]!==n||e[10]!==r||e[11]!==d||e[12]!==g?(y=b.jsxs("section",{id:n,"aria-labelledby":d,"data-view-section-id":"context-section",className:"scroll-mt-(--section-scroll-margin) pt-6 pb-8",children:[g,r]}),e[9]=n,e[10]=r,e[11]=d,e[12]=g,e[13]=y):y=e[13],y},OOe=_.lazy(async()=>await un(()=>import("./index-Ba3RqmDE.js"),__vite__mapDeps([24,25]))),ROe="Loading the editor…",kOe=t=>{const e=ee.c(32),{anchorId:n,heading:s,context:i,markdown:o,isDraft:r,unwrittenLabel:a,writeUpNotice:c,changeOverview:d,codeLinks:f,editing:p,renderCodeLinkDialog:m,onOpenCodeLink:g}=t,y=(p==null?void 0:p.isWriting)===!0,v=Aae(n,i);let S;e[0]!==p||e[1]!==y?(S=p===null||y?null:b.jsx(ft,{variant:"link",size:"sm",onClick:p.onEdit,children:"Edit"}),e[0]=p,e[1]=y,e[2]=S):S=e[2];let w;e[3]!==p||e[4]!==s||e[5]!==y||e[6]!==o||e[7]!==m?(w=p!==null&&y?b.jsx(_.Suspense,{fallback:b.jsx("p",{className:"text-sm text-muted-foreground",children:ROe}),children:b.jsx(OOe,{label:s,markdown:o,isSaving:p.isSaving,errorMessage:p.errorMessage,renderCodeLinkDialog:m,onSave:p.onSave,onCancel:p.onCancel})}):null,e[3]=p,e[4]=s,e[5]=y,e[6]=o,e[7]=m,e[8]=w):w=e[8];let N;e[9]!==r||e[10]!==y||e[11]!==a?(N=!y&&r?b.jsx(Ja,{isPending:!0,lineCount:4,className:"max-w-[55rem] text-base",children:b.jsx("p",{className:"text-muted-foreground",children:a})}):null,e[9]=r,e[10]=y,e[11]=a,e[12]=N):N=e[12];let C;e[13]!==v||e[14]!==f||e[15]!==i||e[16]!==r||e[17]!==y||e[18]!==g?(C=!y&&!r?b.jsx(z7,{value:v,children:b.jsx(ho,{blocks:i,codeLinks:f,className:NOe,onOpenCodeLink:g})}):null,e[13]=v,e[14]=f,e[15]=i,e[16]=r,e[17]=y,e[18]=g,e[19]=C):C=e[19];let T;e[20]!==d||e[21]!==g?(T=b.jsx(COe,{...d,onOpenWaypoint:g}),e[20]=d,e[21]=g,e[22]=T):T=e[22];let R;return e[23]!==n||e[24]!==s||e[25]!==S||e[26]!==w||e[27]!==N||e[28]!==C||e[29]!==T||e[30]!==c?(R=b.jsxs(TOe,{anchorId:n,heading:s,writeUpNotice:c,action:S,children:[w,N,C,T]}),e[23]=n,e[24]=s,e[25]=S,e[26]=w,e[27]=N,e[28]=C,e[29]=T,e[30]=c,e[31]=R):R=e[31],R},AOe=t=>{const e=ee.c(22),{anchorId:n,heading:s,emptyMessage:i,entries:o,placeholder:r,submitLabel:a,isSubmitting:c,renderEditor:d,onComment:f}=t,p=`${n}-heading`,m=`${n}-heading`;let g;e[0]!==s||e[1]!==m?(g=b.jsx("h2",{id:m,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:s}),e[0]=s,e[1]=m,e[2]=g):g=e[2];let y;e[3]!==i?(y=i===null?null:b.jsx("p",{className:"pb-4 text-muted-foreground",children:i}),e[3]=i,e[4]=y):y=e[4];let v;e[5]!==o?(v=o.map(_Oe),e[5]=o,e[6]=v):v=e[6];let S;e[7]!==c||e[8]!==f||e[9]!==r||e[10]!==d||e[11]!==a?(S=b.jsx(hN,{label:r,submitLabel:a,cancelLabel:null,isSubmitting:c,className:"border-t pt-4",renderEditor:d,onSubmit:f}),e[7]=c,e[8]=f,e[9]=r,e[10]=d,e[11]=a,e[12]=S):S=e[12];let w;e[13]!==y||e[14]!==v||e[15]!==S?(w=b.jsxs("div",{className:"flex max-w-[52rem] flex-col",children:[y,v,S]}),e[13]=y,e[14]=v,e[15]=S,e[16]=w):w=e[16];let N;return e[17]!==n||e[18]!==p||e[19]!==g||e[20]!==w?(N=b.jsxs("section",{id:n,"aria-labelledby":p,"data-view-section-id":"conversation-section",className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[g,w]}),e[17]=n,e[18]=p,e[19]=g,e[20]=w,e[21]=N):N=e[21],N};function _Oe(t){return b.jsx(iB,{comment:t,verdictLabel:t.verdictLabel,locationLabel:t.locationLabel,className:"border-t py-3 first:border-t-0 first:pt-0"},t.id)}const MOe=140,LOe=120,u1=0,eC=`
463
+ `,IOe={currentAnchorId:null,aboveAnchorIds:new Set},gI=t=>t===""?[]:t.split(eC),DOe=t=>t.reduce((e,n)=>{const s=document.getElementById(n);return s!==null&&s.getBoundingClientRect().top<=MOe?n:e},t.at(0)??null),jOe=t=>{var n;const e=(n=document.getElementById(t))==null?void 0:n.getBoundingClientRect();return e!==void 0&&e.height>0&&e.top<LOe},POe=t=>({currentAnchorId:DOe(t.sectionAnchorIds),aboveAnchorIds:new Set(t.waypointAnchorIds.filter(jOe))}),zOe=(t,e)=>t.size===e.size&&[...t].every(n=>e.has(n)),BOe=(t,e)=>t.currentAnchorId===e.currentAnchorId&&zOe(t.aboveAnchorIds,e.aboveAnchorIds),$Oe=(t,e)=>{const n=ee.c(9),[s]=_.useState(VOe),i=_.useRef(u1);let o;n[0]!==t?(o=t.join(eC),n[0]=t,n[1]=o):o=n[1];const r=o;let a;n[2]!==e?(a=e.join(eC),n[2]=e,n[3]=a):a=n[3];const c=a;let d,f;return n[4]!==r||n[5]!==s||n[6]!==c?(d=()=>{const p={sectionAnchorIds:gI(r),waypointAnchorIds:gI(c)},m=()=>{i.current=u1;const y=POe(p);BOe(s.getState(),y)||s.setState(y,!0)},g=()=>{i.current===u1&&(i.current=requestAnimationFrame(m))};return m(),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),()=>{cancelAnimationFrame(i.current),i.current=u1,window.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},f=[s,r,c],n[4]=r,n[5]=s,n[6]=c,n[7]=d,n[8]=f):(d=n[7],f=n[8]),_.useEffect(d,f),s},FOe=t=>oo(t),HOe=t=>oo(t,qOe);function UOe(){return IOe}function VOe(){return R3(UOe)}function qOe(t){return t.currentAnchorId}const tC="grid grid-cols-[2.5rem_1fr] items-center rounded-sm py-1.5 pr-2 text-sm hover:bg-muted",yI="transition-[fill,stroke] duration-[180ms] ease-out",WOe="relative flex flex-col before:absolute before:top-4 before:bottom-4 before:left-[calc(1.25rem-2px)] before:w-1 before:bg-(--line)",bI=t=>{const e=ee.c(7),{sections:n,currentAnchorId:s}=t;let i;if(e[0]!==s||e[1]!==n){let r;e[3]!==s?(r=a=>b.jsxs("li",{className:"relative flex flex-col",children:[b.jsxs("a",{href:`#${a.anchorId}`,"aria-current":a.anchorId===s?"location":void 0,"data-user-action-id":"rail-section-action",className:Se(tC,"group/stop text-muted-foreground aria-[current]:font-semibold aria-[current]:text-primary-text"),children:[b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:b.jsx("circle",{cx:"10",cy:"10",r:"7",className:Se(yI,"fill-background stroke-muted-foreground [stroke-width:3] group-aria-[current]/stop:fill-(--line) group-aria-[current]/stop:stroke-(--line)")})}),b.jsx("span",{className:"leading-5",children:a.label})]}),a.children.map(c=>b.jsxs("a",{href:`#${c.anchorId}`,"aria-current":c.anchorId===s?"location":void 0,"data-user-action-id":"rail-file-action",className:Se(tC,"group/stop py-1 text-[0.8125rem] text-muted-foreground aria-[current]:text-primary-text"),children:[b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:b.jsx("circle",{cx:"10",cy:"10",r:"3.5",className:Se(yI,"fill-background stroke-(--line) [stroke-width:2] group-aria-[current]/stop:fill-(--line)")})}),b.jsx("span",{className:"leading-4",children:c.label})]},c.anchorId))]},a.anchorId),e[3]=s,e[4]=r):r=e[4],i=n.map(r),e[0]=s,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=b.jsx("ol",{className:WOe,children:i}),e[5]=i,e[6]=o):o=e[6],o},GOe="Arrange",KOe=t=>{const e=ee.c(17),{label:n,groups:s,sections:i,currentAnchorId:o,onEditGroup:r,onArrangeGroups:a}=t,c=r===void 0?null:r,d=a===void 0?null:a;let f;e[0]!==d?(f=d===null?null:b.jsxs(ft,{variant:"ghost",size:"sm",className:"self-end",onClick:d,children:[b.jsx(JX,{"aria-hidden":"true"}),GOe]}),e[0]=d,e[1]=f):f=e[1];let p;if(e[2]!==o||e[3]!==s||e[4]!==c){let y;e[6]!==o||e[7]!==c?(y=v=>b.jsxs("div",{className:"flex flex-col",children:[v.label===null?null:b.jsxs("div",{className:"flex items-start",children:[b.jsxs("a",{href:`#${v.anchorId}`,"data-user-action-id":"rail-segment-action",className:Se(tC,"min-w-0 flex-1 items-start"),children:[b.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"mt-0.5 size-5 justify-self-center",children:b.jsx("rect",{x:"3.5",y:"3.5",width:"13",height:"13",rx:"2.5",className:"fill-(--line)"})}),b.jsxs("span",{className:"flex min-w-0 flex-col",children:[b.jsx("span",{className:"leading-5 font-semibold text-foreground",children:v.label}),b.jsx("span",{className:"text-xs leading-4 text-muted-foreground tabular-nums",children:v.detailLabel})]})]}),c===null?null:b.jsx(xs,{icon:"edit",label:`Edit ${v.label}`,className:"shrink-0 text-muted-foreground",onClick:()=>{c(v.anchorId)}})]}),b.jsx(bI,{sections:v.sections,currentAnchorId:o})]},v.anchorId),e[6]=o,e[7]=c,e[8]=y):y=e[8],p=s.map(y),e[2]=o,e[3]=s,e[4]=c,e[5]=p}else p=e[5];let m;e[9]!==o||e[10]!==i?(m=b.jsx("div",{className:"border-t pt-2",children:b.jsx(bI,{sections:i,currentAnchorId:o})}),e[9]=o,e[10]=i,e[11]=m):m=e[11];let g;return e[12]!==n||e[13]!==f||e[14]!==p||e[15]!==m?(g=b.jsxs("nav",{"aria-label":n,className:"flex flex-col gap-2",children:[f,p,m]}),e[12]=n,e[13]=f,e[14]=p,e[15]=m,e[16]=g):g=e[16],g},YOe=t=>{const e=ee.c(6);let n,s;e[0]!==t?({readingPosition:s,...n}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);const i=HOe(s);let o;return e[3]!==n||e[4]!==i?(o=b.jsx(KOe,{...n,currentAnchorId:i}),e[3]=n,e[4]=i,e[5]=o):o=e[5],o},xI=new Set,XOe={openWaypointIds:xI,currentWaypointId:null,focusedWaypointId:null,visit:null,collapsedAnchorIds:xI,holdingAnchorId:null,heldPlace:null},YN=(t,e)=>new Set([...t,...e]),Zb=(t,e)=>new Set([...t].filter(n=>!e.includes(n))),QOe=(t,e)=>t.has(e)?Zb(t,[e]):YN(t,[e]),gH=(t,e)=>t.holdingAnchorId===e?t:{...t,holdingAnchorId:e,collapsedAnchorIds:e===null?t.collapsedAnchorIds:Zb(t.collapsedAnchorIds,[e])},Jb=(t,e,n)=>gH({...t,currentWaypointId:e},n),ZOe=(t,e,n)=>Jb({...t,openWaypointIds:QOe(t.openWaypointIds,e)},e,n),JOe=(t,e,n,s)=>{var i;return Jb({...t,focusedWaypointId:e.id,openWaypointIds:n?YN(t.openWaypointIds,[e.id]):t.openWaypointIds,visit:{anchorId:e.anchorId,waypointId:e.id,isOpening:n,count:(((i=t.visit)==null?void 0:i.count)??0)+1}},e.id,s)},eRe=(t,e,n)=>t.currentWaypointId===e?t:Jb(t,e,n),tRe=(t,e,n)=>Jb({...t,focusedWaypointId:null},e,n),nRe=t=>t.currentWaypointId===null?t:{...t,openWaypointIds:Zb(t.openWaypointIds,[t.currentWaypointId])},sRe=t=>t.focusedWaypointId===null?t:{...t,focusedWaypointId:null},iRe=(t,e,n,s)=>{var i;return{...t,collapsedAnchorIds:n?YN(t.collapsedAnchorIds,e):Zb(t.collapsedAnchorIds,e),heldPlace:s===null?t.heldPlace:{anchorId:s,count:(((i=t.heldPlace)==null?void 0:i.count)??0)+1}}},oRe=()=>R3(()=>XOe),fa=(t,e)=>{t.setState(e,!0)},rRe=t=>oo(t),lRe="Arrange files",aRe=()=>{const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("span",{"aria-hidden":"true",className:"inline-flex size-3.5 shrink-0 items-center justify-center rounded-full bg-waypoint text-line-foreground",children:b.jsx(Nu,{className:"size-2.5",strokeWidth:3.5})}),t[0]=e):e=t[0],e},cRe=t=>t==="reviewed"?b.jsx(aRe,{}):b.jsx(rB,{kind:t}),uRe=t=>{const e=ee.c(26),{anchorId:n,heading:s,coverageLabel:i,emptyMessage:o,writeUpNotice:r,navigation:a,children:c,onArrangeFiles:d}=t,f=r===void 0?null:r,p=kie(n);let m;e[0]!==a||e[1]!==p?(m=yde({...a,markerOf:cRe,sectionSteps:p}),e[0]=a,e[1]=p,e[2]=m):m=e[2],L3(n,m);const g=`${n}-heading`,y=`${n}-heading`;let v;e[3]!==s||e[4]!==y?(v=b.jsx("h2",{id:y,className:"shrink-0 text-2xl leading-9 font-semibold tracking-[-0.02em] whitespace-nowrap text-foreground",children:s}),e[3]=s,e[4]=y,e[5]=v):v=e[5];let S;e[6]!==i?(S=b.jsx("p",{className:"min-w-0 truncate text-sm text-muted-foreground tabular-nums",children:i}),e[6]=i,e[7]=S):S=e[7];let w;e[8]!==f?(w=f===null?null:b.jsx(Ff,{label:f,className:"shrink-0"}),e[8]=f,e[9]=w):w=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=b.jsx("span",{className:"flex-1"}),e[10]=N):N=e[10];let C;e[11]!==d?(C=d===null?null:b.jsx(ft,{variant:"link",size:"sm",onClick:d,children:lRe}),e[11]=d,e[12]=C):C=e[12];let T;e[13]!==v||e[14]!==S||e[15]!==w||e[16]!==C?(T=b.jsxs("div",{className:"flex items-center gap-3",children:[v,S,w,N,C]}),e[13]=v,e[14]=S,e[15]=w,e[16]=C,e[17]=T):T=e[17];let R;e[18]!==o?(R=o===null?null:b.jsx("p",{className:"pt-6 text-muted-foreground",children:o}),e[18]=o,e[19]=R):R=e[19];let A;return e[20]!==n||e[21]!==c||e[22]!==T||e[23]!==R||e[24]!==g?(A=b.jsxs("section",{id:n,"aria-labelledby":g,"data-view-section-id":"code-walkthrough-section",className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-10",children:[T,R,c]}),e[20]=n,e[21]=c,e[22]=T,e[23]=R,e[24]=g,e[25]=A):A=e[25],A},dRe=t=>{const e=ee.c(12);let n,s,i,o;e[0]!==t?({readingPosition:s,walkthroughStore:o,navigationOf:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=o):(n=e[1],s=e[2],i=e[3],o=e[4]);const r=FOe(s),a=rRe(o);let c;e[5]!==n||e[6]!==r||e[7]!==a?(c=n(r,a),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==c||e[10]!==i?(d=b.jsx(uRe,{...i,navigation:c}),e[9]=c,e[10]=i,e[11]=d):d=e[11],d},fRe={},hRe=()=>{},vI="flex flex-wrap items-center gap-x-3 gap-y-1 border-b py-2.5 text-sm",pRe="sticky top-(--band-height) z-20 flex h-(--strip-height) items-center gap-3 border-b bg-background text-sm whitespace-nowrap",mRe=t=>{const e=ee.c(13),{staleNotice:n,unassignedFiles:s,progress:i,onShowUnassignedFiles:o,onCopyPrompt:r}=t;let a;e[0]!==r||e[1]!==n?(a=n===null?null:b.jsxs("div",{role:"status",className:vI,children:[b.jsx(gp,{status:"stale",tone:"signal"}),b.jsx("p",{className:"font-bold text-signal-text [&_code]:bg-transparent [&_code]:px-0",children:b.jsx(pf,{inlines:n.message,codeLinks:fRe,onOpenCodeLink:hRe})}),b.jsx(ft,{variant:"outline",size:"sm",onClick:()=>{r(n.prompt,n.copiedMessage)},children:n.promptLabel})]}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let c;e[3]!==o||e[4]!==s?(c=s===null?null:b.jsxs("div",{role:"status",className:vI,children:[b.jsx(gp,{status:"stale",tone:"signal"}),b.jsx("p",{className:"font-bold text-signal-text",children:s.message}),b.jsx(ft,{variant:"outline",size:"sm",onClick:o,children:s.actionLabel})]}),e[3]=o,e[4]=s,e[5]=c):c=e[5];let d;e[6]!==r||e[7]!==i?(d=i===null?null:b.jsxs("div",{role:"status",...Bie,className:pRe,children:[b.jsx(gp,{status:i.isWriting?"awaiting-review":"stale",tone:i.isWriting?"status":"signal",className:i.isWriting?"motion-safe:animate-pulse":""}),b.jsx("p",{className:"font-bold text-signal-text",children:i.label}),b.jsx("progress",{"aria-label":i.countLabel,value:i.writtenCount,max:i.totalCount,className:"h-1.5 w-40 shrink-0 appearance-none overflow-hidden rounded-[0.225rem] bg-muted [&::-moz-progress-bar]:bg-signal [&::-webkit-progress-bar]:bg-muted [&::-webkit-progress-value]:bg-signal [&::-webkit-progress-value]:transition-[width] [&::-webkit-progress-value]:duration-300"}),b.jsx("p",{className:"text-foreground tabular-nums",children:i.countLabel}),b.jsx("p",{className:"min-w-0 truncate text-muted-foreground",children:i.message}),i.prompt===null?null:b.jsx(ft,{variant:"outline",size:"sm",onClick:()=>{i.prompt!==null&&r(i.prompt.text,i.prompt.copiedMessage)},children:i.prompt.label})]}),e[6]=r,e[7]=i,e[8]=d):d=e[8];let f;return e[9]!==a||e[10]!==c||e[11]!==d?(f=b.jsxs(b.Fragment,{children:[a,c,d]}),e[9]=a,e[10]=c,e[11]=d,e[12]=f):f=e[12],f},gRe="Label",yRe="Files",bRe="No files yet.",xRe="Add a file",vRe="Search the changed files",SRe="Close",wRe="Delete",yH=t=>{const e=ee.c(52),{reviewKey:n,legend:s,label:i,paths:o,isSaving:r,isDeleting:a,errorMessage:c,onSave:d,onDelete:f,onClose:p}=t,m=_.useId(),g=_.useId(),y=EN(n,"changed"),[v,S]=_.useState(i),[w,N]=_.useState(o);let C;e[0]!==y?(C=G=>{N(Y=>Y.includes(G)?Y:[...Y,G]),y.onQueryChange("")},e[0]=y,e[1]=C):C=e[1];const T=C;let R;e[2]!==v||e[3]!==w||e[4]!==d?(R=s$(()=>{d({title:v,paths:w})}),e[2]=v,e[3]=w,e[4]=d,e[5]=R):R=e[5];let A;e[6]!==p?(A=b.jsx(xs,{icon:"close",label:SRe,className:"absolute top-2 right-2",onClick:p}),e[6]=p,e[7]=A):A=e[7];let k;e[8]!==m?(k=b.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:gRe}),e[8]=m,e[9]=k):k=e[9];let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=G=>{S(G.target.value)},e[10]=M):M=e[10];let L;e[11]!==v||e[12]!==m?(L=b.jsx(Hm,{id:m,value:v,onChange:M}),e[11]=v,e[12]=m,e[13]=L):L=e[13];let j;e[14]!==k||e[15]!==L?(j=b.jsxs("div",{className:"grid gap-1.5 pr-8",children:[k,L]}),e[14]=k,e[15]=L,e[16]=j):j=e[16];let D;e[17]!==g?(D=b.jsx("p",{id:g,className:"text-sm font-bold",children:yRe}),e[17]=g,e[18]=D):D=e[18];let P;e[19]!==w||e[20]!==g?(P=w.length===0?b.jsx("p",{className:"text-sm text-muted-foreground",children:bRe}):b.jsx("ul",{"aria-labelledby":g,className:"grid gap-0.5",children:w.map(G=>b.jsxs("li",{className:"flex items-center justify-between gap-2",children:[b.jsx("span",{className:"min-w-0 truncate font-mono text-[0.8rem]",title:G,children:G}),b.jsx(xs,{icon:"close",label:`Remove ${G}`,onClick:()=>{N(Y=>Y.filter(J=>J!==G))}})]},G))}),e[19]=w,e[20]=g,e[21]=P):P=e[21];let B;e[22]!==D||e[23]!==P?(B=b.jsxs("div",{className:"grid gap-1.5",children:[D,P]}),e[22]=D,e[23]=P,e[24]=B):B=e[24];let I;e[25]!==y.errorMessage||e[26]!==y.files||e[27]!==y.message||e[28]!==y.onQueryChange||e[29]!==y.query||e[30]!==T?(I=b.jsx(CN,{label:xRe,hint:null,placeholder:vRe,query:y.query,files:y.files,message:y.message,errorMessage:y.errorMessage,onQueryChange:y.onQueryChange,onSelect:T}),e[25]=y.errorMessage,e[26]=y.files,e[27]=y.message,e[28]=y.onQueryChange,e[29]=y.query,e[30]=T,e[31]=I):I=e[31];let F;e[32]!==c?(F=c===null?null:b.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c}),e[32]=c,e[33]=F):F=e[33];let z;e[34]!==a||e[35]!==f?(z=f===null?null:b.jsx(ft,{type:"button",variant:"destructive",disabled:a,onClick:f,children:wRe}),e[34]=a,e[35]=f,e[36]=z):z=e[36];const U=r?"Saving…":"Save";let H;e[37]!==r||e[38]!==U?(H=b.jsx(ft,{type:"submit",disabled:r,children:U}),e[37]=r,e[38]=U,e[39]=H):H=e[39];let V;e[40]!==z||e[41]!==H?(V=b.jsxs("div",{className:"flex justify-end gap-2",children:[z,H]}),e[40]=z,e[41]=H,e[42]=V):V=e[42];let W;return e[43]!==s||e[44]!==B||e[45]!==I||e[46]!==F||e[47]!==V||e[48]!==R||e[49]!==A||e[50]!==j?(W=b.jsxs("form",{"aria-label":s,onSubmit:R,className:"relative mt-6 grid max-w-[44rem] gap-4 rounded-lg border border-foreground p-4",children:[A,j,B,I,F,V]}),e[43]=s,e[44]=B,e[45]=I,e[46]=F,e[47]=V,e[48]=R,e[49]=A,e[50]=j,e[51]=W):W=e[51],W},ERe=t=>{const e=ee.c(8),{heading:n,detailLabel:s,children:i}=t,o=i===void 0?null:i;let r;e[0]!==n?(r=b.jsx("h2",{className:"text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==s?(a=s===null?null:b.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:s}),e[2]=s,e[3]=a):a=e[3];let c;return e[4]!==o||e[5]!==r||e[6]!==a?(c=b.jsxs("div",{className:"flex items-baseline gap-3 pt-6",children:[r,o,a]}),e[4]=o,e[5]=r,e[6]=a,e[7]=c):c=e[7],c},CRe="text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",NRe="text-sm text-muted-foreground tabular-nums",TRe="Edit segment",ORe=t=>{const e=ee.c(25),{reviewKey:n,heading:s,isTitleDraft:i,detailLabel:o,outline:r,authoring:a}=t;if(a===null){let m;return e[0]!==o||e[1]!==s||e[2]!==i?(m=s===null?null:b.jsx(ERe,{heading:s,detailLabel:o,children:b.jsx(Ja,{isPending:i,className:"w-64 self-center text-[1.75rem]",children:null})}),e[0]=o,e[1]=s,e[2]=i,e[3]=m):m=e[3],m}if(a.writing.isWriting){let m;return e[4]!==a.isPending||e[5]!==a.onRemove||e[6]!==a.writing.errorMessage||e[7]!==a.writing.isSaving||e[8]!==a.writing.onCancel||e[9]!==a.writing.onSave||e[10]!==r.heading||e[11]!==r.label||e[12]!==r.paths||e[13]!==n?(m=b.jsx(yH,{reviewKey:n,legend:r.heading,label:r.label,paths:r.paths,isSaving:a.writing.isSaving,isDeleting:a.isPending,errorMessage:a.writing.errorMessage,onSave:a.writing.onSave,onDelete:a.onRemove,onClose:a.writing.onCancel}),e[4]=a.isPending,e[5]=a.onRemove,e[6]=a.writing.errorMessage,e[7]=a.writing.isSaving,e[8]=a.writing.onCancel,e[9]=a.writing.onSave,e[10]=r.heading,e[11]=r.label,e[12]=r.paths,e[13]=n,e[14]=m):m=e[14],m}let c;e[15]!==r.heading?(c=b.jsx("h2",{className:CRe,children:r.heading}),e[15]=r.heading,e[16]=c):c=e[16];let d;e[17]!==r.detailLabel?(d=b.jsx("p",{className:NRe,children:r.detailLabel}),e[17]=r.detailLabel,e[18]=d):d=e[18];let f;e[19]!==a.writing.onEdit?(f=b.jsx(ft,{variant:"link",size:"sm",onClick:a.writing.onEdit,children:TRe}),e[19]=a.writing.onEdit,e[20]=f):f=e[20];let p;return e[21]!==c||e[22]!==d||e[23]!==f?(p=b.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[c,d,f]}),e[21]=c,e[22]=d,e[23]=f,e[24]=p):p=e[24],p},RRe=t=>{const e=ee.c(4),{selection:n,onComment:s,onAsk:i}=t;let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=n===null||n.commentRange===null&&i===null?null:b.jsxs("div",{role:"toolbar","aria-label":"Selected code",className:"fixed z-50 flex -translate-y-full gap-0.5 rounded-lg border border-foreground bg-popover p-1 duration-150 animate-in fade-in-0",style:{left:n.left,top:n.top},onMouseDown:kRe,children:[n.commentRange===null?null:b.jsx(ft,{variant:"ghost",size:"sm",onClick:()=>{n.commentRange!==null&&s(n.path,n.commentRange)},children:"Add comment"}),i===null?null:b.jsx(ft,{variant:"ghost",size:"sm",onClick:()=>{i(n)},children:"Ask the agent"})]}),e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o};function kRe(t){t.preventDefault()}const ARe=t=>{const e=ee.c(9),{heading:n,message:s,children:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[b.jsx("span",{className:"h-9 w-1 bg-(--line)"}),b.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),e[0]=o):o=e[0];let r;e[1]!==n?(r=b.jsx("h2",{className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:n}),e[1]=n,e[2]=r):r=e[2];let a;e[3]!==s?(a=b.jsx("p",{className:"max-w-[62ch] text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==r||e[7]!==a?(c=b.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] pt-10",children:[o,b.jsxs("div",{className:"pt-5",children:[r,a,i]})]}),e[5]=i,e[6]=r,e[7]=a,e[8]=c):c=e[8],c},_Re="Close",MRe="Cancel",LRe=t=>{const e=ee.c(29),{title:n,description:s,paths:i,confirmation:o,onClose:r}=t;let a;e[0]!==r?(a=T=>{T||r()},e[0]=r,e[1]=a):a=e[1];let c;e[2]!==n?(c=b.jsx(vl,{children:n}),e[2]=n,e[3]=c):c=e[3];const d=(o==null?void 0:o.warning)??s;let f;e[4]!==d?(f=b.jsx(Sl,{children:d}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==c||e[7]!==f?(p=b.jsxs(bl,{children:[c,f]}),e[6]=c,e[7]=f,e[8]=p):p=e[8];let m;e[9]!==i?(m=i.map(IRe),e[9]=i,e[10]=m):m=e[10];let g;e[11]!==m||e[12]!==n?(g=b.jsx("ul",{"aria-label":n,className:"grid max-h-80 gap-1 overflow-y-auto",children:m}),e[11]=m,e[12]=n,e[13]=g):g=e[13];const y=o===null?_Re:MRe;let v;e[14]!==r||e[15]!==y?(v=b.jsx(ft,{type:"button",variant:"ghost",onClick:r,children:y}),e[14]=r,e[15]=y,e[16]=v):v=e[16];let S;e[17]!==o?(S=o===null?null:b.jsx(ft,{type:"button",onClick:o.onConfirm,children:o.confirmLabel}),e[17]=o,e[18]=S):S=e[18];let w;e[19]!==S||e[20]!==v?(w=b.jsxs(xl,{children:[v,S]}),e[19]=S,e[20]=v,e[21]=w):w=e[21];let N;e[22]!==w||e[23]!==p||e[24]!==g?(N=b.jsxs(yl,{children:[p,g,w]}),e[22]=w,e[23]=p,e[24]=g,e[25]=N):N=e[25];let C;return e[26]!==a||e[27]!==N?(C=b.jsx(gl,{open:!0,onOpenChange:a,children:N}),e[26]=a,e[27]=N,e[28]=C):C=e[28],C};function IRe(t){return b.jsx("li",{className:"font-mono text-[0.8rem] break-all",children:t},t)}const SI=t=>Symbol.iterator in t,wI=t=>"entries"in t,EI=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,o]of n)if(!s.has(i)||!Object.is(o,s.get(i)))return!1;return!0},DRe=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),o=s.next();for(;!i.done&&!o.done;){if(!Object.is(i.value,o.value))return!1;i=n.next(),o=s.next()}return!!i.done&&!!o.done};function jRe(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:SI(t)&&SI(e)?wI(t)&&wI(e)?EI(t,e):DRe(t,e):EI({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function PRe(t){const e=Oo.useRef(void 0);return n=>{const s=t(n);return jRe(e.current,s)?e.current:e.current=s}}const zRe="Collapse file",BRe="Expand file",$Re=t=>{const e=ee.c(85),{file:n,previewVisit:s,openWaypointIds:i,currentWaypointId:o,focusedWaypointId:r,isCollapsed:a,isReviewPending:c,composer:d,composingRange:f,isCommentPending:p,renderCommentEditor:m,codeLinks:g,codeDefinitions:y,onOpenCodeLink:v,onToggleWaypoint:S,onPreviewWaypoint:w,onCollapsedChange:N,onWaypointReviewedChange:C,onFileReviewedChange:T,onRootBlockReviewedChange:R,onStartComment:A,onAddComment:k,onPostComment:M,onReply:L,onResolveThread:j,onDiscardComment:D,onWriteUp:P,authoring:B,headerActions:I}=t,F=s===void 0?null:s,z=w===void 0?null:w,U=P===void 0?null:P,H=B===void 0?null:B,V=I===void 0?null:I;let W;e[0]!==d||e[1]!==f||e[2]!==p||e[3]!==k||e[4]!==D||e[5]!==M||e[6]!==L||e[7]!==j||e[8]!==A||e[9]!==m?(W=d===null?null:{composer:d,composingRange:f,isCommentPending:p,renderCommentEditor:m,onStartComment:A,onAddComment:k,onPostComment:M,onReply:L,onResolveThread:j,onDiscardComment:D},e[0]=d,e[1]=f,e[2]=p,e[3]=k,e[4]=D,e[5]=M,e[6]=L,e[7]=j,e[8]=A,e[9]=m,e[10]=W):W=e[10];const G=W,Y=n.anchorId,J=n.title,q=n.isReviewed,X=a?"":"[contain-intrinsic-size:auto_32rem] [content-visibility:auto]";let Z;e[11]!==X?(Z=Se("scroll-mt-(--waypoint-scroll-margin) pt-6",X),e[11]=X,e[12]=Z):Z=e[12];const te=a?"":"border-b";let Q;e[13]!==te?(Q=Se("sticky top-(--file-header-top) z-10 flex h-11 items-center gap-3 bg-muted pr-1 pl-1.5",te),e[13]=te,e[14]=Q):Q=e[14];const se=!a,ae=`${a?BRe:zRe}: ${n.path}`;let le;e[15]!==a||e[16]!==N?(le=()=>{N(!a)},e[15]=a,e[16]=N,e[17]=le):le=e[17];const ne=a?"":"rotate-90";let fe;e[18]!==ne?(fe=Se("size-4 transition-transform duration-[180ms] ease-out",ne),e[18]=ne,e[19]=fe):fe=e[19];let ve;e[20]!==fe?(ve=b.jsx(Gy,{"aria-hidden":"true",className:fe}),e[20]=fe,e[21]=ve):ve=e[21];let we;e[22]!==se||e[23]!==ae||e[24]!==le||e[25]!==ve?(we=b.jsx("button",{type:"button","aria-expanded":se,"aria-label":ae,"data-user-action-id":"collapse-file-action",className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground",onClick:le,children:ve}),e[22]=se,e[23]=ae,e[24]=le,e[25]=ve,e[26]=we):we=e[26];let Ce;e[27]!==n.title?(Ce=b.jsx("h3",{className:"truncate text-[0.9375rem] leading-5 font-semibold",children:n.title}),e[27]=n.title,e[28]=Ce):Ce=e[28];let ye;e[29]!==n.path?(ye=b.jsx("p",{className:"truncate font-mono text-xs leading-4 text-muted-foreground",title:n.path,children:n.path}),e[29]=n.path,e[30]=ye):ye=e[30];let Oe;e[31]!==Ce||e[32]!==ye?(Oe=b.jsxs("div",{className:"flex min-w-0 flex-col justify-center",children:[Ce,ye]}),e[31]=Ce,e[32]=ye,e[33]=Oe):Oe=e[33];let be;e[34]===Symbol.for("react.memo_cache_sentinel")?(be=b.jsx("span",{className:"flex-1"}),e[34]=be):be=e[34];let _e;e[35]!==n.countLabels?(_e=n.countLabels.map(FRe),e[35]=n.countLabels,e[36]=_e):_e=e[36];let Me;e[37]!==_e?(Me=b.jsx(mf,{segments:_e,className:"hidden shrink justify-end text-xs text-muted-foreground tabular-nums md:flex"}),e[37]=_e,e[38]=Me):Me=e[38];let Be;e[39]!==n.forgeLink?(Be=n.forgeLink===null?null:b.jsx(Qa,{href:n.forgeLink.href,label:n.forgeLink.label,className:"shrink-0 text-xs"}),e[39]=n.forgeLink,e[40]=Be):Be=e[40];let He;e[41]!==n.isReviewed||e[42]!==n.path||e[43]!==n.reviewLabel||e[44]!==c||e[45]!==T?(He=T===null?null:b.jsx(zb,{label:n.reviewLabel,isReviewed:n.isReviewed,isDisabled:c,onChange:Pe=>{T(n.path,Pe)}}),e[41]=n.isReviewed,e[42]=n.path,e[43]=n.reviewLabel,e[44]=c,e[45]=T,e[46]=He):He=e[46];let Ae;e[47]!==V||e[48]!==Q||e[49]!==we||e[50]!==Oe||e[51]!==Me||e[52]!==Be||e[53]!==He?(Ae=b.jsxs("div",{"data-file-header":"",className:Q,children:[we,Oe,be,Me,Be,He,V]}),e[47]=V,e[48]=Q,e[49]=we,e[50]=Oe,e[51]=Me,e[52]=Be,e[53]=He,e[54]=Ae):Ae=e[54];let Ee;e[55]!==H||e[56]!==y||e[57]!==g||e[58]!==G||e[59]!==o||e[60]!==n.path||e[61]!==n.rootBlocks||e[62]!==n.rows||e[63]!==n.threads||e[64]!==r||e[65]!==a||e[66]!==c||e[67]!==v||e[68]!==z||e[69]!==R||e[70]!==S||e[71]!==C||e[72]!==U||e[73]!==i||e[74]!==F?(Ee=b.jsx(EB,{path:n.path,label:n.path,rows:n.rows,rootBlocks:n.rootBlocks,threads:n.threads,previewVisit:F,openWaypointIds:i,currentWaypointId:o,focusedWaypointId:r,isCollapsed:a,isReviewPending:c,commenting:G,codeLinks:g,codeDefinitions:y,onOpenCodeLink:v,onToggleWaypoint:S,onPreviewWaypoint:z,onWaypointReviewedChange:C,onRootBlockReviewedChange:R,onWriteUp:U,authoring:H}),e[55]=H,e[56]=y,e[57]=g,e[58]=G,e[59]=o,e[60]=n.path,e[61]=n.rootBlocks,e[62]=n.rows,e[63]=n.threads,e[64]=r,e[65]=a,e[66]=c,e[67]=v,e[68]=z,e[69]=R,e[70]=S,e[71]=C,e[72]=U,e[73]=i,e[74]=F,e[75]=Ee):Ee=e[75];let Ne;e[76]!==Ae||e[77]!==Ee?(Ne=b.jsxs("div",{className:"overflow-clip rounded-md border",children:[Ae,Ee]}),e[76]=Ae,e[77]=Ee,e[78]=Ne):Ne=e[78];let xe;return e[79]!==n.anchorId||e[80]!==n.isReviewed||e[81]!==n.title||e[82]!==Z||e[83]!==Ne?(xe=b.jsx("article",{id:Y,"aria-label":J,"data-reviewed":q,"data-reference-scope":"",className:Z,children:Ne}),e[79]=n.anchorId,e[80]=n.isReviewed,e[81]=n.title,e[82]=Z,e[83]=Ne,e[84]=xe):xe=e[84],xe};function FRe(t){return{text:t,kind:"plain"}}const HRe=t=>t.rows.flatMap(e=>e.kind==="waypoint"?[e.waypoint.id]:[]),CI=(t,e)=>e!==null&&t.includes(e)?e:null,URe=(t,e)=>e!==null&&t.includes(e.waypointId)?e:null,VRe=t=>t===null||t.isOpening?null:{waypointId:t.waypointId,count:t.count},qRe=t=>{const e=ee.c(25);let n,s,i;e[0]!==t?({walkthroughStore:i,...n}=t,s=HRe(n.file),e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);const o=s;let r;e[4]!==o?(r=C=>o.filter(T=>C.openWaypointIds.has(T)),e[4]=o,e[5]=r):r=e[5];const a=oo(i,PRe(r));let c;e[6]!==o?(c=C=>CI(o,C.currentWaypointId),e[6]=o,e[7]=c):c=e[7];const d=oo(i,c);let f;e[8]!==o?(f=C=>CI(o,C.focusedWaypointId),e[8]=o,e[9]=f):f=e[9];const p=oo(i,f);let m;e[10]!==o?(m=C=>URe(o,C.visit),e[10]=o,e[11]=m):m=e[11];const g=oo(i,m);let y;e[12]!==n.file.anchorId?(y=C=>C.collapsedAnchorIds.has(n.file.anchorId),e[12]=n.file.anchorId,e[13]=y):y=e[13];const v=oo(i,y);let S;e[14]!==a?(S=new Set(a),e[14]=a,e[15]=S):S=e[15];let w;e[16]!==g?(w=VRe(g),e[16]=g,e[17]=w):w=e[17];let N;return e[18]!==d||e[19]!==p||e[20]!==v||e[21]!==n||e[22]!==S||e[23]!==w?(N=b.jsx($Re,{...n,openWaypointIds:S,currentWaypointId:d,focusedWaypointId:p,previewVisit:w,isCollapsed:v}),e[18]=d,e[19]=p,e[20]=v,e[21]=n,e[22]=S,e[23]=w,e[24]=N):N=e[24],N},WRe=t=>[...t.groups.flatMap(e=>{var n;return[...e.options,...((n=e.more)==null?void 0:n.options)??[]]}),...t.submenus.flatMap(e=>e.options)],GRe=t=>WRe(t).filter(e=>e.isSelected).map(e=>e.key),KRe=(t,e)=>t.length===e.length&&t.every(n=>e.includes(n)),YRe=(t,e)=>t.every(n=>KRe(GRe(n.walkthrough.controls.filter),e)),XRe=t=>t.flatMap(e=>e.walkthrough.files).flatMap(e=>e.rows).flatMap(e=>e.kind==="waypoint"&&!e.waypoint.isReviewed?[e.waypoint.id]:[]).at(0)??null,QRe=[],XN=t=>{var n;const e=(n=document.getElementById(t))==null?void 0:n.getBoundingClientRect();return e!==void 0&&e.height>0&&e.top<I3()},QN=t=>{var e;(e=document.getElementById(t))==null||e.scrollIntoView({block:"start",behavior:"instant"})},ZRe=t=>{const e=ee.c(3),n=oo(t,lke);let s,i;e[0]!==n?(s=()=>{n!==null&&QN(n.anchorId)},i=[n],e[0]=n,e[1]=s,e[2]=i):(s=e[1],i=e[2]),_.useLayoutEffect(s,i)},JRe=t=>{const e=ee.c(4),n=_.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{const r=n.current;r!==null&&(n.current=null,QN(r))},e[0]=s):s=e[0];let i;e[1]!==t?(i=[t],e[1]=t,e[2]=i):i=e[2],_.useLayoutEffect(s,i);let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=r=>{n.current=XN(r)?r:null},e[3]=o):o=e[3],o},eke=(t,e)=>{const n=ee.c(5),s=_.useRef(null);let i,o;n[0]!==e||n[1]!==t?(i=()=>{const a=s.current;if(a===null||!YRe(t,a.keys))return;s.current=null;const c=XRe(t);c!==null?e(c):a.heldAnchorId!==null&&QN(a.heldAnchorId)},o=[t,e],n[0]=e,n[1]=t,n[2]=i,n[3]=o):(i=n[2],o=n[3]),_.useLayoutEffect(i,o);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=(a,c)=>{s.current={keys:a,heldAnchorId:XN(c)?c:null}},n[4]=r):r=n[4],r},tke=(t,e)=>t.flatMap(n=>n.walkthrough.files).flatMap(n=>n.rows.flatMap(s=>s.kind==="waypoint"&&s.waypoint.id===e?[{path:n.path,waypoint:s.waypoint,rootBlockId:s.rootBlockId}]:[])).at(0)??null,nke=t=>({side:"new",startLineLabel:String(t.lineStart),lineLabel:String(t.lineEnd)}),ske=t=>t.reading===null&&!t.isBeingWritten,ike=(t,e)=>e==="line"?{kind:"waypoint",waypointId:t.waypoint.id}:t.rootBlockId===null?null:{kind:"root-block",rootBlockId:t.rootBlockId},oke=(t,e)=>{var n,s;return((n=t.find(i=>i.anchorId===e))==null?void 0:n.anchorId)??((s=t.at(0))==null?void 0:s.anchorId)??null},rke=(t,e,n)=>{const s=ee.c(20),i=JRe(t),o=eke(t,e.onVisitWaypoint);let r;s[0]!==e.store?(r=(N,C,T)=>{const R=T!==null&&XN(T)?T:null;fa(e.store,A=>iRe(A,N,C,R))},s[0]=e.store,s[1]=r):r=s[1];const a=r,{onReviewedChange:c,onFilterChange:d,onShowReviewedChange:f,onCommentOnWaypoint:p,onWriteDescription:m,onWriteUp:g,agentLabel:y}=n;let v;s[2]!==a?(v=(N,C)=>{a([N],C,N)},s[2]=a,s[3]=v):v=s[3];let S;s[4]!==y||s[5]!==o||s[6]!==a||s[7]!==i||s[8]!==p||s[9]!==d||s[10]!==c||s[11]!==f||s[12]!==m||s[13]!==g||s[14]!==t||s[15]!==e?(S=(N,C,T)=>{const{controls:R}=N.walkthrough,{collapsedAnchorIds:A}=T,k=tke(t,T.currentWaypointId),M=(k==null?void 0:k.waypoint)??null,L=N.walkthrough.files.map(ake),j=oke(N.walkthrough.files,C.currentAnchorId),D=e.steppingOf(N,T.currentWaypointId,C.aboveAnchorIds);return{controls:R,positionLabel:D.positionLabel,canStepBack:D.canStepBack,canStepForward:D.canStepForward,currentWaypoint:M===null?null:{isReviewed:M.isReviewed,isOpen:T.openWaypointIds.has(M.id),canComment:M.lines!==null,canWriteUp:ske(M),canWriteUpBlock:(k==null?void 0:k.rootBlockId)!=null},areFilesCollapsed:L.length>0&&L.every(P=>A.has(P)),isFileCollapsed:j===null?null:A.has(j),onPrevious:D.onPrevious,onNext:D.onNext,onCurrentReviewedChange:c===null?null:P=>{M!==null&&(P&&!R.reviewedToggle.isShown&&D.onNext(),c(M.id,P))},onCommentOnCurrent:p===null?null:()=>{(k==null?void 0:k.waypoint.lines)!=null&&p(k.path,nke(k.waypoint.lines))},onDescribeCurrent:m===null?null:()=>{M!==null&&m(M.id)},agentLabel:y,onWriteUpCurrent:g===null?null:P=>{const B=k===null?null:ike(k,P);B!==null&&g(B)},onFilterChange:d===null?null:P=>{o(P??QRe,N.walkthrough.anchorId),d(P)},onShowReviewedChange:f===null?null:P=>{i(N.walkthrough.anchorId),f(P)},onFilesCollapsedChange:P=>{a(L,P,N.walkthrough.anchorId)},onFileCollapsedChange:P=>{j!==null&&a([j],P,j)},onCurrentOpenChange:e.onCurrentOpenChange}},s[4]=y,s[5]=o,s[6]=a,s[7]=i,s[8]=p,s[9]=d,s[10]=c,s[11]=f,s[12]=m,s[13]=g,s[14]=t,s[15]=e,s[16]=S):S=s[16];let w;return s[17]!==v||s[18]!==S?(w={onFileCollapsedChange:v,navigationOf:S},s[17]=v,s[18]=S,s[19]=w):w=s[19],w};function lke(t){return t.heldPlace}function ake(t){return t.anchorId}const cke=160,uke=.33,dke=900,NI="data-waypoint-focus",ZN=t=>{var e;(e=document.getElementById(t))==null||e.scrollIntoView({block:"start"})},fke=t=>[...document.querySelectorAll(`[${NI}]`)].filter(e=>e.getAttribute(NI)===t),hke=t=>{const e=fke(t).map(o=>o.getBoundingClientRect());if(e.length===0)return 0;const n=Math.min(...e.map(o=>o.top)),s=Math.max(...e.map(o=>o.bottom));return Math.max(0,Math.min(s,window.innerHeight)-Math.max(n,I3()))/Math.max(1,s-n)},I1=t=>t.walkthrough.files.flatMap(e=>e.rows.flatMap(n=>n.kind==="waypoint"?[n.waypoint]:[])),pke=t=>t.flatMap(I1).map(e=>e.anchorId),mke=(t,e)=>t.rows.some(n=>n.kind==="waypoint"&&n.waypoint.id===e),Xh=(t,e)=>{var n;return((n=t.flatMap(s=>s.walkthrough.files).find(s=>mke(s,e)))==null?void 0:n.anchorId)??null},gke=(t,e,n)=>{var s,i;return e===null?{previousId:((s=t.filter(o=>n.has(o.anchorId)).at(-1))==null?void 0:s.id)??null,nextId:((i=t.find(o=>!n.has(o.anchorId)))==null?void 0:i.id)??null}:{previousId:e.previousId,nextId:e.nextId}},yke=(t,e,n)=>{const s=ee.c(7),i=_.useRef(null);let o;s[0]!==t||s[1]!==n?(o=()=>{if(i.current=null,t===null)return;const a=()=>{i.current===null&&(i.current=window.scrollY)},c=()=>{const f=i.current;if(f===null)return;(Math.abs(window.scrollY-f)>cke||hke(t)<uke)&&n()},d=setTimeout(a,dke);return window.addEventListener("scrollend",a),window.addEventListener("scroll",c,{passive:!0}),()=>{clearTimeout(d),window.removeEventListener("scrollend",a),window.removeEventListener("scroll",c)}},s[0]=t,s[1]=n,s[2]=o):o=s[2];let r;s[3]!==t||s[4]!==n||s[5]!==e?(r=[t,e,n],s[3]=t,s[4]=n,s[5]=e,s[6]=r):r=s[6],_.useEffect(o,r)},bke=t=>()=>{fa(t,sRe)},xke=t=>{const e=ee.c(5),n=oo(t,Ske),s=oo(t,wke);let i;e[0]!==t?(i=()=>bke(t),e[0]=t,e[1]=i):i=e[1];const[o]=_.useState(i);let r,a;e[2]!==n?(r=()=>{n!==null&&ZN(n.anchorId)},a=[n],e[2]=n,e[3]=r,e[4]=a):(r=e[3],a=e[4]),_.useEffect(r,a),yke(s,n,o)},vke=t=>{const e=ee.c(36),[n]=_.useState(oRe);let s;e[0]!==t?(s=t.flatMap(I1),e[0]=t,e[1]=s):s=e[1];const i=s;let o,r;e[2]!==t||e[3]!==n?(o=()=>{fa(n,w=>gH(w,Xh(t,w.currentWaypointId)))},r=[n,t],e[2]=t,e[3]=n,e[4]=o,e[5]=r):(o=e[4],r=e[5]),_.useLayoutEffect(o,r);let a;e[6]!==t||e[7]!==n||e[8]!==i?(a=(w,N)=>{const C=i.find(T=>T.id===w);C!==void 0&&fa(n,T=>JOe(T,C,N,Xh(t,C.id)))},e[6]=t,e[7]=n,e[8]=i,e[9]=a):a=e[9];const c=a;let d;e[10]!==c?(d=(w,N,C)=>{const T=I1(w),R=T.find(k=>k.id===N)??null,A=gke(T,R,C);return{positionLabel:(R==null?void 0:R.positionLabel)??null,canStepBack:A.previousId!==null,canStepForward:A.nextId!==null,onPrevious:()=>{c(A.previousId,!1)},onNext:()=>{c(A.nextId,!1)}}},e[10]=c,e[11]=d):d=e[11];let f;e[12]!==t||e[13]!==n?(f=w=>{const N=t.find(T=>T.walkthrough.anchorId===w),C=N===void 0?void 0:I1(N).at(0);C!==void 0&&fa(n,T=>tRe(T,C.id,Xh(t,C.id)))},e[12]=t,e[13]=n,e[14]=f):f=e[14];let p;e[15]!==c?(p=w=>{c(w,!1)},e[15]=c,e[16]=p):p=e[16];let m,g;e[17]!==t||e[18]!==n?(m=w=>{fa(n,N=>ZOe(N,w,Xh(t,w)))},g=w=>{fa(n,N=>eRe(N,w,Xh(t,w)))},e[17]=t,e[18]=n,e[19]=m,e[20]=g):(m=e[19],g=e[20]);let y;e[21]!==n||e[22]!==c?(y=w=>{const{currentWaypointId:N}=n.getState();w||fa(n,nRe),c(N,w)},e[21]=n,e[22]=c,e[23]=y):y=e[23];let v;e[24]!==c||e[25]!==i?(v=w=>{const N=i.find(C=>C.anchorId===w);N===void 0?ZN(w):c(N.id,!0)},e[24]=c,e[25]=i,e[26]=v):v=e[26];let S;return e[27]!==n||e[28]!==v||e[29]!==d||e[30]!==f||e[31]!==p||e[32]!==m||e[33]!==g||e[34]!==y?(S={store:n,steppingOf:d,onSectionEntered:f,onVisitWaypoint:p,onToggleWaypoint:m,onPreviewWaypoint:g,onCurrentOpenChange:y,onOpenCodeLink:v},e[27]=n,e[28]=v,e[29]=d,e[30]=f,e[31]=p,e[32]=m,e[33]=g,e[34]=y,e[35]=S):S=e[35],S};function Ske(t){return t.visit}function wke(t){return t.focusedWaypointId}const Eke=t=>{const{walkthroughStore:e}=t;return xke(e),ZRe(e),null},Cke=(t,e)=>{var W,G;const n=ee.c(65),s=ui(),i=Io(),[o,r]=_.useState(!1),[a,c]=_.useState(null);let d;n[0]!==o||n[1]!==t||n[2]!==s.conversation.watch?(d=s.conversation.watch.subscriptionOptions(t,{enabled:o}),n[0]=o,n[1]=t,n[2]=s.conversation.watch,n[3]=d):d=n[3];const f=LX(d);let p;n[4]!==t||n[5]!==s.conversation.modelChoice?(p=s.conversation.modelChoice.queryOptions(t),n[4]=t,n[5]=s.conversation.modelChoice,n[6]=p):p=n[6];let m;n[7]!==o||n[8]!==p?(m={...p,enabled:o},n[7]=o,n[8]=p,n[9]=m):m=n[9];const g=fr(m);let y;n[10]!==e?(y=Y=>{e(Y.message)},n[10]=e,n[11]=y):y=n[11];const v=y;let S;if(n[12]!==v||n[13]!==s.conversation.sendMessage){let Y;n[15]===Symbol.for("react.memo_cache_sentinel")?(Y=J=>{J.kind==="sent"&&c(null)},n[15]=Y):Y=n[15],S=s.conversation.sendMessage.mutationOptions({onSuccess:Y,onError:v}),n[12]=v,n[13]=s.conversation.sendMessage,n[14]=S}else S=n[14];const w=Wn(S);let N;if(n[16]!==i||n[17]!==v||n[18]!==s.conversation.answerQuestions||n[19]!==s.review){let Y;n[21]!==i||n[22]!==s.review?(Y=async()=>{await i.invalidateQueries(s.review.get.pathFilter())},n[21]=i,n[22]=s.review,n[23]=Y):Y=n[23],N=s.conversation.answerQuestions.mutationOptions({onSuccess:Y,onError:v}),n[16]=i,n[17]=v,n[18]=s.conversation.answerQuestions,n[19]=s.review,n[20]=N}else N=n[20];const C=Wn(N);let T;if(n[24]!==e||n[25]!==i||n[26]!==v||n[27]!==s.conversation.chooseModel||n[28]!==s.conversation.modelChoice){let Y;n[30]!==e||n[31]!==i||n[32]!==s.conversation.modelChoice?(Y=async J=>{J.kind==="rejected"&&e(J.message),await i.invalidateQueries(s.conversation.modelChoice.pathFilter())},n[30]=e,n[31]=i,n[32]=s.conversation.modelChoice,n[33]=Y):Y=n[33],T=s.conversation.chooseModel.mutationOptions({onSuccess:Y,onError:v}),n[24]=e,n[25]=i,n[26]=v,n[27]=s.conversation.chooseModel,n[28]=s.conversation.modelChoice,n[29]=T}else T=n[29];const R=Wn(T);let A;n[34]!==C.data||n[35]!==C.variables?(A=((W=C.data)==null?void 0:W.kind)==="rejected"&&C.variables!==void 0?{batchId:C.variables.batchId,message:C.data.message}:null,n[34]=C.data,n[35]=C.variables,n[36]=A):A=n[36];const k=A,M=g.data??null,L=((G=w.data)==null?void 0:G.kind)==="rejected"?w.data.message:null,j=C.isPending?C.variables.batchId:null;let D;n[37]!==k||n[38]!==j?(D={pendingBatchId:j,rejection:k},n[37]=k,n[38]=j,n[39]=D):D=n[39];let P,B,I,F;n[40]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{r(Nke)},B=()=>{r(!1)},I=Y=>{c(Y),r(!0)},F=()=>{c(null)},n[40]=P,n[41]=B,n[42]=I,n[43]=F):(P=n[40],B=n[41],I=n[42],F=n[43]);let z;n[44]!==a||n[45]!==t||n[46]!==w?(z=Y=>{w.mutate({...t,body:Y,reference:a})},n[44]=a,n[45]=t,n[46]=w,n[47]=z):z=n[47];let U;n[48]!==C||n[49]!==t?(U=(Y,J)=>{C.mutate({...t,batchId:Y,answers:J.map(Tke)})},n[48]=C,n[49]=t,n[50]=U):U=n[50];let H;n[51]!==R||n[52]!==t?(H=Y=>{R.mutate({...t,model:Y})},n[51]=R,n[52]=t,n[53]=H):H=n[53];let V;return n[54]!==f.data||n[55]!==o||n[56]!==a||n[57]!==w.isPending||n[58]!==D||n[59]!==z||n[60]!==U||n[61]!==H||n[62]!==M||n[63]!==L?(V={isOpen:o,reference:a,conversation:f.data,modelChoice:M,isSending:w.isPending,sendProblem:L,answering:D,onToggle:P,onClose:B,onAsk:I,onClearReference:F,onSend:z,onAnswer:U,onChooseModel:H},n[54]=f.data,n[55]=o,n[56]=a,n[57]=w.isPending,n[58]=D,n[59]=z,n[60]=U,n[61]=H,n[62]=M,n[63]=L,n[64]=V):V=n[64],V};function Nke(t){return!t}function Tke(t){return{...t,pickedLabels:[...t.pickedLabels]}}const Oke="[data-line]",Rke="[data-path]",kke=6,nC=10,TI=t=>{const e=t instanceof Element?t:(t==null?void 0:t.parentElement)??null;return(e==null?void 0:e.closest(Oke))??null},OI=t=>Number.parseInt(t.dataset.line??"",nC),RI=t=>{const{commentSide:e,commentLine:n}=t.dataset;return(e==="old"||e==="new")&&n!==void 0?{side:e,lineLabel:n}:null},Ake=(t,e)=>{if(e===null)return null;const n=Number.parseInt(e.lineLabel,nC),s=(t==null?void 0:t.side)===e.side?Number.parseInt(t.lineLabel,nC):n;return{side:e.side,startLineLabel:String(Math.min(s,n)),lineLabel:String(Math.max(s,n))}},kI=()=>{const t=window.getSelection();if(t===null||t.isCollapsed||t.rangeCount===0)return null;const e=TI(t.anchorNode),n=TI(t.focusNode),s=(e==null?void 0:e.closest(Rke))??null,i=s==null?void 0:s.dataset.path;if(e===null||n===null||s===null||i===void 0||!s.contains(n))return null;const o=OI(e),r=OI(n);if(Number.isNaN(o)||Number.isNaN(r))return null;const a=t.getRangeAt(0).getBoundingClientRect();return{path:i,lineStart:o,lineEnd:r,commentRange:Ake(RI(e),RI(n)),left:a.left,top:a.top-kke}},_ke=()=>{const t=ee.c(2),[e,n]=_.useState(null);let s,i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{const o=()=>{n(kI())},r=()=>{n(null)},a=()=>{kI()===null&&n(null)};return document.addEventListener("selectionchange",a),document.addEventListener("mouseup",o),document.addEventListener("keyup",o),window.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("selectionchange",a),document.removeEventListener("mouseup",o),document.removeEventListener("keyup",o),window.removeEventListener("scroll",r)}},i=[],t[0]=s,t[1]=i):(s=t[0],i=t[1]),_.useEffect(s,i),e},bH=()=>"Notification"in window,Mke=()=>{bH()&&Notification.permission==="default"&&Notification.requestPermission()},Lke=(t,{title:e,body:n})=>{if(!bH()||Notification.permission!=="granted")return;const s=new Notification(e,{body:n,tag:t});s.addEventListener("click",()=>{window.focus(),s.close()})},Ike=(t,e,n,s)=>{const i=ee.c(6),o=_.useRef(null);let r,a;i[0]!==s||i[1]!==n||i[2]!==e||i[3]!==t?(r=()=>{if(e){o.current=t;return}n===null||o.current!==t||(o.current=null,s(n.title),Lke(t,n))},a=[t,e,n,s],i[0]=s,i[1]=n,i[2]=e,i[3]=t,i[4]=r,i[5]=a):(r=i[4],a=i[5]),_.useEffect(r,a)},Dke=t=>{var y,v;const e=ee.c(14),n=ui(),s=Io();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[o,r]=_.useState(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=S=>{r(w=>w.filter(N=>N!==S))},e[1]=a):a=e[1];const c=a;let d;if(e[2]!==s||e[3]!==n.review.editContext||e[4]!==n.review.get){let S;e[6]!==s||e[7]!==n.review.get?(S=async(w,N)=>{const{segmentId:C}=N;w.kind==="saved"&&(await s.invalidateQueries(n.review.get.pathFilter()),c(C))},e[6]=s,e[7]=n.review.get,e[8]=S):S=e[8],d=n.review.editContext.mutationOptions({onSuccess:S}),e[2]=s,e[3]=n.review.editContext,e[4]=n.review.get,e[5]=d}else d=e[5];const f=Wn(d),m=(((y=f.data)==null?void 0:y.kind)==="rejected"?f.data.message:null)??((v=f.error)==null?void 0:v.message)??null;let g;return e[9]!==f||e[10]!==m||e[11]!==t||e[12]!==o?(g=S=>{var N;const w=((N=f.variables)==null?void 0:N.segmentId)===S;return{isWriting:o.includes(S),isSaving:w&&f.isPending,errorMessage:w?m:null,onEdit:()=>{w&&f.reset(),r(C=>[...C,S])},onSave:C=>{f.mutate({...t,segmentId:S,context:C})},onCancel:()=>{w&&f.reset(),c(S)}}},e[9]=f,e[10]=m,e[11]=t,e[12]=o,e[13]=g):g=e[13],g},jke=5e3,Pke=(t,e,n)=>{var D,P;const s=ee.c(36),i=ui(),[o,r]=_.useState("unchecked");let a;s[0]!==t||s[1]!==i.review.liveAgent?(a=i.review.liveAgent.queryOptions(t),s[0]=t,s[1]=i.review.liveAgent,s[2]=a):a=s[2];let c;s[3]!==a?(c={...a,refetchInterval:jke,refetchIntervalInBackground:!0},s[3]=a,s[4]=c):c=s[4];const{data:d}=fr(c);let f;s[5]!==t||s[6]!==i.review.writeUpPlan?(f=i.review.writeUpPlan.queryOptions({...t,sections:null}),s[5]=t,s[6]=i.review.writeUpPlan,s[7]=f):f=s[7];let p;s[8]!==e||s[9]!==f?(p={...f,enabled:e},s[8]=e,s[9]=f,s[10]=p):p=s[10];const m=fr(p),g=((D=m.data)==null?void 0:D.kind)==="plan"?m.data.isOffered:null,y=(d==null?void 0:d.kind)==="live"?d:null,v=y!==null&&!y.isOnline;o==="unchecked"&&y!==null&&g!==null&&r(g&&v?"open":"closed");let S;if(s[11]!==n||s[12]!==i.review.openAgentTerminal){let B,I;s[14]!==n?(B=F=>{F.kind==="opened"&&(r("closed"),n.onMessage(F.message))},I=F=>{n.onMessage(F.message)},s[14]=n,s[15]=B,s[16]=I):(B=s[15],I=s[16]),S=i.review.openAgentTerminal.mutationOptions({onSuccess:B,onError:I}),s[11]=n,s[12]=i.review.openAgentTerminal,s[13]=S}else S=s[13];const w=Wn(S);let N;s[17]!==w?(N=()=>{w.reset(),r("open")},s[17]=w,s[18]=N):N=s[18];const C=N;let T;s[19]!==y||s[20]!==C?(T=y===null?null:{isOnline:y.isOnline,label:y.statusLabel,onClick:y.isOnline?null:C},s[19]=y,s[20]=C,s[21]=T):T=s[21];const R=o==="open"&&v?y.dialog:null,A=((P=w.data)==null?void 0:P.kind)==="rejected"?w.data.message:null;let k;s[22]!==v||s[23]!==C?(k=()=>{v&&C()},s[22]=v,s[23]=C,s[24]=k):k=s[24];let M;s[25]!==t||s[26]!==w?(M=()=>{w.mutate(t)},s[25]=t,s[26]=w,s[27]=M):M=s[27];let L;s[28]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{r("closed")},s[28]=L):L=s[28];let j;return s[29]!==M||s[30]!==T||s[31]!==R||s[32]!==A||s[33]!==k||s[34]!==w.isPending?(j={status:T,dialog:R,isOpening:w.isPending,problem:A,onAgentAction:k,onOpenTerminal:M,onClose:L},s[29]=M,s[30]=T,s[31]=R,s[32]=A,s[33]=k,s[34]=w.isPending,s[35]=j):j=s[35],j},zke=10,Bke="Review submitted",Dy=t=>Number.parseInt(t,zke),AI=(t,e)=>({path:t,side:e.side,startLine:Dy(e.startLineLabel),endLine:Dy(e.lineLabel)}),$ke=(t,e,n,s)=>{if(n===null)return null;const i={path:e,anchorLineLabel:n.lineLabel,range:{side:n.side,startLineLabel:n.lineLabel,lineLabel:n.lineLabel}};if(!s||(t==null?void 0:t.path)!==e||t.range.side!==n.side)return i;const o=Dy(t.anchorLineLabel),r=Dy(n.lineLabel);return{...t,range:{side:n.side,startLineLabel:String(Math.min(o,r)),lineLabel:String(Math.max(o,r))}}},Fke=(t,e)=>{var Oe;const n=ee.c(90),s=ui(),i=Io(),[o,r]=_.useState(null),[a,c]=_.useState(0),[d,f]=_.useState(""),[p,m]=_.useState(!1),g=_.useDeferredValue(d);let y;n[0]!==i||n[1]!==s.review.get?(y=async()=>{await i.invalidateQueries(s.review.get.pathFilter())},n[0]=i,n[1]=s.review.get,n[2]=y):y=n[2];const v=y;let S;n[3]!==i||n[4]!==v||n[5]!==s.review.searchReviewers?(S=async()=>{await Promise.all([v(),i.invalidateQueries(s.review.searchReviewers.pathFilter())])},n[3]=i,n[4]=v,n[5]=s.review.searchReviewers,n[6]=S):S=n[6];const w=S;let N;n[7]!==e?(N=be=>{e(be.message)},n[7]=e,n[8]=N):N=n[8];const C=N,T={onSuccess:v,onError:C};let R;if(n[9]!==v||n[10]!==C||n[11]!==s.review.addComment){let be;n[13]!==v?(be=async()=>{r(null),await v()},n[13]=v,n[14]=be):be=n[14],R=s.review.addComment.mutationOptions({onSuccess:be,onError:C}),n[9]=v,n[10]=C,n[11]=s.review.addComment,n[12]=R}else R=n[12];const A=Wn(R),k=Wn(s.review.discardComment.mutationOptions(T)),M=Wn(s.review.replyToThread.mutationOptions(T)),L=Wn(s.review.resolveThread.mutationOptions(T));let j;if(n[15]!==i||n[16]!==v||n[17]!==e||n[18]!==s.repository||n[19]!==s.review.submit){let be;n[21]!==i||n[22]!==v||n[23]!==e||n[24]!==s.repository?(be=async()=>{c(Hke),e(Bke),await Promise.all([v(),i.invalidateQueries(s.repository.list.pathFilter())])},n[21]=i,n[22]=v,n[23]=e,n[24]=s.repository,n[25]=be):be=n[25],j=s.review.submit.mutationOptions({onSuccess:be}),n[15]=i,n[16]=v,n[17]=e,n[18]=s.repository,n[19]=s.review.submit,n[20]=j}else j=n[20];const D=Wn(j);let P;n[26]!==w||n[27]!==C||n[28]!==s.review.requestReviewer?(P=s.review.requestReviewer.mutationOptions({onSuccess:w,onError:C}),n[26]=w,n[27]=C,n[28]=s.review.requestReviewer,n[29]=P):P=n[29];const B=Wn(P);let I;n[30]!==w||n[31]!==C||n[32]!==s.review.removeReviewRequest?(I=s.review.removeReviewRequest.mutationOptions({onSuccess:w,onError:C}),n[30]=w,n[31]=C,n[32]=s.review.removeReviewRequest,n[33]=I):I=n[33];const F=Wn(I);let z;n[34]!==g||n[35]!==t||n[36]!==s.review.searchReviewers?(z=s.review.searchReviewers.queryOptions({...t,query:g}),n[34]=g,n[35]=t,n[36]=s.review.searchReviewers,n[37]=z):z=n[37];let U;n[38]!==p||n[39]!==z?(U={...z,enabled:p,placeholderData:jy},n[38]=p,n[39]=z,n[40]=U):U=n[40];const H=fr(U);let V;n[41]!==o?(V=be=>(o==null?void 0:o.path)===be?o.range:null,n[41]=o,n[42]=V):V=n[42];const W=A.isPending||M.isPending||L.isPending||k.isPending,G=((Oe=D.error)==null?void 0:Oe.message)??null,Y=H.data??null,J=B.isPending||F.isPending;let q;n[43]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{m(!0)},n[43]=q):q=n[43];let X;n[44]!==B||n[45]!==t?(X=be=>{B.mutate({...t,login:be})},n[44]=B,n[45]=t,n[46]=X):X=n[46];let Z;n[47]!==F||n[48]!==t?(Z=be=>{F.mutate({...t,login:be})},n[47]=F,n[48]=t,n[49]=Z):Z=n[49];let te;n[50]!==d||n[51]!==Y||n[52]!==J||n[53]!==X||n[54]!==Z?(te={query:d,options:Y,isPending:J,onOpen:q,onSearch:f,onRequest:X,onRemove:Z},n[50]=d,n[51]=Y,n[52]=J,n[53]=X,n[54]=Z,n[55]=te):te=n[55];let Q,se;n[56]===Symbol.for("react.memo_cache_sentinel")?(Q=(be,_e,Me)=>{r(Be=>$ke(Be,be,_e,Me))},se=(be,_e)=>{r({path:be,anchorLineLabel:_e.startLineLabel,range:_e})},n[56]=Q,n[57]=se):(Q=n[56],se=n[57]);let ae,le,ne;n[58]!==A||n[59]!==t?(ae=(be,_e,Me)=>{A.mutate({...t,position:AI(be,_e),body:Me,shouldPostNow:!1})},le=(be,_e,Me)=>{A.mutate({...t,position:AI(be,_e),body:Me,shouldPostNow:!0})},ne=be=>{A.mutate({...t,position:null,body:be,shouldPostNow:!0})},n[58]=A,n[59]=t,n[60]=ae,n[61]=le,n[62]=ne):(ae=n[60],le=n[61],ne=n[62]);let fe;n[63]!==M||n[64]!==t?(fe=(be,_e)=>{M.mutate({...t,threadId:be,body:_e})},n[63]=M,n[64]=t,n[65]=fe):fe=n[65];let ve;n[66]!==L||n[67]!==t?(ve=(be,_e)=>{L.mutate({...t,threadId:be,isResolved:_e})},n[66]=L,n[67]=t,n[68]=ve):ve=n[68];let we;n[69]!==k||n[70]!==t?(we=be=>{k.mutate({...t,commentId:be})},n[69]=k,n[70]=t,n[71]=we):we=n[71];let Ce;n[72]!==t||n[73]!==D?(Ce=(be,_e)=>{D.mutate({...t,verdict:be,body:_e})},n[72]=t,n[73]=D,n[74]=Ce):Ce=n[74];let ye;return n[75]!==k.isPending||n[76]!==a||n[77]!==D.isPending||n[78]!==W||n[79]!==G||n[80]!==te||n[81]!==ae||n[82]!==le||n[83]!==ne||n[84]!==fe||n[85]!==ve||n[86]!==we||n[87]!==Ce||n[88]!==V?(ye={composingRangeOf:V,isCommentPending:W,isSubmitting:D.isPending,isDiscarding:k.isPending,submissionCount:a,submissionError:G,reviewerRequesting:te,onStartComment:Q,onStartRangeComment:se,onAddComment:ae,onPostComment:le,onComment:ne,onReply:fe,onResolveThread:ve,onDiscardComment:we,onSubmit:Ce},n[75]=k.isPending,n[76]=a,n[77]=D.isPending,n[78]=W,n[79]=G,n[80]=te,n[81]=ae,n[82]=le,n[83]=ne,n[84]=fe,n[85]=ve,n[86]=we,n[87]=Ce,n[88]=V,n[89]=ye):ye=n[89],ye};function Hke(t){return t+1}const _I=t=>t.kind==="add"||t.kind==="change",Uke=(t,e)=>{var B,I,F;const n=ee.c(44),s=ui(),i=Io();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],n[0]=o):o=n[0];const[r,a]=_.useState(o),[c,d]=_.useState(!1);let f;n[1]===Symbol.for("react.memo_cache_sentinel")?(f=z=>{a(U=>U.filter(H=>H!==z))},n[1]=f):f=n[1];const p=f;let m;if(n[2]!==e||n[3]!==i||n[4]!==s.review.editSegments||n[5]!==s.review.get){let z;n[7]!==e||n[8]!==i||n[9]!==s.review.get?(z=async(H,V)=>{const{edit:W}=V;if(H.kind==="rejected"){_I(W)||e(H.message);return}await i.invalidateQueries(s.review.get.pathFilter()),W.kind==="add"&&d(!1),(W.kind==="change"||W.kind==="remove")&&p(W.segmentId)},n[7]=e,n[8]=i,n[9]=s.review.get,n[10]=z):z=n[10];let U;n[11]!==e?(U=(H,V)=>{const{edit:W}=V;_I(W)||e(H.message)},n[11]=e,n[12]=U):U=n[12],m=s.review.editSegments.mutationOptions({onSuccess:z,onError:U}),n[2]=e,n[3]=i,n[4]=s.review.editSegments,n[5]=s.review.get,n[6]=m}else m=n[6];const g=Wn(m);let y;n[13]!==g||n[14]!==t?(y=z=>{g.mutate({...t,edit:"paths"in z?{...z,paths:[...z.paths]}:z})},n[13]=g,n[14]=t,n[15]=y):y=n[15];const v=y,S=((B=g.variables)==null?void 0:B.edit)??null,N=(((I=g.data)==null?void 0:I.kind)==="rejected"?g.data.message:null)??((F=g.error)==null?void 0:F.message)??null,C=(S==null?void 0:S.kind)==="add";let T;n[16]!==v?(T=(z,U)=>{v({kind:"move",segmentId:z,direction:U})},n[16]=v,n[17]=T):T=n[17];const R=C&&g.isPending,A=C?N:null;let k;n[18]!==g||n[19]!==C?(k=()=>{C&&g.reset(),d(!0)},n[18]=g,n[19]=C,n[20]=k):k=n[20];let M;n[21]!==v?(M=z=>{v({kind:"add",...z})},n[21]=v,n[22]=M):M=n[22];let L;n[23]!==g||n[24]!==C?(L=()=>{C&&g.reset(),d(!1)},n[23]=g,n[24]=C,n[25]=L):L=n[25];let j;n[26]!==c||n[27]!==R||n[28]!==A||n[29]!==k||n[30]!==M||n[31]!==L?(j={isWriting:c,isSaving:R,errorMessage:A,onEdit:k,onSave:M,onCancel:L},n[26]=c,n[27]=R,n[28]=A,n[29]=k,n[30]=M,n[31]=L,n[32]=j):j=n[32];let D;n[33]!==g||n[34]!==N||n[35]!==S||n[36]!==v||n[37]!==r?(D=z=>{const U=(S==null?void 0:S.kind)==="change"&&S.segmentId===z;return{writing:{isWriting:r.includes(z),isSaving:U&&g.isPending,errorMessage:U?N:null,onEdit:()=>{U&&g.reset(),a(H=>H.includes(z)?H:[...H,z])},onSave:H=>{v({kind:"change",segmentId:z,...H})},onCancel:()=>{U&&g.reset(),p(z)}},isPending:g.isPending,onRemove:()=>{v({kind:"remove",segmentId:z})}}},n[33]=g,n[34]=N,n[35]=S,n[36]=v,n[37]=r,n[38]=D):D=n[38];let P;return n[39]!==g.isPending||n[40]!==j||n[41]!==D||n[42]!==T?(P={isPending:g.isPending,onMove:T,addition:j,authoringOf:D},n[39]=g.isPending,n[40]=j,n[41]=D,n[42]=T,n[43]=P):P=n[43],P},Vke="Loading the branches…",qke=t=>{var w;const e=ee.c(18),n=ui(),s=hm(),[i,o]=_.useState(!1),[r,a]=_.useState(""),c=_.useDeferredValue(r);let d;e[0]!==c||e[1]!==t||e[2]!==n.review.targetSwitcher?(d=n.review.targetSwitcher.queryOptions({...t,query:c}),e[0]=c,e[1]=t,e[2]=n.review.targetSwitcher,e[3]=d):d=e[3];let f;e[4]!==i||e[5]!==d?(f={...d,enabled:i,placeholderData:jy},e[4]=i,e[5]=d,e[6]=f):f=e[6];const p=fr(f),m=p.data??null,g=((w=p.error)==null?void 0:w.message)??Vke;let y;e[7]!==p?(y=()=>{o(!0),p.refetch()},e[7]=p,e[8]=y):y=e[8];let v;e[9]!==s||e[10]!==t?(v=N=>{a(""),s({to:"/pr-reviews/$repoName/$branchId",params:{repoName:t.repositoryName,branchId:N}})},e[9]=s,e[10]=t,e[11]=v):v=e[11];let S;return e[12]!==r||e[13]!==m||e[14]!==g||e[15]!==y||e[16]!==v?(S={switcher:m,placeholder:g,query:r,onOpen:y,onSearch:a,onSwitch:v},e[12]=r,e[13]=m,e[14]=g,e[15]=y,e[16]=v,e[17]=S):S=e[17],S},Wke=2500,Gke=()=>{const t=ee.c(6),[e,n]=_.useState(null);let s,i;t[0]!==e?(s=()=>{if(e===null)return;const d=window.setTimeout(()=>{n(null)},Wke);return()=>{window.clearTimeout(d)}},i=[e],t[0]=e,t[1]=s,t[2]=i):(s=t[1],i=t[2]),_.useEffect(s,i);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=d=>{n({message:d})},t[3]=o):o=t[3];const r=o,a=(e==null?void 0:e.message)??null;let c;return t[4]!==a?(c=[a,r],t[4]=a,t[5]=c):c=t[5],c},Kke="The line you drew ends at this card.",Yke=["add-card","change-card","describe"],MI=t=>Yke.includes(t.kind),Xke=(t,e)=>{var z,U,H,V,W;const n=ee.c(53),s=ui(),i=Io(),[o,r]=_.useState(null),[a,c]=_.useState(null);let d;n[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],n[0]=d):d=n[0];const[f,p]=_.useState(d);let m;n[1]===Symbol.for("react.memo_cache_sentinel")?(m=G=>{p(Y=>Y.filter(J=>J!==G))},n[1]=m):m=n[1];const g=m;let y;if(n[2]!==e||n[3]!==i||n[4]!==s.review.cardBlocks||n[5]!==s.review.cardForm||n[6]!==s.review.editTrace||n[7]!==s.review.get){let G;n[9]!==e||n[10]!==i||n[11]!==s.review.cardBlocks||n[12]!==s.review.cardForm||n[13]!==s.review.get?(G=async(J,q)=>{const{segmentId:X,edit:Z}=q;if(J.kind==="rejected"){MI(Z)||e(J.message);return}await Promise.all([i.invalidateQueries(s.review.get.pathFilter()),i.invalidateQueries(s.review.cardForm.pathFilter()),i.invalidateQueries(s.review.cardBlocks.pathFilter())]),Z.kind==="add-card"&&(r(null),c(J.nodeId===null?null:{segmentId:X,nodeId:J.nodeId})),Z.kind==="change-card"&&c(null),Z.kind==="describe"&&g(X)},n[9]=e,n[10]=i,n[11]=s.review.cardBlocks,n[12]=s.review.cardForm,n[13]=s.review.get,n[14]=G):G=n[14];let Y;n[15]!==e?(Y=(J,q)=>{const{edit:X}=q;MI(X)||e(J.message)},n[15]=e,n[16]=Y):Y=n[16],y=s.review.editTrace.mutationOptions({onSuccess:G,onError:Y}),n[2]=e,n[3]=i,n[4]=s.review.cardBlocks,n[5]=s.review.cardForm,n[6]=s.review.editTrace,n[7]=s.review.get,n[8]=y}else y=n[8];const v=Wn(y);let S;n[17]!==v||n[18]!==t?(S=(G,Y)=>{v.mutate({...t,segmentId:G,edit:Y})},n[17]=v,n[18]=t,n[19]=S):S=n[19];const w=S,N=((z=v.variables)==null?void 0:z.edit)??null,T=(((U=v.data)==null?void 0:U.kind)==="rejected"?v.data.message:null)??((H=v.error)==null?void 0:H.message)??null,R=(N==null?void 0:N.kind)==="add-card";let A;n[20]!==v||n[21]!==R?(A=G=>{R&&v.reset(),r(G)},n[20]=v,n[21]=R,n[22]=A):A=n[22];const k=A,M=(N==null?void 0:N.kind)==="change-card";let L;n[23]!==((V=v.variables)==null?void 0:V.segmentId)||n[24]!==(N==null?void 0:N.kind)?(L=G=>{var Y;return(N==null?void 0:N.kind)==="describe"&&((Y=v.variables)==null?void 0:Y.segmentId)===G},n[23]=(W=v.variables)==null?void 0:W.segmentId,n[24]=N==null?void 0:N.kind,n[25]=L):L=n[25];const j=L;let D;n[26]!==w?(D=G=>({onMoveCards:Y=>{w(G,{kind:"move-cards",places:[...Y]})}}),n[26]=w,n[27]=D):D=n[27];let P;n[28]!==f||n[29]!==v||n[30]!==T||n[31]!==M||n[32]!==j||n[33]!==w||n[34]!==k?(P=G=>({board:{isPending:v.isPending,onAddCard:()=>{k({segmentId:G,lineEnd:null})},onClearDiagram:()=>{w(G,{kind:"clear-diagram"})},onRemoveDiagram:()=>{w(G,{kind:"remove-diagram"})},onAddCardAtLineEnd:Y=>{k({segmentId:G,lineEnd:{...Y,places:[...Y.places]}})},onDrawLine:Y=>{w(G,{kind:"add-line",...Y})},onRemoveLine:Y=>{w(G,{kind:"remove-line",...Y})},onEditCard:Y=>{M&&v.reset(),c({segmentId:G,nodeId:Y})},onRemoveCard:Y=>{w(G,{kind:"remove-card",nodeId:Y})}},description:{isWriting:f.includes(G),isSaving:j(G)&&v.isPending,errorMessage:j(G)?T:null,onEdit:()=>{j(G)&&v.reset(),p(Y=>[...Y,G])},onSave:Y=>{w(G,{kind:"describe",description:Y})},onCancel:()=>{j(G)&&v.reset(),g(G)}},onAddDiagram:()=>{w(G,{kind:"add-diagram"})}}),n[28]=f,n[29]=v,n[30]=T,n[31]=M,n[32]=j,n[33]=w,n[34]=k,n[35]=P):P=n[35];let B;n[36]!==o||n[37]!==v.isPending||n[38]!==T||n[39]!==R||n[40]!==w?(B=o===null?null:{segmentId:o.segmentId,note:o.lineEnd===null?null:Kke,isSaving:R&&v.isPending,errorMessage:R?T:null,onSubmit:G=>{w(o.segmentId,{kind:"add-card",...G,...o.lineEnd===null?{}:{lineEnd:o.lineEnd}})},onClose:()=>{r(null)}},n[36]=o,n[37]=v.isPending,n[38]=T,n[39]=R,n[40]=w,n[41]=B):B=n[41];let I;n[42]!==v.isPending||n[43]!==T||n[44]!==M||n[45]!==a||n[46]!==w?(I=a===null?null:{...a,isSaving:M&&v.isPending,errorMessage:M?T:null,onSave:G=>{w(a.segmentId,{kind:"change-card",nodeId:a.nodeId,...G})},onClose:()=>{c(null)}},n[42]=v.isPending,n[43]=T,n[44]=M,n[45]=a,n[46]=w,n[47]=I):I=n[47];let F;return n[48]!==D||n[49]!==P||n[50]!==B||n[51]!==I?(F={cardMovingOf:D,authoringOf:P,cardAddition:B,cardChange:I},n[48]=D,n[49]=P,n[50]=B,n[51]=I,n[52]=F):F=n[52],F},Qke=(t,e)=>{const n=ee.c(21),s=ui(),i=Io();let o;if(n[0]!==e||n[1]!==i||n[2]!==s.review.editWalkthrough||n[3]!==s.review.get){let p;n[5]!==e||n[6]!==i||n[7]!==s.review.get?(p=async g=>{g.kind==="rejected"?e(g.message):await i.invalidateQueries(s.review.get.pathFilter())},n[5]=e,n[6]=i,n[7]=s.review.get,n[8]=p):p=n[8];let m;n[9]!==e?(m=g=>{e(g.message)},n[9]=e,n[10]=m):m=n[10],o=s.review.editWalkthrough.mutationOptions({onSuccess:p,onError:m}),n[0]=e,n[1]=i,n[2]=s.review.editWalkthrough,n[3]=s.review.get,n[4]=o}else o=n[4];const r=Wn(o);let a,c,d;n[11]!==r||n[12]!==t?(a=(p,m,g,y)=>{r.mutate({...t,segmentId:p,edit:{kind:"move-file",path:m,direction:g,shownPaths:[...y]}})},c=(p,m)=>{r.mutate({...t,segmentId:p,edit:{kind:"remove-file",path:m}})},d=(p,m)=>{r.mutate({...t,segmentId:p,edit:{kind:"remove-waypoint",waypointId:m}})},n[11]=r,n[12]=t,n[13]=a,n[14]=c,n[15]=d):(a=n[13],c=n[14],d=n[15]);let f;return n[16]!==r.isPending||n[17]!==a||n[18]!==c||n[19]!==d?(f={isPending:r.isPending,onMoveFile:a,onRemoveFile:c,onRemoveWaypoint:d},n[16]=r.isPending,n[17]=a,n[18]=c,n[19]=d,n[20]=f):f=n[20],f},Zke=_.lazy(async()=>await un(()=>import("./index-CrCss1qG.js"),__vite__mapDeps([26,25]))),Jke="Loading the editor…",eAe="Remove the file from the walkthrough",LI="Edit the waypoint",tAe="Remove the waypoint",nAe="my-1.5 mr-4 ml-28 rounded-md border border-foreground bg-background p-4 font-sans whitespace-normal",II=(t,e)=>t.rows.flatMap(n=>n.kind==="waypoint"&&n.waypoint.id===e?[n.waypoint]:[]).at(0)??null,sAe=(t,e)=>{const n=ee.c(15),[s,i]=_.useState(null);let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{i(null)},n[0]=o):o=n[0];const r=o;let a;n[1]!==e||n[2]!==t?(a=(y,v)=>b.jsx("div",{id:v.anchorId,className:nAe,children:b.jsx(_.Suspense,{fallback:b.jsx("p",{className:"text-muted-foreground",children:Jke}),children:b.jsx(Zke,{reviewKey:t,segmentId:y,waypointId:v.id,legend:`${LI}: ${v.title}`,text:v.text,renderCodeLinkDialog:e.renderCodeLinkDialog,onClose:r})})}),n[1]=e,n[2]=t,n[3]=a):a=n[3];const c=a;let d;n[4]!==e?(d=(y,v)=>b.jsxs(b.Fragment,{children:[b.jsx(xs,{icon:"edit",label:`${LI}: ${v.title}`,onClick:()=>{i(v.id)}}),b.jsx(xs,{icon:"delete",label:`${tAe}: ${v.title}`,isDisabled:e.isPending,onClick:()=>{e.onRemoveWaypoint(y,v.id)}})]}),n[4]=e,n[5]=d):d=n[5];const f=d;let p;n[6]!==s||n[7]!==f||n[8]!==c?(p=(y,v)=>({editedWaypointId:s,renderEditor:S=>{const w=II(v,S);return w===null?null:c(y,w)},renderActions:S=>{const w=II(v,S);return w===null?null:f(y,w)},onWriteDescription:i}),n[6]=s,n[7]=f,n[8]=c,n[9]=p):p=n[9];let m;n[10]!==e?(m=(y,v)=>b.jsx(xs,{icon:"remove",label:`${eAe}: ${v.path}`,isDisabled:e.isPending,onClick:()=>{e.onRemoveFile(y,v.path)}}),n[10]=e,n[11]=m):m=n[11];let g;return n[12]!==p||n[13]!==m?(g={onWriteDescription:i,authoringOf:p,headerActionsOf:m},n[12]=p,n[13]=m,n[14]=g):g=n[14],g},iAe=(t,e)=>t==="open"||t==="unasked"&&!e,oAe=(t,e,n)=>{var I,F;const s=ee.c(47),i=ui(),o=Io(),[r,a]=_.useState("unasked"),[c,d]=_.useState(null);let f;s[0]!==t||s[1]!==c||s[2]!==i.review.writeUpPlan?(f=i.review.writeUpPlan.queryOptions({...t,sections:c}),s[0]=t,s[1]=c,s[2]=i.review.writeUpPlan,s[3]=f):f=s[3];let p;s[4]!==e||s[5]!==f?(p={...f,enabled:e,placeholderData:jy},s[4]=e,s[5]=f,s[6]=p):p=s[6];const m=fr(p),g=((I=m.data)==null?void 0:I.kind)==="plan"?m.data:null;let y;s[7]!==o||s[8]!==i.review.get||s[9]!==i.review.writeUpPlan?(y=async()=>{await Promise.all([o.invalidateQueries(i.review.get.pathFilter()),o.invalidateQueries(i.review.writeUpPlan.pathFilter())])},s[7]=o,s[8]=i.review.get,s[9]=i.review.writeUpPlan,s[10]=y):y=s[10];const v=y;let S;s[11]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{a("closed"),d(null)},s[11]=S):S=s[11];const w=S;let N;s[12]!==v||s[13]!==i.review.declineWriteUp?(N=i.review.declineWriteUp.mutationOptions({onSuccess:v}),s[12]=v,s[13]=i.review.declineWriteUp,s[14]=N):N=s[14];const C=Wn(N);let T;if(s[15]!==n||s[16]!==v||s[17]!==i.review.writeUp){let z;s[19]!==n||s[20]!==v?(z=async H=>{H.kind!=="rejected"&&(w(),H.kind==="started"&&H.prompt!==null?n.onCopy(H.prompt,H.message):n.onMessage(H.message),H.kind==="started"&&H.prompt===null&&n.onAgentAsked(),await v())},s[19]=n,s[20]=v,s[21]=z):z=s[21];let U;s[22]!==n?(U=H=>{n.onMessage(H.message)},s[22]=n,s[23]=U):U=s[23],T=i.review.writeUp.mutationOptions({onSuccess:z,onError:U}),s[15]=n,s[16]=v,s[17]=i.review.writeUp,s[18]=T}else T=s[18];const R=Wn(T);let A;s[24]!==g||s[25]!==r?(A=g!==null&&iAe(r,g.isOffered)?g:null,s[24]=g,s[25]=r,s[26]=A):A=s[26];const k=g!==null;let M;s[27]!==g?(M=g===null?null:{name:g.agent,label:g.agentLabel},s[27]=g,s[28]=M):M=s[28];const L=((F=R.data)==null?void 0:F.kind)==="rejected"?R.data:null;let j;s[29]!==R?(j=()=>{R.reset(),a("open")},s[29]=R,s[30]=j):j=s[30];let D;s[31]!==t||s[32]!==R?(D=z=>{Mke(),R.mutate({...t,...z})},s[31]=t,s[32]=R,s[33]=D):D=s[33];let P;s[34]!==C||s[35]!==g||s[36]!==t?(P=()=>{g!==null&&!g.isOffered&&C.mutate(t),w()},s[34]=C,s[35]=g,s[36]=t,s[37]=P):P=s[37];let B;return s[38]!==j||s[39]!==D||s[40]!==P||s[41]!==A||s[42]!==k||s[43]!==M||s[44]!==L||s[45]!==R.isPending?(B={plan:A,canWriteUp:k,agent:M,problem:L,isPending:R.isPending,onOpen:j,onSectionsChange:d,onSubmit:D,onClose:P},s[38]=j,s[39]=D,s[40]=P,s[41]=A,s[42]=k,s[43]=M,s[44]=L,s[45]=R.isPending,s[46]=B):B=s[46],B},rAe=(t,e)=>{const n=ee.c(14),s=ui(),i=Io();let o;if(n[0]!==e||n[1]!==i||n[2]!==s.review.get||n[3]!==s.review.requestWriteUp){let c;n[5]!==e||n[6]!==i||n[7]!==s.review.get?(c=async f=>{f.kind==="started"&&f.prompt!==null?e.onCopy(f.prompt,f.message):e.onMessage(f.message),f.kind==="started"&&f.prompt===null&&e.onAgentAsked(),await i.invalidateQueries(s.review.get.pathFilter())},n[5]=e,n[6]=i,n[7]=s.review.get,n[8]=c):c=n[8];let d;n[9]!==e?(d=f=>{e.onMessage(f.message)},n[9]=e,n[10]=d):d=n[10],o=s.review.requestWriteUp.mutationOptions({onSuccess:c,onError:d}),n[0]=e,n[1]=i,n[2]=s.review.get,n[3]=s.review.requestWriteUp,n[4]=o}else o=n[4];const r=Wn(o);let a;return n[11]!==r||n[12]!==t?(a=c=>{r.mutate({...t,target:c})},n[11]=r,n[12]=t,n[13]=a):a=n[13],a},lAe=_.lazy(async()=>await un(()=>import("./index-D8-ze-TP.js"),__vite__mapDeps([27,25]))),aAe=_.lazy(async()=>await un(()=>import("./index-DB42uFFk.js"),__vite__mapDeps([28,25]))),cAe=_.lazy(async()=>await un(()=>import("./index-Ba3RqmDE.js"),__vite__mapDeps([24,25]))),uAe=_.lazy(async()=>await un(()=>import("./index-B4xFHIrG.js"),__vite__mapDeps([29,25]))),dAe=5e3,fAe="The backend did not say what went wrong.",hAe="Could not copy to the clipboard",sC="Loading the editor…",pAe="Add a segment",mAe="New segment",gAe="This Flight Plan has no segments yet.",yAe="Publish anyway",bAe="Arrange segments",xAe="Move a segment up or down. The order is saved as you go.",vAe="Arrange files",SAe="Move a file up or down in the Code Walkthrough. The order is saved as you go.",wAe=[],US=[],EAe="[--line:var(--primary-text)]",CAe="[--band-height:3.5rem] [--pinned-height:calc(var(--band-height)+var(--strip-height,0px))] [--section-scroll-margin:calc(var(--pinned-height)+1rem)] [--file-header-top:var(--pinned-height)] [--waypoint-scroll-margin:calc(var(--pinned-height)+3.5rem)] [--chat-width:26rem] [--navigator-inset-left:calc(1.5rem+13rem+2rem)]",NAe="[--strip-height:2.75rem]",TAe="[--navigator-inset-right:1.5rem]",OAe="[--navigator-inset-right:calc(var(--chat-width)+1.5rem)] [--navigator-band-right:var(--chat-width)]",RAe=t=>{const e=ee.c(6),{writingLabel:n,agent:s,children:i}=t;let o;e[0]!==s||e[1]!==i?(o=b.jsx(wb,{value:s,children:i}),e[0]=s,e[1]=i,e[2]=o):o=e[2];let r;return e[3]!==o||e[4]!==n?(r=b.jsx(U7,{value:n,children:o}),e[3]=o,e[4]=n,e[5]=r):r=e[5],r},VS=t=>b.jsx(_.Suspense,{fallback:b.jsx("p",{className:"text-sm text-muted-foreground",children:sC}),children:b.jsx(uAe,{...t})}),xH=(t,e)=>({repositoryName:t.repoName,targetId:t.branchId,filterKeys:[...e.filter??[]],isShowingReviewed:e.reviewed===!0}),e5e=t=>{var $e,Tt,Gt;const e=ee.c(152),{params:n,search:s,onSearchChange:i}=t,o=ui(),r=Io(),a=hm(),c=_.use(q6);let d;e[0]!==n.branchId||e[1]!==n.repoName?(d={repositoryName:n.repoName,targetId:n.branchId},e[0]=n.branchId,e[1]=n.repoName,e[2]=d):d=e[2];const f=d;let p;e[3]!==n||e[4]!==s||e[5]!==o.review.get?(p=o.review.get.queryOptions(xH(n,s)),e[3]=n,e[4]=s,e[5]=o.review.get,e[6]=p):p=e[6];let m;e[7]!==p?(m={...p,refetchInterval:dAe,refetchIntervalInBackground:!0},e[7]=p,e[8]=m):m=e[8];const{data:g}=$q(m),[y,v]=_.useState(null),[S,w]=_.useState(!1),[N,C]=_.useState(!1),[T,R]=_.useState(null),[A,k]=Gke(),{isOwn:M}=g,L=g.kind==="artifact"?g.progress:null;Ike(`${n.repoName}/${n.branchId}`,L!==null,g.kind==="artifact"?g.completion:null,k);const j=_ke(),D=Dke(f),P=Uke(f,k),B=Xke(f,k),I=Qke(f,k);let F;e[9]!==f?(F=Ie=>b.jsx(Yh,{reviewKey:f,...Ie}),e[9]=f,e[10]=F):F=e[10];let z;e[11]!==F||e[12]!==I.isPending||e[13]!==I.onRemoveFile||e[14]!==I.onRemoveWaypoint?(z={isPending:I.isPending,renderCodeLinkDialog:F,onRemoveFile:I.onRemoveFile,onRemoveWaypoint:I.onRemoveWaypoint},e[11]=F,e[12]=I.isPending,e[13]=I.onRemoveFile,e[14]=I.onRemoveWaypoint,e[15]=z):z=e[15];const U=sAe(f,z),H=Fke(f,k),V=Cke(f,k),W=qke(f),G=G6();let Y;e[16]!==r||e[17]!==o.review.get?(Y=async()=>{await r.invalidateQueries(o.review.get.pathFilter())},e[16]=r,e[17]=o.review.get,e[18]=Y):Y=e[18];const J=Y;let q;e[19]!==k?(q=Ie=>{k(Ie.message)},e[19]=k,e[20]=q):q=e[20];const X=q;let Z;e[21]!==k?(Z=(Ie,Xe)=>{navigator.clipboard.writeText(Ie).then(()=>{k(Xe)},()=>{k(hAe)})},e[21]=k,e[22]=Z):Z=e[22];const te=Z;let Q;e[23]!==k?(Q={onMessage:k},e[23]=k,e[24]=Q):Q=e[24];const se=Pke(f,g.kind==="artifact",Q);let ae;e[25]!==te||e[26]!==se.onAgentAction||e[27]!==k?(ae={onMessage:k,onCopy:te,onAgentAsked:se.onAgentAction},e[25]=te,e[26]=se.onAgentAction,e[27]=k,e[28]=ae):ae=e[28];const le=ae,ne=oAe(f,g.kind==="artifact",le),fe=rAe(f,le),ve=ne.canWriteUp?fe:null;let we;e[29]!==J||e[30]!==X||e[31]!==o.review.setReviewed?(we=o.review.setReviewed.mutationOptions({onSuccess:J,onError:X}),e[29]=J,e[30]=X,e[31]=o.review.setReviewed,e[32]=we):we=e[32];const Ce=Wn(we);let ye;if(e[33]!==J||e[34]!==X||e[35]!==k||e[36]!==o.review.publish){let Ie;e[38]!==J||e[39]!==k?(Ie=async Xe=>{const{message:mt}=Xe;k(mt),await J()},e[38]=J,e[39]=k,e[40]=Ie):Ie=e[40],ye=o.review.publish.mutationOptions({onSuccess:Ie,onError:X}),e[33]=J,e[34]=X,e[35]=k,e[36]=o.review.publish,e[37]=ye}else ye=e[37];const Oe=Wn(ye);let be;e[41]!==se||e[42]!==Oe||e[43]!==f?(be=Ie=>{Ie==="claude"&&se.onAgentAction(),Oe.mutate({...f,destination:Ie})},e[41]=se,e[42]=Oe,e[43]=f,e[44]=be):be=e[44];const _e=be;let Me;if(e[45]!==a||e[46]!==n.branchId||e[47]!==n.repoName||e[48]!==J||e[49]!==X||e[50]!==k||e[51]!==o.review.markComplete){let Ie;e[53]!==a||e[54]!==n.branchId||e[55]!==n.repoName||e[56]!==J||e[57]!==k?(Ie=async Xe=>{const{message:mt,targetId:jn}=Xe;k(mt),C(!1),await J(),jn!==n.branchId&&a({to:"/pr-reviews/$repoName/$branchId",params:{repoName:n.repoName,branchId:jn}})},e[53]=a,e[54]=n.branchId,e[55]=n.repoName,e[56]=J,e[57]=k,e[58]=Ie):Ie=e[58],Me=o.review.markComplete.mutationOptions({onSuccess:Ie,onError:X}),e[45]=a,e[46]=n.branchId,e[47]=n.repoName,e[48]=J,e[49]=X,e[50]=k,e[51]=o.review.markComplete,e[52]=Me}else Me=e[52];const Be=Wn(Me);let He;if(e[59]!==a||e[60]!==r||e[61]!==X||e[62]!==o.review.delete||e[63]!==o.review.get){let Ie;e[65]!==a||e[66]!==r||e[67]!==o.review.get?(Ie=async()=>{r.removeQueries(o.review.get.pathFilter()),await a({to:"/"})},e[65]=a,e[66]=r,e[67]=o.review.get,e[68]=Ie):Ie=e[68],He=o.review.delete.mutationOptions({onSuccess:Ie,onError:X}),e[59]=a,e[60]=r,e[61]=X,e[62]=o.review.delete,e[63]=o.review.get,e[64]=He}else He=e[64];const Ae=Wn(He),Ee=g.kind==="artifact"?g:null,Ne=(Ee==null?void 0:Ee.segments.find(Ie=>Ie.id===T))??null,xe=vke((Ee==null?void 0:Ee.segments)??US),Pe=xe.onOpenCodeLink,We=xe.onToggleWaypoint;let et,At;if(e[69]!==(Ee==null?void 0:Ee.rail.groups)||e[70]!==(Ee==null?void 0:Ee.rail.sections)){const Ie=[...(Ee==null?void 0:Ee.rail.groups.flatMap(_Ae))??[],...(Ee==null?void 0:Ee.rail.sections)??[]];et=$Oe,At=Ie.flatMap(LAe),e[69]=Ee==null?void 0:Ee.rail.groups,e[70]=Ee==null?void 0:Ee.rail.sections,e[71]=et,e[72]=At}else et=e[71],At=e[72];const ze=(Ee==null?void 0:Ee.segments)??US;let Te;e[73]!==ze?(Te=pke(ze),e[73]=ze,e[74]=Te):Te=e[74];const qe=et(At,Te);let ot;e[75]!==M||e[76]!==f||e[77]!==Ce?(ot=M?null:(Ie,Xe)=>{Ce.mutate({...f,subject:{kind:"waypoint",id:Ie},isReviewed:Xe})},e[75]=M,e[76]=f,e[77]=Ce,e[78]=ot):ot=e[78];let bt;e[79]!==i?(bt=Ie=>{i({filter:Ie===null?void 0:[...Ie]})},e[79]=i,e[80]=bt):bt=e[80];let Ct;e[81]!==M||e[82]!==i?(Ct=M?null:Ie=>{i({reviewed:Ie?!0:void 0})},e[81]=M,e[82]=i,e[83]=Ct):Ct=e[83];const En=M||(Ee==null?void 0:Ee.composer)==null?null:H.onStartRangeComment,Mt=M?U.onWriteDescription:null,jt=(($e=ne.agent)==null?void 0:$e.label)??null;let rn;e[84]!==ot||e[85]!==bt||e[86]!==Ct||e[87]!==En||e[88]!==Mt||e[89]!==jt||e[90]!==ve?(rn={onReviewedChange:ot,onFilterChange:bt,onShowReviewedChange:Ct,onCommentOnWaypoint:En,onWriteDescription:Mt,onWriteUp:ve,agentLabel:jt},e[84]=ot,e[85]=bt,e[86]=Ct,e[87]=En,e[88]=Mt,e[89]=jt,e[90]=ve,e[91]=rn):rn=e[91];const Cn=rke((Ee==null?void 0:Ee.segments)??US,xe,rn);let nn;e[92]!==(Ee==null?void 0:Ee.segments)||e[93]!==P?(nn=Ie=>{const Xe=Ee==null?void 0:Ee.segments.find(mt=>mt.anchorId===Ie);Xe!==void 0&&(P.authoringOf(Xe.id).writing.onEdit(),ZN(Ie))},e[92]=Ee==null?void 0:Ee.segments,e[93]=P,e[94]=nn):nn=e[94];const st=nn;let St;e[95]!==r||e[96]!==f||e[97]!==k||e[98]!==o.review.codeReference?(St=(Ie,Xe)=>{r.query({...o.review.codeReference.queryOptions({...f,path:Ie.path,lineStart:Ie.lineStart,lineEnd:Ie.lineEnd}),staleTime:"static"}).then(Xe,mt=>{k(mt instanceof Error?mt.message:fAe)})},e[95]=r,e[96]=f,e[97]=k,e[98]=o.review.codeReference,e[99]=St):St=e[99];const dn=St;let rt;e[100]!==V.isOpen||e[101]!==L?(rt=Se("px-6 pb-24 transition-[margin] duration-200 ease-out",V.isOpen?["mr-(--chat-width)",OAe]:TAe,EAe,CAe,L===null?null:NAe),e[100]=V.isOpen,e[101]=L,e[102]=rt):rt=e[102];let Wt;e[103]!==g.shell.documentTitle?(Wt=b.jsx("title",{children:g.shell.documentTitle}),e[103]=g.shell.documentTitle,e[104]=Wt):Wt=e[104];let _t;e[105]!==c||e[106]!==V.isOpen||e[107]!==V.onToggle||e[108]!==G||e[109]!==Ae||e[110]!==H||e[111]!==M||e[112]!==se.status||e[113]!==Be||e[114]!==g.changedFiles||e[115]!==g.chatLabel||e[116]!==g.completeAction||e[117]!==g.kind||e[118]!==g.reviewDraft||e[119]!==g.sharing||e[120]!==g.shell.authorLabel||e[121]!==g.shell.header||e[122]!==g.unassignedFiles||e[123]!==_e||e[124]!==Oe.isPending||e[125]!==Oe.variables||e[126]!==f||e[127]!==W||e[128]!==ne.canWriteUp||e[129]!==ne.onOpen?(_t=c===null?null:Vi.createPortal(b.jsxs(b.Fragment,{children:[b.jsx(Ane,{lineColor:"primary"}),b.jsx(cfe,{header:g.shell.header,changedFiles:g.kind==="missing"?g.changedFiles:null,authorLabel:g.shell.authorLabel,reviewerRequesting:H.reviewerRequesting,targetSwitching:W,agentStatus:se.status,actions:g.kind==="missing"?b.jsx($w,{links:yw,themeToggle:G}):b.jsxs(b.Fragment,{children:[b.jsx(pue,{label:g.chatLabel,isPressed:V.isOpen,onClick:V.onToggle}),!M||g.unassignedFiles===null?null:b.jsx(gue,{label:g.unassignedFiles.label,onClick:()=>{v({kind:"list"})}}),g.completeAction===null?null:b.jsx(mue,{label:g.completeAction.label,isPending:Be.isPending,onClick:()=>{var Ie;((Ie=g.completeAction)==null?void 0:Ie.pullRequestChoice)==null?Be.mutate({...f,pullRequestTargetId:null}):C(!0)}}),g.sharing===null?null:b.jsx(bue,{sharing:g.sharing,publishingKey:Oe.isPending?Oe.variables.destination:null,onPublish:Ie=>{g.unassignedFiles===null?_e(Ie):v({kind:"publish",destination:Ie})}}),g.reviewDraft===null?null:b.jsx(yue,{draft:g.reviewDraft,isSubmitting:H.isSubmitting,isDiscarding:H.isDiscarding,errorMessage:H.submissionError,submissionCount:H.submissionCount,renderEditor:VS,onSubmit:H.onSubmit,onDiscard:H.onDiscardComment}),b.jsx($w,{links:yw,themeToggle:G,reviewActions:{forgeLink:g.shell.header.kind==="pull-request"?g.shell.header.forgeLink:null,onWriteUp:ne.canWriteUp?ne.onOpen:null,onDelete:()=>{Ae.mutate(f)}}})]})})]}),c),e[105]=c,e[106]=V.isOpen,e[107]=V.onToggle,e[108]=G,e[109]=Ae,e[110]=H,e[111]=M,e[112]=se.status,e[113]=Be,e[114]=g.changedFiles,e[115]=g.chatLabel,e[116]=g.completeAction,e[117]=g.kind,e[118]=g.reviewDraft,e[119]=g.sharing,e[120]=g.shell.authorLabel,e[121]=g.shell.header,e[122]=g.unassignedFiles,e[123]=_e,e[124]=Oe.isPending,e[125]=Oe.variables,e[126]=f,e[127]=W,e[128]=ne.canWriteUp,e[129]=ne.onOpen,e[130]=_t):_t=e[130];let It;e[131]!==g.heading||e[132]!==g.kind||e[133]!==g.message?(It=g.kind==="missing"?b.jsx("div",{className:"max-w-208",children:b.jsx(ARe,{heading:g.heading,message:g.message})}):null,e[131]=g.heading,e[132]=g.kind,e[133]=g.message,e[134]=It):It=e[134];const Zt=g.kind==="missing"?null:b.jsx(soe,{rail:g.rail,onSectionJump:xe.onSectionEntered,children:b.jsxs(RAe,{writingLabel:((Tt=g.progress)==null?void 0:Tt.isWriting)===!0?g.progress.label:null,agent:ne.agent,children:[b.jsx(mRe,{staleNotice:g.staleNotice,unassignedFiles:M?null:g.unassignedFiles,progress:g.progress,onShowUnassignedFiles:()=>{v({kind:"list"})},onCopyPrompt:te}),b.jsxs("div",{className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8",children:[b.jsx("aside",{className:"sticky top-[calc(var(--pinned-height)+0.5rem)] max-h-[calc(100dvh-var(--pinned-height)-1rem)] self-start overflow-y-auto pt-5 pb-4",children:b.jsx(YOe,{label:"Review sections",groups:g.rail.groups,sections:g.rail.sections,readingPosition:qe,onEditGroup:M?st:null,onArrangeGroups:M&&g.segments.some(IAe)?()=>{w(!0)}:null})}),b.jsxs("div",{className:"min-w-0",children:[g.segments.map(Ie=>b.jsxs("section",{id:Ie.anchorId,"aria-label":(M?Ie.outline.heading:Ie.heading)??void 0,className:"scroll-mt-(--section-scroll-margin) not-first:border-t-4 not-first:border-foreground",children:[b.jsx(ORe,{reviewKey:f,heading:Ie.heading,isTitleDraft:Ie.isTitleDraft,detailLabel:Ie.detailLabel,outline:Ie.outline,authoring:M&&Ie.heading!==null?P.authoringOf(Ie.id):null}),b.jsx(Jce,{order:Ie.sectionOrder,sections:{context:b.jsx(kOe,{...Ie.context,writeUpNotice:Ie.writeUpNotices.context,codeLinks:g.codeLinks,editing:M?D(Ie.id):null,renderCodeLinkDialog:Xe=>b.jsx(Yh,{reviewKey:f,...Xe}),onOpenCodeLink:Pe}),traceDiagram:b.jsx(VSe,{...Ie.traceDiagram,writeUpNotice:Ie.writeUpNotices.traceDiagram,codeLinks:g.codeLinks,codeDefinitions:g.codeDefinitions,isReviewPending:Ce.isPending,authoring:M?B.authoringOf(Ie.id):null,cardMoving:g.canMoveCards?B.cardMovingOf(Ie.id):null,onWriteUpNode:ve===null?null:Xe=>{ve({kind:"trace-node",segmentId:Ie.id,nodeId:Xe})},tabEditing:{authoringOf:Xe=>M?B.authoringOf(Xe):null,cardMovingOf:Xe=>g.canMoveCards?B.cardMovingOf(Xe):null,writeUpOf:Xe=>ve===null?null:mt=>{ve({kind:"trace-node",segmentId:Xe,nodeId:mt})}},renderDescriptionEditor:M?Xe=>b.jsx(_.Suspense,{fallback:b.jsx("p",{className:"text-sm text-muted-foreground",children:sC}),children:b.jsx(cAe,{...Xe,renderCodeLinkDialog:mt=>b.jsx(Yh,{reviewKey:f,...mt})})}):null,onOpenCodeLink:Pe,onWaypointReviewedChange:M?null:(Xe,mt)=>{Ce.mutate({...f,subject:{kind:"waypoint",id:Xe},isReviewed:mt})}}),blastDiagram:b.jsx(b.Fragment,{children:Ie.blastDiagram===null?null:b.jsx(Nce,{...Ie.blastDiagram,writeUpNotice:Ie.writeUpNotices.blastDiagram,onWriteUpFile:ve===null?null:Xe=>{ve({kind:"blast-file",segmentId:Ie.id,path:Xe})},codeLinks:g.codeLinks,renderImpactEditor:M?Xe=>b.jsx(_.Suspense,{fallback:b.jsx("p",{className:"text-muted-foreground",children:sC}),children:b.jsx(aAe,{...Xe,reviewKey:f,renderCodeLinkDialog:mt=>b.jsx(Yh,{reviewKey:f,...mt})},Xe.path)}):null,onOpenCodeLink:Pe,onOpenFile:Pe})}),walkthrough:b.jsx(dRe,{anchorId:Ie.walkthrough.anchorId,heading:Ie.walkthrough.heading,coverageLabel:Ie.walkthrough.coverageLabel,emptyMessage:Ie.walkthrough.emptyMessage,writeUpNotice:Ie.writeUpNotices.walkthrough,readingPosition:qe,walkthroughStore:xe.store,navigationOf:(Xe,mt)=>Cn.navigationOf(Ie,Xe,mt),onArrangeFiles:M&&Ie.walkthrough.fileOrder.length>1?()=>{R(Ie.id)}:null,children:Ie.walkthrough.files.map(Xe=>b.jsx(qRe,{walkthroughStore:xe.store,file:Xe,isReviewPending:Ce.isPending,composer:M?null:g.composer,composingRange:H.composingRangeOf(Xe.path),isCommentPending:H.isCommentPending,renderCommentEditor:VS,codeLinks:g.codeLinks,codeDefinitions:g.codeDefinitions,onOpenCodeLink:Pe,onToggleWaypoint:We,onPreviewWaypoint:xe.onPreviewWaypoint,onCollapsedChange:mt=>{Cn.onFileCollapsedChange(Xe.anchorId,mt)},onWaypointReviewedChange:M?null:(mt,jn)=>{Ce.mutate({...f,subject:{kind:"waypoint",id:mt},isReviewed:jn})},onFileReviewedChange:M?null:(mt,jn)=>{Ce.mutate({...f,subject:{kind:"file",path:mt},isReviewed:jn})},onRootBlockReviewedChange:M?null:(mt,jn)=>{Ce.mutate({...f,subject:{kind:"root-block",id:mt},isReviewed:jn})},onStartComment:H.onStartComment,onAddComment:H.onAddComment,onPostComment:H.onPostComment,onReply:H.onReply,onResolveThread:H.onResolveThread,onDiscardComment:H.onDiscardComment,onWriteUp:ve,authoring:M?U.authoringOf(Ie.id,Xe):null,headerActions:M?U.headerActionsOf(Ie.id,Xe):null},Xe.anchorId))})}})]},Ie.id)),M&&g.segments.length===0&&!P.addition.isWriting?b.jsx("p",{className:"pt-6 text-muted-foreground",children:gAe}):null,M&&P.addition.isWriting?b.jsx(yH,{reviewKey:f,legend:mAe,label:"",paths:wAe,isSaving:P.addition.isSaving,isDeleting:!1,errorMessage:P.addition.errorMessage,onSave:P.addition.onSave,onDelete:null,onClose:P.addition.onCancel}):null,M&&!P.addition.isWriting&&g.segments.every(DAe)?b.jsx(ft,{variant:"outline",className:"mt-6",onClick:P.addition.onEdit,children:pAe}):null,g.conversation===null||g.composer===null?null:b.jsx(AOe,{anchorId:g.conversation.anchorId,heading:g.conversation.heading,emptyMessage:g.conversation.emptyMessage,entries:g.conversation.entries,placeholder:g.composer.placeholder,submitLabel:g.composer.commentLabel,isSubmitting:H.isCommentPending,renderEditor:VS,onComment:H.onComment})]})]}),S&&M?b.jsx(KM,{title:bAe,description:xAe,entries:g.segments.map(jAe),isPending:P.isPending,onMove:P.onMove,onClose:()=>{w(!1)}}):null,!M||Ne===null?null:b.jsx(KM,{title:vAe,description:SAe,entries:Ne.walkthrough.fileOrder.map(PAe),isPending:I.isPending,onMove:(Ie,Xe)=>{I.onMoveFile(Ne.id,Ie,Xe,Ne.walkthrough.fileOrder.map(zAe))},onClose:()=>{R(null)}}),!M||B.cardAddition===null?null:b.jsx(iEe,{reviewKey:f,addition:B.cardAddition}),!M||B.cardChange===null?null:b.jsx(_.Suspense,{fallback:null,children:b.jsx(lAe,{reviewKey:f,change:B.cardChange,renderCodeLinkDialog:Ie=>b.jsx(Yh,{reviewKey:f,...Ie})})}),ne.plan===null?null:b.jsx(wwe,{plan:ne.plan,problem:ne.problem,isPending:ne.isPending,onSectionsChange:ne.onSectionsChange,onSubmit:ne.onSubmit,onClose:ne.onClose}),N&&((Gt=g.completeAction)==null?void 0:Gt.pullRequestChoice)!=null?b.jsx(gOe,{choice:g.completeAction.pullRequestChoice,isPending:Be.isPending,onComplete:Ie=>{Be.mutate({...f,pullRequestTargetId:Ie})},onClose:()=>{C(!1)}}):null,y===null||g.unassignedFiles===null?null:b.jsx(LRe,{title:g.unassignedFiles.title,description:g.unassignedFiles.description,paths:g.unassignedFiles.paths,confirmation:y.kind==="list"?null:{warning:g.unassignedFiles.publishWarning,confirmLabel:yAe,onConfirm:()=>{_e(y.destination),v(null)}},onClose:()=>{v(null)}}),b.jsx(RRe,{selection:j,onComment:(Ie,Xe)=>{var mt;H.onStartRangeComment(Ie,Xe),(mt=window.getSelection())==null||mt.removeAllRanges()},onAsk:Ie=>{dn(Ie,Xe=>{const{reference:mt}=Xe;V.onAsk(mt),se.onAgentAction()})}}),V.isOpen&&V.conversation!==void 0?b.jsx(Wce,{conversation:V.conversation,modelChoice:V.modelChoice,codeLinks:g.codeLinks,reference:V.reference,isSending:V.isSending,sendProblem:V.sendProblem,answering:V.answering,onSend:Ie=>{V.onSend(Ie),se.onAgentAction()},onAnswer:(Ie,Xe)=>{V.onAnswer(Ie,Xe),se.onAgentAction()},onChooseModel:V.onChooseModel,onClearReference:V.onClearReference,onOpenCodeLink:Pe,onClose:V.onClose}):null,b.jsx(Eke,{walkthroughStore:xe.store}),b.jsx(W8,{}),b.jsx(wde,{reviewMode:M?"user":"teammate"})]})});let Nn;e[135]!==te||e[136]!==se.dialog||e[137]!==se.isOpening||e[138]!==se.onClose||e[139]!==se.onOpenTerminal||e[140]!==se.problem?(Nn=se.dialog===null?null:b.jsx(Zce,{content:se.dialog,isOpening:se.isOpening,problem:se.problem,onOpenTerminal:se.onOpenTerminal,onCopy:te,onClose:se.onClose}),e[135]=te,e[136]=se.dialog,e[137]=se.isOpening,e[138]=se.onClose,e[139]=se.onOpenTerminal,e[140]=se.problem,e[141]=Nn):Nn=e[141];let bn;e[142]!==A?(bn=b.jsx(ufe,{message:A}),e[142]=A,e[143]=bn):bn=e[143];let ln;return e[144]!==rt||e[145]!==Wt||e[146]!==_t||e[147]!==It||e[148]!==Zt||e[149]!==Nn||e[150]!==bn?(ln=b.jsxs("div",{className:rt,children:[Wt,_t,It,Zt,Nn,bn]}),e[144]=rt,e[145]=Wt,e[146]=_t,e[147]=It,e[148]=Zt,e[149]=Nn,e[150]=bn,e[151]=ln):ln=e[151],ln},t5e=t=>{const e=ee.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=b.jsx(rr,{to:"/",className:"underline",children:"Go to your repositories"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=b.jsx(uD,{heading:"MAYDAY! MAYDAY! We couldn't open this review",error:n,className:"px-6 pt-8",children:s}),e[1]=n,e[2]=i):i=e[2],i},kAe=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):void 0,AAe=t=>({filter:kAe(t.filter),reviewed:t.reviewed===!0?!0:void 0});function _Ae(t){return t.sections}function MAe(t){return t.anchorId}function LAe(t){return[t.anchorId,...t.children.map(MAe)]}function IAe(t){return t.outline.canMoveUp}function DAe(t){return t.heading!==null}function jAe(t){return{id:t.id,...t.outline}}function PAe(t){return{id:t.path,...t}}function zAe(t){return t.path}const BAe=()=>un(()=>import("./_branchId-7x6qWn3I.js"),[]),$Ae=()=>un(()=>import("./_branchId-OMHvVhfT.js"),[]),FAe=Ci()({staticData:{isFullWidth:!0,hasPageSettingsMenu:!0},validateSearch:AAe,loaderDeps:({search:t})=>t,loader:async({context:{queryClient:t,trpc:e},params:n,deps:s})=>{await t.query({...e.review.get.queryOptions(xH(n,s)),staleTime:"static"})},component:Dn($Ae,"component"),pendingComponent:One,errorComponent:Dn(BAe,"errorComponent")}),HAe=()=>un(()=>import("./create-CsL8aMCo.js"),[]),UAe=()=>un(()=>import("./create-B3JUVzoL.js"),[]),VAe=Ci()({loader:async({context:{queryClient:t,trpc:e},params:n})=>{await t.query({...e.review.creationForm.queryOptions({repositoryName:n.repoName}),staleTime:"static"})},component:Dn(UAe,"component"),errorComponent:Dn(HAe,"errorComponent")}),qAe=()=>un(()=>import("./index-DbJECumi.js"),__vite__mapDeps([30,6])),WAe=()=>un(()=>import("./index-4USZJYGF.js"),__vite__mapDeps([31,11])),GAe=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.configuration.list.queryOptions(),staleTime:"static"})},component:Dn(WAe,"component"),pendingComponent:ku,errorComponent:Dn(qAe,"errorComponent")}),KAe=()=>un(()=>import("./_id-CHxZrl-p.js"),__vite__mapDeps([32,6])),YAe=()=>un(()=>import("./_id-1eTNGJK9.js"),__vite__mapDeps([33,25])),XAe=Ci()({validateSearch:t=>typeof t.field=="string"?{field:t.field}:{},loaderDeps:({search:t})=>({field:t.field??null}),loader:async({context:{queryClient:t,trpc:e},params:n,deps:s})=>{await t.query({...e.configuration.get.queryOptions({id:n.id,field:s.field}),staleTime:"static"})},component:Dn(YAe,"component"),pendingComponent:ku,errorComponent:Dn(KAe,"errorComponent")}),QAe=()=>un(()=>import("./create-DhWyrgF0.js"),__vite__mapDeps([34,6])),ZAe=()=>un(()=>import("./create-CriuRRQV.js"),__vite__mapDeps([35,11])),JAe=Ci()({loader:async({context:{queryClient:t,trpc:e}})=>{await t.query({...e.configuration.creationForm.queryOptions(),staleTime:"static"})},component:Dn(ZAe,"component"),pendingComponent:ku,errorComponent:Dn(QAe,"errorComponent")}),e_e=Kte.update({id:"/",path:"/",getParentRoute:()=>Ru}),El=Xte.update({id:"/settings",path:"/settings",getParentRoute:()=>Ru}),t_e=Qte.update({id:"/",path:"/",getParentRoute:()=>El}),n_e=sne.update({id:"/agents",path:"/agents",getParentRoute:()=>El}),s_e=lne.update({id:"/forges",path:"/forges",getParentRoute:()=>El}),i_e=dne.update({id:"/repositories",path:"/repositories",getParentRoute:()=>El}),o_e=mne.update({id:"/review",path:"/review",getParentRoute:()=>El}),r_e=Ene.update({id:"/setup/",path:"/setup/",getParentRoute:()=>Ru}),l_e=Tne.update({id:"/artifact/claude/download",path:"/artifact/claude/download",getParentRoute:()=>Ru}),a_e=FAe.update({id:"/pr-reviews/$repoName/$branchId",path:"/pr-reviews/$repoName/$branchId",getParentRoute:()=>Ru}),c_e=VAe.update({id:"/pr-reviews/$repoName/create",path:"/pr-reviews/$repoName/create",getParentRoute:()=>Ru}),u_e=GAe.update({id:"/profiles/",path:"/profiles/",getParentRoute:()=>El}),d_e=XAe.update({id:"/profiles/$id",path:"/profiles/$id",getParentRoute:()=>El}),f_e=JAe.update({id:"/profiles/create",path:"/profiles/create",getParentRoute:()=>El}),h_e={SettingsAgentsRoute:n_e,SettingsForgesRoute:s_e,SettingsRepositoriesRoute:i_e,SettingsReviewRoute:o_e,SettingsIndexRoute:t_e,SettingsProfilesIdRoute:d_e,SettingsProfilesCreateRoute:f_e,SettingsProfilesIndexRoute:u_e},p_e=El._addFileChildren(h_e),m_e={IndexRoute:e_e,SettingsRouteRoute:p_e,SetupIndexRoute:r_e,ArtifactClaudeDownloadRoute:l_e,PrReviewsRepoNameBranchIdRoute:a_e,PrReviewsRepoNameCreateRoute:c_e},g_e=Ru._addFileChildren(m_e)._addFileTypes(),y_e=(t,e)=>jG({routeTree:g_e,context:t,defaultPreload:"intent",defaultPreloadStaleTime:0,...e===void 0?{}:{history:e}}),b_e=({queryClient:t,trpcClient:e,history:n})=>{const s=y_e({queryClient:t,trpc:zX(e,t)},n);return b.jsx(sq,{client:t,children:b.jsx(DX,{trpcClient:e,queryClient:t,children:b.jsx(BG,{router:s})})})},vH=document.getElementById("root");if(!vH)throw new Error("Missing #root element in index.html");const x_e=b_e({queryClient:new Rq,trpcClient:PX(jX())});Wq.createRoot(vH).render(b.jsx(_.StrictMode,{children:x_e}));export{O_e as $,Hf as A,ft as B,lu as C,vl as D,Se as E,Rne as F,$q as G,q6 as H,xs as I,Eu as J,Vi as K,mf as L,Ane as M,Zte as N,U6 as O,ine as P,ane as Q,Kte as R,Wwe as S,fne as T,$f as U,Ene as V,ole as W,ile as X,rle as Y,Hm as Z,$ce as _,T_e as a,_Te as a$,R_e as a0,ZSe as a1,rwe as a2,vt as a3,TK as a4,vw as a5,Tne as a6,Cne as a7,w_e as a8,t5e as a9,C_e as aA,rm as aB,XE as aC,Q_e as aD,Iy as aE,VF as aF,XTe as aG,X_e as aH,S4e as aI,Ke as aJ,Et as aK,ATe as aL,Z_e as aM,G_e as aN,Y_e as aO,Vt as aP,K_e as aQ,$_e as aR,B_e as aS,ut as aT,y4e as aU,__e as aV,Kn as aW,sH as aX,L_e as aY,iH as aZ,O4e as a_,FAe as aa,e5e as ab,hm as ac,VAe as ad,XAe as ae,r$ as af,a$ as ag,Qp as ah,yr as ai,sTe as aj,Ep as ak,VN as al,mn as am,tt as an,F_e as ao,q_e as ap,I_e as aq,C4e as ar,H_e as as,bTe as at,c3 as au,W_e as av,wC as aw,Po as ax,Oo as ay,Gi as az,Sl as b,Xb as b0,V_e as b1,U_e as b2,lm as b3,j_e as b4,je as b5,z_e as b6,P_e as b7,D_e as b8,ws as b9,GEe as ba,mNe as bb,Hn as bc,_o as bd,A_e as be,NNe as bf,CNe as bg,GN as bh,jC as bi,F7 as bj,Ky as bk,H7 as bl,$7 as bm,M_e as bn,c1 as bo,J_e as bp,ee as c,bl as d,xl as e,yl as f,gl as g,ui as h,Io as i,b as j,jy as k,fr as l,Wn as m,VP as n,qP as o,UP as p,N_e as q,_ as r,s$ as s,WP as t,Wi as u,Vd as v,nY as w,k_e as x,gp as y,rr as z};