@cuongtran001/kanna 1.76.1 → 1.76.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{BoardsPage-ClqCJi3S.js → BoardsPage-BvYUo0PD.js} +1 -1
- package/dist/client/assets/{BoardsRoutePage-tILf5ZVU.js → BoardsRoutePage-D5hLNJ2q.js} +1 -1
- package/dist/client/assets/{ChatPage-C8syKflw.js → ChatPage-zfy8nznW.js} +3 -3
- package/dist/client/assets/{CronJobRow-FbVVkka2.js → CronJobRow-VCv0jyI2.js} +1 -1
- package/dist/client/assets/{CronJobsPage-Cjtn8F5l.js → CronJobsPage-8FE4cO2q.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-D6Js0oz9.js → FilePreviewSheet-B5b8L-4e.js} +1 -1
- package/dist/client/assets/{FlowSurface-BD6Fv7KF.js → FlowSurface-DmNZQO7Z.js} +1 -1
- package/dist/client/assets/{GenUIBlock-CCn7-ePE.js → GenUIBlock-DX1nLbtf.js} +2 -2
- package/dist/client/assets/{KannaSocketProvider-m8QFHU_F.js → KannaSocketProvider-CiuKyRYE.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-CPKymu8m.js → LocalProjectsPage-DjCZmQ8c.js} +1 -1
- package/dist/client/assets/{SettingsPage-04gXMi4Y.js → SettingsPage-ELjbPQEw.js} +1 -1
- package/dist/client/assets/{StackBoardsRoutePage-CzojEmXE.js → StackBoardsRoutePage-i7WMqsk0.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-BUbmvfUG.js → ToolCallMessage-BhxowUjs.js} +3 -3
- package/dist/client/assets/{VChartSurface-CeQqqBBu.js → VChartSurface-DQ6HIQXe.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-nsRU1QEm.js → WorkflowsPage-BCIsFa6f.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-D5tluUkJ.js → WorkflowsSection-B5TkVqRA.js} +1 -1
- package/dist/client/assets/{chart-renderer-6tEMKXRu.js → chart-renderer-DQLdORyQ.js} +1 -1
- package/dist/client/assets/{chatSounds-DHfUpC0L.js → chatSounds-CUN4vZG0.js} +1 -1
- package/dist/client/assets/chevron-left-DpI8tMxJ.js +1 -0
- package/dist/client/assets/{clipboard.adapter-CYn3H1oo.js → clipboard.adapter-BvW6oQa_.js} +1 -1
- package/dist/client/assets/{columnStyle-BOebgRHp.js → columnStyle-C0IvZxLY.js} +1 -1
- package/dist/client/assets/{contextWindow-D1RRC1b-.js → contextWindow-WJUHfP_d.js} +1 -1
- package/dist/client/assets/{copyFeedbackStore-DdNWcKCp.js → copyFeedbackStore-BsjXKW0-.js} +1 -1
- package/dist/client/assets/{createScopedStore-C0pJOwR9.js → createScopedStore-DW4wfjbM.js} +1 -1
- package/dist/client/assets/{dist-DRcJM7Lq.js → dist-Q8elClTa.js} +1 -1
- package/dist/client/assets/{ellipsis-BrvN3hX9.js → ellipsis-D_1qLZbX.js} +1 -1
- package/dist/client/assets/{flow-kinds-CkaWSYYm.js → flow-kinds-Df0GmP61.js} +1 -1
- package/dist/client/assets/{folder-BunWGsz1.js → folder-UHukK2MD.js} +1 -1
- package/dist/client/assets/{formatDuration-SKek8N5u.js → formatDuration-BA1K5CFs.js} +1 -1
- package/dist/client/assets/{genui-td2w9ZBU.js → genui-CZI72r1O.js} +1 -1
- package/dist/client/assets/{globe-BIvdtBFt.js → globe-CQI7GjsK.js} +1 -1
- package/dist/client/assets/{host-6jbynfZo.js → host-C0p_56Re.js} +1 -1
- package/dist/client/assets/{index-CVlOrRGa.js → index-3lHvRekg.js} +3 -3
- package/dist/client/assets/{info-DhG2cfVg.js → info-BXzVPePc.js} +1 -1
- package/dist/client/assets/{input-C3R4k6-W.js → input-BerPPEIs.js} +1 -1
- package/dist/client/assets/{lexicalToReact-CfHucecr.js → lexicalToReact-DdXqoi0d.js} +3 -3
- package/dist/client/assets/{log-CYjZ_PZ1.js → log-7fGlFSON.js} +1 -1
- package/dist/client/assets/{monitor-DwO0L7DX.js → monitor-BOFtyQiW.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-By8_y_o0.js → pendingActionsStore-idc6m2Ya.js} +1 -1
- package/dist/client/assets/{play-B-vQkmFp.js → play-DltDjX9H.js} +1 -1
- package/dist/client/assets/{plus-BDLscSN_.js → plus-CwWMJ0a-.js} +1 -1
- package/dist/client/assets/{popover-104yTR95.js → popover-gn1uvc-1.js} +1 -1
- package/dist/client/assets/{pushClient-DiLvwOUU.js → pushClient-NeXrldi-.js} +1 -1
- package/dist/client/assets/runDetached-BWsF_7Xo.js +1 -0
- package/dist/client/assets/{segmented-control-CROY-CuD.js → segmented-control-3UDSwswP.js} +1 -1
- package/dist/client/assets/{select-BiDB8UlY.js → select-Df67vheJ.js} +1 -1
- package/dist/client/assets/{settings-header-button-DrzrbXmr.js → settings-header-button-CKZHCdXh.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-Db0_daIj.js → sidebarPendingActions-B8iNQJfE.js} +1 -1
- package/dist/client/assets/{square-pen-DXsycXBb.js → square-pen-DJjPW4f4.js} +1 -1
- package/dist/client/assets/{state-mark-C1zpvAww.js → state-mark-CU2hw5D9.js} +1 -1
- package/dist/client/assets/{terminal-BSJXFRP8.js → terminal-8Bxl5uZh.js} +1 -1
- package/dist/client/assets/{timer.adapter-DsZB_-cb.js → timer.adapter-BD7zwXEm.js} +1 -1
- package/dist/client/assets/{tools-MYv8-phR.js → tools-Lo2VrFmM.js} +1 -1
- package/dist/client/assets/{triangle-alert-Ck2DCXSO.js → triangle-alert-CQwDyl4K.js} +1 -1
- package/dist/client/assets/{useAppGlobalState-BwEVtuo2.js → useAppGlobalState-uP5C1BG8.js} +1 -1
- package/dist/client/assets/{useKannaState-DbEQQ6kC.js → useKannaState-B2eDC-Dw.js} +1 -1
- package/dist/client/assets/{useTheme-BHNSJGUC.js → useTheme-B_JDh31l.js} +1 -1
- package/dist/client/index.html +33 -33
- package/package.json +1 -1
- package/dist/client/assets/chevron-left-BO_O7rLs.js +0 -1
- package/dist/client/assets/runDetached-DtQs26wR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-CYjZ_PZ1.js";import{c as o,f as s,s as c}from"./pendingActionsStore-By8_y_o0.js";import{H as l}from"./FilePreviewSheet-D6Js0oz9.js";import{t as u}from"./formatDuration-SKek8N5u.js";import{c as d,i as f,n as p,r as m,u as h}from"./timer.adapter-DsZB_-cb.js";import{t as g}from"./createScopedStore-C0pJOwR9.js";import{t as _}from"./runDetached-DtQs26wR.js";import{s as v}from"./contextWindow-D1RRC1b-.js";import{l as y,s as b,t as x}from"./state-mark-C1zpvAww.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=g(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(v,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:u(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(p,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(f,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(d,{children:(0,k.jsx)(h,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(m,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:u(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(v,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:u(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return _(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-7fGlFSON.js";import{c as o,f as s,s as c}from"./pendingActionsStore-idc6m2Ya.js";import{H as l}from"./FilePreviewSheet-B5b8L-4e.js";import{t as u}from"./formatDuration-BA1K5CFs.js";import{c as d,i as f,n as p,r as m,u as h}from"./timer.adapter-BD7zwXEm.js";import{t as g}from"./createScopedStore-DW4wfjbM.js";import{t as _}from"./runDetached-BWsF_7Xo.js";import{s as v}from"./contextWindow-WJUHfP_d.js";import{l as y,s as b,t as x}from"./state-mark-CU2hw5D9.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=g(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(v,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:u(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(p,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(f,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(d,{children:(0,k.jsx)(h,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(m,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:u(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(v,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:u(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return _(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,H as t,I as n,k as r}from"./genui-
|
|
1
|
+
import{B as e,H as t,I as n,k as r}from"./genui-CZI72r1O.js";var i=`Other`;function a(e,t){let n=t.map(t=>r(e.metrics[t])),[i]=n;return n.every(e=>e.format===i?.format&&e.currency===i?.currency)}function o(e,t,r,i){let a=e.dimensions?.[t];return a?.kind===`time`?n(i,r.grain??a.grain??`month`):i}function s(e,t){let n=[];for(let r of e){let e=r.dimensions[t];e!==void 0&&!n.includes(e)&&n.push(e)}return n}function c(e,t,n){let r=e.dimensions?.[t]?.order;return[...n].sort((e,t)=>{let n=r?r.indexOf(e):-1,i=r?r.indexOf(t):-1;return n===i?e.localeCompare(t,`en`,{numeric:!0}):n===-1?1:i===-1?-1:n-i})}function l(e,t,n,r){let i=new Map;for(let r of e){let e=r.dimensions[t]??``;i.set(e,(i.get(e)??0)+Math.abs(r.values[n]??0))}let a=[...i.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>e);return new Set(a.length>r+1?a.slice(0,r):a)}function u(n,i,a,c){let l=s(a.rows,n.dimension);return{kind:n.chart,xOrder:l,xLabels:Object.fromEntries(l.map(e=>[e,o(i,n.dimension,a,e)])),format:r(i.metrics[c]),valueLabel:t(c,i.metrics[c]),dimensionLabel:e(n.dimension,i.dimensions?.[n.dimension])}}function d(e,t,n){let[r]=e.metrics;if(!r)return{ok:!1,message:`A chart needs a metric`};if(!a(t,[...e.metrics,...e.secondaryMetric?[e.secondaryMetric]:[]]))return{ok:!1,message:`These metrics use different units, and a chart has one axis. Show them in two charts.`};switch(e.chart){case`waterfall`:return m(e,t,n,r);case`composition`:return h(e,t,n,r);case`combo`:return p(e,t,n,r);default:return f(e,t,n)}}function f(e,n,r){let[a=``]=e.metrics;if(e.chart===`stacked-bar`&&!e.series&&e.metrics.length<2)return{ok:!1,message:`A stacked bar needs a series dimension or at least two metrics to stack`};if(e.series&&e.metrics.length>1)return{ok:!1,message:`Split by a series dimension with one metric, or list several metrics without a series`};let o=u(e,n,r,a),d=[],f=[];if(e.series){let t=e.series,u=l(r.rows,t,a,7),p=c(n,t,[...u]),m=s(r.rows,t).some(e=>!u.has(e));p.forEach((e,t)=>f.push({id:e,label:e,role:`series`,slot:t})),m&&f.push({id:i,label:i,role:`series`,slot:p.length});let h=new Map;for(let n of r.rows){let r=n.dimensions[e.dimension],o=n.dimensions[t]??``,s=n.values[a];if(r===void 0||s==null)continue;let c=`${r}\u0001${u.has(o)?o:i}`;h.set(c,(h.get(c)??0)+s)}for(let[e,t]of h){let[n=``,r=``]=e.split(``);d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:t})}return{ok:!0,model:{...o,points:d,series:f}}}e.metrics.forEach((e,r)=>{f.push({id:e,label:t(e,n.metrics[e]),role:`series`,slot:r})}),r.comparison&&e.metrics.forEach(e=>{f.push({id:`${e}::compare`,label:`${t(e,n.metrics[e])} (${r.comparison?.label})`,role:`compare`,slot:null})});for(let t of r.rows){let n=t.dimensions[e.dimension];if(n!==void 0)for(let r of e.metrics){let e=t.values[r];e!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:e});let i=t.compare?.[r];i!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:`${r}::compare`,value:i})}}return{ok:!0,model:{...o,points:d,series:f}}}function p(e,n,r,i){if(!e.secondaryMetric)return{ok:!1,message:`A combo chart needs a secondaryMetric drawn as a line over the bars`};let a=e.secondaryMetric,o=u(e,n,r,i),s=[];for(let t of r.rows){let n=t.dimensions[e.dimension];if(n===void 0)continue;let r=t.values[i],c=t.values[a];r!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:i,value:r}),c!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:a,value:c})}return{ok:!0,model:{...o,points:s,series:[{id:i,label:t(i,n.metrics[i]),role:`series`,slot:0},{id:a,label:t(a,n.metrics[a]),role:`secondary`,slot:1}]}}}function m(e,t,n,r){if(e.series)return{ok:!1,message:`A waterfall shows one metric; drop the series dimension`};let i=u(e,t,n,r),a=[],o=0;for(let t of n.rows){let n=t.dimensions[e.dimension],s=t.values[r];if(n===void 0||s==null)continue;let c=o;o+=s,a.push({x:n,xLabel:i.xLabels[n]??n,series:s>=0?`increase`:`decrease`,value:s,start:c,end:o})}let s=e.totalLabel??`Total`;return a.push({x:s,xLabel:s,series:`total`,value:o,start:0,end:o}),{ok:!0,model:{...i,points:a,xOrder:[...a.map(e=>e.x)],xLabels:{...i.xLabels,[s]:s},series:[{id:`increase`,label:`Increase`,role:`increase`,slot:null},{id:`decrease`,label:`Decrease`,role:`decrease`,slot:null},{id:`total`,label:s,role:`total`,slot:null}]}}}function h(e,t,n,r){let a=u(e,t,n,r),o=n.rows.map(t=>({key:t.dimensions[e.dimension]??``,value:t.values[r]??0})).filter(e=>e.value!==0);if(o.some(e=>e.value<0))return{ok:!1,message:`A part-to-whole chart cannot show negative values; use a bar chart`};let s=[...o].sort((e,t)=>t.value-e.value),l=s.length>6?s.slice(0,5):s,d=s.slice(l.length).reduce((e,t)=>e+t.value,0),f=c(t,e.dimension,l.map(e=>e.key)),p=new Map(l.map(e=>[e.key,e.value])),m=f.map((e,t)=>({id:e,label:a.xLabels[e]??e,role:`series`,slot:t})),h=f.map(e=>({x:e,xLabel:a.xLabels[e]??e,series:e,value:p.get(e)??0}));return d>0&&(m.push({id:i,label:i,role:`series`,slot:f.length}),h.push({x:i,xLabel:i,series:i,value:d})),{ok:!0,model:{...a,points:h,series:m,xOrder:h.map(e=>e.x)}}}function g(e,t){if(!t||t.x===void 0)return null;let n=String(t.x);return!e.xOrder.includes(n)||e.kind===`waterfall`&&n===e.xOrder[e.xOrder.length-1]?null:{x:n,series:t.series===void 0?``:String(t.series)}}export{d as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./log-
|
|
1
|
+
import{d as e}from"./log-7fGlFSON.js";import{t}from"./timer.adapter-BD7zwXEm.js";import{t as n}from"./runDetached-BWsF_7Xo.js";var r={blow:`/chat-sounds/Blow.mp3`,bottle:`/chat-sounds/Bottle.mp3`,frog:`/chat-sounds/Frog.mp3`,funk:`/chat-sounds/Funk.mp3`,glass:`/chat-sounds/Glass.mp3`,ping:`/chat-sounds/Ping.mp3`,pop:`/chat-sounds/Pop.mp3`,purr:`/chat-sounds/Purr.mp3`,tink:`/chat-sounds/Tink.mp3`};function i(t=e){return t.getVisibilityState()!==`visible`||!t.hasFocus()}function a(e){let t=new Audio(r[e]);return t.preload=`auto`,t.play()}async function o(e,r,i=t){if(r<=0)return;let o=Array.from({length:r},(t,r)=>new Promise(t=>{i.setTimeout(()=>{n(`chat sound`,a(e).finally(()=>t()))},r*90)}));await Promise.all(o)}function s(t,n=e){return t===`never`?!1:t===`always`||i(n)}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};t.node;var n=e(t),r={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};r.node;var i=e(r),a={writeText(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.writeText(e)},readText(){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.readText()}};export{i as n,n as r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./log-
|
|
1
|
+
import{c as e}from"./log-7fGlFSON.js";var t=[];function n(e,t){return`${e}:${t}`}var r=e()(e=>({boardsByOwner:{},viewByBoard:{},pageSizeByBoard:{},setBoards:(t,n)=>e(e=>({boardsByOwner:{...e.boardsByOwner,[t]:n}})),setBoardView:(t,n)=>e(e=>({viewByBoard:{...e.viewByBoard,[t]:n}})),growPage:t=>e(e=>{let n=e.viewByBoard[t];if(n&&!Object.values(n.cursors).some(e=>e!==null))return e;let r=e.pageSizeByBoard[t]??30;return{pageSizeByBoard:{...e.pageSizeByBoard,[t]:r+30}}}),clearBoardView:t=>e(e=>{if(!(t in e.viewByBoard))return e;let n={...e.viewByBoard};delete n[t];let r={...e.pageSizeByBoard};return delete r[t],{viewByBoard:n,pageSizeByBoard:r}})}));function i(e){return n=>n.boardsByOwner[e]??t}function a(e){return t=>t.viewByBoard[e]??null}function o(e){return t=>t.pageSizeByBoard[e]??30}var s={"muted-icon":`bg-muted-icon`,info:`bg-info`,success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive`};function c(e,t){return t!==null&&e>t}export{a,o as i,c as n,i as o,n as r,r as s,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{p as r}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{p as r}from"./log-7fGlFSON.js";import{c as i,l as a,n as o}from"./state-mark-CU2hw5D9.js";var s=e(t(),1),c=e=>Symbol.iterator in e,l=e=>`entries`in e,u=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},d=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function f(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:c(e)&&c(t)?l(e)&&l(t)?u(e,t):d(e,t):u({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function p(e){let t=s.useRef(void 0);return n=>{let r=e(n);return f(t.current,r)?t.current:t.current=r}}function m(e){if(e==null)return null;switch(typeof e){case`string`:case`boolean`:return e;case`number`:return Number.isFinite(e)?e:null}if(Array.isArray(e))return e.map(e=>m(e));if(r(e)){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=m(r));return t}return null}var h=e(n(),1);function g({tone:e,label:t}){return(0,h.jsx)(o,{tone:e,label:t})}function _({status:e}){return(0,h.jsx)(g,{tone:a(e),label:i(e)})}function v(e,t,n){let r=typeof e.maxTokens==`number`&&Number.isFinite(e.maxTokens)?e.maxTokens:null,i=r&&r>0?Math.min(100,e.usedTokens/r*100):null,a=r===null?null:Math.max(0,Math.round(r-e.usedTokens)),o=i===null?null:Math.max(0,100-i);return{...e,compactsAutomatically:e.compactsAutomatically||n,maxTokens:r??void 0,remainingTokens:a,usedPercentage:i,remainingPercentage:o,updatedAt:t}}function y(e){let t=e.some(e=>e.kind===`compact_boundary`||e.kind===`compact_summary`||e.kind===`context_cleared`);for(let n=e.length-1;n>=0;--n){let r=e[n];if(r&&!(r.kind!==`context_window_updated`||r.usage.usedTokens<=0))return v(r.usage,new Date(r.createdAt).toISOString(),t)}return null}function b(e,t){return!e||t===null||!Number.isFinite(t)||t<=0?e:v({...e,maxTokens:t},e.updatedAt,e.compactsAutomatically)}function x(e){return e===void 0||!Number.isFinite(e)||e<0?0:e}function S(e,t){let n=0,r=0,i=0,a=0;for(let t of e){if(t.kind!==`result`)continue;let e=t.usage;e&&(n+=x(e.inputTokens),r+=x(e.outputTokens),i+=x(e.cachedInputTokens)),a+=x(t.costUsd??e?.costUsd)}for(let e of t){let t=e.usage;t&&(n+=x(t.inputTokens),r+=x(t.outputTokens),i+=x(t.cachedInputTokens),a+=x(t.costUsd))}if(n===0&&r===0&&i===0&&a===0)return null;let o=n>0?i/n*100:null;return{inputTokens:n,outputTokens:r,cachedTokens:i,costUsd:a,cacheHitPercentage:o}}function C(e){return!Number.isFinite(e)||e<=0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function w(e){return e==null||!Number.isFinite(e)?`0`:e<1e3?`${Math.round(e)}`:e<1e4?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}m`}export{b as a,m as c,C as i,p as l,y as n,g as o,w as r,_ as s,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{ct as r,mn as i,mt as a,ot as o,st as s,yt as c}from"./useAppGlobalState-BwEVtuo2.js";import{c as l}from"./log-CYjZ_PZ1.js";import{c as u,f as d}from"./pendingActionsStore-By8_y_o0.js";import{Bt as f,Ht as p,Ut as m}from"./lexicalToReact-CfHucecr.js";import{m as h}from"./pushClient-DiLvwOUU.js";import{t as g}from"./timer.adapter-DsZB_-cb.js";import{t as _}from"./createScopedStore-C0pJOwR9.js";import{T as ee,h as v}from"./useTheme-BHNSJGUC.js";import{n as y,r as b,t as x}from"./popover-104yTR95.js";var S={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};S.node;var C=d(S),w={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};w.node;var T=d(w),E={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};E.node;var D=d(E),O={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};O.node;var k=d(O),A={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};A.node;var j=d(A),M={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};M.node;var N=d(M),P={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};P.node;var F=d(P),I={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};I.node;var L=d(I),R={name:`square-menu`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 8h10`,key:`1jw688`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h10`,key:`wp8him`}]],aliases:[`menu-square`]};R.node;var z=d(R),B={name:`square-minus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-square`]};B.node;var V=d(B);function H(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var U=e(t(),1),W=_(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function te(){return e=>({open:!1,query:``,setQuery:t=>e({query:t}),setPopoverOpen:t=>e(t?{open:!0}:{open:!1,query:``}),closeAndClearQuery:()=>e({open:!1,query:``})})}var G=_(`SearchableModelPopover`,te),K=e(n(),1),ne=[],re={openrouter:`Loading models… verify OpenRouter API key in Settings.`,custom:`No models configured. Add an endpoint in Settings → Providers.`};function ie({className:e,...t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:(0,K.jsx)(`path`,{d:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`})})}function ae({className:e,...t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:(0,K.jsx)(`path`,{d:`M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z`})})}function oe({className:e,...t}){return(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,K.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,K.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,K.jsx)(`path`,{d:`M2 12h4`}),(0,K.jsx)(`path`,{d:`M18 12h4`})]})}var q={claude:ie,codex:ae,openrouter:oe,custom:L};function J({onClick:e,selected:t,icon:n,label:r,description:i,disabled:a}){return(0,K.jsxs)(`button`,{onClick:e,disabled:a,className:u(`w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity`,t?`bg-muted border-border`:`hover:opacity-60`,a&&`opacity-40 cursor-not-allowed`),children:[n,(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function Y({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,K.jsx)(`button`,{disabled:!0,className:u(`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,t),children:e}):(0,K.jsx)(W.Provider,{init:void 0,children:(0,K.jsx)(se,{trigger:e,triggerClassName:t,children:r})})}function se({trigger:e,triggerClassName:t,children:n}){let r=W.useScopedStore(e=>e.open),i=W.useScopedStore(e=>e.setOpen);return(0,K.jsxs)(x,{open:r,onOpenChange:i,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:u(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t),children:e})}),(0,K.jsx)(y,{align:`center`,className:`w-64 p-1`,children:(0,K.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function ce({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){return(0,K.jsx)(G.Provider,{init:void 0,children:(0,K.jsx)(le,{models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i})})}function le({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){let a=G.useScopedStore(e=>e.open),o=G.useScopedStore(e=>e.query),s=G.useScopedStore(e=>e.setPopoverOpen),c=G.useScopedStore(e=>e.setQuery),l=G.useScopedStore(e=>e.closeAndClearQuery),d=(0,U.useCallback)(e=>{n(e),l()},[n,l]),p=e.find(e=>e.id===t)?.label??t,m=(0,U.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,o]),h;return h=e.length===0?(0,K.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:i}):m.length===0?(0,K.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):m.map(e=>(0,K.jsx)(J,{onClick:()=>d(e.id),selected:t===e.id,icon:(0,K.jsx)(T,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,K.jsxs)(x,{open:a,onOpenChange:s,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:u(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,K.jsx)(r,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{className:`max-w-[200px] truncate`,children:p})]})}),(0,K.jsxs)(y,{align:`center`,className:`w-80 p-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,K.jsx)(f,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`input`,{type:`text`,value:o,onChange:e=>c(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,K.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:h})]})]})}function ue({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:i=!1,model:l,modelOptions:d,onProviderChange:f,onModelChange:g,onModelOptionChange:_,planMode:y=!1,onPlanModeChange:b,includePlanMode:x=!0,className:S}){let C=ee(v),w=e.find(e=>e.id===t)??e[0],E=w?.id??t,O=q[E],k=T,A=x&&w?.supportsPlanMode&&b,M=E===`claude`&&`contextWindow`in d?d:null,P=E===`codex`&&`fastMode`in d?d:null,F=w?.models??ne,I=F.find(e=>e.id===l)?.contextWindowOptions??[],L=M?.contextWindow??o[0].id,R=L===`1m`?z:V,B=F.find(e=>e.id===l)?.label??l,H=c(E)?(0,K.jsx)(ce,{models:F,selectedModel:l,onSelect:e=>g?.(E,e),ModelIcon:k,emptyMessage:re[E]}):(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(k,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:B})]}),children:e=>F.map(t=>{let n=T;return(0,K.jsx)(J,{onClick:()=>{g?.(E,t.id),e()},selected:l===t.id,icon:(0,K.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:i&&E===`codex`&&t.id===`gpt-5.5`?(0,K.jsxs)(K.Fragment,{children:[t.label,` `,(0,K.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):t.label},t.id)})});return(0,K.jsxs)(`div`,{className:u(`flex md:justify-center items-center gap-0.5`,S),children:[n?(0,K.jsx)(Y,{disabled:!f,trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(O,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:w?.label??E})]}),children:t=>e.map(e=>{let n=q[e.id];return(0,K.jsx)(J,{onClick:()=>{f?.(e.id),t()},selected:E===e.id,icon:(0,K.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,g==null?(0,K.jsx)(h,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,K.jsxs)(`span`,{"aria-disabled":`true`,className:`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,children:[(0,K.jsx)(N,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:B})]})}):H,c(E)?null:(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:E===`claude`?s.find(e=>e.id===d.reasoningEffort)?.label??d.reasoningEffort:r.find(e=>e.id===d.reasoningEffort)?.label??d.reasoningEffort})]}),children:e=>E===`claude`?a(l,C).map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:d.reasoningEffort===t.id,icon:(0,K.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):r.map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`codexReasoningEffort`,effort:t.id}),e()},selected:d.reasoningEffort===t.id,icon:(0,K.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),E===`claude`&&I.length>1?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:I.find(e=>e.id===L)?.label??L})]}),children:e=>I.map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`contextWindow`,contextWindow:t.id}),e()},selected:L===t.id,icon:t.id===`1m`?(0,K.jsx)(z,{className:`h-4 w-4 text-muted-foreground`}):(0,K.jsx)(V,{className:`h-4 w-4 text-muted-foreground`}),label:t.label,description:t.id===`1m`?`Expanded context window`:`Standard context window`},t.id))}):null,E===`codex`?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[P?.fastMode?(0,K.jsx)(D,{className:`h-3.5 w-3.5`}):(0,K.jsx)(D,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,K.jsx)(`span`,{children:P?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:P?.fastMode?`text-success-text`:void 0,children:e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{onClick:()=>{_({type:`fastMode`,fastMode:!1}),e()},selected:!P?.fastMode,icon:(0,K.jsx)(D,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,K.jsx)(J,{onClick:()=>{_({type:`fastMode`,fastMode:!0}),e()},selected:!!P?.fastMode,icon:(0,K.jsx)(D,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,A?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[y?(0,K.jsx)(p,{className:`h-3.5 w-3.5`}):(0,K.jsx)(j,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:y?`Plan Mode`:`Full Access`})]}),triggerClassName:y?`text-info-text`:void 0,children:e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{onClick:()=>{b(!1),e()},selected:!y,icon:(0,K.jsx)(j,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,K.jsx)(J,{onClick:()=>{b(!0),e()},selected:y,icon:(0,K.jsx)(p,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var de=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],X={cursor:`/editor-icons/cursor.png`,defaultApp:`/editor-icons/default-app.png`,finder:`/editor-icons/finder.png`,preview:`/editor-icons/preview.png`,xcode:`/editor-icons/xcode.png`,terminal:`/editor-icons/terminal.png`,windsurf:`/editor-icons/windsurf.png`,custom:`/editor-icons/custom.png`};function Z({src:e,className:t}){return(0,K.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function fe({preset:e,className:t}){switch(e){case`xcode`:return(0,K.jsx)(Z,{src:X.xcode,className:t});case`windsurf`:return(0,K.jsx)(Z,{src:X.windsurf,className:t});case`custom`:return(0,K.jsx)(Z,{src:X.custom,className:t});default:return(0,K.jsx)(Z,{src:X.cursor,className:t})}}function pe({className:e}){return(0,K.jsx)(Z,{src:X.finder,className:e})}function me({className:e}){return(0,K.jsx)(Z,{src:X.preview,className:e})}function he({className:e}){return(0,K.jsx)(Z,{src:X.defaultApp,className:e})}function ge({className:e}){return(0,K.jsx)(i,{className:e})}function _e({className:e}){return(0,K.jsx)(Z,{src:X.terminal,className:e})}var ve=2e3,Q={},$=l()((e,t)=>({copiedTokens:Q,nextToken:1,markCopied:n=>{let r=t().nextToken;return e(e=>({nextToken:r+1,copiedTokens:{...e.copiedTokens,[n]:r}})),r},clearCopied:(n,r)=>{let{copiedTokens:i}=t();if(i[n]!==r)return;let a=Object.fromEntries(Object.entries(i).filter(([e])=>e!==n));e({copiedTokens:Object.keys(a).length>0?a:Q})}}));async function ye(e,t,n=g){await t();let r=$.getState().markCopied(e);n.setTimeout(()=>$.getState().clearCopied(e,r),ve)}function be(e){return $(t=>t.copiedTokens[e]!==void 0)}export{C as _,fe as a,me as c,J as d,H as f,k as g,N as h,de as i,_e as l,F as m,be as n,pe as o,L as p,he as r,ge as s,ye as t,ue as u};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{ct as r,mn as i,mt as a,ot as o,st as s,yt as c}from"./useAppGlobalState-uP5C1BG8.js";import{c as l}from"./log-7fGlFSON.js";import{c as u,f as d}from"./pendingActionsStore-idc6m2Ya.js";import{Bt as f,Ht as p,Ut as m}from"./lexicalToReact-DdXqoi0d.js";import{m as h}from"./pushClient-NeXrldi-.js";import{t as g}from"./timer.adapter-BD7zwXEm.js";import{t as _}from"./createScopedStore-DW4wfjbM.js";import{T as ee,h as v}from"./useTheme-B_JDh31l.js";import{n as y,r as b,t as x}from"./popover-gn1uvc-1.js";var S={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};S.node;var C=d(S),w={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};w.node;var T=d(w),E={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};E.node;var D=d(E),O={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};O.node;var k=d(O),A={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};A.node;var j=d(A),M={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};M.node;var N=d(M),P={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};P.node;var F=d(P),I={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};I.node;var L=d(I),R={name:`square-menu`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 8h10`,key:`1jw688`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h10`,key:`wp8him`}]],aliases:[`menu-square`]};R.node;var z=d(R),B={name:`square-minus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-square`]};B.node;var V=d(B);function H(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var U=e(t(),1),W=_(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function te(){return e=>({open:!1,query:``,setQuery:t=>e({query:t}),setPopoverOpen:t=>e(t?{open:!0}:{open:!1,query:``}),closeAndClearQuery:()=>e({open:!1,query:``})})}var G=_(`SearchableModelPopover`,te),K=e(n(),1),ne=[],re={openrouter:`Loading models… verify OpenRouter API key in Settings.`,custom:`No models configured. Add an endpoint in Settings → Providers.`};function ie({className:e,...t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:(0,K.jsx)(`path`,{d:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`})})}function ae({className:e,...t}){return(0,K.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:(0,K.jsx)(`path`,{d:`M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z`})})}function oe({className:e,...t}){return(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:u(`shrink-0`,e),...t,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,K.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,K.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,K.jsx)(`path`,{d:`M2 12h4`}),(0,K.jsx)(`path`,{d:`M18 12h4`})]})}var q={claude:ie,codex:ae,openrouter:oe,custom:L};function J({onClick:e,selected:t,icon:n,label:r,description:i,disabled:a}){return(0,K.jsxs)(`button`,{onClick:e,disabled:a,className:u(`w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity`,t?`bg-muted border-border`:`hover:opacity-60`,a&&`opacity-40 cursor-not-allowed`),children:[n,(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function Y({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,K.jsx)(`button`,{disabled:!0,className:u(`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,t),children:e}):(0,K.jsx)(W.Provider,{init:void 0,children:(0,K.jsx)(se,{trigger:e,triggerClassName:t,children:r})})}function se({trigger:e,triggerClassName:t,children:n}){let r=W.useScopedStore(e=>e.open),i=W.useScopedStore(e=>e.setOpen);return(0,K.jsxs)(x,{open:r,onOpenChange:i,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:u(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t),children:e})}),(0,K.jsx)(y,{align:`center`,className:`w-64 p-1`,children:(0,K.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function ce({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){return(0,K.jsx)(G.Provider,{init:void 0,children:(0,K.jsx)(le,{models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i})})}function le({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){let a=G.useScopedStore(e=>e.open),o=G.useScopedStore(e=>e.query),s=G.useScopedStore(e=>e.setPopoverOpen),c=G.useScopedStore(e=>e.setQuery),l=G.useScopedStore(e=>e.closeAndClearQuery),d=(0,U.useCallback)(e=>{n(e),l()},[n,l]),p=e.find(e=>e.id===t)?.label??t,m=(0,U.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,o]),h;return h=e.length===0?(0,K.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:i}):m.length===0?(0,K.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):m.map(e=>(0,K.jsx)(J,{onClick:()=>d(e.id),selected:t===e.id,icon:(0,K.jsx)(T,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,K.jsxs)(x,{open:a,onOpenChange:s,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:u(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,K.jsx)(r,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{className:`max-w-[200px] truncate`,children:p})]})}),(0,K.jsxs)(y,{align:`center`,className:`w-80 p-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,K.jsx)(f,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`input`,{type:`text`,value:o,onChange:e=>c(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,K.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:h})]})]})}function ue({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:i=!1,model:l,modelOptions:d,onProviderChange:f,onModelChange:g,onModelOptionChange:_,planMode:y=!1,onPlanModeChange:b,includePlanMode:x=!0,className:S}){let C=ee(v),w=e.find(e=>e.id===t)??e[0],E=w?.id??t,O=q[E],k=T,A=x&&w?.supportsPlanMode&&b,M=E===`claude`&&`contextWindow`in d?d:null,P=E===`codex`&&`fastMode`in d?d:null,F=w?.models??ne,I=F.find(e=>e.id===l)?.contextWindowOptions??[],L=M?.contextWindow??o[0].id,R=L===`1m`?z:V,B=F.find(e=>e.id===l)?.label??l,H=c(E)?(0,K.jsx)(ce,{models:F,selectedModel:l,onSelect:e=>g?.(E,e),ModelIcon:k,emptyMessage:re[E]}):(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(k,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:B})]}),children:e=>F.map(t=>{let n=T;return(0,K.jsx)(J,{onClick:()=>{g?.(E,t.id),e()},selected:l===t.id,icon:(0,K.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:i&&E===`codex`&&t.id===`gpt-5.5`?(0,K.jsxs)(K.Fragment,{children:[t.label,` `,(0,K.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):t.label},t.id)})});return(0,K.jsxs)(`div`,{className:u(`flex md:justify-center items-center gap-0.5`,S),children:[n?(0,K.jsx)(Y,{disabled:!f,trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(O,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:w?.label??E})]}),children:t=>e.map(e=>{let n=q[e.id];return(0,K.jsx)(J,{onClick:()=>{f?.(e.id),t()},selected:E===e.id,icon:(0,K.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,g==null?(0,K.jsx)(h,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,K.jsxs)(`span`,{"aria-disabled":`true`,className:`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,children:[(0,K.jsx)(N,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:B})]})}):H,c(E)?null:(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:E===`claude`?s.find(e=>e.id===d.reasoningEffort)?.label??d.reasoningEffort:r.find(e=>e.id===d.reasoningEffort)?.label??d.reasoningEffort})]}),children:e=>E===`claude`?a(l,C).map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:d.reasoningEffort===t.id,icon:(0,K.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):r.map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`codexReasoningEffort`,effort:t.id}),e()},selected:d.reasoningEffort===t.id,icon:(0,K.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),E===`claude`&&I.length>1?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(R,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:I.find(e=>e.id===L)?.label??L})]}),children:e=>I.map(t=>(0,K.jsx)(J,{onClick:()=>{_({type:`contextWindow`,contextWindow:t.id}),e()},selected:L===t.id,icon:t.id===`1m`?(0,K.jsx)(z,{className:`h-4 w-4 text-muted-foreground`}):(0,K.jsx)(V,{className:`h-4 w-4 text-muted-foreground`}),label:t.label,description:t.id===`1m`?`Expanded context window`:`Standard context window`},t.id))}):null,E===`codex`?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[P?.fastMode?(0,K.jsx)(D,{className:`h-3.5 w-3.5`}):(0,K.jsx)(D,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,K.jsx)(`span`,{children:P?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:P?.fastMode?`text-success-text`:void 0,children:e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{onClick:()=>{_({type:`fastMode`,fastMode:!1}),e()},selected:!P?.fastMode,icon:(0,K.jsx)(D,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,K.jsx)(J,{onClick:()=>{_({type:`fastMode`,fastMode:!0}),e()},selected:!!P?.fastMode,icon:(0,K.jsx)(D,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,A?(0,K.jsx)(Y,{trigger:(0,K.jsxs)(K.Fragment,{children:[y?(0,K.jsx)(p,{className:`h-3.5 w-3.5`}):(0,K.jsx)(j,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{children:y?`Plan Mode`:`Full Access`})]}),triggerClassName:y?`text-info-text`:void 0,children:e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{onClick:()=>{b(!1),e()},selected:!y,icon:(0,K.jsx)(j,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,K.jsx)(J,{onClick:()=>{b(!0),e()},selected:y,icon:(0,K.jsx)(p,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var de=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],X={cursor:`/editor-icons/cursor.png`,defaultApp:`/editor-icons/default-app.png`,finder:`/editor-icons/finder.png`,preview:`/editor-icons/preview.png`,xcode:`/editor-icons/xcode.png`,terminal:`/editor-icons/terminal.png`,windsurf:`/editor-icons/windsurf.png`,custom:`/editor-icons/custom.png`};function Z({src:e,className:t}){return(0,K.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function fe({preset:e,className:t}){switch(e){case`xcode`:return(0,K.jsx)(Z,{src:X.xcode,className:t});case`windsurf`:return(0,K.jsx)(Z,{src:X.windsurf,className:t});case`custom`:return(0,K.jsx)(Z,{src:X.custom,className:t});default:return(0,K.jsx)(Z,{src:X.cursor,className:t})}}function pe({className:e}){return(0,K.jsx)(Z,{src:X.finder,className:e})}function me({className:e}){return(0,K.jsx)(Z,{src:X.preview,className:e})}function he({className:e}){return(0,K.jsx)(Z,{src:X.defaultApp,className:e})}function ge({className:e}){return(0,K.jsx)(i,{className:e})}function _e({className:e}){return(0,K.jsx)(Z,{src:X.terminal,className:e})}var ve=2e3,Q={},$=l()((e,t)=>({copiedTokens:Q,nextToken:1,markCopied:n=>{let r=t().nextToken;return e(e=>({nextToken:r+1,copiedTokens:{...e.copiedTokens,[n]:r}})),r},clearCopied:(n,r)=>{let{copiedTokens:i}=t();if(i[n]!==r)return;let a=Object.fromEntries(Object.entries(i).filter(([e])=>e!==n));e({copiedTokens:Object.keys(a).length>0?a:Q})}}));async function ye(e,t,n=g){await t();let r=$.getState().markCopied(e);n.setTimeout(()=>$.getState().clearCopied(e,r),ve)}function be(e){return $(t=>t.copiedTokens[e]!==void 0)}export{C as _,fe as a,me as c,J as d,H as f,k as g,N as h,de as i,_e as l,F as m,be as n,pe as o,L as p,he as r,ge as s,ye as t,ue as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{l as r,u as i}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{l as r,u as i}from"./log-7fGlFSON.js";var a=e(t(),1),o=e(n(),1);function s(e,t){let n=(0,a.createContext)(null);function s({init:e,children:r}){let s=(0,a.useRef)(null);return s.current===null&&(s.current=i(t(e))),(0,o.jsx)(n.Provider,{value:s.current,children:r})}function c(){let t=(0,a.useContext)(n);if(t===null)throw Error(`${e}: useScopedStore must be used inside its Provider`);return t}function l(e){return r(c(),e)}return{Provider:s,useScopedStore:l,useScopedStoreApi:c}}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-idc6m2Ya.js";import{D as i,E as a,x as o}from"./chatFocusPolicy-DYR_9DV3.js";var s={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};s.node;var c=r(s),l=e(t(),1),u=e(n(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let t=e+`CollectionProvider`,[n,r]=a(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=f(e=>{let{scope:t,children:n}=e,r=l.useRef(null),i=l.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);d.displayName=t;let p=e+`CollectionSlot`,m=o(p),h=l.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=c(p,n),o=i(t,a.collectionRef);return(0,u.jsx)(m,{ref:o,children:r})});h.displayName=p;let g=e+`CollectionItemSlot`,_=`data-radix-collection-item`,v=o(g),y=l.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=l.useRef(null),s=i(t,o),d=c(g,n);return l.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,u.jsx)(v,{[_]:``,ref:s,children:r})});y.displayName=g;function b(t){let n=c(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return f(b,`useCollection`),[{Provider:d,Slot:h,ItemSlot:y},b,r]}f(p,`createCollection`);var m=new WeakMap,h=class e extends Map{static{f(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],m.set(this,!0)}set(e,t){return m.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=v(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=g(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=g(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return g(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function g(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_(e,t);return n===-1?void 0:e[n]}f(g,`at`);function _(e,t){let n=e.length,r=v(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}f(_,`toSafeIndex`);function v(e){return e!==e||e===0?0:Math.trunc(e)}f(v,`toSafeInteger`);function y(e){let t=e+`CollectionProvider`,[n,r]=a(t),[s,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new h,setItemMap:f(()=>void 0,`setItemMap`)}),d=f(({state:e,...t})=>e?(0,u.jsx)(m,{...t,state:e}):(0,u.jsx)(p,{...t}),`CollectionProvider`);d.displayName=t;let p=f(e=>{let t=T();return(0,u.jsx)(m,{...e,state:t})},`CollectionInit`);p.displayName=t+`Init`;let m=f(e=>{let{scope:t,children:n,state:r}=e,a=l.useRef(null),[o,c]=l.useState(null),d=i(a,c),[f,p]=r;return l.useEffect(()=>{if(!o)return;let e=C(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,u.jsx)(s,{scope:t,itemMap:f,setItemMap:p,collectionRef:d,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);m.displayName=t+`Impl`;let g=e+`CollectionSlot`,_=o(g),v=l.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=c(g,n),o=i(t,a.collectionRef);return(0,u.jsx)(_,{ref:o,children:r})});v.displayName=g;let y=e+`CollectionItemSlot`,x=o(y),w=l.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=l.useRef(null),[s,d]=l.useState(null),f=i(t,o,d),{setItemMap:p}=c(y,n),m=l.useRef(a);b(m.current,a)||(m.current=a);let g=m.current;return l.useEffect(()=>{let e=g;return p(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(S):(t.set(s,{...e,element:s}),t.toSorted(S)):t),()=>{p(e=>!s||!e.has(s)?e:(e.delete(s),new h(e)))}},[s,g,p]),(0,u.jsx)(x,{"data-radix-collection-item":``,ref:f,children:r})});w.displayName=y;function T(){return l.useState(new h)}f(T,`useInitCollection`);function E(t){let{itemMap:n}=c(e+`CollectionConsumer`,t);return n}return f(E,`useCollection`),[{Provider:d,Slot:v,ItemSlot:w},{createCollectionScope:r,useCollection:E,useInitCollection:T}]}f(y,`createCollection`);function b(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}f(b,`shallowEqual`);function x(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}f(x,`isElementPreceding`);function S(e,t){return!e[1].element||!t[1].element?0:x(e[1].element,t[1].element)?-1:1}f(S,`sortByDocumentPosition`);function C(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}f(C,`getChildListObserver`);var w=Object.defineProperty,T=(e,t)=>w(e,`name`,{value:t,configurable:!0}),E={LTR:`ltr`,RTL:`rtl`},D=l.createContext(void 0);function O(e){let t=l.useContext(D);return e||t||E.LTR}T(O,`useDirection`);export{p as n,c as r,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{P as r,q as i,t as a}from"./useQuery-Cqr8_M0q.js";import{a as o,c as s,f as c,n as l,r as u,s as d,t as f}from"./pendingActionsStore-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{P as r,q as i,t as a}from"./useQuery-Cqr8_M0q.js";import{a as o,c as s,f as c,n as l,r as u,s as d,t as f}from"./pendingActionsStore-idc6m2Ya.js";import{i as p,r as m}from"./host-C0p_56Re.js";import{t as ee}from"./globe-CQI7GjsK.js";import{t as te}from"./info-BXzVPePc.js";import{n as h,t as g}from"./triangle-alert-CQwDyl4K.js";import{t as _}from"./play-DltDjX9H.js";import{t as v}from"./createScopedStore-DW4wfjbM.js";import{F as y,S as b}from"./genui-CZI72r1O.js";var x={name:`arrow-down-right`,size:24,node:[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]};x.node;var S=c(x),C={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};C.node;var w=c(C),T={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};T.node;var E=c(T),D={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};D.node;var O=c(D),k={name:`diamond`,size:24,node:[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]};k.node;var A=c(k),j={name:`rectangle-horizontal`,size:24,node:[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`2`,key:`9lu3g6`}]]};j.node;var ne=c(j),M={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};M.node;var re=c(M),N={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};N.node;var P=c(N);function F(e){return e.type??`static`}function I(e){let t=new Map(e.nodes.map(e=>[e.id,0]));for(let n of e.edges)n.from!==n.to&&t.set(n.to,(t.get(n.to)??0)+1);let n=new Set,r=[];for(;r.length<e.nodes.length;){let i=e.nodes.find(e=>!n.has(e.id)&&t.get(e.id)===0)??e.nodes.find(e=>!n.has(e.id));if(!i)break;n.add(i.id),r.push(i);for(let n of e.edges)n.from===i.id&&n.to!==i.id&&t.set(n.to,(t.get(n.to)??0)-1)}return r}function L(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=new Map((e.groups??[]).map(e=>[e.id,e.label])),r=(e,n)=>{let r=t.get(e);return r?[{node:r,edge:n}]:[]};return I(e).map(t=>({node:t,groupLabel:t.group?n.get(t.group)??null:null,incoming:e.edges.filter(e=>e.to===t.id).flatMap(e=>r(e.from,e)),outgoing:e.edges.filter(e=>e.from===t.id).flatMap(e=>r(e.to,e))}))}function R(e){return{step:e.node.label,edge:F(e.edge),...e.edge.label?{label:e.edge.label}:{}}}function z(e,t){let n=L(e).find(e=>e.node.id===t);if(!n)return null;let{node:r}=n;return{...e.title?{diagram:e.title}:{},step:r.label,...r.description?{description:r.description}:{},...r.kind?{kind:r.kind}:{},...r.status?{status:r.status}:{},...n.groupLabel?{group:n.groupLabel}:{},...r.path?{path:r.path}:{},...r.line?{line:r.line}:{},upstream:n.incoming.map(R),downstream:n.outgoing.map(R)}}function B(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`h${(t>>>0).toString(16)}:${e.length}`}var V=e(t(),1),H=e(n(),1),U=(0,V.createContext)(null);function W({value:e,children:t}){return(0,H.jsx)(U.Provider,{value:e,children:t})}function G(){let e=(0,V.useContext)(U);if(!e)throw Error(`GenUI components render only inside a GenUI view`);return e}var K=v(`GenUIView`,()=>e=>({pendingAgentMessage:null,previewPath:null,previewProbe:null,refreshNonce:{},notice:null,proposeAgentMessage:t=>e({pendingAgentMessage:t,notice:null}),cancelAgentMessage:()=>e({pendingAgentMessage:null}),openPreview:t=>e({previewPath:t,previewProbe:null}),closePreview:()=>e({previewPath:null,previewProbe:null}),setPreviewProbe:t=>e({previewProbe:t}),refreshDataset:t=>e(e=>({refreshNonce:{...e.refreshNonce,[t]:(e.refreshNonce[t]??0)+1}})),showNotice:t=>e({notice:t})})),q=10,J=`genui-dataset`;function Y(e){return e.source===`file`?(e.refreshSeconds??q)*1e3:e.source===`mcp`&&e.refreshSeconds?e.refreshSeconds*1e3:!1}function X(e){let{spec:t}=G();return e?t.datasets?.[e]??null:null}function ie(e,t){let n=m(),i=X(e),o=K.useScopedStore(t=>e?t.refreshNonce[e]??0:0),s=i!==null&&i.source!==`inline`&&n.queryDataset!==null&&t!==null,c=(0,V.useMemo)(()=>!i||i.source!==`inline`||!t?null:y(i,i.rows,t),[i,t]),l=n.queryDataset,u=a({queryKey:[J,n.chatId,e,i?B(JSON.stringify(i)):null,t?JSON.stringify(t):null,o],queryFn:async()=>{if(!i||!t||!l)throw Error(`dataset is not queryable`);return await l(i,t,o>0)},enabled:s,placeholderData:r,refetchInterval:i&&s&&!n.readonly?Y(i):!1,retry:!1});if(!i)return{status:`error`,message:`This view refers to a dataset "${e??``}" it does not declare`};if(!t)return{status:`loading`};if(c)return c.ok?{status:`ok`,result:c.result,refreshing:!1}:{status:`error`,message:c.message};if(!n.queryDataset)return{status:`unavailable`,message:`Live data is not included in a shared view`};if(u.error)return{status:`error`,message:b.source_unavailable};let d=u.data;if(!d)return{status:`loading`};switch(d.status){case`ok`:return{status:`ok`,result:d.result,refreshing:u.isPlaceholderData};case`needs_approval`:return d;case`error`:return{status:`error`,message:`${b[d.code]}: ${d.message}`}}}var ae={neutral:`text-muted-foreground`,positive:`text-success-text`,negative:`text-destructive-text`,attention:`text-warning-text`,info:`text-info-text`};function Z(e){return ae[e]}function oe({tone:e,className:t}){let n=s(`h-3.5 w-3.5 shrink-0`,t);switch(e){case`positive`:return(0,H.jsx)(p,{className:n,"aria-hidden":`true`});case`negative`:return(0,H.jsx)(E,{className:n,"aria-hidden":`true`});case`attention`:return(0,H.jsx)(g,{className:n,"aria-hidden":`true`});case`info`:return(0,H.jsx)(te,{className:n,"aria-hidden":`true`});case`neutral`:return(0,H.jsx)(h,{className:n,"aria-hidden":`true`})}}function se(e){return e===`positive`?`positive`:e===`negative`?`negative`:`neutral`}function Q({trend:e,className:t}){let n=s(`h-3.5 w-3.5 shrink-0`,t);return e===`up`?(0,H.jsx)(w,{className:n,"aria-hidden":`true`}):e===`down`?(0,H.jsx)(S,{className:n,"aria-hidden":`true`}):(0,H.jsx)(h,{className:n,"aria-hidden":`true`})}function ce({component:e}){return(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(g,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),e,` could not be shown: its settings changed to an unsupported value`]})}function le({server:e,tool:t}){let n=m(),r=i(),a=f(`genui.dataset.approve`,n.chatId??``,e,t),s=u(a),c=n.approveTool;return c?(0,H.jsx)(o,{size:`sm`,variant:`outline`,pending:s,onClick:()=>{l(a,async()=>{await c(e,t),await r.invalidateQueries({queryKey:[J,n.chatId]})})},children:`Allow for this chat`}):null}function ue({state:e,minHeight:t,emptyLabel:n}){return(0,H.jsx)(`div`,{className:`flex items-center justify-center rounded-md border border-dashed border-border px-3 py-4 text-sm`,style:t?{minHeight:t}:void 0,children:(0,H.jsx)(de,{state:e,emptyLabel:n})})}function de({state:e,emptyLabel:t}){switch(e.status){case`loading`:return(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,role:`status`,children:[(0,H.jsx)(d,{}),` Loading data…`]});case`needs_approval`:return(0,H.jsxs)(`span`,{className:`flex flex-col items-center gap-2 text-center text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground`,children:[(0,H.jsx)(re,{className:`h-4 w-4`,"aria-hidden":`true`}),`Action requires approval`]}),(0,H.jsx)(`span`,{className:`max-w-prose text-xs`,children:e.message}),(0,H.jsx)(le,{server:e.server,tool:e.tool})]});case`unavailable`:return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:t??e.message});case`error`:return(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 text-destructive-text`,role:`alert`,children:[(0,H.jsx)(g,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),e.message]})}}function fe({label:e,minHeight:t}){return(0,H.jsx)(`div`,{className:`flex items-center justify-center rounded-md border border-dashed border-border px-3 py-4 text-sm text-muted-foreground`,style:t?{minHeight:t}:void 0,children:e})}var $={start:{icon:_,label:`Start`},end:{icon:P,label:`End`},process:{icon:ne,label:`Step`},decision:{icon:A,label:`Decision`},store:{icon:O,label:`Store`},external:{icon:ee,label:`External`}},pe={neutral:`bg-muted-foreground`,positive:`bg-success`,negative:`bg-destructive`,attention:`bg-warning`,info:`bg-info`};function me({node:e,className:t}){let n=$[e.kind??`process`],r=n.icon;return(0,H.jsx)(r,{className:s(`h-3.5 w-3.5 shrink-0 text-muted-foreground`,t),"aria-label":n.label})}function he({node:e}){if(!e.status)return null;let t=e.tone??`neutral`;return(0,H.jsxs)(`span`,{className:s(`flex shrink-0 items-center gap-1 text-xs font-medium whitespace-nowrap tabular-nums`,Z(t)),children:[(0,H.jsx)(`span`,{className:s(`h-1.5 w-1.5 rounded-full`,pe[t]),"aria-hidden":`true`}),e.status]})}function ge(e){if(!e.path)return null;let t=e.path.split(`/`).pop()??e.path;return e.line?`${t}:${e.line}`:t}export{B as _,ue as a,L as b,oe as c,Z as d,X as f,G as g,W as h,ge as i,Q as l,K as m,me as n,fe as o,ie as p,he as r,ce as s,$ as t,se as u,F as v,z as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};t.node;var n=e(t),r=1e3,i=60*r,a=60*i,o=24*a;function s(e){let t=Math.max(0,e);if(t<i)return`${Math.floor(t/r)}s`;if(t<a)return`${Math.floor(t/i)}m`;if(t<o){let e=Math.floor(t/a),n=Math.floor(t%a/i);return n===0?`${e}h`:`${e}h ${n}m`}let n=Math.floor(t/o),s=Math.floor(t%o/a);return s===0?`${n}d`:`${n}d ${s}h`}function c(e){let t=Math.max(0,e),n=Math.ceil(t/r);if(n<60)return`${String(n)}s`;let s=Math.ceil(t/i);if(s<60)return`${String(s)}m`;let c=Math.ceil(t/a);return c<24?`${String(c)}h`:`${String(Math.ceil(t/o))}d`}function l(e){let t=Math.max(0,e);if(t>=a)return s(t);let n=Math.floor(t/r);return`${Math.floor(n/60)}:${(n%60).toString().padStart(2,`0`)}`}export{n as i,c as n,l as r,s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,c as n,l as r,s as i,u as a}from"./useTheme-BHNSJGUC.js";import"./tools-MYv8-phR.js";var o=e({BIGINT_FORMAT_RANGES:()=>Fe,CONSTANT_CATCH:()=>vt,Class:()=>st,NUMBER_FORMAT_RANGES:()=>Pe,aborted:()=>y,allowsEval:()=>Se,assert:()=>f,assertEqual:()=>s,assertIs:()=>u,assertNever:()=>d,assertNotEqual:()=>c,assignProp:()=>h,attachSchema:()=>qe,base64ToUint8Array:()=>tt,base64urlToUint8Array:()=>rt,cached:()=>ne,captureStackTrace:()=>be,cleanEnum:()=>et,cleanRegex:()=>ie,clone:()=>Ae,cloneDef:()=>me,codePointLength:()=>Xe,constantCatch:()=>yt,createTransparentProxy:()=>je,defineLazy:()=>se,defineLazyInternal:()=>S,derived:()=>dt,esc:()=>ve,escapeRegex:()=>ke,explicitlyAborted:()=>Ge,extend:()=>ze,finalizeIssue:()=>x,floatSafeRemainder:()=>ae,getElementAtPath:()=>he,getEnumValues:()=>p,getLengthableOrigin:()=>Ze,getParsedType:()=>Ee,getSizableOrigin:()=>Je,hexToUint8Array:()=>at,hide:()=>ut,installLazyProp:()=>_t,isObject:()=>xe,isPlainObject:()=>Ce,issue:()=>$e,joinValues:()=>m,jsonStringifyReplacer:()=>ee,members:()=>ct,merge:()=>He,mergeDefs:()=>_,normalizeParams:()=>v,nullish:()=>re,numKeys:()=>Te,objectClone:()=>ce,omit:()=>Re,optionalKeys:()=>Ne,own:()=>lt,parsedType:()=>Qe,partial:()=>Ue,pick:()=>Ie,prefixIssues:()=>b,primitiveTypes:()=>Oe,promiseAllObject:()=>ge,propertyKeyTypes:()=>De,randomString:()=>_e,rawShape:()=>le,required:()=>We,safeExtend:()=>Ve,shallowClone:()=>we,slugify:()=>ye,stringifyPrimitive:()=>Me,toZod:()=>l,uint8ArrayToBase64:()=>nt,uint8ArrayToBase64url:()=>it,uint8ArrayToHex:()=>ot,unwrapMessage:()=>Ke});function s(e){return e}function c(e){return e}function l(){return e=>e}function u(e){}function d(e){throw Error(`Unexpected value in exhaustive check`)}function f(e){}function p(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>Me(e)).join(t)}function ee(e,t){return typeof t==`bigint`?t.toString():t}var te=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ne(e){return new te(e)}function re(e){return e==null}function ie(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ae(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var oe=Symbol(`evaluating`);function se(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==oe)return r===void 0&&(r=oe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ce(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function le(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function g(e){return le(e._zod.def)??e._zod.def.shape}function ue(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return h(this,t,e),e},enumerable:!0,configurable:!0})}function de(e,t,n){t in e?h(e,t,n):e[t]=n}function fe(e,t,n,r){let i=g(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ue(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):de(e,a,r?r(n.value,a):n.value))}}function pe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ue(e,n,()=>t[n]):de(e,n,r.value))}}function _(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function me(e){return _(e._zod.def)}function he(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ge(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function _e(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ve(e){return JSON.stringify(e)}function ye(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var be=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Se=ne(()=>{if(w.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ce(e){if(xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return xe(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function we(e){return Ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Te(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Ee=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},De=new Set([`string`,`number`,`symbol`]),Oe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ae(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function v(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function je(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Me(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ne(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Pe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ie(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return fe(i,e,Le(e,t)),Ae(e,_(n,{shape:i,checks:[]}))}function Le(e,t){let n=g(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Re(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Le(e,t)),a={};return fe(a,e,Reflect.ownKeys(g(e)).filter(e=>!i.has(e))),Ae(e,_(n,{shape:a,checks:[]}))}function ze(e,t){if(!Ce(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=g(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ae(e,_(e._zod.def,{shape:Be(e,t)}))}function Be(e,t){let n={};return fe(n,e,Reflect.ownKeys(g(e))),pe(n,t),n}function Ve(e,t){if(!Ce(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ae(e,_(e._zod.def,{shape:Be(e,t)}))}function He(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return fe(n,e,Reflect.ownKeys(g(e))),fe(n,t,Reflect.ownKeys(g(t))),Ae(e,_(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ue(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Le(t,n)):void 0,o={};return fe(o,t,Reflect.ownKeys(g(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ae(t,_(t._zod.def,{shape:o,checks:[]}))}function We(e,t,n){let r=n?new Set(Le(t,n)):void 0,i={};return fe(i,t,Reflect.ownKeys(g(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ae(t,_(t._zod.def,{shape:i}))}function y(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ge(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ke(e){return typeof e==`string`?e:e?.message}function qe(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function x(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ke(e.inst?._zod.def?.error?.(e))??Ke(a?.(e))??Ke(t?.error?.(e))??Ke(n.customError?.(e))??Ke(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}function Je(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var Ye=/[\uD800-\uDBFF]/;function Xe(e){let t=e.length;if(!Ye.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ze(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Qe(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function $e(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function et(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function tt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function nt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function rt(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return tt(t+`=`.repeat((4-t.length%4)%4))}function it(e){return nt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function at(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function ot(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var st=class{constructor(...e){}};function ct(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ft(e,n,r.value)}}function lt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function ut(e,t,n){return lt(e,t,n,!1)}function dt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return lt(this,n,r(this))},set(e){lt(this,n,e)}})}return t}function ft(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:lt(this,t,n.bind(this))},set(e){lt(this,t,e)}})}function pt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var mt,ht=!1,gt={configurable:!0,get(){ht=!0}};function S(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&mt!==e._zod){mt=void 0;return}mt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,gt);let e=ht;ht=!1;try{let r=n(this);return ht?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),ht||=e,r}catch(n){throw delete this[t],ht||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function _t(e,t,n,r){let i=pt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var vt=`~constantCatch`;function yt(e){let t=()=>e;return t[vt]=!0,t}var bt,xt=Object.freeze({status:`aborted`}),St={value:void 0,enumerable:!1},Ct=`captureStackTrace`in Error?Error:null;function wt(e){let t=Ct;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ct=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){St.value=new a(r);try{Object.defineProperty(n,"_zod",St)}finally{St.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),ct(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?wt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Tt=Symbol(`zod_brand`),Et=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Dt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(bt=globalThis).__zod_globalConfig??(bt.__zod_globalConfig={});var w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function Ot(){let e=this._zod;return e.message??=JSON.stringify(e.def,ee,2),e.message}function kt(e){this._zod.message=e}var At={get:Ot,set:kt,enumerable:!0,configurable:!0},jt={value:void 0,enumerable:!1},Mt=new WeakSet([Object.prototype,Error.prototype]),Nt=(e,t)=>{e.name=`$ZodError`,jt.value=t,Object.defineProperty(e,"issues",jt),jt.value=void 0,Object.defineProperty(e,"message",At);let n=Object.getPrototypeOf(e);Mt.has(n)||(Mt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Pt=C(`$ZodError`,Nt),E=C(`$ZodError`,Nt,void 0,{Parent:Error});function Ft(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function It(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ft(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Lt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Rt(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;s<e.length;){let n=e[s],i=s===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),Object.prototype.hasOwnProperty.call(r.properties,n)||Object.defineProperty(r.properties,n,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),r=r.properties[n]):(r.items??(r.items=[]),(a=r.items)[n]??(a[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),s++}}};return r(e),n}function zt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Bt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${zt(e.path)}`);return t.join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,c as n,l as r,s as i,u as a}from"./useTheme-B_JDh31l.js";import"./tools-Lo2VrFmM.js";var o=e({BIGINT_FORMAT_RANGES:()=>Fe,CONSTANT_CATCH:()=>vt,Class:()=>st,NUMBER_FORMAT_RANGES:()=>Pe,aborted:()=>y,allowsEval:()=>Se,assert:()=>f,assertEqual:()=>s,assertIs:()=>u,assertNever:()=>d,assertNotEqual:()=>c,assignProp:()=>h,attachSchema:()=>qe,base64ToUint8Array:()=>tt,base64urlToUint8Array:()=>rt,cached:()=>ne,captureStackTrace:()=>be,cleanEnum:()=>et,cleanRegex:()=>ie,clone:()=>Ae,cloneDef:()=>me,codePointLength:()=>Xe,constantCatch:()=>yt,createTransparentProxy:()=>je,defineLazy:()=>se,defineLazyInternal:()=>S,derived:()=>dt,esc:()=>ve,escapeRegex:()=>ke,explicitlyAborted:()=>Ge,extend:()=>ze,finalizeIssue:()=>x,floatSafeRemainder:()=>ae,getElementAtPath:()=>he,getEnumValues:()=>p,getLengthableOrigin:()=>Ze,getParsedType:()=>Ee,getSizableOrigin:()=>Je,hexToUint8Array:()=>at,hide:()=>ut,installLazyProp:()=>_t,isObject:()=>xe,isPlainObject:()=>Ce,issue:()=>$e,joinValues:()=>m,jsonStringifyReplacer:()=>ee,members:()=>ct,merge:()=>He,mergeDefs:()=>_,normalizeParams:()=>v,nullish:()=>re,numKeys:()=>Te,objectClone:()=>ce,omit:()=>Re,optionalKeys:()=>Ne,own:()=>lt,parsedType:()=>Qe,partial:()=>Ue,pick:()=>Ie,prefixIssues:()=>b,primitiveTypes:()=>Oe,promiseAllObject:()=>ge,propertyKeyTypes:()=>De,randomString:()=>_e,rawShape:()=>le,required:()=>We,safeExtend:()=>Ve,shallowClone:()=>we,slugify:()=>ye,stringifyPrimitive:()=>Me,toZod:()=>l,uint8ArrayToBase64:()=>nt,uint8ArrayToBase64url:()=>it,uint8ArrayToHex:()=>ot,unwrapMessage:()=>Ke});function s(e){return e}function c(e){return e}function l(){return e=>e}function u(e){}function d(e){throw Error(`Unexpected value in exhaustive check`)}function f(e){}function p(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>Me(e)).join(t)}function ee(e,t){return typeof t==`bigint`?t.toString():t}var te=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ne(e){return new te(e)}function re(e){return e==null}function ie(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ae(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var oe=Symbol(`evaluating`);function se(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==oe)return r===void 0&&(r=oe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ce(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function le(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function g(e){return le(e._zod.def)??e._zod.def.shape}function ue(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return h(this,t,e),e},enumerable:!0,configurable:!0})}function de(e,t,n){t in e?h(e,t,n):e[t]=n}function fe(e,t,n,r){let i=g(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ue(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):de(e,a,r?r(n.value,a):n.value))}}function pe(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ue(e,n,()=>t[n]):de(e,n,r.value))}}function _(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function me(e){return _(e._zod.def)}function he(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ge(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function _e(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ve(e){return JSON.stringify(e)}function ye(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var be=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Se=ne(()=>{if(w.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ce(e){if(xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return xe(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function we(e){return Ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Te(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Ee=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},De=new Set([`string`,`number`,`symbol`]),Oe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ae(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function v(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function je(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Me(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ne(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Pe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ie(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return fe(i,e,Le(e,t)),Ae(e,_(n,{shape:i,checks:[]}))}function Le(e,t){let n=g(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Re(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Le(e,t)),a={};return fe(a,e,Reflect.ownKeys(g(e)).filter(e=>!i.has(e))),Ae(e,_(n,{shape:a,checks:[]}))}function ze(e,t){if(!Ce(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=g(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ae(e,_(e._zod.def,{shape:Be(e,t)}))}function Be(e,t){let n={};return fe(n,e,Reflect.ownKeys(g(e))),pe(n,t),n}function Ve(e,t){if(!Ce(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ae(e,_(e._zod.def,{shape:Be(e,t)}))}function He(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return fe(n,e,Reflect.ownKeys(g(e))),fe(n,t,Reflect.ownKeys(g(t))),Ae(e,_(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ue(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Le(t,n)):void 0,o={};return fe(o,t,Reflect.ownKeys(g(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ae(t,_(t._zod.def,{shape:o,checks:[]}))}function We(e,t,n){let r=n?new Set(Le(t,n)):void 0,i={};return fe(i,t,Reflect.ownKeys(g(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ae(t,_(t._zod.def,{shape:i}))}function y(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ge(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ke(e){return typeof e==`string`?e:e?.message}function qe(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function x(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Ke(e.inst?._zod.def?.error?.(e))??Ke(a?.(e))??Ke(t?.error?.(e))??Ke(n.customError?.(e))??Ke(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}function Je(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var Ye=/[\uD800-\uDBFF]/;function Xe(e){let t=e.length;if(!Ye.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ze(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Qe(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function $e(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function et(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function tt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function nt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function rt(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return tt(t+`=`.repeat((4-t.length%4)%4))}function it(e){return nt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function at(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function ot(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var st=class{constructor(...e){}};function ct(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ft(e,n,r.value)}}function lt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function ut(e,t,n){return lt(e,t,n,!1)}function dt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return lt(this,n,r(this))},set(e){lt(this,n,e)}})}return t}function ft(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:lt(this,t,n.bind(this))},set(e){lt(this,t,e)}})}function pt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var mt,ht=!1,gt={configurable:!0,get(){ht=!0}};function S(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&mt!==e._zod){mt=void 0;return}mt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,gt);let e=ht;ht=!1;try{let r=n(this);return ht?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),ht||=e,r}catch(n){throw delete this[t],ht||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function _t(e,t,n,r){let i=pt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var vt=`~constantCatch`;function yt(e){let t=()=>e;return t[vt]=!0,t}var bt,xt=Object.freeze({status:`aborted`}),St={value:void 0,enumerable:!1},Ct=`captureStackTrace`in Error?Error:null;function wt(e){let t=Ct;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ct=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){St.value=new a(r);try{Object.defineProperty(n,"_zod",St)}finally{St.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),ct(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?wt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Tt=Symbol(`zod_brand`),Et=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Dt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(bt=globalThis).__zod_globalConfig??(bt.__zod_globalConfig={});var w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function Ot(){let e=this._zod;return e.message??=JSON.stringify(e.def,ee,2),e.message}function kt(e){this._zod.message=e}var At={get:Ot,set:kt,enumerable:!0,configurable:!0},jt={value:void 0,enumerable:!1},Mt=new WeakSet([Object.prototype,Error.prototype]),Nt=(e,t)=>{e.name=`$ZodError`,jt.value=t,Object.defineProperty(e,"issues",jt),jt.value=void 0,Object.defineProperty(e,"message",At);let n=Object.getPrototypeOf(e);Mt.has(n)||(Mt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Pt=C(`$ZodError`,Nt),E=C(`$ZodError`,Nt,void 0,{Parent:Error});function Ft(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function It(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ft(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Lt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Rt(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;s<e.length;){let n=e[s],i=s===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),Object.prototype.hasOwnProperty.call(r.properties,n)||Object.defineProperty(r.properties,n,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),r=r.properties[n]):(r.items??(r.items=[]),(a=r.items)[n]??(a[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),s++}}};return r(e),n}function zt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Bt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${zt(e.path)}`);return t.join(`
|
|
2
2
|
`)}function Vt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ht=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Et;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>x(e,o,T())));throw be(n,a?.callee??t),n}return s.value};return t},Ut=Ht(E),Wt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>x(e,o,T())));throw be(n,a?.callee??t),n}return s.value};return t},Gt=Wt(E),Kt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Et;return a.issues.length?Jt(e,a.issues,i):{success:!0,data:a.value}},qt=Kt(E);function Jt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>x(e,n,T()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Yt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Jt(e,a.issues,i):{success:!0,data:a.value}},Xt=Yt(E),Zt=Symbol.for(`zod.compile.invalid`),Qt=Symbol.for(`zod.compile.fallback`),$t=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Zt)return!0;if(r.definite===!0&&n===void 0)return!1}return en(e,t,n)});function en(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Qt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Et;return a.issues.length===0}var tn=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},nn=e=>{let t=Ht(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Vt(n,a))};return n},rn=nn(E),an=e=>{let t=Ht(e),n=(e,r,i,a)=>t(e,r,i,Vt(n,a));return n},on=an(E),sn=e=>{let t=Wt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Vt(n,a))};return n},cn=sn(E),ln=e=>{let t=Wt(e),n=async(e,r,i,a)=>await t(e,r,i,Vt(n,a));return n},un=ln(E),dn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Kt(e)(t,n,i)},fn=dn(E),pn=e=>(t,n,r)=>Kt(e)(t,n,r),mn=pn(E),hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Yt(e)(t,n,i)},gn=hn(E),_n=e=>async(t,n,r)=>Yt(e)(t,n,r),vn=_n(E),yn=e({anyString:()=>cr,base64:()=>qn,base64url:()=>Jn,bigint:()=>ur,boolean:()=>pr,browserEmail:()=>zn,cidrv4:()=>Gn,cidrv6:()=>Kn,creditCard:()=>$n,cuid:()=>bn,cuid2:()=>xn,currencyCode:()=>er,date:()=>ir,datetime:()=>sr,domain:()=>Xn,duration:()=>Dn,e164:()=>Qn,email:()=>Pn,emoji:()=>Vn,extendedDuration:()=>On,guid:()=>kn,hex:()=>vr,hostname:()=>Yn,html5Email:()=>Fn,httpProtocol:()=>Zn,iban:()=>tr,idnEmail:()=>Rn,integer:()=>dr,ipv4:()=>Hn,ipv6:()=>Un,ksuid:()=>wn,lowercase:()=>gr,mac:()=>Wn,md5_base64:()=>Sr,md5_base64url:()=>Cr,md5_hex:()=>xr,nanoid:()=>Tn,nanoidOfLength:()=>En,null:()=>mr,number:()=>fr,rfc5322Email:()=>In,sha1_base64:()=>Tr,sha1_base64url:()=>Er,sha1_hex:()=>wr,sha256_base64:()=>Or,sha256_base64url:()=>kr,sha256_hex:()=>Dr,sha384_base64:()=>jr,sha384_base64url:()=>Mr,sha384_hex:()=>Ar,sha512_base64:()=>Pr,sha512_base64url:()=>Fr,sha512_hex:()=>Nr,string:()=>lr,time:()=>or,ulid:()=>Sn,undefined:()=>hr,unicodeEmail:()=>Ln,uppercase:()=>_r,uuid:()=>An,uuid4:()=>jn,uuid6:()=>Mn,uuid7:()=>Nn,xid:()=>Cn}),bn=/^[cC][0-9a-z]{6,}$/,xn=/^[0-9a-z]+$/,Sn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Cn=/^[0-9a-vA-V]{20}$/,wn=/^[A-Za-z0-9]{27}$/,Tn=/^[a-zA-Z0-9_-]{21}$/;function En(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Dn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,On=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,An=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jn=An(4),Mn=An(6),Nn=An(7),Pn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,In=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ln=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Rn=Ln,zn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bn=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Vn(){return new RegExp(Bn,`u`)}var Hn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Un=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Wn=e=>{let t=ke(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Gn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Yn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xn=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Zn=/^https?$/,Qn=/^\+[1-9]\d{6,14}$/,$n=/^\d(?:[ -]?\d){11,18}$/,er=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,tr=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,nr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function rr(e){return RegExp(`^${e}$`)}var ir=rr(nr);function ar(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function or(e){return RegExp(`^${ar(e)}$`)}function sr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${ar({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${ar({precision:e.precision})}`:n;return RegExp(`^${nr}T(?:${r})$`)}var cr=/^[\s\S]{0,}$/,lr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ur=/^-?\d+n?$/,dr=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,pr=/^(?:true|false)$/i,mr=/^null$/i,hr=/^undefined$/i,gr=/^[^A-Z]*$/,_r=/^[^a-z]*$/,vr=/^[0-9a-fA-F]*$/;function yr(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function br(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var xr=/^[0-9a-fA-F]{32}$/,Sr=yr(22,`==`),Cr=br(22),wr=/^[0-9a-fA-F]{40}$/,Tr=yr(27,`=`),Er=br(27),Dr=/^[0-9a-fA-F]{64}$/,Or=yr(43,`=`),kr=br(43),Ar=/^[0-9a-fA-F]{96}$/,jr=yr(64,``),Mr=br(64),Nr=/^[0-9a-fA-F]{128}$/,Pr=yr(86,`==`),Fr=br(86),D=C(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ir=e=>{let t=e.value;return!re(t)&&t.size!==void 0},Lr=e=>{let t=e.value;return!re(t)&&t.length!==void 0},Rr={number:`number`,bigint:`bigint`,object:`date`},zr=C(`$ZodCheckLessThan`,(e,t)=>{D.init(e,t);let n=Rr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Rr[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Br=C(`$ZodCheckGreaterThan`,(e,t)=>{D.init(e,t);let n=Rr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Rr[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vr=C(`$ZodCheckMultipleOf`,(e,t)=>{D.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ae(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Hr=C(`$ZodCheckNumberFormat`,(e,t)=>{D.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Pe[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ur=C(`$ZodCheckBigIntFormat`,(e,t)=>{D.init(e,t);let[n,r]=Fe[t.format];e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Wr=C(`$ZodCheckMaxSize`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Je(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gr=C(`$ZodCheckMinSize`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Je(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kr=C(`$ZodCheckSizeEquals`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Je(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),qr=C(`$ZodCheckMaxLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Lr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Xe(r):i)<=t.maximum)return;let a=Ze(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Jr=C(`$ZodCheckMinLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Lr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Xe(r):i)>=t.minimum)return;let a=Ze(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Yr=C(`$ZodCheckLengthEquals`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Lr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Xe(r):i;if(a===t.length)return;let o=Ze(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Xr=C(`$ZodCheckStringFormat`,(e,t)=>{var n,r;D.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Zr=C(`$ZodCheckRegex`,(e,t)=>{Xr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qr=C(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=gr,Xr.init(e,t)}),$r=C(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=_r,Xr.init(e,t)}),ei=C(`$ZodCheckIncludes`,(e,t)=>{D.init(e,t);let n=ke(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ti=C(`$ZodCheckStartsWith`,(e,t)=>{D.init(e,t);let n=RegExp(`^${ke(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ni=C(`$ZodCheckEndsWith`,(e,t)=>{D.init(e,t);let n=RegExp(`.*${ke(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function ri(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues))}var ii=C(`$ZodCheckProperty`,(e,t)=>{D.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>ri(n,e,t.property));ri(n,e,t.property)}}),ai=C(`$ZodCheckProperties`,(e,t)=>{D.init(e,t),ut(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>ri(t,r,e)))):ri(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),oi=C(`$ZodCheckMimeType`,(e,t)=>{D.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),si=C(`$ZodCheckOverwrite`,(e,t)=>{D.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ci=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
3
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
4
4
|
`)}\n};`)(...Object.values(this.closed))}},li={major:4,minor:6,patch:5},O=C(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=li;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=y(t),a;for(let o of n){if(o._zod.def.when){if(Ge(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Et;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(qe(t.issues,n,e),i||=y(t,n))});else{if(t.issues.length===n)continue;qe(t.issues,n,e),i||=y(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(y(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Et;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Et;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return ut(this,`~standard`,fi(this))},set"~standard"(e){lt(this,`~standard`,e)}}),ui=(e,t)=>e.issues.length?{issues:e.issues.map(e=>x(e,t,T()))}:{value:e.value};async function di(e,t){let n={async:!0};return ui(await e._zod.run({value:t,issues:[]},n),n)}function fi(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ui(r,n)}catch{}return di(e,t)},vendor:`zod`,version:1}}var pi=C(`$ZodString`,(e,t)=>{O.init(e,t),e._zod.pattern=t.pattern??cr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),k=C(`$ZodStringFormat`,(e,t)=>{Xr.init(e,t),pi.init(e,t)}),mi=C(`$ZodGUID`,(e,t)=>{t.pattern??=kn,k.init(e,t)}),hi=C(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=An(e)}else t.pattern??=An();k.init(e,t)}),gi=C(`$ZodEmail`,(e,t)=>{t.pattern??=Pn,k.init(e,t)});function _i(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function vi(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?_i(e)||2:yi(e,t)}function yi(e,t){if(!t.normalize&&t.protocol?.source===Zn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var bi=/[\t\n\r]/g;function xi(e){return e.replace(bi,``)}function Si(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ci(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var wi=C(`$ZodURL`,(e,t)=>{k.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=vi(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=xi(r);return}t.hostname&&!Si(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Ci(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:xi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ti=C(`$ZodEmoji`,(e,t)=>{t.pattern??=Vn(),k.init(e,t)}),Ei=C(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Tn:En(t.length),k.init(e,t)}),Di=C(`$ZodCUID`,(e,t)=>{t.pattern??=bn,k.init(e,t)}),Oi=C(`$ZodCUID2`,(e,t)=>{t.pattern??=xn,k.init(e,t)}),ki=C(`$ZodULID`,(e,t)=>{t.pattern??=Sn,k.init(e,t)}),Ai=C(`$ZodXID`,(e,t)=>{t.pattern??=Cn,k.init(e,t)}),ji=C(`$ZodKSUID`,(e,t)=>{t.pattern??=wn,k.init(e,t)}),Mi=C(`$ZodISODateTime`,(e,t)=>{t.pattern??=sr(t),k.init(e,t)}),Ni=C(`$ZodISODate`,(e,t)=>{t.pattern??=ir,k.init(e,t)}),Pi=C(`$ZodISOTime`,(e,t)=>{t.pattern??=or(t),k.init(e,t)}),Fi=C(`$ZodISODuration`,(e,t)=>{t.pattern??=Dn,k.init(e,t)}),Ii=C(`$ZodIPv4`,(e,t)=>{t.pattern??=Hn,k.init(e,t)}),Li=/^[0-9a-fA-F:.]+$/;function Ri(e){return Li.test(e)?_i(`http://[${e}]`):!1}var zi=C(`$ZodIPv6`,(e,t)=>{t.pattern??=Un,k.init(e,t),e._zod.check=n=>{Ri(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Bi=C(`$ZodMAC`,(e,t)=>{t.pattern??=Wn(t.delimiter),k.init(e,t)}),Vi=C(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gn,k.init(e,t)});function Hi(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ri(n)}var Ui=C(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kn,k.init(e,t),e._zod.check=n=>{Hi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Wi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Gi=/^[0-9a-zA-Z+/]*={0,2}$/,Ki=C(`$ZodBase64`,(e,t)=>{t.pattern??=Gi,k.init(e,t),e._zod.check=n=>{Wi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),qi=/^[A-Za-z0-9_-]*$/;function Ji(e){if(!qi.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Wi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Yi=C(`$ZodBase64URL`,(e,t)=>{t.pattern??=qi,k.init(e,t),e._zod.check=n=>{Ji(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xi=C(`$ZodE164`,(e,t)=>{t.pattern??=Qn,k.init(e,t)}),Zi=/[- ]/g;function Qi(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}function $i(e){return $n.test(e)?Qi(e.replace(Zi,``)):!1}var ea=C(`$ZodCreditCard`,(e,t)=>{t.pattern??=$n,k.init(e,t),e._zod.check=n=>{$i(n.value)||n.issues.push({code:`invalid_format`,format:`credit_card`,input:n.value,inst:e,continue:!t.abort})}});function ta(e){let t=0,n=e.length;for(let r=4;r<n;r++){let n=e.charCodeAt(r);t=(n>=65?t*100+(n-55):t*10+(n-48))%97}for(let n=0;n<4;n++){let r=e.charCodeAt(n);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function na(e){return tr.test(e)?ta(e):!1}var ra=C(`$ZodIBAN`,(e,t)=>{t.pattern??=tr,k.init(e,t),e._zod.check=n=>{na(n.value)||n.issues.push({code:`invalid_format`,format:`iban`,input:n.value,inst:e,continue:!t.abort})}});function ia(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var aa=C(`$ZodJWT`,(e,t)=>{k.init(e,t),e._zod.check=n=>{ia(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),oa=C(`$ZodCustomStringFormat`,(e,t)=>{k.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),sa=C(`$ZodNumber`,(e,t)=>{O.init(e,t),e._zod.pattern=fr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ca=C(`$ZodNumberFormat`,(e,t)=>{Hr.init(e,t),sa.init(e,t)}),la=C(`$ZodBoolean`,(e,t)=>{O.init(e,t),e._zod.pattern=pr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),ua=C(`$ZodBigInt`,(e,t)=>{O.init(e,t),e._zod.pattern=ur,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),da=C(`$ZodBigIntFormat`,(e,t)=>{Ur.init(e,t),ua.init(e,t)}),fa=C(`$ZodSymbol`,(e,t)=>{O.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),pa=C(`$ZodUndefined`,(e,t)=>{O.init(e,t),e._zod.pattern=hr,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ma=C(`$ZodNull`,(e,t)=>{O.init(e,t),e._zod.pattern=mr,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ha=C(`$ZodAny`,(e,t)=>{O.init(e,t),e._zod.parse=e=>e}),ga=C(`$ZodUnknown`,(e,t)=>{O.init(e,t),e._zod.parse=e=>e}),_a=C(`$ZodNever`,(e,t)=>{O.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),va=C(`$ZodVoid`,(e,t)=>{O.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),ya=C(`$ZodDate`,(e,t)=>{O.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function ba(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues)),t.value[n]=e.value}var xa=C(`$ZodArray`,(e,t)=>{O.init(e,t);let n=w.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ba(t,r,e)));else if(ba(c,r,e),s&&c.issues.length!==0&&y(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Sa(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...b(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Ca=[];function wa(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Ca,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ne(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Ta(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(y(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Sa(e,n,i,t,d,f))):Sa(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Ea=C(`$ZodObject`,(e,t)=>{O.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=ne(()=>wa(t));S(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||h(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xe,o=t.catchall,s,c=w.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(y(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Sa(n,t,e,r,a,o))):Sa(s,t,e,r,a,o)}return o?Ta(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Da=C(`$ZodObjectJIT`,(e,t)=>{Ea.init(e,t);let n=e._zod.parse,r=ne(()=>wa(t)),i=w.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ci([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-idc6m2Ya.js";var t={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-idc6m2Ya.js";var i={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};i.node;var a=r(i),o=e(t(),1),s=e(n(),1),c={chatId:null,readonly:!0,workspaceRoot:null,queryDataset:null,approveTool:null,sendToAgent:null,openLink:()=>{},ChartRenderer:null,FlowRenderer:null},l=(0,o.createContext)(c);function u({value:e,children:t}){return(0,s.jsx)(l.Provider,{value:e,children:t})}function d(){return(0,o.useContext)(l)}export{a as i,c as n,d as r,u as t};
|