orc-ai 0.1.63 → 0.1.64
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/README.md +3 -2
- package/dist/index.js +897 -803
- package/dist/skills/orc-platform/SKILL.md +1 -1
- package/dist/skills/orc-platform/references/html-kit.md +154 -0
- package/dist/skills/orc-platform/references/scratchpads.md +6 -2
- package/dist/web/assets/{Agents-DmrIiUAL.js → Agents-G5dt5_s6.js} +2 -2
- package/dist/web/assets/Audit-De9E5Tfd.js +1 -0
- package/dist/web/assets/ChatUiRenderer-B1D3eTfy.js +4 -0
- package/dist/web/assets/ConfirmDialog-Cp1PcD4R.js +1 -0
- package/dist/web/assets/{Dashboard-Dh9P-zTd.js → Dashboard-DWorNfLX.js} +1 -1
- package/dist/web/assets/DocumentWorkspace-DZI0NvGD.js +1 -0
- package/dist/web/assets/FileEditor-CarhD1G9.js +1 -0
- package/dist/web/assets/{IntegrationCallback-CUZ5N-88.js → IntegrationCallback-CuUd_OOy.js} +1 -1
- package/dist/web/assets/JobWebhooks-8emXf4c1.js +1 -0
- package/dist/web/assets/Jobs-ComQ_dFU.js +3 -0
- package/dist/web/assets/Knowledge-Cm2ZVDRs.js +1 -0
- package/dist/web/assets/{MarkdownRenderer-fsBqw-wB.js → MarkdownRenderer-CHALCapQ.js} +5 -5
- package/dist/web/assets/{NativeFolderField-BuHwey26.js → NativeFolderField-CdaIEZa-.js} +1 -1
- package/dist/web/assets/PackageCatalog-CcPUM8f8.js +8 -0
- package/dist/web/assets/{PackageRunDialog-C8m43ZhJ.js → PackageRunDialog-DV1E6WX3.js} +19 -19
- package/dist/web/assets/{Pager-Dbs7fj3d.js → Pager-DZtibAkl.js} +1 -1
- package/dist/web/assets/Projects-BxrWujMD.js +3 -0
- package/dist/web/assets/{ResponsiveFilters-HzhzzjyL.js → ResponsiveFilters-C3siPRT-.js} +1 -1
- package/dist/web/assets/{ResumeActions-e6YpUhEq.js → ResumeActions-0eJvpGmW.js} +1 -1
- package/dist/web/assets/Rules-CHdgAIUd.js +18 -0
- package/dist/web/assets/{ScratchpadDiagramEditor-DkW_SmM8.js → ScratchpadDiagramEditor-6R8JsXS3.js} +1 -1
- package/dist/web/assets/Scratchpads-uD9R68sw.js +10 -0
- package/dist/web/assets/{SessionHomeLink-BAWO86fJ.js → SessionHomeLink-CMCZb7Vy.js} +1 -1
- package/dist/web/assets/Sessions-BD9AlzAN.js +4 -0
- package/dist/web/assets/Settings-Bt1even4.js +14 -0
- package/dist/web/assets/Skills-BSsN8kq-.js +3 -0
- package/dist/web/assets/{SourceEditor-B6pT-Rc0.js → SourceEditor-V5vL7Aof.js} +4 -4
- package/dist/web/assets/{TagInput-ChFu05vJ.js → TagInput-DU4zMpED.js} +1 -1
- package/dist/web/assets/TaskDetailSheet-C8dGHMsb.js +1 -0
- package/dist/web/assets/{Tasks-CC92r1kL.js → Tasks-wxRlyx-L.js} +6 -6
- package/dist/web/assets/Terminals-BFRG72xa.js +2 -0
- package/dist/web/assets/{ViewHeader-D-lhe59Y.js → ViewHeader-CKIR1ZTZ.js} +1 -1
- package/dist/web/assets/{Webhooks-BxpA1QBK.js → Webhooks-Bg3pm4rJ.js} +1 -1
- package/dist/web/assets/{badge-BqTVr27Z.js → badge-DfvoXiLp.js} +1 -1
- package/dist/web/assets/check-DrnDUgkq.js +1 -0
- package/dist/web/assets/chevron-down-C1WyGsAA.js +1 -0
- package/dist/web/assets/chevron-up-ZnWliPW7.js +1 -0
- package/dist/web/assets/{chunk-OB3PAWPO-1IihCzFx.js → chunk-OB3PAWPO-BD6ylT0A.js} +1 -1
- package/dist/web/assets/{circle-check-DWP3C_MJ.js → circle-check-CnioupGj.js} +1 -1
- package/dist/web/assets/{client-954dj6K2.js → client-DigivyCS.js} +1 -1
- package/dist/web/assets/{download-BD7lYc4O.js → download-CNwtbYo1.js} +1 -1
- package/dist/web/assets/{highlighted-body-JLMTFACH-CAMR1LA5.js → highlighted-body-JLMTFACH-dpkthrjz.js} +1 -1
- package/dist/web/assets/{index-XIDqokJX.js → index-Bc-Nka6Y.js} +50 -49
- package/dist/web/assets/index-BrDTqMtQ.css +1 -0
- package/dist/web/assets/{live-sessions-C6D_vHcN.js → live-sessions-BG3mNXnQ.js} +1 -1
- package/dist/web/assets/{maximize-2-BUxUwGbf.js → maximize-2-CcupqYE8.js} +1 -1
- package/dist/web/assets/mermaid-WFAXDIZX-BX9NWlJb.js +1 -0
- package/dist/web/assets/orc-kit-BZEVA3Qv.js +317 -0
- package/dist/web/assets/{scratchpad-kinds-B0Y6McXL.js → scratchpad-kinds-RGciqVT1.js} +1 -1
- package/dist/web/assets/{scratchpad-routes-BtsIfhUW.js → scratchpad-routes-Q2TRGUnx.js} +1 -1
- package/dist/web/assets/send-0IpktRLv.js +1 -0
- package/dist/web/assets/{upload-CPf6QZHl.js → upload-CaDKCpy5.js} +1 -1
- package/dist/web/assets/{useDetailRoute-DOhAbdV7.js → useDetailRoute-B-xjWsyW.js} +1 -1
- package/dist/web/assets/{useIntegrations-C0MAVKB4.js → useIntegrations-C6zijOMH.js} +1 -1
- package/dist/web/assets/{useJobs-BlWldKP0.js → useJobs-Dly6n-pv.js} +1 -1
- package/dist/web/assets/{useMemories-CAf8HcOI.js → useMemories-jakANU6m.js} +1 -1
- package/dist/web/assets/useProjectScope-DpgzthH7.js +1 -0
- package/dist/web/assets/{useSessions-DiUU2FN8.js → useSessions-tFa1FZ9M.js} +1 -1
- package/dist/web/assets/{view-params-DD7i9s5g.js → view-params-YEmeZppw.js} +1 -1
- package/dist/web/assets/{x-tY-z3woy.js → x-BayoBYp_.js} +1 -1
- package/dist/web/index.html +11 -18
- package/dist/web/sw.js +26 -17
- package/package.json +1 -1
- package/dist/web/assets/Audit-DGSNmToV.js +0 -1
- package/dist/web/assets/ChatUiRenderer-Dddr55cW.js +0 -4
- package/dist/web/assets/ConfirmDialog-B5es4nUp.js +0 -1
- package/dist/web/assets/DocumentWorkspace-I81K42yx.js +0 -1
- package/dist/web/assets/FileEditor-wRs221QU.js +0 -1
- package/dist/web/assets/JobWebhooks-oaF694Af.js +0 -1
- package/dist/web/assets/Jobs-Lmyw5700.js +0 -3
- package/dist/web/assets/Knowledge-V4JuZnUZ.js +0 -1
- package/dist/web/assets/Markdown-D-AaJ4bU.js +0 -2
- package/dist/web/assets/MarkdownEditor-5U4_BhYm.js +0 -2
- package/dist/web/assets/PackageCatalog-BC-yAjPQ.js +0 -8
- package/dist/web/assets/Projects-C280nbHV.js +0 -3
- package/dist/web/assets/Rules-BwsnRQBe.js +0 -18
- package/dist/web/assets/Scratchpads-BtUKOhup.js +0 -10
- package/dist/web/assets/Sessions-Cn2dIJBt.js +0 -4
- package/dist/web/assets/Settings-Bb01CfFw.js +0 -14
- package/dist/web/assets/Skills-Vw41zPVg.js +0 -3
- package/dist/web/assets/TaskDetailSheet-DuTfo6rZ.js +0 -1
- package/dist/web/assets/Terminals-dCbgpRsm.js +0 -2
- package/dist/web/assets/check-Cg2_C_4I.js +0 -1
- package/dist/web/assets/chevron-down-KBvm_HoX.js +0 -1
- package/dist/web/assets/dialog-DNIYhwi4.js +0 -1
- package/dist/web/assets/file-kind-BYU1kv95.js +0 -1
- package/dist/web/assets/index-hvCYuRJb.css +0 -1
- package/dist/web/assets/label-Bm_d0NKL.js +0 -1
- package/dist/web/assets/mermaid-WFAXDIZX-Bzg8wVqT.js +0 -1
- package/dist/web/assets/select-cyLFVkkB.js +0 -1
- package/dist/web/assets/tabs-bEwJLtA0.js +0 -1
- package/dist/web/assets/textarea-CovStda2.js +0 -1
- package/dist/web/assets/useProjectScope-DtEj9j-P.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";var t={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";var n=e(t(),1),r=e=>{throw TypeError(e)},i=(e,t,n)=>t.has(e)||r(`Cannot `+n),a=(e,t,n)=>(i(e,t,`read from private field`),n?n.call(e):t.get(e)),o=(e,t,n)=>t.has(e)?r(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),s=(e,t,n,r)=>(i(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),c=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l=/^[\\/]{2}/;function u(e,t){return t+e.replace(/\\/g,`/`)}var d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return v(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:y(t)}return x(t,n,null,e)}function m(e,t){if(e===!1||e==null)throw Error(t)}function h(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function g(){return Math.random().toString(36).substring(2,10)}function _(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function v(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?b(t):t,state:n,key:t&&t.key||r||g(),mask:i}}function y({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 b(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 x(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:v(y.location,e,t);n&&n(r,e),l=u()+1;let d=_(r,l),p=y.createHref(r.mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:v(y.location,e,t);n&&n(r,e),l=u();let i=_(r,l),d=y.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:y.location,delta:0})}function g(e){return S(i,e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return y}function S(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),m(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:y(t);return i=i.replace(/ $/,`%20`),!n&&l.test(i)&&(i=r+i),new URL(i,r)}function C(e){return{defaultValue:e}}var w,T=class{constructor(e){if(o(this,w,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(a(this,w).has(e))return a(this,w).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){a(this,w).set(e,t)}};w=new WeakMap;var E=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function D(e){return E.has(e)}var ee=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function O(e){return ee.has(e)}function k(e){return e.index===!0}function A(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(m(e.index!==!0||!e.children,`Cannot specify children on an index route`),m(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),k(e)){let n={...e,id:s};return r[s]=j(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=j(n,t(n)),e.children&&(n.children=A(e.children,t,o,r,i)),n}})}function j(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function M(e,t,n=`/`){return N(e,t,n,!1)}function N(e,t,n,r,i){let a=V((typeof t==`string`?b(t):t).pathname||`/`,n);if(a==null)return null;let o=i??P(e),s=null,c=B(a);for(let e=0;s==null&&e<o.length;++e)s=ue(o[e],c,r);return s}function te(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 P(e){let t=F(e);return I(t),t}function F(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;m(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=U([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(m(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),F(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ce(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ne(e.path))a(e,t,!0,n)}),t}function ne(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=ne(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 I(e){e.sort((e,t)=>e.score===t.score?le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var re=/^:[\w-]+$/,ie=3,ae=2,L=1,oe=10,se=-2,R=e=>e===`*`;function ce(e,t){let n=e.split(`/`),r=n.length;return n.some(R)&&(r+=se),t&&(r+=ae),n.filter(e=>!R(e)).reduce((e,t)=>e+(re.test(t)?ie:t===``?L:oe),r)}function le(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 ue(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):z(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=z({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:U([a,d.pathname]),pathnameBase:Se(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function z(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fe(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=xe(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=xe(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fe(e,t=!1,n=!0){h(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function B(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return h(!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 V(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function pe({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var me=e=>c.test(e);function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?b(e):e,a;return n?(n=be(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Ce(r),hash:we(i)}}function ge(e,t){let n=xe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(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 ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function H(e,t,n,r=!1){let i;typeof e==`string`?i=b(e):(i={...e},m(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),m(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),m(!i.search||!i.search.includes(`#`),_e(`#`,`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=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var be=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>be(e.join(`/`));function xe(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Se=e=>xe(e).replace(/^\/*/,`/`),Ce=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,we=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Te=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ee=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 De(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Oe(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}var ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ae(e,t){let n=e;if(typeof n!=`string`||!c.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ke)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=V(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{h(!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}}var W=Symbol(`Uninstrumented`);function je(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=G(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=G(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[W]??i,a=G(n[e],t,(...e)=>Pe(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[W]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[W]??e,r=G(n.middleware,t,(...e)=>Pe(e[0]));return r?(r[W]=t,r):e})),r}function Me(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[W]??e.navigate,r=G(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?y(n):`.`,...K(e,r??{})}});r&&(r[W]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[W]??e.fetch,r=G(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...K(e,i??{})}});r&&(r[W]=t,e.fetch=r)}return e}function G(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ne(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ne(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ne(e,t,n,r-1),a=await o,m(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function Pe(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Fe(t),params:{...r},pattern:i,context:Ie(n)}}function K(e,t){return{currentUrl:y(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Fe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ie(e){if(Re(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Le=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Re(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Le}var ze=new URL(`http://localhost`);function q(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ze)}catch{return ze}}function Be(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ve(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function He(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Be(i,n),s=!Be(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ve(e,i)||!Be(i,a)))throw Error(`External navigation is not allowed`)}var Ue=[`POST`,`PUT`,`PATCH`,`DELETE`],We=new Set(Ue),Ge=[`GET`,...Ue],Ke=new Set(Ge),qe=new Set([301,302,303,307,308]),Je=new Set([307,308]),Ye={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xe={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ze={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Qe=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),$e=`remix-router-transitions`,et=Symbol(`ResetLoaderData`),tt,nt,rt,it,at=class{constructor(e){o(this,tt),o(this,nt),o(this,rt),o(this,it),s(this,tt,e),s(this,nt,P(e))}get stableRoutes(){return a(this,tt)}get activeRoutes(){return a(this,rt)??a(this,tt)}get branches(){return a(this,it)??a(this,nt)}get hasHMRRoutes(){return a(this,rt)!=null}setRoutes(e){s(this,tt,e),s(this,nt,P(e))}setHmrRoutes(e){s(this,rt,e),s(this,it,P(e))}commitHmrRoutes(){a(this,rt)&&(s(this,tt,a(this,rt)),s(this,nt,a(this,it)),s(this,rt,void 0),s(this,it,void 0))}};tt=new WeakMap,nt=new WeakMap,rt=new WeakMap,it=new WeakMap;function ot(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;m(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Qe,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...je(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new at(A(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let u=e.dataStrategy||Ct,d={...e.future},f=null,p=new Set,g=null,_=null,x=null,C=null,w=e.hydrationData!=null,E=N(s.activeRoutes,e.history.location,c,!1,s.branches),D=!1,ee=null,O,k;if(E==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=qt(s.activeRoutes);O=!0,k=!O,E=n,ee={[r.id]:t}}else if(E&&!e.hydrationData&&it(E,s.activeRoutes,e.history.location.pathname).active&&(E=null),!E){O=!1,k=!O,E=[];let t=it(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(D=!0,E=t.matches)}else if(E.some(e=>e.route.lazy))O=!1,k=!O;else if(!E.some(e=>dt(e.route)))O=!0,k=!O;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=E;if(n){let e=E.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}k=!1,O=!0,r.forEach(e=>{let r=ft(e.route,t,n);k||=r.renderFallback,O&&=!r.shouldLoad})}let j,M={historyAction:e.history.action,location:e.history.location,matches:E,initialized:O,renderFallback:k,navigation:Ye,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||ee,fetchers:new Map,blockers:new Map},P=`POP`,F=null,ne=!1,I,re=!1,ie=new Map,ae=null,L=!1,oe=!1,se=new Set,R=new Map,ce=0,le=-1,ue=new Map,z=new Set,de=new Map,fe=new Map,B=new Set,pe=new Map,he,ge=null;function _e(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(he){he(),he=void 0;return}h(pe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=qe({currentLocation:M.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{he=e});e.history.go(r*-1),Ke(i,{state:`blocked`,location:n,proceed(){Ke(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(M.blockers);e.set(i,Ze),H({blockers:e})}}),F?.resolve(),F=null}else return Se(t,n)}),n){gn(t,ie);let e=()=>_n(t,ie);t.addEventListener(`pagehide`,e),ae=()=>t.removeEventListener(`pagehide`,e)}return M.initialized||Se(`POP`,M.location,{initialHydration:!0}),j}function ve(){f&&f(),ae&&ae(),p.clear(),I&&I.abort(),M.fetchers.forEach((e,t)=>Re(M.fetchers,t)),M.blockers.forEach((e,t)=>Ge(t))}function ye(e){if(p.add(e),g){let{newErrors:t}=g;g=null,e(M,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function H(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),M={...M,...e};let n=[],r=[];M.fetchers.forEach((e,t)=>{e.state===`idle`&&(B.has(t)?n.push(t):r.push(t))}),B.forEach(e=>{!M.fetchers.has(e)&&!R.has(e)&&n.push(e)}),p.size===0&&(g={newErrors:e.errors??null}),[...p].forEach(r=>r(M,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Re(M.fetchers,e)),r.forEach(e=>M.fetchers.delete(e))}function be(t,n,{flushSync:r}={}){let i=M.actionData!=null&&M.navigation.formMethod!=null&&X(M.navigation.formMethod)&&M.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?M.actionData:null;let o=n.loaderData?Wt(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,c=M.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Ze)));let l=!L&&rt(t,n.matches||M.matches),u=ne===!0||M.navigation.formMethod!=null&&X(M.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),L||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let d;if(P===`POP`&&!L&&t!==M.location){let e=ie.get(M.location.pathname);e&&e.has(t.pathname)?d={currentLocation:M.location,nextLocation:t}:ie.has(t.pathname)&&(d={currentLocation:t,nextLocation:M.location})}else if(re){let e=ie.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ie.set(M.location.pathname,e)),d={currentLocation:M.location,nextLocation:t}}H({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Ye,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),P=`POP`,ne=!1,re=!1,L=!1,oe=!1,F?.resolve(),F=null,ge?.resolve(),ge=null}async function U(t,n){if(F?.resolve(),F=null,typeof t==`number`){F||=vn();let n=F.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=lt(!1,ct(M.location,M.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?b(n.mask):{...M.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},l.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),He(typeof n.mask==`string`?n.mask:y(n.mask),y(o),e.history.createURL(`/`),`reject`)}let s=M.location,u=v(s,r,n&&n.state,void 0,o);u={...u,...e.history.encodeLocation(u)},He(t==null?e.history.createHref(M.location):typeof t==`string`?t:y(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||i!=null&&X(i.formMethod)&&i.formAction===M.location.pathname+M.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=qe({currentLocation:s,nextLocation:u,historyAction:f});h?Ke(h,{state:`blocked`,location:u,proceed(){Ke(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),U(t,n)},reset(){let e=new Map(M.blockers);e.set(h,Ze),H({blockers:e})}}):await Se(f,u,{submission:i,pendingError:a,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function xe(){ge||=vn(),Pe(),H({revalidation:`loading`});let e=ge.promise;return M.navigation.state===`submitting`?e:M.navigation.state===`idle`?(Se(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),e):(Se(P||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:re===!0}),e)}async function Se(t,n,r){I&&I.abort(),I=null,P=t,L=(r&&r.startUninterruptedRevalidation)===!0,nt(M.location,M.matches),ne=(r&&r.preventScrollReset)===!0,re=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&M.matches&&M.matches.length>0&&!D?M.matches:N(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&M.initialized&&!oe&&Xt(M.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){be(n,{matches:a},{flushSync:o});return}let l=it(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=$e(n.pathname);be(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;I=new AbortController;let d=Rt(e.history,n,I.signal,r&&r.submission),f=e.getContext?await e.getContext():new T,p;if(r&&r.pendingError)p=[Kt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let i=await Ce(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Y(t)&&De(t.error)&&t.error.status===404){I=null,be(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=dn(n,a,t,r.submission),o=!1,l.active=!1,d=Rt(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await we(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(I=null,be(n,{matches:h||a,...Gt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ce(t,n,i,l,u,d,f,p,m={}){if(Pe(),H({navigation:fn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ot(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=qt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Kt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=$e(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=ln(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:J(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await G(t,n,kt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(tn(h)){let n;return n=m&&m.replace!=null?m.replace:Lt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===M.location.pathname+M.location.search,await W(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(h)){let e=Kt(l,g.route.id);return(m&&m.replace)!==!0&&(P=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function we(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||dn(n,i,l,p),x=p||m||un(b),S=!L&&!g;if(d){if(S){let e=Te(v);H({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ot(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=qt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Kt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=$e(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=ut(t,u,a,o,e.history,M,i,x,n,g?[]:r,g===!0,oe,se,B,de,z,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++ce,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(M.fetchers),t=Ve(e);return be(n,{matches:i,loaderData:{},errors:v&&Y(v[1])?{[v[0]]:v[1].error}:null,...Gt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Te(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Ee(T)),H(e,{flushSync:_})}T.forEach(e=>{q(e.key),e.controller&&R.set(e.key,e.controller)});let E=()=>T.forEach(e=>q(e.key));I&&I.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:ee}=await Ne(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener(`abort`,E),T.forEach(e=>R.delete(e.key));let O=Jt(D);if(O)return await W(t,O.result,!0,{replace:h}),{shortCircuited:!0};if(O=Jt(ee),O)return z.add(O.key),await W(t,O.result,!0,{replace:h}),{shortCircuited:!0};let k=new Map(M.fetchers),{loaderData:A,errors:j}=Ut(M,i,D,v,T,ee,k);g&&M.errors&&(j={...M.errors,...j});let N=Ve(k),te=Ue(le,k),P=N||te||T.length>0;return{matches:i,loaderData:A,errors:j,...P?{workingFetchers:k}:{}}}function Te(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Ee(e){let t=new Map(M.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=pn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Oe(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=ct(M.location,M.matches,c,r,n,i?.relative),u=N(o,l,c,!1,s.branches),d=it(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Fe(t,n,J(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=lt(!0,l,i);if(m){Fe(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new T,g=(i&&i.preventScrollReset)===!0;p&&X(p.formMethod)?await ke(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(de.set(t,{routeId:n,path:f}),await Ae(t,n,f,u,h,d.active,a,g,p))}async function ke(t,n,i,l,u,d,f,p,h,g){Pe(),de.delete(t),K(t,mn(h,M.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Rt(e.history,i,_.signal,h);if(d){let e=await ot(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Fe(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Fe(t,n,J(404,{pathname:i}),{flushSync:f});return}}let y=ln(l,i);if(!y.route.action&&!y.route.lazy){Fe(t,n,J(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:f});return}R.set(t,_);let b=ce,x=kt(a,o,v,i,l,y,r,u),S=await G(v,i,x,u,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){R.get(t)===_&&R.delete(t);return}if(B.has(t)){if(tn(C)||Y(C)){K(t,hn(void 0));return}}else{if(tn(C)){if(R.delete(t),le>b){K(t,hn(void 0));return}return z.add(t),K(t,pn(h)),W(v,C,!1,{fetcherSubmission:h,preventScrollReset:p})}if(Y(C)){Fe(t,n,C.error);return}}let w=M.navigation.location||M.location,T=Rt(e.history,w,_.signal),E=s.activeRoutes,D=M.navigation.state===`idle`?M.matches:N(E,M.navigation.location,c,!1,s.branches);m(D,`Didn't find any matches after fetcher action`);let ee=++ce;ue.set(t,ee);let{dsMatches:O,revalidatingFetchers:k}=ut(T,u,a,o,e.history,M,D,h,w,r,!1,oe,se,B,de,z,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),A=pn(h,C.data),j=new Map(M.fetchers);j.set(t,A),k.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=j.get(t),r=pn(void 0,n?n.data:void 0);j.set(t,r),q(t),e.controller&&R.set(t,e.controller)}),H({fetchers:j});let te=()=>k.forEach(e=>q(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Ne(O,k,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),ue.delete(t),R.delete(t),k.forEach(e=>R.delete(e.key));let re=M.fetchers.has(t),ie=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,hn(C.data)),{...e,fetchers:n}},ae=Jt(F);if(ae)return M=ie(M),W(T,ae.result,!1,{preventScrollReset:p});if(ae=Jt(ne),ae)return z.add(ae.key),M=ie(M),W(T,ae.result,!1,{preventScrollReset:p});let L=new Map(M.fetchers);re&&L.set(t,hn(C.data));let{loaderData:fe,errors:V}=Ut(M,D,F,void 0,k,ne,L);Ue(ee,L),M.navigation.state===`loading`&&ee>le?(m(P,`Expected pending action`),I&&I.abort(),be(M.navigation.location,{matches:D,loaderData:fe,errors:V,fetchers:L})):(H({errors:V,loaderData:Wt(M.loaderData,fe,D,V),fetchers:L}),oe=!1)}async function Ae(t,n,i,s,c,l,u,d,f){let p=M.fetchers.get(t);K(t,pn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Rt(e.history,i,m.signal);if(l){let e=await ot(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Fe(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Fe(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=ln(s,i);R.set(t,m);let _=ce,v=await G(h,i,kt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(R.get(t)===m&&R.delete(t),!h.signal.aborted){if(B.has(t))K(t,hn(void 0));else if(tn(y)){if(le>_){K(t,hn(void 0));return}z.add(t),await W(h,y,!1,{preventScrollReset:d})}else Y(y)?Fe(t,n,y.error):K(t,hn(y.data))}}async function W(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(F?.resolve(),F=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let d=i.response.headers.get(`Location`);m(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Lt(d,p,c,e.history),He(f,d,p,`allow-explicit`);let h=v(M.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(me(d)){let n=S(t,d,!0);e=n.origin!==t.location.origin||V(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}I=null;let g=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:_,formAction:y,formEncType:b}=M.navigation;!o&&!s&&_&&y&&b&&(o=un(M.navigation));let x=o||s;Je.has(i.response.status)&&x&&X(x.formMethod)?await Se(g,h,{submission:{...x,formAction:d},preventScrollReset:l||ne,enableViewTransition:a?re:void 0}):await Se(g,h,{overrideNavigation:dn(h,[],g,o),fetcherSubmission:s,preventScrollReset:l||ne,enableViewTransition:a?re:void 0})}async function G(e,t,n,r,i){let a,o={};try{a=await At(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!X(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;a.hasOwnProperty(e.route.id)||M.loaderData.hasOwnProperty(e.route.id)||M.errors&&M.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(en(r)){let i=r.result;o[t]={type:`redirect`,response:Pt(i,e,t,n,c)}}else o[t]=await Nt(r);return o}async function Ne(e,t,n,r,i){let a=G(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await G(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Pe(){oe=!0,de.forEach((e,t)=>{R.has(t)&&se.add(t),q(t)})}function K(e,t,n={}){let r=new Map(M.fetchers);r.set(e,t),H({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Fe(e,t,n,r={}){let i=Kt(M.matches,t),a=new Map(M.fetchers);Re(a,e),H({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ie(e){return fe.set(e,(fe.get(e)||0)+1),B.has(e)&&B.delete(e),M.fetchers.get(e)||Xe}function Le(e,t){q(e,t?.reason),K(e,hn(null))}function Re(e,t){let n=M.fetchers.get(t);R.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&q(t),de.delete(t),ue.delete(t),z.delete(t),B.delete(t),se.delete(t),e.delete(t)}function ze(e){let t=(fe.get(e)||0)-1;t<=0?(fe.delete(e),B.add(e)):fe.set(e,t),H({fetchers:new Map(M.fetchers)})}function q(e,t){let n=R.get(e);n&&(n.abort(t),R.delete(e))}function Be(e,t){for(let n of e){let e=t.get(n);m(e,`Expected fetcher: ${n}`);let r=hn(e.data);t.set(n,r)}}function Ve(e){let t=[],n=!1;for(let r of z){let i=e.get(r);m(i,`Expected fetcher: ${r}`),i.state===`loading`&&(z.delete(r),t.push(r),n=!0)}return Be(t,e),n}function Ue(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);m(e,`Expected fetcher: ${r}`),e.state===`loading`&&(q(r),ue.delete(r),n.push(r))}return Be(n,t),n.length>0}function We(e,t){let n=M.blockers.get(e)||Ze;return pe.get(e)!==t&&pe.set(e,t),n}function Ge(e){M.blockers.delete(e),pe.delete(e)}function Ke(e,t){let n=M.blockers.get(e)||Ze;m(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(M.blockers);r.set(e,t),H({blockers:r})}function qe({currentLocation:e,nextLocation:t,historyAction:n}){if(pe.size===0)return;pe.size>1&&h(!1,`A router only supports one blocker at a time`);let r=Array.from(pe.entries()),[i,a]=r[r.length-1],o=M.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function $e(e){let t=J(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=qt(n);return{notFoundMatches:r,route:i,error:t}}function et(e,t,n){if(_=e,C=t,x=n||null,!w&&M.navigation===Ye){w=!0;let e=rt(M.location,M.matches);e!=null&&H({restoreScrollPosition:e})}return()=>{_=null,C=null,x=null}}function tt(e,t){return x&&x(e,t.map(e=>te(e,M.loaderData)))||e.key}function nt(e,t){if(_&&C){let n=tt(e,t);_[n]=C()}}function rt(e,t){if(_){let n=tt(e,t),r=_[n];if(typeof r==`number`)return r}return null}function it(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:N(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:N(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ot(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||gt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=N(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=N(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&st(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=N(s.activeRoutes,n,c,!0,u),!f||st(l,f))return{type:`success`,matches:null};l=f}}function st(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function pt(e){o={},s.setHmrRoutes(A(e,a,void 0,o))}function mt(e,t,n=!1){gt(e,t,s,o,a,n),s.hasHMRRoutes||H({})}return j={get basename(){return c},get future(){return d},get state(){return M},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:_e,subscribe:ye,enableScrollRestoration:et,navigate:U,fetch:Oe,revalidate:xe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ie,resetFetcher:Le,deleteFetcher:ze,dispose:ve,getBlocker:We,deleteBlocker:Ge,patchRoutes:mt,_internalFetchControllers:R,_internalSetRoutes:pt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){H(e)}},e.instrumentations&&(j=Me(j,e.instrumentations.map(e=>e.router).filter(Boolean))),j}function st(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ct(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=H(r||`.`,ye(o),V(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=cn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=pe({basename:n,pathname:c.pathname})),y(c)}function lt(e,t,n){if(!n||!st(n))return{path:t};if(n.formMethod&&!sn(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Yt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
2
2
|
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!X(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}m(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Bt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Bt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Vt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Vt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(X(c.formMethod))return{path:t,submission:c};let l=b(t);return e&&l.search&&cn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:y(l),submission:c}}function ut(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Y(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Y(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,ee={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},O=Oe(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!dt(s))f=!1;else if(u){let{shouldLoad:e}=ft(s,a.loaderData,a.errors);f=e}else pt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Ot(n,r,e,c,O,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?mt(a.matches[o],i)&&(p=!0):p=!0;let m={...ee,defaultShouldRevalidate:p},h=ht(i,m);return Ot(n,r,e,c,O,i,l,t,h,m,x)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=N(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=ln(b,e.path),C=new AbortController,w=Rt(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=kt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=kt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...ee,defaultShouldRevalidate:i};ht(S,a)&&(T=kt(n,r,w,e.path,b,S,l,t,a))}T&&A.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:k,revalidatingFetchers:A}}function dt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ft(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!dt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function pt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function mt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ht(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function gt(e,t,n,r,i,a){let o;if(e){let t=r[e];m(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>_t(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=A(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=A([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function _t(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>_t(e,t)))??!1}var vt=new WeakMap,yt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(m(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=vt.get(i);o||(o={},vt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=D(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)h(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)h(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},bt=new WeakMap;function xt(e,t,n,r,i){let a=n[e.id];if(m(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=bt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{m(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=O(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?h(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?h(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return bt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=yt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function St(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Ct(e){return e.matches.some(e=>e.route.middleware)?wt(e,()=>St(e)):St(e)}function wt(e,t){return Tt(e,t,e=>{if(on(e))throw e;return e},Qt,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Kt(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Tt(e,t,n,r,i){let{matches:a,...o}=e;return await Et(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Et(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Et(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Dt(e,t,n,r,i){let a=yt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=xt(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Ot(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Dt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ht(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ht(a,{...l,defaultShouldRevalidate:e}):ht(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?jt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function kt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Ot(e,t,n,r,Oe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Dt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function At(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:zt(t,n),pattern:Oe(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return wt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function jt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:zt(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw J(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Mt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Nt(e){let{result:t,type:n}=e;if(rn(t)){let e;try{e=await Mt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Ee(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?nn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Zt(t),statusCode:De(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:De(t)?t.status:void 0}:nn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Pt(e,t,n,r,i){let a=e.headers.get(`Location`);if(m(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!me(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ct(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Ft=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function It(e){try{return Ft.includes(new URL(e).protocol)}catch{return!1}}function Lt(e,t,n,r){if(me(e)){let r=e,i=l.test(r)?new URL(u(r,t.protocol)):new URL(r);if(It(i.toString()))throw Error(`Invalid redirect location`);let a=V(i.pathname,n)!=null;if(i.origin===t.origin&&a)return be(i.pathname)+i.search+i.hash}try{if(It(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Rt(e,t,n,r){let i=e.createURL(Yt(t)).toString(),a={signal:n};if(r&&X(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Bt(r.formData):r.formData}return new Request(i,a)}function zt(e,t){let n=new URL(e.url),r=typeof t==`string`?b(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Bt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Vt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Ht(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(m(!tn(f),`Cannot handle redirect results in processLoaderData`),Y(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Kt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=et),c||(c=!0,s=De(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Ut(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Ht(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(m(s,`Did not find corresponding fetcher result`),Y(s)){let t=Kt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(tn(s))m(!1,`Unhandled fetcher revalidation redirect`);else{let e=hn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Wt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==et).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Gt(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Kt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function qt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function J(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Ee(e||500,o,Error(s),!0)}function Jt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(tn(r))return{key:n,result:r}}}function Yt(e){return y({...typeof e==`string`?b(e):e,hash:``})}function Xt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Zt(e){return new Ee(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Qt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&$t(t))}function $t(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function en(e){return rn(e.result)&&qe.has(e.result.status)}function Y(e){return e.type===`error`}function tn(e){return(e&&e.type)===`redirect`}function nn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function rn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function an(e){return qe.has(e)}function on(e){return rn(e)&&an(e.status)&&e.headers.has(`Location`)}function sn(e){return Ke.has(e.toUpperCase())}function X(e){return We.has(e.toUpperCase())}function cn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function ln(e,t){let n=typeof t==`string`?b(t).search:t.search;if(e[e.length-1].route.index&&cn(n||``))return e[e.length-1];let r=ve(e);return r[r.length-1]}function un(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function dn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function fn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function pn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function mn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function hn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function gn(e,t){try{let n=e.sessionStorage.getItem($e);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function _n(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(n))}catch(e){h(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function vn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var yn=n.createContext(null);yn.displayName=`DataRouter`;var bn=n.createContext(null);bn.displayName=`DataRouterState`;var xn=n.createContext(!1);function Sn(){return n.useContext(xn)}var Cn=n.createContext({isTransitioning:!1});Cn.displayName=`ViewTransition`;var wn=n.createContext(new Map);wn.displayName=`Fetchers`;var Tn=n.createContext(null);Tn.displayName=`Await`;var Z=n.createContext(null);Z.displayName=`Navigation`;var En=n.createContext(null);En.displayName=`Location`;var Q=n.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var Dn=n.createContext(null);Dn.displayName=`RouteError`;var On=`REACT_ROUTER_ERROR`,kn=`REDIRECT`,An=`ROUTE_ERROR_RESPONSE`;function jn(e){if(e.startsWith(`${On}:${kn}:{`))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 Mn(e){if(e.startsWith(`${On}:${An}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ee(t.status,t.statusText,t.data)}catch{}}function Nn(e,{relative:t}={}){m(Pn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext(Z),{hash:a,pathname:o,search:s}=Vn(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:U([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Pn(){return n.useContext(En)!=null}function $(){return m(Pn(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(En).location}function Fn(e){m(Pn(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=$();return n.useMemo(()=>z(e,B(t)),[t,e])}var In=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ln(e){n.useContext(Z).static||n.useLayoutEffect(e)}function Rn(){let{isDataRoute:e}=n.useContext(Q);return e?or():zn()}function zn(){m(Pn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(yn),{basename:t,navigator:r}=n.useContext(Z),{matches:i}=n.useContext(Q),{pathname:a}=$(),o=JSON.stringify(ye(i)),s=n.useRef(!1);return Ln(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(h(s.current,In),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=H(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),He(typeof n==`string`?n:y(n),r.createHref(c),q(r),`reject`),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Bn(){let{matches:e}=n.useContext(Q);return e[e.length-1]?.params??{}}function Vn(e,{relative:t}={}){let{matches:r}=n.useContext(Q),{pathname:i}=$(),a=JSON.stringify(ye(r));return n.useMemo(()=>H(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function Hn(e,t){return Un(e,t)}function Un(e,t,r){m(Pn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext(Z),{matches:a}=n.useContext(Q),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;cr(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (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.
|
|
3
3
|
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),f;if(t){let e=typeof t==`string`?b(t):t;m(l===`/`||e.pathname?.startsWith(l),`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 "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,g=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):M(e,{pathname:g});h(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),h(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 v=Xn(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:U([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&v?n.createElement(En.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function Wn(){let e=rr(),t=De(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=n.createElement(n.Fragment,null,n.createElement(`p`,null,`💿 Hey developer 👋`),n.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,n.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,n.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:a},r):null,s)}var Gn=n.createElement(Wn,null),Kn=class extends n.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=Mn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(Q.Provider,{value:this.props.routeContext},n.createElement(Dn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement(Jn,{error:e},t):t}};Kn.contextType=xn;var qn=new WeakMap;function Jn({children:e,error:t}){let{basename:r,navigator:i}=n.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=jn(t.digest);if(e){let a=qn.get(t);if(a)throw a;let o=Ae(e.location,r),s=o.absoluteURL||o.to;if(He(e.location,s,q(i),`allow-explicit`),It(s))throw Error(`Invalid redirect location`);if(ke&&!qn.get(t)){if(o.isExternal||e.reloadDocument)window.location.href=s;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw qn.set(t,n),n}}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${s}`})}}return e}function Yn({routeContext:e,match:t,children:r}){let i=n.useContext(yn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(Q.Provider,{value:e},r)}function Xn(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);m(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 s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Oe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Gn,s&&(c<0&&l===0?(cr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(Yn,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Kn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Zn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qn(e){let t=n.useContext(yn);return m(t,Zn(e)),t}function $n(e){let t=n.useContext(bn);return m(t,Zn(e)),t}function er(e){let t=n.useContext(Q);return m(t,Zn(e)),t}function tr(e){let t=er(e),n=t.matches[t.matches.length-1];return m(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nr(){return tr(`useRouteId`)}function rr(){let e=n.useContext(Dn),t=$n(`useRouteError`),r=tr(`useRouteError`);return e===void 0?t.errors?.[r]:e}var ir=0;function ar(e){let{router:t,basename:r}=Qn(`useBlocker`),i=$n(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:V(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:V(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++ir);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):Ze}function or(){let{router:e}=Qn(`useNavigate`),t=tr(`useNavigate`),r=n.useRef(!1);return Ln(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{h(r.current,In),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var sr={};function cr(e,t,n){!t&&!sr[e]&&(sr[e]=!0,h(!1,n))}var lr={};function ur(e,t){!e&&!lr[t]&&(lr[t]=!0,console.warn(t))}var dr=n.useOptimistic,fr=()=>void 0;function pr(e){return dr?dr(e):[e,fr]}function mr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&h(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:n.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&h(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&h(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var hr=[`HydrateFallback`,`hydrateFallbackElement`],gr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function _r({router:e,flushSync:t,onError:r,useTransitions:i}){i=Sn()||i;let[a,o]=n.useState(e.state),[s,c]=pr(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Oe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),ur(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ur(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b)t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>vr(e,a)),o(a)});else if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n))}else h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new gr)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>vr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(yn.Provider,{value:C},n.createElement(bn.Provider,{value:s},n.createElement(wn.Provider,{value:y.current},n.createElement(Cn.Provider,{value:d},n.createElement(Cr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(yr,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function vr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var yr=n.memo(br);function br({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Un(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function xr({to:e,replace:t,state:r,relative:i}){m(Pn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a,navigator:o}=n.useContext(Z);h(!a,`<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:s}=n.useContext(Q),{pathname:c}=$(),l=Rn(),u=H(e,ye(s),c,i===`path`);He(typeof e==`string`?e:y(e),o.createHref(u),q(o),`reject`);let d=JSON.stringify(u);return n.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:i})},[l,d,i,t,r]),null}function Sr(e){m(!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 Cr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){m(!Pn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=b(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:g=`default`,mask:_}=r,v=n.useMemo(()=>{let e=V(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:g,mask:_},navigationType:i}},[c,u,d,f,p,g,i,_]);return h(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement(Z.Provider,{value:l},n.createElement(En.Provider,{children:t,value:v}))}function wr({children:e,location:t}){return Hn(Tr(e),t)}n.Component;function Tr(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Tr(e.props.children,a));return}m(e.type===Sr,`[${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>`),m(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.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&&(o.children=Tr(e.props.children,a)),r.push(o)}),r}var Er=`get`,Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}function Pr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Fr(e,t){let n=Pr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ir=null;function Lr(){if(Ir===null)try{new FormData(document.createElement(`form`),0),Ir=!1}catch{Ir=!0}return Ir}var Rr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function zr(e){return e!=null&&!Rr.has(e)?(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Br(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?V(o,t):null,n=e.getAttribute(`method`)||Er,i=zr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(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?V(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Er,i=zr(e.getAttribute(`formenctype`))||zr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Lr()){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(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Er,r=null,i=Dr,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`);function Vr(e,t){if(e===!1||e==null)throw Error(t)}function Hr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&V(i.pathname,t)===`/`?`${xe(t)}/_root.${r}`:`${xe(i.pathname)}.${r}`,i}async function Ur(e,t){if(e.id in t)return t[e.id];try{let n=await 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 Wr(e){return e!=null&&typeof e.page==`string`}function Gr(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 Kr(e,t,n){return Zr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ur(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Gr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function qr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Jr(e,t,{includeHydrateFallback:n}={}){return Yr(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 Yr(e){return[...new Set(e)]}function Xr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Zr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Wr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Xr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Qr(){let e=n.useContext(yn);return Vr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function $r(){let e=n.useContext(bn);return Vr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ei=n.createContext(void 0);ei.displayName=`FrameworkContext`;function ti(){let e=n.useContext(ei);return Vr(e,`You must render this element inside a <HydratedRouter> element`),e}function ni(e,t){let r=n.useContext(ei),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ri(c,m),onBlur:ri(l,h),onMouseEnter:ri(u,m),onMouseLeave:ri(d,h),onTouchStart:ri(f,m)}]:[o,p,{}]:[!1,p,{}]}function ri(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ii({page:e,...t}){let r=Sn(),{nonce:i}=ti(),{router:a}=Qr(),o=n.useMemo(()=>M(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(oi,{page:e,matches:o,...t}):n.createElement(si,{page:e,matches:o,...t})):null}function ai(e){let{manifest:t,routeModules:r}=ti(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Kr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function oi({page:e,matches:t,...r}){let i=$(),{future:a}=ti(),{basename:o}=Qr(),s=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Hr(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return n.createElement(n.Fragment,null,s.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function si({page:e,matches:t,...r}){let i=$(),{future:a,manifest:o,routeModules:s}=ti(),{basename:c}=Qr(),{loaderData:l,matches:u}=$r(),d=n.useMemo(()=>qr(e,t,u,o,i,`data`),[e,t,u,o,i]),f=n.useMemo(()=>qr(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Hr(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&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,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=n.useMemo(()=>Jr(f,o),[f,o]),h=ai(f);return n.createElement(n.Fragment,null,p.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),m.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),h.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ci(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}n.Component;var li=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{li&&(window.__reactRouterVersion=`7.18.4`)}catch{}function ui(e,t){return ot({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||di(),routes:e,mapRouteProperties:mr,hydrationRouteProperties:hr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function di(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:fi(e.errors)}),e}function fi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Ee(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Te.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var pi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext(Z),b=typeof d==`string`&&c.test(d),x=Ae(d,_);d=x.to;let S=Nn(d,{relative:i}),C=$(),w=null;if(s){let e=H(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ni(r,h),ee=vi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function O(t){e&&e(t),t.defaultPrevented||ee(t)}let k=!(x.isExternal||a),A=n.createElement(`a`,{...h,...D,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?O:e,ref:ci(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,A,n.createElement(ii,{page:S})):A});pi.displayName=`Link`;var mi=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Vn(o,{relative:l.relative}),f=$(),p=n.useContext(bn),{navigator:m,basename:h}=n.useContext(Z),g=p!=null&&wi(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=V(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(pi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});mi.displayName=`NavLink`;var hi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=Er,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext(Z),v=Si(),y=Ci(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});hi.displayName=`Form`;function gi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _i(e){let t=n.useContext(yn);return m(t,gi(e)),t}function vi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Rn(),f=$(),p=Vn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?y(f)===y(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}function yi(e){h(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=n.useRef(Pr(e)),r=n.useRef(!1),i=$(),a=n.useMemo(()=>Fr(i.search,r.current?null:t.current),[i.search]),o=Rn();return[a,n.useCallback((e,t)=>{let n=Pr(typeof e==`function`?e(new URLSearchParams(a)):e);r.current=!0,o(`?`+n,t)},[o,a])]}var bi=0,xi=()=>`__${String(++bi)}__`;function Si(){let{router:e}=_i(`useSubmit`),{basename:t}=n.useContext(Z),r=nr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Br(e,t);if(n.navigate===!1){let e=n.fetcherKey||xi();await i(e,r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync})}else await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ci(e,{relative:t}={}){let{basename:r}=n.useContext(Z),i=n.useContext(Q);m(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Vn(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.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();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),y(o)}function wi(e,{relative:t}={}){let r=n.useContext(Cn);m(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=_i(`useViewTransitionState`),a=Vn(e,{relative:t});if(!r.isTransitioning)return!1;let o=V(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=V(r.nextLocation.pathname,i)||r.nextLocation.pathname;return z(a.pathname,s)!=null||z(a.pathname,o)!=null}export{_r as a,C as c,Fn as d,Rn as f,Sr as i,ar as l,yi as m,mi as n,wr as o,Bn as p,xr as r,ui as s,pi as t,$ as u};
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),f;if(t){let e=typeof t==`string`?b(t):t;m(l===`/`||e.pathname?.startsWith(l),`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 "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,g=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):M(e,{pathname:g});h(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),h(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 v=Xn(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:U([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&v?n.createElement(En.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function Wn(){let e=rr(),t=De(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=n.createElement(n.Fragment,null,n.createElement(`p`,null,`💿 Hey developer 👋`),n.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,n.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,n.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:a},r):null,s)}var Gn=n.createElement(Wn,null),Kn=class extends n.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=Mn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(Q.Provider,{value:this.props.routeContext},n.createElement(Dn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement(Jn,{error:e},t):t}};Kn.contextType=xn;var qn=new WeakMap;function Jn({children:e,error:t}){let{basename:r,navigator:i}=n.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=jn(t.digest);if(e){let a=qn.get(t);if(a)throw a;let o=Ae(e.location,r),s=o.absoluteURL||o.to;if(He(e.location,s,q(i),`allow-explicit`),It(s))throw Error(`Invalid redirect location`);if(ke&&!qn.get(t)){if(o.isExternal||e.reloadDocument)window.location.href=s;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw qn.set(t,n),n}}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${s}`})}}return e}function Yn({routeContext:e,match:t,children:r}){let i=n.useContext(yn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(Q.Provider,{value:e},r)}function Xn(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);m(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 s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Oe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Gn,s&&(c<0&&l===0?(cr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(Yn,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Kn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Zn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qn(e){let t=n.useContext(yn);return m(t,Zn(e)),t}function $n(e){let t=n.useContext(bn);return m(t,Zn(e)),t}function er(e){let t=n.useContext(Q);return m(t,Zn(e)),t}function tr(e){let t=er(e),n=t.matches[t.matches.length-1];return m(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nr(){return tr(`useRouteId`)}function rr(){let e=n.useContext(Dn),t=$n(`useRouteError`),r=tr(`useRouteError`);return e===void 0?t.errors?.[r]:e}var ir=0;function ar(e){let{router:t,basename:r}=Qn(`useBlocker`),i=$n(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:V(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:V(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++ir);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):Ze}function or(){let{router:e}=Qn(`useNavigate`),t=tr(`useNavigate`),r=n.useRef(!1);return Ln(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{h(r.current,In),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var sr={};function cr(e,t,n){!t&&!sr[e]&&(sr[e]=!0,h(!1,n))}var lr={};function ur(e,t){!e&&!lr[t]&&(lr[t]=!0,console.warn(t))}var dr=n.useOptimistic,fr=()=>void 0;function pr(e){return dr?dr(e):[e,fr]}function mr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&h(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:n.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&h(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&h(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var hr=[`HydrateFallback`,`hydrateFallbackElement`],gr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function _r({router:e,flushSync:t,onError:r,useTransitions:i}){i=Sn()||i;let[a,o]=n.useState(e.state),[s,c]=pr(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Oe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),ur(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ur(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b)t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>vr(e,a)),o(a)});else if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n))}else h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new gr)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>vr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(yn.Provider,{value:C},n.createElement(bn.Provider,{value:s},n.createElement(wn.Provider,{value:y.current},n.createElement(Cn.Provider,{value:d},n.createElement(Cr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(yr,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function vr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var yr=n.memo(br);function br({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Un(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function xr({to:e,replace:t,state:r,relative:i}){m(Pn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a,navigator:o}=n.useContext(Z);h(!a,`<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:s}=n.useContext(Q),{pathname:c}=$(),l=Rn(),u=H(e,ye(s),c,i===`path`);He(typeof e==`string`?e:y(e),o.createHref(u),q(o),`reject`);let d=JSON.stringify(u);return n.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:i})},[l,d,i,t,r]),null}function Sr(e){m(!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 Cr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){m(!Pn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=b(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:g=`default`,mask:_}=r,v=n.useMemo(()=>{let e=V(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:g,mask:_},navigationType:i}},[c,u,d,f,p,g,i,_]);return h(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement(Z.Provider,{value:l},n.createElement(En.Provider,{children:t,value:v}))}function wr({children:e,location:t}){return Hn(Tr(e),t)}n.Component;function Tr(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Tr(e.props.children,a));return}m(e.type===Sr,`[${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>`),m(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.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&&(o.children=Tr(e.props.children,a)),r.push(o)}),r}var Er=`get`,Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}function Pr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Fr(e,t){let n=Pr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ir=null;function Lr(){if(Ir===null)try{new FormData(document.createElement(`form`),0),Ir=!1}catch{Ir=!0}return Ir}var Rr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function zr(e){return e!=null&&!Rr.has(e)?(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Br(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?V(o,t):null,n=e.getAttribute(`method`)||Er,i=zr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(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?V(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Er,i=zr(e.getAttribute(`formenctype`))||zr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Lr()){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(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Er,r=null,i=Dr,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`);function Vr(e,t){if(e===!1||e==null)throw Error(t)}function Hr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&V(i.pathname,t)===`/`?`${xe(t)}/_root.${r}`:`${xe(i.pathname)}.${r}`,i}async function Ur(e,t){if(e.id in t)return t[e.id];try{let n=await 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 Wr(e){return e!=null&&typeof e.page==`string`}function Gr(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 Kr(e,t,n){return Zr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ur(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Gr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function qr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Jr(e,t,{includeHydrateFallback:n}={}){return Yr(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 Yr(e){return[...new Set(e)]}function Xr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Zr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Wr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Xr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Qr(){let e=n.useContext(yn);return Vr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function $r(){let e=n.useContext(bn);return Vr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ei=n.createContext(void 0);ei.displayName=`FrameworkContext`;function ti(){let e=n.useContext(ei);return Vr(e,`You must render this element inside a <HydratedRouter> element`),e}function ni(e,t){let r=n.useContext(ei),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ri(c,m),onBlur:ri(l,h),onMouseEnter:ri(u,m),onMouseLeave:ri(d,h),onTouchStart:ri(f,m)}]:[o,p,{}]:[!1,p,{}]}function ri(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ii({page:e,...t}){let r=Sn(),{nonce:i}=ti(),{router:a}=Qr(),o=n.useMemo(()=>M(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(oi,{page:e,matches:o,...t}):n.createElement(si,{page:e,matches:o,...t})):null}function ai(e){let{manifest:t,routeModules:r}=ti(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Kr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function oi({page:e,matches:t,...r}){let i=$(),{future:a}=ti(),{basename:o}=Qr(),s=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Hr(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return n.createElement(n.Fragment,null,s.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function si({page:e,matches:t,...r}){let i=$(),{future:a,manifest:o,routeModules:s}=ti(),{basename:c}=Qr(),{loaderData:l,matches:u}=$r(),d=n.useMemo(()=>qr(e,t,u,o,i,`data`),[e,t,u,o,i]),f=n.useMemo(()=>qr(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Hr(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&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,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=n.useMemo(()=>Jr(f,o),[f,o]),h=ai(f);return n.createElement(n.Fragment,null,p.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),m.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),h.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ci(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}n.Component;var li=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{li&&(window.__reactRouterVersion=`7.18.4`)}catch{}function ui(e,t){return ot({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||di(),routes:e,mapRouteProperties:mr,hydrationRouteProperties:hr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function di(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:fi(e.errors)}),e}function fi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Ee(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Te.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var pi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext(Z),b=typeof d==`string`&&c.test(d),x=Ae(d,_);d=x.to;let S=Nn(d,{relative:i}),C=$(),w=null;if(s){let e=H(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ni(r,h),ee=vi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function O(t){e&&e(t),t.defaultPrevented||ee(t)}let k=!(x.isExternal||a),A=n.createElement(`a`,{...h,...D,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?O:e,ref:ci(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,A,n.createElement(ii,{page:S})):A});pi.displayName=`Link`;var mi=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Vn(o,{relative:l.relative}),f=$(),p=n.useContext(bn),{navigator:m,basename:h}=n.useContext(Z),g=p!=null&&wi(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=V(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(pi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});mi.displayName=`NavLink`;var hi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=Er,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext(Z),v=Si(),y=Ci(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});hi.displayName=`Form`;function gi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _i(e){let t=n.useContext(yn);return m(t,gi(e)),t}function vi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Rn(),f=$(),p=Vn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?y(f)===y(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}function yi(e){h(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=n.useRef(Pr(e)),r=n.useRef(!1),i=$(),a=n.useMemo(()=>Fr(i.search,r.current?null:t.current),[i.search]),o=Rn();return[a,n.useCallback((e,t)=>{let n=Pr(typeof e==`function`?e(new URLSearchParams(a)):e);r.current=!0,o(`?`+n,t)},[o,a])]}var bi=0,xi=()=>`__${String(++bi)}__`;function Si(){let{router:e}=_i(`useSubmit`),{basename:t}=n.useContext(Z),r=nr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Br(e,t);if(n.navigate===!1){let e=n.fetcherKey||xi();await i(e,r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync})}else await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ci(e,{relative:t}={}){let{basename:r}=n.useContext(Z),i=n.useContext(Q);m(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Vn(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.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();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),y(o)}function wi(e,{relative:t}={}){let r=n.useContext(Cn);m(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=_i(`useViewTransitionState`),a=Vn(e,{relative:t});if(!r.isTransitioning)return!1;let o=V(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=V(r.nextLocation.pathname,i)||r.nextLocation.pathname;return z(a.pathname,s)!=null||z(a.pathname,o)!=null}export{_r as a,C as c,Fn as d,Rn as f,yi as h,Sr as i,ar as l,rr as m,mi as n,wr as o,Bn as p,xr as r,ui as s,pi as t,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./client-
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";var t={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};t.node;var n=e(t),r={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};r.node;var i=e(r);export{n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";var n=e(t(),1),r=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function i(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:r(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var a=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function l(e){return e!=null}function u(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??c.width,a=e.size??e.height??c.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...o],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?s(...d):s(`lucide`,...u,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??c[`stroke-width`])*Number(e.size??e.width??c.width)/Number(t.size??t.width??c.width):t.strokeWidth??c[`stroke-width`];return[`svg`,{...Object.entries(c).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&l(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&l(t.width)&&{[r(`width`)]:t.width},...`height`in t&&l(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function d(e,t={}){return u(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,n.createContext)({}),m=()=>(0,n.useContext)(p),h=(0,n.forwardRef)(({color:e,size:t,width:r,height:i,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:c,className:l=``,children:u,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...g},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=m()??{},w=!!u||f(g),[T,E,D=[]]=d(h,{color:e??S,width:r??t??v,height:i??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:c??x,className:s(C,l),hasA11yProp:w,attributes:g});return(0,n.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function g(e,t=[],r=[]){let a=typeof e==`string`?i(e,t,r):e,s=(0,n.forwardRef)(({className:e,...t},r)=>(0,n.createElement)(h,{ref:r,icon:a,className:e,...t}));return a.name&&(s.displayName=o(a.name)),s}var _=`orc-api-access-changed`,v=`orc_api_secret`,y=(e,t)=>`${e.replace(/\/$/,``)}${t}`;async function b(e,t){let n=await fetch(y(e,`/auth/session`),{credentials:`include`,cache:`no-store`,signal:t??AbortSignal.timeout(1e4)});if(!n.ok)throw Error(`Could not connect to the ORC API. Try again.`);return await n.json()}async function x(e,t,n){let r=await fetch(y(e,`/auth/session`),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:t,...n?{expires_at:n}:{}})});if(r.status===401)return!1;if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Could not sign in. Try again.`)}return!0}async function S(e){await fetch(y(e,`/auth/session`),{method:`DELETE`,credentials:`include`}),window.dispatchEvent(new Event(_))}async function C(e){let t=``;try{let n=`${v}:${new URL(e,window.location.href).href.replace(/\/$/,``)}`;t=localStorage.getItem(n)??localStorage.getItem(v)??``;for(let e of Object.keys(localStorage))e.startsWith(v)&&localStorage.removeItem(e)}catch{return}t&&await x(e,t).catch(()=>!1)}async function w(e,t){let n=await fetch(y(e,`/settings`),{credentials:`include`,cache:`no-store`,signal:t??AbortSignal.timeout(1e4)});if(n.status===401)return null;if(!n.ok)throw Error(`Could not connect to the ORC API. Try again.`);let r=await n.json();if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`The server did not return an ORC access check. Check the API connection.`);let i=r;if(i.theme!==void 0&&i.theme!==`dark`&&i.theme!==`light`||i.terminal_font!==void 0&&typeof i.terminal_font!=`string`)throw Error(`The server returned invalid workspace preferences.`);return i}var T=e=>{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},E=e=>Math.floor(new Date(`${e}T23:59:59`).getTime()/1e3);async function D(e,t,n){let r=await fetch(y(e,`/auth/token`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:t,expires_at:n})}),i=await r.json().catch(()=>null);if(r.status===401)throw Error(`Incorrect API secret.`);if(!r.ok||!i)throw Error(i?.error??`Could not create a token. Try again.`);return i}var O=()=>localStorage.getItem(`orc_api_url`)??`/api`,k=class extends Error{status;code;constructor(e,t,n){super(e),this.status=t,this.code=n,this.name=`ApiError`}},A=`human`;function j(e,t,n=O(),r=window.location){let i=`/terminals/${encodeURIComponent(e)}/ws?ticket=${encodeURIComponent(t)}`,a=n.replace(/\/+$/,``);if(/^https?:\/\//i.test(a))return`${a.replace(/^http/i,`ws`)}${i}`;let o=r.protocol===`https:`?`wss:`:`ws:`,s=a.startsWith(`/`)||a===``?a:`/${a}`;return`${o}//${r.host}${s}${i}`}var M=encodeURIComponent;function N(){return{"X-Orc-Source":`ui`}}function P(e,t={}){let n=new Headers(t.headers);for(let[e,t]of Object.entries(N()))n.has(e)||n.set(e,t);return fetch(`${O()}${e.startsWith(`/`)?e:`/${e}`}`,{credentials:`include`,...t,headers:n})}async function F(e,t,n,r,i){let a=`${O()}${t}`;if(r){let e=new URLSearchParams;for(let[t,n]of Object.entries(r))n!==void 0&&e.set(t,String(n));let t=e.toString();t&&(a+=`?${t}`)}let o={"Content-Type":`application/json`,...N(),...i?.headers},s=await fetch(a,{method:e,headers:o,credentials:`include`,signal:i?.signal,...n===void 0?{}:{body:JSON.stringify(n)}});if(s.status===401&&window.dispatchEvent(new Event(_)),s.status===204||s.status===404&&i?.nullOn404)return null;let c=await s.json();if(!s.ok){let e=c;throw new k(typeof e.error==`string`?e.error:`HTTP ${s.status}`,s.status,typeof e.code==`string`?e.code:null)}return c}var I={preview:{session:e=>F(`GET`,`/desktop-preview/session`,void 0,{session_id:e}),register:(e,t,n,r,i=!1)=>F(`POST`,`/desktop-preview/clients`,{client_id:e,session_id:t,agent_access:n,browser_ready:i},void 0,{headers:r?{"X-Preview-Lease":r}:{}}),pending:(e,t)=>F(`GET`,`/desktop-preview/clients/${M(e)}/requests`,void 0,void 0,{headers:{"X-Preview-Lease":t}}),ack:(e,t,n,r,i=null,a)=>F(`POST`,`/desktop-preview/requests/${M(e)}/ack`,{client_id:t,status:r,error:i,...a===void 0?{}:{result:a}},void 0,{headers:{"X-Preview-Lease":n}}),file:(e,t)=>F(`GET`,`/desktop-preview/file`,void 0,{session_id:e,target:t}),save:(e,t,n,r)=>F(`PUT`,`/desktop-preview/file`,{session_id:e,target:t,content:n,original:r})},channels:{notificationPolicy:()=>F(`GET`,`/channels/notification-policy`),saveNotificationPolicy:e=>F(`PUT`,`/channels/notification-policy`,e),notificationDeliveries:()=>F(`GET`,`/channels/notification-deliveries`),notificationPreview:e=>F(`POST`,`/channels/notification-preview`,e),list:()=>F(`GET`,`/channels`),providers:()=>F(`GET`,`/channels/providers`),save:e=>F(`PUT`,`/channels/${M(e.id)}`,e),verify:e=>F(`POST`,`/channels/${M(e)}/verify`),send:e=>F(`POST`,`/channels/messages`,e),pair:e=>F(`POST`,`/channels/${M(e)}/pairings`),pairing:e=>F(`GET`,`/channels/pairings/${M(e)}`),confirmPairing:e=>F(`POST`,`/channels/pairings/${M(e)}/confirm`),manifest:()=>F(`GET`,`/channels/slack-manifest`),routeTest:(e,t)=>F(`POST`,`/channels/${M(e)}/route-test`,t)},push:{config:()=>F(`GET`,`/push/config`),devices:()=>F(`GET`,`/push/subscriptions`),subscribe:e=>F(`POST`,`/push/subscriptions`,e),updateTopics:(e,t)=>F(`PATCH`,`/push/subscriptions/${encodeURIComponent(e)}`,{topics:t}),remove:e=>F(`DELETE`,`/push/subscriptions/${encodeURIComponent(e)}`),test:e=>F(`POST`,`/push/subscriptions/${encodeURIComponent(e)}/test`)},humanRequests:{view:e=>F(`GET`,`/human-requests/${encodeURIComponent(e)}/view`),run:(e,t,n,r)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/run`,{version:t,script:n,values:r}),list:()=>F(`GET`,`/human-requests`),respond:(e,t,n)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/respond`,{version:t,response:n}),cancel:(e,t)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/cancel`,{version:t})},chat:{capabilities:(e,t)=>F(`GET`,`/chat/capabilities?${new URLSearchParams({agent:e,...t?{threadId:t}:{}})}`),steer:(e,t,n=crypto.randomUUID())=>F(`POST`,`/chat/runs/${e}/steer`,{input:t,requestId:n}),waiting:()=>F(`GET`,`/chat/waiting`),models:(e,t,n,r,i)=>F(`GET`,`/chat/models`,void 0,{agent:e,threadId:t,host:n===null?`__local__`:n,cwd:r,providerId:i}),list:()=>F(`GET`,`/chat/threads`),cancel:e=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/cancel`),get:e=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}`),session:e=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}/session`),refresh:e=>F(`POST`,`/chat/threads/${encodeURIComponent(e)}/refresh`),configure:(e,t)=>F(`PATCH`,`/chat/threads/${encodeURIComponent(e)}/config`,{agentOptions:t}),history:(e,t)=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}/history`,void 0,{before:t}),resume:e=>F(`POST`,`/chat/threads`,{sourceSessionId:e}),fromSetup:e=>F(`POST`,`/chat/threads`,{setup:e}),permission:(e,t,n)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/permission`,{requestId:t,decision:n}),answer:(e,t,n)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/answer`,{requestId:t,answers:n}),permissionMode:(e,t)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/permission-mode`,{mode:t})},settings:{providers:{get:()=>F(`GET`,`/settings/providers`),save:e=>F(`PUT`,`/settings/providers`,e)},usageHistory:e=>F(`GET`,`/usage/history`,void 0,{days:e}),usageQuotas:()=>F(`GET`,`/usage/quotas`),mcp:{get:()=>F(`GET`,`/settings/mcp`),save:e=>F(`PATCH`,`/settings/mcp`,e)},security:{get:()=>F(`GET`,`/settings/security`),save:e=>F(`PATCH`,`/settings/security`,e)},get:()=>F(`GET`,`/settings`),save:e=>F(`PATCH`,`/settings`,e)},search:(e,t)=>F(`GET`,`/search`,void 0,{q:e,project_id:t}),rules:{list:()=>F(`GET`,`/rules`),activate:(e,t,n)=>F(`POST`,`/rules/activate`,{policy:e,expected_id:t,reason:n}),revert:(e,t)=>F(`POST`,`/rules/revert`,{id:e,reason:t})},health:{check:e=>F(`GET`,`/health`,void 0,void 0,{signal:e})},integrations:{connections:()=>F(`GET`,`/integrations/connections`),connection:e=>F(`GET`,`/integrations/connections/${M(e)}`),create:(e,t)=>F(`POST`,`/integrations/connections`,{name:e,source:t}),test:(e,t)=>F(`POST`,`/integrations/connections/test`,{name:e,source:t}),update:(e,t)=>F(`PUT`,`/integrations/connections/${M(e)}`,{source:t}),setEnabled:(e,t)=>F(`PATCH`,`/integrations/connections/${M(e)}`,{enabled:t}),remove:e=>F(`DELETE`,`/integrations/connections/${M(e)}`),refresh:e=>F(`POST`,`/integrations/connections/${M(e)}/refresh`,{}),authorize:(e,t)=>F(`POST`,`/integrations/connections/${M(e)}/authorize`,{redirectUrl:t}),finishAuthorization:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/authorize/callback`,{code:t,state:n}),signOut:e=>F(`DELETE`,`/integrations/connections/${M(e)}/authorize`),tools:e=>F(`GET`,`/integrations/connections/${M(e)}/tools`),tool:(e,t)=>F(`GET`,`/integrations/connections/${M(e)}/tools/${M(t)}`),setToolEnabled:(e,t,n)=>F(`PATCH`,`/integrations/connections/${M(e)}/tools/${M(t)}`,{enabled:n}),invoke:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/tools/${M(t)}/invoke`,{args:n}),resources:e=>F(`GET`,`/integrations/connections/${M(e)}/resources`),readResource:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/resources/read`,{uri:t,vars:n}),prompts:e=>F(`GET`,`/integrations/connections/${M(e)}/prompts`),getPrompt:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/prompts/get`,{prompt:t,arguments:n})},system:{about:()=>F(`GET`,`/system/about`),restart:()=>F(`POST`,`/system/restart`,{})},tasks:{list:e=>F(`GET`,`/tasks`,void 0,e),get:e=>F(`GET`,`/tasks/${e}`),create:e=>F(`POST`,`/tasks`,e),startFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow`,{name:t,start:!0}),update:(e,t)=>F(`PATCH`,`/tasks/${e}`,t),delete:e=>F(`DELETE`,`/tasks/${e}`),addComment:(e,t,n=`human`)=>F(`POST`,`/tasks/${e}/comments`,{content:t,author:n}),listComments:e=>F(`GET`,`/tasks/${e}/comments`),listLinks:e=>F(`GET`,`/tasks/${e}/links`),addLink:(e,t)=>F(`POST`,`/tasks/${e}/links`,t),deleteLink:(e,t)=>F(`DELETE`,`/tasks/${e}/links/${t}`),flow:e=>F(`GET`,`/tasks/${e}/flow`,void 0,void 0,{nullOn404:!0}),resumeFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow/resume`,t),haltFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow/halt`,{reason:t})},backends:{list:()=>F(`GET`,`/backends`)},flows:{list:e=>F(`GET`,`/flows`,void 0,e),get:e=>F(`GET`,`/flows/${encodeURIComponent(e)}`)},memories:{limits:()=>F(`GET`,`/memory-limits`),list:e=>F(`GET`,`/memories`,void 0,e),get:(e,t)=>F(`GET`,`/memories/${encodeURIComponent(t)}`,void 0,{project_id:e}),create:e=>F(`POST`,`/memories`,{...e,author:A}),update:(e,t)=>F(`PATCH`,`/memories/${encodeURIComponent(e)}`,{...t,author:A}),delete:(e,t)=>F(`DELETE`,`/memories/${encodeURIComponent(t)}`,void 0,{project_id:e,author:A}),history:(e,t)=>F(`GET`,`/memories/${encodeURIComponent(t)}/history`,void 0,{project_id:e}),revert:(e,t)=>F(`POST`,`/memories/${encodeURIComponent(e)}/revert`,t),nativeSources:e=>F(`GET`,`/memory-transfer/sources`,void 0,{project_id:e}),previewImport:(e,t)=>F(`POST`,`/memory-transfer/import/preview`,{project_id:e,dir:t}),importNative:(e,t,n)=>F(`POST`,`/memory-transfer/import`,{project_id:e,dir:t,memories:n,author:A}),previewExport:(e,t)=>F(`POST`,`/memory-transfer/export/preview`,{project_id:e,dir:t}),exportNative:(e,t,n,r)=>F(`POST`,`/memory-transfer/export`,{project_id:e,dir:t,names:n,overwrite:r})},scratchpads:{list:e=>F(`GET`,`/scratchpads`,void 0,e),get:e=>F(`GET`,`/scratchpads/${M(e)}`),create:e=>F(`POST`,`/scratchpads`,{...e,author:A}),update:(e,t)=>F(`PATCH`,`/scratchpads/${M(e)}`,{...t,author:A}),delete:e=>F(`DELETE`,`/scratchpads/${M(e)}`)},jobs:{nativeSession:(e,t)=>F(`GET`,`/jobs/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/session`),list:e=>F(`GET`,`/jobs`,void 0,e),listAll:async e=>{let t=[],n=0;for(;;){let r=await I.jobs.list({...e,limit:e?.limit??100,offset:n});if(t.push(...r.jobs),r.next_offset==null)return{jobs:t};if(!Number.isSafeInteger(r.next_offset)||r.next_offset<=n)throw Error(`Invalid job pagination response`);n=r.next_offset}},get:e=>F(`GET`,`/jobs/${e}`),create:e=>F(`POST`,`/jobs`,e),update:(e,t)=>F(`PATCH`,`/jobs/${e}`,t),delete:e=>F(`DELETE`,`/jobs/${e}`),trigger:e=>F(`POST`,`/jobs/${e}/trigger`),runs:(e,t=10)=>F(`GET`,`/jobs/${e}/runs`,void 0,{limit:t}),runLogs:(e,t,n)=>F(`GET`,`/jobs/${e}/runs/${t}/logs`,void 0,n)},webhooks:{list:e=>F(`GET`,`/webhooks`,void 0,{project_id:e}),create:e=>F(`POST`,`/webhooks`,e),update:(e,t)=>F(`PATCH`,`/webhooks/${e}`,t),delete:e=>F(`DELETE`,`/webhooks/${e}`),rotate:e=>F(`POST`,`/webhooks/${e}/rotate-secret`),deliveries:e=>F(`GET`,`/webhooks/${e}/deliveries`)},projects:{syncGithub:e=>F(`POST`,`/projects/${encodeURIComponent(e)}/github-sync`),list:e=>F(`GET`,`/projects`,void 0,e),listAll:async e=>{let t=[],n=0;for(;;){let r=await I.projects.list({...e,limit:100,offset:n});if(t.push(...r.projects),r.next_offset==null)return{projects:t};if(!Number.isSafeInteger(r.next_offset)||r.next_offset<=n)throw Error(`Invalid project pagination response`);n=r.next_offset}},get:e=>F(`GET`,`/projects/${e}`),getByName:e=>F(`GET`,`/projects/by-name/${encodeURIComponent(e)}`),summary:e=>F(`GET`,`/projects/${e}/summary`),create:e=>F(`POST`,`/projects`,e),update:(e,t)=>F(`PATCH`,`/projects/${e}`,t),delete:e=>F(`DELETE`,`/projects/${e}`),addComment:(e,t,n=`human`)=>F(`POST`,`/projects/${e}/comments`,{content:t,author:n}),listComments:e=>F(`GET`,`/projects/${e}/comments`)},sessions:{cacheUsage:e=>F(`GET`,`/sessions/live/${encodeURIComponent(e)}/cache`),archive:e=>F(`GET`,`/sessions/archive`,void 0,e),archiveUpload:e=>F(`POST`,`/sessions/archive/upload`,e),archiveIndex:e=>F(`POST`,`/sessions/archive/index`,{project_id:e}),archiveTranscript:(e,t)=>F(`GET`,`/sessions/archive/${e}/transcript`,void 0,t),archiveResume:(e,t)=>F(`POST`,`/sessions/archive/${e}/resume`,t),list:e=>F(`GET`,`/sessions`,void 0,e),get:e=>F(`GET`,`/sessions/${e}`),sync:()=>F(`POST`,`/sessions/live/sync`),search:e=>F(`GET`,`/sessions/live/search`,void 0,e),transcript:(e,t)=>F(`GET`,`/sessions/live/${e}/transcript`,void 0,t),live:e=>F(`GET`,`/sessions/live`,void 0,e),linkTask:(e,t)=>F(`PATCH`,`/sessions/live/${e}`,{task_id:t})},skills:{visibility:()=>F(`GET`,`/skills/settings/visibility`),setVisibility:e=>F(`PUT`,`/skills/settings/visibility`,e),updateInstructions:(e,t)=>F(`PUT`,`/skills/${encodeURIComponent(e)}/instructions`,t),history:(e,t={})=>F(`GET`,`/skills/${encodeURIComponent(e)}/history`,void 0,t),revert:(e,t)=>F(`POST`,`/skills/${encodeURIComponent(e)}/revert`,t),discover:e=>F(`POST`,`/skills/discover`,{source:e}),import:e=>F(`POST`,`/skills/import`,e),origin:e=>F(`GET`,`/skills/${encodeURIComponent(e)}/origin`),localAgents:e=>F(`GET`,`/skills/local-agents`,void 0,e?{path:e}:void 0),projectFolders:()=>F(`GET`,`/skills/project-folders`),importLocal:(e,t)=>F(`POST`,`/skills/local-agents/import`,{skills:e,...t?{folder:t}:{}}),previewExport:e=>F(`POST`,`/skills/export/preview`,{target:e}),exportTo:(e,t,n)=>F(`POST`,`/skills/export`,{target:e,names:t,overwrite:n}),delete:e=>F(`DELETE`,`/skills/${encodeURIComponent(e)}`),sync:(e,t={})=>F(`POST`,`/skills/${encodeURIComponent(e)}/sync`,t),editFile:(e,t)=>F(`PUT`,`/skills/${encodeURIComponent(e)}/file`,t),list:e=>F(`GET`,`/skills`,void 0,e),get:(e,t,n={})=>F(`GET`,`/skills/${encodeURIComponent(e)}`,void 0,{...n,ref:t}),projects:e=>F(`GET`,`/skills/${encodeURIComponent(e)}/projects`),create:e=>F(`POST`,`/skills`,e)},agents:{list:()=>F(`GET`,`/agents`),get:e=>F(`GET`,`/agents/${encodeURIComponent(e)}`),create:e=>F(`POST`,`/agents`,e),delete:e=>F(`DELETE`,`/agents/${encodeURIComponent(e)}`),update:(e,t)=>F(`PUT`,`/agents/${encodeURIComponent(e)}`,t)},agentPackages:{delete:(e,t)=>F(`DELETE`,`/agent-packages/${encodeURIComponent(e)}`,{expectedRevision:t}),acquire:e=>F(`POST`,`/agent-packages/acquire`,{source:e}),importAcquired:e=>F(`POST`,`/agent-packages/import-acquired`,e),list:()=>F(`GET`,`/agent-packages`),get:(e,t)=>F(`GET`,`/agent-packages/${encodeURIComponent(e)}`,void 0,t?{ref:t}:void 0),create:e=>F(`POST`,`/agent-packages`,e),update:(e,t)=>F(`PUT`,`/agent-packages/${encodeURIComponent(e)}`,t),discover:e=>F(`POST`,`/agent-packages/discover`,{source:e}),importGit:e=>F(`POST`,`/agent-packages/import-git`,e),exportArtifact:e=>F(`POST`,`/agent-packages/${encodeURIComponent(e)}/export`)},agentSetups:{list:()=>F(`GET`,`/agent-setups`),create:e=>F(`POST`,`/agent-setups`,e),command:e=>F(`POST`,`/agent-setups/command`,e)},packageTools:{list:e=>F(`GET`,`/package-tools`,void 0,e===void 0?void 0:{host:e??``})},audit:{list:(e={})=>F(`GET`,`/audit`,void 0,e)},notifications:{list:(e={})=>F(`GET`,`/notifications`,void 0,e),update:(e,t)=>F(`PATCH`,`/notifications/${encodeURIComponent(e)}`,t),markAllRead:()=>F(`POST`,`/notifications/read`)},kb:{list:(e={})=>F(`GET`,`/kb/bases`,void 0,e),get:e=>F(`GET`,`/kb/bases/${M(e)}`),create:e=>F(`POST`,`/kb/bases`,e),update:(e,t)=>F(`PATCH`,`/kb/bases/${M(e)}`,t),remove:e=>F(`DELETE`,`/kb/bases/${M(e)}`),usage:e=>F(`GET`,`/kb/bases/${M(e)}/usage`),maintenance:e=>F(`GET`,`/kb/bases/${M(e)}/maintenance`),documents:e=>F(`GET`,`/kb/bases/${M(e)}/documents`),createDocument:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/documents`,t),upload:(e,t,n)=>{let r=new FormData;return r.set(`file`,t.file,t.file.name),t.title&&r.set(`title`,t.title),t.path&&r.set(`path`,t.path),t.labels?.length&&r.set(`labels`,t.labels.join(`,`)),t.document_id&&r.set(`document_id`,t.document_id),t.expected_revision!==void 0&&r.set(`expected_revision`,String(t.expected_revision)),new Promise((t,i)=>{let a=new XMLHttpRequest;a.open(`POST`,`${O()}/kb/bases/${M(e)}/upload`),a.withCredentials=!0;for(let[e,t]of Object.entries(N()))a.setRequestHeader(e,t);a.upload.onprogress=e=>{e.lengthComputable&&n?.(e.loaded/e.total)},a.onerror=()=>i(new k(`Upload failed: network error`,0,null)),a.onload=()=>{let e=null;try{e=JSON.parse(a.responseText)}catch{}if(a.status>=200&&a.status<300)return t(e);let n=e??{};i(new k(typeof n.error==`string`?n.error:`HTTP ${a.status}`,a.status,typeof n.code==`string`?n.code:null))},a.send(r)})},document:(e,t={})=>F(`GET`,`/kb/documents/${M(e)}`,void 0,t),updateDocument:(e,t)=>F(`PATCH`,`/kb/documents/${M(e)}`,t),removeDocument:e=>F(`DELETE`,`/kb/documents/${M(e)}`),revisions:e=>F(`GET`,`/kb/documents/${M(e)}/revisions`),revision:(e,t)=>F(`GET`,`/kb/documents/${M(e)}/revisions/${t}`),original:async e=>{let t=await P(`/kb/documents/${M(e)}/original`);if(!t.ok)throw new k(`HTTP ${t.status}`,t.status,null);return t.blob()},reparse:e=>F(`POST`,`/kb/documents/${M(e)}/reparse`),documentUsage:e=>F(`GET`,`/kb/documents/${M(e)}/usage`),citation:e=>F(`GET`,`/kb/citations/${M(e)}`),comments:(e,t={})=>F(`GET`,`/kb/bases/${M(e)}/comments`,void 0,t),addComment:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/comments`,t),closeComment:(e,t)=>F(`POST`,`/kb/comments/${M(e)}/close`,t),reopenComment:e=>F(`POST`,`/kb/comments/${M(e)}/reopen`),digestTemplate:()=>F(`GET`,`/kb/digest-template`),digest:e=>F(`GET`,`/kb/bases/${M(e)}/digest`),setDigest:(e,t)=>F(`PUT`,`/kb/bases/${M(e)}/digest`,t),removeDigest:(e,t)=>F(`DELETE`,`/kb/bases/${M(e)}/digest`,void 0,{confirm:t}),runDigest:e=>F(`POST`,`/kb/bases/${M(e)}/digest/run`),digestRuns:(e,t)=>F(`GET`,`/kb/bases/${M(e)}/digest/runs`,void 0,{limit:t}),search:(e,t)=>F(`POST`,`/kb/search`,e,{project_id:t}),sources:e=>F(`GET`,`/kb/bases/${M(e)}/sources`),addSource:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/sources`,t),scanSource:e=>F(`POST`,`/kb/sources/${M(e)}/scan`),removeSource:e=>F(`DELETE`,`/kb/sources/${M(e)}`),status:()=>F(`GET`,`/kb/status`),settings:()=>F(`GET`,`/kb/settings`),updateSettings:e=>F(`PATCH`,`/kb/settings`,e),parsers:()=>F(`GET`,`/kb/parsers`),installDocling:()=>F(`POST`,`/kb/parsers/docling/install`),uninstallDocling:()=>F(`DELETE`,`/kb/parsers/docling`)},tags:{list:e=>F(`GET`,`/tags`,void 0,e)},terminals:{list:e=>F(`GET`,`/terminals`,void 0,{host:e===null?``:e}),create:e=>F(`POST`,`/terminals`,e),get:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}`),rename:(e,t)=>F(`PATCH`,`/terminals/${encodeURIComponent(e)}`,{name:t}),remove:e=>F(`DELETE`,`/terminals/${encodeURIComponent(e)}`),ticket:e=>F(`POST`,`/terminals/${encodeURIComponent(e)}/ticket`),pickFolder:(e,t)=>F(`POST`,`/terminals/pick-folder`,{initial:e,host:t}),browse:(e,t)=>F(`GET`,`/terminals/browse`,void 0,{path:e,host:t===null?``:t}),createFolder:(e,t,n)=>F(`POST`,`/terminals/browse/folders`,{host:e,parent:t,name:n})},ssh:{get:()=>F(`GET`,`/ssh`),select:(e,t)=>F(`PUT`,`/ssh`,{host:e,...t===void 0?{}:{remote_port:t}}),test:e=>F(`POST`,`/ssh/test`,e?{host:e}:{})},git:{status:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/status`),diff:(e,t,n)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/diff`,void 0,{staged:t?`1`:`0`,path:n}),terminalWorktrees:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/worktrees`),stage:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/stage`,{paths:t}),switchBranch:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/switch`,{branch:t}),checkoutGithub:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/github`),pullReview:(e,t)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/pulls/${t}`),postPullComment:(e,t,n)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/pulls/${t}/comments`,n),saveFile:(e,t,n,r)=>F(`PUT`,`/terminals/${encodeURIComponent(e)}/files`,{path:t,content:n,original:r}),files:(e,t)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/files`,void 0,{path:t}),commit:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/commit`,{message:t}),addWorktree:e=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/worktrees`),githubItems:(e,t)=>F(`GET`,`/github/items`,void 0,{filter:e,project_id:t}),registry:e=>F(`GET`,`/git/registry`,void 0,{project_id:e}),registryPulls:e=>F(`GET`,`/git/registry/pulls`,void 0,{project_id:e}),cleanup:e=>F(`POST`,`/git/worktrees/cleanup`,{items:e}),worktrees:(e,t)=>F(`GET`,`/git/worktrees`,void 0,{cwd:e,host:t===null?``:t}),removeWorktree:e=>F(`POST`,`/git/worktrees/remove`,e)},gateway:{status:()=>F(`GET`,`/gateway/status`),send:e=>F(`POST`,`/gateway/send`,e)}};export{j as a,D as c,b as d,x as f,g as h,O as i,E as l,T as m,I as n,_ as o,S as p,P as r,w as s,k as t,C as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";var n=e(t(),1),r=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function i(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:r(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var a=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function l(e){return e!=null}function u(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??c.width,a=e.size??e.height??c.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...o],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?s(...d):s(`lucide`,...u,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??c[`stroke-width`])*Number(e.size??e.width??c.width)/Number(t.size??t.width??c.width):t.strokeWidth??c[`stroke-width`];return[`svg`,{...Object.entries(c).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&l(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&l(t.width)&&{[r(`width`)]:t.width},...`height`in t&&l(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function d(e,t={}){return u(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,n.createContext)({}),m=()=>(0,n.useContext)(p),h=(0,n.forwardRef)(({color:e,size:t,width:r,height:i,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:c,className:l=``,children:u,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...g},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=m()??{},w=!!u||f(g),[T,E,D=[]]=d(h,{color:e??S,width:r??t??v,height:i??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:c??x,className:s(C,l),hasA11yProp:w,attributes:g});return(0,n.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function g(e,t=[],r=[]){let a=typeof e==`string`?i(e,t,r):e,s=(0,n.forwardRef)(({className:e,...t},r)=>(0,n.createElement)(h,{ref:r,icon:a,className:e,...t}));return a.name&&(s.displayName=o(a.name)),s}var _=`orc-api-access-changed`,v=`orc_api_secret`,y=(e,t)=>`${e.replace(/\/$/,``)}${t}`;async function b(e,t){let n=await fetch(y(e,`/auth/session`),{credentials:`include`,cache:`no-store`,signal:t??AbortSignal.timeout(1e4)});if(!n.ok)throw Error(`Could not connect to the ORC API. Try again.`);return await n.json()}async function x(e,t,n){let r=await fetch(y(e,`/auth/session`),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:t,...n?{expires_at:n}:{}})});if(r.status===401)return!1;if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Could not sign in. Try again.`)}return!0}async function S(e){await fetch(y(e,`/auth/session`),{method:`DELETE`,credentials:`include`}),window.dispatchEvent(new Event(_))}async function C(e){let t=``;try{let n=`${v}:${new URL(e,window.location.href).href.replace(/\/$/,``)}`;t=localStorage.getItem(n)??localStorage.getItem(v)??``;for(let e of Object.keys(localStorage))e.startsWith(v)&&localStorage.removeItem(e)}catch{return}t&&await x(e,t).catch(()=>!1)}async function w(e,t){let n=await fetch(y(e,`/settings`),{credentials:`include`,cache:`no-store`,signal:t??AbortSignal.timeout(1e4)});if(n.status===401)return null;if(!n.ok)throw Error(`Could not connect to the ORC API. Try again.`);let r=await n.json();if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`The server did not return an ORC access check. Check the API connection.`);let i=r;if(i.theme!==void 0&&i.theme!==`dark`&&i.theme!==`light`||i.terminal_font!==void 0&&typeof i.terminal_font!=`string`)throw Error(`The server returned invalid workspace preferences.`);return i}var T=e=>{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},E=e=>Math.floor(new Date(`${e}T23:59:59`).getTime()/1e3);async function D(e,t,n){let r=await fetch(y(e,`/auth/token`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:t,expires_at:n})}),i=await r.json().catch(()=>null);if(r.status===401)throw Error(`Incorrect API secret.`);if(!r.ok||!i)throw Error(i?.error??`Could not create a token. Try again.`);return i}var O=()=>localStorage.getItem(`orc_api_url`)??`/api`,k=class extends Error{status;code;constructor(e,t,n){super(e),this.status=t,this.code=n,this.name=`ApiError`}},A=`human`;function j(e,t,n=O(),r=window.location){let i=`/terminals/${encodeURIComponent(e)}/ws?ticket=${encodeURIComponent(t)}`,a=n.replace(/\/+$/,``);if(/^https?:\/\//i.test(a))return`${a.replace(/^http/i,`ws`)}${i}`;let o=r.protocol===`https:`?`wss:`:`ws:`,s=a.startsWith(`/`)||a===``?a:`/${a}`;return`${o}//${r.host}${s}${i}`}var M=encodeURIComponent;function N(){return{"X-Orc-Source":`ui`}}function P(e,t={}){let n=new Headers(t.headers);for(let[e,t]of Object.entries(N()))n.has(e)||n.set(e,t);return fetch(`${O()}${e.startsWith(`/`)?e:`/${e}`}`,{credentials:`include`,...t,headers:n})}async function F(e,t,n,r,i){let a=`${O()}${t}`;if(r){let e=new URLSearchParams;for(let[t,n]of Object.entries(r))n!==void 0&&e.set(t,String(n));let t=e.toString();t&&(a+=`?${t}`)}let o={"Content-Type":`application/json`,...N(),...i?.headers},s=await fetch(a,{method:e,headers:o,credentials:`include`,signal:i?.signal,...n===void 0?{}:{body:JSON.stringify(n)}});if(s.status===401&&window.dispatchEvent(new Event(_)),s.status===204||s.status===404&&i?.nullOn404)return null;let c=await s.json();if(!s.ok){let e=c;throw new k(typeof e.error==`string`?e.error:`HTTP ${s.status}`,s.status,typeof e.code==`string`?e.code:null)}return c}var I={preview:{session:e=>F(`GET`,`/desktop-preview/session`,void 0,{session_id:e}),register:(e,t,n,r,i=!1)=>F(`POST`,`/desktop-preview/clients`,{client_id:e,session_id:t,agent_access:n,browser_ready:i},void 0,{headers:r?{"X-Preview-Lease":r}:{}}),pending:(e,t)=>F(`GET`,`/desktop-preview/clients/${M(e)}/requests`,void 0,void 0,{headers:{"X-Preview-Lease":t}}),ack:(e,t,n,r,i=null,a)=>F(`POST`,`/desktop-preview/requests/${M(e)}/ack`,{client_id:t,status:r,error:i,...a===void 0?{}:{result:a}},void 0,{headers:{"X-Preview-Lease":n}}),file:(e,t)=>F(`GET`,`/desktop-preview/file`,void 0,{session_id:e,target:t}),save:(e,t,n,r)=>F(`PUT`,`/desktop-preview/file`,{session_id:e,target:t,content:n,original:r})},channels:{notificationPolicy:()=>F(`GET`,`/channels/notification-policy`),saveNotificationPolicy:e=>F(`PUT`,`/channels/notification-policy`,e),notificationDeliveries:()=>F(`GET`,`/channels/notification-deliveries`),notificationPreview:e=>F(`POST`,`/channels/notification-preview`,e),list:()=>F(`GET`,`/channels`),providers:()=>F(`GET`,`/channels/providers`),save:e=>F(`PUT`,`/channels/${M(e.id)}`,e),verify:e=>F(`POST`,`/channels/${M(e)}/verify`),send:e=>F(`POST`,`/channels/messages`,e),pair:e=>F(`POST`,`/channels/${M(e)}/pairings`),pairing:e=>F(`GET`,`/channels/pairings/${M(e)}`),confirmPairing:e=>F(`POST`,`/channels/pairings/${M(e)}/confirm`),manifest:()=>F(`GET`,`/channels/slack-manifest`),routeTest:(e,t)=>F(`POST`,`/channels/${M(e)}/route-test`,t)},push:{config:()=>F(`GET`,`/push/config`),devices:()=>F(`GET`,`/push/subscriptions`),subscribe:e=>F(`POST`,`/push/subscriptions`,e),updateTopics:(e,t)=>F(`PATCH`,`/push/subscriptions/${encodeURIComponent(e)}`,{topics:t}),remove:e=>F(`DELETE`,`/push/subscriptions/${encodeURIComponent(e)}`),test:e=>F(`POST`,`/push/subscriptions/${encodeURIComponent(e)}/test`)},humanRequests:{view:e=>F(`GET`,`/human-requests/${encodeURIComponent(e)}/view`),run:(e,t,n,r)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/run`,{version:t,script:n,values:r}),list:()=>F(`GET`,`/human-requests`),respond:(e,t,n)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/respond`,{version:t,response:n}),cancel:(e,t)=>F(`POST`,`/human-requests/${encodeURIComponent(e)}/cancel`,{version:t})},chat:{capabilities:(e,t)=>F(`GET`,`/chat/capabilities?${new URLSearchParams({agent:e,...t?{threadId:t}:{}})}`),steer:(e,t,n=crypto.randomUUID())=>F(`POST`,`/chat/runs/${e}/steer`,{input:t,requestId:n}),waiting:()=>F(`GET`,`/chat/waiting`),models:(e,t,n,r,i)=>F(`GET`,`/chat/models`,void 0,{agent:e,threadId:t,host:n===null?`__local__`:n,cwd:r,providerId:i}),list:()=>F(`GET`,`/chat/threads`),cancel:e=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/cancel`),get:e=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}`),session:e=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}/session`),refresh:e=>F(`POST`,`/chat/threads/${encodeURIComponent(e)}/refresh`),configure:(e,t)=>F(`PATCH`,`/chat/threads/${encodeURIComponent(e)}/config`,{agentOptions:t}),history:(e,t)=>F(`GET`,`/chat/threads/${encodeURIComponent(e)}/history`,void 0,{before:t}),resume:e=>F(`POST`,`/chat/threads`,{sourceSessionId:e}),fromSetup:e=>F(`POST`,`/chat/threads`,{setup:e}),permission:(e,t,n)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/permission`,{requestId:t,decision:n}),answer:(e,t,n)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/answer`,{requestId:t,answers:n}),permissionMode:(e,t)=>F(`POST`,`/chat/runs/${encodeURIComponent(e)}/permission-mode`,{mode:t})},settings:{providers:{get:()=>F(`GET`,`/settings/providers`),save:e=>F(`PUT`,`/settings/providers`,e)},usageHistory:e=>F(`GET`,`/usage/history`,void 0,{days:e}),usageQuotas:()=>F(`GET`,`/usage/quotas`),mcp:{get:()=>F(`GET`,`/settings/mcp`),save:e=>F(`PATCH`,`/settings/mcp`,e)},security:{get:()=>F(`GET`,`/settings/security`),save:e=>F(`PATCH`,`/settings/security`,e)},get:()=>F(`GET`,`/settings`),save:e=>F(`PATCH`,`/settings`,e)},search:(e,t)=>F(`GET`,`/search`,void 0,{q:e,project_id:t}),rules:{list:()=>F(`GET`,`/rules`),activate:(e,t,n)=>F(`POST`,`/rules/activate`,{policy:e,expected_id:t,reason:n}),revert:(e,t)=>F(`POST`,`/rules/revert`,{id:e,reason:t})},health:{check:e=>F(`GET`,`/health`,void 0,void 0,{signal:e})},integrations:{connections:()=>F(`GET`,`/integrations/connections`),connection:e=>F(`GET`,`/integrations/connections/${M(e)}`),create:(e,t)=>F(`POST`,`/integrations/connections`,{name:e,source:t}),test:(e,t)=>F(`POST`,`/integrations/connections/test`,{name:e,source:t}),update:(e,t)=>F(`PUT`,`/integrations/connections/${M(e)}`,{source:t}),setEnabled:(e,t)=>F(`PATCH`,`/integrations/connections/${M(e)}`,{enabled:t}),remove:e=>F(`DELETE`,`/integrations/connections/${M(e)}`),refresh:e=>F(`POST`,`/integrations/connections/${M(e)}/refresh`,{}),authorize:(e,t)=>F(`POST`,`/integrations/connections/${M(e)}/authorize`,{redirectUrl:t}),finishAuthorization:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/authorize/callback`,{code:t,state:n}),signOut:e=>F(`DELETE`,`/integrations/connections/${M(e)}/authorize`),tools:e=>F(`GET`,`/integrations/connections/${M(e)}/tools`),tool:(e,t)=>F(`GET`,`/integrations/connections/${M(e)}/tools/${M(t)}`),setToolEnabled:(e,t,n)=>F(`PATCH`,`/integrations/connections/${M(e)}/tools/${M(t)}`,{enabled:n}),invoke:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/tools/${M(t)}/invoke`,{args:n}),resources:e=>F(`GET`,`/integrations/connections/${M(e)}/resources`),readResource:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/resources/read`,{uri:t,vars:n}),prompts:e=>F(`GET`,`/integrations/connections/${M(e)}/prompts`),getPrompt:(e,t,n)=>F(`POST`,`/integrations/connections/${M(e)}/prompts/get`,{prompt:t,arguments:n})},system:{about:()=>F(`GET`,`/system/about`),restart:()=>F(`POST`,`/system/restart`,{})},tasks:{list:e=>F(`GET`,`/tasks`,void 0,e),get:e=>F(`GET`,`/tasks/${e}`),create:e=>F(`POST`,`/tasks`,e),startFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow`,{name:t,start:!0}),update:(e,t)=>F(`PATCH`,`/tasks/${e}`,t),delete:e=>F(`DELETE`,`/tasks/${e}`),addComment:(e,t,n=`human`)=>F(`POST`,`/tasks/${e}/comments`,{content:t,author:n}),listComments:e=>F(`GET`,`/tasks/${e}/comments`),listLinks:e=>F(`GET`,`/tasks/${e}/links`),addLink:(e,t)=>F(`POST`,`/tasks/${e}/links`,t),deleteLink:(e,t)=>F(`DELETE`,`/tasks/${e}/links/${t}`),flow:e=>F(`GET`,`/tasks/${e}/flow`,void 0,void 0,{nullOn404:!0}),resumeFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow/resume`,t),haltFlow:(e,t)=>F(`POST`,`/tasks/${e}/flow/halt`,{reason:t})},backends:{list:()=>F(`GET`,`/backends`)},flows:{list:e=>F(`GET`,`/flows`,void 0,e),get:e=>F(`GET`,`/flows/${encodeURIComponent(e)}`)},memories:{limits:()=>F(`GET`,`/memory-limits`),list:e=>F(`GET`,`/memories`,void 0,e),get:(e,t)=>F(`GET`,`/memories/${encodeURIComponent(t)}`,void 0,{project_id:e}),create:e=>F(`POST`,`/memories`,{...e,author:A}),update:(e,t)=>F(`PATCH`,`/memories/${encodeURIComponent(e)}`,{...t,author:A}),delete:(e,t)=>F(`DELETE`,`/memories/${encodeURIComponent(t)}`,void 0,{project_id:e,author:A}),history:(e,t)=>F(`GET`,`/memories/${encodeURIComponent(t)}/history`,void 0,{project_id:e}),revert:(e,t)=>F(`POST`,`/memories/${encodeURIComponent(e)}/revert`,t),nativeSources:e=>F(`GET`,`/memory-transfer/sources`,void 0,{project_id:e}),previewImport:(e,t)=>F(`POST`,`/memory-transfer/import/preview`,{project_id:e,dir:t}),importNative:(e,t,n)=>F(`POST`,`/memory-transfer/import`,{project_id:e,dir:t,memories:n,author:A}),previewExport:(e,t)=>F(`POST`,`/memory-transfer/export/preview`,{project_id:e,dir:t}),exportNative:(e,t,n,r)=>F(`POST`,`/memory-transfer/export`,{project_id:e,dir:t,names:n,overwrite:r})},scratchpads:{list:e=>F(`GET`,`/scratchpads`,void 0,e),get:e=>F(`GET`,`/scratchpads/${M(e)}`),create:e=>F(`POST`,`/scratchpads`,{...e,author:A}),update:(e,t)=>F(`PATCH`,`/scratchpads/${M(e)}`,{...t,author:A}),delete:e=>F(`DELETE`,`/scratchpads/${M(e)}`)},jobs:{nativeSession:(e,t)=>F(`GET`,`/jobs/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/session`),list:e=>F(`GET`,`/jobs`,void 0,e),listAll:async e=>{let t=[],n=0;for(;;){let r=await I.jobs.list({...e,limit:e?.limit??100,offset:n});if(t.push(...r.jobs),r.next_offset==null)return{jobs:t};if(!Number.isSafeInteger(r.next_offset)||r.next_offset<=n)throw Error(`Invalid job pagination response`);n=r.next_offset}},get:e=>F(`GET`,`/jobs/${e}`),create:e=>F(`POST`,`/jobs`,e),update:(e,t)=>F(`PATCH`,`/jobs/${e}`,t),delete:e=>F(`DELETE`,`/jobs/${e}`),trigger:e=>F(`POST`,`/jobs/${e}/trigger`),runs:(e,t=10)=>F(`GET`,`/jobs/${e}/runs`,void 0,{limit:t}),runLogs:(e,t,n)=>F(`GET`,`/jobs/${e}/runs/${t}/logs`,void 0,n)},webhooks:{list:e=>F(`GET`,`/webhooks`,void 0,{project_id:e}),create:e=>F(`POST`,`/webhooks`,e),update:(e,t)=>F(`PATCH`,`/webhooks/${e}`,t),delete:e=>F(`DELETE`,`/webhooks/${e}`),rotate:e=>F(`POST`,`/webhooks/${e}/rotate-secret`),deliveries:e=>F(`GET`,`/webhooks/${e}/deliveries`)},projects:{syncGithub:e=>F(`POST`,`/projects/${encodeURIComponent(e)}/github-sync`),list:e=>F(`GET`,`/projects`,void 0,e),listAll:async e=>{let t=[],n=0;for(;;){let r=await I.projects.list({...e,limit:100,offset:n});if(t.push(...r.projects),r.next_offset==null)return{projects:t};if(!Number.isSafeInteger(r.next_offset)||r.next_offset<=n)throw Error(`Invalid project pagination response`);n=r.next_offset}},get:e=>F(`GET`,`/projects/${e}`),getByName:e=>F(`GET`,`/projects/by-name/${encodeURIComponent(e)}`),summary:e=>F(`GET`,`/projects/${e}/summary`),create:e=>F(`POST`,`/projects`,e),update:(e,t)=>F(`PATCH`,`/projects/${e}`,t),delete:e=>F(`DELETE`,`/projects/${e}`),addComment:(e,t,n=`human`)=>F(`POST`,`/projects/${e}/comments`,{content:t,author:n}),listComments:e=>F(`GET`,`/projects/${e}/comments`)},sessions:{cacheUsage:e=>F(`GET`,`/sessions/live/${encodeURIComponent(e)}/cache`),archive:e=>F(`GET`,`/sessions/archive`,void 0,e),archiveUpload:e=>F(`POST`,`/sessions/archive/upload`,e),archiveIndex:e=>F(`POST`,`/sessions/archive/index`,{project_id:e}),archiveTranscript:(e,t)=>F(`GET`,`/sessions/archive/${e}/transcript`,void 0,t),archiveResume:(e,t)=>F(`POST`,`/sessions/archive/${e}/resume`,t),list:e=>F(`GET`,`/sessions`,void 0,e),get:e=>F(`GET`,`/sessions/${e}`),sync:()=>F(`POST`,`/sessions/live/sync`),search:e=>F(`GET`,`/sessions/live/search`,void 0,e),transcript:(e,t)=>F(`GET`,`/sessions/live/${e}/transcript`,void 0,t),live:e=>F(`GET`,`/sessions/live`,void 0,e),linkTask:(e,t)=>F(`PATCH`,`/sessions/live/${e}`,{task_id:t}),messages:e=>F(`GET`,`/sessions/live/${encodeURIComponent(e)}/messages`),sendMessage:(e,t)=>F(`POST`,`/sessions/live/${encodeURIComponent(e)}/messages`,{body:t}),cancelMessage:e=>F(`POST`,`/session-messages/${encodeURIComponent(e)}/cancel`),moveMessage:(e,t)=>F(`POST`,`/session-messages/${encodeURIComponent(e)}/move`,{direction:t})},skills:{visibility:()=>F(`GET`,`/skills/settings/visibility`),setVisibility:e=>F(`PUT`,`/skills/settings/visibility`,e),updateInstructions:(e,t)=>F(`PUT`,`/skills/${encodeURIComponent(e)}/instructions`,t),history:(e,t={})=>F(`GET`,`/skills/${encodeURIComponent(e)}/history`,void 0,t),revert:(e,t)=>F(`POST`,`/skills/${encodeURIComponent(e)}/revert`,t),discover:e=>F(`POST`,`/skills/discover`,{source:e}),import:e=>F(`POST`,`/skills/import`,e),origin:e=>F(`GET`,`/skills/${encodeURIComponent(e)}/origin`),localAgents:e=>F(`GET`,`/skills/local-agents`,void 0,e?{path:e}:void 0),projectFolders:()=>F(`GET`,`/skills/project-folders`),importLocal:(e,t)=>F(`POST`,`/skills/local-agents/import`,{skills:e,...t?{folder:t}:{}}),previewExport:e=>F(`POST`,`/skills/export/preview`,{target:e}),exportTo:(e,t,n)=>F(`POST`,`/skills/export`,{target:e,names:t,overwrite:n}),delete:e=>F(`DELETE`,`/skills/${encodeURIComponent(e)}`),sync:(e,t={})=>F(`POST`,`/skills/${encodeURIComponent(e)}/sync`,t),editFile:(e,t)=>F(`PUT`,`/skills/${encodeURIComponent(e)}/file`,t),list:e=>F(`GET`,`/skills`,void 0,e),get:(e,t,n={})=>F(`GET`,`/skills/${encodeURIComponent(e)}`,void 0,{...n,ref:t}),projects:e=>F(`GET`,`/skills/${encodeURIComponent(e)}/projects`),create:e=>F(`POST`,`/skills`,e)},agents:{list:()=>F(`GET`,`/agents`),get:e=>F(`GET`,`/agents/${encodeURIComponent(e)}`),create:e=>F(`POST`,`/agents`,e),delete:e=>F(`DELETE`,`/agents/${encodeURIComponent(e)}`),update:(e,t)=>F(`PUT`,`/agents/${encodeURIComponent(e)}`,t)},agentPackages:{delete:(e,t)=>F(`DELETE`,`/agent-packages/${encodeURIComponent(e)}`,{expectedRevision:t}),acquire:e=>F(`POST`,`/agent-packages/acquire`,{source:e}),importAcquired:e=>F(`POST`,`/agent-packages/import-acquired`,e),list:()=>F(`GET`,`/agent-packages`),get:(e,t)=>F(`GET`,`/agent-packages/${encodeURIComponent(e)}`,void 0,t?{ref:t}:void 0),create:e=>F(`POST`,`/agent-packages`,e),update:(e,t)=>F(`PUT`,`/agent-packages/${encodeURIComponent(e)}`,t),discover:e=>F(`POST`,`/agent-packages/discover`,{source:e}),importGit:e=>F(`POST`,`/agent-packages/import-git`,e),exportArtifact:e=>F(`POST`,`/agent-packages/${encodeURIComponent(e)}/export`)},agentSetups:{list:()=>F(`GET`,`/agent-setups`),create:e=>F(`POST`,`/agent-setups`,e),command:e=>F(`POST`,`/agent-setups/command`,e)},packageTools:{list:e=>F(`GET`,`/package-tools`,void 0,e===void 0?void 0:{host:e??``})},audit:{list:(e={})=>F(`GET`,`/audit`,void 0,e)},notifications:{list:(e={})=>F(`GET`,`/notifications`,void 0,e),update:(e,t)=>F(`PATCH`,`/notifications/${encodeURIComponent(e)}`,t),markAllRead:()=>F(`POST`,`/notifications/read`)},kb:{list:(e={})=>F(`GET`,`/kb/bases`,void 0,e),get:e=>F(`GET`,`/kb/bases/${M(e)}`),create:e=>F(`POST`,`/kb/bases`,e),update:(e,t)=>F(`PATCH`,`/kb/bases/${M(e)}`,t),remove:e=>F(`DELETE`,`/kb/bases/${M(e)}`),usage:e=>F(`GET`,`/kb/bases/${M(e)}/usage`),maintenance:e=>F(`GET`,`/kb/bases/${M(e)}/maintenance`),documents:e=>F(`GET`,`/kb/bases/${M(e)}/documents`),createDocument:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/documents`,t),upload:(e,t,n)=>{let r=new FormData;return r.set(`file`,t.file,t.file.name),t.title&&r.set(`title`,t.title),t.path&&r.set(`path`,t.path),t.labels?.length&&r.set(`labels`,t.labels.join(`,`)),t.document_id&&r.set(`document_id`,t.document_id),t.expected_revision!==void 0&&r.set(`expected_revision`,String(t.expected_revision)),new Promise((t,i)=>{let a=new XMLHttpRequest;a.open(`POST`,`${O()}/kb/bases/${M(e)}/upload`),a.withCredentials=!0;for(let[e,t]of Object.entries(N()))a.setRequestHeader(e,t);a.upload.onprogress=e=>{e.lengthComputable&&n?.(e.loaded/e.total)},a.onerror=()=>i(new k(`Upload failed: network error`,0,null)),a.onload=()=>{let e=null;try{e=JSON.parse(a.responseText)}catch{}if(a.status>=200&&a.status<300)return t(e);let n=e??{};i(new k(typeof n.error==`string`?n.error:`HTTP ${a.status}`,a.status,typeof n.code==`string`?n.code:null))},a.send(r)})},document:(e,t={})=>F(`GET`,`/kb/documents/${M(e)}`,void 0,t),updateDocument:(e,t)=>F(`PATCH`,`/kb/documents/${M(e)}`,t),removeDocument:e=>F(`DELETE`,`/kb/documents/${M(e)}`),revisions:e=>F(`GET`,`/kb/documents/${M(e)}/revisions`),revision:(e,t)=>F(`GET`,`/kb/documents/${M(e)}/revisions/${t}`),original:async e=>{let t=await P(`/kb/documents/${M(e)}/original`);if(!t.ok)throw new k(`HTTP ${t.status}`,t.status,null);return t.blob()},reparse:e=>F(`POST`,`/kb/documents/${M(e)}/reparse`),documentUsage:e=>F(`GET`,`/kb/documents/${M(e)}/usage`),citation:e=>F(`GET`,`/kb/citations/${M(e)}`),comments:(e,t={})=>F(`GET`,`/kb/bases/${M(e)}/comments`,void 0,t),addComment:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/comments`,t),closeComment:(e,t)=>F(`POST`,`/kb/comments/${M(e)}/close`,t),reopenComment:e=>F(`POST`,`/kb/comments/${M(e)}/reopen`),digestTemplate:()=>F(`GET`,`/kb/digest-template`),digest:e=>F(`GET`,`/kb/bases/${M(e)}/digest`),setDigest:(e,t)=>F(`PUT`,`/kb/bases/${M(e)}/digest`,t),removeDigest:(e,t)=>F(`DELETE`,`/kb/bases/${M(e)}/digest`,void 0,{confirm:t}),runDigest:e=>F(`POST`,`/kb/bases/${M(e)}/digest/run`),digestRuns:(e,t)=>F(`GET`,`/kb/bases/${M(e)}/digest/runs`,void 0,{limit:t}),search:(e,t)=>F(`POST`,`/kb/search`,e,{project_id:t}),sources:e=>F(`GET`,`/kb/bases/${M(e)}/sources`),addSource:(e,t)=>F(`POST`,`/kb/bases/${M(e)}/sources`,t),scanSource:e=>F(`POST`,`/kb/sources/${M(e)}/scan`),removeSource:e=>F(`DELETE`,`/kb/sources/${M(e)}`),status:()=>F(`GET`,`/kb/status`),settings:()=>F(`GET`,`/kb/settings`),updateSettings:e=>F(`PATCH`,`/kb/settings`,e),parsers:()=>F(`GET`,`/kb/parsers`),installDocling:()=>F(`POST`,`/kb/parsers/docling/install`),uninstallDocling:()=>F(`DELETE`,`/kb/parsers/docling`)},tags:{list:e=>F(`GET`,`/tags`,void 0,e)},terminals:{list:e=>F(`GET`,`/terminals`,void 0,{host:e===null?``:e}),create:e=>F(`POST`,`/terminals`,e),get:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}`),rename:(e,t)=>F(`PATCH`,`/terminals/${encodeURIComponent(e)}`,{name:t}),remove:e=>F(`DELETE`,`/terminals/${encodeURIComponent(e)}`),ticket:e=>F(`POST`,`/terminals/${encodeURIComponent(e)}/ticket`),pickFolder:(e,t)=>F(`POST`,`/terminals/pick-folder`,{initial:e,host:t}),browse:(e,t)=>F(`GET`,`/terminals/browse`,void 0,{path:e,host:t===null?``:t}),createFolder:(e,t,n)=>F(`POST`,`/terminals/browse/folders`,{host:e,parent:t,name:n})},workspaces:{list:(e={})=>F(`GET`,`/workspaces`,void 0,e),byPath:async e=>(await F(`GET`,`/workspaces`,void 0,{path:e})).workspaces[0]??null},ssh:{get:()=>F(`GET`,`/ssh`),select:(e,t)=>F(`PUT`,`/ssh`,{host:e,...t===void 0?{}:{remote_port:t}}),test:e=>F(`POST`,`/ssh/test`,e?{host:e}:{})},git:{status:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/status`),diff:(e,t,n)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/diff`,void 0,{staged:t?`1`:`0`,path:n}),terminalWorktrees:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/worktrees`),stage:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/stage`,{paths:t}),switchBranch:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/switch`,{branch:t}),checkoutGithub:e=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/github`),pullReview:(e,t)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/git/pulls/${t}`),postPullComment:(e,t,n)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/pulls/${t}/comments`,n),saveFile:(e,t,n,r)=>F(`PUT`,`/terminals/${encodeURIComponent(e)}/files`,{path:t,content:n,original:r}),files:(e,t)=>F(`GET`,`/terminals/${encodeURIComponent(e)}/files`,void 0,{path:t}),commit:(e,t)=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/commit`,{message:t}),addWorktree:e=>F(`POST`,`/terminals/${encodeURIComponent(e)}/git/worktrees`),githubItems:(e,t)=>F(`GET`,`/github/items`,void 0,{filter:e,project_id:t}),registry:e=>F(`GET`,`/git/registry`,void 0,{project_id:e}),registryPulls:e=>F(`GET`,`/git/registry/pulls`,void 0,{project_id:e}),cleanup:e=>F(`POST`,`/git/worktrees/cleanup`,{items:e}),worktrees:(e,t)=>F(`GET`,`/git/worktrees`,void 0,{cwd:e,host:t===null?``:t}),removeWorktree:e=>F(`POST`,`/git/worktrees/remove`,e)},gateway:{status:()=>F(`GET`,`/gateway/status`),send:e=>F(`POST`,`/gateway/send`,e)}};export{j as a,D as c,b as d,x as f,g as h,O as i,E as l,T as m,I as n,_ as o,S as p,P as r,w as s,k as t,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./client-
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";var t={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{n as r,r as i,t as a}from"./MarkdownRenderer-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{n as r,r as i,t as a}from"./MarkdownRenderer-CHALCapQ.js";var o=e(t(),1),s=n(),c=({code:e,isIncomplete:t=!1,language:n,maxHeight:c,raw:l,className:u,startLine:d,lineNumbers:f,...p})=>{let{shikiTheme:m}=(0,o.useContext)(r),h=i(),[g,_]=(0,o.useState)(l);return(0,o.useEffect)(()=>{if(!h){_(l);return}let r=!0,i=h.highlight({code:e,isIncomplete:t,language:n,themes:m},e=>{r&&_(e)});return i&&_(i),()=>{r=!1}},[e,t,n,m,h,l]),(0,s.jsx)(a,{className:u,language:n,lineNumbers:f,maxHeight:c,result:g,startLine:d,...p})};export{c as HighlightedCodeBlockBody};
|