@open-mercato/cezar 0.20.0-pr2192.5251 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/agent-setup-routes.d.ts +14 -14
- package/dist/server/dashboard.d.ts +54 -54
- package/dist/server/server.d.ts +68 -68
- package/dist/server/worktree-lifecycle.d.ts +90 -90
- package/dist/telemetry-service.json +1 -0
- package/dist/workflows/run-env-keys.d.ts +8 -0
- package/dist/workflows/run-env-keys.js +14 -0
- package/dist/workflows/run-env-keys.js.map +1 -0
- package/package.json +5 -5
- package/web/dist/assets/{active-forge-KyXM3uG9.js → active-forge-CkAcQPDz.js} +1 -1
- package/web/dist/assets/{agent-task-pickers-UkVtTCna.js → agent-task-pickers-BXCIulS3.js} +1 -1
- package/web/dist/assets/{alert-dialog-DT465VL4.js → alert-dialog-B2Vi6MQZ.js} +1 -1
- package/web/dist/assets/{ask-card-DVv8mY_R.js → ask-card-DPIjQSs8.js} +1 -1
- package/web/dist/assets/{assets-view-D22vr-oN.js → assets-view-CsFjfV2n.js} +1 -1
- package/web/dist/assets/{automation-format-KxcnBz7L.js → automation-format-CMG-6CYi.js} +1 -1
- package/web/dist/assets/{automations-route-3gfbxDq2.js → automations-route-Dd7F6b4F.js} +1 -1
- package/web/dist/assets/{button-CEskWahs.js → button-CJXK1JqU.js} +1 -1
- package/web/dist/assets/{centered-state-Cpzaj75Y.js → centered-state-DE6sgEMs.js} +1 -1
- package/web/dist/assets/{chip-CEZRGBV7.js → chip-DTCkrr8F.js} +1 -1
- package/web/dist/assets/{collapsible-ZLdkcdMa.js → collapsible-DHALizq-.js} +1 -1
- package/web/dist/assets/{command-CcbuBum7.js → command-CwP_dLx3.js} +1 -1
- package/web/dist/assets/{commit-list-BSjLQA6p.js → commit-list-BJeaIEp4.js} +1 -1
- package/web/dist/assets/{compare-variants-C9soYpuE.js → compare-variants-CYv97XSw.js} +1 -1
- package/web/dist/assets/{composer-Bz8ZfbHr.js → composer-C-aBJhY0.js} +1 -1
- package/web/dist/assets/{composer-attachments-BD2enHFJ.js → composer-attachments-ChelZhq4.js} +1 -1
- package/web/dist/assets/{dashboard-Bl6qWW8i.js → dashboard-Dh65_Yi7.js} +1 -1
- package/web/dist/assets/{dialog-nn9sCNvn.js → dialog-DVZE8yAO.js} +1 -1
- package/web/dist/assets/{diff-FrEDv09S.js → diff-aKT-mpn8.js} +2 -2
- package/web/dist/assets/{diff-stat-zisAayZW.js → diff-stat-DPetRUXO.js} +1 -1
- package/web/dist/assets/{diff-view-BeoeZVcx.js → diff-view-m4TvXu0y.js} +1 -1
- package/web/dist/assets/{dist-B_KqW6o6.js → dist-Bsi6zLdE.js} +1 -1
- package/web/dist/assets/{dropdown-menu-ayNafd3n.js → dropdown-menu-BKvUsb5Y.js} +1 -1
- package/web/dist/assets/{file-preview-Dzc3RFUx.js → file-preview-C2EkjhOh.js} +1 -1
- package/web/dist/assets/{follow-up-engine-Dul_3U9s.js → follow-up-engine-BnRCTyQ4.js} +1 -1
- package/web/dist/assets/{git-tab-loading-DG4p-eF4.js → git-tab-loading-DpG2D8Vl.js} +1 -1
- package/web/dist/assets/{github-DvZE0hDJ.js → github-CWRtsamJ.js} +1 -1
- package/web/dist/assets/{host-usage-GTjB03IM.js → host-usage-B8ohHYHR.js} +1 -1
- package/web/dist/assets/{icon-tooltip-DRhwcic2.js → icon-tooltip-DYk5cjLx.js} +1 -1
- package/web/dist/assets/{impact-control-CTdtyfcn.js → impact-control-ClslFBBA.js} +1 -1
- package/web/dist/assets/{impact-model-CpNcUgTV.js → impact-model-DCDyRxcf.js} +1 -1
- package/web/dist/assets/{index-BMA7ZpLG.js → index-BfbbA0lF.js} +4 -4
- package/web/dist/assets/{input-BtDLUR9Q.js → input-DofKzJZl.js} +1 -1
- package/web/dist/assets/{loading-state-BTvZxCb2.js → loading-state-NiNQtJ5H.js} +1 -1
- package/web/dist/assets/{manager-avatar-Ct1uVuvZ.js → manager-avatar-CKfqcoJQ.js} +1 -1
- package/web/dist/assets/{manager-chat-BfxPyXv3.js → manager-chat-BdigDKYZ.js} +1 -1
- package/web/dist/assets/{manager-index-CeMdRtKd.js → manager-index-D0TOmxr6.js} +1 -1
- package/web/dist/assets/{manager-new-Bs8_CMUR.js → manager-new-CCet_7u8.js} +1 -1
- package/web/dist/assets/{manager-settings-Bv2EqZvs.js → manager-settings-I1AeATjr.js} +1 -1
- package/web/dist/assets/{managers-DDPXJoKR.js → managers-Dr63u21Y.js} +1 -1
- package/web/dist/assets/{markdown-3rt1rOmI.js → markdown-CXJIKz2i.js} +1 -1
- package/web/dist/assets/{markdown-LlPZylt7.js → markdown-YSf01kqC.js} +1 -1
- package/web/dist/assets/{mascot-picker-BuGxdrpW.js → mascot-picker-C4s7n9Fc.js} +1 -1
- package/web/dist/assets/{new-task-form-BoiK41PS.js → new-task-form-2p4cXcVQ.js} +1 -1
- package/web/dist/assets/{picker-pill-CzANlEqt.js → picker-pill-Dv9H0dRF.js} +1 -1
- package/web/dist/assets/{pill-C2wRS9lg.js → pill-CoDPUIcJ.js} +1 -1
- package/web/dist/assets/{popover-DPba6FvD.js → popover-DUg9gBOn.js} +1 -1
- package/web/dist/assets/{project-router-CnMbTz-a.js → project-router-B1Q3upIJ.js} +1 -1
- package/web/dist/assets/{project-terminal-sfYncenW.js → project-terminal-DbIohh5G.js} +2 -2
- package/web/dist/assets/{provider-auth-alert-DbNH_-XT.js → provider-auth-alert-GxIEkIvw.js} +1 -1
- package/web/dist/assets/{queries-DVZ1lYAo.js → queries-BQUz3Wnb.js} +1 -1
- package/web/dist/assets/{reasoning-effort-pill-al6bbPpw.js → reasoning-effort-pill-BOV3C0If.js} +1 -1
- package/web/dist/assets/{reference-chip-DdxKs2_A.js → reference-chip-BpbybBvl.js} +1 -1
- package/web/dist/assets/{reference-conflict-action-Ci4LDmIm.js → reference-conflict-action-ByDYwT-Y.js} +1 -1
- package/web/dist/assets/{repo-git-BcEGYBrc.js → repo-git-ikURCYEK.js} +1 -1
- package/web/dist/assets/{run-actions-CDKK-8MP.js → run-actions-ChUnbFA7.js} +1 -1
- package/web/dist/assets/{run-diff-JJOUeclX.js → run-diff-B08Fk7dR.js} +1 -1
- package/web/dist/assets/{scroll-within-CfS_Ia4E.js → scroll-within-DMA4ZbQV.js} +1 -1
- package/web/dist/assets/{segmented-Chb1Y4ie.js → segmented-DI7abdqX.js} +1 -1
- package/web/dist/assets/{select-DG3hFvx2.js → select-DL5E3ZAD.js} +1 -1
- package/web/dist/assets/{sheet-DirfZrZD.js → sheet-DPwaj6sk.js} +1 -1
- package/web/dist/assets/{skills-CxWFZgjH.js → skills-BNiKFlUw.js} +1 -1
- package/web/dist/assets/{spinner-CwKcijCN.js → spinner-hSpq0sPM.js} +1 -1
- package/web/dist/assets/{status-dot-CZAbXsOs.js → status-dot-AP_4obOJ.js} +1 -1
- package/web/dist/assets/{tabs-r4PCzkHp.js → tabs-DrhZb97I.js} +1 -1
- package/web/dist/assets/{task-commits-CHnonzuD.js → task-commits-Di0Mc8MX.js} +1 -1
- package/web/dist/assets/{task-graph-DZAjkdmH.js → task-graph-Bpi3lEER.js} +1 -1
- package/web/dist/assets/{task-notes-CHs_WZf5.js → task-notes-DCHLinAF.js} +1 -1
- package/web/dist/assets/{task-workspace-DWGBLHlR.js → task-workspace-DHl5akxu.js} +3 -3
- package/web/dist/assets/{telemetry-onLa6CTl.js → telemetry-3DhVDxf8.js} +1 -1
- package/web/dist/assets/{terminal-drawer-DV7kUP0D.js → terminal-drawer-CEktqC3z.js} +1 -1
- package/web/dist/assets/{terminal-pane-DQAHtCtb.js → terminal-pane-CmmTwiTX.js} +1 -1
- package/web/dist/assets/{terminal-scope-CEQdw5Tz.js → terminal-scope-okFE6qRP.js} +1 -1
- package/web/dist/assets/{textarea-BqeSvPOp.js → textarea-DDyYxCcO.js} +1 -1
- package/web/dist/assets/{thread-items-CNxMLcOo.js → thread-items-C-4IW5zi.js} +1 -1
- package/web/dist/assets/{toaster-4t61QM_C.js → toaster-BoJZiTRl.js} +1 -1
- package/web/dist/assets/{tracker-B7u8exjG.js → tracker-bQUG9SkJ.js} +1 -1
- package/web/dist/assets/{tree-pane-resize-XHzIJDtc.js → tree-pane-resize-xgVK7J9r.js} +1 -1
- package/web/dist/assets/utils-Dp6vCdiU.js +55 -0
- package/web/dist/assets/{workflow-graph-BaZd6m6v.js → workflow-graph-CGMeFErv.js} +1 -1
- package/web/dist/assets/{worktree-lifecycle-YFVatYLd.js → worktree-lifecycle-C18dBDW4.js} +1 -1
- package/web/dist/assets/{worktree-lifecycle-operation-CYHhFvQF.js → worktree-lifecycle-operation-_xqKBVKB.js} +1 -1
- package/web/dist/assets/{zoomable-image-D4B6jvp-.js → zoomable-image-BiM5LfTG.js} +1 -1
- package/web/dist/index.html +46 -46
- package/web/dist/assets/utils-DWwoYTjU.js +0 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Xr as e,Yr as t,d as n,pn as r,pt as i,s as a,xo as o,yo as s}from"./queries-
|
|
1
|
+
import{Xr as e,Yr as t,d as n,pn as r,pt as i,s as a,xo as o,yo as s}from"./queries-BQUz3Wnb.js";import{$ as c,Lt as l,Y as u}from"./utils-Dp6vCdiU.js";import{o as d}from"./host-usage-B8ohHYHR.js";import{t as f}from"./provider-auth-alert-GxIEkIvw.js";function p(){let e=n(),t=i(),r=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),a=t.data?.info?.root;return{accounts:r,repoAccount:m(a?e.data?.selections?.[a]:void 0,e.data?.defaults)}}function m(e,t){let n={};for(let r of[t,e])for(let[e,t]of Object.entries(r??{}))t&&(n[e]=t);return Object.keys(n).length>0?n:void 0}function h(e,t){return`${f[e]} account "${t.replace(/"/g,``)}" is not signed in. Sign it in under Settings → Agents → Accounts, or choose another account for this task.`}function g(t,i){let s=o(),c=n().data?.profiles.find(e=>e.provider===t&&e.id===i&&!e.isDefault),l=c?u(c):``,d=c?.status,f=a(l,c!==void 0&&d?.status!==`connected`).data?.status??(d?.status===`connected`?d:void 0),p=e=>c&&e!==void 0&&e!==`connected`?h(t,c.label||c.id):null;return{blocked:p(f?.status),verify:async()=>{if(!c)return null;try{let t=await e(l,{refresh:!0});return s.setQueryData(r.agentAccountStatus(l),t),p(t.status.status)}catch{return null}}}}function _(e,t){return e.filter(e=>e.provider===t).length>1}function v(e,i){let a=n(),{repoAccount:o}=p(),c=d()===`local`,l=((e.runner??`claude`)===`claude`?e.agentProfile:void 0)??o?.claude,f=a.data?.profiles.find(e=>e.provider===`claude`&&(l?e.id===l:e.isDefault)),m=f?u(f):``;return s({queryKey:r.agentAccountDetails(m),queryFn:({signal:e})=>t(m,{signal:e}),enabled:i&&c&&m!==``,staleTime:5*6e4,retry:!1}).data}var y=`quick-task`;function b(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var x=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`junie`,label:`junie`,desc:`JetBrains Junie CLI`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`cursor`,label:`cursor`,desc:`Cursor Agent CLI`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`copilot`,label:`copilot`,desc:`GitHub Copilot CLI (ACP)`},{id:`omp`,label:`omp`,desc:`OMP (RPC)`},{id:`antigravity`,label:`antigravity`,desc:`Google Antigravity CLI (agy)`},{id:`gemini`,label:`gemini`,desc:`Gemini CLI (ACP)`},{id:`kimi`,label:`kimi`,desc:`Kimi Code (ACP)`}],S={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`fable`,label:`fable`,desc:`Most capable, for the hardest tasks`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],junie:[{id:``,label:`auto`,desc:`Use your Junie default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`},{id:`anthropic/claude-opus-4-8`,label:`claude-opus-4.8`,desc:`via Anthropic`},{id:`anthropic/claude-sonnet-5`,label:`claude-sonnet-5`,desc:`via Anthropic`},{id:`openai/gpt-5.1`,label:`gpt-5.1`,desc:`via OpenAI`}],copilot:[{id:``,label:`auto`,desc:`Let Copilot pick the model`}],omp:[{id:``,label:`auto`,desc:`Use your omp default model`}],antigravity:[{id:``,label:`auto`,desc:`Use your Antigravity default model`}],gemini:[{id:``,label:`auto`,desc:`Use your Gemini CLI default model`},{id:`gemini-3.5-flash`,label:`gemini-3.5-flash`,desc:`Fast; available on a free API key`},{id:`gemini-3-flash-preview`,label:`gemini-3-flash-preview`,desc:`Preview Flash model`},{id:`gemini-3.1-flash-lite`,label:`gemini-3.1-flash-lite`,desc:`Fastest, cheapest`},{id:`gemini-2.5-pro`,label:`gemini-2.5-pro`,desc:`Deeper reasoning (paid tiers)`}],kimi:[{id:``,label:`auto`,desc:`Use your Kimi default model`}]},C={claude:/^claude[-.]/,codex:/^gpt[-.]/,gemini:/^gemini[-.]/},w=[`opencode`,`pi`],T=[`copilot`,`cursor`];function E(e,t){return!e||S[t].some(t=>t.id===e)||C[t]?.test(e)||T.includes(t)&&Object.values(C).some(t=>t.test(e))?!1:Object.entries(S).some(([n,r])=>n!==t&&!w.includes(n)&&r.some(t=>t.id!==``&&t.id===e))||Object.entries(C).some(([n,r])=>n!==t&&r.test(e))}function D(e,t,n=[]){let r=S[e]??S.claude,i=c(e)?t?.models??[]:[],a=i.length>0?[O(r)]:[...r],o=new Set(a.map(e=>e.id));for(let e of i)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||E(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}function O(e){return e.find(e=>e.id===``)??{id:``,label:`auto`,desc:``}}var k={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,junie:`Junie`,cursor:`Cursor`,antigravity:`Antigravity`,kimi:`Kimi`};function A(e){return c(e)?k[e]:e}function j(e,t,n=!1){if(!c(e))return;let r=k[e];if(t?.stale)return`Using cached ${r} model list`;if(n||t?.source===`unavailable`)return`Latest ${r} models unavailable`}function M(e,t,n){return!l(e)||t===``||n?.runner!==e?[]:n.models.find(e=>e.id===t)?.reasoningEfforts??[]}function N(e,t,n,r){let i=M(t,n,r);return e!==null&&i.some(t=>t.id===e)?e:``}function P(e){let t=x.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function F(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function I(e,t,n=!1){return!n&&e===t?void 0:e}function L(e,t,n,r){let i=D(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function R(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function z(e,t,n){return e&&R(e,t,n)?e:null}function B(e){let{task:t,source:n,model:r,reasoningEffort:i,modelsLocked:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,variants:u,images:d,worktree:f,newBranch:p,branch:m,autonomous:h,generateFollowups:g,todoId:_,dispatch:v,readOnly:y,inPlaceByDefault:b}=e,x=y===!0&&u<=1&&!v,S=f===!1&&u<=1&&!v&&!x;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:a?void 0:r||void 0,...a||!i?{}:{reasoningEffort:i},runner:I(o,c,s),agentProfile:l||void 0,variants:u>1?u:void 0,images:d.length>0?[...d]:void 0,worktree:x?void 0:f===!1&&u<=1?!1:b&&f!==!1&&u<=1?!0:void 0,...x?{readOnly:!0}:{},...S&&p?{newBranch:!0,...m?.trim()?{branch:m.trim()}:{}}:{},autonomous:h===!0||void 0,generateFollowups:g!==!1&&void 0,todoId:_||void 0,dispatch:v??void 0}}function V(e,t,n){let r=(t?e?.askSkill:e?.defaultSkill)??null;return r&&(n===null||n.some(e=>e.name===r))?{source:`skill`,ref:r}:null}function H(e){return/\?\s*$/.test(e.trim())}function U(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}export{g as S,U as _,H as a,p as b,D as c,M as d,L as f,I as g,z as h,A as i,V as l,F as m,P as n,j as o,N as p,B as r,E as s,x as t,b as u,y as v,v as x,_ as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Dp6vCdiU.js";import{i,o as a,p as o,r as s,s as c,t as l}from"./dropdown-menu-BKvUsb5Y.js";import{t as u}from"./search-BjsZLqse.js";import{n as d,r as f}from"./chip-DTCkrr8F.js";import{t as p}from"./new-task-form-2p4cXcVQ.js";import{t as m}from"./lib-BQXq3kEf.js";var h=e(t(),1),g=n();function _({slot:e,ariaLabel:t,label:n,value:p,options:_,onPick:v,disabled:y=!1,readOnly:b=!1,hint:x,disabledHint:S,status:C,searchPlaceholder:w,className:T}){let[E,D]=(0,h.useState)(!1),[O,k]=(0,h.useState)(``),A=(0,h.useRef)(null),j=(0,h.useRef)(null),M=(0,h.useRef)(null),N=w??(_.length>15?`Search…`:void 0),P=(0,h.useMemo)(()=>{let e=O.trim().toLowerCase();return N&&e?_.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e)):_},[_,O,N]);(0,h.useEffect)(()=>{if(!E||!N)return;let e=window.setTimeout(()=>A.current?.focus());return()=>window.clearTimeout(e)},[E,N]);let F=b?S??x:y?S:x,I=(0,g.jsx)(`span`,{className:`min-w-0 truncate`,children:n});if(b)return(0,g.jsx)(`span`,{"data-slot":e,"aria-label":t,title:F,className:r(f,`min-w-0 max-w-full cursor-default hover:bg-card hover:text-muted-foreground`,T),children:I});let L=e=>(0,g.jsx)(c,{value:e.value,className:`gap-2.5`,children:(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,g.jsx)(`span`,{className:`text-label font-medium`,children:e.label}),e.desc?(0,g.jsx)(`span`,{className:`max-w-[calc(100vw-3rem)] whitespace-normal break-words text-meta text-muted-foreground md:max-w-96`,children:e.desc}):null]})},e.value),R=(0,g.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:y,title:F,className:r(f,`min-w-0 max-w-full`,T),children:[I,d]});return y?(0,g.jsx)(`span`,{title:S,className:`inline-flex min-w-0 max-w-full`,children:R}):(0,g.jsxs)(l,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,g.jsx)(o,{asChild:!0,children:R}),(0,g.jsxs)(s,{ref:j,align:`start`,"data-testid":`${e}-menu`,children:[N?(0,g.jsxs)(`div`,{className:`mb-1 flex h-9 items-center gap-2 border-b border-border px-2`,children:[(0,g.jsx)(u,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,g.jsx)(`input`,{ref:A,type:`search`,"aria-label":N,placeholder:N,value:O,onChange:e=>k(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=j.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else if(e.key===`Enter`&&!e.nativeEvent.isComposing&&O.trim()){e.preventDefault(),e.stopPropagation();let t=P[0];if(!t)return;v(t.value),D(!1),k(``)}else e.key!==`Escape`&&e.stopPropagation()},className:`h-full min-w-48 bg-transparent text-base outline-none placeholder:text-muted-foreground md:text-sm`})]}):null,(0,g.jsx)(a,{value:p,onValueChange:v,children:N?(0,g.jsx)(`div`,{ref:M,className:`max-h-[min(20rem,calc(var(--radix-dropdown-menu-content-available-height)-3.5rem))] overflow-y-auto overscroll-contain`,children:P.length>100?(0,g.jsx)(m,{scrollRef:M,itemSize:30,data:P,children:L}):P.map(L)}):P.map(L)}),N&&P.length===0?(0,g.jsx)(`p`,{className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,C?(0,g.jsx)(i,{disabled:!0,className:`border-t border-border text-meta text-muted-foreground`,children:C}):null]})]})}var v=(e,t)=>t===null?e:`${e}:${t}`;function y({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,className:s}){let c=p.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:v(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:v(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),l=a??o?.[t]??`default`,u=c.some(e=>e.value===v(t,l))?v(t,l):v(t,null);return(0,g.jsx)(_,{slot:`runner-pill`,ariaLabel:`Runner`,label:c.find(e=>e.value===u)?.label??t,value:u,disabled:r,className:s,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:c})}var b=`shrink-0 rounded-r-none border-r-0 pr-1.5`,x=`max-w-[18rem] rounded-l-none pl-1.5`,S=`max-w-[18rem]`;export{S as a,x as i,y as n,b as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-Dp6vCdiU.js";import{t as r}from"./status-dot-AP_4obOJ.js";e();var i=t();function a({className:e,dot:t,pulse:a=!1,children:o,...s}){return(0,i.jsxs)(`span`,{"data-slot":`pill`,className:n(`inline-flex h-5 items-center gap-1.5 rounded-full bg-muted px-2 text-ui font-medium whitespace-nowrap text-muted-foreground`,e),...s,children:[t?(0,i.jsx)(r,{tone:t,pulse:a}):null,o]})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DWwoYTjU.js";import{A as i,C as a,D as o,E as s,I as c,N as l,S as u,T as d,a as f,b as p,i as m,k as h,o as g,r as _,s as v,v as y,x as ee,y as te,z as b}from"./button-CEskWahs.js";var x=e(t(),1),S=n();function C(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)}var w={Slash:`/`,Backslash:`\\`,Period:`.`,Comma:`,`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Minus:`-`,Equal:`=`,Backquote:"`",Enter:`Enter`,Space:`Space`,Backspace:`Backspace`,Delete:`Delete`,Tab:`Tab`,Escape:`Escape`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`};function ne(e){let t=e.code??``;if(/^Key[A-Z]$/.test(t))return t.slice(3);if(/^Digit[0-9]$/.test(t))return t.slice(5);if(/^Numpad[0-9]$/.test(t))return t.slice(6);if(/^F([1-9]|1[0-2])$/.test(t))return t;if(t in w)return w[t];let n=e.key??``;return n.length===1&&n!==` `?n.toUpperCase():null}function re(e,t=C()){if([`Meta`,`Control`,`Alt`,`Shift`,`OS`,`AltGraph`].includes(e.key)||!t&&e.getModifierState?.(`AltGraph`))return null;let n=ne(e);if(!n)return null;let r=[];return(t?e.metaKey:e.ctrlKey)&&r.push(`Mod`),t&&e.ctrlKey&&r.push(`Ctrl`),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),r.push(n),r.join(`+`)}function T(e,t=C()){let n=e.split(`+`),r=n.at(-1)||`+`,i=n.slice(0,-1);if(t){let e={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Mod:`⌘`};return[`Ctrl`,`Alt`,`Shift`,`Mod`].filter(e=>i.includes(e)).map(t=>e[t]).join(``)+r}let a={Mod:`Ctrl`,Alt:`Alt`,Shift:`Shift`};return[...i.map(e=>a[e]??e),r].join(`+`)}function E(e=document){return e.querySelector(`[role="dialog"], [role="alertdialog"], [role="menu"]`)!==null}function D(e,t=C()){if(!e)return;let n=/^Mod\+([1-9])$/.exec(e);return n?n[1]:T(e,t)}var O=new Set("Mod+K.Mod+P.Mod+Shift+P.Mod+N.Mod+Enter.Mod+B.Alt+D.Mod+Shift+`.Alt+Up.Alt+Down.Alt+Shift+Up.Alt+Shift+Down.Mod+A.Mod+C.Mod+V.Mod+X.Mod+Z.Mod+Shift+Z.Mod+F.Mod+L.Mod+R.Mod+T.Mod+W.Mod+Q.Mod+Shift+T.Mod+Shift+N.Mod+Shift+W".split(`.`));function k(e,t=C()){if(!(t||[`Control`,`Alt`,`AltGraph`].includes(e.key))&&(e.getModifierState?.(`AltGraph`)||e.ctrlKey&&e.altKey))return`Ctrl+Alt — types characters on many layouts`}function A(e,t=C()){let n=e.split(`+`).slice(0,-1);if(!n.some(e=>e===`Mod`||e===`Ctrl`||e===`Alt`))return`Use ⌘/Ctrl, ⌃ or ⌥ with the key`;if(!t&&n.includes(`Mod`)&&n.includes(`Alt`))return`Ctrl+Alt types characters on many layouts`;if(O.has(e))return`That shortcut is taken by the browser or cezar`}var j={...Object.fromEntries(Array.from({length:9},(e,t)=>[`tab:${t+1}`,`Mod+${t+1}`])),"terminal-column":`Mod+/`},ie=200;function ae(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(Object.keys(t).length>=ie)break;n.length<1||n.length>120||typeof r==`string`&&O.has(r)||(r===null||typeof r==`string`&&r.length>=1&&r.length<=40)&&(t[n]=r)}return t}function M(e={}){let t=new Map;for(let[n,r]of Object.entries(j))n in e||t.set(n,r);for(let[n,r]of Object.entries(e))r&&t.set(n,r);let n=new Map;for(let[r,i]of t){let t=n.get(i);(t===void 0||r in e&&!(t in e))&&n.set(i,r)}return new Map([...t].filter(([e,t])=>n.get(t)===e))}function N(e,t,n){let r={...e};if(n)for(let[i,a]of M(e))i!==t&&a===n&&(j[i]?r[i]=null:delete r[i]);return n===(j[t]??null)?delete r[t]:r[t]=n,r}function oe(e,t){return N(e,t,j[t]??null)}var se=[{id:`reply`,label:`Write to the agent`,group:`Actions`},{id:`toggle-read`,label:`Mark read / unread`,group:`Actions`},{id:`pin`,label:`Pin / Unpin`,group:`Actions`},{id:`archive`,label:`Archive / Unarchive`,group:`Actions`},{id:`rename`,label:`Rename`,group:`Actions`},{id:`end-session`,label:`End session`,group:`Actions`},{id:`accept`,label:`Accept changes without a PR`,group:`Actions`},{id:`stop`,label:`Stop`,group:`Actions`},{id:`delete`,label:`Delete`,group:`Actions`},{id:`git:commit`,label:`Commit`,group:`Git`},{id:`git:commit-push`,label:`Commit and push`,group:`Git`},{id:`git:push`,label:`Push`,group:`Git`},{id:`git:create-pr`,label:`Create PR`,group:`Git`},{id:`git:create-draft-pr`,label:`Create draft PR`,group:`Git`},{id:`git:update-branch`,label:`Update branch`,group:`Git`},{id:`git:resolve-conflicts`,label:`Resolve conflicts`,group:`Git`},{id:`git:fix-checks`,label:`Fix errors`,group:`Git`},{id:`open-pr`,label:`Open pull request`,group:`Git`},...Array.from({length:9},(e,t)=>({id:`tab:${t+1}`,label:`Tab ${t+1}`,group:`Go to view`})),{id:`view:session`,label:`Chat`,group:`Go to view`},{id:`view:changes`,label:`Changes`,group:`Go to view`},{id:`view:commits`,label:`Commits`,group:`Go to view`},{id:`view:files`,label:`Files`,group:`Go to view`},{id:`view:graph`,label:`Graph`,group:`Go to view`},{id:`view:notes`,label:`Notes`,group:`Go to view`},{id:`view:browser`,label:`Preview`,group:`Go to view`},{id:`view:assets`,label:`Assets`,group:`Go to view`},{id:`view:terminal`,label:`Terminal`,group:`Go to view`},{id:`full-view`,label:`Full view`,group:`Layout`},{id:`split`,label:`Split view`,group:`Layout`},{id:`terminal`,label:`Show / hide terminal`,group:`Layout`},{id:`terminal-column`,label:`Terminal in a column`,group:`Layout`},{id:`open:terminal-resume`,label:`Terminal (resume session)`,group:`Open in`},{id:`copy:link`,label:`Copy task link`,group:`Copy`},{id:`copy:branch`,label:`Copy branch name`,group:`Copy`},{id:`copy:path`,label:`Copy worktree path`,group:`Copy`},{id:`copy:resume`,label:`Copy take-over command`,group:`Open in`},{id:`copy:pr`,label:`Copy pull request link`,group:`Copy`},{id:`copy:id`,label:`Copy task id`,group:`Copy`}];function P(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function ce(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function le(e,t,{inEditable:n=!1}={}){if(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat)return!1;if(P(e.target)&&!ce(e.target)){if(!n)return!1;let t=C();if(e.target instanceof HTMLElement&&e.target.closest(`.xterm`))return t&&e.metaKey;if(t?!e.metaKey:!e.ctrlKey)return!1}return!0}function ue(e,t,n={}){let r=x.useRef(t);x.useLayoutEffect(()=>{r.current=t});let i=n.inEditable===!0;x.useEffect(()=>{let t=t=>{le(t,e,{inEditable:i})&&(t.preventDefault(),r.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,i])}function de(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||P(e.target))}function fe(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function pe(e,t){let n=x.useRef(t);x.useLayoutEffect(()=>{n.current=t}),x.useEffect(()=>{let t=t=>{de(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var F=`Popover`,[I,me]=i(F,[v]),L=v(),[R,z]=I(F),B=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,c=L(t),l=x.useRef(null),[u,f]=x.useState(!1),[p,m]=o({prop:r,defaultProp:i??!1,onChange:a,caller:F});return(0,S.jsx)(g,{...c,children:(0,S.jsx)(R,{scope:t,contentId:d(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>f(!0),[]),onCustomAnchorRemove:x.useCallback(()=>f(!1),[]),modal:s,children:n})})};B.displayName=F;var V=`PopoverAnchor`,H=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(V,n),a=L(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return x.useEffect(()=>(o(),()=>s()),[o,s]),(0,S.jsx)(_,{...a,...r,ref:t})});H.displayName=V;var U=`PopoverTrigger`,W=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(U,n),a=L(n),o=b(t,i.triggerRef),s=(0,S.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Z(i.open),...r,ref:o,onClick:h(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,S.jsx)(_,{asChild:!0,...a,children:s})});W.displayName=U;var G=`PopoverPortal`,[he,ge]=I(G,{forceMount:void 0}),K=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=z(G,t);return(0,S.jsx)(he,{scope:t,forceMount:n,children:(0,S.jsx)(s,{present:n||a.open,children:(0,S.jsx)(ee,{asChild:!0,container:i,children:r})})})};K.displayName=G;var q=`PopoverContent`,J=x.forwardRef((e,t)=>{let n=ge(q,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=z(q,e.__scopePopover);return(0,S.jsx)(s,{present:r||a.open,children:a.modal?(0,S.jsx)(ve,{...i,ref:t}):(0,S.jsx)(ye,{...i,ref:t})})});J.displayName=q;var _e=c(`PopoverContent.RemoveScroll`),ve=x.forwardRef((e,t)=>{let n=z(q,e.__scopePopover),r=x.useRef(null),i=b(t,r),a=x.useRef(!1);return x.useEffect(()=>{let e=r.current;if(e)return y(e)},[]),(0,S.jsx)(te,{as:_e,allowPinchZoom:!0,children:(0,S.jsx)(Y,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ye=x.forwardRef((e,t)=>{let n=z(q,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return(0,S.jsx)(Y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Y=x.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,...h}=e,g=z(q,n),_=L(n);return p(),(0,S.jsx)(u,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,S.jsx)(a,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,S.jsx)(f,{"data-state":Z(g.open),role:`dialog`,id:g.contentId,..._,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),X=`PopoverClose`,be=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(X,n);return(0,S.jsx)(l.button,{type:`button`,...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})});be.displayName=X;var xe=`PopoverArrow`,Se=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=L(n);return(0,S.jsx)(m,{...i,...r,ref:t})});Se.displayName=xe;function Z(e){return e?`open`:`closed`}var Ce=B,we=H,Te=W,Ee=K,De=J;function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function $(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Oe(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function ke(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function Ae(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(Oe(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function je(){let[e,t]=(0,x.useState)({top:0,bottom:0});return(0,x.useEffect)(()=>Ae(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Me(e){let t=(0,x.useRef)(e);t.current=e,(0,x.useEffect)(()=>{let e=document.documentElement;return $(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Ne=120;function Pe(e,t,n){let r=new Map,i=()=>{let i=Math.max(r.get(e.innerWidth)??0,e.innerHeight);r.set(e.innerWidth,i);let a=e.visualViewport?e.innerHeight-e.visualViewport.height:0;n(Math.max(a,i-e.innerHeight)>=Ne&&P(t.activeElement)&&(e.matchMedia?.(`(pointer: coarse)`).matches??!1))},a,o=()=>{clearTimeout(a),i()},s=()=>{clearTimeout(a),a=setTimeout(i,Fe)},c=()=>{P(t.activeElement)&&o()};i();let l=e.visualViewport;return e.addEventListener(`resize`,o),l?.addEventListener(`resize`,o),l?.addEventListener(`scroll`,o),t.addEventListener(`focusin`,c),t.addEventListener(`focusout`,s),()=>{clearTimeout(a),e.removeEventListener(`resize`,o),l?.removeEventListener(`resize`,o),l?.removeEventListener(`scroll`,o),t.removeEventListener(`focusin`,c),t.removeEventListener(`focusout`,s)}}var Fe=400;function Ie(){let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>Pe(window,document,t),[]),e}function Le({...e}){return(0,S.jsx)(Ce,{"data-slot":`popover`,...e})}function Re({...e}){return(0,S.jsx)(Te,{"data-slot":`popover-trigger`,...e})}function ze({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,...a}){let o=je();return(0,S.jsx)(Ee,{children:(0,S.jsx)(De,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:ke(o,i),className:r(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...a})})}function Be({...e}){return(0,S.jsx)(we,{"data-slot":`popover-anchor`,...e})}export{D as C,E as S,M as _,Me as a,oe as b,P as c,se as d,j as f,A as g,re as h,Re as i,ue as l,N as m,Be as n,Ie as o,k as p,ze as r,fe as s,Le as t,pe as u,T as v,ae as x,C as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Dp6vCdiU.js";import{A as i,C as a,D as o,E as s,I as c,N as l,S as u,T as d,a as f,b as p,i as m,k as h,o as g,r as _,s as v,v as y,x as ee,y as te,z as b}from"./button-CJXK1JqU.js";var x=e(t(),1),S=n();function C(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)}var w={Slash:`/`,Backslash:`\\`,Period:`.`,Comma:`,`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Minus:`-`,Equal:`=`,Backquote:"`",Enter:`Enter`,Space:`Space`,Backspace:`Backspace`,Delete:`Delete`,Tab:`Tab`,Escape:`Escape`,ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`};function ne(e){let t=e.code??``;if(/^Key[A-Z]$/.test(t))return t.slice(3);if(/^Digit[0-9]$/.test(t))return t.slice(5);if(/^Numpad[0-9]$/.test(t))return t.slice(6);if(/^F([1-9]|1[0-2])$/.test(t))return t;if(t in w)return w[t];let n=e.key??``;return n.length===1&&n!==` `?n.toUpperCase():null}function re(e,t=C()){if([`Meta`,`Control`,`Alt`,`Shift`,`OS`,`AltGraph`].includes(e.key)||!t&&e.getModifierState?.(`AltGraph`))return null;let n=ne(e);if(!n)return null;let r=[];return(t?e.metaKey:e.ctrlKey)&&r.push(`Mod`),t&&e.ctrlKey&&r.push(`Ctrl`),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),r.push(n),r.join(`+`)}function T(e,t=C()){let n=e.split(`+`),r=n.at(-1)||`+`,i=n.slice(0,-1);if(t){let e={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Mod:`⌘`};return[`Ctrl`,`Alt`,`Shift`,`Mod`].filter(e=>i.includes(e)).map(t=>e[t]).join(``)+r}let a={Mod:`Ctrl`,Alt:`Alt`,Shift:`Shift`};return[...i.map(e=>a[e]??e),r].join(`+`)}function E(e=document){return e.querySelector(`[role="dialog"], [role="alertdialog"], [role="menu"]`)!==null}function D(e,t=C()){if(!e)return;let n=/^Mod\+([1-9])$/.exec(e);return n?n[1]:T(e,t)}var O=new Set("Mod+K.Mod+P.Mod+Shift+P.Mod+N.Mod+Enter.Mod+B.Alt+D.Mod+Shift+`.Alt+Up.Alt+Down.Alt+Shift+Up.Alt+Shift+Down.Mod+A.Mod+C.Mod+V.Mod+X.Mod+Z.Mod+Shift+Z.Mod+F.Mod+L.Mod+R.Mod+T.Mod+W.Mod+Q.Mod+Shift+T.Mod+Shift+N.Mod+Shift+W".split(`.`));function k(e,t=C()){if(!(t||[`Control`,`Alt`,`AltGraph`].includes(e.key))&&(e.getModifierState?.(`AltGraph`)||e.ctrlKey&&e.altKey))return`Ctrl+Alt — types characters on many layouts`}function A(e,t=C()){let n=e.split(`+`).slice(0,-1);if(!n.some(e=>e===`Mod`||e===`Ctrl`||e===`Alt`))return`Use ⌘/Ctrl, ⌃ or ⌥ with the key`;if(!t&&n.includes(`Mod`)&&n.includes(`Alt`))return`Ctrl+Alt types characters on many layouts`;if(O.has(e))return`That shortcut is taken by the browser or cezar`}var j={...Object.fromEntries(Array.from({length:9},(e,t)=>[`tab:${t+1}`,`Mod+${t+1}`])),"terminal-column":`Mod+/`},ie=200;function ae(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e)){if(Object.keys(t).length>=ie)break;n.length<1||n.length>120||typeof r==`string`&&O.has(r)||(r===null||typeof r==`string`&&r.length>=1&&r.length<=40)&&(t[n]=r)}return t}function M(e={}){let t=new Map;for(let[n,r]of Object.entries(j))n in e||t.set(n,r);for(let[n,r]of Object.entries(e))r&&t.set(n,r);let n=new Map;for(let[r,i]of t){let t=n.get(i);(t===void 0||r in e&&!(t in e))&&n.set(i,r)}return new Map([...t].filter(([e,t])=>n.get(t)===e))}function N(e,t,n){let r={...e};if(n)for(let[i,a]of M(e))i!==t&&a===n&&(j[i]?r[i]=null:delete r[i]);return n===(j[t]??null)?delete r[t]:r[t]=n,r}function oe(e,t){return N(e,t,j[t]??null)}var se=[{id:`reply`,label:`Write to the agent`,group:`Actions`},{id:`toggle-read`,label:`Mark read / unread`,group:`Actions`},{id:`pin`,label:`Pin / Unpin`,group:`Actions`},{id:`archive`,label:`Archive / Unarchive`,group:`Actions`},{id:`rename`,label:`Rename`,group:`Actions`},{id:`end-session`,label:`End session`,group:`Actions`},{id:`accept`,label:`Accept changes without a PR`,group:`Actions`},{id:`stop`,label:`Stop`,group:`Actions`},{id:`delete`,label:`Delete`,group:`Actions`},{id:`git:commit`,label:`Commit`,group:`Git`},{id:`git:commit-push`,label:`Commit and push`,group:`Git`},{id:`git:push`,label:`Push`,group:`Git`},{id:`git:create-pr`,label:`Create PR`,group:`Git`},{id:`git:create-draft-pr`,label:`Create draft PR`,group:`Git`},{id:`git:update-branch`,label:`Update branch`,group:`Git`},{id:`git:resolve-conflicts`,label:`Resolve conflicts`,group:`Git`},{id:`git:fix-checks`,label:`Fix errors`,group:`Git`},{id:`open-pr`,label:`Open pull request`,group:`Git`},...Array.from({length:9},(e,t)=>({id:`tab:${t+1}`,label:`Tab ${t+1}`,group:`Go to view`})),{id:`view:session`,label:`Chat`,group:`Go to view`},{id:`view:changes`,label:`Changes`,group:`Go to view`},{id:`view:commits`,label:`Commits`,group:`Go to view`},{id:`view:files`,label:`Files`,group:`Go to view`},{id:`view:graph`,label:`Graph`,group:`Go to view`},{id:`view:notes`,label:`Notes`,group:`Go to view`},{id:`view:browser`,label:`Preview`,group:`Go to view`},{id:`view:assets`,label:`Assets`,group:`Go to view`},{id:`view:terminal`,label:`Terminal`,group:`Go to view`},{id:`full-view`,label:`Full view`,group:`Layout`},{id:`split`,label:`Split view`,group:`Layout`},{id:`terminal`,label:`Show / hide terminal`,group:`Layout`},{id:`terminal-column`,label:`Terminal in a column`,group:`Layout`},{id:`open:terminal-resume`,label:`Terminal (resume session)`,group:`Open in`},{id:`copy:link`,label:`Copy task link`,group:`Copy`},{id:`copy:branch`,label:`Copy branch name`,group:`Copy`},{id:`copy:path`,label:`Copy worktree path`,group:`Copy`},{id:`copy:resume`,label:`Copy take-over command`,group:`Open in`},{id:`copy:pr`,label:`Copy pull request link`,group:`Copy`},{id:`copy:id`,label:`Copy task id`,group:`Copy`}];function P(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function ce(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function le(e,t,{inEditable:n=!1}={}){if(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat)return!1;if(P(e.target)&&!ce(e.target)){if(!n)return!1;let t=C();if(e.target instanceof HTMLElement&&e.target.closest(`.xterm`))return t&&e.metaKey;if(t?!e.metaKey:!e.ctrlKey)return!1}return!0}function ue(e,t,n={}){let r=x.useRef(t);x.useLayoutEffect(()=>{r.current=t});let i=n.inEditable===!0;x.useEffect(()=>{let t=t=>{le(t,e,{inEditable:i})&&(t.preventDefault(),r.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,i])}function de(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||P(e.target))}function fe(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function pe(e,t){let n=x.useRef(t);x.useLayoutEffect(()=>{n.current=t}),x.useEffect(()=>{let t=t=>{de(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var F=`Popover`,[I,me]=i(F,[v]),L=v(),[R,z]=I(F),B=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,c=L(t),l=x.useRef(null),[u,f]=x.useState(!1),[p,m]=o({prop:r,defaultProp:i??!1,onChange:a,caller:F});return(0,S.jsx)(g,{...c,children:(0,S.jsx)(R,{scope:t,contentId:d(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>f(!0),[]),onCustomAnchorRemove:x.useCallback(()=>f(!1),[]),modal:s,children:n})})};B.displayName=F;var V=`PopoverAnchor`,H=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(V,n),a=L(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return x.useEffect(()=>(o(),()=>s()),[o,s]),(0,S.jsx)(_,{...a,...r,ref:t})});H.displayName=V;var U=`PopoverTrigger`,W=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(U,n),a=L(n),o=b(t,i.triggerRef),s=(0,S.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Z(i.open),...r,ref:o,onClick:h(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,S.jsx)(_,{asChild:!0,...a,children:s})});W.displayName=U;var G=`PopoverPortal`,[he,ge]=I(G,{forceMount:void 0}),K=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=z(G,t);return(0,S.jsx)(he,{scope:t,forceMount:n,children:(0,S.jsx)(s,{present:n||a.open,children:(0,S.jsx)(ee,{asChild:!0,container:i,children:r})})})};K.displayName=G;var q=`PopoverContent`,J=x.forwardRef((e,t)=>{let n=ge(q,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=z(q,e.__scopePopover);return(0,S.jsx)(s,{present:r||a.open,children:a.modal?(0,S.jsx)(ve,{...i,ref:t}):(0,S.jsx)(ye,{...i,ref:t})})});J.displayName=q;var _e=c(`PopoverContent.RemoveScroll`),ve=x.forwardRef((e,t)=>{let n=z(q,e.__scopePopover),r=x.useRef(null),i=b(t,r),a=x.useRef(!1);return x.useEffect(()=>{let e=r.current;if(e)return y(e)},[]),(0,S.jsx)(te,{as:_e,allowPinchZoom:!0,children:(0,S.jsx)(Y,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ye=x.forwardRef((e,t)=>{let n=z(q,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return(0,S.jsx)(Y,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Y=x.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:m,...h}=e,g=z(q,n),_=L(n);return p(),(0,S.jsx)(u,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,S.jsx)(a,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,S.jsx)(f,{"data-state":Z(g.open),role:`dialog`,id:g.contentId,..._,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),X=`PopoverClose`,be=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(X,n);return(0,S.jsx)(l.button,{type:`button`,...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})});be.displayName=X;var xe=`PopoverArrow`,Se=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=L(n);return(0,S.jsx)(m,{...i,...r,ref:t})});Se.displayName=xe;function Z(e){return e?`open`:`closed`}var Ce=B,we=H,Te=W,Ee=K,De=J;function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function $(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Oe(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function ke(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function Ae(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(Oe(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function je(){let[e,t]=(0,x.useState)({top:0,bottom:0});return(0,x.useEffect)(()=>Ae(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Me(e){let t=(0,x.useRef)(e);t.current=e,(0,x.useEffect)(()=>{let e=document.documentElement;return $(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Ne=120;function Pe(e,t,n){let r=new Map,i=()=>{let i=Math.max(r.get(e.innerWidth)??0,e.innerHeight);r.set(e.innerWidth,i);let a=e.visualViewport?e.innerHeight-e.visualViewport.height:0;n(Math.max(a,i-e.innerHeight)>=Ne&&P(t.activeElement)&&(e.matchMedia?.(`(pointer: coarse)`).matches??!1))},a,o=()=>{clearTimeout(a),i()},s=()=>{clearTimeout(a),a=setTimeout(i,Fe)},c=()=>{P(t.activeElement)&&o()};i();let l=e.visualViewport;return e.addEventListener(`resize`,o),l?.addEventListener(`resize`,o),l?.addEventListener(`scroll`,o),t.addEventListener(`focusin`,c),t.addEventListener(`focusout`,s),()=>{clearTimeout(a),e.removeEventListener(`resize`,o),l?.removeEventListener(`resize`,o),l?.removeEventListener(`scroll`,o),t.removeEventListener(`focusin`,c),t.removeEventListener(`focusout`,s)}}var Fe=400;function Ie(){let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>Pe(window,document,t),[]),e}function Le({...e}){return(0,S.jsx)(Ce,{"data-slot":`popover`,...e})}function Re({...e}){return(0,S.jsx)(Te,{"data-slot":`popover-trigger`,...e})}function ze({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,...a}){let o=je();return(0,S.jsx)(Ee,{children:(0,S.jsx)(De,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:ke(o,i),className:r(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...a})})}function Be({...e}){return(0,S.jsx)(we,{"data-slot":`popover-anchor`,...e})}export{D as C,E as S,M as _,Me as a,oe as b,P as c,se as d,j as f,A as g,re as h,Re as i,ue as l,N as m,Be as n,Ie as o,k as p,ze as r,fe as s,Le as t,pe as u,T as v,ae as x,C as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{go as r,mo as i}from"./queries-DVZ1lYAo.js";import{i as a}from"./utils-DWwoYTjU.js";import{t as o}from"./preload-helper-Czpn1I53.js";var s=e(t(),1),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,t,n=`/`){return w(e,t,n,!1)}function w(e,t,n,r,i){let a=O((typeof t==`string`?b(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ee(e),s=null,c=he(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function T(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 ee(e){let t=E(e);return ne(t),t}function E(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=A([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}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=me(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 te(e.path))a(e,t,!0,n)}),t}function te(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=te(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 ne(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var re=/^:[\w-]+$/,ie=3,ae=2,oe=1,se=10,ce=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=ce),t&&(r+=ae),n.filter(e=>!le(e)).reduce((e,t)=>e+(re.test(t)?ie:t===``?oe:se),r)}function de(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 fe(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?pe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:Se(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end);return pe(e,t,n,r)}function pe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(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 he(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 O(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 ge(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?b(e):e,a;return n?(n=xe(n),a=n.startsWith(`/`)?_e(n.substring(1),`/`):_e(n,t)):a=t,{pathname:a,search:Ce(r),hash:we(i)}}function _e(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ve(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 ye(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function be(e){let t=ye(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=b(e):(i={...e},m(!i.pathname||!i.pathname.includes(`?`),ve(`?`,`pathname`,`search`,i)),m(!i.pathname||!i.pathname.includes(`#`),ve(`#`,`pathname`,`hash`,i)),m(!i.search||!i.search.includes(`#`),ve(`#`,`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=ge(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xe=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>xe(e.join(`/`)),j=e=>e.replace(/\/+$/,``),Se=e=>j(e).replace(/^\/*/,`/`),Ce=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,we=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Te=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 Ee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function De(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var Oe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ke(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(Oe)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=O(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}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ae=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ae);var je=[`GET`,...Ae];new Set(je);var Me=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ne(e){try{return Me.includes(new URL(e).protocol)}catch{return!1}}var M=s.createContext(null);M.displayName=`DataRouter`;var N=s.createContext(null);N.displayName=`DataRouterState`;var Pe=s.createContext(!1);function Fe(){return s.useContext(Pe)}var Ie=s.createContext({isTransitioning:!1});Ie.displayName=`ViewTransition`;var Le=s.createContext(new Map);Le.displayName=`Fetchers`;var Re=s.createContext(null);Re.displayName=`Await`;var P=s.createContext(null);P.displayName=`Navigation`;var F=s.createContext(null);F.displayName=`Location`;var I=s.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var L=s.createContext(null);L.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))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 Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Te(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){m(R(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=s.useContext(P),{hash:i,pathname:a,search:o}=V(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:o,hash:i})}function R(){return s.useContext(F)!=null}function z(){return m(R(),`useLocation() may be used only in the context of a <Router> component.`),s.useContext(F).location}function Ge(){return s.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){s.useContext(P).static||s.useLayoutEffect(e)}function B(){let{isDataRoute:e}=s.useContext(I);return e?ht():Je()}function Je(){m(R(),`useNavigate() may be used only in the context of a <Router> component.`);let e=s.useContext(M),{basename:t,navigator:n}=s.useContext(P),{matches:r}=s.useContext(I),{pathname:i}=z(),a=JSON.stringify(be(r)),o=s.useRef(!1);return qe(()=>{o.current=!0}),s.useCallback((r,s={})=>{if(h(o.current,Ke),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ye=s.createContext(null);function Xe(e){let t=s.useContext(I).outlet;return s.useMemo(()=>t&&s.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=s.useContext(I);return e[e.length-1]?.params??{}}function V(e,{relative:t}={}){let{matches:n}=s.useContext(I),{pathname:r}=z(),i=JSON.stringify(be(n));return s.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){m(R(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=s.useContext(P),{matches:i}=s.useContext(I),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;_t(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.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{go as r,mo as i}from"./queries-BQUz3Wnb.js";import{i as a}from"./utils-Dp6vCdiU.js";import{t as o}from"./preload-helper-Czpn1I53.js";var s=e(t(),1),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,t,n=`/`){return w(e,t,n,!1)}function w(e,t,n,r,i){let a=O((typeof t==`string`?b(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ee(e),s=null,c=he(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function T(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 ee(e){let t=E(e);return ne(t),t}function E(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=A([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}".`),E(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=me(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 te(e.path))a(e,t,!0,n)}),t}function te(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=te(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 ne(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var re=/^:[\w-]+$/,ie=3,ae=2,oe=1,se=10,ce=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=ce),t&&(r+=ae),n.filter(e=>!le(e)).reduce((e,t)=>e+(re.test(t)?ie:t===``?oe:se),r)}function de(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 fe(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?pe(u,l,s.matcher,s.compiledParams):D(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=D({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:A([a,d.pathname]),pathnameBase:Se(A([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=A([a,d.pathnameBase]))}return o}function D(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end);return pe(e,t,n,r)}function pe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(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 he(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 O(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 ge(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?b(e):e,a;return n?(n=xe(n),a=n.startsWith(`/`)?_e(n.substring(1),`/`):_e(n,t)):a=t,{pathname:a,search:Ce(r),hash:we(i)}}function _e(e,t){let n=j(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ve(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 ye(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function be(e){let t=ye(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function k(e,t,n,r=!1){let i;typeof e==`string`?i=b(e):(i={...e},m(!i.pathname||!i.pathname.includes(`?`),ve(`?`,`pathname`,`search`,i)),m(!i.pathname||!i.pathname.includes(`#`),ve(`#`,`pathname`,`hash`,i)),m(!i.search||!i.search.includes(`#`),ve(`#`,`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=ge(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xe=e=>e.replace(/[\\/]{2,}/g,`/`),A=e=>xe(e.join(`/`)),j=e=>e.replace(/\/+$/,``),Se=e=>j(e).replace(/^\/*/,`/`),Ce=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,we=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Te=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 Ee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function De(e){return A(e.map(e=>e.route.path).filter(Boolean))||`/`}var Oe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ke(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(Oe)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=O(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}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ae=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ae);var je=[`GET`,...Ae];new Set(je);var Me=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ne(e){try{return Me.includes(new URL(e).protocol)}catch{return!1}}var M=s.createContext(null);M.displayName=`DataRouter`;var N=s.createContext(null);N.displayName=`DataRouterState`;var Pe=s.createContext(!1);function Fe(){return s.useContext(Pe)}var Ie=s.createContext({isTransitioning:!1});Ie.displayName=`ViewTransition`;var Le=s.createContext(new Map);Le.displayName=`Fetchers`;var Re=s.createContext(null);Re.displayName=`Await`;var P=s.createContext(null);P.displayName=`Navigation`;var F=s.createContext(null);F.displayName=`Location`;var I=s.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var L=s.createContext(null);L.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))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 Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Te(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){m(R(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=s.useContext(P),{hash:i,pathname:a,search:o}=V(e,{relative:t}),c=a;return n!==`/`&&(c=a===`/`?n:A([n,a])),r.createHref({pathname:c,search:o,hash:i})}function R(){return s.useContext(F)!=null}function z(){return m(R(),`useLocation() may be used only in the context of a <Router> component.`),s.useContext(F).location}function Ge(){return s.useContext(F).navigationType}var Ke=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qe(e){s.useContext(P).static||s.useLayoutEffect(e)}function B(){let{isDataRoute:e}=s.useContext(I);return e?ht():Je()}function Je(){m(R(),`useNavigate() may be used only in the context of a <Router> component.`);let e=s.useContext(M),{basename:t,navigator:n}=s.useContext(P),{matches:r}=s.useContext(I),{pathname:i}=z(),a=JSON.stringify(be(r)),o=s.useRef(!1);return qe(()=>{o.current=!0}),s.useCallback((r,s={})=>{if(h(o.current,Ke),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=k(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:A([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ye=s.createContext(null);function Xe(e){let t=s.useContext(I).outlet;return s.useMemo(()=>t&&s.createElement(Ye.Provider,{value:e},t),[t,e])}function Ze(){let{matches:e}=s.useContext(I);return e[e.length-1]?.params??{}}function V(e,{relative:t}={}){let{matches:n}=s.useContext(I),{pathname:r}=z(),i=JSON.stringify(be(n));return s.useMemo(()=>k(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Qe(e,t){return $e(e,t)}function $e(e,t,n){m(R(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=s.useContext(P),{matches:i}=s.useContext(I),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:`/`,l=a?a.pathnameBase:`/`,u=a&&a.route;{let e=u&&u.path||``;_t(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.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=z(),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 _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):C(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=ot(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:A([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:A([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&v?s.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function et(){let e=mt(),t=Ee(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=s.createElement(s.Fragment,null,s.createElement(`p`,null,`💿 Hey developer 👋`),s.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,s.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,s.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),s.createElement(s.Fragment,null,s.createElement(`h2`,null,`Unexpected Application Error!`),s.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?s.createElement(`pre`,{style:i},n):null,o)}var tt=s.createElement(et,null),nt=class extends s.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ue(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:s.createElement(I.Provider,{value:this.props.routeContext},s.createElement(L.Provider,{value:e,children:this.props.component}));return this.context?s.createElement(it,{error:e},t):t}};nt.contextType=Pe;var rt=new WeakMap;function it({children:e,error:t}){let{basename:n}=s.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=He(t.digest);if(e){let r=rt.get(t);if(r)throw r;let i=ke(e.location,n),a=i.absoluteURL||i.to;if(Ne(a))throw Error(`Invalid redirect location`);if(Oe&&!rt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw rt.set(t,n),n}return s.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function at({routeContext:e,match:t,children:n}){let r=s.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),s.createElement(I.Provider,{value:e},n)}function ot(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);m(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,c=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:a}=r,s=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||s){n.isStatic&&(o=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:De(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||tt,o&&(c<0&&l===0?(_t(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?s.createElement(n.route.Component,null):n.route.element?n.route.element:e,s.createElement(at,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?s.createElement(nt,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ct(e){let t=s.useContext(M);return m(t,st(e)),t}function H(e){let t=s.useContext(N);return m(t,st(e)),t}function lt(e){let t=s.useContext(I);return m(t,st(e)),t}function ut(e){let t=lt(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 dt(){return ut(`useRouteId`)}function ft(){let e=H(`useNavigation`);return s.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function pt(){let{matches:e,loaderData:t}=H(`useMatches`);return s.useMemo(()=>e.map(e=>T(e,t)),[e,t])}function mt(){let e=s.useContext(L),t=H(`useRouteError`),n=ut(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ht(){let{router:e}=ct(`useNavigate`),t=ut(`useNavigate`),n=s.useRef(!1);return qe(()=>{n.current=!0}),s.useCallback(async(r,i={})=>{h(n.current,Ke),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var gt={};function _t(e,t,n){!t&&!gt[e]&&(gt[e]=!0,h(!1,n))}s.memo(vt);function vt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return $e(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function yt({to:e,replace:t,state:n,relative:r}){m(R(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=s.useContext(P);h(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=s.useContext(I),{pathname:o}=z(),c=B(),l=k(e,be(a),o,r===`path`),u=JSON.stringify(l);return s.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function bt(e){return Xe(e.context)}function xt(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 St({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){m(!R(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=s.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof n==`string`&&(n=b(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:g=`default`,mask:_}=n,v=s.useMemo(()=>{let e=O(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:g,mask:_},navigationType:r}},[c,u,d,f,p,g,r,_]);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:s.createElement(P.Provider,{value:l},s.createElement(F.Provider,{children:t,value:v}))}function Ct({children:e,location:t}){return Qe(wt(e),t)}s.Component;function wt(e,t=[]){let n=[];return s.Children.forEach(e,(e,r)=>{if(!s.isValidElement(e))return;let i=[...t,r];if(e.type===s.Fragment){n.push.apply(n,wt(e.props.children,i));return}m(e.type===xt,`[${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 a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=wt(e.props.children,i)),n.push(a)}),n}var U=`get`,W=`application/x-www-form-urlencoded`;function G(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Tt(e){return G(e)&&e.tagName.toLowerCase()===`button`}function Et(e){return G(e)&&e.tagName.toLowerCase()===`form`}function Dt(e){return G(e)&&e.tagName.toLowerCase()===`input`}function Ot(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kt(e,t){return e.button===0&&(!t||t===`_self`)&&!Ot(e)}function At(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 jt(e,t){let n=At(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var K=null;function Mt(){if(K===null)try{new FormData(document.createElement(`form`),0),K=!1}catch{K=!0}return K}var Nt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Pt(e){return e!=null&&!Nt.has(e)?(h(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${W}"`),null):e}function Ft(e,t){let n,r,i,a,o;if(Et(e)){let o=e.getAttribute(`action`);r=o?O(o,t):null,n=e.getAttribute(`method`)||U,i=Pt(e.getAttribute(`enctype`))||W,a=new FormData(e)}else if(Tt(e)||Dt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?O(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||U,i=Pt(e.getAttribute(`formenctype`))||Pt(o.getAttribute(`enctype`))||W,a=new FormData(o,e),!Mt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(G(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=U,r=null,i=W,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var It={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Lt=/[&><\u2028\u2029]/g;function Rt(e){return e.replace(Lt,e=>It[e])}function zt(e,t){if(e===!1||e==null)throw Error(t)}function Bt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&O(i.pathname,t)===`/`?i.pathname=`${j(t)}/_root.${r}`:i.pathname=`${j(i.pathname)}.${r}`,i}async function Vt(e,t){if(e.id in t)return t[e.id];try{let n=await o(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ht(e){return e!=null&&typeof e.page==`string`}function Ut(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 Wt(e,t,n){return Yt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Vt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ut).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Gt(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 Kt(e,t,{includeHydrateFallback:n}={}){return qt(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 qt(e){return[...new Set(e)]}function Jt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Yt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ht(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Jt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Xt(){let e=s.useContext(M);return zt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Zt(){let e=s.useContext(N);return zt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var q=s.createContext(void 0);q.displayName=`FrameworkContext`;function J(){let e=s.useContext(q);return zt(e,`You must render this element inside a <HydratedRouter> element`),e}function Qt(e,t){let n=s.useContext(q),[r,i]=s.useState(!1),[a,o]=s.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=s.useRef(null);s.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),s.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Y(c,m),onBlur:Y(l,h),onMouseEnter:Y(u,m),onMouseLeave:Y(d,h),onTouchStart:Y(f,m)}]:[a,p,{}]:[!1,p,{}]}function Y(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function $t({page:e,...t}){let n=Fe(),{nonce:r}=J(),{router:i}=Xt(),a=s.useMemo(()=>C(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?s.createElement(tn,{page:e,matches:a,...t}):s.createElement(nn,{page:e,matches:a,...t})):null}function en(e){let{manifest:t,routeModules:n}=J(),[r,i]=s.useState([]);return s.useEffect(()=>{let r=!1;return Wt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function tn({page:e,matches:t,...n}){let r=z(),{future:i}=J(),{basename:a}=Xt(),o=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Bt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return s.createElement(s.Fragment,null,o.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function nn({page:e,matches:t,...n}){let r=z(),{future:i,manifest:a,routeModules:o}=J(),{basename:c}=Xt(),{loaderData:l,matches:u}=Zt(),d=s.useMemo(()=>Gt(e,t,u,a,r,`data`),[e,t,u,a,r]),f=s.useMemo(()=>Gt(e,t,u,a,r,`assets`),[e,t,u,a,r]),p=s.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=Bt(e,c,i.v8_trailingSlashAwareDataRequests,`data`);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,i.v8_trailingSlashAwareDataRequests,l,r,a,d,t,e,o]),m=s.useMemo(()=>Kt(f,a),[f,a]),h=en(f);return s.createElement(s.Fragment,null,p.map(e=>s.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>s.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>s.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function rn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}s.Component;var an=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{an&&(window.__reactRouterVersion=`7.18.1`)}catch{}function on({basename:e,children:t,useTransitions:n,window:r}){let i=s.useRef();i.current??=p({window:r,v5Compat:!0});let a=i.current,[o,c]=s.useState({action:a.action,location:a.location}),l=s.useCallback(e=>{n===!1?c(e):s.startTransition(()=>c(e))},[n]);return s.useLayoutEffect(()=>a.listen(l),[a,l]),s.createElement(St,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function sn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=s.useState({action:n.action,location:n.location}),o=s.useCallback(e=>{r===!1?a(e):s.startTransition(()=>a(e))},[r]);return s.useLayoutEffect(()=>n.listen(o),[n,o]),s.createElement(St,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}sn.displayName=`unstable_HistoryRouter`;var X=s.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=s.useContext(P),b=typeof d==`string`&&c.test(d),x=ke(d,_);d=x.to;let S=We(d,{relative:r}),C=z(),w=null;if(o){let e=k(o,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:A([_,e.pathname])),w=v.createHref(e)}let[T,ee,E]=Qt(n,h),te=mn(d,{replace:a,mask:o,state:l,target:u,preventScrollReset:f,relative:r,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let re=!(x.isExternal||i),ie=s.createElement(`a`,{...h,...E,href:(re?w:void 0)||x.absoluteURL||S,onClick:re?ne:e,ref:rn(g,ee),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?s.createElement(s.Fragment,null,ie,s.createElement($t,{page:S})):ie});X.displayName=`Link`;var cn=s.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:c,...l},u){let d=V(a,{relative:l.relative}),f=z(),p=s.useContext(N),{navigator:m,basename:h}=s.useContext(P),g=p!=null&&wn(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=O(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return s.createElement(X,{...l,"aria-current":w,className:T,ref:u,style:ee,to:a,viewTransition:o},typeof c==`function`?c(C):c)});cn.displayName=`NavLink`;var ln=s.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=U,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=s.useContext(P),v=vn(),y=yn(l,{relative:d}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return s.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||o,l=()=>v(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:i,state:a,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?s.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});ln.displayName=`Form`;function un({getKey:e,storageKey:t,...n}){let r=s.useContext(q),{basename:i}=s.useContext(P),a=z(),o=pt();Sn({getKey:e,storageKey:t});let c=s.useMemo(()=>{if(!r||!e)return null;let t=xn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),s.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Rt(JSON.stringify(t||bn))}, ${Rt(JSON.stringify(c))})`}})}un.displayName=`ScrollRestoration`;function dn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fn(e){let t=s.useContext(M);return m(t,dn(e)),t}function pn(e){let t=s.useContext(N);return m(t,dn(e)),t}function mn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=B(),f=z(),p=V(e,{relative:o});return s.useCallback(m=>{if(kt(m,t)){m.preventDefault();let t=n===void 0?y(f)===y(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l});u?s.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,c,l,u])}function hn(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=s.useRef(At(e)),n=s.useRef(!1),r=z(),i=s.useMemo(()=>jt(r.search,n.current?null:t.current),[r.search]),a=B();return[i,s.useCallback((e,t)=>{let r=At(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var gn=0,_n=()=>`__${String(++gn)}__`;function vn(){let{router:e}=fn(`useSubmit`),{basename:t}=s.useContext(P),n=dt(),r=e.fetch,i=e.navigate;return s.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ft(e,t);if(a.navigate===!1){let e=a.fetcherKey||_n();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function yn(e,{relative:t}={}){let{basename:n}=s.useContext(P),r=s.useContext(I);m(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...V(e||`.`,{relative:t})},o=z();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:A([n,a.pathname])),y(a)}var bn=`react-router-scroll-positions`,Z={};function xn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:O(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Sn({getKey:e,storageKey:t}={}){let{router:n}=fn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=pn(`useScrollRestoration`),{basename:a}=s.useContext(P),o=z(),c=pt(),l=ft();s.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Cn(s.useCallback(()=>{if(l.state===`idle`){let t=xn(o,c,a,e);Z[t]=window.scrollY}try{sessionStorage.setItem(t||bn,JSON.stringify(Z))}catch(e){h(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,c,t])),typeof document<`u`&&(s.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||bn);e&&(Z=JSON.parse(e))}catch{}},[t]),s.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Z,()=>window.scrollY,e?(t,n)=>xn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),s.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{h(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Cn(e,t){let{capture:n}=t||{};s.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wn(e,{relative:t}={}){let n=s.useContext(Ie);m(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=fn(`useViewTransitionState`),i=V(e,{relative:t});if(!n.isTransitioning)return!1;let a=O(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=O(n.nextLocation.pathname,r)||n.nextLocation.pathname;return D(i.pathname,o)!=null||D(i.pathname,a)!=null}var Q=n(),Tn=/^\/p\/([^/]+)(?=\/|$)/;function En(e){let t=Tn.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function Dn(e){let t=Tn.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function On(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function kn(e,t){return e===null?t:typeof t==`string`?On(e,t):t.pathname===void 0?t:{...t,pathname:On(e,t.pathname)}}function An(){let{projectId:e}=r(),{pathname:t}=z();return e??En(t)}function jn({projectId:e,children:t}){let n=r(),o=(0,s.useMemo)(()=>e===null?n:{projectId:e,apiBase:`${a}/p/${encodeURIComponent(e)}`},[n,e]);return(0,Q.jsx)(i.Provider,{value:o,children:t})}function $(){let e=An();return(0,s.useCallback)(t=>kn(e,t),[e])}function Mn(e){let{pathname:t}=z();return(0,s.useMemo)(()=>D(e,Dn(t)),[e,t])}function Nn({to:e,...t}){let n=$();return(0,Q.jsx)(X,{...t,to:n(e)})}function Pn({to:e,...t}){let n=$();return(0,Q.jsx)(cn,{...t,to:n(e)})}function Fn({to:e,...t}){let n=$();return(0,Q.jsx)(yt,{...t,to:n(e)})}function In(){let e=B(),t=$();return(0,s.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{hn as C,Ze as S,Ct as _,En as a,B as b,An as c,on as d,X as f,xt as g,bt as h,Fn as i,In as l,yt as m,jn as n,kn as o,cn as p,Pn as r,Dn as s,Nn as t,Mn as u,D as v,Ge as x,z as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-drawer-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r}from"./queries-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-drawer-CEktqC3z.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/queries-BQUz3Wnb.js","assets/utils-Dp6vCdiU.js","assets/bundle-mjs-rHxsej31.js","assets/button-CJXK1JqU.js","assets/createLucideIcon-BHp8sXmF.js","assets/dist-Bsi6zLdE.js","assets/dropdown-menu-BKvUsb5Y.js","assets/external-link-BE6y205O.js","assets/loader-circle-CPBhhDbB.js","assets/panel-right-BOIRp-Hi.js","assets/play-CmVAj_fu.js","assets/plus-CxRU2X8C.js","assets/square-wDIzrTDO.js","assets/terminal-CxnJmFUC.js","assets/x-BqECUykl.js","assets/alert-dialog-B2Vi6MQZ.js","assets/tabs-DrhZb97I.js","assets/icon-tooltip-DYk5cjLx.js","assets/input-DofKzJZl.js","assets/status-dot-AP_4obOJ.js","assets/drawer-state-DasOAIpO.js","assets/terminal-pane-CmmTwiTX.js","assets/preload-helper-Czpn1I53.js","assets/host-usage-B8ohHYHR.js","assets/use-desktop-BNN3U2y9.js","assets/clipboard-DvCUPLwM.js","assets/terminal-pane-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r}from"./queries-BQUz3Wnb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{c as a}from"./project-router-B1Q3upIJ.js";import{t as o}from"./terminal-CxnJmFUC.js";import{i as s}from"./loading-state-NiNQtJ5H.js";import{t as c}from"./centered-state-DE6sgEMs.js";import{t as l}from"./terminal-scope-okFE6qRP.js";var u=e(t(),1),d=n(),f=(0,u.lazy)(()=>i(()=>import(`./terminal-drawer-CEktqC3z.js`).then(e=>({default:e.TerminalDrawer})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),p=()=>{};function m(){let e=a()??`default`,t=r(),n=(0,u.useMemo)(()=>l(e),[e]);return t.data&&t.data.capabilities.terminal!==!0?(0,d.jsx)(`div`,{"data-route":`terminal`,className:`flex min-h-full flex-col`,children:(0,d.jsx)(c,{icon:(0,d.jsx)(o,{}),tone:`neutral`,heading:`h1`,title:`Terminal disabled`,subtitle:`The terminal is off on this cockpit: CEZ_TERMINAL=0, or hosted mode without CEZ_TERMINAL=1.`})}):(0,d.jsx)(`div`,{"data-route":`terminal`,className:`flex h-full min-h-0 flex-col pt-1`,children:(0,d.jsx)(u.Suspense,{fallback:(0,d.jsx)(s,{label:`Loading terminal…`}),children:(0,d.jsx)(f,{scope:n,height:0,onHeightChange:p,fill:!0},n.key)})})}export{m as ProjectTerminalRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rt as e}from"./utils-
|
|
1
|
+
import{Rt as e}from"./utils-Dp6vCdiU.js";var t=e,n={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,cursor:`Cursor`,pi:`pi`,junie:`Junie`,copilot:`GitHub Copilot CLI`,omp:`OMP`,antigravity:`Antigravity`,gemini:`Gemini CLI`,kimi:`Kimi Code`};function r(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let n=e,r={};for(let e of t){let t=n[e];typeof t==`string`&&t.length>0&&t.length<=128&&(r[e]=t)}return r}function i(e,r){if(!e)return[];let i=new Map(e.providers.map(e=>[e.provider,e]));return t.flatMap(e=>{let t=i.get(e);return t?.status!==`disconnected`||!t.authFailureId||r[e]===t.authFailureId?[]:[{provider:e,label:n[e],authFailureId:t.authFailureId}]})}function a(e,t){return{...e,...Object.fromEntries(t.map(({provider:e,authFailureId:t})=>[e,t]))}}export{i,a as n,r,n as t};
|