nextclaw 0.18.0 → 0.18.2
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/cli/{index.js → app/index.js} +11531 -9137
- package/package.json +20 -20
- package/resources/USAGE.md +30 -3
- package/ui-dist/assets/ChannelsList-SQ7Oxotv.js +8 -0
- package/ui-dist/assets/DocBrowser-BCO2k6XD.js +1 -0
- package/ui-dist/assets/{DocBrowser-6ReNjvzF.js → DocBrowser-rDOjI3ga.js} +1 -1
- package/ui-dist/assets/{DocBrowserContext-B6SpA7Qs.js → DocBrowserContext-BUq3Wo8O.js} +1 -1
- package/ui-dist/assets/{LogoBadge-ByNLYg65.js → LogoBadge-DP8Ye7wJ.js} +1 -1
- package/ui-dist/assets/ModelConfig-C77Ae9ru.js +1 -0
- package/ui-dist/assets/ProviderScopedModelInput-CEnK61uo.js +1 -0
- package/ui-dist/assets/ProvidersList-BCupBayq.js +1 -0
- package/ui-dist/assets/RuntimeConfig-Ad-CAcmy.js +1 -0
- package/ui-dist/assets/SearchConfig-BfCz4wJ4.js +1 -0
- package/ui-dist/assets/SecretsConfig-DjmBIhyy.js +3 -0
- package/ui-dist/assets/{SessionsConfig-ChHQ7M5c.js → SessionsConfig-CvjxU40H.js} +2 -2
- package/ui-dist/assets/{book-open-BdcxxoQu.js → book-open-BE8M56IM.js} +1 -1
- package/ui-dist/assets/chat-page-JKC6ln-y.js +58 -0
- package/ui-dist/assets/chat-session-display-YcRMrAMa.js +1 -0
- package/ui-dist/assets/{chunk-JZWAC4HX-DK5HPmIK.js → chunk-JZWAC4HX-erTUn3b8.js} +1 -1
- package/ui-dist/assets/client-CszWMVKi.js +7 -0
- package/ui-dist/assets/config-split-page-BAGSzUR3.js +1 -0
- package/ui-dist/assets/{createLucideIcon-BSeTgkZW.js → createLucideIcon-CCiTGX8L.js} +1 -1
- package/ui-dist/assets/desktop-DfkLlkG2.js +1 -0
- package/ui-dist/assets/desktop-update-config-BXeGlqHD.js +1 -0
- package/ui-dist/assets/dialog-BghZFPch.js +5 -0
- package/ui-dist/assets/{dist-6TrrnPCR.js → dist-Dd9cr-kz.js} +1 -1
- package/ui-dist/assets/dist-ZwoAXs46.js +9 -0
- package/ui-dist/assets/{download-BhDxnyvU.js → download-D7LOizcW.js} +1 -1
- package/ui-dist/assets/es2015-CEAreese.js +41 -0
- package/ui-dist/assets/{external-link-BgErLCNT.js → external-link-qsnCMhw1.js} +1 -1
- package/ui-dist/assets/{hash-Bl7dr_UG.js → hash-0zjWsNl-.js} +1 -1
- package/ui-dist/assets/{i18n-eDHeDY0n.js → i18n-DvzXOGQX.js} +1 -1
- package/ui-dist/assets/index-DvVTC9FF.css +1 -0
- package/ui-dist/assets/index-lr6rQUSd.js +2 -0
- package/ui-dist/assets/key-round-BLe9D8ND.js +1 -0
- package/ui-dist/assets/loader-circle-wj7kARHv.js +1 -0
- package/ui-dist/assets/{logos-x89HbrZ4.js → logos-_v5b2SdG.js} +1 -1
- package/ui-dist/assets/marketplace-page-CAAk1Khc.js +1 -0
- package/ui-dist/assets/marketplace-page-CfCiq90S.js +49 -0
- package/ui-dist/assets/mcp-marketplace-page-D0Pp9Hs-.js +40 -0
- package/ui-dist/assets/play-o6NmwGTi.js +1 -0
- package/ui-dist/assets/plus-I9pBS4Fl.js +1 -0
- package/ui-dist/assets/{refresh-cw-C47QSEwg.js → refresh-cw-MNqgR3LZ.js} +1 -1
- package/ui-dist/assets/remote-C9fXm4V5.js +1 -0
- package/ui-dist/assets/{save-3S6-H3Xw.js → save-D4bObrmH.js} +1 -1
- package/ui-dist/assets/search-DxmL3IWE.js +1 -0
- package/ui-dist/assets/security-config-BUm6FFfl.js +1 -0
- package/ui-dist/assets/select-BILPf7zs.js +1 -0
- package/ui-dist/assets/setting-row-BATDgg4r.js +1 -0
- package/ui-dist/assets/skeleton-COKMAnJy.js +1 -0
- package/ui-dist/assets/{switch-BsLtHOH-.js → switch-CBOzecWS.js} +1 -1
- package/ui-dist/assets/{tabs-custom-D3HYMt6k.js → tabs-custom-Bx3cNhD-.js} +1 -1
- package/ui-dist/assets/tag-chip-zUaDE2-H.js +1 -0
- package/ui-dist/assets/{trash-2-G48scll7.js → trash-2-CQUgYyRn.js} +1 -1
- package/ui-dist/assets/use-infinite-scroll-loader-B5V2Klve.js +1 -0
- package/ui-dist/assets/useConfirmDialog-patAnl1g.js +1 -0
- package/ui-dist/assets/{useMutation-CBWjE2uj.js → useMutation-__AYv-Pz.js} +1 -1
- package/ui-dist/assets/x-BHUGQIUv.js +1 -0
- package/ui-dist/index.html +22 -22
- package/ui-dist/runtime-icons/claude.ico +0 -0
- package/ui-dist/runtime-icons/codex-openai.svg +6 -0
- package/ui-dist/runtime-icons/hermes-agent.png +0 -0
- package/ui-dist/assets/ChannelsList-Ita2Zm1_.js +0 -8
- package/ui-dist/assets/DocBrowser-BNwbPHf4.js +0 -1
- package/ui-dist/assets/MarketplacePage-CjX2MWww.js +0 -1
- package/ui-dist/assets/MarketplacePage-D0sDlYX4.js +0 -49
- package/ui-dist/assets/McpMarketplacePage-BGKJm1sJ.js +0 -40
- package/ui-dist/assets/ModelConfig-BzZenCH-.js +0 -1
- package/ui-dist/assets/ProviderScopedModelInput-Da7khnBA.js +0 -1
- package/ui-dist/assets/ProvidersList-BbVzRxjY.js +0 -1
- package/ui-dist/assets/RemoteAccessPage-BaDH_X1Q.js +0 -1
- package/ui-dist/assets/RuntimeConfig-F_XKGgLm.js +0 -1
- package/ui-dist/assets/SearchConfig-BGkzXQP-.js +0 -1
- package/ui-dist/assets/SecretsConfig-D281Rotl.js +0 -3
- package/ui-dist/assets/app-query-client-VnFElj4E.js +0 -1
- package/ui-dist/assets/chat-page-Doe0yTtB.js +0 -58
- package/ui-dist/assets/chat-session-display-cw78aiI_.js +0 -1
- package/ui-dist/assets/client-_i4MU2bB.js +0 -7
- package/ui-dist/assets/config-DtIQwrHF.js +0 -1
- package/ui-dist/assets/config-layout-CHs0mAaR.js +0 -1
- package/ui-dist/assets/desktop-update-config-Dpcf4BKG.js +0 -1
- package/ui-dist/assets/dist-ccBFUi-o.js +0 -9
- package/ui-dist/assets/index-CF9xve0E.js +0 -6
- package/ui-dist/assets/index-FgA52VBt.css +0 -1
- package/ui-dist/assets/infiniteQueryBehavior-ZDS92Qpp.js +0 -1
- package/ui-dist/assets/loader-circle-ACM1s51e.js +0 -1
- package/ui-dist/assets/page-layout-vZnghcFy.js +0 -1
- package/ui-dist/assets/play-CFUwCA2E.js +0 -1
- package/ui-dist/assets/plus-rYsv72JG.js +0 -1
- package/ui-dist/assets/popover-Bg1VoTZ6.js +0 -1
- package/ui-dist/assets/refresh-ccw-DT98i__E.js +0 -1
- package/ui-dist/assets/rotate-cw-JtFzpNn6.js +0 -1
- package/ui-dist/assets/search-3kFR_zh9.js +0 -1
- package/ui-dist/assets/security-config-BWaiARNk.js +0 -1
- package/ui-dist/assets/select-DJ2MUjBB.js +0 -41
- package/ui-dist/assets/skeleton-ByQepn0M.js +0 -1
- package/ui-dist/assets/status-dot-vbanNPFU.js +0 -1
- package/ui-dist/assets/use-infinite-scroll-loader-DkNhD-42.js +0 -1
- package/ui-dist/assets/useConfirmDialog-BkvTN-vd.js +0 -1
- package/ui-dist/assets/x-ByDbItbq.js +0 -1
- /package/dist/cli/{index.d.ts → app/index.d.ts} +0 -0
- /package/ui-dist/assets/{config-hints-BhTmc9P1.js → config-hints-DSQQbeOA.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,p as t,u as n}from"./i18n-DvzXOGQX.js";import{L as r}from"./client-CszWMVKi.js";import{t as i}from"./createLucideIcon-CCiTGX8L.js";import{t as a}from"./loader-circle-wj7kARHv.js";var o=i(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),s=t();function c({status:t,className:r}){let i=e(t===`running`?`sessionsRunStatusRunning`:`sessionsRunStatusQueued`);return(0,s.jsxs)(`span`,{className:n(`inline-flex h-3.5 w-3.5 items-center justify-center text-gray-400`,r),title:i,"aria-label":i,children:[(0,s.jsx)(a,{className:`h-3 w-3 animate-spin`}),(0,s.jsx)(`span`,{className:`sr-only`,children:i})]})}var l=function(e){return e.CALL=`call`,e.RESULT=`result`,e.PARTIAL_CALL=`partial-call`,e.ERROR=`error`,e.CANCELLED=`cancelled`,e}({});function u(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function d(e){return u(e)}function f(e){let t=u(e);if(!t)return null;let n=t.replace(/[\\/]+$/,``);if(!n)return t;let r=n.split(/[\\/]/).filter(Boolean);return r[r.length-1]??n}var p=new Set([`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`]);function m(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??{})}catch{return String(e??``)}}function h(e){return`${r}/api/ncp/assets/content?${new URLSearchParams({uri:e}).toString()}`}function g(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _(e){let{metadata:t}=e;return!t||typeof t!=`object`||Array.isArray(t)?null:t}function v(e){let t=_(e);return t?g(t.preferred_model)??g(t.preferredModel)??g(t.model):null}function y(e){let t=_(e);if(!t)return null;let n=g(t.preferred_thinking)??g(t.thinking)??g(t.thinking_level)??g(t.thinkingLevel);if(!n)return null;let r=n.toLowerCase();return p.has(r)?r:null}function b(e){let t=_(e);return t?g(t.label):null}function x(e){let t=_(e);return t?d(t.project_root??t.projectRoot):null}function S(e){let t=_(e);return t?g(t.ui_last_read_at):null}function C(e){let t=_(e);return t?g(t.runtime)??g(t.session_type)??g(t.sessionType)??`native`:`native`}function w(e){let t=_(e);return t?g(t.parent_session_id)??g(t.parentSessionId):null}function T(e){let t=_(e);return t?g(t.spawned_by_request_id)??g(t.spawnedByRequestId):null}function E(e){let t=_(e);return t?t.child_session_promoted===!0:!1}function D(e){if(e===`heartbeat`)return{type:`heartbeat`};if(e.startsWith(`cron:`))return{type:`cron`};if(e.startsWith(`agent:`)){let t=e.split(`:`);if(t.length>=3){let e=t[2];if(e&&e!==`main`&&e!==`direct`)return{channel:e}}}return{}}function O(e){return e.state===`cancelled`?l.CANCELLED:e.state===`result`?l.RESULT:e.state===`partial-call`?l.PARTIAL_CALL:l.CALL}function k(e){let t=[];for(let n of e){if(n.type===`text`){t.push({type:`text`,text:n.text});continue}if(n.type===`rich-text`){t.push({type:`text`,text:n.text});continue}if(n.type===`reasoning`){t.push({type:`reasoning`,reasoning:n.text,details:[]});continue}if(n.type===`source`){t.push({type:`source`,source:{sourceType:`url`,id:n.url??n.title??Math.random().toString(36).slice(2,8),url:n.url??``,...n.title?{title:n.title}:{}}});continue}if(n.type===`file`&&n.contentBase64){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:n.contentBase64,...n.url?{url:n.url}:{},...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.url){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:n.url,...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.assetUri){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:h(n.assetUri),...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`step-start`){t.push({type:`step-start`});continue}n.type===`tool-invocation`&&t.push({type:`tool-invocation`,toolInvocation:{status:O(n),toolCallId:n.toolCallId??`${n.toolName}-${Math.random().toString(36).slice(2,8)}`,toolName:n.toolName,args:m(n.args),result:n.result}})}return t}function A(e){return e===`service`?`system`:e===`tool`?`assistant`:e}function j(e){return{id:e.id,role:A(e.role),parts:k(e.parts),meta:{source:`stream`,status:e.status,sessionKey:e.sessionId,timestamp:e.timestamp}}}function M(e){let t=b(e),n=v(e),r=y(e),i=x(e),a=S(e),o=g(e.lastMessageAt),s=f(i),c=D(e.sessionId),l=w(e),u=T(e),d=E(e);return{key:e.sessionId,createdAt:e.updatedAt,updatedAt:e.updatedAt,...o?{lastMessageAt:o}:{},...a?{readAt:a}:{},...typeof e.agentId==`string`&&e.agentId.trim().length>0?{agentId:e.agentId.trim()}:{},...t?{label:t}:{},...c,...n?{preferredModel:n}:{},...r?{preferredThinking:r}:{},...i?{projectRoot:i}:{},...s?{projectName:s}:{},sessionType:C(e),sessionTypeMutable:!1,isChildSession:!!l,...d?{isPromotedChildSession:d}:{},...l?{parentSessionId:l}:{},...u?{spawnedByRequestId:u}:{},messageCount:e.messageCount}}function N(e){return e.map(M)}function P(){return`ncp-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function F(e){if(e.label&&e.label.trim())return e.label.trim();let t=e.key.split(`:`);return t[t.length-1]||e.key}function I(e){return e.trim().toLowerCase()}function L(e,t){let n=I(t);return n?[e.key,F(e),e.projectRoot??``,e.projectName??``].map(I).some(e=>e.includes(n)):!0}export{M as a,d as c,N as i,c as l,L as n,P as o,j as r,f as s,F as t,o as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-eDHeDY0n.js";var n=`modulepreload`,r=function(e){return`/`+e},i={},a=function(e,t,a){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=r(t,a),t in i)return;i[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(a)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:n,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},o=e(t(),1),s=`popstate`;function c(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return p(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:m(t)}return g(t,n,null,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substring(2,10)}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?h(t):t,state:n,key:t&&t.key||r||d()}}function m({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function h(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,c=`POP`,l=null,u=d();u??(u=0,o.replaceState({...o.state,idx:u},``));function d(){return(o.state||{idx:null}).idx}function m(){c=`POP`;let e=d(),t=e==null?null:e-u;u=e,l&&l({action:c,location:y.location,delta:t})}function h(e,t){c=`PUSH`;let r=p(y.location,e,t);n&&n(r,e),u=d()+1;let s=f(r,u),m=y.createHref(r);try{o.pushState(s,``,m)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(m)}a&&l&&l({action:c,location:y.location,delta:1})}function g(e,t){c=`REPLACE`;let r=p(y.location,e,t);n&&n(r,e),u=d();let i=f(r,u),s=y.createHref(r);o.replaceState(i,``,s),a&&l&&l({action:c,location:y.location,delta:0})}function v(e){return _(e)}let y={get action(){return c},get location(){return e(i,o)},listen(e){if(l)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,m),l=e,()=>{i.removeEventListener(s,m),l=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:h,replace:g,go(e){return o.go(e)}};return y}function _(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),l(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:m(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function v(e,t,n=`/`){return y(e,t,n,!1)}function y(e,t,n,r){let i=D((typeof t==`string`?h(t):t).pathname||`/`,n);if(i==null)return null;let a=x(e);C(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=le(i);o=se(a[e],t,r)}return o}function b(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function x(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;l(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let u=j([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),x(e.children,t,d,u,o)),!(e.path==null&&!e.index)&&t.push({path:u,score:ae(u,e.index),routesMeta:d})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of S(e.path))a(e,t,!0,n)}),t}function S(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=S(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function C(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var w=/^:[\w-]+$/,T=3,ee=2,te=1,ne=10,re=-2,ie=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(ie)&&(r+=re),t&&(r+=ee),n.filter(e=>!ie(e)).reduce((e,t)=>e+(w.test(t)?T:t===``?te:ne),r)}function oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function se(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:j([a,u.pathname]),pathnameBase:me(j([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=j([a,u.pathnameBase]))}return o}function E(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ce(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ce(e,t=!1,n=!0){u(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function le(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function D(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?fe(n.substring(1),`/`):fe(n,t)):a=t,{pathname:a,search:he(r),hash:ge(i)}}function fe(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function O(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function k(e){let t=pe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function A(e,t,n,r=!1){let i;typeof e==`string`?i=h(e):(i={...e},l(!i.pathname||!i.pathname.includes(`?`),O(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),O(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),O(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=de(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(u||d)&&(c.pathname+=`/`),c}var j=e=>e.join(`/`).replace(/\/\/+/g,`/`),me=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),he=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ve(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ye(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xe(e,t){let n=e;if(typeof n!=`string`||!ue.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(be)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=D(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{u(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Se=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Se);var Ce=[`GET`,...Se];new Set(Ce);var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var we=o.createContext(!1),Te=o.createContext({isTransitioning:!1});Te.displayName=`ViewTransition`;var Ee=o.createContext(new Map);Ee.displayName=`Fetchers`;var De=o.createContext(null);De.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var L=o.createContext(null);L.displayName=`RouteError`;var Oe=`REACT_ROUTER_ERROR`,ke=`REDIRECT`,Ae=`ROUTE_ERROR_RESPONSE`;function je(e){if(e.startsWith(`${Oe}:${ke}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Me(e){if(e.startsWith(`${Oe}:${Ae}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new _e(t.status,t.statusText,t.data)}catch{}}function Ne(e,{relative:t}={}){l(R(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=V(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:j([n,a])),r.createHref({pathname:c,search:s,hash:i})}function R(){return o.useContext(F)!=null}function z(){return l(R(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}var Pe=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Fe(e){o.useContext(P).static||o.useLayoutEffect(e)}function B(){let{isDataRoute:e}=o.useContext(I);return e?et():Ie()}function Ie(){l(R(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=z(),a=JSON.stringify(k(r)),s=o.useRef(!1);return Fe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(u(s.current,Pe),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=A(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}o.createContext(null);function Le(){let{matches:e}=o.useContext(I),t=e[e.length-1];return t?t.params:{}}function V(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=z(),i=JSON.stringify(k(n));return o.useMemo(()=>A(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Re(e,t){return ze(e,t)}function ze(e,t,n,r,i){l(R(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=o.useContext(P),{matches:s}=o.useContext(I),c=s[s.length-1],d=c?c.params:{},f=c?c.pathname:`/`,p=c?c.pathnameBase:`/`,m=c&&c.route;{let e=m&&m.path||``;nt(f,!m||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{_ as e,m as t}from"./i18n-DvzXOGQX.js";var n=`modulepreload`,r=function(e){return`/`+e},i={},a=function(e,t,a){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=r(t,a),t in i)return;i[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(a)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:n,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},o=e(t(),1),s=`popstate`;function c(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return p(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:m(t)}return g(t,n,null,e)}function l(e,t){if(e===!1||e==null)throw Error(t)}function u(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function d(){return Math.random().toString(36).substring(2,10)}function f(e,t){return{usr:e.state,key:e.key,idx:t}}function p(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?h(t):t,state:n,key:t&&t.key||r||d()}}function m({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function h(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,c=`POP`,l=null,u=d();u??(u=0,o.replaceState({...o.state,idx:u},``));function d(){return(o.state||{idx:null}).idx}function m(){c=`POP`;let e=d(),t=e==null?null:e-u;u=e,l&&l({action:c,location:y.location,delta:t})}function h(e,t){c=`PUSH`;let r=p(y.location,e,t);n&&n(r,e),u=d()+1;let s=f(r,u),m=y.createHref(r);try{o.pushState(s,``,m)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(m)}a&&l&&l({action:c,location:y.location,delta:1})}function g(e,t){c=`REPLACE`;let r=p(y.location,e,t);n&&n(r,e),u=d();let i=f(r,u),s=y.createHref(r);o.replaceState(i,``,s),a&&l&&l({action:c,location:y.location,delta:0})}function v(e){return _(e)}let y={get action(){return c},get location(){return e(i,o)},listen(e){if(l)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,m),l=e,()=>{i.removeEventListener(s,m),l=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:h,replace:g,go(e){return o.go(e)}};return y}function _(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),l(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:m(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function v(e,t,n=`/`){return y(e,t,n,!1)}function y(e,t,n,r){let i=D((typeof t==`string`?h(t):t).pathname||`/`,n);if(i==null)return null;let a=x(e);C(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=le(i);o=se(a[e],t,r)}return o}function b(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function x(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;l(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let u=j([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),x(e.children,t,d,u,o)),!(e.path==null&&!e.index)&&t.push({path:u,score:ae(u,e.index),routesMeta:d})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of S(e.path))a(e,t,!0,n)}),t}function S(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=S(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function C(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var w=/^:[\w-]+$/,T=3,ee=2,te=1,ne=10,re=-2,ie=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(ie)&&(r+=re),t&&(r+=ee),n.filter(e=>!ie(e)).reduce((e,t)=>e+(w.test(t)?T:t===``?te:ne),r)}function oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function se(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=E({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:j([a,u.pathname]),pathnameBase:me(j([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=j([a,u.pathnameBase]))}return o}function E(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ce(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ce(e,t=!1,n=!0){u(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function le(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function D(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?fe(n.substring(1),`/`):fe(n,t)):a=t,{pathname:a,search:he(r),hash:ge(i)}}function fe(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function O(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function pe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function k(e){let t=pe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function A(e,t,n,r=!1){let i;typeof e==`string`?i=h(e):(i={...e},l(!i.pathname||!i.pathname.includes(`?`),O(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),O(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),O(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=de(i,s),u=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(u||d)&&(c.pathname+=`/`),c}var j=e=>e.join(`/`).replace(/\/\/+/g,`/`),me=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),he=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ve(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ye(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xe(e,t){let n=e;if(typeof n!=`string`||!ue.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(be)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=D(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{u(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Se=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Se);var Ce=[`GET`,...Se];new Set(Ce);var M=o.createContext(null);M.displayName=`DataRouter`;var N=o.createContext(null);N.displayName=`DataRouterState`;var we=o.createContext(!1),Te=o.createContext({isTransitioning:!1});Te.displayName=`ViewTransition`;var Ee=o.createContext(new Map);Ee.displayName=`Fetchers`;var De=o.createContext(null);De.displayName=`Await`;var P=o.createContext(null);P.displayName=`Navigation`;var F=o.createContext(null);F.displayName=`Location`;var I=o.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var L=o.createContext(null);L.displayName=`RouteError`;var Oe=`REACT_ROUTER_ERROR`,ke=`REDIRECT`,Ae=`ROUTE_ERROR_RESPONSE`;function je(e){if(e.startsWith(`${Oe}:${ke}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Me(e){if(e.startsWith(`${Oe}:${Ae}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new _e(t.status,t.statusText,t.data)}catch{}}function Ne(e,{relative:t}={}){l(R(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=o.useContext(P),{hash:i,pathname:a,search:s}=V(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:j([n,a])),r.createHref({pathname:c,search:s,hash:i})}function R(){return o.useContext(F)!=null}function z(){return l(R(),`useLocation() may be used only in the context of a <Router> component.`),o.useContext(F).location}var Pe=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Fe(e){o.useContext(P).static||o.useLayoutEffect(e)}function B(){let{isDataRoute:e}=o.useContext(I);return e?et():Ie()}function Ie(){l(R(),`useNavigate() may be used only in the context of a <Router> component.`);let e=o.useContext(M),{basename:t,navigator:n}=o.useContext(P),{matches:r}=o.useContext(I),{pathname:i}=z(),a=JSON.stringify(k(r)),s=o.useRef(!1);return Fe(()=>{s.current=!0}),o.useCallback((r,o={})=>{if(u(s.current,Pe),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=A(r,JSON.parse(a),i,o.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(o.replace?n.replace:n.push)(c,o.state,o)},[t,n,a,i,e])}o.createContext(null);function Le(){let{matches:e}=o.useContext(I),t=e[e.length-1];return t?t.params:{}}function V(e,{relative:t}={}){let{matches:n}=o.useContext(I),{pathname:r}=z(),i=JSON.stringify(k(n));return o.useMemo(()=>A(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Re(e,t){return ze(e,t)}function ze(e,t,n,r,i){l(R(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=o.useContext(P),{matches:s}=o.useContext(I),c=s[s.length-1],d=c?c.params:{},f=c?c.pathname:`/`,p=c?c.pathnameBase:`/`,m=c&&c.route;{let e=m&&m.path||``;nt(f,!m||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let g=z(),_;if(t){let e=typeof t==`string`?h(t):t;l(p===`/`||e.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${e.pathname}" was given in the \`location\` prop.`),_=e}else _=g;let y=_.pathname||`/`,b=y;if(p!==`/`){let e=p.replace(/^\//,``).split(`/`);b=`/`+y.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let x=v(e,{pathname:b});u(m||x!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),u(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=Ge(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:j([p,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?p:j([p,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),s,n,r,i);return t&&S?o.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,..._},navigationType:`POP`}},S):S}function Be(){let e=$e(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=o.createElement(o.Fragment,null,o.createElement(`p`,null,`💿 Hey developer 👋`),o.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,o.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,o.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),o.createElement(o.Fragment,null,o.createElement(`h2`,null,`Unexpected Application Error!`),o.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?o.createElement(`pre`,{style:i},n):null,s)}var Ve=o.createElement(Be,null),He=class extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Me(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:o.createElement(I.Provider,{value:this.props.routeContext},o.createElement(L.Provider,{value:e,children:this.props.component}));return this.context?o.createElement(Ue,{error:e},t):t}};He.contextType=we;var H=new WeakMap;function Ue({children:e,error:t}){let{basename:n}=o.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=je(t.digest);if(e){let r=H.get(t);if(r)throw r;let i=xe(e.location,n);if(be&&!H.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw H.set(t,n),n}return o.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function We({routeContext:e,match:t,children:n}){let r=o.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(I.Provider,{value:e},n)}function Ge(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=n?.errors;if(s!=null){let e=a.findIndex(e=>e.route.id&&s?.[e.route.id]!==void 0);l(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let c=!1,u=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){c=!0,a=u>=0?a.slice(0,u+1):[a[0]];break}}}let d=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:ye(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let l,f=!1,p=null,m=null;n&&(l=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||Ve,c&&(u<0&&i===0?(nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):u===i&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,i+1)),g=()=>{let t;return t=l?p:f?m:r.route.Component?o.createElement(r.route.Component,null):r.route.element?r.route.element:e,o.createElement(We,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?o.createElement(He,{location:n.location,revalidation:n.revalidation,component:p,error:l,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function U(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ke(e){let t=o.useContext(M);return l(t,U(e)),t}function qe(e){let t=o.useContext(N);return l(t,U(e)),t}function Je(e){let t=o.useContext(I);return l(t,U(e)),t}function Ye(e){let t=Je(e),n=t.matches[t.matches.length-1];return l(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Xe(){return Ye(`useRouteId`)}function Ze(){return qe(`useNavigation`).navigation}function Qe(){let{matches:e,loaderData:t}=qe(`useMatches`);return o.useMemo(()=>e.map(e=>b(e,t)),[e,t])}function $e(){let e=o.useContext(L),t=qe(`useRouteError`),n=Ye(`useRouteError`);return e===void 0?t.errors?.[n]:e}function et(){let{router:e}=Ke(`useNavigate`),t=Ye(`useNavigate`),n=o.useRef(!1);return Fe(()=>{n.current=!0}),o.useCallback(async(r,i={})=>{u(n.current,Pe),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var tt={};function nt(e,t,n){!t&&!tt[e]&&(tt[e]=!0,u(!1,n))}o.useOptimistic,o.memo(rt);function rt({routes:e,future:t,state:n,onError:r}){return ze(e,void 0,n,r,t)}function it({to:e,replace:t,state:n,relative:r}){l(R(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=o.useContext(P);u(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=o.useContext(I),{pathname:s}=z(),c=B(),d=A(e,k(a),s,r===`path`),f=JSON.stringify(d);return o.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function at(e){l(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ot({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:s}){l(!R(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),d=o.useMemo(()=>({basename:c,navigator:i,static:a,unstable_useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=h(n));let{pathname:f=`/`,search:p=``,hash:m=``,state:g=null,key:_=`default`}=n,v=o.useMemo(()=>{let e=D(f,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:g,key:_},navigationType:r}},[c,f,p,m,g,_,r]);return u(v!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:o.createElement(P.Provider,{value:d},o.createElement(F.Provider,{children:t,value:v}))}function st({children:e,location:t}){return Re(W(e),t)}o.Component;function W(e,t=[]){let n=[];return o.Children.forEach(e,(e,r)=>{if(!o.isValidElement(e))return;let i=[...t,r];if(e.type===o.Fragment){n.push.apply(n,W(e.props.children,i));return}l(e.type===at,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),l(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=W(e.props.children,i)),n.push(a)}),n}var G=`get`,K=`application/x-www-form-urlencoded`;function q(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ct(e){return q(e)&&e.tagName.toLowerCase()===`button`}function lt(e){return q(e)&&e.tagName.toLowerCase()===`form`}function ut(e){return q(e)&&e.tagName.toLowerCase()===`input`}function dt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ft(e,t){return e.button===0&&(!t||t===`_self`)&&!dt(e)}var J=null;function pt(){if(J===null)try{new FormData(document.createElement(`form`),0),J=!1}catch{J=!0}return J}var mt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Y(e){return e!=null&&!mt.has(e)?(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${K}"`),null):e}function ht(e,t){let n,r,i,a,o;if(lt(e)){let o=e.getAttribute(`action`);r=o?D(o,t):null,n=e.getAttribute(`method`)||G,i=Y(e.getAttribute(`enctype`))||K,a=new FormData(e)}else if(ct(e)||ut(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?D(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||G,i=Y(e.getAttribute(`formenctype`))||Y(o.getAttribute(`enctype`))||K,a=new FormData(o,e),!pt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(q(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=G,r=null,i=K,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var gt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},_t=/[&><\u2028\u2029]/g;function vt(e){return e.replace(_t,e=>gt[e])}function X(e,t){if(e===!1||e==null)throw Error(t)}function yt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&D(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function bt(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xt(e){return e!=null&&typeof e.page==`string`}function St(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ct(e,t,n){return Ot((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await bt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(St).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function wt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Tt(e,t,{includeHydrateFallback:n}={}){return Et(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Et(e){return[...new Set(e)]}function Dt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ot(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!xt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Dt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function kt(){let e=o.useContext(M);return X(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function At(){let e=o.useContext(N);return X(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Z=o.createContext(void 0);Z.displayName=`FrameworkContext`;function jt(){let e=o.useContext(Z);return X(e,`You must render this element inside a <HydratedRouter> element`),e}function Mt(e,t){let n=o.useContext(Z),[r,i]=o.useState(!1),[a,s]=o.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=o.useRef(null);o.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),o.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),s(!1)};return n?e===`intent`?[a,p,{onFocus:Q(c,m),onBlur:Q(l,h),onMouseEnter:Q(u,m),onMouseLeave:Q(d,h),onTouchStart:Q(f,m)}]:[a,p,{}]:[!1,p,{}]}function Q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Nt({page:e,...t}){let{router:n}=kt(),r=o.useMemo(()=>v(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?o.createElement(Ft,{page:e,matches:r,...t}):null}function Pt(e){let{manifest:t,routeModules:n}=jt(),[r,i]=o.useState([]);return o.useEffect(()=>{let r=!1;return Ct(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ft({page:e,matches:t,...n}){let r=z(),{future:i,manifest:a,routeModules:s}=jt(),{basename:c}=kt(),{loaderData:l,matches:u}=At(),d=o.useMemo(()=>wt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=o.useMemo(()=>wt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=o.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let u=yt(e,c,i.unstable_trailingSlashAwareDataRequests,`data`);return o&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.unstable_trailingSlashAwareDataRequests,l,r,a,d,t,e,s]),m=o.useMemo(()=>Tt(f,a),[f,a]),h=Pt(f);return o.createElement(o.Fragment,null,p.map(e=>o.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>o.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>o.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function It(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}o.Component;var Lt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Lt&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Rt({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=o.useRef();i.current??=c({window:r,v5Compat:!0});let a=i.current,[s,l]=o.useState({action:a.action,location:a.location}),u=o.useCallback(e=>{n===!1?l(e):o.startTransition(()=>l(e))},[n]);return o.useLayoutEffect(()=>a.listen(u),[a,u]),o.createElement(ot,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a,unstable_useTransitions:n})}function zt({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=o.useState({action:n.action,location:n.location}),s=o.useCallback(e=>{r===!1?a(e):o.startTransition(()=>a(e))},[r]);return o.useLayoutEffect(()=>n.listen(s),[n,s]),o.createElement(ot,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}zt.displayName=`unstable_HistoryRouter`;var Bt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=o.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,unstable_useTransitions:g}=o.useContext(P),_=typeof l==`string`&&Bt.test(l),v=xe(l,h);l=v.to;let y=Ne(l,{relative:r}),[b,x,S]=Mt(n,p),C=Jt(l,{replace:a,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:g});function w(t){e&&e(t),t.defaultPrevented||C(t)}let T=o.createElement(`a`,{...p,...S,href:v.absoluteURL||y,onClick:v.isExternal||i?e:w,ref:It(m,x),target:c,"data-discover":!_&&t===`render`?`true`:void 0});return b&&!_?o.createElement(o.Fragment,null,T,o.createElement(Nt,{page:y})):T});Vt.displayName=`Link`;var Ht=o.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:s,children:c,...l},u){let d=V(a,{relative:l.relative}),f=z(),p=o.useContext(N),{navigator:m,basename:h}=o.useContext(P),g=p!=null&&rn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=D(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return o.createElement(Vt,{...l,"aria-current":w,className:T,ref:u,style:ee,to:a,viewTransition:s},typeof c==`function`?c(C):c)});Ht.displayName=`NavLink`;var Ut=o.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:s=G,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=o.useContext(P),_=Zt(),v=Qt(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Bt.test(c);return o.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||s,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?o.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Ut.displayName=`Form`;function Wt({getKey:e,storageKey:t,...n}){let r=o.useContext(Z),{basename:i}=o.useContext(P),a=z(),s=Qe();tn({getKey:e,storageKey:t});let c=o.useMemo(()=>{if(!r||!e)return null;let t=en(a,s,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return o.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${vt(JSON.stringify(t||$t))}, ${vt(JSON.stringify(c))})`}})}Wt.displayName=`ScrollRestoration`;function Gt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kt(e){let t=o.useContext(M);return l(t,Gt(e)),t}function qt(e){let t=o.useContext(N);return l(t,Gt(e)),t}function Jt(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=B(),d=z(),f=V(e,{relative:a});return o.useCallback(p=>{if(ft(p,t)){p.preventDefault();let t=n===void 0?m(d)===m(f):n,h=()=>u(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:c});l?o.startTransition(()=>h()):h()}},[d,u,f,n,r,t,e,i,a,s,c,l])}var Yt=0,Xt=()=>`__${String(++Yt)}__`;function Zt(){let{router:e}=Kt(`useSubmit`),{basename:t}=o.useContext(P),n=Xe(),r=e.fetch,i=e.navigate;return o.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ht(e,t);a.navigate===!1?await r(a.fetcherKey||Xt(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Qt(e,{relative:t}={}){let{basename:n}=o.useContext(P),r=o.useContext(I);l(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...V(e||`.`,{relative:t})},s=z();if(e==null){a.search=s.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:j([n,a.pathname])),m(a)}var $t=`react-router-scroll-positions`,$={};function en(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:D(e.pathname,n)||e.pathname},t)),i??=e.key,i}function tn({getKey:e,storageKey:t}={}){let{router:n}=Kt(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=qt(`useScrollRestoration`),{basename:a}=o.useContext(P),s=z(),c=Qe(),l=Ze();o.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),nn(o.useCallback(()=>{if(l.state===`idle`){let t=en(s,c,a,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||$t,JSON.stringify($))}catch(e){u(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(o.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||$t);e&&($=JSON.parse(e))}catch{}},[t]),o.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>en(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),o.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{u(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function nn(e,t){let{capture:n}=t||{};o.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function rn(e,{relative:t}={}){let n=o.useContext(Te);l(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Kt(`useViewTransitionState`),i=V(e,{relative:t});if(!n.isTransitioning)return!1;let a=D(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=D(n.nextLocation.pathname,r)||n.nextLocation.pathname;return E(i.pathname,s)!=null||E(i.pathname,a)!=null}export{st as a,Le as c,at as i,a as l,Ht as n,z as o,it as r,B as s,Rt as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,p as r}from"./i18n-DvzXOGQX.js";import{r as i}from"./dist-ZwoAXs46.js";var a=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(){}},o={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#e=o;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 c(e){setTimeout(e,0)}var l=typeof window>`u`||`Deno`in globalThis;function u(){}function d(e,t){return typeof e==`function`?e(t):e}function f(e){return typeof e==`number`&&e>=0&&e!==1/0}function p(e,t){return Math.max(e+(t||0)-Date.now(),0)}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==v(o,t.options))return!1}else if(!b(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,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(y(t.options.mutationKey)!==y(a))return!1}else if(!b(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function v(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function b(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>b(e[n],t[n])):!1}var x=Object.prototype.hasOwnProperty;function S(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=w(e)&&w(t);if(!r&&!(T(e)&&T(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:x.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=S(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(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 w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!ee(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ee(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ee(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return new Promise(t=>{s.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:S(e,t)}function ne(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function re(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function ie(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function O(e,t){return typeof e==`function`?e(...t):!!e}function ae(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 k=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!l&&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 A(){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 oe=c;function se(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oe,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 j=se(),M=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!l&&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 ce(e){return Math.min(1e3*2**e,3e4)}function le(e){return(e??`online`)===`online`?M.isOnline():!0}var N=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ue(e){let t=!1,n=0,r,i=A(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new N(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},u=()=>k.isFocused()&&(e.networkMode===`always`||M.isOnline())&&e.canRun(),d=()=>le(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(l?0:3),o=e.retryDelay??ce,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),te(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var de=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f(this.gcTime)&&(this.#e=s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(l?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(s.clearTimeout(this.#e),void 0)}},fe=class extends de{#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=he(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=he(this.options);e.data!==void 0&&(this.setState(me(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=E(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(u).catch(u):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>h(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>m(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:!p(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=ie(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=ue({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){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,...pe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...me(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),j.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function pe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:le(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function he(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 ge=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=A(),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),ve(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return P(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return P(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 h(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&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ye(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(t.enabled,this.#t)||m(this.options.staleTime,this.#t)!==m(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||h(this.options.enabled,this.#t)!==h(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 be(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(u)),t}#g(){this.#b();let e=m(this.options.staleTime,this.#t);if(l||this.#r.isStale||!f(e))return;let t=p(this.#r.dataUpdatedAt,e)+1;this.#d=s.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,!(l||h(this.options.enabled,this.#t)===!1||!f(this.#p)||this.#p===0)&&(this.#f=s.setInterval(()=>{(this.options.refetchIntervalInBackground||k.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(s.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(s.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&&ve(e,t),o=i&&ye(e,n,t,r);(a||o)&&(l={...l,...pe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=E(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=E(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 _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:F(e,t),refetch:this.refetch,promise:this.#o,isEnabled:h(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=A())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!C(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){j.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function _e(e,t){return h(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function ve(e,t){return _e(e,t)||e.state.data!==void 0&&P(e,t,t.refetchOnMount)}function P(e,t,n){if(h(t.enabled,e)!==!1&&m(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&F(e,t)}return!1}function ye(e,t,n,r){return(e!==t||h(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&F(e,n)}function F(e,t){return h(t.enabled,e)!==!1&&e.isStaleByTime(m(t.staleTime,e))}function be(e,t){return!C(e.getCurrentResult(),t)}function I(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=>{ae(e,()=>t.signal,()=>n=!0)},u=ie(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=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?re:ne;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?xe:L,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:L(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function L(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 xe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Se(e,t){return t?L(e,t)!=null:!1}function Ce(e,t){return!t||!e.getPreviousPageParam?!1:xe(e,t)!=null}var we=class extends de{#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||Te(),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=ue({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),j.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Te(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ee=class extends a{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 we({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=R(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=R(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=R(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=R(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){j.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=>_(t,e))}findAll(e={}){return this.getAll().filter(t=>_(e,t))}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return j.batch(()=>Promise.all(e.map(e=>e.continue().catch(u))))}};function R(e){return e.options.scope?.id}var De=class extends a{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??v(r,t),a=this.get(i);return a||(a=new fe({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(){j.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=>g(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>g(e,t)):t}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){j.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){j.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Oe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new De,this.#t=e.mutationCache||new Ee,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=k.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=M.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(m(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=d(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return j.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;j.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return j.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=j.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(u).catch(u)}invalidateQueries(e,t={}){return j.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=j.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(u)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(u)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(m(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(u).catch(u)}fetchInfiniteQuery(e){return e.behavior=I(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(u).catch(u)}ensureInfiniteQueryData(e){return e.behavior=I(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return M.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(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{b(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{b(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||=v(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===D&&(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()}},z=e(n(),1),ke=r(),Ae=z.createContext(void 0),je=e=>{let t=z.useContext(Ae);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Me=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,ke.jsx)(Ae.Provider,{value:e,children:t})),Ne=z.createContext(!1),Pe=()=>z.useContext(Ne);Ne.Provider;function Fe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ie=z.createContext(Fe()),Le=()=>z.useContext(Ie),Re=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?O(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ze=e=>{z.useEffect(()=>{e.clearReset()},[e])},Be=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||O(n,[e.error,r])),Ve=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))}},He=(e,t)=>e.isLoading&&e.isFetching&&!t,Ue=(e,t)=>e?.suspense&&t.isPending,We=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ge(e,t,n){let r=Pe(),i=Le(),a=je(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Ve(o),Re(o,i,s),ze(i);let c=!a.getQueryCache().get(o.queryHash),[d]=z.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(z.useSyncExternalStore(z.useCallback(e=>{let t=p?d.subscribe(j.batchCalls(e)):u;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),z.useEffect(()=>{d.setOptions(o)},[o,d]),Ue(o,f))throw We(o,d,i);if(Be({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!l&&He(f,r)&&(c?We(o,d,i):s?.promise)?.catch(u).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function B(e,t){return Ge(e,ge,t)}var V=new Oe({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}}),Ke=`http://127.0.0.1:55667`,H=(()=>{let e=(void 0)?.trim();return e?e.replace(/\/$/,``):typeof window<`u`&&window.location?.origin?window.location.origin:Ke})();async function qe(e={}){let t=await $.get(`/api/auth/status`,{timeoutMs:e.timeoutMs??5e3});if(!t.ok)throw Error(t.error.message);return t.data}async function Je(e){let t=await $.post(`/api/auth/setup`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function Ye(e){let t=await $.post(`/api/auth/login`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function Xe(){let e=await $.post(`/api/auth/logout`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function Ze(e){let t=await $.put(`/api/auth/password`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function Qe(e){let t=await $.put(`/api/auth/enabled`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function $e(){let e=await $.get(`/api/app/meta`);if(!e.ok)throw Error(e.error.message);return e.data}async function et(){let e=await $.get(`/api/runtime/bootstrap-status`);if(!e.ok)throw Error(e.error.message);return e.data}async function tt(){let e=await $.get(`/api/config`);if(!e.ok)throw Error(e.error.message);return e.data}async function nt(){let e=await $.get(`/api/config/meta`);if(!e.ok)throw Error(e.error.message);return e.data}async function rt(){let e=await $.get(`/api/config/schema`);if(!e.ok)throw Error(e.error.message);return e.data}async function it(e){let t=await $.put(`/api/config/model`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function at(e){let t=await $.put(`/api/config/search`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function ot(e,t){let n=await $.put(`/api/config/providers/${e}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function st(e={}){let t=await $.post(`/api/config/providers`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function ct(e){let t=await $.delete(`/api/config/providers/${e}`);if(!t.ok)throw Error(t.error.message);return t.data}async function lt(e,t){let n=await $.post(`/api/config/providers/${e}/test`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function ut(e,t={}){let n=await $.post(`/api/config/providers/${e}/auth/start`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function dt(e,t){let n=await $.post(`/api/config/providers/${e}/auth/poll`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function ft(e){let t=await $.post(`/api/config/providers/${e}/auth/import-cli`,{});if(!t.ok)throw Error(t.error.message);return t.data}async function pt(e,t){let n=await $.put(`/api/config/channels/${e}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function mt(e){let t=await $.put(`/api/config/runtime`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function ht(e){let t=await $.put(`/api/config/secrets`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function gt(e,t){let n=await $.post(`/api/config/actions/${e}/execute`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function _t(){let e=await $.get(`/api/ncp/session-types`);if(!e.ok)throw Error(e.error.message);return e.data}async function vt(e){let t=new URLSearchParams;e?.all&&t.set(`all`,`1`);let n=t.toString(),r=await $.get(n?`/api/cron?`+n:`/api/cron`);if(!r.ok)throw Error(r.error.message);return r.data}async function yt(e){let t=await $.delete(`/api/cron/${encodeURIComponent(e)}`);if(!t.ok)throw Error(t.error.message);return t.data}async function bt(e,t){let n=await $.put(`/api/cron/${encodeURIComponent(e)}/enable`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function xt(e,t){let n=await $.post(`/api/cron/${encodeURIComponent(e)}/run`,t);if(!n.ok)throw Error(n.error.message);return n.data}function St(e){return e.activeSystemAction?`service-transitioning`:e.lifecyclePhase}function Ct(e){return e===`ready`?`connected`:e===`startup-failed`||e===`stalled`?`disconnected`:`connecting`}function wt(e){return e.activeSystemAction?.message?.trim()?e.activeSystemAction.message.trim():e.lifecyclePhase===`cold-starting`?t(`chatRuntimeInitializing`):e.lifecyclePhase===`startup-failed`?e.bootstrapStatus?.ncpAgent.error?.trim()||e.bootstrapStatus?.lastError?.trim()||e.lastError?.trim()||t(`chatRuntimeInitializationFailed`):null}function U(e){let t=St(e);return{...e,phase:t,connectionStatus:Ct(t),isChatBlocked:t!==`ready`,chatMessage:wt(e)}}function Tt(e){return e===`start-service`?`starting-service`:e===`stop-service`?`stopping-service`:e===`restart-service`?`restarting-service`:`restarting-app`}function Et(e){return e===`start-service`?`starting`:e===`stop-service`?`stopping`:e===`restart-service`?`restarting`:null}function Dt(e){let{action:t,message:n}=e;return{action:t,lifecycle:Tt(t),serviceState:Et(t),message:n}}function Ot(e){if(e.runtimeControlError)return{tone:`inactive`,title:t(`runtimeControlLoadFailed`),description:e.runtimeControlError,reasonLines:[],actionLabel:null,isBusy:!1};if(!e.runtimeControlView)return{tone:`inactive`,title:t(`runtimeStatusLoadingTitle`),description:t(`runtimeStatusLoadingDescription`),reasonLines:[],actionLabel:null,isBusy:!!e.activeSystemAction};if(e.activeSystemAction)return{tone:`attention`,title:t(`runtimeControlTitle`),description:e.activeSystemAction.message||e.runtimeControlView.message||t(`runtimeControlDescription`),reasonLines:[],actionLabel:null,isBusy:!0};let n=e.runtimeControlView;return n.pendingRestart?{tone:`attention`,title:t(`runtimeStatusPendingRestartTitle`),description:t(`runtimeStatusPendingRestartDescription`),reasonLines:n.pendingRestart.changedPaths.length>0?n.pendingRestart.changedPaths.map(e=>t(`runtimeStatusPendingRestartReasonItem`).replace(`{path}`,e)):[n.pendingRestart.message],actionLabel:n.canRestartService.available?t(`runtimeStatusRestartAction`):null,isBusy:!1}:{tone:n.lifecycle===`healthy`?`healthy`:`inactive`,title:t(`runtimeStatusHealthyTitle`),description:t(`runtimeStatusHealthyDescription`),reasonLines:[],actionLabel:null,isBusy:!1}}function kt(e){let n=e.activeSystemAction,r=e.runtimeControlView;return{controlView:r,visibleLifecycle:n?.lifecycle??r?.lifecycle??`healthy`,visibleServiceState:n?.serviceState??r?.serviceState??`unknown`,visibleMessage:n?.message||e.lastSystemActionError||r?.message||t(`runtimeControlDescription`),busyAction:n?.action??null,busy:!!n,pendingRestart:r?.pendingRestart??null,errorMessage:e.lastSystemActionError||e.runtimeControlError||null}}async function At(){let e=await $.get(`/api/runtime/control`);if(!e.ok)throw Error(e.error.message);return e.data}async function jt(){let e=await $.post(`/api/runtime/control/start-service`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function Mt(){let e=await $.post(`/api/runtime/control/restart-service`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function Nt(){let e=await $.post(`/api/runtime/control/stop-service`,{});if(!e.ok)throw Error(e.error.message);return e.data}var Pt={lifecyclePhase:`cold-starting`,hasReachedReady:!1,lastReadyAt:null,recoveryStartedAt:null,bootstrapStatus:null,lastError:null,lastTransportError:null,runtimeControlView:null,runtimeControlError:null,activeSystemAction:null,lastSystemActionError:null},W=i(e=>({state:Pt,patchState:t=>e(e=>({state:{...e.state,...t}}))})),Ft=3e4;function G(e){return e instanceof Error?e.message:String(e??``)}function It(e){return e&&(e.ncpAgent.error?.trim()||e.lastError?.trim())||null}function Lt(e){return t(e===`start-service`?`runtimeControlStartingServiceHelp`:e===`restart-service`?`runtimeControlRestartingServiceHelp`:e===`stop-service`?`runtimeControlStoppingServiceHelp`:`runtimeControlRestartingAppHelp`)}function K(e){let t=e.trim().toLowerCase();return t?t.includes(`failed to fetch`)||t.includes(`networkerror`)||t.includes(`network request failed`)||t.includes(`load failed`)||t.includes(`request timed out`)||t.includes(`timed out waiting for remote request response`)||t.includes(`remote transport connection closed`)||t.includes(`websocket error`)||t.includes(`fetch failed on `)||t.includes(`stream request failed for `)||t.includes(`ncp fetch failed for `):!1}var q=new class{constructor(){this.recoveryTimeoutId=null,this.getRuntimeBootstrapPollInterval=e=>{let{lifecyclePhase:t,activeSystemAction:n}=this.getState();return t===`recovering`||t===`stalled`||n?.lifecycle===`recovering`?500:e?.ncpAgent.state===`ready`?!1:500},this.getRuntimeControl=async()=>this.decorateForCurrentEnvironment(await At()),this.reportBootstrapStatus=e=>{let t=this.getState(),n=It(e);if(e.ncpAgent.state===`ready`){this.transitionToReady(e);return}if(!t.hasReachedReady){if(e.ncpAgent.state===`error`||e.phase===`error`){this.transitionToStartupFailed(n,e);return}this.transitionToColdStarting(e);return}this.transitionToRecovering(n,e)},this.reportBootstrapQueryError=e=>{let t=G(e).trim();if(t&&!this.reportTransportFailure(t)){if(this.getState().hasReachedReady){this.transitionToRecovering(t);return}this.transitionToStartupFailed(t)}},this.reportTransportFailure=e=>{let t=G(e).trim();return K(t)?this.getState().hasReachedReady?(this.transitionToRecovering(t),!0):(this.patchState({lastTransportError:t}),!0):!1},this.handleConnectionInterrupted=e=>{let t=this.getState(),n=e?.trim()||null;if(!t.hasReachedReady){n&&this.patchState({lastTransportError:n});return}this.transitionToRecovering(n)},this.handleConnectionRestored=()=>{let e=this.getState();e.bootstrapStatus?.ncpAgent.state===`ready`&&this.transitionToReady(e.bootstrapStatus)},this.reportRuntimeControlView=e=>{this.patchState({runtimeControlView:e,runtimeControlError:null})},this.reportRuntimeControlError=e=>{let t=G(e).trim();t&&this.patchState({runtimeControlError:t})},this.runRuntimeControlAction=async e=>{this.patchState({activeSystemAction:Dt({action:e,message:Lt(e)}),lastSystemActionError:null});try{let n=await this.executeRuntimeControlAction(e);if(e===`restart-app`)return n;if(e===`stop-service`)return await this.refreshRuntimeControlView(),this.clearActiveSystemAction(),n;this.patchState({activeSystemAction:{action:e,lifecycle:`recovering`,serviceState:null,message:t(`runtimeControlRecoveringHelp`)}});let r=await this.waitForRecovery();return this.syncRuntimeControlQueryCache(r),this.reportRuntimeControlView(r),this.clearActiveSystemAction(),n}catch(n){let r=n instanceof Error?n.message:t(`runtimeControlActionFailed`);throw this.patchState({activeSystemAction:{action:e,lifecycle:`failed`,serviceState:e===`stop-service`?`running`:e===`restart-app`?null:`unknown`,message:r},lastSystemActionError:r}),n}},this.isChatInteractionBlocked=()=>U(this.getState()).isChatBlocked,this.getDisplayMessage=e=>{if(!e?.trim())return wt(this.getState());let{phase:n}=U(this.getState());return n===`service-transitioning`&&this.getState().activeSystemAction?.message?.trim()?this.getState().activeSystemAction?.message?.trim()??null:n===`recovering`&&K(e)?t(`runtimeControlRecoveringHelp`):n===`stalled`&&K(e)?null:e},this.resetForTests=()=>{this.clearRecoveryTimeout(),W.setState({state:Pt})},this.getState=()=>W.getState().state,this.patchState=e=>{W.getState().patchState(e)},this.transitionToColdStarting=e=>{this.clearRecoveryTimeout(),this.patchState({lifecyclePhase:`cold-starting`,recoveryStartedAt:null,bootstrapStatus:e,lastError:null})},this.transitionToStartupFailed=(e,t)=>{this.clearRecoveryTimeout(),this.patchState({lifecyclePhase:`startup-failed`,recoveryStartedAt:null,bootstrapStatus:t??this.getState().bootstrapStatus,lastError:e})},this.transitionToRecovering=(e,t)=>{let n=this.getState();if(!n.hasReachedReady){this.patchState({lastTransportError:e?.trim()||n.lastTransportError});return}n.lifecyclePhase!==`recovering`&&n.lifecyclePhase!==`stalled`&&(this.clearRecoveryTimeout(),this.recoveryTimeoutId=window.setTimeout(()=>{this.recoveryTimeoutId=null,this.getState().lifecyclePhase===`recovering`&&this.patchState({lifecyclePhase:`stalled`})},Ft)),this.patchState({lifecyclePhase:n.lifecyclePhase===`stalled`?`stalled`:`recovering`,recoveryStartedAt:n.recoveryStartedAt??Date.now(),bootstrapStatus:t??(n.lifecyclePhase===`ready`?null:n.bootstrapStatus),lastError:e?.trim()||n.lastError,lastTransportError:e?.trim()||n.lastTransportError})},this.transitionToReady=e=>{let t=this.getState(),n=t.lifecyclePhase===`recovering`||t.lifecyclePhase===`stalled`;this.clearRecoveryTimeout(),this.patchState({lifecyclePhase:`ready`,hasReachedReady:!0,lastReadyAt:Date.now(),recoveryStartedAt:null,bootstrapStatus:e,lastError:null,lastTransportError:null}),n&&Promise.all([V.invalidateQueries(),V.refetchQueries({type:`active`})])},this.executeRuntimeControlAction=async e=>{let n=this.getDesktopBridge();if(e===`restart-service`&&n&&typeof n.restartService==`function`){let e=await n.restartService();return{accepted:e.accepted,action:`restart-service`,lifecycle:e.lifecycle,message:e.message}}if(e===`start-service`)return await jt();if(e===`stop-service`)return await Nt();if(e===`restart-app`){if(!n||typeof n.restartApp!=`function`)throw Error(t(`runtimeRestartAppUnavailable`));let e=await n.restartApp();return{accepted:e.accepted,action:`restart-app`,lifecycle:e.lifecycle,message:e.message}}return await Mt()},this.waitForRecovery=async()=>{let e=Date.now()+25e3,n=null;for(;Date.now()<e;)try{return await this.getRuntimeControl()}catch(e){n=e,await new Promise(e=>{window.setTimeout(e,1500)})}throw n instanceof Error?n:Error(t(`runtimeRecoveryTimedOut`))},this.refreshRuntimeControlView=async()=>{try{let e=await this.getRuntimeControl();this.syncRuntimeControlQueryCache(e),this.reportRuntimeControlView(e),await V.invalidateQueries({queryKey:[`runtime-control`]})}catch(e){this.reportRuntimeControlError(e)}},this.syncRuntimeControlQueryCache=e=>{V.setQueryData([`runtime-control`],e)},this.clearActiveSystemAction=()=>{this.patchState({activeSystemAction:null,lastSystemActionError:null})},this.clearRecoveryTimeout=()=>{this.recoveryTimeoutId!==null&&(window.clearTimeout(this.recoveryTimeoutId),this.recoveryTimeoutId=null)},this.decorateForCurrentEnvironment=e=>{let n=this.getDesktopBridge();return!n||typeof n.restartApp!=`function`?e:{...e,environment:`desktop-embedded`,serviceState:`running`,canStartService:{available:!1,requiresConfirmation:!1,impact:`none`},canStopService:{available:!1,requiresConfirmation:!0,impact:`brief-ui-disconnect`},canRestartApp:{available:!0,requiresConfirmation:!0,impact:`full-app-relaunch`},ownerLabel:t(`runtimeControlEnvironmentDesktop`),managementHint:t(`runtimeControlDesktopServiceHint`)}},this.getDesktopBridge=()=>typeof window>`u`?null:window.nextclawDesktop??null}};function Rt(){return{phase:`kernel-starting`,ncpAgent:{state:`pending`},pluginHydration:{state:`pending`,loadedPluginCount:0,totalPluginCount:0},channels:{state:`pending`,enabled:[]},remote:{state:`pending`}}}function zt(){let e=B({queryKey:[`runtime-bootstrap-status`],queryFn:et,placeholderData:Rt,refetchInterval:e=>q.getRuntimeBootstrapPollInterval(e.state.data),refetchIntervalInBackground:!0,retry:!1,refetchOnWindowFocus:!0}),t=B({queryKey:[`runtime-control`],queryFn:async()=>await q.getRuntimeControl(),staleTime:5e3,refetchOnWindowFocus:!0});(0,z.useEffect)(()=>{e.data&&q.reportBootstrapStatus(e.data)},[e.data]),(0,z.useEffect)(()=>{e.error&&q.reportBootstrapQueryError(e.error)},[e.error]),(0,z.useEffect)(()=>{t.data&&q.reportRuntimeControlView(t.data)},[t.data]),(0,z.useEffect)(()=>{t.error&&q.reportRuntimeControlError(t.error)},[t.error])}function Bt(){return U(W(e=>e.state))}function Vt(){let e=U(W(e=>e.state));return{isBlocked:e.isChatBlocked,message:e.chatMessage,phase:e.phase,lastReadyAt:e.lastReadyAt}}function Ht(){return Ot(W(e=>e.state))}function Ut(){return kt(W(e=>e.state))}function Wt(e){return e.replace(/\s+/g,` `).trim().slice(0,200)}function Gt(e,t){if(t===404&&e.startsWith(`/api/config/providers/`)&&e.endsWith(`/test`))return`Provider test endpoint is missing. This usually means nextclaw runtime version is outdated.`;if(t===401||t===403)return`Authentication failed. Check apiKey and custom headers.`;if(t===429)return`Rate limited by upstream provider. Retry later or switch model/provider.`;if(t>=500)return`Upstream service error. Retry later and inspect server logs if it persists.`}function Kt(e){if(e instanceof Error){let t=e.name?.trim()||`Error`,n=e.message?.trim()||`Unknown error`;return{summary:`${t}: ${n}`,details:{errorName:t,errorMessage:n,...e.stack?.trim()?{errorStack:e.stack.trim()}:{}}}}return{summary:String(e??`Unknown error`),details:{errorName:`NonError`,errorMessage:String(e??`Unknown error`)}}}async function qt(e,t={}){let n=`${H}${e}`,r=(t.method||`GET`).toUpperCase(),i;try{i=await fetch(n,{credentials:`include`,headers:{"Content-Type":`application/json`,...t.headers},...t})}catch(t){let i=Kt(t);return q.reportTransportFailure(i.summary),{ok:!1,error:{code:`NETWORK_ERROR`,message:`Fetch failed on ${r} ${e} | ${i.summary}`,details:{method:r,endpoint:e,url:n,...i.details}}}}let a=await i.text(),o=null;if(a)try{o=JSON.parse(a)}catch{}if(!o){let t=a?Wt(a):``,o=Gt(e,i.status),s=[`Non-JSON response (${i.status} ${i.statusText}) on ${r} ${e}`];return t&&s.push(`body=${t}`),o&&s.push(`hint=${o}`),{ok:!1,error:{code:`INVALID_RESPONSE`,message:s.join(` | `),details:{status:i.status,statusText:i.statusText,method:r,endpoint:e,url:n,bodySnippet:t||void 0,hint:o}}}}return i.ok,o}function Jt(e){let t=e.split(`
|
|
2
|
+
`),n=``,r=[];for(let e of t){let t=e.trimEnd();if(!(!t||t.startsWith(`:`))){if(t.startsWith(`event:`)){n=t.slice(6).trim();continue}t.startsWith(`data:`)&&r.push(t.slice(5).trimStart())}}if(!n)return null;let i,a=r.join(`
|
|
3
|
+
`);if(a)try{i=JSON.parse(a)}catch{i=a}return{name:n,payload:i}}function Yt(e,t,n){let r=Jt(e);r&&(r.name===`final`&&n(r.payload),t(r))}function Xt(e,t,n){let r=e.value.indexOf(`
|
|
4
|
+
|
|
5
|
+
`);for(;r!==-1;)Yt(e.value.slice(0,r),t,n),e.value=e.value.slice(r+2),r=e.value.indexOf(`
|
|
6
|
+
|
|
7
|
+
`)}async function Zt(e,t){let n=e.body?.getReader();if(!n)throw Error(`SSE response body unavailable`);let r=new TextDecoder,i={value:``},a;try{for(;;){let{value:e,done:o}=await n.read();if(o)break;i.value+=r.decode(e,{stream:!0}),Xt(i,t,e=>{a=e})}i.value.trim()&&Yt(i.value,t,e=>{a=e})}finally{n.releaseLock()}return a}function Qt(e,t){let n=e.replace(/\/$/,``);try{let e=new URL(n,window.location.origin);return`${e.protocol===`https:`?`wss:`:e.protocol===`http:`?`ws:`:e.protocol}//${e.host}${t}`}catch{return n.startsWith(`wss://`)||n.startsWith(`ws://`)?`${n}${t}`:n.startsWith(`https://`)?`${n.replace(/^https:/,`wss:`)}${t}`:n.startsWith(`http://`)?`${n.replace(/^http:/,`ws:`)}${t}`:`${n}${t}`}}function $t(e,t){return e.ok?Error(t):Error(e.error.message)}function J(e){if(e instanceof Error){let t=e.name?.trim(),n=e.message?.trim();return t&&n?`${t}: ${n}`:n||t||`Unknown error`}return String(e??`Unknown error`)}function en(e,t){let n=Error(e);return t!==void 0&&(n.cause=t),n}var tn=class{constructor(e){this.wsUrl=e,this.socket=null,this.reconnectTimer=null,this.manualClose=!1,this.subscribers=new Set,this.subscribe=e=>(this.subscribers.add(e),this.subscribers.size===1?this.connect():this.socket?.readyState===WebSocket.OPEN&&e({type:`connection.open`,payload:{}}),()=>{this.subscribers.delete(e),this.subscribers.size===0&&this.disconnect()}),this.emit=e=>{for(let t of this.subscribers)t(e)},this.connect=()=>{if(this.socket&&(this.socket.readyState===WebSocket.CONNECTING||this.socket.readyState===WebSocket.OPEN))return;this.manualClose=!1;let e=new WebSocket(this.wsUrl);this.socket=e,e.onopen=()=>{this.emit({type:`connection.open`,payload:{}})},e.onmessage=e=>{try{let t=JSON.parse(String(e.data??``));this.emit(t)}catch(e){console.error(`Failed to parse websocket message:`,e)}},e.onerror=()=>{this.emit({type:`connection.error`,payload:{message:`websocket error`}})},e.onclose=()=>{this.emit({type:`connection.close`,payload:{}}),this.socket=null,!this.manualClose&&this.subscribers.size>0&&this.scheduleReconnect()}},this.scheduleReconnect=()=>{this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},3e3))},this.disconnect=()=>{this.manualClose=!0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.socket?.close(),this.socket=null}}},Y=class{constructor(e={}){this.options=e,this.request=async e=>{let t=Number.isFinite(e.timeoutMs)&&(e.timeoutMs??0)>0?Math.trunc(e.timeoutMs):null,n=t?new AbortController:null,r=t?window.setTimeout(()=>n?.abort(`Request timed out after ${t}ms: ${e.method} ${e.path}`),t):null;try{let t=await qt(e.path,{method:e.method,...e.body===void 0?{}:{body:JSON.stringify(e.body)},...n?{signal:n.signal}:{}});if(!t.ok)throw $t(t,`Request failed for ${e.method} ${e.path}`);return t.data}catch(t){if(n?.signal.aborted){let{reason:t}=n.signal;throw Error(typeof t==`string`&&t.trim()?t:`Request timed out: ${e.method} ${e.path}`)}throw t instanceof Error?t:en(`Request failed for ${e.method} ${e.path} | ${J(t)}`,t)}finally{r!==null&&window.clearTimeout(r)}},this.openStream=e=>{let t=new AbortController,n=()=>t.abort();return e.signal&&(e.signal.aborted?n():e.signal.addEventListener(`abort`,n,{once:!0})),{finished:(async()=>{let r;try{r=await fetch(`${this.apiBase}${e.path}`,{method:e.method,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`},...e.body===void 0?{}:{body:JSON.stringify(e.body)},signal:t.signal})}catch(t){throw q.reportTransportFailure(J(t)),en(`Stream request failed for ${e.method} ${e.path} | ${J(t)}`,t)}if(!r.ok){let t=(await r.text()).trim();throw Error(t?`Stream request failed for ${e.method} ${e.path} | HTTP ${r.status} | ${t}`:`Stream request failed for ${e.method} ${e.path} | HTTP ${r.status}`)}try{return await Zt(r,e.onEvent)}finally{e.signal?.removeEventListener(`abort`,n)}})(),cancel:()=>t.abort()}},this.subscribe=e=>this.realtimeGateway.subscribe(e),this.apiBase=e.apiBase??H,this.realtimeGateway=new tn(Qt(this.apiBase,e.wsPath??`/ws`))}};function nn(e,t,n){if(typeof e==`object`&&e&&`ok`in e){let t=e;if(t.ok===!1&&t.error?.message)return Error(t.error.message);if(t.ok===!0)return Error(n)}return typeof e==`string`&&e.trim()?Error(e.trim()):Error(`${n} (${t})`)}function rn(e){if(typeof e==`object`&&e&&`ok`in e){let t=e;if(t.ok===!1)throw Error(t.error?.message??`Remote request failed.`);if(t.ok===!0)return t.data}return e}function an(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var on=15e3,X=class{constructor(e,t=H){this.runtime=e,this.apiBase=t,this.socket=null,this.connectPromise=null,this.connectTimeoutId=null,this.reconnectTimer=null,this.manualClose=!1,this.subscribers=new Set,this.pendingRequests=new Map,this.pendingStreams=new Map}async request(e){await this.ensureSocket();let t=an(`req`),n=Number.isFinite(e.timeoutMs)&&(e.timeoutMs??0)>0?Math.trunc(e.timeoutMs):on;return await new Promise((r,i)=>{let a=window.setTimeout(()=>{this.pendingRequests.delete(t),i(Error(`Timed out waiting for remote request response after ${n}ms: ${e.method} ${e.path}`))},n);this.pendingRequests.set(t,{resolve:e=>r(e),reject:i,timeoutId:a}),this.send({type:`request`,id:t,target:{method:e.method,path:e.path,...e.body===void 0?{}:{body:e.body}}})})}openStream(e){let t=an(`stream`),n=!1,r=e=>{n||(n=!0,a(e))},i,a,o=new Promise((e,t)=>{i=e,a=t}),s=()=>{this.pendingStreams.delete(t),!n&&(n=!0,this.send({type:`stream.cancel`,streamId:t}),a(Error(`stream cancelled`)))};this.pendingStreams.set(t,{onEvent:e.onEvent,finalResult:void 0,resolve:e=>{n||(n=!0,i(e))},reject:e=>{n||(n=!0,a(e))}});let c=()=>s();return e.signal&&(e.signal.aborted?s():e.signal.addEventListener(`abort`,c,{once:!0})),this.ensureSocket().then(()=>{n||this.send({type:`stream.open`,streamId:t,target:{method:e.method,path:e.path,...e.body===void 0?{}:{body:e.body}}})}).catch(e=>{this.pendingStreams.delete(t),r(e instanceof Error?e:Error(String(e)))}),{finished:o.finally(()=>{e.signal?.removeEventListener(`abort`,c),this.pendingStreams.delete(t)}),cancel:s}}subscribe(e){return this.subscribers.add(e),this.ensureSocket().catch(t=>{e({type:`connection.error`,payload:{message:t instanceof Error?t.message:String(t)}})}),()=>{this.subscribers.delete(e)}}emit(e){for(let t of this.subscribers)t(e)}send(e){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)throw Error(`Remote transport websocket is not connected.`);this.socket.send(JSON.stringify(e))}async ensureSocket(){if(this.socket?.readyState===WebSocket.OPEN&&this.connectPromise===null)return;if(this.connectPromise)return await this.connectPromise;let e=Qt(this.apiBase,this.runtime.wsPath);return this.manualClose=!1,this.connectPromise=new Promise((t,n)=>{let r=new WebSocket(e);this.socket=r;let i=!1,a=()=>{this.connectTimeoutId!==null&&(window.clearTimeout(this.connectTimeoutId),this.connectTimeoutId=null)};this.connectTimeoutId=window.setTimeout(()=>{this.connectTimeoutId=null,n(Error(`Timed out waiting for remote transport websocket.`)),r.close()},8e3),r.onopen=()=>{i=!0,a(),this.connectPromise=null,t(),this.emit({type:`connection.open`,payload:{}})},r.onmessage=e=>{try{let t=JSON.parse(String(e.data??``));if(t.type===`connection.ready`)return;this.handleFrame(t)}catch(e){console.error(`Failed to parse remote websocket frame:`,e)}},r.onerror=()=>{this.emit({type:`connection.error`,payload:{message:`remote websocket error`}})},r.onclose=()=>{a();let e=this.connectPromise!==null;this.socket=null,this.connectPromise=null,this.failPendingWork(Error(`Remote transport connection closed.`)),this.emit({type:`connection.close`,payload:{}}),e&&!i&&n(Error(`Remote transport connection closed before ready.`)),!this.manualClose&&this.subscribers.size>0&&this.scheduleReconnect()}}),await this.connectPromise}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.ensureSocket().catch(()=>void 0)},3e3))}failPendingWork(e){for(let t of this.pendingRequests.values())window.clearTimeout(t.timeoutId),t.reject(e);this.pendingRequests.clear();for(let t of this.pendingStreams.values())t.reject(e);this.pendingStreams.clear()}handleFrame(e){if(e.type===`response`||e.type===`request.error`){this.handleRequestFrame(e);return}if(e.type===`stream.event`||e.type===`stream.end`||e.type===`stream.error`){this.handleStreamFrame(e);return}if(e.type===`event`){this.emit(e.event);return}e.type===`connection.error`&&this.emit({type:`connection.error`,payload:{message:e.message}})}handleRequestFrame(e){let t=this.pendingRequests.get(e.id);if(t){if(this.pendingRequests.delete(e.id),window.clearTimeout(t.timeoutId),e.type===`request.error`){t.reject(Error(e.message));return}if(e.status>=400){t.reject(nn(e.body,e.status,`Remote request failed.`));return}try{t.resolve(rn(e.body))}catch(e){t.reject(e instanceof Error?e:Error(String(e)))}}}handleStreamFrame(e){let t=this.pendingStreams.get(e.streamId);if(t){if(e.type===`stream.event`){try{e.event===`final`&&(t.finalResult=e.payload),t.onEvent({name:e.event,payload:e.payload})}catch(n){this.pendingStreams.delete(e.streamId),t.reject(n instanceof Error?n:Error(String(n)))}return}if(this.pendingStreams.delete(e.streamId),e.type===`stream.end`){t.resolve(t.finalResult);return}t.reject(Error(e.message))}}},sn=`/_remote/runtime`,Z={mode:`remote`,protocolVersion:1,wsPath:`/_remote/ws`};async function cn(e){let t=`${e.replace(/\/$/,``)}${sn}`,n;try{n=await fetch(t,{method:`GET`,credentials:`include`,cache:`no-store`})}catch{return new Y({apiBase:e})}if(n.status===404)return new Y({apiBase:e});if(!(n.headers.get(`content-type`)?.toLowerCase()??``).includes(`application/json`))return n.status>=400?new X(Z,e):new Y({apiBase:e});let r=null;try{r=await n.json()}catch{return n.status>=400?new X(Z,e):new Y({apiBase:e})}return n.ok&&r.ok&&r.data?.mode===`remote`?new X(r.data,e):n.status>=400?new X(Z,e):new Y({apiBase:e})}var ln=new class{constructor(e=H){this.apiBase=e,this.transportPromise=null,this.getTransport=async()=>(this.transportPromise||=cn(this.apiBase),await this.transportPromise),this.request=async e=>await(await this.getTransport()).request(e),this.openStream=e=>{let t=null,n,r,i=new Promise((e,t)=>{n=e,r=t});return this.getTransport().then(i=>{t=i.openStream(e),t.finished.then(n).catch(e=>{r(e instanceof Error?e:Error(String(e)))})}).catch(e=>{r(e instanceof Error?e:Error(String(e)))}),{finished:i,cancel:()=>t?.cancel()}},this.subscribe=e=>{let t=()=>{},n=!0;return this.getTransport().then(r=>{n&&(t=r.subscribe(e))}).catch(t=>{e({type:`connection.error`,payload:{message:t instanceof Error?t.message:String(t)}})}),()=>{n=!1,t()}}}};async function Q(e,t={}){let n=(t.method||`GET`).toUpperCase();try{return{ok:!0,data:await ln.request({method:n,path:e,...t.timeoutMs===void 0?{}:{timeoutMs:t.timeoutMs},...t.body===void 0?{}:{body:un(t.body)}})}}catch(t){return{ok:!1,error:{code:`REQUEST_FAILED`,message:t instanceof Error?t.message:String(t),details:{method:n,endpoint:e}}}}}var $={get:(e,t={})=>Q(e,{...t,method:`GET`}),put:(e,t)=>Q(e,{method:`PUT`,body:JSON.stringify(t)}),post:(e,t)=>Q(e,{method:`POST`,body:JSON.stringify(t)}),delete:e=>Q(e,{method:`DELETE`})};function un(e){if(e!=null){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}}export{a as $,Ze as A,Ge as B,dt as C,ut as D,Je as E,at as F,Ce as G,je as H,ht as I,j as J,I as K,H as L,it as M,ot as N,lt as O,mt as P,O as Q,V as R,Xe as S,bt as T,Te as U,Me as V,Se as W,u as X,y as Y,C as Z,rt as _,Ht as a,ft as b,q as c,ct as d,gt as f,nt as g,tt as h,Ut as i,pt as j,Qe as k,st as l,qe as m,ln as n,Bt as o,$e as p,ge as q,Vt as r,zt as s,$ as t,yt as u,vt as v,xt as w,Ye as x,_t as y,B as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,u as t}from"./i18n-DvzXOGQX.js";var n=e(),r=`min-w-0 overflow-hidden rounded-2xl border border-gray-200/70 bg-white shadow-card xl:h-[calc(100vh-180px)] xl:max-h-[860px]`;function i({className:e,...i}){return(0,n.jsx)(`section`,{className:t(r,`flex flex-col`,e),...i})}function a({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`grid min-h-0 grid-cols-1 gap-5 xl:flex-1 xl:grid-cols-[340px_minmax(0,1fr)]`,e),...r})}function o({className:e,...i}){return(0,n.jsx)(`section`,{className:t(r,`flex items-center justify-center px-6 py-12 text-center`,e),...i})}function s({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`shrink-0 border-b border-gray-100`,e),...r})}function c({className:e,scrollOnDesktop:r=!0,...i}){return(0,n.jsx)(`div`,{className:t(`min-h-0 flex-1`,r&&`overflow-visible xl:overflow-y-auto xl:overscroll-contain`,e),...i})}function l({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`shrink-0 border-t border-gray-100`,e),...r})}function u({active:e=!1,className:r,type:i=`button`,...a}){return(0,n.jsx)(`button`,{type:i,className:t(`w-full rounded-xl border p-2.5 text-left transition-all`,e?`border-primary/30 bg-primary-50/40 shadow-sm`:`border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70`,r),...a})}function d({icon:e,title:r,description:i,className:a,...o}){return(0,n.jsxs)(`div`,{className:t(`flex min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 px-4 py-10 text-center`,a),...o,children:[(0,n.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white`,children:(0,n.jsx)(e,{className:`h-5 w-5 text-gray-300`})}),(0,n.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:r}),i?(0,n.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:i}):null]})}export{i as a,s as c,a as i,o as n,c as o,d as r,l as s,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-
|
|
1
|
+
import{_ as e,m as t}from"./i18n-DvzXOGQX.js";var n=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i={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`},a=e(t()),o=(0,a.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s=``,children:c,iconNode:l,...u},d)=>(0,a.createElement)(`svg`,{ref:d,...i,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:r(`lucide`,s),...u},[...l.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(c)?c:[c]])),s=(e,t)=>{let i=(0,a.forwardRef)(({className:i,...s},c)=>(0,a.createElement)(o,{ref:c,iconNode:t,className:r(`lucide-${n(e)}`,i),...s}));return i.displayName=`${e}`,i};export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./i18n-DvzXOGQX.js";import{n as t,r as n}from"./dist-ZwoAXs46.js";import{t as r}from"./createLucideIcon-CCiTGX8L.js";var i=r(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),a=n(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),o=new class{constructor(){this.start=async()=>{let n=this.getDesktopApi();if(!n){this.markUnsupported();return}a.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let e=await n.getPresenceState();a.setState({supported:!0,initialized:!0,busyAction:null,snapshot:e})}catch(n){a.setState({supported:!0,initialized:!0,busyAction:null}),t.error(`${e(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(n)}`)}},this.markUnsupported=()=>{a.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async n=>{let r=this.getDesktopApi();if(!r)throw Error(e(`runtimePresenceLaunchAtLoginUnavailable`));a.setState({busyAction:`saving-preferences`});try{let i=await r.updatePresencePreferences(n);return a.setState({supported:!0,initialized:!0,snapshot:i}),t.success(e(`runtimePresenceSaved`)),i}catch(n){throw t.error(`${e(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(n)}`),n}finally{a.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=t=>t instanceof Error?t.message:e(`error`)}},s=n(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),c=new class{constructor(){this.unsubscribe=null,this.start=async()=>{let n=this.getDesktopApi();if(!n){s.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=n.onUpdateStateChanged(e=>{s.setState({supported:!0,initialized:!0,snapshot:e})}),s.setState({supported:!0,initialized:!1});try{let e=await n.getUpdateState();s.setState({supported:!0,initialized:!0,snapshot:e})}catch(n){s.setState({supported:!0,initialized:!0}),t.error(`${e(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(n)}`)}},this.stop=()=>{this.unsubscribe?.(),this.unsubscribe=null},this.checkForUpdates=async()=>{let n;try{n=await this.runSnapshotCommand(`checking`,e(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(n.status===`up-to-date`){t.success(e(`desktopUpdatesAlreadyLatest`));return}if(n.status===`update-available`){t.success(e(`desktopUpdatesAvailable`).replace(`{version}`,n.availableVersion??e(`desktopUpdatesUnknownVersion`)));return}if(n.status===`downloaded`){t.success(e(`desktopUpdatesReadyToApply`));return}n.status===`failed`&&n.errorMessage&&t.error(n.errorMessage)},this.downloadUpdate=async()=>{let n;try{n=await this.runSnapshotCommand(`downloading`,e(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}n.status===`downloaded`&&t.success(e(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,e(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updatePreferences=async t=>{try{await this.runSnapshotCommand(`saving-preferences`,e(`desktopUpdatesPreferencesFailed`),async e=>await e.updatePreferences(t))}catch{return}},this.updateChannel=async n=>{if(s.getState().snapshot?.channel===n)return;let r;try{r=await this.runSnapshotCommand(`switching-channel`,e(`desktopUpdatesChannelChangeFailed`),async e=>await e.updateChannel(n))}catch{return}if(r.status===`update-available`&&r.availableVersion){t.success(e(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(n)).replace(`{version}`,r.availableVersion));return}t.success(e(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(n)))},this.runSnapshotCommand=async(n,r,i)=>{let a=this.getDesktopApi();if(!a)throw Error(e(`desktopUpdatesDesktopOnlyDescription`));s.setState({busyAction:n});try{let e=await i(a);return s.setState({snapshot:e}),e}catch(e){throw t.error(`${r}: ${this.getErrorMessage(e)}`),e}finally{s.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=t=>t instanceof Error?t.message:e(`error`),this.getChannelLabel=t=>e(t===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};export{i as a,a as i,s as n,o as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,n as r,p as i,u as a}from"./i18n-DvzXOGQX.js";import{a as o,i as s,o as c}from"./dist-ZwoAXs46.js";import{a as l,i as u,n as d,r as f,t as p}from"./select-BILPf7zs.js";import{t as m}from"./download-D7LOizcW.js";import{t as h}from"./external-link-qsnCMhw1.js";import{t as g}from"./refresh-cw-MNqgR3LZ.js";import{a as _,n as v,t as y}from"./desktop-DfkLlkG2.js";import{dt as b,ft as x,gt as S,mt as C,pt as w,ut as T}from"./index-lr6rQUSd.js";import{t as E}from"./switch-CBOzecWS.js";var D=e(n(),1),O=i();function k(e){return e?.trim()||`-`}function A(e){return e?r(e):`-`}function j(e){return t(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function M(e){return t(e===`checking`?`desktopUpdatesStatusChecking`:e===`update-available`?`desktopUpdatesStatusAvailable`:e===`downloading`?`desktopUpdatesStatusDownloading`:e===`downloaded`?`desktopUpdatesStatusDownloaded`:e===`up-to-date`?`desktopUpdatesStatusUpToDate`:e===`failed`?`desktopUpdatesStatusFailed`:`desktopUpdatesStatusIdle`)}function N(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function P(){let{supported:e,initialized:n,busyAction:r,snapshot:i}=v();if((0,D.useEffect)(()=>(y.start(),()=>{y.stop()}),[]),!n)return(0,O.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)});if(!e||!i)return(0,O.jsxs)(o,{className:`space-y-6`,children:[(0,O.jsx)(s,{title:t(`desktopUpdatesPageTitle`),description:t(`desktopUpdatesPageDescription`)}),(0,O.jsxs)(T,{children:[(0,O.jsxs)(w,{children:[(0,O.jsx)(C,{children:t(`desktopUpdatesDesktopOnlyTitle`)}),(0,O.jsx)(x,{children:t(`desktopUpdatesDesktopOnlyDescription`)})]}),(0,O.jsx)(b,{children:(0,O.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesDesktopOnlyFutureHint`)})})]})]});let P=r===`checking`,F=r===`downloading`,I=r===`applying`,L=r===`saving-preferences`,R=r===`switching-channel`,z=i.status===`update-available`&&!F&&!I,B=i.status===`downloaded`&&!I;return(0,O.jsxs)(o,{className:`space-y-6`,children:[(0,O.jsx)(s,{title:t(`desktopUpdatesPageTitle`),description:t(`desktopUpdatesPageDescription`),actions:(0,O.jsxs)(c,{variant:`outline`,onClick:()=>void y.checkForUpdates(),disabled:P||F||I,children:[(0,O.jsx)(g,{className:a(`mr-2 h-4 w-4`,P&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]})}),(0,O.jsxs)(T,{children:[(0,O.jsxs)(w,{children:[(0,O.jsx)(C,{children:t(`desktopUpdatesOverviewTitle`)}),(0,O.jsx)(x,{children:t(`desktopUpdatesOverviewDescription`)})]}),(0,O.jsxs)(b,{className:`space-y-5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t(`desktopUpdatesStatusLabel`)}),(0,O.jsx)(`span`,{className:a(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,N(i.status)),children:M(i.status)})]}),(0,O.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:[(0,O.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,O.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:t(`desktopUpdatesLauncherVersion`)}),(0,O.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:k(i.launcherVersion)})]}),(0,O.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,O.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:t(`desktopUpdatesCurrentBundleVersion`)}),(0,O.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:k(i.currentVersion)})]}),(0,O.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,O.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:t(`desktopUpdatesAvailableVersion`)}),(0,O.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:k(i.availableVersion)})]}),(0,O.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,O.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:t(`desktopUpdatesLastCheckedAt`)}),(0,O.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:A(i.lastCheckedAt)})]}),(0,O.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,O.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:t(`desktopUpdatesCurrentChannel`)}),(0,O.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:j(i.channel)})]})]}),i.channel===`beta`?(0,O.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,O.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:t(`desktopUpdatesBetaBadgeTitle`)}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:t(`desktopUpdatesBetaBadgeDescription`)})]}):null,i.downloadedVersion?(0,O.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,O.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:t(`desktopUpdatesDownloadedBannerTitle`)}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:t(`desktopUpdatesDownloadedBannerDescription`).replace(`{version}`,i.downloadedVersion)})]}):null,i.errorMessage?(0,O.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:i.errorMessage}):null]})]}),(0,O.jsxs)(T,{children:[(0,O.jsxs)(w,{children:[(0,O.jsx)(C,{children:t(`desktopUpdatesPreferencesTitle`)}),(0,O.jsx)(x,{children:t(`desktopUpdatesPreferencesDescription`)})]}),(0,O.jsxs)(b,{className:`space-y-5`,children:[(0,O.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:(0,O.jsxs)(`div`,{className:`space-y-3`,children:[(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(S,{children:t(`desktopUpdatesReleaseChannel`)}),(0,O.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelHelp`)})]}),(0,O.jsxs)(p,{value:i.channel,disabled:R||P||F||I,onValueChange:e=>void y.updateChannel(e),children:[(0,O.jsx)(u,{className:`w-full max-w-sm`,children:(0,O.jsx)(l,{placeholder:t(`desktopUpdatesReleaseChannel`)})}),(0,O.jsxs)(d,{children:[(0,O.jsx)(f,{value:`stable`,children:t(`desktopUpdatesChannelStable`)}),(0,O.jsx)(f,{value:`beta`,children:t(`desktopUpdatesChannelBeta`)})]})]}),(0,O.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelDowngradeHint`)})]})}),(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-gray-200 p-4`,children:[(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(S,{children:t(`desktopUpdatesAutomaticChecks`)}),(0,O.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesAutomaticChecksHelp`)})]}),(0,O.jsx)(E,{checked:i.preferences.automaticChecks,disabled:L||R,onCheckedChange:e=>void y.updatePreferences({automaticChecks:e})})]}),(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-gray-200 p-4`,children:[(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(S,{children:t(`desktopUpdatesAutoDownload`)}),(0,O.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesAutoDownloadHelp`)})]}),(0,O.jsx)(E,{checked:i.preferences.autoDownload,disabled:L||R,onCheckedChange:e=>void y.updatePreferences({autoDownload:e})})]})]})]}),(0,O.jsxs)(T,{children:[(0,O.jsxs)(w,{children:[(0,O.jsx)(C,{children:t(`desktopUpdatesActionsTitle`)}),(0,O.jsx)(x,{children:t(`desktopUpdatesActionsDescription`)})]}),(0,O.jsxs)(b,{className:`flex flex-wrap items-center gap-3`,children:[(0,O.jsxs)(c,{variant:`outline`,onClick:()=>void y.checkForUpdates(),disabled:P||F||I,children:[(0,O.jsx)(g,{className:a(`mr-2 h-4 w-4`,P&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]}),(0,O.jsxs)(c,{onClick:()=>void y.downloadUpdate(),disabled:!z,children:[(0,O.jsx)(m,{className:a(`mr-2 h-4 w-4`,F&&`animate-bounce`)}),t(`desktopUpdatesDownloadNow`)]}),(0,O.jsxs)(c,{variant:`secondary`,onClick:()=>void y.applyDownloadedUpdate(),disabled:!B,children:[(0,O.jsx)(_,{className:a(`mr-2 h-4 w-4`,I&&`animate-spin`)}),t(`desktopUpdatesApplyNow`)]}),i.releaseNotesUrl?(0,O.jsxs)(c,{variant:`ghost`,onClick:()=>window.open(i.releaseNotesUrl??``,`_blank`,`noopener,noreferrer`),children:[(0,O.jsx)(h,{className:`mr-2 h-4 w-4`}),t(`desktopUpdatesReleaseNotes`)]}):null]})]})]})}export{P as DesktopUpdateConfig};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-DvzXOGQX.js";import{_ as i,a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as ee,n as te,o as p,r as ne,t as re}from"./es2015-CEAreese.js";import{t as m}from"./dist-Dd9cr-kz.js";import{t as ie}from"./x-BHUGQIUv.js";var h=e(t(),1),g=n(),_=`Dialog`,[v,ae]=u(_),[y,b]=v(_),x=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=h.useRef(null),u=h.useRef(null),[d,f]=s({prop:r,defaultProp:i??!1,onChange:a,caller:_});return(0,g.jsx)(y,{scope:t,triggerRef:l,contentRef:u,contentId:c(),titleId:c(),descriptionId:c(),open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};x.displayName=_;var S=`DialogTrigger`,oe=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=b(S,n),s=l(t,a.triggerRef);return(0,g.jsx)(o.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":z(a.open),...r,ref:s,onClick:i(e.onClick,a.onOpenToggle)})});oe.displayName=S;var C=`DialogPortal`,[se,w]=v(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=b(C,t);return(0,g.jsx)(se,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,g.jsx)(m,{present:n||a.open,children:(0,g.jsx)(d,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=h.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=b(E,e.__scopeDialog);return a.modal?(0,g.jsx)(m,{present:r||a.open,children:(0,g.jsx)(k,{...i,ref:t})}):null});D.displayName=E;var O=f(`DialogOverlay.RemoveScroll`),k=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b(E,n);return(0,g.jsx)(te,{as:O,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(o.div,{"data-state":z(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),A=`DialogContent`,j=h.forwardRef((e,t)=>{let n=w(A,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=b(A,e.__scopeDialog);return(0,g.jsx)(m,{present:r||a.open,children:a.modal?(0,g.jsx)(ce,{...i,ref:t}):(0,g.jsx)(le,{...i,ref:t})})});j.displayName=A;var ce=h.forwardRef((e,t)=>{let n=b(A,e.__scopeDialog),r=h.useRef(null),a=l(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return re(e)},[]),(0,g.jsx)(M,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:i(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:i(e.onFocusOutside,e=>e.preventDefault())})}),le=h.forwardRef((e,t)=>{let n=b(A,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,g.jsx)(M,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),M=h.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,c=b(A,n),u=h.useRef(null),d=l(t,u);return ne(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(a,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,g.jsx)(p,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":z(c.open),...s,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(H,{titleId:c.titleId}),(0,g.jsx)(de,{contentRef:u,descriptionId:c.descriptionId})]})]})}),N=`DialogTitle`,P=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b(N,n);return(0,g.jsx)(o.h2,{id:i.titleId,...r,ref:t})});P.displayName=N;var F=`DialogDescription`,I=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b(F,n);return(0,g.jsx)(o.p,{id:i.descriptionId,...r,ref:t})});I.displayName=F;var L=`DialogClose`,R=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=b(L,n);return(0,g.jsx)(o.button,{type:`button`,...r,ref:t,onClick:i(e.onClick,()=>a.onOpenChange(!1))})});R.displayName=L;function z(e){return e?`open`:`closed`}var B=`DialogTitleWarning`,[ue,V]=ee(B,{contentName:A,titleName:N,docsSlug:`dialog`}),H=({titleId:e})=>{let t=V(B),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},U=`DialogDescriptionWarning`,de=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${V(U).contentName}}.`;return h.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},fe=x,pe=T,W=D,G=j,K=P,q=I,me=R,he=fe,ge=pe,J=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(W,{ref:n,className:r(`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));J.displayName=W.displayName;var Y=h.forwardRef(({className:e,children:t,...n},i)=>(0,g.jsxs)(ge,{children:[(0,g.jsx)(J,{}),(0,g.jsxs)(G,{ref:i,className:r(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200/50 bg-white p-6 shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-2xl`,e),...n,children:[t,(0,g.jsxs)(me,{className:`absolute right-4 top-4 rounded-lg p-1 opacity-70 ring-offset-white transition-all duration-fast hover:opacity-100 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,g.jsx)(ie,{className:`h-4 w-4 text-gray-500`}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Y.displayName=G.displayName;var X=({className:e,...t})=>(0,g.jsx)(`div`,{className:r(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});X.displayName=`DialogHeader`;var Z=({className:e,...t})=>(0,g.jsx)(`div`,{className:r(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...t});Z.displayName=`DialogFooter`;var Q=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(K,{ref:n,className:r(`text-lg font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));Q.displayName=K.displayName;var $=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(q,{ref:n,className:r(`text-sm text-gray-500 leading-relaxed`,e),...t}));$.displayName=q.displayName;export{X as a,Z as i,Y as n,Q as o,$ as r,he as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-
|
|
1
|
+
import{_ as e,m as t}from"./i18n-DvzXOGQX.js";import{g as n,p as r}from"./es2015-CEAreese.js";var i=e(t(),1);function a(e,t){return i.useReducer((e,n)=>t[e][n]??e,e)}var o=e=>{let{present:t,children:r}=e,a=s(t),o=typeof r==`function`?r({present:a.isPresent}):i.Children.only(r),c=n(a.ref,l(o));return typeof r==`function`||a.isPresent?i.cloneElement(o,{ref:c}):null};o.displayName=`Presence`;function s(e){let[t,n]=i.useState(),o=i.useRef(null),s=i.useRef(e),l=i.useRef(`none`),[u,d]=a(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return i.useEffect(()=>{let e=c(o.current);l.current=u===`mounted`?e:`none`},[u]),r(()=>{let t=o.current,n=s.current;if(n!==e){let r=l.current,i=c(t);e?d(`MOUNT`):i===`none`||t?.display===`none`?d(`UNMOUNT`):d(n&&r!==i?`ANIMATION_OUT`:`UNMOUNT`),s.current=e}},[e,d]),r(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,r=r=>{let i=c(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(d(`ANIMATION_END`),!s.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},i=e=>{e.target===t&&(l.current=c(o.current))};return t.addEventListener(`animationstart`,i),t.addEventListener(`animationcancel`,r),t.addEventListener(`animationend`,r),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,i),t.removeEventListener(`animationcancel`,r),t.removeEventListener(`animationend`,r)}}else d(`ANIMATION_END`)},[t,d]),{isPresent:[`mounted`,`unmountSuspended`].includes(u),ref:i.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}function c(e){return e?.animationName||`none`}function l(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}export{o as t};
|