@kimuson/claude-code-viewer 0.7.4 → 0.7.5

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 (44) hide show
  1. package/README.md +9 -0
  2. package/dist/main.js +104085 -9969
  3. package/dist/static/assets/AuthProvider-a1wlLm40.js +22 -0
  4. package/dist/static/assets/{ProtectedRoute-CTOJTf-s.js → ProtectedRoute-Bd-6jyxE.js} +1 -1
  5. package/dist/static/assets/{card-5CIj0Vrs.js → card-D9aMzhGi.js} +1 -1
  6. package/dist/static/assets/createLucideIcon-Dr4vJxG7.js +1 -0
  7. package/dist/static/assets/dist-BSr9MeK6.js +109 -0
  8. package/dist/static/assets/{dist-B0PGU2Rq.js → dist-DsKpSV8b.js} +1 -1
  9. package/dist/static/assets/{eye-DomqS332.js → eye-93IqRP6X.js} +1 -1
  10. package/dist/static/assets/index-B-si4iv9.js +20 -0
  11. package/dist/static/assets/{index-B5oyQ9A3.css → index-CRjH32Aw.css} +1 -1
  12. package/dist/static/assets/{input-DxYncE22.js → input-M1VOtQpS.js} +1 -1
  13. package/dist/static/assets/label-CV_Y-Hm3.js +1 -0
  14. package/dist/static/assets/{login-BgVcUPOp.js → login-B5ql67Sw.js} +1 -1
  15. package/dist/static/assets/markdown-parser-vendor-BdkS_k_8.js +29 -0
  16. package/dist/static/assets/{projects-BrdJ1LSG.js → projects-CzabZWrQ.js} +1 -1
  17. package/dist/static/assets/{refractor-vendor-CoTYH44G.js → refractor-vendor-BfdmH2uT.js} +1 -1
  18. package/dist/static/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
  19. package/dist/static/assets/routes-DCVxLOkG.js +1 -0
  20. package/dist/static/assets/session-Bh26l_lo.js +13 -0
  21. package/dist/static/assets/session-BxPcWj4u.js +1 -0
  22. package/dist/static/assets/{syntax-highlighter-vendor-E92u2I9N.js → syntax-highlighter-vendor-BmNdBw1C.js} +1 -1
  23. package/dist/static/assets/workbox-window.prod.es5-8x20nBgX.js +2 -0
  24. package/dist/static/index.html +10 -12
  25. package/dist/static/sw.js +1 -1
  26. package/package.json +2 -132
  27. package/dist/main.js.map +0 -7
  28. package/dist/static/assets/AuthProvider-BuZnJ5E7.js +0 -22
  29. package/dist/static/assets/NotFound-Dwvf0Bo3.js +0 -1
  30. package/dist/static/assets/createLucideIcon-CRmASjPp.js +0 -1
  31. package/dist/static/assets/dist-DiNC9I1q.js +0 -84
  32. package/dist/static/assets/index-PituKE8G.js +0 -20
  33. package/dist/static/assets/label-BIlZTnVW.js +0 -1
  34. package/dist/static/assets/markdown-parser-vendor-Dm3WZMeS.js +0 -29
  35. package/dist/static/assets/rolldown-runtime-Dw2cE7zH.js +0 -1
  36. package/dist/static/assets/routes-BCc9450k.js +0 -1
  37. package/dist/static/assets/session-BruJZygw.js +0 -2
  38. package/dist/static/assets/session-DXLe2gKP.js +0 -13
  39. package/dist/static/assets/session-DheVJS_-.js +0 -1
  40. package/dist/static/assets/workbox-window.prod.es5-DHdPsNjM.js +0 -2
  41. /package/dist/static/assets/{messages-CCdvpjPA.js → messages-BugsdlC4.js} +0 -0
  42. /package/dist/static/assets/{messages-CXMLmBXL.js → messages-C9GGR_pN.js} +0 -0
  43. /package/dist/static/assets/{messages-D1gyj6vH.js → messages-CXGVSZXJ.js} +0 -0
  44. /package/dist/static/assets/{xterm-vendor-C7zPO6uk.js → xterm-vendor-D6WsVDeV.js} +0 -0
@@ -1,22 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{d as t,f as n}from"./markdown-parser-vendor-Dm3WZMeS.js";import{t as r}from"./createLucideIcon-CRmASjPp.js";var i=e(n(),1),a=i.use,o=typeof window<`u`?i.useLayoutEffect:i.useEffect;function s(e){let t=i.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function c(e,t,n={},r={}){i.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function l(e){let t=i.useRef(null);return i.useImperativeHandle(e,()=>t.current,[]),t}var u=i.createContext(null);function d(e){return i.useContext(u)}function f(e){let t=d();return i.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var p=r(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),m=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(){}},h=new class extends m{#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`}},g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_=new class{#e=g;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 v(e){setTimeout(e,0)}var y=typeof window>`u`||`Deno`in globalThis;function b(){}function x(e,t){return typeof e==`function`?e(t):e}function S(e){return typeof e==`number`&&e>=0&&e!==1/0}function C(e,t){return Math.max(e+(t||0)-Date.now(),0)}function w(e,t){return typeof e==`function`?e(t):e}function T(e,t){return typeof e==`function`?e(t):e}function ee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==D(o,t.options))return!1}else if(!k(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 E(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(O(t.options.mutationKey)!==O(a))return!1}else if(!k(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function D(e,t){return(t?.queryKeyHashFn||O)(e)}function O(e){return JSON.stringify(e,(e,t)=>j(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function k(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>k(e[n],t[n])):!1}var te=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=re(e)&&re(t);if(!r&&!(j(e)&&j(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:te.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function A(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 re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function j(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=>{_.setTimeout(t,e)})}function M(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var N=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===N?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P(e,t){return typeof e==`function`?e(...t):!!e}function le(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 F=(()=>{let e=()=>y;return{isServer(){return e()},setIsServer(t){e=t}}})();function I(){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 ue=v;function de(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ue,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 L=de(),R=new class extends m{#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 fe(e){return Math.min(1e3*2**e,3e4)}function pe(e){return(e??`online`)===`online`?R.isOnline():!0}var z=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function me(e){let t=!1,n=0,r,i=I(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new z(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>h.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),u=()=>pe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{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(d).catch(r=>{if(a())return;let i=e.retry??(F.isServer()?0:3),o=e.retryDelay??fe,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){f(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var he=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S(this.gcTime)&&(this.#e=_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(_.clearTimeout(this.#e),void 0)}},ge=class extends he{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ye(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ye(this.options);e.data!==void 0&&(this.setState(ve(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=M(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>T(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===N||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>w(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!C(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.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.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=ce(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!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.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=me({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof z&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof z){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(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,..._e(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ve(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=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),L.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function _e(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ye(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 be=class extends m{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=I(),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),Se(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return B(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return B(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 T(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&&!A(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ce(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||T(this.options.enabled,this.#t)!==T(t.enabled,this.#t)||w(this.options.staleTime,this.#t)!==w(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||T(this.options.enabled,this.#t)!==T(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 we(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(b)),t}#g(){this.#b();let e=w(this.options.staleTime,this.#t);if(F.isServer()||this.#r.isStale||!S(e))return;let t=C(this.#r.dataUpdatedAt,e)+1;this.#d=_.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,!(F.isServer()||T(this.options.enabled,this.#t)===!1||!S(this.#p)||this.#p===0)&&(this.#f=_.setInterval(()=>{(this.options.refetchIntervalInBackground||h.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(_.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(_.clearInterval(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&&Se(e,t),o=i&&Ce(e,n,t,r);(a||o)&&(l={...l,..._e(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=M(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=M(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,x={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:V(e,t),refetch:this.refetch,promise:this.#o,isEnabled:T(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=I())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}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),!A(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){L.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function xe(e,t){return T(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Se(e,t){return xe(e,t)||e.state.data!==void 0&&B(e,t,t.refetchOnMount)}function B(e,t,n){if(T(t.enabled,e)!==!1&&w(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&V(e,t)}return!1}function Ce(e,t,n,r){return(e!==t||T(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&V(e,n)}function V(e,t){return T(t.enabled,e)!==!1&&e.isStaleByTime(w(t.staleTime,e))}function we(e,t){return!A(e.getCurrentResult(),t)}var Te=class extends he{#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||Ee(),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=me({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){this.state=(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),L.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends m{#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),A(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&O(t.mutationKey)!==O(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??Ee();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){L.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)})})}},H=t(),Oe=i.createContext(void 0),U=e=>{let t=i.useContext(Oe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ke=({client:e,children:t})=>(i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,H.jsx)(Oe.Provider,{value:e,children:t})),Ae=i.createContext(!1),je=()=>i.useContext(Ae);Ae.Provider;function Me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ne=i.createContext(Me()),Pe=()=>i.useContext(Ne),Fe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?P(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ie=e=>{i.useEffect(()=>{e.clearReset()},[e])},Le=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||P(n,[e.error,r])),Re=(e,t)=>t.state.data===void 0,ze=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))}},Be=(e,t)=>e.isLoading&&e.isFetching&&!t,Ve=(e,t)=>e?.suspense&&t.isPending,He=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ue(e,t,n){let r=je(),a=Pe(),o=U(n),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash);s._optimisticResults=r?`isRestoring`:`optimistic`,ze(s),Fe(s,a,c),Ie(a);let l=!o.getQueryCache().get(s.queryHash),[u]=i.useState(()=>new t(o,s)),d=u.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(i.useSyncExternalStore(i.useCallback(e=>{let t=f?u.subscribe(L.batchCalls(e)):b;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),i.useEffect(()=>{u.setOptions(s)},[s,u]),Ve(s,d))throw He(s,u,a);if(Le({result:d,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,d),s.experimental_prefetchInRender&&!F.isServer()&&Be(d,r)&&(l?He(s,u,a):c?.promise)?.catch(b).finally(()=>{u.updateResult()}),s.notifyOnChangeProps?d:u.trackResult(d)}function We(e,t){return Ue({...e,enabled:!0,suspense:!0,throwOnError:Re,placeholderData:void 0},be,t)}function W(e,t){let n=U(t),[r]=i.useState(()=>new De(n,e));i.useEffect(()=>{r.setOptions(e)},[r,e]);let a=i.useSyncExternalStore(i.useCallback(e=>r.subscribe(L.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=i.useCallback((e,t)=>{r.mutate(e,t).catch(b)},[r]);if(a.error&&P(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function Ge(e){return`init`in e}function Ke(e){return!!e.write}function qe(e){return`v`in e||`e`in e}function G(e){if(`e`in e)throw e.e;return e.v}function K(e){return typeof e?.then==`function`}function Je(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Ye(e,t,n){let r=new Set;for(let t of n.get(e)?.t||[])r.add(t);for(let e of t.p)r.add(e);return r}var Xe=(e,t,...n)=>t.read(...n),Ze=(e,t,...n)=>t.write(...n),Qe=(e,t)=>t.INTERNAL_onInit?.call(t,e),$e=(e,t,n)=>t.onMount?.call(t,n),et=(e,t)=>{var n;let r=q(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},tt=e=>{let t=q(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13],c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set,c=t.add.bind(t);r.forEach(e=>n.get(e)?.l.forEach(c)),r.clear(),a.forEach(c),a.clear(),i.forEach(c),i.clear(),t.forEach(l),r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},nt=e=>{let t=q(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17],c=[],l=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){let t=d[d.length-1],i=a(e,t);if(u.has(t)){d.pop();continue}if(l.has(t)){r.get(t)===i.n&&c.push([t,i]),u.add(t),d.pop();continue}l.add(t);for(let e of Ye(t,i,n))l.has(e)||d.push(e)}for(let t=c.length-1;t>=0;--t){let[n,a]=c[t],l=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){l=!0;break}l&&(r.set(n,a.n),o(e,n),s(e,n)),r.delete(n)}},rt=(e,t)=>{var n,r;let i=q(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],p=i[14],m=i[16],h=i[17],g=i[20],_=i[26],v=i[28],y=u(e,t),b=v[0];if(qe(y)){if(a.has(t)&&o.get(t)!==y.n||y.m===b)return y.m=b,y;let n=!1;for(let[t,r]of y.d)if(p(e,t).n!==r){n=!0;break}if(!n)return y.m=b,y}let x=!0,S=new Set(y.d.keys()),C=new Map,w=()=>{for(let e of S)C.has(e)||y.d.delete(e)},T=()=>{if(a.has(t)){let n=!s.size;h(e,t),n&&(f(e),d(e))}},ee=n=>{var r;if(n===t){let t=u(e,n);if(!qe(t))if(Ge(n))g(e,n,n.init);else throw Error(`no atom init`);return G(t)}let i=p(e,n);try{return G(i)}finally{C.set(n,i.n),y.d.set(n,i.n),K(y.v)&&Je(t,y.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),x||T()}},E,D,O={get signal(){return E||=new AbortController,E.signal},get setSelf(){return!D&&Ke(t)&&(D=(...n)=>{if(!x)try{return m(e,t,...n)}finally{f(e),d(e)}}),D}},k=y.n,te=o.get(t)===k;try{let r=l(e,t,ee,O);if(g(e,t,r),K(r)){_(e,r,()=>E?.abort());let t=()=>{w(),T()};r.then(t,t)}else w();return(n=c.r)==null||n.call(c,t),y.m=b,y}catch(e){return delete y.v,y.e=e,++y.n,y.m=b,y}finally{x=!1,y.n!==k&&te&&(o.set(t,y.n),s.add(t),(r=c.c)==null||r.call(c,t))}},it=(e,t)=>{let n=q(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of Ye(t,n,r)){let t=a(e,s);i.get(s)!==t.n&&(i.set(s,t.n),o.push(s))}}},at=(e,t,...n)=>{let r=q(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],p=r[17],m=r[20],h=r[28],g=!0,_=t=>G(u(e,t)),v=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!Ge(n))throw Error(`atom not writable`);let t=u.n,s=r[0];m(e,n,s),p(e,n),t!==u.n&&(++h[0],i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{g||(l(e),c(e))}};try{return o(e,t,_,v,...n)}finally{g=!1}},ot=(e,t)=>{var n;let r=q(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},st=(e,t)=>{var n;let r=q(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],m=c(e,t),h=i.get(t);if(!h){d(e,t);for(let n of m.d.keys())p(e,n).t.add(t);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(t,h),Ke(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(h.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return h},ct=(e,t)=>{var n;let r=q(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},lt=(e,t,n)=>{let r=q(e),i=r[11],a=r[27],o=i(e,t),s=`v`in o,c=o.v;if(K(n))for(let r of o.d.keys())Je(t,n,i(e,r));o.v=n,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,K(c)&&a(e,c))},ut=(e,t)=>{let n=q(e)[14];return G(n(e,t))},dt=(e,t,...n)=>{let r=q(e),i=r[3],a=r[12],o=r[13],s=r[16],c=i.size;try{return s(e,t,...n)}finally{i.size!==c&&(o(e),a(e))}},ft=(e,t,n)=>{let r=q(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},pt=(e,t,n)=>{let r=q(e)[25],i=r.get(t);if(!i){i=new Set,r.set(t,i);let e=()=>r.delete(t);t.then(e,e)}i.add(n)},mt=(e,t)=>{q(e)[25].get(t)?.forEach(e=>e())},ht=new WeakMap,q=e=>ht.get(e);function gt(e){let t=q(e),n=t[24];return n?n(t):t}function _t(...e){let t={get(e){let n=q(t)[21];return n(t,e)},set(e,...n){let r=q(t)[22];return r(t,e,...n)},sub(e,n){let r=q(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,void 0,new WeakMap,pt,mt,[0]].map((t,n)=>e[n]||t);return ht.set(t,Object.freeze(n)),t}var vt=0;function yt(e,t){let n=`atom${++vt}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=bt,r.write=xt),t&&(r.write=t),r}function bt(e){return e(this)}function xt(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var St;function Ct(){return St?St():_t()}var wt;function Tt(){return wt||=Ct(),wt}var Et=(0,i.createContext)(void 0);function J(e){let t=(0,i.useContext)(Et);return e?.store||t||Tt()}var Y=e=>typeof e?.then==`function`,X=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},Dt=i.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(X(e),e)}),Ot=new WeakMap,kt=(e,t,n)=>{let r=gt(e)[26],i=Ot.get(t);return i||(i=new Promise((a,o)=>{let s=t,c=e=>t=>{s===e&&a(t)},l=e=>t=>{s===e&&o(t)},u=()=>{try{let t=n();Y(t)?(Ot.set(t,i),s=t,t.then(c(t),l(t)),r(e,t,u)):a(t)}catch(e){o(e)}};t.then(c(t),l(t)),r(e,t,u)}),Ot.set(t,i)),i};function At(e,t){let{delay:n,unstable_promiseStatus:r=!i.use}=t||{},a=J(t),[[o,s,c],l]=(0,i.useReducer)(t=>{let n=a.get(e);return Object.is(t[0],n)&&t[1]===a&&t[2]===e?t:[n,a,e]},void 0,()=>[a.get(e),a,e]),u=o;if((s!==a||c!==e)&&(l(),u=a.get(e)),(0,i.useEffect)(()=>{let t=a.sub(e,()=>{if(r)try{let t=a.get(e);Y(t)&&X(kt(a,t,()=>a.get(e)))}catch{}if(typeof n==`number`){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
2
-
3
- Migration guide:
4
-
5
- Create a custom hook like the following.
6
-
7
- function useAtomValueWithDelay<Value>(
8
- atom: Atom<Value>,
9
- options: { delay: number },
10
- ): Value {
11
- const { delay } = options
12
- const store = useStore(options)
13
- const [value, setValue] = useState(() => store.get(atom))
14
- useEffect(() => {
15
- const unsub = store.sub(atom, () => {
16
- setTimeout(() => setValue(store.get(atom)), delay)
17
- })
18
- return unsub
19
- }, [store, atom, delay])
20
- return value
21
- }
22
- `),setTimeout(l,n);return}l()});return l(),t},[a,e,n,r]),(0,i.useDebugValue)(u),Y(u)){let t=kt(a,u,()=>a.get(e));return r&&X(t),Dt(t)}return u}function jt(e,t){let n=J(t);return(0,i.useCallback)((...t)=>n.set(e,...t),[n,e])}function Mt(e,t){return[At(e,t),jt(e,t)]}var Nt=yt({authEnabled:!1,authenticated:!1,checked:!1}),Pt=/^[\w!#$%&'*.^`|~+-]+$/,Ft=(e,t,n={})=>{if(!Pt.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},It=(e,t,n)=>(t=encodeURIComponent(t),Ft(e,t,n)),Lt=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),Rt=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},zt=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},Bt=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},Vt=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ht(e,t){if(!Z(e)&&!Z(t))return t;let n={...e};for(let e in t){let r=t[e];Z(n[e])&&Z(r)?n[e]=Ht(n[e],r):n[e]=r}return n}var Ut=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return Ut(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),Wt=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(It(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=Vt(a),a=Rt(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},Gt=(e,t)=>Ut(function n(r){let i=t?.buildSearchParams??zt,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=Lt(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=Rt(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=Vt(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=Bt(r.args[0]&&r.args[0].param?Rt(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new Wt(c,s,{buildSearchParams:i});if(s){t??={};let e=Ht(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),Kt=class extends Error{status;statusText;constructor(e,t){super(`HttpError: ${e} ${t}`),this.status=e,this.statusText=t}},Q=Gt(`/`,{fetch:async(...e)=>{let t=await fetch(...e);if(!t.ok)throw console.error(t),new Kt(t.status,t.statusText);return t}}),$={queryKey:[`auth`,`check`],queryFn:async()=>await(await Q.api.auth.check.$get()).json()},qt={queryKey:[`projects`],queryFn:async()=>{let e=await Q.api.projects.$get({param:{}});if(!e.ok)throw Error(`Failed to fetch projects: ${e.statusText}`);return await e.json()}},Jt=(e,t)=>({queryKey:[`directory-listing`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`directory-browser`].$get({query:{...e!==void 0&&e!==``?{currentPath:e}:{},...t===void 0?{}:{showHidden:t.toString()}}});if(!n.ok)throw Error(`Failed to fetch directory listing`);return await n.json()}}),Yt=(e,t)=>({queryKey:[`projects`,e],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].$get({param:{projectId:e},query:{cursor:t}});if(!n.ok)throw Error(`Failed to fetch project: ${n.statusText}`);return await n.json()}}),Xt=(e,t)=>({queryKey:[`projects`,e,`sessions`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch session: ${n.statusText}`);return await n.json()}}),Zt=e=>({queryKey:[`claude-commands`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`][`claude-commands`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch claude commands: ${t.statusText}`);return await t.json()}}),Qt={queryKey:[`sessionProcesses`],queryFn:async()=>{let e=await Q.api[`claude-code`][`session-processes`].$get({});if(!e.ok)throw Error(`Failed to fetch alive tasks: ${e.statusText}`);return await e.json()}},$t=e=>({queryKey:[`git`,`current-revisions`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git[`current-revisions`].$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch current revisions: ${t.statusText}`);return await t.json()}}),en=e=>({queryKey:[`git`,`branches`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].git.branches.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch branches: ${t.statusText}`);return await t.json()}}),tn=(e,t,n)=>({queryKey:[`git`,`diff`,e,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`].git.diff.$post({param:{projectId:e},json:{fromRef:t,toRef:n}});if(!r.ok)throw Error(`Failed to fetch diff: ${r.statusText}`);return await r.json()}}),nn=e=>({queryKey:[`mcp`,`list`,e],queryFn:async()=>{let t=await Q.api.projects[`:projectId`].mcp.list.$get({param:{projectId:e}});if(!t.ok)throw Error(`Failed to fetch MCP list: ${t.statusText}`);return await t.json()}}),rn=(e,t)=>({queryKey:[`file-completion`,e,t],queryFn:async()=>{let n=await Q.api[`file-system`][`file-completion`].$get({query:{basePath:t,projectId:e}});if(!n.ok)throw Error(`Failed to fetch file completion`);return await n.json()}}),an={queryKey:[`config`],queryFn:async()=>{let e=await Q.api.config.$get();if(!e.ok)throw Error(`Failed to fetch config: ${e.statusText}`);return await e.json()}},on={queryKey:[`version`],queryFn:async()=>{let e=await Q.api.version.$get();if(!e.ok)throw Error(`Failed to fetch system version: ${e.statusText}`);return await e.json()}},sn={queryKey:[`cc`,`meta`],queryFn:async()=>{let e=await Q.api[`claude-code`].meta.$get();if(!e.ok)throw Error(`Failed to fetch system features: ${e.statusText}`);return await e.json()}},cn={queryKey:[`flags`],queryFn:async()=>{let e=await Q.api[`feature-flags`].$get();if(!e.ok)throw Error(`Failed to fetch feature flags: ${e.statusText}`);return await e.json()}},ln=(e,t)=>({queryKey:[`projects`,e,`sessions`,t,`agent-sessions`],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].sessions[`:sessionId`][`agent-sessions`].$get({param:{projectId:e,sessionId:t}});if(!n.ok)throw Error(`Failed to fetch agent sessions: ${n.statusText}`);return await n.json()}}),un=(e,t,n)=>({queryKey:[`projects`,e,`agent-sessions`,t,n],queryFn:async()=>{let r=await Q.api.projects[`:projectId`][`agent-sessions`][`:agentId`].$get({param:{projectId:e,agentId:t},query:{sessionId:n}});if(!r.ok)throw Error(`Failed to fetch agent session: ${r.statusText}`);return await r.json()}}),dn=(e,t)=>({queryKey:[`search`,e,t?.limit,t?.projectId],queryFn:async()=>{let n=await Q.api.search.$get({query:{q:e,...t?.limit===void 0?{}:{limit:t.limit.toString()},...t?.projectId!==void 0&&t.projectId!==``?{projectId:t.projectId}:{}}});if(!n.ok)throw Error(`Failed to search: ${n.statusText}`);return await n.json()}}),fn={queryKey:[`notifications`],queryFn:async()=>{let e=await Q.api.notifications.$get();if(!e.ok)throw Error(`Failed to fetch notifications: ${e.statusText}`);return await e.json()}},pn={queryKey:[`pending-permission-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-permission-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending permission requests`);return await e.json()}},mn=(e,t,n)=>({queryKey:[`generate-permission-rule`,e,t,n],queryFn:async()=>{let r=await Q.api[`claude-code`][`generate-permission-rule`].$post({json:{toolName:e,toolInput:t,projectId:n}});if(!r.ok)throw Error(`Failed to generate permission rule`);return await r.json()}}),hn={queryKey:[`pending-question-requests`],queryFn:async()=>{let e=await Q.api[`claude-code`][`pending-question-requests`].$get();if(!e.ok)throw Error(`Failed to fetch pending question requests`);return await e.json()}},gn=(e,t)=>({queryKey:[`projects`,e,`files`,t],queryFn:async()=>{let n=await Q.api.projects[`:projectId`].files.$get({param:{projectId:e},query:{filePath:t}});if(!n.ok)throw Error(`Failed to fetch file content`);return await n.json()}}),_n=({children:e})=>{let t=jt(Nt),{data:n}=We({queryKey:$.queryKey,queryFn:$.queryFn});return(0,i.useEffect)(()=>{t({authEnabled:n.authEnabled,authenticated:n.authenticated,checked:!0})},[n,t]),(0,H.jsx)(H.Fragment,{children:e})},vn=()=>{let e=At(Nt),t=U(),n=f(),r=W({mutationFn:async e=>{await Q.api.auth.login.$post({json:{password:e}})},onSuccess:async()=>{await t.invalidateQueries({queryKey:$.queryKey}),n({to:`/projects`})}}),i=W({mutationFn:async()=>{await Q.api.auth.logout.$post(),await t.invalidateQueries({queryKey:$.queryKey})},onSuccess:()=>{n({to:`/login`})}});return{authEnabled:e.authEnabled,isAuthenticated:e.authenticated,login:r.mutateAsync,logout:i.mutateAsync}};export{E as $,At as A,U as B,Xt as C,Q as D,Kt as E,W as F,L as G,be as H,We as I,se as J,le as K,Ue as L,J as M,yt as N,Nt as O,Tt as P,D as Q,Re as R,dn as S,on as T,ge as U,Te as V,R as W,x as X,ce as Y,O as Z,fn as _,sn as a,h as at,Yt as b,Jt as c,f as ct,gn as d,a as dt,ee as et,mn as f,l as ft,nn as g,tn as h,s as ht,un as i,N as it,jt as j,Mt as k,cn as l,d as lt,$t as m,o as mt,vn as n,k as nt,Zt as o,m as ot,en as p,c as pt,oe as q,ln as r,w as rt,an as s,p as st,_n as t,b as tt,rn as u,u as ut,pn as v,Qt as w,qt as x,hn as y,ke as z};
@@ -1 +0,0 @@
1
- import{d as e}from"./markdown-parser-vendor-Dm3WZMeS.js";import{n as t}from"./dist-B0PGU2Rq.js";import{t as n}from"./createLucideIcon-CRmASjPp.js";import{a as r,i,n as a,o,r as s,t as c}from"./card-5CIj0Vrs.js";var l=n(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),u=n(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),d=e(),f=({message:e=(0,d.jsx)(t,{id:`notfound.default.title`}),description:n=(0,d.jsx)(t,{id:`notfound.default.description`})})=>(0,d.jsx)(`div`,{className:`flex min-h-screen items-center justify-center p-4`,children:(0,d.jsxs)(c,{className:`w-full max-w-2xl`,children:[(0,d.jsx)(i,{children:(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(l,{className:`size-6 text-muted-foreground`}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(r,{children:e}),(0,d.jsx)(s,{children:n})]})]})}),(0,d.jsx)(a,{className:`space-y-4`,children:(0,d.jsx)(`div`,{className:`flex gap-2`,children:(0,d.jsxs)(o,{onClick:()=>{window.location.href=`/`},variant:`default`,children:[(0,d.jsx)(u,{}),(0,d.jsx)(t,{id:`notfound.button.go_home`})]})})})]})});export{u as n,f as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{f as t}from"./markdown-parser-vendor-Dm3WZMeS.js";var n=e(t()),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=(0,n.createContext)({}),u=()=>(0,n.useContext)(l),d=(0,n.forwardRef)(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:a,className:o=``,children:l,iconNode:d,...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=u()??{},y=a??g?Number(i??h)*24/Number(t??m):i??h;return(0,n.createElement)(`svg`,{ref:p,...s,width:t??m??s.width,height:t??m??s.height,stroke:e??_,strokeWidth:y,className:r(`lucide`,v,o),...!l&&!c(f)&&{"aria-hidden":`true`},...f},[...d.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(l)?l:[l]])}),f=(e,t)=>{let a=(0,n.forwardRef)(({className:a,...s},c)=>(0,n.createElement)(d,{ref:c,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,a),...s}));return a.displayName=o(e),a};export{f as t};