@deslop/workbench 0.0.276 → 0.0.279

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 (33) hide show
  1. package/dist/client/assets/browser-D0lHtlHJ.js +1 -0
  2. package/dist/client/assets/button-D5PTso91.js +1 -0
  3. package/dist/client/assets/check-C1Q0x6Ev.js +1 -0
  4. package/dist/client/assets/composite-CV4TlLb7.js +1 -0
  5. package/dist/client/assets/dialog-CTqPdO7i.js +153 -0
  6. package/dist/client/assets/diff-BT1KPXaz.js +2 -0
  7. package/dist/client/assets/{diff-EoDIt5jN.js → diff-pSi7J_Xb.js} +16 -16
  8. package/dist/client/assets/fallbacks-BYq-1Jf8.js +2 -0
  9. package/dist/client/assets/index-C7MJruWE.js +10 -0
  10. package/dist/client/assets/index-DSI5FM62.css +2 -0
  11. package/dist/client/assets/info-C9lZ-VFp.js +1 -0
  12. package/dist/client/assets/route-Cw2wqWmD.js +45 -0
  13. package/dist/client/assets/route-XNMYtWT-.js +2 -0
  14. package/dist/client/assets/state-CfuBgP9R.js +2 -0
  15. package/dist/client/assets/{terminal-sqa9_A_E.js → terminal-7Yq8POXn.js} +2 -2
  16. package/dist/client/assets/terminal-Br2Fi1vV.js +2 -0
  17. package/dist/client/assets/utils-BcciP3Sx.js +16 -0
  18. package/dist/client/index.html +9 -9
  19. package/dist/workbench +0 -0
  20. package/package.json +2 -1
  21. package/dist/client/assets/browser-CDM4mh5t.js +0 -1
  22. package/dist/client/assets/browser-DUaXGcgT.js +0 -2
  23. package/dist/client/assets/button-BYRipVmK.js +0 -1
  24. package/dist/client/assets/createLucideIcon-Bk3TPktA.js +0 -1
  25. package/dist/client/assets/diff-BCr_QDYx.js +0 -2
  26. package/dist/client/assets/index-DxvAx_py.css +0 -2
  27. package/dist/client/assets/index-UUAWOdl4.js +0 -10
  28. package/dist/client/assets/resizable-MFmepAoA.js +0 -153
  29. package/dist/client/assets/route-DMxzlDqY.js +0 -2
  30. package/dist/client/assets/route-MqVf7nES.js +0 -45
  31. package/dist/client/assets/state-DfyXvTLb.js +0 -2
  32. package/dist/client/assets/terminal-C8OCiIgm.js +0 -2
  33. package/dist/client/assets/utils-CC77kD3H.js +0 -16
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-MqVf7nES.js","assets/compiler-runtime-CUwoe8mk.js","assets/utils-CC77kD3H.js","assets/state-DfyXvTLb.js","assets/button-BYRipVmK.js","assets/resizable-MFmepAoA.js","assets/createLucideIcon-Bk3TPktA.js"])))=>i.map(i=>d[i]);
2
- import{n as e,o as t,r as n}from"./compiler-runtime-CUwoe8mk.js";import{Ao as r,Bo as i,Co as a,Fo as o,Go as s,Ho as c,Io as l,Jo as u,K as d,Ko as f,Lo as p,Mo as m,No as h,Oo as g,Po as _,Qo as v,Ro as y,T as b,To as x,Uo as S,Vo as C,Wo as w,Xo as T,Yo as E,Zo as D,as as O,bo as ee,ds as te,es as k,i as ne,is as re,jo as A,ls as j,ns as ie,os as M,qo as ae,rs as N,ss as oe,ts as se,yo as ce,zo as le}from"./utils-CC77kD3H.js";function ue(e){let t=e;return{get(){return t},set(e){t=k(e,t)}}}function de(e){return{get(){return e()}}}function fe(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,c=new Map,l=new Map,u=n(e.status),d=n(e.loadedAt),f=n(e.isLoading),p=n(e.isTransitioning),m=n(e.location),h=n(e.resolvedLocation),g=n(e.statusCode),_=n(e.redirect),v=n([]),y=n([]),b=n([]),x=r(()=>P(o,v.get())),S=r(()=>P(c,y.get())),C=r(()=>P(l,b.get())),w=r(()=>v.get()[0]),T=r(()=>v.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:m.get().href,resolvedLocationHref:h.get()?.href,status:u.get()})),D=r(()=>({status:u.get(),loadedAt:d.get(),isLoading:f.get(),isTransitioning:p.get(),matches:x.get(),location:m.get(),resolvedLocation:h.get(),statusCode:g.get(),redirect:_.get()})),O=s(64);function ee(e){let t=O.get(e);return t||(t=r(()=>{let t=v.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),O.set(e,t)),t}let te={status:u,loadedAt:d,isLoading:f,isTransitioning:p,location:m,resolvedLocation:h,statusCode:g,redirect:_,matchesId:v,pendingIds:y,cachedIds:b,matches:x,pendingMatches:S,cachedMatches:C,firstId:w,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:c,cachedMatchStores:l,__store:D,getRouteMatchStore:ee,setMatches:k,setPending:ne,setCached:re};k(e.matches),a?.(te);function k(e){F(e,o,v,n,i)}function ne(e){F(e,c,y,n,i)}function re(e){F(e,l,b,n,i)}return te}function P(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function F(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}u(n.get(),a)||n.set(a)})}function pe(){try{return sessionStorage}catch{return}}var me=`tsr-scroll-restoration-v1_3`,he=pe();function ge(){try{return JSON.parse(he?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function _e(){try{he?.setItem(me,JSON.stringify(I))}catch{}}var I=ge(),ve=`data-scroll-restoration-id`,ye=e=>e.state.__TSR_key||e.href;function be(e){let t=e.getAttribute(ve);if(t)return`[${ve}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var L=!1,R=`window`;function xe(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Se(e){let t=[];for(let n of e){if(n===R)continue;let e=xe(n);e&&t.push(e)}return t}function Ce(e,t){if((t??e.options.scrollRestoration)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup)return;e.isScrollRestorationSetup=!0,L=!1;let n=e.options.getScrollRestorationKey||ye,r=new Map,i=(e,t,n)=>{let i=r.get(e)||{};i.scrollX=t,i.scrollY=n,r.set(e,i)};history.scrollRestoration=`manual`;let a=t=>{if(!(L||!e.isScrollRestoring))if(t.target===document)i(R,scrollX,scrollY);else{let e=t.target;i(e,e.scrollLeft,e.scrollTop)}},o=t=>{if(!e.isScrollRestoring)return;let n=I[t]||={};for(let[e,t]of r)e===R?n[R]=t:e.isConnected&&(n[be(e)]=t)};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(n(e.fromLocation)),r.clear()}),addEventListener(`pagehide`,()=>{o(n(e.stores.resolvedLocation.get()??e.stores.location.get())),_e()}),e.subscribe(`onRendered`,t=>{let i=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=e.resetNextScroll,s;if(r.clear(),o||(e.resetNextScroll=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let c=n(t.toLocation),l=t.fromLocation&&n(t.fromLocation);if(e.isScrollRestoring&&l&&l!==c){let e=I[l];if(e){let t=I[c];for(let n in e){if(n===R){if(o)continue}else{let e=xe(n);if(!e||o&&a&&(s??=Se(a),s.includes(e)))continue}t||=I[c]={},t[n]??=e[n]}}}L=!0;try{let n=t.toLocation.hash,r=t.toLocation.state.__hashScrollIntoViewOptions??!0,l=!1;if(o){let o=it.get(t.toLocation),u=n&&r&&(o===`PUSH`||o===`REPLACE`),d=e.isScrollRestoring?I[c]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:n}=d[e];if(e===R){if(u)continue;scrollTo({top:n,left:t,behavior:i}),l=!0}else{let r=xe(e);r&&(r.scrollLeft=t,r.scrollTop=n)}}if(!l&&!n){let e={top:0,left:0,behavior:i};if(scrollTo(e),a){s??=Se(a);for(let t of s)t.scrollTo(e)}}}!l&&n&&r&&document.getElementById(n)?.scrollIntoView(r)}finally{L=!1}})}function we(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Te(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ee(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Te(r):Array.isArray(t)?t.push(Te(r)):n[e]=[t,Te(r)]}return n}var De=ke(JSON.parse),Oe=Ae(JSON.stringify,JSON.parse);function ke(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ee(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ae(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=we(e,r);return t?`?${t}`:``}}var je=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Me=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),z=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),B=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ne=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},V=(e,t,n)=>{if(!(!g(n)&&!A(n)))throw g(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:g(n)?`redirected`:A(n)?`notFound`:r.status===`pending`?`success`:r.status,context:B(e,t.index),isFetching:!1,error:n})),A(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),g(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Pe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Fe=(e,t,n)=>{let r=B(e,n);e.updateMatch(t,e=>({...e,context:r}))},H=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,V(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,V(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!g(n)&&!A(n)&&(e.serialError??=n)},Ie=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!z(e,t)&&(n.options.loader||n.options.beforeLoad||Ke(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{je(e)},i);r._nonReactive.pendingTimeout=t}},Le=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ie(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&V(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Re=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=E(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&H(e,n,o),s&&H(e,n,s),Ie(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=E();let f={...B(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,_=z(e,t),v={search:p,abortController:c,params:m,preload:_,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(g(r)||A(r))&&(u(),H(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},b;try{if(b=r.options.beforeLoad(v),N(b))return u(),b.catch(t=>{H(e,n,t)}).then(y)}catch(t){u(),H(e,n,t)}y(b)},ze=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Re(e,n,t,i),s=()=>{if(Pe(e,n))return;let t=Le(e,n,i);return N(t)?t.then(o):o()};return a()},Be=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Ve=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=B(e,r),d=z(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},He=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{U(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Ve(e,t,n,r,i)),l=!!s&&N(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;V(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:B(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:B(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,A(t)&&await i.options.notFoundComponent?.preload?.(),V(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,V(e,e.router.getMatch(n),t)}!g(o)&&!A(o)&&await U(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:B(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),V(e,r,t)}},Ue=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Ve(e,t,i,n,d)):m,{status:_,invalid:v}=l,y=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=_===`success`&&(v||(h??y)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await He(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){g(t)&&await e.router.navigate(t.options)}})()):_!==`success`||o?await He(e,t,i,n,d):Fe(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Pe(e,i)){if(!e.router.getMatch(i))return e.matches[n];Fe(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=z(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&V(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=E(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function We(e){let t=e,n=[];Me(t.router)&&je(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ze(t,e);N(n)&&await n}catch(e){if(g(e))throw e;if(A(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ne(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ue(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(g(e))throw e;A(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Ne(t,l);e===void 0&&f();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await U(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await U(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Be(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=je(t);if(N(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ge(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function U(e,t=W){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===W?(()=>{if(e._componentsPromise===void 0){let t=Ge(e,W);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ge(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ke(e){for(let t of W)if(e.options[t]?.preload)return!0;return!1}var W=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function qe(e){return{input:({url:t})=>{for(let n of e)t=Ye(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Xe(e[n],t);return t}}}function Je(e){let t=p(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=o([`/`,t,e.pathname]),e)}}function Ye(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Xe(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var G=`__TSR_index`,Ze=`popstate`,Qe=`beforeunload`;function $e(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=K(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[G];i=et(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[G];i=et(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[G]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function et(e,t){t||={};let n=rt();return{...t,key:n,__TSR_key:n,[G]:e}}function tt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>K(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=rt();t.history.replaceState({[G]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=K(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[G]-l.state[G],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=$e({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Qe,S,{capture:!0}),t.removeEventListener(Ze,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Qe,S,{capture:!0}),t.addEventListener(Ze,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function nt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function K(e,t){let n=nt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=rt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[G]:0,key:a,__TSR_key:a}}}function rt(){return(Math.random()+1).toString(36).substring(7)}function q(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var it=new WeakMap,at=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=h(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=s(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=fe(st(this.latestLocation),e),Ce(this)}let a=!1,o=this.options.basepath??`/`,c=this.options.rewrite;if(r||n!==o||i!==c){this.basepath=o;let e=[],t=p(o);t&&t!==`/`&&e.push(Je({basepath:o})),c&&e.push(c),this.rewrite=e.length===0?void 0:e.length===1?e[0]:qe(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=w(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&S(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:T(e).path,external:!1,searchStr:o,search:O(t?.search,i),hash:T(r.slice(1)).path,state:M(t?.state,a)}}let o=new URL(i,this.origin),s=Ye(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:T(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:O(t?.search,c),hash:T(s.hash.slice(1)).path,state:M(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>l({base:e,to:t.includes(`//`)?m(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>ct({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,k(t.params,s)),d=this.routesByPath[y(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&se(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:T(_({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Y(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=lt({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=O(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?k(t.hash,n.hash):void 0,b=g?`#${g}`:``,x=t.state===!0?n.state:t.state?k(t.state,n.state):{};x=M(n.state,x);let S=`${p}${h}${b}`,C,w,E=!1;if(this.rewrite){let e=new URL(S,this.origin),t=Xe(this.rewrite,e);C=e.href.replace(e.origin,``),t.origin===this.origin?w=t.pathname+t.search+t.hash:(w=t.href,E=!0)}else C=v(S),w=C;return{publicHref:w,href:C,pathname:p,search:m,searchStr:h,state:x,hash:g??``,external:E,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=i(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:a,...c}=s.route,l=a===!1||a===null?Object.create(null):(a??!0)===!0?n:Object.assign(n,k(a,n));r={from:e.from,...c,params:l},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=D(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=y(this.latestLocation.href)===y(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=E(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=K(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ye(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ie(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?it.set(this.latestLocation,t):it.delete(this.latestLocation);let n=this.latestLocation,r=q(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await We({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){g(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):A(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(q(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ie(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=U,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await We({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(g(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});A(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=c(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!D(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?D(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Oe,parseSearch:e.parseSearch??De,protocolAllowlist:e.protocolAllowlist??ae}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=le(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:y(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?dt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Y(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof J||(r=new J(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:v}=_({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),y=r.id+h+m,b=this.getMatch(y),x=l.get(r.id),S=b?._strictParams??v,C;if(!b)try{ft(r,S)}catch(e){if(C=A(e)||g(e)?e:new ot(e.message,{cause:e}),t?.throwOnError)throw C}Object.assign(i,S);let w=x?`stay`:`enter`,T;if(b)T={...b,cause:w,params:x?.params??i,_strictParams:S,search:O(x?x.search:b.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Ke(r)?`pending`:`success`;T={id:y,ssr:r.options.ssr,index:n,routeId:r.id,params:x?.params??i,_strictParams:S,pathname:h,updatedAt:Date.now(),search:x?O(x.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:C,__routeContext:void 0,_nonReactive:{loadPromise:E()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:w,loaderDeps:x?M(x.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(T.globalNotFound=s===r.id),T.searchError=f;let D=this.getParentContext(o);T.context={...D,...T.__routeContext,...T.__beforeLoadContext},c[n]=T}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?O(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=re(t),i={...e.search};for(let e of t)try{Object.assign(i,Y(e.options.validateSearch,i))}catch{}let a=re(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{ft(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},J=class extends Error{},ot=class extends Error{};function st(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Y(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new J(`Async validation not supported`);if(n.issues)throw new J(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ct({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=y(e),a,o=C(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function lt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ut(n)(e,t,r??!1)}function ut(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Y(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:k(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function dt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return r}function ft(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var X=t(n(),1),Z=e();function pt(e){let t=e.errorComponent??Q;return(0,Z.jsx)(mt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?X.createElement(t,{error:n,reset:r}):e.children})}var mt=class extends X.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Q({error:e}){let[t,n]=X.useState(!1);return(0,Z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Z.jsx)(`code`,{children:e.message}):null})}):null]})}function ht(e){let t=j(),n=`not-found-${x(t.stores.location,e=>e.pathname)}-${x(t.stores.status,e=>e)}`;return(0,Z.jsx)(pt,{getResetKey:()=>n,onCatch:(t,n)=>{if(A(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(A(t))return e.fallback?.(t);throw t},children:e.children})}function gt(){return(0,Z.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Z.jsx)(Z.Fragment,{children:e.children})}function _t(e,t,n){return t.options.notFoundComponent?(0,Z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Z.jsx)(gt,{})}var vt=X.memo(function({matchId:e}){let t=j(),n=t.stores.matchStores.get(e);n||f();let r=x(t.stores.loadedAt,e=>e),i=x(n,e=>e);return(0,Z.jsx)(yt,{router:t,matchId:e,resetKey:r,matchState:X.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function yt({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,s=o?(0,Z.jsx)(o,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,d=r.ssr===!1||r.ssr===`data-only`,f=(!i.isRoot||i.options.wrapInSuspense||d)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||d))?X.Suspense:$,p=c?pt:$,m=u?ht:$;return(0,Z.jsxs)(i.isRoot?i.options.shellComponent??$:$,{children:[(0,Z.jsx)(oe.Provider,{value:t,children:(0,Z.jsx)(f,{fallback:s,children:(0,Z.jsx)(p,{getResetKey:()=>n,errorComponent:c||Q,onCatch:(e,t)=>{if(A(e))throw e.routeId??=r.routeId,e;l?.(e,t)},children:(0,Z.jsx)(m,{fallback:e=>{if(e.routeId??=r.routeId,!u||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return X.createElement(u,e)},children:d||r._displayPending?(0,Z.jsx)(a,{fallback:s,children:(0,Z.jsx)(xt,{matchId:t})}):(0,Z.jsx)(xt,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bt,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function bt({resetKey:e}){let t=j(),n=X.useRef(void 0);return te(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...q(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var xt=X.memo(function({matchId:e}){let t=j(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||f();let i=x(r,e=>e),a=i.routeId,o=t.routesById[a],s=X.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=X.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,Z.jsx)(e,{},s):(0,Z.jsx)(St,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=E();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return A(i.error)||f(),_t(t,o,i.error);if(i.status===`redirected`)throw g(i.error)||f(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),St=X.memo(function(){let e=j(),t=X.useContext(oe),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=x(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=x(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||f(),_t(e,a,void 0);if(!i)return null;let s=(0,Z.jsx)(vt,{matchId:i});return n===`__root__`?(0,Z.jsx)(X.Suspense,{fallback:o,children:s}):s}),Ct=ee(`/(home)`)({component:ce(()=>ne(()=>import(`./route-MqVf7nES.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`),validateSearch:d(b({}))});export{pt as a,q as c,$ as i,ue as l,vt as n,Q as o,St as r,at as s,Ct as t,de as u};
@@ -1,45 +0,0 @@
1
- import{n as e,o as t,r as n,t as r}from"./compiler-runtime-CUwoe8mk.js";import{$i as i,Bi as a,Bn as o,Ca as s,Fn as c,Ki as l,Ln as u,Rn as d,So as f,To as p,Vi as m,Vn as h,c as g,go as _,ia as v,l as y,la as b,ls as x,os as S,qi as C,s as w,sn as ee,t as T,to as E,vt as D,wa as te,zn as O}from"./utils-CC77kD3H.js";import{r as k,t as A}from"./route-DMxzlDqY.js";import{a as ne,c as j,i as M,l as N,n as re,o as ie,r as ae,s as oe,t as se}from"./state-DfyXvTLb.js";import{t as P}from"./createLucideIcon-Bk3TPktA.js";import{T as ce,a as le,c as ue,d as de,f as fe,h as pe,i as me,l as he,m as ge,n as F,p as _e,r as I,t as ve,u as L}from"./resizable-MFmepAoA.js";import{t as ye}from"./button-BYRipVmK.js";var R=t(n(),1);function z(e){let t=x({warn:e?.router===void 0}),n=e?.router||t,r=(0,R.useRef)(void 0);return p(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=S(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var be=P(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),B=P(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),xe=P(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Se=P(`git-branch-plus`,[[`path`,{d:`M6 3v12`,key:`qpgusn`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`1d02ji`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`chk6ph`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`,key:`or332x`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),Ce=P(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),V=P(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),we=P(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Te=P(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Ee=P(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),H=r(),U=1,De=.9,Oe=.8,ke=.17,Ae=.1,je=.999,Me=.9999,Ne=.99,Pe=/[\\\/_+.#"@\[\(\{&]/,Fe=/[\\\/_+.#"@\[\(\{&]/g,Ie=/[\s-]/,Le=/[\s-]/g;function Re(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?U:Ne;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Re(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=U:Pe.test(e.charAt(l-1))?(d*=Oe,p=e.slice(i,l-1).match(Fe),p&&i>0&&(d*=je**+p.length)):Ie.test(e.charAt(l-1))?(d*=De,m=e.slice(i,l-1).match(Le),m&&i>0&&(d*=je**+m.length)):(d*=ke,i>0&&(d*=je**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Me)),(d<Ae&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Re(e,t,n,r,l+1,a+2,o),f*Ae>d&&(d=f*Ae)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ze(e){return e.toLowerCase().replace(Le,` `)}function Be(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Re(e,t,ze(e),ze(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Ve(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function G(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ve(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ve(e[t],null)}}}}function He(...e){return R.useCallback(G(...e),e)}var K=e();function Ue(e,t){let n=R.createContext(t),r=e=>{let{children:t,...r}=e,i=R.useMemo(()=>r,Object.values(r));return(0,K.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=R.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function We(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,K.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ge(i,...t)]}function Ge(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Ke=globalThis?.document?R.useLayoutEffect:()=>{},qe=R.useId||(()=>void 0),Je=0;function q(e){let[t,n]=R.useState(qe());return Ke(()=>{e||n(e=>e??String(Je++))},[e]),e||(t?`radix-${t}`:``)}var Ye=R.useInsertionEffect||Ke;function Xe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ze({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=Qe(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ze({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return Ye(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Qe(e){return typeof e==`function`}var $e=t(f(),1);function et(e){let t=tt(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(rt);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function tt(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=at(n),i=it(r,n.props);return n.type!==R.Fragment&&(i.ref=t?G(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nt=Symbol(`radix.slottable`);function rt(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===nt}function it(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function at(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=et(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ot(e,t){e&&$e.flushSync(()=>e.dispatchEvent(t))}function st(e){let t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...e)=>t.current?.(...e),[])}function ct(e,t=globalThis?.document){let n=st(e);R.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var lt=`DismissableLayer`,ut=`dismissableLayer.update`,dt=`dismissableLayer.pointerDownOutside`,ft=`dismissableLayer.focusOutside`,pt,mt=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ht=R.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=R.useContext(mt),[u,d]=R.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=R.useState({}),m=He(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=vt(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=yt(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return ct(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(pt=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),bt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pt)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),bt())},[u,l]),R.useEffect(()=>{let e=()=>p({});return document.addEventListener(ut,e),()=>document.removeEventListener(ut,e)},[]),(0,K.jsx)(J.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:W(e.onFocusCapture,S.onFocusCapture),onBlurCapture:W(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,x.onPointerDownCapture)})});ht.displayName=lt;var gt=`DismissableLayerBranch`,_t=R.forwardRef((e,t)=>{let n=R.useContext(mt),r=R.useRef(null),i=He(t,r);return R.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,K.jsx)(J.div,{...e,ref:i})});_t.displayName=gt;function vt(e,t=globalThis?.document){let n=st(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){xt(dt,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yt(e,t=globalThis?.document){let n=st(e),r=R.useRef(!1);return R.useEffect(()=>{let e=e=>{e.target&&!r.current&&xt(ft,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bt(){let e=new CustomEvent(ut);document.dispatchEvent(e)}function xt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ot(i,a):i.dispatchEvent(a)}var St=`focusScope.autoFocusOnMount`,Ct=`focusScope.autoFocusOnUnmount`,wt={bubbles:!1,cancelable:!0},Tt=`FocusScope`,Et=R.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=R.useState(null),l=st(i),u=st(a),d=R.useRef(null),f=He(t,e=>c(e)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Y(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Y(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Y(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),R.useEffect(()=>{if(s){Nt.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(St,wt);s.addEventListener(St,l),s.dispatchEvent(t),t.defaultPrevented||(Dt(It(kt(s)),{select:!0}),document.activeElement===e&&Y(s))}return()=>{s.removeEventListener(St,l),setTimeout(()=>{let t=new CustomEvent(Ct,wt);s.addEventListener(Ct,u),s.dispatchEvent(t),t.defaultPrevented||Y(e??document.body,{select:!0}),s.removeEventListener(Ct,u),Nt.remove(p)},0)}}},[s,l,u,p]);let m=R.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ot(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Y(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Y(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,K.jsx)(J.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Et.displayName=Tt;function Dt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Y(r,{select:t}),document.activeElement!==n)return}function Ot(e){let t=kt(e);return[At(t,e),At(t.reverse(),e)]}function kt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function At(e,t){for(let n of e)if(!jt(n,{upTo:t}))return n}function jt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Mt(e){return e instanceof HTMLInputElement&&`select`in e}function Y(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mt(e)&&t&&e.select()}}var Nt=Pt();function Pt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ft(e,t),e.unshift(t)},remove(t){e=Ft(e,t),e[0]?.resume()}}}function Ft(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function It(e){return e.filter(e=>e.tagName!==`A`)}var Lt=`Portal`,Rt=R.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=R.useState(!1);Ke(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?$e.createPortal((0,K.jsx)(J.div,{...r,ref:t}),o):null});Rt.displayName=Lt;function zt(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var Bt=e=>{let{present:t,children:n}=e,r=Vt(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=He(r.ref,Ut(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};Bt.displayName=`Presence`;function Vt(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=zt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=Ht(r.current);a.current=o===`mounted`?e:`none`},[o]),Ke(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ht(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ke(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ht(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ht(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ht(e){return e?.animationName||`none`}function Ut(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wt=0;function Gt(){R.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Kt()),document.body.insertAdjacentElement(`beforeend`,e[1]??Kt()),Wt++,()=>{Wt===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Wt--}},[])}function Kt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var X=function(){return X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},X.apply(this,arguments)};function qt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Jt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Yt=`right-scroll-bar-position`,Xt=`width-before-scroll-bar`,Zt=`with-scroll-bars-hidden`,Qt=`--removed-body-scroll-bar-size`;function $t(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function en(e,t){var n=(0,R.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var tn=typeof window<`u`?R.useLayoutEffect:R.useEffect,nn=new WeakMap;function rn(e,t){var n=en(t||null,function(t){return e.forEach(function(e){return $t(e,t)})});return tn(function(){var t=nn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$t(e,null)}),i.forEach(function(e){r.has(e)||$t(e,a)})}nn.set(n,e)},[e]),n}function an(e){return e}function on(e,t){t===void 0&&(t=an);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sn(e){e===void 0&&(e={});var t=on(null);return t.options=X({async:!0,ssr:!1},e),t}var cn=function(e){var t=e.sideCar,n=qt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return R.createElement(r,X({},n))};cn.isSideCarExport=!0;function ln(e,t){return e.useMedium(t),cn}var un=sn(),dn=function(){},fn=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:dn,onWheelCapture:dn,onTouchMoveCapture:dn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=qt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=rn([n,t]),C=X(X({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:un,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?R.cloneElement(R.Children.only(s),X(X({},C),{ref:S})):R.createElement(v,X({},C,{className:c,ref:S}),s))});fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fn.classNames={fullWidth:Xt,zeroRight:Yt};var pn,mn=function(){if(pn)return pn;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function hn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=mn();return t&&e.setAttribute(`nonce`,t),e}function gn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _n(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var vn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hn())&&(gn(t,n),_n(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yn=function(){var e=vn();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bn=function(){var e=yn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xn={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||``,10)||0},Cn=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Sn(n),Sn(r),Sn(i)]},wn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xn;var t=Cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tn=bn(),En=`data-scroll-locked`,Dn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${Zt} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${En}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${Yt} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${Xt} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${Yt} .${Yt} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${Xt} .${Xt} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${En}] {
36
- ${Qt}: ${s}px;
37
- }
38
- `},On=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},kn=function(){R.useEffect(function(){return document.body.setAttribute(En,(On()+1).toString()),function(){var e=On()-1;e<=0?document.body.removeAttribute(En):document.body.setAttribute(En,e.toString())}},[])},An=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;kn();var a=R.useMemo(function(){return wn(i)},[i]);return R.createElement(Tn,{styles:Dn(a,!t,i,n?``:`!important`)})},jn=!1;if(typeof window<`u`)try{var Mn=Object.defineProperty({},"passive",{get:function(){return jn=!0,!0}});window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=jn?{passive:!1}:!1,Pn=function(e){return e.tagName===`TEXTAREA`},Fn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Pn(e)&&n[t]===`visible`)},In=function(e){return Fn(e,`overflowY`)},Ln=function(e){return Fn(e,`overflowX`)},Rn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Vn(e,r)){var i=Hn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Bn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Vn=function(e,t){return e===`v`?In(t):Ln(t)},Hn=function(e,t){return e===`v`?zn(t):Bn(t)},Un=function(e,t){return e===`h`&&t===`rtl`?-1:1},Wn=function(e,t,n,r,i){var a=Un(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Hn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Vn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Gn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kn=function(e){return[e.deltaX,e.deltaY]},qn=function(e){return e&&`current`in e?e.current:e},Jn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yn=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},Xn=0,Zn=[];function Qn(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Xn++)[0],a=R.useState(bn)[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jt([e.lockRef.current],(e.shards||[]).map(qn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=R.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Gn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Rn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Rn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Wn(h,t,e,h===`h`?s:c,!0)},[]),c=R.useCallback(function(e){var n=e;if(!(!Zn.length||Zn[Zn.length-1]!==a)){var r=`deltaY`in n?Kn(n):Gn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Jn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(qn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=R.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:$n(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=R.useCallback(function(e){n.current=Gn(e),r.current=void 0},[]),d=R.useCallback(function(t){l(t.type,Kn(t),t.target,s(t,e.lockRef.current))},[]),f=R.useCallback(function(t){l(t.type,Gn(t),t.target,s(t,e.lockRef.current))},[]);R.useEffect(function(){return Zn.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Nn),document.addEventListener(`touchmove`,c,Nn),document.addEventListener(`touchstart`,u,Nn),function(){Zn=Zn.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Nn),document.removeEventListener(`touchmove`,c,Nn),document.removeEventListener(`touchstart`,u,Nn)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(a,{styles:Yn(i)}):null,p?R.createElement(An,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $n(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var er=ln(un,Qn),tr=R.forwardRef(function(e,t){return R.createElement(fn,X({},e,{ref:t,sideCar:er}))});tr.classNames=fn.classNames;var nr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},rr=new WeakMap,ir=new WeakMap,ar={},or=0,sr=function(e){return e&&(e.host||sr(e.parentNode))},cr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=sr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},lr=function(e,t,n,r){var i=cr(t,Array.isArray(e)?e:[e]);ar[n]||(ar[n]=new WeakMap);var a=ar[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(rr.get(e)||0)+1,l=(a.get(e)||0)+1;rr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ir.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),or++,function(){o.forEach(function(e){var t=rr.get(e)-1,i=a.get(e)-1;rr.set(e,t),a.set(e,i),t||(ir.has(e)||e.removeAttribute(r),ir.delete(e)),i||e.removeAttribute(n)}),or--,or||(rr=new WeakMap,rr=new WeakMap,ir=new WeakMap,ar={})}},ur=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||nr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),lr(r,i,n,`aria-hidden`)):function(){return null}},dr=`Dialog`,[fr,pr]=We(dr),[mr,Z]=fr(dr),hr=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=R.useRef(null),c=R.useRef(null),[l,u]=Xe({prop:r,defaultProp:i??!1,onChange:a,caller:dr});return(0,K.jsx)(mr,{scope:t,triggerRef:s,contentRef:c,contentId:q(),titleId:q(),descriptionId:q(),open:l,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};hr.displayName=dr;var gr=`DialogTrigger`,_r=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(gr,n),a=He(t,i.triggerRef);return(0,K.jsx)(J.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Lr(i.open),...r,ref:a,onClick:W(e.onClick,i.onOpenToggle)})});_r.displayName=gr;var vr=`DialogPortal`,[yr,br]=fr(vr,{forceMount:void 0}),xr=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z(vr,t);return(0,K.jsx)(yr,{scope:t,forceMount:n,children:R.Children.map(r,e=>(0,K.jsx)(Bt,{present:n||a.open,children:(0,K.jsx)(Rt,{asChild:!0,container:i,children:e})}))})};xr.displayName=vr;var Sr=`DialogOverlay`,Cr=R.forwardRef((e,t)=>{let n=br(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Sr,e.__scopeDialog);return a.modal?(0,K.jsx)(Bt,{present:r||a.open,children:(0,K.jsx)(Tr,{...i,ref:t})}):null});Cr.displayName=Sr;var wr=et(`DialogOverlay.RemoveScroll`),Tr=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(Sr,n);return(0,K.jsx)(tr,{as:wr,allowPinchZoom:!0,shards:[i.contentRef],children:(0,K.jsx)(J.div,{"data-state":Lr(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Er=`DialogContent`,Dr=R.forwardRef((e,t)=>{let n=br(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z(Er,e.__scopeDialog);return(0,K.jsx)(Bt,{present:r||a.open,children:a.modal?(0,K.jsx)(Or,{...i,ref:t}):(0,K.jsx)(kr,{...i,ref:t})})});Dr.displayName=Er;var Or=R.forwardRef((e,t)=>{let n=Z(Er,e.__scopeDialog),r=R.useRef(null),i=He(t,n.contentRef,r);return R.useEffect(()=>{let e=r.current;if(e)return ur(e)},[]),(0,K.jsx)(Ar,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault())})}),kr=R.forwardRef((e,t)=>{let n=Z(Er,e.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return(0,K.jsx)(Ar,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Ar=R.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z(Er,n),c=R.useRef(null),l=He(t,c);return Gt(),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Et,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(ht,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Lr(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Vr,{titleId:s.titleId}),(0,K.jsx)(Ur,{contentRef:c,descriptionId:s.descriptionId})]})]})}),jr=`DialogTitle`,Mr=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(jr,n);return(0,K.jsx)(J.h2,{id:i.titleId,...r,ref:t})});Mr.displayName=jr;var Nr=`DialogDescription`,Pr=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(Nr,n);return(0,K.jsx)(J.p,{id:i.descriptionId,...r,ref:t})});Pr.displayName=Nr;var Fr=`DialogClose`,Ir=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Z(Fr,n);return(0,K.jsx)(J.button,{type:`button`,...r,ref:t,onClick:W(e.onClick,()=>i.onOpenChange(!1))})});Ir.displayName=Fr;function Lr(e){return e?`open`:`closed`}var Rr=`DialogTitleWarning`,[zr,Br]=Ue(Rr,{contentName:Er,titleName:jr,docsSlug:`dialog`}),Vr=({titleId:e})=>{let t=Br(Rr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
-
43
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
-
45
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Hr=`DialogDescriptionWarning`,Ur=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Br(Hr).contentName}}.`;return R.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Wr=hr,Gr=xr,Kr=Cr,qr=Dr,Jr=Symbol.for(`react.lazy`),Yr=R.use;function Xr(e){return typeof e==`object`&&!!e&&`then`in e}function Zr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Jr&&`_payload`in e&&Xr(e._payload)}function Qr(e){let t=$r(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e;Zr(r)&&typeof Yr==`function`&&(r=Yr(r._payload));let a=R.Children.toArray(r),o=a.find(ti);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function $r(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(Zr(n)&&typeof Yr==`function`&&(n=Yr(n._payload)),R.isValidElement(n)){let e=ri(n),i=ni(r,n.props);return n.type!==R.Fragment&&(i.ref=t?G(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ei=Symbol(`radix.slottable`);function ti(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ei}function ni(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ri(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Qr(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ii=`[cmdk-group=""]`,ai=`[cmdk-group-items=""]`,oi=`[cmdk-group-heading=""]`,si=`[cmdk-item=""]`,ci=`${si}:not([aria-disabled="true"])`,li=`cmdk-item-select`,ui=`data-value`,di=(e,t,n)=>Be(e,t,n),fi=R.createContext(void 0),pi=()=>R.useContext(fi),mi=R.createContext(void 0),hi=()=>R.useContext(mi),gi=R.createContext(void 0),_i=R.forwardRef((e,t)=>{let n=ji(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=ji(()=>new Set),i=ji(()=>new Map),a=ji(()=>new Map),o=ji(()=>new Set),s=ki(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=q(),y=q(),b=q(),x=R.useRef(null),S=Ni();Ai(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Ai(()=>{S(6,te)},[]);let C=R.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),S(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=R.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ee(t,r)),S(2,()=>{T(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),T(),n.current.value||E(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&E(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function ee(e,t){let r=s.current?.filter??di;return e?r(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;k().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ai);t?t.appendChild(e.parentElement===t?e:e.closest(`${ai} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ai} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${ii}[${ui}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function E(){let e=k().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ui);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ee(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ii)?.querySelector(oi))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${si}[aria-selected="true"]`)}function k(){return Array.from(x.current?.querySelectorAll(ci)||[])}function A(e){let t=k()[e];t&&C.setState(`value`,t.getAttribute(ui))}function ne(e){var t;let n=O(),r=k(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(ui))}function j(e){let t=O()?.closest(ii),n;for(;t&&!n;)t=e>0?Di(t,ii):Oi(t,ii),n=t?.querySelector(ci);n?C.setState(`value`,n.getAttribute(ui)):ne(e)}let M=()=>A(k().length-1),N=e=>{e.preventDefault(),e.metaKey?M():e.altKey?j(1):ne(1)},re=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?j(-1):ne(-1)};return R.createElement(Q.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&N(e);break;case`ArrowDown`:N(e);break;case`p`:case`k`:g&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),A(0);break;case`End`:e.preventDefault(),M();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(li);t.dispatchEvent(e)}}}}},R.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:Ii},c),Fi(e,e=>R.createElement(mi.Provider,{value:C},R.createElement(fi.Provider,{value:w},e))))}),vi=R.forwardRef((e,t)=>{let n=q(),r=R.useRef(null),i=R.useContext(gi),a=pi(),o=ki(e),s=o.current?.forceMount??i?.forceMount;Ai(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Mi(n,r,[e.value,e.children,r],e.keywords),l=hi(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);R.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(li,f),()=>t.removeEventListener(li,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return R.createElement(Q.div,{ref:G(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),yi=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=q(),s=R.useRef(null),c=R.useRef(null),l=q(),u=pi(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Ai(()=>u.group(o),[]),Mi(o,s,[e.value,e.heading,c]);let f=R.useMemo(()=>({id:o,forceMount:i}),[i]);return R.createElement(Q.div,{ref:G(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&R.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Fi(e,e=>R.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},R.createElement(gi.Provider,{value:f},e))))}),bi=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),a=$(e=>!e.search);return!n&&!a?null:R.createElement(Q.div,{ref:G(i,t),...r,"cmdk-separator":``,role:`separator`})}),xi=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=hi(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=pi();return R.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),R.createElement(Q.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Si=R.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=R.useRef(null),o=R.useRef(null),s=$(e=>e.selectedItemId),c=pi();return R.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),R.createElement(Q.div,{ref:G(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Fi(e,e=>R.createElement(`div`,{ref:G(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Ci=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return R.createElement(Wr,{open:n,onOpenChange:r},R.createElement(Gr,{container:o},R.createElement(Kr,{"cmdk-overlay":``,className:i}),R.createElement(qr,{"aria-label":e.label,"cmdk-dialog":``,className:a},R.createElement(_i,{ref:t,...s}))))}),wi=R.forwardRef((e,t)=>$(e=>e.filtered.count===0)?R.createElement(Q.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Ti=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return R.createElement(Q.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Fi(e,e=>R.createElement(`div`,{"aria-hidden":!0},e)))}),Ei=Object.assign(_i,{List:Si,Item:vi,Input:xi,Group:yi,Separator:bi,Dialog:Ci,Empty:wi,Loading:Ti});function Di(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Oi(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ki(e){let t=R.useRef(e);return Ai(()=>{t.current=e}),t}var Ai=typeof window>`u`?R.useEffect:R.useLayoutEffect;function ji(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=hi(),n=()=>e(t.snapshot());return R.useSyncExternalStore(t.subscribe,n,n)}function Mi(e,t,n,r=[]){let i=R.useRef(),a=pi();return Ai(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(ui,s),i.current=s}),i}var Ni=()=>{let[e,t]=R.useState(),n=ji(()=>new Map);return Ai(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Pi(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Fi({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(Pi(t),{ref:t.ref},n(t.props.children)):n(t)}var Ii={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Li(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Ei,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ri(e){let t=(0,H.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({title:a,description:o,children:n,className:r,showCloseButton:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`Command Palette`:a,l=o===void 0?`Search for a command to run...`:o,u=s===void 0?!1:s,d;t[7]===c?d=t[8]:(d=(0,K.jsx)(fe,{children:c}),t[7]=c,t[8]=d);let f;t[9]===l?f=t[10]:(f=(0,K.jsx)(L,{children:l}),t[9]=l,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(de,{className:`sr-only`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===r?m=t[15]:(m=T(`top-1/3 translate-y-0 overflow-hidden rounded-none p-0`,r),t[14]=r,t[15]=m);let h;t[16]!==n||t[17]!==u||t[18]!==m?(h=(0,K.jsx)(he,{className:m,showCloseButton:u,children:n}),t[16]=n,t[17]=u,t[18]=m,t[19]=h):h=t[19];let g;return t[20]!==i||t[21]!==p||t[22]!==h?(g=(0,K.jsxs)(ue,{...i,children:[p,h]}),t[20]=i,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function zi(e){let t=(0,H.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`w-full text-xs outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Ei.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7];let o;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(le,{children:(0,K.jsx)(we,{className:`size-4 shrink-0 opacity-50`})}),t[8]=o):o=t[8];let s;return t[9]===a?s=t[10]:(s=(0,K.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,K.jsxs)(me,{className:`border-input/30 bg-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[a,o]})}),t[9]=a,t[10]=s),s}function Bi(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Ei.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vi(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`py-6 text-center text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Ei.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hi(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(Ei.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ui(e){let t=(0,H.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=T(`group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none in-data-[slot=dialog-content]:rounded-none! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(B,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,K.jsxs)(Ei.Item,{"data-slot":`command-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Wi(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=T(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,K.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Gi=[`[&_svg]:text-[oklch(0.74_0.085_50)] [&_.tree-label]:text-[oklch(0.8_0.085_50)]`,`[&_svg]:text-[oklch(0.72_0.075_150)] [&_.tree-label]:text-[oklch(0.78_0.075_150)]`,`[&_svg]:text-[oklch(0.72_0.075_220)] [&_.tree-label]:text-[oklch(0.78_0.075_220)]`,`[&_svg]:text-[oklch(0.72_0.075_285)] [&_.tree-label]:text-[oklch(0.78_0.075_285)]`,`[&_svg]:text-[oklch(0.72_0.075_20)] [&_.tree-label]:text-[oklch(0.78_0.075_20)]`,`[&_svg]:text-[oklch(0.74_0.065_95)] [&_.tree-label]:text-[oklch(0.8_0.065_95)]`],Ki=j(e=>N(ae.runtime.atom(D(ae,t=>u(e)?t(`projects.branches`,{cwd:e}):ee(new M({branches:[],defaultBranch:`main`}))),{initialValue:new M({branches:[],defaultBranch:`main`})})));function qi(){let e=(0,H.c)(19),t=A.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:Ji},e[0]=n):n=e[0];let r=z(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=se(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=oe(i),o,s,c;e[3]===t?(o=e[4],s=e[5],c=e[6]):(o=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Math.abs(E(e)).toString(36)},to:`/$worktree/diff`})})},s=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Math.abs(E(e)).toString(36)},to:`/$worktree/terminal`})})},c=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Math.abs(E(e)).toString(36)},to:`/$worktree/browser`})})},e[3]=t,e[4]=o,e[5]=s,e[6]=c);let l;e[7]!==a.value.activeProject||e[8]!==a.value.activeWorktree||e[9]!==a.value.projects||e[10]!==r.activeView||e[11]!==o||e[12]!==s||e[13]!==c?(l=(0,K.jsx)(F,{defaultSize:`22%`,minSize:`16%`,maxSize:`34%`,children:(0,K.jsx)(ta,{activeProject:a.value.activeProject,activeWorktree:a.value.activeWorktree,activeView:r.activeView,projects:a.value.projects,selectWorktree:o,selectTerminal:s,selectBrowser:c})}),e[7]=a.value.activeProject,e[8]=a.value.activeWorktree,e[9]=a.value.projects,e[10]=r.activeView,e[11]=o,e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(ve,{}),e[15]=u):u=e[15];let d;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(F,{defaultSize:`86%`,minSize:`60%`,children:(0,K.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,K.jsx)(k,{})})}),e[16]=d):d=e[16];let f;return e[17]===l?f=e[18]:(f=(0,K.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden font-mono`,children:(0,K.jsxs)(I,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[l,u,d]})}),e[17]=l,e[18]=f),f}function Ji(e){return{activeView:_(g(e.location.pathname),y(c(`/terminal`),Zi),y(c(`/browser`),Xi),w(Yi)),activeWorktreeId:o(`/`)(e.location.pathname)[1]}}function Yi(){return`diff`}function Xi(){return`browser`}function Zi(){return`terminal`}function Qi(e){let t=o(`/`)(e);for(let n=t.length-1;n>=0;--n)if(u(t[n]??``)&&t[n]!==`.`)return t[n]??e;return e}function $i(e){let t=h(`/home/`)(e)?_(o(`/`)(e),b(3),i(`/`)):void 0;return t&&h(`${t}/`)(e)?`~/${O(d(t)+1)(e)}`:Qi(e)}function ea(e){let t=(0,H.c)(4);if(e.root){let n=`size-3.5 ${e.dirty?`text-amber-500`:`text-current`}`,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(V,{className:n}),t[0]=n,t[1]=r),r}let n=`size-3.5 ${e.dirty?`text-amber-500`:`text-current`}`,r;return t[2]===n?r=t[3]:(r=(0,K.jsx)(Te,{className:n}),t[2]=n,t[3]=r),r}function ta(e){let t=(0,H.c)(76),n=ne(re),r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=ae.mutation(`projects.createWorktree`),i={mode:`promise`},t[0]=r,t[1]=i):(r=t[0],i=t[1]);let o=ie(r,i),c,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=ae.mutation(`projects.deleteWorktree`),d={mode:`promise`},t[2]=c,t[3]=d):(c=t[2],d=t[3]);let f=ie(c,d),[p,h]=(0,R.useState)(``),[g,y]=(0,R.useState)(!1),[b,x]=(0,R.useState)(e.activeProject?.repository.root),S;t[4]!==b||t[5]!==e.activeProject||t[6]!==e.projects?(S=_(e.projects,C(e=>e.repository.root===b),s)??e.activeProject,t[4]=b,t[5]=e.activeProject,t[6]=e.projects,t[7]=S):S=t[7];let w=S,ee=w?.repository.root??``,T;t[8]===ee?T=t[9]:(T=Ki(ee),t[8]=ee,t[9]=T);let E=oe(T),D;if(t[10]!==E.value.branches||t[11]!==w?.worktrees){let e;t[13]===w?.worktrees?e=t[14]:(e=e=>!_(w?.worktrees??[],v(na),l(u),a(e.name)),t[13]=w?.worktrees,t[14]=e),D=_(E.value.branches,l(ia),m(ra),l(e)),t[10]=E.value.branches,t[11]=w?.worktrees,t[12]=D}else D=t[12];let O=D,k;t[15]!==O||t[16]!==p||t[17]!==E.value.defaultBranch||t[18]!==o||t[19]!==w||t[20]!==e||t[21]!==n?(k=async function(t){let r=t===void 0?p:t,i=_(O,C(e=>e.name===r),s),a=await o({payload:{baseBranch:i?.type===`remote`?`${i.remote}/${i.name}`:`origin/${E.value.defaultBranch}`,branch:r,cwd:(w??e.activeProject)?.repository.root??``,mode:i?.type===`local`?`existing-local`:i?.type===`remote`?`existing-remote`:`new-local`}});y(!1),h(``),n(),e.selectWorktree(a)},t[15]=O,t[16]=p,t[17]=E.value.defaultBranch,t[18]=o,t[19]=w,t[20]=e,t[21]=n,t[22]=k):k=t[22];let A=k,j;t[23]===e.activeWorktree?j=t[24]:(j=()=>{e.activeWorktree&&navigator.clipboard.writeText(e.activeWorktree.root)},t[23]=e.activeWorktree,t[24]=j);let M;t[25]===e.activeWorktree?M=t[26]:(M=e.activeWorktree?$i(e.activeWorktree.root):`No worktree selected`,t[25]=e.activeWorktree,t[26]=M);let N;t[27]===M?N=t[28]:(N=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:M}),t[27]=M,t[28]=N);let se;t[29]!==N||t[30]!==j?(se=(0,K.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground flex h-full min-w-0 items-center px-3 text-left`,onClick:j,children:N}),t[29]=N,t[30]=j,t[31]=se):se=t[31];let P;t[32]!==f||t[33]!==e.activeProject?.repository||t[34]!==e.activeWorktree||t[35]!==n?(P=e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,K.jsx)(`button`,{type:`button`,className:`text-destructive hover:bg-muted hover:text-destructive flex h-8 w-8 items-center justify-center`,onClick:async()=>{e.activeWorktree&&confirm(`Delete worktree ${e.activeWorktree.branch??Qi(e.activeWorktree.root)}?`)&&(await f({payload:{cwd:e.activeWorktree.root,force:!0}}),y(!1),n())},title:`Delete worktree`,children:(0,K.jsx)(ce,{className:`size-3`})}),t[32]=f,t[33]=e.activeProject?.repository,t[34]=e.activeWorktree,t[35]=n,t[36]=P):P=t[36];let le;t[37]!==se||t[38]!==P?(le=(0,K.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[se,P]}),t[37]=se,t[38]=P,t[39]=le):le=t[39];let ue;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{y(e)},t[40]=ue):ue=t[40];let de;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{e.stopPropagation(),e.key===`Escape`&&y(!1)},t[41]=de):de=t[41];let fe;t[42]===w?fe=t[43]:(fe=w?Qi(w.repository.root):`workspace`,t[42]=w,t[43]=fe);let me=`Create in ${fe}...`,he;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{h(e)},t[44]=he):he=t[44];let F;t[45]!==p||t[46]!==A||t[47]!==w?(F=e=>{e.key===`Enter`&&p!==``&&w&&(e.preventDefault(),A())},t[45]=p,t[46]=A,t[47]=w,t[48]=F):F=t[48];let I;t[49]!==p||t[50]!==me||t[51]!==F?(I=(0,K.jsx)(zi,{placeholder:me,value:p,onValueChange:he,onKeyDown:F}),t[49]=p,t[50]=me,t[51]=F,t[52]=I):I=t[52];let ve;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,K.jsx)(Vi,{children:`No command found.`}),t[53]=ve):ve=t[53];let L;t[54]!==O||t[55]!==p||t[56]!==E.value.defaultBranch||t[57]!==A||t[58]!==w?(L=w&&(0,K.jsxs)(Hi,{children:[v(O,e=>(0,K.jsxs)(Ui,{value:e.name,onSelect:()=>{h(e.name),A(e.name)},children:[e.type===`local`?(0,K.jsx)(xe,{className:`size-3.5`}):(0,K.jsx)(Te,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,K.jsx)(Wi,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)),p!==``&&te(C(O,e=>e.name===p))&&(0,K.jsxs)(Ui,{value:`create ${p}`,onSelect:()=>void A(),children:[(0,K.jsx)(Se,{className:`size-3.5`}),`Create `,p,(0,K.jsxs)(Wi,{children:[`origin/`,E.value.defaultBranch]})]})]}),t[54]=O,t[55]=p,t[56]=E.value.defaultBranch,t[57]=A,t[58]=w,t[59]=L):L=t[59];let z;t[60]===L?z=t[61]:(z=(0,K.jsxs)(Bi,{children:[ve,L]}),t[60]=L,t[61]=z);let B;t[62]!==I||t[63]!==z?(B=(0,K.jsxs)(Li,{onKeyDown:de,children:[I,z]}),t[62]=I,t[63]=z,t[64]=B):B=t[64];let V;t[65]!==g||t[66]!==B?(V=(0,K.jsx)(Ri,{open:g,onOpenChange:ue,title:`Create worktree`,description:`Create or open a worktree branch.`,className:`sm:max-w-2xl`,children:B}),t[65]=g,t[66]=B,t[67]=V):V=t[67];let we;t[68]===e?we=t[69]:(we=v(e.projects,(t,n)=>{let r=s(C(t.worktrees,e=>e.root===t.repository.root))??t.worktrees[0];return(0,K.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,K.jsxs)(`div`,{className:`text-foreground grid h-7 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 pr-2 text-left text-xs font-semibold hover:bg-transparent ${Gi[n%Gi.length]}`,children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center`,children:(0,K.jsx)(be,{className:`size-3.5`})}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,K.jsx)(`button`,{type:`button`,className:`tree-label flex min-w-0 items-center gap-1.5 text-left`,onClick:()=>{r&&e.selectWorktree(r.root)},children:(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:Qi(t.repository.root)})})})]}),(0,K.jsx)(ye,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,onClick:e=>{e.stopPropagation(),x(t.repository.root),h(``),y(!0)},title:`Create worktree`,children:(0,K.jsx)(Se,{className:`size-3`})})]}),(0,K.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:v(t.worktrees,n=>(0,K.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,K.jsx)(ge,{icon:(0,K.jsx)(ea,{dirty:n.status?.dirtyTracked??n.status?.untracked??n.status?.unpushedCommits??(n.status?.behind??0)>0,root:n.root===t.repository.root}),selected:e.activeView===`diff`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectWorktree(n.root)},children:n.branch??Qi(n.root)},n.root),(0,K.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,K.jsx)(`li`,{className:`w-full min-w-0`,children:(0,K.jsx)(ge,{icon:(0,K.jsx)(Ee,{className:`size-3.5`}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectTerminal(n.root)},children:`terminal`})}),(0,K.jsx)(`li`,{className:`w-full min-w-0`,children:(0,K.jsx)(ge,{icon:(0,K.jsx)(Ce,{className:`size-3.5`}),selected:e.activeView===`browser`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectBrowser(n.root)},children:`browser`})})]})]},n.root))})]},t.repository.gitDirectory)}),t[68]=e,t[69]=we);let U;t[70]===we?U=t[71]:(U=(0,K.jsx)(_e,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,K.jsx)(pe,{children:we})}),t[70]=we,t[71]=U);let De;return t[72]!==le||t[73]!==V||t[74]!==U?(De=(0,K.jsxs)(`div`,{className:`flex h-full flex-col border-r text-xs`,children:[le,V,U]}),t[72]=le,t[73]=V,t[74]=U,t[75]=De):De=t[75],De}function na(e){return e.branch??``}function ra(e,t){return e.name===t.name}function ia(e){return u(e.name)}export{qi as component};