@open-mercato/cezar 0.9.1-pr683.785 → 0.9.1-pr684.788

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 (23) hide show
  1. package/package.json +1 -1
  2. package/web/dist/assets/{centered-state-BReta6eb.js → centered-state-D1yrjQoc.js} +2 -2
  3. package/web/dist/assets/{commit-list-DfJRHYFk.js → commit-list-BfkG866w.js} +1 -1
  4. package/web/dist/assets/{compare-variants-BStm-Ovz.js → compare-variants-jcT4c_JW.js} +1 -1
  5. package/web/dist/assets/{diff-C739D239.js → diff-Dw6FglWc.js} +2 -2
  6. package/web/dist/assets/{diff-view-T7lcevcs.js → diff-view-6Y7sgPso.js} +1 -1
  7. package/web/dist/assets/{dist-Cu-vv6-9.js → dist-CVke47_f.js} +1 -1
  8. package/web/dist/assets/{git-toolbar-9zaiGB5p.js → git-toolbar-ChzL0bFu.js} +1 -1
  9. package/web/dist/assets/{github-B6WuGsyo.js → github-CUBMqPuy.js} +1 -1
  10. package/web/dist/assets/{index-Cd5Hgc0_.js → index-YvXMniy_.js} +3 -3
  11. package/web/dist/assets/{project-router-DN5PKKrC.js → project-router-DAVnRglp.js} +1 -1
  12. package/web/dist/assets/{repo-git-CC_RPAgr.js → repo-git-VKPTtK9w.js} +1 -1
  13. package/web/dist/assets/{run-diff-BpC4g-YQ.js → run-diff-CfKkTcmS.js} +1 -1
  14. package/web/dist/assets/{run-header--x1HauoC.js → run-header-CMZJ2dG8.js} +1 -1
  15. package/web/dist/assets/{skills-B05nl28c.js → skills-kmz63wkf.js} +1 -1
  16. package/web/dist/assets/{tab-link-DVv8pNDn.js → tab-link-BBLapc-J.js} +1 -1
  17. package/web/dist/assets/{task-changes-BkjTVPtk.js → task-changes-DQWwrWI7.js} +1 -1
  18. package/web/dist/assets/{task-commits-oN2GEONS.js → task-commits-Ber_6Mkg.js} +1 -1
  19. package/web/dist/assets/{task-files-pLrheO_e.js → task-files-CB9Msjey.js} +1 -1
  20. package/web/dist/assets/{task-thread-OZ6HpdEp.js → task-thread-agaEEfIO.js} +6 -6
  21. package/web/dist/assets/{use-desktop-DYhVkH-Q.js → use-desktop-DUr2E3HH.js} +1 -1
  22. package/web/dist/assets/{workflows-CRmBJjob.js → workflows-DytyO3vg.js} +1 -1
  23. package/web/dist/index.html +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cezar",
3
- "version": "0.9.1-pr683.785",
3
+ "version": "0.9.1-pr684.788",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  import{a as e,i as t,o as n,r,s as i,u as a}from"./bundle-mjs-BegPhL5c.js";import{a as o,o as s,r as c,t as l}from"./utils-B8xGEgP3.js";var u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},d=new class extends u{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},f={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},p=new class{#e=f;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function m(e){setTimeout(e,0)}var h=typeof window>`u`||`Deno`in globalThis;function g(){}function _(e,t){return typeof e==`function`?e(t):e}function v(e){return typeof e==`number`&&e>=0&&e!==1/0}function y(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==w(o,t.options))return!1}else if(!E(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(T(t.options.mutationKey)!==T(a))return!1}else if(!E(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function w(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>E(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{p.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>h;return{isServer(){return e()},setIsServer(t){e=t}}})();function me(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var he=m;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=ge(),_e=new class extends u{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=me(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new be(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>d.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),u=()=>ye(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(pe.isServer()?0:3),o=e.retryDelay??ve,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?h():m().then(h),i)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v(this.gcTime)&&(this.#e=p.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(p.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ce:se;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(g).catch(g):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>b(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!y(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends u{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=me(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ie(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(g)),t}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(pe.isServer()||this.#r.isStale||!v(e))return;let t=y(this.#r.dataUpdatedAt,e)+1;this.#d=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(pe.isServer()||x(this.options.enabled,this.#t)===!1||!v(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(p.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(p.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Fe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:x(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=me();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!D(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){O.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function je(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&x(t.retryOnMount,e)===!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(x(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}function Ie(e,t){return!D(e.getCurrentResult(),t)}var Le=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Re(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Re(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ze=class extends u{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),D(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&T(t.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Re();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},k=a(i(),1),A=e(),Be=k.createContext(void 0),j=e=>{let t=k.useContext(Be);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ve=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,A.jsx)(Be.Provider,{value:e,children:t})),He=k.createContext(!1),Ue=()=>k.useContext(He);He.Provider;function We(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ge=k.createContext(We()),Ke=()=>k.useContext(Ge),qe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Je=e=>{k.useEffect(()=>{e.clearReset()},[e])},Ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),Xe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Qe=(e,t)=>e?.suspense&&t.isPending,$e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et(e,t,n){let r=Ue(),i=Ke(),a=j(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Xe(o),qe(o,i,s),Je(i);let l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(k.useSyncExternalStore(k.useCallback(e=>{let t=f?u.subscribe(O.batchCalls(e)):g;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),Qe(o,d))throw $e(o,u,i);if(Ye({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!pe.isServer()&&Ze(d,r)&&(l?$e(o,u,i):s?.promise)?.catch(g).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function M(e,t){return et(e,Ae,t)}function N(e,t){let n=j(t),[r]=k.useState(()=>new ze(n,e));k.useEffect(()=>{r.setOptions(e)},[r,e]);let i=k.useSyncExternalStore(k.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=k.useCallback((e,t)=>{r.mutate(e,t).catch(g)},[r]);if(i.error&&de(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var tt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,nt=/^[\\/]{2}/;function rt(e,t){return t+e.replace(/\\/g,`/`)}var it=`popstate`;function at(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ot(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return lt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ut(t)}return dt(t,n,null,e)}function P(e,t){if(e===!1||e==null)throw Error(t)}function F(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function st(){return Math.random().toString(36).substring(2,10)}function ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function lt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||st(),mask:i}}function ut({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u()+1;let d=ct(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u();let i=ct(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ft(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(it,d),c=e,()=>{i.removeEventListener(it,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ft(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),P(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ut(t);return i=i.replace(/ $/,`%20`),!n&&nt.test(i)&&(i=r+i),new URL(i,r)}function pt(e,t,n=`/`){return mt(e,t,n,!1)}function mt(e,t,n,r,i){let a=L((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??gt(e),s=null,c=Nt(a);for(let e=0;s==null&&e<o.length;++e)s=kt(o[e],c,r);return s}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function gt(e){let t=_t(e);return yt(t),t}function _t(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;P(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=R([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(P(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),_t(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Dt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Mt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of vt(e.path))a(e,t,!0,n)}),t}function vt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=vt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function yt(e){e.sort((e,t)=>e.score===t.score?Ot(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var bt=/^:[\w-]+$/,xt=3,St=2,Ct=1,wt=10,Tt=-2,Et=e=>e===`*`;function Dt(e,t){let n=e.split(`/`),r=n.length;return n.some(Et)&&(r+=Tt),t&&(r+=St),n.filter(e=>!Et(e)).reduce((e,t)=>e+(bt.test(t)?xt:t===``?Ct:wt),r)}function Ot(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function kt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?jt(u,l,s.matcher,s.compiledParams):At(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:R([a,d.pathname]),pathnameBase:Ht(R([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=R([a,d.pathnameBase]))}return o}function At(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mt(e.path,e.caseSensitive,e.end);return jt(e,t,n,r)}function jt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Mt(e,t=!1,n=!0){F(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return F(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Pt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Bt(n),a=n.startsWith(`/`)?Ft(n.substring(1),`/`):Ft(n,t)):a=t,{pathname:a,search:Ut(r),hash:Wt(i)}}function Ft(e,t){let n=Vt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function It(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Rt(e){let t=Lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function zt(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},P(!i.pathname||!i.pathname.includes(`?`),It(`?`,`pathname`,`search`,i)),P(!i.pathname||!i.pathname.includes(`#`),It(`#`,`pathname`,`hash`,i)),P(!i.search||!i.search.includes(`#`),It(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Pt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Bt=e=>e.replace(/[\\/]{2,}/g,`/`),R=e=>Bt(e.join(`/`)),Vt=e=>e.replace(/\/+$/,``),Ht=e=>Vt(e).replace(/^\/*/,`/`),Ut=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function qt(e){return R(e.map(e=>e.route.path).filter(Boolean))||`/`}var Jt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e,t){let n=e;if(typeof n!=`string`||!tt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Jt)try{let e=new URL(window.location.href),r=nt.test(n)?new URL(rt(n,e.protocol)):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{F(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Xt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Xt);var Zt=[`GET`,...Xt];new Set(Zt);var Qt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function $t(e){try{return Qt.includes(new URL(e).protocol)}catch{return!1}}var z=k.createContext(null);z.displayName=`DataRouter`;var en=k.createContext(null);en.displayName=`DataRouterState`;var tn=k.createContext(!1);function nn(){return k.useContext(tn)}var rn=k.createContext({isTransitioning:!1});rn.displayName=`ViewTransition`;var an=k.createContext(new Map);an.displayName=`Fetchers`;var on=k.createContext(null);on.displayName=`Await`;var B=k.createContext(null);B.displayName=`Navigation`;var sn=k.createContext(null);sn.displayName=`Location`;var V=k.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName=`Route`;var cn=k.createContext(null);cn.displayName=`RouteError`;var ln=`REACT_ROUTER_ERROR`,un=`REDIRECT`,dn=`ROUTE_ERROR_RESPONSE`;function fn(e){if(e.startsWith(`${ln}:${un}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function pn(e){if(e.startsWith(`${ln}:${dn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Gt(t.status,t.statusText,t.data)}catch{}}function mn(e,{relative:t}={}){P(H(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=k.useContext(B),{hash:i,pathname:a,search:o}=Sn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:R([n,a])),r.createHref({pathname:s,search:o,hash:i})}function H(){return k.useContext(sn)!=null}function U(){return P(H(),`useLocation() may be used only in the context of a <Router> component.`),k.useContext(sn).location}var hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function gn(e){k.useContext(B).static||k.useLayoutEffect(e)}function _n(){let{isDataRoute:e}=k.useContext(V);return e?Vn():vn()}function vn(){P(H(),`useNavigate() may be used only in the context of a <Router> component.`);let e=k.useContext(z),{basename:t,navigator:n}=k.useContext(B),{matches:r}=k.useContext(V),{pathname:i}=U(),a=JSON.stringify(Rt(r)),o=k.useRef(!1);return gn(()=>{o.current=!0}),k.useCallback((r,s={})=>{if(F(o.current,hn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=zt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:R([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var yn=k.createContext(null);function bn(e){let t=k.useContext(V).outlet;return k.useMemo(()=>t&&k.createElement(yn.Provider,{value:e},t),[t,e])}function xn(){let{matches:e}=k.useContext(V);return e[e.length-1]?.params??{}}function Sn(e,{relative:t}={}){let{matches:n}=k.useContext(V),{pathname:r}=U(),i=JSON.stringify(Rt(n));return k.useMemo(()=>zt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Cn(e,t){return wn(e,t)}function wn(e,t,n){P(H(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=k.useContext(B),{matches:i}=k.useContext(V),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Un(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=U(),d;if(t){let e=typeof t==`string`?I(t):t;P(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):pt(e,{pathname:p});F(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),F(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=jn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:R([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:R([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?k.createElement(sn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Tn(){let e=Bn(),t=Kt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=k.createElement(k.Fragment,null,k.createElement(`p`,null,`💿 Hey developer 👋`),k.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,k.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,k.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),k.createElement(k.Fragment,null,k.createElement(`h2`,null,`Unexpected Application Error!`),k.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?k.createElement(`pre`,{style:i},n):null,o)}var En=k.createElement(Tn,null),Dn=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=pn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:k.createElement(V.Provider,{value:this.props.routeContext},k.createElement(cn.Provider,{value:e,children:this.props.component}));return this.context?k.createElement(kn,{error:e},t):t}};Dn.contextType=tn;var On=new WeakMap;function kn({children:e,error:t}){let{basename:n}=k.useContext(B);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=fn(t.digest);if(e){let r=On.get(t);if(r)throw r;let i=Yt(e.location,n),a=i.absoluteURL||i.to;if($t(a))throw Error(`Invalid redirect location`);if(Jt&&!On.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw On.set(t,n),n}return k.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function An({routeContext:e,match:t,children:n}){let r=k.useContext(z);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(V.Provider,{value:e},n)}function jn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:qt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||En,o&&(s<0&&c===0?(Un(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?k.createElement(n.route.Component,null):n.route.element?n.route.element:e,k.createElement(An,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?k.createElement(Dn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nn(e){let t=k.useContext(z);return P(t,Mn(e)),t}function Pn(e){let t=k.useContext(en);return P(t,Mn(e)),t}function Fn(e){let t=k.useContext(V);return P(t,Mn(e)),t}function In(e){let t=Fn(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ln(){return In(`useRouteId`)}function Rn(){let e=Pn(`useNavigation`);return k.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function zn(){let{matches:e,loaderData:t}=Pn(`useMatches`);return k.useMemo(()=>e.map(e=>ht(e,t)),[e,t])}function Bn(){let e=k.useContext(cn),t=Pn(`useRouteError`),n=In(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Vn(){let{router:e}=Nn(`useNavigate`),t=In(`useNavigate`),n=k.useRef(!1);return gn(()=>{n.current=!0}),k.useCallback(async(r,i={})=>{F(n.current,hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Hn={};function Un(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,F(!1,n))}k.memo(Wn);function Wn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return wn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Gn({to:e,replace:t,state:n,relative:r}){P(H(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=k.useContext(B);F(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=k.useContext(V),{pathname:o}=U(),s=_n(),c=zt(e,Rt(a),o,r===`path`),l=JSON.stringify(c);return k.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Kn(e){return bn(e.context)}function qn(e){P(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Jn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!H(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=k.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=k.useMemo(()=>{let e=L(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return F(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:k.createElement(B.Provider,{value:c},k.createElement(sn.Provider,{children:t,value:h}))}function Yn({children:e,location:t}){return Cn(Xn(e),t)}k.Component;function Xn(e,t=[]){let n=[];return k.Children.forEach(e,(e,r)=>{if(!k.isValidElement(e))return;let i=[...t,r];if(e.type===k.Fragment){n.push.apply(n,Xn(e.props.children,i));return}P(e.type===qn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Xn(e.props.children,i)),n.push(a)}),n}var Zn=`get`,Qn=`application/x-www-form-urlencoded`;function $n(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function er(e){return $n(e)&&e.tagName.toLowerCase()===`button`}function tr(e){return $n(e)&&e.tagName.toLowerCase()===`form`}function nr(e){return $n(e)&&e.tagName.toLowerCase()===`input`}function rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e,t){return e.button===0&&(!t||t===`_self`)&&!rr(e)}function ar(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function or(e,t){let n=ar(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var sr=null;function cr(){if(sr===null)try{new FormData(document.createElement(`form`),0),sr=!1}catch{sr=!0}return sr}var lr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ur(e){return e!=null&&!lr.has(e)?(F(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qn}"`),null):e}function dr(e,t){let n,r,i,a,o;if(tr(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`enctype`))||Qn,a=new FormData(e)}else if(er(e)||nr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`formenctype`))||ur(o.getAttribute(`enctype`))||Qn,a=new FormData(o,e),!cr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if($n(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Zn,r=null,i=Qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},pr=/[&><\u2028\u2029]/g;function mr(e){return e.replace(pr,e=>fr[e])}function hr(e,t){if(e===!1||e==null)throw Error(t)}function gr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&L(i.pathname,t)===`/`?i.pathname=`${Vt(t)}/_root.${r}`:i.pathname=`${Vt(i.pathname)}.${r}`,i}async function _r(e,n){if(e.id in n)return n[e.id];try{let r=await t(()=>import(e.module),[]);return n[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vr(e){return e!=null&&typeof e.page==`string`}function yr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function br(e,t,n){return Tr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await _r(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(yr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function xr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Sr(e,t,{includeHydrateFallback:n}={}){return Cr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Cr(e){return[...new Set(e)]}function wr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Tr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!vr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(wr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Er(){let e=k.useContext(z);return hr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Dr(){let e=k.useContext(en);return hr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Or=k.createContext(void 0);Or.displayName=`FrameworkContext`;function kr(){let e=k.useContext(Or);return hr(e,`You must render this element inside a <HydratedRouter> element`),e}function Ar(e,t){let n=k.useContext(Or),[r,i]=k.useState(!1),[a,o]=k.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=k.useRef(null);k.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),k.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:jr(s,p),onBlur:jr(c,m),onMouseEnter:jr(l,p),onMouseLeave:jr(u,m),onTouchStart:jr(d,p)}]:[a,f,{}]:[!1,f,{}]}function jr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Mr({page:e,...t}){let n=nn(),{nonce:r}=kr(),{router:i}=Er(),a=k.useMemo(()=>pt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?k.createElement(Pr,{page:e,matches:a,...t}):k.createElement(Fr,{page:e,matches:a,...t})):null}function Nr(e){let{manifest:t,routeModules:n}=kr(),[r,i]=k.useState([]);return k.useEffect(()=>{let r=!1;return br(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Pr({page:e,matches:t,...n}){let r=U(),{future:i}=kr(),{basename:a}=Er(),o=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=gr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return k.createElement(k.Fragment,null,o.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Fr({page:e,matches:t,...n}){let r=U(),{future:i,manifest:a,routeModules:o}=kr(),{basename:s}=Er(),{loaderData:c,matches:l}=Dr(),u=k.useMemo(()=>xr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=k.useMemo(()=>xr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=gr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=k.useMemo(()=>Sr(d,a),[d,a]),m=Nr(d);return k.createElement(k.Fragment,null,f.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>k.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>k.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ir(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}k.Component;var Lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Lr&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Rr({basename:e,children:t,useTransitions:n,window:r}){let i=k.useRef();i.current??=ot({window:r,v5Compat:!0});let a=i.current,[o,s]=k.useState({action:a.action,location:a.location}),c=k.useCallback(e=>{n===!1?s(e):k.startTransition(()=>s(e))},[n]);return k.useLayoutEffect(()=>a.listen(c),[a,c]),k.createElement(Jn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function zr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=k.useState({action:n.action,location:n.location}),o=k.useCallback(e=>{r===!1?a(e):k.startTransition(()=>a(e))},[r]);return k.useLayoutEffect(()=>n.listen(o),[n,o]),k.createElement(Jn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}zr.displayName=`unstable_HistoryRouter`;var Br=k.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=k.useContext(B),v=typeof l==`string`&&tt.test(l),y=Yt(l,h);l=y.to;let b=mn(l,{relative:r}),x=U(),S=null;if(o){let e=zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:R([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Ar(n,p),E=qr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ee(t){e&&e(t),t.defaultPrevented||E(t)}let te=!(y.isExternal||i),D=k.createElement(`a`,{...p,...T,href:(te?S:void 0)||y.absoluteURL||b,onClick:te?ee:e,ref:Ir(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?k.createElement(k.Fragment,null,D,k.createElement(Mr,{page:b})):D});Br.displayName=`Link`;var Vr=k.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Sn(a,{relative:c.relative}),d=U(),f=k.useContext(en),{navigator:p,basename:m}=k.useContext(B),h=f!=null&&ii(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=L(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return k.createElement(Br,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Vr.displayName=`NavLink`;var Hr=k.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Zn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=k.useContext(B),g=Zr(),_=Qr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&tt.test(s);return k.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?k.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Hr.displayName=`Form`;function Ur({getKey:e,storageKey:t,...n}){let r=k.useContext(Or),{basename:i}=k.useContext(B),a=U(),o=zn();ni({getKey:e,storageKey:t});let s=k.useMemo(()=>{if(!r||!e)return null;let t=ti(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),k.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${mr(JSON.stringify(t||$r))}, ${mr(JSON.stringify(s))})`}})}Ur.displayName=`ScrollRestoration`;function Wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gr(e){let t=k.useContext(z);return P(t,Wr(e)),t}function Kr(e){let t=k.useContext(en);return P(t,Wr(e)),t}function qr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_n(),d=U(),f=Sn(e,{relative:o});return k.useCallback(p=>{if(ir(p,t)){p.preventDefault();let t=n===void 0?ut(d)===ut(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?k.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Jr(e){F(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=k.useRef(ar(e)),n=k.useRef(!1),r=U(),i=k.useMemo(()=>or(r.search,n.current?null:t.current),[r.search]),a=_n();return[i,k.useCallback((e,t)=>{let r=ar(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Yr=0,Xr=()=>`__${String(++Yr)}__`;function Zr(){let{router:e}=Gr(`useSubmit`),{basename:t}=k.useContext(B),n=Ln(),r=e.fetch,i=e.navigate;return k.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=dr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Xr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Qr(e,{relative:t}={}){let{basename:n}=k.useContext(B),r=k.useContext(V);P(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Sn(e||`.`,{relative:t})},o=U();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:R([n,a.pathname])),ut(a)}var $r=`react-router-scroll-positions`,ei={};function ti(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:L(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ni({getKey:e,storageKey:t}={}){let{router:n}=Gr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Kr(`useScrollRestoration`),{basename:a}=k.useContext(B),o=U(),s=zn(),c=Rn();k.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ri(k.useCallback(()=>{if(c.state===`idle`){let t=ti(o,s,a,e);ei[t]=window.scrollY}try{sessionStorage.setItem(t||$r,JSON.stringify(ei))}catch(e){F(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(k.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||$r);e&&(ei=JSON.parse(e))}catch{}},[t]),k.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ei,()=>window.scrollY,e?(t,n)=>ti(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),k.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{F(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ri(e,t){let{capture:n}=t||{};k.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ii(e,{relative:t}={}){let n=k.useContext(rn);P(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Gr(`useViewTransitionState`),i=Sn(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return At(i.pathname,o)!=null||At(i.pathname,a)!=null}var ai=[`claude`,`codex`,`opencode`],oi=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function si(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ci(e,t){if(!si(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!ai.includes(n)||typeof r!=`string`||!oi.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function li(e){return ci(e,!1)}function ui(e,t){if(!si(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=ci(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function W(e){let t=ui(e,!0);if(t===null||t.length!==ai.length)return null;let n=new Map(t.map(e=>[e.provider,e]));return ai.some(e=>!n.has(e))?null:ai.map(e=>n.get(e))}function di(e){let t=W(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function fi(e,t){let n=W(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function pi(e,t,n,r){let i=W(e),a=W(t),o=W(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:mi(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function mi(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function hi(e){let t=W(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&e.status===`connected`).map(e=>e.provider));return ai.filter(e=>n.has(e))}function gi(e,t){return W(e)?.find(e=>e.provider===t)}var G=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function _i(e){try{return JSON.parse(e)}catch{return}}function vi(e){return typeof e==`string`?e:void 0}function yi(e,t,n){let r=_i(n),i=r&&typeof r==`object`?r:{};return new G(e,vi(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:vi(i.manual),command:vi(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}async function bi(e,t){try{return await fetch(s(e),t)}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new G(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function xi(e,t={}){let n=await bi(e,t),r=await n.text();if(!n.ok)throw yi(n.status,n.statusText,r);let i=_i(r);if(i===void 0)throw new G(n.status,`the cezar server answered ${e} with a non-JSON body`);return i}async function Si(e,t={}){let n=await bi(e,t),r=await n.text();if(!n.ok)throw yi(n.status,n.statusText,r);return r}function K(e,t={}){return xi(e,{method:`GET`,signal:t.signal})}function q(e,t,n){return xi(t,{method:e,...n===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(n)}})}var J=(e,t=``)=>`/api/runs/${encodeURIComponent(e)}${t}`;function Ci(e){return K(`/api/health`,e)}function wi(e){return K(`/api/models?runner=codex`,e)}function Ti(e=!1,t){return K(`/api/providers/status${e?`?refresh=1`:``}`,t).then(di)}function Ei(e){return K(`/api/launch-key`,e)}function Di(e){return K(`/api/projects`,e)}function Oi(e,t){return K(`/api/fs/browse${e===void 0||e===``?``:`?path=${encodeURIComponent(e)}`}`,t)}function ki(e){return K(`/api/runs`,e)}function Ai(e,t){return K(`/api/p/${encodeURIComponent(e)}/runs`,t)}function ji(e,t){return K(J(e),t)}function Mi(e){return K(`/api/ui-state`,e)}function Ni(e){return K(`/api/workflows`,e)}function Pi(e){return K(`/api/skills`,e)}function Fi(e){return K(`/api/skills?wait=1`,e)}function Ii(){return q(`POST`,`/api/skills/refresh`)}function Li(e){return K(`/api/skills/importable`,e)}function Ri(e){return K(`/api/skills/importable?wait=1`,e)}function zi(e){return K(`/api/todos`,e)}function Bi(e){return K(`/api/repo`,e)}function Vi(e){return K(`/api/config`,e)}function Hi(e={}){return K(`/api/agent-config`,e)}function Ui(e,t={}){return K(`/api/agent-config/${encodeURIComponent(e)}`,t)}function Wi(e,t){return q(`PUT`,`/api/agent-config/${encodeURIComponent(e)}`,t)}function Gi(e){return K(`/api/repo/changes`,e)}function Ki(e,t){return K(`/api/repo/commit/${encodeURIComponent(e)}?structured=1`,t)}function qi(e,t){return K(J(e,`/commits`),t)}function Ji(e,t,n){return K(J(e,`/commit/${encodeURIComponent(t)}`),n)}function Yi(e={},t){let n=new URLSearchParams;e.limit!==void 0&&n.set(`limit`,String(e.limit)),e.refresh&&n.set(`refresh`,`1`);let r=n.toString();return K(`/api/github${r?`?${r}`:``}`,t)}function Xi(e,t){return K(`/api/github/checks?${new URLSearchParams({prs:e.join(`,`)}).toString()}`,t)}function Zi(e,t,n={},r){return K(`/api/github/comments/${e}/${t}${n.refresh?`?refresh=1`:``}`,r)}function Qi(e,t={},n){return K(`/api/github/prs/${e}/merge-state${t.refresh?`?refresh=1`:``}`,n)}function $i(e,t){return q(`POST`,`/api/github/prs/${e}/merge`,t)}function ea(e,t={},n){return K(`/api/github/prs/${e}/changes${t.refresh?`?refresh=1`:``}`,n)}function ta(e,t){return Si(J(e,`/diff`),{method:`GET`,signal:t?.signal})}function na(e,t){return Si(J(e,`/handoff`),{method:`GET`,signal:t?.signal})}function ra(e,t){return K(J(e,`/changes`),t)}function ia(e,t,n){return K(J(e,`/files?path=${encodeURIComponent(t)}`),n)}function aa(e,t){return s(J(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}function oa(e,t){return K(`/api/groups/${encodeURIComponent(e)}`,t)}function sa(e){return q(`POST`,`/api/providers/connect`,{provider:e})}function ca(e,t){return q(`PUT`,`/api/providers/${encodeURIComponent(e)}/enabled`,{enabled:t}).then(di)}function la(e,t){return q(`POST`,`/api/providers/${encodeURIComponent(e)}/retry`,{authFailureId:t}).then(di)}async function ua(e){let t=`/api/projects`,n=await bi(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=_i(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new G(n.status,`the cezar server answered ${t} without a project`):yi(n.status,n.statusText,r)}function da(e){return q(`POST`,`/api/projects/checkout`,e)}function fa(e){return q(`DELETE`,`/api/projects/${encodeURIComponent(e)}`)}function pa(e,t){return q(`PATCH`,`/api/projects/${encodeURIComponent(e)}`,t)}function ma(e){return q(`POST`,`/api/runs`,e)}function ha(e){return q(`POST`,J(e,`/cancel`))}function ga(e,t=!0){return q(`POST`,J(e,`/archive`),{archived:t})}function _a(){return q(`POST`,`/api/runs/archive-finished`)}function va(e){return q(`POST`,J(e,`/finish`))}function ya(e,t={}){let n={};return t.text!==void 0&&(n.text=t.text),t.images!==void 0&&(n.images=t.images),t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),q(`POST`,J(e,`/continue`),n)}function ba(e){return q(`POST`,J(e,`/pr`))}function xa(e,t){return q(`PATCH`,J(e),t)}function Sa(e){return q(`DELETE`,J(e))}function Ca(e){return q(`DELETE`,`/api/todos/${encodeURIComponent(e)}`)}function wa(e,t={}){let n={};return t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),t.prompt!==void 0&&(n.prompt=t.prompt),q(`POST`,`/api/todos/${encodeURIComponent(e)}/start`,Object.keys(n).length>0?n:void 0)}function Ta(e,t){return q(`POST`,`/api/groups/${encodeURIComponent(e)}/pick`,{runId:t})}function Ea(e){return q(`POST`,J(e,`/open-in-cli`))}function Da(e){return K(`/api/open-targets`,e)}function Oa(e,t){return q(`POST`,J(e,`/open-in`),{target:t})}function ka(e,t){return q(`POST`,J(e,`/open-in`),{target:`default`,path:t})}function Aa(e,t){return q(`POST`,J(e,`/git/commit`),{message:t})}function ja(e){return q(`POST`,J(e,`/git/push`))}function Ma(e,t){return q(`POST`,J(e,`/messages`),{text:t.text??``,images:t.images??[]})}function Na(e,t,n){return q(`PATCH`,J(e,`/queued-messages/${encodeURIComponent(t)}`),n)}function Pa(e,t){return q(`DELETE`,J(e,`/queued-messages/${encodeURIComponent(t)}`))}function Fa(e){return q(`POST`,`/api/repo/branch`,e)}function Ia(e){return q(`POST`,`/api/plan`,{task:e})}function La(e){return q(`POST`,`/api/workflows`,e)}function Ra(e){return q(`POST`,`/api/workflows/parse`,{yaml:e})}function za(e){return q(`DELETE`,`/api/workflows/${encodeURIComponent(e)}`)}function Ba(e){return q(`PUT`,`/api/ui-state`,e)}function Va(e){return K(`/api/workspace/ui-state`,e)}function Ha(e){return q(`PUT`,`/api/workspace/ui-state`,e)}function Ua(e){return K(`/api/workspace/config`,e)}function Wa(e,t){return K(`/api/workspace/skills-update?projectId=${encodeURIComponent(e)}`,t)}function Ga(e){return q(`POST`,`/api/workspace/skills-update/check`,{projectId:e})}function Ka(e){return q(`POST`,`/api/workspace/skills-update/apply`,{projectId:e})}function qa(e){return q(`PUT`,`/api/workspace/config`,e)}function Ja(e){return q(`PUT`,`/api/config`,e)}function Ya(e){return K(`/api/worktrees`,e)}function Xa(){return q(`POST`,`/api/worktrees/reclaim`,{})}function Za(e){return q(`POST`,J(e,`/remove-worktree`))}var Qa=`/api/ws`,$a=3e3,eo=1e3,to=7e4,no=0,ro=1;function io(e){let t=new Map,n=null,r,i,a,o=()=>{clearTimeout(a),a=setTimeout(()=>{a=void 0,n?.close()},to)},s=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${Qa}`,c=e=>{n?.readyState===ro&&n.send(JSON.stringify(e))},l=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||n&&(n.readyState===no||n.readyState===ro))return;let i=new e(s());n=i,i.addEventListener(`open`,()=>{if(i===n){o();for(let e of t.keys())c({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==n)return;o();let r;try{r=JSON.parse(e.data)}catch{return}if(typeof r!=`object`||!r)return;let{type:a,topic:s,data:c}=r;if(a!==`event`||typeof s!=`string`)return;let l=t.get(s);if(l)for(let e of[...l])e(c)}),i.addEventListener(`close`,()=>{i===n&&(n=null,clearTimeout(a),a=void 0,t.size>0&&r===void 0&&(r=setTimeout(()=>{r=void 0,t.size>0&&l()},$a)))}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,o){let s=t.get(e);s||(s=new Set,t.set(e,s));let u=s.size===0;s.add(o),clearTimeout(i),i=void 0,n?u&&c({type:`subscribe`,topic:e}):(clearTimeout(r),r=void 0,l());let d=!0;return()=>{d&&(d=!1,s.delete(o),!(s.size>0)&&(t.delete(e),c({type:`unsubscribe`,topic:e}),t.size===0&&i===void 0&&(i=setTimeout(()=>{i=void 0,!(t.size>0)&&(clearTimeout(r),r=void 0,clearTimeout(a),a=void 0,n?.close(),n=null)},eo))))}}}}var ao=null;function oo(e,t){return ao??=io(),ao.subscribe(e,t)}var Y={get health(){return[o(),`health`]},runs:{get all(){return[o(),`runs`]},list:()=>[o(),`runs`,`list`],detail:e=>[o(),`runs`,`detail`,e],diff:e=>[o(),`runs`,`diff`,e],changes:e=>[o(),`runs`,`changes`,e],file:(e,t)=>[o(),`runs`,`files`,e,t],handoff:e=>[o(),`runs`,`handoff`,e],commits:e=>[o(),`runs`,`commits`,e],commit:(e,t)=>[o(),`runs`,`commit`,e,t]},groups:{detail:e=>[o(),`groups`,e]},get todos(){return[o(),`todos`]},get workflows(){return[o(),`workflows`]},get skills(){return[o(),`skills`]},get skillsReady(){return[o(),`skills`,`ready`]},get importableSkills(){return[o(),`skills`,`importable`]},get importableSkillsReady(){return[o(),`skills`,`importable`,`ready`]},get launchKey(){return[o(),`launch-key`]},get repo(){return[o(),`repo`]},get repoChanges(){return[o(),`repo`,`changes`]},repoCommit:e=>[o(),`repo`,`commit`,e],get uiState(){return[o(),`ui-state`]},get config(){return[o(),`config`]},get agentConfig(){return[o(),`agent-config`]},agentConfigFile:e=>[o(),`agent-config`,`file`,e],get worktrees(){return[o(),`worktrees`]},github:(e={})=>[o(),`github`,e.limit??null],githubChecks:e=>[o(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[o(),`github`,`comments`,e,t],githubMergeState:e=>[o(),`github`,`merge-state`,e],get openTargets(){return[o(),`open-targets`]}},X={models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],skillsUpdate:e=>[`workspace`,`skills-update`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:e=>[...X.fsBrowseRoot,e]};function so(e=!0){return M({queryKey:X.models(`codex`),queryFn:({signal:e})=>wi({signal:e}),staleTime:300*1e3,enabled:e})}function co(){let e=j();return M({queryKey:X.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(X.providerStatus),r=await Ti(!1,{signal:t});return pi(n,e.getQueryData(X.providerStatus),r)},refetchInterval:3e4,refetchOnWindowFocus:!0})}function lo(){let e=j();return N({mutationFn:()=>Ti(!0),onMutate:()=>e.getQueryData(X.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(X.providerStatus,e=>pi(r,e,t))})}function uo(){let e=j();return N({mutationFn:({provider:e,authFailureId:t})=>la(e,t),onMutate:()=>e.getQueryData(X.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(X.providerStatus,e=>pi(r,e,t,n.authFailureId))}})}function fo(){return M({queryKey:X.projects,queryFn:({signal:e})=>Di({signal:e})})}function po(e){return M({queryKey:X.fsBrowse(e),queryFn:({signal:t})=>Oi(e??void 0,{signal:t}),retry:!1})}function mo(){let e=j();return N({mutationFn:e=>ua(e),onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function ho(){let e=j();return N({mutationFn:e=>fa(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function go(){let e=j();return N({mutationFn:e=>pa(e.id,{maxParallel:e.maxParallel}),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function _o(){let e=j();return N({mutationFn:e=>da(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:X.projects})})}function vo(){let e=j();(0,k.useEffect)(()=>oo(`health`,t=>{e.setQueryData(Y.health,t)}),[e])}function yo(){return M({queryKey:Y.health,queryFn:({signal:e})=>Ci({signal:e})})}function bo(){return M({queryKey:Y.openTargets,queryFn:({signal:e})=>Da({signal:e}),staleTime:5*6e4})}function xo(){return M({queryKey:Y.runs.list(),queryFn:({signal:e})=>ki({signal:e})})}function So(e,t=!0,n=!1){return M({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Ai(e,{signal:t}),enabled:t})}function Co(e){return M({queryKey:Y.runs.detail(e??``),queryFn:({signal:t})=>ji(e,{signal:t}),enabled:!!e})}function wo(e){return M({queryKey:Y.runs.diff(e??``),queryFn:({signal:t})=>ta(e,{signal:t}),enabled:!!e})}function To(e,t=!1){return M({queryKey:Y.runs.changes(e??``),queryFn:({signal:t})=>ra(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Eo(e,t){return M({queryKey:Y.runs.file(e??``,t??``),queryFn:({signal:n})=>ia(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Do(e){return M({queryKey:Y.groups.detail(e??``),queryFn:({signal:t})=>oa(e,{signal:t}),enabled:!!e})}function Oo(e,t=!1){return M({queryKey:Y.runs.commits(e??``),queryFn:({signal:t})=>qi(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function ko(e,t){return M({queryKey:Y.runs.commit(e??``,t??``),queryFn:({signal:n})=>Ji(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function Ao(e,t=!0){return M({queryKey:Y.runs.handoff(e??``),queryFn:({signal:t})=>na(e,{signal:t}),enabled:!!e&&t})}function jo(e=!0){return M({queryKey:Y.todos,queryFn:({signal:e})=>zi({signal:e}),enabled:e})}function Mo(){return M({queryKey:Y.workflows,queryFn:({signal:e})=>Ni({signal:e})})}function No(e=!0){let t=j(),n=Y.skills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>Pi({signal:e}),enabled:e}),a=M({queryKey:Y.skillsReady,queryFn:({signal:e})=>Fi({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Po(e=!0){let t=j(),n=Y.importableSkills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>Li({signal:e}),enabled:e}),a=M({queryKey:Y.importableSkillsReady,queryFn:({signal:e})=>Ri({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Fo(){return M({queryKey:Y.launchKey,queryFn:({signal:e})=>Ei({signal:e}),staleTime:1/0})}function Io(){return M({queryKey:Y.repo,queryFn:({signal:e})=>Bi({signal:e})})}function Lo(){return M({queryKey:Y.repoChanges,queryFn:({signal:e})=>Gi({signal:e}),retry:!1})}function Ro(e){return M({queryKey:Y.repoCommit(e??``),queryFn:({signal:t})=>Ki(e,{signal:t}),enabled:!!e,retry:!1})}function zo(){return M({queryKey:Y.config,queryFn:({signal:e})=>Vi({signal:e})})}function Bo(){return M({queryKey:Y.worktrees,queryFn:({signal:e})=>Ya({signal:e})})}function Vo(){return M({queryKey:Y.uiState,queryFn:({signal:e})=>Mi({signal:e})})}function Ho(){return M({queryKey:Y.agentConfig,queryFn:({signal:e})=>Hi({signal:e})})}function Uo(e){return M({queryKey:Y.agentConfigFile(e??``),queryFn:({signal:t})=>Ui(e,{signal:t}),enabled:e!==null})}function Wo(e){let t=j(),n=Y.agentConfig,r=Y.agentConfigFile(e);return N({mutationFn:t=>Wi(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Go(){return M({queryKey:X.uiState,queryFn:({signal:e})=>Va({signal:e})})}function Ko(){return M({queryKey:X.config,queryFn:({signal:e})=>Ua({signal:e})})}function qo(e,t=!0){return M({queryKey:X.skillsUpdate(e),queryFn:({signal:t})=>Wa(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return t===void 0||t===`idle`||t===`checking`||t===`updating`?1e4:!1}})}function Jo(e){let t=j();return N({mutationFn:t=>xa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function Yo(e){let t=j();return N({mutationFn:t=>Ma(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all}),onError:e=>{e instanceof G&&e.status===409&&t.invalidateQueries({queryKey:Y.runs.all})}})}function Xo(e){let t=j();return N({mutationFn:({msgId:t,message:n})=>Na(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function Zo(e){let t=j();return N({mutationFn:t=>Pa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:Y.runs.all})})}function Qo(e={},t=!0){return M({queryKey:Y.github(e),queryFn:({signal:t})=>Yi({limit:e.limit},{signal:t}),enabled:t})}function $o(e,t=!0){return M({queryKey:Y.githubChecks(e),queryFn:({signal:t})=>Xi(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function es(e,t,n=!0){return M({queryKey:Y.githubComments(e,t),queryFn:({signal:n})=>Zi(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function ts(e){return M({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>ea(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}var ns=c(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),rs=c(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),is=a(n(),1),as=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,os=r,ss=(e,t)=>n=>{if(t?.variants==null)return os(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=as(t)||as(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return os(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function cs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ls(...e){return t=>{let n=!1,r=e.map(e=>{let r=cs(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():cs(e[t],null)}}}}function us(...e){return k.useCallback(ls(...e),e)}function ds(e){let t=k.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ys(r)&&typeof Cs==`function`&&(r=Cs(r._payload)),k.Children.forEach(r,e=>{if(_s(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ys(n)&&typeof Cs==`function`&&(n=Cs(n._payload)),a=ms(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=k.cloneElement(a,void 0,s):!o&&k.Children.count(r)===1&&k.isValidElement(r)&&(a=r);let c=a?gs(a):void 0,l=us(n,c);if(!a){if(r||r===0)throw Error(o?Ss(e):xs(e));return r}let u=hs(i,a.props??{});return a.type!==k.Fragment&&(u.ref=n?l:c),k.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var fs=ds(`Slot`),ps=Symbol.for(`radix.slottable`),ms=(e,t)=>{if(`child`in e.props){let t=e.props.child;return k.isValidElement(t)?k.cloneElement(t,void 0,e.props.children(t.props.children)):null}return k.isValidElement(t)?t:null};function hs(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 gs(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)}function _s(e){return k.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ps}var vs=Symbol.for(`react.lazy`);function ys(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===vs&&`_payload`in e&&bs(e._payload)}function bs(e){return typeof e==`object`&&!!e&&`then`in e}var xs=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ss=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Cs=k.use,ws=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ds(`Primitive.${t}`),r=k.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ts(e,t){e&&is.flushSync(()=>e.dispatchEvent(t))}function Es(e,t=[]){let n=[];function r(t,r){let i=k.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=k.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=k.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>k.createContext(e));return function(n){let r=n?.[e]||t;return k.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ds(i,...t)]}function Ds(...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 k.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Os(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var Z=globalThis?.document?k.useLayoutEffect:()=>{},ks=k.useInsertionEffect||Z;function As({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=js({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=k.useRef(e!==void 0);k.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,k.useCallback(t=>{if(s){let n=Ms(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function js({defaultProp:e,onChange:t}){let[n,r]=k.useState(e),i=k.useRef(n),a=k.useRef(t);return ks(()=>{a.current=t},[t]),k.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ms(e){return typeof e==`function`}function Ns(e,t){return k.useReducer((e,n)=>t[e][n]??e,e)}var Ps=e=>{let{present:t,children:n}=e,r=Fs(t),i=typeof n==`function`?n({present:r.isPresent}):k.Children.only(n),a=Ls(r.ref,zs(i));return typeof n==`function`||r.isPresent?k.cloneElement(i,{ref:a}):null};Ps.displayName=`Presence`;function Fs(e){let[t,n]=k.useState(),r=k.useRef(null),i=k.useRef(e),a=k.useRef(`none`),o=k.useRef(void 0),[s,c]=Ns(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return k.useEffect(()=>{s===`mounted`?(a.current=o.current??Rs(r.current),o.current=void 0):a.current=`none`},[s]),Z(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Rs(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Z(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Rs(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Rs(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:k.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Rs(t)}else r.current=null;n(e)},[])}}function Is(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ls(...e){let t=k.useRef(e);return t.current=e,k.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Is(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Is(n[e],null)}}},[])}function Rs(e){return e?.animationName||`none`}function zs(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 Bs=k.useId||(()=>void 0),Vs=0;function Hs(e){let[t,n]=k.useState(Bs());return Z(()=>{e||n(e=>e??String(Vs++))},[e]),e||(t?`radix-${t}`:``)}function Us(e){let t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Ws=`DismissableLayer`,Gs=`dismissableLayer.update`,Ks=`dismissableLayer.pointerDownOutside`,qs=`dismissableLayer.focusOutside`,Js,Ys=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xs=k.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=k.useContext(Ys),[d,f]=k.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=k.useState({}),h=us(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=k.useRef(!1),C=tc(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=nc(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Us(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return k.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),k.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Js=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),rc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Js))}},[d,p,n,u]),k.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),rc())},[d,u]),k.useEffect(()=>{let e=()=>m({});return document.addEventListener(Gs,e),()=>document.removeEventListener(Gs,e)},[]),(0,A.jsx)(ws.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Os(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Os(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Os(e.onPointerDownCapture,C.onPointerDownCapture)})});Xs.displayName=Ws;var Zs=`DismissableLayerBranch`,Qs=k.forwardRef((e,t)=>{let n=k.useContext(Ys),r=k.useRef(null),i=us(t,r);return k.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,A.jsx)(ws.div,{...e,ref:i})});Qs.displayName=Zs;function $s(){let e=k.useContext(Ys),[t,n]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ec=()=>!0;function tc(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ec}=t,s=Us(e),c=k.useRef(!1),l=k.useRef(!1),u=k.useRef(new Map),d=k.useRef(()=>{});return k.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ic(Ks,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function nc(e,t=globalThis?.document){let n=Us(e),r=k.useRef(!1);return k.useEffect(()=>{let e=e=>{e.target&&!r.current&&ic(qs,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 rc(){let e=new CustomEvent(Gs);document.dispatchEvent(e)}function ic(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?Ts(i,a):i.dispatchEvent(a)}var ac=`focusScope.autoFocusOnMount`,oc=`focusScope.autoFocusOnUnmount`,sc={bubbles:!1,cancelable:!0},cc=`FocusScope`,lc=k.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=k.useState(null),l=Us(i),u=Us(a),d=k.useRef(null),f=us(t,c),p=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Q(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]),k.useEffect(()=>{if(s){gc.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ac,sc);s.addEventListener(ac,l),s.dispatchEvent(t),t.defaultPrevented||(uc(yc(fc(s)),{select:!0}),document.activeElement===e&&Q(s))}return()=>{s.removeEventListener(ac,l),setTimeout(()=>{let t=new CustomEvent(oc,sc);s.addEventListener(oc,u),s.dispatchEvent(t),t.defaultPrevented||Q(e??document.body,{select:!0}),s.removeEventListener(oc,u),gc.remove(p)},0)}}},[s,l,u,p]);let m=k.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]=dc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,A.jsx)(ws.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});lc.displayName=cc;function uc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function dc(e){let t=fc(e);return[pc(t,e),pc(t.reverse(),e)]}function fc(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 pc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):mc(r,{upTo:t})))return r}function mc(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 hc(e){return e instanceof HTMLInputElement&&`select`in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hc(e)&&t&&e.select()}}var gc=_c();function _c(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=vc(e,t),e.unshift(t)},remove(t){e=vc(e,t),e[0]?.resume()}}}function vc(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yc(e){return e.filter(e=>e.tagName!==`A`)}var bc=`Portal`,xc=k.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=k.useState(!1);Z(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?is.createPortal((0,A.jsx)(ws.div,{...r,ref:t}),o):null});xc.displayName=bc;var Sc=0,Cc=null;function wc(){k.useEffect(()=>{Cc||={start:Tc(),end:Tc()};let{start:e,end:t}=Cc;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Sc++,()=>{Sc===1&&(Cc?.start.remove(),Cc?.end.remove(),Cc=null),Sc=Math.max(0,Sc-1)}},[])}function Tc(){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 $=function(){return $=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},$.apply(this,arguments)};function Ec(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 Dc(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 Oc=`right-scroll-bar-position`,kc=`width-before-scroll-bar`,Ac=`with-scroll-bars-hidden`,jc=`--removed-body-scroll-bar-size`;function Mc(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Nc(e,t){var n=(0,k.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 Pc=typeof window<`u`?k.useLayoutEffect:k.useEffect,Fc=new WeakMap;function Ic(e,t){var n=Nc(t||null,function(t){return e.forEach(function(e){return Mc(e,t)})});return Pc(function(){var t=Fc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Mc(e,null)}),i.forEach(function(e){r.has(e)||Mc(e,a)})}Fc.set(n,e)},[e]),n}function Lc(e){return e}function Rc(e,t){t===void 0&&(t=Lc);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 zc(e){e===void 0&&(e={});var t=Rc(null);return t.options=$({async:!0,ssr:!1},e),t}var Bc=function(e){var t=e.sideCar,n=Ec(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 k.createElement(r,$({},n))};Bc.isSideCarExport=!0;function Vc(e,t){return e.useMedium(t),Bc}var Hc=zc(),Uc=function(){},Wc=k.forwardRef(function(e,t){var n=k.useRef(null),r=k.useState({onScrollCapture:Uc,onWheelCapture:Uc,onTouchMoveCapture:Uc}),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=Ec(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ic([n,t]),C=$($({},b),i);return k.createElement(k.Fragment,null,u&&k.createElement(x,{sideCar:Hc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?k.cloneElement(k.Children.only(s),$($({},C),{ref:S})):k.createElement(v,$({},C,{className:c,ref:S}),s))});Wc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wc.classNames={fullWidth:kc,zeroRight:Oc};var Gc,Kc=function(){if(Gc)return Gc;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kc();return t&&e.setAttribute(`nonce`,t),e}function Jc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qc())&&(Jc(t,n),Yc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zc=function(){var e=Xc();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qc=function(){var e=Zc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$c={left:0,top:0,right:0,gap:0},el=function(e){return parseInt(e||``,10)||0},tl=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[el(n),el(r),el(i)]},nl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $c;var t=tl(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])}},rl=Qc(),il=`data-scroll-locked`,al=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=U(),d;if(t){let e=typeof t==`string`?I(t):t;P(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):pt(e,{pathname:p});F(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),F(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=jn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:R([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:R([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?k.createElement(sn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Tn(){let e=Bn(),t=Kt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=k.createElement(k.Fragment,null,k.createElement(`p`,null,`💿 Hey developer 👋`),k.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,k.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,k.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),k.createElement(k.Fragment,null,k.createElement(`h2`,null,`Unexpected Application Error!`),k.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?k.createElement(`pre`,{style:i},n):null,o)}var En=k.createElement(Tn,null),Dn=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=pn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:k.createElement(V.Provider,{value:this.props.routeContext},k.createElement(cn.Provider,{value:e,children:this.props.component}));return this.context?k.createElement(kn,{error:e},t):t}};Dn.contextType=tn;var On=new WeakMap;function kn({children:e,error:t}){let{basename:n}=k.useContext(B);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=fn(t.digest);if(e){let r=On.get(t);if(r)throw r;let i=Yt(e.location,n),a=i.absoluteURL||i.to;if($t(a))throw Error(`Invalid redirect location`);if(Jt&&!On.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw On.set(t,n),n}return k.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function An({routeContext:e,match:t,children:n}){let r=k.useContext(z);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(V.Provider,{value:e},n)}function jn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:qt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||En,o&&(s<0&&c===0?(Un(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?k.createElement(n.route.Component,null):n.route.element?n.route.element:e,k.createElement(An,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?k.createElement(Dn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nn(e){let t=k.useContext(z);return P(t,Mn(e)),t}function Pn(e){let t=k.useContext(en);return P(t,Mn(e)),t}function Fn(e){let t=k.useContext(V);return P(t,Mn(e)),t}function In(e){let t=Fn(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ln(){return In(`useRouteId`)}function Rn(){let e=Pn(`useNavigation`);return k.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function zn(){let{matches:e,loaderData:t}=Pn(`useMatches`);return k.useMemo(()=>e.map(e=>ht(e,t)),[e,t])}function Bn(){let e=k.useContext(cn),t=Pn(`useRouteError`),n=In(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Vn(){let{router:e}=Nn(`useNavigate`),t=In(`useNavigate`),n=k.useRef(!1);return gn(()=>{n.current=!0}),k.useCallback(async(r,i={})=>{F(n.current,hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Hn={};function Un(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,F(!1,n))}k.memo(Wn);function Wn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return wn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Gn({to:e,replace:t,state:n,relative:r}){P(H(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=k.useContext(B);F(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=k.useContext(V),{pathname:o}=U(),s=_n(),c=zt(e,Rt(a),o,r===`path`),l=JSON.stringify(c);return k.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Kn(e){return bn(e.context)}function qn(e){P(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Jn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!H(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=k.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=k.useMemo(()=>{let e=L(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return F(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:k.createElement(B.Provider,{value:c},k.createElement(sn.Provider,{children:t,value:h}))}function Yn({children:e,location:t}){return Cn(Xn(e),t)}k.Component;function Xn(e,t=[]){let n=[];return k.Children.forEach(e,(e,r)=>{if(!k.isValidElement(e))return;let i=[...t,r];if(e.type===k.Fragment){n.push.apply(n,Xn(e.props.children,i));return}P(e.type===qn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Xn(e.props.children,i)),n.push(a)}),n}var Zn=`get`,Qn=`application/x-www-form-urlencoded`;function $n(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function er(e){return $n(e)&&e.tagName.toLowerCase()===`button`}function tr(e){return $n(e)&&e.tagName.toLowerCase()===`form`}function nr(e){return $n(e)&&e.tagName.toLowerCase()===`input`}function rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e,t){return e.button===0&&(!t||t===`_self`)&&!rr(e)}function ar(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function or(e,t){let n=ar(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var sr=null;function cr(){if(sr===null)try{new FormData(document.createElement(`form`),0),sr=!1}catch{sr=!0}return sr}var lr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ur(e){return e!=null&&!lr.has(e)?(F(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qn}"`),null):e}function dr(e,t){let n,r,i,a,o;if(tr(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`enctype`))||Qn,a=new FormData(e)}else if(er(e)||nr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`formenctype`))||ur(o.getAttribute(`enctype`))||Qn,a=new FormData(o,e),!cr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if($n(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Zn,r=null,i=Qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},pr=/[&><\u2028\u2029]/g;function mr(e){return e.replace(pr,e=>fr[e])}function hr(e,t){if(e===!1||e==null)throw Error(t)}function gr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&L(i.pathname,t)===`/`?i.pathname=`${Vt(t)}/_root.${r}`:i.pathname=`${Vt(i.pathname)}.${r}`,i}async function _r(e,n){if(e.id in n)return n[e.id];try{let r=await t(()=>import(e.module),[]);return n[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vr(e){return e!=null&&typeof e.page==`string`}function yr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function br(e,t,n){return Tr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await _r(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(yr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function xr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Sr(e,t,{includeHydrateFallback:n}={}){return Cr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Cr(e){return[...new Set(e)]}function wr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Tr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!vr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(wr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Er(){let e=k.useContext(z);return hr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Dr(){let e=k.useContext(en);return hr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Or=k.createContext(void 0);Or.displayName=`FrameworkContext`;function kr(){let e=k.useContext(Or);return hr(e,`You must render this element inside a <HydratedRouter> element`),e}function Ar(e,t){let n=k.useContext(Or),[r,i]=k.useState(!1),[a,o]=k.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=k.useRef(null);k.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),k.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:jr(s,p),onBlur:jr(c,m),onMouseEnter:jr(l,p),onMouseLeave:jr(u,m),onTouchStart:jr(d,p)}]:[a,f,{}]:[!1,f,{}]}function jr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Mr({page:e,...t}){let n=nn(),{nonce:r}=kr(),{router:i}=Er(),a=k.useMemo(()=>pt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?k.createElement(Pr,{page:e,matches:a,...t}):k.createElement(Fr,{page:e,matches:a,...t})):null}function Nr(e){let{manifest:t,routeModules:n}=kr(),[r,i]=k.useState([]);return k.useEffect(()=>{let r=!1;return br(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Pr({page:e,matches:t,...n}){let r=U(),{future:i}=kr(),{basename:a}=Er(),o=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=gr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return k.createElement(k.Fragment,null,o.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Fr({page:e,matches:t,...n}){let r=U(),{future:i,manifest:a,routeModules:o}=kr(),{basename:s}=Er(),{loaderData:c,matches:l}=Dr(),u=k.useMemo(()=>xr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=k.useMemo(()=>xr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=gr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=k.useMemo(()=>Sr(d,a),[d,a]),m=Nr(d);return k.createElement(k.Fragment,null,f.map(e=>k.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>k.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>k.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ir(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}k.Component;var Lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Lr&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Rr({basename:e,children:t,useTransitions:n,window:r}){let i=k.useRef();i.current??=ot({window:r,v5Compat:!0});let a=i.current,[o,s]=k.useState({action:a.action,location:a.location}),c=k.useCallback(e=>{n===!1?s(e):k.startTransition(()=>s(e))},[n]);return k.useLayoutEffect(()=>a.listen(c),[a,c]),k.createElement(Jn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function zr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=k.useState({action:n.action,location:n.location}),o=k.useCallback(e=>{r===!1?a(e):k.startTransition(()=>a(e))},[r]);return k.useLayoutEffect(()=>n.listen(o),[n,o]),k.createElement(Jn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}zr.displayName=`unstable_HistoryRouter`;var Br=k.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=k.useContext(B),v=typeof l==`string`&&tt.test(l),y=Yt(l,h);l=y.to;let b=mn(l,{relative:r}),x=U(),S=null;if(o){let e=zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:R([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Ar(n,p),E=qr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ee(t){e&&e(t),t.defaultPrevented||E(t)}let te=!(y.isExternal||i),D=k.createElement(`a`,{...p,...T,href:(te?S:void 0)||y.absoluteURL||b,onClick:te?ee:e,ref:Ir(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?k.createElement(k.Fragment,null,D,k.createElement(Mr,{page:b})):D});Br.displayName=`Link`;var Vr=k.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Sn(a,{relative:c.relative}),d=U(),f=k.useContext(en),{navigator:p,basename:m}=k.useContext(B),h=f!=null&&ii(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=L(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return k.createElement(Br,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Vr.displayName=`NavLink`;var Hr=k.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Zn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=k.useContext(B),g=Zr(),_=Qr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&tt.test(s);return k.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?k.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Hr.displayName=`Form`;function Ur({getKey:e,storageKey:t,...n}){let r=k.useContext(Or),{basename:i}=k.useContext(B),a=U(),o=zn();ni({getKey:e,storageKey:t});let s=k.useMemo(()=>{if(!r||!e)return null;let t=ti(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),k.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${mr(JSON.stringify(t||$r))}, ${mr(JSON.stringify(s))})`}})}Ur.displayName=`ScrollRestoration`;function Wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gr(e){let t=k.useContext(z);return P(t,Wr(e)),t}function Kr(e){let t=k.useContext(en);return P(t,Wr(e)),t}function qr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_n(),d=U(),f=Sn(e,{relative:o});return k.useCallback(p=>{if(ir(p,t)){p.preventDefault();let t=n===void 0?ut(d)===ut(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?k.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Jr(e){F(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=k.useRef(ar(e)),n=k.useRef(!1),r=U(),i=k.useMemo(()=>or(r.search,n.current?null:t.current),[r.search]),a=_n();return[i,k.useCallback((e,t)=>{let r=ar(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Yr=0,Xr=()=>`__${String(++Yr)}__`;function Zr(){let{router:e}=Gr(`useSubmit`),{basename:t}=k.useContext(B),n=Ln(),r=e.fetch,i=e.navigate;return k.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=dr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Xr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Qr(e,{relative:t}={}){let{basename:n}=k.useContext(B),r=k.useContext(V);P(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Sn(e||`.`,{relative:t})},o=U();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:R([n,a.pathname])),ut(a)}var $r=`react-router-scroll-positions`,ei={};function ti(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:L(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ni({getKey:e,storageKey:t}={}){let{router:n}=Gr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Kr(`useScrollRestoration`),{basename:a}=k.useContext(B),o=U(),s=zn(),c=Rn();k.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ri(k.useCallback(()=>{if(c.state===`idle`){let t=ti(o,s,a,e);ei[t]=window.scrollY}try{sessionStorage.setItem(t||$r,JSON.stringify(ei))}catch(e){F(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(k.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||$r);e&&(ei=JSON.parse(e))}catch{}},[t]),k.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ei,()=>window.scrollY,e?(t,n)=>ti(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),k.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{F(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ri(e,t){let{capture:n}=t||{};k.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ii(e,{relative:t}={}){let n=k.useContext(rn);P(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Gr(`useViewTransitionState`),i=Sn(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return At(i.pathname,o)!=null||At(i.pathname,a)!=null}var ai=[`claude`,`codex`,`opencode`],oi=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function si(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ci(e,t){if(!si(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!ai.includes(n)||typeof r!=`string`||!oi.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function li(e){return ci(e,!1)}function ui(e,t){if(!si(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=ci(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function W(e){let t=ui(e,!0);if(t===null||t.length!==ai.length)return null;let n=new Map(t.map(e=>[e.provider,e]));return ai.some(e=>!n.has(e))?null:ai.map(e=>n.get(e))}function di(e){let t=W(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function fi(e,t){let n=W(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function pi(e,t,n,r){let i=W(e),a=W(t),o=W(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:mi(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function mi(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function hi(e){let t=W(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&e.status===`connected`).map(e=>e.provider));return ai.filter(e=>n.has(e))}function gi(e,t){return W(e)?.find(e=>e.provider===t)}var _i=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function vi(e){try{return JSON.parse(e)}catch{return}}function yi(e){return typeof e==`string`?e:void 0}function bi(e,t,n){let r=vi(n),i=r&&typeof r==`object`?r:{};return new _i(e,yi(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:yi(i.manual),command:yi(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}async function xi(e,t){try{return await fetch(s(e),{...t,credentials:`include`})}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new _i(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function Si(e,t={}){let n=await xi(e,t),r=await n.text();if(!n.ok)throw bi(n.status,n.statusText,r);let i=vi(r);if(i===void 0)throw new _i(n.status,`the cezar server answered ${e} with a non-JSON body`);return i}async function Ci(e,t={}){let n=await xi(e,t),r=await n.text();if(!n.ok)throw bi(n.status,n.statusText,r);return r}function G(e,t={}){return Si(e,{method:`GET`,signal:t.signal})}function K(e,t,n){return Si(t,{method:e,...n===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(n)}})}var q=(e,t=``)=>`/api/runs/${encodeURIComponent(e)}${t}`;function wi(e){return G(`/api/health`,e)}function Ti(e){return G(`/api/models?runner=codex`,e)}function Ei(e=!1,t){return G(`/api/providers/status${e?`?refresh=1`:``}`,t).then(di)}function Di(e){return G(`/api/launch-key`,e)}function Oi(e){return G(`/api/projects`,e)}function ki(e,t){return G(`/api/fs/browse${e===void 0||e===``?``:`?path=${encodeURIComponent(e)}`}`,t)}function Ai(e){return G(`/api/runs`,e)}function ji(e,t){return G(`/api/p/${encodeURIComponent(e)}/runs`,t)}function Mi(e,t){return G(q(e),t)}function Ni(e){return G(`/api/ui-state`,e)}function Pi(e){return G(`/api/workflows`,e)}function Fi(e){return G(`/api/skills`,e)}function Ii(e){return G(`/api/skills?wait=1`,e)}function Li(){return K(`POST`,`/api/skills/refresh`)}function Ri(e){return G(`/api/skills/importable`,e)}function zi(e){return G(`/api/skills/importable?wait=1`,e)}function Bi(e){return G(`/api/todos`,e)}function Vi(e){return G(`/api/repo`,e)}function Hi(e){return G(`/api/config`,e)}function Ui(e={}){return G(`/api/agent-config`,e)}function Wi(e,t={}){return G(`/api/agent-config/${encodeURIComponent(e)}`,t)}function Gi(e,t){return K(`PUT`,`/api/agent-config/${encodeURIComponent(e)}`,t)}function Ki(e){return G(`/api/repo/changes`,e)}function qi(e,t){return G(`/api/repo/commit/${encodeURIComponent(e)}?structured=1`,t)}function Ji(e,t){return G(q(e,`/commits`),t)}function Yi(e,t,n){return G(q(e,`/commit/${encodeURIComponent(t)}`),n)}function Xi(e={},t){let n=new URLSearchParams;e.limit!==void 0&&n.set(`limit`,String(e.limit)),e.refresh&&n.set(`refresh`,`1`);let r=n.toString();return G(`/api/github${r?`?${r}`:``}`,t)}function Zi(e,t){return G(`/api/github/checks?${new URLSearchParams({prs:e.join(`,`)}).toString()}`,t)}function Qi(e,t,n={},r){return G(`/api/github/comments/${e}/${t}${n.refresh?`?refresh=1`:``}`,r)}function $i(e,t={},n){return G(`/api/github/prs/${e}/merge-state${t.refresh?`?refresh=1`:``}`,n)}function ea(e,t){return K(`POST`,`/api/github/prs/${e}/merge`,t)}function ta(e,t={},n){return G(`/api/github/prs/${e}/changes${t.refresh?`?refresh=1`:``}`,n)}function na(e,t){return Ci(q(e,`/diff`),{method:`GET`,signal:t?.signal})}function ra(e,t){return Ci(q(e,`/handoff`),{method:`GET`,signal:t?.signal})}function ia(e,t){return G(q(e,`/changes`),t)}function aa(e,t,n){return G(q(e,`/files?path=${encodeURIComponent(t)}`),n)}function oa(e,t){return s(q(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}function sa(e,t){return G(`/api/groups/${encodeURIComponent(e)}`,t)}function ca(e){return K(`POST`,`/api/providers/connect`,{provider:e})}function la(e,t){return K(`PUT`,`/api/providers/${encodeURIComponent(e)}/enabled`,{enabled:t}).then(di)}function ua(e,t){return K(`POST`,`/api/providers/${encodeURIComponent(e)}/retry`,{authFailureId:t}).then(di)}async function da(e){let t=`/api/projects`,n=await xi(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=vi(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new _i(n.status,`the cezar server answered ${t} without a project`):bi(n.status,n.statusText,r)}function fa(e){return K(`POST`,`/api/projects/checkout`,e)}function pa(e){return K(`DELETE`,`/api/projects/${encodeURIComponent(e)}`)}function ma(e,t){return K(`PATCH`,`/api/projects/${encodeURIComponent(e)}`,t)}function ha(e){return K(`POST`,`/api/runs`,e)}function ga(e){return K(`POST`,q(e,`/cancel`))}function _a(e,t=!0){return K(`POST`,q(e,`/archive`),{archived:t})}function va(){return K(`POST`,`/api/runs/archive-finished`)}function ya(e){return K(`POST`,q(e,`/finish`))}function ba(e,t={}){let n={};return t.text!==void 0&&(n.text=t.text),t.images!==void 0&&(n.images=t.images),t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),K(`POST`,q(e,`/continue`),n)}function xa(e){return K(`POST`,q(e,`/pr`))}function Sa(e,t){return K(`PATCH`,q(e),t)}function Ca(e){return K(`DELETE`,q(e))}function wa(e){return K(`DELETE`,`/api/todos/${encodeURIComponent(e)}`)}function Ta(e,t={}){let n={};return t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),t.prompt!==void 0&&(n.prompt=t.prompt),K(`POST`,`/api/todos/${encodeURIComponent(e)}/start`,Object.keys(n).length>0?n:void 0)}function Ea(e,t){return K(`POST`,`/api/groups/${encodeURIComponent(e)}/pick`,{runId:t})}function Da(e){return K(`POST`,q(e,`/open-in-cli`))}function Oa(e){return G(`/api/open-targets`,e)}function ka(e,t){return K(`POST`,q(e,`/open-in`),{target:t})}function Aa(e,t){return K(`POST`,q(e,`/open-in`),{target:`default`,path:t})}function ja(e,t){return K(`POST`,q(e,`/git/commit`),{message:t})}function Ma(e){return K(`POST`,q(e,`/git/push`))}function Na(e,t){return K(`POST`,q(e,`/messages`),{text:t.text??``,images:t.images??[]})}function Pa(e,t,n){return K(`PATCH`,q(e,`/queued-messages/${encodeURIComponent(t)}`),n)}function Fa(e,t){return K(`DELETE`,q(e,`/queued-messages/${encodeURIComponent(t)}`))}function Ia(e){return K(`POST`,`/api/repo/branch`,e)}function La(e){return K(`POST`,`/api/plan`,{task:e})}function Ra(e){return K(`POST`,`/api/workflows`,e)}function za(e){return K(`POST`,`/api/workflows/parse`,{yaml:e})}function Ba(e){return K(`DELETE`,`/api/workflows/${encodeURIComponent(e)}`)}function Va(e){return K(`PUT`,`/api/ui-state`,e)}function Ha(e){return G(`/api/workspace/ui-state`,e)}function Ua(e){return K(`PUT`,`/api/workspace/ui-state`,e)}function Wa(e){return G(`/api/workspace/config`,e)}function Ga(e,t){return G(`/api/workspace/skills-update?projectId=${encodeURIComponent(e)}`,t)}function Ka(e){return K(`POST`,`/api/workspace/skills-update/check`,{projectId:e})}function qa(e){return K(`POST`,`/api/workspace/skills-update/apply`,{projectId:e})}function Ja(e){return K(`PUT`,`/api/workspace/config`,e)}function Ya(e){return K(`PUT`,`/api/config`,e)}function Xa(e){return G(`/api/worktrees`,e)}function Za(){return K(`POST`,`/api/worktrees/reclaim`,{})}function Qa(e){return K(`POST`,q(e,`/remove-worktree`))}var $a=`/api/ws`,eo=3e3,to=1e3,no=7e4,ro=0,io=1;function ao(e){let t=new Map,n=null,r,i,a,o=()=>{clearTimeout(a),a=setTimeout(()=>{a=void 0,n?.close()},no)},s=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${$a}`,c=e=>{n?.readyState===io&&n.send(JSON.stringify(e))},l=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||n&&(n.readyState===ro||n.readyState===io))return;let i=new e(s());n=i,i.addEventListener(`open`,()=>{if(i===n){o();for(let e of t.keys())c({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==n)return;o();let r;try{r=JSON.parse(e.data)}catch{return}if(typeof r!=`object`||!r)return;let{type:a,topic:s,data:c}=r;if(a!==`event`||typeof s!=`string`)return;let l=t.get(s);if(l)for(let e of[...l])e(c)}),i.addEventListener(`close`,()=>{i===n&&(n=null,clearTimeout(a),a=void 0,t.size>0&&r===void 0&&(r=setTimeout(()=>{r=void 0,t.size>0&&l()},eo)))}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,o){let s=t.get(e);s||(s=new Set,t.set(e,s));let u=s.size===0;s.add(o),clearTimeout(i),i=void 0,n?u&&c({type:`subscribe`,topic:e}):(clearTimeout(r),r=void 0,l());let d=!0;return()=>{d&&(d=!1,s.delete(o),!(s.size>0)&&(t.delete(e),c({type:`unsubscribe`,topic:e}),t.size===0&&i===void 0&&(i=setTimeout(()=>{i=void 0,!(t.size>0)&&(clearTimeout(r),r=void 0,clearTimeout(a),a=void 0,n?.close(),n=null)},to))))}}}}var oo=null;function so(e,t){return oo??=ao(),oo.subscribe(e,t)}var J={get health(){return[o(),`health`]},runs:{get all(){return[o(),`runs`]},list:()=>[o(),`runs`,`list`],detail:e=>[o(),`runs`,`detail`,e],diff:e=>[o(),`runs`,`diff`,e],changes:e=>[o(),`runs`,`changes`,e],file:(e,t)=>[o(),`runs`,`files`,e,t],handoff:e=>[o(),`runs`,`handoff`,e],commits:e=>[o(),`runs`,`commits`,e],commit:(e,t)=>[o(),`runs`,`commit`,e,t]},groups:{detail:e=>[o(),`groups`,e]},get todos(){return[o(),`todos`]},get workflows(){return[o(),`workflows`]},get skills(){return[o(),`skills`]},get skillsReady(){return[o(),`skills`,`ready`]},get importableSkills(){return[o(),`skills`,`importable`]},get importableSkillsReady(){return[o(),`skills`,`importable`,`ready`]},get launchKey(){return[o(),`launch-key`]},get repo(){return[o(),`repo`]},get repoChanges(){return[o(),`repo`,`changes`]},repoCommit:e=>[o(),`repo`,`commit`,e],get uiState(){return[o(),`ui-state`]},get config(){return[o(),`config`]},get agentConfig(){return[o(),`agent-config`]},agentConfigFile:e=>[o(),`agent-config`,`file`,e],get worktrees(){return[o(),`worktrees`]},github:(e={})=>[o(),`github`,e.limit??null],githubChecks:e=>[o(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[o(),`github`,`comments`,e,t],githubMergeState:e=>[o(),`github`,`merge-state`,e],get openTargets(){return[o(),`open-targets`]}},Y={models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],skillsUpdate:e=>[`workspace`,`skills-update`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:e=>[...Y.fsBrowseRoot,e]};function co(e=!0){return M({queryKey:Y.models(`codex`),queryFn:({signal:e})=>Ti({signal:e}),staleTime:300*1e3,enabled:e})}function lo(){let e=j();return M({queryKey:Y.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Y.providerStatus),r=await Ei(!1,{signal:t});return pi(n,e.getQueryData(Y.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function uo(){let e=j();return N({mutationFn:()=>Ei(!0),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Y.providerStatus,e=>pi(r,e,t))})}function fo(){let e=j();return N({mutationFn:({provider:e,authFailureId:t})=>ua(e,t),onMutate:()=>e.getQueryData(Y.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Y.providerStatus,e=>pi(r,e,t,n.authFailureId))}})}function po(){return M({queryKey:Y.projects,queryFn:({signal:e})=>Oi({signal:e})})}function mo(e){return M({queryKey:Y.fsBrowse(e),queryFn:({signal:t})=>ki(e??void 0,{signal:t}),retry:!1})}function ho(){let e=j();return N({mutationFn:e=>da(e),onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function go(){let e=j();return N({mutationFn:e=>pa(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function _o(){let e=j();return N({mutationFn:e=>ma(e.id,{maxParallel:e.maxParallel}),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function vo(){let e=j();return N({mutationFn:e=>fa(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Y.projects})})}function yo(){let e=j();(0,k.useEffect)(()=>so(`health`,t=>{e.setQueryData(J.health,t)}),[e])}function bo(){return M({queryKey:J.health,queryFn:({signal:e})=>wi({signal:e})})}function xo(){return M({queryKey:J.openTargets,queryFn:({signal:e})=>Oa({signal:e}),staleTime:5*6e4})}function So(){return M({queryKey:J.runs.list(),queryFn:({signal:e})=>Ai({signal:e})})}function Co(e,t=!0,n=!1){return M({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>ji(e,{signal:t}),enabled:t})}function wo(e){return M({queryKey:J.runs.detail(e??``),queryFn:({signal:t})=>Mi(e,{signal:t}),enabled:!!e})}function To(e){return M({queryKey:J.runs.diff(e??``),queryFn:({signal:t})=>na(e,{signal:t}),enabled:!!e})}function Eo(e,t=!1){return M({queryKey:J.runs.changes(e??``),queryFn:({signal:t})=>ia(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Do(e,t){return M({queryKey:J.runs.file(e??``,t??``),queryFn:({signal:n})=>aa(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Oo(e){return M({queryKey:J.groups.detail(e??``),queryFn:({signal:t})=>sa(e,{signal:t}),enabled:!!e})}function ko(e,t=!1){return M({queryKey:J.runs.commits(e??``),queryFn:({signal:t})=>Ji(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Ao(e,t){return M({queryKey:J.runs.commit(e??``,t??``),queryFn:({signal:n})=>Yi(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function jo(e,t=!0){return M({queryKey:J.runs.handoff(e??``),queryFn:({signal:t})=>ra(e,{signal:t}),enabled:!!e&&t})}function Mo(e=!0){return M({queryKey:J.todos,queryFn:({signal:e})=>Bi({signal:e}),enabled:e})}function No(){return M({queryKey:J.workflows,queryFn:({signal:e})=>Pi({signal:e})})}function Po(e=!0){let t=j(),n=J.skills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>Fi({signal:e}),enabled:e}),a=M({queryKey:J.skillsReady,queryFn:({signal:e})=>Ii({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Fo(e=!0){let t=j(),n=J.importableSkills,r=n[0],i=M({queryKey:n,queryFn:({signal:e})=>Ri({signal:e}),enabled:e}),a=M({queryKey:J.importableSkillsReady,queryFn:({signal:e})=>zi({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,k.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Io(){return M({queryKey:J.launchKey,queryFn:({signal:e})=>Di({signal:e}),staleTime:1/0})}function Lo(){return M({queryKey:J.repo,queryFn:({signal:e})=>Vi({signal:e})})}function Ro(){return M({queryKey:J.repoChanges,queryFn:({signal:e})=>Ki({signal:e}),retry:!1})}function zo(e){return M({queryKey:J.repoCommit(e??``),queryFn:({signal:t})=>qi(e,{signal:t}),enabled:!!e,retry:!1})}function Bo(){return M({queryKey:J.config,queryFn:({signal:e})=>Hi({signal:e})})}function Vo(){return M({queryKey:J.worktrees,queryFn:({signal:e})=>Xa({signal:e})})}function Ho(){return M({queryKey:J.uiState,queryFn:({signal:e})=>Ni({signal:e})})}function Uo(){return M({queryKey:J.agentConfig,queryFn:({signal:e})=>Ui({signal:e})})}function Wo(e){return M({queryKey:J.agentConfigFile(e??``),queryFn:({signal:t})=>Wi(e,{signal:t}),enabled:e!==null})}function Go(e){let t=j(),n=J.agentConfig,r=J.agentConfigFile(e);return N({mutationFn:t=>Gi(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Ko(){return M({queryKey:Y.uiState,queryFn:({signal:e})=>Ha({signal:e})})}function qo(){return M({queryKey:Y.config,queryFn:({signal:e})=>Wa({signal:e})})}function Jo(e,t=!0){return M({queryKey:Y.skillsUpdate(e),queryFn:({signal:t})=>Ga(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return t===void 0||t===`idle`||t===`checking`||t===`updating`?6e4:!1}})}function Yo(e){let t=j();return N({mutationFn:t=>Sa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Xo(e){let t=j();return N({mutationFn:t=>Na(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Zo(e){let t=j();return N({mutationFn:({msgId:t,message:n})=>Pa(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function Qo(e){let t=j();return N({mutationFn:t=>Fa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:J.runs.all})})}function $o(e={},t=!0){return M({queryKey:J.github(e),queryFn:({signal:t})=>Xi({limit:e.limit},{signal:t}),enabled:t})}function es(e,t=!0){return M({queryKey:J.githubChecks(e),queryFn:({signal:t})=>Zi(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function ts(e,t,n=!0){return M({queryKey:J.githubComments(e,t),queryFn:({signal:n})=>Qi(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function ns(e){return M({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>ta(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}var rs=c(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),is=c(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),as=a(n(),1),os=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ss=r,cs=(e,t)=>n=>{if(t?.variants==null)return ss(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=os(t)||os(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ss(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function ls(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function us(...e){return t=>{let n=!1,r=e.map(e=>{let r=ls(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():ls(e[t],null)}}}}function ds(...e){return k.useCallback(us(...e),e)}function fs(e){let t=k.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];bs(r)&&typeof ws==`function`&&(r=ws(r._payload)),k.Children.forEach(r,e=>{if(vs(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;bs(n)&&typeof ws==`function`&&(n=ws(n._payload)),a=hs(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=k.cloneElement(a,void 0,s):!o&&k.Children.count(r)===1&&k.isValidElement(r)&&(a=r);let c=a?_s(a):void 0,l=ds(n,c);if(!a){if(r||r===0)throw Error(o?Cs(e):Ss(e));return r}let u=gs(i,a.props??{});return a.type!==k.Fragment&&(u.ref=n?l:c),k.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var ps=fs(`Slot`),ms=Symbol.for(`radix.slottable`),hs=(e,t)=>{if(`child`in e.props){let t=e.props.child;return k.isValidElement(t)?k.cloneElement(t,void 0,e.props.children(t.props.children)):null}return k.isValidElement(t)?t:null};function gs(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 _s(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)}function vs(e){return k.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ms}var ys=Symbol.for(`react.lazy`);function bs(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ys&&`_payload`in e&&xs(e._payload)}function xs(e){return typeof e==`object`&&!!e&&`then`in e}var Ss=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Cs=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,ws=k.use,Ts=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=fs(`Primitive.${t}`),r=k.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Es(e,t){e&&as.flushSync(()=>e.dispatchEvent(t))}function Ds(e,t=[]){let n=[];function r(t,r){let i=k.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=k.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=k.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>k.createContext(e));return function(n){let r=n?.[e]||t;return k.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Os(i,...t)]}function Os(...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 k.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function ks(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var X=globalThis?.document?k.useLayoutEffect:()=>{},As=k.useInsertionEffect||X;function js({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ms({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=k.useRef(e!==void 0);k.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,k.useCallback(t=>{if(s){let n=Ns(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ms({defaultProp:e,onChange:t}){let[n,r]=k.useState(e),i=k.useRef(n),a=k.useRef(t);return As(()=>{a.current=t},[t]),k.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ns(e){return typeof e==`function`}function Ps(e,t){return k.useReducer((e,n)=>t[e][n]??e,e)}var Fs=e=>{let{present:t,children:n}=e,r=Is(t),i=typeof n==`function`?n({present:r.isPresent}):k.Children.only(n),a=Rs(r.ref,Bs(i));return typeof n==`function`||r.isPresent?k.cloneElement(i,{ref:a}):null};Fs.displayName=`Presence`;function Is(e){let[t,n]=k.useState(),r=k.useRef(null),i=k.useRef(e),a=k.useRef(`none`),o=k.useRef(void 0),[s,c]=Ps(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return k.useEffect(()=>{s===`mounted`?(a.current=o.current??zs(r.current),o.current=void 0):a.current=`none`},[s]),X(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=zs(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),X(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=zs(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=zs(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:k.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=zs(t)}else r.current=null;n(e)},[])}}function Ls(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Rs(...e){let t=k.useRef(e);return t.current=e,k.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ls(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ls(n[e],null)}}},[])}function zs(e){return e?.animationName||`none`}function Bs(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 Vs=k.useId||(()=>void 0),Hs=0;function Us(e){let[t,n]=k.useState(Vs());return X(()=>{e||n(e=>e??String(Hs++))},[e]),e||(t?`radix-${t}`:``)}function Z(e){let t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Ws=`DismissableLayer`,Gs=`dismissableLayer.update`,Ks=`dismissableLayer.pointerDownOutside`,qs=`dismissableLayer.focusOutside`,Js,Ys=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xs=k.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=k.useContext(Ys),[d,f]=k.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=k.useState({}),h=ds(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=k.useRef(!1),C=tc(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=nc(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Z(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return k.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),k.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Js=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),rc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Js))}},[d,p,n,u]),k.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),rc())},[d,u]),k.useEffect(()=>{let e=()=>m({});return document.addEventListener(Gs,e),()=>document.removeEventListener(Gs,e)},[]),(0,A.jsx)(Ts.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:ks(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ks(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ks(e.onPointerDownCapture,C.onPointerDownCapture)})});Xs.displayName=Ws;var Zs=`DismissableLayerBranch`,Qs=k.forwardRef((e,t)=>{let n=k.useContext(Ys),r=k.useRef(null),i=ds(t,r);return k.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,A.jsx)(Ts.div,{...e,ref:i})});Qs.displayName=Zs;function $s(){let e=k.useContext(Ys),[t,n]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ec=()=>!0;function tc(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ec}=t,s=Z(e),c=k.useRef(!1),l=k.useRef(!1),u=k.useRef(new Map),d=k.useRef(()=>{});return k.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ic(Ks,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function nc(e,t=globalThis?.document){let n=Z(e),r=k.useRef(!1);return k.useEffect(()=>{let e=e=>{e.target&&!r.current&&ic(qs,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 rc(){let e=new CustomEvent(Gs);document.dispatchEvent(e)}function ic(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?Es(i,a):i.dispatchEvent(a)}var ac=`focusScope.autoFocusOnMount`,oc=`focusScope.autoFocusOnUnmount`,sc={bubbles:!1,cancelable:!0},cc=`FocusScope`,lc=k.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=k.useState(null),l=Z(i),u=Z(a),d=k.useRef(null),f=ds(t,c),p=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Q(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]),k.useEffect(()=>{if(s){gc.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ac,sc);s.addEventListener(ac,l),s.dispatchEvent(t),t.defaultPrevented||(uc(yc(fc(s)),{select:!0}),document.activeElement===e&&Q(s))}return()=>{s.removeEventListener(ac,l),setTimeout(()=>{let t=new CustomEvent(oc,sc);s.addEventListener(oc,u),s.dispatchEvent(t),t.defaultPrevented||Q(e??document.body,{select:!0}),s.removeEventListener(oc,u),gc.remove(p)},0)}}},[s,l,u,p]);let m=k.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]=dc(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,A.jsx)(Ts.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});lc.displayName=cc;function uc(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function dc(e){let t=fc(e);return[pc(t,e),pc(t.reverse(),e)]}function fc(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 pc(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):mc(r,{upTo:t})))return r}function mc(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 hc(e){return e instanceof HTMLInputElement&&`select`in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hc(e)&&t&&e.select()}}var gc=_c();function _c(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=vc(e,t),e.unshift(t)},remove(t){e=vc(e,t),e[0]?.resume()}}}function vc(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yc(e){return e.filter(e=>e.tagName!==`A`)}var bc=`Portal`,xc=k.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=k.useState(!1);X(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?as.createPortal((0,A.jsx)(Ts.div,{...r,ref:t}),o):null});xc.displayName=bc;var Sc=0,Cc=null;function wc(){k.useEffect(()=>{Cc||={start:Tc(),end:Tc()};let{start:e,end:t}=Cc;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Sc++,()=>{Sc===1&&(Cc?.start.remove(),Cc?.end.remove(),Cc=null),Sc=Math.max(0,Sc-1)}},[])}function Tc(){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 $=function(){return $=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},$.apply(this,arguments)};function Ec(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 Dc(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 Oc=`right-scroll-bar-position`,kc=`width-before-scroll-bar`,Ac=`with-scroll-bars-hidden`,jc=`--removed-body-scroll-bar-size`;function Mc(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Nc(e,t){var n=(0,k.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 Pc=typeof window<`u`?k.useLayoutEffect:k.useEffect,Fc=new WeakMap;function Ic(e,t){var n=Nc(t||null,function(t){return e.forEach(function(e){return Mc(e,t)})});return Pc(function(){var t=Fc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Mc(e,null)}),i.forEach(function(e){r.has(e)||Mc(e,a)})}Fc.set(n,e)},[e]),n}function Lc(e){return e}function Rc(e,t){t===void 0&&(t=Lc);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 zc(e){e===void 0&&(e={});var t=Rc(null);return t.options=$({async:!0,ssr:!1},e),t}var Bc=function(e){var t=e.sideCar,n=Ec(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 k.createElement(r,$({},n))};Bc.isSideCarExport=!0;function Vc(e,t){return e.useMedium(t),Bc}var Hc=zc(),Uc=function(){},Wc=k.forwardRef(function(e,t){var n=k.useRef(null),r=k.useState({onScrollCapture:Uc,onWheelCapture:Uc,onTouchMoveCapture:Uc}),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=Ec(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ic([n,t]),C=$($({},b),i);return k.createElement(k.Fragment,null,u&&k.createElement(x,{sideCar:Hc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?k.cloneElement(k.Children.only(s),$($({},C),{ref:S})):k.createElement(v,$({},C,{className:c,ref:S}),s))});Wc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wc.classNames={fullWidth:kc,zeroRight:Oc};var Gc,Kc=function(){if(Gc)return Gc;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Kc();return t&&e.setAttribute(`nonce`,t),e}function Jc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qc())&&(Jc(t,n),Yc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zc=function(){var e=Xc();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qc=function(){var e=Zc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$c={left:0,top:0,right:0,gap:0},el=function(e){return parseInt(e||``,10)||0},tl=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[el(n),el(r),el(i)]},nl=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $c;var t=tl(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])}},rl=Qc(),il=`data-scroll-locked`,al=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
4
  .${Ac} {
5
5
  overflow: hidden ${r};
6
6
  padding-right: ${s}px ${r};
@@ -40,4 +40,4 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
40
40
  `},ol=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},sl=function(){k.useEffect(function(){return document.body.setAttribute(il,(ol()+1).toString()),function(){var e=ol()-1;e<=0?document.body.removeAttribute(il):document.body.setAttribute(il,e.toString())}},[])},cl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;sl();var a=k.useMemo(function(){return nl(i)},[i]);return k.createElement(rl,{styles:al(a,!t,i,n?``:`!important`)})},ll=!1;if(typeof window<`u`)try{var ul=Object.defineProperty({},"passive",{get:function(){return ll=!0,!0}});window.addEventListener(`test`,ul,ul),window.removeEventListener(`test`,ul,ul)}catch{ll=!1}var dl=ll?{passive:!1}:!1,fl=function(e){return e.tagName===`TEXTAREA`},pl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!fl(e)&&n[t]===`visible`)},ml=function(e){return pl(e,`overflowY`)},hl=function(e){return pl(e,`overflowX`)},gl=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),yl(e,r)){var i=bl(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_l=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},vl=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},yl=function(e,t){return e===`v`?ml(t):hl(t)},bl=function(e,t){return e===`v`?_l(t):vl(t)},xl=function(e,t){return e===`h`&&t===`rtl`?-1:1},Sl=function(e,t,n,r,i){var a=xl(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=bl(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&yl(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},Cl=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wl=function(e){return[e.deltaX,e.deltaY]},Tl=function(e){return e&&`current`in e?e.current:e},El=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Dl=function(e){return`
41
41
  .block-interactivity-${e} {pointer-events: none;}
42
42
  .allow-interactivity-${e} {pointer-events: all;}
43
- `},Ol=0,kl=[];function Al(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),i=k.useState(Ol++)[0],a=k.useState(Qc)[0],o=k.useRef(e);k.useEffect(function(){o.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Dc([e.lockRef.current],(e.shards||[]).map(Tl),!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=k.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Cl(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=gl(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=gl(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 Sl(h,t,e,h===`h`?s:c,!0)},[]),c=k.useCallback(function(e){var n=e;if(!(!kl.length||kl[kl.length-1]!==a)){var r=`deltaY`in n?wl(n):Cl(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&El(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Tl).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=k.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:jl(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=k.useCallback(function(e){n.current=Cl(e),r.current=void 0},[]),d=k.useCallback(function(t){l(t.type,wl(t),t.target,s(t,e.lockRef.current))},[]),f=k.useCallback(function(t){l(t.type,Cl(t),t.target,s(t,e.lockRef.current))},[]);k.useEffect(function(){return kl.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,dl),document.addEventListener(`touchmove`,c,dl),document.addEventListener(`touchstart`,u,dl),function(){kl=kl.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,dl),document.removeEventListener(`touchmove`,c,dl),document.removeEventListener(`touchstart`,u,dl)}},[]);var p=e.removeScrollBar,m=e.inert;return k.createElement(k.Fragment,null,m?k.createElement(a,{styles:Dl(i)}):null,p?k.createElement(cl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ml=Vc(Hc,Al),Nl=k.forwardRef(function(e,t){return k.createElement(Wc,$({},e,{ref:t,sideCar:Ml}))});Nl.classNames=Wc.classNames;var Pl=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Fl=new WeakMap,Il=new WeakMap,Ll={},Rl=0,zl=function(e){return e&&(e.host||zl(e.parentNode))},Bl=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=zl(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})},Vl=function(e,t,n,r){var i=Bl(t,Array.isArray(e)?e:[e]);Ll[n]||(Ll[n]=new WeakMap);var a=Ll[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=(Fl.get(e)||0)+1,l=(a.get(e)||0)+1;Fl.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Il.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(),Rl++,function(){o.forEach(function(e){var t=Fl.get(e)-1,i=a.get(e)-1;Fl.set(e,t),a.set(e,i),t||(Il.has(e)||e.removeAttribute(r),Il.delete(e)),i||e.removeAttribute(n)}),Rl--,Rl||(Fl=new WeakMap,Fl=new WeakMap,Il=new WeakMap,Ll={})}},Hl=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Pl(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Vl(r,i,n,`aria-hidden`)):function(){return null}},Ul=ss(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function Wl({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,A.jsx)(r?fs:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:l(Ul({variant:t,size:n,className:e})),...i})}var Gl=5e3,Kl=[],ql=1,Jl=new Set;function Yl(e){Kl=e;for(let e of Jl)e()}function Xl(e){return Jl.add(e),()=>Jl.delete(e)}function Zl(e,t={}){let n={id:ql++,message:e,tone:t.tone??`default`};Yl([...Kl,n]),setTimeout(()=>Yl(Kl.filter(e=>e.id!==n.id)),Gl)}function Ql(){let e=(0,k.useSyncExternalStore)(Xl,()=>Kl);return e.length===0?null:(0,A.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,A.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:l(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}var $l={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function eu({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:o=!1,heading:s=`h1`,className:c}){return(0,A.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:l(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,c),children:[o?(0,A.jsx)(ru,{}):null,(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,A.jsx)(`div`,{"data-slot":`centered-state-tile`,className:l(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,$l[t]),children:e}),(0,A.jsx)(s,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,A.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,A.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,A.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var tu=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],nu={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function ru({className:e}){return(0,A.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:l(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:tu.map((e,t)=>(0,A.jsx)(`span`,{className:l(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,nu[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}export{mo as $,xa as $t,Y as A,Jr as An,ha as At,ts as B,T as Bn,za as Bt,fs as C,Kn as Cn,Go as Ct,ss as D,U as Dn,Ka as Dt,us as E,At as En,G as Et,Xo as F,Le as Fn,Fa as Ft,Fo as G,E as Gn,Qi as Gt,yo as H,C as Hn,Yi as Ht,po as I,Ee as In,ma as It,So as J,d as Jn,$i as Jt,bo as K,b as Kn,Ei as Kt,Qo as L,_e as Ln,ba as Lt,Uo as M,M as Mn,Aa as Mt,_o as N,Ve as Nn,sa as Nt,rs as O,_n as On,_a as Ot,zo as P,j as Pn,ya as Pt,lo as Q,Ra as Qt,$o as R,O as Rn,La as Rt,Ts as S,Gn as Sn,Ko as St,ls as T,Yn as Tn,X as Tt,vo as U,S as Un,Zi as Ut,Do as V,w as Vn,va as Vt,Po as W,g as Wn,ea as Wt,co as X,Oa as Xt,fo as Y,u as Yn,ka as Yt,Wo as Z,Ea as Zt,As as _,gi as _n,qo as _t,Wl as a,qa as an,uo as at,Es as b,Br as bn,go as bt,Nl as c,Ii as cn,ko as ct,lc as d,aa as dn,Eo as dt,Ta as en,ho as et,Xs as f,ca as fn,Ao as ft,Ps as g,di as gn,No as gt,Hs as h,li as hn,Yo as ht,Zl as i,Ba as in,Ro as it,Ho as j,N as jn,Ga as jt,ns as k,xn as kn,ga as kt,wc as l,Za as ln,Oo as lt,Us as m,fi as mn,xo as mt,ru as n,ja as nn,Io as nt,Ul as o,Ha as on,Co as ot,$s as p,wa as pn,so as pt,Jo as q,le as qn,ia as qt,Ql as r,Ja as rn,Lo as rt,Hl as s,Xa as sn,To as st,eu as t,Ia as tn,Zo as tt,xc as u,Ca as un,wo as ut,Z as v,hi as vn,jo as vt,ds as w,qn as wn,Bo as wt,ws as x,Vr as xn,Mo as xt,Os as y,Rr as yn,Vo as yt,es as z,_ as zn,Sa as zt};
43
+ `},Ol=0,kl=[];function Al(e){var t=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),i=k.useState(Ol++)[0],a=k.useState(Qc)[0],o=k.useRef(e);k.useEffect(function(){o.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Dc([e.lockRef.current],(e.shards||[]).map(Tl),!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=k.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Cl(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=gl(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=gl(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 Sl(h,t,e,h===`h`?s:c,!0)},[]),c=k.useCallback(function(e){var n=e;if(!(!kl.length||kl[kl.length-1]!==a)){var r=`deltaY`in n?wl(n):Cl(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&El(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Tl).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=k.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:jl(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=k.useCallback(function(e){n.current=Cl(e),r.current=void 0},[]),d=k.useCallback(function(t){l(t.type,wl(t),t.target,s(t,e.lockRef.current))},[]),f=k.useCallback(function(t){l(t.type,Cl(t),t.target,s(t,e.lockRef.current))},[]);k.useEffect(function(){return kl.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,dl),document.addEventListener(`touchmove`,c,dl),document.addEventListener(`touchstart`,u,dl),function(){kl=kl.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,dl),document.removeEventListener(`touchmove`,c,dl),document.removeEventListener(`touchstart`,u,dl)}},[]);var p=e.removeScrollBar,m=e.inert;return k.createElement(k.Fragment,null,m?k.createElement(a,{styles:Dl(i)}):null,p?k.createElement(cl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ml=Vc(Hc,Al),Nl=k.forwardRef(function(e,t){return k.createElement(Wc,$({},e,{ref:t,sideCar:Ml}))});Nl.classNames=Wc.classNames;var Pl=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Fl=new WeakMap,Il=new WeakMap,Ll={},Rl=0,zl=function(e){return e&&(e.host||zl(e.parentNode))},Bl=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=zl(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})},Vl=function(e,t,n,r){var i=Bl(t,Array.isArray(e)?e:[e]);Ll[n]||(Ll[n]=new WeakMap);var a=Ll[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=(Fl.get(e)||0)+1,l=(a.get(e)||0)+1;Fl.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Il.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(),Rl++,function(){o.forEach(function(e){var t=Fl.get(e)-1,i=a.get(e)-1;Fl.set(e,t),a.set(e,i),t||(Il.has(e)||e.removeAttribute(r),Il.delete(e)),i||e.removeAttribute(n)}),Rl--,Rl||(Fl=new WeakMap,Fl=new WeakMap,Il=new WeakMap,Ll={})}},Hl=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Pl(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Vl(r,i,n,`aria-hidden`)):function(){return null}},Ul=cs(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function Wl({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,A.jsx)(r?ps:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:l(Ul({variant:t,size:n,className:e})),...i})}var Gl=5e3,Kl=[],ql=1,Jl=new Set;function Yl(e){Kl=e;for(let e of Jl)e()}function Xl(e){return Jl.add(e),()=>Jl.delete(e)}function Zl(e,t={}){let n={id:ql++,message:e,tone:t.tone??`default`};Yl([...Kl,n]),setTimeout(()=>Yl(Kl.filter(e=>e.id!==n.id)),Gl)}function Ql(){let e=(0,k.useSyncExternalStore)(Xl,()=>Kl);return e.length===0?null:(0,A.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,A.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:l(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}var $l={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function eu({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:o=!1,heading:s=`h1`,className:c}){return(0,A.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:l(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,c),children:[o?(0,A.jsx)(ru,{}):null,(0,A.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,A.jsx)(`div`,{"data-slot":`centered-state-tile`,className:l(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,$l[t]),children:e}),(0,A.jsx)(s,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,A.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,A.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,A.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var tu=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],nu={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function ru({className:e}){return(0,A.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:l(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:tu.map((e,t)=>(0,A.jsx)(`span`,{className:l(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,nu[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}export{ho as $,Sa as $t,J as A,Jr as An,ga as At,ns as B,T as Bn,Ba as Bt,ps as C,Kn as Cn,Ko as Ct,cs as D,U as Dn,qa as Dt,ds as E,At as En,_i as Et,Zo as F,Le as Fn,Ia as Ft,Io as G,E as Gn,$i as Gt,bo as H,C as Hn,Xi as Ht,mo as I,Ee as In,ha as It,Co as J,d as Jn,ea as Jt,xo as K,b as Kn,Di as Kt,$o as L,_e as Ln,xa as Lt,Wo as M,M as Mn,ja as Mt,vo as N,Ve as Nn,ca as Nt,is as O,_n as On,va as Ot,Bo as P,j as Pn,ba as Pt,uo as Q,za as Qt,es as R,O as Rn,Ra as Rt,Es as S,Gn as Sn,qo as St,us as T,Yn as Tn,Y as Tt,yo as U,S as Un,Qi as Ut,Oo as V,w as Vn,ya as Vt,Fo as W,g as Wn,ta as Wt,lo as X,ka as Xt,po as Y,u as Yn,Aa as Yt,Go as Z,Da as Zt,js as _,gi as _n,Jo as _t,Wl as a,Ja as an,fo as at,Ds as b,Br as bn,_o as bt,Nl as c,Li as cn,Ao as ct,lc as d,oa as dn,Do as dt,Ea as en,go as et,Xs as f,la as fn,jo as ft,Fs as g,di as gn,Po as gt,Us as h,li as hn,Xo as ht,Zl as i,Va as in,zo as it,Uo as j,N as jn,Ka as jt,rs as k,xn as kn,_a as kt,wc as l,Qa as ln,ko as lt,Z as m,fi as mn,So as mt,ru as n,Ma as nn,Lo as nt,Ul as o,Ua as on,wo as ot,$s as p,Ta as pn,co as pt,Yo as q,le as qn,aa as qt,Ql as r,Ya as rn,Ro as rt,Hl as s,Za as sn,Eo as st,eu as t,La as tn,Qo as tt,xc as u,wa as un,To as ut,X as v,hi as vn,Mo as vt,fs as w,qn as wn,Vo as wt,Ts as x,Vr as xn,No as xt,ks as y,Rr as yn,Ho as yt,ts as z,_ as zn,Ca as zt};
@@ -1 +1 @@
1
- import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{bn as r}from"./centered-state-BReta6eb.js";import{t as i}from"./utils-B8xGEgP3.js";import{t as a}from"./lib-DPEZDBUN.js";var o=n(t(),1),s=e(),c=41;function l({slot:e,commits:t,className:n}){let r=t.length>150,l=(0,o.useRef)(null),d=(0,o.useRef)(null),[f,p]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{if(!r)return;let e=()=>{let e=l.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]);let m=t.map(e=>(0,s.jsx)(u,{commit:e},e.sha));return(0,s.jsx)(`div`,{ref:e=>{l.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":r,className:i(`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,n),children:r?(0,s.jsx)(a,{scrollRef:d,startMargin:f,itemSize:c,children:m}):m})}function u({commit:e}){return(0,s.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_41px] [content-visibility:auto]`,children:(0,s.jsxs)(r,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,s.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})})}export{l as t};
1
+ import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{bn as r}from"./centered-state-D1yrjQoc.js";import{t as i}from"./utils-B8xGEgP3.js";import{t as a}from"./lib-DPEZDBUN.js";var o=n(t(),1),s=e(),c=41;function l({slot:e,commits:t,className:n}){let r=t.length>150,l=(0,o.useRef)(null),d=(0,o.useRef)(null),[f,p]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{if(!r)return;let e=()=>{let e=l.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]);let m=t.map(e=>(0,s.jsx)(u,{commit:e},e.sha));return(0,s.jsx)(`div`,{ref:e=>{l.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":r,className:i(`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,n),children:r?(0,s.jsx)(a,{scrollRef:d,startMargin:f,itemSize:c,children:m}):m})}function u({commit:e}){return(0,s.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_41px] [content-visibility:auto]`,children:(0,s.jsxs)(r,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,s.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})})}export{l as t};
@@ -1 +1 @@
1
- import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{A as r,Et as i,Pn as a,V as o,a as s,en as c,i as l,jn as u,k as d,kn as f,mt as p,t as m}from"./centered-state-BReta6eb.js";import{t as h}from"./utils-B8xGEgP3.js";import{t as g}from"./search-x-CbHLclyX.js";import{i as _,n as v,r as y,t as b}from"./run-diff-BpC4g-YQ.js";import{c as x,t as S}from"./project-router-DN5PKKrC.js";import{At as C,Ot as w,X as T,Xt as E,Y as D,Z as O,_ as k,an as A,d as j,f as M,g as N,h as P,ht as F,m as I,p as L,t as R,u as z,x as B}from"./index-Cd5Hgc0_.js";var V=n(t(),1),H=e();function U(){let{groupId:e}=f(),t=o(e),n=a();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:r.groups.detail(e)})},[n,e,(p().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(D,{});if(t.isError){let e=t.error instanceof i&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(m,{icon:e?(0,H.jsx)(g,{}):(0,H.jsx)(E,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(s,{asChild:!0,variant:`outline`,children:(0,H.jsx)(S,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=x(),i=a(),[o,s]=(0,V.useState)(null),f=t.every(e=>T.has(e.status)),p=t[0]?F(t[0]):``,m=u({mutationFn:t=>c(e,t),onSuccess:(t,a)=>{i.invalidateQueries({queryKey:r.runs.all}),i.invalidateQueries({queryKey:r.groups.detail(e)}),n(`/tasks/${t.winner?.id??a}`)},onError:e=>l(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(E,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:p,children:p})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:h(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:f,pickPending:m.isPending,onPick:()=>s(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(z,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,H.jsxs)(L,{children:[(0,H.jsxs)(N,{children:[(0,H.jsxs)(k,{children:[`Pick variant `,o?.variant,`?`]}),(0,H.jsxs)(I,{children:[`Variant `,o?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(P,{children:[(0,H.jsx)(M,{children:`Keep comparing`}),(0,H.jsxs)(j,{"data-slot":`confirm-pick`,onClick:()=>{o&&m.mutate(o.id),s(null)},children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Pick variant `,o?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=C(e),a=O(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(R,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[w(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(B,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(s,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(v,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(_,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(A,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(y,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(b,{runId:e.id})})})]})}export{U as CompareVariantsRoute};
1
+ import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{A as r,Et as i,Pn as a,V as o,a as s,en as c,i as l,jn as u,k as d,kn as f,mt as p,t as m}from"./centered-state-D1yrjQoc.js";import{t as h}from"./utils-B8xGEgP3.js";import{t as g}from"./search-x-CbHLclyX.js";import{i as _,n as v,r as y,t as b}from"./run-diff-CfKkTcmS.js";import{c as x,t as S}from"./project-router-DAVnRglp.js";import{At as C,Ot as w,X as T,Xt as E,Y as D,Z as O,_ as k,an as A,d as j,f as M,g as N,h as P,ht as F,m as I,p as L,t as R,u as z,x as B}from"./index-YvXMniy_.js";var V=n(t(),1),H=e();function U(){let{groupId:e}=f(),t=o(e),n=a();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:r.groups.detail(e)})},[n,e,(p().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(D,{});if(t.isError){let e=t.error instanceof i&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(m,{icon:e?(0,H.jsx)(g,{}):(0,H.jsx)(E,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(s,{asChild:!0,variant:`outline`,children:(0,H.jsx)(S,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=x(),i=a(),[o,s]=(0,V.useState)(null),f=t.every(e=>T.has(e.status)),p=t[0]?F(t[0]):``,m=u({mutationFn:t=>c(e,t),onSuccess:(t,a)=>{i.invalidateQueries({queryKey:r.runs.all}),i.invalidateQueries({queryKey:r.groups.detail(e)}),n(`/tasks/${t.winner?.id??a}`)},onError:e=>l(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(E,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:p,children:p})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:h(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:f,pickPending:m.isPending,onPick:()=>s(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(z,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,H.jsxs)(L,{children:[(0,H.jsxs)(N,{children:[(0,H.jsxs)(k,{children:[`Pick variant `,o?.variant,`?`]}),(0,H.jsxs)(I,{children:[`Variant `,o?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(P,{children:[(0,H.jsx)(M,{children:`Keep comparing`}),(0,H.jsxs)(j,{"data-slot":`confirm-pick`,onClick:()=>{o&&m.mutate(o.id),s(null)},children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Pick variant `,o?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=C(e),a=O(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(R,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[w(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(B,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(s,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(d,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(v,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(_,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(A,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(y,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(b,{runId:e.id})})})]})}export{U as CompareVariantsRoute};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-T7lcevcs.js","assets/bundle-mjs-BegPhL5c.js","assets/utils-B8xGEgP3.js","assets/index-Cd5Hgc0_.js","assets/centered-state-BReta6eb.js","assets/search-x-CbHLclyX.js","assets/triangle-alert-CHtGkjPK.js","assets/textarea-BhdkPlu6.js","assets/dist-Cu-vv6-9.js","assets/project-router-DN5PKKrC.js","assets/chunk-BO2N2NFS-DtrdTCWa.js","assets/lib-uHpeUPzK.js","assets/index-C2MYcg0H.css","assets/lib-DPEZDBUN.js","assets/image-preview-B6kVovYD.js","assets/zoomable-image-Bb6ydBLq.js"])))=>i.map(i=>d[i]);
2
- import{a as e,i as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{t as i}from"./utils-B8xGEgP3.js";import{rt as a}from"./index-Cd5Hgc0_.js";import{n as o,t as s}from"./image-preview-B6kVovYD.js";var c=r(n(),1),l=e();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return t(()=>import(`./diff-view-T7lcevcs.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-6Y7sgPso.js","assets/bundle-mjs-BegPhL5c.js","assets/utils-B8xGEgP3.js","assets/index-YvXMniy_.js","assets/centered-state-D1yrjQoc.js","assets/search-x-CbHLclyX.js","assets/triangle-alert-CHtGkjPK.js","assets/textarea-BhdkPlu6.js","assets/dist-CVke47_f.js","assets/project-router-DAVnRglp.js","assets/chunk-BO2N2NFS-DtrdTCWa.js","assets/lib-uHpeUPzK.js","assets/index-C2MYcg0H.css","assets/lib-DPEZDBUN.js","assets/image-preview-B6kVovYD.js","assets/zoomable-image-Bb6ydBLq.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,i as t,s as n,u as r}from"./bundle-mjs-BegPhL5c.js";import{t as i}from"./utils-B8xGEgP3.js";import{rt as a}from"./index-YvXMniy_.js";import{n as o,t as s}from"./image-preview-B6kVovYD.js";var c=r(n(),1),l=e();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return t(()=>import(`./diff-view-6Y7sgPso.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
3
  `).map((e,t)=>(0,l.jsxs)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};