@nervekit/desktop 0.43.0 → 0.43.1
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.
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/components.d.ts +2 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/index.d.ts +3 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-source.d.ts +43 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-view.svelte.d.ts +22 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-window.d.ts +77 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/terminal-text.svelte.d.ts +6 -0
- package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/terminal/ansi.d.ts +4 -0
- package/dist/builtin/configure-nerve/reference/extensions/components.md +2 -1
- package/dist/builtin/configure-nerve/reference/extensions/scripts/nerve-version.json +1 -1
- package/dist/{chunk-XIVWNWL7.js → chunk-3LWB5SGT.js} +3 -18
- package/dist/{chunk-EBDLSTDH.js → chunk-WQHOXPLV.js} +549 -236
- package/dist/{chunk-HKBJTS2Z.js → chunk-ZTG7VIGB.js} +1 -1
- package/dist/daemon.js +3 -3
- package/dist/main.js +2 -2
- package/dist/web/assets/AsyncBashCenterHost-BlxXoXd6.js +2 -0
- package/dist/web/assets/{ConversationListItem-DALhochc.js → ConversationListItem-DfSMoYfe.js} +1 -1
- package/dist/web/assets/{ConversationsWorkbenchPanel-ChtoTW2H.js → ConversationsWorkbenchPanel-BOIMwRZx.js} +1 -1
- package/dist/web/assets/{DiscoverCenterHost-Bju7ypB-.js → DiscoverCenterHost-Bi6audxE.js} +1 -1
- package/dist/web/assets/{ExtensionPageCenterHost-BO-5q4j_.js → ExtensionPageCenterHost-DEg-LHcU.js} +1 -1
- package/dist/web/assets/{FileCenterComposedHost-BxLlLMBI.js → FileCenterComposedHost-CPwzMZI9.js} +1 -1
- package/dist/web/assets/FilesWorkbenchPanel-DnKQd6QC.js +12 -0
- package/dist/web/assets/{GitDiffCenterHost-D8i3Jq9A.js → GitDiffCenterHost-DtsFPa1z.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-CtZPJKqJ.js → GitWorkbenchPanel-BfJKdIkE.js} +1 -1
- package/dist/web/assets/LaunchCenterHost-C5Bd9ELF.js +1 -0
- package/dist/web/assets/LaunchConfigurationNotice-Dp3rBKil.js +1 -0
- package/dist/web/assets/LaunchOutputPane-BuCSQcxg.js +2 -0
- package/dist/web/assets/LaunchesWorkbenchPanel-CMd3Xcbp.js +1 -0
- package/dist/web/assets/{LogsCenterHost-xynA0TWK.js → LogsCenterHost-Be6EbsrZ.js} +1 -1
- package/dist/web/assets/{MermaidCenterHost-kAV1ocvE.js → MermaidCenterHost-BdQ8CGeb.js} +1 -1
- package/dist/web/assets/{MobileFilesBody-CiwIT8Vf.js → MobileFilesBody-C1q-YRaD.js} +1 -1
- package/dist/web/assets/{MobileFilesHost-DvQOpQFH.js → MobileFilesHost-DK769osZ.js} +1 -1
- package/dist/web/assets/MobileLaunchOutputHost-BLDX3-Tn.js +1 -0
- package/dist/web/assets/MobileLaunchesHost-Dv2gfOEY.js +2 -0
- package/dist/web/assets/{MobileNoteEditorHost-DSuZ0mU5.js → MobileNoteEditorHost-ZRzzwCYD.js} +1 -1
- package/dist/web/assets/{MobileNotesHost-Lg699XCv.js → MobileNotesHost-COOtVfAp.js} +1 -1
- package/dist/web/assets/{MobileSettingsHost-Bv1P74ck.js → MobileSettingsHost-BU2lCcG2.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageHost-DudFqhZC.js → MobileSettingsPageHost-BC5LOq7Y.js} +1 -1
- package/dist/web/assets/{NotesWorkbenchPanel-C8sctQWR.js → NotesWorkbenchPanel-BiTDbfjj.js} +1 -1
- package/dist/web/assets/{PullRequestCenterHost-BWJ-exw1.js → PullRequestCenterHost-DV3V3yxm.js} +1 -1
- package/dist/web/assets/{PullRequestsWorkbenchPanel-8Fb0-hW3.js → PullRequestsWorkbenchPanel-Dpvt9W-q.js} +1 -1
- package/dist/web/assets/{SearchWorkbenchPanel-B35YmwtL.js → SearchWorkbenchPanel-Bfj8fwPg.js} +1 -1
- package/dist/web/assets/{SettingsCenterHost-BuiirrId.js → SettingsCenterHost-sHWZehrB.js} +1 -1
- package/dist/web/assets/{SystemPromptCenterHost-BqKV92Ew.js → SystemPromptCenterHost-CA9i8UbB.js} +1 -1
- package/dist/web/assets/{ThemePreviewPicker-C6J0H91i.js → ThemePreviewPicker-PySjP6aS.js} +1 -1
- package/dist/web/assets/{adapters-C5HB2cBr.js → adapters-fVomUv3-.js} +1 -1
- package/dist/web/assets/{agent-profiles.svelte-DjdXLJnE.js → agent-profiles.svelte-CenutfXA.js} +1 -1
- package/dist/web/assets/{appearance.svelte-fB4gKc-X.js → appearance.svelte-BKxiMJ3c.js} +1 -1
- package/dist/web/assets/{center-tabs.svelte-8YpJhA1o.js → center-tabs.svelte-i0d5hUO3.js} +1 -1
- package/dist/web/assets/{channel-3Wv484LF.js → channel-DB8mSlhP.js} +2 -2
- package/dist/web/assets/{client-CjIsgPXA.js → client-DHxa8CWS.js} +1 -1
- package/dist/web/assets/{code-BDTZAlQg.js → code-CsVM8hq8.js} +2 -2
- package/dist/web/assets/{conversation-connection-Dm9Zr6Yb.js → conversation-connection-CaV3KY7Z.js} +1 -1
- package/dist/web/assets/{discover-Cwv6pB0p.js → discover-Do0oQbdF.js} +1 -1
- package/dist/web/assets/{dist-BENZZeCy.js → dist-B887qHIr.js} +1 -1
- package/dist/web/assets/{dist-CIK1TmOX.js → dist-Bg8Vm0DE.js} +1 -1
- package/dist/web/assets/{dist-DoKRJEPu.js → dist-C2z70795.js} +1 -1
- package/dist/web/assets/{dist-DUPZ8ZaX.js → dist-CcBabmlO.js} +1 -1
- package/dist/web/assets/{dist-BBlCv_-z.js → dist-HSfz5y1D.js} +1 -1
- package/dist/web/assets/{dist-BB4fpXjy.js → dist-HUxdivoH.js} +1 -1
- package/dist/web/assets/{dist-BqcaQXZ-.js → dist-wvfFRict.js} +1 -1
- package/dist/web/assets/{extension-themes.svelte-D2TAUtUA.js → extension-themes.svelte-nXDPOl_E.js} +1 -1
- package/dist/web/assets/{file-tabs.svelte-DxL_vZZv.js → file-tabs.svelte-BxCAtif2.js} +2 -2
- package/dist/web/assets/{files-vq7_WbHL.js → files-DcUCbPX1.js} +1 -1
- package/dist/web/assets/filesystem-9b72Tdkw.js +1 -0
- package/dist/web/assets/{git-store.svelte-D9S4P9gI.js → git-store.svelte-DIVFeLGG.js} +1 -1
- package/dist/web/assets/{index-B8XniJoh.js → index-6mIS-NWJ.js} +108 -108
- package/dist/web/assets/index-D2aeJHnc.css +1 -0
- package/dist/web/assets/launches-Dafgn_my.js +5 -0
- package/dist/web/assets/{launches.api-C4z0obJK.js → launches.api-ZZ-IwIQ_.js} +1 -1
- package/dist/web/assets/log-view-Dqspnrs0.js +1 -0
- package/dist/web/assets/{logs.api-BtGxtYFi.js → logs.api-BxN21LL0.js} +1 -1
- package/dist/web/assets/{maintenance-state.svelte-BusQWeCR.js → maintenance-state.svelte-BAKtNG-i.js} +1 -1
- package/dist/web/assets/{menu-icons-DLuZ586C.js → menu-icons-tnCN992t.js} +1 -1
- package/dist/web/assets/page-tabs.svelte-wduGZwmi.js +4 -0
- package/dist/web/assets/{popover-panel-SA7quIc1.js → popover-panel-DO5nPkvA.js} +1 -1
- package/dist/web/assets/pr-view-loader.svelte-RSHgeFYM.js +1 -0
- package/dist/web/assets/{progress-BZbo8ynI.js → progress-CRuzrJQt.js} +1 -1
- package/dist/web/assets/{scratch-notes-state.svelte-B4NySamQ.js → scratch-notes-state.svelte-BcqgnE6z.js} +1 -1
- package/dist/web/assets/{scratch-notes.api-BMBs2yoU.js → scratch-notes.api-D9wtv1Mn.js} +1 -1
- package/dist/web/assets/{settings-Cu_0wNkX.js → settings-CKsESd2i.js} +1 -1
- package/dist/web/assets/{settings-DTw27q0i.js → settings-Crny2xGb.js} +1 -1
- package/dist/web/assets/{settings-scope-Bz4U5ImL.js → settings-scope-BiY5kIdC.js} +1 -1
- package/dist/web/assets/shell-layout.svelte-9B3T60gv.js +2 -0
- package/dist/web/assets/{views-DIrSFdZB.js → views-Bl6CiPE0.js} +1 -1
- package/dist/web/assets/{workbench-connection-BpvUZMVX.js → workbench-connection-CyMud_mZ.js} +1 -1
- package/dist/web/assets/{workspace-uXAUsF3x.js → workspace-V-yCOfn1.js} +1 -1
- package/dist/web/assets/workspace-actions.svelte-D8-Agx2d.js +1 -0
- package/dist/web/assets/{workspace-selectors.svelte-B90FdGfV.js → workspace-selectors.svelte-DQ1mQdvX.js} +1 -1
- package/dist/web/index.html +36 -37
- package/dist/web/sw.js +1 -1
- package/dist/worker.js +2 -2
- package/package.json +7 -7
- package/dist/web/assets/AsyncBashCenterHost-Dcx6zVCo.js +0 -2
- package/dist/web/assets/FilesWorkbenchPanel-jyqwIQAe.js +0 -12
- package/dist/web/assets/LaunchCenterHost-CSy1io6s.js +0 -1
- package/dist/web/assets/LaunchConfigurationNotice-DugBa05c.js +0 -1
- package/dist/web/assets/LaunchesWorkbenchPanel-CNqGG_AP.js +0 -1
- package/dist/web/assets/LogStream-C70iQmUI.css +0 -1
- package/dist/web/assets/LogStream-DfJ4LiCv.js +0 -1
- package/dist/web/assets/MobileLaunchOutputHost-pFJgIV1_.js +0 -1
- package/dist/web/assets/MobileLaunchesHost-0VtdW0x8.js +0 -2
- package/dist/web/assets/filesystem-DiVFVMn3.js +0 -1
- package/dist/web/assets/index-DC_ohlBG.css +0 -1
- package/dist/web/assets/launches-CmB4KShL.js +0 -5
- package/dist/web/assets/launches.svelte-D2bNAphM.js +0 -2
- package/dist/web/assets/page-tabs.svelte-Cc5F8hMx.js +0 -4
- package/dist/web/assets/pr-view-loader.svelte-eOmDNaGf.js +0 -1
- package/dist/web/assets/shell-layout.svelte-Dyx_fbRn.js +0 -2
- package/dist/web/assets/workspace-actions.svelte-DE0mQsY6.js +0 -1
- /package/dist/{chunk-EBDLSTDH.js.LEGAL.txt → chunk-WQHOXPLV.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./workbench-connection-BpvUZMVX.js";var t=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(){}},n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=n;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 i(e){setTimeout(e,0)}var a=typeof window>`u`||`Deno`in globalThis;function o(){}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return typeof e==`number`&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return typeof e==`function`?e(t):e}function d(e,t){return typeof e==`function`?e(t):e}function f(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(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 p(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(h(t.options.mutationKey)!==h(a))return!1}else if(!g(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function m(e,t){return(t?.queryKeyHashFn||h)(e)}function h(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>g(e[n],t[n])):!1}var _=Object.prototype.hasOwnProperty;function v(e,t){if(e===t)return e;let n=y(e)&&y(t);if(!n&&!(b(e)&&b(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:_.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=v(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!x(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!x(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function x(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{r.setTimeout(t,e)})}function te(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:v(e,t)}function S(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function C(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var w=Symbol();function T(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===w?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var E=new class extends t{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!a&&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`}};function ne(){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 D=i;function O(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=D,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 k=O(),A=new class extends t{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!a&&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 j(e){return Math.min(1e3*2**e,3e4)}function M(e){return(e??`online`)!==`online`||A.isOnline()}var N=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function P(e){let t=!1,n=0,r,i=ne(),o=()=>i.status!==`pending`,s=t=>{if(!o()){let n=new N(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>E.isFocused()&&(e.networkMode===`always`||A.isOnline())&&e.canRun(),d=()=>M(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),i.resolve(e))},p=e=>{o()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())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(o())return;let i=e.retry??(a?0:3),s=e.retryDelay??j,c=typeof s==`function`?s(n,r):s,l=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!l?p(r):(n++,e.onFail?.(n,r),ee(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()}))})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var F=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c(this.gcTime)&&(this.#e=r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#e&&=(r.clearTimeout(this.#e),void 0)}},I=class extends F{#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=R(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=R(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=te(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(o).catch(o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>d(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===w||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>u(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:!l(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.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({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=T(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.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=P({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof N&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({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 N){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(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,...L(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:`success`,...!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`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:M(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function R(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`}}function z(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=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=T(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();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?C:S;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,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:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(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 V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var H=class extends F{#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||U(),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=P({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}),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{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error: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),k.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var W=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new H({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=G(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){k.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>p(t,e))}findAll(e={}){return this.getAll().filter(t=>p(e,t))}notify(e){k.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return k.batch(()=>Promise.all(e.map(e=>e.continue().catch(o))))}};function G(e){return e.options.scope?.id}var K=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new I({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){k.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>f(e,t)):t}notify(e){k.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){k.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){k.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},q=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new K,this.#t=e.mutationCache||new W,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=E.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=A.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(u(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=s(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return k.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;k.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return k.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=k.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(o).catch(o)}invalidateQueries(e,t={}){return k.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=k.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(o)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(o)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(u(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(o).catch(o)}fetchInfiniteQuery(e){return e.behavior=z(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(o).catch(o)}ensureInfiniteQueryData(e){return e.behavior=z(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return A.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(h(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(h(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===w&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};async function J(t){return e(`git.operation.start`,t)}async function Y(t){return e(`git.operation.bulk.start`,t)}async function X(t){return e(`git.operation.cancel`,{operationId:t})}var Z=12e4;async function re(t){return await e(`git.workspace.watch.sync`,t)}async function ie(t){return await e(`git.workspace.watch.clear`,{projectId:t})}async function ae(t){return await e(`git.workspace.snapshot.get`,{projectId:t},{timeoutMs:Z})}async function oe(t,n){return await e(`git.repo.detail.get`,{projectId:t,repo:n},{timeoutMs:Z})}async function se(t,n,r=!0){return await e(`git.workspace.refresh`,{projectId:t,...n?{repo:n}:{},force:r},{timeoutMs:Z})}async function ce(t,n=!1){return await e(`git.project.files.status.get`,{projectId:t,refresh:n},{timeoutMs:Z})}async function le(t,n){return await e(`git.branches.list`,{projectId:t,repo:n})}async function ue(t,n,r){return await e(`git.branch.create`,{projectId:t,repo:n,name:r})}async function de(t,n,r){return await e(`git.branch.switch`,{projectId:t,repo:n,name:r})}async function fe(t,n,r){return await e(`git.branch.delete`,{projectId:t,repo:n,name:r})}async function pe(t,n,r,i){return await e(`git.worktree.create`,{projectId:t,repo:n,branch:r,...i?{id:i}:{}})}async function me(t,n,r){return await e(`git.worktree.remove`,{projectId:t,repo:n,force:r.force,deleteBranch:r.deleteBranch})}async function he(t,n,r,i){return await e(`git.stash.create`,{projectId:t,repo:n,area:r,...i?{paths:[...i]}:{}})}async function ge(t,n,r,i){return await e(`git.stash.apply`,{projectId:t,repo:n,index:r,expectedHash:i})}async function _e(t,n,r,i){return await e(`git.stash.drop`,{projectId:t,repo:n,index:r,expectedHash:i})}async function ve(t,n,r,i){return await e(`git.file.diff.get`,{projectId:t,repo:n,path:r,area:i})}async function ye(t,n,r){return await e(`git.file.stage`,{projectId:t,repo:n,path:r})}async function be(t,n,r){return await e(`git.file.unstage`,{projectId:t,repo:n,path:r})}async function xe(t,n,r){return await e(`git.file.discard`,{projectId:t,repo:n,path:r})}async function Se(t,n){return await e(`github.status.get`,{projectId:t,repo:n})}async function Ce(t,n,r){return await e(`github.pr.list`,{projectId:t,repo:n,filters:r})}async function Q(t,n,r,i){return await e(t,{projectId:n,repo:r,number:i})}async function we(t,n,r){return await e(`github.pr.initial.get`,{projectId:t,repo:n,number:r})}var Te=(e,t,n)=>Q(`github.pr.core.get`,e,t,n),Ee=(e,t,n)=>Q(`github.pr.conversation.get`,e,t,n),De=(e,t,n)=>Q(`github.pr.overview.get`,e,t,n),$=(e,t,n)=>Q(`github.pr.commits.get`,e,t,n),Oe=(e,t,n)=>Q(`github.pr.checks.get`,e,t,n);async function ke(t){return await e(`github.pr.file.diff.get`,{projectId:t.projectId,repo:t.repo,number:t.number,path:t.path,...t.previousPath?{previousPath:t.previousPath}:{},status:t.status,expectedBaseRefOid:t.expectedBaseRefOid,expectedHeadRefOid:t.expectedHeadRefOid,...t.expectedHeadRepository?{expectedHeadRepository:t.expectedHeadRepository}:{}})}async function Ae(t,n,r){return await e(`github.pr.files.get`,{projectId:t,repo:n,number:r})}async function je(t,n,r,i,a){return await e(`github.pr.merge`,{projectId:t,repo:n,number:r,method:i,expectedHeadOid:a})}function Me(t,n){return e(`github.pr.snapshot.get`,{projectId:t,repo:n})}function Ne(t){return e(`github.pr.watch.sync`,t)}function Pe(t,n){return e(`github.pr.watch.clear`,{projectId:t,repo:n})}function Fe(t,n,r){return e(`github.pr.refresh`,{projectId:t,repo:n,number:r})}function Ie(t,n,r){return e(`github.pr.expect`,{projectId:t,repo:n,branch:r})}var Le=new q({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}),Re={clientConfig:[`client-config`],workspace:[`workspace`],latestRelease:[`status`,`latest-release`],slashCompletions:[`completions`,`slash`],git:{project:e=>[`git`,e],repo:(e,t)=>[`git`,e,`repo`,t],branches:(e,t)=>[`git`,e,`repo`,t,`branches`],githubStatus:(e,t)=>[`git`,e,`repo`,t,`github-status`],pr:(e,t,n)=>[`git`,e,`repo`,t,`pr`,n],prInitial:(e,t,n)=>[`git`,e,`repo`,t,`pr`,n,`initial`],prSection:(e,t,n,r)=>[`git`,e,`repo`,t,`pr`,n,r],prFileDiff:(e,t,n,r,i,a,o,s)=>[`git`,e,`repo`,t,`pr`,n,`file-diff`,r,i,a,o??``,s],prFiles:(e,t,n,r,i)=>[`git`,e,`repo`,t,`pr`,n,`files`,r,i],prHeadSection:(e,t,n,r,i)=>[`git`,e,`repo`,t,`pr`,n,r,i]}};export{je as A,be as B,we as C,ce as D,Se as E,Y as F,J as I,de as L,Fe as M,me as N,le as O,ye as P,re as R,Ae as S,Me as T,q as V,Oe as _,ie as a,Te as b,he as c,xe as d,_e as f,ae as g,oe as h,X as i,se as j,Ce as k,pe as l,ve as m,Re as n,Pe as o,Ie as p,ge as r,ue as s,Le as t,fe as u,$ as v,De as w,ke as x,Ee as y,Ne as z};
|
|
1
|
+
import{o as e}from"./workbench-connection-CyMud_mZ.js";var t=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(){}},n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=n;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 i(e){setTimeout(e,0)}var a=typeof window>`u`||`Deno`in globalThis;function o(){}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return typeof e==`number`&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return typeof e==`function`?e(t):e}function d(e,t){return typeof e==`function`?e(t):e}function f(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(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 p(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(h(t.options.mutationKey)!==h(a))return!1}else if(!g(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function m(e,t){return(t?.queryKeyHashFn||h)(e)}function h(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>g(e[n],t[n])):!1}var _=Object.prototype.hasOwnProperty;function v(e,t){if(e===t)return e;let n=y(e)&&y(t);if(!n&&!(b(e)&&b(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:_.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=v(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!x(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!x(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function x(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{r.setTimeout(t,e)})}function te(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:v(e,t)}function S(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function C(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var w=Symbol();function T(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===w?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var E=new class extends t{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!a&&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`}};function ne(){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 D=i;function O(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=D,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 k=O(),A=new class extends t{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!a&&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 j(e){return Math.min(1e3*2**e,3e4)}function M(e){return(e??`online`)!==`online`||A.isOnline()}var N=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function P(e){let t=!1,n=0,r,i=ne(),o=()=>i.status!==`pending`,s=t=>{if(!o()){let n=new N(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>E.isFocused()&&(e.networkMode===`always`||A.isOnline())&&e.canRun(),d=()=>M(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),i.resolve(e))},p=e=>{o()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())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(o())return;let i=e.retry??(a?0:3),s=e.retryDelay??j,c=typeof s==`function`?s(n,r):s,l=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!l?p(r):(n++,e.onFail?.(n,r),ee(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()}))})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var F=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c(this.gcTime)&&(this.#e=r.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#e&&=(r.clearTimeout(this.#e),void 0)}},I=class extends F{#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=R(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=R(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=te(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(o).catch(o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>d(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===w||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>u(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:!l(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.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({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=T(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.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=P({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof N&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({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 N){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(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,...L(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:`success`,...!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`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),k.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:M(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function R(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`}}function z(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=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=T(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();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?C:S;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?V:B,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:B(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function B(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 V(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var H=class extends F{#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||U(),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=P({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}),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{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error: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),k.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var W=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new H({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=G(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=G(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){k.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>p(t,e))}findAll(e={}){return this.getAll().filter(t=>p(e,t))}notify(e){k.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return k.batch(()=>Promise.all(e.map(e=>e.continue().catch(o))))}};function G(e){return e.options.scope?.id}var K=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new I({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){k.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>f(e,t)):t}notify(e){k.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){k.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){k.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},q=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new K,this.#t=e.mutationCache||new W,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=E.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=A.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(u(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=s(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return k.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;k.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return k.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=k.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(o).catch(o)}invalidateQueries(e,t={}){return k.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=k.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(o)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(o)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(u(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(o).catch(o)}fetchInfiniteQuery(e){return e.behavior=z(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(o).catch(o)}ensureInfiniteQueryData(e){return e.behavior=z(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return A.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(h(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(h(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===w&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};async function J(t){return e(`git.operation.start`,t)}async function Y(t){return e(`git.operation.bulk.start`,t)}async function X(t){return e(`git.operation.cancel`,{operationId:t})}var Z=12e4;async function re(t){return await e(`git.workspace.watch.sync`,t)}async function ie(t){return await e(`git.workspace.watch.clear`,{projectId:t})}async function ae(t){return await e(`git.workspace.snapshot.get`,{projectId:t},{timeoutMs:Z})}async function oe(t,n){return await e(`git.repo.detail.get`,{projectId:t,repo:n},{timeoutMs:Z})}async function se(t,n,r=!0){return await e(`git.workspace.refresh`,{projectId:t,...n?{repo:n}:{},force:r},{timeoutMs:Z})}async function ce(t,n=!1){return await e(`git.project.files.status.get`,{projectId:t,refresh:n},{timeoutMs:Z})}async function le(t,n){return await e(`git.branches.list`,{projectId:t,repo:n})}async function ue(t,n,r){return await e(`git.branch.create`,{projectId:t,repo:n,name:r})}async function de(t,n,r){return await e(`git.branch.switch`,{projectId:t,repo:n,name:r})}async function fe(t,n,r){return await e(`git.branch.delete`,{projectId:t,repo:n,name:r})}async function pe(t,n,r,i){return await e(`git.worktree.create`,{projectId:t,repo:n,branch:r,...i?{id:i}:{}})}async function me(t,n,r){return await e(`git.worktree.remove`,{projectId:t,repo:n,force:r.force,deleteBranch:r.deleteBranch})}async function he(t,n,r,i){return await e(`git.stash.create`,{projectId:t,repo:n,area:r,...i?{paths:[...i]}:{}})}async function ge(t,n,r,i){return await e(`git.stash.apply`,{projectId:t,repo:n,index:r,expectedHash:i})}async function _e(t,n,r,i){return await e(`git.stash.drop`,{projectId:t,repo:n,index:r,expectedHash:i})}async function ve(t,n,r,i){return await e(`git.file.diff.get`,{projectId:t,repo:n,path:r,area:i})}async function ye(t,n,r){return await e(`git.file.stage`,{projectId:t,repo:n,path:r})}async function be(t,n,r){return await e(`git.file.unstage`,{projectId:t,repo:n,path:r})}async function xe(t,n,r){return await e(`git.file.discard`,{projectId:t,repo:n,path:r})}async function Se(t,n){return await e(`github.status.get`,{projectId:t,repo:n})}async function Ce(t,n,r){return await e(`github.pr.list`,{projectId:t,repo:n,filters:r})}async function Q(t,n,r,i){return await e(t,{projectId:n,repo:r,number:i})}async function we(t,n,r){return await e(`github.pr.initial.get`,{projectId:t,repo:n,number:r})}var Te=(e,t,n)=>Q(`github.pr.core.get`,e,t,n),Ee=(e,t,n)=>Q(`github.pr.conversation.get`,e,t,n),De=(e,t,n)=>Q(`github.pr.overview.get`,e,t,n),$=(e,t,n)=>Q(`github.pr.commits.get`,e,t,n),Oe=(e,t,n)=>Q(`github.pr.checks.get`,e,t,n);async function ke(t){return await e(`github.pr.file.diff.get`,{projectId:t.projectId,repo:t.repo,number:t.number,path:t.path,...t.previousPath?{previousPath:t.previousPath}:{},status:t.status,expectedBaseRefOid:t.expectedBaseRefOid,expectedHeadRefOid:t.expectedHeadRefOid,...t.expectedHeadRepository?{expectedHeadRepository:t.expectedHeadRepository}:{}})}async function Ae(t,n,r){return await e(`github.pr.files.get`,{projectId:t,repo:n,number:r})}async function je(t,n,r,i,a){return await e(`github.pr.merge`,{projectId:t,repo:n,number:r,method:i,expectedHeadOid:a})}function Me(t,n){return e(`github.pr.snapshot.get`,{projectId:t,repo:n})}function Ne(t){return e(`github.pr.watch.sync`,t)}function Pe(t,n){return e(`github.pr.watch.clear`,{projectId:t,repo:n})}function Fe(t,n,r){return e(`github.pr.refresh`,{projectId:t,repo:n,number:r})}function Ie(t,n,r){return e(`github.pr.expect`,{projectId:t,repo:n,branch:r})}var Le=new q({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}),Re={clientConfig:[`client-config`],workspace:[`workspace`],latestRelease:[`status`,`latest-release`],slashCompletions:[`completions`,`slash`],git:{project:e=>[`git`,e],repo:(e,t)=>[`git`,e,`repo`,t],branches:(e,t)=>[`git`,e,`repo`,t,`branches`],githubStatus:(e,t)=>[`git`,e,`repo`,t,`github-status`],pr:(e,t,n)=>[`git`,e,`repo`,t,`pr`,n],prInitial:(e,t,n)=>[`git`,e,`repo`,t,`pr`,n,`initial`],prSection:(e,t,n,r)=>[`git`,e,`repo`,t,`pr`,n,r],prFileDiff:(e,t,n,r,i,a,o,s)=>[`git`,e,`repo`,t,`pr`,n,`file-diff`,r,i,a,o??``,s],prFiles:(e,t,n,r,i)=>[`git`,e,`repo`,t,`pr`,n,`files`,r,i],prHeadSection:(e,t,n,r,i)=>[`git`,e,`repo`,t,`pr`,n,r,i]}};export{je as A,be as B,we as C,ce as D,Se as E,Y as F,J as I,de as L,Fe as M,me as N,le as O,ye as P,re as R,Ae as S,Me as T,q as V,Oe as _,ie as a,Te as b,he as c,xe as d,_e as f,ae as g,oe as h,X as i,se as j,Ce as k,pe as l,ve as m,Re as n,Pe as o,Ie as p,ge as r,ue as s,Le as t,fe as u,$ as v,De as w,ke as x,Ee as y,Ne as z};
|