@nextclaw/ui 0.12.34 → 0.12.35-beta.0
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/CHANGELOG.md +63 -0
- package/dist/assets/{api-rASx2-N4.js → api-De1PAch0.js} +3 -3
- package/dist/assets/{book-open-BcnAiKde.js → book-open-825Pcd0z.js} +1 -1
- package/dist/assets/channels-list-page-CGjXDSD-.js +8 -0
- package/dist/assets/chat-page-RsUTK_bY.js +105 -0
- package/dist/assets/{config-split-page-CcrEUtwu.js → config-split-page-BvfxFQSb.js} +1 -1
- package/dist/assets/{createLucideIcon-DzY6wN61.js → createLucideIcon-CeNHY6BW.js} +1 -1
- package/dist/assets/desktop-update-config-B_YIv5ZJ.js +1 -0
- package/dist/assets/{dist-NBjcwlsw.js → dist-uH7tiW6E.js} +1 -1
- package/dist/assets/{doc-browser-D2pq4IHR.js → doc-browser-CDe9yz9n.js} +1 -1
- package/dist/assets/doc-browser-DwT64GuF.js +1 -0
- package/dist/assets/{doc-browser-context-BPeeiNJ_.js → doc-browser-context-CQAx_92e.js} +1 -1
- package/dist/assets/{es2015-CVAuMqlM.js → es2015-c9XYpli5.js} +1 -1
- package/dist/assets/{external-link-CpEvG65F.js → external-link-BE1deZ_c.js} +1 -1
- package/dist/assets/i18n-DnubSHoK.js +1 -0
- package/dist/assets/index-6WZ6JjaU.css +1 -0
- package/dist/assets/index-BjH_p3R6.js +103 -0
- package/dist/assets/{key-round-DUq47t0P.js → key-round-CHo3gqpO.js} +1 -1
- package/dist/assets/mcp-marketplace-page-0C214hGi.js +40 -0
- package/dist/assets/mcp-marketplace-page-amWcMncu.js +1 -0
- package/dist/assets/model-config-B8zNrkag.js +1 -0
- package/dist/assets/notice-card-DO33_LzD.js +5 -0
- package/dist/assets/play-CqlWbVNo.js +1 -0
- package/dist/assets/plus-p61tQh2-.js +1 -0
- package/dist/assets/provider-scoped-model-input-B0_r_4EY.js +1 -0
- package/dist/assets/providers-list-B6v3foi7.js +1 -0
- package/dist/assets/remote-k671rLmY.js +1 -0
- package/dist/assets/{rotate-cw-BN9yjccP.js → rotate-cw-CYUByuqo.js} +1 -1
- package/dist/assets/runtime-config-page-DgH-XJwK.js +1 -0
- package/dist/assets/{save-CO_4qf6b.js → save-B6Ga8JIq.js} +1 -1
- package/dist/assets/{search-CRtQwr-h.js → search-5kKpgNoP.js} +1 -1
- package/dist/assets/search-config-DPZ6d9y6.js +1 -0
- package/dist/assets/{secrets-config-DFbHCb9n.js → secrets-config-CrXA11bo.js} +2 -2
- package/dist/assets/{select-HI5kiwX_.js → select-C0hGOCOK.js} +1 -1
- package/dist/assets/{setting-row-B4QnghjV.js → setting-row-xsM_0nTd.js} +1 -1
- package/dist/assets/{tabs-custom-D48zdZoc.js → tabs-custom-Bnqfhe4p.js} +1 -1
- package/dist/assets/{tag-chip-BPgMfp9l.js → tag-chip-cktJJMzh.js} +1 -1
- package/dist/assets/x-DDQw-C2x.js +1 -0
- package/dist/index.html +17 -29
- package/package.json +9 -9
- package/src/app/components/layout/app-layout.test.tsx +49 -4
- package/src/app/components/layout/app-layout.tsx +4 -7
- package/src/app/components/layout/settings-entry-page.test.tsx +9 -0
- package/src/app/components/layout/sidebar.layout.test.tsx +2 -2
- package/src/app/components/layout/sidebar.tsx +3 -3
- package/src/app/configs/app-navigation.config.ts +0 -12
- package/src/app/hooks/use-app-event-consumers.ts +1 -6
- package/src/app/hooks/use-viewport-layout.ts +0 -1
- package/src/app/index.tsx +2 -10
- package/src/features/channels/components/config/channel-form.tsx +85 -47
- package/src/features/channels/components/config/weixin-channel-auth-section.test.tsx +45 -1
- package/src/features/channels/components/config/weixin-channel-auth-section.tsx +119 -1
- package/src/features/channels/hooks/use-channel-auth.ts +8 -1
- package/src/features/channels/index.ts +1 -1
- package/src/features/chat/components/conversation/chat-conversation-panel.test.tsx +2 -2
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +2 -7
- package/src/features/chat/components/layout/chat-sidebar.test.tsx +27 -3
- package/src/features/chat/components/layout/chat-sidebar.tsx +2 -3
- package/src/features/chat/managers/chat-session-list.manager.test.ts +12 -11
- package/src/features/chat/managers/chat-session-list.manager.ts +2 -1
- package/src/features/chat/managers/chat-ui.manager.ts +2 -2
- package/src/features/chat/managers/ncp-chat-input.manager.test.ts +3 -3
- package/src/features/chat/pages/ncp-chat-page.test.ts +3 -0
- package/src/features/chat/pages/ncp-chat-page.tsx +19 -19
- package/src/features/chat/utils/chat-session-route.utils.test.ts +14 -0
- package/src/features/chat/utils/chat-session-route.utils.ts +3 -1
- package/src/features/chat/utils/ncp-chat-runtime-availability.utils.test.ts +6 -6
- package/src/features/marketplace/components/marketplace-list-card.tsx +4 -36
- package/src/features/marketplace/components/marketplace-page-detail.test.tsx +0 -1
- package/src/features/marketplace/components/marketplace-page.test.tsx +9 -128
- package/src/features/marketplace/components/marketplace-page.tsx +16 -72
- package/src/features/marketplace/hooks/use-marketplace-curated-scene-route.ts +1 -1
- package/src/features/marketplace/hooks/use-marketplace.ts +1 -10
- package/src/features/marketplace/utils/marketplace-installed-cache.utils.test.ts +23 -21
- package/src/features/system-status/managers/system-status.manager.bootstrap-polling.test.ts +12 -12
- package/src/features/system-status/managers/system-status.manager.test.ts +6 -6
- package/src/index.css +1 -1
- package/src/platforms/desktop/components/desktop-app-shell.test.tsx +29 -13
- package/src/platforms/desktop/components/desktop-app-shell.tsx +14 -16
- package/src/platforms/desktop/components/desktop-window-chrome.tsx +2 -3
- package/src/platforms/mobile/components/mobile-app-shell.tsx +3 -1
- package/src/platforms/mobile/components/mobile-topbar.tsx +6 -5
- package/src/platforms/mobile/index.ts +1 -0
- package/src/shared/components/config/provider-form-support.ts +51 -33
- package/src/shared/components/config/provider-form.tsx +68 -35
- package/src/shared/components/config/provider-models-section.tsx +19 -4
- package/src/shared/components/model-config.test.tsx +2 -0
- package/src/shared/components/ui/button.tsx +1 -1
- package/src/shared/lib/api/channel-auth.types.ts +8 -0
- package/src/shared/lib/api/types.ts +17 -20
- package/src/shared/lib/api/utils/channel-auth.utils.ts +10 -1
- package/src/shared/lib/api/utils/marketplace.utils.ts +0 -5
- package/src/shared/lib/i18n/channel-auth.constants.ts +24 -10
- package/src/shared/lib/i18n/chat-labels.utils.ts +2 -2
- package/src/shared/lib/i18n/index.ts +2 -0
- package/src/shared/lib/i18n/marketplace.ts +0 -16
- package/src/shared/lib/provider-models/index.ts +41 -13
- package/src/shared/lib/ui-document-title/index.ts +0 -1
- package/dist/assets/app-manager-provider-CUkcbdWk.js +0 -1
- package/dist/assets/channels-list-page-ZWYqfcCe.js +0 -8
- package/dist/assets/chat-page-ACm58eUO.js +0 -1
- package/dist/assets/cpu-DKc3bQic.js +0 -3
- package/dist/assets/desktop-C-cDRCBY.js +0 -3
- package/dist/assets/desktop-update-config-DAD9JN9Q.js +0 -1
- package/dist/assets/dialog-CR80q3Rm.js +0 -5
- package/dist/assets/doc-browser-DhIkcy0-.js +0 -1
- package/dist/assets/doc-browser-fLs0TcdS.js +0 -1
- package/dist/assets/download-CMM8po31.js +0 -1
- package/dist/assets/i18n-D1144VAA.js +0 -1
- package/dist/assets/index-DV57tBmg.css +0 -1
- package/dist/assets/index-Db9Cufsy.js +0 -100
- package/dist/assets/marketplace-page-CAp_gpNe.js +0 -105
- package/dist/assets/marketplace-page-PPY5uMHK.js +0 -1
- package/dist/assets/mcp-marketplace-page-87__92b1.js +0 -1
- package/dist/assets/mcp-marketplace-page-C6HENB6V.js +0 -40
- package/dist/assets/model-config-CK3a8DWH.js +0 -1
- package/dist/assets/notice-card-CF4AJPM3.js +0 -1
- package/dist/assets/play-AqrNslHI.js +0 -1
- package/dist/assets/plus-B-YHtTNC.js +0 -1
- package/dist/assets/popover-DeAliE_4.js +0 -1
- package/dist/assets/provider-scoped-model-input-B8LJ6RCt.js +0 -1
- package/dist/assets/providers-list-BTPjqNdK.js +0 -1
- package/dist/assets/refresh-cw-CrbD8EkT.js +0 -1
- package/dist/assets/remote-DiPWGRZc.js +0 -1
- package/dist/assets/runtime-config-page-Bb9he7t8.js +0 -1
- package/dist/assets/search-config-BkbSXa9d.js +0 -1
- package/dist/assets/settings-MWL2SMyk.js +0 -1
- package/dist/assets/sparkles-BmgOD4nY.js +0 -1
- package/dist/assets/status-dot-l3kPFdq_.js +0 -1
- package/dist/assets/use-config-BFqzVF8Y.js +0 -1
- package/dist/assets/use-infinite-scroll-loader-DXhw9W4l.js +0 -1
- package/dist/assets/x-BeyYA_h6.js +0 -1
- /package/dist/assets/{config-hints-BNfpOL4J.js → config-hints-DGfwbumO.js} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-D1144VAA.js";import{t as n}from"./createLucideIcon-DzY6wN61.js";var r=`modulepreload`,i=function(e){return`/`+e},a={},o=function(e,t,n){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=i(t,n),t in a)return;a[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(n)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`:r,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)})},s=e(t(),1),c=`popstate`;function l(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n){let r=h(i?l().pathname:`/`,e,t,n);return f(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:g(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?_(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function u(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return h(``,{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:g(t)}return v(t,n,null,e)}function d(e,t){if(e===!1||e==null)throw Error(t)}function f(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function p(){return Math.random().toString(36).substring(2,10)}function m(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?_(t):t,state:n,key:t&&t.key||r||p()}}function g({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 _(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 v(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,l=null,u=d();u??(u=0,o.replaceState({...o.state,idx:u},``));function d(){return(o.state||{idx:null}).idx}function f(){s=`POP`;let e=d(),t=e==null?null:e-u;u=e,l&&l({action:s,location:v.location,delta:t})}function p(e,t){s=`PUSH`;let r=h(v.location,e,t);n&&n(r,e),u=d()+1;let c=m(r,u),f=v.createHref(r);try{o.pushState(c,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&l&&l({action:s,location:v.location,delta:1})}function g(e,t){s=`REPLACE`;let r=h(v.location,e,t);n&&n(r,e),u=d();let i=m(r,u),c=v.createHref(r);o.replaceState(i,``,c),a&&l&&l({action:s,location:v.location,delta:0})}function _(e){return y(e)}let v={get action(){return s},get location(){return e(i,o)},listen(e){if(l)throw Error(`A history only accepts one active listener`);return i.addEventListener(c,f),l=e,()=>{i.removeEventListener(c,f),l=null}},createHref(e){return t(i,e)},createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:p,replace:g,go(e){return o.go(e)}};return v}function y(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),d(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:g(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function b(e,t,n=`/`){return x(e,t,n,!1)}function x(e,t,n,r){let i=D((typeof t==`string`?_(t):t).pathname||`/`,n);if(i==null)return null;let a=C(e);T(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=de(i);o=le(a[e],t,r)}return o}function S(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 C(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;d(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=j([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(d(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),C(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of w(e.path))a(e,t,!0,n)}),t}function w(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=w(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 T(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:ie),r)}function ce(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 le(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:ge(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]=ue(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 ue(e,t=!1,n=!0){f(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(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 de(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return f(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function 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 fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function pe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?_(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?me(n.substring(1),`/`):me(n,t)):a=t,{pathname:a,search:_e(r),hash:ve(i)}}function me(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 he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function k(e){let t=he(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=_(e):(i={...e},d(!i.pathname||!i.pathname.includes(`?`),O(`?`,`pathname`,`search`,i)),d(!i.pathname||!i.pathname.includes(`#`),O(`#`,`pathname`,`hash`,i)),d(!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=pe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var j=e=>e.join(`/`).replace(/\/\/+/g,`/`),ge=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),_e=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ve=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ye=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 be(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xe(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var Se=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ce(e,t){let n=e;if(typeof n!=`string`||!fe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Se)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{f(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var we=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(we);var Te=[`GET`,...we];new Set(Te);var M=s.createContext(null);M.displayName=`DataRouter`;var N=s.createContext(null);N.displayName=`DataRouterState`;var Ee=s.createContext(!1),De=s.createContext({isTransitioning:!1});De.displayName=`ViewTransition`;var Oe=s.createContext(new Map);Oe.displayName=`Fetchers`;var ke=s.createContext(null);ke.displayName=`Await`;var P=s.createContext(null);P.displayName=`Navigation`;var F=s.createContext(null);F.displayName=`Location`;var I=s.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var Ae=s.createContext(null);Ae.displayName=`RouteError`;var je=`REACT_ROUTER_ERROR`,Me=`REDIRECT`,Ne=`ROUTE_ERROR_RESPONSE`;function Pe(e){if(e.startsWith(`${je}:${Me}:{`))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 Fe(e){if(e.startsWith(`${je}:${Ne}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ye(t.status,t.statusText,t.data)}catch{}}function Ie(e,{relative:t}={}){d(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=s.useContext(P),{hash:i,pathname:a,search:o}=B(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:j([n,a])),r.createHref({pathname:c,search:o,hash:i})}function L(){return s.useContext(F)!=null}function R(){return d(L(),`useLocation() may be used only in the context of a <Router> component.`),s.useContext(F).location}var Le=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Re(e){s.useContext(P).static||s.useLayoutEffect(e)}function z(){let{isDataRoute:e}=s.useContext(I);return e?tt():ze()}function ze(){d(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=s.useContext(M),{basename:t,navigator:n}=s.useContext(P),{matches:r}=s.useContext(I),{pathname:i}=R(),a=JSON.stringify(k(r)),o=s.useRef(!1);return Re(()=>{o.current=!0}),s.useCallback((r,s={})=>{if(f(o.current,Le),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=A(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}s.createContext(null);function Be(){let{matches:e}=s.useContext(I),t=e[e.length-1];return t?t.params:{}}function B(e,{relative:t}={}){let{matches:n}=s.useContext(I),{pathname:r}=R(),i=JSON.stringify(k(n));return s.useMemo(()=>A(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ve(e,t){return He(e,t)}function He(e,t,n,r,i){d(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=s.useContext(P),{matches:o}=s.useContext(I),c=o[o.length-1],l=c?c.params:{},u=c?c.pathname:`/`,p=c?c.pathnameBase:`/`,m=c&&c.route;{let e=m&&m.path||``;rt(u,!m||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (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
|
-
|
|
3
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let h=R(),g;if(t){let e=typeof t==`string`?_(t):t;d(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.`),g=e}else g=h;let v=g.pathname||`/`,y=v;if(p!==`/`){let e=p.replace(/^\//,``).split(`/`);y=`/`+v.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let x=b(e,{pathname:y});f(m||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),f(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 "${g.pathname}${g.search}${g.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=Je(x&&x.map(e=>Object.assign({},e,{params:Object.assign({},l,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])})),o,n,r,i);return t&&S?s.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...g},navigationType:`POP`}},S):S}function Ue(){let e=et(),t=be(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=s.createElement(s.Fragment,null,s.createElement(`p`,null,`💿 Hey developer 👋`),s.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,s.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,s.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),s.createElement(s.Fragment,null,s.createElement(`h2`,null,`Unexpected Application Error!`),s.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?s.createElement(`pre`,{style:i},n):null,o)}var We=s.createElement(Ue,null),Ge=class extends s.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=Fe(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:s.createElement(I.Provider,{value:this.props.routeContext},s.createElement(Ae.Provider,{value:e,children:this.props.component}));return this.context?s.createElement(Ke,{error:e},t):t}};Ge.contextType=Ee;var V=new WeakMap;function Ke({children:e,error:t}){let{basename:n}=s.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Pe(t.digest);if(e){let r=V.get(t);if(r)throw r;let i=Ce(e.location,n);if(Se&&!V.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 V.set(t,n),n}return s.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function qe({routeContext:e,match:t,children:n}){let r=s.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(I.Provider,{value:e},n)}function Je(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,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);d(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let c=!1,l=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=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=l>=0?a.slice(0,l+1):[a[0]];break}}}let u=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:xe(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let d,f=!1,p=null,m=null;n&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||We,c&&(l<0&&i===0?(rt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):l===i&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,i+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?s.createElement(r.route.Component,null):r.route.element?r.route.element:e,s.createElement(qe,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?s.createElement(Ge,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function H(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ye(e){let t=s.useContext(M);return d(t,H(e)),t}function U(e){let t=s.useContext(N);return d(t,H(e)),t}function Xe(e){let t=s.useContext(I);return d(t,H(e)),t}function W(e){let t=Xe(e),n=t.matches[t.matches.length-1];return d(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ze(){return W(`useRouteId`)}function Qe(){return U(`useNavigation`).navigation}function $e(){let{matches:e,loaderData:t}=U(`useMatches`);return s.useMemo(()=>e.map(e=>S(e,t)),[e,t])}function et(){let e=s.useContext(Ae),t=U(`useRouteError`),n=W(`useRouteError`);return e===void 0?t.errors?.[n]:e}function tt(){let{router:e}=Ye(`useNavigate`),t=W(`useNavigate`),n=s.useRef(!1);return Re(()=>{n.current=!0}),s.useCallback(async(r,i={})=>{f(n.current,Le),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var nt={};function rt(e,t,n){!t&&!nt[e]&&(nt[e]=!0,f(!1,n))}s.useOptimistic,s.memo(it);function it({routes:e,future:t,state:n,onError:r}){return He(e,void 0,n,r,t)}function at({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=s.useRef();a.current??=l({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[c,u]=s.useState({action:o.action,location:o.location}),d=s.useCallback(e=>{i===!1?u(e):s.startTransition(()=>u(e))},[i]);return s.useLayoutEffect(()=>o.listen(d),[o,d]),s.createElement(G,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:i})}function ot({to:e,replace:t,state:n,relative:r}){d(L(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=s.useContext(P);f(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=s.useContext(I),{pathname:o}=R(),c=z(),l=A(e,k(a),o,r===`path`),u=JSON.stringify(l);return s.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function st(e){d(!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 G({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){d(!L(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=s.useMemo(()=>({basename:c,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[c,i,a,o]);typeof n==`string`&&(n=_(n));let{pathname:u=`/`,search:p=``,hash:m=``,state:h=null,key:g=`default`}=n,v=s.useMemo(()=>{let e=D(u,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:g},navigationType:r}},[c,u,p,m,h,g,r]);return f(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:s.createElement(P.Provider,{value:l},s.createElement(F.Provider,{children:t,value:v}))}function ct({children:e,location:t}){return Ve(K(e),t)}s.Component;function K(e,t=[]){let n=[];return s.Children.forEach(e,(e,r)=>{if(!s.isValidElement(e))return;let i=[...t,r];if(e.type===s.Fragment){n.push.apply(n,K(e.props.children,i));return}d(e.type===st,`[${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>`),d(!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=K(e.props.children,i)),n.push(a)}),n}var q=`get`,J=`application/x-www-form-urlencoded`;function Y(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function lt(e){return Y(e)&&e.tagName.toLowerCase()===`button`}function ut(e){return Y(e)&&e.tagName.toLowerCase()===`form`}function dt(e){return Y(e)&&e.tagName.toLowerCase()===`input`}function ft(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pt(e,t){return e.button===0&&(!t||t===`_self`)&&!ft(e)}var X=null;function mt(){if(X===null)try{new FormData(document.createElement(`form`),0),X=!1}catch{X=!0}return X}var ht=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function gt(e){return e!=null&&!ht.has(e)?(f(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${J}"`),null):e}function _t(e,t){let n,r,i,a,o;if(ut(e)){let o=e.getAttribute(`action`);r=o?D(o,t):null,n=e.getAttribute(`method`)||q,i=gt(e.getAttribute(`enctype`))||J,a=new FormData(e)}else if(lt(e)||dt(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`)||q,i=gt(e.getAttribute(`formenctype`))||gt(o.getAttribute(`enctype`))||J,a=new FormData(o,e),!mt()){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(Y(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=q,r=null,i=J,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 vt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},yt=/[&><\u2028\u2029]/g;function bt(e){return e.replace(yt,e=>vt[e])}function xt(e,t){if(e===!1||e==null)throw Error(t)}function St(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 Ct(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>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 wt(e){return e!=null&&typeof e.page==`string`}function Tt(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 Et(e,t,n){return jt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ct(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Tt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Dt(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 Ot(e,t,{includeHydrateFallback:n}={}){return kt(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 kt(e){return[...new Set(e)]}function At(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function jt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!wt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(At(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Mt(){let e=s.useContext(M);return xt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Nt(){let e=s.useContext(N);return xt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Z=s.createContext(void 0);Z.displayName=`FrameworkContext`;function Pt(){let e=s.useContext(Z);return xt(e,`You must render this element inside a <HydratedRouter> element`),e}function Ft(e,t){let n=s.useContext(Z),[r,i]=s.useState(!1),[a,o]=s.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=s.useRef(null);s.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),s.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!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 It({page:e,...t}){let{router:n}=Mt(),r=s.useMemo(()=>b(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?s.createElement(Rt,{page:e,matches:r,...t}):null}function Lt(e){let{manifest:t,routeModules:n}=Pt(),[r,i]=s.useState([]);return s.useEffect(()=>{let r=!1;return Et(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Rt({page:e,matches:t,...n}){let r=R(),{future:i,manifest:a,routeModules:o}=Pt(),{basename:c}=Mt(),{loaderData:l,matches:u}=Nt(),d=s.useMemo(()=>Dt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=s.useMemo(()=>Dt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!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&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=St(e,c,i.unstable_trailingSlashAwareDataRequests,`data`);return s&&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,o]),m=s.useMemo(()=>Ot(f,a),[f,a]),h=Lt(f);return s.createElement(s.Fragment,null,p.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>s.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>s.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function zt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}s.Component;var Bt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Bt&&(window.__reactRouterVersion=`7.13.0`)}catch{}function Vt({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=s.useRef();i.current??=u({window:r,v5Compat:!0});let a=i.current,[o,c]=s.useState({action:a.action,location:a.location}),l=s.useCallback(e=>{n===!1?c(e):s.startTransition(()=>c(e))},[n]);return s.useLayoutEffect(()=>a.listen(l),[a,l]),s.createElement(G,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Ht({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=s.useState({action:n.action,location:n.location}),o=s.useCallback(e=>{r===!1?a(e):s.startTransition(()=>a(e))},[r]);return s.useLayoutEffect(()=>n.listen(o),[n,o]),s.createElement(G,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Ht.displayName=`unstable_HistoryRouter`;var Ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wt=s.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:o,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,unstable_useTransitions:g}=s.useContext(P),_=typeof l==`string`&&Ut.test(l),v=Ce(l,h);l=v.to;let y=Ie(l,{relative:r}),[b,x,S]=Ft(n,p),C=Zt(l,{replace:a,state:o,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=s.createElement(`a`,{...p,...S,href:v.absoluteURL||y,onClick:v.isExternal||i?e:w,ref:zt(m,x),target:c,"data-discover":!_&&t===`render`?`true`:void 0});return b&&!_?s.createElement(s.Fragment,null,T,s.createElement(It,{page:y})):T});Wt.displayName=`Link`;var Gt=s.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:c,...l},u){let d=B(a,{relative:l.relative}),f=R(),p=s.useContext(N),{navigator:m,basename:h}=s.useContext(P),g=p!=null&&sn(d)&&o===!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 s.createElement(Wt,{...l,"aria-current":w,className:T,ref:u,style:ee,to:a,viewTransition:o},typeof c==`function`?c(C):c)});Gt.displayName=`NavLink`;var Kt=s.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=q,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=s.useContext(P),_=en(),v=tn(c,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Ut.test(c);return s.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`)||o,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?s.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Kt.displayName=`Form`;function qt({getKey:e,storageKey:t,...n}){let r=s.useContext(Z),{basename:i}=s.useContext(P),a=R(),o=$e();an({getKey:e,storageKey:t});let c=s.useMemo(()=>{if(!r||!e)return null;let t=rn(a,o,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 s.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${bt(JSON.stringify(t||nn))}, ${bt(JSON.stringify(c))})`}})}qt.displayName=`ScrollRestoration`;function Jt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yt(e){let t=s.useContext(M);return d(t,Jt(e)),t}function Xt(e){let t=s.useContext(N);return d(t,Jt(e)),t}function Zt(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=z(),d=R(),f=B(e,{relative:a});return s.useCallback(p=>{if(pt(p,t)){p.preventDefault();let t=n===void 0?g(d)===g(f):n,m=()=>u(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:c});l?s.startTransition(()=>m()):m()}},[d,u,f,n,r,t,e,i,a,o,c,l])}var Qt=0,$t=()=>`__${String(++Qt)}__`;function en(){let{router:e}=Yt(`useSubmit`),{basename:t}=s.useContext(P),n=Ze(),r=e.fetch,i=e.navigate;return s.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=_t(e,t);a.navigate===!1?await r(a.fetcherKey||$t(),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 tn(e,{relative:t}={}){let{basename:n}=s.useContext(P),r=s.useContext(I);d(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...B(e||`.`,{relative:t})},o=R();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:j([n,a.pathname])),g(a)}var nn=`react-router-scroll-positions`,$={};function rn(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 an({getKey:e,storageKey:t}={}){let{router:n}=Yt(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Xt(`useScrollRestoration`),{basename:a}=s.useContext(P),o=R(),c=$e(),l=Qe();s.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),on(s.useCallback(()=>{if(l.state===`idle`){let t=rn(o,c,a,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||nn,JSON.stringify($))}catch(e){f(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,c,t])),typeof document<`u`&&(s.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||nn);e&&($=JSON.parse(e))}catch{}},[t]),s.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>rn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{f(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function on(e,t){let{capture:n}=t||{};s.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function sn(e,{relative:t}={}){let n=s.useContext(De);d(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Yt(`useViewTransitionState`),i=B(e,{relative:t});if(!n.isTransitioning)return!1;let a=D(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=D(n.nextLocation.pathname,r)||n.nextLocation.pathname;return E(i.pathname,o)!=null||E(i.pathname,a)!=null}var cn=n(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]);export{Gt as a,ct as c,Be as d,o as f,at as i,R as l,Vt as n,ot as o,Wt as r,st as s,cn as t,z as u};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/doc-browser-DhIkcy0-.js","assets/doc-browser-D2pq4IHR.js","assets/i18n-D1144VAA.js","assets/createLucideIcon-DzY6wN61.js","assets/search-CRtQwr-h.js","assets/book-open-BcnAiKde.js","assets/external-link-CpEvG65F.js","assets/plus-B-YHtTNC.js","assets/x-BeyYA_h6.js","assets/doc-browser-context-BPeeiNJ_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as e,i as t,m as n,p as r,r as i,u as a}from"./i18n-D1144VAA.js";import{Dt as o,Et as s,Lt as c,Nt as l,Ot as u,Tt as d,bt as f,gt as p,mt as m,pt as h,wt as ee,yt as g}from"./api-rASx2-N4.js";import{a as _,f as v,t as y}from"./cpu-DKc3bQic.js";import{t as b}from"./createLucideIcon-DzY6wN61.js";import{n as te,t as ne}from"./search-CRtQwr-h.js";import{t as re}from"./book-open-BcnAiKde.js";import{i as ie,k as ae,n as oe,r as se,t as ce}from"./select-HI5kiwX_.js";import{t as x}from"./download-CMM8po31.js";import{t as le}from"./key-round-DUq47t0P.js";import{h as ue,n as de}from"./app-manager-provider-CUkcbdWk.js";import{n as fe,t as pe}from"./settings-MWL2SMyk.js";import{t as me}from"./refresh-cw-CrbD8EkT.js";import{t as he}from"./sparkles-BmgOD4nY.js";import{t as ge}from"./x-BeyYA_h6.js";import{i as _e}from"./doc-browser-context-BPeeiNJ_.js";import{n as ve}from"./doc-browser-fLs0TcdS.js";import{t as ye}from"./use-config-BFqzVF8Y.js";import{n as be,r as xe,t as Se}from"./popover-DeAliE_4.js";var S=b(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),C=b(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),w=b(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),T=b(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),E=b(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),D=b(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),O=b(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),k=b(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),Ce=b(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),we=b(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Te=b(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),A=b(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Ee=b(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),j=b(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),M=f(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),De=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}M.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();M.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){M.setState({supported:!0,initialized:!0,busyAction:null}),c.error(`${i(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{M.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(i(`runtimePresenceLaunchAtLoginUnavailable`));M.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return M.setState({supported:!0,initialized:!0,snapshot:n}),c.success(i(`runtimePresenceSaved`)),n}catch(e){throw c.error(`${i(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{M.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:i(`error`)}},N=f(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){N.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{N.setState({supported:!0,initialized:!0,snapshot:e})}),N.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();N.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){N.setState({supported:!0,initialized:!0}),c.error(`${i(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,i(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){c.success(i(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){c.success(i(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??i(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){c.success(i(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&c.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,i(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&c.success(i(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,i(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updatePreferences=async e=>{try{await this.runSnapshotCommand(`saving-preferences`,i(`desktopUpdatesPreferencesFailed`),async t=>await t.updatePreferences(e))}catch{return}},this.updateChannel=async e=>{if(N.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,i(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){c.success(i(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}c.success(i(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(i(`desktopUpdatesDesktopOnlyDescription`));N.setState({busyAction:e});try{let e=await n(r);return N.setState({snapshot:e}),e}catch(e){throw c.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{N.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:i(`error`),this.getChannelLabel=e=>i(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function P(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function Oe(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function ke(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function Ae(e){return[{target:`/chat`,label:e(`chat`),icon:D},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:w},{target:`/agents`,label:e(`agentsPageTitle`),icon:C},{target:`/settings`,label:e(`settings`),icon:pe}]}function je(e){return[{target:`/model`,label:e(`model`),icon:y},{target:`/providers`,label:e(`providers`),icon:he},{target:`/channels`,label:e(`channels`),icon:fe},{target:`/search`,label:e(`searchChannels`),icon:ne},{target:`/runtime`,label:e(`runtime`),icon:y},{target:`/updates`,label:e(`updates`),icon:x},{target:`/remote`,label:e(`remote`),icon:Ee},{target:`/security`,label:e(`security`),icon:we},{target:`/secrets`,label:e(`secrets`),icon:le},{target:`/cron`,label:e(`cron`),icon:S},{target:`/marketplace/plugins`,label:e(`marketplaceFilterPlugins`),icon:Ce},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:j}]}function F(e){return[{target:`/language`,label:e(`language`),icon:E},...je(e)]}function Me(e){let t=e.toLowerCase();return t===`/settings`?!0:F(e=>e).some(e=>P(t,e.target))}function Ne(e,t){let n=e.toLowerCase(),r=F(t);if(ke(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(P(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}var Pe=`nextclaw.ui.theme`,I=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],L=`warm`,Fe=!1,R=new Set;function Ie(e){return e===`warm`||e===`cool`}function Le(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function Re(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Pe);if(Ie(e))return e}catch{}return`warm`}function z(){return Fe||=(L=Re(),Le(L),!0),L}function ze(){return Fe?L:z()}function Be(e){if(z(),e!==L){if(L=e,Le(L),typeof window<`u`)try{window.localStorage.setItem(Pe,L)}catch{}R.forEach(e=>e(L))}}function Ve(e){return R.add(e),()=>{R.delete(e)}}var B=r(),He={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-gray-300 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function Ue(){let e=p(),t=e.actionLabel===i(`runtimeStatusRestartAction`),n=async()=>{if(t)try{let e=await g.runRuntimeControlAction(`restart-service`);c.success(e.message)}catch(e){let t=e instanceof Error?e.message:i(`runtimeControlActionFailed`);c.error(`${i(`runtimeControlActionFailed`)}: ${t}`)}};return(0,B.jsxs)(Se,{children:[(0,B.jsx)(xe,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,children:(0,B.jsx)(`span`,{className:a(`h-2.5 w-2.5 rounded-full`,He[e.tone])})})}),(0,B.jsxs)(be,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,B.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,B.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,B.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,B.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:i(`runtimeStatusActionHint`)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void n(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?i(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}var V=e(n(),1);function H({className:e,density:t=`sidebar`,suffix:n}){let{data:r}=ye(),i=r?.name??`NextClaw`,o=r?.productVersion?.trim(),s=o?`v${o}`:null,c=n??(0,B.jsx)(Ue,{}),l=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`,u=t===`chrome`;return(0,B.jsxs)(`div`,{className:a(e??`flex min-w-0 items-center gap-2`,l&&`pl-[58px]`),children:[(0,B.jsx)(`div`,{className:a(`flex shrink-0 items-center justify-center overflow-hidden`,`h-6 w-6 rounded-md`),children:(0,B.jsx)(`img`,{src:`/logo.svg`,alt:i,className:`h-full w-full object-contain`})}),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,B.jsx)(`span`,{className:a(`shrink-0 font-semibold text-gray-800`,u?`text-[15px]`:`text-[14px]`),children:i}),s?(0,B.jsx)(We,{versionLabel:s,density:t}):null]}),(0,B.jsx)(Ge,{}),c?(0,B.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:c}):null]})]})}function We({versionLabel:e,density:t}){let[n,r]=(0,V.useState)(!1);return(0,B.jsxs)(`span`,{className:`relative min-w-0 flex-1`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),children:[(0,B.jsx)(`span`,{tabIndex:0,"aria-label":e,className:a(`block min-w-0 truncate font-medium text-gray-500 outline-none`,`text-[12px]`),children:e}),n?(0,B.jsx)(`span`,{className:`pointer-events-none absolute left-0 top-full z-[var(--z-tooltip)] mt-1 w-max max-w-none whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md`,children:e}):null]})}function Ge(){let{supported:e,busyAction:t,snapshot:n}=m();return!e||!n?null:n.status===`downloading`||n.status===`blocked`||n.status===`failed`?(0,B.jsx)(Ke,{snapshot:n}):n.status===`downloaded`?(0,B.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void h.applyDownloadedUpdate(),children:i(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)}):n.status===`update-available`?(0,B.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void h.downloadUpdate(),children:i(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)}):null}function Ke({snapshot:e}){if(e.status===`blocked`||e.status===`failed`)return(0,B.jsx)(qe,{snapshot:e});let t=e.status===`downloading`?Je(e):null;return t?(0,B.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,title:i(`updates`),children:t}):null}function qe({snapshot:e}){let t=e.status===`failed`?i(`desktopUpdatesStatusFailed`):i(`desktopUpdatesStatusBlocked`),n=e.recoveryCommand?.trim()||null,r=e.errorMessage?.trim()||e.blockReason?.trim()||null,a=[t,e.status===`blocked`&&e.blockReason?i(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,r,n].filter(Boolean).join(`
|
|
3
|
-
`);return(0,B.jsx)(`span`,{role:`img`,"aria-label":t,title:a,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100`,children:`!`})}function Je(e){let t=e.progress?.percent;return t==null?i(`desktopUpdatesInlineDownloading`):i(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var Ye={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`}};function U(e){return Ye[e]}function W({to:e,label:t,icon:n,density:r=`default`,className:i}){let o=U(r);return(0,B.jsx)(_,{to:e,className:({isActive:e})=>a(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,o.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,i),children:({isActive:e})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:a(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function Xe({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=U(r);return(0,B.jsxs)(`button`,{type:`button`,onClick:n,className:a(`flex w-full items-center rounded-xl font-medium text-gray-600 transition-all duration-base hover:bg-gray-200/60 hover:text-gray-800`,d.row,i),"data-testid":l,children:[(0,B.jsx)(t,{className:a(d.icon,`shrink-0 text-gray-400`)}),(0,B.jsx)(`span`,{className:a(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,B.jsx)(`span`,{className:a(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function Ze({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:o=`default`,children:s}){let c=U(o);return(0,B.jsxs)(ce,{value:n,onValueChange:i,children:[(0,B.jsxs)(ie,{className:a(`h-auto w-full rounded-xl border-0 bg-transparent font-medium text-gray-600 shadow-none hover:bg-gray-200/60 focus:ring-0`,c.row),children:[(0,B.jsxs)(`div`,{className:a(`flex min-w-0 items-center`,c.gap),children:[(0,B.jsx)(t,{className:a(c.icon,`text-gray-400`)}),(0,B.jsx)(`span`,{className:`text-left`,children:e})]}),(0,B.jsx)(`span`,{className:a(`ml-auto text-gray-500`,c.value),children:r})]}),(0,B.jsx)(oe,{children:s})]})}var G=`nextclaw-pwa-install-banner-dismissed`,K=`nextclaw-pwa-install-banner-dismissed-until`;function Qe(){let e=q();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:tt(e):!1}function $e(){let e=q();e?.setItem(G,`1`),e?.removeItem(K)}function et(){let e=q();e?.removeItem(G),e?.removeItem(K)}function q(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function tt(e){let t=e.getItem(K);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(K),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(G,`1`),!0)}function nt(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:Qe(),updateAvailable:!1,registrationFailed:!1}}var J=f(()=>nt()),Y=`nextclaw-pwa-dev-sw-reset`,X=new class{constructor(){this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{let e=await navigator.serviceWorker.register(`/sw.js`);this.registration=e,this.bindRegistration(e),navigator.serviceWorker.addEventListener(`controllerchange`,this.handleControllerChange),await this.syncUpdateAvailability()}catch{J.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){J.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;J.setState({updateAvailable:this.shouldSurfaceUpdate(e)})},this.applyUpdate=async()=>{let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;if(!e){window.location.reload();return}e.waiting||await e.update();let t=e.waiting;if(!t){window.location.reload();return}this.reloadWhenControllerChanges=!0,t.postMessage({type:`SKIP_WAIT`})},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(navigator.serviceWorker.removeEventListener(`controllerchange`,this.handleControllerChange),this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1)},this.bindRegistration=e=>{e.addEventListener(`updatefound`,()=>{let t=e.installing;t&&t.addEventListener(`statechange`,()=>{t.state===`installed`&&this.syncUpdateAvailability()})})},this.handleControllerChange=()=>{this.reloadWhenControllerChanges&&(this.reloadWhenControllerChanges=!1,window.location.reload())},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.shouldSurfaceUpdate=e=>!e?.waiting||!navigator.serviceWorker.controller?!1:J.getState().installability===`installed`,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));if(e.length===0){this.clearDevResetMarker();return}if(await Promise.all(e.map(async e=>await e.unregister())),await this.clearNextClawCaches(),navigator.serviceWorker.controller&&!this.hasDevResetMarker()){this.setDevResetMarker(),window.location.reload();return}this.clearDevResetMarker()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))},this.hasDevResetMarker=()=>{try{return window.sessionStorage.getItem(Y)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(Y,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(Y)}catch{}}}},Z=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),J.setState(nt())},this.refreshState=()=>{let e=this.resolveInstallability();J.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:Qe()})),X.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{$e(),J.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(et(),this.refreshState(),c.success(i(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,et(),J.setState({dismissedInstallPrompt:!0}),c.success(i(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function rt(){let e=J(e=>e.installability);return(0,B.jsx)(`span`,{className:a(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:it(e)})}function it(e){return i(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function at(e,t,n){return i(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function ot(){let e=J(e=>e.installability),t=J(e=>e.installMethod),n=J(e=>e.blockedReason);return(0,B.jsxs)(ee,{children:[(0,B.jsxs)(o,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(u,{children:i(`pwaInstallTitle`)}),(0,B.jsx)(s,{children:i(`pwaInstallDescription`)})]}),(0,B.jsx)(rt,{})]}),(0,B.jsxs)(d,{className:`space-y-4`,children:[(0,B.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:at(e,t,n)})}),e===`available`&&t===`prompt`?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsxs)(l,{type:`button`,className:`gap-2`,onClick:()=>{Z.promptInstall()},children:[(0,B.jsx)(x,{className:`h-4 w-4`}),i(`pwaInstallAction`)]}),(0,B.jsx)(`p`,{className:`text-sm text-gray-500`,children:i(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,B.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,B.jsx)(Te,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaInstallManualHint`)})]}):null]})]})}function st(){let e=J(e=>e.installability),t=J(e=>e.installMethod),n=J(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,B.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:i(`pwaInstallBannerTitle`)}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaInstallBannerDescription`)})]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":i(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Z.dismissInstallPrompt()},children:(0,B.jsx)(ge,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,B.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Z.promptInstall()},children:[(0,B.jsx)(x,{className:`h-4 w-4`}),i(`pwaInstallAction`)]}),(0,B.jsx)(l,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Z.dismissInstallPrompt()},children:i(`pwaInstallDismiss`)})]})]})}function ct(){let e=J(e=>e.updateAvailable),t=J(e=>e.installability);return!e||t!==`installed`?null:(0,B.jsxs)(`div`,{className:`fixed top-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,B.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:i(`pwaUpdateBannerTitle`)}),(0,B.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:i(`pwaUpdateBannerDescription`)})]})}),(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsxs)(l,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{X.applyUpdate()},children:[(0,B.jsx)(me,{className:`h-4 w-4`}),i(`pwaUpdateAction`)]})})]})}var lt=!1;function ut(){lt||typeof window>`u`||(lt=!0,Z.start(),X.start())}var dt={warm:`#F9F8F5`,cool:`#F8FAFB`},ft=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=dt[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=`light`},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`)===`cool`?`cool`:`warm`;this.syncTheme(e)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},Q=(0,V.createContext)(null);function pt({children:e}){let[t,n]=(0,V.useState)(()=>z());(0,V.useEffect)(()=>{ft.syncTheme(t)},[t]),(0,V.useEffect)(()=>Ve(e=>{n(e)}),[]);let r=(0,V.useCallback)(e=>{Be(e),n(ze())},[]),i=(0,V.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,B.jsx)(Q.Provider,{value:i,children:e})}function mt(){let e=(0,V.useContext)(Q);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function ht(){let{language:e,setLanguage:n}=ve();return{currentLanguage:e,currentLanguageLabel:t.find(t=>t.value===e)?.label??e,languageOptions:t,selectLanguage:(0,V.useCallback)(t=>{e!==t&&(n(t),window.location.reload())},[e,n])}}function gt(){let{currentLanguage:e,currentLanguageLabel:t,languageOptions:n,selectLanguage:r}=ht();return(0,B.jsxs)(`section`,{className:`mx-auto w-full max-w-3xl space-y-4`,children:[(0,B.jsx)(`div`,{className:`rounded-3xl border border-gray-200/80 bg-white p-5 shadow-card`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,B.jsx)(E,{className:`h-4 w-4`})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:i(`language`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t})]})]})}),(0,B.jsx)(`div`,{className:`overflow-hidden rounded-3xl border border-gray-200/80 bg-white shadow-card`,children:n.map(t=>{let n=t.value===e;return(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(t.value),className:a(`flex w-full items-center justify-between gap-3 border-b border-gray-100 px-5 py-4 text-left text-sm transition-colors last:border-b-0`,n?`bg-gray-50 text-gray-900`:`text-gray-700 hover:bg-gray-50/70`),"aria-current":n?`true`:void 0,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:t.label}),n?(0,B.jsx)(ae,{className:`h-4 w-4 text-gray-700`}):null]},t.value)})})]})}function _t({mode:e}){let t=de(),n=_e(),r=ue(),{currentLanguage:o,currentLanguageLabel:s,languageOptions:c,selectLanguage:l}=ht(),{theme:u,setTheme:d}=mt(),f=e===`settings`,p=i(I.find(e=>e.value===u)?.labelKey??`themeWarm`),m=r.data?.account.email?.trim(),h=!!r.data?.account.loggedIn,ee=e=>{u!==e&&d(e)},g=[{target:`/chat`,label:i(`chat`),icon:D},{target:`/chat/cron`,label:i(`cron`),icon:S},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:w},{target:`/agents`,label:i(`agentsPageTitle`),icon:C}],v=je(i),y=f?v:g,b=f?`compact`:`default`;return(0,B.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[f?(0,B.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,B.jsxs)(_,{to:`/chat`,className:`group inline-flex min-w-0 items-center gap-1.5 rounded-lg px-1 py-1 text-[12px] font-medium text-gray-500 transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,B.jsx)(te,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,B.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,B.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,B.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,B.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,B.jsx)(H,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,B.jsx)(`ul`,{className:a(f?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:y.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(W,{to:e.target,label:e.label,icon:e.icon,density:b})},e.target))})}),(0,B.jsxs)(`div`,{className:a(`shrink-0 border-t border-[#dde0ea] bg-secondary`,f?`mt-2 pt-3`:`mt-3 pt-3`),children:[f?(0,B.jsx)(Xe,{onClick:()=>t.accountManager.openAccountPanel(),icon:le,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:h?m||i(`remoteAccountEntryConnected`):i(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`}):null,e===`main`&&(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(W,{to:`/settings`,label:i(`settings`),icon:pe})}),(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(Ze,{value:u,onValueChange:e=>ee(e),icon:k,label:i(`theme`),valueLabel:p,density:b,children:I.map(e=>(0,B.jsx)(se,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,B.jsx)(`div`,{className:`mb-2`,children:(0,B.jsx)(Ze,{value:o,onValueChange:e=>l(e),icon:E,label:i(`language`),valueLabel:s,density:b,children:c.map(e=>(0,B.jsx)(se,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,B.jsx)(Xe,{onClick:()=>n.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:re,label:i(`docBrowserHelp`),density:b})]})]})]})}var vt=[{action:`minimize`,label:`Minimize`,icon:O},{action:`close`,label:`Close`,icon:ge,variant:`danger`}];function yt(){let e=xt()?{action:`toggle-maximize`,label:`Restore`,icon:T}:{action:`toggle-maximize`,label:`Maximize`,icon:A};return(0,B.jsxs)(`header`,{className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 border-b border-[#ebe7dc]/80 bg-secondary`,"data-testid":`desktop-window-chrome`,children:[(0,B.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,B.jsx)(`div`,{className:`desktop-window-no-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary pl-4 pr-3 text-secondary-foreground`,"data-testid":`desktop-window-chrome-sidebar`,children:(0,B.jsx)(H,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`desktop-window-drag h-full min-w-0 flex-1`,"data-testid":`desktop-window-chrome-main-drag-region`}),(0,B.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:[vt[0],e,vt[1]].map(e=>(0,B.jsx)(bt,{control:e},e.action))})]})}function bt({control:e}){let t=e.icon;return(0,B.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,B.jsx)(t,{className:`h-3.5 w-3.5`})})}function xt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{let e=!0,n=window.nextclawDesktop;n?.getWindowState?.().then(n=>{e&&t(n.isMaximized)});let r=n?.onWindowStateChanged?.(e=>{t(e.isMaximized)});return()=>{e=!1,r?.()}},[]),e}function $(){return typeof window>`u`?null:wt()??window.nextclawDesktop?.platform??null}function St(){return $()===`darwin`}function Ct(){return $()===`win32`}function wt(){return null}var Tt=(0,V.lazy)(async()=>({default:(await v(async()=>{let{DocBrowser:e}=await import(`./doc-browser-DhIkcy0-.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function Et(e){return{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":e?`280px`:`240px`}}function Dt({pathname:e,isDocBrowserOpen:t,docBrowserMode:n,children:r}){let i=Oe(e),o=Ct();return(0,B.jsxs)(`div`,{className:a(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,o?`rounded-[10px]`:null),style:o?Et(i):void 0,children:[o?(0,B.jsx)(yt,{}):null,(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!i&&(0,B.jsx)(_t,{mode:`settings`}),(0,B.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,B.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:i?(0,B.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:r}):(0,B.jsx)(`main`,{className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,B.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:r})})}),t&&n===`docked`?(0,B.jsx)(V.Suspense,{fallback:null,children:(0,B.jsx)(Tt,{})}):null]})]}),t&&n===`floating`?(0,B.jsx)(V.Suspense,{fallback:null,children:(0,B.jsx)(Tt,{})}):null]})}export{w as A,j as C,D,O as E,S as M,E as O,M as S,k as T,ke as _,gt as a,Ne as b,ut as c,ct as d,W as f,F as g,Ae as h,Ct as i,C as j,T as k,st as l,I as m,$ as n,pt as o,H as p,St as r,mt as s,Dt as t,ot as u,Oe as v,A as w,De as x,Me as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,r as t,t as n,u as r}from"./i18n-D1144VAA.js";import{At as i,Dt as a,Et as o,Nt as s,Ot as c,Tt as l,ft as u,jt as d,kt as f,mt as p,pt as m,wt as h}from"./api-rASx2-N4.js";import{a as g,i as _,n as v,r as y,t as b}from"./select-HI5kiwX_.js";import{t as x}from"./download-CMM8po31.js";import{t as S}from"./external-link-CpEvG65F.js";import{t as C}from"./refresh-cw-CrbD8EkT.js";import{t as w}from"./rotate-cw-BN9yjccP.js";var T=e(),E={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`};function D({status:e}){return(0,T.jsx)(`span`,{className:r(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,L(e)),children:I(e)})}function O({label:e,value:t}){return(0,T.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:e}),(0,T.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:t})]})}function k({snapshot:e}){if(e.status!==`downloading`)return null;let n=e.progress?.percent,r=n==null?t(`desktopUpdatesDownloadProgressUnknown`):t(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(n)),i=N(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,T.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,T.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${n??0}%`}})})]})}function A({label:e,help:t,checked:n,disabled:r,onCheckedChange:i}){return(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-gray-200 p-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:e}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t})]}),(0,T.jsx)(u,{checked:n,disabled:r,onCheckedChange:i})]})}function j(e){return e?.trim()||`-`}function M(e){return e?n(e):`-`}function N(e,t){let n=P(e);return t&&t>0?`${n} / ${P(t)}`:n}function P(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function F(e){return t(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function I(e){return t(E[e]??`desktopUpdatesStatusIdle`)}function L(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`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function R(){return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`)}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`runtimeUpdatesUnavailableTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesUnavailableDescription`)})]}),(0,T.jsx)(l,{children:(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`runtimeUpdatesUnavailableHint`)})})]})]})}function z(){let{supported:e,initialized:n,busyAction:u,snapshot:E}=p();if(!n)return(0,T.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)});if(!e||!E)return(0,T.jsx)(R,{});let N=u===`checking`,P=u===`downloading`,I=u===`applying`,L=u===`saving-preferences`,z=u===`switching-channel`,B=E.status===`update-available`&&!P&&!I,V=E.status===`downloaded`&&!I,H=[[t(`runtimeUpdatesHostVersion`),j(E.hostVersion)],[t(`desktopUpdatesCurrentBundleVersion`),j(E.currentVersion)],[t(`desktopUpdatesAvailableVersion`),j(E.availableVersion)],[t(`desktopUpdatesLastCheckedAt`),M(E.lastCheckedAt)],[t(`desktopUpdatesCurrentChannel`),F(E.channel)]];return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`),actions:(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(C,{className:r(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]})}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesOverviewTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesOverviewDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t(`desktopUpdatesStatusLabel`)}),(0,T.jsx)(D,{status:E.status})]}),(0,T.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:H.map(([e,t])=>(0,T.jsx)(O,{label:e,value:t},e))}),E.channel===`beta`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:t(`desktopUpdatesBetaBadgeTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:t(`desktopUpdatesBetaBadgeDescription`)})]}):null,E.downloadedVersion?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:t(`desktopUpdatesDownloadedBannerTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:t(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,E.downloadedVersion)})]}):null,(0,T.jsx)(k,{snapshot:E}),E.status===`blocked`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:t(`desktopUpdatesBlockedTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:E.errorMessage??t(`desktopUpdatesBlockedDescription`)}),E.recoveryCommand?(0,T.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:E.recoveryCommand}):null]}):null,E.errorMessage&&E.status!==`blocked`?(0,T.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:E.errorMessage}):null]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesPreferencesTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesPreferencesDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:t(`desktopUpdatesReleaseChannel`)}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelHelp`)})]}),(0,T.jsxs)(b,{value:E.channel,disabled:z||N||P||I,onValueChange:e=>void m.updateChannel(e),children:[(0,T.jsx)(_,{className:`w-full max-w-sm`,children:(0,T.jsx)(g,{placeholder:t(`desktopUpdatesReleaseChannel`)})}),(0,T.jsxs)(v,{children:[(0,T.jsx)(y,{value:`stable`,children:t(`desktopUpdatesChannelStable`)}),(0,T.jsx)(y,{value:`beta`,children:t(`desktopUpdatesChannelBeta`)})]})]}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelDowngradeHint`)})]})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutomaticChecks`),help:t(`desktopUpdatesAutomaticChecksHelp`),checked:E.preferences.automaticChecks,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({automaticChecks:e})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutoDownload`),help:t(`desktopUpdatesAutoDownloadHelp`),checked:E.preferences.autoDownload,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({autoDownload:e})})]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesActionsTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesActionsDescription`)})]}),(0,T.jsxs)(l,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(C,{className:r(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]}),(0,T.jsxs)(s,{onClick:()=>void m.downloadUpdate(),disabled:!B,children:[(0,T.jsx)(x,{className:r(`mr-2 h-4 w-4`,P&&`animate-bounce`)}),t(`desktopUpdatesDownloadNow`)]}),(0,T.jsxs)(s,{variant:`secondary`,onClick:()=>void m.applyDownloadedUpdate(),disabled:!V,children:[(0,T.jsx)(w,{className:r(`mr-2 h-4 w-4`,I&&`animate-spin`)}),t(`runtimeUpdatesApplyNow`)]}),E.releaseNotesUrl?(0,T.jsxs)(s,{variant:`ghost`,onClick:()=>window.open(E.releaseNotesUrl??``,`_blank`,`noopener,noreferrer`),children:[(0,T.jsx)(S,{className:`mr-2 h-4 w-4`}),t(`desktopUpdatesReleaseNotes`)]}):null]})]})]})}export{z as DesktopUpdateConfig};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{_ as e,m as t,p as n,u as r}from"./i18n-D1144VAA.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-CVAuMqlM.js";import{t as m}from"./dist-NBjcwlsw.js";import{t as ie}from"./x-BeyYA_h6.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 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./doc-browser-D2pq4IHR.js";export{e as DocBrowser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,l as r,m as i,p as a,r as o,s}from"./i18n-D1144VAA.js";import"./doc-browser-D2pq4IHR.js";import{i as c,r as l}from"./doc-browser-context-BPeeiNJ_.js";var u=e(i(),1);function d(){let e=c();(0,u.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;l(r)&&(n.hasAttribute(`data-doc-external`)||t.ctrlKey||t.metaKey||t.shiftKey||(t.preventDefault(),t.stopPropagation(),e.open(r)))};return document.addEventListener(`click`,t,!0),()=>document.removeEventListener(`click`,t,!0)},[e])}var f=a(),p=(0,u.createContext)(null);function m({children:e}){let[i,a]=(0,u.useState)(()=>s());(0,u.useEffect)(()=>r(e=>{a(e)}),[]);let o=(0,u.useCallback)(e=>{n(e),a(t())},[]),c=(0,u.useCallback)(()=>{o(i===`en`?`zh`:`en`)},[i,o]),l=(0,u.useMemo)(()=>({language:i,setLanguage:o,toggleLanguage:c}),[i,o,c]);return(0,f.jsx)(p.Provider,{value:l,children:e})}function h(){let e=(0,u.useContext)(p);if(!e)throw Error(`useI18n must be used within I18nProvider`);return{...e,t:o}}export{h as n,d as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DzY6wN61.js";var t=e(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]);export{t};
|