@kidlat-dakila/flightplan 0.1.5 → 0.1.6

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 (55) hide show
  1. package/backend/main.js +286 -53
  2. package/frontend/assets/_branchId-CPb8-qBw.js +1 -0
  3. package/frontend/assets/{_branchId-BctD9BVI.js → _branchId-LiwHskkW.js} +1 -1
  4. package/frontend/assets/{_id-DS2_k7mD.js → _id-BDFgPH36.js} +1 -1
  5. package/frontend/assets/_id-DlHylI1F.js +1 -0
  6. package/frontend/assets/agents-BGNiGYQQ.js +1 -0
  7. package/frontend/assets/{agents-Cg-w99VB.js → agents-DBPulyWi.js} +1 -1
  8. package/frontend/assets/configuration-C8ZTSPna.js +1 -0
  9. package/frontend/assets/{configuration-B1tYKnw1.js → configuration-DBU-Fvop.js} +1 -1
  10. package/frontend/assets/{create-BXn1thks.js → create-BWsYjEs5.js} +1 -1
  11. package/frontend/assets/{create-DQsVrUIP.js → create-DBNC2wSp.js} +1 -1
  12. package/frontend/assets/{create-CNT_ktA4.js → create-DBv4ZLt7.js} +1 -1
  13. package/frontend/assets/create-DXgFUVIW.js +1 -0
  14. package/frontend/assets/{download-BsAZZo3P.js → download-BnmEn_Ca.js} +1 -1
  15. package/frontend/assets/{forges-ChElPpOV.js → forges-BOWrvfZl.js} +1 -1
  16. package/frontend/assets/forges-DwSiwqas.js +1 -0
  17. package/frontend/assets/{index-eMdhkBjo.js → index-B1Rm0SQ5.js} +1 -1
  18. package/frontend/assets/index-BKKD-dvv.js +1 -0
  19. package/frontend/assets/{index-C8gx27Rr.js → index-BaflOxvR.js} +1 -1
  20. package/frontend/assets/{index-h6dRc3tV.js → index-CR5UGYQN.js} +1 -1
  21. package/frontend/assets/{index-Dfzoepph.js → index-CSoB1eP_.js} +1 -1
  22. package/frontend/assets/{index-DgodP5aC.js → index-CUqlioqL.js} +1 -1
  23. package/frontend/assets/{index-Baaegu29.js → index-CZN7BV83.js} +1 -1
  24. package/frontend/assets/index-CeY9TXPf.js +1 -0
  25. package/frontend/assets/{index-9KbVyMz4.js → index-CydhSU9g.js} +1 -1
  26. package/frontend/assets/index-D-k5POv5.js +1 -0
  27. package/frontend/assets/{index-B7lg0P4V.js → index-DCCyA67N.js} +1 -1
  28. package/frontend/assets/{index-CX9sF5Fh.js → index-DfRj4oZV.js} +3 -3
  29. package/frontend/assets/index-Dn9qaXzX.js +1 -0
  30. package/frontend/assets/{index-DzSYBwXV.js → index-Dw5NpM9d.js} +1 -1
  31. package/frontend/assets/{index-CPyhbNqS.js → index-DyfuBbIJ.js} +1 -1
  32. package/frontend/assets/{index-CIReAhWD.js → index-PzkXPYSX.js} +1 -1
  33. package/frontend/assets/{index-xoWXUJLW.js → index-QabB0_Qw.js} +1 -1
  34. package/frontend/assets/{index-Ccx_zqhL.js → index-V8tnJR9v.js} +1 -1
  35. package/frontend/assets/{index-BYtgetD4.js → index-XcYy-NBi.js} +1 -1
  36. package/frontend/assets/{index-BsRx8Pzi.js → index-efpZ6EEe.js} +1 -1
  37. package/frontend/assets/{index-BWM8kiQ0.js → index-s14Wy6CE.js} +1 -1
  38. package/frontend/assets/index-zxLaxo8R.js +1 -0
  39. package/frontend/assets/repositories-BLLfYDjf.js +1 -0
  40. package/frontend/assets/{repositories-DdOEWFoL.js → repositories-of9BXUjW.js} +1 -1
  41. package/frontend/assets/{route-qbVbAxtx.js → route-X94hglR1.js} +1 -1
  42. package/frontend/index.html +1 -1
  43. package/package.json +1 -1
  44. package/frontend/assets/_branchId--sAXSZ0Z.js +0 -1
  45. package/frontend/assets/_id-ZvG2tACL.js +0 -1
  46. package/frontend/assets/agents-DbSvvIcf.js +0 -1
  47. package/frontend/assets/configuration-PLwRj92u.js +0 -1
  48. package/frontend/assets/create-CGIYQfn-.js +0 -1
  49. package/frontend/assets/forges-D5lw6fYh.js +0 -1
  50. package/frontend/assets/index-BBbL0wfM.js +0 -1
  51. package/frontend/assets/index-BCEvS2zI.js +0 -1
  52. package/frontend/assets/index-D3gI7yfx.js +0 -1
  53. package/frontend/assets/index-D6S4PGCc.js +0 -1
  54. package/frontend/assets/index-DvVl2gWR.js +0 -1
  55. package/frontend/assets/repositories-Di8qfiyD.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BWM8kiQ0.js","assets/index-s0xxzhVW.js","assets/index-BBbL0wfM.js","assets/index-DvVl2gWR.js","assets/index-D3gI7yfx.js","assets/index-xoWXUJLW.js","assets/agents-DbSvvIcf.js","assets/index-BYtgetD4.js","assets/agents-Cg-w99VB.js","assets/index-Baaegu29.js","assets/index-DzSYBwXV.js","assets/index-BsRx8Pzi.js","assets/configuration-PLwRj92u.js","assets/configuration-B1tYKnw1.js","assets/index-DgodP5aC.js","assets/forges-D5lw6fYh.js","assets/forges-ChElPpOV.js","assets/index-9KbVyMz4.js","assets/repositories-Di8qfiyD.js","assets/repositories-DdOEWFoL.js","assets/index-CPyhbNqS.js","assets/index-CqVakH8R.js","assets/index-Dfzoepph.js","assets/index-CIReAhWD.js","assets/index-h6dRc3tV.js","assets/index-B7lg0P4V.js","assets/index-eMdhkBjo.js","assets/index-Ccx_zqhL.js","assets/index-C8gx27Rr.js","assets/index-BCEvS2zI.js","assets/index-D6S4PGCc.js","assets/_id-ZvG2tACL.js","assets/_id-DS2_k7mD.js","assets/create-CGIYQfn-.js","assets/create-DQsVrUIP.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-s14Wy6CE.js","assets/index-s0xxzhVW.js","assets/index-zxLaxo8R.js","assets/index-D-k5POv5.js","assets/index-Dn9qaXzX.js","assets/index-QabB0_Qw.js","assets/agents-BGNiGYQQ.js","assets/index-XcYy-NBi.js","assets/agents-DBPulyWi.js","assets/index-CZN7BV83.js","assets/index-Dw5NpM9d.js","assets/index-efpZ6EEe.js","assets/configuration-C8ZTSPna.js","assets/configuration-DBU-Fvop.js","assets/index-CUqlioqL.js","assets/forges-DwSiwqas.js","assets/forges-BOWrvfZl.js","assets/index-CydhSU9g.js","assets/repositories-BLLfYDjf.js","assets/repositories-of9BXUjW.js","assets/index-DyfuBbIJ.js","assets/index-CqVakH8R.js","assets/index-CSoB1eP_.js","assets/index-PzkXPYSX.js","assets/index-CR5UGYQN.js","assets/index-DCCyA67N.js","assets/index-B1Rm0SQ5.js","assets/index-V8tnJR9v.js","assets/index-BaflOxvR.js","assets/index-CeY9TXPf.js","assets/index-BKKD-dvv.js","assets/_id-DlHylI1F.js","assets/_id-BDFgPH36.js","assets/create-DXgFUVIW.js","assets/create-DBNC2wSp.js"])))=>i.map(i=>d[i]);
2
2
  var e$=Object.defineProperty;var qO=e=>{throw TypeError(e)};var t$=(e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _t=(e,t,n)=>t$(e,typeof t!="symbol"?t+"":t,n),iS=(e,t,n)=>t.has(e)||qO("Cannot "+n);var Q=(e,t,n)=>(iS(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?qO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pe=(e,t,n,r)=>(iS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pt=(e,t,n)=>(iS(e,t,"access private method"),n);var kg=(e,t,n,r)=>({set _(s){Pe(e,t,s,n)},get _(){return Q(e,t,r)}});function n$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function bE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oS={exports:{}},ah={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -64,7 +64,7 @@ Error generating stack: `+p.message+`
64
64
  *
65
65
  * This source code is licensed under the MIT license found in the
66
66
  * LICENSE file in the root directory of this source tree.
67
- */var Pk;function fU(){if(Pk)return xS;Pk=1;var e=Ip(),t=zj();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return xS.useSyncExternalStoreWithSelector=function(d,h,m,g,y){var b=i(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function C(D){if(!T){if(T=!0,N=D,D=g(D),y!==void 0&&w.hasValue){var k=w.value;if(y(k,D))return R=k}return R=D}if(k=R,r(N,D))return k;var I=g(D);return y!==void 0&&y(k,I)?(N=D,k):(N=D,R=I)}var T=!1,N,R,M=m===void 0?null:m;return[function(){return C(h())},M===null?void 0:function(){return C(M())}]},[h,m,g,y]);var E=s(d,b[0],b[1]);return l(function(){w.hasValue=!0,w.value=E},[E]),u(E),E},xS}var zk;function dU(){return zk||(zk=1,yS.exports=fU()),yS.exports}var zE=dU();const hU=bE(zE);function pU(e,t){return e===t}function tl(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??pU,s=O.useCallback(l=>{const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=O.useCallback(()=>e.get(),[e]);return zE.useSyncExternalStoreWithSelector(s,i,i,t,r)}var Bk={};function Bj(e,t){const n=O.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=fa(n.current,s):s}}function tu(e){const t=gs(),n=O.useContext(e.from?rU:Py),r=e.from??n,s=t.stores.getMatchStore(r),i=Bj(e,t),l=tl(s,c=>c?i(c):Bk);if(l!==Bk)return l;(e.shouldThrow??!0)&&OE()}function Hj(e){return tu({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fj(e){const{select:t,...n}=e;return tu({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function $j(e){return tu({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vj(e){return tu({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jp(e){const t=gs();return O.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function abe(e){const t=gs(),n=jp(),r=O.useRef(null);return TE(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Uj(e){return tu({...e,select:t=>e.select?e.select(t.context):t.context})}function mU(...e){const t=O.useRef(e),n=t.current;return e.forEach((r,s)=>{qo(n[s],r,!1,!0)||(n[s]=r)}),t.current}function Lg(e,t){e.preloadRoute(t).catch(n=>{console.warn(n),console.warn(XV)})}var gU={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function yU(e,t){const n=typeof e=="string"&&Gh(e);if(n)return t.has(n)?e:null}function xU(e,t,n,r,s){const i=pk(e.pathname,r),l=pk(t.pathname,r);return(n!=null&&n.exact?i!==l:!(i.startsWith(l)&&(i.length===l.length||i[l.length]==="/")))||((n==null?void 0:n.includeSearch)??!0)&&!qo(e.search,t.search,!(n!=null&&n.exact),n==null?void 0:n.explicitUndefined)?!1:n!=null&&n.includeHash?s&&e.hash===t.hash:!0}function bU(e,t,n){const r=gs(),s=O.useRef(null),i=O.useCallback(J=>{if(s.current=J,typeof t=="function")return t(J);t&&(t.current=J)},[t]),{activeOptions:l,to:c,preload:u,preloadDelay:d,hashScrollIntoView:h,replace:m,startTransition:g,resetScroll:y,viewTransition:b,ignoreBlocker:w,disabled:E,target:C,onClick:T,onBlur:N,onFocus:R,onMouseEnter:M,onMouseLeave:D,onTouchStart:k}=e,I=Ij(),[_,P,H]=mU(e.search,e.params,l),[z,U]=O.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,_,P,e.state,e.mask,e.unsafeRelative]),j=O.useCallback(J=>{const K=yU(c,r.protocolAllowlist);if(K!==void 0)return[K??void 0];z._fromLocation||(U._fromLocation=J);const ce=r.buildLocation(U),ye=CU(ce,r,E);return[ye,!E&&(!ye||Gh(ye))?void 0:xU(J,ce,H,r.basepath,I)]},[H,E,I,z,U,r,c]),[B,L]=tl(r.stores.location,j,gU),$=L===void 0?B:void 0,q=E||B===void 0,G=O.useRef(!1),W=e.reloadDocument||$||q?!1:u??r.options.defaultPreload,Z=d??r.options.defaultPreloadDelay??0,re=O.useCallback(J=>{const K=J==null?void 0:J.isIntersecting;if(!(K??W==="intent")){K===!1&&SS(s);return}if(!Z){Lg(r,z);return}Lh.has(s)||Lh.set(s,setTimeout(()=>{Lh.delete(s),Lg(r,z)},Z))},[r,z,s,W,Z]);O.useEffect(()=>{W==="render"&&!G.current&&(G.current=!0,Lg(r,z));let J;return W==="viewport"&&s.current&&typeof IntersectionObserver=="function"&&(J=new IntersectionObserver(K=>re(K.pop()),{rootMargin:"100px"}),J.observe(s.current)),()=>{J==null||J.disconnect(),SS(s)}},[r,z,W,re,s]);const de=wU(e,n);if(de.ref=t?i:s,$)return de.href=$,de;const F=J=>{const K=C??J.currentTarget.getAttribute("target");!q&&!(J.metaKey||J.altKey||J.ctrlKey||J.shiftKey)&&!J.defaultPrevented&&(!K||K==="_self")&&J.button===0&&(J.preventDefault(),r.navigate({...z,replace:m,resetScroll:y,hashScrollIntoView:h,startTransition:g,viewTransition:b,ignoreBlocker:w}))},X=()=>{W==="intent"&&Lg(r,z)},te=()=>{W==="intent"&&SS(s)};return de.onClick=Ju(T,F),de.onBlur=Ju(N,te),de.onFocus=Ju(R,re),de.onMouseEnter=Ju(M,re),de.onMouseLeave=Ju(D,te),de.onTouchStart=Ju(k,X),EU(de,e,L,B,q,n)}var vU={},SU={className:"active"},qj=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 wU(e,t){const n={};for(const r in e)qj.has(r)||r==="type"&&t!==void 0||r==="disabled"&&t==="a"||(n[r]=e[r]);return n}function EU(e,t,n,r,s,i){const{activeProps:l,inactiveProps:c,className:u,style:d,target:h}=t,m=hj(n?l:c,{})??(n?SU:vU);Object.assign(e,m),e.href=r,i!=="a"&&(e.disabled=s),e.target=h;const g=m.style;(d||g)&&(e.style=d&&g?{...d,...g}:d||g);const y=m.className;return(u||y)&&(e.className=u?y?`${u} ${y}`:u:y),s&&(e.role="link",e["aria-disabled"]=!0),n&&(e["data-status"]="active",e["aria-current"]="page"),e}var Lh=new WeakMap,SS=e=>{clearTimeout(Lh.get(e)),Lh.delete(e)},Ju=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function CU(e,t,n){if(n)return;const r=e.maskedLocation??e,s=r.external?r.publicHref:t.history.createHref(r.publicHref)||"/";if(!((r.external||s!==r.publicHref)&&gj(s,t.protocolAllowlist)))return s}var Ff=O.memo(O.forwardRef((e,t)=>{const n=e._asChild||"a",r=bU(e,t,n),s=typeof e.children=="function"?e.children({isActive:r["data-status"]==="active"}):e.children;return O.createElement(n,r,s)}),NU);function NU(e,t){let n=0;for(const r in t)if(n++,e[r]!==t[r]&&(!qj.has(r)||!qo(e[r],t[r],!1,!0)))return!1;for(const r in e)n--;return n===0}var TU=class extends Dj{constructor(t){super(t),this.useMatch=n=>tu({...n,from:this.id}),this.useRouteContext=n=>Uj({...n,from:this.id}),this.useSearch=n=>Vj({...n,from:this.id}),this.useParams=n=>$j({...n,from:this.id}),this.useLoaderDeps=n=>Fj({...n,from:this.id}),this.useLoaderData=n=>Hj({...n,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((n,r)=>x.jsx(Ff,{ref:r,from:this.fullPath,...n}))}};function RU(e){return new TU(e)}function OU(){return e=>MU(e)}var kU=class extends QV{constructor(e){super(e),this.useMatch=t=>tu({...t,from:this.id}),this.useRouteContext=t=>Uj({...t,from:this.id}),this.useSearch=t=>Vj({...t,from:this.id}),this.useParams=t=>$j({...t,from:this.id}),this.useLoaderDeps=t=>Fj({...t,from:this.id}),this.useLoaderData=t=>Hj({...t,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((t,n)=>x.jsx(Ff,{ref:n,from:this.fullPath,...t}))}};function MU(e){return new kU(e)}function ys(e){return t=>{const n=RU(t);return n.isRoot=!1,n}}function fn(e,t){let n,r,s;const i=()=>(n||(s=void 0,n=e().then(c=>{n=void 0,l.preload=void 0,r=c[t??"default"]}).catch(c=>{n=void 0,s=c})),n),l=function(u){if(s){if(X$(s)&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${s.message}`;if(!sessionStorage.getItem(d))throw sessionStorage.setItem(d,"1"),window.location.reload(),new Promise(()=>{})}throw s}if(!r)if(dk)dk(i());else throw i();return O.createElement(r,u)};return l.preload=i,l}function AU(e){const t=gs(),n=`not-found-${tl(t.stores.location,r=>r.pathname)}-${tl(t.stores.status)}`;return x.jsx(PE,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(Hf(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(Hf(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function _U(){return x.jsx("p",{children:"Not Found"})}function of(e){return x.jsx(x.Fragment,{children:e.children})}function Gj(e,t,n){return t.options.notFoundComponent?x.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...n}):x.jsx(_U,{})}function zy(e,t){const n=(t==null?void 0:t.options.pendingComponent)??e.options.defaultPendingComponent;return n?x.jsx(n,{}):null}var DU=(e,t)=>e[0]===t[0]&&e[1]===t[1],Kj=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n==="data-only"||!e.ssr,Yj=O.memo(function({routeId:t}){const n=gs();return x.jsx(IU,{router:n,match:tl(n.stores.getMatchStore(t))})});function IU({router:e,match:t}){var m,g;const n=e.routesById[t.routeId],r=zy(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,i=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):n.options.notFoundComponent,c=t.ssr===!1||t.ssr==="data-only",u=Kj(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(((g=n.options.errorComponent)==null?void 0:g.preload)||c))?O.Suspense:of,d=s?PE:of,h=l?AU:of;return x.jsxs(n.isRoot?n.options.shellComponent??of:of,{children:[x.jsx(Py.Provider,{value:t.routeId,children:x.jsx(u,{fallback:r,children:x.jsx(d,{getResetKey:()=>t,errorComponent:s,onCatch:(y,b)=>{if(Hf(y))throw y.routeId??(y.routeId=t.routeId),y;i==null||i(y,b)},children:x.jsx(h,{fallback:y=>{if(y.routeId??(y.routeId=t.routeId),y.routeId!==t.routeId)throw y;return O.createElement(l,y)},children:c?x.jsx(tU,{fallback:r,children:x.jsx(Hk,{match:t})}):x.jsx(Hk,{match:t})})})})}),null]})}var Hk=O.memo(function({match:t}){const n=gs(),r=t.routeId,s=n.routesById[r],i=O.useMemo(()=>{var u;const c=(u=s.options.remountDeps??n.options.defaultRemountDeps)==null?void 0:u({routeId:r,loaderDeps:t.loaderDeps,params:t._strictParams,search:t._strictSearch});return c?JSON.stringify(c):void 0},[r,t.loaderDeps,t._strictParams,t._strictSearch,s.options.remountDeps,n.options.defaultRemountDeps]),l=O.useMemo(()=>{const c=s.options.component??n.options.defaultComponent;return c?x.jsx(c,{},i):x.jsx(Wj,{})},[i,s.options.component,n.options.defaultComponent]);if(t.status==="pending"){if(n.ssr&&!Kj(n,s,t.ssr))return l;if(n._tx)throw n._tx[5];return zy(n,s)}if(t.status==="notFound")return Gj(n,s,t.error);if(t.status==="error")throw t.error;return l}),Wj=O.memo(function(){const t=gs(),n=O.useContext(Py);let r,s,i;{const c=t.stores.getMatchStore(n);[r,s]=tl(c,u=>[!!u._notFound,u.error],{compare:DU}),i=tl(t.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Gj(t,t.routesById[n],s);if(!i)return null;const l=x.jsx(Yj,{routeId:i});return n===yf?x.jsx(O.Suspense,{fallback:zy(t),children:l}):l});function Xj(e,t){const n=e[1];e.length=0,n==null||n(t)}function jU({t:e}){const t=gs(),n=t._rendered??(t._rendered=[]);return t.startTransition=(r,s)=>new Promise(i=>{Xj(n,!1),n.push(s,i),e(t),O.startTransition(r)}),TE(()=>{const r=t.history.subscribe(t.load);t.updateLatestLocation();const s=t.latestLocation,i=t.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ji(s.publicHref)!==Ji(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const l=t.stores.resolvedLocation.get();return(l==null?void 0:l.href)===s.href&&l.state.__TSR_key===s.state.__TSR_key?n.push(t.stores.matches.get(),c=>{c&&t.emit({type:"onRendered",...jy(l,l)})}):t._tx||t.load({sync:!0}).catch(console.error),r},[t,t.history]),null}function LU(){const e=gs(),t=e.routesById[yf],n=zy(e,t),r=e.ssr?of:O.Suspense,s=x.jsxs(x.Fragment,{children:[x.jsx(jU,{t:O.useState()[1]}),x.jsx(r,{fallback:n,children:x.jsx(PU,{})})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:s}):s}function PU(){const e=gs(),t=e._rendered,n=tl(e.stores.matches,l=>t[0]??l),r=n[0],s=r==null?void 0:r.routeId;TE(()=>{t[0]===n&&Xj(t,!0)},[t,n]);const i=s?x.jsx(Yj,{routeId:s}):null;return x.jsx(Py.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:x.jsx(PE,{getResetKey:()=>r,onCatch:void 0,children:i})})}function Fk(e){const t=gs();return tl(t.stores.matches,Bj(e,t))}var zU=e=>({createMutableStore:Ik,createReadonlyStore:Ik,batch:aU}),BU=e=>new HU(e),HU=class extends jV{constructor(e){super(e,zU)}};function FU({router:e,children:t,...n}){pj(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=x.jsx(jj.Provider,{value:e,children:t});return e.options.Wrap?x.jsx(e.options.Wrap,{children:r}):r}function $U({router:e,...t}){return x.jsx(FU,{router:e,...t,children:x.jsx(LU,{})})}const Qj=O.createContext(null);function By(){return typeof window<"u"}function Nr(e){return BE(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ol(e){var t;return(t=(BE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BE(e){return By()?e instanceof Node||e instanceof vn(e).Node:!1}function bt(e){return By()?e instanceof Element||e instanceof vn(e).Element:!1}function Zt(e){return By()?e instanceof HTMLElement||e instanceof vn(e).HTMLElement:!1}function $f(e){return!By()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}function Lp(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function VU(e){return/^(table|td|th)$/.test(Nr(e))}function Hy(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UU=/transform|translate|scale|rotate|perspective|filter/,qU=/paint|layout|strict|content/,ac=e=>!!e&&e!=="none";let wS;function HE(e){const t=bt(e)?zs(e):e;return ac(t.transform)||ac(t.translate)||ac(t.scale)||ac(t.rotate)||ac(t.perspective)||!FE()&&(ac(t.backdropFilter)||ac(t.filter))||UU.test(t.willChange||"")||qU.test(t.contain||"")}function GU(e){let t=nl(e);for(;Zt(t)&&!Ko(t);){if(HE(t))return t;if(Hy(t))return null;t=nl(t)}return null}function FE(){return wS==null&&(wS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wS}function Ko(e){return/^(html|body|#document)$/.test(Nr(e))}function zs(e){return vn(e).getComputedStyle(e)}function Fy(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nl(e){if(Nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$f(e)&&e.host||ol(e);return $f(t)?t.host:t}function Zj(e){const t=nl(e);return Ko(t)?(e.ownerDocument||e).body:Zt(t)&&Lp(t)?t:Zj(t)}function Qh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zj(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),l=vn(s);if(i){const c=K1(l);return t.concat(l,l.visualViewport||[],Lp(s)?s:[],c&&n?Qh(c):[])}else return t.concat(s,Qh(s,[],n))}function K1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const $E={...o$},$k={};function Tr(e,t){const n=O.useRef($k);return n.current===$k&&(n.current=e(t)),n}const ES=$E.useInsertionEffect,KU=ES&&ES!==$E.useLayoutEffect?ES:e=>e();function Qe(e){const t=Tr(YU).current;return t.next=e,KU(t.effect),t.trampoline}function YU(){const e={next:void 0,callback:WU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function WU(){}const XU=()=>{},ze=typeof document<"u"?O.useLayoutEffect:XU;function Y1(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const VE={};function Yo(e,t,n,r,s){if(!n&&!r&&!s&&!e)return U0(t);let i=U0(e);return t&&(i=Eh(i,t)),n&&(i=Eh(i,n)),r&&(i=Eh(i,r)),s&&(i=Eh(i,s)),i}function QU(e){if(e.length===0)return VE;if(e.length===1)return U0(e[0]);let t=U0(e[0]);for(let n=1;n<e.length;n+=1)t=Eh(t,e[n]);return t}function U0(e){return UE(e)?{...eL(e,VE)}:ZU(e)}function Eh(e,t){return UE(t)?eL(t,e):JU(e,t)}function ZU(e){const t={...e};for(const n in t){const r=t[n];Jj(n,r)&&(t[n]=tL(r))}return t}function JU(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Y1(e.style,r);break}case"className":{e[n]=nL(e.className,r);break}default:Jj(n,r)?e[n]=e9(e[n],r):e[n]=r}}return e}function Jj(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function UE(e){return typeof e=="function"}function eL(e,t){return UE(e)?e(t):e??VE}function e9(e,t){return t?e?(...n)=>{const r=n[0];if(rL(r)){const i=r;q0(i);const l=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),l}const s=t(...n);return e==null||e(...n),s}:tL(t):e}function tL(e){return e&&((...t)=>{const n=t[0];return rL(n)&&q0(n),e(...t)})}function q0(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nL(e,t){return t?e?t+" "+e:t:e}function rL(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function t9(e,t){return function(r,...s){const i=new URL(e);return i.searchParams.set("code",r.toString()),s.forEach(l=>i.searchParams.append("args[]",l)),`${t} error #${r}; visit ${i} for the full message.`}}const wn=t9("https://base-ui.com/production-error","Base UI"),n9=O.createContext(void 0);function qE(e=!1){const t=O.useContext(n9);if(t===void 0&&!e)throw new Error(wn(16));return t}function r9(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:i}=e,l=r&&t!==!1,c=r&&t===!1;return{props:O.useMemo(()=>{const d={onKeyDown(h){n&&t&&h.key!=="Tab"&&h.preventDefault()}};return r||(d.tabIndex=s,!i&&n&&(d.tabIndex=t?s:-1)),(i&&(t||l)||!i&&n)&&(d["aria-disabled"]=n),i&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,i,s])}}function Dt(e){return(e==null?void 0:e.ownerDocument)||document}function v0(e,t,{detail:n=0}={}){e.dispatchEvent(new(vn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Pp(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:i}=e,l=O.useRef(null),c=qE(!0),u=i??c!==void 0,{props:d}=r9({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:s}),h=O.useCallback(()=>{const y=l.current;CS(y)&&u&&t&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,d.disabled,u]);ze(h,[h]);const m=O.useCallback((y={})=>{const{onClick:b,onMouseDown:w,onKeyUp:E,onKeyDown:C,onPointerDown:T,...N}=y;return Yo({onClick(R){if(t){R.preventDefault();return}b==null||b(R)},onMouseDown(R){t||w==null||w(R)},onKeyDown(R){if(t||(q0(R),C==null||C(R),R.baseUIHandlerPrevented))return;const M=R.target===R.currentTarget,D=R.currentTarget,k=CS(D),I=!s&&s9(D),_=M&&(s?k:!I),P=R.key==="Enter",H=R.key===" ",z=D.getAttribute("role"),U=(z==null?void 0:z.startsWith("menuitem"))||z==="option"||z==="gridcell";if(M&&u&&H){if(R.defaultPrevented&&U)return;R.preventDefault(),(!s||k)&&(R.preventBaseUIHandler(),v0(D,R));return}if(!_||s||!H&&!P){M&&I&&H&&R.preventDefault();return}R.defaultPrevented||(R.preventDefault(),P&&(R.preventBaseUIHandler(),v0(D,R)))},onKeyUp(R){if(!t){if(q0(R),E==null||E(R),R.target===R.currentTarget&&s&&u&&CS(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!u&&!R.defaultPrevented&&R.key===" "&&(R.preventBaseUIHandler(),v0(R.currentTarget,R))}},onPointerDown(R){if(t){R.preventDefault();return}T==null||T(R)}},s?{type:"button"}:{role:"button"},d,N)},[t,d,u,s]),g=Qe(y=>{l.current=y,h()});return{getButtonProps:m,buttonRef:g}}function CS(e){return Zt(e)&&e.tagName==="BUTTON"}function s9(e){return Zt(e)&&e.tagName==="A"&&!!e.href}function Vf(e,t,n,r){const s=Tr(sL).current;return o9(s,e,t,n,r)&&iL(s,[e,t,n,r]),s.callback}function i9(e){const t=Tr(sL).current;return l9(t,e)&&iL(t,e),t.callback}function sL(){return{callback:null,cleanup:null,refs:[]}}function o9(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function l9(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function iL(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=i(n);typeof l=="function"&&(r[s]=l);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=r[s];typeof l=="function"?l():i(null);break}case"object":{i.current=null;break}}}}}}}const a9=parseInt(O.version,10);function GE(e){return a9>=e}function Vk(e){if(!O.isValidElement(e))return null;const t=e,n=t.props;return(GE(19)?n==null?void 0:n.ref:t.ref)??null}function Bn(){}const Zh=Object.freeze([]),Tn=Object.freeze({});function c9(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const i=t[r](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function u9(e,t){return typeof e=="function"?e(t):e}function f9(e,t){return typeof e=="function"?e(t):e}function dn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=m9(r));const s=d9(t,n,r);if(n.enabled===!1)return null;const i=n.state??Tn;return g9(e,r,s,i)}function d9(e,t,n){const{className:r,style:s}=e,{state:i=Tn,ref:l,props:c,stateAttributesMapping:u,enabled:d=!0}=t,h=d?u9(r,i):void 0,m=d?f9(s,i):void 0,g=d?c9(i,u):Tn,y=d&&c?h9(c):void 0,b=d?Y1(g,y)??{}:Tn;return typeof document<"u"&&(d?Array.isArray(l)?b.ref=i9([b.ref,Vk(n),...l]):b.ref=Vf(b.ref,Vk(n),l):Vf(null,null)),d?(h!==void 0&&(b.className=nL(b.className,h)),m!==void 0&&(b.style=Y1(b.style,m)),b):Tn}function h9(e){return Array.isArray(e)?QU(e):Yo(void 0,e)}const p9=Symbol.for("react.lazy");function m9(e){if((e==null?void 0:e.$$typeof)!==p9)return e;const t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function g9(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Yo(n,t.props);return s.ref=n.ref,O.cloneElement(t,s)}if(e&&typeof e=="string")return y9(e,n);throw new Error(wn(8))}function y9(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):O.createElement(e,t)}const x9=O.forwardRef(function(t,n){const{render:r,className:s,disabled:i=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,style:u,...d}=t,{getButtonProps:h,buttonRef:m}=Pp({disabled:i,focusableWhenDisabled:l,native:c});return dn("button",t,{state:{disabled:i},ref:[n,m],props:[d,h]})});function oL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=oL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function b9(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=oL(e))&&(r&&(r+=" "),r+=t);return r}const Uk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qk=b9,v9=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],m=i==null?void 0:i[d];if(h===null)return null;const g=Uk(h)||Uk(m);return s[d][g]}),c=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...y}=h;return Object.entries(y).every(b=>{let[w,E]=b;return Array.isArray(E)?E.includes({...i,...c}[w]):{...i,...c}[w]===E})?[...d,m,g]:d},[]);return qk(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},lL=48,oo=(e,t=0)=>{const n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-lL-t;return n},$y=e=>{const t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Ea=e=>{const t=new Int32Array(e.length);let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r)-lL;n+=s>>>1^-(s&1),t[r]=n}return t},S9=384,w9=[],fc=$y(oo("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),E9=$y(oo(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),C9="@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",N9=(()=>{const e=fc.length-1,t=new Int32Array(e);for(let s=e-1;s>=0;s--){let i=1,l=s+1;for(let c=fc[s];c<fc[s+1];c++)i+=t[l],l+=t[l];t[s]=i}const n=new Int32Array(fc[e]);let r=0;for(let s=0;s<e;s++){let i=s+1;for(let l=fc[s];l<fc[s+1];l++)n[r++]=i,i+=t[i]}return n})(),T9=oo("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),R9=$y(oo("123333359346463635126536711576")),O9=oo("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),k9=oo("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),M9=Ea("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),A9=(()=>{const e=new Int32Array(319).fill(-1),t=Ea("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),n=Ea("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),_9="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(e=>{const t=e.split(" "),n=t.shift();for(let r=0;r<t.length;r++)t[r]=n+t[r];return t}),Gk=Ea("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),D9=Ea("ɠ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"),I9=Ea("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),aL=new Int32Array(995),cL=new Int32Array(995),uL=new Int32Array(995);let W1="";const X1=new Int32Array(1038);{const e=new Map;let t=0,n=0;for(let r=0;r<Gk.length;r++)for(const s of _9[I9[r]]){let i=e.get(s);i===void 0&&(i=t++,e.set(s,i),X1[i*2]=W1.length,X1[i*2+1]=s.length,W1+=s),aL[n]=Gk[r],cL[n]=D9[r],uL[n]=i,n++}}const j9=Ea("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),L9=$y(oo("1::24444432:442:44:44>222222:44:4421322511111311111114")),P9=Ea("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"),z9=oo("ij"),B9=oo("—"),H9=oo("1"),F9="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var $9={GROUP_COUNT:S9,customValidatorNames:w9,edgeStart:fc,labelStart:E9,labelText:C9,edgeTarget:N9,nodeGroup:T9,nodeVlist:A9,vlistPat:R9,vlistOps:O9,vlistRef:k9,vlistGroup:M9,litAnchor:aL,litGroup:cL,litPool:uL,poolOffsets:X1,poolText:W1,adjGid:j9,adjStart:L9,adjTgt:P9,patGid:z9,patTgt:B9,postfixLookupGroups:H9,orderSensitiveModifiers:F9};const V9="line"in new Error,Vi=-1,cc=-1,NS=(e,t,n)=>{let r=2166136261;for(let s=t;s<n;s++)r=Math.imul(r^e.charCodeAt(s),16777619);return r},S0=(e,t,n)=>{const r=n-t;let s=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){const i=r>>2,l=r>>1;s=Math.imul(s^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+i),2246822507),s=Math.imul(s^e.charCodeAt(t+l)<<8^e.charCodeAt(t+l+i)<<16^e.charCodeAt(n-3),3266489909),s^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let c=t+3,u=n-4;c<t+8&&c<u;c++,u--)s=Math.imul(s^e.charCodeAt(c)^e.charCodeAt(u)<<8,16777619)}return s^s>>>15|0},U9=(e,t,n={})=>{const{GROUP_COUNT:r,edgeStart:s,labelStart:i,labelText:l,edgeTarget:c,nodeGroup:u,nodeVlist:d,vlistPat:h,vlistOps:m,vlistRef:g,vlistGroup:y,litAnchor:b,litGroup:w,litPool:E,poolOffsets:C,poolText:T,adjGid:N,adjStart:R,adjTgt:M,patGid:D,patTgt:k,postfixLookupGroups:I,customValidatorNames:_,orderSensitiveModifiers:P}=e,H=new Int32Array(r).fill(-1);for(let pe=0;pe<N.length;pe++)H[N[pe]]=pe;let z=0;for(let pe=0;pe+1<R.length;pe++){const Ee=R[pe+1]-R[pe];Ee>z&&(z=Ee)}let U=32;for(;U<2*(1+z+D.length);)U<<=1;const j=new Int32Array(g.length+1);for(let pe=0;pe<g.length;pe++)j[pe+1]=j[pe]+h[g[pe]+1]-h[g[pe]];const B=new Uint8Array(r);for(let pe=0;pe<I.length;pe++)B[I[pe]]=1;const L=s.length-1,$=new Uint8Array(L);let q=0,G=!0;for(let pe=0;pe<b.length;pe++){$[b[pe]]=1;const Ee=C[E[pe]*2+1];Ee>q&&(q=Ee);const Ce=T.charCodeAt(C[E[pe]*2]);(Ce===91||Ce===40)&&(G=!1)}let W=1;for(;W<b.length*2;)W<<=1;const Z=new Int32Array(W).fill(-1);for(let pe=0;pe<b.length;pe++){const Ee=C[E[pe]*2];let Ce=(NS(T,Ee,Ee+C[E[pe]*2+1])^Math.imul(b[pe],2654435761)|0)&W-1;for(;Z[Ce]!==-1;)Ce=Ce+1&W-1;Z[Ce]=pe}const re=(pe,Ee,Ce,Ge)=>{let ot=(NS(Ee,Ce,Ge)^Math.imul(pe,2654435761)|0)&W-1;const it=Ge-Ce;for(;;){const at=Z[ot];if(at===-1)return-1;if(b[at]===pe&&C[E[at]*2+1]===it){const Ht=C[E[at]*2];let It=!0;for(let Ze=0;Ze<it;Ze++)if(T.charCodeAt(Ht+Ze)!==Ee.charCodeAt(Ce+Ze)){It=!1;break}if(It)return w[at]}ot=ot+1&W-1}},de=n.cacheSize??8192,F=n.prefix??e.prefix??"",X=F===""?"":F+":",te=X.length,J=(_??[]).map(pe=>{throw new Error("cn: missing validator "+pe)}),K=/\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$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ye=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let oe=0,xe=-1,Se=-1,ke=-1,_e=-1;const we=pe=>pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===95,Re=pe=>/\s/.test(String.fromCharCode(pe)),Ae=(pe,Ee,Ce)=>{if(oe=0,xe=-1,Ce-Ee<3)return;const Ge=pe.charCodeAt(Ee),ot=pe.charCodeAt(Ce-1);if(Ge===91&&ot===93)oe=1;else if(Ge===40&&ot===41)oe=2;else return;ke=Ee+1,_e=Ce-1;let it=Ee+1;if(we(pe.charCodeAt(it))){for(it++;it<Ce-1;){const at=pe.charCodeAt(it);if(!we(at)&&at!==45)break;it++}it<Ce-2&&pe.charCodeAt(it)===58&&(xe=Ee+1,Se=it,ke=it+1)}},Le=(pe,Ee,Ce,Ge)=>{if(Ce-Ee!==Ge.length)return!1;for(let ot=0;ot<Ge.length;ot++)if(pe.charCodeAt(Ee+ot)!==Ge.charCodeAt(ot))return!1;return!0},Ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,We=pe=>!!pe&&!Number.isNaN(Number(pe)),Oe=(pe,Ee,Ce)=>{if(Ce-Ee<11||!Le(pe,Ee,Ee+10,"@container"))return!1;if(pe.charCodeAt(Ee+10)===47)return Ce-Ee>=12;const Ge=pe.charCodeAt(Ee+11);return Ge===115&&Ce-Ee>=17&&Le(pe,Ee+10,Ee+16,"-size/")||Ge===110&&Ce-Ee>=19&&Le(pe,Ee+10,Ee+18,"-normal/")},De=[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(pe=>pe.split(" ")),he=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],se=(pe,Ee,Ce,Ge)=>{if(pe>=10){if(pe>=25)return J[pe-25](Ee.slice(Ce,Ge));const ot=pe-10;if(oe!==De[ot])return!1;if(xe>=0){for(const it of ne[ot])if(Le(Ee,xe,Se,it))return!0;return!1}switch(he[ot]){case 0:return!1;case 1:return!0;case 2:{const it=Ee.slice(ke,_e);return K.test(it)&&!ce.test(it)}case 3:return We(Ee.slice(ke,_e));case 4:return ge.test(Ee.slice(ke,_e));default:return ye.test(Ee.slice(ke,_e))}}switch(pe){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return Ie.test(Ee.slice(Ce,Ge));case 5:return We(Ee.slice(Ce,Ge));case 6:{const ot=Ee.slice(Ce,Ge);return!!ot&&Number.isInteger(Number(ot))}case 7:return Ge>Ce&&Ee.charCodeAt(Ge-1)===37&&We(Ee.slice(Ce,Ge-1));case 8:return Ue.test(Ee.slice(Ce,Ge));default:return Oe(Ee,Ce,Ge)}},Te=new Set(typeof P=="string"?P.split(" "):P),Ve=(pe,Ee,Ce,Ge,ot,it)=>{const at=NS(Ee,Ce,Ge)^(ot?2654435769:0)|0;let Ht=pe.get(at);if(Ht!==void 0)e:for(let ut=0;ut<Ht.length;ut++){const At=Ht[ut];if(!(At.imp!==ot||At.k.length!==Ge-Ce)){for(let tt=0;tt<At.k.length;tt++)if(At.k.charCodeAt(tt)!==Ee.charCodeAt(Ce+tt))continue e;return At.id}}else pe.set(at,Ht=[]);const It=Ee.slice(Ce,Ge),Ze=it(It);return Ht.push({k:It,imp:ot,id:Ze}),Ze};let jt=new Map,hn=new Map,Fe=2;const Tt=4096,zt=(pe,Ee)=>{const Ce=[];let Ge=0,ot=0,it=0;for(let Ze=0;Ze<pe.length;Ze++){const ut=pe.charCodeAt(Ze);Ge===0&&ot===0&&ut===58?(Ce.push(pe.slice(it,Ze)),it=Ze+1):ut===91?Ge++:ut===93?Ge--:ut===40?ot++:ut===41&&ot--}Ce.push(pe.slice(it));let at=Ce[0];if(Ce.length>1){const Ze=[];let ut=[];for(const At of Ce)At.charCodeAt(0)===91||Te.has(At)?(ut.length&&(Ze.push(...ut.sort()),ut=[]),Ze.push(At)):ut.push(At);ut.length&&Ze.push(...ut.sort()),at=Ze.join(":")}const Ht=Ee?at+" !":at;let It=hn.get(Ht);return It===void 0&&hn.set(Ht,It=Fe++),It};let Vn=new Map,Un=r;const xs=r+4096,on=()=>Un++,ar=2097152,zr=8192,bs=new Int32Array(zr),qn=new Array(zr).fill(null),mt=new Int32Array(zr),ln=new Int32Array(zr),Gn=new Uint8Array(zr);let Rn=0;const On=(pe,Ee,Ce,Ge,ot,it,at,Ht)=>{let It=pe;if(qn[pe]!==null)if(qn[pe|1]===null)It=pe|1;else if((Rn++&3)===0)It=pe|Rn>>2&1;else return;qn[It]=Ee.slice(Ce,Ge),bs[It]=ot,mt[It]=it,ln[It]=at,Gn[It]=Ht},Bt=()=>qn.fill(null);let Wt=256,Xt=[new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt)],[Br,Kn,_n,cr]=Xt,ur=new Uint8Array(Wt),fr=new Uint8Array(Wt);const ns=()=>{Wt*=2,Xt=Xt.map(Ee=>{const Ce=new Int32Array(Wt);return Ce.set(Ee),Ce}),[Br,Kn,_n,cr]=Xt;const pe=new Uint8Array(Wt);pe.set(ur),ur=pe,fr=new Uint8Array(Wt)};let Rr=64,Or=new Int32Array(Rr),rs=new Int32Array(Rr);const oi=new Int32Array(r);let dr=2048,Ai=21,vs=new Float64Array(dr),cl=new Int32Array(dr),Ss=0;const ul=(pe,Ee)=>{if(pe===0&&Ee<r)return oi[Ee]===Ss?1:(oi[Ee]=Ss,0);const Ce=pe*2097152+Ee+1;let Ge=Math.imul(Ce,2654435761)>>>Ai;for(;cl[Ge]===Ss;){if(vs[Ge]===Ce)return 1;Ge=Ge+1&dr-1}return vs[Ge]=Ce,cl[Ge]=Ss,0},uo=(pe,Ee,Ce,Ge,ot)=>{if(Ce-Ee>=2&&pe.charCodeAt(Ee)===91&&pe.charCodeAt(Ce-1)===93){let it=-1;for(let at=Ee+1;at<Ce-1;at++)if(pe.charCodeAt(at)===58){it=at;break}return it===-1||it===Ee+1?Vi:Ve(Vn,pe,Ee+1,it,0,on)}if(Ge>=0&&u[Ge]>=0)return u[Ge];for(let it=ot-1;it>=0;it--){const at=rs[it];if(at>Ce)continue;const Ht=Or[it],It=Ce-at;if($[Ht]===1&&It>0&&It<=q){const mn=pe.charCodeAt(at);if(G===!1||mn!==91&&mn!==40){const Es=re(Ht,pe,at,Ce);if(Es>=0)return Es}}const Ze=d[Ht];if(Ze<0)continue;const ut=g[Ze],At=h[ut],tt=h[ut+1];if(At===tt)continue;Ae(pe,at,Ce);const Wn=j[Ze]-At;for(let mn=At;mn<tt;mn++)if(se(m[mn],pe,at,Ce))return y[Wn+mn]}return Vi},li=pe=>{const Ee=pe.length;let Ce=0,Ge=0,ot=!1;(Fe>Tt||jt.size>Tt)&&(jt=new Map,hn=new Map,Fe=2,Bt()),Un>xs&&(Vn=new Map,Un=r,Bt());let it=0;for(;it<Ee;){let Ze=pe.charCodeAt(it);if(Ze===32||Ze>=9&&Ze<=13||Ze>=160&&Re(Ze)){Ze!==32&&(ot=!0),it++;continue}const ut=it;let At=0;for(;it<Ee;){if(Ze=pe.charCodeAt(it),Ze<=32){if(Ze===32)break;if(Ze>=9&&Ze<=13){ot=!0;break}}else if(Ze>=160&&Re(Ze)){ot=!0;break}At=Math.imul(At^Ze,16777619),it++}const tt=it,Wn=tt-ut;Ce===Wt&&ns();const mn=Ce++;Br[mn]=ut,Kn[mn]=tt,Ge+=Wn,At^=Math.imul(Wn,2654435761);const Es=At^At>>>15|0,Dn=Es&8190;{let Ot=-1;if(bs[Dn]===Es&&qn[Dn]!==null&&qn[Dn].length===Wn?Ot=Dn:bs[Dn|1]===Es&&qn[Dn|1]!==null&&qn[Dn|1].length===Wn&&(Ot=Dn|1),Ot>=0){const er=qn[Ot];let Vs=!0;for(let Ts=0;Ts<Wn;Ts++)if(er.charCodeAt(Ts)!==pe.charCodeAt(ut+Ts)){Vs=!1;break}if(Vs){_n[mn]=mt[Ot],cr[mn]=ln[Ot],ur[mn]=Gn[Ot];continue}}}let In=ut;if(te!==0){if(tt-ut<=te||!pe.startsWith(X,ut)){_n[mn]=Vi,On(Dn,pe,ut,tt,Es,Vi,0,0);continue}In=ut+te}let hu=0,yd=0,go=-1,pu=-1;for(let Ot=In;Ot<tt;Ot++){const er=pe.charCodeAt(Ot);if(hu===0&&yd===0){if(er===58){go=Ot;continue}if(er===47){pu=Ot;continue}}er===91?hu++:er===93?hu--:er===40?yd++:er===41&&yd--}const fm=go>=In?go+1:In;let rn=fm,kr=tt,pl=!1,mu=0;kr>rn&&pe.charCodeAt(kr-1)===33?(pl=!0,kr--):kr>rn&&pe.charCodeAt(rn)===33&&(pl=!0,rn++,mu=1);let ls=-1;pu>fm&&(ls=pu+mu,ls>=kr&&(ls=-1));let gu=rn;kr-rn>1&&pe.charCodeAt(rn)===45&&(gu=rn+1);let Cs=0,Fr=0,ml=0,xd=-1,Ns=0;(d[0]>=0||$[0]===1)&&(Or[0]=0,rs[0]=gu,Ns=1);let Pa=cc,bd=0;for(let Ot=gu;Ot<kr;Ot++)if(Ot===ls&&(Pa=Fr<ml?cc:Cs,bd=Ns),Cs!==cc){const er=pe.charCodeAt(Ot);let Vs=-1;if(Fr<ml)l.charCodeAt(Fr)===er?(Fr++,Fr===ml&&(Vs=Cs=xd)):Cs=cc;else{const Ts=s[Cs],Ha=s[Cs+1];let yo=cc;for(let pr=Ts;pr<Ha;pr++){const Fa=i[pr];if(l.charCodeAt(Fa)===er){i[pr+1]-Fa===1?Vs=yo=c[pr]:(Fr=Fa+1,ml=i[pr+1],xd=c[pr],yo=Cs);break}}Cs=yo}if(Vs>=0&&(d[Vs]>=0||$[Vs]===1)&&Ot+1<kr&&pe.charCodeAt(Ot+1)===45){if(Ns===Rr){Rr*=2;const Ts=new Int32Array(Rr);Ts.set(Or),Or=Ts;const Ha=new Int32Array(Rr);Ha.set(rs),rs=Ha}Or[Ns]=Vs,rs[Ns]=Ot+2,Ns++}}ls===kr&&(Pa=Fr<ml?cc:Cs,bd=Ns);const vd=Fr<ml?cc:Cs;let hr,$r=!1;if(ls>=0)if($r=!0,hr=uo(pe,rn,ls,Pa,bd),hr!==Vi&&hr<r&&B[hr]){const Ot=uo(pe,rn,kr,vd,Ns);Ot!==Vi&&Ot!==hr&&(hr=Ot,$r=!1)}else hr===Vi&&(hr=uo(pe,rn,kr,vd,Ns),$r=!1);else hr=uo(pe,rn,kr,vd,Ns);let za=0,Ba=0;hr===Vi?_n[mn]=Vi:(Ba=$r?1:0,za=In>=go?pl?1:0:Ve(jt,pe,In,go,pl?1:0,Ot=>zt(Ot,pl)),_n[mn]=hr,ur[mn]=Ba,cr[mn]=za),On(Dn,pe,ut,tt,Es,hr,za,Ba)}if(Ce===0)return"";if(Ce===1)return Br[0]===0&&Kn[0]===Ee?pe:pe.slice(Br[0],Kn[0]);if(Ce*U>dr){for(;Ce*U>dr;)dr<<=1,Ai--;vs=new Float64Array(dr),cl=new Int32Array(dr)}if(Fe>=ar||Un>=ar)throw new Error("cn: too many distinct classes in one merge");Ss=Ss+1|0,Ss===0&&(oi.fill(0),cl.fill(0),Ss=1);let at=!1;for(let Ze=Ce-1;Ze>=0;Ze--){const ut=_n[Ze];if(ut===Vi){fr[Ze]=1;continue}const At=cr[Ze];if(ul(At,ut)===1){fr[Ze]=0,at=!0;continue}if(fr[Ze]=1,ut<r){const tt=H[ut];if(tt>=0)for(let Wn=R[tt];Wn<R[tt+1];Wn++)ul(At,M[Wn]);if(ur[Ze]&1)for(let Wn=0;Wn<D.length;Wn++)D[Wn]===ut&&ul(At,k[Wn])}}if(!at&&!ot&&Ee===Ge+Ce-1)return pe;let Ht="",It=0;for(;It<Ce;){if(!fr[It]){It++;continue}const Ze=Br[It];let ut=Kn[It],At=It+1;for(;At<Ce&&fr[At]&&Br[At]===ut+1&&pe.charCodeAt(ut)===32;)ut=Kn[At],At++;Ht.length>0&&(Ht+=" "),Ht+=pe.slice(Ze,ut),It=At}return Ht},ss=16384,is=new Int32Array(ss*2);let fo=0,pn=1,nn=Object.create(null),Yn=Object.create(null),Hr=new Map,La=new Map,ho=0,fl=0;const _i=()=>{fo^=ss,pn=pn+1|0,fl=0},po=pe=>{let Ee=nn[pe];if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=Yn[pe],Ee!==void 0)?(nn[pe]=Ee,Ee):(Ee=li(pe),ot?(nn[pe]=Ee,++ho>de&&(ho=0,Yn=nn,nn=Object.create(null),_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},dl=pe=>{let Ee=Hr.get(pe);if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=La.get(pe),Ee!==void 0)?(Hr.set(pe,Ee),Ee):(Ee=li(pe),ot?(Hr.set(pe,Ee),++ho>de&&(ho=0,La=Hr,Hr=new Map,_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},hl=pe=>{const Ee=S0(pe,0,pe.length),Ce=(Ee&16383)+fo;return is[Ce]===(Ee^pn)||is[Ce^ss]===(Ee^pn-1)?!0:(is[Ce]=Ee^pn,++fl>ss&&_i(),!1)},ws=de===0?li:V9?pe=>{const Ee=Hr.get(pe);return Ee!==void 0?Ee:dl(pe)}:po;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?ws(arguments[0]):ws(G9.apply(null,arguments))},mergeString:ws,seenBefore:de===0?()=>!1:hl,mergeUncached:li}},G0=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let n="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const r=e;for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const l=typeof i=="string"?i:G0(i,t);l&&(n&&(n+=" "),n+=l)}return n}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(n&&(n+=" "),n+=r)}return n},q9=(e,t)=>{let n="";for(let r=0;r<e.length;r++){const s=e[r];if(!s)continue;const i=typeof s=="string"?s:G0(s,t);i&&(n&&(n+=" "),n+=i)}return n},G9=function(){return q9(arguments,!1)},K9=256,Kk=16,Y9=1024,TS=4096,W9=(e,t)=>{const n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached;let s=new Map,i=new Map,l=0,c=null,u=null,d=[],h=[],m=0;const g=(C,T,N)=>{u===null&&(u=new Array(TS).fill(""),d=new Array(TS).fill(""),h=new Array(TS).fill(""));const R=S0(C,0,C.length)&4094;if(u[R]===C&&d[R]===T)return h[R];if(u[R|1]===C&&d[R|1]===T)return h[R|1];const M=e(N?T+" "+C:C),D=u[R]===""?R:R|(u[R|1]===""?1:m++&1);return u[D]=C,d[D]=T,h[D]=M,M},y=(C,T,N,R)=>{let M=0;if(T){if(T!==C.a0)return!1;M=1}if(N){if(N!==(M===0?C.a0:C.a1))return!1;M++}if(R){if(R!==(M===0?C.a0:M===1?C.a1:C.a2))return!1;M++}return M===C.t},b=(C,T)=>{const N=C.a;let R=0;for(let M=0;M<T.length;M++){const D=T[M];if(D){if(D!==N[R])return!1;R++}}return R===C.t},w=(C,T)=>{const N=C.length,R=c===null?null:c.n;if(!T){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let M="",D=-1,k=0,I=!1;for(let H=0;H<N;H++){let z=C[H];if(z){if(typeof z!="string"){if(z=C[H]=G0(z,!0),!z)continue;I=!0}D<0&&(M=z,D=H),k++}}if(k===0)return"";if(k===1)return e(M);if(I){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let _=s.get(M);_===void 0&&(_=i.get(M),_!==void 0&&s.set(M,_));let P=null;if(_!==void 0){if(_.skip>0){_.skip--,c=null;let z=M;for(let U=D+1;U<N;U++){const j=C[U];j&&(z+=" "+j)}return g(z,"",!1)}const H=_.e;e:for(let z=0;z<H.length;z++){const U=H[z];if(U.t!==k)continue;const j=U.a;let B=1;for(let L=D+1;L<N;L++){const $=C[L];if($&&$!==j[B++])continue e}P=U;break}P!==null&&(_.miss=0)}if(P===null){let H=M;const z=[M];for(let j=D+1;j<N;j++){const B=C[j];B&&(H+=" "+B,z.push(B))}if(!n(H))return r(H);P={r:e(H),t:z.length,a0:z[0],a1:z[1],a2:z[2]??"",a:z,n:null},_===void 0?s.set(M,_={e:[],miss:0,skip:0,at:0}):++_.miss>Kk&&(_.miss=Kk,_.skip=Y9,_.e.length=0,_.at=0);const U=_.e;U.length<K9?U.push(P):(U[_.at]=P,_.at=_.at+1&255),++l>1e3&&(l=0,i=s,s=new Map)}return c!==null&&c!==P&&(c.n=P),c=P,P.r},E=C=>Array.isArray(C)?w(C.slice(),!1):e(G0(C,!0));return function(C,T,N){const R=arguments.length;if((R|1)===3){const k=c;if(k!==null){const I=k.n;if(I!==null&&y(I,C,T,N))return c=I,I.r;if(k!==I&&y(k,C,T,N))return k.r}if(R===2&&typeof T=="string"&&T!==""){const I=s.get(C);if(I!==void 0&&I.skip>0)return I.skip--,c=null,g(T,C,!0)}return w([C,T,N],!0)}if(R===1)return typeof C=="string"?e(C):E(C);const M=c;if(M!==null){const k=M.n;if(k!==null){const I=k.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===k.t)return c=k,k.r}if(M!==k){const I=M.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===M.t)return M.r}}const D=[];for(let k=0;k<R;k++)D.push(arguments[k]);return w(D,!0)}},Yk=U9($9),Ne=W9(Yk.mergeString,Yk),X9=v9("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 nt({className:e,variant:t="default",size:n="default",children:r,...s}){return x.jsx(x9,{"data-slot":"button",className:Ne(X9({variant:t,size:n,className:e})),...s,children:typeof r=="string"?x.jsx("span",{className:"text-box-cap",children:r}):r})}const Q9=({logoSrc:e,name:t})=>x.jsx("img",{src:e,alt:t,width:"32",height:"32",className:"size-8"}),Z9={column:"max-w-5xl px-4 sm:px-6",full:"px-6"},J9=({brand:e,width:t="column",children:n})=>x.jsx("header",{className:"sticky top-0 z-40 bg-sign text-sign-foreground",children:x.jsxs("div",{className:Ne("mx-auto flex h-14 w-full items-center justify-between gap-6",Z9[t]),children:[e,n]})}),e7="/logo-small.png",t7="Flight Plan",n7="Settings",r7="/setup/",s7="mx-auto max-w-5xl px-4 pt-8 pb-16 sm:px-6",i7="The backend did not say what went wrong.",o7=()=>{const[e,t]=O.useState(null),n=Fk({select:s=>s.some(i=>i.staticData.isFullWidth===!0)}),r=Fk({select:s=>s.some(i=>i.routeId===r7)});return x.jsx(Qj,{value:e,children:x.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[x.jsxs(J9,{width:n?"full":"column",brand:x.jsx(Ff,{to:"/",className:"shrink-0 rounded-sm",children:x.jsx(Q9,{logoSrc:e7,name:t7})}),children:[x.jsx("div",{ref:t,className:"flex min-w-0 flex-1 items-center border-l border-sign-foreground/20 pl-6 empty:hidden"}),r?null:x.jsx(Ff,{to:"/settings",className:"shrink-0 rounded-sm text-sm text-sign-muted hover:text-sign-foreground",children:n7})]}),x.jsx("main",{className:Ne("w-full",n?"":s7),children:x.jsx(Wj,{})})]})})},l7=()=>x.jsxs("section",{className:"max-w-prose",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"This page does not exist"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:"The address does not match any page of Flight Plan."}),x.jsx(Ff,{to:"/",className:"mt-4 inline-block underline",children:"Go to your repositories"})]}),a7=({error:e})=>{const t=gs();return x.jsxs("main",{role:"alert",className:"mx-auto min-h-screen max-w-prose bg-background px-4 pt-16 text-foreground",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"Flight Plan could not start"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:i7}),x.jsx(nt,{className:"mt-4",onClick:()=>{t.invalidate()},children:"Try again"})]})},nu=OU()({beforeLoad:async({context:{queryClient:e,trpc:t},location:n})=>{const r=await e.query({...t.setup.gate.queryOptions({path:n.pathname}),staleTime:"static"});r.redirectTo!==null&&kE({to:r.redirectTo,throw:!0})},component:o7,notFoundComponent:l7,errorComponent:a7}),c7="modulepreload",u7=function(e){return"/"+e},Wk={},$t=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(d=>{if(d=u7(d),d in Wk)return;Wk[d]=!0;const h=d.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":c7,h||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),h)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},f7=[{id:"first",stopWidths:["w-3/5","w-2/5","w-1/2"]},{id:"second",stopWidths:["w-2/5","w-3/5"]}],d7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading your repositories"}),x.jsxs("div",{"aria-hidden":"true",className:"motion-safe:animate-pulse",children:[x.jsx("div",{className:"mb-6 h-9 w-48 rounded-sm bg-muted"}),f7.map(e=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] border-t-2 border-foreground pt-5 pb-6",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-7 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex flex-col gap-4 pb-1",children:[x.jsx("span",{className:"h-6 w-40 rounded-sm bg-muted"}),e.stopWidths.map(t=>x.jsx("span",{className:`h-5 rounded-sm bg-muted ${t}`},t))]})]},e.id))]})]}),h7=()=>$t(()=>import("./index-BWM8kiQ0.js"),__vite__mapDeps([0,1])),p7=()=>$t(()=>import("./index-BBbL0wfM.js"),__vite__mapDeps([2,1,3,4,5])),Xk=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,m7=ys()({validateSearch:e=>({status:Xk(e.status),author:Xk(e.author),fixtureCase:typeof e.fixtureCase=="string"?e.fixtureCase:void 0}),loaderDeps:({search:e})=>({statuses:e.status??null,authors:e.author??null,fixtureCase:e.fixtureCase}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.repository.list.queryOptions(n),staleTime:"static"})},component:fn(p7,"component"),pendingComponent:d7,errorComponent:fn(h7,"errorComponent")}),g7=()=>$t(()=>import("./route-qbVbAxtx.js"),[]),y7=ys()({component:fn(g7,"component")}),x7=ys()({beforeLoad:()=>{kE({to:"/settings/agents",throw:!0})}}),b7={section:"agents"},v7=["w-2/5","w-3/5","w-1/2"],ru=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the settings"}),x.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-4 motion-safe:animate-pulse",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),v7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]}),S7=()=>$t(()=>import("./agents-DbSvvIcf.js"),__vite__mapDeps([6,7])),w7=()=>$t(()=>import("./agents-Cg-w99VB.js"),__vite__mapDeps([8,9,10,4,11])),E7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(b7),staleTime:"static"})},component:fn(w7,"component"),pendingComponent:ru,errorComponent:fn(S7,"errorComponent")}),C7={section:"configuration"},N7=()=>$t(()=>import("./configuration-PLwRj92u.js"),__vite__mapDeps([12,7])),T7=()=>$t(()=>import("./configuration-B1tYKnw1.js"),__vite__mapDeps([13,9,14,11])),R7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(C7),staleTime:"static"})},component:fn(T7,"component"),pendingComponent:ru,errorComponent:fn(N7,"errorComponent")}),O7={section:"forges"},k7=()=>$t(()=>import("./forges-D5lw6fYh.js"),__vite__mapDeps([15,7])),M7=()=>$t(()=>import("./forges-ChElPpOV.js"),__vite__mapDeps([16,9,17,11])),A7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(O7),staleTime:"static"})},component:fn(M7,"component"),pendingComponent:ru,errorComponent:fn(k7,"errorComponent")}),_7={section:"repositories"},D7=()=>$t(()=>import("./repositories-Di8qfiyD.js"),__vite__mapDeps([18,7])),I7=()=>$t(()=>import("./repositories-DdOEWFoL.js"),__vite__mapDeps([19,3,4,5,11])),j7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(_7),staleTime:"static"})},component:fn(I7,"component"),pendingComponent:ru,errorComponent:fn(D7,"errorComponent")}),L7=["first","second","third","fourth"],P7=["w-2/5","w-3/5","w-1/2"],z7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the setup"}),x.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:[x.jsx("span",{className:"h-9 w-64 rounded-sm bg-muted lg:col-span-2"}),x.jsx("div",{children:L7.map(e=>x.jsxs("div",{className:"grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-5 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsx("span",{className:"h-5 w-32 rounded-sm bg-muted"})]},e))}),x.jsxs("div",{className:"flex flex-col gap-4",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),P7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]})]}),B7=()=>$t(()=>import("./index-CPyhbNqS.js"),__vite__mapDeps([20,21])),H7=()=>$t(()=>import("./index-Dfzoepph.js"),__vite__mapDeps([22,21,3,4,10,14,17])),F7=ys()({validateSearch:e=>({step:typeof e.step=="string"?e.step:void 0}),loaderDeps:({search:e})=>({step:e.step??null}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.setup.get.queryOptions(n),staleTime:"static"})},component:fn(H7,"component"),pendingComponent:z7,errorComponent:fn(B7,"errorComponent")}),$7=e=>({artifactUrl:e.artifact,repositoryName:e.repository,targetId:e.target}),V7=()=>$t(()=>import("./download-BsAZZo3P.js"),[]),RS=e=>typeof e=="string"?e:"",U7=ys()({validateSearch:e=>({artifact:RS(e.artifact),repository:RS(e.repository),target:RS(e.target)}),loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},deps:n})=>{const r=$7(n),s=await e.query({...t.review.importForm.queryOptions(r),staleTime:"static"});if(!s.startsAtOnce)return{importId:s.isImporting?s.importId:null,refusal:null};const i=await e.getMutationCache().build(e,t.review.import.mutationOptions()).execute(r);return await e.invalidateQueries(t.review.importForm.pathFilter()),{importId:i.importId,refusal:i.importId===null?i.message:null}},component:fn(V7,"component")}),Ui="rounded-sm bg-muted motion-safe:animate-pulse",q7=()=>x.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:[x.jsx("div",{className:"col-span-2 border-b pb-3",children:x.jsx("div",{className:`h-5 w-64 ${Ui}`})}),x.jsxs("div",{className:"flex flex-col gap-4 pt-6",children:[x.jsx("div",{className:`h-5 w-28 ${Ui}`}),x.jsx("div",{className:`h-5 w-40 ${Ui}`}),x.jsx("div",{className:`h-5 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-36 ${Ui}`})]}),x.jsxs("div",{className:"flex flex-col gap-3 pt-6",children:[x.jsx("div",{className:`h-6 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[70ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[64ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[52ch] ${Ui}`}),x.jsx("div",{className:`mt-8 h-64 w-full ${Ui}`})]})]});var Bs=dj();const ube=bE(Bs),fL=()=>"Notification"in window,Q1=()=>{fL()&&Notification.permission==="default"&&Notification.requestPermission()};function ad(e){const t={subscribe(n){let r=null,s=!1,i=!1,l=!1;function c(){if(r===null){l=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(u){var d;s||(d=n.next)===null||d===void 0||d.call(n,u)},error(u){var d;s||(s=!0,(d=n.error)===null||d===void 0||d.call(n,u),c())},complete(){var u;s||(s=!0,(u=n.complete)===null||u===void 0||u.call(n),c())}}),l&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(G7,t)}};return t}function G7(e,t){return t(e)}function K7(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function i(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const l=e.subscribe({next(c){s=!0,n(c),i()},error(c){r(c)},complete(){t.abort(),i()}})})}function Y7(e){return t=>{let n=0,r=null;const s=[];function i(){r||(r=t.subscribe({next(c){for(const d of s){var u;(u=d.next)===null||u===void 0||u.call(d,c)}},error(c){for(const d of s){var u;(u=d.error)===null||u===void 0||u.call(d,c)}},complete(){for(const u of s){var c;(c=u.complete)===null||c===void 0||c.call(u)}}}))}function l(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return ad(c=>(n++,s.push(c),i(),{unsubscribe(){n--,l();const u=s.findIndex(d=>d===c);u>-1&&s.splice(u,1)}}))}}function dL(e){let t=e;const n=[],r=l=>{t!==void 0&&l.next(t),n.push(l)},s=l=>{n.splice(n.indexOf(l),1)},i=ad(l=>(r(l),()=>{s(l)}));return i.next=l=>{if(t!==l){t=l;for(const c of n)c.next(l)}},i.get=()=>t,i}function hL(e){return ad(t=>{function n(r=0,s=e.op){const i=e.links[r];if(!i)throw new Error("No more links to execute - did you forget to add an ending link?");return i({op:s,next(l){return n(r+1,l)}})}return n().subscribe(t)})}function Qk(e){return Array.isArray(e)?e:[e]}function W7(e){return t=>{const n=Qk(e.true).map(s=>s(t)),r=Qk(e.false).map(s=>s(t));return s=>ad(i=>{const l=e.condition(s.op)?n:r;return hL({op:s.op,links:l}).subscribe(i)})}}function Jh(e){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jh(e)}function X7(e,t){if(Jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q7(e){var t=X7(e,"string");return Jh(t)=="symbol"?t:t+""}function Ir(e,t,n){return(t=Q7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){Ir(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ca(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Z7(e){return typeof e=="function"}function pL(){return Object.create(null)}const J7=typeof Symbol=="function"&&!!Symbol.asyncIterator;function eq(e){return J7&&Ca(e)&&Symbol.asyncIterator in e}const KE=e=>e(),Pg={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},tq=[Pg.BAD_GATEWAY,Pg.SERVICE_UNAVAILABLE,Pg.GATEWAY_TIMEOUT,Pg.INTERNAL_SERVER_ERROR],mL=()=>{},Jk=e=>{Object.freeze&&Object.freeze(e)};function gL(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(mL,{get(i,l){if(!(typeof l!="string"||l==="then"))return gL(e,[...t,l],n)},apply(i,l,c){const u=t[t.length-1];if(u==="valueOf"||u==="toString"||u==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let d={args:c,path:t};return u==="call"?d={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(d={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),Jk(d.args),Jk(d.path),e(d)}})),n[s]}const yL=e=>gL(e,[],pL()),nq=e=>new Proxy(mL,{get(t,n){if(n!=="then")return e(n)}});function ep(e){"@babel/helpers - typeof";return ep=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ep(e)}function rq(e,t){if(ep(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sq(e){var t=rq(e,"string");return ep(t)=="symbol"?t:t+""}function yc(e,t,n){return(t=sq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var iq=class extends Error{constructor(e){super(oq(e)),Object.assign(this,e)}};function oq(e){if("message"in e)return String(e.message)}function lq(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(Ca(e))return new iq(e)}}var tM=class extends Error{constructor(e){var t,n,r;const s=lq(e.cause),i=(t=(n=e.message)!==null&&n!==void 0?n:s==null?void 0:s.message)!==null&&t!==void 0?t:e.code;super(i,{cause:s}),yc(this,"cause",void 0),yc(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function aq(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:zg(zg({},e),{},{error:n})}}return{ok:!0,result:zg(zg({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var OS=class extends Error{constructor(){super("Unable to transform response from server")}};function cq(e,t){let n;try{n=aq(e,t)}catch{throw new OS}if(!n.ok&&(!Ca(n.error.error)||typeof n.error.error.code!="number"))throw new OS;if(n.ok&&!Ca(n.result))throw new OS;return n}function uq(e){return typeof e=="function"}async function fq(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(i=>t===i||t.startsWith(i+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function dq(e){const{type:t,path:n}=e,r=await fq(e.router,n);if(!r||!uq(r)||r._def.type!==t&&!e.allowMethodOverride)throw new tM({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});/* istanbul ignore if -- @preserve */if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new tM({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}let xL;const kS=new WeakMap,hq=()=>{};xL=Symbol.toStringTag;var bL=class dc{constructor(t){yc(this,"promise",void 0),yc(this,"subscribers",[]),yc(this,"settlement",null),yc(this,xL,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const n=this.promise.then(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:r},s==null||s.forEach(({resolve:i})=>{i(r)})});"catch"in n&&n.catch(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"rejected",reason:r},s==null||s.forEach(({reject:i})=>{i(r)})})}subscribe(){let t,n;const{settlement:r}=this;if(r===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const s=mq();this.subscribers=gq(this.subscribers,s),t=s.promise,n=()=>{this.subscribers!==null&&(this.subscribers=xq(this.subscribers,s))}}else{const{status:s}=r;s==="fulfilled"?t=Promise.resolve(r.value):t=Promise.reject(r.reason),n=hq}return Object.assign(t,{unsubscribe:n})}then(t,n){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.then(t,n),{unsubscribe:s})}catch(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.catch(t),{unsubscribe:r})}finally(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.finally(t),{unsubscribe:r})}static proxy(t){const n=dc.getSubscribablePromise(t);return typeof n<"u"?n:dc.createSubscribablePromise(t)}static createSubscribablePromise(t){const n=new dc(t);return kS.set(t,n),kS.set(n,n),n}static getSubscribablePromise(t){return kS.get(t)}static resolve(t){const n=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return dc.proxy(n).subscribe()}static async any(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async race(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async raceReferences(t){const n=t.map(pq);try{return await Promise.race(n)}finally{for(const r of n)r.unsubscribe()}}};function pq(e){return bL.proxy(e).then(()=>[e])}function mq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function gq(e,t){return[...e,t]}function yq(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xq(e,t){const n=e.indexOf(t);return n!==-1?yq(e,n):e}var nM,rM,sM,iM;(rM=(nM=Symbol).dispose)!==null&&rM!==void 0||(nM.dispose=Symbol());(iM=(sM=Symbol).asyncDispose)!==null&&iM!==void 0||(sM.asyncDispose=Symbol());function bq(e,t){const n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r==null||r.call(n)},n}function vq(e,t){const n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await(r==null?void 0:r.call(n))},n}const vL=Symbol();function Sq(e){let t=null;return bq({start(){if(t)throw new Error("Timer already started");return new Promise(n=>{t=setTimeout(()=>n(vL),e)})}},()=>{t&&clearTimeout(t)})}function SL(){var e=typeof SuppressedError=="function"?SuppressedError:function(s,i){var l=Error();return l.name="SuppressedError",l.error=s,l.suppressed=i,l},t={},n=[];function r(s,i){if(i!=null){if(Object(i)!==i)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var l=i[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=i[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var c=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");c&&(l=function(){try{c.call(i)}catch(d){return Promise.reject(d)}}),n.push({v:i,d:l,a:s})}else s&&n.push({d:i,a:s});return i}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var i,l=this.e,c=0;function u(){for(;i=n.pop();)try{if(!i.a&&c===1)return c=0,n.push(i),Promise.resolve().then(u);if(i.d){var h=i.d.call(i.v);if(i.a)return c|=2,Promise.resolve(h).then(u,d)}else c|=1}catch(m){return d(m)}if(c===1)return l!==t?Promise.reject(l):Promise.resolve();if(l!==t)throw l}function d(h){return l=l!==t?new e(h,l):h,u()}return u()}}}function wL(e,t){this.v=e,this.k=t}function oM(e){return new wL(e,0)}function wq(e){return function(){return new Ch(e.apply(this,arguments))}}function Ch(e){var t,n;function r(i,l){try{var c=e[i](l),u=c.value,d=u instanceof wL;Promise.resolve(d?u.v:u).then(function(h){if(d){var m=i==="return"?"return":"next";if(!u.k||h.done)return r(m,h);h=e[m](h).value}s(c.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}function s(i,l){switch(i){case"return":t.resolve({value:l,done:!0});break;case"throw":t.reject(l);break;default:t.resolve({value:l,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(i,l){return new Promise(function(c,u){var d={key:i,arg:l,resolve:c,reject:u,next:null};n?n=n.next=d:(t=n=d,r(i,l))})},typeof e.return!="function"&&(this.return=void 0)}Ch.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ch.prototype.next=function(e){return this._invoke("next",e)},Ch.prototype.throw=function(e){return this._invoke("throw",e)},Ch.prototype.return=function(e){return this._invoke("return",e)};const Eq="ping",Cq="serialized-error",Nq="connected",Tq="return";async function Rq(e){try{var t=SL();const n=t.u(Sq(e.timeoutMs)),r=await bL.race([e.promise,n.start()]);return r===vL?await e.onTimeout():r}catch(n){t.e=n}finally{t.d()}}function Oq(e){const{deserialize:t=c=>c}=e;let n=pL();const r=e.signal;let s=null;const i=()=>new ReadableStream({async start(c){const[u,d]=await Promise.all([e.url(),e.init()]),h=s=new e.EventSource(u,d);c.enqueue({type:"connecting",eventSource:s,event:null}),h.addEventListener(Nq,g=>{const y=JSON.parse(g.data);n=y,c.enqueue({type:"connected",options:y,eventSource:h})}),h.addEventListener(Cq,g=>{const y=g;c.enqueue({type:"serialized-error",error:t(JSON.parse(y.data)),eventSource:h})}),h.addEventListener(Eq,()=>{c.enqueue({type:"ping",eventSource:h})}),h.addEventListener(Tq,()=>{h.close(),c.close(),s=null}),h.addEventListener("error",g=>{h.readyState===h.CLOSED?c.error(g):c.enqueue({type:"connecting",eventSource:h,event:g})}),h.addEventListener("message",g=>{const y=g,b={data:t(JSON.parse(y.data))};y.lastEventId&&(b.id=y.lastEventId),c.enqueue({type:"data",data:b,eventSource:h})});const m=()=>{try{h.close(),c.close()}catch{}};r.aborted?m():r.addEventListener("abort",m)},cancel(){s==null||s.close()}}),l=()=>{let c=i(),u=c.getReader();async function d(){await u.cancel(),s=null}return vq({read(){return u.read()},async recreate(){await d(),c=i(),u=c.getReader()}},d)};return KE(wq(function*(){try{var c=SL();const u=c.a(l());for(;;){let d=u.read();const h=n.reconnectAfterInactivityMs;h&&(d=Rq({promise:d,timeoutMs:h,onTimeout:async()=>{const g={value:{type:"timeout",ms:h,eventSource:s},done:!1};return await u.recreate(),g}}));const m=yield oM(d);if(m.done)return m.value;yield m.value}}catch(u){c.e=u}finally{yield oM(c.d())}}))}function kq(e){return e instanceof la}function Mq(e){return Ca(e)&&Ca(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Aq(e,t){return typeof e=="string"?e:Ca(e)&&typeof e.message=="string"?e.message:t}var la=class w0 extends Error{constructor(t,n){var r,s;const i=n==null?void 0:n.cause;super(t,{cause:i}),Ir(this,"cause",void 0),Ir(this,"shape",void 0),Ir(this,"data",void 0),Ir(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,w0.prototype)}static from(t,n={}){const r=t;return kq(r)?(n.meta&&(r.meta=An(An({},r.meta),n.meta)),r):Mq(r)?new w0(r.error.message,An(An({},n),{},{result:r,cause:n.cause})):new w0(Aq(r,"Unknown error"),An(An({},n),{},{cause:r}))}};function EL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const lM=e=>typeof e=="function";function _q(e){if(e)return e;if(typeof window<"u"&&lM(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&lM(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function Dq(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const i of e)i!=null&&i.aborted?s():i==null||i.addEventListener("abort",s,{once:!0});return t.signal}function CL(...e){const t=new AbortController;for(const n of e)n!=null&&n.aborted?t.abort():n==null||n.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function Iq(e){return{url:e.url.toString(),fetch:e.fetch,transformer:EL(e.transformer),methodOverride:e.methodOverride}}function jq(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Lq={query:"GET",mutation:"POST",subscription:"PATCH"};function NL(e){return"input"in e?e.transformer.input.serialize(e.input):jq(e.inputs.map(t=>e.transformer.input.serialize(t)))}const YE=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=NL(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},Pq=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=NL(e);return t!==void 0?JSON.stringify(t):void 0},zq=e=>$q(An(An({},e),{},{contentTypeHeader:"application/json",getUrl:YE,getBody:Pq}));var Bq=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Hq=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Bq};async function Fq(e){var t,n;Hq(e.signal);const r=e.getUrl(e),s=e.getBody(e),i=(t=e.methodOverride)!==null&&t!==void 0?t:Lq[e.type],l=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),c=An(An(An({},e.contentTypeHeader&&i!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),l);return _q(e.fetch)(r,{method:i,signal:e.signal,body:s,headers:c})}async function $q(e){const t={},n=await Fq(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const aM=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function cM(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const u=[[]];let d=0;for(;;){const g=c[d];if(!g)break;const y=u[u.length-1];if(g.aborted){var h;(h=g.reject)===null||h===void 0||h.call(g,new Error("Aborted")),d++;continue}if(e.validate(y.concat(g).map(b=>b.key))){y.push(g),d++;continue}if(y.length===0){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Input is too big for a single dispatch")),d++;continue}u.push([])}return u}function i(){const c=s(t);r();for(const u of c){if(!u.length)continue;const d={items:u};for(const h of u)h.batch=d;e.fetch(d.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(g,y)=>{const b=d.items[y];try{var w;const C=await Promise.resolve(g);(w=b.resolve)===null||w===void 0||w.call(b,C)}catch(C){var E;(E=b.reject)===null||E===void 0||E.call(b,C)}b.batch=null,b.reject=null,b.resolve=null}));for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Missing result")),g.batch=null}}).catch(h=>{for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,h),g.batch=null}})}}function l(c){var u;const d={aborted:!1,key:c,batch:null,resolve:aM,reject:aM},h=new Promise((m,g)=>{var y;d.reject=g,d.resolve=m,(y=t)!==null&&y!==void 0||(t=[]),t.push(d)});return(u=n)!==null&&u!==void 0||(n=setTimeout(i)),h}return{load:l}}function Vq(e){var t,n;const r=Iq(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const l=u=>({validate(d){if(s===1/0&&i===1/0)return!0;if(d.length>i)return!1;const h=d.map(g=>g.path).join(","),m=d.map(g=>g.input);return YE(An(An({},r),{},{type:u,path:h,inputs:m,signal:null})).length<=s},async fetch(d){const h=d.map(b=>b.path).join(","),m=d.map(b=>b.input),g=Dq(...d.map(b=>b.signal)),y=await zq(An(An({},r),{},{path:h,inputs:m,type:u,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:g}));return(Array.isArray(y.json)?y.json:d.map(()=>y.json)).map(b=>({meta:y.meta,json:b}))}}),c={query:cM(l("query")),mutation:cM(l("mutation"))};return({op:u})=>ad(d=>{/* istanbul ignore if -- @preserve */if(u.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=new AbortController,m=c[u.type].load(An(An({},u),{},{signal:CL(u.signal,h.signal)}));let g=!1,y;return m.then(b=>{g=!0,y=b;const w=cq(b.json,r.transformer.output);if(!w.ok){d.error(la.from(w.error,{meta:b.meta}));return}d.next({context:b.meta,result:w.result}),d.complete()}).catch(b=>{g=!0,d.error(la.from(b,{meta:y==null?void 0:y.meta}))}),()=>{g||h.abort()}})}}const tp=(e,...t)=>typeof e=="function"?e(...t):e;function Uq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function qq(e){const t=await tp(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Gq(e,t){const n={method:"connectionParams",data:await tp(e)};return t.encode(n)}function Kq(e){const{promise:t,resolve:n,reject:r}=Uq();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function Yq(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function i(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function l(){clearTimeout(r),i()}function c(){clearTimeout(s),l()}e.addEventListener("open",i),e.addEventListener("message",({data:u})=>{clearTimeout(r),i(),u==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var Wq=class Z1{constructor(t){var n;if(Ir(this,"id",++Z1.connectCount),Ir(this,"WebSocketPonyfill",void 0),Ir(this,"urlOptions",void 0),Ir(this,"keepAliveOpts",void 0),Ir(this,"encoder",void 0),Ir(this,"wsObservable",dL(null)),Ir(this,"openPromise",null),this.WebSocketPonyfill=(n=t.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=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}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=++Z1.connectCount;const t=qq(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Yq(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Kq(n),this.urlOptions.connectionParams&&n.send(await Gq(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};Ir(Wq,"connectCount",0);var TL=class{constructor(e){Ir(this,"links",void 0),Ir(this,"runtime",void 0),Ir(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return hL({links:this.links,op:An(An({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Y7())}async requestAsPromise(e){try{const t=this.$request(e);return(await K7(t)).result.data}catch(t){throw la.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var i;(i=n.onStarted)===null||i===void 0||i.call(n,{context:r.context});break;case"stopped":var l;(l=n.onStopped)===null||l===void 0||l.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const RL=Symbol.for("trpc_untypedClient"),Xq={query:"query",mutate:"mutation",subscribe:"subscription"},Qq=e=>Xq[e];function Zq(e){const t=yL(({path:n,args:r})=>{const s=[...n],i=Qq(s.pop()),l=s.join(".");return e[i](l,...r)});return nq(n=>n===RL?e:t[n])}function Jq(e){return Zq(new TL(e))}function eG(e){return e[RL]}function tG(e,t){return!t||e!=null&&typeof e!="object"?e:An(An({},e??{}),{},{lastEventId:t})}function nG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new E0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function E0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return E0=function(r){this.s=r,this.n=r.next},E0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new E0(e)}async function rG(e){let t=await tp(e.url);if(e.connectionParams){const n=await tp(e.connectionParams),r=t.includes("?")?"&":"?";t+=r+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return t}function sG(e){const t=EL(e.transformer);return()=>({op:n})=>ad(r=>{var s;const{type:i,path:l,input:c}=n;/* istanbul ignore if -- @preserve */if(i!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let u;const d=new AbortController,h=CL(n.signal,d.signal),m=Oq({url:async()=>YE({transformer:t,url:await rG(e),input:tG(c,u),path:l,type:i,signal:null}),init:()=>tp(e.eventSourceOptions,{op:n}),signal:h,deserialize:b=>t.output.deserialize(b),EventSource:(s=e.EventSource)!==null&&s!==void 0?s:globalThis.EventSource}),g=dL({type:"state",state:"connecting",error:null}),y=g.subscribe({next(b){r.next({result:b})}});return KE(async()=>{var b=!1,w=!1,E;try{for(var C=nG(m),T;b=!(T=await C.next()).done;b=!1){const N=T.value;switch(N.type){case"ping":break;case"data":const R=N.data;let M;R.id?(u=R.id,M={id:R.id,data:R}):M={data:R.data},r.next({result:M,context:{eventSource:N.eventSource}});break;case"connected":r.next({result:{type:"started"},context:{eventSource:N.eventSource}}),g.next({type:"state",state:"pending",error:null});break;case"serialized-error":{const D=la.from({error:N.error});if(tq.includes(N.error.code)){g.next({type:"state",state:"connecting",error:D});break}throw D}case"connecting":{const D=g.get(),k=N.event&&la.from(N.event);if(!k&&D.state==="connecting")break;g.next({type:"state",state:"connecting",error:k});break}case"timeout":g.next({type:"state",state:"connecting",error:new la(`Timeout of ${N.ms}ms reached while waiting for a response`)})}}}catch(N){w=!0,E=N}finally{try{b&&C.return!=null&&await C.return()}finally{if(w)throw E}}r.next({result:{type:"stopped"}}),g.next({type:"state",state:"idle",error:null}),r.complete()}).catch(b=>{r.error(la.from(b))}),()=>{r.complete(),d.abort(),y.unsubscribe()}})}function np(e){"@babel/helpers - typeof";return np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},np(e)}function iG(e,t){if(np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oG(e){var t=iG(e,"string");return np(t)=="symbol"?t:t+""}function lG(e,t,n){return(t=oG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){lG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new C0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function C0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return C0=function(r){this.s=r,this.n=r.next},C0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new C0(e)}function cG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function uG(e,t){if(e==null)return{};var n,r,s=cG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const fG=["cursor","direction"];function Vy(e){return{path:e.path.join(".")}}function dG(e){return e.length>=3}function hG(e){return dG(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function WE(e,t,n){var r;const s=hG(e);let i=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var l,c;i=wt(wt(wt({},(l=(c=s.args)===null||c===void 0?void 0:c.input)!==null&&l!==void 0?l:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.path.join("."),i,t==null?void 0:t.trpc]}async function pG(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var i=!1,l=!1,c;try{for(var u=aG(e),d;i=!(d=await u.next()).done;i=!1){const h=d.value;s.push(h),r.setState({data:[...s]})}}catch(h){l=!0,c=h}finally{try{i&&u.return!=null&&await u.return()}finally{if(l)throw c}}return s}function Mo(e){const t=KE(()=>{const{input:n,type:r}=e,s=e.path.flatMap(i=>i.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&Ca(n)&&("direction"in n||"cursor"in n)){const{cursor:i,direction:l}=n;return[s,{input:uG(n,fG),type:"infinite"}]}return[s,wt(wt({},typeof n<"u"&&n!==ri&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function OL(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function XE(e){return Z7(e)?e():e}function mG(e){var t;const{input:n,query:r,path:s,queryKey:i,opts:l}=e,c=n===ri,u=async d=>{var h;const m=wt(wt({},l),{},{trpc:wt(wt({},l==null?void 0:l.trpc),!(l==null||(h=l.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})});return await r(...WE(i,m,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign(wt(wt({},l??{}),{},{queryKey:i,queryFn:c?ri:u,initialPageParam:(t=l==null?void 0:l.initialCursor)!==null&&t!==void 0?t:n==null?void 0:n.cursor}),{trpc:Vy({path:s})})}function gG(e){var t,n;const{mutate:r,path:s,prefix:i,opts:l,overrides:c}=e,u=XE(e.queryClient),d=OL({path:s,prefix:(t=l==null?void 0:l.keyPrefix)!==null&&t!==void 0?t:i}),h=u.defaultMutationOptions(u.getMutationDefaults(d)),m=(n=c==null?void 0:c.onSuccess)!==null&&n!==void 0?n:(y=>y.originalFn()),g=async y=>await r(...WE([...d,{input:y}],l));return wt(wt({},l),{},{mutationKey:d,mutationFn:g,onSuccess(...y){var b,w;return m({originalFn:()=>{var C,T,N;return(C=l==null||(T=l.onSuccess)===null||T===void 0?void 0:T.call(l,...y))!==null&&C!==void 0?C:h==null||(N=h.onSuccess)===null||N===void 0?void 0:N.call(h,...y)},queryClient:u,meta:(b=(w=l==null?void 0:l.meta)!==null&&w!==void 0?w:h==null?void 0:h.meta)!==null&&b!==void 0?b:{}})},trpc:Vy({path:s})})}function yG(e){const{input:t,query:n,path:r,queryKey:s,opts:i}=e,l=XE(e.queryClient),c=t===ri,u=async d=>{var h;const m=wt(wt({},i),{},{trpc:wt(wt({},i==null?void 0:i.trpc),!(i==null||(h=i.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})}),g=d.queryKey,y=await n(...WE(g,m));return eq(y)?pG(y,l,g):y};return Object.assign(wt(wt({},i),{},{queryKey:s,queryFn:c?ri:u}),{trpc:Vy({path:r})})}const xG=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:i={}}=e,l="enabled"in i?!!i.enabled:s!==ri,c=u=>t(n.join("."),s===ri?void 0:s,u);return wt(wt({},i),{},{enabled:l,subscribe:c,queryKey:r,trpc:Vy({path:n})})};function bG(e){const t=O.useRef(e);t.current=e;const n=O.useRef(new Set([])),r=O.useCallback(m=>{n.current.add(m)},[]),s=O.useRef(()=>{}),i=O.useCallback(()=>{var m;if((m=s.current)===null||m===void 0||m.call(s),h(l),!e.enabled)return;const g=e.subscribe({onStarted:()=>{var y,b;(y=(b=t.current).onStarted)===null||y===void 0||y.call(b),h(w=>wt(wt({},w),{},{status:"pending",error:null}))},onData:y=>{var b,w;(b=(w=t.current).onData)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"pending",data:y,error:null}))},onError:y=>{var b,w;(b=(w=t.current).onError)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"error",error:y}))},onConnectionStateChange:y=>{var b,w;(b=(w=t.current).onConnectionStateChange)===null||b===void 0||b.call(w,y),h(E=>{switch(y.state){case"connecting":return wt(wt({},E),{},{status:"connecting",error:y.error});case"pending":return E;case"idle":return wt(wt({},E),{},{status:"idle",data:void 0,error:null})}})}});s.current=()=>{g.unsubscribe()}},[va(e.queryKey),e.enabled]),l=O.useCallback(()=>e.enabled?{data:void 0,error:null,status:"connecting",reset:i}:{data:void 0,error:null,status:"idle",reset:i},[e.enabled,i]),c=O.useRef(l()),[u,d]=O.useState(fM(c,r));u.reset=i;const h=O.useCallback(m=>{const g=c.current,y=c.current=m(g);let b=!1;for(const w of n.current)if(g[w]!==y[w]){b=!0;break}b&&d(fM(c,r))},[r]);return O.useEffect(()=>{if(e.enabled)return i(),()=>{var m;(m=s.current)===null||m===void 0||m.call(s)}},[i,e.enabled]),u}function fM(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function kL(e){const t=e.keyPrefix,n=r=>(s,i,l)=>"router"in e?Promise.resolve(XE(e.ctx)).then(c=>dq({router:e.router,path:s,getRawInput:async()=>i,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof TL?e.client:eG(e.client))[r](s,i,l);return yL(({args:r,path:s})=>{const i=[...s],l=i.pop(),[c,u]=r;return{"~types":void 0,pathKey:()=>Mo({path:i,type:"any",prefix:t}),pathFilter:()=>wt(wt({},c),{},{queryKey:Mo({path:i,type:"any",prefix:t})}),queryOptions:()=>yG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>Mo({path:i,input:c,type:"query",prefix:t}),queryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>mG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>Mo({path:i,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var d;return gG({opts:c,path:i,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(d=e.overrides)===null||d===void 0?void 0:d.mutations})},mutationKey:()=>OL({path:i,prefix:t}),subscriptionOptions:()=>xG({opts:u,path:i,input:c,queryKey:Mo({path:i,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[l]()})}function vG(){const e=O.createContext(null),t=O.createContext(null),n=i=>{const l=O.useMemo(()=>kL({client:i.trpcClient,queryClient:i.queryClient,keyPrefix:i.keyPrefix}),[i.trpcClient,i.queryClient,i.keyPrefix]);return O.createElement(e.Provider,{value:i.trpcClient},O.createElement(t.Provider,{value:l},i.children))};n.displayName="TRPCProvider";function r(){const i=O.useContext(t);if(!i)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return i}function s(){const i=O.useContext(e);if(!i)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return i}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const dM="/api/trpc",{TRPCProvider:SG,useTRPC:ii}=vG(),wG=()=>[W7({condition:e=>e.type==="subscription",true:sG({url:dM}),false:Vq({url:dM})})],EG=e=>Jq({links:e}),CG=(e,t)=>kL({client:e,queryClient:t}),NG={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)]"},TG={...NG,primary:"[--line:var(--primary)]"},RG=({lineColor:e})=>x.jsx("span",{"aria-hidden":"true",className:Ne("pointer-events-none absolute inset-x-0 bottom-0 h-1 bg-(--line)",TG[e])}),ML=3,OG=1,cd=2,QE=.5,kG=.3,MG=1.5,MS={added:"var(--diff-added)",modified:"var(--line-blue)",deleted:"var(--diff-removed)"},AL=e=>(e+ML+OG)*cd,hM=e=>e==="plain",AG=e=>Math.max(MG,e*kG),_L=({centre:e,radius:t})=>{const n=t*QE;return`M${String(e-n)} ${String(e)}h${String(n*cd)}`},_G=e=>{const t=e.radius*QE;return`${_L(e)}M${String(e.centre)} ${String(e.centre-t)}v${String(t*cd)}`},DG=({centre:e,radius:t})=>{const n=t*QE,r=n*cd;return`M${String(e-n)} ${String(e-n)}l${String(r)} ${String(r)}m0 ${String(-r)}l${String(-r)} ${String(r)}`},IG=({centre:e,radius:t})=>`M${String(e)} ${String(e-t)}a${String(t)} ${String(t)} 0 0 1 0 ${String(t*cd)}z`,AS=({path:e,radius:t})=>x.jsx("path",{d:e,strokeWidth:AG(t),className:"fill-none stroke-background [stroke-linecap:round]"}),_S=({shape:{centre:e,radius:t},ink:n,children:r=null})=>x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:e,cy:e,r:t,fill:n}),x.jsx("circle",{cx:e,cy:e,r:t+ML,stroke:n,className:"fill-none [stroke-width:1.5]"}),r]}),jG=(e,t)=>{const{centre:n,radius:r}=t;switch(e){case"added":return x.jsx(_S,{shape:t,ink:MS.added,children:x.jsx(AS,{path:_G(t),radius:r})});case"modified":return x.jsx(_S,{shape:t,ink:MS.modified});case"deleted":return x.jsx(_S,{shape:t,ink:MS.deleted,children:x.jsx(AS,{path:_L(t),radius:r})});case"breaks":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-destructive"}),x.jsx(AS,{path:DG(t),radius:r})]});case"behaviour-changes":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-background stroke-foreground [stroke-width:2]"}),x.jsx("path",{d:IG(t),className:"fill-foreground"})]});case"plain":return x.jsx("circle",{cx:n,cy:n,r,className:"fill-muted-foreground"})}},DL=({mark:e,radius:t,className:n})=>{const r=AL(t);return x.jsx("svg",{"aria-hidden":"true",width:r,height:r,viewBox:`0 0 ${String(r)} ${String(r)}`,"data-mark":e,className:Ne("shrink-0",n),children:jG(e,{centre:r/cd,radius:t})})},IL=O.createContext(void 0);function su(e){const t=O.useContext(IL);if(!e&&t===void 0)throw new Error(wn(27));return t}const jL="data-starting-style",LG="data-ending-style",PG={[jL]:""},zG={[LG]:""},ZE={transitionStatus(e){return e==="starting"?PG:e==="ending"?zG:null}},BG="data-open",HG="data-closed",FG="data-anchor-hidden",LL="data-popup-open",$G="data-pressed",VG={[LL]:""},UG={[LL]:"",[$G]:""},qG={[BG]:""},GG={[HG]:""},KG={[FG]:""},JE={open(e){return e?VG:null}},J1={open(e){return e?UG:null}},Uy={open(e){return e?qG:GG},anchorHidden(e){return e?KG:null}},zp={...Uy,...ZE},YG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,forceRender:l=!1,...c}=t,u=su(),d=u.useState("open"),h=u.useState("nested"),m=u.useState("mounted"),g=u.useState("transitionStatus");return dn("div",t,{state:{open:d,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:zp,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!h})}),qy="none",rl="trigger-press",xn="trigger-hover",bf="trigger-focus",eC="outside-press",tC="item-press",PL="close-press",Bc="focus-out",Bp="escape-key",ew="list-navigation",WG="cancel-open",Nh="sibling-open",XG="disabled",Hp="imperative-action";function gt(e,t,n,r){let s=!1,i=!1;const l=r??Tn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...l}}const zL=O.forwardRef(function(t,n){const{render:r,className:s,style:i,disabled:l=!1,nativeButton:c=!0,...u}=t,d=su(),h=d.useState("open"),{getButtonProps:m,buttonRef:g}=Pp({disabled:l,native:c}),y={disabled:l};function b(w){h&&d.setOpen(!1,gt(PL,w.nativeEvent))}return dn("button",t,{state:y,ref:[n,g],props:[{onClick:b},u,m]})});let pM=0;function QG(e,t="mui"){const[n,r]=O.useState(e),s=e||n;return O.useEffect(()=>{n==null&&(pM+=1,r(`${t}-${pM}`))},[n,t]),s}const mM=$E.useId;function Uf(e,t){if(mM!==void 0){const n=mM();return e??(t?`${t}-${n}`:n)}return QG(e,t)}function lo(e){return Uf(e,"base-ui")}const ZG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("descriptionElementId",d),dn("p",t,{ref:n,props:[{id:d},c]})});function nC(e){O.useEffect(e,Zh)}const dh=0;class si{constructor(){_t(this,"currentId",dh);_t(this,"clear",()=>{this.currentId!==dh&&(clearTimeout(this.currentId),this.currentId=dh)});_t(this,"disposeEffect",()=>this.clear)}static create(){return new si}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dh,n()},t)}isStarted(){return this.currentId!==dh}}function Jr(){const e=Tr(si.create).current;return nC(e.disposeEffect),e}function JG(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:eK,platform:tK,maxTouchPoints:nK}=JG(),Gy=eK.toLowerCase(),rp=tK.toLowerCase(),Ky=/^i(os$|p)/.test(rp)||rp==="macintel"&&nK>1,gM="android",tw=rp===gM||Gy.includes(gM),rC=!Ky&&rp.startsWith("mac");rp.startsWith("win");const rK=rC||Ky;var QI;const Aa=typeof CSS<"u"&&!!((QI=CSS.supports)!=null&&QI.call(CSS,"-webkit-backdrop-filter:none"));!Aa&&Gy.includes("firefox");!Aa&&Gy.includes("chrom");const sK=rK,sC=/jsdom|happydom/.test(Gy);function Ki(e){e.preventDefault(),e.stopPropagation()}function iK(e){return"nativeEvent"in e}function iC(e){return e.pointerType===""&&e.isTrusted?!0:tw&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oC(e){return sC?!1:!tw&&e.width===0&&e.height===0||tw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ha(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function oK(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Xr(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Je(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&$f(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Zr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const nw="data-base-ui-focusable",BL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Yy="ArrowLeft",Wy="ArrowRight",HL="ArrowUp",lC="ArrowDown",rw="data-trigger-disabled";function K0(e,t){if(!bt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(rw);for(const[,r]of t.entries())if(Je(r,n))return!r.hasAttribute(rw);return!1}function DS(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function lK(e){return e.matches("html,body")}function Xy(e){return Zt(e)&&e.matches(BL)}function aK(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${BL}`))!=null}function sw(e){return e?e.getAttribute("role")==="combobox"&&Xy(e):!1}function cK(e){if(!e||sC)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function iw(e){return e?e.hasAttribute(nw)?e:e.querySelector(`[${nw}]`)||e:null}function uK(e,t){return t!=null&&!ha(t)?0:typeof e=="function"?e():e}function sp(e,t,n){const r=uK(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function yM(e){return typeof e=="function"?e():e}function FL(e,t){return t||e==="click"||e==="mousedown"}function fK(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const dK=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new si,currentIdRef:{current:null},currentContextRef:{current:null}});function hK(e,t){e.current=t.current}function pK(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),i=O.useContext(dK),{currentIdRef:l,delayRef:c,timeoutMs:u,initialDelayRef:d,currentContextRef:h,hasProvider:m,timeout:g}=i,[y,b]=O.useState(!1),w=O.useRef(n);return ze(()=>{w.current=n},[n]),ze(()=>{function E(){var C;(C=h.current)==null||C.setIsInstantPhase(!1),l.current=null,h.current=null,c.current=d.current,g.clear()}if(l.current&&!n&&l.current===s){if(b(!1),u){const C=s;return g.start(u,()=>{r.select("open")||l.current&&l.current!==C||E()}),()=>{(w.current||l.current!==C)&&g.clear()}}E()}},[n,s,l,c,u,d,h,g,r]),ze(()=>{if(!n)return;const E=h.current,C=l.current;g.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:b},l.current=s,c.current={open:0,close:sp(d.current,"close")},C!==null&&C!==s?(b(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,gt(qy))):(b(!1),E==null||E.setIsInstantPhase(!1))},[n,s,r,l,c,d,h,g]),ze(()=>()=>{if(l.current===s){if(h.current=null,!w.current)return;l.current=null,hK(c,d),g.clear()}},[h,l,c,s,d,g]),O.useMemo(()=>({activeIdRef:l,hasProvider:m,delayRef:c,isInstantPhase:y}),[l,m,c,y])}function xt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function no(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Hn(e){const t=Tr(mK,e).current;return t.next=e,ze(t.effect),t}function mK(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Bg=null;class gK{constructor(){_t(this,"callbacks",[]);_t(this,"callbacksCount",0);_t(this,"nextId",1);_t(this,"startId",1);_t(this,"isScheduled",!1);_t(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)(s=n[i])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Hg=new gK;class Qi{constructor(){_t(this,"currentId",Bg);_t(this,"cancel",()=>{this.currentId!==Bg&&(Hg.cancel(this.currentId),this.currentId=Bg)});_t(this,"disposeEffect",()=>this.cancel)}static create(){return new Qi}static request(t){return Hg.request(t)}static cancel(t){return Hg.cancel(t)}request(t){this.cancel(),this.currentId=Hg.request(()=>{this.currentId=Bg,t()})}}function ip(){const e=Tr(Qi.create).current;return nC(e.disposeEffect),e}const yK={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},xK={...yK,position:"fixed",top:0,left:0},Na=O.forwardRef(function(t,n){const[r,s]=O.useState();ze(()=>{sK&&Aa&&s("button")},[]);const i={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:xK,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),qf=Math.min,Wo=Math.max,Y0=Math.round,Fg=Math.floor,Xo=e=>({x:e,y:e}),bK={left:"right",right:"left",bottom:"top",top:"bottom"};function $L(e,t,n){return Wo(e,qf(t,n))}function Ta(e,t){return typeof e=="function"?e(t):e}function ti(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function aC(e){return e==="x"?"y":"x"}function cC(e){return e==="y"?"height":"width"}function ei(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function uC(e){return aC(ei(e))}function vK(e,t,n){n===void 0&&(n=!1);const r=sl(e),s=uC(e),i=cC(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=W0(l)),[l,W0(l)]}function SK(e){const t=W0(e);return[ow(e),t,ow(t)]}function ow(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xM=["left","right"],bM=["right","left"],wK=["top","bottom"],EK=["bottom","top"];function CK(e,t,n){switch(e){case"top":case"bottom":return n?t?bM:xM:t?xM:bM;case"left":case"right":return t?wK:EK;default:return[]}}function NK(e,t,n,r){const s=sl(e);let i=CK(ti(e),n==="start",r);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(ow)))),i}function W0(e){const t=ti(e);return bK[t]+e.slice(t.length)}function TK(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function VL(e){return typeof e!="number"?TK(e):{top:e,right:e,bottom:e,left:e}}function X0(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function vM(e,t){return t<0||t>=e.length}function IS(e,t){return ff(e.current,{disabledIndices:t})}function SM(e,t){return ff(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ff(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let i=t;do i+=n?-s:s;while(i>=0&&i<=e.length-1&&UL(e,i,r));return i}function UL(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Qy(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function RK(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Qy(e,t=e?zs(e):null){return!e||!e.isConnected||!t||RK(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const OK='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function kK(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return $f(n)?n.host:null}function lw(e){for(const t of Array.from(e.children))if(Nr(t)==="summary")return t;return null}function MK(e,t){const n=lw(t);return!!n&&(e===n||Je(n,e))}function qL(e){const t=e?Nr(e):"";return e!=null&&e.matches(OK)&&(t!=="summary"||e.parentElement!=null&&Nr(e.parentElement)==="details"&&lw(e.parentElement)===e)&&(t!=="details"||lw(e)==null)&&(t!=="input"||e.type!=="hidden")}function GL(e){if(!qL(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=kK(t)){const n=t!==e,r=Nr(t)==="slot";if(t.hasAttribute("inert")||n&&Nr(t)==="details"&&!t.open&&!MK(e,t)||t.hasAttribute("hidden")||!r&&!AK(t,n))return!1}return!0}function AK(e,t){const n=zs(e);return t?n.display!=="none":Qy(e,n)}function KL(e){const t=e.tabIndex;if(t<0){const n=Nr(e);if(n==="details"||n==="audio"||n==="video"||Zt(e)&&e.isContentEditable)return 0}return t}function jS(e){if(Nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function _K(e,t){const n=jS(e);if(!n)return!0;const r=t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form&&i.checked});return r?r===n:t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form})===n}function YL(e){if(Zt(e)&&Nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function WL(e,t){YL(e).forEach(n=>{qL(n)&&t.push(n),WL(n,t)})}function XL(e,t,n){YL(e).forEach(r=>{Zt(r)&&r.matches(t)&&n.push(r),XL(r,t,n)})}function fC(e){return GL(e)&&KL(e)>=0}function QL(e){const t=[];return WL(e,t),t.filter(GL)}function Fp(e){const t=QL(e);return t.filter(n=>KL(n)>=0&&_K(n,t))}function ZL(e,t){const n=Fp(e),r=n.length;if(r===0)return;const s=Xr(Dt(e)),i=n.indexOf(s),l=i===-1?t===1?0:r-1:i+t;return n[l]}function dC(e){return ZL(Dt(e).body,1)||e}function JL(e){return ZL(Dt(e).body,-1)||e}function eP(e,t){if(!e)return null;const n=Fp(Dt(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const i=(s+t+r)%r;return n[i]}function DK(e){return eP(e,1)}function IK(e){return eP(e,-1)}function vf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Je(n,r)}function jK(e){Fp(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wM(e){const t=[];XL(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ra(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var i;return[...!n||(i=s.context)!=null&&i.open?[s]:[],...Ra(e,s.id,n)]})}function EM(e,t){var s;let n=[],r=(s=e.find(i=>i.id===t))==null?void 0:s.parentId;for(;r;){const i=e.find(l=>l.id===r);r=i==null?void 0:i.parentId,i&&(n=n.concat(i))}return n}function op(e){return`data-base-ui-${e}`}let $g=0;function N0(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame($g);function i(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return i(),Bn;const l=requestAnimationFrame(i);return $g=l,()=>{$g===l&&(cancelAnimationFrame(l),$g=0)}}const LS={inert:new WeakMap,"aria-hidden":new WeakMap},CM="data-base-ui-inert",aw={inert:new WeakSet,"aria-hidden":new WeakSet};let hh=new WeakMap,PS=0;function LK(e){return aw[e]}function tP(e){return e?$f(e)?e.host:tP(e.parentNode):null}const NM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=tP(n);return e.contains(r)?r:null}).filter(n=>n!=null),TM=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},RM=(e,t,n)=>{const r=[],s=i=>{!i||n.has(i)||Array.from(i.children).forEach(l=>{Nr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function PK(e,t,n,r,{mark:s=!0}){let i=null;r?i="inert":n&&(i="aria-hidden");let l=null,c=null;const u=NM(t,e),d=s?RM(t,TM(u),new Set(u)):[],h=[],m=[];if(i){const g=LS[i],y=LK(i);c=y,l=g;const b=NM(t,Array.from(t.querySelectorAll("[aria-live]"))),w=u.concat(b);RM(t,TM(w),new Set(w)).forEach(C=>{const T=C.getAttribute(i),N=T!==null&&T!=="false",R=(g.get(C)||0)+1;g.set(C,R),h.push(C),R===1&&N&&y.add(C),N||C.setAttribute(i,i==="inert"?"":"true")})}return s&&d.forEach(g=>{const y=(hh.get(g)||0)+1;hh.set(g,y),m.push(g),y===1&&g.setAttribute(CM,"")}),PS+=1,()=>{l&&h.forEach(g=>{const b=(l.get(g)||0)-1;l.set(g,b),b||(!(c!=null&&c.has(g))&&i&&g.removeAttribute(i),c==null||c.delete(g))}),s&&m.forEach(g=>{const y=(hh.get(g)||0)-1;hh.set(g,y),y||g.removeAttribute(CM)}),PS-=1,PS||(LS.inert=new WeakMap,LS["aria-hidden"]=new WeakMap,aw.inert=new WeakSet,aw["aria-hidden"]=new WeakSet,hh=new WeakMap)}}function OM(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,i=Dt(e[0]).body;return PK(e,i,n,r,{mark:s})}const zK=500,nP=500,BK={style:{transition:"none"}},rP="data-base-ui-click-trigger",HK={fallbackAxisSide:"none"},Zy={fallbackAxisSide:"end"},FK={clipPath:"inset(50%)",position:"fixed",top:0,left:0},sP=O.createContext(null),iP=()=>O.useContext(sP),$K=op("portal");function oP(e={}){const{ref:t,container:n,componentProps:r=Tn,elementProps:s}=e,i=Uf(),l=iP(),c=l==null?void 0:l.portalNode,[u,d]=O.useState(null),[h,m]=O.useState(null),g=Qe(E=>{E!==null&&m(E)}),y=O.useRef(null);ze(()=>{if(n===null){y.current&&(y.current=null,m(null),d(null));return}const E=(n&&(BE(n)?n:n.current))??c??document.body;if(E==null){y.current&&(y.current=null,m(null),d(null));return}y.current!==E&&(y.current=E,m(null),d(E))},[n,c]);const b=dn("div",r,{ref:[t,g],props:[{id:i,[$K]:""},s]}),w=u&&b?Bs.createPortal(b,u):null;return{node:h,nodeId:O.isValidElement(b)?b.props.id:void 0,subtree:w}}const hC=O.forwardRef(function(t,n){const{render:r,className:s,style:i,children:l,container:c,portalOwnerRole:u,...d}=t,{node:h,nodeId:m,subtree:g}=oP({container:c,ref:n,componentProps:t,elementProps:d}),y=O.useRef(null),b=O.useRef(null),w=O.useRef(null),E=O.useRef(null),[C,T]=O.useState(null),N=O.useRef(!1),R=C==null?void 0:C.modal,M=C==null?void 0:C.open,D=!!C&&!C.modal&&C.open&&!!h;O.useEffect(()=>{if(!h||R)return;function I(_){h&&_.relatedTarget&&vf(_)&&(_.type==="focusin"?N.current&&(wM(h),N.current=!1):(jK(h),N.current=!0))}return no(xt(h,"focusin",I,!0),xt(h,"focusout",I,!0))},[h,R]),ze(()=>{!h||M!==!0||!N.current||(wM(h),N.current=!1)},[M,h]);const k=O.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:w,afterInsideRef:E,portalNode:h,setFocusManagerState:T}),[h]);return x.jsxs(O.Fragment,{children:[g,x.jsxs(sP.Provider,{value:k,children:[D&&h&&x.jsx(Na,{"data-type":"outside",ref:y,onFocus:I=>{var _;if(vf(I,h))(_=w.current)==null||_.focus();else{const P=C?C.domReference:null,H=JL(P);H==null||H.focus()}}}),D&&h&&x.jsx("span",{role:u,"aria-owns":m,style:FK}),h&&Bs.createPortal(l,h),D&&h&&x.jsx(Na,{"data-type":"outside",ref:b,onFocus:I=>{var _;if(vf(I,h))(_=E.current)==null||_.focus();else{const P=C?C.domReference:null,H=dC(P);H==null||H.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,gt(Bc,I.nativeEvent)))}}})]})]})});function lP(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class pC{constructor(){_t(this,"nodesRef",{current:[]});_t(this,"events",lP())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const aP=O.createContext(null),cP=O.createContext(null),iu=()=>{var e;return((e=O.useContext(aP))==null?void 0:e.id)||null},_a=e=>{const t=O.useContext(cP);return e??t};function Jy(e){const t=Uf(),n=_a(e),r=iu();return ze(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function mC(e){const{children:t,id:n}=e,r=iu();return x.jsx(aP.Provider,{value:O.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gC(e){const{children:t,externalTree:n}=e,r=Tr(()=>n??new pC).current;return x.jsx(cP.Provider,{value:r,children:t})}function Io(e){return e==null?e:"current"in e?e.current:e}function VK(e,t){const n=vn(Zr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const kM=20;let aa=[];function yC(){aa=aa.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function MM(e){yC(),e&&Nr(e)!=="body"&&(aa.push(new WeakRef(e)),aa.length>kM&&(aa=aa.slice(-kM)))}function AM(){var e;return yC(),(e=aa[aa.length-1])==null?void 0:e.deref()}function UK(e){return e?fC(e)?e:Fp(e)[0]||e:null}function _M(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=QL(e).filter(i=>{const l=i.getAttribute("data-tabindex")||"";return fC(i)||i.hasAttribute("data-tabindex")&&!l.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function xC(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:y,getInsideElements:b}=e,w="rootStore"in t?t.rootStore:t,E=w.useState("open"),C=w.useState("domReferenceElement"),T=w.useState("floatingElement"),{events:N,dataRef:R}=w.context,M=Qe(()=>{var oe;return(oe=R.current.floatingContext)==null?void 0:oe.nodeId}),D=s===!1,k=sw(C)&&D,I=Hn(s),_=Hn(i),P=Hn(d),H=Hn(E),z=_a(y),U=iP(),j=O.useRef(!1),B=O.useRef(!1),L=O.useRef(!1),$=O.useRef(null),q=O.useRef(""),G=O.useRef(""),W=O.useRef(null),Z=O.useRef(null),re=Vf(W,g,U==null?void 0:U.beforeInsideRef),de=Vf(Z,U==null?void 0:U.afterInsideRef),F=Jr(),X=Jr(),te=ip(),J=U!=null,K=iw(T),ce=Qe((oe=K)=>oe?Fp(oe):[]),ye=Qe(()=>(b==null?void 0:b().filter(oe=>oe!=null))??[]);O.useEffect(()=>{if(r||!c)return;function oe(Se){Se.key==="Tab"&&Je(K,Xr(Dt(K)))&&ce().length===0&&!k&&Ki(Se)}const xe=Dt(K);return xt(xe,"keydown",oe)},[r,K,c,k,ce]),O.useEffect(()=>{if(r||!E)return;const oe=Dt(K);function xe(){L.current=!1}function Se(_e){const we=Zr(_e),Re=ye(),Ae=Je(T,we)||Je(C,we)||Je(U==null?void 0:U.portalNode,we)||Re.some(Le=>Le===we||Je(Le,we));L.current=!Ae,G.current=_e.pointerType||"keyboard",we!=null&&we.closest(`[${rP}]`)&&(B.current=!0,X.start(0,()=>{B.current=!1}))}function ke(){G.current="keyboard"}return no(xt(oe,"pointerdown",Se,!0),xt(oe,"pointerup",xe,!0),xt(oe,"pointercancel",xe,!0),xt(oe,"keydown",ke,!0),xe)},[r,T,C,K,E,U,X,ye]),O.useEffect(()=>{if(r||!u)return;const oe=Dt(K);function xe(){B.current=!0,X.start(0,()=>{B.current=!1})}function Se(Re){const Ae=Zr(Re);fC(Ae)&&($.current=Ae)}function ke(Re){const Ae=Re.relatedTarget,Le=Re.currentTarget,Ie=Zr(Re);c&&Ae==null&&Ie!=null&&Je(T,Ie)&&MM(Ie),queueMicrotask(()=>{const Ue=M(),We=w.context.triggerElements,Oe=ye(),De=(Ae==null?void 0:Ae.hasAttribute(op("focus-guard")))&&[W.current,Z.current,U==null?void 0:U.beforeInsideRef.current,U==null?void 0:U.afterInsideRef.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,Io(m),Io(h)].includes(Ae),ne=!(Je(C,Ae)||Je(T,Ae)||Je(Ae,T)||Je(U==null?void 0:U.portalNode,Ae)||Oe.some(he=>he===Ae||Je(he,Ae))||We.hasMatchingElement(he=>Je(he,Ae))||De||z&&(Ra(z.nodesRef.current,Ue).find(he=>{var se,Te;return Je((se=he.context)==null?void 0:se.elements.floating,Ae)||Je((Te=he.context)==null?void 0:Te.elements.domReference,Ae)})||EM(z.nodesRef.current,Ue).find(he=>{var se,Te,Ve;return[(se=he.context)==null?void 0:se.elements.floating,iw((Te=he.context)==null?void 0:Te.elements.floating)].includes(Ae)||((Ve=he.context)==null?void 0:Ve.elements.domReference)===Ae})));if(Le===C&&K&&_M(K),l&&Le!==C&&!Qy(Ie)&&Xr(oe)===oe.body){if(Zt(K)&&(K.focus(),l==="popup")){te.request(()=>{K.focus()});return}const he=ce(),se=$.current,Te=(se&&he.includes(se)?se:null)||he[he.length-1]||K;Zt(Te)&&Te.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(k||!c)&&Ae&&ne&&!B.current&&(k||Ae!==AM())&&(j.current=!0,w.setOpen(!1,gt(Bc,Re)))})}function _e(){L.current||(R.current.insideReactTree=!0,F.start(0,()=>{R.current.insideReactTree=!1}))}const we=Zt(C)?C:null;if(!(!T&&!we))return no(we&&xt(we,"focusout",ke),we&&xt(we,"pointerdown",xe),T&&xt(T,"focusin",Se),T&&xt(T,"focusout",ke),T&&U&&xt(T,"focusout",_e,!0))},[r,C,T,K,c,z,U,w,u,l,ce,k,M,R,F,X,te,h,m,ye]),O.useEffect(()=>{var Le,Ie,Ue;if(r||!T||!E)return;const oe=Array.from(((Le=U==null?void 0:U.portalNode)==null?void 0:Le.querySelectorAll(`[${op("portal")}]`))||[]),Se=(Ue=(Ie=(z?EM(z.nodesRef.current,M()):[]).find(We=>{var Oe;return sw(((Oe=We.context)==null?void 0:Oe.elements.domReference)||null)}))==null?void 0:Ie.context)==null?void 0:Ue.elements.domReference,_e=[...[T,...oe,W.current,Z.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,...ye()],Se,Io(m),Io(h),k?C:null].filter(We=>We!=null),we=OM(_e,{ariaHidden:c||k,mark:!1}),Re=[T,...oe].filter(We=>We!=null),Ae=OM(Re);return()=>{Ae(),we()}},[E,r,C,T,c,U,k,z,M,h,m,ye]),ze(()=>{if(!E||r||!Zt(K))return;q.current="",G.current="";const oe=Dt(K),xe=Xr(oe);queueMicrotask(()=>{const Se=I.current,ke=typeof Se=="function"?Se(P.current||""):Se;if(ke===void 0||ke===!1||Je(K,xe))return;let we=null;const Re=()=>(we==null&&(we=ce(K)),we[0]||K);let Ae;ke===!0||ke===null?Ae=Re():Ae=Io(ke),Ae=Ae||Re();const Le=Je(K,Xr(oe));N0(Ae,{preventScroll:Ae===K,shouldFocus(){if(!H.current)return!1;if(Le)return!0;const Ie=Xr(oe);return!(Ie!==Ae&&Je(K,Ie))}})})},[r,E,K,ce,I,P,H]),ze(()=>{if(r||!K)return;const oe=Dt(K),xe=Xr(oe),Se=P.current==null;MM(xe);function ke(we){if(we.open||(q.current=VK(we.nativeEvent,G.current)),we.reason===xn&&we.nativeEvent.type==="mouseleave"&&(j.current=!0),we.reason===eC)if(we.nested)j.current=!1;else if(iC(we.nativeEvent)||oC(we.nativeEvent))j.current=!1;else{let Re=!1;Dt(K).createElement("div").focus({get preventScroll(){return Re=!0,!1}}),Re?j.current=!1:j.current=!0}}N.on("openchange",ke);function _e(we){const Re=_.current;let Ae=typeof Re=="function"?Re(we):Re;if(Ae===void 0||Ae===!1)return null;Ae===null&&(Ae=!0);const Le=C!=null&&C.isConnected?C:null,Ie=xe!=null&&xe.isConnected&&Nr(xe)!=="body"?xe:null;let Ue=Se?Ie||Le:Le||Ie;return Ue||(Ue=AM()||null),typeof Ae=="boolean"?Ue:Io(Ae)||Ue||null}return()=>{N.off("openchange",ke);const we=Xr(oe),Re=ye(),Ae=Je(T,we)||Re.some(We=>We===we||Je(We,we))||z&&Ra(z.nodesRef.current,M(),!1).some(We=>{var Oe;return Je((Oe=We.context)==null?void 0:Oe.elements.floating,we)}),Le=_.current,Ie=q.current,Ue=_e(Ie);queueMicrotask(()=>{const We=UK(Ue),Oe=typeof Le!="boolean";if(Le&&!j.current&&Zt(We)&&(!(!Oe&&We!==we&&we!==oe.body)||Ae)){const De={preventScroll:!0};Ie==="keyboard"&&(De.focusVisible=!0),We.focus(De)}j.current=!1})}},[r,T,K,_,P,N,z,C,M,ye]),ze(()=>{if(!Aa||E||!T)return;const oe=Xr(Dt(T));!Zt(oe)||!Xy(oe)||Je(T,oe)&&oe.blur()},[E,T]),ze(()=>{if(!(r||!U))return U.setFocusManagerState({modal:c,closeOnFocusOut:u,open:E,onOpenChange:w.setOpen,domReference:C}),()=>{U.setFocusManagerState(null)}},[r,U,c,E,w,u,C]),ze(()=>{if(!(r||!K))return _M(K),()=>{queueMicrotask(yC)}},[r,K]);const ge=!r&&(c?!k:!0)&&(J||c);return x.jsxs(O.Fragment,{children:[ge&&x.jsx(Na,{"data-type":"inside",ref:re,onFocus:oe=>{var xe;if(c){const Se=ce();N0(Se[Se.length-1])}else if(U!=null&&U.portalNode)if(j.current=!1,vf(oe,U.portalNode)){const Se=dC(C);Se==null||Se.focus()}else(xe=Io(m??U.beforeOutsideRef))==null||xe.focus()}}),n,ge&&x.jsx(Na,{"data-type":"inside",ref:de,onFocus:oe=>{var xe;if(c)N0(ce()[0]);else if(U!=null&&U.portalNode)if(u&&(j.current=!0),vf(oe,U.portalNode)){const Se=JL(C);Se==null||Se.focus()}else(xe=Io(h??U.afterOutsideRef))==null||xe.focus()}})]})}function uP(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=rl}=t,d="rootStore"in e?e.rootStore:e,h=d.context.dataRef,m=O.useRef(void 0),g=ip(),y=Jr(),b=O.useMemo(()=>{function w(C,T,N,R){const M=gt(u,T,N);C&&R==="touch"&&c>0?y.start(c,()=>{d.setOpen(!0,M)}):d.setOpen(C,M)}function E(C,T,N){const R=h.current.openEvent,M=d.select("domReferenceElement")!==T;return C&&M||!C||!s?!0:R&&l?!N(R.type):!1}return{onPointerDown(C){m.current=ha(C.pointerType,!0)&&oC(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const T=m.current,N=C.nativeEvent,R=d.select("open");if(C.button!==0||r==="click"||ha(T,!0)&&i)return;const M=E(R,C.currentTarget,I=>I==="click"||I==="mousedown"),D=Zr(N);if(Xy(D)){w(M,N,D,T);return}const k=C.currentTarget;g.request(()=>{w(M,N,k,T)})},onClick(C){if(r==="mousedown-only")return;const T=m.current;if(r==="mousedown"&&T){m.current=void 0;return}if(ha(T,!0)&&i)return;const N=d.select("open"),R=E(N,C.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");w(R,C.nativeEvent,C.currentTarget,T)},onKeyDown(){m.current=void 0}}},[h,r,i,u,d,l,s,g,y,c]);return O.useMemo(()=>n?{reference:b}:Tn,[n,b])}function qK(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var y;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(((y=t.dataRef.current.openEvent)==null?void 0:y.type)||"")&&t.pointerType!=="touch";let d=i.width,h=i.height,m=i.x,g=i.y;return n==null&&t.x&&l&&(n=i.x-t.x),r==null&&t.y&&c&&(r=i.y-t.y),m-=n||0,g-=r||0,d=0,h=0,!s||u?(d=t.axis==="y"?i.width:0,h=t.axis==="x"?i.height:0,m=l&&t.x!=null?t.x:m,g=c&&t.y!=null?t.y:g):s&&!u&&(h=t.axis==="x"?i.height:h,d=t.axis==="y"?i.width:d),s=!0,{width:d,height:h,x:m,y:g,top:g,right:m+d,bottom:g+h,left:m}}}}function DM(e){return e!=null&&e.clientX!=null}function GK(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),u=s.context.dataRef,d=O.useRef(!1),h=O.useRef(null),[m,g]=O.useState(),[y,b]=O.useState([]),w=Qe(R=>{s.set("positionReference",R)}),E=Qe((R,M,D)=>{d.current||u.current.openEvent&&!DM(u.current.openEvent)||s.set("positionReference",qK(D??c,{x:R,y:M,axis:r,dataRef:u,pointerType:m}))}),C=Qe(R=>{i?h.current||(E(R.clientX,R.clientY,R.currentTarget),b([])):E(R.clientX,R.clientY,R.currentTarget)}),T=ha(m)?l:i;O.useEffect(()=>{if(!n){w(c);return}if(!T)return;function R(){var k;(k=h.current)==null||k.call(h),h.current=null}const M=vn(l);function D(k){const I=Zr(k);Je(l,I)?R():E(k.clientX,k.clientY)}return!u.current.openEvent||DM(u.current.openEvent)?h.current=xt(M,"mousemove",D):w(c),R},[T,n,l,u,c,s,E,w,y]),O.useEffect(()=>()=>{s.set("positionReference",null)},[s]),O.useEffect(()=>{n&&!l&&(d.current=!1)},[n,l]),O.useEffect(()=>{!n&&i&&(d.current=!0)},[n,i]);const N=O.useMemo(()=>{function R(M){g(M.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:C,onMouseEnter:C}},[C]);return O.useMemo(()=>n?{reference:N,trigger:N}:{},[n,N])}function KK(){return!1}function YK(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $p(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:i="sloppy",referencePress:l=KK,bubbles:c,externalTree:u}=t,d="rootStore"in e?e.rootStore:e,h=d.useState("open"),m=d.useState("floatingElement"),{dataRef:g,events:y}=d.context,b=_a(u),w=Qe(typeof s=="function"?s:()=>!1),E=typeof s=="function"?w:s,C=E!==!1,T=Qe(()=>i),{escapeKey:N,outsidePress:R}=YK(c),M=O.useRef(!1),D=O.useRef(!1),k=O.useRef(!1),I=O.useRef(!1),_=O.useRef(!1),P=O.useRef(""),H=O.useRef(null),z=Jr(),U=Jr(),j=Qe(()=>{U.clear(),g.current.insideReactTree=!1}),B=Qe(F=>{var J;const X=(J=g.current.floatingContext)==null?void 0:J.nodeId;return(b?Ra(b.nodesRef.current,X):[]).some(K=>{var ce;return((ce=K.context)==null?void 0:ce.open)&&!K.context.dataRef.current[F]})}),L=Qe(F=>DS(F,d.select("floatingElement"))||DS(F,d.select("domReferenceElement"))),$=Qe(F=>{l()&&d.setOpen(!1,gt(rl,F.nativeEvent))}),q=Qe(F=>{if(!h||!n||!r||F.key!=="Escape"||_.current||!N&&B("__escapeKeyBubbles"))return;const X=iK(F)?F.nativeEvent:F,te=gt(Bp,X);d.setOpen(!1,te),te.isCanceled||F.preventDefault(),!N&&!te.isPropagationAllowed&&F.stopPropagation()}),G=Qe(()=>{g.current.insideReactTree=!0,U.start(0,j)}),W=Qe(F=>{if(!h||!n||F.button!==0)return;const X=Zr(F.nativeEvent);Je(d.select("floatingElement"),X)&&(M.current||(M.current=!0,D.current=!1))}),Z=Qe(F=>{!h||!n||(F.defaultPrevented||F.nativeEvent.defaultPrevented)&&M.current&&(D.current=!0)});O.useEffect(()=>{function F(X){X.open||(I.current=!1)}return y.on("openchange",F),()=>{y.off("openchange",F)}},[y]),O.useEffect(()=>{if(!h||!n)return h||(I.current=!1),j;g.current.__escapeKeyBubbles=N,g.current.__outsidePressBubbles=R;const F=new si,X=new si,te=Dt(m);function J(){F.clear(),_.current=!0}function K(){F.start(Aa?5:0,()=>{_.current=!1})}function ce(){k.current=!0,X.start(0,()=>{k.current=!1})}function ye(){M.current=!1,D.current=!1}function ge(){const ne=P.current,he=ne==="pen"||!ne?"mouse":ne,se=T(),Te=typeof se=="function"?se():se;return typeof Te=="string"?Te:Te[he]}function oe(ne){const he=ge();return he==="intentional"&&ne.type!=="click"||he==="sloppy"&&ne.type==="click"}function xe(ne){var Te;const he=(Te=g.current.floatingContext)==null?void 0:Te.nodeId,se=b&&Ra(b.nodesRef.current,he).some(Ve=>{var jt;return DS(ne,(jt=Ve.context)==null?void 0:jt.elements.floating)});return L(ne)||se}function Se(ne){if(oe(ne)){ne.type!=="click"&&!L(ne)&&(X.clear(),k.current=!1),j();return}if(g.current.insideReactTree){j();return}const he=Zr(ne),se=`[${op("inert")}]`,Te=bt(he)?he.getRootNode():null,Ve=Array.from(($f(Te)?Te:Dt(d.select("floatingElement"))).querySelectorAll(se)),jt=d.context.triggerElements;if(he&&(jt.hasElement(he)||jt.hasMatchingElement(Fe=>Je(Fe,he))))return;let hn=bt(he)?he:null;for(;hn&&!Ko(hn);){const Fe=nl(hn);if(Ko(Fe)||!bt(Fe))break;hn=Fe}if(!(Ve.length&&bt(he)&&!lK(he)&&!Je(he,d.select("floatingElement"))&&Ve.every(Fe=>!Je(hn,Fe)))){if(Zt(he)&&!("touches"in ne)){const Fe=Ko(he),Tt=zs(he),zt=/auto|scroll/,Vn=Fe||zt.test(Tt.overflowX),Un=Fe||zt.test(Tt.overflowY),xs=Vn&&he.clientWidth>0&&he.scrollWidth>he.clientWidth,on=Un&&he.clientHeight>0&&he.scrollHeight>he.clientHeight,ar=Tt.direction==="rtl",zr=on&&(ar?ne.offsetX<=he.offsetWidth-he.clientWidth:ne.offsetX>he.clientWidth),bs=xs&&ne.offsetY>he.clientHeight;if(zr||bs)return}if(!xe(ne)){if(ge()==="intentional"){if(ne.detail!==0&&!iC(ne)&&!I.current)return;if(k.current){X.clear(),k.current=!1;return}}typeof E=="function"&&!E(ne)||B("__outsidePressBubbles")||(d.setOpen(!1,gt(eC,ne)),j())}}}function ke(ne){ge()!=="sloppy"||ne.pointerType==="touch"||!d.select("open")||!n||L(ne)||Se(ne)}function _e(ne){if(ge()!=="sloppy"||!d.select("open")||!n||L(ne))return;const he=ne.touches[0];he&&(H.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function we(ne,he){const se=Zr(ne);if(!se)return;const Te=xt(se,ne.type,()=>{he(ne),Te()})}function Re(ne){P.current="touch",we(ne,_e)}function Ae(ne){z.clear(),ne.type==="pointerdown"&&(ne.button===0&&(I.current=!0),P.current=ne.pointerType),!(ne.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&we(ne,he=>{he.type==="pointerdown"?ke(he):Se(he)})}function Le(ne){if(ne.type==="pointercancel"&&(I.current=!1),!M.current)return;const he=D.current;if(ye(),ge()==="intentional"){if(ne.type==="pointercancel"){he&&ce();return}if(!xe(ne)){if(he){ce();return}typeof E=="function"&&!E(ne)||(X.clear(),k.current=!0,j())}}}function Ie(ne){if(ge()!=="sloppy"||!H.current||L(ne))return;const he=ne.touches[0];if(!he)return;const se=Math.abs(he.clientX-H.current.startX),Te=Math.abs(he.clientY-H.current.startY),Ve=Math.sqrt(se*se+Te*Te);Ve>5&&(H.current.dismissOnTouchEnd=!0),Ve>10&&(Se(ne),z.clear(),H.current=null)}function Ue(ne){we(ne,Ie)}function We(ne){ge()!=="sloppy"||!H.current||L(ne)||(H.current.dismissOnTouchEnd&&Se(ne),z.clear(),H.current=null)}function Oe(ne){we(ne,We)}const De=no(r&&no(xt(te,"keydown",q),xt(te,"compositionstart",J),xt(te,"compositionend",K)),C&&no(xt(te,"click",Ae,!0),xt(te,"pointerdown",Ae,!0),xt(te,"pointerup",Le,!0),xt(te,"pointercancel",Le,!0),xt(te,"mousedown",Ae,!0),xt(te,"mouseup",Le,!0),xt(te,"touchstart",Re,{capture:!0,passive:!0}),xt(te,"touchmove",Ue,{capture:!0,passive:!0}),xt(te,"touchend",Oe,{capture:!0,passive:!0})));return()=>{De(),F.clear(),X.clear(),ye(),k.current=!1,j()}},[g,m,r,C,E,h,n,N,R,q,j,T,B,L,b,d,z]);const re=O.useMemo(()=>({onKeyDown:q,onPointerDown:$,onClick:$}),[q,$]),de=O.useMemo(()=>({onKeyDown:q,onPointerDown:Z,onMouseDown:Z,onClickCapture:G,onMouseDownCapture(F){G(),W(F)},onPointerDownCapture(F){G(),W(F)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[q,G,W,Z]);return O.useMemo(()=>n?{reference:re,floating:de,trigger:re}:{},[n,re,de])}function IM(e,t,n){let{reference:r,floating:s}=e;const i=ei(t),l=uC(t),c=cC(l),u=ti(t),d=i==="y",h=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let y;switch(u){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}const b=sl(t);return b&&(y[l]+=g*(b==="end"?1:-1)*(n&&d?-1:1)),y}async function WK(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:y=0}=Ta(t,e),b=VL(y),E=c[g?m==="floating"?"reference":"floating":m],C=X0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),T=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(N))&&await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1},M=X0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:N,strategy:u}):T);return{top:(C.top-M.top+b.top)/R.y,bottom:(M.bottom-C.bottom+b.bottom)/R.y,left:(C.left-M.left+b.left)/R.x,right:(M.right-C.right+b.right)/R.x}}const XK=50,QK=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:WK},u=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:m}=IM(d,r,u),g=r,y=0;const b={};for(let w=0;w<i.length;w++){const E=i[w];if(!E)continue;const{name:C,fn:T}=E,{x:N,y:R,data:M,reset:D}=await T({x:h,y:m,initialPlacement:r,placement:g,strategy:s,middlewareData:b,rects:d,platform:c,elements:{reference:e,floating:t}});h=N??h,m=R??m,b[C]={...b[C],...M},D&&y<XK&&(y++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(d=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:h,y:m}=IM(d,g,u)),w=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:b}},ZK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...E}=Ta(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=ti(s),T=ei(c),N=ti(c)===c,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),M=g||(N||!w?[W0(c)]:SK(c)),D=b!=="none";!g&&D&&M.push(...NK(c,w,b,R));const k=[c,...M],I=await u.detectOverflow(t,E),_=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&_.push(I[C]),m){const j=vK(s,l,R);_.push(I[j[0]],I[j[1]])}if(P=[...P,{placement:s,overflows:_}],!_.every(j=>j<=0)){var H,z;const j=(((H=i.flip)==null?void 0:H.index)||0)+1,B=k[j];if(B&&(!(m==="alignment"?T!==ei(B):!1)||P.every(q=>ei(q.placement)===T?q.overflows[0]>0:!0)))return{data:{index:j,overflows:P},reset:{placement:B}};let L=(z=P.filter($=>$.overflows[0]<=0).sort(($,q)=>$.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!L)switch(y){case"bestFit":{var U;const $=(U=P.filter(q=>{if(D){const G=ei(q.placement);return G===T||G==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(G=>G>0).reduce((G,W)=>G+W,0)]).sort((q,G)=>q[1]-G[1])[0])==null?void 0:U[0];$&&(L=$);break}case"initialPlacement":L=c;break}if(s!==L)return{reset:{placement:L}}}return{}}}},fP=new Set(["left","top"]);async function JK(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ti(n),c=sl(n),u=ei(n)==="y",d=fP.has(l)?-1:1,h=i&&u?-1:1,m=Ta(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),u?{x:y*h,y:g*d}:{x:g*d,y:y*h}}const eY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:l,middlewareData:c}=t,u=await JK(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:l}}}}},tY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:u={fn:T=>{let{x:N,y:R}=T;return{x:N,y:R}}},...d}=Ta(e,t),h={x:n,y:r},m=await i.detectOverflow(t,d),g=ei(s),y=aC(g);let b=h[y],w=h[g];const E=(T,N)=>$L(N+m[T==="y"?"top":"left"],N,N-m[T==="y"?"bottom":"right"]);l&&(b=E(y,b)),c&&(w=E(g,w));const C=u.fn({...t,[y]:b,[g]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[g]:c}}}}}},nY=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:l,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=Ta(e,t),g={x:s,y:i},y=ei(l),b=aC(y);let w=g[b],E=g[y];const C=Ta(d,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(h){const M=b==="y"?"height":"width",D=c.reference[b]-c.floating[M]+T.mainAxis,k=c.reference[b]+c.reference[M]-T.mainAxis;w<D?w=D:w>k&&(w=k)}if(m){var N,R;const M=b==="y"?"width":"height",D=fP.has(ti(l)),k=c.reference[y]-c.floating[M]+(D&&((N=u.offset)==null?void 0:N[y])||0)+(D?0:T.crossAxis),I=c.reference[y]+c.reference[M]+(D?0:((R=u.offset)==null?void 0:R[y])||0)-(D?T.crossAxis:0);E<k?E=k:E>I&&(E=I)}return{[b]:w,[y]:E}}}},rY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Ta(e,t),u=await s.detectOverflow(t,c),d=ti(n),h=sl(n),m=ei(n)==="y",{width:g,height:y}=r.floating;let b,w;d==="top"||d==="bottom"?(b=d,w=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,b=h==="end"?"top":"bottom");const E=y-u.top-u.bottom,C=g-u.left-u.right,T=qf(y-u[b],E),N=qf(g-u[w],C),R=t.middlewareData.shift,M=!R;let D=T,k=N;R!=null&&R.enabled.x&&(k=C),R!=null&&R.enabled.y&&(D=E),M&&!h&&(m?k=g-2*Wo(u.left,u.right):D=y-2*Wo(u.top,u.bottom)),await l({...t,availableWidth:k,availableHeight:D});const I=await s.getDimensions(i.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function dP(e){const t=zs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Zt(e),i=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=Y0(n)!==i||Y0(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function bC(e){return bt(e)?e:e.contextElement}function Sf(e){const t=bC(e);if(!Zt(t))return Xo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=dP(t);let l=(i?Y0(n.width):n.width)/r,c=(i?Y0(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const sY=Xo(0);function hP(e){const t=vn(e);return!FE()||!t.visualViewport?sY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iY(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vn(e)}function Hc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=bC(e);let l=Xo(1);t&&(r?bt(r)&&(l=Sf(r)):l=Sf(e));const c=iY(i,n,r)?hP(i):Xo(0);let u=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,h=s.width/l.x,m=s.height/l.y;if(i&&r){const g=vn(i),y=bt(r)?vn(r):r;let b=g,w=K1(b);for(;w&&y!==b;){const E=Sf(w),C=w.getBoundingClientRect(),T=zs(w),N=C.left+(w.clientLeft+parseFloat(T.paddingLeft))*E.x,R=C.top+(w.clientTop+parseFloat(T.paddingTop))*E.y;u*=E.x,d*=E.y,h*=E.x,m*=E.y,u+=N,d+=R,b=vn(w),w=K1(b)}}return X0({width:h,height:m,x:u,y:d})}function ex(e,t){const n=Fy(e).scrollLeft;return t?t.left+n:Hc(ol(e)).left+n}function pP(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ex(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function oY(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",l=ol(r),c=t?Hy(t.floating):!1;if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Xo(1);const h=Xo(0),m=Zt(r);if((m||!i)&&((Nr(r)!=="body"||Lp(l))&&(u=Fy(r)),m)){const y=Hc(r);d=Sf(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=l&&!m&&!i?pP(l,u):Xo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function lY(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function aY(e){const t=Fy(e),n=e.ownerDocument.body,r=Wo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Wo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+ex(e);const l=-t.scrollTop;return zs(n).direction==="rtl"&&(i+=Wo(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:l}}const cY=25;function uY(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=vn(e),i=ol(e),l=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,d=0,h=0;if(l){const g=!FE()||t==="fixed";r?g||(d=-l.offsetLeft,h=-l.offsetTop):(c=l.width,u=l.height,g&&(d=l.offsetLeft,h=l.offsetTop))}if(ex(i)<=0){const g=i.ownerDocument,y=g.body,b=getComputedStyle(y),w=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-y.clientWidth-w),C=getComputedStyle(i).scrollbarGutter==="stable both-edges"?E/2:E;C<=cY&&(c-=C)}return{width:c,height:u,x:d,y:h}}function fY(e,t){const n=Hc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Sf(e),l=e.clientWidth*i.x,c=e.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:l,height:c,x:u,y:d}}function jM(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=uY(e,n,t);else if(t==="document")r=aY(ol(e));else if(bt(t))r=fY(t,n);else{const s=hP(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return X0(r)}function dY(e,t){const n=t.get(e);if(n)return n;let r=Qh(e,[],!1).filter(c=>bt(c)&&Nr(c)!=="body"),s=null;const i=zs(e).position==="fixed";let l=i?nl(e):e;for(;bt(l)&&!Ko(l);){const c=zs(l),u=HE(l),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(m=>m!==l):s=c,l=nl(l)}return t.set(e,r),r}function hY(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Hy(t)?[]:dY(t,this._c):[].concat(n),r],c=jM(t,l[0],s);let u=c.top,d=c.right,h=c.bottom,m=c.left;for(let g=1;g<l.length;g++){const y=jM(t,l[g],s);u=Wo(y.top,u),d=qf(y.right,d),h=qf(y.bottom,h),m=Wo(y.left,m)}return{width:d-m,height:h-u,x:m,y:u}}function pY(e){const{width:t,height:n}=dP(e);return{width:t,height:n}}function mY(e,t,n){const r=Zt(t),s=ol(t),i=n==="fixed",l=Hc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Xo(0);if((r||!i)&&((Nr(t)!=="body"||Lp(s))&&(c=Fy(t)),r)){const g=Hc(t,!0,i,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}!r&&s&&(u.x=ex(s));const d=s&&!r&&!i?pP(s,c):Xo(0),h=l.left+c.scrollLeft-u.x-d.x,m=l.top+c.scrollTop-u.y-d.y;return{x:h,y:m,width:l.width,height:l.height}}function zS(e){return zs(e).position==="static"}function LM(e,t){if(!Zt(e)||zs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ol(e)===n&&(n=n.ownerDocument.body),n}function mP(e,t){const n=vn(e);if(Hy(e))return n;if(!Zt(e)){let s=nl(e);for(;s&&!Ko(s);){if(bt(s)&&!zS(s))return s;s=nl(s)}return n}let r=LM(e,t);for(;r&&VU(r)&&zS(r);)r=LM(r,t);return r&&Ko(r)&&zS(r)&&!HE(r)?n:r||GU(e)||n}const gY=async function(e){const t=this.getOffsetParent||mP,n=this.getDimensions,r=await n(e.floating);return{reference:mY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yY(e){return zs(e).direction==="rtl"}const xY={convertOffsetParentRelativeRectToViewportRelativeRect:oY,getDocumentElement:ol,getClippingRect:hY,getOffsetParent:mP,getElementRects:gY,getClientRects:lY,getDimensions:pY,getScale:Sf,isElement:bt,isRTL:yY};function gP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bY(e,t,n){let r=null,s;const i=ol(e);function l(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),l();const g=e.getBoundingClientRect(),{left:y,top:b,width:w,height:E}=g;if(h||t(),!w||!E)return;const C=Fg(b),T=Fg(i.clientWidth-(y+w)),N=Fg(i.clientHeight-(b+E)),R=Fg(y),D={rootMargin:-C+"px "+-T+"px "+-N+"px "+-R+"px",threshold:Wo(0,qf(1,m))||1};let k=!0;function I(_){const P=_[0].intersectionRatio;if(!gP(g,e.getBoundingClientRect()))return c();if(P!==m){if(!k)return c();P?c(!1,P):s=setTimeout(()=>{c(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(I,{...D,root:i.ownerDocument})}catch{r=new IntersectionObserver(I,D)}r.observe(e)}const u=vn(e),d=()=>c(n);return u.addEventListener("resize",d),c(!0),()=>{u.removeEventListener("resize",d),l()}}function PM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=bC(e),h=s||i?[...d?Qh(d):[],...t?Qh(t):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),i&&C.addEventListener("resize",n)});const m=d&&c?bY(d,n,i):null;let g=-1,y=null;l&&(y=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),d&&!u&&y.observe(d),t&&y.observe(t));let b,w=u?Hc(e):null;u&&E();function E(){const C=Hc(e);w&&!gP(w,C)&&n(),w=C,b=requestAnimationFrame(E)}return n(),()=>{var C;h.forEach(T=>{s&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),m==null||m(),(C=y)==null||C.disconnect(),y=null,u&&cancelAnimationFrame(b)}}const vY=eY,SY=tY,wY=ZK,EY=rY,CY=nY,NY=(e,t,n)=>{const r=new Map,s=n??{},i={...xY,...s.platform,_c:r};return QK(e,t,{...s,platform:i})};var TY=typeof document<"u",RY=function(){},T0=TY?O.useLayoutEffect:RY;function Q0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Q0(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zM(e,t){const n=yP(e);return Math.round(t*n)/n}function BS(e){const t=O.useRef(e);return T0(()=>{t.current=e}),t}function OY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=O.useState(r);Q0(g,r)||y(r);const[b,w]=O.useState(null),[E,C]=O.useState(null),T=O.useCallback(q=>{q!==D.current&&(D.current=q,w(q))},[]),N=O.useCallback(q=>{q!==k.current&&(k.current=q,C(q))},[]),R=i||b,M=l||E,D=O.useRef(null),k=O.useRef(null),I=O.useRef(h),_=u!=null,P=BS(u),H=BS(s),z=BS(d),U=O.useCallback(()=>{if(!D.current||!k.current)return;const q={placement:t,strategy:n,middleware:g};H.current&&(q.platform=H.current),NY(D.current,k.current,q).then(G=>{const W={...G,isPositioned:z.current!==!1};j.current&&!Q0(I.current,W)&&(I.current=W,Bs.flushSync(()=>{m(W)}))})},[g,t,n,H,z]);T0(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(q=>({...q,isPositioned:!1})))},[d]);const j=O.useRef(!1);T0(()=>(j.current=!0,()=>{j.current=!1}),[]),T0(()=>{if(R&&(D.current=R),M&&(k.current=M),R&&M){if(P.current)return P.current(R,M,U);U()}},[R,M,U,P,_]);const B=O.useMemo(()=>({reference:D,floating:k,setReference:T,setFloating:N}),[T,N]),L=O.useMemo(()=>({reference:R,floating:M}),[R,M]),$=O.useMemo(()=>{const q={position:n,left:0,top:0};if(!L.floating)return q;const G=zM(L.floating,h.x),W=zM(L.floating,h.y);return c?{...q,transform:"translate("+G+"px, "+W+"px)",...yP(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:W}},[n,c,L.floating,h.x,h.y]);return O.useMemo(()=>({...h,update:U,refs:B,elements:L,floatingStyles:$}),[h,U,B,L,$])}const kY=(e,t)=>{const n=vY(e);return{name:n.name,fn:n.fn,options:[e,t]}},MY=(e,t)=>{const n=SY(e);return{name:n.name,fn:n.fn,options:[e,t]}},AY=(e,t)=>({fn:CY(e).fn,options:[e,t]}),_Y=(e,t)=>{const n=wY(e);return{name:n.name,fn:n.fn,options:[e,t]}},DY=(e,t)=>{const n=EY(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Z0(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function IY(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function xP(e){const t=[];let n,r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(const c of Array.from(e).sort((u,d)=>u.top-d.top)){if(r=Math.min(r,c.left),s=Math.min(s,c.top),i=Math.max(i,c.right),l=Math.max(l,c.bottom),!n||c.top-n.top>n.height/2)t.push(IY(c));else{const u=t[t.length-1];u.left=Math.min(u.left,c.left),u.right=Math.max(u.right,c.right),u.bottom=Math.max(u.bottom,c.bottom),u.width=u.right-u.left,u.height=u.bottom-u.top}n=c}return{lines:t,fallback:Z0(r,s,i,l)}}function bP(e,t,n){return e.findIndex(r=>t>r.left-2&&t<r.right+2&&n>r.top-2&&n<r.bottom+2)}function BM(e){return Z0(e.left,e.top,e.right,e.bottom)}function jY(e,t,n){const{lines:r}=xP(e.getClientRects());if(r.length<2)return;const s=bP(r,t,n);return{x:t,y:n,lineIndex:s===-1?void 0:s,element:e}}function LY(e,t,n){const{lines:r,fallback:s}=xP(e.getClientRects());if(r.length<2)return null;const i=n==null?void 0:n.x,l=n==null?void 0:n.y,c=t[0];if((n==null?void 0:n.lineIndex)!=null&&r[n.lineIndex])return BM(r[n.lineIndex]);if(i!=null&&l!=null){const b=bP(r,i,l);if(b!==-1)return BM(r[b])}if(r.length===2&&r[0].left>r[1].right&&i!=null&&l!=null)return s;if(c==="t"||c==="b"){const b=r[0],w=r[r.length-1],E=c==="t"?b:w;return Z0(E.left,b.top,E.right,w.bottom)}const u=c==="l";let d=r[0].left,h=r[0].right,m=u?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,g=r[0],y=r[0];for(const b of r){d=Math.min(d,b.left),h=Math.max(h,b.right);const w=u?b.left:b.right;u&&w<m||!u&&w>m?(m=w,g=b,y=b):w===m&&(y=b)}return Z0(d,g.top,h,y.bottom)}function PY(e){return"contextElement"in e&&e.contextElement?e.contextElement:bt(e)?e:void 0}function zY(e,t){function n(s){vP(e,s.currentTarget,s.clientX,s.clientY)}function r(s){t||n(s)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function vP(e,t,n,r){const s=jY(t,n,r);return e.current=s,s}function BY(e){return{name:"inline",async fn(t){const n=t.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!="function")return{};const r=PY(n),s=e.current,i=(s==null?void 0:s.element)===n||(s==null?void 0:s.element)===r?s:void 0,l=LY(n,t.placement,i);if(!l||typeof t.platform.getElementRects!="function")return{};const c=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return l}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===c.reference.x&&t.rects.reference.y===c.reference.y&&t.rects.reference.width===c.reference.width&&t.rects.reference.height===c.reference.height?{}:{reset:{rects:c}}}}}var vC=zj();const cw=[];let uw;function HY(){return uw}function FY(e){cw.push(e)}function ud(e){const t=(n,r)=>{const s=Tr($Y).current;let i;try{uw=s;for(const l of cw)l.before(s);i=e(n,r);for(const l of cw)l.after(s);s.didInitialize=!0}finally{uw=void 0}return i};return t.displayName=e.displayName||e.name,t}function tx(e){return O.forwardRef(ud(e))}function $Y(){return{didInitialize:!1}}const VY=GE(19),UY=VY?GY:KY;function SP(e,t,n,r,s){return UY(e,t,n,r,s)}function qY(e,t,n,r,s){const i=O.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return vC.useSyncExternalStore(e.subscribe,i,i)}FY({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),vC.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function GY(e,t,n,r,s){const i=HY();if(!i)return qY(e,t,n,r,s);const l=i.syncIndex;i.syncIndex+=1;let c;return i.didInitialize?(c=i.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,s))&&(c.store!==e&&(i.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=s,c.value=t(e.getSnapshot(),n,r,s))):(c={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},i.syncHooks.push(c)),c.value}function KY(e,t,n,r,s){return zE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,r,s))}class YY{constructor(t){_t(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));_t(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return SP(this,t,n,r,s)}}class fd extends YY{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){O.useDebugValue(t);const r=this;ze(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ze(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ze(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){O.useDebugValue(t);const r=this,s=n!==void 0;ze(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const i=this.selectors[t];return i(this.state,n,r,s)}useState(t,n,r,s){return O.useDebugValue(t),SP(this,this.selectors[t],n,r,s)}useContextCallback(t,n){O.useDebugValue(t);const r=Qe(n??Bn);this.context[t]=r}useStateSetter(t){const n=O.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(i=>{const l=r(i);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}const WY={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class wP extends fd{constructor(n){const{syncOnly:r,nested:s,onOpenChange:i,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:lP(),nested:s,triggerElements:l},WY);_t(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&oK(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});_t(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});_t(this,"setOpen",(n,r)=>{var s,i,l,c;if(this.syncOnly){(i=(s=this.context).onOpenChange)==null||i.call(s,n,r);return}this.dispatchOpenChange(n,r),(c=(l=this.context).onOpenChange)==null||c.call(l,n,r)});this.syncOnly=r}}function EP(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:i,onOpenChange:l}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),d=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,m=l,g=O.useRef(null);r===void 0&&g.current===null&&(g.current=new wP({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:d,triggerElements:h,onOpenChange:m,floatingId:s,syncOnly:!0,nested:i}));const y=r??g.current;return t.useSyncedValue("floatingId",s),ze(()=>{const b={open:c,floatingId:s,referenceElement:u,floatingElement:d};bt(u)&&(b.domReferenceElement=u),y.state.positionReference===y.state.referenceElement&&(b.positionReference=u),y.update(b)},[c,s,u,d,y]),y.context.onOpenChange=m,y.context.nested=i,y}function CP(e,t=!1,n=!1,r=!1){const[s,i]=O.useState(e&&t?"idle":void 0),[l,c]=O.useState(e&&!r);return e&&!l&&(c(!0),i("starting")),!e&&l&&s!=="ending"&&!n&&i("ending"),!e&&!l&&s==="ending"&&i(void 0),ze(()=>{if(!e&&l&&s!=="ending"&&n){const u=Qi.request(()=>{i("ending")});return()=>{Qi.cancel(u)}}},[e,l,s,n]),ze(()=>{if(!e||t)return;const u=Qi.request(()=>{i(void 0)});return()=>{Qi.cancel(u)}},[t,e]),ze(()=>{if(!e||!t)return;e&&l&&s!=="idle"&&i("starting");const u=Qi.request(()=>{i("idle")});return()=>{Qi.cancel(u)}},[t,e,l,s]),{mounted:l,setMounted:c,transitionStatus:s}}let Vg=null;function XY(e){if(!Vg){const t=[];Vg=t,queueMicrotask(()=>{Vg=null,Bs.flushSync(()=>{for(const n of t)n()})})}Vg.push(e)}function nx(e,t=!1,n=!1){const r=ip();return Qe((s,i=null)=>{r.cancel();const l=Io(e);if(l==null)return;const c=l,u=()=>{if(!n){Bs.flushSync(s);return}XY(()=>{i!=null&&i.aborted||s()})};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{i!=null&&i.aborted||u()},()=>{if(i!=null&&i.aborted)return;if(c.getAnimations().some(m=>m.pending||m.playState!=="finished")){d();return}u()})}if(t){const h=jL;if(!c.hasAttribute(h)){r.request(d);return}const m=new MutationObserver(()=>{c.hasAttribute(h)||(m.disconnect(),d())});m.observe(c,{attributes:!0,attributeFilter:[h]}),i==null||i.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(d)})}function ou(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:i}=e,l=Qe(i),c=nx(r,n,s);O.useEffect(()=>{if(!t)return;const u=new AbortController;return c(l,u.signal),()=>{u.abort()}},[t,n,l,c])}const Vp={tabIndex:-1,[nw]:""};function NP(e){return t=>t==="touch"?e.current:!0}function rx(e,t=!1){const n=Uf(),r=iu()!=null,s=Tr(()=>e(n,r)).current;return EP({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Up({handle:e,store:t}){return ze(()=>e.attachStore(t),[e,t]),null}function HM(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function QY(e,t){const n=O.useRef(null);return Qe(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const i=s.store;i.context.triggerElements.getById(s.id)===s.element&&(i.context.triggerElements.delete(s.id),HM(i))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),HM(t))})}function sx(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const i=(n==null?void 0:n.id)??null;let l=e.activeTriggerId,c=e.activeTriggerElement;return(i||t)&&(l=i,c=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:l,activeTriggerElement:c}}function SC(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function TP(e,t,n,r={}){var h,m,g;const s=n.reason,i=s===xn,l=t&&s===bf,c=!t&&(s===rl||s===Bp),u=SC(n);if((m=(h=e.context).onOpenChange)==null||m.call(h,t,n),n.isCanceled)return;(g=r.onBeforeDispatch)==null||g.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const d=()=>{const y=sx(e.state,t,n.trigger,u()),b={...r.extraState,...y};l?b.instantType="focus":c?b.instantType="dismiss":i&&(b.instantType=void 0),e.update(b)};i?Bs.flushSync(d):d()}function ix(e,t,n,r){const s=n.useState("isMountedByTrigger",e),i=QY(e,n),l=Qe(u=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){const m={activeTriggerElement:u,...d?r:null};n.update(m);return}if(h==null&&d){const m={activeTriggerId:e??null,activeTriggerElement:u,...r};n.update(m)}}),c=Qe(u=>{i(u),u&&l(u)});return ze(()=>(c(t.current),()=>c(null)),[c,t,n,e]),ze(()=>{if(s){const u={activeTriggerElement:t.current,...r};n.update(u)}},[s,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:s}}function qp(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),s=e.useState("open"),i=e.useState("triggerCount"),l=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");ze(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,d={};e.state.triggerCount!==u&&(d.triggerCount=u);const h=e.select("activeTriggerId");let m=null;if(h){const g=e.context.triggerElements.getById(h);if(g)r.current=h,g!==e.state.activeTriggerElement&&(d.activeTriggerElement=g);else{for(const[y,b]of e.context.triggerElements.entries())if(b===e.state.activeTriggerElement){d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y;break}d.activeTriggerId===void 0&&(r.current===h?m=h:r.current=null)}}else r.current=null;if(!m&&!h&&u===1){const g=e.context.triggerElements.entries().next();if(!g.done){const[y,b]=g.value;d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&e.update(d),m&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){const g=gt(qy);e.setOpen(!1,g),g.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,i,l,c,n])}function Gp(e,t,n,r){const{mounted:s,setMounted:i,transitionStatus:l}=CP(e,!1,!1,r),c=t.useState("preventUnmountingOnClose"),u=e?!1:c;t.useSyncedValues({mounted:s,transitionStatus:l,preventUnmountingOnClose:u});const d=Qe(()=>{var h,m;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(m=(h=t.context).onOpenChangeComplete)==null||m.call(h,!1)});return ou({enabled:s&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:l}}function Kp(e,t){e.useSyncedValues(t),ze(()=>()=>{e.update({activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn})},[e])}function RP(e,t){ze(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ze(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yp{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Wp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wP({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn}}const Ph=e=>e.triggerIdProp??e.activeTriggerId,wC=e=>e.openProp??e.open,FM=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function OP(e,t){return t!==void 0&&wC(e)&&Ph(e)===t}function ZY(e,t){return OP(e,t)?!0:t!==void 0&&wC(e)&&Ph(e)==null&&e.triggerCount===1}const Xp={open:wC,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ph,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:FM,isTriggerActive:(e,t)=>t!==void 0&&Ph(e)===t,isOpenedByTrigger:(e,t)=>OP(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ph(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ZY(e,t)?FM(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ox(e){const t=O.useCallback(r=>e===void 0?Bn:e.subscribeStore(r),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return vC.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function JY(e){return eW(e,e.rootContext)}function eW(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),i=t.useState("floatingElement"),l=t.useState("domReferenceElement"),c=t.useState("open"),u=t.useState("floatingId"),[d,h]=O.useState(null),[m,g]=O.useState(void 0),[y,b]=O.useState(void 0),w=O.useRef(null),E=_a(r),C=O.useMemo(()=>({reference:s,floating:i,domReference:l}),[s,i,l]),T=OY({...e,elements:{...C,...d&&{reference:d}}}),N=bt(m)?m:null,R=y===void 0?t.state.floatingElement:y;t.useSyncedValue("referenceElement",m??null),t.useSyncedValue("domReferenceElement",m===void 0?l:N),t.useSyncedValue("floatingElement",R);const M=O.useCallback(H=>{const z=bt(H)?{getBoundingClientRect:()=>H.getBoundingClientRect(),getClientRects:()=>H.getClientRects(),contextElement:H}:H;h(z),T.refs.setReference(z)},[T.refs]),D=O.useCallback(H=>{(bt(H)||H===null)&&(w.current=H,g(H)),(bt(T.refs.reference.current)||T.refs.reference.current===null||H!==null&&!bt(H))&&T.refs.setReference(H)},[T.refs,g]),k=O.useCallback(H=>{b(H),T.refs.setFloating(H)},[T.refs]),I=O.useMemo(()=>({...T.refs,setReference:D,setFloating:k,setPositionReference:M,domReference:w}),[T.refs,D,k,M]),_=O.useMemo(()=>({...T.elements,domReference:l}),[T.elements,l]),P=O.useMemo(()=>({...T,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:u,refs:I,elements:_,nodeId:n,rootStore:t}),[T,I,_,n,t,c,u]);return ze(()=>{l&&(w.current=l)},[l]),ze(()=>{t.context.dataRef.current.floatingContext=P;const H=E==null?void 0:E.nodesRef.current.find(z=>z.id===n);H&&(H.context=P)}),O.useMemo(()=>({...T,context:P,refs:I,elements:_,rootStore:t}),[T,I,_,P,t])}const HS=rC&&Aa;function EC(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:i,dataRef:l}=s.context,c=O.useRef(!1),u=O.useRef(null),d=O.useRef(!0),h=Jr();O.useEffect(()=>{const g=s.select("domReferenceElement");if(!n)return;const y=vn(g);function b(){const C=s.select("domReferenceElement");!s.select("open")&&Zt(C)&&C===Xr(Dt(C))&&(c.current=!0,u.current=C)}function w(){d.current=!0}function E(){d.current=!1}return no(xt(y,"blur",b),HS&&xt(y,"keydown",w,!0),HS&&xt(y,"pointerdown",E,!0))},[s,n]),O.useEffect(()=>{if(!n)return;function g(y){if(y.reason===rl||y.reason===Bp){const b=s.select("domReferenceElement");bt(b)&&(u.current=b,c.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,n,s]);const m=O.useMemo(()=>{function g(){c.current=!1,u.current=null}return{onMouseLeave(){g()},onFocus(y){const b=y.currentTarget;if(c.current){if(u.current===b)return;g()}const w=Zr(y.nativeEvent);if(bt(w)){if(HS&&!y.relatedTarget){if(!d.current&&!Xy(w))return}else if(!cK(w))return}const E=K0(y.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:T}=y,N=typeof r=="function"?r():r;if(s.select("open")&&E||N===0||N===void 0){s.setOpen(!0,gt(bf,C,T));return}h.start(N,()=>{c.current||s.setOpen(!0,gt(bf,C,T))})},onBlur(y){g();const b=y.relatedTarget,w=y.nativeEvent,E=bt(b)&&b.hasAttribute(op("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{var R;const C=s.select("domReferenceElement"),T=Xr(Dt(C));!b&&T===C||Je((R=l.current.floatingContext)==null?void 0:R.refs.floating.current,T)||Je(C,T)||E||K0(b??T,s.context.triggerElements)||s.setOpen(!1,gt(bf,w))})}}},[l,r,s,h]);return O.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class CC{constructor(){_t(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});_t(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 si,this.restTimeout=new si,this.handleCloseOptions=void 0}static create(){return new CC}}const J0=new WeakMap;function ey(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&J0.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),J0.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kP(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,i=J0.get(n);i&&i!==e&&ey(i),ey(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,J0.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function NC(e){const t=e.context.dataRef.current,n=Tr(()=>t.hoverInteractionState??CC.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),nC(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function lx(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,i="rootStore"in e?e.rootStore:e,l=i.useState("open"),c=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,h=_a(),m=iu(),g=NC(i),y=Jr(),b=Qe(()=>{var C;return FL((C=d.current.openEvent)==null?void 0:C.type,g.interactedInside)}),w=Qe(()=>{var C;return fK((C=d.current.openEvent)==null?void 0:C.type)}),E=Qe(()=>{ey(g)});ze(()=>{l||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,E())},[l,g,E]),O.useEffect(()=>E,[E]),ze(()=>{var C,T,N,R,M;if(n&&l&&(C=g.handleCloseOptions)!=null&&C.blockPointerEvents&&w()&&bt(u)&&c){const D=u,k=c,I=Dt(c),_=(N=(T=h==null?void 0:h.nodesRef.current.find(U=>U.id===m))==null?void 0:T.context)==null?void 0:N.elements.floating;_&&(_.style.pointerEvents="");const P=g.pointerEventsScopeElement!==k?g.pointerEventsScopeElement:null,H=_!==k?_:null,z=((M=(R=g.handleCloseOptions)==null?void 0:R.getScope)==null?void 0:M.call(R))??P??H??D.closest("[data-rootownerid]")??I.body;return kP(g,{scopeElement:z,referenceElement:D,floatingElement:k}),()=>{E()}}},[n,l,u,c,g,w,h,m,E]),O.useEffect(()=>{if(!n)return;function C(){return!!(h&&m&&Ra(h.nodesRef.current,m).length>0)}function T(I){const _=sp(r,"close",g.pointerType),P=()=>{i.setOpen(!1,gt(xn,I)),h==null||h.events.emit("floating.closed",I)};_?g.openChangeTimeout.start(_,P):(g.openChangeTimeout.clear(),P())}function N(I){const _=Zr(I);if(!aK(_)){g.interactedInside=!1;return}g.interactedInside=(_==null?void 0:_.closest("[aria-haspopup]"))!=null}function R(){g.openChangeTimeout.clear(),y.clear(),h==null||h.events.off("floating.closed",D),E()}function M(I){var z;if(C()&&h){h.events.on("floating.closed",D);return}if(K0(I.relatedTarget,i.context.triggerElements))return;const _=((z=d.current.floatingContext)==null?void 0:z.nodeId)??s,P=I.relatedTarget;if(!(h&&_&&bt(P)&&Ra(h.nodesRef.current,_,!1).some(U=>{var j;return Je((j=U.context)==null?void 0:j.elements.floating,P)}))){if(g.handler){g.handler(I);return}E(),w()&&!b()&&T(I)}}function D(I){!h||!m||C()||y.start(0,()=>{h.events.off("floating.closed",D),i.setOpen(!1,gt(xn,I)),h.events.emit("floating.closed",I)})}const k=c;return no(k&&xt(k,"mouseenter",R),k&&xt(k,"mouseleave",M),k&&xt(k,"pointerdown",N,!0),()=>{h==null||h.events.off("floating.closed",D)})},[n,c,i,d,r,s,w,b,E,g,h,m,y])}const tW={current:null};function ax(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:i=!1,restMs:l=0,move:c=!0,triggerElementRef:u=tW,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g,shouldOpen:y,guardStaleOpen:b=!1}=t,w="rootStore"in e?e.rootStore:e,{dataRef:E,events:C}=w.context,T=_a(d),N=NC(w),R=O.useRef(!1),M=Hn(s),D=Hn(r),k=Hn(l),I=Hn(n),_=Hn(y),P=Hn(g),H=Qe(()=>{var L;return FL((L=E.current.openEvent)==null?void 0:L.type,N.interactedInside)}),z=Qe(()=>{var L;return((L=_.current)==null?void 0:L.call(_))!==!1}),U=Qe((L,$,q)=>{const G=w.context.triggerElements;if(G.hasElement($))return!L||!Je(L,$);if(!bt(q))return!1;const W=q;return G.hasMatchingElement(Z=>Je(Z,W))&&(!L||!Je(L,W))}),j=Qe(()=>{if(!N.handler)return;Dt(w.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),B=Qe(()=>{ey(N)});return h&&(N.handleCloseOptions=s==null?void 0:s.__options),O.useEffect(()=>j,[j]),O.useEffect(()=>{if(!n)return;function L($){$.open?R.current=!1:(R.current=$.reason===xn,j(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return C.on("openchange",L),()=>{C.off("openchange",L)}},[n,C,N,j]),O.useEffect(()=>{if(!n)return;function L(re,de=!0){const F=sp(D.current,"close",N.pointerType);F?N.openChangeTimeout.start(F,()=>{w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re)}):de&&(N.openChangeTimeout.clear(),w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re))}const $=u.current??(h?w.select("domReferenceElement"):null);if(!bt($))return;function q(re){var we;if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,i&&!ha(N.pointerType))return;const de=yM(k.current),F=sp(D.current,"open",N.pointerType),X=Zr(re),te=re.currentTarget??null,J=w.select("domReferenceElement");let K=te;if(bt(X)&&!w.context.triggerElements.hasElement(X)){for(const Re of w.context.triggerElements.elements())if(Je(Re,X)){K=Re;break}}bt(te)&&bt(J)&&!w.context.triggerElements.hasElement(te)&&Je(te,J)&&(K=J);const ce=K==null?!1:U(J,K,X),ye=w.select("open"),ge=((we=P.current)==null?void 0:we.call(P))??w.select("transitionStatus")==="ending",oe=!ye&&ge&&R.current,xe=!ce&&bt(K)&&bt(J)&&Je(J,K)&&oe,Se=de>0&&!F,ke=ce&&(ye||oe)||xe,_e=!ye||ce;if(ke){z()&&w.setOpen(!0,gt(xn,re,K));return}Se||(F?N.openChangeTimeout.start(F,()=>{_e&&z()&&w.setOpen(!0,gt(xn,re,K))}):_e&&z()&&w.setOpen(!0,gt(xn,re,K)))}function G(re){if(H()){B();return}j();const de=w.select("domReferenceElement"),F=Dt(de);N.restTimeout.clear(),N.restTimeoutPending=!1;const X=E.current.floatingContext??(m==null?void 0:m());if(K0(re.relatedTarget,w.context.triggerElements))return;if(M.current&&X){w.select("open")||N.openChangeTimeout.clear();const J=u.current;N.handler=M.current({...X,tree:T,x:re.clientX,y:re.clientY,onClose(){B(),j(),I.current&&!H()&&J===w.select("domReferenceElement")&&L(re,!0)}}),F.addEventListener("mousemove",N.handler),N.handler(re);return}(N.pointerType==="touch"?!Je(w.select("floatingElement"),re.relatedTarget):!0)&&L(re)}function W(re){Je($,re.relatedTarget)||(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1)}const Z=b?xt($,"mouseout",W):void 0;return c?no(xt($,"mousemove",q,{once:!0}),xt($,"mouseenter",q),xt($,"mouseleave",G),Z):no(xt($,"mouseenter",q),xt($,"mouseleave",G),Z)},[j,B,E,D,w,n,M,N,h,U,H,i,c,k,u,T,I,m,P,z,b]),O.useMemo(()=>{if(!n)return;function L($){N.pointerType=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){var X,te,J;const{nativeEvent:q}=$,G=$.currentTarget,W=w.select("domReferenceElement"),Z=w.select("open"),re=U(W,G,$.target);if(i&&!ha(N.pointerType))return;if(Z&&re&&((X=N.handleCloseOptions)!=null&&X.blockPointerEvents)){const K=w.select("floatingElement");if(K){const ce=((J=(te=N.handleCloseOptions)==null?void 0:te.getScope)==null?void 0:J.call(te))??G.ownerDocument.body;kP(N,{scopeElement:ce,referenceElement:G,floatingElement:K})}}const de=yM(k.current);if(Z&&!re||de===0||!re&&N.restTimeoutPending&&$.movementX**2+$.movementY**2<2)return;N.restTimeout.clear();function F(){if(N.restTimeoutPending=!1,H())return;const K=w.select("open");!N.blockMouseMove&&(!K||re)&&z()&&w.setOpen(!0,gt(xn,q,G))}N.pointerType==="touch"?Bs.flushSync(()=>{F()}):re&&Z?F():(N.restTimeoutPending=!0,N.restTimeout.start(de,F))}}},[n,N,H,U,i,w,k,z])}const nW="Escape";function $M(e){return Aa&&e.movementX===0&&e.movementY===0}function cx(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ug(e,t){return cx(t,e===HL||e===lC,e===Yy||e===Wy)}function FS(e,t,n){return cx(t,e===lC,n?e===Yy:e===Wy)||e==="Enter"||e===" "||e===""}function rW(e,t,n){return cx(t,n?e===Yy:e===Wy,e===lC)}function sW(e,t,n,r){const s=n?e===Wy:e===Yy,i=e===HL;return t==="both"||t==="horizontal"&&r?e===nW:cx(t,s,i)}function iW(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:u=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:E="vertical",parentOrientation:C,id:T,resetOnPointerLeave:N=!0,externalTree:R,grid:M}=t,D=M!=null,k="rootStore"in e?e.rootStore:e,I=k.useState("open"),_=k.useState("floatingElement"),P=k.useState("domReferenceElement"),H=k.context.dataRef,z=iw(_),U=sw(P),j=Hn(z),B=iu(),L=_a(R),$=O.useRef(g),q=O.useRef(l??-1),G=O.useRef(null),W=O.useRef(!0),Z=Qe(Oe=>{s(q.current===-1?null:q.current,Oe)}),re=O.useRef(!!_),de=O.useRef(I),F=O.useRef(!1),X=O.useRef(!1),te=O.useRef(null),J=Hn(w),K=Hn(I),ce=Hn(l),ye=Hn(N),ge=ip(),oe=ip(),xe=Qe(()=>{function Oe(se){m?L==null||L.events.emit("virtualfocus",se):te.current=N0(se,{sync:F.current,preventScroll:!0})}const De=n.current[q.current],ne=X.current;De&&Oe(De),(F.current?se=>se():se=>ge.request(se))(()=>{var Ve;const se=n.current[q.current]||De;if(!se)return;De||Oe(se),Ae&&(ne||!W.current)&&((Ve=se.scrollIntoView)==null||Ve.call(se,{block:"nearest",inline:"nearest"}))})});ze(()=>{H.current.orientation=E},[H,E]),ze(()=>{i&&(I&&_?(q.current=l??-1,$.current&&l!=null&&(X.current=!0,Z())):re.current&&(q.current=-1,Z()))},[i,I,_,l,Z]),ze(()=>{if(i){if(!I){F.current=!1;return}if(_)if(r==null){if(F.current=!1,ce.current!=null)return;if(re.current&&(q.current=-1,xe()),(!de.current||!re.current)&&$.current&&(G.current!=null||$.current===!0&&G.current==null)){let Oe=0;const De=()=>{n.current[0]==null?(Oe<2&&(Oe?he=>oe.request(he):queueMicrotask)(De),Oe+=1):(q.current=G.current==null||FS(G.current,E,h)||d?IS(n):SM(n),G.current=null,Z())};De()}}else vM(n.current,r)||(q.current=r,xe(),X.current=!1)}},[i,I,_,r,ce,d,n,E,h,Z,xe,oe]),ze(()=>{var se,Te;if(!i||_||!L||m||!re.current)return;const Oe=L.nodesRef.current,De=(Te=(se=Oe.find(Ve=>Ve.id===B))==null?void 0:se.context)==null?void 0:Te.elements.floating,ne=Xr(Dt(P??De??null)),he=Oe.some(Ve=>Ve.context&&Je(Ve.context.elements.floating,ne));De&&!he&&W.current&&De.focus({preventScroll:!0})},[i,_,P,L,B,m]),ze(()=>{de.current=I,re.current=!!_}),ze(()=>{I||(G.current=null,$.current=g)},[I,g]);const Se=r!=null,ke=Qe(Oe=>{if(!K.current)return;const De=n.current.indexOf(Oe.currentTarget);De!==-1&&(q.current!==De||r!==De)&&(q.current=De,Z(Oe))}),_e=Qe(()=>{var Oe,De,ne;return C??((ne=(De=(Oe=L==null?void 0:L.nodesRef.current.find(he=>he.id===B))==null?void 0:Oe.context)==null?void 0:De.dataRef)==null?void 0:ne.current.orientation)}),we=Qe(()=>IS(n,J.current)),Re=Qe(Oe=>{if(W.current=!1,F.current=!0,Oe.which===229||!K.current&&Oe.currentTarget===j.current)return;if(d&&sW(Oe.key,E,h,D)){Ug(Oe.key,_e())||Ki(Oe),k.setOpen(!1,gt(ew,Oe.nativeEvent)),Zt(P)&&(m?L==null||L.events.emit("virtualfocus",P):P.focus());return}const De=q.current,ne=IS(n,w),he=SM(n,w);if(U||(Oe.key==="Home"&&(Ki(Oe),q.current=ne,Z(Oe)),Oe.key==="End"&&(Ki(Oe),q.current=he,Z(Oe))),M!=null){const se=M(Oe,q.current,n,E,u,h,w,ne,he);if(se!=null&&(q.current=se,Z(Oe)),E==="both")return}if(Ug(Oe.key,E)){if(Ki(Oe),I&&!m&&Xr(Oe.currentTarget.ownerDocument)===Oe.currentTarget){q.current=FS(Oe.key,E,h)?ne:he,Z(Oe);return}FS(Oe.key,E,h)?u?De>=he?c&&De!==n.current.length?q.current=-1:(F.current=!1,q.current=ne):q.current=ff(n.current,{startingIndex:De,disabledIndices:w}):q.current=Math.min(he,ff(n.current,{startingIndex:De,disabledIndices:w})):u?De<=ne?c&&De!==-1?q.current=n.current.length:(F.current=!1,q.current=he):q.current=ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w}):q.current=Math.max(ne,ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w})),vM(n.current,q.current)&&(q.current=-1),Z(Oe)}}),Ae=O.useMemo(()=>({onFocus(De){F.current=!0,ke(De)},onClick:({currentTarget:De})=>De.focus({preventScroll:!0}),onMouseMove(De){$M(De)||(F.current=!0,X.current=!1,y&&ke(De))},onPointerLeave(De){var he;if(!K.current||!W.current||De.pointerType==="touch")return;F.current=!0;const ne=De.relatedTarget;if(!(!y||n.current.includes(ne))&&ye.current&&((he=te.current)==null||he.call(te),te.current=null,q.current=-1,Z(De),!m)){const se=j.current,Te=Xr(Dt(se));se&&Je(se,Te)&&se.focus({preventScroll:!0})}}}),[ke,K,j,y,n,Z,ye,m]),Le=O.useMemo(()=>m&&I&&Se&&{"aria-activedescendant":`${T}-${r}`},[m,I,Se,T,r]),Ie=O.useMemo(()=>({...U?{}:Le,onKeyDown(Oe){if(Oe.key==="Tab"&&Oe.shiftKey&&I&&!m){const De=Zr(Oe.nativeEvent);if(De&&!Je(j.current,De))return;Ki(Oe),k.setOpen(!1,gt(Bc,Oe.nativeEvent)),Zt(P)&&P.focus();return}Re(Oe)},onPointerMove(Oe){$M(Oe)||(W.current=!0)}}),[Le,Re,j,U,k,I,m,P]),Ue=O.useMemo(()=>{function Oe(he){k.setOpen(!0,gt(ew,he.nativeEvent,he.currentTarget))}function De(he){g==="auto"&&iC(he.nativeEvent)&&($.current=!m)}function ne(he){$.current=g,g==="auto"&&oC(he.nativeEvent)&&($.current=!0)}return{onKeyDown(he){const se=k.select("open");W.current=!1;const Te=he.key.startsWith("Arrow"),Ve=rW(he.key,_e(),h),jt=Ug(he.key,E),hn=(d?Ve:jt)||he.key==="Enter"||he.key.trim()==="";if(m&&se)return Re(he);if(!(!se&&!b&&Te)){if(hn){const Fe=Ug(he.key,_e());G.current=d&&Fe?null:he.key}if(d){Ve&&(Ki(he),se?(q.current=we(),Z(he)):Oe(he));return}jt&&(ce.current!=null&&(q.current=ce.current),Ki(he),!se&&b?Oe(he):Re(he),se&&Z(he))}},onFocus(he){k.select("open")&&!m&&(q.current=-1,Z(he))},onPointerDown:ne,onPointerEnter:ne,onMouseDown:De,onClick:De}},[Re,g,we,d,Z,k,b,E,_e,h,ce,m]),We=O.useMemo(()=>({...Le,...Ue}),[Le,Ue]);return O.useMemo(()=>i?{reference:We,floating:Ie,item:Ae,trigger:Ue}:{},[i,We,Ie,Ue,Ae])}function oW(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:i,disabledIndices:l,onTyping:c,enabled:u=!0,resetMs:d=750,selectedIndex:h=null}=t,m="rootStore"in e?e.rootStore:e,g=m.useState("open"),y=Jr(),b=O.useRef(""),w=O.useRef(h??s??-1),E=O.useRef(null),C=Qe(R=>{function M(j){return r==null?void 0:r.current[j]}function D(j){const B=M(j);return B&&!Qy(B)||B!=null&&B.matches(":disabled")?!1:l==null||!UL(Zh,j,l)}function k(j,B,L=0){if(j.length===0)return-1;const $=(L%j.length+j.length)%j.length,q=B.toLowerCase();for(let G=0;G<j.length;G+=1){const W=($+G)%j.length,Z=j[W];if(!(!(Z!=null&&Z.toLowerCase().startsWith(q))||!D(W)))return W}return-1}const I=n.current;if(b.current.length>0&&R.key===" "&&(Ki(R),c==null||c(!0)),b.current.length>0&&b.current[0]!==" "&&k(I,b.current)===-1&&R.key!==" "&&(c==null||c(!1)),I==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(Ki(R),c==null||c(!0));const _=b.current==="";_&&(w.current=h??s??-1),I.every((j,B)=>{var L,$;return j&&D(B)?((L=j[0])==null?void 0:L.toLowerCase())!==(($=j[1])==null?void 0:$.toLowerCase()):!0})&&b.current===R.key&&(b.current="",w.current=E.current),b.current+=R.key,y.start(d,()=>{b.current="",w.current=E.current,c==null||c(!1)});const z=((_?h??s??-1:w.current)??0)+1,U=k(I,b.current,z);U!==-1?(i==null||i(U),E.current=U):R.key!==" "&&(b.current="",c==null||c(!1))}),T=Qe(R=>{const M=R.relatedTarget,D=m.select("domReferenceElement"),k=m.select("floatingElement");Je(D,M)||Je(k,M)||(y.clear(),b.current="",w.current=E.current,c==null||c(!1))});ze(()=>{!g&&h!==null||(y.clear(),E.current=null,b.current!==""&&(b.current=""))},[g,h,y]);const N=O.useMemo(()=>({onKeyDown:C,onBlur:T}),[C,T]);return O.useMemo(()=>u?{reference:N,floating:N}:{},[u,N])}const VM=.1,lW=VM*VM,Yt=.5;function qg(e,t,n,r,s,i){return r>=t!=i>=t&&e<=(s-n)*(t-r)/(i-r)+n}function Gg(e,t,n,r,s,i,l,c,u,d){let h=!1;return qg(e,t,n,r,s,i)&&(h=!h),qg(e,t,s,i,l,c)&&(h=!h),qg(e,t,l,c,u,d)&&(h=!h),qg(e,t,u,d,n,r)&&(h=!h),h}function aW(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Kg(e,t,n,r,s,i){const l=Math.min(n,s),c=Math.max(n,s),u=Math.min(r,i),d=Math.max(r,i);return e>=l&&e<=c&&t>=u&&t<=d}function ux(e={}){const{blockPointerEvents:t=!1}=e,n=new si,r=({x:s,y:i,placement:l,elements:c,onClose:u,nodeId:d,tree:h})=>{const m=l==null?void 0:l.split("-")[0];let g=!1,y=null,b=null,w=typeof performance<"u"?performance.now():0;function E(T,N){const R=performance.now(),M=R-w;if(y===null||b===null||M===0)return y=T,b=N,w=R,!1;const D=T-y,k=N-b,I=D*D+k*k,_=M*M*lW;return y=T,b=N,w=R,I<_}function C(){n.clear(),u()}return function(N){n.clear();const R=c.domReference,M=c.floating;if(!R||!M||m==null||s==null||i==null)return;const{clientX:D,clientY:k}=N,I=Zr(N),_=N.type==="mouseleave",P=Je(M,I),H=Je(R,I);if(P&&(g=!0,!_))return;if(H&&(g=!1,!_)){g=!0;return}if(_&&bt(N.relatedTarget)&&Je(M,N.relatedTarget))return;function z(){return!!(h&&Ra(h.nodesRef.current,d).length>0)}function U(){z()||C()}if(z())return;const j=R.getBoundingClientRect(),B=M.getBoundingClientRect(),L=s>B.right-B.width/2,$=i>B.bottom-B.height/2,q=B.width>j.width,G=B.height>j.height,W=(q?j:B).left,Z=(q?j:B).right,re=(G?j:B).top,de=(G?j:B).bottom;if(m==="top"&&i>=j.bottom-1||m==="bottom"&&i<=j.top+1||m==="left"&&s>=j.right-1||m==="right"&&s<=j.left+1){U();return}let F=!1;switch(m){case"top":F=Kg(D,k,W,j.top+1,Z,B.bottom-1);break;case"bottom":F=Kg(D,k,W,B.top+1,Z,j.bottom-1);break;case"left":F=Kg(D,k,B.right-1,de,j.left+1,re);break;case"right":F=Kg(D,k,j.right-1,de,B.left+1,re);break}if(F)return;if(g&&!aW(D,k,j)){U();return}if(!_&&E(D,k)){U();return}let X=!1;switch(m){case"top":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i+Yt+1,ye=L||q?B.bottom-Yt:B.top,ge=L?q?B.bottom-Yt:B.top:B.bottom-Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"bottom":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i-Yt,ye=L||q?B.top+Yt:B.bottom,ge=L?q?B.top+Yt:B.bottom:B.top+Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"left":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s+Yt+1,ye=$||G?B.right-Yt:B.left,ge=$?G?B.right-Yt:B.left:B.right-Yt;X=Gg(D,k,ye,B.top,ge,B.bottom,ce,J,ce,K);break}case"right":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s-Yt,ye=$||G?B.left+Yt:B.right,ge=$?G?B.left+Yt:B.right:B.left+Yt;X=Gg(D,k,ce,J,ce,K,ye,B.top,ge,B.bottom);break}}X?g||n.start(40,U):U()}};return r.__options={...e,blockPointerEvents:t},r}const MP=O.createContext(void 0);function cW(){const e=O.useContext(MP);if(e===void 0)throw new Error(wn(26));return e}const uW="ArrowUp",fW="ArrowDown",dW="ArrowLeft",hW="ArrowRight",pW="Home",mW="End",TC=new Set([uW,fW,dW,hW,pW,mW]),gW="--nested-dialogs",yW="data-nested-dialog-open",xW={...Uy,...ZE,nestedDialogOpen(e){return e?{[yW]:""}:null}},AP=O.forwardRef(function(t,n){const{render:r,className:s,style:i,finalFocus:l,initialFocus:c,...u}=t,d=su(),h=d.useState("descriptionElementId"),m=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),y=d.useState("popupProps"),b=d.useState("modal"),w=d.useState("mounted"),E=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),T=d.useState("open"),N=d.useState("openMethod"),R=d.useState("titleElementId"),M=d.useState("transitionStatus"),D=d.useState("role"),k=g.useState("floatingId");cW(),ou({open:T,ref:d.context.popupRef,onComplete(){var U,j;T&&((j=(U=d.context).onOpenChangeComplete)==null||j.call(U,!0))}});const I=c===void 0?NP(d.context.popupRef):c,_=C>0,P=d.useStateSetter("popupElement"),z=dn("div",t,{state:{open:T,nested:E,transitionStatus:M,nestedDialogOpen:_},props:[y,{id:k,"aria-labelledby":R,"aria-describedby":h,role:D,...Vp,hidden:!w,onKeyDown(U){TC.has(U.key)&&U.stopPropagation()},style:{[gW]:C}},u],ref:[n,d.context.popupRef,P],stateAttributesMapping:xW});return x.jsx(xC,{context:g,openInteractionType:N,disabled:!w,closeOnFocusOut:!m,initialFocus:I,returnFocus:l,modal:b!==!1,restoreFocus:"popup",children:z})});function RC(e){return GE(19)?e:e?"true":void 0}const OC=O.forwardRef(function(t,n){const{cutout:r,...s}=t;let i;if(r){const l=r.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),_P=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,i=su(),l=i.useState("mounted"),c=i.useState("modal"),u=i.useState("open");return l||r?x.jsx(MP.Provider,{value:r,children:x.jsxs(hC,{ref:n,...s,children:[l&&c===!0&&x.jsx(OC,{ref:i.context.internalBackdropRef,inert:RC(!u)}),t.children]})}):null});let UM={},qM={},GM="";function fx(e,t){return Lp(e)?e:t}function KM(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fx(t,n)).overflowY)}function bW(e){if(typeof document>"u")return!1;const t=Dt(e);return vn(t).innerWidth-t.documentElement.clientWidth>0}function vW(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Dt(e),r=n.documentElement,s=n.body,i=fx(r,s),l=i.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",i.style.overflowY="scroll";const u=i.offsetWidth;i.style.overflowY="hidden";const d=i.offsetWidth;return i.style.overflowY=l,r.style.scrollbarGutter=c,u===d}function SW(e){const t=Dt(e),n=t.documentElement,r=t.body,s=fx(n,r),i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function wW(e){var y;const t=Dt(e),n=t.documentElement,r=t.body,s=vn(n);let i=0,l=0,c=!1;const u=Qi.create();if(Aa&&(((y=s.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),w=s.getComputedStyle(r),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,l=n.scrollLeft,UM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},GM=n.style.scrollBehavior,qM={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const N=n.scrollHeight>n.clientHeight,R=n.scrollWidth>n.clientWidth,M=b.overflowY==="scroll"||w.overflowY==="scroll",D=b.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),I=Math.max(0,s.innerHeight-r.clientHeight),_=parseFloat(w.marginTop)+parseFloat(w.marginBottom),P=parseFloat(w.marginLeft)+parseFloat(w.marginRight),H=fx(n,r);if(c=vW(e),c){n.style.scrollbarGutter=T,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(N||M)&&(n.style.overflowY="scroll"),(R||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:_||I?`calc(100dvh - ${_+I}px)`:"100dvh",width:P||k?`calc(100vw - ${P+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,UM),Object.assign(r.style,qM),c||(n.scrollTop=i,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=GM)}function m(){h(),u.request(d)}d();const g=xt(s,"resize",m);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class EW{constructor(){_t(this,"lockCount",0);_t(this,"restore",null);_t(this,"timeoutLock",si.create());_t(this,"timeoutUnlock",si.create());_t(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});_t(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Dt(t),r=n.documentElement,s=n.body,i=vn(r);if(KM(i,r,s)){const c=new i.MutationObserver(()=>{KM(i,r,s)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(s,u),this.restore=()=>c.disconnect();return}const l=Ky||!bW(t);this.restore=l?SW(t):wW(t)}}const CW=new EW;function DP(e=!0,t=null){ze(()=>{if(e)return CW.acquire(t)},[e,t])}function NW({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),i=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,d]=O.useState(0),[h,m]=O.useState(0),g=u===0,y=$p(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!e.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const w=Zr(b);if(g&&!s){if(i){const E=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return E||C?E===w||C===w||Je(w,l)&&!(w!=null&&w.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:g});return DP(r&&i===!0,l),e.useContextCallback("onNestedDialogOpen",(b,w)=>{d(b),m(w)}),ze(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,h+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,h,t]),Kp(e,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const TW={...Xp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class RW extends fd{constructor(n,r,s){const i=new Yp,l=OW(n,i,r,s);super(l,kW(i),TW);_t(this,"setOpen",(n,r)=>{var s,i;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(i=(s=this.context).onOpenChange)==null||i.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(sx(this.state,n,r.trigger)))})}}function OW(e,t,n,r=!1){return{...Wp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function kW(e){return{popupRef:O.createRef(),backdropRef:O.createRef(),internalBackdropRef:O.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function MW(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:d,handle:h,triggerId:m,defaultTriggerId:g=null}=t,y=e==="drawer",b=u,w=c,E="dialog",C=su(!0),T=C!=null,N={modal:b,disablePointerDismissal:w,nested:T,role:E},R=rx((P,H)=>new RW({open:s,openProp:r,activeTriggerId:g,triggerIdProp:m,...N},P,H),!0);R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",m),R.useSyncedValues(N),R.useContextCallback("onOpenChange",i),R.useContextCallback("onOpenChangeComplete",l);const M=R.useState("open"),D=R.useState("mounted"),k=R.useState("payload");RP(R,M),qp(R);const{forceUnmount:I}=Gp(M,R);O.useImperativeHandle(d,()=>({unmount:I,close:()=>R.setOpen(!1,gt(Hp))}),[I,R]);const _=M||D;return x.jsxs(IL.Provider,{value:R,children:[h&&x.jsx(Up,{handle:h,store:R}),_&&x.jsx(NW,{store:R,parentContext:C==null?void 0:C.context,isDrawer:y}),typeof n=="function"?n({payload:k}):n]})}const IP=ud(function(t){return MW("dialog",t)}),AW=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("titleElementId",d),dn("h2",t,{ref:n,props:[{id:d},c]})});function _W(e){const t=O.useRef(""),n=O.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:O.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function jP(e,t){const n=O.useRef(e),r=Qe(t);ze(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function LP(e,t){const n=Qe((i,l)=>{(typeof e=="function"?e():e)||t(l||(Ky?"touch":""))}),{onClick:r,onPointerDown:s}=_W(n);return O.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function DW(e){const[t,n]=O.useState(null),r=LP(e,n);return jP(e,s=>{s&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}/**
67
+ */var Pk;function fU(){if(Pk)return xS;Pk=1;var e=Ip(),t=zj();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return xS.useSyncExternalStoreWithSelector=function(d,h,m,g,y){var b=i(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=c(function(){function C(D){if(!T){if(T=!0,N=D,D=g(D),y!==void 0&&w.hasValue){var k=w.value;if(y(k,D))return R=k}return R=D}if(k=R,r(N,D))return k;var I=g(D);return y!==void 0&&y(k,I)?(N=D,k):(N=D,R=I)}var T=!1,N,R,M=m===void 0?null:m;return[function(){return C(h())},M===null?void 0:function(){return C(M())}]},[h,m,g,y]);var E=s(d,b[0],b[1]);return l(function(){w.hasValue=!0,w.value=E},[E]),u(E),E},xS}var zk;function dU(){return zk||(zk=1,yS.exports=fU()),yS.exports}var zE=dU();const hU=bE(zE);function pU(e,t){return e===t}function tl(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??pU,s=O.useCallback(l=>{const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=O.useCallback(()=>e.get(),[e]);return zE.useSyncExternalStoreWithSelector(s,i,i,t,r)}var Bk={};function Bj(e,t){const n=O.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=fa(n.current,s):s}}function tu(e){const t=gs(),n=O.useContext(e.from?rU:Py),r=e.from??n,s=t.stores.getMatchStore(r),i=Bj(e,t),l=tl(s,c=>c?i(c):Bk);if(l!==Bk)return l;(e.shouldThrow??!0)&&OE()}function Hj(e){return tu({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fj(e){const{select:t,...n}=e;return tu({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function $j(e){return tu({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vj(e){return tu({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jp(e){const t=gs();return O.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function abe(e){const t=gs(),n=jp(),r=O.useRef(null);return TE(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Uj(e){return tu({...e,select:t=>e.select?e.select(t.context):t.context})}function mU(...e){const t=O.useRef(e),n=t.current;return e.forEach((r,s)=>{qo(n[s],r,!1,!0)||(n[s]=r)}),t.current}function Lg(e,t){e.preloadRoute(t).catch(n=>{console.warn(n),console.warn(XV)})}var gU={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function yU(e,t){const n=typeof e=="string"&&Gh(e);if(n)return t.has(n)?e:null}function xU(e,t,n,r,s){const i=pk(e.pathname,r),l=pk(t.pathname,r);return(n!=null&&n.exact?i!==l:!(i.startsWith(l)&&(i.length===l.length||i[l.length]==="/")))||((n==null?void 0:n.includeSearch)??!0)&&!qo(e.search,t.search,!(n!=null&&n.exact),n==null?void 0:n.explicitUndefined)?!1:n!=null&&n.includeHash?s&&e.hash===t.hash:!0}function bU(e,t,n){const r=gs(),s=O.useRef(null),i=O.useCallback(J=>{if(s.current=J,typeof t=="function")return t(J);t&&(t.current=J)},[t]),{activeOptions:l,to:c,preload:u,preloadDelay:d,hashScrollIntoView:h,replace:m,startTransition:g,resetScroll:y,viewTransition:b,ignoreBlocker:w,disabled:E,target:C,onClick:T,onBlur:N,onFocus:R,onMouseEnter:M,onMouseLeave:D,onTouchStart:k}=e,I=Ij(),[_,P,H]=mU(e.search,e.params,l),[z,U]=O.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,_,P,e.state,e.mask,e.unsafeRelative]),j=O.useCallback(J=>{const K=yU(c,r.protocolAllowlist);if(K!==void 0)return[K??void 0];z._fromLocation||(U._fromLocation=J);const ce=r.buildLocation(U),ye=CU(ce,r,E);return[ye,!E&&(!ye||Gh(ye))?void 0:xU(J,ce,H,r.basepath,I)]},[H,E,I,z,U,r,c]),[B,L]=tl(r.stores.location,j,gU),$=L===void 0?B:void 0,q=E||B===void 0,G=O.useRef(!1),W=e.reloadDocument||$||q?!1:u??r.options.defaultPreload,Z=d??r.options.defaultPreloadDelay??0,re=O.useCallback(J=>{const K=J==null?void 0:J.isIntersecting;if(!(K??W==="intent")){K===!1&&SS(s);return}if(!Z){Lg(r,z);return}Lh.has(s)||Lh.set(s,setTimeout(()=>{Lh.delete(s),Lg(r,z)},Z))},[r,z,s,W,Z]);O.useEffect(()=>{W==="render"&&!G.current&&(G.current=!0,Lg(r,z));let J;return W==="viewport"&&s.current&&typeof IntersectionObserver=="function"&&(J=new IntersectionObserver(K=>re(K.pop()),{rootMargin:"100px"}),J.observe(s.current)),()=>{J==null||J.disconnect(),SS(s)}},[r,z,W,re,s]);const de=wU(e,n);if(de.ref=t?i:s,$)return de.href=$,de;const F=J=>{const K=C??J.currentTarget.getAttribute("target");!q&&!(J.metaKey||J.altKey||J.ctrlKey||J.shiftKey)&&!J.defaultPrevented&&(!K||K==="_self")&&J.button===0&&(J.preventDefault(),r.navigate({...z,replace:m,resetScroll:y,hashScrollIntoView:h,startTransition:g,viewTransition:b,ignoreBlocker:w}))},X=()=>{W==="intent"&&Lg(r,z)},te=()=>{W==="intent"&&SS(s)};return de.onClick=Ju(T,F),de.onBlur=Ju(N,te),de.onFocus=Ju(R,re),de.onMouseEnter=Ju(M,re),de.onMouseLeave=Ju(D,te),de.onTouchStart=Ju(k,X),EU(de,e,L,B,q,n)}var vU={},SU={className:"active"},qj=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 wU(e,t){const n={};for(const r in e)qj.has(r)||r==="type"&&t!==void 0||r==="disabled"&&t==="a"||(n[r]=e[r]);return n}function EU(e,t,n,r,s,i){const{activeProps:l,inactiveProps:c,className:u,style:d,target:h}=t,m=hj(n?l:c,{})??(n?SU:vU);Object.assign(e,m),e.href=r,i!=="a"&&(e.disabled=s),e.target=h;const g=m.style;(d||g)&&(e.style=d&&g?{...d,...g}:d||g);const y=m.className;return(u||y)&&(e.className=u?y?`${u} ${y}`:u:y),s&&(e.role="link",e["aria-disabled"]=!0),n&&(e["data-status"]="active",e["aria-current"]="page"),e}var Lh=new WeakMap,SS=e=>{clearTimeout(Lh.get(e)),Lh.delete(e)},Ju=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function CU(e,t,n){if(n)return;const r=e.maskedLocation??e,s=r.external?r.publicHref:t.history.createHref(r.publicHref)||"/";if(!((r.external||s!==r.publicHref)&&gj(s,t.protocolAllowlist)))return s}var Ff=O.memo(O.forwardRef((e,t)=>{const n=e._asChild||"a",r=bU(e,t,n),s=typeof e.children=="function"?e.children({isActive:r["data-status"]==="active"}):e.children;return O.createElement(n,r,s)}),NU);function NU(e,t){let n=0;for(const r in t)if(n++,e[r]!==t[r]&&(!qj.has(r)||!qo(e[r],t[r],!1,!0)))return!1;for(const r in e)n--;return n===0}var TU=class extends Dj{constructor(t){super(t),this.useMatch=n=>tu({...n,from:this.id}),this.useRouteContext=n=>Uj({...n,from:this.id}),this.useSearch=n=>Vj({...n,from:this.id}),this.useParams=n=>$j({...n,from:this.id}),this.useLoaderDeps=n=>Fj({...n,from:this.id}),this.useLoaderData=n=>Hj({...n,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((n,r)=>x.jsx(Ff,{ref:r,from:this.fullPath,...n}))}};function RU(e){return new TU(e)}function OU(){return e=>MU(e)}var kU=class extends QV{constructor(e){super(e),this.useMatch=t=>tu({...t,from:this.id}),this.useRouteContext=t=>Uj({...t,from:this.id}),this.useSearch=t=>Vj({...t,from:this.id}),this.useParams=t=>$j({...t,from:this.id}),this.useLoaderDeps=t=>Fj({...t,from:this.id}),this.useLoaderData=t=>Hj({...t,from:this.id}),this.useNavigate=()=>jp({from:this.fullPath}),this.Link=od.forwardRef((t,n)=>x.jsx(Ff,{ref:n,from:this.fullPath,...t}))}};function MU(e){return new kU(e)}function ys(e){return t=>{const n=RU(t);return n.isRoot=!1,n}}function fn(e,t){let n,r,s;const i=()=>(n||(s=void 0,n=e().then(c=>{n=void 0,l.preload=void 0,r=c[t??"default"]}).catch(c=>{n=void 0,s=c})),n),l=function(u){if(s){if(X$(s)&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${s.message}`;if(!sessionStorage.getItem(d))throw sessionStorage.setItem(d,"1"),window.location.reload(),new Promise(()=>{})}throw s}if(!r)if(dk)dk(i());else throw i();return O.createElement(r,u)};return l.preload=i,l}function AU(e){const t=gs(),n=`not-found-${tl(t.stores.location,r=>r.pathname)}-${tl(t.stores.status)}`;return x.jsx(PE,{getResetKey:()=>n,onCatch:(r,s)=>{var i;if(Hf(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(Hf(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function _U(){return x.jsx("p",{children:"Not Found"})}function of(e){return x.jsx(x.Fragment,{children:e.children})}function Gj(e,t,n){return t.options.notFoundComponent?x.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...n}):x.jsx(_U,{})}function zy(e,t){const n=(t==null?void 0:t.options.pendingComponent)??e.options.defaultPendingComponent;return n?x.jsx(n,{}):null}var DU=(e,t)=>e[0]===t[0]&&e[1]===t[1],Kj=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n==="data-only"||!e.ssr,Yj=O.memo(function({routeId:t}){const n=gs();return x.jsx(IU,{router:n,match:tl(n.stores.getMatchStore(t))})});function IU({router:e,match:t}){var m,g;const n=e.routesById[t.routeId],r=zy(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,i=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??((m=e.options.notFoundRoute)==null?void 0:m.options.component):n.options.notFoundComponent,c=t.ssr===!1||t.ssr==="data-only",u=Kj(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(((g=n.options.errorComponent)==null?void 0:g.preload)||c))?O.Suspense:of,d=s?PE:of,h=l?AU:of;return x.jsxs(n.isRoot?n.options.shellComponent??of:of,{children:[x.jsx(Py.Provider,{value:t.routeId,children:x.jsx(u,{fallback:r,children:x.jsx(d,{getResetKey:()=>t,errorComponent:s,onCatch:(y,b)=>{if(Hf(y))throw y.routeId??(y.routeId=t.routeId),y;i==null||i(y,b)},children:x.jsx(h,{fallback:y=>{if(y.routeId??(y.routeId=t.routeId),y.routeId!==t.routeId)throw y;return O.createElement(l,y)},children:c?x.jsx(tU,{fallback:r,children:x.jsx(Hk,{match:t})}):x.jsx(Hk,{match:t})})})})}),null]})}var Hk=O.memo(function({match:t}){const n=gs(),r=t.routeId,s=n.routesById[r],i=O.useMemo(()=>{var u;const c=(u=s.options.remountDeps??n.options.defaultRemountDeps)==null?void 0:u({routeId:r,loaderDeps:t.loaderDeps,params:t._strictParams,search:t._strictSearch});return c?JSON.stringify(c):void 0},[r,t.loaderDeps,t._strictParams,t._strictSearch,s.options.remountDeps,n.options.defaultRemountDeps]),l=O.useMemo(()=>{const c=s.options.component??n.options.defaultComponent;return c?x.jsx(c,{},i):x.jsx(Wj,{})},[i,s.options.component,n.options.defaultComponent]);if(t.status==="pending"){if(n.ssr&&!Kj(n,s,t.ssr))return l;if(n._tx)throw n._tx[5];return zy(n,s)}if(t.status==="notFound")return Gj(n,s,t.error);if(t.status==="error")throw t.error;return l}),Wj=O.memo(function(){const t=gs(),n=O.useContext(Py);let r,s,i;{const c=t.stores.getMatchStore(n);[r,s]=tl(c,u=>[!!u._notFound,u.error],{compare:DU}),i=tl(t.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Gj(t,t.routesById[n],s);if(!i)return null;const l=x.jsx(Yj,{routeId:i});return n===yf?x.jsx(O.Suspense,{fallback:zy(t),children:l}):l});function Xj(e,t){const n=e[1];e.length=0,n==null||n(t)}function jU({t:e}){const t=gs(),n=t._rendered??(t._rendered=[]);return t.startTransition=(r,s)=>new Promise(i=>{Xj(n,!1),n.push(s,i),e(t),O.startTransition(r)}),TE(()=>{const r=t.history.subscribe(t.load);t.updateLatestLocation();const s=t.latestLocation,i=t.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ji(s.publicHref)!==Ji(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const l=t.stores.resolvedLocation.get();return(l==null?void 0:l.href)===s.href&&l.state.__TSR_key===s.state.__TSR_key?n.push(t.stores.matches.get(),c=>{c&&t.emit({type:"onRendered",...jy(l,l)})}):t._tx||t.load({sync:!0}).catch(console.error),r},[t,t.history]),null}function LU(){const e=gs(),t=e.routesById[yf],n=zy(e,t),r=e.ssr?of:O.Suspense,s=x.jsxs(x.Fragment,{children:[x.jsx(jU,{t:O.useState()[1]}),x.jsx(r,{fallback:n,children:x.jsx(PU,{})})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:s}):s}function PU(){const e=gs(),t=e._rendered,n=tl(e.stores.matches,l=>t[0]??l),r=n[0],s=r==null?void 0:r.routeId;TE(()=>{t[0]===n&&Xj(t,!0)},[t,n]);const i=s?x.jsx(Yj,{routeId:s}):null;return x.jsx(Py.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:x.jsx(PE,{getResetKey:()=>r,onCatch:void 0,children:i})})}function Fk(e){const t=gs();return tl(t.stores.matches,Bj(e,t))}var zU=e=>({createMutableStore:Ik,createReadonlyStore:Ik,batch:aU}),BU=e=>new HU(e),HU=class extends jV{constructor(e){super(e,zU)}};function FU({router:e,children:t,...n}){pj(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=x.jsx(jj.Provider,{value:e,children:t});return e.options.Wrap?x.jsx(e.options.Wrap,{children:r}):r}function $U({router:e,...t}){return x.jsx(FU,{router:e,...t,children:x.jsx(LU,{})})}const Qj=O.createContext(null);function By(){return typeof window<"u"}function Nr(e){return BE(e)?(e.nodeName||"").toLowerCase():"#document"}function vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ol(e){var t;return(t=(BE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BE(e){return By()?e instanceof Node||e instanceof vn(e).Node:!1}function bt(e){return By()?e instanceof Element||e instanceof vn(e).Element:!1}function Zt(e){return By()?e instanceof HTMLElement||e instanceof vn(e).HTMLElement:!1}function $f(e){return!By()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vn(e).ShadowRoot}function Lp(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function VU(e){return/^(table|td|th)$/.test(Nr(e))}function Hy(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UU=/transform|translate|scale|rotate|perspective|filter/,qU=/paint|layout|strict|content/,ac=e=>!!e&&e!=="none";let wS;function HE(e){const t=bt(e)?zs(e):e;return ac(t.transform)||ac(t.translate)||ac(t.scale)||ac(t.rotate)||ac(t.perspective)||!FE()&&(ac(t.backdropFilter)||ac(t.filter))||UU.test(t.willChange||"")||qU.test(t.contain||"")}function GU(e){let t=nl(e);for(;Zt(t)&&!Ko(t);){if(HE(t))return t;if(Hy(t))return null;t=nl(t)}return null}function FE(){return wS==null&&(wS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wS}function Ko(e){return/^(html|body|#document)$/.test(Nr(e))}function zs(e){return vn(e).getComputedStyle(e)}function Fy(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nl(e){if(Nr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$f(e)&&e.host||ol(e);return $f(t)?t.host:t}function Zj(e){const t=nl(e);return Ko(t)?(e.ownerDocument||e).body:Zt(t)&&Lp(t)?t:Zj(t)}function Qh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zj(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),l=vn(s);if(i){const c=K1(l);return t.concat(l,l.visualViewport||[],Lp(s)?s:[],c&&n?Qh(c):[])}else return t.concat(s,Qh(s,[],n))}function K1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const $E={...o$},$k={};function Tr(e,t){const n=O.useRef($k);return n.current===$k&&(n.current=e(t)),n}const ES=$E.useInsertionEffect,KU=ES&&ES!==$E.useLayoutEffect?ES:e=>e();function Qe(e){const t=Tr(YU).current;return t.next=e,KU(t.effect),t.trampoline}function YU(){const e={next:void 0,callback:WU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function WU(){}const XU=()=>{},ze=typeof document<"u"?O.useLayoutEffect:XU;function Y1(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const VE={};function Yo(e,t,n,r,s){if(!n&&!r&&!s&&!e)return U0(t);let i=U0(e);return t&&(i=Eh(i,t)),n&&(i=Eh(i,n)),r&&(i=Eh(i,r)),s&&(i=Eh(i,s)),i}function QU(e){if(e.length===0)return VE;if(e.length===1)return U0(e[0]);let t=U0(e[0]);for(let n=1;n<e.length;n+=1)t=Eh(t,e[n]);return t}function U0(e){return UE(e)?{...eL(e,VE)}:ZU(e)}function Eh(e,t){return UE(t)?eL(t,e):JU(e,t)}function ZU(e){const t={...e};for(const n in t){const r=t[n];Jj(n,r)&&(t[n]=tL(r))}return t}function JU(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Y1(e.style,r);break}case"className":{e[n]=nL(e.className,r);break}default:Jj(n,r)?e[n]=e9(e[n],r):e[n]=r}}return e}function Jj(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function UE(e){return typeof e=="function"}function eL(e,t){return UE(e)?e(t):e??VE}function e9(e,t){return t?e?(...n)=>{const r=n[0];if(rL(r)){const i=r;q0(i);const l=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),l}const s=t(...n);return e==null||e(...n),s}:tL(t):e}function tL(e){return e&&((...t)=>{const n=t[0];return rL(n)&&q0(n),e(...t)})}function q0(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nL(e,t){return t?e?t+" "+e:t:e}function rL(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function t9(e,t){return function(r,...s){const i=new URL(e);return i.searchParams.set("code",r.toString()),s.forEach(l=>i.searchParams.append("args[]",l)),`${t} error #${r}; visit ${i} for the full message.`}}const wn=t9("https://base-ui.com/production-error","Base UI"),n9=O.createContext(void 0);function qE(e=!1){const t=O.useContext(n9);if(t===void 0&&!e)throw new Error(wn(16));return t}function r9(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:i}=e,l=r&&t!==!1,c=r&&t===!1;return{props:O.useMemo(()=>{const d={onKeyDown(h){n&&t&&h.key!=="Tab"&&h.preventDefault()}};return r||(d.tabIndex=s,!i&&n&&(d.tabIndex=t?s:-1)),(i&&(t||l)||!i&&n)&&(d["aria-disabled"]=n),i&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,i,s])}}function Dt(e){return(e==null?void 0:e.ownerDocument)||document}function v0(e,t,{detail:n=0}={}){e.dispatchEvent(new(vn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Pp(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:i}=e,l=O.useRef(null),c=qE(!0),u=i??c!==void 0,{props:d}=r9({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:s}),h=O.useCallback(()=>{const y=l.current;CS(y)&&u&&t&&d.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,d.disabled,u]);ze(h,[h]);const m=O.useCallback((y={})=>{const{onClick:b,onMouseDown:w,onKeyUp:E,onKeyDown:C,onPointerDown:T,...N}=y;return Yo({onClick(R){if(t){R.preventDefault();return}b==null||b(R)},onMouseDown(R){t||w==null||w(R)},onKeyDown(R){if(t||(q0(R),C==null||C(R),R.baseUIHandlerPrevented))return;const M=R.target===R.currentTarget,D=R.currentTarget,k=CS(D),I=!s&&s9(D),_=M&&(s?k:!I),P=R.key==="Enter",H=R.key===" ",z=D.getAttribute("role"),U=(z==null?void 0:z.startsWith("menuitem"))||z==="option"||z==="gridcell";if(M&&u&&H){if(R.defaultPrevented&&U)return;R.preventDefault(),(!s||k)&&(R.preventBaseUIHandler(),v0(D,R));return}if(!_||s||!H&&!P){M&&I&&H&&R.preventDefault();return}R.defaultPrevented||(R.preventDefault(),P&&(R.preventBaseUIHandler(),v0(D,R)))},onKeyUp(R){if(!t){if(q0(R),E==null||E(R),R.target===R.currentTarget&&s&&u&&CS(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!u&&!R.defaultPrevented&&R.key===" "&&(R.preventBaseUIHandler(),v0(R.currentTarget,R))}},onPointerDown(R){if(t){R.preventDefault();return}T==null||T(R)}},s?{type:"button"}:{role:"button"},d,N)},[t,d,u,s]),g=Qe(y=>{l.current=y,h()});return{getButtonProps:m,buttonRef:g}}function CS(e){return Zt(e)&&e.tagName==="BUTTON"}function s9(e){return Zt(e)&&e.tagName==="A"&&!!e.href}function Vf(e,t,n,r){const s=Tr(sL).current;return o9(s,e,t,n,r)&&iL(s,[e,t,n,r]),s.callback}function i9(e){const t=Tr(sL).current;return l9(t,e)&&iL(t,e),t.callback}function sL(){return{callback:null,cleanup:null,refs:[]}}function o9(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function l9(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function iL(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=i(n);typeof l=="function"&&(r[s]=l);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const l=r[s];typeof l=="function"?l():i(null);break}case"object":{i.current=null;break}}}}}}}const a9=parseInt(O.version,10);function GE(e){return a9>=e}function Vk(e){if(!O.isValidElement(e))return null;const t=e,n=t.props;return(GE(19)?n==null?void 0:n.ref:t.ref)??null}function Bn(){}const Zh=Object.freeze([]),Tn=Object.freeze({});function c9(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const i=t[r](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function u9(e,t){return typeof e=="function"?e(t):e}function f9(e,t){return typeof e=="function"?e(t):e}function dn(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=m9(r));const s=d9(t,n,r);if(n.enabled===!1)return null;const i=n.state??Tn;return g9(e,r,s,i)}function d9(e,t,n){const{className:r,style:s}=e,{state:i=Tn,ref:l,props:c,stateAttributesMapping:u,enabled:d=!0}=t,h=d?u9(r,i):void 0,m=d?f9(s,i):void 0,g=d?c9(i,u):Tn,y=d&&c?h9(c):void 0,b=d?Y1(g,y)??{}:Tn;return typeof document<"u"&&(d?Array.isArray(l)?b.ref=i9([b.ref,Vk(n),...l]):b.ref=Vf(b.ref,Vk(n),l):Vf(null,null)),d?(h!==void 0&&(b.className=nL(b.className,h)),m!==void 0&&(b.style=Y1(b.style,m)),b):Tn}function h9(e){return Array.isArray(e)?QU(e):Yo(void 0,e)}const p9=Symbol.for("react.lazy");function m9(e){if((e==null?void 0:e.$$typeof)!==p9)return e;const t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function g9(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Yo(n,t.props);return s.ref=n.ref,O.cloneElement(t,s)}if(e&&typeof e=="string")return y9(e,n);throw new Error(wn(8))}function y9(e,t){return e==="button"?O.createElement("button",{type:"button",...t,key:t.key}):e==="img"?O.createElement("img",{alt:"",...t,key:t.key}):O.createElement(e,t)}const x9=O.forwardRef(function(t,n){const{render:r,className:s,disabled:i=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,style:u,...d}=t,{getButtonProps:h,buttonRef:m}=Pp({disabled:i,focusableWhenDisabled:l,native:c});return dn("button",t,{state:{disabled:i},ref:[n,m],props:[d,h]})});function oL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=oL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function b9(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=oL(e))&&(r&&(r+=" "),r+=t);return r}const Uk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qk=b9,v9=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return qk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],m=i==null?void 0:i[d];if(h===null)return null;const g=Uk(h)||Uk(m);return s[d][g]}),c=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:m,className:g,...y}=h;return Object.entries(y).every(b=>{let[w,E]=b;return Array.isArray(E)?E.includes({...i,...c}[w]):{...i,...c}[w]===E})?[...d,m,g]:d},[]);return qk(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},lL=48,oo=(e,t=0)=>{const n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-lL-t;return n},$y=e=>{const t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Ea=e=>{const t=new Int32Array(e.length);let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r)-lL;n+=s>>>1^-(s&1),t[r]=n}return t},S9=384,w9=[],fc=$y(oo("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),E9=$y(oo(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),C9="@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",N9=(()=>{const e=fc.length-1,t=new Int32Array(e);for(let s=e-1;s>=0;s--){let i=1,l=s+1;for(let c=fc[s];c<fc[s+1];c++)i+=t[l],l+=t[l];t[s]=i}const n=new Int32Array(fc[e]);let r=0;for(let s=0;s<e;s++){let i=s+1;for(let l=fc[s];l<fc[s+1];l++)n[r++]=i,i+=t[i]}return n})(),T9=oo("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),R9=$y(oo("123333359346463635126536711576")),O9=oo("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),k9=oo("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),M9=Ea("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),A9=(()=>{const e=new Int32Array(319).fill(-1),t=Ea("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),n=Ea("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),_9="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(e=>{const t=e.split(" "),n=t.shift();for(let r=0;r<t.length;r++)t[r]=n+t[r];return t}),Gk=Ea("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),D9=Ea("ɠ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"),I9=Ea("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),aL=new Int32Array(995),cL=new Int32Array(995),uL=new Int32Array(995);let W1="";const X1=new Int32Array(1038);{const e=new Map;let t=0,n=0;for(let r=0;r<Gk.length;r++)for(const s of _9[I9[r]]){let i=e.get(s);i===void 0&&(i=t++,e.set(s,i),X1[i*2]=W1.length,X1[i*2+1]=s.length,W1+=s),aL[n]=Gk[r],cL[n]=D9[r],uL[n]=i,n++}}const j9=Ea("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),L9=$y(oo("1::24444432:442:44:44>222222:44:4421322511111311111114")),P9=Ea("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"),z9=oo("ij"),B9=oo("—"),H9=oo("1"),F9="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var $9={GROUP_COUNT:S9,customValidatorNames:w9,edgeStart:fc,labelStart:E9,labelText:C9,edgeTarget:N9,nodeGroup:T9,nodeVlist:A9,vlistPat:R9,vlistOps:O9,vlistRef:k9,vlistGroup:M9,litAnchor:aL,litGroup:cL,litPool:uL,poolOffsets:X1,poolText:W1,adjGid:j9,adjStart:L9,adjTgt:P9,patGid:z9,patTgt:B9,postfixLookupGroups:H9,orderSensitiveModifiers:F9};const V9="line"in new Error,Vi=-1,cc=-1,NS=(e,t,n)=>{let r=2166136261;for(let s=t;s<n;s++)r=Math.imul(r^e.charCodeAt(s),16777619);return r},S0=(e,t,n)=>{const r=n-t;let s=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){const i=r>>2,l=r>>1;s=Math.imul(s^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+i),2246822507),s=Math.imul(s^e.charCodeAt(t+l)<<8^e.charCodeAt(t+l+i)<<16^e.charCodeAt(n-3),3266489909),s^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let c=t+3,u=n-4;c<t+8&&c<u;c++,u--)s=Math.imul(s^e.charCodeAt(c)^e.charCodeAt(u)<<8,16777619)}return s^s>>>15|0},U9=(e,t,n={})=>{const{GROUP_COUNT:r,edgeStart:s,labelStart:i,labelText:l,edgeTarget:c,nodeGroup:u,nodeVlist:d,vlistPat:h,vlistOps:m,vlistRef:g,vlistGroup:y,litAnchor:b,litGroup:w,litPool:E,poolOffsets:C,poolText:T,adjGid:N,adjStart:R,adjTgt:M,patGid:D,patTgt:k,postfixLookupGroups:I,customValidatorNames:_,orderSensitiveModifiers:P}=e,H=new Int32Array(r).fill(-1);for(let pe=0;pe<N.length;pe++)H[N[pe]]=pe;let z=0;for(let pe=0;pe+1<R.length;pe++){const Ee=R[pe+1]-R[pe];Ee>z&&(z=Ee)}let U=32;for(;U<2*(1+z+D.length);)U<<=1;const j=new Int32Array(g.length+1);for(let pe=0;pe<g.length;pe++)j[pe+1]=j[pe]+h[g[pe]+1]-h[g[pe]];const B=new Uint8Array(r);for(let pe=0;pe<I.length;pe++)B[I[pe]]=1;const L=s.length-1,$=new Uint8Array(L);let q=0,G=!0;for(let pe=0;pe<b.length;pe++){$[b[pe]]=1;const Ee=C[E[pe]*2+1];Ee>q&&(q=Ee);const Ce=T.charCodeAt(C[E[pe]*2]);(Ce===91||Ce===40)&&(G=!1)}let W=1;for(;W<b.length*2;)W<<=1;const Z=new Int32Array(W).fill(-1);for(let pe=0;pe<b.length;pe++){const Ee=C[E[pe]*2];let Ce=(NS(T,Ee,Ee+C[E[pe]*2+1])^Math.imul(b[pe],2654435761)|0)&W-1;for(;Z[Ce]!==-1;)Ce=Ce+1&W-1;Z[Ce]=pe}const re=(pe,Ee,Ce,Ge)=>{let ot=(NS(Ee,Ce,Ge)^Math.imul(pe,2654435761)|0)&W-1;const it=Ge-Ce;for(;;){const at=Z[ot];if(at===-1)return-1;if(b[at]===pe&&C[E[at]*2+1]===it){const Ht=C[E[at]*2];let It=!0;for(let Ze=0;Ze<it;Ze++)if(T.charCodeAt(Ht+Ze)!==Ee.charCodeAt(Ce+Ze)){It=!1;break}if(It)return w[at]}ot=ot+1&W-1}},de=n.cacheSize??8192,F=n.prefix??e.prefix??"",X=F===""?"":F+":",te=X.length,J=(_??[]).map(pe=>{throw new Error("cn: missing validator "+pe)}),K=/\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$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ye=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let oe=0,xe=-1,Se=-1,ke=-1,_e=-1;const we=pe=>pe>=97&&pe<=122||pe>=65&&pe<=90||pe>=48&&pe<=57||pe===95,Re=pe=>/\s/.test(String.fromCharCode(pe)),Ae=(pe,Ee,Ce)=>{if(oe=0,xe=-1,Ce-Ee<3)return;const Ge=pe.charCodeAt(Ee),ot=pe.charCodeAt(Ce-1);if(Ge===91&&ot===93)oe=1;else if(Ge===40&&ot===41)oe=2;else return;ke=Ee+1,_e=Ce-1;let it=Ee+1;if(we(pe.charCodeAt(it))){for(it++;it<Ce-1;){const at=pe.charCodeAt(it);if(!we(at)&&at!==45)break;it++}it<Ce-2&&pe.charCodeAt(it)===58&&(xe=Ee+1,Se=it,ke=it+1)}},Le=(pe,Ee,Ce,Ge)=>{if(Ce-Ee!==Ge.length)return!1;for(let ot=0;ot<Ge.length;ot++)if(pe.charCodeAt(Ee+ot)!==Ge.charCodeAt(ot))return!1;return!0},Ie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ue=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,We=pe=>!!pe&&!Number.isNaN(Number(pe)),Oe=(pe,Ee,Ce)=>{if(Ce-Ee<11||!Le(pe,Ee,Ee+10,"@container"))return!1;if(pe.charCodeAt(Ee+10)===47)return Ce-Ee>=12;const Ge=pe.charCodeAt(Ee+11);return Ge===115&&Ce-Ee>=17&&Le(pe,Ee+10,Ee+16,"-size/")||Ge===110&&Ce-Ee>=19&&Le(pe,Ee+10,Ee+18,"-normal/")},De=[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(pe=>pe.split(" ")),he=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],se=(pe,Ee,Ce,Ge)=>{if(pe>=10){if(pe>=25)return J[pe-25](Ee.slice(Ce,Ge));const ot=pe-10;if(oe!==De[ot])return!1;if(xe>=0){for(const it of ne[ot])if(Le(Ee,xe,Se,it))return!0;return!1}switch(he[ot]){case 0:return!1;case 1:return!0;case 2:{const it=Ee.slice(ke,_e);return K.test(it)&&!ce.test(it)}case 3:return We(Ee.slice(ke,_e));case 4:return ge.test(Ee.slice(ke,_e));default:return ye.test(Ee.slice(ke,_e))}}switch(pe){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return Ie.test(Ee.slice(Ce,Ge));case 5:return We(Ee.slice(Ce,Ge));case 6:{const ot=Ee.slice(Ce,Ge);return!!ot&&Number.isInteger(Number(ot))}case 7:return Ge>Ce&&Ee.charCodeAt(Ge-1)===37&&We(Ee.slice(Ce,Ge-1));case 8:return Ue.test(Ee.slice(Ce,Ge));default:return Oe(Ee,Ce,Ge)}},Te=new Set(typeof P=="string"?P.split(" "):P),Ve=(pe,Ee,Ce,Ge,ot,it)=>{const at=NS(Ee,Ce,Ge)^(ot?2654435769:0)|0;let Ht=pe.get(at);if(Ht!==void 0)e:for(let ut=0;ut<Ht.length;ut++){const At=Ht[ut];if(!(At.imp!==ot||At.k.length!==Ge-Ce)){for(let tt=0;tt<At.k.length;tt++)if(At.k.charCodeAt(tt)!==Ee.charCodeAt(Ce+tt))continue e;return At.id}}else pe.set(at,Ht=[]);const It=Ee.slice(Ce,Ge),Ze=it(It);return Ht.push({k:It,imp:ot,id:Ze}),Ze};let jt=new Map,hn=new Map,Fe=2;const Tt=4096,zt=(pe,Ee)=>{const Ce=[];let Ge=0,ot=0,it=0;for(let Ze=0;Ze<pe.length;Ze++){const ut=pe.charCodeAt(Ze);Ge===0&&ot===0&&ut===58?(Ce.push(pe.slice(it,Ze)),it=Ze+1):ut===91?Ge++:ut===93?Ge--:ut===40?ot++:ut===41&&ot--}Ce.push(pe.slice(it));let at=Ce[0];if(Ce.length>1){const Ze=[];let ut=[];for(const At of Ce)At.charCodeAt(0)===91||Te.has(At)?(ut.length&&(Ze.push(...ut.sort()),ut=[]),Ze.push(At)):ut.push(At);ut.length&&Ze.push(...ut.sort()),at=Ze.join(":")}const Ht=Ee?at+" !":at;let It=hn.get(Ht);return It===void 0&&hn.set(Ht,It=Fe++),It};let Vn=new Map,Un=r;const xs=r+4096,on=()=>Un++,ar=2097152,zr=8192,bs=new Int32Array(zr),qn=new Array(zr).fill(null),mt=new Int32Array(zr),ln=new Int32Array(zr),Gn=new Uint8Array(zr);let Rn=0;const On=(pe,Ee,Ce,Ge,ot,it,at,Ht)=>{let It=pe;if(qn[pe]!==null)if(qn[pe|1]===null)It=pe|1;else if((Rn++&3)===0)It=pe|Rn>>2&1;else return;qn[It]=Ee.slice(Ce,Ge),bs[It]=ot,mt[It]=it,ln[It]=at,Gn[It]=Ht},Bt=()=>qn.fill(null);let Wt=256,Xt=[new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt),new Int32Array(Wt)],[Br,Kn,_n,cr]=Xt,ur=new Uint8Array(Wt),fr=new Uint8Array(Wt);const ns=()=>{Wt*=2,Xt=Xt.map(Ee=>{const Ce=new Int32Array(Wt);return Ce.set(Ee),Ce}),[Br,Kn,_n,cr]=Xt;const pe=new Uint8Array(Wt);pe.set(ur),ur=pe,fr=new Uint8Array(Wt)};let Rr=64,Or=new Int32Array(Rr),rs=new Int32Array(Rr);const oi=new Int32Array(r);let dr=2048,Ai=21,vs=new Float64Array(dr),cl=new Int32Array(dr),Ss=0;const ul=(pe,Ee)=>{if(pe===0&&Ee<r)return oi[Ee]===Ss?1:(oi[Ee]=Ss,0);const Ce=pe*2097152+Ee+1;let Ge=Math.imul(Ce,2654435761)>>>Ai;for(;cl[Ge]===Ss;){if(vs[Ge]===Ce)return 1;Ge=Ge+1&dr-1}return vs[Ge]=Ce,cl[Ge]=Ss,0},uo=(pe,Ee,Ce,Ge,ot)=>{if(Ce-Ee>=2&&pe.charCodeAt(Ee)===91&&pe.charCodeAt(Ce-1)===93){let it=-1;for(let at=Ee+1;at<Ce-1;at++)if(pe.charCodeAt(at)===58){it=at;break}return it===-1||it===Ee+1?Vi:Ve(Vn,pe,Ee+1,it,0,on)}if(Ge>=0&&u[Ge]>=0)return u[Ge];for(let it=ot-1;it>=0;it--){const at=rs[it];if(at>Ce)continue;const Ht=Or[it],It=Ce-at;if($[Ht]===1&&It>0&&It<=q){const mn=pe.charCodeAt(at);if(G===!1||mn!==91&&mn!==40){const Es=re(Ht,pe,at,Ce);if(Es>=0)return Es}}const Ze=d[Ht];if(Ze<0)continue;const ut=g[Ze],At=h[ut],tt=h[ut+1];if(At===tt)continue;Ae(pe,at,Ce);const Wn=j[Ze]-At;for(let mn=At;mn<tt;mn++)if(se(m[mn],pe,at,Ce))return y[Wn+mn]}return Vi},li=pe=>{const Ee=pe.length;let Ce=0,Ge=0,ot=!1;(Fe>Tt||jt.size>Tt)&&(jt=new Map,hn=new Map,Fe=2,Bt()),Un>xs&&(Vn=new Map,Un=r,Bt());let it=0;for(;it<Ee;){let Ze=pe.charCodeAt(it);if(Ze===32||Ze>=9&&Ze<=13||Ze>=160&&Re(Ze)){Ze!==32&&(ot=!0),it++;continue}const ut=it;let At=0;for(;it<Ee;){if(Ze=pe.charCodeAt(it),Ze<=32){if(Ze===32)break;if(Ze>=9&&Ze<=13){ot=!0;break}}else if(Ze>=160&&Re(Ze)){ot=!0;break}At=Math.imul(At^Ze,16777619),it++}const tt=it,Wn=tt-ut;Ce===Wt&&ns();const mn=Ce++;Br[mn]=ut,Kn[mn]=tt,Ge+=Wn,At^=Math.imul(Wn,2654435761);const Es=At^At>>>15|0,Dn=Es&8190;{let Ot=-1;if(bs[Dn]===Es&&qn[Dn]!==null&&qn[Dn].length===Wn?Ot=Dn:bs[Dn|1]===Es&&qn[Dn|1]!==null&&qn[Dn|1].length===Wn&&(Ot=Dn|1),Ot>=0){const er=qn[Ot];let Vs=!0;for(let Ts=0;Ts<Wn;Ts++)if(er.charCodeAt(Ts)!==pe.charCodeAt(ut+Ts)){Vs=!1;break}if(Vs){_n[mn]=mt[Ot],cr[mn]=ln[Ot],ur[mn]=Gn[Ot];continue}}}let In=ut;if(te!==0){if(tt-ut<=te||!pe.startsWith(X,ut)){_n[mn]=Vi,On(Dn,pe,ut,tt,Es,Vi,0,0);continue}In=ut+te}let hu=0,yd=0,go=-1,pu=-1;for(let Ot=In;Ot<tt;Ot++){const er=pe.charCodeAt(Ot);if(hu===0&&yd===0){if(er===58){go=Ot;continue}if(er===47){pu=Ot;continue}}er===91?hu++:er===93?hu--:er===40?yd++:er===41&&yd--}const fm=go>=In?go+1:In;let rn=fm,kr=tt,pl=!1,mu=0;kr>rn&&pe.charCodeAt(kr-1)===33?(pl=!0,kr--):kr>rn&&pe.charCodeAt(rn)===33&&(pl=!0,rn++,mu=1);let ls=-1;pu>fm&&(ls=pu+mu,ls>=kr&&(ls=-1));let gu=rn;kr-rn>1&&pe.charCodeAt(rn)===45&&(gu=rn+1);let Cs=0,Fr=0,ml=0,xd=-1,Ns=0;(d[0]>=0||$[0]===1)&&(Or[0]=0,rs[0]=gu,Ns=1);let Pa=cc,bd=0;for(let Ot=gu;Ot<kr;Ot++)if(Ot===ls&&(Pa=Fr<ml?cc:Cs,bd=Ns),Cs!==cc){const er=pe.charCodeAt(Ot);let Vs=-1;if(Fr<ml)l.charCodeAt(Fr)===er?(Fr++,Fr===ml&&(Vs=Cs=xd)):Cs=cc;else{const Ts=s[Cs],Ha=s[Cs+1];let yo=cc;for(let pr=Ts;pr<Ha;pr++){const Fa=i[pr];if(l.charCodeAt(Fa)===er){i[pr+1]-Fa===1?Vs=yo=c[pr]:(Fr=Fa+1,ml=i[pr+1],xd=c[pr],yo=Cs);break}}Cs=yo}if(Vs>=0&&(d[Vs]>=0||$[Vs]===1)&&Ot+1<kr&&pe.charCodeAt(Ot+1)===45){if(Ns===Rr){Rr*=2;const Ts=new Int32Array(Rr);Ts.set(Or),Or=Ts;const Ha=new Int32Array(Rr);Ha.set(rs),rs=Ha}Or[Ns]=Vs,rs[Ns]=Ot+2,Ns++}}ls===kr&&(Pa=Fr<ml?cc:Cs,bd=Ns);const vd=Fr<ml?cc:Cs;let hr,$r=!1;if(ls>=0)if($r=!0,hr=uo(pe,rn,ls,Pa,bd),hr!==Vi&&hr<r&&B[hr]){const Ot=uo(pe,rn,kr,vd,Ns);Ot!==Vi&&Ot!==hr&&(hr=Ot,$r=!1)}else hr===Vi&&(hr=uo(pe,rn,kr,vd,Ns),$r=!1);else hr=uo(pe,rn,kr,vd,Ns);let za=0,Ba=0;hr===Vi?_n[mn]=Vi:(Ba=$r?1:0,za=In>=go?pl?1:0:Ve(jt,pe,In,go,pl?1:0,Ot=>zt(Ot,pl)),_n[mn]=hr,ur[mn]=Ba,cr[mn]=za),On(Dn,pe,ut,tt,Es,hr,za,Ba)}if(Ce===0)return"";if(Ce===1)return Br[0]===0&&Kn[0]===Ee?pe:pe.slice(Br[0],Kn[0]);if(Ce*U>dr){for(;Ce*U>dr;)dr<<=1,Ai--;vs=new Float64Array(dr),cl=new Int32Array(dr)}if(Fe>=ar||Un>=ar)throw new Error("cn: too many distinct classes in one merge");Ss=Ss+1|0,Ss===0&&(oi.fill(0),cl.fill(0),Ss=1);let at=!1;for(let Ze=Ce-1;Ze>=0;Ze--){const ut=_n[Ze];if(ut===Vi){fr[Ze]=1;continue}const At=cr[Ze];if(ul(At,ut)===1){fr[Ze]=0,at=!0;continue}if(fr[Ze]=1,ut<r){const tt=H[ut];if(tt>=0)for(let Wn=R[tt];Wn<R[tt+1];Wn++)ul(At,M[Wn]);if(ur[Ze]&1)for(let Wn=0;Wn<D.length;Wn++)D[Wn]===ut&&ul(At,k[Wn])}}if(!at&&!ot&&Ee===Ge+Ce-1)return pe;let Ht="",It=0;for(;It<Ce;){if(!fr[It]){It++;continue}const Ze=Br[It];let ut=Kn[It],At=It+1;for(;At<Ce&&fr[At]&&Br[At]===ut+1&&pe.charCodeAt(ut)===32;)ut=Kn[At],At++;Ht.length>0&&(Ht+=" "),Ht+=pe.slice(Ze,ut),It=At}return Ht},ss=16384,is=new Int32Array(ss*2);let fo=0,pn=1,nn=Object.create(null),Yn=Object.create(null),Hr=new Map,La=new Map,ho=0,fl=0;const _i=()=>{fo^=ss,pn=pn+1|0,fl=0},po=pe=>{let Ee=nn[pe];if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=Yn[pe],Ee!==void 0)?(nn[pe]=Ee,Ee):(Ee=li(pe),ot?(nn[pe]=Ee,++ho>de&&(ho=0,Yn=nn,nn=Object.create(null),_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},dl=pe=>{let Ee=Hr.get(pe);if(Ee!==void 0)return Ee;const Ce=S0(pe,0,pe.length),Ge=(Ce&16383)+fo,ot=is[Ge]===(Ce^pn)||is[Ge^ss]===(Ce^pn-1);return ot&&(Ee=La.get(pe),Ee!==void 0)?(Hr.set(pe,Ee),Ee):(Ee=li(pe),ot?(Hr.set(pe,Ee),++ho>de&&(ho=0,La=Hr,Hr=new Map,_i())):(is[Ge]=Ce^pn,++fl>ss&&_i()),Ee)},hl=pe=>{const Ee=S0(pe,0,pe.length),Ce=(Ee&16383)+fo;return is[Ce]===(Ee^pn)||is[Ce^ss]===(Ee^pn-1)?!0:(is[Ce]=Ee^pn,++fl>ss&&_i(),!1)},ws=de===0?li:V9?pe=>{const Ee=Hr.get(pe);return Ee!==void 0?Ee:dl(pe)}:po;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?ws(arguments[0]):ws(G9.apply(null,arguments))},mergeString:ws,seenBefore:de===0?()=>!1:hl,mergeUncached:li}},G0=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let n="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const r=e;for(let s=0;s<r.length;s++){const i=r[s];if(!i)continue;const l=typeof i=="string"?i:G0(i,t);l&&(n&&(n+=" "),n+=l)}return n}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(n&&(n+=" "),n+=r)}return n},q9=(e,t)=>{let n="";for(let r=0;r<e.length;r++){const s=e[r];if(!s)continue;const i=typeof s=="string"?s:G0(s,t);i&&(n&&(n+=" "),n+=i)}return n},G9=function(){return q9(arguments,!1)},K9=256,Kk=16,Y9=1024,TS=4096,W9=(e,t)=>{const n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached;let s=new Map,i=new Map,l=0,c=null,u=null,d=[],h=[],m=0;const g=(C,T,N)=>{u===null&&(u=new Array(TS).fill(""),d=new Array(TS).fill(""),h=new Array(TS).fill(""));const R=S0(C,0,C.length)&4094;if(u[R]===C&&d[R]===T)return h[R];if(u[R|1]===C&&d[R|1]===T)return h[R|1];const M=e(N?T+" "+C:C),D=u[R]===""?R:R|(u[R|1]===""?1:m++&1);return u[D]=C,d[D]=T,h[D]=M,M},y=(C,T,N,R)=>{let M=0;if(T){if(T!==C.a0)return!1;M=1}if(N){if(N!==(M===0?C.a0:C.a1))return!1;M++}if(R){if(R!==(M===0?C.a0:M===1?C.a1:C.a2))return!1;M++}return M===C.t},b=(C,T)=>{const N=C.a;let R=0;for(let M=0;M<T.length;M++){const D=T[M];if(D){if(D!==N[R])return!1;R++}}return R===C.t},w=(C,T)=>{const N=C.length,R=c===null?null:c.n;if(!T){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let M="",D=-1,k=0,I=!1;for(let H=0;H<N;H++){let z=C[H];if(z){if(typeof z!="string"){if(z=C[H]=G0(z,!0),!z)continue;I=!0}D<0&&(M=z,D=H),k++}}if(k===0)return"";if(k===1)return e(M);if(I){if(R!==null&&b(R,C))return c=R,R.r;if(c!==null&&c!==R&&b(c,C))return c.r}let _=s.get(M);_===void 0&&(_=i.get(M),_!==void 0&&s.set(M,_));let P=null;if(_!==void 0){if(_.skip>0){_.skip--,c=null;let z=M;for(let U=D+1;U<N;U++){const j=C[U];j&&(z+=" "+j)}return g(z,"",!1)}const H=_.e;e:for(let z=0;z<H.length;z++){const U=H[z];if(U.t!==k)continue;const j=U.a;let B=1;for(let L=D+1;L<N;L++){const $=C[L];if($&&$!==j[B++])continue e}P=U;break}P!==null&&(_.miss=0)}if(P===null){let H=M;const z=[M];for(let j=D+1;j<N;j++){const B=C[j];B&&(H+=" "+B,z.push(B))}if(!n(H))return r(H);P={r:e(H),t:z.length,a0:z[0],a1:z[1],a2:z[2]??"",a:z,n:null},_===void 0?s.set(M,_={e:[],miss:0,skip:0,at:0}):++_.miss>Kk&&(_.miss=Kk,_.skip=Y9,_.e.length=0,_.at=0);const U=_.e;U.length<K9?U.push(P):(U[_.at]=P,_.at=_.at+1&255),++l>1e3&&(l=0,i=s,s=new Map)}return c!==null&&c!==P&&(c.n=P),c=P,P.r},E=C=>Array.isArray(C)?w(C.slice(),!1):e(G0(C,!0));return function(C,T,N){const R=arguments.length;if((R|1)===3){const k=c;if(k!==null){const I=k.n;if(I!==null&&y(I,C,T,N))return c=I,I.r;if(k!==I&&y(k,C,T,N))return k.r}if(R===2&&typeof T=="string"&&T!==""){const I=s.get(C);if(I!==void 0&&I.skip>0)return I.skip--,c=null,g(T,C,!0)}return w([C,T,N],!0)}if(R===1)return typeof C=="string"?e(C):E(C);const M=c;if(M!==null){const k=M.n;if(k!==null){const I=k.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===k.t)return c=k,k.r}if(M!==k){const I=M.a;let _=0,P=!0;for(let H=0;H<R;H++){const z=arguments[H];if(z){if(z!==I[_]){P=!1;break}_++}}if(P&&_===M.t)return M.r}}const D=[];for(let k=0;k<R;k++)D.push(arguments[k]);return w(D,!0)}},Yk=U9($9),Ne=W9(Yk.mergeString,Yk),X9=v9("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 nt({className:e,variant:t="default",size:n="default",children:r,...s}){return x.jsx(x9,{"data-slot":"button",className:Ne(X9({variant:t,size:n,className:e})),...s,children:typeof r=="string"?x.jsx("span",{className:"text-box-cap",children:r}):r})}const Q9=({logoSrc:e,name:t})=>x.jsx("img",{src:e,alt:t,width:"32",height:"32",className:"size-8"}),Z9={column:"max-w-5xl px-4 sm:px-6",full:"px-6"},J9=({brand:e,width:t="column",children:n})=>x.jsx("header",{className:"sticky top-0 z-40 bg-sign text-sign-foreground",children:x.jsxs("div",{className:Ne("mx-auto flex h-14 w-full items-center justify-between gap-6",Z9[t]),children:[e,n]})}),e7="/logo-small.png",t7="Flight Plan",n7="Settings",r7="/setup/",s7="mx-auto max-w-5xl px-4 pt-8 pb-16 sm:px-6",i7="The backend did not say what went wrong.",o7=()=>{const[e,t]=O.useState(null),n=Fk({select:s=>s.some(i=>i.staticData.isFullWidth===!0)}),r=Fk({select:s=>s.some(i=>i.routeId===r7)});return x.jsx(Qj,{value:e,children:x.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[x.jsxs(J9,{width:n?"full":"column",brand:x.jsx(Ff,{to:"/",className:"shrink-0 rounded-sm",children:x.jsx(Q9,{logoSrc:e7,name:t7})}),children:[x.jsx("div",{ref:t,className:"flex min-w-0 flex-1 items-center border-l border-sign-foreground/20 pl-6 empty:hidden"}),r?null:x.jsx(Ff,{to:"/settings",className:"shrink-0 rounded-sm text-sm text-sign-muted hover:text-sign-foreground",children:n7})]}),x.jsx("main",{className:Ne("w-full",n?"":s7),children:x.jsx(Wj,{})})]})})},l7=()=>x.jsxs("section",{className:"max-w-prose",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"This page does not exist"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:"The address does not match any page of Flight Plan."}),x.jsx(Ff,{to:"/",className:"mt-4 inline-block underline",children:"Go to your repositories"})]}),a7=({error:e})=>{const t=gs();return x.jsxs("main",{role:"alert",className:"mx-auto min-h-screen max-w-prose bg-background px-4 pt-16 text-foreground",children:[x.jsx("h1",{className:"text-2xl font-bold tracking-[-0.01em]",children:"Flight Plan could not start"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:i7}),x.jsx(nt,{className:"mt-4",onClick:()=>{t.invalidate()},children:"Try again"})]})},nu=OU()({beforeLoad:async({context:{queryClient:e,trpc:t},location:n})=>{const r=await e.query({...t.setup.gate.queryOptions({path:n.pathname}),staleTime:"static"});r.redirectTo!==null&&kE({to:r.redirectTo,throw:!0})},component:o7,notFoundComponent:l7,errorComponent:a7}),c7="modulepreload",u7=function(e){return"/"+e},Wk={},$t=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(d=>{if(d=u7(d),d in Wk)return;Wk[d]=!0;const h=d.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":c7,h||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),h)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},f7=[{id:"first",stopWidths:["w-3/5","w-2/5","w-1/2"]},{id:"second",stopWidths:["w-2/5","w-3/5"]}],d7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading your repositories"}),x.jsxs("div",{"aria-hidden":"true",className:"motion-safe:animate-pulse",children:[x.jsx("div",{className:"mb-6 h-9 w-48 rounded-sm bg-muted"}),f7.map(e=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] border-t-2 border-foreground pt-5 pb-6",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-7 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsxs("div",{className:"flex flex-col gap-4 pb-1",children:[x.jsx("span",{className:"h-6 w-40 rounded-sm bg-muted"}),e.stopWidths.map(t=>x.jsx("span",{className:`h-5 rounded-sm bg-muted ${t}`},t))]})]},e.id))]})]}),h7=()=>$t(()=>import("./index-s14Wy6CE.js"),__vite__mapDeps([0,1])),p7=()=>$t(()=>import("./index-zxLaxo8R.js"),__vite__mapDeps([2,1,3,4,5])),Xk=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,m7=ys()({validateSearch:e=>({status:Xk(e.status),author:Xk(e.author),fixtureCase:typeof e.fixtureCase=="string"?e.fixtureCase:void 0}),loaderDeps:({search:e})=>({statuses:e.status??null,authors:e.author??null,fixtureCase:e.fixtureCase}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.repository.list.queryOptions(n),staleTime:"static"})},component:fn(p7,"component"),pendingComponent:d7,errorComponent:fn(h7,"errorComponent")}),g7=()=>$t(()=>import("./route-X94hglR1.js"),[]),y7=ys()({component:fn(g7,"component")}),x7=ys()({beforeLoad:()=>{kE({to:"/settings/agents",throw:!0})}}),b7={section:"agents"},v7=["w-2/5","w-3/5","w-1/2"],ru=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the settings"}),x.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-4 motion-safe:animate-pulse",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),v7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]}),S7=()=>$t(()=>import("./agents-BGNiGYQQ.js"),__vite__mapDeps([6,7])),w7=()=>$t(()=>import("./agents-DBPulyWi.js"),__vite__mapDeps([8,9,10,4,11])),E7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(b7),staleTime:"static"})},component:fn(w7,"component"),pendingComponent:ru,errorComponent:fn(S7,"errorComponent")}),C7={section:"configuration"},N7=()=>$t(()=>import("./configuration-C8ZTSPna.js"),__vite__mapDeps([12,7])),T7=()=>$t(()=>import("./configuration-DBU-Fvop.js"),__vite__mapDeps([13,9,14,11])),R7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(C7),staleTime:"static"})},component:fn(T7,"component"),pendingComponent:ru,errorComponent:fn(N7,"errorComponent")}),O7={section:"forges"},k7=()=>$t(()=>import("./forges-DwSiwqas.js"),__vite__mapDeps([15,7])),M7=()=>$t(()=>import("./forges-BOWrvfZl.js"),__vite__mapDeps([16,9,17,11])),A7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(O7),staleTime:"static"})},component:fn(M7,"component"),pendingComponent:ru,errorComponent:fn(k7,"errorComponent")}),_7={section:"repositories"},D7=()=>$t(()=>import("./repositories-BLLfYDjf.js"),__vite__mapDeps([18,7])),I7=()=>$t(()=>import("./repositories-of9BXUjW.js"),__vite__mapDeps([19,3,4,5,11])),j7=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(_7),staleTime:"static"})},component:fn(I7,"component"),pendingComponent:ru,errorComponent:fn(D7,"errorComponent")}),L7=["first","second","third","fourth"],P7=["w-2/5","w-3/5","w-1/2"],z7=()=>x.jsxs("div",{role:"status","aria-busy":"true",children:[x.jsx("span",{className:"sr-only",children:"Loading the setup"}),x.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:[x.jsx("span",{className:"h-9 w-64 rounded-sm bg-muted lg:col-span-2"}),x.jsx("div",{children:L7.map(e=>x.jsxs("div",{className:"grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[x.jsxs("span",{className:"flex flex-col items-center",children:[x.jsx("span",{className:"size-5 rounded-full bg-muted"}),x.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),x.jsx("span",{className:"h-5 w-32 rounded-sm bg-muted"})]},e))}),x.jsxs("div",{className:"flex flex-col gap-4",children:[x.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),x.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),P7.map(e=>x.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]})]}),B7=()=>$t(()=>import("./index-DyfuBbIJ.js"),__vite__mapDeps([20,21])),H7=()=>$t(()=>import("./index-CSoB1eP_.js"),__vite__mapDeps([22,21,3,4,10,14,17])),F7=ys()({validateSearch:e=>({step:typeof e.step=="string"?e.step:void 0}),loaderDeps:({search:e})=>({step:e.step??null}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.setup.get.queryOptions(n),staleTime:"static"})},component:fn(H7,"component"),pendingComponent:z7,errorComponent:fn(B7,"errorComponent")}),$7=e=>({artifactUrl:e.artifact,repositoryName:e.repository,targetId:e.target}),V7=()=>$t(()=>import("./download-BnmEn_Ca.js"),[]),RS=e=>typeof e=="string"?e:"",U7=ys()({validateSearch:e=>({artifact:RS(e.artifact),repository:RS(e.repository),target:RS(e.target)}),loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},deps:n})=>{const r=$7(n),s=await e.query({...t.review.importForm.queryOptions(r),staleTime:"static"});if(!s.startsAtOnce)return{importId:s.isImporting?s.importId:null,refusal:null};const i=await e.getMutationCache().build(e,t.review.import.mutationOptions()).execute(r);return await e.invalidateQueries(t.review.importForm.pathFilter()),{importId:i.importId,refusal:i.importId===null?i.message:null}},component:fn(V7,"component")}),Ui="rounded-sm bg-muted motion-safe:animate-pulse",q7=()=>x.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:[x.jsx("div",{className:"col-span-2 border-b pb-3",children:x.jsx("div",{className:`h-5 w-64 ${Ui}`})}),x.jsxs("div",{className:"flex flex-col gap-4 pt-6",children:[x.jsx("div",{className:`h-5 w-28 ${Ui}`}),x.jsx("div",{className:`h-5 w-40 ${Ui}`}),x.jsx("div",{className:`h-5 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-36 ${Ui}`})]}),x.jsxs("div",{className:"flex flex-col gap-3 pt-6",children:[x.jsx("div",{className:`h-6 w-32 ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[70ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[64ch] ${Ui}`}),x.jsx("div",{className:`h-5 w-full max-w-[52ch] ${Ui}`}),x.jsx("div",{className:`mt-8 h-64 w-full ${Ui}`})]})]});var Bs=dj();const ube=bE(Bs),fL=()=>"Notification"in window,Q1=()=>{fL()&&Notification.permission==="default"&&Notification.requestPermission()};function ad(e){const t={subscribe(n){let r=null,s=!1,i=!1,l=!1;function c(){if(r===null){l=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(u){var d;s||(d=n.next)===null||d===void 0||d.call(n,u)},error(u){var d;s||(s=!0,(d=n.error)===null||d===void 0||d.call(n,u),c())},complete(){var u;s||(s=!0,(u=n.complete)===null||u===void 0||u.call(n),c())}}),l&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(G7,t)}};return t}function G7(e,t){return t(e)}function K7(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function i(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const l=e.subscribe({next(c){s=!0,n(c),i()},error(c){r(c)},complete(){t.abort(),i()}})})}function Y7(e){return t=>{let n=0,r=null;const s=[];function i(){r||(r=t.subscribe({next(c){for(const d of s){var u;(u=d.next)===null||u===void 0||u.call(d,c)}},error(c){for(const d of s){var u;(u=d.error)===null||u===void 0||u.call(d,c)}},complete(){for(const u of s){var c;(c=u.complete)===null||c===void 0||c.call(u)}}}))}function l(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return ad(c=>(n++,s.push(c),i(),{unsubscribe(){n--,l();const u=s.findIndex(d=>d===c);u>-1&&s.splice(u,1)}}))}}function dL(e){let t=e;const n=[],r=l=>{t!==void 0&&l.next(t),n.push(l)},s=l=>{n.splice(n.indexOf(l),1)},i=ad(l=>(r(l),()=>{s(l)}));return i.next=l=>{if(t!==l){t=l;for(const c of n)c.next(l)}},i.get=()=>t,i}function hL(e){return ad(t=>{function n(r=0,s=e.op){const i=e.links[r];if(!i)throw new Error("No more links to execute - did you forget to add an ending link?");return i({op:s,next(l){return n(r+1,l)}})}return n().subscribe(t)})}function Qk(e){return Array.isArray(e)?e:[e]}function W7(e){return t=>{const n=Qk(e.true).map(s=>s(t)),r=Qk(e.false).map(s=>s(t));return s=>ad(i=>{const l=e.condition(s.op)?n:r;return hL({op:s.op,links:l}).subscribe(i)})}}function Jh(e){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jh(e)}function X7(e,t){if(Jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q7(e){var t=X7(e,"string");return Jh(t)=="symbol"?t:t+""}function Ir(e,t,n){return(t=Q7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){Ir(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ca(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Z7(e){return typeof e=="function"}function pL(){return Object.create(null)}const J7=typeof Symbol=="function"&&!!Symbol.asyncIterator;function eq(e){return J7&&Ca(e)&&Symbol.asyncIterator in e}const KE=e=>e(),Pg={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},tq=[Pg.BAD_GATEWAY,Pg.SERVICE_UNAVAILABLE,Pg.GATEWAY_TIMEOUT,Pg.INTERNAL_SERVER_ERROR],mL=()=>{},Jk=e=>{Object.freeze&&Object.freeze(e)};function gL(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(mL,{get(i,l){if(!(typeof l!="string"||l==="then"))return gL(e,[...t,l],n)},apply(i,l,c){const u=t[t.length-1];if(u==="valueOf"||u==="toString"||u==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let d={args:c,path:t};return u==="call"?d={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(d={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),Jk(d.args),Jk(d.path),e(d)}})),n[s]}const yL=e=>gL(e,[],pL()),nq=e=>new Proxy(mL,{get(t,n){if(n!=="then")return e(n)}});function ep(e){"@babel/helpers - typeof";return ep=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ep(e)}function rq(e,t){if(ep(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sq(e){var t=rq(e,"string");return ep(t)=="symbol"?t:t+""}function yc(e,t,n){return(t=sq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var iq=class extends Error{constructor(e){super(oq(e)),Object.assign(this,e)}};function oq(e){if("message"in e)return String(e.message)}function lq(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(Ca(e))return new iq(e)}}var tM=class extends Error{constructor(e){var t,n,r;const s=lq(e.cause),i=(t=(n=e.message)!==null&&n!==void 0?n:s==null?void 0:s.message)!==null&&t!==void 0?t:e.code;super(i,{cause:s}),yc(this,"cause",void 0),yc(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function aq(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:zg(zg({},e),{},{error:n})}}return{ok:!0,result:zg(zg({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var OS=class extends Error{constructor(){super("Unable to transform response from server")}};function cq(e,t){let n;try{n=aq(e,t)}catch{throw new OS}if(!n.ok&&(!Ca(n.error.error)||typeof n.error.error.code!="number"))throw new OS;if(n.ok&&!Ca(n.result))throw new OS;return n}function uq(e){return typeof e=="function"}async function fq(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(i=>t===i||t.startsWith(i+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function dq(e){const{type:t,path:n}=e,r=await fq(e.router,n);if(!r||!uq(r)||r._def.type!==t&&!e.allowMethodOverride)throw new tM({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});/* istanbul ignore if -- @preserve */if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new tM({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}let xL;const kS=new WeakMap,hq=()=>{};xL=Symbol.toStringTag;var bL=class dc{constructor(t){yc(this,"promise",void 0),yc(this,"subscribers",[]),yc(this,"settlement",null),yc(this,xL,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const n=this.promise.then(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:r},s==null||s.forEach(({resolve:i})=>{i(r)})});"catch"in n&&n.catch(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"rejected",reason:r},s==null||s.forEach(({reject:i})=>{i(r)})})}subscribe(){let t,n;const{settlement:r}=this;if(r===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const s=mq();this.subscribers=gq(this.subscribers,s),t=s.promise,n=()=>{this.subscribers!==null&&(this.subscribers=xq(this.subscribers,s))}}else{const{status:s}=r;s==="fulfilled"?t=Promise.resolve(r.value):t=Promise.reject(r.reason),n=hq}return Object.assign(t,{unsubscribe:n})}then(t,n){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.then(t,n),{unsubscribe:s})}catch(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.catch(t),{unsubscribe:r})}finally(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.finally(t),{unsubscribe:r})}static proxy(t){const n=dc.getSubscribablePromise(t);return typeof n<"u"?n:dc.createSubscribablePromise(t)}static createSubscribablePromise(t){const n=new dc(t);return kS.set(t,n),kS.set(n,n),n}static getSubscribablePromise(t){return kS.get(t)}static resolve(t){const n=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return dc.proxy(n).subscribe()}static async any(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async race(t){const n=(Array.isArray(t)?t:[...t]).map(dc.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async raceReferences(t){const n=t.map(pq);try{return await Promise.race(n)}finally{for(const r of n)r.unsubscribe()}}};function pq(e){return bL.proxy(e).then(()=>[e])}function mq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function gq(e,t){return[...e,t]}function yq(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xq(e,t){const n=e.indexOf(t);return n!==-1?yq(e,n):e}var nM,rM,sM,iM;(rM=(nM=Symbol).dispose)!==null&&rM!==void 0||(nM.dispose=Symbol());(iM=(sM=Symbol).asyncDispose)!==null&&iM!==void 0||(sM.asyncDispose=Symbol());function bq(e,t){const n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r==null||r.call(n)},n}function vq(e,t){const n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await(r==null?void 0:r.call(n))},n}const vL=Symbol();function Sq(e){let t=null;return bq({start(){if(t)throw new Error("Timer already started");return new Promise(n=>{t=setTimeout(()=>n(vL),e)})}},()=>{t&&clearTimeout(t)})}function SL(){var e=typeof SuppressedError=="function"?SuppressedError:function(s,i){var l=Error();return l.name="SuppressedError",l.error=s,l.suppressed=i,l},t={},n=[];function r(s,i){if(i!=null){if(Object(i)!==i)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var l=i[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=i[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var c=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");c&&(l=function(){try{c.call(i)}catch(d){return Promise.reject(d)}}),n.push({v:i,d:l,a:s})}else s&&n.push({d:i,a:s});return i}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var i,l=this.e,c=0;function u(){for(;i=n.pop();)try{if(!i.a&&c===1)return c=0,n.push(i),Promise.resolve().then(u);if(i.d){var h=i.d.call(i.v);if(i.a)return c|=2,Promise.resolve(h).then(u,d)}else c|=1}catch(m){return d(m)}if(c===1)return l!==t?Promise.reject(l):Promise.resolve();if(l!==t)throw l}function d(h){return l=l!==t?new e(h,l):h,u()}return u()}}}function wL(e,t){this.v=e,this.k=t}function oM(e){return new wL(e,0)}function wq(e){return function(){return new Ch(e.apply(this,arguments))}}function Ch(e){var t,n;function r(i,l){try{var c=e[i](l),u=c.value,d=u instanceof wL;Promise.resolve(d?u.v:u).then(function(h){if(d){var m=i==="return"?"return":"next";if(!u.k||h.done)return r(m,h);h=e[m](h).value}s(c.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}function s(i,l){switch(i){case"return":t.resolve({value:l,done:!0});break;case"throw":t.reject(l);break;default:t.resolve({value:l,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(i,l){return new Promise(function(c,u){var d={key:i,arg:l,resolve:c,reject:u,next:null};n?n=n.next=d:(t=n=d,r(i,l))})},typeof e.return!="function"&&(this.return=void 0)}Ch.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ch.prototype.next=function(e){return this._invoke("next",e)},Ch.prototype.throw=function(e){return this._invoke("throw",e)},Ch.prototype.return=function(e){return this._invoke("return",e)};const Eq="ping",Cq="serialized-error",Nq="connected",Tq="return";async function Rq(e){try{var t=SL();const n=t.u(Sq(e.timeoutMs)),r=await bL.race([e.promise,n.start()]);return r===vL?await e.onTimeout():r}catch(n){t.e=n}finally{t.d()}}function Oq(e){const{deserialize:t=c=>c}=e;let n=pL();const r=e.signal;let s=null;const i=()=>new ReadableStream({async start(c){const[u,d]=await Promise.all([e.url(),e.init()]),h=s=new e.EventSource(u,d);c.enqueue({type:"connecting",eventSource:s,event:null}),h.addEventListener(Nq,g=>{const y=JSON.parse(g.data);n=y,c.enqueue({type:"connected",options:y,eventSource:h})}),h.addEventListener(Cq,g=>{const y=g;c.enqueue({type:"serialized-error",error:t(JSON.parse(y.data)),eventSource:h})}),h.addEventListener(Eq,()=>{c.enqueue({type:"ping",eventSource:h})}),h.addEventListener(Tq,()=>{h.close(),c.close(),s=null}),h.addEventListener("error",g=>{h.readyState===h.CLOSED?c.error(g):c.enqueue({type:"connecting",eventSource:h,event:g})}),h.addEventListener("message",g=>{const y=g,b={data:t(JSON.parse(y.data))};y.lastEventId&&(b.id=y.lastEventId),c.enqueue({type:"data",data:b,eventSource:h})});const m=()=>{try{h.close(),c.close()}catch{}};r.aborted?m():r.addEventListener("abort",m)},cancel(){s==null||s.close()}}),l=()=>{let c=i(),u=c.getReader();async function d(){await u.cancel(),s=null}return vq({read(){return u.read()},async recreate(){await d(),c=i(),u=c.getReader()}},d)};return KE(wq(function*(){try{var c=SL();const u=c.a(l());for(;;){let d=u.read();const h=n.reconnectAfterInactivityMs;h&&(d=Rq({promise:d,timeoutMs:h,onTimeout:async()=>{const g={value:{type:"timeout",ms:h,eventSource:s},done:!1};return await u.recreate(),g}}));const m=yield oM(d);if(m.done)return m.value;yield m.value}}catch(u){c.e=u}finally{yield oM(c.d())}}))}function kq(e){return e instanceof la}function Mq(e){return Ca(e)&&Ca(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Aq(e,t){return typeof e=="string"?e:Ca(e)&&typeof e.message=="string"?e.message:t}var la=class w0 extends Error{constructor(t,n){var r,s;const i=n==null?void 0:n.cause;super(t,{cause:i}),Ir(this,"cause",void 0),Ir(this,"shape",void 0),Ir(this,"data",void 0),Ir(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,w0.prototype)}static from(t,n={}){const r=t;return kq(r)?(n.meta&&(r.meta=An(An({},r.meta),n.meta)),r):Mq(r)?new w0(r.error.message,An(An({},n),{},{result:r,cause:n.cause})):new w0(Aq(r,"Unknown error"),An(An({},n),{},{cause:r}))}};function EL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const lM=e=>typeof e=="function";function _q(e){if(e)return e;if(typeof window<"u"&&lM(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&lM(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function Dq(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const i of e)i!=null&&i.aborted?s():i==null||i.addEventListener("abort",s,{once:!0});return t.signal}function CL(...e){const t=new AbortController;for(const n of e)n!=null&&n.aborted?t.abort():n==null||n.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function Iq(e){return{url:e.url.toString(),fetch:e.fetch,transformer:EL(e.transformer),methodOverride:e.methodOverride}}function jq(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const Lq={query:"GET",mutation:"POST",subscription:"PATCH"};function NL(e){return"input"in e?e.transformer.input.serialize(e.input):jq(e.inputs.map(t=>e.transformer.input.serialize(t)))}const YE=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=NL(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},Pq=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=NL(e);return t!==void 0?JSON.stringify(t):void 0},zq=e=>$q(An(An({},e),{},{contentTypeHeader:"application/json",getUrl:YE,getBody:Pq}));var Bq=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Hq=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Bq};async function Fq(e){var t,n;Hq(e.signal);const r=e.getUrl(e),s=e.getBody(e),i=(t=e.methodOverride)!==null&&t!==void 0?t:Lq[e.type],l=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),c=An(An(An({},e.contentTypeHeader&&i!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),l);return _q(e.fetch)(r,{method:i,signal:e.signal,body:s,headers:c})}async function $q(e){const t={},n=await Fq(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const aM=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function cM(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const u=[[]];let d=0;for(;;){const g=c[d];if(!g)break;const y=u[u.length-1];if(g.aborted){var h;(h=g.reject)===null||h===void 0||h.call(g,new Error("Aborted")),d++;continue}if(e.validate(y.concat(g).map(b=>b.key))){y.push(g),d++;continue}if(y.length===0){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Input is too big for a single dispatch")),d++;continue}u.push([])}return u}function i(){const c=s(t);r();for(const u of c){if(!u.length)continue;const d={items:u};for(const h of u)h.batch=d;e.fetch(d.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(g,y)=>{const b=d.items[y];try{var w;const C=await Promise.resolve(g);(w=b.resolve)===null||w===void 0||w.call(b,C)}catch(C){var E;(E=b.reject)===null||E===void 0||E.call(b,C)}b.batch=null,b.reject=null,b.resolve=null}));for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,new Error("Missing result")),g.batch=null}}).catch(h=>{for(const g of d.items){var m;(m=g.reject)===null||m===void 0||m.call(g,h),g.batch=null}})}}function l(c){var u;const d={aborted:!1,key:c,batch:null,resolve:aM,reject:aM},h=new Promise((m,g)=>{var y;d.reject=g,d.resolve=m,(y=t)!==null&&y!==void 0||(t=[]),t.push(d)});return(u=n)!==null&&u!==void 0||(n=setTimeout(i)),h}return{load:l}}function Vq(e){var t,n;const r=Iq(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const l=u=>({validate(d){if(s===1/0&&i===1/0)return!0;if(d.length>i)return!1;const h=d.map(g=>g.path).join(","),m=d.map(g=>g.input);return YE(An(An({},r),{},{type:u,path:h,inputs:m,signal:null})).length<=s},async fetch(d){const h=d.map(b=>b.path).join(","),m=d.map(b=>b.input),g=Dq(...d.map(b=>b.signal)),y=await zq(An(An({},r),{},{path:h,inputs:m,type:u,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:g}));return(Array.isArray(y.json)?y.json:d.map(()=>y.json)).map(b=>({meta:y.meta,json:b}))}}),c={query:cM(l("query")),mutation:cM(l("mutation"))};return({op:u})=>ad(d=>{/* istanbul ignore if -- @preserve */if(u.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=new AbortController,m=c[u.type].load(An(An({},u),{},{signal:CL(u.signal,h.signal)}));let g=!1,y;return m.then(b=>{g=!0,y=b;const w=cq(b.json,r.transformer.output);if(!w.ok){d.error(la.from(w.error,{meta:b.meta}));return}d.next({context:b.meta,result:w.result}),d.complete()}).catch(b=>{g=!0,d.error(la.from(b,{meta:y==null?void 0:y.meta}))}),()=>{g||h.abort()}})}}const tp=(e,...t)=>typeof e=="function"?e(...t):e;function Uq(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function qq(e){const t=await tp(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Gq(e,t){const n={method:"connectionParams",data:await tp(e)};return t.encode(n)}function Kq(e){const{promise:t,resolve:n,reject:r}=Uq();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function Yq(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function i(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function l(){clearTimeout(r),i()}function c(){clearTimeout(s),l()}e.addEventListener("open",i),e.addEventListener("message",({data:u})=>{clearTimeout(r),i(),u==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var Wq=class Z1{constructor(t){var n;if(Ir(this,"id",++Z1.connectCount),Ir(this,"WebSocketPonyfill",void 0),Ir(this,"urlOptions",void 0),Ir(this,"keepAliveOpts",void 0),Ir(this,"encoder",void 0),Ir(this,"wsObservable",dL(null)),Ir(this,"openPromise",null),this.WebSocketPonyfill=(n=t.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=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}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=++Z1.connectCount;const t=qq(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Yq(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Kq(n),this.urlOptions.connectionParams&&n.send(await Gq(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};Ir(Wq,"connectCount",0);var TL=class{constructor(e){Ir(this,"links",void 0),Ir(this,"runtime",void 0),Ir(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return hL({links:this.links,op:An(An({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Y7())}async requestAsPromise(e){try{const t=this.$request(e);return(await K7(t)).result.data}catch(t){throw la.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var i;(i=n.onStarted)===null||i===void 0||i.call(n,{context:r.context});break;case"stopped":var l;(l=n.onStopped)===null||l===void 0||l.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const RL=Symbol.for("trpc_untypedClient"),Xq={query:"query",mutate:"mutation",subscribe:"subscription"},Qq=e=>Xq[e];function Zq(e){const t=yL(({path:n,args:r})=>{const s=[...n],i=Qq(s.pop()),l=s.join(".");return e[i](l,...r)});return nq(n=>n===RL?e:t[n])}function Jq(e){return Zq(new TL(e))}function eG(e){return e[RL]}function tG(e,t){return!t||e!=null&&typeof e!="object"?e:An(An({},e??{}),{},{lastEventId:t})}function nG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new E0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function E0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return E0=function(r){this.s=r,this.n=r.next},E0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new E0(e)}async function rG(e){let t=await tp(e.url);if(e.connectionParams){const n=await tp(e.connectionParams),r=t.includes("?")?"&":"?";t+=r+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return t}function sG(e){const t=EL(e.transformer);return()=>({op:n})=>ad(r=>{var s;const{type:i,path:l,input:c}=n;/* istanbul ignore if -- @preserve */if(i!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let u;const d=new AbortController,h=CL(n.signal,d.signal),m=Oq({url:async()=>YE({transformer:t,url:await rG(e),input:tG(c,u),path:l,type:i,signal:null}),init:()=>tp(e.eventSourceOptions,{op:n}),signal:h,deserialize:b=>t.output.deserialize(b),EventSource:(s=e.EventSource)!==null&&s!==void 0?s:globalThis.EventSource}),g=dL({type:"state",state:"connecting",error:null}),y=g.subscribe({next(b){r.next({result:b})}});return KE(async()=>{var b=!1,w=!1,E;try{for(var C=nG(m),T;b=!(T=await C.next()).done;b=!1){const N=T.value;switch(N.type){case"ping":break;case"data":const R=N.data;let M;R.id?(u=R.id,M={id:R.id,data:R}):M={data:R.data},r.next({result:M,context:{eventSource:N.eventSource}});break;case"connected":r.next({result:{type:"started"},context:{eventSource:N.eventSource}}),g.next({type:"state",state:"pending",error:null});break;case"serialized-error":{const D=la.from({error:N.error});if(tq.includes(N.error.code)){g.next({type:"state",state:"connecting",error:D});break}throw D}case"connecting":{const D=g.get(),k=N.event&&la.from(N.event);if(!k&&D.state==="connecting")break;g.next({type:"state",state:"connecting",error:k});break}case"timeout":g.next({type:"state",state:"connecting",error:new la(`Timeout of ${N.ms}ms reached while waiting for a response`)})}}}catch(N){w=!0,E=N}finally{try{b&&C.return!=null&&await C.return()}finally{if(w)throw E}}r.next({result:{type:"stopped"}}),g.next({type:"state",state:"idle",error:null}),r.complete()}).catch(b=>{r.error(la.from(b))}),()=>{r.complete(),d.abort(),y.unsubscribe()}})}function np(e){"@babel/helpers - typeof";return np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},np(e)}function iG(e,t){if(np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oG(e){var t=iG(e,"string");return np(t)=="symbol"?t:t+""}function lG(e,t,n){return(t=oG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(n),!0).forEach(function(r){lG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aG(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new C0(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function C0(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return C0=function(r){this.s=r,this.n=r.next},C0.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new C0(e)}function cG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function uG(e,t){if(e==null)return{};var n,r,s=cG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const fG=["cursor","direction"];function Vy(e){return{path:e.path.join(".")}}function dG(e){return e.length>=3}function hG(e){return dG(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function WE(e,t,n){var r;const s=hG(e);let i=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var l,c;i=wt(wt(wt({},(l=(c=s.args)===null||c===void 0?void 0:c.input)!==null&&l!==void 0?l:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.path.join("."),i,t==null?void 0:t.trpc]}async function pG(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var i=!1,l=!1,c;try{for(var u=aG(e),d;i=!(d=await u.next()).done;i=!1){const h=d.value;s.push(h),r.setState({data:[...s]})}}catch(h){l=!0,c=h}finally{try{i&&u.return!=null&&await u.return()}finally{if(l)throw c}}return s}function Mo(e){const t=KE(()=>{const{input:n,type:r}=e,s=e.path.flatMap(i=>i.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&Ca(n)&&("direction"in n||"cursor"in n)){const{cursor:i,direction:l}=n;return[s,{input:uG(n,fG),type:"infinite"}]}return[s,wt(wt({},typeof n<"u"&&n!==ri&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function OL(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function XE(e){return Z7(e)?e():e}function mG(e){var t;const{input:n,query:r,path:s,queryKey:i,opts:l}=e,c=n===ri,u=async d=>{var h;const m=wt(wt({},l),{},{trpc:wt(wt({},l==null?void 0:l.trpc),!(l==null||(h=l.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})});return await r(...WE(i,m,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign(wt(wt({},l??{}),{},{queryKey:i,queryFn:c?ri:u,initialPageParam:(t=l==null?void 0:l.initialCursor)!==null&&t!==void 0?t:n==null?void 0:n.cursor}),{trpc:Vy({path:s})})}function gG(e){var t,n;const{mutate:r,path:s,prefix:i,opts:l,overrides:c}=e,u=XE(e.queryClient),d=OL({path:s,prefix:(t=l==null?void 0:l.keyPrefix)!==null&&t!==void 0?t:i}),h=u.defaultMutationOptions(u.getMutationDefaults(d)),m=(n=c==null?void 0:c.onSuccess)!==null&&n!==void 0?n:(y=>y.originalFn()),g=async y=>await r(...WE([...d,{input:y}],l));return wt(wt({},l),{},{mutationKey:d,mutationFn:g,onSuccess(...y){var b,w;return m({originalFn:()=>{var C,T,N;return(C=l==null||(T=l.onSuccess)===null||T===void 0?void 0:T.call(l,...y))!==null&&C!==void 0?C:h==null||(N=h.onSuccess)===null||N===void 0?void 0:N.call(h,...y)},queryClient:u,meta:(b=(w=l==null?void 0:l.meta)!==null&&w!==void 0?w:h==null?void 0:h.meta)!==null&&b!==void 0?b:{}})},trpc:Vy({path:s})})}function yG(e){const{input:t,query:n,path:r,queryKey:s,opts:i}=e,l=XE(e.queryClient),c=t===ri,u=async d=>{var h;const m=wt(wt({},i),{},{trpc:wt(wt({},i==null?void 0:i.trpc),!(i==null||(h=i.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:d.signal}:{signal:null})}),g=d.queryKey,y=await n(...WE(g,m));return eq(y)?pG(y,l,g):y};return Object.assign(wt(wt({},i),{},{queryKey:s,queryFn:c?ri:u}),{trpc:Vy({path:r})})}const xG=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:i={}}=e,l="enabled"in i?!!i.enabled:s!==ri,c=u=>t(n.join("."),s===ri?void 0:s,u);return wt(wt({},i),{},{enabled:l,subscribe:c,queryKey:r,trpc:Vy({path:n})})};function bG(e){const t=O.useRef(e);t.current=e;const n=O.useRef(new Set([])),r=O.useCallback(m=>{n.current.add(m)},[]),s=O.useRef(()=>{}),i=O.useCallback(()=>{var m;if((m=s.current)===null||m===void 0||m.call(s),h(l),!e.enabled)return;const g=e.subscribe({onStarted:()=>{var y,b;(y=(b=t.current).onStarted)===null||y===void 0||y.call(b),h(w=>wt(wt({},w),{},{status:"pending",error:null}))},onData:y=>{var b,w;(b=(w=t.current).onData)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"pending",data:y,error:null}))},onError:y=>{var b,w;(b=(w=t.current).onError)===null||b===void 0||b.call(w,y),h(E=>wt(wt({},E),{},{status:"error",error:y}))},onConnectionStateChange:y=>{var b,w;(b=(w=t.current).onConnectionStateChange)===null||b===void 0||b.call(w,y),h(E=>{switch(y.state){case"connecting":return wt(wt({},E),{},{status:"connecting",error:y.error});case"pending":return E;case"idle":return wt(wt({},E),{},{status:"idle",data:void 0,error:null})}})}});s.current=()=>{g.unsubscribe()}},[va(e.queryKey),e.enabled]),l=O.useCallback(()=>e.enabled?{data:void 0,error:null,status:"connecting",reset:i}:{data:void 0,error:null,status:"idle",reset:i},[e.enabled,i]),c=O.useRef(l()),[u,d]=O.useState(fM(c,r));u.reset=i;const h=O.useCallback(m=>{const g=c.current,y=c.current=m(g);let b=!1;for(const w of n.current)if(g[w]!==y[w]){b=!0;break}b&&d(fM(c,r))},[r]);return O.useEffect(()=>{if(e.enabled)return i(),()=>{var m;(m=s.current)===null||m===void 0||m.call(s)}},[i,e.enabled]),u}function fM(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function kL(e){const t=e.keyPrefix,n=r=>(s,i,l)=>"router"in e?Promise.resolve(XE(e.ctx)).then(c=>dq({router:e.router,path:s,getRawInput:async()=>i,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof TL?e.client:eG(e.client))[r](s,i,l);return yL(({args:r,path:s})=>{const i=[...s],l=i.pop(),[c,u]=r;return{"~types":void 0,pathKey:()=>Mo({path:i,type:"any",prefix:t}),pathFilter:()=>wt(wt({},c),{},{queryKey:Mo({path:i,type:"any",prefix:t})}),queryOptions:()=>yG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>Mo({path:i,input:c,type:"query",prefix:t}),queryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>mG({input:c,opts:u,path:i,queryClient:e.queryClient,queryKey:Mo({path:i,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>Mo({path:i,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>wt(wt({},u),{},{queryKey:Mo({path:i,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var d;return gG({opts:c,path:i,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(d=e.overrides)===null||d===void 0?void 0:d.mutations})},mutationKey:()=>OL({path:i,prefix:t}),subscriptionOptions:()=>xG({opts:u,path:i,input:c,queryKey:Mo({path:i,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[l]()})}function vG(){const e=O.createContext(null),t=O.createContext(null),n=i=>{const l=O.useMemo(()=>kL({client:i.trpcClient,queryClient:i.queryClient,keyPrefix:i.keyPrefix}),[i.trpcClient,i.queryClient,i.keyPrefix]);return O.createElement(e.Provider,{value:i.trpcClient},O.createElement(t.Provider,{value:l},i.children))};n.displayName="TRPCProvider";function r(){const i=O.useContext(t);if(!i)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return i}function s(){const i=O.useContext(e);if(!i)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return i}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const dM="/api/trpc",{TRPCProvider:SG,useTRPC:ii}=vG(),wG=()=>[W7({condition:e=>e.type==="subscription",true:sG({url:dM}),false:Vq({url:dM})})],EG=e=>Jq({links:e}),CG=(e,t)=>kL({client:e,queryClient:t}),NG={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)]"},TG={...NG,primary:"[--line:var(--primary)]"},RG=({lineColor:e})=>x.jsx("span",{"aria-hidden":"true",className:Ne("pointer-events-none absolute inset-x-0 bottom-0 h-1 bg-(--line)",TG[e])}),ML=3,OG=1,cd=2,QE=.5,kG=.3,MG=1.5,MS={added:"var(--diff-added)",modified:"var(--line-blue)",deleted:"var(--diff-removed)"},AL=e=>(e+ML+OG)*cd,hM=e=>e==="plain",AG=e=>Math.max(MG,e*kG),_L=({centre:e,radius:t})=>{const n=t*QE;return`M${String(e-n)} ${String(e)}h${String(n*cd)}`},_G=e=>{const t=e.radius*QE;return`${_L(e)}M${String(e.centre)} ${String(e.centre-t)}v${String(t*cd)}`},DG=({centre:e,radius:t})=>{const n=t*QE,r=n*cd;return`M${String(e-n)} ${String(e-n)}l${String(r)} ${String(r)}m0 ${String(-r)}l${String(-r)} ${String(r)}`},IG=({centre:e,radius:t})=>`M${String(e)} ${String(e-t)}a${String(t)} ${String(t)} 0 0 1 0 ${String(t*cd)}z`,AS=({path:e,radius:t})=>x.jsx("path",{d:e,strokeWidth:AG(t),className:"fill-none stroke-background [stroke-linecap:round]"}),_S=({shape:{centre:e,radius:t},ink:n,children:r=null})=>x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:e,cy:e,r:t,fill:n}),x.jsx("circle",{cx:e,cy:e,r:t+ML,stroke:n,className:"fill-none [stroke-width:1.5]"}),r]}),jG=(e,t)=>{const{centre:n,radius:r}=t;switch(e){case"added":return x.jsx(_S,{shape:t,ink:MS.added,children:x.jsx(AS,{path:_G(t),radius:r})});case"modified":return x.jsx(_S,{shape:t,ink:MS.modified});case"deleted":return x.jsx(_S,{shape:t,ink:MS.deleted,children:x.jsx(AS,{path:_L(t),radius:r})});case"breaks":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-destructive"}),x.jsx(AS,{path:DG(t),radius:r})]});case"behaviour-changes":return x.jsxs(x.Fragment,{children:[x.jsx("circle",{cx:n,cy:n,r,className:"fill-background stroke-foreground [stroke-width:2]"}),x.jsx("path",{d:IG(t),className:"fill-foreground"})]});case"plain":return x.jsx("circle",{cx:n,cy:n,r,className:"fill-muted-foreground"})}},DL=({mark:e,radius:t,className:n})=>{const r=AL(t);return x.jsx("svg",{"aria-hidden":"true",width:r,height:r,viewBox:`0 0 ${String(r)} ${String(r)}`,"data-mark":e,className:Ne("shrink-0",n),children:jG(e,{centre:r/cd,radius:t})})},IL=O.createContext(void 0);function su(e){const t=O.useContext(IL);if(!e&&t===void 0)throw new Error(wn(27));return t}const jL="data-starting-style",LG="data-ending-style",PG={[jL]:""},zG={[LG]:""},ZE={transitionStatus(e){return e==="starting"?PG:e==="ending"?zG:null}},BG="data-open",HG="data-closed",FG="data-anchor-hidden",LL="data-popup-open",$G="data-pressed",VG={[LL]:""},UG={[LL]:"",[$G]:""},qG={[BG]:""},GG={[HG]:""},KG={[FG]:""},JE={open(e){return e?VG:null}},J1={open(e){return e?UG:null}},Uy={open(e){return e?qG:GG},anchorHidden(e){return e?KG:null}},zp={...Uy,...ZE},YG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,forceRender:l=!1,...c}=t,u=su(),d=u.useState("open"),h=u.useState("nested"),m=u.useState("mounted"),g=u.useState("transitionStatus");return dn("div",t,{state:{open:d,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:zp,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!h})}),qy="none",rl="trigger-press",xn="trigger-hover",bf="trigger-focus",eC="outside-press",tC="item-press",PL="close-press",Bc="focus-out",Bp="escape-key",ew="list-navigation",WG="cancel-open",Nh="sibling-open",XG="disabled",Hp="imperative-action";function gt(e,t,n,r){let s=!1,i=!1;const l=r??Tn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...l}}const zL=O.forwardRef(function(t,n){const{render:r,className:s,style:i,disabled:l=!1,nativeButton:c=!0,...u}=t,d=su(),h=d.useState("open"),{getButtonProps:m,buttonRef:g}=Pp({disabled:l,native:c}),y={disabled:l};function b(w){h&&d.setOpen(!1,gt(PL,w.nativeEvent))}return dn("button",t,{state:y,ref:[n,g],props:[{onClick:b},u,m]})});let pM=0;function QG(e,t="mui"){const[n,r]=O.useState(e),s=e||n;return O.useEffect(()=>{n==null&&(pM+=1,r(`${t}-${pM}`))},[n,t]),s}const mM=$E.useId;function Uf(e,t){if(mM!==void 0){const n=mM();return e??(t?`${t}-${n}`:n)}return QG(e,t)}function lo(e){return Uf(e,"base-ui")}const ZG=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("descriptionElementId",d),dn("p",t,{ref:n,props:[{id:d},c]})});function nC(e){O.useEffect(e,Zh)}const dh=0;class si{constructor(){_t(this,"currentId",dh);_t(this,"clear",()=>{this.currentId!==dh&&(clearTimeout(this.currentId),this.currentId=dh)});_t(this,"disposeEffect",()=>this.clear)}static create(){return new si}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dh,n()},t)}isStarted(){return this.currentId!==dh}}function Jr(){const e=Tr(si.create).current;return nC(e.disposeEffect),e}function JG(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:eK,platform:tK,maxTouchPoints:nK}=JG(),Gy=eK.toLowerCase(),rp=tK.toLowerCase(),Ky=/^i(os$|p)/.test(rp)||rp==="macintel"&&nK>1,gM="android",tw=rp===gM||Gy.includes(gM),rC=!Ky&&rp.startsWith("mac");rp.startsWith("win");const rK=rC||Ky;var QI;const Aa=typeof CSS<"u"&&!!((QI=CSS.supports)!=null&&QI.call(CSS,"-webkit-backdrop-filter:none"));!Aa&&Gy.includes("firefox");!Aa&&Gy.includes("chrom");const sK=rK,sC=/jsdom|happydom/.test(Gy);function Ki(e){e.preventDefault(),e.stopPropagation()}function iK(e){return"nativeEvent"in e}function iC(e){return e.pointerType===""&&e.isTrusted?!0:tw&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oC(e){return sC?!1:!tw&&e.width===0&&e.height===0||tw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ha(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function oK(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Xr(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Je(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&$f(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Zr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const nw="data-base-ui-focusable",BL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Yy="ArrowLeft",Wy="ArrowRight",HL="ArrowUp",lC="ArrowDown",rw="data-trigger-disabled";function K0(e,t){if(!bt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(rw);for(const[,r]of t.entries())if(Je(r,n))return!r.hasAttribute(rw);return!1}function DS(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function lK(e){return e.matches("html,body")}function Xy(e){return Zt(e)&&e.matches(BL)}function aK(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${BL}`))!=null}function sw(e){return e?e.getAttribute("role")==="combobox"&&Xy(e):!1}function cK(e){if(!e||sC)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function iw(e){return e?e.hasAttribute(nw)?e:e.querySelector(`[${nw}]`)||e:null}function uK(e,t){return t!=null&&!ha(t)?0:typeof e=="function"?e():e}function sp(e,t,n){const r=uK(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function yM(e){return typeof e=="function"?e():e}function FL(e,t){return t||e==="click"||e==="mousedown"}function fK(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const dK=O.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new si,currentIdRef:{current:null},currentContextRef:{current:null}});function hK(e,t){e.current=t.current}function pK(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),i=O.useContext(dK),{currentIdRef:l,delayRef:c,timeoutMs:u,initialDelayRef:d,currentContextRef:h,hasProvider:m,timeout:g}=i,[y,b]=O.useState(!1),w=O.useRef(n);return ze(()=>{w.current=n},[n]),ze(()=>{function E(){var C;(C=h.current)==null||C.setIsInstantPhase(!1),l.current=null,h.current=null,c.current=d.current,g.clear()}if(l.current&&!n&&l.current===s){if(b(!1),u){const C=s;return g.start(u,()=>{r.select("open")||l.current&&l.current!==C||E()}),()=>{(w.current||l.current!==C)&&g.clear()}}E()}},[n,s,l,c,u,d,h,g,r]),ze(()=>{if(!n)return;const E=h.current,C=l.current;g.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:b},l.current=s,c.current={open:0,close:sp(d.current,"close")},C!==null&&C!==s?(b(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,gt(qy))):(b(!1),E==null||E.setIsInstantPhase(!1))},[n,s,r,l,c,d,h,g]),ze(()=>()=>{if(l.current===s){if(h.current=null,!w.current)return;l.current=null,hK(c,d),g.clear()}},[h,l,c,s,d,g]),O.useMemo(()=>({activeIdRef:l,hasProvider:m,delayRef:c,isInstantPhase:y}),[l,m,c,y])}function xt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function no(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Hn(e){const t=Tr(mK,e).current;return t.next=e,ze(t.effect),t}function mK(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Bg=null;class gK{constructor(){_t(this,"callbacks",[]);_t(this,"callbacksCount",0);_t(this,"nextId",1);_t(this,"startId",1);_t(this,"isScheduled",!1);_t(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)(s=n[i])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Hg=new gK;class Qi{constructor(){_t(this,"currentId",Bg);_t(this,"cancel",()=>{this.currentId!==Bg&&(Hg.cancel(this.currentId),this.currentId=Bg)});_t(this,"disposeEffect",()=>this.cancel)}static create(){return new Qi}static request(t){return Hg.request(t)}static cancel(t){return Hg.cancel(t)}request(t){this.cancel(),this.currentId=Hg.request(()=>{this.currentId=Bg,t()})}}function ip(){const e=Tr(Qi.create).current;return nC(e.disposeEffect),e}const yK={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},xK={...yK,position:"fixed",top:0,left:0},Na=O.forwardRef(function(t,n){const[r,s]=O.useState();ze(()=>{sK&&Aa&&s("button")},[]);const i={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:xK,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),qf=Math.min,Wo=Math.max,Y0=Math.round,Fg=Math.floor,Xo=e=>({x:e,y:e}),bK={left:"right",right:"left",bottom:"top",top:"bottom"};function $L(e,t,n){return Wo(e,qf(t,n))}function Ta(e,t){return typeof e=="function"?e(t):e}function ti(e){return e.split("-")[0]}function sl(e){return e.split("-")[1]}function aC(e){return e==="x"?"y":"x"}function cC(e){return e==="y"?"height":"width"}function ei(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function uC(e){return aC(ei(e))}function vK(e,t,n){n===void 0&&(n=!1);const r=sl(e),s=uC(e),i=cC(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=W0(l)),[l,W0(l)]}function SK(e){const t=W0(e);return[ow(e),t,ow(t)]}function ow(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xM=["left","right"],bM=["right","left"],wK=["top","bottom"],EK=["bottom","top"];function CK(e,t,n){switch(e){case"top":case"bottom":return n?t?bM:xM:t?xM:bM;case"left":case"right":return t?wK:EK;default:return[]}}function NK(e,t,n,r){const s=sl(e);let i=CK(ti(e),n==="start",r);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(ow)))),i}function W0(e){const t=ti(e);return bK[t]+e.slice(t.length)}function TK(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function VL(e){return typeof e!="number"?TK(e):{top:e,right:e,bottom:e,left:e}}function X0(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function vM(e,t){return t<0||t>=e.length}function IS(e,t){return ff(e.current,{disabledIndices:t})}function SM(e,t){return ff(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ff(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let i=t;do i+=n?-s:s;while(i>=0&&i<=e.length-1&&UL(e,i,r));return i}function UL(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Qy(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function RK(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Qy(e,t=e?zs(e):null){return!e||!e.isConnected||!t||RK(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const OK='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function kK(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return $f(n)?n.host:null}function lw(e){for(const t of Array.from(e.children))if(Nr(t)==="summary")return t;return null}function MK(e,t){const n=lw(t);return!!n&&(e===n||Je(n,e))}function qL(e){const t=e?Nr(e):"";return e!=null&&e.matches(OK)&&(t!=="summary"||e.parentElement!=null&&Nr(e.parentElement)==="details"&&lw(e.parentElement)===e)&&(t!=="details"||lw(e)==null)&&(t!=="input"||e.type!=="hidden")}function GL(e){if(!qL(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=kK(t)){const n=t!==e,r=Nr(t)==="slot";if(t.hasAttribute("inert")||n&&Nr(t)==="details"&&!t.open&&!MK(e,t)||t.hasAttribute("hidden")||!r&&!AK(t,n))return!1}return!0}function AK(e,t){const n=zs(e);return t?n.display!=="none":Qy(e,n)}function KL(e){const t=e.tabIndex;if(t<0){const n=Nr(e);if(n==="details"||n==="audio"||n==="video"||Zt(e)&&e.isContentEditable)return 0}return t}function jS(e){if(Nr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function _K(e,t){const n=jS(e);if(!n)return!0;const r=t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form&&i.checked});return r?r===n:t.find(s=>{const i=jS(s);return(i==null?void 0:i.name)===n.name&&i.form===n.form})===n}function YL(e){if(Zt(e)&&Nr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Zt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function WL(e,t){YL(e).forEach(n=>{qL(n)&&t.push(n),WL(n,t)})}function XL(e,t,n){YL(e).forEach(r=>{Zt(r)&&r.matches(t)&&n.push(r),XL(r,t,n)})}function fC(e){return GL(e)&&KL(e)>=0}function QL(e){const t=[];return WL(e,t),t.filter(GL)}function Fp(e){const t=QL(e);return t.filter(n=>KL(n)>=0&&_K(n,t))}function ZL(e,t){const n=Fp(e),r=n.length;if(r===0)return;const s=Xr(Dt(e)),i=n.indexOf(s),l=i===-1?t===1?0:r-1:i+t;return n[l]}function dC(e){return ZL(Dt(e).body,1)||e}function JL(e){return ZL(Dt(e).body,-1)||e}function eP(e,t){if(!e)return null;const n=Fp(Dt(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const i=(s+t+r)%r;return n[i]}function DK(e){return eP(e,1)}function IK(e){return eP(e,-1)}function vf(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Je(n,r)}function jK(e){Fp(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function wM(e){const t=[];XL(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ra(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var i;return[...!n||(i=s.context)!=null&&i.open?[s]:[],...Ra(e,s.id,n)]})}function EM(e,t){var s;let n=[],r=(s=e.find(i=>i.id===t))==null?void 0:s.parentId;for(;r;){const i=e.find(l=>l.id===r);r=i==null?void 0:i.parentId,i&&(n=n.concat(i))}return n}function op(e){return`data-base-ui-${e}`}let $g=0;function N0(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame($g);function i(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return i(),Bn;const l=requestAnimationFrame(i);return $g=l,()=>{$g===l&&(cancelAnimationFrame(l),$g=0)}}const LS={inert:new WeakMap,"aria-hidden":new WeakMap},CM="data-base-ui-inert",aw={inert:new WeakSet,"aria-hidden":new WeakSet};let hh=new WeakMap,PS=0;function LK(e){return aw[e]}function tP(e){return e?$f(e)?e.host:tP(e.parentNode):null}const NM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=tP(n);return e.contains(r)?r:null}).filter(n=>n!=null),TM=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},RM=(e,t,n)=>{const r=[],s=i=>{!i||n.has(i)||Array.from(i.children).forEach(l=>{Nr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function PK(e,t,n,r,{mark:s=!0}){let i=null;r?i="inert":n&&(i="aria-hidden");let l=null,c=null;const u=NM(t,e),d=s?RM(t,TM(u),new Set(u)):[],h=[],m=[];if(i){const g=LS[i],y=LK(i);c=y,l=g;const b=NM(t,Array.from(t.querySelectorAll("[aria-live]"))),w=u.concat(b);RM(t,TM(w),new Set(w)).forEach(C=>{const T=C.getAttribute(i),N=T!==null&&T!=="false",R=(g.get(C)||0)+1;g.set(C,R),h.push(C),R===1&&N&&y.add(C),N||C.setAttribute(i,i==="inert"?"":"true")})}return s&&d.forEach(g=>{const y=(hh.get(g)||0)+1;hh.set(g,y),m.push(g),y===1&&g.setAttribute(CM,"")}),PS+=1,()=>{l&&h.forEach(g=>{const b=(l.get(g)||0)-1;l.set(g,b),b||(!(c!=null&&c.has(g))&&i&&g.removeAttribute(i),c==null||c.delete(g))}),s&&m.forEach(g=>{const y=(hh.get(g)||0)-1;hh.set(g,y),y||g.removeAttribute(CM)}),PS-=1,PS||(LS.inert=new WeakMap,LS["aria-hidden"]=new WeakMap,aw.inert=new WeakSet,aw["aria-hidden"]=new WeakSet,hh=new WeakMap)}}function OM(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,i=Dt(e[0]).body;return PK(e,i,n,r,{mark:s})}const zK=500,nP=500,BK={style:{transition:"none"}},rP="data-base-ui-click-trigger",HK={fallbackAxisSide:"none"},Zy={fallbackAxisSide:"end"},FK={clipPath:"inset(50%)",position:"fixed",top:0,left:0},sP=O.createContext(null),iP=()=>O.useContext(sP),$K=op("portal");function oP(e={}){const{ref:t,container:n,componentProps:r=Tn,elementProps:s}=e,i=Uf(),l=iP(),c=l==null?void 0:l.portalNode,[u,d]=O.useState(null),[h,m]=O.useState(null),g=Qe(E=>{E!==null&&m(E)}),y=O.useRef(null);ze(()=>{if(n===null){y.current&&(y.current=null,m(null),d(null));return}const E=(n&&(BE(n)?n:n.current))??c??document.body;if(E==null){y.current&&(y.current=null,m(null),d(null));return}y.current!==E&&(y.current=E,m(null),d(E))},[n,c]);const b=dn("div",r,{ref:[t,g],props:[{id:i,[$K]:""},s]}),w=u&&b?Bs.createPortal(b,u):null;return{node:h,nodeId:O.isValidElement(b)?b.props.id:void 0,subtree:w}}const hC=O.forwardRef(function(t,n){const{render:r,className:s,style:i,children:l,container:c,portalOwnerRole:u,...d}=t,{node:h,nodeId:m,subtree:g}=oP({container:c,ref:n,componentProps:t,elementProps:d}),y=O.useRef(null),b=O.useRef(null),w=O.useRef(null),E=O.useRef(null),[C,T]=O.useState(null),N=O.useRef(!1),R=C==null?void 0:C.modal,M=C==null?void 0:C.open,D=!!C&&!C.modal&&C.open&&!!h;O.useEffect(()=>{if(!h||R)return;function I(_){h&&_.relatedTarget&&vf(_)&&(_.type==="focusin"?N.current&&(wM(h),N.current=!1):(jK(h),N.current=!0))}return no(xt(h,"focusin",I,!0),xt(h,"focusout",I,!0))},[h,R]),ze(()=>{!h||M!==!0||!N.current||(wM(h),N.current=!1)},[M,h]);const k=O.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:w,afterInsideRef:E,portalNode:h,setFocusManagerState:T}),[h]);return x.jsxs(O.Fragment,{children:[g,x.jsxs(sP.Provider,{value:k,children:[D&&h&&x.jsx(Na,{"data-type":"outside",ref:y,onFocus:I=>{var _;if(vf(I,h))(_=w.current)==null||_.focus();else{const P=C?C.domReference:null,H=JL(P);H==null||H.focus()}}}),D&&h&&x.jsx("span",{role:u,"aria-owns":m,style:FK}),h&&Bs.createPortal(l,h),D&&h&&x.jsx(Na,{"data-type":"outside",ref:b,onFocus:I=>{var _;if(vf(I,h))(_=E.current)==null||_.focus();else{const P=C?C.domReference:null,H=dC(P);H==null||H.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,gt(Bc,I.nativeEvent)))}}})]})]})});function lP(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class pC{constructor(){_t(this,"nodesRef",{current:[]});_t(this,"events",lP())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const aP=O.createContext(null),cP=O.createContext(null),iu=()=>{var e;return((e=O.useContext(aP))==null?void 0:e.id)||null},_a=e=>{const t=O.useContext(cP);return e??t};function Jy(e){const t=Uf(),n=_a(e),r=iu();return ze(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function mC(e){const{children:t,id:n}=e,r=iu();return x.jsx(aP.Provider,{value:O.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gC(e){const{children:t,externalTree:n}=e,r=Tr(()=>n??new pC).current;return x.jsx(cP.Provider,{value:r,children:t})}function Io(e){return e==null?e:"current"in e?e.current:e}function VK(e,t){const n=vn(Zr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const kM=20;let aa=[];function yC(){aa=aa.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function MM(e){yC(),e&&Nr(e)!=="body"&&(aa.push(new WeakRef(e)),aa.length>kM&&(aa=aa.slice(-kM)))}function AM(){var e;return yC(),(e=aa[aa.length-1])==null?void 0:e.deref()}function UK(e){return e?fC(e)?e:Fp(e)[0]||e:null}function _M(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=QL(e).filter(i=>{const l=i.getAttribute("data-tabindex")||"";return fC(i)||i.hasAttribute("data-tabindex")&&!l.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function xC(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:y,getInsideElements:b}=e,w="rootStore"in t?t.rootStore:t,E=w.useState("open"),C=w.useState("domReferenceElement"),T=w.useState("floatingElement"),{events:N,dataRef:R}=w.context,M=Qe(()=>{var oe;return(oe=R.current.floatingContext)==null?void 0:oe.nodeId}),D=s===!1,k=sw(C)&&D,I=Hn(s),_=Hn(i),P=Hn(d),H=Hn(E),z=_a(y),U=iP(),j=O.useRef(!1),B=O.useRef(!1),L=O.useRef(!1),$=O.useRef(null),q=O.useRef(""),G=O.useRef(""),W=O.useRef(null),Z=O.useRef(null),re=Vf(W,g,U==null?void 0:U.beforeInsideRef),de=Vf(Z,U==null?void 0:U.afterInsideRef),F=Jr(),X=Jr(),te=ip(),J=U!=null,K=iw(T),ce=Qe((oe=K)=>oe?Fp(oe):[]),ye=Qe(()=>(b==null?void 0:b().filter(oe=>oe!=null))??[]);O.useEffect(()=>{if(r||!c)return;function oe(Se){Se.key==="Tab"&&Je(K,Xr(Dt(K)))&&ce().length===0&&!k&&Ki(Se)}const xe=Dt(K);return xt(xe,"keydown",oe)},[r,K,c,k,ce]),O.useEffect(()=>{if(r||!E)return;const oe=Dt(K);function xe(){L.current=!1}function Se(_e){const we=Zr(_e),Re=ye(),Ae=Je(T,we)||Je(C,we)||Je(U==null?void 0:U.portalNode,we)||Re.some(Le=>Le===we||Je(Le,we));L.current=!Ae,G.current=_e.pointerType||"keyboard",we!=null&&we.closest(`[${rP}]`)&&(B.current=!0,X.start(0,()=>{B.current=!1}))}function ke(){G.current="keyboard"}return no(xt(oe,"pointerdown",Se,!0),xt(oe,"pointerup",xe,!0),xt(oe,"pointercancel",xe,!0),xt(oe,"keydown",ke,!0),xe)},[r,T,C,K,E,U,X,ye]),O.useEffect(()=>{if(r||!u)return;const oe=Dt(K);function xe(){B.current=!0,X.start(0,()=>{B.current=!1})}function Se(Re){const Ae=Zr(Re);fC(Ae)&&($.current=Ae)}function ke(Re){const Ae=Re.relatedTarget,Le=Re.currentTarget,Ie=Zr(Re);c&&Ae==null&&Ie!=null&&Je(T,Ie)&&MM(Ie),queueMicrotask(()=>{const Ue=M(),We=w.context.triggerElements,Oe=ye(),De=(Ae==null?void 0:Ae.hasAttribute(op("focus-guard")))&&[W.current,Z.current,U==null?void 0:U.beforeInsideRef.current,U==null?void 0:U.afterInsideRef.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,Io(m),Io(h)].includes(Ae),ne=!(Je(C,Ae)||Je(T,Ae)||Je(Ae,T)||Je(U==null?void 0:U.portalNode,Ae)||Oe.some(he=>he===Ae||Je(he,Ae))||We.hasMatchingElement(he=>Je(he,Ae))||De||z&&(Ra(z.nodesRef.current,Ue).find(he=>{var se,Te;return Je((se=he.context)==null?void 0:se.elements.floating,Ae)||Je((Te=he.context)==null?void 0:Te.elements.domReference,Ae)})||EM(z.nodesRef.current,Ue).find(he=>{var se,Te,Ve;return[(se=he.context)==null?void 0:se.elements.floating,iw((Te=he.context)==null?void 0:Te.elements.floating)].includes(Ae)||((Ve=he.context)==null?void 0:Ve.elements.domReference)===Ae})));if(Le===C&&K&&_M(K),l&&Le!==C&&!Qy(Ie)&&Xr(oe)===oe.body){if(Zt(K)&&(K.focus(),l==="popup")){te.request(()=>{K.focus()});return}const he=ce(),se=$.current,Te=(se&&he.includes(se)?se:null)||he[he.length-1]||K;Zt(Te)&&Te.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(k||!c)&&Ae&&ne&&!B.current&&(k||Ae!==AM())&&(j.current=!0,w.setOpen(!1,gt(Bc,Re)))})}function _e(){L.current||(R.current.insideReactTree=!0,F.start(0,()=>{R.current.insideReactTree=!1}))}const we=Zt(C)?C:null;if(!(!T&&!we))return no(we&&xt(we,"focusout",ke),we&&xt(we,"pointerdown",xe),T&&xt(T,"focusin",Se),T&&xt(T,"focusout",ke),T&&U&&xt(T,"focusout",_e,!0))},[r,C,T,K,c,z,U,w,u,l,ce,k,M,R,F,X,te,h,m,ye]),O.useEffect(()=>{var Le,Ie,Ue;if(r||!T||!E)return;const oe=Array.from(((Le=U==null?void 0:U.portalNode)==null?void 0:Le.querySelectorAll(`[${op("portal")}]`))||[]),Se=(Ue=(Ie=(z?EM(z.nodesRef.current,M()):[]).find(We=>{var Oe;return sw(((Oe=We.context)==null?void 0:Oe.elements.domReference)||null)}))==null?void 0:Ie.context)==null?void 0:Ue.elements.domReference,_e=[...[T,...oe,W.current,Z.current,U==null?void 0:U.beforeOutsideRef.current,U==null?void 0:U.afterOutsideRef.current,...ye()],Se,Io(m),Io(h),k?C:null].filter(We=>We!=null),we=OM(_e,{ariaHidden:c||k,mark:!1}),Re=[T,...oe].filter(We=>We!=null),Ae=OM(Re);return()=>{Ae(),we()}},[E,r,C,T,c,U,k,z,M,h,m,ye]),ze(()=>{if(!E||r||!Zt(K))return;q.current="",G.current="";const oe=Dt(K),xe=Xr(oe);queueMicrotask(()=>{const Se=I.current,ke=typeof Se=="function"?Se(P.current||""):Se;if(ke===void 0||ke===!1||Je(K,xe))return;let we=null;const Re=()=>(we==null&&(we=ce(K)),we[0]||K);let Ae;ke===!0||ke===null?Ae=Re():Ae=Io(ke),Ae=Ae||Re();const Le=Je(K,Xr(oe));N0(Ae,{preventScroll:Ae===K,shouldFocus(){if(!H.current)return!1;if(Le)return!0;const Ie=Xr(oe);return!(Ie!==Ae&&Je(K,Ie))}})})},[r,E,K,ce,I,P,H]),ze(()=>{if(r||!K)return;const oe=Dt(K),xe=Xr(oe),Se=P.current==null;MM(xe);function ke(we){if(we.open||(q.current=VK(we.nativeEvent,G.current)),we.reason===xn&&we.nativeEvent.type==="mouseleave"&&(j.current=!0),we.reason===eC)if(we.nested)j.current=!1;else if(iC(we.nativeEvent)||oC(we.nativeEvent))j.current=!1;else{let Re=!1;Dt(K).createElement("div").focus({get preventScroll(){return Re=!0,!1}}),Re?j.current=!1:j.current=!0}}N.on("openchange",ke);function _e(we){const Re=_.current;let Ae=typeof Re=="function"?Re(we):Re;if(Ae===void 0||Ae===!1)return null;Ae===null&&(Ae=!0);const Le=C!=null&&C.isConnected?C:null,Ie=xe!=null&&xe.isConnected&&Nr(xe)!=="body"?xe:null;let Ue=Se?Ie||Le:Le||Ie;return Ue||(Ue=AM()||null),typeof Ae=="boolean"?Ue:Io(Ae)||Ue||null}return()=>{N.off("openchange",ke);const we=Xr(oe),Re=ye(),Ae=Je(T,we)||Re.some(We=>We===we||Je(We,we))||z&&Ra(z.nodesRef.current,M(),!1).some(We=>{var Oe;return Je((Oe=We.context)==null?void 0:Oe.elements.floating,we)}),Le=_.current,Ie=q.current,Ue=_e(Ie);queueMicrotask(()=>{const We=UK(Ue),Oe=typeof Le!="boolean";if(Le&&!j.current&&Zt(We)&&(!(!Oe&&We!==we&&we!==oe.body)||Ae)){const De={preventScroll:!0};Ie==="keyboard"&&(De.focusVisible=!0),We.focus(De)}j.current=!1})}},[r,T,K,_,P,N,z,C,M,ye]),ze(()=>{if(!Aa||E||!T)return;const oe=Xr(Dt(T));!Zt(oe)||!Xy(oe)||Je(T,oe)&&oe.blur()},[E,T]),ze(()=>{if(!(r||!U))return U.setFocusManagerState({modal:c,closeOnFocusOut:u,open:E,onOpenChange:w.setOpen,domReference:C}),()=>{U.setFocusManagerState(null)}},[r,U,c,E,w,u,C]),ze(()=>{if(!(r||!K))return _M(K),()=>{queueMicrotask(yC)}},[r,K]);const ge=!r&&(c?!k:!0)&&(J||c);return x.jsxs(O.Fragment,{children:[ge&&x.jsx(Na,{"data-type":"inside",ref:re,onFocus:oe=>{var xe;if(c){const Se=ce();N0(Se[Se.length-1])}else if(U!=null&&U.portalNode)if(j.current=!1,vf(oe,U.portalNode)){const Se=dC(C);Se==null||Se.focus()}else(xe=Io(m??U.beforeOutsideRef))==null||xe.focus()}}),n,ge&&x.jsx(Na,{"data-type":"inside",ref:de,onFocus:oe=>{var xe;if(c)N0(ce()[0]);else if(U!=null&&U.portalNode)if(u&&(j.current=!0),vf(oe,U.portalNode)){const Se=JL(C);Se==null||Se.focus()}else(xe=Io(h??U.afterOutsideRef))==null||xe.focus()}})]})}function uP(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=rl}=t,d="rootStore"in e?e.rootStore:e,h=d.context.dataRef,m=O.useRef(void 0),g=ip(),y=Jr(),b=O.useMemo(()=>{function w(C,T,N,R){const M=gt(u,T,N);C&&R==="touch"&&c>0?y.start(c,()=>{d.setOpen(!0,M)}):d.setOpen(C,M)}function E(C,T,N){const R=h.current.openEvent,M=d.select("domReferenceElement")!==T;return C&&M||!C||!s?!0:R&&l?!N(R.type):!1}return{onPointerDown(C){m.current=ha(C.pointerType,!0)&&oC(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const T=m.current,N=C.nativeEvent,R=d.select("open");if(C.button!==0||r==="click"||ha(T,!0)&&i)return;const M=E(R,C.currentTarget,I=>I==="click"||I==="mousedown"),D=Zr(N);if(Xy(D)){w(M,N,D,T);return}const k=C.currentTarget;g.request(()=>{w(M,N,k,T)})},onClick(C){if(r==="mousedown-only")return;const T=m.current;if(r==="mousedown"&&T){m.current=void 0;return}if(ha(T,!0)&&i)return;const N=d.select("open"),R=E(N,C.currentTarget,M=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");w(R,C.nativeEvent,C.currentTarget,T)},onKeyDown(){m.current=void 0}}},[h,r,i,u,d,l,s,g,y,c]);return O.useMemo(()=>n?{reference:b}:Tn,[n,b])}function qK(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var y;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(((y=t.dataRef.current.openEvent)==null?void 0:y.type)||"")&&t.pointerType!=="touch";let d=i.width,h=i.height,m=i.x,g=i.y;return n==null&&t.x&&l&&(n=i.x-t.x),r==null&&t.y&&c&&(r=i.y-t.y),m-=n||0,g-=r||0,d=0,h=0,!s||u?(d=t.axis==="y"?i.width:0,h=t.axis==="x"?i.height:0,m=l&&t.x!=null?t.x:m,g=c&&t.y!=null?t.y:g):s&&!u&&(h=t.axis==="x"?i.height:h,d=t.axis==="y"?i.width:d),s=!0,{width:d,height:h,x:m,y:g,top:g,right:m+d,bottom:g+h,left:m}}}}function DM(e){return e!=null&&e.clientX!=null}function GK(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),u=s.context.dataRef,d=O.useRef(!1),h=O.useRef(null),[m,g]=O.useState(),[y,b]=O.useState([]),w=Qe(R=>{s.set("positionReference",R)}),E=Qe((R,M,D)=>{d.current||u.current.openEvent&&!DM(u.current.openEvent)||s.set("positionReference",qK(D??c,{x:R,y:M,axis:r,dataRef:u,pointerType:m}))}),C=Qe(R=>{i?h.current||(E(R.clientX,R.clientY,R.currentTarget),b([])):E(R.clientX,R.clientY,R.currentTarget)}),T=ha(m)?l:i;O.useEffect(()=>{if(!n){w(c);return}if(!T)return;function R(){var k;(k=h.current)==null||k.call(h),h.current=null}const M=vn(l);function D(k){const I=Zr(k);Je(l,I)?R():E(k.clientX,k.clientY)}return!u.current.openEvent||DM(u.current.openEvent)?h.current=xt(M,"mousemove",D):w(c),R},[T,n,l,u,c,s,E,w,y]),O.useEffect(()=>()=>{s.set("positionReference",null)},[s]),O.useEffect(()=>{n&&!l&&(d.current=!1)},[n,l]),O.useEffect(()=>{!n&&i&&(d.current=!0)},[n,i]);const N=O.useMemo(()=>{function R(M){g(M.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:C,onMouseEnter:C}},[C]);return O.useMemo(()=>n?{reference:N,trigger:N}:{},[n,N])}function KK(){return!1}function YK(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $p(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:i="sloppy",referencePress:l=KK,bubbles:c,externalTree:u}=t,d="rootStore"in e?e.rootStore:e,h=d.useState("open"),m=d.useState("floatingElement"),{dataRef:g,events:y}=d.context,b=_a(u),w=Qe(typeof s=="function"?s:()=>!1),E=typeof s=="function"?w:s,C=E!==!1,T=Qe(()=>i),{escapeKey:N,outsidePress:R}=YK(c),M=O.useRef(!1),D=O.useRef(!1),k=O.useRef(!1),I=O.useRef(!1),_=O.useRef(!1),P=O.useRef(""),H=O.useRef(null),z=Jr(),U=Jr(),j=Qe(()=>{U.clear(),g.current.insideReactTree=!1}),B=Qe(F=>{var J;const X=(J=g.current.floatingContext)==null?void 0:J.nodeId;return(b?Ra(b.nodesRef.current,X):[]).some(K=>{var ce;return((ce=K.context)==null?void 0:ce.open)&&!K.context.dataRef.current[F]})}),L=Qe(F=>DS(F,d.select("floatingElement"))||DS(F,d.select("domReferenceElement"))),$=Qe(F=>{l()&&d.setOpen(!1,gt(rl,F.nativeEvent))}),q=Qe(F=>{if(!h||!n||!r||F.key!=="Escape"||_.current||!N&&B("__escapeKeyBubbles"))return;const X=iK(F)?F.nativeEvent:F,te=gt(Bp,X);d.setOpen(!1,te),te.isCanceled||F.preventDefault(),!N&&!te.isPropagationAllowed&&F.stopPropagation()}),G=Qe(()=>{g.current.insideReactTree=!0,U.start(0,j)}),W=Qe(F=>{if(!h||!n||F.button!==0)return;const X=Zr(F.nativeEvent);Je(d.select("floatingElement"),X)&&(M.current||(M.current=!0,D.current=!1))}),Z=Qe(F=>{!h||!n||(F.defaultPrevented||F.nativeEvent.defaultPrevented)&&M.current&&(D.current=!0)});O.useEffect(()=>{function F(X){X.open||(I.current=!1)}return y.on("openchange",F),()=>{y.off("openchange",F)}},[y]),O.useEffect(()=>{if(!h||!n)return h||(I.current=!1),j;g.current.__escapeKeyBubbles=N,g.current.__outsidePressBubbles=R;const F=new si,X=new si,te=Dt(m);function J(){F.clear(),_.current=!0}function K(){F.start(Aa?5:0,()=>{_.current=!1})}function ce(){k.current=!0,X.start(0,()=>{k.current=!1})}function ye(){M.current=!1,D.current=!1}function ge(){const ne=P.current,he=ne==="pen"||!ne?"mouse":ne,se=T(),Te=typeof se=="function"?se():se;return typeof Te=="string"?Te:Te[he]}function oe(ne){const he=ge();return he==="intentional"&&ne.type!=="click"||he==="sloppy"&&ne.type==="click"}function xe(ne){var Te;const he=(Te=g.current.floatingContext)==null?void 0:Te.nodeId,se=b&&Ra(b.nodesRef.current,he).some(Ve=>{var jt;return DS(ne,(jt=Ve.context)==null?void 0:jt.elements.floating)});return L(ne)||se}function Se(ne){if(oe(ne)){ne.type!=="click"&&!L(ne)&&(X.clear(),k.current=!1),j();return}if(g.current.insideReactTree){j();return}const he=Zr(ne),se=`[${op("inert")}]`,Te=bt(he)?he.getRootNode():null,Ve=Array.from(($f(Te)?Te:Dt(d.select("floatingElement"))).querySelectorAll(se)),jt=d.context.triggerElements;if(he&&(jt.hasElement(he)||jt.hasMatchingElement(Fe=>Je(Fe,he))))return;let hn=bt(he)?he:null;for(;hn&&!Ko(hn);){const Fe=nl(hn);if(Ko(Fe)||!bt(Fe))break;hn=Fe}if(!(Ve.length&&bt(he)&&!lK(he)&&!Je(he,d.select("floatingElement"))&&Ve.every(Fe=>!Je(hn,Fe)))){if(Zt(he)&&!("touches"in ne)){const Fe=Ko(he),Tt=zs(he),zt=/auto|scroll/,Vn=Fe||zt.test(Tt.overflowX),Un=Fe||zt.test(Tt.overflowY),xs=Vn&&he.clientWidth>0&&he.scrollWidth>he.clientWidth,on=Un&&he.clientHeight>0&&he.scrollHeight>he.clientHeight,ar=Tt.direction==="rtl",zr=on&&(ar?ne.offsetX<=he.offsetWidth-he.clientWidth:ne.offsetX>he.clientWidth),bs=xs&&ne.offsetY>he.clientHeight;if(zr||bs)return}if(!xe(ne)){if(ge()==="intentional"){if(ne.detail!==0&&!iC(ne)&&!I.current)return;if(k.current){X.clear(),k.current=!1;return}}typeof E=="function"&&!E(ne)||B("__outsidePressBubbles")||(d.setOpen(!1,gt(eC,ne)),j())}}}function ke(ne){ge()!=="sloppy"||ne.pointerType==="touch"||!d.select("open")||!n||L(ne)||Se(ne)}function _e(ne){if(ge()!=="sloppy"||!d.select("open")||!n||L(ne))return;const he=ne.touches[0];he&&(H.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function we(ne,he){const se=Zr(ne);if(!se)return;const Te=xt(se,ne.type,()=>{he(ne),Te()})}function Re(ne){P.current="touch",we(ne,_e)}function Ae(ne){z.clear(),ne.type==="pointerdown"&&(ne.button===0&&(I.current=!0),P.current=ne.pointerType),!(ne.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&we(ne,he=>{he.type==="pointerdown"?ke(he):Se(he)})}function Le(ne){if(ne.type==="pointercancel"&&(I.current=!1),!M.current)return;const he=D.current;if(ye(),ge()==="intentional"){if(ne.type==="pointercancel"){he&&ce();return}if(!xe(ne)){if(he){ce();return}typeof E=="function"&&!E(ne)||(X.clear(),k.current=!0,j())}}}function Ie(ne){if(ge()!=="sloppy"||!H.current||L(ne))return;const he=ne.touches[0];if(!he)return;const se=Math.abs(he.clientX-H.current.startX),Te=Math.abs(he.clientY-H.current.startY),Ve=Math.sqrt(se*se+Te*Te);Ve>5&&(H.current.dismissOnTouchEnd=!0),Ve>10&&(Se(ne),z.clear(),H.current=null)}function Ue(ne){we(ne,Ie)}function We(ne){ge()!=="sloppy"||!H.current||L(ne)||(H.current.dismissOnTouchEnd&&Se(ne),z.clear(),H.current=null)}function Oe(ne){we(ne,We)}const De=no(r&&no(xt(te,"keydown",q),xt(te,"compositionstart",J),xt(te,"compositionend",K)),C&&no(xt(te,"click",Ae,!0),xt(te,"pointerdown",Ae,!0),xt(te,"pointerup",Le,!0),xt(te,"pointercancel",Le,!0),xt(te,"mousedown",Ae,!0),xt(te,"mouseup",Le,!0),xt(te,"touchstart",Re,{capture:!0,passive:!0}),xt(te,"touchmove",Ue,{capture:!0,passive:!0}),xt(te,"touchend",Oe,{capture:!0,passive:!0})));return()=>{De(),F.clear(),X.clear(),ye(),k.current=!1,j()}},[g,m,r,C,E,h,n,N,R,q,j,T,B,L,b,d,z]);const re=O.useMemo(()=>({onKeyDown:q,onPointerDown:$,onClick:$}),[q,$]),de=O.useMemo(()=>({onKeyDown:q,onPointerDown:Z,onMouseDown:Z,onClickCapture:G,onMouseDownCapture(F){G(),W(F)},onPointerDownCapture(F){G(),W(F)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[q,G,W,Z]);return O.useMemo(()=>n?{reference:re,floating:de,trigger:re}:{},[n,re,de])}function IM(e,t,n){let{reference:r,floating:s}=e;const i=ei(t),l=uC(t),c=cC(l),u=ti(t),d=i==="y",h=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let y;switch(u){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-s.width,y:m};break;default:y={x:r.x,y:r.y}}const b=sl(t);return b&&(y[l]+=g*(b==="end"?1:-1)*(n&&d?-1:1)),y}async function WK(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:y=0}=Ta(t,e),b=VL(y),E=c[g?m==="floating"?"reference":"floating":m],C=X0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),T=m==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(N))&&await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1},M=X0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:N,strategy:u}):T);return{top:(C.top-M.top+b.top)/R.y,bottom:(M.bottom-C.bottom+b.bottom)/R.y,left:(C.left-M.left+b.left)/R.x,right:(M.right-C.right+b.right)/R.x}}const XK=50,QK=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:WK},u=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:m}=IM(d,r,u),g=r,y=0;const b={};for(let w=0;w<i.length;w++){const E=i[w];if(!E)continue;const{name:C,fn:T}=E,{x:N,y:R,data:M,reset:D}=await T({x:h,y:m,initialPlacement:r,placement:g,strategy:s,middlewareData:b,rects:d,platform:c,elements:{reference:e,floating:t}});h=N??h,m=R??m,b[C]={...b[C],...M},D&&y<XK&&(y++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(d=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:h,y:m}=IM(d,g,u)),w=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:b}},ZK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...E}=Ta(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=ti(s),T=ei(c),N=ti(c)===c,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),M=g||(N||!w?[W0(c)]:SK(c)),D=b!=="none";!g&&D&&M.push(...NK(c,w,b,R));const k=[c,...M],I=await u.detectOverflow(t,E),_=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&_.push(I[C]),m){const j=vK(s,l,R);_.push(I[j[0]],I[j[1]])}if(P=[...P,{placement:s,overflows:_}],!_.every(j=>j<=0)){var H,z;const j=(((H=i.flip)==null?void 0:H.index)||0)+1,B=k[j];if(B&&(!(m==="alignment"?T!==ei(B):!1)||P.every(q=>ei(q.placement)===T?q.overflows[0]>0:!0)))return{data:{index:j,overflows:P},reset:{placement:B}};let L=(z=P.filter($=>$.overflows[0]<=0).sort(($,q)=>$.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!L)switch(y){case"bestFit":{var U;const $=(U=P.filter(q=>{if(D){const G=ei(q.placement);return G===T||G==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(G=>G>0).reduce((G,W)=>G+W,0)]).sort((q,G)=>q[1]-G[1])[0])==null?void 0:U[0];$&&(L=$);break}case"initialPlacement":L=c;break}if(s!==L)return{reset:{placement:L}}}return{}}}},fP=new Set(["left","top"]);async function JK(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=ti(n),c=sl(n),u=ei(n)==="y",d=fP.has(l)?-1:1,h=i&&u?-1:1,m=Ta(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),u?{x:y*h,y:g*d}:{x:g*d,y:y*h}}const eY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:l,middlewareData:c}=t,u=await JK(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:l}}}}},tY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:u={fn:T=>{let{x:N,y:R}=T;return{x:N,y:R}}},...d}=Ta(e,t),h={x:n,y:r},m=await i.detectOverflow(t,d),g=ei(s),y=aC(g);let b=h[y],w=h[g];const E=(T,N)=>$L(N+m[T==="y"?"top":"left"],N,N-m[T==="y"?"bottom":"right"]);l&&(b=E(y,b)),c&&(w=E(g,w));const C=u.fn({...t,[y]:b,[g]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[g]:c}}}}}},nY=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:l,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=Ta(e,t),g={x:s,y:i},y=ei(l),b=aC(y);let w=g[b],E=g[y];const C=Ta(d,t),T=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(h){const M=b==="y"?"height":"width",D=c.reference[b]-c.floating[M]+T.mainAxis,k=c.reference[b]+c.reference[M]-T.mainAxis;w<D?w=D:w>k&&(w=k)}if(m){var N,R;const M=b==="y"?"width":"height",D=fP.has(ti(l)),k=c.reference[y]-c.floating[M]+(D&&((N=u.offset)==null?void 0:N[y])||0)+(D?0:T.crossAxis),I=c.reference[y]+c.reference[M]+(D?0:((R=u.offset)==null?void 0:R[y])||0)-(D?T.crossAxis:0);E<k?E=k:E>I&&(E=I)}return{[b]:w,[y]:E}}}},rY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Ta(e,t),u=await s.detectOverflow(t,c),d=ti(n),h=sl(n),m=ei(n)==="y",{width:g,height:y}=r.floating;let b,w;d==="top"||d==="bottom"?(b=d,w=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,b=h==="end"?"top":"bottom");const E=y-u.top-u.bottom,C=g-u.left-u.right,T=qf(y-u[b],E),N=qf(g-u[w],C),R=t.middlewareData.shift,M=!R;let D=T,k=N;R!=null&&R.enabled.x&&(k=C),R!=null&&R.enabled.y&&(D=E),M&&!h&&(m?k=g-2*Wo(u.left,u.right):D=y-2*Wo(u.top,u.bottom)),await l({...t,availableWidth:k,availableHeight:D});const I=await s.getDimensions(i.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function dP(e){const t=zs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Zt(e),i=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=Y0(n)!==i||Y0(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function bC(e){return bt(e)?e:e.contextElement}function Sf(e){const t=bC(e);if(!Zt(t))return Xo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=dP(t);let l=(i?Y0(n.width):n.width)/r,c=(i?Y0(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const sY=Xo(0);function hP(e){const t=vn(e);return!FE()||!t.visualViewport?sY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iY(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vn(e)}function Hc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=bC(e);let l=Xo(1);t&&(r?bt(r)&&(l=Sf(r)):l=Sf(e));const c=iY(i,n,r)?hP(i):Xo(0);let u=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,h=s.width/l.x,m=s.height/l.y;if(i&&r){const g=vn(i),y=bt(r)?vn(r):r;let b=g,w=K1(b);for(;w&&y!==b;){const E=Sf(w),C=w.getBoundingClientRect(),T=zs(w),N=C.left+(w.clientLeft+parseFloat(T.paddingLeft))*E.x,R=C.top+(w.clientTop+parseFloat(T.paddingTop))*E.y;u*=E.x,d*=E.y,h*=E.x,m*=E.y,u+=N,d+=R,b=vn(w),w=K1(b)}}return X0({width:h,height:m,x:u,y:d})}function ex(e,t){const n=Fy(e).scrollLeft;return t?t.left+n:Hc(ol(e)).left+n}function pP(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ex(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function oY(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",l=ol(r),c=t?Hy(t.floating):!1;if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Xo(1);const h=Xo(0),m=Zt(r);if((m||!i)&&((Nr(r)!=="body"||Lp(l))&&(u=Fy(r)),m)){const y=Hc(r);d=Sf(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=l&&!m&&!i?pP(l,u):Xo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function lY(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function aY(e){const t=Fy(e),n=e.ownerDocument.body,r=Wo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Wo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+ex(e);const l=-t.scrollTop;return zs(n).direction==="rtl"&&(i+=Wo(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:l}}const cY=25;function uY(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=vn(e),i=ol(e),l=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,d=0,h=0;if(l){const g=!FE()||t==="fixed";r?g||(d=-l.offsetLeft,h=-l.offsetTop):(c=l.width,u=l.height,g&&(d=l.offsetLeft,h=l.offsetTop))}if(ex(i)<=0){const g=i.ownerDocument,y=g.body,b=getComputedStyle(y),w=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-y.clientWidth-w),C=getComputedStyle(i).scrollbarGutter==="stable both-edges"?E/2:E;C<=cY&&(c-=C)}return{width:c,height:u,x:d,y:h}}function fY(e,t){const n=Hc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Sf(e),l=e.clientWidth*i.x,c=e.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:l,height:c,x:u,y:d}}function jM(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=uY(e,n,t);else if(t==="document")r=aY(ol(e));else if(bt(t))r=fY(t,n);else{const s=hP(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return X0(r)}function dY(e,t){const n=t.get(e);if(n)return n;let r=Qh(e,[],!1).filter(c=>bt(c)&&Nr(c)!=="body"),s=null;const i=zs(e).position==="fixed";let l=i?nl(e):e;for(;bt(l)&&!Ko(l);){const c=zs(l),u=HE(l),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(m=>m!==l):s=c,l=nl(l)}return t.set(e,r),r}function hY(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Hy(t)?[]:dY(t,this._c):[].concat(n),r],c=jM(t,l[0],s);let u=c.top,d=c.right,h=c.bottom,m=c.left;for(let g=1;g<l.length;g++){const y=jM(t,l[g],s);u=Wo(y.top,u),d=qf(y.right,d),h=qf(y.bottom,h),m=Wo(y.left,m)}return{width:d-m,height:h-u,x:m,y:u}}function pY(e){const{width:t,height:n}=dP(e);return{width:t,height:n}}function mY(e,t,n){const r=Zt(t),s=ol(t),i=n==="fixed",l=Hc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Xo(0);if((r||!i)&&((Nr(t)!=="body"||Lp(s))&&(c=Fy(t)),r)){const g=Hc(t,!0,i,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}!r&&s&&(u.x=ex(s));const d=s&&!r&&!i?pP(s,c):Xo(0),h=l.left+c.scrollLeft-u.x-d.x,m=l.top+c.scrollTop-u.y-d.y;return{x:h,y:m,width:l.width,height:l.height}}function zS(e){return zs(e).position==="static"}function LM(e,t){if(!Zt(e)||zs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ol(e)===n&&(n=n.ownerDocument.body),n}function mP(e,t){const n=vn(e);if(Hy(e))return n;if(!Zt(e)){let s=nl(e);for(;s&&!Ko(s);){if(bt(s)&&!zS(s))return s;s=nl(s)}return n}let r=LM(e,t);for(;r&&VU(r)&&zS(r);)r=LM(r,t);return r&&Ko(r)&&zS(r)&&!HE(r)?n:r||GU(e)||n}const gY=async function(e){const t=this.getOffsetParent||mP,n=this.getDimensions,r=await n(e.floating);return{reference:mY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yY(e){return zs(e).direction==="rtl"}const xY={convertOffsetParentRelativeRectToViewportRelativeRect:oY,getDocumentElement:ol,getClippingRect:hY,getOffsetParent:mP,getElementRects:gY,getClientRects:lY,getDimensions:pY,getScale:Sf,isElement:bt,isRTL:yY};function gP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bY(e,t,n){let r=null,s;const i=ol(e);function l(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),l();const g=e.getBoundingClientRect(),{left:y,top:b,width:w,height:E}=g;if(h||t(),!w||!E)return;const C=Fg(b),T=Fg(i.clientWidth-(y+w)),N=Fg(i.clientHeight-(b+E)),R=Fg(y),D={rootMargin:-C+"px "+-T+"px "+-N+"px "+-R+"px",threshold:Wo(0,qf(1,m))||1};let k=!0;function I(_){const P=_[0].intersectionRatio;if(!gP(g,e.getBoundingClientRect()))return c();if(P!==m){if(!k)return c();P?c(!1,P):s=setTimeout(()=>{c(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(I,{...D,root:i.ownerDocument})}catch{r=new IntersectionObserver(I,D)}r.observe(e)}const u=vn(e),d=()=>c(n);return u.addEventListener("resize",d),c(!0),()=>{u.removeEventListener("resize",d),l()}}function PM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=bC(e),h=s||i?[...d?Qh(d):[],...t?Qh(t):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),i&&C.addEventListener("resize",n)});const m=d&&c?bY(d,n,i):null;let g=-1,y=null;l&&(y=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),d&&!u&&y.observe(d),t&&y.observe(t));let b,w=u?Hc(e):null;u&&E();function E(){const C=Hc(e);w&&!gP(w,C)&&n(),w=C,b=requestAnimationFrame(E)}return n(),()=>{var C;h.forEach(T=>{s&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),m==null||m(),(C=y)==null||C.disconnect(),y=null,u&&cancelAnimationFrame(b)}}const vY=eY,SY=tY,wY=ZK,EY=rY,CY=nY,NY=(e,t,n)=>{const r=new Map,s=n??{},i={...xY,...s.platform,_c:r};return QK(e,t,{...s,platform:i})};var TY=typeof document<"u",RY=function(){},T0=TY?O.useLayoutEffect:RY;function Q0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Q0(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function yP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zM(e,t){const n=yP(e);return Math.round(t*n)/n}function BS(e){const t=O.useRef(e);return T0(()=>{t.current=e}),t}function OY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,m]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=O.useState(r);Q0(g,r)||y(r);const[b,w]=O.useState(null),[E,C]=O.useState(null),T=O.useCallback(q=>{q!==D.current&&(D.current=q,w(q))},[]),N=O.useCallback(q=>{q!==k.current&&(k.current=q,C(q))},[]),R=i||b,M=l||E,D=O.useRef(null),k=O.useRef(null),I=O.useRef(h),_=u!=null,P=BS(u),H=BS(s),z=BS(d),U=O.useCallback(()=>{if(!D.current||!k.current)return;const q={placement:t,strategy:n,middleware:g};H.current&&(q.platform=H.current),NY(D.current,k.current,q).then(G=>{const W={...G,isPositioned:z.current!==!1};j.current&&!Q0(I.current,W)&&(I.current=W,Bs.flushSync(()=>{m(W)}))})},[g,t,n,H,z]);T0(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,m(q=>({...q,isPositioned:!1})))},[d]);const j=O.useRef(!1);T0(()=>(j.current=!0,()=>{j.current=!1}),[]),T0(()=>{if(R&&(D.current=R),M&&(k.current=M),R&&M){if(P.current)return P.current(R,M,U);U()}},[R,M,U,P,_]);const B=O.useMemo(()=>({reference:D,floating:k,setReference:T,setFloating:N}),[T,N]),L=O.useMemo(()=>({reference:R,floating:M}),[R,M]),$=O.useMemo(()=>{const q={position:n,left:0,top:0};if(!L.floating)return q;const G=zM(L.floating,h.x),W=zM(L.floating,h.y);return c?{...q,transform:"translate("+G+"px, "+W+"px)",...yP(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:W}},[n,c,L.floating,h.x,h.y]);return O.useMemo(()=>({...h,update:U,refs:B,elements:L,floatingStyles:$}),[h,U,B,L,$])}const kY=(e,t)=>{const n=vY(e);return{name:n.name,fn:n.fn,options:[e,t]}},MY=(e,t)=>{const n=SY(e);return{name:n.name,fn:n.fn,options:[e,t]}},AY=(e,t)=>({fn:CY(e).fn,options:[e,t]}),_Y=(e,t)=>{const n=wY(e);return{name:n.name,fn:n.fn,options:[e,t]}},DY=(e,t)=>{const n=EY(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Z0(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function IY(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function xP(e){const t=[];let n,r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(const c of Array.from(e).sort((u,d)=>u.top-d.top)){if(r=Math.min(r,c.left),s=Math.min(s,c.top),i=Math.max(i,c.right),l=Math.max(l,c.bottom),!n||c.top-n.top>n.height/2)t.push(IY(c));else{const u=t[t.length-1];u.left=Math.min(u.left,c.left),u.right=Math.max(u.right,c.right),u.bottom=Math.max(u.bottom,c.bottom),u.width=u.right-u.left,u.height=u.bottom-u.top}n=c}return{lines:t,fallback:Z0(r,s,i,l)}}function bP(e,t,n){return e.findIndex(r=>t>r.left-2&&t<r.right+2&&n>r.top-2&&n<r.bottom+2)}function BM(e){return Z0(e.left,e.top,e.right,e.bottom)}function jY(e,t,n){const{lines:r}=xP(e.getClientRects());if(r.length<2)return;const s=bP(r,t,n);return{x:t,y:n,lineIndex:s===-1?void 0:s,element:e}}function LY(e,t,n){const{lines:r,fallback:s}=xP(e.getClientRects());if(r.length<2)return null;const i=n==null?void 0:n.x,l=n==null?void 0:n.y,c=t[0];if((n==null?void 0:n.lineIndex)!=null&&r[n.lineIndex])return BM(r[n.lineIndex]);if(i!=null&&l!=null){const b=bP(r,i,l);if(b!==-1)return BM(r[b])}if(r.length===2&&r[0].left>r[1].right&&i!=null&&l!=null)return s;if(c==="t"||c==="b"){const b=r[0],w=r[r.length-1],E=c==="t"?b:w;return Z0(E.left,b.top,E.right,w.bottom)}const u=c==="l";let d=r[0].left,h=r[0].right,m=u?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,g=r[0],y=r[0];for(const b of r){d=Math.min(d,b.left),h=Math.max(h,b.right);const w=u?b.left:b.right;u&&w<m||!u&&w>m?(m=w,g=b,y=b):w===m&&(y=b)}return Z0(d,g.top,h,y.bottom)}function PY(e){return"contextElement"in e&&e.contextElement?e.contextElement:bt(e)?e:void 0}function zY(e,t){function n(s){vP(e,s.currentTarget,s.clientX,s.clientY)}function r(s){t||n(s)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function vP(e,t,n,r){const s=jY(t,n,r);return e.current=s,s}function BY(e){return{name:"inline",async fn(t){const n=t.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!="function")return{};const r=PY(n),s=e.current,i=(s==null?void 0:s.element)===n||(s==null?void 0:s.element)===r?s:void 0,l=LY(n,t.placement,i);if(!l||typeof t.platform.getElementRects!="function")return{};const c=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return l}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===c.reference.x&&t.rects.reference.y===c.reference.y&&t.rects.reference.width===c.reference.width&&t.rects.reference.height===c.reference.height?{}:{reset:{rects:c}}}}}var vC=zj();const cw=[];let uw;function HY(){return uw}function FY(e){cw.push(e)}function ud(e){const t=(n,r)=>{const s=Tr($Y).current;let i;try{uw=s;for(const l of cw)l.before(s);i=e(n,r);for(const l of cw)l.after(s);s.didInitialize=!0}finally{uw=void 0}return i};return t.displayName=e.displayName||e.name,t}function tx(e){return O.forwardRef(ud(e))}function $Y(){return{didInitialize:!1}}const VY=GE(19),UY=VY?GY:KY;function SP(e,t,n,r,s){return UY(e,t,n,r,s)}function qY(e,t,n,r,s){const i=O.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return vC.useSyncExternalStore(e.subscribe,i,i)}FY({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),vC.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function GY(e,t,n,r,s){const i=HY();if(!i)return qY(e,t,n,r,s);const l=i.syncIndex;i.syncIndex+=1;let c;return i.didInitialize?(c=i.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,s))&&(c.store!==e&&(i.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=s,c.value=t(e.getSnapshot(),n,r,s))):(c={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},i.syncHooks.push(c)),c.value}function KY(e,t,n,r,s){return zE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,r,s))}class YY{constructor(t){_t(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));_t(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return SP(this,t,n,r,s)}}class fd extends YY{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){O.useDebugValue(t);const r=this;ze(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ze(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ze(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){O.useDebugValue(t);const r=this,s=n!==void 0;ze(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const i=this.selectors[t];return i(this.state,n,r,s)}useState(t,n,r,s){return O.useDebugValue(t),SP(this,this.selectors[t],n,r,s)}useContextCallback(t,n){O.useDebugValue(t);const r=Qe(n??Bn);this.context[t]=r}useStateSetter(t){const n=O.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(i=>{const l=r(i);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}const WY={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class wP extends fd{constructor(n){const{syncOnly:r,nested:s,onOpenChange:i,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:lP(),nested:s,triggerElements:l},WY);_t(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&oK(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});_t(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});_t(this,"setOpen",(n,r)=>{var s,i,l,c;if(this.syncOnly){(i=(s=this.context).onOpenChange)==null||i.call(s,n,r);return}this.dispatchOpenChange(n,r),(c=(l=this.context).onOpenChange)==null||c.call(l,n,r)});this.syncOnly=r}}function EP(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:i,onOpenChange:l}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),d=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,m=l,g=O.useRef(null);r===void 0&&g.current===null&&(g.current=new wP({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:d,triggerElements:h,onOpenChange:m,floatingId:s,syncOnly:!0,nested:i}));const y=r??g.current;return t.useSyncedValue("floatingId",s),ze(()=>{const b={open:c,floatingId:s,referenceElement:u,floatingElement:d};bt(u)&&(b.domReferenceElement=u),y.state.positionReference===y.state.referenceElement&&(b.positionReference=u),y.update(b)},[c,s,u,d,y]),y.context.onOpenChange=m,y.context.nested=i,y}function CP(e,t=!1,n=!1,r=!1){const[s,i]=O.useState(e&&t?"idle":void 0),[l,c]=O.useState(e&&!r);return e&&!l&&(c(!0),i("starting")),!e&&l&&s!=="ending"&&!n&&i("ending"),!e&&!l&&s==="ending"&&i(void 0),ze(()=>{if(!e&&l&&s!=="ending"&&n){const u=Qi.request(()=>{i("ending")});return()=>{Qi.cancel(u)}}},[e,l,s,n]),ze(()=>{if(!e||t)return;const u=Qi.request(()=>{i(void 0)});return()=>{Qi.cancel(u)}},[t,e]),ze(()=>{if(!e||!t)return;e&&l&&s!=="idle"&&i("starting");const u=Qi.request(()=>{i("idle")});return()=>{Qi.cancel(u)}},[t,e,l,s]),{mounted:l,setMounted:c,transitionStatus:s}}let Vg=null;function XY(e){if(!Vg){const t=[];Vg=t,queueMicrotask(()=>{Vg=null,Bs.flushSync(()=>{for(const n of t)n()})})}Vg.push(e)}function nx(e,t=!1,n=!1){const r=ip();return Qe((s,i=null)=>{r.cancel();const l=Io(e);if(l==null)return;const c=l,u=()=>{if(!n){Bs.flushSync(s);return}XY(()=>{i!=null&&i.aborted||s()})};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{i!=null&&i.aborted||u()},()=>{if(i!=null&&i.aborted)return;if(c.getAnimations().some(m=>m.pending||m.playState!=="finished")){d();return}u()})}if(t){const h=jL;if(!c.hasAttribute(h)){r.request(d);return}const m=new MutationObserver(()=>{c.hasAttribute(h)||(m.disconnect(),d())});m.observe(c,{attributes:!0,attributeFilter:[h]}),i==null||i.addEventListener("abort",()=>m.disconnect(),{once:!0});return}r.request(d)})}function ou(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:i}=e,l=Qe(i),c=nx(r,n,s);O.useEffect(()=>{if(!t)return;const u=new AbortController;return c(l,u.signal),()=>{u.abort()}},[t,n,l,c])}const Vp={tabIndex:-1,[nw]:""};function NP(e){return t=>t==="touch"?e.current:!0}function rx(e,t=!1){const n=Uf(),r=iu()!=null,s=Tr(()=>e(n,r)).current;return EP({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Up({handle:e,store:t}){return ze(()=>e.attachStore(t),[e,t]),null}function HM(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function QY(e,t){const n=O.useRef(null);return Qe(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const i=s.store;i.context.triggerElements.getById(s.id)===s.element&&(i.context.triggerElements.delete(s.id),HM(i))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),HM(t))})}function sx(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const i=(n==null?void 0:n.id)??null;let l=e.activeTriggerId,c=e.activeTriggerElement;return(i||t)&&(l=i,c=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:l,activeTriggerElement:c}}function SC(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function TP(e,t,n,r={}){var h,m,g;const s=n.reason,i=s===xn,l=t&&s===bf,c=!t&&(s===rl||s===Bp),u=SC(n);if((m=(h=e.context).onOpenChange)==null||m.call(h,t,n),n.isCanceled)return;(g=r.onBeforeDispatch)==null||g.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const d=()=>{const y=sx(e.state,t,n.trigger,u()),b={...r.extraState,...y};l?b.instantType="focus":c?b.instantType="dismiss":i&&(b.instantType=void 0),e.update(b)};i?Bs.flushSync(d):d()}function ix(e,t,n,r){const s=n.useState("isMountedByTrigger",e),i=QY(e,n),l=Qe(u=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){const m={activeTriggerElement:u,...d?r:null};n.update(m);return}if(h==null&&d){const m={activeTriggerId:e??null,activeTriggerElement:u,...r};n.update(m)}}),c=Qe(u=>{i(u),u&&l(u)});return ze(()=>(c(t.current),()=>c(null)),[c,t,n,e]),ze(()=>{if(s){const u={activeTriggerElement:t.current,...r};n.update(u)}},[s,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:s}}function qp(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=O.useRef(null),s=e.useState("open"),i=e.useState("triggerCount"),l=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");ze(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,d={};e.state.triggerCount!==u&&(d.triggerCount=u);const h=e.select("activeTriggerId");let m=null;if(h){const g=e.context.triggerElements.getById(h);if(g)r.current=h,g!==e.state.activeTriggerElement&&(d.activeTriggerElement=g);else{for(const[y,b]of e.context.triggerElements.entries())if(b===e.state.activeTriggerElement){d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y;break}d.activeTriggerId===void 0&&(r.current===h?m=h:r.current=null)}}else r.current=null;if(!m&&!h&&u===1){const g=e.context.triggerElements.entries().next();if(!g.done){const[y,b]=g.value;d.activeTriggerId=y,d.activeTriggerElement=b,r.current=y}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&e.update(d),m&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===m&&!e.context.triggerElements.getById(m)){const g=gt(qy);e.setOpen(!1,g),g.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,i,l,c,n])}function Gp(e,t,n,r){const{mounted:s,setMounted:i,transitionStatus:l}=CP(e,!1,!1,r),c=t.useState("preventUnmountingOnClose"),u=e?!1:c;t.useSyncedValues({mounted:s,transitionStatus:l,preventUnmountingOnClose:u});const d=Qe(()=>{var h,m;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(m=(h=t.context).onOpenChangeComplete)==null||m.call(h,!1)});return ou({enabled:s&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:l}}function Kp(e,t){e.useSyncedValues(t),ze(()=>()=>{e.update({activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn})},[e])}function RP(e,t){ze(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ze(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yp{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Wp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wP({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn}}const Ph=e=>e.triggerIdProp??e.activeTriggerId,wC=e=>e.openProp??e.open,FM=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function OP(e,t){return t!==void 0&&wC(e)&&Ph(e)===t}function ZY(e,t){return OP(e,t)?!0:t!==void 0&&wC(e)&&Ph(e)==null&&e.triggerCount===1}const Xp={open:wC,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ph,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:FM,isTriggerActive:(e,t)=>t!==void 0&&Ph(e)===t,isOpenedByTrigger:(e,t)=>OP(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ph(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ZY(e,t)?FM(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ox(e){const t=O.useCallback(r=>e===void 0?Bn:e.subscribeStore(r),[e]),n=O.useCallback(()=>e===void 0?void 0:e.store,[e]);return vC.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function JY(e){return eW(e,e.rootContext)}function eW(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),i=t.useState("floatingElement"),l=t.useState("domReferenceElement"),c=t.useState("open"),u=t.useState("floatingId"),[d,h]=O.useState(null),[m,g]=O.useState(void 0),[y,b]=O.useState(void 0),w=O.useRef(null),E=_a(r),C=O.useMemo(()=>({reference:s,floating:i,domReference:l}),[s,i,l]),T=OY({...e,elements:{...C,...d&&{reference:d}}}),N=bt(m)?m:null,R=y===void 0?t.state.floatingElement:y;t.useSyncedValue("referenceElement",m??null),t.useSyncedValue("domReferenceElement",m===void 0?l:N),t.useSyncedValue("floatingElement",R);const M=O.useCallback(H=>{const z=bt(H)?{getBoundingClientRect:()=>H.getBoundingClientRect(),getClientRects:()=>H.getClientRects(),contextElement:H}:H;h(z),T.refs.setReference(z)},[T.refs]),D=O.useCallback(H=>{(bt(H)||H===null)&&(w.current=H,g(H)),(bt(T.refs.reference.current)||T.refs.reference.current===null||H!==null&&!bt(H))&&T.refs.setReference(H)},[T.refs,g]),k=O.useCallback(H=>{b(H),T.refs.setFloating(H)},[T.refs]),I=O.useMemo(()=>({...T.refs,setReference:D,setFloating:k,setPositionReference:M,domReference:w}),[T.refs,D,k,M]),_=O.useMemo(()=>({...T.elements,domReference:l}),[T.elements,l]),P=O.useMemo(()=>({...T,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:u,refs:I,elements:_,nodeId:n,rootStore:t}),[T,I,_,n,t,c,u]);return ze(()=>{l&&(w.current=l)},[l]),ze(()=>{t.context.dataRef.current.floatingContext=P;const H=E==null?void 0:E.nodesRef.current.find(z=>z.id===n);H&&(H.context=P)}),O.useMemo(()=>({...T,context:P,refs:I,elements:_,rootStore:t}),[T,I,_,P,t])}const HS=rC&&Aa;function EC(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:i,dataRef:l}=s.context,c=O.useRef(!1),u=O.useRef(null),d=O.useRef(!0),h=Jr();O.useEffect(()=>{const g=s.select("domReferenceElement");if(!n)return;const y=vn(g);function b(){const C=s.select("domReferenceElement");!s.select("open")&&Zt(C)&&C===Xr(Dt(C))&&(c.current=!0,u.current=C)}function w(){d.current=!0}function E(){d.current=!1}return no(xt(y,"blur",b),HS&&xt(y,"keydown",w,!0),HS&&xt(y,"pointerdown",E,!0))},[s,n]),O.useEffect(()=>{if(!n)return;function g(y){if(y.reason===rl||y.reason===Bp){const b=s.select("domReferenceElement");bt(b)&&(u.current=b,c.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,n,s]);const m=O.useMemo(()=>{function g(){c.current=!1,u.current=null}return{onMouseLeave(){g()},onFocus(y){const b=y.currentTarget;if(c.current){if(u.current===b)return;g()}const w=Zr(y.nativeEvent);if(bt(w)){if(HS&&!y.relatedTarget){if(!d.current&&!Xy(w))return}else if(!cK(w))return}const E=K0(y.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:T}=y,N=typeof r=="function"?r():r;if(s.select("open")&&E||N===0||N===void 0){s.setOpen(!0,gt(bf,C,T));return}h.start(N,()=>{c.current||s.setOpen(!0,gt(bf,C,T))})},onBlur(y){g();const b=y.relatedTarget,w=y.nativeEvent,E=bt(b)&&b.hasAttribute(op("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{var R;const C=s.select("domReferenceElement"),T=Xr(Dt(C));!b&&T===C||Je((R=l.current.floatingContext)==null?void 0:R.refs.floating.current,T)||Je(C,T)||E||K0(b??T,s.context.triggerElements)||s.setOpen(!1,gt(bf,w))})}}},[l,r,s,h]);return O.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}class CC{constructor(){_t(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});_t(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 si,this.restTimeout=new si,this.handleCloseOptions=void 0}static create(){return new CC}}const J0=new WeakMap;function ey(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&J0.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),J0.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kP(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,i=J0.get(n);i&&i!==e&&ey(i),ey(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,J0.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function NC(e){const t=e.context.dataRef.current,n=Tr(()=>t.hoverInteractionState??CC.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),nC(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function lx(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,i="rootStore"in e?e.rootStore:e,l=i.useState("open"),c=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,h=_a(),m=iu(),g=NC(i),y=Jr(),b=Qe(()=>{var C;return FL((C=d.current.openEvent)==null?void 0:C.type,g.interactedInside)}),w=Qe(()=>{var C;return fK((C=d.current.openEvent)==null?void 0:C.type)}),E=Qe(()=>{ey(g)});ze(()=>{l||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,E())},[l,g,E]),O.useEffect(()=>E,[E]),ze(()=>{var C,T,N,R,M;if(n&&l&&(C=g.handleCloseOptions)!=null&&C.blockPointerEvents&&w()&&bt(u)&&c){const D=u,k=c,I=Dt(c),_=(N=(T=h==null?void 0:h.nodesRef.current.find(U=>U.id===m))==null?void 0:T.context)==null?void 0:N.elements.floating;_&&(_.style.pointerEvents="");const P=g.pointerEventsScopeElement!==k?g.pointerEventsScopeElement:null,H=_!==k?_:null,z=((M=(R=g.handleCloseOptions)==null?void 0:R.getScope)==null?void 0:M.call(R))??P??H??D.closest("[data-rootownerid]")??I.body;return kP(g,{scopeElement:z,referenceElement:D,floatingElement:k}),()=>{E()}}},[n,l,u,c,g,w,h,m,E]),O.useEffect(()=>{if(!n)return;function C(){return!!(h&&m&&Ra(h.nodesRef.current,m).length>0)}function T(I){const _=sp(r,"close",g.pointerType),P=()=>{i.setOpen(!1,gt(xn,I)),h==null||h.events.emit("floating.closed",I)};_?g.openChangeTimeout.start(_,P):(g.openChangeTimeout.clear(),P())}function N(I){const _=Zr(I);if(!aK(_)){g.interactedInside=!1;return}g.interactedInside=(_==null?void 0:_.closest("[aria-haspopup]"))!=null}function R(){g.openChangeTimeout.clear(),y.clear(),h==null||h.events.off("floating.closed",D),E()}function M(I){var z;if(C()&&h){h.events.on("floating.closed",D);return}if(K0(I.relatedTarget,i.context.triggerElements))return;const _=((z=d.current.floatingContext)==null?void 0:z.nodeId)??s,P=I.relatedTarget;if(!(h&&_&&bt(P)&&Ra(h.nodesRef.current,_,!1).some(U=>{var j;return Je((j=U.context)==null?void 0:j.elements.floating,P)}))){if(g.handler){g.handler(I);return}E(),w()&&!b()&&T(I)}}function D(I){!h||!m||C()||y.start(0,()=>{h.events.off("floating.closed",D),i.setOpen(!1,gt(xn,I)),h.events.emit("floating.closed",I)})}const k=c;return no(k&&xt(k,"mouseenter",R),k&&xt(k,"mouseleave",M),k&&xt(k,"pointerdown",N,!0),()=>{h==null||h.events.off("floating.closed",D)})},[n,c,i,d,r,s,w,b,E,g,h,m,y])}const tW={current:null};function ax(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:i=!1,restMs:l=0,move:c=!0,triggerElementRef:u=tW,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g,shouldOpen:y,guardStaleOpen:b=!1}=t,w="rootStore"in e?e.rootStore:e,{dataRef:E,events:C}=w.context,T=_a(d),N=NC(w),R=O.useRef(!1),M=Hn(s),D=Hn(r),k=Hn(l),I=Hn(n),_=Hn(y),P=Hn(g),H=Qe(()=>{var L;return FL((L=E.current.openEvent)==null?void 0:L.type,N.interactedInside)}),z=Qe(()=>{var L;return((L=_.current)==null?void 0:L.call(_))!==!1}),U=Qe((L,$,q)=>{const G=w.context.triggerElements;if(G.hasElement($))return!L||!Je(L,$);if(!bt(q))return!1;const W=q;return G.hasMatchingElement(Z=>Je(Z,W))&&(!L||!Je(L,W))}),j=Qe(()=>{if(!N.handler)return;Dt(w.select("domReferenceElement")).removeEventListener("mousemove",N.handler),N.handler=void 0}),B=Qe(()=>{ey(N)});return h&&(N.handleCloseOptions=s==null?void 0:s.__options),O.useEffect(()=>j,[j]),O.useEffect(()=>{if(!n)return;function L($){$.open?R.current=!1:(R.current=$.reason===xn,j(),N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1)}return C.on("openchange",L),()=>{C.off("openchange",L)}},[n,C,N,j]),O.useEffect(()=>{if(!n)return;function L(re,de=!0){const F=sp(D.current,"close",N.pointerType);F?N.openChangeTimeout.start(F,()=>{w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re)}):de&&(N.openChangeTimeout.clear(),w.setOpen(!1,gt(xn,re)),T==null||T.events.emit("floating.closed",re))}const $=u.current??(h?w.select("domReferenceElement"):null);if(!bt($))return;function q(re){var we;if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,i&&!ha(N.pointerType))return;const de=yM(k.current),F=sp(D.current,"open",N.pointerType),X=Zr(re),te=re.currentTarget??null,J=w.select("domReferenceElement");let K=te;if(bt(X)&&!w.context.triggerElements.hasElement(X)){for(const Re of w.context.triggerElements.elements())if(Je(Re,X)){K=Re;break}}bt(te)&&bt(J)&&!w.context.triggerElements.hasElement(te)&&Je(te,J)&&(K=J);const ce=K==null?!1:U(J,K,X),ye=w.select("open"),ge=((we=P.current)==null?void 0:we.call(P))??w.select("transitionStatus")==="ending",oe=!ye&&ge&&R.current,xe=!ce&&bt(K)&&bt(J)&&Je(J,K)&&oe,Se=de>0&&!F,ke=ce&&(ye||oe)||xe,_e=!ye||ce;if(ke){z()&&w.setOpen(!0,gt(xn,re,K));return}Se||(F?N.openChangeTimeout.start(F,()=>{_e&&z()&&w.setOpen(!0,gt(xn,re,K))}):_e&&z()&&w.setOpen(!0,gt(xn,re,K)))}function G(re){if(H()){B();return}j();const de=w.select("domReferenceElement"),F=Dt(de);N.restTimeout.clear(),N.restTimeoutPending=!1;const X=E.current.floatingContext??(m==null?void 0:m());if(K0(re.relatedTarget,w.context.triggerElements))return;if(M.current&&X){w.select("open")||N.openChangeTimeout.clear();const J=u.current;N.handler=M.current({...X,tree:T,x:re.clientX,y:re.clientY,onClose(){B(),j(),I.current&&!H()&&J===w.select("domReferenceElement")&&L(re,!0)}}),F.addEventListener("mousemove",N.handler),N.handler(re);return}(N.pointerType==="touch"?!Je(w.select("floatingElement"),re.relatedTarget):!0)&&L(re)}function W(re){Je($,re.relatedTarget)||(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1)}const Z=b?xt($,"mouseout",W):void 0;return c?no(xt($,"mousemove",q,{once:!0}),xt($,"mouseenter",q),xt($,"mouseleave",G),Z):no(xt($,"mouseenter",q),xt($,"mouseleave",G),Z)},[j,B,E,D,w,n,M,N,h,U,H,i,c,k,u,T,I,m,P,z,b]),O.useMemo(()=>{if(!n)return;function L($){N.pointerType=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){var X,te,J;const{nativeEvent:q}=$,G=$.currentTarget,W=w.select("domReferenceElement"),Z=w.select("open"),re=U(W,G,$.target);if(i&&!ha(N.pointerType))return;if(Z&&re&&((X=N.handleCloseOptions)!=null&&X.blockPointerEvents)){const K=w.select("floatingElement");if(K){const ce=((J=(te=N.handleCloseOptions)==null?void 0:te.getScope)==null?void 0:J.call(te))??G.ownerDocument.body;kP(N,{scopeElement:ce,referenceElement:G,floatingElement:K})}}const de=yM(k.current);if(Z&&!re||de===0||!re&&N.restTimeoutPending&&$.movementX**2+$.movementY**2<2)return;N.restTimeout.clear();function F(){if(N.restTimeoutPending=!1,H())return;const K=w.select("open");!N.blockMouseMove&&(!K||re)&&z()&&w.setOpen(!0,gt(xn,q,G))}N.pointerType==="touch"?Bs.flushSync(()=>{F()}):re&&Z?F():(N.restTimeoutPending=!0,N.restTimeout.start(de,F))}}},[n,N,H,U,i,w,k,z])}const nW="Escape";function $M(e){return Aa&&e.movementX===0&&e.movementY===0}function cx(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ug(e,t){return cx(t,e===HL||e===lC,e===Yy||e===Wy)}function FS(e,t,n){return cx(t,e===lC,n?e===Yy:e===Wy)||e==="Enter"||e===" "||e===""}function rW(e,t,n){return cx(t,n?e===Yy:e===Wy,e===lC)}function sW(e,t,n,r){const s=n?e===Wy:e===Yy,i=e===HL;return t==="both"||t==="horizontal"&&r?e===nW:cx(t,s,i)}function iW(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:u=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:E="vertical",parentOrientation:C,id:T,resetOnPointerLeave:N=!0,externalTree:R,grid:M}=t,D=M!=null,k="rootStore"in e?e.rootStore:e,I=k.useState("open"),_=k.useState("floatingElement"),P=k.useState("domReferenceElement"),H=k.context.dataRef,z=iw(_),U=sw(P),j=Hn(z),B=iu(),L=_a(R),$=O.useRef(g),q=O.useRef(l??-1),G=O.useRef(null),W=O.useRef(!0),Z=Qe(Oe=>{s(q.current===-1?null:q.current,Oe)}),re=O.useRef(!!_),de=O.useRef(I),F=O.useRef(!1),X=O.useRef(!1),te=O.useRef(null),J=Hn(w),K=Hn(I),ce=Hn(l),ye=Hn(N),ge=ip(),oe=ip(),xe=Qe(()=>{function Oe(se){m?L==null||L.events.emit("virtualfocus",se):te.current=N0(se,{sync:F.current,preventScroll:!0})}const De=n.current[q.current],ne=X.current;De&&Oe(De),(F.current?se=>se():se=>ge.request(se))(()=>{var Ve;const se=n.current[q.current]||De;if(!se)return;De||Oe(se),Ae&&(ne||!W.current)&&((Ve=se.scrollIntoView)==null||Ve.call(se,{block:"nearest",inline:"nearest"}))})});ze(()=>{H.current.orientation=E},[H,E]),ze(()=>{i&&(I&&_?(q.current=l??-1,$.current&&l!=null&&(X.current=!0,Z())):re.current&&(q.current=-1,Z()))},[i,I,_,l,Z]),ze(()=>{if(i){if(!I){F.current=!1;return}if(_)if(r==null){if(F.current=!1,ce.current!=null)return;if(re.current&&(q.current=-1,xe()),(!de.current||!re.current)&&$.current&&(G.current!=null||$.current===!0&&G.current==null)){let Oe=0;const De=()=>{n.current[0]==null?(Oe<2&&(Oe?he=>oe.request(he):queueMicrotask)(De),Oe+=1):(q.current=G.current==null||FS(G.current,E,h)||d?IS(n):SM(n),G.current=null,Z())};De()}}else vM(n.current,r)||(q.current=r,xe(),X.current=!1)}},[i,I,_,r,ce,d,n,E,h,Z,xe,oe]),ze(()=>{var se,Te;if(!i||_||!L||m||!re.current)return;const Oe=L.nodesRef.current,De=(Te=(se=Oe.find(Ve=>Ve.id===B))==null?void 0:se.context)==null?void 0:Te.elements.floating,ne=Xr(Dt(P??De??null)),he=Oe.some(Ve=>Ve.context&&Je(Ve.context.elements.floating,ne));De&&!he&&W.current&&De.focus({preventScroll:!0})},[i,_,P,L,B,m]),ze(()=>{de.current=I,re.current=!!_}),ze(()=>{I||(G.current=null,$.current=g)},[I,g]);const Se=r!=null,ke=Qe(Oe=>{if(!K.current)return;const De=n.current.indexOf(Oe.currentTarget);De!==-1&&(q.current!==De||r!==De)&&(q.current=De,Z(Oe))}),_e=Qe(()=>{var Oe,De,ne;return C??((ne=(De=(Oe=L==null?void 0:L.nodesRef.current.find(he=>he.id===B))==null?void 0:Oe.context)==null?void 0:De.dataRef)==null?void 0:ne.current.orientation)}),we=Qe(()=>IS(n,J.current)),Re=Qe(Oe=>{if(W.current=!1,F.current=!0,Oe.which===229||!K.current&&Oe.currentTarget===j.current)return;if(d&&sW(Oe.key,E,h,D)){Ug(Oe.key,_e())||Ki(Oe),k.setOpen(!1,gt(ew,Oe.nativeEvent)),Zt(P)&&(m?L==null||L.events.emit("virtualfocus",P):P.focus());return}const De=q.current,ne=IS(n,w),he=SM(n,w);if(U||(Oe.key==="Home"&&(Ki(Oe),q.current=ne,Z(Oe)),Oe.key==="End"&&(Ki(Oe),q.current=he,Z(Oe))),M!=null){const se=M(Oe,q.current,n,E,u,h,w,ne,he);if(se!=null&&(q.current=se,Z(Oe)),E==="both")return}if(Ug(Oe.key,E)){if(Ki(Oe),I&&!m&&Xr(Oe.currentTarget.ownerDocument)===Oe.currentTarget){q.current=FS(Oe.key,E,h)?ne:he,Z(Oe);return}FS(Oe.key,E,h)?u?De>=he?c&&De!==n.current.length?q.current=-1:(F.current=!1,q.current=ne):q.current=ff(n.current,{startingIndex:De,disabledIndices:w}):q.current=Math.min(he,ff(n.current,{startingIndex:De,disabledIndices:w})):u?De<=ne?c&&De!==-1?q.current=n.current.length:(F.current=!1,q.current=he):q.current=ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w}):q.current=Math.max(ne,ff(n.current,{startingIndex:De,decrement:!0,disabledIndices:w})),vM(n.current,q.current)&&(q.current=-1),Z(Oe)}}),Ae=O.useMemo(()=>({onFocus(De){F.current=!0,ke(De)},onClick:({currentTarget:De})=>De.focus({preventScroll:!0}),onMouseMove(De){$M(De)||(F.current=!0,X.current=!1,y&&ke(De))},onPointerLeave(De){var he;if(!K.current||!W.current||De.pointerType==="touch")return;F.current=!0;const ne=De.relatedTarget;if(!(!y||n.current.includes(ne))&&ye.current&&((he=te.current)==null||he.call(te),te.current=null,q.current=-1,Z(De),!m)){const se=j.current,Te=Xr(Dt(se));se&&Je(se,Te)&&se.focus({preventScroll:!0})}}}),[ke,K,j,y,n,Z,ye,m]),Le=O.useMemo(()=>m&&I&&Se&&{"aria-activedescendant":`${T}-${r}`},[m,I,Se,T,r]),Ie=O.useMemo(()=>({...U?{}:Le,onKeyDown(Oe){if(Oe.key==="Tab"&&Oe.shiftKey&&I&&!m){const De=Zr(Oe.nativeEvent);if(De&&!Je(j.current,De))return;Ki(Oe),k.setOpen(!1,gt(Bc,Oe.nativeEvent)),Zt(P)&&P.focus();return}Re(Oe)},onPointerMove(Oe){$M(Oe)||(W.current=!0)}}),[Le,Re,j,U,k,I,m,P]),Ue=O.useMemo(()=>{function Oe(he){k.setOpen(!0,gt(ew,he.nativeEvent,he.currentTarget))}function De(he){g==="auto"&&iC(he.nativeEvent)&&($.current=!m)}function ne(he){$.current=g,g==="auto"&&oC(he.nativeEvent)&&($.current=!0)}return{onKeyDown(he){const se=k.select("open");W.current=!1;const Te=he.key.startsWith("Arrow"),Ve=rW(he.key,_e(),h),jt=Ug(he.key,E),hn=(d?Ve:jt)||he.key==="Enter"||he.key.trim()==="";if(m&&se)return Re(he);if(!(!se&&!b&&Te)){if(hn){const Fe=Ug(he.key,_e());G.current=d&&Fe?null:he.key}if(d){Ve&&(Ki(he),se?(q.current=we(),Z(he)):Oe(he));return}jt&&(ce.current!=null&&(q.current=ce.current),Ki(he),!se&&b?Oe(he):Re(he),se&&Z(he))}},onFocus(he){k.select("open")&&!m&&(q.current=-1,Z(he))},onPointerDown:ne,onPointerEnter:ne,onMouseDown:De,onClick:De}},[Re,g,we,d,Z,k,b,E,_e,h,ce,m]),We=O.useMemo(()=>({...Le,...Ue}),[Le,Ue]);return O.useMemo(()=>i?{reference:We,floating:Ie,item:Ae,trigger:Ue}:{},[i,We,Ie,Ue,Ae])}function oW(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:i,disabledIndices:l,onTyping:c,enabled:u=!0,resetMs:d=750,selectedIndex:h=null}=t,m="rootStore"in e?e.rootStore:e,g=m.useState("open"),y=Jr(),b=O.useRef(""),w=O.useRef(h??s??-1),E=O.useRef(null),C=Qe(R=>{function M(j){return r==null?void 0:r.current[j]}function D(j){const B=M(j);return B&&!Qy(B)||B!=null&&B.matches(":disabled")?!1:l==null||!UL(Zh,j,l)}function k(j,B,L=0){if(j.length===0)return-1;const $=(L%j.length+j.length)%j.length,q=B.toLowerCase();for(let G=0;G<j.length;G+=1){const W=($+G)%j.length,Z=j[W];if(!(!(Z!=null&&Z.toLowerCase().startsWith(q))||!D(W)))return W}return-1}const I=n.current;if(b.current.length>0&&R.key===" "&&(Ki(R),c==null||c(!0)),b.current.length>0&&b.current[0]!==" "&&k(I,b.current)===-1&&R.key!==" "&&(c==null||c(!1)),I==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(Ki(R),c==null||c(!0));const _=b.current==="";_&&(w.current=h??s??-1),I.every((j,B)=>{var L,$;return j&&D(B)?((L=j[0])==null?void 0:L.toLowerCase())!==(($=j[1])==null?void 0:$.toLowerCase()):!0})&&b.current===R.key&&(b.current="",w.current=E.current),b.current+=R.key,y.start(d,()=>{b.current="",w.current=E.current,c==null||c(!1)});const z=((_?h??s??-1:w.current)??0)+1,U=k(I,b.current,z);U!==-1?(i==null||i(U),E.current=U):R.key!==" "&&(b.current="",c==null||c(!1))}),T=Qe(R=>{const M=R.relatedTarget,D=m.select("domReferenceElement"),k=m.select("floatingElement");Je(D,M)||Je(k,M)||(y.clear(),b.current="",w.current=E.current,c==null||c(!1))});ze(()=>{!g&&h!==null||(y.clear(),E.current=null,b.current!==""&&(b.current=""))},[g,h,y]);const N=O.useMemo(()=>({onKeyDown:C,onBlur:T}),[C,T]);return O.useMemo(()=>u?{reference:N,floating:N}:{},[u,N])}const VM=.1,lW=VM*VM,Yt=.5;function qg(e,t,n,r,s,i){return r>=t!=i>=t&&e<=(s-n)*(t-r)/(i-r)+n}function Gg(e,t,n,r,s,i,l,c,u,d){let h=!1;return qg(e,t,n,r,s,i)&&(h=!h),qg(e,t,s,i,l,c)&&(h=!h),qg(e,t,l,c,u,d)&&(h=!h),qg(e,t,u,d,n,r)&&(h=!h),h}function aW(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Kg(e,t,n,r,s,i){const l=Math.min(n,s),c=Math.max(n,s),u=Math.min(r,i),d=Math.max(r,i);return e>=l&&e<=c&&t>=u&&t<=d}function ux(e={}){const{blockPointerEvents:t=!1}=e,n=new si,r=({x:s,y:i,placement:l,elements:c,onClose:u,nodeId:d,tree:h})=>{const m=l==null?void 0:l.split("-")[0];let g=!1,y=null,b=null,w=typeof performance<"u"?performance.now():0;function E(T,N){const R=performance.now(),M=R-w;if(y===null||b===null||M===0)return y=T,b=N,w=R,!1;const D=T-y,k=N-b,I=D*D+k*k,_=M*M*lW;return y=T,b=N,w=R,I<_}function C(){n.clear(),u()}return function(N){n.clear();const R=c.domReference,M=c.floating;if(!R||!M||m==null||s==null||i==null)return;const{clientX:D,clientY:k}=N,I=Zr(N),_=N.type==="mouseleave",P=Je(M,I),H=Je(R,I);if(P&&(g=!0,!_))return;if(H&&(g=!1,!_)){g=!0;return}if(_&&bt(N.relatedTarget)&&Je(M,N.relatedTarget))return;function z(){return!!(h&&Ra(h.nodesRef.current,d).length>0)}function U(){z()||C()}if(z())return;const j=R.getBoundingClientRect(),B=M.getBoundingClientRect(),L=s>B.right-B.width/2,$=i>B.bottom-B.height/2,q=B.width>j.width,G=B.height>j.height,W=(q?j:B).left,Z=(q?j:B).right,re=(G?j:B).top,de=(G?j:B).bottom;if(m==="top"&&i>=j.bottom-1||m==="bottom"&&i<=j.top+1||m==="left"&&s>=j.right-1||m==="right"&&s<=j.left+1){U();return}let F=!1;switch(m){case"top":F=Kg(D,k,W,j.top+1,Z,B.bottom-1);break;case"bottom":F=Kg(D,k,W,B.top+1,Z,j.bottom-1);break;case"left":F=Kg(D,k,B.right-1,de,j.left+1,re);break;case"right":F=Kg(D,k,j.right-1,de,B.left+1,re);break}if(F)return;if(g&&!aW(D,k,j)){U();return}if(!_&&E(D,k)){U();return}let X=!1;switch(m){case"top":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i+Yt+1,ye=L||q?B.bottom-Yt:B.top,ge=L?q?B.bottom-Yt:B.top:B.bottom-Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"bottom":{const te=q?Yt/2:Yt*4,J=q||L?s+te:s-te,K=q?s-te:L?s+te:s-te,ce=i-Yt,ye=L||q?B.top+Yt:B.bottom,ge=L?q?B.top+Yt:B.bottom:B.top+Yt;X=Gg(D,k,J,ce,K,ce,B.left,ye,B.right,ge);break}case"left":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s+Yt+1,ye=$||G?B.right-Yt:B.left,ge=$?G?B.right-Yt:B.left:B.right-Yt;X=Gg(D,k,ye,B.top,ge,B.bottom,ce,J,ce,K);break}case"right":{const te=G?Yt/2:Yt*4,J=G||$?i+te:i-te,K=G?i-te:$?i+te:i-te,ce=s-Yt,ye=$||G?B.left+Yt:B.right,ge=$?G?B.left+Yt:B.right:B.left+Yt;X=Gg(D,k,ce,J,ce,K,ye,B.top,ge,B.bottom);break}}X?g||n.start(40,U):U()}};return r.__options={...e,blockPointerEvents:t},r}const MP=O.createContext(void 0);function cW(){const e=O.useContext(MP);if(e===void 0)throw new Error(wn(26));return e}const uW="ArrowUp",fW="ArrowDown",dW="ArrowLeft",hW="ArrowRight",pW="Home",mW="End",TC=new Set([uW,fW,dW,hW,pW,mW]),gW="--nested-dialogs",yW="data-nested-dialog-open",xW={...Uy,...ZE,nestedDialogOpen(e){return e?{[yW]:""}:null}},AP=O.forwardRef(function(t,n){const{render:r,className:s,style:i,finalFocus:l,initialFocus:c,...u}=t,d=su(),h=d.useState("descriptionElementId"),m=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),y=d.useState("popupProps"),b=d.useState("modal"),w=d.useState("mounted"),E=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),T=d.useState("open"),N=d.useState("openMethod"),R=d.useState("titleElementId"),M=d.useState("transitionStatus"),D=d.useState("role"),k=g.useState("floatingId");cW(),ou({open:T,ref:d.context.popupRef,onComplete(){var U,j;T&&((j=(U=d.context).onOpenChangeComplete)==null||j.call(U,!0))}});const I=c===void 0?NP(d.context.popupRef):c,_=C>0,P=d.useStateSetter("popupElement"),z=dn("div",t,{state:{open:T,nested:E,transitionStatus:M,nestedDialogOpen:_},props:[y,{id:k,"aria-labelledby":R,"aria-describedby":h,role:D,...Vp,hidden:!w,onKeyDown(U){TC.has(U.key)&&U.stopPropagation()},style:{[gW]:C}},u],ref:[n,d.context.popupRef,P],stateAttributesMapping:xW});return x.jsx(xC,{context:g,openInteractionType:N,disabled:!w,closeOnFocusOut:!m,initialFocus:I,returnFocus:l,modal:b!==!1,restoreFocus:"popup",children:z})});function RC(e){return GE(19)?e:e?"true":void 0}const OC=O.forwardRef(function(t,n){const{cutout:r,...s}=t;let i;if(r){const l=r.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),_P=O.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,i=su(),l=i.useState("mounted"),c=i.useState("modal"),u=i.useState("open");return l||r?x.jsx(MP.Provider,{value:r,children:x.jsxs(hC,{ref:n,...s,children:[l&&c===!0&&x.jsx(OC,{ref:i.context.internalBackdropRef,inert:RC(!u)}),t.children]})}):null});let UM={},qM={},GM="";function fx(e,t){return Lp(e)?e:t}function KM(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fx(t,n)).overflowY)}function bW(e){if(typeof document>"u")return!1;const t=Dt(e);return vn(t).innerWidth-t.documentElement.clientWidth>0}function vW(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Dt(e),r=n.documentElement,s=n.body,i=fx(r,s),l=i.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",i.style.overflowY="scroll";const u=i.offsetWidth;i.style.overflowY="hidden";const d=i.offsetWidth;return i.style.overflowY=l,r.style.scrollbarGutter=c,u===d}function SW(e){const t=Dt(e),n=t.documentElement,r=t.body,s=fx(n,r),i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function wW(e){var y;const t=Dt(e),n=t.documentElement,r=t.body,s=vn(n);let i=0,l=0,c=!1;const u=Qi.create();if(Aa&&(((y=s.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),w=s.getComputedStyle(r),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,l=n.scrollLeft,UM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},GM=n.style.scrollBehavior,qM={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const N=n.scrollHeight>n.clientHeight,R=n.scrollWidth>n.clientWidth,M=b.overflowY==="scroll"||w.overflowY==="scroll",D=b.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,s.innerWidth-r.clientWidth),I=Math.max(0,s.innerHeight-r.clientHeight),_=parseFloat(w.marginTop)+parseFloat(w.marginBottom),P=parseFloat(w.marginLeft)+parseFloat(w.marginRight),H=fx(n,r);if(c=vW(e),c){n.style.scrollbarGutter=T,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(N||M)&&(n.style.overflowY="scroll"),(R||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:_||I?`calc(100dvh - ${_+I}px)`:"100dvh",width:P||k?`calc(100vw - ${P+k}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,UM),Object.assign(r.style,qM),c||(n.scrollTop=i,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=GM)}function m(){h(),u.request(d)}d();const g=xt(s,"resize",m);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class EW{constructor(){_t(this,"lockCount",0);_t(this,"restore",null);_t(this,"timeoutLock",si.create());_t(this,"timeoutUnlock",si.create());_t(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});_t(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Dt(t),r=n.documentElement,s=n.body,i=vn(r);if(KM(i,r,s)){const c=new i.MutationObserver(()=>{KM(i,r,s)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(s,u),this.restore=()=>c.disconnect();return}const l=Ky||!bW(t);this.restore=l?SW(t):wW(t)}}const CW=new EW;function DP(e=!0,t=null){ze(()=>{if(e)return CW.acquire(t)},[e,t])}function NW({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),i=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,d]=O.useState(0),[h,m]=O.useState(0),g=u===0,y=$p(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!e.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const w=Zr(b);if(g&&!s){if(i){const E=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return E||C?E===w||C===w||Je(w,l)&&!(w!=null&&w.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:g});return DP(r&&i===!0,l),e.useContextCallback("onNestedDialogOpen",(b,w)=>{d(b),m(w)}),ze(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,h+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,h,t]),Kp(e,{activeTriggerProps:y.reference,inactiveTriggerProps:y.trigger,popupProps:y.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const TW={...Xp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class RW extends fd{constructor(n,r,s){const i=new Yp,l=OW(n,i,r,s);super(l,kW(i),TW);_t(this,"setOpen",(n,r)=>{var s,i;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(i=(s=this.context).onOpenChange)==null||i.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(sx(this.state,n,r.trigger)))})}}function OW(e,t,n,r=!1){return{...Wp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function kW(e){return{popupRef:O.createRef(),backdropRef:O.createRef(),internalBackdropRef:O.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function MW(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:d,handle:h,triggerId:m,defaultTriggerId:g=null}=t,y=e==="drawer",b=u,w=c,E="dialog",C=su(!0),T=C!=null,N={modal:b,disablePointerDismissal:w,nested:T,role:E},R=rx((P,H)=>new RW({open:s,openProp:r,activeTriggerId:g,triggerIdProp:m,...N},P,H),!0);R.useControlledProp("openProp",r),R.useControlledProp("triggerIdProp",m),R.useSyncedValues(N),R.useContextCallback("onOpenChange",i),R.useContextCallback("onOpenChangeComplete",l);const M=R.useState("open"),D=R.useState("mounted"),k=R.useState("payload");RP(R,M),qp(R);const{forceUnmount:I}=Gp(M,R);O.useImperativeHandle(d,()=>({unmount:I,close:()=>R.setOpen(!1,gt(Hp))}),[I,R]);const _=M||D;return x.jsxs(IL.Provider,{value:R,children:[h&&x.jsx(Up,{handle:h,store:R}),_&&x.jsx(NW,{store:R,parentContext:C==null?void 0:C.context,isDrawer:y}),typeof n=="function"?n({payload:k}):n]})}const IP=ud(function(t){return MW("dialog",t)}),AW=O.forwardRef(function(t,n){const{render:r,className:s,style:i,id:l,...c}=t,u=su(),d=lo(l);return u.useSyncedValueWithCleanup("titleElementId",d),dn("h2",t,{ref:n,props:[{id:d},c]})});function _W(e){const t=O.useRef(""),n=O.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:O.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function jP(e,t){const n=O.useRef(e),r=Qe(t);ze(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function LP(e,t){const n=Qe((i,l)=>{(typeof e=="function"?e():e)||t(l||(Ky?"touch":""))}),{onClick:r,onPointerDown:s}=_W(n);return O.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function DW(e){const[t,n]=O.useState(null),r=LP(e,n);return jP(e,s=>{s&&!e&&n(null)}),O.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}/**
68
68
  * @license lucide-react v1.49.0 - ISC
69
69
  *
70
70
  * This source code is licensed under the ISC license.
@@ -438,4 +438,4 @@ img.ProseMirror-separator {
438
438
  display: block;
439
439
  }`;var Obe=class extends gge{constructor(e={}){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:Vme,createMappablePosition:Ume},this.setOptions(e),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:r,moved:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const n=uE(t,this.options.autofocus);this.editorState=$o.create({doc:t,schema:this.schema,selection:n||void 0})}s0e(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){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(e),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 e=this.editorView.dom;e!=null&&e.editor&&delete e.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(e){console.warn("Failed to remove CSS element:",e)}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():Nf.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Nf.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Mge(o0e,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=dE(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(l=>!l.key.startsWith(i))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[Qge,Kge.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),Yge,Jge,e0e,n0e.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),Xge,t0e,Wge,r0e.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new $x(n,this)}createCommandManager(){this.commandManager=new Nf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=fE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const n=fE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=$o.create({doc:n,schema:this.schema,selection:uE(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,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(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;const t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return dE(t)?n=>({role:"textbox",...t(n)}):{role:"textbox",...t}}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,l=this.extensionManager.transformPastedHTML(i);this.editorView=new H6(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:s,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const u=this.view.dom;u.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(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var h;return(h=this.capturedTransaction)===null||h===void 0?void 0:h.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),s=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!s)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),c=l==null?void 0:l.getMeta("focus"),u=l==null?void 0:l.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),u&&this.emit("blur",{editor:this,event:u.event,transaction:l}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||i.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return zme(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return $me(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return q2(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
440
440
 
441
- `,textSerializers:n={}}=e||{};return Lme(this.state.doc,{blockSeparator:t,textSerializers:{...sH(this.schema),...n}})}get isEmpty(){return K2(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 e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new i0e(t,this,!1,n)}get $doc(){return this.$pos(0)}};function kbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=t,l=r[r.length-1],c=r[0];if(l){const u=c.search(/\S/),d=n.from+c.indexOf(l),h=d+l.length;if(oH(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(y=>y===e.type&&y!==g.mark.type)).filter(g=>g.to>d).length)return null;h<n.to&&i.delete(h,n.to),d>n.from&&i.delete(n.from+u,d);const m=n.from+u+l.length;i.addMark(n.from+u,m,e.type.create(s||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function Mbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r)||{},{tr:i}=t,l=n.from;let c=n.to;const u=e.type.create(s);if(r[1]){let d=l+r[0].lastIndexOf(r[1]);d>c?d=c:c=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,l+r[0].length-1),i.replaceWith(d,c,u)}else if(r[0]){const d=e.type.isInline?l:l-1;i.insert(d,e.type.create(s)).delete(i.mapping.map(l),i.mapping.map(c))}i.scrollIntoView()},undoable:e.undoable})}function Abe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),i=Gt(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function _be(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const i=Gt(e.getAttributes,void 0,r)||{},l=t.tr.delete(n.from,n.to),c=l.doc.resolve(n.from).blockRange(),u=c&&R2(c,e.type,i);if(!u)return null;if(l.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:g}=e.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(w=>g.includes(w.type.name));l.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const d=l.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Ia(l.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&l.join(n.from-1)},undoable:e.undoable})}var l0e=class yH extends Y2{constructor(...t){super(...t),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new yH(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Dbe(e){return new $ge({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const i=Gt(e.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:l}=t,c=r[r.length-1],u=r[0];let d=n.to;if(c){const h=u.search(/\S/),m=n.from+u.indexOf(c),g=m+c.length;if(oH(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(b=>b===e.type&&b!==y.mark.type)).filter(y=>y.to>m).length)return null;g<n.to&&l.delete(g,n.to),m>n.from&&l.delete(n.from+h,m),d=n.from+h+c.length,l.addMark(n.from+h,d,e.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||l.removeStoredMark(e.type)}}})}const h0="codeLink",b1="data-code-link",TI="data-code",a0e=/^\[(`?)([^\]`\n]+)\1\]\(code:([^)\s]+)\)/,c0e=/\[[^\]\n]*\]\(code:/,u0e="rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[0.875em] data-code:font-mono",f0e=/^[^\]`\n]+$/,d0e=/^[^)\s]+$/,h0e="#",p0e=({lineStart:e,lineEnd:t})=>e===t?`L${String(e)}`:`L${String(e)}-${String(t)}`,m0e=({path:e,range:t,label:n,isCode:r})=>{const s=n.trim();return f0e.test(s)&&d0e.test(e)?{linkId:`${e}${h0e}${p0e(t)}`,label:s,isCode:r}:null},RI=e=>typeof e=="string"?e:"",v1=e=>({linkId:RI(e==null?void 0:e.linkId),label:RI(e==null?void 0:e.label),isCode:(e==null?void 0:e.isCode)===!0}),g0e=({linkId:e,label:t,isCode:n})=>`[${n?`\`${t}\``:t}](code:${e})`,y0e=e=>{const t=a0e.exec(e);return t===null?null:{raw:t[0],isCode:t[1]!=="",label:t[2],linkId:t[3]}},Ibe=l0e.create({name:h0,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes:()=>({linkId:{default:""},label:{default:""},isCode:{default:!1}}),parseHTML:()=>[{tag:`span[${b1}]`,getAttrs:e=>({linkId:e.getAttribute(b1)??"",label:e.textContent,isCode:e.hasAttribute(TI)})}],renderHTML:({node:e})=>{const{linkId:t,label:n,isCode:r}=v1(e.attrs);return["span",{[b1]:t,...r?{[TI]:""}:{},class:u0e,title:t},n]},markdownTokenizer:{name:h0,level:"inline",start:e=>e.search(c0e),tokenize:e=>{const t=y0e(e);return t===null?void 0:{type:h0,...t}}},parseMarkdown:e=>({type:h0,attrs:v1(e)}),renderMarkdown:e=>g0e(v1(e.attrs))}),x0e="Link to code",b0e="Pick a file of the Flight Plan, select the lines the link points at, and name the link.",v0e="File",S0e="Search the files of the Flight Plan",w0e="Link these lines",E0e="Select the lines in the code: click a line number, then another with Shift.",C0e="Label",N0e="Show the label as code",T0e="Write a label without a backtick or a closing square bracket.",vh=({reviewKey:e,selectedText:t,onInsert:n,onClose:r})=>{const s=O.useId(),i=w2(e,"flight-plan"),[l,c]=O.useState(null),[u,d]=O.useState(null),[h,m]=O.useState(t),[g,y]=O.useState(!1),b=S2(e,l),w=l===null||u===null?null:m0e({path:l,range:u,label:h,isCode:g}),E=l!==null&&u!==null&&h.trim()!==""&&w===null,C=T=>{c(T),d(null),i.onQueryChange(T)};return x.jsx(cu,{open:!0,onOpenChange:T=>{T||r()},children:x.jsxs(uu,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:x0e}),x.jsx(fu,{children:b0e})]}),x.jsx(C2,{label:v0e,hint:null,placeholder:S0e,query:i.query,files:i.files,message:i.message,errorMessage:i.errorMessage,onQueryChange:i.onQueryChange,onSelect:C}),l===null?x.jsx("span",{}):x.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[x.jsx(E2,{path:l,lines:b.lines,statusMessage:b.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:w0e,focusOn:u,className:"flex-1",onHighlightCode:d}),x.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:u===null?E0e:bp(u)})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("label",{htmlFor:s,className:"text-sm font-bold",children:C0e}),x.jsx(Mx,{id:s,value:h,"aria-invalid":E,onChange:T=>{m(T.target.value)}}),E?x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T0e}):null,x.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:g,className:"size-4 accent-(--primary)",onChange:T=>{y(T.target.checked)}}),N0e]})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:"Cancel"}),x.jsx(nt,{type:"button",disabled:w===null,onClick:()=>{w!==null&&n(w)},children:"Insert"})]})]})})},R0e=({choice:e,isPending:t,onComplete:n,onClose:r})=>{const s=O.useId(),[i,l]=O.useState(e.selectedId);return x.jsx(cu,{open:!0,onOpenChange:c=>{c||r()},children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e.title}),x.jsx(fu,{children:e.description})]}),e.emptyMessage===null?x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e.title}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:e.options.map(c=>x.jsxs("li",{className:"border-b border-border py-3",children:[x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:s,checked:i===c.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{l(c.id)}}),x.jsx("span",{className:"min-w-0 font-bold",children:c.label})]}),x.jsx("span",{className:"block pl-7 text-sm text-muted-foreground",children:c.detail})]},c.id))})]}):x.jsx("p",{className:"text-muted-foreground",children:e.emptyMessage}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:e.cancelLabel}),x.jsx(nt,{type:"button",variant:"outline",disabled:t,onClick:()=>{n(null)},children:e.skipLabel}),e.emptyMessage===null?x.jsx(nt,{type:"button",disabled:t||i===null,onClick:()=>{n(i)},children:e.confirmLabel}):null]})]})})},O0e=({anchorId:e,heading:t,action:n=null,children:r})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) pt-6 pb-8",children:[x.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[x.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),n]}),r]}),k0e=O.lazy(async()=>await $t(()=>import("./index-CIReAhWD.js"),__vite__mapDeps([23,24]))),M0e="Loading the editor…",A0e=({anchorId:e,heading:t,context:n,markdown:r,isDraft:s,unwrittenLabel:i,codeLinks:l,editing:c,renderCodeLinkDialog:u,onOpenCodeLink:d})=>{const h=(c==null?void 0:c.isWriting)===!0;return x.jsxs(O0e,{anchorId:e,heading:t,action:c===null||h?null:x.jsx(nt,{variant:"link",size:"sm",onClick:c.onEdit,children:"Edit"}),children:[c!==null&&h?x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:M0e}),children:x.jsx(k0e,{label:t,markdown:r,isSaving:c.isSaving,errorMessage:c.errorMessage,renderCodeLinkDialog:u,onSave:c.onSave,onCancel:c.onCancel})}):null,!h&&s?x.jsx(so,{isPending:!0,lineCount:4,className:"max-w-[44rem] text-base",children:x.jsx("p",{className:"text-muted-foreground",children:i})}):null,!h&&!s?x.jsx(Hs,{blocks:n,codeLinks:l,onOpenCodeLink:d}):null]})},_0e=({anchorId:e,heading:t,emptyMessage:n,entries:r,placeholder:s,submitLabel:i,isSubmitting:l,renderEditor:c,onComment:u})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsx("h2",{id:`${e}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),x.jsxs("div",{className:"flex max-w-[52rem] flex-col",children:[n===null?null:x.jsx("p",{className:"pb-4 text-muted-foreground",children:n}),r.map(d=>x.jsx(H4,{comment:d,verdictLabel:d.verdictLabel,locationLabel:d.locationLabel,className:"border-t py-3 first:border-t-0 first:pt-0"},d.id)),x.jsx(VC,{label:s,submitLabel:i,cancelLabel:null,isSubmitting:l,className:"border-t pt-4",renderEditor:c,onSubmit:u})]})]}),D0e=({label:e,options:t,value:n,className:r,onChange:s})=>{const i=O.useId();return x.jsxs("fieldset",{className:Ne("grid gap-1.5",r),children:[x.jsx("legend",{className:"float-left text-sm font-bold",children:e}),x.jsx("span",{className:"clear-left inline-flex w-fit overflow-hidden rounded-lg border border-input bg-card",children:t.map(l=>x.jsxs("label",{className:"flex h-[calc(2rem-2px)] cursor-pointer items-center border-l border-input px-3 text-sm transition-colors duration-[180ms] ease-out first:border-l-0 hover:bg-muted has-checked:bg-foreground has-checked:font-bold has-checked:text-background has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring",children:[x.jsx("input",{type:"radio",name:i,className:"sr-only",checked:n===l.value,onChange:()=>{s(l.value)}}),x.jsx("span",{className:"text-box-cap",children:l.label})]},l.value))})]})},I0e="flex w-full max-w-xl items-center gap-3 rounded-lg border border-input bg-card px-3 py-2 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",OI=({option:e})=>x.jsxs("span",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-bold",children:e.label}),e.tagLabel===null?null:x.jsx("span",{className:"text-sm text-muted-foreground",children:e.tagLabel})]}),kI=({label:e,dialogTitle:t,dialogDescription:n,chooseLabel:r,cancelLabel:s,options:i,selectedKey:l,describedBy:c,onChoose:u})=>{const d=O.useId(),[h,m]=O.useState(!1),[g,y]=O.useState(l),b=i.find(C=>C.key===l),w=()=>{y(l),m(!0)},E=()=>{u(g),m(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-label":`${e}: ${(b==null?void 0:b.label)??""}`,"aria-describedby":c,className:I0e,onClick:w,children:[x.jsx("span",{className:"min-w-0 flex-1",children:b===void 0?null:x.jsxs(x.Fragment,{children:[x.jsx(OI,{option:b}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:b.summary})]})}),x.jsx(kC,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]}),x.jsx(cu,{open:h,onOpenChange:m,children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t}),x.jsx(fu,{children:n})]}),x.jsxs("form",{action:E,className:"grid gap-4",children:[x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:i.map(C=>x.jsx("li",{className:"border-b border-border py-3",children:x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:d,checked:g===C.key,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{y(C.key)}}),x.jsxs("span",{className:"min-w-0",children:[x.jsx(OI,{option:C}),x.jsx("span",{className:"block text-sm",children:C.summary}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.description}),C.note===null?null:x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.note})]})]})},C.key))})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:()=>{m(!1)},children:s}),x.jsx(nt,{type:"submit",children:r})]})]})]})})]})},MI="manual",j0e=["writer","model","effort"],S1="border-t border-border pt-6 pb-5",w1="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",E1="max-w-[62ch] pb-3 text-sm text-muted-foreground",xH="border-b border-border py-3 last:border-b-0",L0e="size-4 shrink-0 accent-(--primary)",bH="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",vH=`${L0e} row-span-2 mt-1`,pE="col-start-2 max-w-[62ch] text-sm text-muted-foreground",P0e="min-h-20 w-full max-w-xl resize-y 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 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",z0e=({option:e,groupName:t,isChosen:n,model:r,effort:s,onChoose:i,onModelChange:l,onEffortChange:c})=>{const u=e.unavailableReason===null,d=e.modelOptions.find(m=>m.model===r),h=(d==null?void 0:d.hasEffortChoice)===!0;return x.jsxs("li",{className:xH,children:[x.jsxs("label",{className:Ne(bH,u?"":"cursor-default"),children:[x.jsx("input",{type:"radio",name:t,checked:n,disabled:!u,className:vH,onChange:i}),x.jsx("span",{className:"font-bold",children:e.label}),e.unavailableReason===null?x.jsx("span",{className:pE,children:e.description}):x.jsxs("span",{className:pE,children:[x.jsx("span",{className:"font-bold text-foreground",children:"Unavailable."}),` ${e.unavailableReason}`]})]}),n&&(e.hasModelChoice||h)?x.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-x-6 gap-y-3 pl-7",children:[e.hasModelChoice?x.jsx(x4,{label:e.modelLegend,options:e.modelOptions.map(m=>({value:m.model,label:m.label})),value:r,className:"w-60",onChange:m=>{const g=e.modelOptions.find(y=>y.model===m);g!==void 0&&l(g)}}):null,d!==void 0&&h?x.jsx(D0e,{label:e.effortLegend,options:d.effortOptions.map(m=>({value:m.effort,label:m.label})),value:s,onChange:c}):null]}):null]})},W2=({form:e,problem:t,errorMessage:n,isPending:r,dataNotice:s,className:i,onSubmit:l})=>{var L;const c=O.useId(),u=O.useId(),d=O.useId(),h=O.useId(),m=O.useId(),g=O.useId(),y=O.useId(),[b,w]=O.useState(e.configuration.selectedPreset),[E,C]=O.useState(e.order.selectedOrder),[T,N]=O.useState(e.order.customOrder),[R,M]=O.useState(e.writer.selectedKey),[D,k]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedModel]))),[I,_]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedEffort]))),P=e.writer.agents.find($=>$.agent===R),H=e.order.options.find($=>$.order===E),z=((L=e.configuration.options.find($=>$.preset===b))==null?void 0:L.rewriteNotice)??null,U=(t==null?void 0:t.field)==="customOrder"?t.message:null,j=t!==null&&j0e.includes(t.field)?t.message:null,B=()=>{l({preset:b,order:E,customOrder:T,writer:P===void 0?{kind:"manual"}:{kind:"agent",agent:P.agent,model:D[P.agent]??P.selectedModel,effort:I[P.agent]??P.selectedEffort}})};return x.jsxs("form",{action:B,className:i,children:[x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":c,children:[x.jsx("h3",{id:c,className:w1,children:e.configuration.heading}),x.jsx("p",{id:u,className:E1,children:e.configuration.hint}),x.jsx(kI,{label:e.configuration.heading,dialogTitle:e.configuration.dialogTitle,dialogDescription:e.configuration.dialogDescription,chooseLabel:e.configuration.chooseLabel,cancelLabel:e.configuration.cancelLabel,options:e.configuration.options.map($=>({key:$.preset,label:$.label,tagLabel:$.tagLabel,summary:$.bestFor,description:$.description,note:$.note})),selectedKey:b,describedBy:u,onChoose:$=>{const q=e.configuration.options.find(G=>G.preset===$);q!==void 0&&w(q.preset)}}),z===null?null:x.jsx("p",{role:"status",className:"max-w-[62ch] pt-3 text-sm font-bold text-foreground",children:z})]}),x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":d,children:[x.jsx("h3",{id:d,className:w1,children:e.order.heading}),x.jsx("p",{id:h,className:E1,children:e.order.hint}),x.jsx(kI,{label:e.order.heading,dialogTitle:e.order.dialogTitle,dialogDescription:e.order.dialogDescription,chooseLabel:e.order.chooseLabel,cancelLabel:e.order.cancelLabel,options:e.order.options.map($=>({key:$.order,label:$.label,tagLabel:$.tagLabel,summary:$.summary,description:$.description,note:null})),selectedKey:E,describedBy:h,onChoose:$=>{const q=e.order.options.find(G=>G.order===$);q!==void 0&&C(q.order)}}),(H==null?void 0:H.promptField)==null?null:x.jsxs("div",{className:"mt-4 grid max-w-xl gap-1.5",children:[x.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:H.promptField.label}),x.jsx("textarea",{id:m,value:T,placeholder:H.promptField.placeholder,"aria-invalid":U!==null,"aria-describedby":U===null?void 0:g,className:P0e,onChange:$=>{N($.target.value)}}),U===null?null:x.jsx("p",{id:g,role:"alert",className:"text-sm text-destructive",children:U})]})]}),x.jsxs("fieldset",{className:S1,children:[x.jsx("legend",{className:`${w1} float-left w-full`,children:e.writer.heading}),x.jsx("p",{className:`${E1} clear-left`,children:e.writer.hint}),x.jsxs("ul",{className:"border-t border-border",children:[e.writer.agents.map($=>x.jsx(z0e,{option:$,groupName:y,isChosen:R===$.agent,model:D[$.agent]??$.selectedModel,onChoose:()=>{M($.agent)},effort:I[$.agent]??$.selectedEffort,onModelChange:q=>{k(G=>({...G,[$.agent]:q.model})),_(G=>({...G,[$.agent]:q.selectedEffort}))},onEffortChange:q=>{_(G=>({...G,[$.agent]:q}))}},$.agent)),x.jsx("li",{className:xH,children:x.jsxs("label",{className:bH,children:[x.jsx("input",{type:"radio",name:y,checked:R===MI,className:vH,onChange:()=>{M(MI)}}),x.jsx("span",{className:"font-bold",children:e.writer.manual.label}),x.jsx("span",{className:pE,children:e.writer.manual.description})]})})]}),j===null?null:x.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:j})]}),x.jsxs("footer",{className:"border-t border-border pt-4",children:[n===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:n}),x.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[s===null?null:x.jsx("p",{className:"flex-1 text-sm text-muted-foreground",children:s}),x.jsx(nt,{type:"submit",disabled:r,children:r?e.pendingLabel:(P==null?void 0:P.submitLabel)??e.writer.manual.submitLabel})]})]})]})},B0e="target",H0e="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",F0e="border-b border-border py-3 last:border-b-0",$0e="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",V0e="row-span-2 mt-1 size-4 shrink-0 accent-(--primary)",U0e="col-start-2 max-w-[62ch] text-sm text-muted-foreground",q0e=({creationForm:e,targetSearch:t,problem:n,errorMessage:r,isPending:s,onTargetQueryChange:i,onTargetSelect:l,onSubmit:c})=>{var b;const u=O.useId(),[d,h]=O.useState(e.initialization.selectedKind),m=((b=e.initialization.options.find(w=>w.kind===d))==null?void 0:b.authorWriting)??null,g=(n==null?void 0:n.field)===B0e?n.message:null,y=()=>{m!==null&&c({preset:e.form.configuration.selectedPreset,order:e.form.order.selectedOrder,customOrder:e.form.order.customOrder,writer:{kind:"author",start:m.start}})};return x.jsxs("div",{className:"grid max-w-208 gap-4",children:[x.jsx(uB,{label:e.target.label,hint:e.target.hint,placeholder:e.target.placeholder,value:t.value,suggestions:t.options,message:t.message,errorMessage:g,className:"max-w-xl",onValueChange:i,onSelect:l}),x.jsxs("fieldset",{className:"pt-2",children:[x.jsx("legend",{className:`${H0e} float-left w-full pb-2`,children:e.initialization.legend}),x.jsx("ul",{className:"clear-left border-t border-border",children:e.initialization.options.map(w=>x.jsx("li",{className:F0e,children:x.jsxs("label",{className:$0e,children:[x.jsx("input",{type:"radio",name:u,checked:d===w.kind,className:V0e,onChange:()=>{h(w.kind)}}),x.jsx("span",{className:"font-bold",children:w.label}),x.jsx("span",{className:U0e,children:w.description})]})},w.kind))})]}),m===null?x.jsx(W2,{form:e.form,problem:g===null?n:null,errorMessage:r,isPending:s,dataNotice:null,onSubmit:c}):x.jsxs("form",{action:y,className:"border-t border-border pt-4",children:[r===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:r}),x.jsx("div",{className:"flex justify-end",children:x.jsx(nt,{type:"submit",disabled:s,children:s?e.pendingLabel:m.submitLabel})})]})]})},G0e="Searching…",AI="",K0e="",Y0e="author",W0e=(e,t)=>{var g,y,b,w,E;const n=ii(),r=jp(),s=Ri(),[i,l]=O.useState(null),c=O.useDeferredValue(i??AI),{data:u}=fj(n.review.creationForm.queryOptions({repositoryName:e,targetId:t})),d=Zc({...n.review.searchTargets.queryOptions({repositoryName:e,query:c}),placeholderData:SE}),h=i===null?u.target.selected:null,m=Nn(n.review.request.mutationOptions({onSuccess:async C=>{C.kind==="requested"&&(C.prompt!==null&&await navigator.clipboard.writeText(C.prompt).catch(()=>{}),await s.invalidateQueries(n.review.get.pathFilter()))}}));return{creationForm:u,targetSearch:{value:i??(h==null?void 0:h.label)??AI,options:((g=d.data)==null?void 0:g.options)??[],message:((y=d.data)==null?void 0:y.message)??(d.isPending?G0e:null)},problem:((b=m.data)==null?void 0:b.kind)==="rejected"?m.data:null,errorMessage:((w=m.data)==null?void 0:w.kind)==="unavailable"?m.data.message:((E=m.error)==null?void 0:E.message)??null,isPending:m.isPending,onTargetQueryChange:l,onTargetSelect:C=>{m.reset(),l(null),r({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e,branchId:C}})},onSubmit:C=>{C.writer.kind!==Y0e&&Q1(),m.mutate({repositoryName:e,targetId:(h==null?void 0:h.id)??K0e,...C})}}},X0e=({repositoryName:e,targetId:t})=>{const n=W0e(e,t);return x.jsx("div",{className:"pt-8",children:x.jsx(q0e,{creationForm:n.creationForm,targetSearch:n.targetSearch,problem:n.problem,errorMessage:n.errorMessage,isPending:n.isPending,onTargetQueryChange:n.onTargetQueryChange,onTargetSelect:n.onTargetSelect,onSubmit:n.onSubmit})})},Q0e=({isOpen:e,rebuildForm:t,loadingLabel:n,problem:r,errorMessage:s,isPending:i,onSubmit:l,onClose:c})=>x.jsx(cu,{open:e,onOpenChange:u=>{u||c()},children:x.jsx(uu,{className:"max-h-[calc(100dvh-4rem)] overflow-y-auto sm:max-w-3xl",children:t===null?x.jsxs(Oa,{children:[x.jsx(ka,{children:n}),s===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}):x.jsxs(x.Fragment,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t.title}),x.jsx(fu,{className:"max-w-[62ch]",children:t.description})]}),x.jsx(W2,{form:t.form,problem:r,errorMessage:s,isPending:i,dataNotice:null,onSubmit:l})]})})}),Z0e={},J0e=()=>{},C1="flex flex-wrap items-center gap-x-3 gap-y-1 border-b py-2.5 text-sm",eye=({staleNotice:e,unassignedFiles:t,progress:n,onShowUnassignedFiles:r,onCopyPrompt:s})=>x.jsxs("div",{children:[e===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text [&_code]:bg-transparent [&_code]:px-0",children:x.jsx(Gf,{inlines:e.message,codeLinks:Z0e,onOpenCodeLink:J0e})}),x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{s(e.prompt,e.copiedMessage)},children:e.promptLabel})]}),t===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text",children:t.message}),x.jsx(nt,{variant:"outline",size:"sm",onClick:r,children:t.actionLabel})]}),n===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:n.isWriting?"awaiting-review":"stale",tone:n.isWriting?"status":"signal",className:n.isWriting?"motion-safe:animate-pulse":""}),x.jsx("p",{className:"font-bold text-signal-text",children:n.label}),x.jsx("progress",{"aria-label":n.countLabel,value:n.writtenCount,max:n.totalCount,className:"h-1.5 w-40 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"}),x.jsx("p",{className:"text-foreground tabular-nums",children:n.countLabel}),x.jsx("p",{className:"text-muted-foreground",children:n.message}),n.prompt===null?null:x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{n.prompt!==null&&s(n.prompt.text,n.prompt.copiedMessage)},children:n.prompt.label})]})]}),tye="Label",nye="Files",rye="No files yet.",sye="Add a file",iye="Search the changed files",oye="Close",lye="Delete",SH=({reviewKey:e,legend:t,label:n,paths:r,isSaving:s,isDeleting:i,errorMessage:l,onSave:c,onDelete:u,onClose:d})=>{const h=O.useId(),m=O.useId(),g=w2(e,"changed"),[y,b]=O.useState(n),[w,E]=O.useState(r),C=T=>{E(N=>N.includes(T)?N:[...N,T]),g.onQueryChange("")};return x.jsxs("form",{"aria-label":t,action:()=>{c({title:y,paths:w})},className:"relative mt-6 grid max-w-[44rem] gap-4 rounded-lg border border-foreground p-4",children:[x.jsx(un,{icon:"close",label:oye,className:"absolute top-2 right-2",onClick:d}),x.jsxs("div",{className:"grid gap-1.5 pr-8",children:[x.jsx("label",{htmlFor:h,className:"text-sm font-bold",children:tye}),x.jsx(Mx,{id:h,value:y,onChange:T=>{b(T.target.value)}})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("p",{id:m,className:"text-sm font-bold",children:nye}),w.length===0?x.jsx("p",{className:"text-sm text-muted-foreground",children:rye}):x.jsx("ul",{"aria-labelledby":m,className:"grid gap-0.5",children:w.map(T=>x.jsxs("li",{className:"flex items-center justify-between gap-2",children:[x.jsx("span",{className:"min-w-0 truncate font-mono text-[0.8rem]",title:T,children:T}),x.jsx(un,{icon:"close",label:`Remove ${T}`,onClick:()=>{E(N=>N.filter(R=>R!==T))}})]},T))})]}),x.jsx(C2,{label:sye,hint:null,placeholder:iye,query:g.query,files:g.files,message:g.message,errorMessage:g.errorMessage,onQueryChange:g.onQueryChange,onSelect:C}),l===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}),x.jsxs("div",{className:"flex justify-end gap-2",children:[u===null?null:x.jsx(nt,{type:"button",variant:"destructive",disabled:i,onClick:u,children:lye}),x.jsx(nt,{type:"submit",disabled:s,children:s?"Saving…":"Save"})]})]})},aye=({heading:e,detailLabel:t,children:n=null})=>x.jsxs("div",{className:"flex items-baseline gap-3 pt-6",children:[x.jsx("h2",{className:"text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",children:e}),n,t===null?null:x.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:t})]}),cye="text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",uye="text-sm text-muted-foreground tabular-nums",fye="Edit segment",dye=({reviewKey:e,heading:t,isTitleDraft:n,detailLabel:r,outline:s,authoring:i})=>i===null?t===null?null:x.jsx(aye,{heading:t,detailLabel:r,children:x.jsx(so,{isPending:n,className:"w-64 self-center text-[1.75rem]",children:null})}):i.writing.isWriting?x.jsx(SH,{reviewKey:e,legend:s.heading,label:s.label,paths:s.paths,isSaving:i.writing.isSaving,isDeleting:i.isPending,errorMessage:i.writing.errorMessage,onSave:i.writing.onSave,onDelete:i.onRemove,onClose:i.writing.onCancel}):x.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[x.jsx("h2",{className:cye,children:s.heading}),x.jsx("p",{className:uye,children:s.detailLabel}),x.jsx(nt,{variant:"link",size:"sm",onClick:i.writing.onEdit,children:fye})]}),hye=({selection:e,onComment:t,onAsk:n})=>e===null||e.commentRange===null&&n===null?null:x.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:e.left,top:e.top},onMouseDown:r=>{r.preventDefault()},children:[e.commentRange===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{e.commentRange!==null&&t(e.path,e.commentRange)},children:"Add comment"}),n===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{n(e)},children:"Ask the agent"})]}),pye=({heading:e,message:t,children:n})=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] pt-10",children:[x.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[x.jsx("span",{className:"h-9 w-1 bg-(--line)"}),x.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),x.jsxs("div",{className:"pt-5",children:[x.jsx("h2",{className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:e}),x.jsx("p",{className:"max-w-[62ch] text-muted-foreground",children:t}),n]})]}),mye=({heading:e,message:t,...n})=>x.jsxs("div",{className:"max-w-208",children:[x.jsx(pye,{heading:e,message:t}),x.jsx(W2,{...n,className:"pt-6 pl-10"})]}),gye="Close",yye="Cancel",xye=({title:e,description:t,paths:n,confirmation:r,onClose:s})=>x.jsx(cu,{open:!0,onOpenChange:i=>{i||s()},children:x.jsxs(uu,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e}),x.jsx(fu,{children:(r==null?void 0:r.warning)??t})]}),x.jsx("ul",{"aria-label":e,className:"grid max-h-80 gap-1 overflow-y-auto",children:n.map(i=>x.jsx("li",{className:"font-mono text-[0.8rem] break-all",children:i},i))}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:s,children:r===null?gye:yye}),r===null?null:x.jsx(nt,{type:"button",onClick:r.onConfirm,children:r.confirmLabel})]})]})}),bye=O.lazy(async()=>await $t(()=>import("./index-B7lg0P4V.js"),__vite__mapDeps([25,24]))),vye="Loading the editor…",Sye="Remove the file from the walkthrough",_I="Edit the waypoint",wye="Remove the waypoint",Eye="my-1.5 mr-4 ml-18 rounded-md border border-foreground bg-background p-4 font-sans whitespace-normal",Cye=e=>e.rows.flatMap(t=>t.kind==="waypoint"?[t.waypoint]:[]),Nye=e=>e.lines===null?[]:[{id:e.id,title:e.title,attentionLabel:e.attentionLabel,...e.lines}],Tye=({reviewKey:e,segmentId:t,file:n,openWaypointIds:r,currentWaypointId:s,isPending:i,codeLinks:l,renderCodeLinkDialog:c,onOpenCodeLink:u,onToggleWaypoint:d,onRemove:h,onRemoveWaypoint:m})=>{var R;const[g,y]=O.useState(null),b=S2(e,n.path),w=Cye(n),E=new Set((R=b.lines)==null?void 0:R.map(M=>M.numberLabel)),C=M=>M.lines!==null&&E.has(String(M.lines.lineEnd)),T=()=>{y(null)},N=M=>M.id===g?x.jsx("div",{id:M.anchorId,className:Eye,children:x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:vye}),children:x.jsx(bye,{reviewKey:e,segmentId:t,waypointId:M.id,legend:`${_I}: ${M.title}`,text:M.text,renderCodeLinkDialog:c,onClose:T})})}):x.jsx(UC,{waypoint:M,isOpen:r.has(M.id),isCurrent:M.id===s,isReviewPending:!1,codeLinks:l,actions:x.jsxs(x.Fragment,{children:[x.jsx(un,{icon:"edit",label:`${_I}: ${M.title}`,onClick:()=>{y(M.id)}}),x.jsx(un,{icon:"delete",label:`${wye}: ${M.title}`,isDisabled:i,onClick:()=>{m(M.id)}})]}),onOpenCodeLink:u,onToggle:()=>{d(M.id)},onReviewedChange:null});return x.jsxs("article",{id:n.anchorId,"aria-label":n.title,className:"scroll-mt-(--waypoint-scroll-margin) pt-6",children:[n.summary.length===0?null:x.jsx("ul",{className:"flex list-disc flex-col gap-2 pb-4 pl-5",children:hd(n.summary).map(({key:M,item:D})=>x.jsx("li",{children:x.jsx(Hs,{blocks:D,codeLinks:l,onOpenCodeLink:u})},M))}),x.jsxs("div",{className:"flex items-center gap-3 pb-2",children:[x.jsx("h3",{className:"min-w-0 truncate text-[0.9375rem] leading-5 font-semibold",children:n.title}),x.jsx("p",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.waypointCountLabel}),x.jsx("span",{className:"flex-1"}),x.jsx(un,{icon:"remove",label:`${Sye}: ${n.path}`,isDisabled:i,onClick:h})]}),b.lines===null?null:x.jsx("div",{className:"bg-code empty:hidden",children:w.filter(M=>!C(M)).map(M=>x.jsx("div",{children:N(M)},M.id))}),x.jsx(E2,{path:n.path,lines:b.lines,statusMessage:b.statusMessage,waypoints:w.flatMap(Nye),waypointOptions:"always-on",highlightButtonLabel:null,focusOn:null,renderWaypoint:({id:M})=>w.filter(D=>D.id===M).map(N),onHighlightCode:null})]})},Rye=(e,t)=>{var w,E;const n=ii(),r=Ri(),[s,i]=O.useState(!1),[l,c]=O.useState(null),u=bG(n.conversation.watch.subscriptionOptions(e,{enabled:s})),d=Zc({...n.conversation.modelChoice.queryOptions(e),enabled:s}),h=C=>{t(C.message)},m=Nn(n.conversation.sendMessage.mutationOptions({onSuccess:C=>{C.kind==="sent"&&c(null)},onError:h})),g=Nn(n.conversation.answerQuestions.mutationOptions({onError:h})),y=Nn(n.conversation.chooseModel.mutationOptions({onSuccess:async C=>{C.kind==="rejected"&&t(C.message),await r.invalidateQueries(n.conversation.modelChoice.pathFilter())},onError:h})),b=((w=g.data)==null?void 0:w.kind)==="rejected"&&g.variables!==void 0?{batchId:g.variables.batchId,message:g.data.message}:null;return{isOpen:s,reference:l,conversation:u.data,modelChoice:d.data??null,isSending:m.isPending,sendProblem:((E=m.data)==null?void 0:E.kind)==="rejected"?m.data.message:null,answering:{pendingBatchId:g.isPending?g.variables.batchId:null,rejection:b},onToggle:()=>{i(C=>!C)},onClose:()=>{i(!1)},onAsk:C=>{c(C),i(!0)},onClearReference:()=>{c(null)},onSend:C=>{m.mutate({...e,body:C,reference:l})},onAnswer:(C,T)=>{g.mutate({...e,batchId:C,answers:T.map(N=>({...N,pickedLabels:[...N.pickedLabels]}))})},onChooseModel:C=>{y.mutate({...e,model:C})}}},Oye="[data-line]",kye="[data-path]",Mye=6,mE=10,DI=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(Oye))??null},II=e=>Number.parseInt(e.dataset.line??"",mE),jI=e=>{const{commentSide:t,commentLine:n}=e.dataset;return(t==="old"||t==="new")&&n!==void 0?{side:t,lineLabel:n}:null},Aye=(e,t)=>{if(t===null)return null;const n=Number.parseInt(t.lineLabel,mE),r=(e==null?void 0:e.side)===t.side?Number.parseInt(e.lineLabel,mE):n;return{side:t.side,startLineLabel:String(Math.min(r,n)),lineLabel:String(Math.max(r,n))}},LI=()=>{const e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0)return null;const t=DI(e.anchorNode),n=DI(e.focusNode),r=(t==null?void 0:t.closest(kye))??null,s=r==null?void 0:r.dataset.path;if(t===null||n===null||r===null||s===void 0||!r.contains(n))return null;const i=II(t),l=II(n);if(Number.isNaN(i)||Number.isNaN(l))return null;const c=e.getRangeAt(0).getBoundingClientRect();return{path:s,lineStart:i,lineEnd:l,commentRange:Aye(jI(t),jI(n)),left:c.left,top:c.top-Mye}},_ye=()=>{const[e,t]=O.useState(null);return O.useEffect(()=>{const n=()=>{t(LI())},r=()=>{t(null)},s=()=>{LI()===null&&t(null)};return document.addEventListener("selectionchange",s),document.addEventListener("mouseup",n),document.addEventListener("keyup",n),window.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("selectionchange",s),document.removeEventListener("mouseup",n),document.removeEventListener("keyup",n),window.removeEventListener("scroll",r)}},[]),e},Dye=(e,{title:t,body:n})=>{if(!fL()||Notification.permission!=="granted")return;const r=new Notification(t,{body:n,tag:e});r.addEventListener("click",()=>{window.focus(),r.close()})},Iye=(e,t,n,r)=>{const s=O.useRef(null);O.useEffect(()=>{if(t){s.current=e;return}n===null||s.current!==e||(s.current=null,r(n.title),Dye(e,n))},[e,t,n,r])},jye=e=>{var d,h;const t=ii(),n=Ri(),[r,s]=O.useState([]),i=m=>{s(g=>g.filter(y=>y!==m))},l=Nn(t.review.editContext.mutationOptions({onSuccess:async(m,{segmentId:g})=>{m.kind==="saved"&&(await n.invalidateQueries(t.review.get.pathFilter()),i(g))}})),u=(((d=l.data)==null?void 0:d.kind)==="rejected"?l.data.message:null)??((h=l.error)==null?void 0:h.message)??null;return m=>{var y;const g=((y=l.variables)==null?void 0:y.segmentId)===m;return{isWriting:r.includes(m),isSaving:g&&l.isPending,errorMessage:g?u:null,onEdit:()=>{g&&l.reset(),s(b=>[...b,m])},onSave:b=>{l.mutate({...e,segmentId:m,context:b})},onCancel:()=>{g&&l.reset(),i(m)}}}},Lye="The line you drew ends at this card.",Pye=["add-card","change-card","describe"],PI=e=>Pye.includes(e.kind),zye=(e,t)=>{var R,M,D;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(null),[u,d]=O.useState([]),h=k=>{d(I=>I.filter(_=>_!==k))},m=Nn(n.review.editJourney.mutationOptions({onSuccess:async(k,{segmentId:I,edit:_})=>{if(k.kind==="rejected"){PI(_)||t(k.message);return}await Promise.all([r.invalidateQueries(n.review.get.pathFilter()),r.invalidateQueries(n.review.cardForm.pathFilter()),r.invalidateQueries(n.review.cardBlocks.pathFilter())]),_.kind==="add-card"&&(i(null),c(k.nodeId===null?null:{segmentId:I,nodeId:k.nodeId})),_.kind==="change-card"&&c(null),_.kind==="describe"&&h(I)},onError:(k,{edit:I})=>{PI(I)||t(k.message)}})),g=(k,I)=>{m.mutate({...e,segmentId:k,edit:I})},y=((R=m.variables)==null?void 0:R.edit)??null,w=(((M=m.data)==null?void 0:M.kind)==="rejected"?m.data.message:null)??((D=m.error)==null?void 0:D.message)??null,E=(y==null?void 0:y.kind)==="add-card",C=k=>{E&&m.reset(),i(k)},T=(y==null?void 0:y.kind)==="change-card",N=k=>{var I;return(y==null?void 0:y.kind)==="describe"&&((I=m.variables)==null?void 0:I.segmentId)===k};return{authoringOf:k=>({board:{isPending:m.isPending,onAddCard:()=>{C({segmentId:k,lineEnd:null})},onClearDiagram:()=>{g(k,{kind:"clear-diagram"})},onRemoveDiagram:()=>{g(k,{kind:"remove-diagram"})},onAddCardAtLineEnd:I=>{C({segmentId:k,lineEnd:{...I,places:[...I.places]}})},onMoveCards:I=>{g(k,{kind:"move-cards",places:[...I]})},onDrawLine:I=>{g(k,{kind:"add-line",...I})},onRemoveLine:I=>{g(k,{kind:"remove-line",...I})},onEditCard:I=>{T&&m.reset(),c({segmentId:k,nodeId:I})},onRemoveCard:I=>{g(k,{kind:"remove-card",nodeId:I})}},description:{isWriting:u.includes(k),isSaving:N(k)&&m.isPending,errorMessage:N(k)?w:null,onEdit:()=>{N(k)&&m.reset(),d(I=>[...I,k])},onSave:I=>{g(k,{kind:"describe",description:I})},onCancel:()=>{N(k)&&m.reset(),h(k)}},onAddDiagram:()=>{g(k,{kind:"add-diagram"})}}),cardAddition:s===null?null:{segmentId:s.segmentId,note:s.lineEnd===null?null:Lye,isSaving:E&&m.isPending,errorMessage:E?w:null,onSubmit:k=>{g(s.segmentId,{kind:"add-card",...k,...s.lineEnd===null?{}:{lineEnd:s.lineEnd}})},onClose:()=>{i(null)}},cardChange:l===null?null:{...l,isSaving:T&&m.isPending,errorMessage:T?w:null,onSave:k=>{g(l.segmentId,{kind:"change-card",nodeId:l.nodeId,...k})},onClose:()=>{c(null)}}}},Bye=10,Hye="Review submitted",Iy=e=>Number.parseInt(e,Bye),zI=(e,t)=>({path:e,side:t.side,startLine:Iy(t.startLineLabel),endLine:Iy(t.lineLabel)}),Fye=(e,t,n,r)=>{if(n===null)return null;const s={path:t,anchorLineLabel:n.lineLabel,range:{side:n.side,startLineLabel:n.lineLabel,lineLabel:n.lineLabel}};if(!r||(e==null?void 0:e.path)!==t||e.range.side!==n.side)return s;const i=Iy(e.anchorLineLabel),l=Iy(n.lineLabel);return{...e,range:{side:n.side,startLineLabel:String(Math.min(i,l)),lineLabel:String(Math.max(i,l))}}},$ye=(e,t)=>{var _;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(0),[u,d]=O.useState(""),[h,m]=O.useState(!1),g=O.useDeferredValue(u),y=async()=>{await r.invalidateQueries(n.review.get.pathFilter())},b=async()=>{await Promise.all([y(),r.invalidateQueries(n.review.searchReviewers.pathFilter())])},w=P=>{t(P.message)},E={onSuccess:y,onError:w},C=Nn(n.review.addComment.mutationOptions({onSuccess:async()=>{i(null),await y()},onError:w})),T=Nn(n.review.discardComment.mutationOptions(E)),N=Nn(n.review.replyToThread.mutationOptions(E)),R=Nn(n.review.resolveThread.mutationOptions(E)),M=Nn(n.review.submit.mutationOptions({onSuccess:async()=>{c(P=>P+1),t(Hye),await Promise.all([y(),r.invalidateQueries(n.repository.list.pathFilter())])}})),D=Nn(n.review.requestReviewer.mutationOptions({onSuccess:b,onError:w})),k=Nn(n.review.removeReviewRequest.mutationOptions({onSuccess:b,onError:w})),I=Zc({...n.review.searchReviewers.queryOptions({...e,query:g}),enabled:h,placeholderData:SE});return{composingRangeOf:P=>(s==null?void 0:s.path)===P?s.range:null,isCommentPending:C.isPending||N.isPending||R.isPending||T.isPending,isSubmitting:M.isPending,isDiscarding:T.isPending,submissionCount:l,submissionError:((_=M.error)==null?void 0:_.message)??null,reviewerRequesting:{query:u,options:I.data??null,isPending:D.isPending||k.isPending,onOpen:()=>{m(!0)},onSearch:d,onRequest:P=>{D.mutate({...e,login:P})},onRemove:P=>{k.mutate({...e,login:P})}},onStartComment:(P,H,z)=>{i(U=>Fye(U,P,H,z))},onStartRangeComment:(P,H)=>{i({path:P,anchorLineLabel:H.startLineLabel,range:H})},onAddComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!1})},onPostComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!0})},onComment:P=>{C.mutate({...e,position:null,body:P,shouldPostNow:!0})},onReply:(P,H)=>{N.mutate({...e,threadId:P,body:H})},onResolveThread:(P,H)=>{R.mutate({...e,threadId:P,isResolved:H})},onDiscardComment:P=>{T.mutate({...e,commentId:P})},onSubmit:(P,H)=>{M.mutate({...e,verdict:P,body:H})}}},Vye=e=>{const[t,n]=O.useState(!1);return O.useEffect(()=>{const r=()=>{n(window.scrollY>e)};return r(),window.addEventListener("scroll",r,{passive:!0}),()=>{window.removeEventListener("scroll",r)}},[e]),t},Uye=(e,t)=>{var l,c;const n=ii(),r=Ri(),s=Nn(n.review.generateSection.mutationOptions({onSuccess:async u=>{u.kind==="generated"&&(u.prompt!==null&&await navigator.clipboard.writeText(u.prompt).catch(()=>{}),await r.invalidateQueries(n.review.get.pathFilter()),t(u.message))}})),i=((l=s.data)==null?void 0:l.kind)==="unavailable"?s.data.message:((c=s.error)==null?void 0:c.message)??null;return{generatingSection:s.isPending?s.variables.section:null,errorMessageOf:u=>{var d;return((d=s.variables)==null?void 0:d.section)===u?i:null},onGenerate:u=>{s.mutate({...e,section:u})}}},BI=e=>e.kind==="add"||e.kind==="change",qye=(e,t)=>{var w,E,C;const n=ii(),r=Ri(),[s,i]=O.useState([]),[l,c]=O.useState(!1),u=T=>{i(N=>N.filter(R=>R!==T))},d=Nn(n.review.editSegments.mutationOptions({onSuccess:async(T,{edit:N})=>{if(T.kind==="rejected"){BI(N)||t(T.message);return}await r.invalidateQueries(n.review.get.pathFilter()),N.kind==="add"&&c(!1),(N.kind==="change"||N.kind==="remove")&&u(N.segmentId)},onError:(T,{edit:N})=>{BI(N)||t(T.message)}})),h=T=>{d.mutate({...e,edit:"paths"in T?{...T,paths:[...T.paths]}:T})},m=((w=d.variables)==null?void 0:w.edit)??null,y=(((E=d.data)==null?void 0:E.kind)==="rejected"?d.data.message:null)??((C=d.error)==null?void 0:C.message)??null,b=(m==null?void 0:m.kind)==="add";return{isPending:d.isPending,onMove:(T,N)=>{h({kind:"move",segmentId:T,direction:N})},addition:{isWriting:l,isSaving:b&&d.isPending,errorMessage:b?y:null,onEdit:()=>{b&&d.reset(),c(!0)},onSave:T=>{h({kind:"add",...T})},onCancel:()=>{b&&d.reset(),c(!1)}},authoringOf:T=>{const N=(m==null?void 0:m.kind)==="change"&&m.segmentId===T;return{writing:{isWriting:s.includes(T),isSaving:N&&d.isPending,errorMessage:N?y:null,onEdit:()=>{N&&d.reset(),i(R=>R.includes(T)?R:[...R,T])},onSave:R=>{h({kind:"change",segmentId:T,...R})},onCancel:()=>{N&&d.reset(),u(T)}},isPending:d.isPending,onRemove:()=>{h({kind:"remove",segmentId:T})}}}}},Gye=2500,Kye=()=>{const[e,t]=O.useState(null);O.useEffect(()=>{if(e===null)return;const r=window.setTimeout(()=>{t(null)},Gye);return()=>{window.clearTimeout(r)}},[e]);const n=O.useCallback(r=>{t({message:r})},[]);return[(e==null?void 0:e.message)??null,n]},Yye=(e,t)=>{const n=ii(),r=Ri(),s=Nn(n.review.editWalkthrough.mutationOptions({onSuccess:async i=>{i.kind==="rejected"?t(i.message):await r.invalidateQueries(n.review.get.pathFilter())},onError:i=>{t(i.message)}}));return{isPending:s.isPending,onMoveFile:(i,l,c)=>{s.mutate({...e,segmentId:i,edit:{kind:"move-file",path:l,direction:c}})},onRemoveFile:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-file",path:l}})},onRemoveWaypoint:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-waypoint",waypointId:l}})}}},Wye="j",Xye="k",Qye="input, textarea, select, [contenteditable='true']",Zye=e=>e instanceof Element&&e.closest(Qye)!==null,Jye=(e,t)=>{const n=O.useEffectEvent(e),r=O.useEffectEvent(t);O.useEffect(()=>{const s=i=>{i.repeat||i.metaKey||i.ctrlKey||i.altKey||Zye(i.target)||(i.key===Wye&&r(),i.key===Xye&&n())};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[])},gE=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start"})},exe=(e,t)=>{const[n,r]=O.useState(()=>new Set),[s,i]=O.useState(null),l=e.flatMap(y=>y.walkthrough.files.flatMap(b=>b.rows.flatMap(w=>w.kind==="waypoint"?[w.waypoint]:[]))),c=l.find(y=>y.id===s)??null,u=c===null?(t==null?void 0:t.lastWaypointId)??null:c.previousId,d=c===null?(t==null?void 0:t.firstWaypointId)??null:c.nextId,h=y=>{const b=l.find(w=>w.id===y);b!==void 0&&(i(b.id),r(w=>new Set([...w,b.id])),gE(b.anchorId))},m=()=>{h(u)},g=()=>{h(d)};return Jye(m,g),{openWaypointIds:n,currentWaypointId:s,positionLabel:(c==null?void 0:c.positionLabel)??null,canStepBack:u!==null,canStepForward:d!==null,onPrevious:m,onNext:g,onToggleWaypoint:y=>{i(y),r(b=>new Set(b.has(y)?[...b].filter(w=>w!==y):[...b,y]))},onOpenCodeLink:y=>{const b=l.find(w=>w.anchorId===y);b===void 0?gE(y):h(b.id)}}},txe=O.lazy(async()=>await $t(()=>import("./index-eMdhkBjo.js"),__vite__mapDeps([26,24]))),nxe=O.lazy(async()=>await $t(()=>import("./index-Ccx_zqhL.js"),__vite__mapDeps([27,24]))),rxe=O.lazy(async()=>await $t(()=>import("./index-CIReAhWD.js"),__vite__mapDeps([23,24]))),sxe=O.lazy(async()=>await $t(()=>import("./index-C8gx27Rr.js"),__vite__mapDeps([28,24]))),ixe=5e3,oxe=480,wH="The backend did not say what went wrong.",lxe="Could not copy to the clipboard",axe="Loading the options…",yE="Loading the editor…",cxe="Add a segment",uxe="New segment",fxe="This Flight Plan has no segments yet.",dxe="Publish anyway",hxe="Arrange segments",pxe="Move a segment up or down. The order is saved as you go.",mxe="Arrange files",gxe="Move a file up or down in the Code Walkthrough. The order is saved as you go.",yxe=[],xxe=[],bxe="text-4xl leading-10 font-bold tracking-[-0.02em]",vxe="[--line:var(--primary-text)]",Sxe="[--band-height:3.5rem] [--walkthrough-heading-height:2.75rem] [--section-scroll-margin:4.5rem] [--file-header-top:6.25rem] [--waypoint-scroll-margin:9.75rem] [--chat-width:26rem]",N1=e=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(sxe,{...e})}),EH=(e,t)=>({repositoryName:e.repoName,targetId:e.branchId,filterKeys:t.filter??null,isShowingReviewed:t.reviewed??!1}),jbe=({params:e,search:t,onSearchChange:n})=>{var Ae,Le,Ie,Ue,We,Oe,De,ne,he;const r=ii(),s=Ri(),i=jp(),l=O.use(Qj),c={repositoryName:e.repoName,targetId:e.branchId},{data:u}=fj({...r.review.get.queryOptions(EH(e,t)),refetchInterval:ixe,refetchIntervalInBackground:!0}),[d,h]=O.useState(null),[m,g]=O.useState(null),[y,b]=O.useState(!1),[w,E]=O.useState(!1),[C,T]=O.useState(null),[N,R]=Kye(),{isOwn:M}=u,D=u.kind==="artifact"?u.progress:null;Iye(`${e.repoName}/${e.branchId}`,D!==null,u.kind==="artifact"?u.completion:null,R);const k=_ye(),I=jye(c),_=qye(c,R),P=zye(c,R),H=Yye(c,R),z=Uye(c,R),U=$ye(c,R),j=Vye(oxe),B=Rye(c,R),L=Zc({...r.review.rebuildForm.queryOptions({...c,mode:d??"update"}),enabled:d!==null,gcTime:0}),$=async()=>{await s.invalidateQueries(r.review.get.pathFilter())},q=se=>{R(se.message)},G=(se,Te)=>{navigator.clipboard.writeText(se).then(()=>{R(Te)},()=>{R(lxe)})},W=Nn(r.review.setReviewed.mutationOptions({onSuccess:$,onError:q})),Z=Nn(r.review.publish.mutationOptions({onSuccess:async({message:se})=>{R(se),await $()},onError:q})),re=Nn(r.review.markComplete.mutationOptions({onSuccess:async({message:se,targetId:Te})=>{R(se),E(!1),await $(),Te!==e.branchId&&i({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e.repoName,branchId:Te}})},onError:q})),de=Nn(r.review.request.mutationOptions({onSuccess:async se=>{se.kind==="requested"&&(se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),F=Nn(r.review.rebuild.mutationOptions({onSuccess:async se=>{se.kind==="rebuilt"&&(h(null),se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),X=Nn(r.review.delete.mutationOptions({onSuccess:async({message:se})=>{R(se),await Promise.all([$(),s.invalidateQueries(r.review.creationForm.pathFilter())])},onError:q})),te=se=>{F.reset(),h(se)},J=u.kind==="artifact"?u:null,K=(J==null?void 0:J.segments.find(se=>se.id===C))??null,ce=exe((J==null?void 0:J.segments)??xxe,(J==null?void 0:J.walkthroughControls.stepping)??null),{openWaypointIds:ye,currentWaypointId:ge}=ce,oe=ce.onOpenCodeLink,xe=ce.onToggleWaypoint,Se=[...(J==null?void 0:J.rail.groups.flatMap(se=>se.sections))??[],...(J==null?void 0:J.rail.sections)??[]],ke=Oce(Se.flatMap(se=>[se.anchorId,...se.children.map(Te=>Te.anchorId)])),_e=n,we=se=>{const Te=J==null?void 0:J.segments.find(Ve=>Ve.anchorId===se);Te!==void 0&&(_.authoringOf(Te.id).writing.onEdit(),gE(se))},Re=(se,Te)=>{s.query({...r.review.codeReference.queryOptions({...c,path:se.path,lineStart:se.lineStart,lineEnd:se.lineEnd}),staleTime:"static"}).then(Te,Ve=>{R(Ve instanceof Error?Ve.message:wH)})};return x.jsxs("div",{className:Ne("px-6 pb-16 transition-[margin] duration-200 ease-out",B.isOpen?"mr-(--chat-width)":"",vxe,Sxe),children:[x.jsx("title",{children:u.shell.documentTitle}),l===null?null:Bs.createPortal(x.jsxs(x.Fragment,{children:[x.jsx(RG,{lineColor:"primary"}),x.jsx(Aue,{header:u.shell.header,changedFiles:u.kind==="missing"?u.changedFiles:null,authorLabel:u.shell.authorLabel,reviewerRequesting:U.reviewerRequesting,actions:u.kind==="missing"?null:x.jsxs(x.Fragment,{children:[x.jsx(Yce,{label:u.chatLabel,isPressed:B.isOpen,onClick:B.onToggle}),!M||u.unassignedFiles===null?null:x.jsx(Xce,{label:u.unassignedFiles.label,onClick:()=>{g({kind:"list"})}}),u.completeAction===null?null:x.jsx(Wce,{label:u.completeAction.label,isPending:re.isPending,onClick:()=>{var se;((se=u.completeAction)==null?void 0:se.pullRequestChoice)==null?re.mutate({...c,pullRequestTargetId:null}):E(!0)}}),u.sharing===null?null:x.jsx(Jce,{sharing:u.sharing,publishingKey:Z.isPending?Z.variables.destination:null,onPublish:se=>{u.unassignedFiles===null?Z.mutate({...c,destination:se}):g({kind:"publish",destination:se})}}),u.reviewDraft===null?null:x.jsx(Zce,{draft:u.reviewDraft,isSubmitting:U.isSubmitting,isDiscarding:U.isDiscarding,errorMessage:U.submissionError,submissionCount:U.submissionCount,renderEditor:N1,onSubmit:U.onSubmit,onDiscard:U.onDiscardComment}),x.jsx(Qce,{forgeLink:u.shell.header.kind==="pull-request"?u.shell.header.forgeLink:null,rebuild:M?null:{onUpdate:()=>{te("update")},onRegenerate:()=>{te("regenerate")}},onDelete:()=>{X.mutate(c)}})]})})]}),l),x.jsx(Q0e,{isOpen:d!==null,rebuildForm:L.isFetching?null:L.data??null,loadingLabel:axe,problem:((Ae=F.data)==null?void 0:Ae.kind)==="rejected"?F.data:null,errorMessage:((Le=F.data)==null?void 0:Le.kind)==="unavailable"?F.data.message:((Ie=F.error)==null?void 0:Ie.message)??((Ue=L.error)==null?void 0:Ue.message)??null,isPending:F.isPending,onSubmit:se=>{d!==null&&(Q1(),F.mutate({...c,...se,mode:d}))},onClose:()=>{h(null)}}),u.kind==="missing"&&M?x.jsx(O.Suspense,{fallback:null,children:x.jsx(X0e,{repositoryName:e.repoName,targetId:e.branchId})}):null,u.kind==="missing"&&!M?x.jsx(mye,{heading:u.heading,message:u.message,form:u.form,problem:((We=de.data)==null?void 0:We.kind)==="rejected"?de.data:null,errorMessage:((Oe=de.data)==null?void 0:Oe.kind)==="unavailable"?de.data.message:((De=de.error)==null?void 0:De.message)??null,isPending:de.isPending,dataNotice:u.shell.notice,onSubmit:se=>{Q1(),de.mutate({...c,...se})}}):null,u.kind==="missing"?null:x.jsxs(p4,{value:((ne=u.progress)==null?void 0:ne.isWriting)===!0?u.progress.label:null,children:[x.jsx(eye,{staleNotice:u.staleNotice,unassignedFiles:M?null:u.unassignedFiles,progress:u.progress,onShowUnassignedFiles:()=>{g({kind:"list"})},onCopyPrompt:G}),x.jsxs("div",{className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8",children:[x.jsx("aside",{className:"sticky top-[calc(var(--band-height)+0.5rem)] max-h-[calc(100dvh-var(--band-height)-1rem)] self-start overflow-y-auto pt-5 pb-4",children:x.jsx(Iue,{label:"Review sections",groups:u.rail.groups,sections:u.rail.sections,currentAnchorId:ke,onEditGroup:M?we:null,onArrangeGroups:M&&u.segments.some(se=>se.outline.canMoveUp)?()=>{b(!0)}:null})}),x.jsxs("div",{className:"min-w-0",children:[u.segments.map(se=>x.jsxs("section",{id:se.anchorId,"aria-label":(M?se.outline.heading:se.heading)??void 0,className:"scroll-mt-(--section-scroll-margin) not-first:border-t-4 not-first:border-foreground",children:[x.jsx(dye,{reviewKey:c,heading:se.heading,isTitleDraft:se.isTitleDraft,detailLabel:se.detailLabel,outline:se.outline,authoring:M?_.authoringOf(se.id):null}),x.jsx(A0e,{...se.context,codeLinks:u.codeLinks,editing:M?I(se.id):null,renderCodeLinkDialog:Te=>x.jsx(vh,{reviewKey:c,...Te}),onOpenCodeLink:oe}),se.offers.journey===null?x.jsx(Nce,{...se.journey,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,isReviewPending:W.isPending,authoring:M?P.authoringOf(se.id):null,renderDescriptionEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(rxe,{...Te,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})})}):null,onOpenCodeLink:oe,onWaypointReviewedChange:M?null:(Te,Ve)=>{W.mutate({...c,subject:{kind:"waypoint",id:Te},isReviewed:Ve})}}):x.jsx(US,{kind:"board",...se.offers.journey,isGenerating:z.generatingSection===se.offers.journey.section,errorMessage:z.errorMessageOf(se.offers.journey.section),onGenerate:()=>{z.onGenerate("journey")}}),se.offers.blast===null?null:x.jsx(US,{kind:"board",...se.offers.blast,isGenerating:z.generatingSection===se.offers.blast.section,errorMessage:z.errorMessageOf(se.offers.blast.section),onGenerate:()=>{z.onGenerate("blast")}}),se.blast===null?null:x.jsx(QZ,{...se.blast,codeLinks:u.codeLinks,renderImpactEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:yE}),children:x.jsx(nxe,{...Te,reviewKey:c,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})},Te.path)}):null,onOpenCodeLink:oe,onOpenFile:oe}),x.jsxs(oee,{anchorId:se.walkthrough.anchorId,heading:se.walkthrough.heading,intro:se.walkthrough.intro,coverageLabel:se.walkthrough.coverageLabel,controls:u.walkthroughControls,positionLabel:ce.positionLabel??u.walkthroughControls.stepping.idleLabel,canStepBack:ce.canStepBack,canStepForward:ce.canStepForward,emptyMessage:se.walkthrough.emptyMessage,codeLinks:u.codeLinks,onArrangeFiles:M&&se.walkthrough.fileOrder.length>1?()=>{T(se.id)}:null,onOpenCodeLink:oe,onPrevious:ce.onPrevious,onNext:ce.onNext,onFilterChange:Te=>{_e({filter:Te===null?void 0:[...Te]})},onShowReviewedChange:M?null:Te=>{_e({reviewed:Te?!0:void 0})},children:[se.offers.findings===null?null:x.jsx(US,{kind:"notice",...se.offers.findings,isGenerating:z.generatingSection===se.offers.findings.section,errorMessage:z.errorMessageOf(se.offers.findings.section),onGenerate:()=>{z.onGenerate("findings")}}),M?se.walkthrough.files.map(Te=>x.jsx(Tye,{reviewKey:c,segmentId:se.id,file:Te,openWaypointIds:ye,currentWaypointId:ge,isPending:H.isPending,codeLinks:u.codeLinks,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve}),onOpenCodeLink:oe,onToggleWaypoint:xe,onRemove:()=>{H.onRemoveFile(se.id,Te.path)},onRemoveWaypoint:Ve=>{H.onRemoveWaypoint(se.id,Ve)}},Te.anchorId)):se.walkthrough.files.map(Te=>x.jsx(yee,{file:Te,openWaypointIds:ye,currentWaypointId:ge,isReviewPending:W.isPending,composer:u.composer,composingRange:U.composingRangeOf(Te.path),isCommentPending:U.isCommentPending,renderCommentEditor:N1,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,onOpenCodeLink:oe,onToggleWaypoint:xe,onWaypointReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"waypoint",id:Ve},isReviewed:jt})},onFileReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"file",path:Ve},isReviewed:jt})},onStartComment:U.onStartComment,onAddComment:U.onAddComment,onPostComment:U.onPostComment,onReply:U.onReply,onResolveThread:U.onResolveThread,onDiscardComment:U.onDiscardComment},Te.anchorId))]})]},se.id)),M&&u.segments.length===0&&!_.addition.isWriting?x.jsx("p",{className:"pt-6 text-muted-foreground",children:fxe}):null,M&&_.addition.isWriting?x.jsx(SH,{reviewKey:c,legend:uxe,label:"",paths:yxe,isSaving:_.addition.isSaving,isDeleting:!1,errorMessage:_.addition.errorMessage,onSave:_.addition.onSave,onDelete:null,onClose:_.addition.onCancel}):null,M&&!_.addition.isWriting?x.jsx(nt,{variant:"outline",className:"mt-6",onClick:_.addition.onEdit,children:cxe}):null,u.conversation===null||u.composer===null?null:x.jsx(_0e,{anchorId:u.conversation.anchorId,heading:u.conversation.heading,emptyMessage:u.conversation.emptyMessage,entries:u.conversation.entries,placeholder:u.composer.placeholder,submitLabel:u.composer.commentLabel,isSubmitting:U.isCommentPending,renderEditor:N1,onComment:U.onComment})]})]}),y&&M?x.jsx(iD,{title:hxe,description:pxe,entries:u.segments.map(se=>({id:se.id,...se.outline})),isPending:_.isPending,onMove:_.onMove,onClose:()=>{b(!1)}}):null,!M||K===null?null:x.jsx(iD,{title:mxe,description:gxe,entries:K.walkthrough.fileOrder.map(se=>({id:se.path,...se})),isPending:H.isPending,onMove:(se,Te)=>{H.onMoveFile(K.id,se,Te)},onClose:()=>{T(null)}}),!M||P.cardAddition===null?null:x.jsx(gfe,{reviewKey:c,addition:P.cardAddition}),!M||P.cardChange===null?null:x.jsx(O.Suspense,{fallback:null,children:x.jsx(txe,{reviewKey:c,change:P.cardChange,renderCodeLinkDialog:se=>x.jsx(vh,{reviewKey:c,...se})})}),w&&((he=u.completeAction)==null?void 0:he.pullRequestChoice)!=null?x.jsx(R0e,{choice:u.completeAction.pullRequestChoice,isPending:re.isPending,onComplete:se=>{re.mutate({...c,pullRequestTargetId:se})},onClose:()=>{E(!1)}}):null,m===null||u.unassignedFiles===null?null:x.jsx(xye,{title:u.unassignedFiles.title,description:u.unassignedFiles.description,paths:u.unassignedFiles.paths,confirmation:m.kind==="list"?null:{warning:u.unassignedFiles.publishWarning,confirmLabel:dxe,onConfirm:()=>{Z.mutate({...c,destination:m.destination}),g(null)}},onClose:()=>{g(null)}}),x.jsx(hye,{selection:k,onComment:(se,Te)=>{var Ve;U.onStartRangeComment(se,Te),(Ve=window.getSelection())==null||Ve.removeAllRanges()},onAsk:se=>{Re(se,({reference:Te})=>{B.onAsk(Te)})}}),B.isOpen&&B.conversation!==void 0?x.jsx(hJ,{conversation:B.conversation,modelChoice:B.modelChoice,codeLinks:u.codeLinks,reference:B.reference,isSending:B.isSending,sendProblem:B.sendProblem,answering:B.answering,onSend:B.onSend,onAnswer:B.onAnswer,onChooseModel:B.onChooseModel,onClearReference:B.onClearReference,onOpenCodeLink:oe,onClose:B.onClose}):null,j&&!B.isOpen?x.jsx(un,{icon:"top",label:"Back to top",variant:"outline",className:"fixed right-4 bottom-4 z-30",onClick:()=>{window.scrollTo({top:0})}}):null]}),x.jsx(jue,{message:N})]})},Lbe=({error:e})=>{const t=gs();return x.jsxs("section",{role:"alert",className:"max-w-prose px-6 pt-8",children:[x.jsx("h1",{className:bxe,children:"Could not open this review"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:wH}),x.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[x.jsx(nt,{onClick:()=>{t.invalidate()},children:"Try again"}),x.jsx(Ff,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},wxe=e=>typeof e=="boolean"?e:void 0,Exe=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,Cxe=e=>({filter:Exe(e.filter),reviewed:wxe(e.reviewed)}),Nxe=()=>$t(()=>import("./_branchId--sAXSZ0Z.js"),[]),Txe=()=>$t(()=>import("./_branchId-BctD9BVI.js"),[]),Rxe=ys()({staticData:{isFullWidth:!0},validateSearch:Cxe,loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{const s=await e.query({...t.review.get.queryOptions(EH(n,r)),staleTime:"static"});s.kind!=="missing"||!s.isOwn||await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:n.branchId}),staleTime:"static"})},component:fn(Txe,"component"),pendingComponent:q7,errorComponent:fn(Nxe,"errorComponent")}),Oxe=()=>$t(()=>import("./create-CNT_ktA4.js"),[]),kxe=()=>$t(()=>import("./create-BXn1thks.js"),[]),Mxe=ys()({loader:async({context:{queryClient:e,trpc:t},params:n})=>{await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:null}),staleTime:"static"})},component:fn(kxe,"component"),errorComponent:fn(Oxe,"errorComponent")}),Axe=()=>$t(()=>import("./index-BCEvS2zI.js"),__vite__mapDeps([29,7])),_xe=()=>$t(()=>import("./index-D6S4PGCc.js"),__vite__mapDeps([30,11])),Dxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.list.queryOptions(),staleTime:"static"})},component:fn(_xe,"component"),pendingComponent:ru,errorComponent:fn(Axe,"errorComponent")}),Ixe=()=>$t(()=>import("./_id-ZvG2tACL.js"),__vite__mapDeps([31,7])),jxe=()=>$t(()=>import("./_id-DS2_k7mD.js"),__vite__mapDeps([32,24])),Lxe=ys()({validateSearch:e=>typeof e.field=="string"?{field:e.field}:{},loaderDeps:({search:e})=>({field:e.field??null}),loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{await e.query({...t.configuration.get.queryOptions({id:n.id,field:r.field}),staleTime:"static"})},component:fn(jxe,"component"),pendingComponent:ru,errorComponent:fn(Ixe,"errorComponent")}),Pxe=()=>$t(()=>import("./create-CGIYQfn-.js"),__vite__mapDeps([33,7])),zxe=()=>$t(()=>import("./create-DQsVrUIP.js"),__vite__mapDeps([34,11])),Bxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.creationForm.queryOptions(),staleTime:"static"})},component:fn(zxe,"component"),pendingComponent:ru,errorComponent:fn(Pxe,"errorComponent")}),Hxe=m7.update({id:"/",path:"/",getParentRoute:()=>nu}),al=y7.update({id:"/settings",path:"/settings",getParentRoute:()=>nu}),Fxe=x7.update({id:"/",path:"/",getParentRoute:()=>al}),$xe=E7.update({id:"/agents",path:"/agents",getParentRoute:()=>al}),Vxe=R7.update({id:"/configuration",path:"/configuration",getParentRoute:()=>al}),Uxe=A7.update({id:"/forges",path:"/forges",getParentRoute:()=>al}),qxe=j7.update({id:"/repositories",path:"/repositories",getParentRoute:()=>al}),Gxe=F7.update({id:"/setup/",path:"/setup/",getParentRoute:()=>nu}),Kxe=U7.update({id:"/artifact/claude/download",path:"/artifact/claude/download",getParentRoute:()=>nu}),Yxe=Rxe.update({id:"/pr-reviews/$repoName/$branchId",path:"/pr-reviews/$repoName/$branchId",getParentRoute:()=>nu}),Wxe=Mxe.update({id:"/pr-reviews/$repoName/create",path:"/pr-reviews/$repoName/create",getParentRoute:()=>nu}),Xxe=Dxe.update({id:"/profiles/",path:"/profiles/",getParentRoute:()=>al}),Qxe=Lxe.update({id:"/profiles/$id",path:"/profiles/$id",getParentRoute:()=>al}),Zxe=Bxe.update({id:"/profiles/create",path:"/profiles/create",getParentRoute:()=>al}),Jxe={SettingsAgentsRoute:$xe,SettingsConfigurationRoute:Vxe,SettingsForgesRoute:Uxe,SettingsRepositoriesRoute:qxe,SettingsIndexRoute:Fxe,SettingsProfilesIdRoute:Qxe,SettingsProfilesCreateRoute:Zxe,SettingsProfilesIndexRoute:Xxe},ebe=al._addFileChildren(Jxe),tbe={IndexRoute:Hxe,SettingsRouteRoute:ebe,SetupIndexRoute:Gxe,ArtifactClaudeDownloadRoute:Kxe,PrReviewsRepoNameBranchIdRoute:Yxe,PrReviewsRepoNameCreateRoute:Wxe},nbe=nu._addFileChildren(tbe)._addFileTypes(),rbe=(e,t)=>BU({routeTree:nbe,context:e,defaultPreload:"intent",defaultPreloadStaleTime:0,...t===void 0?{}:{history:t}}),sbe=({queryClient:e,trpcClient:t,history:n})=>{const r=rbe({queryClient:e,trpc:CG(t,e)},n);return x.jsx(l$,{client:e,children:x.jsx(SG,{trpcClient:t,queryClient:e,children:x.jsx($U,{router:r})})})},CH=document.getElementById("root");if(!CH)throw new Error("Missing #root element in index.html");const ibe=sbe({queryClient:new _$,trpcClient:EG(wG())});W$.createRoot(CH).render(x.jsx(O.StrictMode,{children:ibe}));export{W0e as $,gx as A,nt as B,fu as C,cu as D,fbe as E,eee as F,md as G,hd as H,un as I,F7 as J,SE as K,g4 as L,Mx as M,x4 as N,Wj as O,D0e as P,uB as Q,m7 as R,D0 as S,YM as T,U7 as U,$7 as V,abe as W,Lbe as X,Rxe as Y,jbe as Z,Mxe as _,tee as a,bn as a$,q0e as a0,jp as a1,Lxe as a2,S2 as a3,bp as a4,E2 as a5,ft as a6,co as a7,pge as a8,qh as a9,Abe as aA,Nt as aB,Mbe as aC,wbe as aD,Sbe as aE,rt as aF,Ome as aG,pbe as aH,Mn as aI,iH as aJ,mbe as aK,oH as aL,zme as aM,$ge as aN,Fx as aO,Tbe as aP,Op as aQ,xbe as aR,Me as aS,vbe as aT,bbe as aU,ybe as aV,lr as aW,Dy as aX,Nbe as aY,sde as aZ,Tpe as a_,U2 as aa,Gt as ab,Ke as ac,Ebe as ad,Rbe as ae,gbe as af,jme as ag,Cbe as ah,kge as ai,vC as aj,od as ak,Obe as al,zE as am,Mi as an,$s as ao,ube as ap,_y as aq,uI as ar,l0e as as,_be as at,_me as au,He as av,ct as aw,Fge as ax,Dbe as ay,kbe as az,nee as b,Ei as b0,hbe as b1,Lpe as b2,jpe as b3,K2 as b4,Ibe as b5,h0 as b6,X9 as c,Ff as d,dbe as e,Ne as f,NG as g,ii as h,Ri as i,x as j,fj as k,Nn as l,Zc as m,Qj as n,tu as o,Bs as p,RG as q,O as r,b7 as s,C7 as t,gs as u,O7 as v,_7 as w,uu as x,Oa as y,ka as z};
441
+ `,textSerializers:n={}}=e||{};return Lme(this.state.doc,{blockSeparator:t,textSerializers:{...sH(this.schema),...n}})}get isEmpty(){return K2(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 e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new i0e(t,this,!1,n)}get $doc(){return this.$pos(0)}};function kbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=t,l=r[r.length-1],c=r[0];if(l){const u=c.search(/\S/),d=n.from+c.indexOf(l),h=d+l.length;if(oH(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(y=>y===e.type&&y!==g.mark.type)).filter(g=>g.to>d).length)return null;h<n.to&&i.delete(h,n.to),d>n.from&&i.delete(n.from+u,d);const m=n.from+u+l.length;i.addMark(n.from+u,m,e.type.create(s||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function Mbe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Gt(e.getAttributes,void 0,r)||{},{tr:i}=t,l=n.from;let c=n.to;const u=e.type.create(s);if(r[1]){let d=l+r[0].lastIndexOf(r[1]);d>c?d=c:c=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,l+r[0].length-1),i.replaceWith(d,c,u)}else if(r[0]){const d=e.type.isInline?l:l-1;i.insert(d,e.type.create(s)).delete(i.mapping.map(l),i.mapping.map(c))}i.scrollIntoView()},undoable:e.undoable})}function Abe(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),i=Gt(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function _be(e){return new Fx({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const i=Gt(e.getAttributes,void 0,r)||{},l=t.tr.delete(n.from,n.to),c=l.doc.resolve(n.from).blockRange(),u=c&&R2(c,e.type,i);if(!u)return null;if(l.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:g}=e.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){const b=y.filter(w=>g.includes(w.type.name));l.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const d=l.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Ia(l.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&l.join(n.from-1)},undoable:e.undoable})}var l0e=class yH extends Y2{constructor(...t){super(...t),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new yH(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Dbe(e){return new $ge({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const i=Gt(e.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:l}=t,c=r[r.length-1],u=r[0];let d=n.to;if(c){const h=u.search(/\S/),m=n.from+u.indexOf(c),g=m+c.length;if(oH(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(b=>b===e.type&&b!==y.mark.type)).filter(y=>y.to>m).length)return null;g<n.to&&l.delete(g,n.to),m>n.from&&l.delete(n.from+h,m),d=n.from+h+c.length,l.addMark(n.from+h,d,e.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||l.removeStoredMark(e.type)}}})}const h0="codeLink",b1="data-code-link",TI="data-code",a0e=/^\[(`?)([^\]`\n]+)\1\]\(code:([^)\s]+)\)/,c0e=/\[[^\]\n]*\]\(code:/,u0e="rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[0.875em] data-code:font-mono",f0e=/^[^\]`\n]+$/,d0e=/^[^)\s]+$/,h0e="#",p0e=({lineStart:e,lineEnd:t})=>e===t?`L${String(e)}`:`L${String(e)}-${String(t)}`,m0e=({path:e,range:t,label:n,isCode:r})=>{const s=n.trim();return f0e.test(s)&&d0e.test(e)?{linkId:`${e}${h0e}${p0e(t)}`,label:s,isCode:r}:null},RI=e=>typeof e=="string"?e:"",v1=e=>({linkId:RI(e==null?void 0:e.linkId),label:RI(e==null?void 0:e.label),isCode:(e==null?void 0:e.isCode)===!0}),g0e=({linkId:e,label:t,isCode:n})=>`[${n?`\`${t}\``:t}](code:${e})`,y0e=e=>{const t=a0e.exec(e);return t===null?null:{raw:t[0],isCode:t[1]!=="",label:t[2],linkId:t[3]}},Ibe=l0e.create({name:h0,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes:()=>({linkId:{default:""},label:{default:""},isCode:{default:!1}}),parseHTML:()=>[{tag:`span[${b1}]`,getAttrs:e=>({linkId:e.getAttribute(b1)??"",label:e.textContent,isCode:e.hasAttribute(TI)})}],renderHTML:({node:e})=>{const{linkId:t,label:n,isCode:r}=v1(e.attrs);return["span",{[b1]:t,...r?{[TI]:""}:{},class:u0e,title:t},n]},markdownTokenizer:{name:h0,level:"inline",start:e=>e.search(c0e),tokenize:e=>{const t=y0e(e);return t===null?void 0:{type:h0,...t}}},parseMarkdown:e=>({type:h0,attrs:v1(e)}),renderMarkdown:e=>g0e(v1(e.attrs))}),x0e="Link to code",b0e="Pick a file of the Flight Plan, select the lines the link points at, and name the link.",v0e="File",S0e="Search the files of the Flight Plan",w0e="Link these lines",E0e="Select the lines in the code: click a line number, then another with Shift.",C0e="Label",N0e="Show the label as code",T0e="Write a label without a backtick or a closing square bracket.",vh=({reviewKey:e,selectedText:t,onInsert:n,onClose:r})=>{const s=O.useId(),i=w2(e,"flight-plan"),[l,c]=O.useState(null),[u,d]=O.useState(null),[h,m]=O.useState(t),[g,y]=O.useState(!1),b=S2(e,l),w=l===null||u===null?null:m0e({path:l,range:u,label:h,isCode:g}),E=l!==null&&u!==null&&h.trim()!==""&&w===null,C=T=>{c(T),d(null),i.onQueryChange(T)};return x.jsx(cu,{open:!0,onOpenChange:T=>{T||r()},children:x.jsxs(uu,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:x0e}),x.jsx(fu,{children:b0e})]}),x.jsx(C2,{label:v0e,hint:null,placeholder:S0e,query:i.query,files:i.files,message:i.message,errorMessage:i.errorMessage,onQueryChange:i.onQueryChange,onSelect:C}),l===null?x.jsx("span",{}):x.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[x.jsx(E2,{path:l,lines:b.lines,statusMessage:b.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:w0e,focusOn:u,className:"flex-1",onHighlightCode:d}),x.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:u===null?E0e:bp(u)})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("label",{htmlFor:s,className:"text-sm font-bold",children:C0e}),x.jsx(Mx,{id:s,value:h,"aria-invalid":E,onChange:T=>{m(T.target.value)}}),E?x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T0e}):null,x.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[x.jsx("input",{type:"checkbox",checked:g,className:"size-4 accent-(--primary)",onChange:T=>{y(T.target.checked)}}),N0e]})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:"Cancel"}),x.jsx(nt,{type:"button",disabled:w===null,onClick:()=>{w!==null&&n(w)},children:"Insert"})]})]})})},R0e=({choice:e,isPending:t,onComplete:n,onClose:r})=>{const s=O.useId(),[i,l]=O.useState(e.selectedId);return x.jsx(cu,{open:!0,onOpenChange:c=>{c||r()},children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e.title}),x.jsx(fu,{children:e.description})]}),e.emptyMessage===null?x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e.title}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:e.options.map(c=>x.jsxs("li",{className:"border-b border-border py-3",children:[x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:s,checked:i===c.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{l(c.id)}}),x.jsx("span",{className:"min-w-0 font-bold",children:c.label})]}),x.jsx("span",{className:"block pl-7 text-sm text-muted-foreground",children:c.detail})]},c.id))})]}):x.jsx("p",{className:"text-muted-foreground",children:e.emptyMessage}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:r,children:e.cancelLabel}),x.jsx(nt,{type:"button",variant:"outline",disabled:t,onClick:()=>{n(null)},children:e.skipLabel}),e.emptyMessage===null?x.jsx(nt,{type:"button",disabled:t||i===null,onClick:()=>{n(i)},children:e.confirmLabel}):null]})]})})},O0e=({anchorId:e,heading:t,action:n=null,children:r})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) pt-6 pb-8",children:[x.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[x.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),n]}),r]}),k0e=O.lazy(async()=>await $t(()=>import("./index-PzkXPYSX.js"),__vite__mapDeps([23,24]))),M0e="Loading the editor…",A0e=({anchorId:e,heading:t,context:n,markdown:r,isDraft:s,unwrittenLabel:i,codeLinks:l,editing:c,renderCodeLinkDialog:u,onOpenCodeLink:d})=>{const h=(c==null?void 0:c.isWriting)===!0;return x.jsxs(O0e,{anchorId:e,heading:t,action:c===null||h?null:x.jsx(nt,{variant:"link",size:"sm",onClick:c.onEdit,children:"Edit"}),children:[c!==null&&h?x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:M0e}),children:x.jsx(k0e,{label:t,markdown:r,isSaving:c.isSaving,errorMessage:c.errorMessage,renderCodeLinkDialog:u,onSave:c.onSave,onCancel:c.onCancel})}):null,!h&&s?x.jsx(so,{isPending:!0,lineCount:4,className:"max-w-[44rem] text-base",children:x.jsx("p",{className:"text-muted-foreground",children:i})}):null,!h&&!s?x.jsx(Hs,{blocks:n,codeLinks:l,onOpenCodeLink:d}):null]})},_0e=({anchorId:e,heading:t,emptyMessage:n,entries:r,placeholder:s,submitLabel:i,isSubmitting:l,renderEditor:c,onComment:u})=>x.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[x.jsx("h2",{id:`${e}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),x.jsxs("div",{className:"flex max-w-[52rem] flex-col",children:[n===null?null:x.jsx("p",{className:"pb-4 text-muted-foreground",children:n}),r.map(d=>x.jsx(H4,{comment:d,verdictLabel:d.verdictLabel,locationLabel:d.locationLabel,className:"border-t py-3 first:border-t-0 first:pt-0"},d.id)),x.jsx(VC,{label:s,submitLabel:i,cancelLabel:null,isSubmitting:l,className:"border-t pt-4",renderEditor:c,onSubmit:u})]})]}),D0e=({label:e,options:t,value:n,className:r,onChange:s})=>{const i=O.useId();return x.jsxs("fieldset",{className:Ne("grid gap-1.5",r),children:[x.jsx("legend",{className:"float-left text-sm font-bold",children:e}),x.jsx("span",{className:"clear-left inline-flex w-fit overflow-hidden rounded-lg border border-input bg-card",children:t.map(l=>x.jsxs("label",{className:"flex h-[calc(2rem-2px)] cursor-pointer items-center border-l border-input px-3 text-sm transition-colors duration-[180ms] ease-out first:border-l-0 hover:bg-muted has-checked:bg-foreground has-checked:font-bold has-checked:text-background has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring",children:[x.jsx("input",{type:"radio",name:i,className:"sr-only",checked:n===l.value,onChange:()=>{s(l.value)}}),x.jsx("span",{className:"text-box-cap",children:l.label})]},l.value))})]})},I0e="flex w-full max-w-xl items-center gap-3 rounded-lg border border-input bg-card px-3 py-2 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",OI=({option:e})=>x.jsxs("span",{className:"flex items-baseline gap-2",children:[x.jsx("span",{className:"font-bold",children:e.label}),e.tagLabel===null?null:x.jsx("span",{className:"text-sm text-muted-foreground",children:e.tagLabel})]}),kI=({label:e,dialogTitle:t,dialogDescription:n,chooseLabel:r,cancelLabel:s,options:i,selectedKey:l,describedBy:c,onChoose:u})=>{const d=O.useId(),[h,m]=O.useState(!1),[g,y]=O.useState(l),b=i.find(C=>C.key===l),w=()=>{y(l),m(!0)},E=()=>{u(g),m(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":h,"aria-label":`${e}: ${(b==null?void 0:b.label)??""}`,"aria-describedby":c,className:I0e,onClick:w,children:[x.jsx("span",{className:"min-w-0 flex-1",children:b===void 0?null:x.jsxs(x.Fragment,{children:[x.jsx(OI,{option:b}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:b.summary})]})}),x.jsx(kC,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]}),x.jsx(cu,{open:h,onOpenChange:m,children:x.jsxs(uu,{className:"sm:max-w-xl",children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t}),x.jsx(fu,{children:n})]}),x.jsxs("form",{action:E,className:"grid gap-4",children:[x.jsxs("fieldset",{children:[x.jsx("legend",{className:"sr-only",children:e}),x.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:i.map(C=>x.jsx("li",{className:"border-b border-border py-3",children:x.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[x.jsx("input",{type:"radio",name:d,checked:g===C.key,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{y(C.key)}}),x.jsxs("span",{className:"min-w-0",children:[x.jsx(OI,{option:C}),x.jsx("span",{className:"block text-sm",children:C.summary}),x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.description}),C.note===null?null:x.jsx("span",{className:"block text-sm text-muted-foreground",children:C.note})]})]})},C.key))})]}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:()=>{m(!1)},children:s}),x.jsx(nt,{type:"submit",children:r})]})]})]})})]})},MI="manual",j0e=["writer","model","effort"],S1="border-t border-border pt-6 pb-5",w1="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",E1="max-w-[62ch] pb-3 text-sm text-muted-foreground",xH="border-b border-border py-3 last:border-b-0",L0e="size-4 shrink-0 accent-(--primary)",bH="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",vH=`${L0e} row-span-2 mt-1`,pE="col-start-2 max-w-[62ch] text-sm text-muted-foreground",P0e="min-h-20 w-full max-w-xl resize-y 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 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",z0e=({option:e,groupName:t,isChosen:n,model:r,effort:s,onChoose:i,onModelChange:l,onEffortChange:c})=>{const u=e.unavailableReason===null,d=e.modelOptions.find(m=>m.model===r),h=(d==null?void 0:d.hasEffortChoice)===!0;return x.jsxs("li",{className:xH,children:[x.jsxs("label",{className:Ne(bH,u?"":"cursor-default"),children:[x.jsx("input",{type:"radio",name:t,checked:n,disabled:!u,className:vH,onChange:i}),x.jsx("span",{className:"font-bold",children:e.label}),e.unavailableReason===null?x.jsx("span",{className:pE,children:e.description}):x.jsxs("span",{className:pE,children:[x.jsx("span",{className:"font-bold text-foreground",children:"Unavailable."}),` ${e.unavailableReason}`]})]}),n&&(e.hasModelChoice||h)?x.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-x-6 gap-y-3 pl-7",children:[e.hasModelChoice?x.jsx(x4,{label:e.modelLegend,options:e.modelOptions.map(m=>({value:m.model,label:m.label})),value:r,className:"w-60",onChange:m=>{const g=e.modelOptions.find(y=>y.model===m);g!==void 0&&l(g)}}):null,d!==void 0&&h?x.jsx(D0e,{label:e.effortLegend,options:d.effortOptions.map(m=>({value:m.effort,label:m.label})),value:s,onChange:c}):null]}):null]})},W2=({form:e,problem:t,errorMessage:n,isPending:r,dataNotice:s,className:i,onSubmit:l})=>{var L;const c=O.useId(),u=O.useId(),d=O.useId(),h=O.useId(),m=O.useId(),g=O.useId(),y=O.useId(),[b,w]=O.useState(e.configuration.selectedPreset),[E,C]=O.useState(e.order.selectedOrder),[T,N]=O.useState(e.order.customOrder),[R,M]=O.useState(e.writer.selectedKey),[D,k]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedModel]))),[I,_]=O.useState(()=>Object.fromEntries(e.writer.agents.map($=>[$.agent,$.selectedEffort]))),P=e.writer.agents.find($=>$.agent===R),H=e.order.options.find($=>$.order===E),z=((L=e.configuration.options.find($=>$.preset===b))==null?void 0:L.rewriteNotice)??null,U=(t==null?void 0:t.field)==="customOrder"?t.message:null,j=t!==null&&j0e.includes(t.field)?t.message:null,B=()=>{l({preset:b,order:E,customOrder:T,writer:P===void 0?{kind:"manual"}:{kind:"agent",agent:P.agent,model:D[P.agent]??P.selectedModel,effort:I[P.agent]??P.selectedEffort}})};return x.jsxs("form",{action:B,className:i,children:[x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":c,children:[x.jsx("h3",{id:c,className:w1,children:e.configuration.heading}),x.jsx("p",{id:u,className:E1,children:e.configuration.hint}),x.jsx(kI,{label:e.configuration.heading,dialogTitle:e.configuration.dialogTitle,dialogDescription:e.configuration.dialogDescription,chooseLabel:e.configuration.chooseLabel,cancelLabel:e.configuration.cancelLabel,options:e.configuration.options.map($=>({key:$.preset,label:$.label,tagLabel:$.tagLabel,summary:$.bestFor,description:$.description,note:$.note})),selectedKey:b,describedBy:u,onChoose:$=>{const q=e.configuration.options.find(G=>G.preset===$);q!==void 0&&w(q.preset)}}),z===null?null:x.jsx("p",{role:"status",className:"max-w-[62ch] pt-3 text-sm font-bold text-foreground",children:z})]}),x.jsxs("section",{className:`${S1} pb-8`,"aria-labelledby":d,children:[x.jsx("h3",{id:d,className:w1,children:e.order.heading}),x.jsx("p",{id:h,className:E1,children:e.order.hint}),x.jsx(kI,{label:e.order.heading,dialogTitle:e.order.dialogTitle,dialogDescription:e.order.dialogDescription,chooseLabel:e.order.chooseLabel,cancelLabel:e.order.cancelLabel,options:e.order.options.map($=>({key:$.order,label:$.label,tagLabel:$.tagLabel,summary:$.summary,description:$.description,note:null})),selectedKey:E,describedBy:h,onChoose:$=>{const q=e.order.options.find(G=>G.order===$);q!==void 0&&C(q.order)}}),(H==null?void 0:H.promptField)==null?null:x.jsxs("div",{className:"mt-4 grid max-w-xl gap-1.5",children:[x.jsx("label",{htmlFor:m,className:"text-sm font-bold",children:H.promptField.label}),x.jsx("textarea",{id:m,value:T,placeholder:H.promptField.placeholder,"aria-invalid":U!==null,"aria-describedby":U===null?void 0:g,className:P0e,onChange:$=>{N($.target.value)}}),U===null?null:x.jsx("p",{id:g,role:"alert",className:"text-sm text-destructive",children:U})]})]}),x.jsxs("fieldset",{className:S1,children:[x.jsx("legend",{className:`${w1} float-left w-full`,children:e.writer.heading}),x.jsx("p",{className:`${E1} clear-left`,children:e.writer.hint}),x.jsxs("ul",{className:"border-t border-border",children:[e.writer.agents.map($=>x.jsx(z0e,{option:$,groupName:y,isChosen:R===$.agent,model:D[$.agent]??$.selectedModel,onChoose:()=>{M($.agent)},effort:I[$.agent]??$.selectedEffort,onModelChange:q=>{k(G=>({...G,[$.agent]:q.model})),_(G=>({...G,[$.agent]:q.selectedEffort}))},onEffortChange:q=>{_(G=>({...G,[$.agent]:q}))}},$.agent)),x.jsx("li",{className:xH,children:x.jsxs("label",{className:bH,children:[x.jsx("input",{type:"radio",name:y,checked:R===MI,className:vH,onChange:()=>{M(MI)}}),x.jsx("span",{className:"font-bold",children:e.writer.manual.label}),x.jsx("span",{className:pE,children:e.writer.manual.description})]})})]}),j===null?null:x.jsx("p",{role:"alert",className:"pt-3 text-sm text-destructive",children:j})]}),x.jsxs("footer",{className:"border-t border-border pt-4",children:[n===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:n}),x.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[s===null?null:x.jsx("p",{className:"flex-1 text-sm text-muted-foreground",children:s}),x.jsx(nt,{type:"submit",disabled:r,children:r?e.pendingLabel:(P==null?void 0:P.submitLabel)??e.writer.manual.submitLabel})]})]})]})},B0e="target",H0e="text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",F0e="border-b border-border py-3 last:border-b-0",$0e="grid cursor-pointer grid-cols-[1rem_minmax(0,1fr)] gap-x-3",V0e="row-span-2 mt-1 size-4 shrink-0 accent-(--primary)",U0e="col-start-2 max-w-[62ch] text-sm text-muted-foreground",q0e=({creationForm:e,targetSearch:t,problem:n,errorMessage:r,isPending:s,onTargetQueryChange:i,onTargetSelect:l,onSubmit:c})=>{var b;const u=O.useId(),[d,h]=O.useState(e.initialization.selectedKind),m=((b=e.initialization.options.find(w=>w.kind===d))==null?void 0:b.authorWriting)??null,g=(n==null?void 0:n.field)===B0e?n.message:null,y=()=>{m!==null&&c({preset:e.form.configuration.selectedPreset,order:e.form.order.selectedOrder,customOrder:e.form.order.customOrder,writer:{kind:"author",start:m.start}})};return x.jsxs("div",{className:"grid max-w-208 gap-4",children:[x.jsx(uB,{label:e.target.label,hint:e.target.hint,placeholder:e.target.placeholder,value:t.value,suggestions:t.options,message:t.message,errorMessage:g,className:"max-w-xl",onValueChange:i,onSelect:l}),x.jsxs("fieldset",{className:"pt-2",children:[x.jsx("legend",{className:`${H0e} float-left w-full pb-2`,children:e.initialization.legend}),x.jsx("ul",{className:"clear-left border-t border-border",children:e.initialization.options.map(w=>x.jsx("li",{className:F0e,children:x.jsxs("label",{className:$0e,children:[x.jsx("input",{type:"radio",name:u,checked:d===w.kind,className:V0e,onChange:()=>{h(w.kind)}}),x.jsx("span",{className:"font-bold",children:w.label}),x.jsx("span",{className:U0e,children:w.description})]})},w.kind))})]}),m===null?x.jsx(W2,{form:e.form,problem:g===null?n:null,errorMessage:r,isPending:s,dataNotice:null,onSubmit:c}):x.jsxs("form",{action:y,className:"border-t border-border pt-4",children:[r===null?null:x.jsx("p",{role:"alert",className:"pb-3 text-sm text-destructive",children:r}),x.jsx("div",{className:"flex justify-end",children:x.jsx(nt,{type:"submit",disabled:s,children:s?e.pendingLabel:m.submitLabel})})]})]})},G0e="Searching…",AI="",K0e="",Y0e="author",W0e=(e,t)=>{var g,y,b,w,E;const n=ii(),r=jp(),s=Ri(),[i,l]=O.useState(null),c=O.useDeferredValue(i??AI),{data:u}=fj(n.review.creationForm.queryOptions({repositoryName:e,targetId:t})),d=Zc({...n.review.searchTargets.queryOptions({repositoryName:e,query:c}),placeholderData:SE}),h=i===null?u.target.selected:null,m=Nn(n.review.request.mutationOptions({onSuccess:async C=>{C.kind==="requested"&&(C.prompt!==null&&await navigator.clipboard.writeText(C.prompt).catch(()=>{}),await s.invalidateQueries(n.review.get.pathFilter()))}}));return{creationForm:u,targetSearch:{value:i??(h==null?void 0:h.label)??AI,options:((g=d.data)==null?void 0:g.options)??[],message:((y=d.data)==null?void 0:y.message)??(d.isPending?G0e:null)},problem:((b=m.data)==null?void 0:b.kind)==="rejected"?m.data:null,errorMessage:((w=m.data)==null?void 0:w.kind)==="unavailable"?m.data.message:((E=m.error)==null?void 0:E.message)??null,isPending:m.isPending,onTargetQueryChange:l,onTargetSelect:C=>{m.reset(),l(null),r({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e,branchId:C}})},onSubmit:C=>{C.writer.kind!==Y0e&&Q1(),m.mutate({repositoryName:e,targetId:(h==null?void 0:h.id)??K0e,...C})}}},X0e=({repositoryName:e,targetId:t})=>{const n=W0e(e,t);return x.jsx("div",{className:"pt-8",children:x.jsx(q0e,{creationForm:n.creationForm,targetSearch:n.targetSearch,problem:n.problem,errorMessage:n.errorMessage,isPending:n.isPending,onTargetQueryChange:n.onTargetQueryChange,onTargetSelect:n.onTargetSelect,onSubmit:n.onSubmit})})},Q0e=({isOpen:e,rebuildForm:t,loadingLabel:n,problem:r,errorMessage:s,isPending:i,onSubmit:l,onClose:c})=>x.jsx(cu,{open:e,onOpenChange:u=>{u||c()},children:x.jsx(uu,{className:"max-h-[calc(100dvh-4rem)] overflow-y-auto sm:max-w-3xl",children:t===null?x.jsxs(Oa,{children:[x.jsx(ka,{children:n}),s===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}):x.jsxs(x.Fragment,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:t.title}),x.jsx(fu,{className:"max-w-[62ch]",children:t.description})]}),x.jsx(W2,{form:t.form,problem:r,errorMessage:s,isPending:i,dataNotice:null,onSubmit:l})]})})}),Z0e={},J0e=()=>{},C1="flex flex-wrap items-center gap-x-3 gap-y-1 border-b py-2.5 text-sm",eye=({staleNotice:e,unassignedFiles:t,progress:n,onShowUnassignedFiles:r,onCopyPrompt:s})=>x.jsxs("div",{children:[e===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text [&_code]:bg-transparent [&_code]:px-0",children:x.jsx(Gf,{inlines:e.message,codeLinks:Z0e,onOpenCodeLink:J0e})}),x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{s(e.prompt,e.copiedMessage)},children:e.promptLabel})]}),t===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:"stale",tone:"signal"}),x.jsx("p",{className:"font-bold text-signal-text",children:t.message}),x.jsx(nt,{variant:"outline",size:"sm",onClick:r,children:t.actionLabel})]}),n===null?null:x.jsxs("div",{role:"status",className:C1,children:[x.jsx(D0,{status:n.isWriting?"awaiting-review":"stale",tone:n.isWriting?"status":"signal",className:n.isWriting?"motion-safe:animate-pulse":""}),x.jsx("p",{className:"font-bold text-signal-text",children:n.label}),x.jsx("progress",{"aria-label":n.countLabel,value:n.writtenCount,max:n.totalCount,className:"h-1.5 w-40 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"}),x.jsx("p",{className:"text-foreground tabular-nums",children:n.countLabel}),x.jsx("p",{className:"text-muted-foreground",children:n.message}),n.prompt===null?null:x.jsx(nt,{variant:"outline",size:"sm",onClick:()=>{n.prompt!==null&&s(n.prompt.text,n.prompt.copiedMessage)},children:n.prompt.label})]})]}),tye="Label",nye="Files",rye="No files yet.",sye="Add a file",iye="Search the changed files",oye="Close",lye="Delete",SH=({reviewKey:e,legend:t,label:n,paths:r,isSaving:s,isDeleting:i,errorMessage:l,onSave:c,onDelete:u,onClose:d})=>{const h=O.useId(),m=O.useId(),g=w2(e,"changed"),[y,b]=O.useState(n),[w,E]=O.useState(r),C=T=>{E(N=>N.includes(T)?N:[...N,T]),g.onQueryChange("")};return x.jsxs("form",{"aria-label":t,action:()=>{c({title:y,paths:w})},className:"relative mt-6 grid max-w-[44rem] gap-4 rounded-lg border border-foreground p-4",children:[x.jsx(un,{icon:"close",label:oye,className:"absolute top-2 right-2",onClick:d}),x.jsxs("div",{className:"grid gap-1.5 pr-8",children:[x.jsx("label",{htmlFor:h,className:"text-sm font-bold",children:tye}),x.jsx(Mx,{id:h,value:y,onChange:T=>{b(T.target.value)}})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("p",{id:m,className:"text-sm font-bold",children:nye}),w.length===0?x.jsx("p",{className:"text-sm text-muted-foreground",children:rye}):x.jsx("ul",{"aria-labelledby":m,className:"grid gap-0.5",children:w.map(T=>x.jsxs("li",{className:"flex items-center justify-between gap-2",children:[x.jsx("span",{className:"min-w-0 truncate font-mono text-[0.8rem]",title:T,children:T}),x.jsx(un,{icon:"close",label:`Remove ${T}`,onClick:()=>{E(N=>N.filter(R=>R!==T))}})]},T))})]}),x.jsx(C2,{label:sye,hint:null,placeholder:iye,query:g.query,files:g.files,message:g.message,errorMessage:g.errorMessage,onQueryChange:g.onQueryChange,onSelect:C}),l===null?null:x.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}),x.jsxs("div",{className:"flex justify-end gap-2",children:[u===null?null:x.jsx(nt,{type:"button",variant:"destructive",disabled:i,onClick:u,children:lye}),x.jsx(nt,{type:"submit",disabled:s,children:s?"Saving…":"Save"})]})]})},aye=({heading:e,detailLabel:t,children:n=null})=>x.jsxs("div",{className:"flex items-baseline gap-3 pt-6",children:[x.jsx("h2",{className:"text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",children:e}),n,t===null?null:x.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:t})]}),cye="text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",uye="text-sm text-muted-foreground tabular-nums",fye="Edit segment",dye=({reviewKey:e,heading:t,isTitleDraft:n,detailLabel:r,outline:s,authoring:i})=>i===null?t===null?null:x.jsx(aye,{heading:t,detailLabel:r,children:x.jsx(so,{isPending:n,className:"w-64 self-center text-[1.75rem]",children:null})}):i.writing.isWriting?x.jsx(SH,{reviewKey:e,legend:s.heading,label:s.label,paths:s.paths,isSaving:i.writing.isSaving,isDeleting:i.isPending,errorMessage:i.writing.errorMessage,onSave:i.writing.onSave,onDelete:i.onRemove,onClose:i.writing.onCancel}):x.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[x.jsx("h2",{className:cye,children:s.heading}),x.jsx("p",{className:uye,children:s.detailLabel}),x.jsx(nt,{variant:"link",size:"sm",onClick:i.writing.onEdit,children:fye})]}),hye=({selection:e,onComment:t,onAsk:n})=>e===null||e.commentRange===null&&n===null?null:x.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:e.left,top:e.top},onMouseDown:r=>{r.preventDefault()},children:[e.commentRange===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{e.commentRange!==null&&t(e.path,e.commentRange)},children:"Add comment"}),n===null?null:x.jsx(nt,{variant:"ghost",size:"sm",onClick:()=>{n(e)},children:"Ask the agent"})]}),pye=({heading:e,message:t,children:n})=>x.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] pt-10",children:[x.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[x.jsx("span",{className:"h-9 w-1 bg-(--line)"}),x.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),x.jsxs("div",{className:"pt-5",children:[x.jsx("h2",{className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:e}),x.jsx("p",{className:"max-w-[62ch] text-muted-foreground",children:t}),n]})]}),mye=({heading:e,message:t,...n})=>x.jsxs("div",{className:"max-w-208",children:[x.jsx(pye,{heading:e,message:t}),x.jsx(W2,{...n,className:"pt-6 pl-10"})]}),gye="Close",yye="Cancel",xye=({title:e,description:t,paths:n,confirmation:r,onClose:s})=>x.jsx(cu,{open:!0,onOpenChange:i=>{i||s()},children:x.jsxs(uu,{children:[x.jsxs(Oa,{children:[x.jsx(ka,{children:e}),x.jsx(fu,{children:(r==null?void 0:r.warning)??t})]}),x.jsx("ul",{"aria-label":e,className:"grid max-h-80 gap-1 overflow-y-auto",children:n.map(i=>x.jsx("li",{className:"font-mono text-[0.8rem] break-all",children:i},i))}),x.jsxs(md,{children:[x.jsx(nt,{type:"button",variant:"ghost",onClick:s,children:r===null?gye:yye}),r===null?null:x.jsx(nt,{type:"button",onClick:r.onConfirm,children:r.confirmLabel})]})]})}),bye=O.lazy(async()=>await $t(()=>import("./index-DCCyA67N.js"),__vite__mapDeps([25,24]))),vye="Loading the editor…",Sye="Remove the file from the walkthrough",_I="Edit the waypoint",wye="Remove the waypoint",Eye="my-1.5 mr-4 ml-18 rounded-md border border-foreground bg-background p-4 font-sans whitespace-normal",Cye=e=>e.rows.flatMap(t=>t.kind==="waypoint"?[t.waypoint]:[]),Nye=e=>e.lines===null?[]:[{id:e.id,title:e.title,attentionLabel:e.attentionLabel,...e.lines}],Tye=({reviewKey:e,segmentId:t,file:n,openWaypointIds:r,currentWaypointId:s,isPending:i,codeLinks:l,renderCodeLinkDialog:c,onOpenCodeLink:u,onToggleWaypoint:d,onRemove:h,onRemoveWaypoint:m})=>{var R;const[g,y]=O.useState(null),b=S2(e,n.path),w=Cye(n),E=new Set((R=b.lines)==null?void 0:R.map(M=>M.numberLabel)),C=M=>M.lines!==null&&E.has(String(M.lines.lineEnd)),T=()=>{y(null)},N=M=>M.id===g?x.jsx("div",{id:M.anchorId,className:Eye,children:x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:vye}),children:x.jsx(bye,{reviewKey:e,segmentId:t,waypointId:M.id,legend:`${_I}: ${M.title}`,text:M.text,renderCodeLinkDialog:c,onClose:T})})}):x.jsx(UC,{waypoint:M,isOpen:r.has(M.id),isCurrent:M.id===s,isReviewPending:!1,codeLinks:l,actions:x.jsxs(x.Fragment,{children:[x.jsx(un,{icon:"edit",label:`${_I}: ${M.title}`,onClick:()=>{y(M.id)}}),x.jsx(un,{icon:"delete",label:`${wye}: ${M.title}`,isDisabled:i,onClick:()=>{m(M.id)}})]}),onOpenCodeLink:u,onToggle:()=>{d(M.id)},onReviewedChange:null});return x.jsxs("article",{id:n.anchorId,"aria-label":n.title,className:"scroll-mt-(--waypoint-scroll-margin) pt-6",children:[n.summary.length===0?null:x.jsx("ul",{className:"flex list-disc flex-col gap-2 pb-4 pl-5",children:hd(n.summary).map(({key:M,item:D})=>x.jsx("li",{children:x.jsx(Hs,{blocks:D,codeLinks:l,onOpenCodeLink:u})},M))}),x.jsxs("div",{className:"flex items-center gap-3 pb-2",children:[x.jsx("h3",{className:"min-w-0 truncate text-[0.9375rem] leading-5 font-semibold",children:n.title}),x.jsx("p",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:n.waypointCountLabel}),x.jsx("span",{className:"flex-1"}),x.jsx(un,{icon:"remove",label:`${Sye}: ${n.path}`,isDisabled:i,onClick:h})]}),b.lines===null?null:x.jsx("div",{className:"bg-code empty:hidden",children:w.filter(M=>!C(M)).map(M=>x.jsx("div",{children:N(M)},M.id))}),x.jsx(E2,{path:n.path,lines:b.lines,statusMessage:b.statusMessage,waypoints:w.flatMap(Nye),waypointOptions:"always-on",highlightButtonLabel:null,focusOn:null,renderWaypoint:({id:M})=>w.filter(D=>D.id===M).map(N),onHighlightCode:null})]})},Rye=(e,t)=>{var w,E;const n=ii(),r=Ri(),[s,i]=O.useState(!1),[l,c]=O.useState(null),u=bG(n.conversation.watch.subscriptionOptions(e,{enabled:s})),d=Zc({...n.conversation.modelChoice.queryOptions(e),enabled:s}),h=C=>{t(C.message)},m=Nn(n.conversation.sendMessage.mutationOptions({onSuccess:C=>{C.kind==="sent"&&c(null)},onError:h})),g=Nn(n.conversation.answerQuestions.mutationOptions({onError:h})),y=Nn(n.conversation.chooseModel.mutationOptions({onSuccess:async C=>{C.kind==="rejected"&&t(C.message),await r.invalidateQueries(n.conversation.modelChoice.pathFilter())},onError:h})),b=((w=g.data)==null?void 0:w.kind)==="rejected"&&g.variables!==void 0?{batchId:g.variables.batchId,message:g.data.message}:null;return{isOpen:s,reference:l,conversation:u.data,modelChoice:d.data??null,isSending:m.isPending,sendProblem:((E=m.data)==null?void 0:E.kind)==="rejected"?m.data.message:null,answering:{pendingBatchId:g.isPending?g.variables.batchId:null,rejection:b},onToggle:()=>{i(C=>!C)},onClose:()=>{i(!1)},onAsk:C=>{c(C),i(!0)},onClearReference:()=>{c(null)},onSend:C=>{m.mutate({...e,body:C,reference:l})},onAnswer:(C,T)=>{g.mutate({...e,batchId:C,answers:T.map(N=>({...N,pickedLabels:[...N.pickedLabels]}))})},onChooseModel:C=>{y.mutate({...e,model:C})}}},Oye="[data-line]",kye="[data-path]",Mye=6,mE=10,DI=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(Oye))??null},II=e=>Number.parseInt(e.dataset.line??"",mE),jI=e=>{const{commentSide:t,commentLine:n}=e.dataset;return(t==="old"||t==="new")&&n!==void 0?{side:t,lineLabel:n}:null},Aye=(e,t)=>{if(t===null)return null;const n=Number.parseInt(t.lineLabel,mE),r=(e==null?void 0:e.side)===t.side?Number.parseInt(e.lineLabel,mE):n;return{side:t.side,startLineLabel:String(Math.min(r,n)),lineLabel:String(Math.max(r,n))}},LI=()=>{const e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0)return null;const t=DI(e.anchorNode),n=DI(e.focusNode),r=(t==null?void 0:t.closest(kye))??null,s=r==null?void 0:r.dataset.path;if(t===null||n===null||r===null||s===void 0||!r.contains(n))return null;const i=II(t),l=II(n);if(Number.isNaN(i)||Number.isNaN(l))return null;const c=e.getRangeAt(0).getBoundingClientRect();return{path:s,lineStart:i,lineEnd:l,commentRange:Aye(jI(t),jI(n)),left:c.left,top:c.top-Mye}},_ye=()=>{const[e,t]=O.useState(null);return O.useEffect(()=>{const n=()=>{t(LI())},r=()=>{t(null)},s=()=>{LI()===null&&t(null)};return document.addEventListener("selectionchange",s),document.addEventListener("mouseup",n),document.addEventListener("keyup",n),window.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("selectionchange",s),document.removeEventListener("mouseup",n),document.removeEventListener("keyup",n),window.removeEventListener("scroll",r)}},[]),e},Dye=(e,{title:t,body:n})=>{if(!fL()||Notification.permission!=="granted")return;const r=new Notification(t,{body:n,tag:e});r.addEventListener("click",()=>{window.focus(),r.close()})},Iye=(e,t,n,r)=>{const s=O.useRef(null);O.useEffect(()=>{if(t){s.current=e;return}n===null||s.current!==e||(s.current=null,r(n.title),Dye(e,n))},[e,t,n,r])},jye=e=>{var d,h;const t=ii(),n=Ri(),[r,s]=O.useState([]),i=m=>{s(g=>g.filter(y=>y!==m))},l=Nn(t.review.editContext.mutationOptions({onSuccess:async(m,{segmentId:g})=>{m.kind==="saved"&&(await n.invalidateQueries(t.review.get.pathFilter()),i(g))}})),u=(((d=l.data)==null?void 0:d.kind)==="rejected"?l.data.message:null)??((h=l.error)==null?void 0:h.message)??null;return m=>{var y;const g=((y=l.variables)==null?void 0:y.segmentId)===m;return{isWriting:r.includes(m),isSaving:g&&l.isPending,errorMessage:g?u:null,onEdit:()=>{g&&l.reset(),s(b=>[...b,m])},onSave:b=>{l.mutate({...e,segmentId:m,context:b})},onCancel:()=>{g&&l.reset(),i(m)}}}},Lye="The line you drew ends at this card.",Pye=["add-card","change-card","describe"],PI=e=>Pye.includes(e.kind),zye=(e,t)=>{var R,M,D;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(null),[u,d]=O.useState([]),h=k=>{d(I=>I.filter(_=>_!==k))},m=Nn(n.review.editJourney.mutationOptions({onSuccess:async(k,{segmentId:I,edit:_})=>{if(k.kind==="rejected"){PI(_)||t(k.message);return}await Promise.all([r.invalidateQueries(n.review.get.pathFilter()),r.invalidateQueries(n.review.cardForm.pathFilter()),r.invalidateQueries(n.review.cardBlocks.pathFilter())]),_.kind==="add-card"&&(i(null),c(k.nodeId===null?null:{segmentId:I,nodeId:k.nodeId})),_.kind==="change-card"&&c(null),_.kind==="describe"&&h(I)},onError:(k,{edit:I})=>{PI(I)||t(k.message)}})),g=(k,I)=>{m.mutate({...e,segmentId:k,edit:I})},y=((R=m.variables)==null?void 0:R.edit)??null,w=(((M=m.data)==null?void 0:M.kind)==="rejected"?m.data.message:null)??((D=m.error)==null?void 0:D.message)??null,E=(y==null?void 0:y.kind)==="add-card",C=k=>{E&&m.reset(),i(k)},T=(y==null?void 0:y.kind)==="change-card",N=k=>{var I;return(y==null?void 0:y.kind)==="describe"&&((I=m.variables)==null?void 0:I.segmentId)===k};return{authoringOf:k=>({board:{isPending:m.isPending,onAddCard:()=>{C({segmentId:k,lineEnd:null})},onClearDiagram:()=>{g(k,{kind:"clear-diagram"})},onRemoveDiagram:()=>{g(k,{kind:"remove-diagram"})},onAddCardAtLineEnd:I=>{C({segmentId:k,lineEnd:{...I,places:[...I.places]}})},onMoveCards:I=>{g(k,{kind:"move-cards",places:[...I]})},onDrawLine:I=>{g(k,{kind:"add-line",...I})},onRemoveLine:I=>{g(k,{kind:"remove-line",...I})},onEditCard:I=>{T&&m.reset(),c({segmentId:k,nodeId:I})},onRemoveCard:I=>{g(k,{kind:"remove-card",nodeId:I})}},description:{isWriting:u.includes(k),isSaving:N(k)&&m.isPending,errorMessage:N(k)?w:null,onEdit:()=>{N(k)&&m.reset(),d(I=>[...I,k])},onSave:I=>{g(k,{kind:"describe",description:I})},onCancel:()=>{N(k)&&m.reset(),h(k)}},onAddDiagram:()=>{g(k,{kind:"add-diagram"})}}),cardAddition:s===null?null:{segmentId:s.segmentId,note:s.lineEnd===null?null:Lye,isSaving:E&&m.isPending,errorMessage:E?w:null,onSubmit:k=>{g(s.segmentId,{kind:"add-card",...k,...s.lineEnd===null?{}:{lineEnd:s.lineEnd}})},onClose:()=>{i(null)}},cardChange:l===null?null:{...l,isSaving:T&&m.isPending,errorMessage:T?w:null,onSave:k=>{g(l.segmentId,{kind:"change-card",nodeId:l.nodeId,...k})},onClose:()=>{c(null)}}}},Bye=10,Hye="Review submitted",Iy=e=>Number.parseInt(e,Bye),zI=(e,t)=>({path:e,side:t.side,startLine:Iy(t.startLineLabel),endLine:Iy(t.lineLabel)}),Fye=(e,t,n,r)=>{if(n===null)return null;const s={path:t,anchorLineLabel:n.lineLabel,range:{side:n.side,startLineLabel:n.lineLabel,lineLabel:n.lineLabel}};if(!r||(e==null?void 0:e.path)!==t||e.range.side!==n.side)return s;const i=Iy(e.anchorLineLabel),l=Iy(n.lineLabel);return{...e,range:{side:n.side,startLineLabel:String(Math.min(i,l)),lineLabel:String(Math.max(i,l))}}},$ye=(e,t)=>{var _;const n=ii(),r=Ri(),[s,i]=O.useState(null),[l,c]=O.useState(0),[u,d]=O.useState(""),[h,m]=O.useState(!1),g=O.useDeferredValue(u),y=async()=>{await r.invalidateQueries(n.review.get.pathFilter())},b=async()=>{await Promise.all([y(),r.invalidateQueries(n.review.searchReviewers.pathFilter())])},w=P=>{t(P.message)},E={onSuccess:y,onError:w},C=Nn(n.review.addComment.mutationOptions({onSuccess:async()=>{i(null),await y()},onError:w})),T=Nn(n.review.discardComment.mutationOptions(E)),N=Nn(n.review.replyToThread.mutationOptions(E)),R=Nn(n.review.resolveThread.mutationOptions(E)),M=Nn(n.review.submit.mutationOptions({onSuccess:async()=>{c(P=>P+1),t(Hye),await Promise.all([y(),r.invalidateQueries(n.repository.list.pathFilter())])}})),D=Nn(n.review.requestReviewer.mutationOptions({onSuccess:b,onError:w})),k=Nn(n.review.removeReviewRequest.mutationOptions({onSuccess:b,onError:w})),I=Zc({...n.review.searchReviewers.queryOptions({...e,query:g}),enabled:h,placeholderData:SE});return{composingRangeOf:P=>(s==null?void 0:s.path)===P?s.range:null,isCommentPending:C.isPending||N.isPending||R.isPending||T.isPending,isSubmitting:M.isPending,isDiscarding:T.isPending,submissionCount:l,submissionError:((_=M.error)==null?void 0:_.message)??null,reviewerRequesting:{query:u,options:I.data??null,isPending:D.isPending||k.isPending,onOpen:()=>{m(!0)},onSearch:d,onRequest:P=>{D.mutate({...e,login:P})},onRemove:P=>{k.mutate({...e,login:P})}},onStartComment:(P,H,z)=>{i(U=>Fye(U,P,H,z))},onStartRangeComment:(P,H)=>{i({path:P,anchorLineLabel:H.startLineLabel,range:H})},onAddComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!1})},onPostComment:(P,H,z)=>{C.mutate({...e,position:zI(P,H),body:z,shouldPostNow:!0})},onComment:P=>{C.mutate({...e,position:null,body:P,shouldPostNow:!0})},onReply:(P,H)=>{N.mutate({...e,threadId:P,body:H})},onResolveThread:(P,H)=>{R.mutate({...e,threadId:P,isResolved:H})},onDiscardComment:P=>{T.mutate({...e,commentId:P})},onSubmit:(P,H)=>{M.mutate({...e,verdict:P,body:H})}}},Vye=e=>{const[t,n]=O.useState(!1);return O.useEffect(()=>{const r=()=>{n(window.scrollY>e)};return r(),window.addEventListener("scroll",r,{passive:!0}),()=>{window.removeEventListener("scroll",r)}},[e]),t},Uye=(e,t)=>{var l,c;const n=ii(),r=Ri(),s=Nn(n.review.generateSection.mutationOptions({onSuccess:async u=>{u.kind==="generated"&&(u.prompt!==null&&await navigator.clipboard.writeText(u.prompt).catch(()=>{}),await r.invalidateQueries(n.review.get.pathFilter()),t(u.message))}})),i=((l=s.data)==null?void 0:l.kind)==="unavailable"?s.data.message:((c=s.error)==null?void 0:c.message)??null;return{generatingSection:s.isPending?s.variables.section:null,errorMessageOf:u=>{var d;return((d=s.variables)==null?void 0:d.section)===u?i:null},onGenerate:u=>{s.mutate({...e,section:u})}}},BI=e=>e.kind==="add"||e.kind==="change",qye=(e,t)=>{var w,E,C;const n=ii(),r=Ri(),[s,i]=O.useState([]),[l,c]=O.useState(!1),u=T=>{i(N=>N.filter(R=>R!==T))},d=Nn(n.review.editSegments.mutationOptions({onSuccess:async(T,{edit:N})=>{if(T.kind==="rejected"){BI(N)||t(T.message);return}await r.invalidateQueries(n.review.get.pathFilter()),N.kind==="add"&&c(!1),(N.kind==="change"||N.kind==="remove")&&u(N.segmentId)},onError:(T,{edit:N})=>{BI(N)||t(T.message)}})),h=T=>{d.mutate({...e,edit:"paths"in T?{...T,paths:[...T.paths]}:T})},m=((w=d.variables)==null?void 0:w.edit)??null,y=(((E=d.data)==null?void 0:E.kind)==="rejected"?d.data.message:null)??((C=d.error)==null?void 0:C.message)??null,b=(m==null?void 0:m.kind)==="add";return{isPending:d.isPending,onMove:(T,N)=>{h({kind:"move",segmentId:T,direction:N})},addition:{isWriting:l,isSaving:b&&d.isPending,errorMessage:b?y:null,onEdit:()=>{b&&d.reset(),c(!0)},onSave:T=>{h({kind:"add",...T})},onCancel:()=>{b&&d.reset(),c(!1)}},authoringOf:T=>{const N=(m==null?void 0:m.kind)==="change"&&m.segmentId===T;return{writing:{isWriting:s.includes(T),isSaving:N&&d.isPending,errorMessage:N?y:null,onEdit:()=>{N&&d.reset(),i(R=>R.includes(T)?R:[...R,T])},onSave:R=>{h({kind:"change",segmentId:T,...R})},onCancel:()=>{N&&d.reset(),u(T)}},isPending:d.isPending,onRemove:()=>{h({kind:"remove",segmentId:T})}}}}},Gye=2500,Kye=()=>{const[e,t]=O.useState(null);O.useEffect(()=>{if(e===null)return;const r=window.setTimeout(()=>{t(null)},Gye);return()=>{window.clearTimeout(r)}},[e]);const n=O.useCallback(r=>{t({message:r})},[]);return[(e==null?void 0:e.message)??null,n]},Yye=(e,t)=>{const n=ii(),r=Ri(),s=Nn(n.review.editWalkthrough.mutationOptions({onSuccess:async i=>{i.kind==="rejected"?t(i.message):await r.invalidateQueries(n.review.get.pathFilter())},onError:i=>{t(i.message)}}));return{isPending:s.isPending,onMoveFile:(i,l,c)=>{s.mutate({...e,segmentId:i,edit:{kind:"move-file",path:l,direction:c}})},onRemoveFile:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-file",path:l}})},onRemoveWaypoint:(i,l)=>{s.mutate({...e,segmentId:i,edit:{kind:"remove-waypoint",waypointId:l}})}}},Wye="j",Xye="k",Qye="input, textarea, select, [contenteditable='true']",Zye=e=>e instanceof Element&&e.closest(Qye)!==null,Jye=(e,t)=>{const n=O.useEffectEvent(e),r=O.useEffectEvent(t);O.useEffect(()=>{const s=i=>{i.repeat||i.metaKey||i.ctrlKey||i.altKey||Zye(i.target)||(i.key===Wye&&r(),i.key===Xye&&n())};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[])},gE=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start"})},exe=(e,t)=>{const[n,r]=O.useState(()=>new Set),[s,i]=O.useState(null),l=e.flatMap(y=>y.walkthrough.files.flatMap(b=>b.rows.flatMap(w=>w.kind==="waypoint"?[w.waypoint]:[]))),c=l.find(y=>y.id===s)??null,u=c===null?(t==null?void 0:t.lastWaypointId)??null:c.previousId,d=c===null?(t==null?void 0:t.firstWaypointId)??null:c.nextId,h=y=>{const b=l.find(w=>w.id===y);b!==void 0&&(i(b.id),r(w=>new Set([...w,b.id])),gE(b.anchorId))},m=()=>{h(u)},g=()=>{h(d)};return Jye(m,g),{openWaypointIds:n,currentWaypointId:s,positionLabel:(c==null?void 0:c.positionLabel)??null,canStepBack:u!==null,canStepForward:d!==null,onPrevious:m,onNext:g,onToggleWaypoint:y=>{i(y),r(b=>new Set(b.has(y)?[...b].filter(w=>w!==y):[...b,y]))},onOpenCodeLink:y=>{const b=l.find(w=>w.anchorId===y);b===void 0?gE(y):h(b.id)}}},txe=O.lazy(async()=>await $t(()=>import("./index-B1Rm0SQ5.js"),__vite__mapDeps([26,24]))),nxe=O.lazy(async()=>await $t(()=>import("./index-V8tnJR9v.js"),__vite__mapDeps([27,24]))),rxe=O.lazy(async()=>await $t(()=>import("./index-PzkXPYSX.js"),__vite__mapDeps([23,24]))),sxe=O.lazy(async()=>await $t(()=>import("./index-BaflOxvR.js"),__vite__mapDeps([28,24]))),ixe=5e3,oxe=480,wH="The backend did not say what went wrong.",lxe="Could not copy to the clipboard",axe="Loading the options…",yE="Loading the editor…",cxe="Add a segment",uxe="New segment",fxe="This Flight Plan has no segments yet.",dxe="Publish anyway",hxe="Arrange segments",pxe="Move a segment up or down. The order is saved as you go.",mxe="Arrange files",gxe="Move a file up or down in the Code Walkthrough. The order is saved as you go.",yxe=[],xxe=[],bxe="text-4xl leading-10 font-bold tracking-[-0.02em]",vxe="[--line:var(--primary-text)]",Sxe="[--band-height:3.5rem] [--walkthrough-heading-height:2.75rem] [--section-scroll-margin:4.5rem] [--file-header-top:6.25rem] [--waypoint-scroll-margin:9.75rem] [--chat-width:26rem]",N1=e=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(sxe,{...e})}),EH=(e,t)=>({repositoryName:e.repoName,targetId:e.branchId,filterKeys:t.filter??null,isShowingReviewed:t.reviewed??!1}),jbe=({params:e,search:t,onSearchChange:n})=>{var Ae,Le,Ie,Ue,We,Oe,De,ne,he;const r=ii(),s=Ri(),i=jp(),l=O.use(Qj),c={repositoryName:e.repoName,targetId:e.branchId},{data:u}=fj({...r.review.get.queryOptions(EH(e,t)),refetchInterval:ixe,refetchIntervalInBackground:!0}),[d,h]=O.useState(null),[m,g]=O.useState(null),[y,b]=O.useState(!1),[w,E]=O.useState(!1),[C,T]=O.useState(null),[N,R]=Kye(),{isOwn:M}=u,D=u.kind==="artifact"?u.progress:null;Iye(`${e.repoName}/${e.branchId}`,D!==null,u.kind==="artifact"?u.completion:null,R);const k=_ye(),I=jye(c),_=qye(c,R),P=zye(c,R),H=Yye(c,R),z=Uye(c,R),U=$ye(c,R),j=Vye(oxe),B=Rye(c,R),L=Zc({...r.review.rebuildForm.queryOptions({...c,mode:d??"update"}),enabled:d!==null,gcTime:0}),$=async()=>{await s.invalidateQueries(r.review.get.pathFilter())},q=se=>{R(se.message)},G=(se,Te)=>{navigator.clipboard.writeText(se).then(()=>{R(Te)},()=>{R(lxe)})},W=Nn(r.review.setReviewed.mutationOptions({onSuccess:$,onError:q})),Z=Nn(r.review.publish.mutationOptions({onSuccess:async({message:se})=>{R(se),await $()},onError:q})),re=Nn(r.review.markComplete.mutationOptions({onSuccess:async({message:se,targetId:Te})=>{R(se),E(!1),await $(),Te!==e.branchId&&i({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e.repoName,branchId:Te}})},onError:q})),de=Nn(r.review.request.mutationOptions({onSuccess:async se=>{se.kind==="requested"&&(se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),F=Nn(r.review.rebuild.mutationOptions({onSuccess:async se=>{se.kind==="rebuilt"&&(h(null),se.prompt===null?R(se.message):G(se.prompt,se.message),await $())}})),X=Nn(r.review.delete.mutationOptions({onSuccess:async({message:se})=>{R(se),await Promise.all([$(),s.invalidateQueries(r.review.creationForm.pathFilter())])},onError:q})),te=se=>{F.reset(),h(se)},J=u.kind==="artifact"?u:null,K=(J==null?void 0:J.segments.find(se=>se.id===C))??null,ce=exe((J==null?void 0:J.segments)??xxe,(J==null?void 0:J.walkthroughControls.stepping)??null),{openWaypointIds:ye,currentWaypointId:ge}=ce,oe=ce.onOpenCodeLink,xe=ce.onToggleWaypoint,Se=[...(J==null?void 0:J.rail.groups.flatMap(se=>se.sections))??[],...(J==null?void 0:J.rail.sections)??[]],ke=Oce(Se.flatMap(se=>[se.anchorId,...se.children.map(Te=>Te.anchorId)])),_e=n,we=se=>{const Te=J==null?void 0:J.segments.find(Ve=>Ve.anchorId===se);Te!==void 0&&(_.authoringOf(Te.id).writing.onEdit(),gE(se))},Re=(se,Te)=>{s.query({...r.review.codeReference.queryOptions({...c,path:se.path,lineStart:se.lineStart,lineEnd:se.lineEnd}),staleTime:"static"}).then(Te,Ve=>{R(Ve instanceof Error?Ve.message:wH)})};return x.jsxs("div",{className:Ne("px-6 pb-16 transition-[margin] duration-200 ease-out",B.isOpen?"mr-(--chat-width)":"",vxe,Sxe),children:[x.jsx("title",{children:u.shell.documentTitle}),l===null?null:Bs.createPortal(x.jsxs(x.Fragment,{children:[x.jsx(RG,{lineColor:"primary"}),x.jsx(Aue,{header:u.shell.header,changedFiles:u.kind==="missing"?u.changedFiles:null,authorLabel:u.shell.authorLabel,reviewerRequesting:U.reviewerRequesting,actions:u.kind==="missing"?null:x.jsxs(x.Fragment,{children:[x.jsx(Yce,{label:u.chatLabel,isPressed:B.isOpen,onClick:B.onToggle}),!M||u.unassignedFiles===null?null:x.jsx(Xce,{label:u.unassignedFiles.label,onClick:()=>{g({kind:"list"})}}),u.completeAction===null?null:x.jsx(Wce,{label:u.completeAction.label,isPending:re.isPending,onClick:()=>{var se;((se=u.completeAction)==null?void 0:se.pullRequestChoice)==null?re.mutate({...c,pullRequestTargetId:null}):E(!0)}}),u.sharing===null?null:x.jsx(Jce,{sharing:u.sharing,publishingKey:Z.isPending?Z.variables.destination:null,onPublish:se=>{u.unassignedFiles===null?Z.mutate({...c,destination:se}):g({kind:"publish",destination:se})}}),u.reviewDraft===null?null:x.jsx(Zce,{draft:u.reviewDraft,isSubmitting:U.isSubmitting,isDiscarding:U.isDiscarding,errorMessage:U.submissionError,submissionCount:U.submissionCount,renderEditor:N1,onSubmit:U.onSubmit,onDiscard:U.onDiscardComment}),x.jsx(Qce,{forgeLink:u.shell.header.kind==="pull-request"?u.shell.header.forgeLink:null,rebuild:M?null:{onUpdate:()=>{te("update")},onRegenerate:()=>{te("regenerate")}},onDelete:()=>{X.mutate(c)}})]})})]}),l),x.jsx(Q0e,{isOpen:d!==null,rebuildForm:L.isFetching?null:L.data??null,loadingLabel:axe,problem:((Ae=F.data)==null?void 0:Ae.kind)==="rejected"?F.data:null,errorMessage:((Le=F.data)==null?void 0:Le.kind)==="unavailable"?F.data.message:((Ie=F.error)==null?void 0:Ie.message)??((Ue=L.error)==null?void 0:Ue.message)??null,isPending:F.isPending,onSubmit:se=>{d!==null&&(Q1(),F.mutate({...c,...se,mode:d}))},onClose:()=>{h(null)}}),u.kind==="missing"&&M?x.jsx(O.Suspense,{fallback:null,children:x.jsx(X0e,{repositoryName:e.repoName,targetId:e.branchId})}):null,u.kind==="missing"&&!M?x.jsx(mye,{heading:u.heading,message:u.message,form:u.form,problem:((We=de.data)==null?void 0:We.kind)==="rejected"?de.data:null,errorMessage:((Oe=de.data)==null?void 0:Oe.kind)==="unavailable"?de.data.message:((De=de.error)==null?void 0:De.message)??null,isPending:de.isPending,dataNotice:u.shell.notice,onSubmit:se=>{Q1(),de.mutate({...c,...se})}}):null,u.kind==="missing"?null:x.jsxs(p4,{value:((ne=u.progress)==null?void 0:ne.isWriting)===!0?u.progress.label:null,children:[x.jsx(eye,{staleNotice:u.staleNotice,unassignedFiles:M?null:u.unassignedFiles,progress:u.progress,onShowUnassignedFiles:()=>{g({kind:"list"})},onCopyPrompt:G}),x.jsxs("div",{className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8",children:[x.jsx("aside",{className:"sticky top-[calc(var(--band-height)+0.5rem)] max-h-[calc(100dvh-var(--band-height)-1rem)] self-start overflow-y-auto pt-5 pb-4",children:x.jsx(Iue,{label:"Review sections",groups:u.rail.groups,sections:u.rail.sections,currentAnchorId:ke,onEditGroup:M?we:null,onArrangeGroups:M&&u.segments.some(se=>se.outline.canMoveUp)?()=>{b(!0)}:null})}),x.jsxs("div",{className:"min-w-0",children:[u.segments.map(se=>x.jsxs("section",{id:se.anchorId,"aria-label":(M?se.outline.heading:se.heading)??void 0,className:"scroll-mt-(--section-scroll-margin) not-first:border-t-4 not-first:border-foreground",children:[x.jsx(dye,{reviewKey:c,heading:se.heading,isTitleDraft:se.isTitleDraft,detailLabel:se.detailLabel,outline:se.outline,authoring:M?_.authoringOf(se.id):null}),x.jsx(A0e,{...se.context,codeLinks:u.codeLinks,editing:M?I(se.id):null,renderCodeLinkDialog:Te=>x.jsx(vh,{reviewKey:c,...Te}),onOpenCodeLink:oe}),se.offers.journey===null?x.jsx(Nce,{...se.journey,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,isReviewPending:W.isPending,authoring:M?P.authoringOf(se.id):null,renderDescriptionEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-sm text-muted-foreground",children:yE}),children:x.jsx(rxe,{...Te,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})})}):null,onOpenCodeLink:oe,onWaypointReviewedChange:M?null:(Te,Ve)=>{W.mutate({...c,subject:{kind:"waypoint",id:Te},isReviewed:Ve})}}):x.jsx(US,{kind:"board",...se.offers.journey,isGenerating:z.generatingSection===se.offers.journey.section,errorMessage:z.errorMessageOf(se.offers.journey.section),onGenerate:()=>{z.onGenerate("journey")}}),se.offers.blast===null?null:x.jsx(US,{kind:"board",...se.offers.blast,isGenerating:z.generatingSection===se.offers.blast.section,errorMessage:z.errorMessageOf(se.offers.blast.section),onGenerate:()=>{z.onGenerate("blast")}}),se.blast===null?null:x.jsx(QZ,{...se.blast,codeLinks:u.codeLinks,renderImpactEditor:M?Te=>x.jsx(O.Suspense,{fallback:x.jsx("p",{className:"text-muted-foreground",children:yE}),children:x.jsx(nxe,{...Te,reviewKey:c,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve})},Te.path)}):null,onOpenCodeLink:oe,onOpenFile:oe}),x.jsxs(oee,{anchorId:se.walkthrough.anchorId,heading:se.walkthrough.heading,intro:se.walkthrough.intro,coverageLabel:se.walkthrough.coverageLabel,controls:u.walkthroughControls,positionLabel:ce.positionLabel??u.walkthroughControls.stepping.idleLabel,canStepBack:ce.canStepBack,canStepForward:ce.canStepForward,emptyMessage:se.walkthrough.emptyMessage,codeLinks:u.codeLinks,onArrangeFiles:M&&se.walkthrough.fileOrder.length>1?()=>{T(se.id)}:null,onOpenCodeLink:oe,onPrevious:ce.onPrevious,onNext:ce.onNext,onFilterChange:Te=>{_e({filter:Te===null?void 0:[...Te]})},onShowReviewedChange:M?null:Te=>{_e({reviewed:Te?!0:void 0})},children:[se.offers.findings===null?null:x.jsx(US,{kind:"notice",...se.offers.findings,isGenerating:z.generatingSection===se.offers.findings.section,errorMessage:z.errorMessageOf(se.offers.findings.section),onGenerate:()=>{z.onGenerate("findings")}}),M?se.walkthrough.files.map(Te=>x.jsx(Tye,{reviewKey:c,segmentId:se.id,file:Te,openWaypointIds:ye,currentWaypointId:ge,isPending:H.isPending,codeLinks:u.codeLinks,renderCodeLinkDialog:Ve=>x.jsx(vh,{reviewKey:c,...Ve}),onOpenCodeLink:oe,onToggleWaypoint:xe,onRemove:()=>{H.onRemoveFile(se.id,Te.path)},onRemoveWaypoint:Ve=>{H.onRemoveWaypoint(se.id,Ve)}},Te.anchorId)):se.walkthrough.files.map(Te=>x.jsx(yee,{file:Te,openWaypointIds:ye,currentWaypointId:ge,isReviewPending:W.isPending,composer:u.composer,composingRange:U.composingRangeOf(Te.path),isCommentPending:U.isCommentPending,renderCommentEditor:N1,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,onOpenCodeLink:oe,onToggleWaypoint:xe,onWaypointReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"waypoint",id:Ve},isReviewed:jt})},onFileReviewedChange:(Ve,jt)=>{W.mutate({...c,subject:{kind:"file",path:Ve},isReviewed:jt})},onStartComment:U.onStartComment,onAddComment:U.onAddComment,onPostComment:U.onPostComment,onReply:U.onReply,onResolveThread:U.onResolveThread,onDiscardComment:U.onDiscardComment},Te.anchorId))]})]},se.id)),M&&u.segments.length===0&&!_.addition.isWriting?x.jsx("p",{className:"pt-6 text-muted-foreground",children:fxe}):null,M&&_.addition.isWriting?x.jsx(SH,{reviewKey:c,legend:uxe,label:"",paths:yxe,isSaving:_.addition.isSaving,isDeleting:!1,errorMessage:_.addition.errorMessage,onSave:_.addition.onSave,onDelete:null,onClose:_.addition.onCancel}):null,M&&!_.addition.isWriting?x.jsx(nt,{variant:"outline",className:"mt-6",onClick:_.addition.onEdit,children:cxe}):null,u.conversation===null||u.composer===null?null:x.jsx(_0e,{anchorId:u.conversation.anchorId,heading:u.conversation.heading,emptyMessage:u.conversation.emptyMessage,entries:u.conversation.entries,placeholder:u.composer.placeholder,submitLabel:u.composer.commentLabel,isSubmitting:U.isCommentPending,renderEditor:N1,onComment:U.onComment})]})]}),y&&M?x.jsx(iD,{title:hxe,description:pxe,entries:u.segments.map(se=>({id:se.id,...se.outline})),isPending:_.isPending,onMove:_.onMove,onClose:()=>{b(!1)}}):null,!M||K===null?null:x.jsx(iD,{title:mxe,description:gxe,entries:K.walkthrough.fileOrder.map(se=>({id:se.path,...se})),isPending:H.isPending,onMove:(se,Te)=>{H.onMoveFile(K.id,se,Te)},onClose:()=>{T(null)}}),!M||P.cardAddition===null?null:x.jsx(gfe,{reviewKey:c,addition:P.cardAddition}),!M||P.cardChange===null?null:x.jsx(O.Suspense,{fallback:null,children:x.jsx(txe,{reviewKey:c,change:P.cardChange,renderCodeLinkDialog:se=>x.jsx(vh,{reviewKey:c,...se})})}),w&&((he=u.completeAction)==null?void 0:he.pullRequestChoice)!=null?x.jsx(R0e,{choice:u.completeAction.pullRequestChoice,isPending:re.isPending,onComplete:se=>{re.mutate({...c,pullRequestTargetId:se})},onClose:()=>{E(!1)}}):null,m===null||u.unassignedFiles===null?null:x.jsx(xye,{title:u.unassignedFiles.title,description:u.unassignedFiles.description,paths:u.unassignedFiles.paths,confirmation:m.kind==="list"?null:{warning:u.unassignedFiles.publishWarning,confirmLabel:dxe,onConfirm:()=>{Z.mutate({...c,destination:m.destination}),g(null)}},onClose:()=>{g(null)}}),x.jsx(hye,{selection:k,onComment:(se,Te)=>{var Ve;U.onStartRangeComment(se,Te),(Ve=window.getSelection())==null||Ve.removeAllRanges()},onAsk:se=>{Re(se,({reference:Te})=>{B.onAsk(Te)})}}),B.isOpen&&B.conversation!==void 0?x.jsx(hJ,{conversation:B.conversation,modelChoice:B.modelChoice,codeLinks:u.codeLinks,reference:B.reference,isSending:B.isSending,sendProblem:B.sendProblem,answering:B.answering,onSend:B.onSend,onAnswer:B.onAnswer,onChooseModel:B.onChooseModel,onClearReference:B.onClearReference,onOpenCodeLink:oe,onClose:B.onClose}):null,j&&!B.isOpen?x.jsx(un,{icon:"top",label:"Back to top",variant:"outline",className:"fixed right-4 bottom-4 z-30",onClick:()=>{window.scrollTo({top:0})}}):null]}),x.jsx(jue,{message:N})]})},Lbe=({error:e})=>{const t=gs();return x.jsxs("section",{role:"alert",className:"max-w-prose px-6 pt-8",children:[x.jsx("h1",{className:bxe,children:"Could not open this review"}),x.jsx("p",{className:"mt-2 text-muted-foreground",children:e instanceof Error?e.message:wH}),x.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[x.jsx(nt,{onClick:()=>{t.invalidate()},children:"Try again"}),x.jsx(Ff,{to:"/",className:"underline",children:"Go to your repositories"})]})]})},wxe=e=>typeof e=="boolean"?e:void 0,Exe=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,Cxe=e=>({filter:Exe(e.filter),reviewed:wxe(e.reviewed)}),Nxe=()=>$t(()=>import("./_branchId-CPb8-qBw.js"),[]),Txe=()=>$t(()=>import("./_branchId-LiwHskkW.js"),[]),Rxe=ys()({staticData:{isFullWidth:!0},validateSearch:Cxe,loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{const s=await e.query({...t.review.get.queryOptions(EH(n,r)),staleTime:"static"});s.kind!=="missing"||!s.isOwn||await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:n.branchId}),staleTime:"static"})},component:fn(Txe,"component"),pendingComponent:q7,errorComponent:fn(Nxe,"errorComponent")}),Oxe=()=>$t(()=>import("./create-DBv4ZLt7.js"),[]),kxe=()=>$t(()=>import("./create-BWsYjEs5.js"),[]),Mxe=ys()({loader:async({context:{queryClient:e,trpc:t},params:n})=>{await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName,targetId:null}),staleTime:"static"})},component:fn(kxe,"component"),errorComponent:fn(Oxe,"errorComponent")}),Axe=()=>$t(()=>import("./index-CeY9TXPf.js"),__vite__mapDeps([29,7])),_xe=()=>$t(()=>import("./index-BKKD-dvv.js"),__vite__mapDeps([30,11])),Dxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.list.queryOptions(),staleTime:"static"})},component:fn(_xe,"component"),pendingComponent:ru,errorComponent:fn(Axe,"errorComponent")}),Ixe=()=>$t(()=>import("./_id-DlHylI1F.js"),__vite__mapDeps([31,7])),jxe=()=>$t(()=>import("./_id-BDFgPH36.js"),__vite__mapDeps([32,24])),Lxe=ys()({validateSearch:e=>typeof e.field=="string"?{field:e.field}:{},loaderDeps:({search:e})=>({field:e.field??null}),loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{await e.query({...t.configuration.get.queryOptions({id:n.id,field:r.field}),staleTime:"static"})},component:fn(jxe,"component"),pendingComponent:ru,errorComponent:fn(Ixe,"errorComponent")}),Pxe=()=>$t(()=>import("./create-DXgFUVIW.js"),__vite__mapDeps([33,7])),zxe=()=>$t(()=>import("./create-DBNC2wSp.js"),__vite__mapDeps([34,11])),Bxe=ys()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.creationForm.queryOptions(),staleTime:"static"})},component:fn(zxe,"component"),pendingComponent:ru,errorComponent:fn(Pxe,"errorComponent")}),Hxe=m7.update({id:"/",path:"/",getParentRoute:()=>nu}),al=y7.update({id:"/settings",path:"/settings",getParentRoute:()=>nu}),Fxe=x7.update({id:"/",path:"/",getParentRoute:()=>al}),$xe=E7.update({id:"/agents",path:"/agents",getParentRoute:()=>al}),Vxe=R7.update({id:"/configuration",path:"/configuration",getParentRoute:()=>al}),Uxe=A7.update({id:"/forges",path:"/forges",getParentRoute:()=>al}),qxe=j7.update({id:"/repositories",path:"/repositories",getParentRoute:()=>al}),Gxe=F7.update({id:"/setup/",path:"/setup/",getParentRoute:()=>nu}),Kxe=U7.update({id:"/artifact/claude/download",path:"/artifact/claude/download",getParentRoute:()=>nu}),Yxe=Rxe.update({id:"/pr-reviews/$repoName/$branchId",path:"/pr-reviews/$repoName/$branchId",getParentRoute:()=>nu}),Wxe=Mxe.update({id:"/pr-reviews/$repoName/create",path:"/pr-reviews/$repoName/create",getParentRoute:()=>nu}),Xxe=Dxe.update({id:"/profiles/",path:"/profiles/",getParentRoute:()=>al}),Qxe=Lxe.update({id:"/profiles/$id",path:"/profiles/$id",getParentRoute:()=>al}),Zxe=Bxe.update({id:"/profiles/create",path:"/profiles/create",getParentRoute:()=>al}),Jxe={SettingsAgentsRoute:$xe,SettingsConfigurationRoute:Vxe,SettingsForgesRoute:Uxe,SettingsRepositoriesRoute:qxe,SettingsIndexRoute:Fxe,SettingsProfilesIdRoute:Qxe,SettingsProfilesCreateRoute:Zxe,SettingsProfilesIndexRoute:Xxe},ebe=al._addFileChildren(Jxe),tbe={IndexRoute:Hxe,SettingsRouteRoute:ebe,SetupIndexRoute:Gxe,ArtifactClaudeDownloadRoute:Kxe,PrReviewsRepoNameBranchIdRoute:Yxe,PrReviewsRepoNameCreateRoute:Wxe},nbe=nu._addFileChildren(tbe)._addFileTypes(),rbe=(e,t)=>BU({routeTree:nbe,context:e,defaultPreload:"intent",defaultPreloadStaleTime:0,...t===void 0?{}:{history:t}}),sbe=({queryClient:e,trpcClient:t,history:n})=>{const r=rbe({queryClient:e,trpc:CG(t,e)},n);return x.jsx(l$,{client:e,children:x.jsx(SG,{trpcClient:t,queryClient:e,children:x.jsx($U,{router:r})})})},CH=document.getElementById("root");if(!CH)throw new Error("Missing #root element in index.html");const ibe=sbe({queryClient:new _$,trpcClient:EG(wG())});W$.createRoot(CH).render(x.jsx(O.StrictMode,{children:ibe}));export{W0e as $,gx as A,nt as B,RG as C,cu as D,b7 as E,eee as F,C7 as G,O7 as H,un as I,_7 as J,hd as K,g4 as L,F7 as M,Mx as N,Wj as O,x4 as P,D0e as Q,m7 as R,uB as S,YM as T,U7 as U,$7 as V,abe as W,Lbe as X,Rxe as Y,jbe as Z,Mxe as _,uu as a,bn as a$,q0e as a0,jp as a1,Lxe as a2,S2 as a3,bp as a4,E2 as a5,ft as a6,co as a7,pge as a8,qh as a9,Abe as aA,Nt as aB,Mbe as aC,wbe as aD,Sbe as aE,rt as aF,Ome as aG,pbe as aH,Mn as aI,iH as aJ,mbe as aK,oH as aL,zme as aM,$ge as aN,Fx as aO,Tbe as aP,Op as aQ,xbe as aR,Me as aS,vbe as aT,bbe as aU,ybe as aV,lr as aW,Dy as aX,Nbe as aY,sde as aZ,Tpe as a_,U2 as aa,Gt as ab,Ke as ac,Ebe as ad,Rbe as ae,gbe as af,jme as ag,Cbe as ah,kge as ai,vC as aj,od as ak,Obe as al,zE as am,Mi as an,$s as ao,ube as ap,_y as aq,uI as ar,l0e as as,_be as at,_me as au,He as av,ct as aw,Fge as ax,Dbe as ay,kbe as az,Oa as b,Ei as b0,hbe as b1,Lpe as b2,jpe as b3,K2 as b4,Ibe as b5,h0 as b6,ka as c,fu as d,md as e,fbe as f,ii as g,Ri as h,Zc as i,x as j,Nn as k,SE as l,tee as m,nee as n,X9 as o,D0 as p,Ff as q,O as r,dbe as s,Ne as t,gs as u,NG as v,fj as w,Qj as x,tu as y,Bs as z};