@cuongtran001/kanna 1.83.2 → 1.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{BoardsPage-mm_dy-6I.js → BoardsPage-DjXjDuRd.js} +1 -1
- package/dist/client/assets/{BoardsRoutePage-B7dJA_QL.js → BoardsRoutePage-BZzJC4M6.js} +1 -1
- package/dist/client/assets/{ChatPage-Bw4peAkb.js → ChatPage-hEXrvtW-.js} +3 -3
- package/dist/client/assets/{CronJobRow-DKW6LnKe.js → CronJobRow-BLAAn194.js} +1 -1
- package/dist/client/assets/{CronJobsPage-CBxttYFH.js → CronJobsPage-W6GlW2Uy.js} +1 -1
- package/dist/client/assets/{CronRunMessage-B4x7mzzh.js → CronRunMessage-D0Qoy3uj.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-iaBNZ_R0.js → FilePreviewSheet-04ZguH1k.js} +1 -1
- package/dist/client/assets/{FlowSurface-B3kKtCHA.js → FlowSurface-Bs2DOgfu.js} +1 -1
- package/dist/client/assets/{GenUIBlock-CMM23p8L.js → GenUIBlock-CHl_B-Nm.js} +2 -2
- package/dist/client/assets/{InboxPage-C_QKGmlx.js → InboxPage-DW8ljScO.js} +1 -1
- package/dist/client/assets/{KannaSocketProvider-Clv949La.js → KannaSocketProvider-Bw4DvDDN.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-BLF1dYUW.js → LocalProjectsPage-DUp1SEg-.js} +1 -1
- package/dist/client/assets/{SettingsPage-CITPPDfV.js → SettingsPage-BiXGmGWw.js} +4 -4
- package/dist/client/assets/{StackBoardsRoutePage-BX-fo655.js → StackBoardsRoutePage-DUe7ECRH.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-BbLzqXn7.js → ToolCallMessage-1gGAiUVa.js} +1 -1
- package/dist/client/assets/{VChartSurface-D9jlaiQA.js → VChartSurface-D5E7i7Qk.js} +1 -1
- package/dist/client/assets/WebhooksPage-Dc_dYxqW.js +4 -0
- package/dist/client/assets/{WorkflowsPage-ndxOqUWo.js → WorkflowsPage-Dt_YJIYD.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-DgbttKnk.js → WorkflowsSection-Dn5NLie_.js} +1 -1
- package/dist/client/assets/{appSettingsStore-CDBkjKuH.js → appSettingsStore-BBfwETzX.js} +1 -1
- package/dist/client/assets/{arrow-left-DOANYNxC.js → arrow-left-CfIaqB4b.js} +1 -1
- package/dist/client/assets/{chart-renderer-Cw-dI71U.js → chart-renderer-DFgyTjFH.js} +1 -1
- package/dist/client/assets/{chatSounds-Cjf1Ow1m.js → chatSounds-DnB6LG-Z.js} +1 -1
- package/dist/client/assets/chevron-down-C3wqMsmk.js +1 -0
- package/dist/client/assets/chevron-left-D3epb-3S.js +1 -0
- package/dist/client/assets/{clipboard.adapter-BCxT7Qli.js → clipboard.adapter-hbKWYB9v.js} +1 -1
- package/dist/client/assets/{columnStyle-aXeR3SrA.js → columnStyle-C7KkAG5L.js} +1 -1
- package/dist/client/assets/{contextWindow-I-trSDu4.js → contextWindow-DXZRM56M.js} +1 -1
- package/dist/client/assets/{copyFeedbackStore-BW6Vjufv.js → copyFeedbackStore-D3VJJOPQ.js} +1 -1
- package/dist/client/assets/{createScopedStore-D1trFyJw.js → createScopedStore-BOB83agV.js} +1 -1
- package/dist/client/assets/{cronJobsStore-CndqKrjB.js → cronJobsStore-Bmd92Wdu.js} +1 -1
- package/dist/client/assets/{ellipsis-CFHwUFtG.js → ellipsis-CjyUt6mM.js} +1 -1
- package/dist/client/assets/{external-link-9xEpmM2n.js → external-link-DIOTFxAO.js} +1 -1
- package/dist/client/assets/{flow-kinds-DnUaQXgl.js → flow-kinds-CVdBVMES.js} +1 -1
- package/dist/client/assets/{folder-Bg7BAFNU.js → folder-CZMcdIZq.js} +1 -1
- package/dist/client/assets/{genui-jdDJe0VI.js → genui-Dwk7MqBN.js} +1 -1
- package/dist/client/assets/{globe-CeniwLw3.js → globe-BGOCLzBK.js} +1 -1
- package/dist/client/assets/{host-BNDj5_aa.js → host-Bn7kXks2.js} +1 -1
- package/dist/client/assets/{inbox-C62UubNn.js → inbox-OLNazs7P.js} +1 -1
- package/dist/client/assets/{inboxStore-Bks9mpiK.js → inboxStore-DkhqWd7E.js} +1 -1
- package/dist/client/assets/{index-Dp3JEZQ3.js → index-B1Wsyw2i.js} +3 -3
- package/dist/client/assets/{info-BMdKmB36.js → info-BUS8wzM_.js} +1 -1
- package/dist/client/assets/{input-CS1DBeNV.js → input-CvrFJg7l.js} +1 -1
- package/dist/client/assets/{lexicalToReact-CkI42EHr.js → lexicalToReact-TD2k-lRz.js} +3 -3
- package/dist/client/assets/{log-3sQ-5rrS.js → log-DeYiYzru.js} +1 -1
- package/dist/client/assets/{monitor-_V-BjQpD.js → monitor-BiV6DsHv.js} +1 -1
- package/dist/client/assets/{pencil-BTeN1rO_.js → pencil-D4taLrpW.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-C9wopHr4.js → pendingActionsStore-2LSejcqM.js} +1 -1
- package/dist/client/assets/{play-C_g7W9ao.js → play-C_RZ57yb.js} +1 -1
- package/dist/client/assets/{plus-D0uUa5kJ.js → plus-Dt1R6Ec0.js} +1 -1
- package/dist/client/assets/{popover-CA332KD1.js → popover-Byr25LbG.js} +1 -1
- package/dist/client/assets/runDetached-CZb0BmgP.js +1 -0
- package/dist/client/assets/{search-48C1GM_8.js → search-DLUiqdl3.js} +1 -1
- package/dist/client/assets/{searchable-select-C2LG0o1C.js → searchable-select-0lGC5Dbu.js} +1 -1
- package/dist/client/assets/{segmented-control-DbmDSdKy.js → segmented-control-A3JAN-14.js} +1 -1
- package/dist/client/assets/{select-BKHnGLKS.js → select-k2e8CCUh.js} +1 -1
- package/dist/client/assets/{settings-header-button-D4w0LZ-R.js → settings-header-button-Ba-h5PgF.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-BQ059yIu.js → sidebarPendingActions-Dp77KdwI.js} +1 -1
- package/dist/client/assets/{square-pen-C5BA26g7.js → square-pen-DkAUPV7D.js} +1 -1
- package/dist/client/assets/{state-mark-DNAt8L4c.js → state-mark-BoEXhyKA.js} +1 -1
- package/dist/client/assets/{terminal-DDMsYlkg.js → terminal-Be54a8lM.js} +1 -1
- package/dist/client/assets/{timer.adapter-Di4tkt37.js → timer.adapter-xKYiziSz.js} +1 -1
- package/dist/client/assets/{tools-CeacgJBu.js → tools-C_pxctuN.js} +1 -1
- package/dist/client/assets/{triangle-alert-B6T8mkaG.js → triangle-alert-CWM6skP7.js} +1 -1
- package/dist/client/assets/{useAppGlobalState-C6_aikPC.js → useAppGlobalState-DgWkgOn7.js} +1 -1
- package/dist/client/assets/{useKannaState-BESpYf4x.js → useKannaState-C_NyiDTL.js} +2 -2
- package/dist/client/assets/{useTheme-V_0ZRiiP.js → useTheme-C-9wxUOa.js} +1 -1
- package/dist/client/assets/{webhook-_4KNokhW.js → webhook-CE6utUYg.js} +1 -1
- package/dist/client/assets/{webhookCommands-ClSc7rRQ.js → webhookCommands-Cxvl4R_Z.js} +1 -1
- package/dist/client/assets/{webhooksStore-DmkDHteX.js → webhooksStore-BZKAEqao.js} +3 -3
- package/dist/client/index.html +41 -41
- package/package.json +4 -1
- package/src/server/webhooks/webhook-filter.ts +162 -0
- package/src/server/webhooks/webhook-http-routes.test.ts +68 -1
- package/src/server/webhooks/webhook-http-routes.ts +14 -1
- package/src/server/webhooks/webhook-registry.test.ts +67 -0
- package/src/server/webhooks/webhook-registry.ts +62 -4
- package/src/server/webhooks/webhook-store.adapter.test.ts +13 -0
- package/src/server/webhooks/webhook-store.adapter.ts +8 -0
- package/src/server/ws-router-webhooks.ts +12 -0
- package/src/shared/webhooks/types.ts +8 -3
- package/src/shared/webhooks/validate.ts +4 -0
- package/dist/client/assets/WebhooksPage-DGi5OTMt.js +0 -1
- package/dist/client/assets/chevron-down-Coo9PgPJ.js +0 -1
- package/dist/client/assets/chevron-left-n1tLJKrp.js +0 -1
- package/dist/client/assets/runDetached-BBRv1zoc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./log-
|
|
1
|
+
import{c as e}from"./log-DeYiYzru.js";var t=1e3,n=5e3;function r(e){return Number.isFinite(e)?Math.min(n,Math.max(500,Math.round(e))):t}var i={enabled:!0,publicUrl:null};function a(e){if(e===`localhost`||e===`[::1]`)return!0;let t=e.split(`.`);return t.length===4&&t[0]===`127`&&t.every(e=>/^\d+$/.test(e)&&Number(e)<=255)}function o(e){if(e===null)return null;let t;try{t=new URL(e.trim())}catch{return null}return t.protocol===`https:`||t.protocol===`http:`&&a(t.hostname)?t.origin:null}function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(e){return Array.isArray(e)}function l(e){try{return JSON.parse(e)}catch{return null}}var u={enabled:!1,mode:`embedded`,url:`nats://127.0.0.1:4222`,stream:{name:`KANNA`,subjectPrefix:`kanna`,extraSubjects:[],retention:`limits`,storage:`file`,maxAgeDays:30,maxBytesMb:512,maxMsgs:-1,discard:`old`,duplicateWindowSec:120,replicas:1},consumers:[],embedded:{maxMemoryStoreMb:256,maxFileStoreMb:2048,port:`auto`,logLevel:`info`}},d={min:1,max:3650},f={min:1,max:1048576},p={min:0,max:7200},m={min:1,max:5},h={min:1,max:3600},g={min:1,max:1e6},_={min:16,max:1048576},v=/^[A-Za-z0-9_-]{1,64}$/,y=/^[a-z][a-z0-9_-]*$/,b=/^[A-Za-z0-9_-]+$/,x=/^(?:nats|tls|ws|wss):\/\/[^\s/]+$/;function S(e){return e.length<8?null:e.slice(-4)}function C(e){let t=e.split(`.`);return t.every((e,n)=>e===`>`?n===t.length-1:e===`*`||b.test(e))}function w(e,t){return Number.isInteger(e)&&e>=t.min&&e<=t.max}function T(e){let t=[];v.test(e.name)||t.push(`Stream name must be 1–64 letters, digits, - or _`),y.test(e.subjectPrefix)||t.push(`Subject prefix must start with a lowercase letter and use lowercase letters, digits, - or _`);for(let n of e.extraSubjects)C(n)||t.push(`Extra subject "${n}" is not a valid NATS subject`);return w(e.maxAgeDays,d)||t.push(`Max age must be 1–3650 days`),w(e.maxBytesMb,f)||t.push(`Max bytes must be 1–1048576 MB`),(!Number.isInteger(e.maxMsgs)||e.maxMsgs!==-1&&e.maxMsgs<1)&&t.push(`Max messages must be -1 (unlimited) or at least 1`),w(e.duplicateWindowSec,p)||t.push(`Duplicate window must be 0–7200 seconds`),w(e.replicas,m)||t.push(`Replicas must be 1–5`),t}function E(e){let t=[],n=new Set;for(let r of e)v.test(r.durableName)||t.push(`Consumer name "${r.durableName}" must be 1–64 letters, digits, - or _`),n.has(r.durableName)&&t.push(`Consumer name "${r.durableName}" is used twice`),n.add(r.durableName),r.filterSubject.length>0&&!C(r.filterSubject)&&t.push(`Consumer "${r.durableName}" filter is not a valid NATS subject`),w(r.ackWaitSec,h)||t.push(`Consumer "${r.durableName}" ack wait must be 1–3600 seconds`),w(r.maxAckPending,g)||t.push(`Consumer "${r.durableName}" max ack pending must be 1–1000000`);return t}function D(e){let t=[];return w(e.maxMemoryStoreMb,_)||t.push(`Memory store must be 16–1048576 MB`),w(e.maxFileStoreMb,_)||t.push(`File store must be 16–1048576 MB`),e.port!==`auto`&&!w(e.port,{min:1024,max:65535})&&t.push(`Port must be auto or 1024–65535`),t}function O(e){let t=[...T(e.stream),...E(e.consumers),...D(e.embedded)];return e.mode===`external`&&!x.test(e.url)&&t.push(`Server URL must look like nats://host:4222`),t}var k={...u,tokenHint:null};function A(e,t){if(t===void 0)return e;let{token:n,...r}=t,i=n?.trim()??``,a=i.length>0?S(i):e.tokenHint,o=n===null?null:a;return{...e,...r,stream:{...e.stream,...t.stream},consumers:t.consumers??e.consumers,embedded:{...e.embedded,...t.embedded},tokenHint:o}}var j={state:`disabled`,mode:`embedded`,lastError:null,published:0,dropped:0,queued:0,consumers:[],since:0};function M(e,t){return{...e,...t,terminal:{...e.terminal,...t.terminal},panes:{...e.panes,...t.panes},editor:{...e.editor,...t.editor},typography:{...e.typography,...t.typography},providerDefaults:{claude:{...e.providerDefaults.claude,...t.providerDefaults?.claude,modelOptions:{...e.providerDefaults.claude.modelOptions,...t.providerDefaults?.claude?.modelOptions}},codex:{...e.providerDefaults.codex,...t.providerDefaults?.codex,modelOptions:{...e.providerDefaults.codex.modelOptions,...t.providerDefaults?.codex?.modelOptions}},openrouter:{...e.providerDefaults.openrouter,...t.providerDefaults?.openrouter,modelOptions:{}},custom:{...e.providerDefaults.custom,...t.providerDefaults?.custom,modelOptions:{}}},cloudflareTunnel:{...e.cloudflareTunnel,...t.cloudflareTunnel},push:{...e.push,...t.push},telemetry:{...e.telemetry,...t.telemetry},claudeAuth:{tokens:t.claudeAuth?.tokens??e.claudeAuth.tokens,concurrencyDefault:t.claudeAuth?.concurrencyDefault??e.claudeAuth.concurrencyDefault},auth:{...e.auth,...t.auth},uploads:{...e.uploads,...t.uploads},subagents:e.subagents,customMcpServers:e.customMcpServers,customBeacons:e.customBeacons,customModels:e.customModels,mcpSources:e.mcpSources,customProviders:e.customProviders,textSnippets:e.textSnippets,plugins:{...e.plugins,...t.plugins},installedPlugins:e.installedPlugins,remoteMcp:{...e.remoteMcp,...t.remoteMcp},serviceBus:A(e.serviceBus,t.serviceBus),claudeDriver:{lifecycle:{...e.claudeDriver.lifecycle,...t.claudeDriver?.lifecycle}},globalPromptAppend:t.globalPromptAppend??e.globalPromptAppend,subagentRuntime:{runTimeoutMs:t.subagentRuntime?.runTimeoutMs??e.subagentRuntime.runTimeoutMs,defaultLoopSubagentId:t.subagentRuntime?.defaultLoopSubagentId===void 0?e.subagentRuntime.defaultLoopSubagentId:t.subagentRuntime.defaultLoopSubagentId},packageUpdates:{...e.packageUpdates,...t.packageUpdates}}}var ee=e()(e=>({settings:null,hydrationStatus:`idle`,setHydrationStatus:t=>e({hydrationStatus:t}),setFromServer:t=>e({settings:t,hydrationStatus:`ready`}),applyOptimisticPatch:t=>e(e=>({settings:e.settings?M(e.settings,t):e.settings}))})),N=[],P=e=>e.settings?.customMcpServers??N,F=[],I=e=>e.settings?.customBeacons??F,L=[],R=e=>e.settings?.customModels??L,z=[],B=e=>e.settings?.mcpSources??z,V=[],H=e=>e.settings?.customProviders??V,U=[],W=e=>e.settings?.textSnippets??U,G=[],K=e=>e.settings?.plugins.enabled??!1,q=e=>e.settings?.installedPlugins??G,J=e=>e.settings?.remoteMcp??i,Y=e=>e.settings?.serviceBus??k,X=450,Z=`cursor`;function Q(e){return e===`vscode`?`code {path}`:e===`xcode`?`xed {path}`:e===`windsurf`?`windsurf {path}`:`cursor {path}`}var $=e=>e.settings?.terminal.scrollbackLines??1e3,te=e=>e.settings?.terminal.minColumnWidth??X,ne=e=>e.settings?.editor.preset??Z,re=e=>{let t=e.settings?.editor.preset??Z,n=(e.settings?.editor.commandTemplate)?.trim();return n&&n.length>0?n:Q(t)},ie=e=>e.settings?.chatSoundPreference??`always`,ae=e=>e.settings?.chatSoundId??`funk`;export{o as C,r as E,l as S,n as T,ee as _,R as a,c as b,ne as c,te as d,K as f,W as g,Y as h,P as i,q as l,$ as m,ie as n,H as o,J as p,I as r,re as s,ae as t,B as u,j as v,t as w,s as x,O as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-2LSejcqM.js";var t={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};t.node;var n=e(t);export{n 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-Dwk7MqBN.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-DeYiYzru.js";import{t}from"./timer.adapter-xKYiziSz.js";import{t as n}from"./runDetached-CZb0BmgP.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-2LSejcqM.js";var t={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./pendingActionsStore-2LSejcqM.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-2LSejcqM.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-DeYiYzru.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-eq8zrF0J.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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{p as r}from"./log-DeYiYzru.js";import{c as i,l as a,n as o}from"./state-mark-BoEXhyKA.js";function s(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=>s(e));if(r(e)){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=s(r));return t}return null}var c=e(t(),1),l=e=>Symbol.iterator in e,u=e=>`entries`in e,d=(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},f=(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 p(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:l(e)&&l(t)?u(e)&&u(t)?d(e,t):f(e,t):d({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function m(e){let t=c.useRef(void 0);return n=>{let r=e(n);return p(t.current,r)?t.current:t.current=r}}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,s 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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{Pt as r}from"./useAppGlobalState-C6_aikPC.js";import{c as i}from"./log-3sQ-5rrS.js";import{c as a,f as o}from"./pendingActionsStore-C9wopHr4.js";import{Bt as s,Vt as c}from"./lexicalToReact-CkI42EHr.js";import{t as l}from"./search-48C1GM_8.js";import{t as u}from"./timer.adapter-Di4tkt37.js";import{t as d}from"./createScopedStore-D1trFyJw.js";import{_ as f,a as p}from"./appSettingsStore-CDBkjKuH.js";import{D as m,S as h,g,h as ee,m as te}from"./types-C-hQn4rL.js";import{m as ne}from"./KannaSocketProvider-Clv949La.js";import{n as _,r as v,t as y}from"./popover-CA332KD1.js";var b={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`}]]};b.node;var x=o(b),S={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`}]]};S.node;var C=o(S),w={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`}]]};w.node;var T=o(w),E={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`}]]};E.node;var D=o(E),O={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`]};O.node;var k=o(O),A={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`}]]};A.node;var j=o(A),M={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};M.node;var N=o(M),P={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`}]]};P.node;var F=o(P),I={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`}]]};I.node;var L=o(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=o(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=o(B);function re(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var H=e(t(),1),U=d(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function ie(){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 W=d(`SearchableModelPopover`,ie),G=e(n(),1),ae=[],oe={openrouter:`Loading models… verify OpenRouter API key in Settings.`,custom:`No models configured. Add an endpoint in Settings → Providers.`};function se({className:e,...t}){return(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:(0,G.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 ce({className:e,...t}){return(0,G.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:(0,G.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 le({className:e,...t}){return(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,G.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,G.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,G.jsx)(`path`,{d:`M2 12h4`}),(0,G.jsx)(`path`,{d:`M18 12h4`})]})}var K={claude:se,codex:ce,openrouter:le,custom:F};function q({onClick:e,selected:t,icon:n,label:r,description:i,disabled:o}){return(0,G.jsxs)(`button`,{onClick:e,disabled:o,className:a(`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`,o&&`opacity-40 cursor-not-allowed`),children:[n,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function J({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,G.jsx)(`button`,{disabled:!0,className:a(`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,G.jsx)(U.Provider,{init:void 0,children:(0,G.jsx)(ue,{trigger:e,triggerClassName:t,children:r})})}function ue({trigger:e,triggerClassName:t,children:n}){let r=U.useScopedStore(e=>e.open),i=U.useScopedStore(e=>e.setOpen);return(0,G.jsxs)(y,{open:r,onOpenChange:i,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:a(`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,G.jsx)(_,{align:`center`,className:`w-64 p-1`,children:(0,G.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function de({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){return(0,G.jsx)(W.Provider,{init:void 0,children:(0,G.jsx)(fe,{models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i})})}function fe({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){let o=W.useScopedStore(e=>e.open),s=W.useScopedStore(e=>e.query),c=W.useScopedStore(e=>e.setPopoverOpen),u=W.useScopedStore(e=>e.setQuery),d=W.useScopedStore(e=>e.closeAndClearQuery),f=(0,H.useCallback)(e=>{n(e),d()},[n,d]),p=e.find(e=>e.id===t)?.label??t,m=(0,H.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,s]),h;return h=e.length===0?(0,G.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:i}):m.length===0?(0,G.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):m.map(e=>(0,G.jsx)(q,{onClick:()=>f(e.id),selected:t===e.id,icon:(0,G.jsx)(C,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,G.jsxs)(y,{open:o,onOpenChange:c,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,className:a(`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,G.jsx)(r,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{className:`max-w-[200px] truncate`,children:p})]})}),(0,G.jsxs)(_,{align:`center`,className:`w-80 p-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,G.jsx)(l,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,G.jsx)(`input`,{type:`text`,value:s,onChange:e=>u(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,G.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:h})]})]})}function pe({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:r=!1,model:i,modelOptions:o,onProviderChange:l,onModelChange:u,onModelOptionChange:d,planMode:_=!1,onPlanModeChange:v,includePlanMode:y=!0,className:b}){let x=f(p),S=e.find(e=>e.id===t)??e[0],w=S?.id??t,E=K[w],D=C,O=y&&S?.supportsPlanMode&&v,A=w===`claude`&&`contextWindow`in o?o:null,M=w===`codex`&&`fastMode`in o?o:null,N=S?.models??ae,P=N.find(e=>e.id===i)?.contextWindowOptions??[],F=A?.contextWindow??te[0].id,I=F===`1m`?z:V,L=N.find(e=>e.id===i)?.label??i,R=m(w)?(0,G.jsx)(de,{models:N,selectedModel:i,onSelect:e=>u?.(w,e),ModelIcon:D,emptyMessage:oe[w]}):(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(D,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:L})]}),children:e=>N.map(t=>{let n=C;return(0,G.jsx)(q,{onClick:()=>{u?.(w,t.id),e()},selected:i===t.id,icon:(0,G.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:r&&w===`codex`&&t.id===`gpt-5.5`?(0,G.jsxs)(G.Fragment,{children:[t.label,` `,(0,G.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):t.label},t.id)})});return(0,G.jsxs)(`div`,{className:a(`flex md:justify-center items-center gap-0.5`,b),children:[n?(0,G.jsx)(J,{disabled:!l,trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:S?.label??w})]}),children:t=>e.map(e=>{let n=K[e.id];return(0,G.jsx)(q,{onClick:()=>{l?.(e.id),t()},selected:w===e.id,icon:(0,G.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,u==null?(0,G.jsx)(ne,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,G.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,G.jsx)(j,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:L})]})}):R,m(w)?null:(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:w===`claude`?ee.find(e=>e.id===o.reasoningEffort)?.label??o.reasoningEffort:g.find(e=>e.id===o.reasoningEffort)?.label??o.reasoningEffort})]}),children:e=>w===`claude`?h(i,x).map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:o.reasoningEffort===t.id,icon:(0,G.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):g.map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`codexReasoningEffort`,effort:t.id}),e()},selected:o.reasoningEffort===t.id,icon:(0,G.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),w===`claude`&&P.length>1?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(I,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:P.find(e=>e.id===F)?.label??F})]}),children:e=>P.map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`contextWindow`,contextWindow:t.id}),e()},selected:F===t.id,icon:t.id===`1m`?(0,G.jsx)(z,{className:`h-4 w-4 text-muted-foreground`}):(0,G.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,w===`codex`?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[M?.fastMode?(0,G.jsx)(T,{className:`h-3.5 w-3.5`}):(0,G.jsx)(T,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,G.jsx)(`span`,{children:M?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:M?.fastMode?`text-success-text`:void 0,children:e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{onClick:()=>{d({type:`fastMode`,fastMode:!1}),e()},selected:!M?.fastMode,icon:(0,G.jsx)(T,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,G.jsx)(q,{onClick:()=>{d({type:`fastMode`,fastMode:!0}),e()},selected:!!M?.fastMode,icon:(0,G.jsx)(T,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,O?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[_?(0,G.jsx)(s,{className:`h-3.5 w-3.5`}):(0,G.jsx)(k,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:_?`Plan Mode`:`Full Access`})]}),triggerClassName:_?`text-info-text`:void 0,children:e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{onClick:()=>{v(!1),e()},selected:!_,icon:(0,G.jsx)(k,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,G.jsx)(q,{onClick:()=>{v(!0),e()},selected:_,icon:(0,G.jsx)(s,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var me=/^[a-z0-9][a-z0-9_-]{0,39}$/,he=`beacon/`,ge=`(^|[\\s\\n\\t])@beacon/([A-Za-z0-9][A-Za-z0-9_-]*)`;function _e(){return new RegExp(ge,`g`)}function ve(e){return e.length===0?`Short name is required`:e.length>40?`Short name must be at most 40 characters`:me.test(e)?null:`Use lowercase letters, digits, - and _, starting with a letter or digit`}function ye(e){return e.alias??e.label}var be=/[^a-z0-9_-]+/g,Y=/^[-_]+|[-_]+$/g;function xe(e){let t=e.toLowerCase().replace(be,`-`).replace(Y,``).slice(0,40).replace(Y,``);return t.length>0?t:`beacon`}function Se(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;return`${e}-${n}`}function X(e){let t=[...e].sort((e,t)=>e.id.localeCompare(t.id)),n=new Map,r=new Map;for(let e of t)e.alias!==void 0&&e.alias!==null&&(r.has(e.alias)||(n.set(e.id,e.alias),r.set(e.alias,e.id)));for(let e of t){if(n.has(e.id))continue;let t=Se(xe(e.label),r);n.set(e.id,t),r.set(t,e.id)}return{handleByBeaconId:n,beaconIdByHandle:r}}function Ce(e){let t=[];for(let n of e.matchAll(_e())){let e=n[2];e!==void 0&&t.push(e.toLowerCase())}return t}function we(e,t){let n=Ce(e);if(n.length===0)return{beacons:[],unresolvedHandles:[]};let{beaconIdByHandle:r}=X(t),i=new Map(t.map(e=>[e.id,e])),a=[],o=[],s=new Set;for(let e of n){let t=r.get(e),n=t===void 0?void 0:i.get(t);if(n===void 0){o.includes(e)||o.push(e);continue}s.has(n.id)||(s.add(n.id),a.push(n))}return{beacons:a,unresolvedHandles:o}}var Te=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],Z={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 Q({src:e,className:t}){return(0,G.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function Ee({preset:e,className:t}){switch(e){case`xcode`:return(0,G.jsx)(Q,{src:Z.xcode,className:t});case`windsurf`:return(0,G.jsx)(Q,{src:Z.windsurf,className:t});case`custom`:return(0,G.jsx)(Q,{src:Z.custom,className:t});default:return(0,G.jsx)(Q,{src:Z.cursor,className:t})}}function De({className:e}){return(0,G.jsx)(Q,{src:Z.finder,className:e})}function Oe({className:e}){return(0,G.jsx)(Q,{src:Z.preview,className:e})}function ke({className:e}){return(0,G.jsx)(Q,{src:Z.defaultApp,className:e})}function Ae({className:e}){return(0,G.jsx)(r,{className:e})}function je({className:e}){return(0,G.jsx)(Q,{src:Z.terminal,className:e})}var Me=2e3,Ne={},$=i()((e,t)=>({copiedTokens:Ne,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:Ne})}}));async function Pe(e,t,n=u){await t();let r=$.getState().markCopied(e);n.setTimeout(()=>$.getState().clearCopied(e,r),Me)}function Fe(e){return $(t=>t.copiedTokens[e]!==void 0)}export{x as C,D as S,re as _,Ee as a,N as b,Oe as c,ye as d,X as f,q as g,pe as h,Te as i,je as l,ve as m,Fe as n,De as o,we as p,ke as r,Ae as s,Pe as t,he as u,L as v,j as x,F as y};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{Pt as r}from"./useAppGlobalState-DgWkgOn7.js";import{c as i}from"./log-DeYiYzru.js";import{c as a,f as o}from"./pendingActionsStore-2LSejcqM.js";import{Bt as s,Vt as c}from"./lexicalToReact-TD2k-lRz.js";import{t as l}from"./search-DLUiqdl3.js";import{t as u}from"./timer.adapter-xKYiziSz.js";import{t as d}from"./createScopedStore-BOB83agV.js";import{_ as f,a as p}from"./appSettingsStore-BBfwETzX.js";import{D as m,S as h,g,h as ee,m as te}from"./types-C-hQn4rL.js";import{m as ne}from"./KannaSocketProvider-Bw4DvDDN.js";import{n as _,r as v,t as y}from"./popover-Byr25LbG.js";var b={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`}]]};b.node;var x=o(b),S={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`}]]};S.node;var C=o(S),w={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`}]]};w.node;var T=o(w),E={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`}]]};E.node;var D=o(E),O={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`]};O.node;var k=o(O),A={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`}]]};A.node;var j=o(A),M={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};M.node;var N=o(M),P={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`}]]};P.node;var F=o(P),I={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`}]]};I.node;var L=o(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=o(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=o(B);function re(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var H=e(t(),1),U=d(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function ie(){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 W=d(`SearchableModelPopover`,ie),G=e(n(),1),ae=[],oe={openrouter:`Loading models… verify OpenRouter API key in Settings.`,custom:`No models configured. Add an endpoint in Settings → Providers.`};function se({className:e,...t}){return(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:(0,G.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 ce({className:e,...t}){return(0,G.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:(0,G.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 le({className:e,...t}){return(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:a(`shrink-0`,e),...t,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,G.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,G.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,G.jsx)(`path`,{d:`M2 12h4`}),(0,G.jsx)(`path`,{d:`M18 12h4`})]})}var K={claude:se,codex:ce,openrouter:le,custom:F};function q({onClick:e,selected:t,icon:n,label:r,description:i,disabled:o}){return(0,G.jsxs)(`button`,{onClick:e,disabled:o,className:a(`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`,o&&`opacity-40 cursor-not-allowed`),children:[n,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,G.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function J({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,G.jsx)(`button`,{disabled:!0,className:a(`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,G.jsx)(U.Provider,{init:void 0,children:(0,G.jsx)(ue,{trigger:e,triggerClassName:t,children:r})})}function ue({trigger:e,triggerClassName:t,children:n}){let r=U.useScopedStore(e=>e.open),i=U.useScopedStore(e=>e.setOpen);return(0,G.jsxs)(y,{open:r,onOpenChange:i,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:a(`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,G.jsx)(_,{align:`center`,className:`w-64 p-1`,children:(0,G.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function de({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){return(0,G.jsx)(W.Provider,{init:void 0,children:(0,G.jsx)(fe,{models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i})})}function fe({models:e,selectedModel:t,onSelect:n,ModelIcon:r,emptyMessage:i}){let o=W.useScopedStore(e=>e.open),s=W.useScopedStore(e=>e.query),c=W.useScopedStore(e=>e.setPopoverOpen),u=W.useScopedStore(e=>e.setQuery),d=W.useScopedStore(e=>e.closeAndClearQuery),f=(0,H.useCallback)(e=>{n(e),d()},[n,d]),p=e.find(e=>e.id===t)?.label??t,m=(0,H.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,s]),h;return h=e.length===0?(0,G.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:i}):m.length===0?(0,G.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):m.map(e=>(0,G.jsx)(q,{onClick:()=>f(e.id),selected:t===e.id,icon:(0,G.jsx)(C,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,G.jsxs)(y,{open:o,onOpenChange:c,children:[(0,G.jsx)(v,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,className:a(`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,G.jsx)(r,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{className:`max-w-[200px] truncate`,children:p})]})}),(0,G.jsxs)(_,{align:`center`,className:`w-80 p-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,G.jsx)(l,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,G.jsx)(`input`,{type:`text`,value:s,onChange:e=>u(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,G.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:h})]})]})}function pe({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:r=!1,model:i,modelOptions:o,onProviderChange:l,onModelChange:u,onModelOptionChange:d,planMode:_=!1,onPlanModeChange:v,includePlanMode:y=!0,className:b}){let x=f(p),S=e.find(e=>e.id===t)??e[0],w=S?.id??t,E=K[w],D=C,O=y&&S?.supportsPlanMode&&v,A=w===`claude`&&`contextWindow`in o?o:null,M=w===`codex`&&`fastMode`in o?o:null,N=S?.models??ae,P=N.find(e=>e.id===i)?.contextWindowOptions??[],F=A?.contextWindow??te[0].id,I=F===`1m`?z:V,L=N.find(e=>e.id===i)?.label??i,R=m(w)?(0,G.jsx)(de,{models:N,selectedModel:i,onSelect:e=>u?.(w,e),ModelIcon:D,emptyMessage:oe[w]}):(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(D,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:L})]}),children:e=>N.map(t=>{let n=C;return(0,G.jsx)(q,{onClick:()=>{u?.(w,t.id),e()},selected:i===t.id,icon:(0,G.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:r&&w===`codex`&&t.id===`gpt-5.5`?(0,G.jsxs)(G.Fragment,{children:[t.label,` `,(0,G.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):t.label},t.id)})});return(0,G.jsxs)(`div`,{className:a(`flex md:justify-center items-center gap-0.5`,b),children:[n?(0,G.jsx)(J,{disabled:!l,trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:S?.label??w})]}),children:t=>e.map(e=>{let n=K[e.id];return(0,G.jsx)(q,{onClick:()=>{l?.(e.id),t()},selected:w===e.id,icon:(0,G.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,u==null?(0,G.jsx)(ne,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,G.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,G.jsx)(j,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:L})]})}):R,m(w)?null:(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:w===`claude`?ee.find(e=>e.id===o.reasoningEffort)?.label??o.reasoningEffort:g.find(e=>e.id===o.reasoningEffort)?.label??o.reasoningEffort})]}),children:e=>w===`claude`?h(i,x).map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:o.reasoningEffort===t.id,icon:(0,G.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):g.map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`codexReasoningEffort`,effort:t.id}),e()},selected:o.reasoningEffort===t.id,icon:(0,G.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),w===`claude`&&P.length>1?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(I,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:P.find(e=>e.id===F)?.label??F})]}),children:e=>P.map(t=>(0,G.jsx)(q,{onClick:()=>{d({type:`contextWindow`,contextWindow:t.id}),e()},selected:F===t.id,icon:t.id===`1m`?(0,G.jsx)(z,{className:`h-4 w-4 text-muted-foreground`}):(0,G.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,w===`codex`?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[M?.fastMode?(0,G.jsx)(T,{className:`h-3.5 w-3.5`}):(0,G.jsx)(T,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,G.jsx)(`span`,{children:M?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:M?.fastMode?`text-success-text`:void 0,children:e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{onClick:()=>{d({type:`fastMode`,fastMode:!1}),e()},selected:!M?.fastMode,icon:(0,G.jsx)(T,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,G.jsx)(q,{onClick:()=>{d({type:`fastMode`,fastMode:!0}),e()},selected:!!M?.fastMode,icon:(0,G.jsx)(T,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,O?(0,G.jsx)(J,{trigger:(0,G.jsxs)(G.Fragment,{children:[_?(0,G.jsx)(s,{className:`h-3.5 w-3.5`}):(0,G.jsx)(k,{className:`h-3.5 w-3.5`}),(0,G.jsx)(`span`,{children:_?`Plan Mode`:`Full Access`})]}),triggerClassName:_?`text-info-text`:void 0,children:e=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(q,{onClick:()=>{v(!1),e()},selected:!_,icon:(0,G.jsx)(k,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,G.jsx)(q,{onClick:()=>{v(!0),e()},selected:_,icon:(0,G.jsx)(s,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var me=/^[a-z0-9][a-z0-9_-]{0,39}$/,he=`beacon/`,ge=`(^|[\\s\\n\\t])@beacon/([A-Za-z0-9][A-Za-z0-9_-]*)`;function _e(){return new RegExp(ge,`g`)}function ve(e){return e.length===0?`Short name is required`:e.length>40?`Short name must be at most 40 characters`:me.test(e)?null:`Use lowercase letters, digits, - and _, starting with a letter or digit`}function ye(e){return e.alias??e.label}var be=/[^a-z0-9_-]+/g,Y=/^[-_]+|[-_]+$/g;function xe(e){let t=e.toLowerCase().replace(be,`-`).replace(Y,``).slice(0,40).replace(Y,``);return t.length>0?t:`beacon`}function Se(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;return`${e}-${n}`}function X(e){let t=[...e].sort((e,t)=>e.id.localeCompare(t.id)),n=new Map,r=new Map;for(let e of t)e.alias!==void 0&&e.alias!==null&&(r.has(e.alias)||(n.set(e.id,e.alias),r.set(e.alias,e.id)));for(let e of t){if(n.has(e.id))continue;let t=Se(xe(e.label),r);n.set(e.id,t),r.set(t,e.id)}return{handleByBeaconId:n,beaconIdByHandle:r}}function Ce(e){let t=[];for(let n of e.matchAll(_e())){let e=n[2];e!==void 0&&t.push(e.toLowerCase())}return t}function we(e,t){let n=Ce(e);if(n.length===0)return{beacons:[],unresolvedHandles:[]};let{beaconIdByHandle:r}=X(t),i=new Map(t.map(e=>[e.id,e])),a=[],o=[],s=new Set;for(let e of n){let t=r.get(e),n=t===void 0?void 0:i.get(t);if(n===void 0){o.includes(e)||o.push(e);continue}s.has(n.id)||(s.add(n.id),a.push(n))}return{beacons:a,unresolvedHandles:o}}var Te=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],Z={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 Q({src:e,className:t}){return(0,G.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function Ee({preset:e,className:t}){switch(e){case`xcode`:return(0,G.jsx)(Q,{src:Z.xcode,className:t});case`windsurf`:return(0,G.jsx)(Q,{src:Z.windsurf,className:t});case`custom`:return(0,G.jsx)(Q,{src:Z.custom,className:t});default:return(0,G.jsx)(Q,{src:Z.cursor,className:t})}}function De({className:e}){return(0,G.jsx)(Q,{src:Z.finder,className:e})}function Oe({className:e}){return(0,G.jsx)(Q,{src:Z.preview,className:e})}function ke({className:e}){return(0,G.jsx)(Q,{src:Z.defaultApp,className:e})}function Ae({className:e}){return(0,G.jsx)(r,{className:e})}function je({className:e}){return(0,G.jsx)(Q,{src:Z.terminal,className:e})}var Me=2e3,Ne={},$=i()((e,t)=>({copiedTokens:Ne,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:Ne})}}));async function Pe(e,t,n=u){await t();let r=$.getState().markCopied(e);n.setTimeout(()=>$.getState().clearCopied(e,r),Me)}function Fe(e){return $(t=>t.copiedTokens[e]!==void 0)}export{x as C,D as S,re as _,Ee as a,N as b,Oe as c,ye as d,X as f,q as g,pe as h,Te as i,je as l,ve as m,Fe as n,De as o,we as p,ke as r,Ae as s,Pe as t,he as u,L as v,j as x,F as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-eq8zrF0J.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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{l as r,u as i}from"./log-DeYiYzru.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-eq8zrF0J.js";import{c as n}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-eq8zrF0J.js";import{c as n}from"./log-DeYiYzru.js";import{t as r}from"./timer.adapter-xKYiziSz.js";var i=e(t(),1),a={timer:r};function o(e=1e3,t){let{timer:n}=t??a,[r,o]=(0,i.useState)(()=>Date.now()),s=(0,i.useRef)(e);return(0,i.useLayoutEffect)(()=>{s.current=e}),(0,i.useEffect)(()=>{let e=n.setInterval(()=>{o(Date.now())},s.current);return()=>n.clearInterval(e)},[n]),r}var s=[],c=n()(e=>({rows:s,setRows:t=>e({rows:t.length>0?t:s})}));export{o as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-2LSejcqM.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{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-2LSejcqM.js";var t={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{P as r,q as i,t as a}from"./useQuery-DehtkS98.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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{P as r,q as i,t as a}from"./useQuery-DehtkS98.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-2LSejcqM.js";import{i as p,r as m}from"./host-Bn7kXks2.js";import{t as ee}from"./globe-BGOCLzBK.js";import{t as te}from"./info-BUS8wzM_.js";import{n as h,t as g}from"./triangle-alert-CWM6skP7.js";import{t as _}from"./play-C_RZ57yb.js";import{t as v}from"./createScopedStore-BOB83agV.js";import{F as y,S as b}from"./genui-Dwk7MqBN.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-2LSejcqM.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,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{S as t,b as n,x as r}from"./appSettingsStore-CDBkjKuH.js";import"./tools-CeacgJBu.js";import{a as i,s as a}from"./useTheme-V_0ZRiiP.js";var o=e({BIGINT_FORMAT_RANGES:()=>Fe,CONSTANT_CATCH:()=>yt,Class:()=>ct,NUMBER_FORMAT_RANGES:()=>Pe,aborted:()=>y,allowsEval:()=>Se,assert:()=>f,assertEqual:()=>s,assertIs:()=>u,assertNever:()=>d,assertNotEqual:()=>c,assignProp:()=>h,attachSchema:()=>Je,base64ToUint8Array:()=>nt,base64urlToUint8Array:()=>it,cached:()=>ne,captureStackTrace:()=>be,cleanEnum:()=>tt,cleanRegex:()=>ie,clone:()=>Ae,cloneDef:()=>me,codePointLength:()=>Ze,constantCatch:()=>bt,createTransparentProxy:()=>je,defineLazy:()=>se,defineLazyInternal:()=>S,derived:()=>ft,esc:()=>ve,escapeRegex:()=>ke,explicitlyAborted:()=>Ge,extend:()=>ze,finalizeIssue:()=>x,floatSafeRemainder:()=>ae,getElementAtPath:()=>he,getEnumValues:()=>p,getLengthableOrigin:()=>Qe,getParsedType:()=>Ee,getSizableOrigin:()=>Ye,hexToUint8Array:()=>ot,hide:()=>dt,installLazyProp:()=>vt,isObject:()=>xe,isPlainObject:()=>Ce,issue:()=>et,joinValues:()=>m,jsonStringifyReplacer:()=>ee,members:()=>lt,merge:()=>He,mergeDefs:()=>_,normalizeParams:()=>v,nullish:()=>re,numKeys:()=>Te,objectClone:()=>ce,omit:()=>Re,optionalKeys:()=>Ne,own:()=>ut,parsedType:()=>$e,partial:()=>Ue,pick:()=>Ie,prefixIssues:()=>b,primitiveTypes:()=>Oe,promiseAllObject:()=>ge,propertyKeyTypes:()=>De,randomString:()=>_e,rawShape:()=>le,required:()=>We,safeExtend:()=>Ve,shallowClone:()=>we,sizeCaps:()=>qe,slugify:()=>ye,stringifyPrimitive:()=>Me,toZod:()=>l,uint8ArrayToBase64:()=>rt,uint8ArrayToBase64url:()=>at,uint8ArrayToHex:()=>st,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){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Je(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 Ye(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var Xe=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Xe.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 Qe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $e(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 et(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function nt(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 rt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function it(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return nt(t+`=`.repeat((4-t.length%4)%4))}function at(e){return rt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ot(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 st(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var ct=class{constructor(...e){}};function lt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):pt(e,n,r.value)}}function ut(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function dt(e,t,n){return ut(e,t,n,!1)}function ft(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ut(this,n,r(this))},set(e){ut(this,n,e)}})}return t}function pt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ut(this,t,n.bind(this))},set(e){ut(this,t,e)}})}function mt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ht,gt=!1,_t={configurable:!0,get(){gt=!0}};function S(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&ht!==e._zod){ht=void 0;return}ht=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,_t);let e=gt;gt=!1;try{let r=n(this);return gt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),gt||=e,r}catch(n){throw delete this[t],gt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function vt(e,t,n,r){let i=mt(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 yt=`~constantCatch`;function bt(e){let t=()=>e;return t[yt]=!0,t}var xt,St=Object.freeze({status:`aborted`}),Ct={value:void 0,enumerable:!1},wt=`captureStackTrace`in Error?Error:null;function Tt(e){let t=wt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return wt=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){Ct.value=new a(r);try{Object.defineProperty(n,"_zod",Ct)}finally{Ct.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),lt(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?Tt(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 Et=Symbol(`zod_brand`),Dt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(xt=globalThis).__zod_globalConfig??(xt.__zod_globalConfig={});var w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function kt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ee,2),e.message}function At(e){this._zod.message=e}var jt={get:kt,set:At,enumerable:!0,configurable:!0},Mt={value:void 0,enumerable:!1},Nt=new WeakSet([Object.prototype,Error.prototype]),Pt=(e,t)=>{e.name=`$ZodError`,Mt.value=t,Object.defineProperty(e,"issues",Mt),Mt.value=void 0,Object.defineProperty(e,"message",jt);let n=Object.getPrototypeOf(e);Nt.has(n)||(Nt.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})}}))},Ft=C(`$ZodError`,Pt),E=C(`$ZodError`,Pt,void 0,{Parent:Error});function It(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 Lt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?It(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Rt(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 zt(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 Bt(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 Vt(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 ${Bt(e.path)}`);return t.join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{S as t,b as n,x as r}from"./appSettingsStore-BBfwETzX.js";import"./tools-C_pxctuN.js";import{a as i,s as a}from"./useTheme-C-9wxUOa.js";var o=e({BIGINT_FORMAT_RANGES:()=>Fe,CONSTANT_CATCH:()=>yt,Class:()=>ct,NUMBER_FORMAT_RANGES:()=>Pe,aborted:()=>y,allowsEval:()=>Se,assert:()=>f,assertEqual:()=>s,assertIs:()=>u,assertNever:()=>d,assertNotEqual:()=>c,assignProp:()=>h,attachSchema:()=>Je,base64ToUint8Array:()=>nt,base64urlToUint8Array:()=>it,cached:()=>ne,captureStackTrace:()=>be,cleanEnum:()=>tt,cleanRegex:()=>ie,clone:()=>Ae,cloneDef:()=>me,codePointLength:()=>Ze,constantCatch:()=>bt,createTransparentProxy:()=>je,defineLazy:()=>se,defineLazyInternal:()=>S,derived:()=>ft,esc:()=>ve,escapeRegex:()=>ke,explicitlyAborted:()=>Ge,extend:()=>ze,finalizeIssue:()=>x,floatSafeRemainder:()=>ae,getElementAtPath:()=>he,getEnumValues:()=>p,getLengthableOrigin:()=>Qe,getParsedType:()=>Ee,getSizableOrigin:()=>Ye,hexToUint8Array:()=>ot,hide:()=>dt,installLazyProp:()=>vt,isObject:()=>xe,isPlainObject:()=>Ce,issue:()=>et,joinValues:()=>m,jsonStringifyReplacer:()=>ee,members:()=>lt,merge:()=>He,mergeDefs:()=>_,normalizeParams:()=>v,nullish:()=>re,numKeys:()=>Te,objectClone:()=>ce,omit:()=>Re,optionalKeys:()=>Ne,own:()=>ut,parsedType:()=>$e,partial:()=>Ue,pick:()=>Ie,prefixIssues:()=>b,primitiveTypes:()=>Oe,promiseAllObject:()=>ge,propertyKeyTypes:()=>De,randomString:()=>_e,rawShape:()=>le,required:()=>We,safeExtend:()=>Ve,shallowClone:()=>we,sizeCaps:()=>qe,slugify:()=>ye,stringifyPrimitive:()=>Me,toZod:()=>l,uint8ArrayToBase64:()=>rt,uint8ArrayToBase64url:()=>at,uint8ArrayToHex:()=>st,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){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Je(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 Ye(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var Xe=/[\uD800-\uDBFF]/;function Ze(e){let t=e.length;if(!Xe.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 Qe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $e(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 et(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function nt(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 rt(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function it(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return nt(t+`=`.repeat((4-t.length%4)%4))}function at(e){return rt(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ot(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 st(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var ct=class{constructor(...e){}};function lt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):pt(e,n,r.value)}}function ut(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function dt(e,t,n){return ut(e,t,n,!1)}function ft(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ut(this,n,r(this))},set(e){ut(this,n,e)}})}return t}function pt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ut(this,t,n.bind(this))},set(e){ut(this,t,e)}})}function mt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var ht,gt=!1,_t={configurable:!0,get(){gt=!0}};function S(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&ht!==e._zod){ht=void 0;return}ht=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,_t);let e=gt;gt=!1;try{let r=n(this);return gt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),gt||=e,r}catch(n){throw delete this[t],gt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function vt(e,t,n,r){let i=mt(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 yt=`~constantCatch`;function bt(e){let t=()=>e;return t[yt]=!0,t}var xt,St=Object.freeze({status:`aborted`}),Ct={value:void 0,enumerable:!1},wt=`captureStackTrace`in Error?Error:null;function Tt(e){let t=wt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return wt=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){Ct.value=new a(r);try{Object.defineProperty(n,"_zod",Ct)}finally{Ct.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),lt(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?Tt(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 Et=Symbol(`zod_brand`),Dt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(xt=globalThis).__zod_globalConfig??(xt.__zod_globalConfig={});var w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function kt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ee,2),e.message}function At(e){this._zod.message=e}var jt={get:kt,set:At,enumerable:!0,configurable:!0},Mt={value:void 0,enumerable:!1},Nt=new WeakSet([Object.prototype,Error.prototype]),Pt=(e,t)=>{e.name=`$ZodError`,Mt.value=t,Object.defineProperty(e,"issues",Mt),Mt.value=void 0,Object.defineProperty(e,"message",jt);let n=Object.getPrototypeOf(e);Nt.has(n)||(Nt.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})}}))},Ft=C(`$ZodError`,Pt),E=C(`$ZodError`,Pt,void 0,{Parent:Error});function It(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 Lt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?It(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Rt(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 zt(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 Bt(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 Vt(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 ${Bt(e.path)}`);return t.join(`
|
|
2
2
|
`)}function Ht(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ut=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 Dt;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},Wt=Ut(E),Gt=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},Kt=Gt(E),qt=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 Dt;return a.issues.length?Yt(e,a.issues,i):{success:!0,data:a.value}},Jt=qt(E);function Yt(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 Xt=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?Yt(e,a.issues,i):{success:!0,data:a.value}},Zt=Xt(E),Qt=Symbol.for(`zod.compile.invalid`),$t=Symbol.for(`zod.compile.fallback`),en=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qt)return!0;if(r.definite===!0&&n===void 0)return!1}return tn(e,t,n)});function tn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[$t]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Dt;return a.issues.length===0}var nn=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},rn=e=>{let t=Ut(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ht(n,a))};return n},an=rn(E),on=e=>{let t=Ut(e),n=(e,r,i,a)=>t(e,r,i,Ht(n,a));return n},sn=on(E),cn=e=>{let t=Gt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ht(n,a))};return n},ln=cn(E),un=e=>{let t=Gt(e),n=async(e,r,i,a)=>await t(e,r,i,Ht(n,a));return n},dn=un(E),fn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return qt(e)(t,n,i)},pn=fn(E),mn=e=>(t,n,r)=>qt(e)(t,n,r),hn=mn(E),gn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Xt(e)(t,n,i)},_n=gn(E),vn=e=>async(t,n,r)=>Xt(e)(t,n,r),yn=vn(E),bn=e({anyString:()=>lr,base64:()=>Jn,base64url:()=>Yn,bigint:()=>dr,boolean:()=>mr,browserEmail:()=>Bn,cidrv4:()=>Kn,cidrv6:()=>qn,creditCard:()=>er,cuid:()=>xn,cuid2:()=>Sn,currencyCode:()=>tr,date:()=>ar,datetime:()=>cr,domain:()=>Zn,duration:()=>On,e164:()=>$n,email:()=>Fn,emoji:()=>Hn,extendedDuration:()=>kn,guid:()=>An,hex:()=>yr,hostname:()=>Xn,html5Email:()=>In,httpProtocol:()=>Qn,iban:()=>nr,idnEmail:()=>zn,integer:()=>fr,ipv4:()=>Un,ipv6:()=>Wn,ksuid:()=>Tn,lowercase:()=>_r,mac:()=>Gn,md5_base64:()=>Cr,md5_base64url:()=>wr,md5_hex:()=>Sr,nanoid:()=>En,nanoidOfLength:()=>Dn,null:()=>hr,number:()=>pr,rfc5322Email:()=>Ln,sha1_base64:()=>Er,sha1_base64url:()=>Dr,sha1_hex:()=>Tr,sha256_base64:()=>kr,sha256_base64url:()=>Ar,sha256_hex:()=>Or,sha384_base64:()=>Mr,sha384_base64url:()=>Nr,sha384_hex:()=>jr,sha512_base64:()=>Fr,sha512_base64url:()=>Ir,sha512_hex:()=>Pr,string:()=>ur,time:()=>sr,ulid:()=>Cn,undefined:()=>gr,unicodeEmail:()=>Rn,uppercase:()=>vr,uuid:()=>jn,uuid4:()=>Mn,uuid6:()=>Nn,uuid7:()=>Pn,xid:()=>wn}),xn=/^[cC][0-9a-z]{6,}$/,Sn=/^[0-9a-z]+$/,Cn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wn=/^[0-9a-vA-V]{20}$/,Tn=/^[A-Za-z0-9]{27}$/,En=/^[a-zA-Z0-9_-]{21}$/;function Dn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var On=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kn=/^[-+]?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)?)??$/,An=/^([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})$/,jn=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)$/,Mn=jn(4),Nn=jn(6),Pn=jn(7),Fn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,In=/^[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])?)*$/,Ln=/^(([^<>()\[\]\\.,;:\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,}))$/,Rn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zn=Rn,Bn=/^[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])?)*$/,Vn=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Hn(){return new RegExp(Vn,`u`)}var Un=/^(?:(?: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])$/,Wn=/^(([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}|:))$/,Gn=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}$`)},Kn=/^((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])$/,qn=/^(([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])$/,Jn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Xn=/^(?=.{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])?)*\.?$/,Zn=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Qn=/^https?$/,$n=/^\+[1-9]\d{6,14}$/,er=/^\d(?:[ -]?\d){11,18}$/,tr=/^(?: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)$/,nr=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,rr=`(?:(?:\\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 ir(e){return RegExp(`^${e}$`)}var ar=ir(rr);function or(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 sr(e){return RegExp(`^${or(e)}$`)}function cr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${or({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${or({precision:e.precision})}`:n;return RegExp(`^${rr}T(?:${r})$`)}var lr=/^[\s\S]{0,}$/,ur=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},dr=/^-?\d+n?$/,fr=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,mr=/^(?:true|false)$/i,hr=/^null$/i,gr=/^undefined$/i,_r=/^[^A-Z]*$/,vr=/^[^a-z]*$/,yr=/^[0-9a-fA-F]*$/;function br(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function xr(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sr=/^[0-9a-fA-F]{32}$/,Cr=br(22,`==`),wr=xr(22),Tr=/^[0-9a-fA-F]{40}$/,Er=br(27,`=`),Dr=xr(27),Or=/^[0-9a-fA-F]{64}$/,kr=br(43,`=`),Ar=xr(43),jr=/^[0-9a-fA-F]{96}$/,Mr=br(64,``),Nr=xr(64),Pr=/^[0-9a-fA-F]{128}$/,Fr=br(86,`==`),Ir=xr(86),D=C(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lr=e=>{let t=e.value;return!re(t)&&t.size!==void 0},Rr=e=>{let t=e.value;return!re(t)&&t.length!==void 0},zr={number:`number`,bigint:`bigint`,object:`date`},Br=C(`$ZodCheckLessThan`,(e,t)=>{D.init(e,t);let n=zr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:zr[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})}}),Vr=C(`$ZodCheckGreaterThan`,(e,t)=>{D.init(e,t);let n=zr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:zr[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})}}),Hr=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})}}),Ur=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})}}),Wr=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})}}),Gr=C(`$ZodCheckMaxSize`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Lr),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Ye(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kr=C(`$ZodCheckMinSize`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Lr),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Ye(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qr=C(`$ZodCheckSizeEquals`,(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.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Ye(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})}}),Jr=C(`$ZodCheckMaxLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ze(r):i)<=t.maximum)return;let a=Qe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Yr=C(`$ZodCheckMinLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ze(r):i)>=t.minimum)return;let a=Qe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xr=C(`$ZodCheckLengthEquals`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ze(r):i;if(a===t.length)return;let o=Qe(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})}}),Zr=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=()=>{})}),Qr=C(`$ZodCheckRegex`,(e,t)=>{Zr.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})}}),$r=C(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=_r,Zr.init(e,t)}),ei=C(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=vr,Zr.init(e,t)}),ti=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})}}),ni=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})}}),ri=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 ii(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues))}var ai=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=>ii(n,e,t.property));ii(n,e,t.property)}}),oi=C(`$ZodCheckProperties`,(e,t)=>{D.init(e,t),dt(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=>ii(t,r,e)))):ii(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),si=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})}}),ci=C(`$ZodCheckOverwrite`,(e,t)=>{D.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),li=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))}},ui={major:4,minor:6,patch:7},O=C(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ui;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 Dt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Je(t.issues,n,e),i||=y(t,n))});else{if(t.issues.length===n)continue;Je(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 Dt;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 Dt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return dt(this,`~standard`,pi(this))},set"~standard"(e){ut(this,`~standard`,e)}}),di=(e,t)=>e.issues.length?{issues:e.issues.map(e=>x(e,t,T()))}:{value:e.value};async function fi(e,t){let n={async:!0};return di(await e._zod.run({value:t,issues:[]},n),n)}function pi(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return di(r,n)}catch{}return fi(e,t)},vendor:`zod`,version:1}}var mi=C(`$ZodString`,(e,t)=>{O.init(e,t),e._zod.pattern=t.pattern??lr,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)=>{Zr.init(e,t),mi.init(e,t)}),hi=C(`$ZodGUID`,(e,t)=>{t.pattern??=An,k.init(e,t)}),gi=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??=jn(e)}else t.pattern??=jn();k.init(e,t)}),_i=C(`$ZodEmail`,(e,t)=>{t.pattern??=Fn,k.init(e,t)});function vi(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function yi(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?vi(e)||2:bi(e,t)}function bi(e,t){if(!t.normalize&&t.protocol?.source===Qn.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 xi=/[\t\n\r]/g;function Si(e){return e.replace(xi,``)}function Ci(e,t){return t.lastIndex=0,t.test(e.hostname)}function wi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ti=C(`$ZodURL`,(e,t)=>{k.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=yi(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=Si(r);return}t.hostname&&!Ci(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&&!wi(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:Si(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ei=C(`$ZodEmoji`,(e,t)=>{t.pattern??=Hn(),k.init(e,t)}),Di=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?En:Dn(t.length),k.init(e,t)}),Oi=C(`$ZodCUID`,(e,t)=>{t.pattern??=xn,k.init(e,t)}),ki=C(`$ZodCUID2`,(e,t)=>{t.pattern??=Sn,k.init(e,t)}),Ai=C(`$ZodULID`,(e,t)=>{t.pattern??=Cn,k.init(e,t)}),ji=C(`$ZodXID`,(e,t)=>{t.pattern??=wn,k.init(e,t)}),Mi=C(`$ZodKSUID`,(e,t)=>{t.pattern??=Tn,k.init(e,t)}),Ni=C(`$ZodISODateTime`,(e,t)=>{t.pattern??=cr(t),k.init(e,t)}),Pi=C(`$ZodISODate`,(e,t)=>{t.pattern??=ar,k.init(e,t)}),Fi=C(`$ZodISOTime`,(e,t)=>{t.pattern??=sr(t),k.init(e,t)}),Ii=C(`$ZodISODuration`,(e,t)=>{t.pattern??=On,k.init(e,t)}),Li=C(`$ZodIPv4`,(e,t)=>{t.pattern??=Un,k.init(e,t)}),Ri=/^[0-9a-fA-F:.]+$/;function zi(e){return Ri.test(e)?vi(`http://[${e}]`):!1}var Bi=C(`$ZodIPv6`,(e,t)=>{t.pattern??=Wn,k.init(e,t),e._zod.check=n=>{zi(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Vi=C(`$ZodMAC`,(e,t)=>{t.pattern??=Gn(t.delimiter),k.init(e,t)}),Hi=C(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Kn,k.init(e,t)});function Ui(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:zi(n)}var Wi=C(`$ZodCIDRv6`,(e,t)=>{t.pattern??=qn,k.init(e,t),e._zod.check=n=>{Ui(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Gi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ki=/^[0-9a-zA-Z+/]*={0,2}$/,qi=C(`$ZodBase64`,(e,t)=>{t.pattern??=Ki,k.init(e,t),e._zod.check=n=>{Gi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ji=/^[A-Za-z0-9_-]*$/;function Yi(e){if(!Ji.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Xi=C(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ji,k.init(e,t),e._zod.check=n=>{Yi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Zi=C(`$ZodE164`,(e,t)=>{t.pattern??=$n,k.init(e,t)}),Qi=/[- ]/g;function $i(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 ea(e){return er.test(e)?$i(e.replace(Qi,``)):!1}var ta=C(`$ZodCreditCard`,(e,t)=>{t.pattern??=er,k.init(e,t),e._zod.check=n=>{ea(n.value)||n.issues.push({code:`invalid_format`,format:`credit_card`,input:n.value,inst:e,continue:!t.abort})}});function na(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 ra(e){return nr.test(e)?na(e):!1}var ia=C(`$ZodIBAN`,(e,t)=>{t.pattern??=nr,k.init(e,t),e._zod.check=n=>{ra(n.value)||n.issues.push({code:`invalid_format`,format:`iban`,input:n.value,inst:e,continue:!t.abort})}});function aa(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 oa=C(`$ZodJWT`,(e,t)=>{k.init(e,t),e._zod.check=n=>{aa(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),sa=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})}}),ca=C(`$ZodNumber`,(e,t)=>{O.init(e,t),e._zod.pattern=pr,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}}),la=C(`$ZodNumberFormat`,(e,t)=>{Ur.init(e,t),ca.init(e,t)}),ua=C(`$ZodBoolean`,(e,t)=>{O.init(e,t),e._zod.pattern=mr,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}}),da=C(`$ZodBigInt`,(e,t)=>{O.init(e,t),e._zod.pattern=dr,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}}),fa=C(`$ZodBigIntFormat`,(e,t)=>{Wr.init(e,t),da.init(e,t)}),pa=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}}),ma=C(`$ZodUndefined`,(e,t)=>{O.init(e,t),e._zod.pattern=gr,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}}),ha=C(`$ZodNull`,(e,t)=>{O.init(e,t),e._zod.pattern=hr,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}}),ga=C(`$ZodAny`,(e,t)=>{O.init(e,t),e._zod.parse=e=>e}),_a=C(`$ZodUnknown`,(e,t)=>{O.init(e,t),e._zod.parse=e=>e}),va=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)}),ya=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}}),ba=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 xa(e,t){let n=qe(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of qe(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Je(n.issues,t,e),n}}return i(n,a)}}var Sa=e=>Array.isArray(e)?e.length:-1,Ca=e=>e instanceof Map?e.size:-1,wa=e=>e instanceof Set?e.size:-1;function Ta(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues)),t.value[n]=e.value}var Ea=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=>Ta(t,r,e)));else if(Ta(c,r,e),s&&c.issues.length!==0&&y(c))break}return o.length?Promise.all(o).then(()=>r):r},xa(e,Sa)});function Da(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 Oa=[];function ka(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Oa,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 Aa(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=>Da(e,n,i,t,d,f))):Da(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 ja=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(()=>ka(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=>Da(n,t,e,r,a,o))):Da(s,t,e,r,a,o)}return o?Aa(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Ma=C(`$ZodObjectJIT`,(e,t)=>{ja.init(e,t);let n=e._zod.parse,r=ne(()=>ka(t)),i=w.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new li([`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-2LSejcqM.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-eq8zrF0J.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-eq8zrF0J.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-2LSejcqM.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-2LSejcqM.js";var t={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./log-
|
|
1
|
+
import{c as e}from"./log-DeYiYzru.js";function t(e){return`messages`in e?e.state===`new`||e.state===`needs_you`||e.state===`fyi`:e.attention}var n={};function r(e){return{kind:`thread`,id:e.id,ts:e.lastMessageAt,unread:e.unread,thread:e}}function i(e){return{kind:`item`,id:e.id,ts:e.ts,unread:e.unread,item:e}}function a(e,t){return!(t.sourceKind!==void 0&&e.sourceKind!==t.sourceKind||t.projectId!==void 0||t.chatId!==void 0&&e.chatId!==t.chatId||t.attentionOnly===!0&&e.state!==`needs_you`&&e.state!==`new`)}function o(e,t){return!(t.sourceKind!==void 0&&e.source.kind!==t.sourceKind||t.projectId!==void 0&&e.projectId!==t.projectId||t.chatId!==void 0&&e.chatId!==t.chatId||t.attentionOnly===!0&&!e.attention)}function s(e,t){return e.unread===t.unread?t.ts-e.ts:e.unread?-1:1}function c(e,t){return t.ts-e.ts}function l(e,n,l,u){let d=e===`inbox`;return[...n.filter(e=>(!d||t(e))&&a(e,u)).map(r),...l.filter(e=>(!d||t(e))&&o(e,u)).map(i)].sort(d?s:c)}function u(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}var d=864e5;function f(e,t){let n=Math.round((t-e)/d);return n<=0?`Today`:n===1?`Yesterday`:new Date(e).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}function p(e,t){let n=u(t),r=[];for(let t of e){let e=u(t.ts),n=r[r.length-1];n!==void 0&&n.dayStart===e?n.records.push(t):r.push({dayStart:e,records:[t]})}return r.map(e=>({key:String(e.dayStart),label:f(e.dayStart,n),records:e.records}))}function m(e){let t=null;for(let n of e)(t===null||n.ts<t)&&(t=n.ts);return t}function h(e,t,n){let s=m(e.filter(e=>a(e,n)).map(r)),c=m(t.filter(e=>o(e,n)).map(i));return{threadBefore:s??2**53-1,itemBefore:c??2**53-1}}var g=[],_=[],v={},y={};function b(e,t){return e.length>0?e:t}function x(e,t,n){if(t.length===0)return[];let r=new Set(t.map(e=>e.id)),i=Math.min(...t.map(n));return e.filter(e=>!r.has(e.id)&&n(e)<i)}function S(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id));return[...e.filter(e=>!n.has(e.id)),...t]}var C=e=>e.lastMessageAt,w=e=>e.ts,T=e()(e=>({threads:g,items:_,unreadCount:0,total:0,snapshotAt:0,tab:`inbox`,filter:n,selectedThreadId:null,replyDrafts:v,olderExhausted:!1,rawOpen:y,applySnapshot:t=>e(e=>({threads:b([...t.threads,...x(e.threads,t.threads,C)],g),items:b([...t.items,...x(e.items,t.items,w)],_),unreadCount:t.unreadCount,total:t.total,snapshotAt:Date.now()})),appendPage:t=>e(e=>({threads:b(S(e.threads,t.threads),g),items:b(S(e.items,t.items),_),olderExhausted:t.threads.length===0&&t.items.length===0})),setTab:t=>e({tab:t}),setFilter:t=>e({filter:t,olderExhausted:!1}),select:t=>e({selectedThreadId:t}),setReplyDraft:(t,n)=>e(e=>({replyDrafts:{...e.replyDrafts,[t]:n}})),clearReplyDraft:t=>e(e=>({replyDrafts:{...e.replyDrafts,[t]:``}})),toggleRaw:t=>e(e=>{if(e.rawOpen[t]){let n=Object.fromEntries(Object.entries(e.rawOpen).filter(([e])=>e!==t));return{rawOpen:Object.keys(n).length>0?n:y}}return{rawOpen:{...e.rawOpen,[t]:!0}}})})),E=e=>e.unreadCount,D=e=>e.threads,O=e=>e.items,k=e=>e.total,A=e=>e.snapshotAt,j=e=>e.tab,M=e=>e.filter,N=e=>e.olderExhausted;function P(e){let t=e.selectedThreadId;return t===null?null:e.threads.find(e=>e.id===t)??null}export{k as a,P as c,n as d,p as f,D as i,A as l,l as m,O as n,E as o,h as p,j as r,N as s,M as t,T as u};
|