@open-mercato/cezar 0.16.0 → 0.16.1
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/contract/agent-profiles.d.ts +2 -2
- package/dist/contract/index.js +3 -0
- package/dist/contract/projects.d.ts +4 -0
- package/dist/core/backend-detect.js +10 -0
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +3 -0
- package/dist/core/codex-app-server-runner.js +46 -4
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/cursor-bin.d.ts +7 -0
- package/dist/core/cursor-bin.js +11 -0
- package/dist/core/cursor-bin.js.map +1 -1
- package/dist/core/provider-auth.d.ts +25 -7
- package/dist/core/provider-auth.js +141 -17
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/usage-limit.js +51 -6
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/runs/agent-error-telemetry.d.ts +3 -2
- package/dist/runs/agent-error-telemetry.js +24 -3
- package/dist/runs/agent-error-telemetry.js.map +1 -1
- package/dist/self-update/checkouts.js +8 -4
- package/dist/self-update/checkouts.js.map +1 -1
- package/dist/server/provider-auth-runtime.js +6 -3
- package/dist/server/provider-auth-runtime.js.map +1 -1
- package/dist/server/server.d.ts +10 -0
- package/dist/server/server.js +12 -3
- package/dist/server/server.js.map +1 -1
- package/dist/server/terminal/detected-urls.js +6 -1
- package/dist/server/terminal/detected-urls.js.map +1 -1
- package/dist/workspace/projects.d.ts +2 -0
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-task-pickers-DXaIqpJo.js → agent-task-pickers-B5I-IyLy.js} +1 -1
- package/web/dist/assets/{alert-dialog-BRafiUQO.js → alert-dialog-DvPnvVvK.js} +1 -1
- package/web/dist/assets/arrow-left-BELOeFyX.js +1 -0
- package/web/dist/assets/{automation-format-DeGsIrRc.js → automation-format-BL4n19a2.js} +1 -1
- package/web/dist/assets/{automations-route-CwLG2JNr.js → automations-route-BXxP0xWu.js} +1 -1
- package/web/dist/assets/{button-ZPJ84lSe.js → button-Clwd6u4_.js} +1 -1
- package/web/dist/assets/{centered-state-DPvWqO6I.js → centered-state-nM7v9xtl.js} +1 -1
- package/web/dist/assets/check-Dt8U0Zvm.js +1 -0
- package/web/dist/assets/chevron-left-Df5IsPem.js +1 -0
- package/web/dist/assets/chevron-right-VbYrJ_st.js +1 -0
- package/web/dist/assets/circle-check-DnEaQ9Rj.js +1 -0
- package/web/dist/assets/{collapsible-D5nsq_lY.js → collapsible-Bdyuw-he.js} +1 -1
- package/web/dist/assets/{commit-list-Cj_rtptn.js → commit-list-xMdmPYbz.js} +1 -1
- package/web/dist/assets/{compare-variants-DI8e5hXy.js → compare-variants-BWaSra3R.js} +1 -1
- package/web/dist/assets/{dashboard-Bq8Zgcct.js → dashboard-i4GP_SB1.js} +1 -1
- package/web/dist/assets/{diff-Dzk_1Vj_.js → diff-CJKocK17.js} +2 -2
- package/web/dist/assets/{diff-stat-CG6Qr4ac.js → diff-stat-CiWUpWY0.js} +1 -1
- package/web/dist/assets/{diff-view-CnRMn9fw.js → diff-view-DqWj0yYe.js} +1 -1
- package/web/dist/assets/{download-CAIBRPES.js → download-DOJ8Dqfh.js} +1 -1
- package/web/dist/assets/{file-BuJHbBa7.js → file-1a6_DhLG.js} +1 -1
- package/web/dist/assets/{file-preview-Dy3TYcU4.js → file-preview-iucr8WDo.js} +1 -1
- package/web/dist/assets/{file-text-DYR0Kxgo.js → file-text-DmMQx3hx.js} +1 -1
- package/web/dist/assets/{git-pull-request-draft-tzNd17hB.js → git-pull-request-draft-Cn24ayXz.js} +1 -1
- package/web/dist/assets/git-tab-loading-BfC2ir8N.js +1 -0
- package/web/dist/assets/{git-toolbar-Dc6kAzPv.js → git-toolbar-DU5Ca6RI.js} +1 -1
- package/web/dist/assets/{github-k0H4K2Xv.js → github-uQ7k7SEK.js} +1 -1
- package/web/dist/assets/{host-usage-BmL2kzAM.js → host-usage-DjDYDU0A.js} +1 -1
- package/web/dist/assets/{icon-tooltip-BEOrU9g6.js → icon-tooltip-YXzUubMO.js} +1 -1
- package/web/dist/assets/{index-B7LeGGi2.js → index-Cse8uyXO.js} +4 -4
- package/web/dist/assets/{input-NF_gJ6fV.js → input-DIWTlsx6.js} +1 -1
- package/web/dist/assets/{layout-cards-Cx4pRGy3.js → layout-cards-Sur4EWtx.js} +1 -1
- package/web/dist/assets/loader-circle-D-ter0qP.js +1 -0
- package/web/dist/assets/{markdown-D27e_KDW.js → markdown-BzqT8I8y.js} +1 -1
- package/web/dist/assets/{markdown-DUNEzJJg.js → markdown-Rbaca31B.js} +1 -1
- package/web/dist/assets/{message-square-DHEW7I0Y.js → message-square-EWpWB_Gr.js} +1 -1
- package/web/dist/assets/plus-CBVm02wz.js +1 -0
- package/web/dist/assets/{project-router-CIOAbq2D.js → project-router-DZsR9P9C.js} +1 -1
- package/web/dist/assets/{queries-B--Cyn_0.js → queries-CI0EmEcH.js} +1 -1
- package/web/dist/assets/{reference-chip-C0KB59wJ.js → reference-chip-DnemrSPW.js} +1 -1
- package/web/dist/assets/{repo-git-BlEiXMbR.js → repo-git-CxAx2JBB.js} +1 -1
- package/web/dist/assets/{run-diff-C_AD_Pms.js → run-diff-BPZ85gAE.js} +1 -1
- package/web/dist/assets/{save-Ct323V7q.js → save-B8DEQI2V.js} +1 -1
- package/web/dist/assets/{scroll-within-DVYNEANz.js → scroll-within-Cm6fjjNd.js} +1 -1
- package/web/dist/assets/{search-x-7tkSEIRx.js → search-x-CuinYQnl.js} +1 -1
- package/web/dist/assets/{settings-2-CmkgM6rX.js → settings-2-COky68xN.js} +1 -1
- package/web/dist/assets/{skills-DKqFJCnx.js → skills-B1z9gRg4.js} +1 -1
- package/web/dist/assets/{square-Du4NO0cr.js → square-8OFxLPoA.js} +1 -1
- package/web/dist/assets/{tabs-BhcbXPq1.js → tabs-BUk8rSoE.js} +1 -1
- package/web/dist/assets/{tag-DczwHOyX.js → tag-yruQH0i-.js} +1 -1
- package/web/dist/assets/{task-commits-DtSkB1UU.js → task-commits-W1ZZiEt4.js} +1 -1
- package/web/dist/assets/{task-graph-DalcExDj.js → task-graph-fkOtF8MX.js} +1 -1
- package/web/dist/assets/{task-notes-BHYduZ1z.js → task-notes-lmvd1UM7.js} +1 -1
- package/web/dist/assets/{task-workspace-LhAGqT6q.js → task-workspace-DA3mFwL9.js} +3 -3
- package/web/dist/assets/{terminal-tordSBUt.js → terminal-F3ZJ5fI8.js} +1 -1
- package/web/dist/assets/{terminal-drawer-Cvbqz2QG.js → terminal-drawer-DAkquqSe.js} +2 -2
- package/web/dist/assets/{textarea-Dy9f469S.js → textarea-ewNKsXDa.js} +1 -1
- package/web/dist/assets/{token-metrics-edH1Iifj.js → token-metrics-Dk2ZNHb_.js} +1 -1
- package/web/dist/assets/{tooltip-tycRJnh-.js → tooltip-B628Gs7C.js} +1 -1
- package/web/dist/assets/{tracker-BNqQ5hFE.js → tracker-wxG0l2wk.js} +1 -1
- package/web/dist/assets/{triangle-alert-BDB8QKSV.js → triangle-alert-BqI_9MkV.js} +1 -1
- package/web/dist/assets/{upload-H7_s70Ro.js → upload-J0hBTVF7.js} +1 -1
- package/web/dist/assets/{use-automations-7Eect_3d.js → use-automations-v77gHYDG.js} +1 -1
- package/web/dist/assets/{use-now-DUGH_55J.js → use-now-pBdvhv13.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-D4G7Y1CV.js → use-submit-shortcut-hAaAH4HY.js} +1 -1
- package/web/dist/assets/{workflow-graph-4GB6HfLn.js → workflow-graph-Bo72pTbt.js} +1 -1
- package/web/dist/assets/worktree-lifecycle-operation-DOTiqQFx.js +18 -0
- package/web/dist/assets/x-DMIsmLBt.js +1 -0
- package/web/dist/index.html +37 -37
- package/web/dist/assets/arrow-left-BfLRAgF_.js +0 -1
- package/web/dist/assets/check-Blje0ysd.js +0 -1
- package/web/dist/assets/chevron-left-CwNUPSrV.js +0 -1
- package/web/dist/assets/chevron-right-dAzuginM.js +0 -1
- package/web/dist/assets/circle-check-B_-oU6Lf.js +0 -1
- package/web/dist/assets/git-tab-loading-BL6wGQi_.js +0 -1
- package/web/dist/assets/loader-circle-i7B5PoZa.js +0 -1
- package/web/dist/assets/plus-CUeDPNAL.js +0 -1
- package/web/dist/assets/worktree-lifecycle-operation-C6S6Hgiq.js +0 -18
- package/web/dist/assets/x-PavsP4k3.js +0 -1
|
@@ -57,7 +57,7 @@ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}f
|
|
|
57
57
|
|
|
58
58
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=oe,c=!S.jitless,l=c&&se.value,d=t.catchall,f;e._zod.parse=(i,u)=>{f??=r.value;let p=i.value;return s(p)?c&&l&&u?.async===!1&&u.jitless!==!0?(o||=a(t.shape),i=o(i,u),d?Ar([],p,i,u,f,e,u?.abortEarly===!0):i):n(i,u):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Nr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ee(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>je(e,r,nt())))}),t)}var Pr=x(`$ZodUnion`,(e,t)=>{w.init(e,t),b(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),b(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),b(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>f(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Nr(t,r,e,i)):Nr(o,r,e,i)}});function Fr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ir=x(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Pr.init(e,t);let n=e._zod.parse;b(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||m(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=h(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=u(()=>Fr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!oe(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Lr=x(`$ZodIntersection`,(e,t)=>{w.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>zr(e,t,n)):zr(e,i,a)}});function Rr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ce(e)&&ce(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Rr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Rr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function zr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Rr(t.value,n.value);if(!c.valid){if(Ee(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Br=x(`$ZodRecord`,(e,t)=>{w.init(e,t);let n=S.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ce(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>je(e,i,nt())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Oe(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Oe(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e))if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e);l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&cn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>je(e,i,nt())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Oe(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Oe(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Vr=x(`$ZodEnum`,(e,t)=>{w.init(e,t);let n=o(t.entries),r=new Set(n);e._zod.values=r,b(e,`pattern`,e=>{let t=o(e.def.entries).filter(e=>ue.has(typeof e));return RegExp(t.length?`^(${t.map(e=>de(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Hr=x(`$ZodLiteral`,(e,t)=>{w.init(e,t);let n=new Set(t.values);e._zod.values=n,b(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?de(e):e?de(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ur=x(`$ZodTransform`,(e,t)=>{w.init(e,t),e._zod.optin=`optional`,S.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new et;return n.value=i,n}});function Wr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Gr=x(`$ZodOptional`,(e,t)=>{w.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${f(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Wr(e,t)):Wr(e,r)}return t.innerType._zod.run(e,n)}}),Kr=x(`$ZodExactOptional`,(e,t)=>{Gr.init(e,t),b(e,`values`,e=>e.def.innerType._zod.values),b(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),qr=x(`$ZodNullable`,(e,t)=>{w.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin),b(e,`optout`,e=>e.def.innerType._zod.optout),b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${f(t.source)}|null)$`):void 0}),b(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Jr=x(`$ZodDefault`,(e,t)=>{w.init(e,t),e._zod.optin=`defaulted`,b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Yr(e,t)):Yr(r,t)}});function Yr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Xr=x(`$ZodPrefault`,(e,t)=>{w.init(e,t),e._zod.optin=`defaulted`,b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Zr=x(`$ZodNonOptional`,(e,t)=>{w.init(e,t),b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Qr(t,e)):Qr(i,e)}});function Qr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function $r(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>je(e,r,nt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ei=x(`$ZodCatch`,(e,t)=>{w.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),b(e,`optout`,e=>e.def.innerType._zod.optout),b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>$r(e,r,t,n)):$r(e,r,t,n)}}),ti=x(`$ZodPipe`,(e,t)=>{w.init(e,t),b(e,`values`,e=>e.def.in._zod.values),b(e,`optin`,e=>e.def.in._zod.optin),b(e,`optout`,e=>e.def.out._zod.optout),b(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ni(e,t.in,n)):ni(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ni(e,t.out,n)):ni(r,t.out,n)}});function ni(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ri=x(`$ZodReadonly`,(e,t)=>{w.init(e,t),b(e,`propValues`,e=>e.def.innerType._zod.propValues),b(e,`values`,e=>e.def.innerType._zod.values),b(e,`optin`,e=>e.def.innerType?._zod?.optin),b(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ii):ii(r)}});function ii(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ai=x(`$ZodCustom`,(e,t)=>{C.init(e,t),w.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>oi(t,n,r,e));oi(i,n,r,e)}});function oi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ie(e))}}var si=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ci=`~memo`,li=[];function ui(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function di(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var fi=new WeakMap,pi=0,mi=1,hi=2;function gi(e,t,n){let r=fi.get(e);if(r!==void 0)return r?hi:pi;if(t.has(e))return hi;t.add(e);let i=pi,a=e=>{if(i!==hi&&e?._zod){let r=gi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=pi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?mi:o.value?._zod?gi(o.value,t,n):pi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=h(c);s(e?o(e,!0):mi),a(c.catchall);break}case`properties`:s(o(c.shape,!1));break;case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?gi(r,t,!1):mi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),_i(e,i)}function _i(e,t){return t!==mi&&fi.set(e,t===hi),t}function vi(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var yi,bi=[],xi={alloc(e,t,n){let r=yi;if(!r)return n;yi=void 0;let i={value:n,issues:null};return r.set(t.value,i),bi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ci(n,e.value))throw new si;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=gi(e,new Set,!1);if(i===pi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===hi||r?n=!0:r=!0}let l=s.value;if(!ui(l))return t(s,c);let u=c[ci];u||(u={buckets:new WeakMap,backEdges:void 0},c[ci]=u);let d;i===c?d=a:(d=vi(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...di(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;yi=d;let p=bi.length,m=t(s,c);yi=void 0;let h=bi.length>p?bi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?di(e.issues):li),e)):(h&&(h.issues=m.issues.length?di(m.issues):li),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Si(){return xi}function Ci(e,t){let n=e[ci]?.backEdges;return n!==void 0&&ui(t)&&n.has(t)}var wi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Fe(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${pe(e.values[0])}`:`Invalid option: expected one of ${s(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${s(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ti(){return{localeError:wi()}}var Ei,Di=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Oi(){return new Di}(Ei=globalThis).__zod_globalRegistry??(Ei.__zod_globalRegistry=Oi());var ki=globalThis.__zod_globalRegistry;function Ai(e,t){return new e({type:`string`,...y(t)})}function ji(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}function Mi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}function Ni(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}function Pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}function Fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}function Ii(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}function Li(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}function Ri(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}function zi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}function Bi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}function Vi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}function Hi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}function Ui(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}function Wi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}function Gi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}function Ki(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}function qi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}function Ji(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}function Yi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}function Xi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}function Zi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}function Qi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}function $i(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}function ea(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}function ta(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}function na(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}function ra(e,t){return new e({type:`number`,checks:[],...y(t)})}function ia(e,t){return new e({type:`number`,coerce:!0,checks:[],...y(t)})}function aa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}function oa(e,t){return new e({type:`boolean`,...y(t)})}function sa(e,t){return new e({type:`null`,...y(t)})}function ca(e){return new e({type:`any`})}function la(e){return new e({type:`unknown`})}function ua(e,t){return new e({type:`never`,...y(t)})}function da(e,t){return new hn({check:`less_than`,...y(t),value:e,inclusive:!1})}function fa(e,t){return new hn({check:`less_than`,...y(t),value:e,inclusive:!0})}function pa(e,t){return new gn({check:`greater_than`,...y(t),value:e,inclusive:!1})}function ma(e,t){return new gn({check:`greater_than`,...y(t),value:e,inclusive:!0})}function ha(e,t){return new _n({check:`multiple_of`,...y(t),value:e})}function ga(e,t){return new yn({check:`max_length`,...y(t),maximum:e})}function _a(e,t){return new bn({check:`min_length`,...y(t),minimum:e})}function va(e,t){return new xn({check:`length_equals`,...y(t),length:e})}function ya(e,t){return new Cn({check:`string_format`,format:`regex`,...y(t),pattern:e})}function ba(e){return new wn({check:`string_format`,format:`lowercase`,...y(e)})}function xa(e){return new Tn({check:`string_format`,format:`uppercase`,...y(e)})}function Sa(e,t){return new En({check:`string_format`,format:`includes`,...y(t),includes:e})}function Ca(e,t){return new Dn({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}function wa(e,t){return new On({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}function Ta(e){return new kn({check:`overwrite`,tx:e})}function Ea(e){return Ta(t=>t.normalize(e))}function Da(){return Ta(e=>e.trim())}function Oa(){return Ta(e=>e.toLowerCase())}function ka(){return Ta(e=>e.toUpperCase())}function Aa(){return Ta(e=>ie(e))}function ja(e,t,n){return new e({type:`array`,element:t,...y(n)})}function Ma(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}function Na(e,t){let n=Pa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ie(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ie(r))}},e(t.value,t)),t);return n}function Pa(e,t){let n=new C({check:`custom`,...y(t)});return n._zod.check=e,n}function Fa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&m(e,t,n[t]);return e}function Ia(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ki,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function La(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function E(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,E(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Fa(o.schema,c),t.io===`input`&&D(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ra(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function za(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ra(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ra(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
59
59
|
|
|
60
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ba(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ba(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Va=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ha=[`oneOf`,`anyOf`];function Ua(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Wa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ua(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}m(n,r,e.length===1?e[0]:Wa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ua(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ga(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Va)if(t in e)return;let n=t.filter(e=>Ha.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Wa(t);else{let e=n[0],i=Ha.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Wa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Fa(e,r))}function Ka(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Fa(i,s),Fa(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ba(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ga(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Fa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,m(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ja(t,`input`,e.processors),output:Ja(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function D(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return D(r.element,n);if(r.type===`set`)return D(r.valueType,n);if(r.type===`lazy`)return D(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return D(r.innerType,n);if(r.type===`intersection`)return D(r.left,n)||D(r.right,n);if(r.type===`record`||r.type===`map`)return D(r.keyType,n)||D(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:D(r.in,n)||D(r.out,n);if(r.type===`object`){for(let e in r.shape)if(D(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(D(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(D(e,n))return!0;return!!(r.rest&&D(r.rest,n))}return!1}var qa=(e,t={})=>n=>{let r=Ia({...n,processors:t});return E(e,r),za(r,e),Ka(r,e)},Ja=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ia({...i??{},target:a,io:t,processors:n});return E(e,o),za(o,e),Ka(o,e)},Ya=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Xa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Za=(e,t)=>{Ya(e,`minimum`,t),Xa(e,`maximum`,t)},Qa=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},$a=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},eo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},to=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},no=(e,t)=>Ya(e,`minimum`,t.minimum),ro=(e,t)=>Xa(e,`maximum`,t.maximum),io=e=>(t,n)=>{to(t,n.format);let[r,i]=e[n.format];Ya(t,`minimum`,r),Xa(t,`maximum`,i)},ao={greater_than:(e,t)=>Ya(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Xa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Qa(e,t.value),number_format:io(he),bigint_format:io(ge),min_length:no,max_length:ro,length_equals:(e,t)=>Za(e,t.length),min_size:no,max_size:ro,size_equals:(e,t)=>Za(e,t.size),string_format:(e,t)=>{to(e,t.format),t.pattern&&$a(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>eo(e,t.mime)};function O(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ao[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ya(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ya(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Xa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Xa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Qa(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&eo(t,i.mime);for(let e of i.patterns??[])$a(t,e);return t}var oo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},so=new Map([[ur,Yt],[fr,Xt]]),co=e=>so.get(e)??e,lo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=O(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=oo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(co);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},uo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=O(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):La(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},fo=(e,t,n,r)=>{n.type=`boolean`},po=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mo=(e,t,n,r)=>{n.not={}},ho=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},go=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(La(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(La(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_o=(e,t,n,r)=>{La(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},vo=(e,t,n,r)=>{La(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},yo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=O(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=E(a.element,t,{...r,path:[...r.path,`items`]})};function bo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?bo(t.out):t.type===`catch`?bo(t.innerType):e._zod.optin}var xo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&La(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)m(i.properties,e,E(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?bo(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=E(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},So=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>E(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Co=(e,t,n,r)=>{let i=e._zod.def,a=E(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=E(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function wo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=wo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>wo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?cn:sn).source),p):p}var To=new WeakMap;function Eo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of To.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=wo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Do=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=O(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=E(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)m(i.patternProperties,co(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=E(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=To.get(t);n||(n=[],To.set(t,n),t.deferred.push(()=>Eo(t))),n.push(e)}i.additionalProperties=E(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&bo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Oo=(e,t,n,r)=>{let i=e._zod.def,a=E(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ko=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ao=Symbol();function jo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(La(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ao):JSON.parse(o)}var Mo=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=jo(i.defaultValue,e,t,n,r);o!==Ao&&(n.default=o)},No=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=jo(i.defaultValue,e,t,n,r);o!==Ao&&(n._prefault=o)},Po=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{La(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Fo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;E(o,t,r);let s=t.seen.get(e);s.ref=o},Io=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lo=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ro=new WeakSet([Object.prototype,Error.prototype]);function zo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var k=x(`ZodError`,(e,t)=>{lt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ro.has(n)||(Ro.add(n),zo(n,`format`,e=>t=>ft(e,t)),zo(n,`flatten`,e=>t=>dt(e,t)),zo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),zo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Bo=mt(k),Vo=ht(k),Ho=gt(k),Uo=vt(k),Wo=wt(k),Go=Tt(k),Ko=Et(k),qo=Dt(k),Jo=Ot(k),Yo=kt(k),Xo=At(k),Zo=jt(k);function Qo(){S.localeError||nt(Ti())}function $o(){S.memoizer||nt({memoizer:Si()})}var A=x(`ZodType`,(e,t)=>(Qo(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(v(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return fe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_c(e,t))},superRefine(e,t){return this.check(vc(e,t))},overwrite(e){return this.check(Ta(e))},optional(){return $s(this)},exactOptional(){return tc(this)},nullable(){return rc(this)},nullish(){return $s(rc(this))},nonoptional(e){return lc(this,e)},array(){return F(this)},or(e){return R([this,e])},and(e){return Ks(this,e)},transform(e){return pc(this,Zs(e))},default(e){return ac(this,e)},prefault(e){return sc(this,e)},catch(e){return dc(this,e)},pipe(e){return pc(this,e)},readonly(){return hc(this)},describe(e){let t=this.clone();return ki.add(t,{description:e}),t},meta(...e){if(e.length===0)return ki.get(this);let t=this.clone();return ki.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ze(this,`~standard`,{...Pn(this),jsonSchema:{input:Ja(this,`input`),output:Ja(this,`output`)}})},set"~standard"(e){Re(this,`~standard`,e)},parse:function e(t,n){return Bo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Vo(this,t,n,{callee:e})},safeParse(e,t){return Ho(this,e,t)},async safeParseAsync(e,t){return Uo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Re(this,`spa`,e)},validate(e,t){return xt(this,e,t)},validateAsync(e,t){return Ct(this,e,t)},encode:function e(t,n){return Wo(this,t,n,{callee:e})},decode:function e(t,n){return Go(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ko(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await qo(this,t,n,{callee:e})},safeEncode(e,t){return Jo(this,e,t)},safeDecode(e,t){return Yo(this,e,t)},async safeEncodeAsync(e,t){return Xo(this,e,t)},async safeDecodeAsync(e,t){return Zo(this,e,t)},toJSONSchema(e){return qa(this,{})(e)},get description(){return ki.get(this)?.description},get _def(){return this._zod.def}}),es=x(`_ZodString`,(e,t)=>{Fn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r)},Be({format:e=>O(e).format??null,minLength:e=>O(e).minimum??null,maxLength:e=>O(e).maximum??null},{regex(...e){return this.check(ya(...e))},includes(...e){return this.check(Sa(...e))},startsWith(...e){return this.check(Ca(...e))},endsWith(...e){return this.check(wa(...e))},min(...e){return this.check(_a(...e))},max(...e){return this.check(ga(...e))},length(...e){return this.check(va(...e))},nonempty(...e){return this.check(_a(1,...e))},lowercase(e){return this.check(ba(e))},uppercase(e){return this.check(xa(e))},trim(){return this.check(Da())},normalize(...e){return this.check(Ea(...e))},toLowerCase(){return this.check(Oa())},toUpperCase(){return this.check(ka())},slugify(){return this.check(Aa())}})),ts=x(`ZodString`,(e,t)=>{Fn.init(e,t),es.init(e,t)},{email(e){return this.check(ji(os,e))},url(e){return this.check(Li(ds,e))},jwt(e){return this.check(Qi(Ds,e))},emoji(e){return this.check(Ri(ps,e))},guid(e){return this.check(Mi(cs,e))},uuid(e){return this.check(Ni(ls,e))},uuidv4(e){return this.check(Pi(ls,e))},uuidv6(e){return this.check(Fi(ls,e))},uuidv7(e){return this.check(Ii(ls,e))},nanoid(e){return this.check(zi(ms,e))},cuid(e){return this.check(Bi(hs,e))},cuid2(e){return this.check(Vi(gs,e))},ulid(e){return this.check(Hi(_s,e))},base64(e){return this.check(Yi(ws,e))},base64url(e){return this.check(Xi(Ts,e))},xid(e){return this.check(Ui(vs,e))},ksuid(e){return this.check(Wi(ys,e))},ipv4(e){return this.check(Gi(bs,e))},ipv6(e){return this.check(Ki(xs,e))},cidrv4(e){return this.check(qi(Ss,e))},cidrv6(e){return this.check(Ji(Cs,e))},e164(e){return this.check(Zi(Es,e))},datetime(e){return this.check($i(ns,e))},date(e){return this.check(ea(rs,e))},time(e){return this.check(ta(is,e))},duration(e){return this.check(na(as,e))}});function j(e){return Ai(ts,e)}var M=x(`ZodStringFormat`,(e,t)=>{T.init(e,t),es.init(e,t)}),ns=x(`ZodISODateTime`,(e,t)=>{Qn.init(e,t),M.init(e,t)}),rs=x(`ZodISODate`,(e,t)=>{$n.init(e,t),M.init(e,t)}),is=x(`ZodISOTime`,(e,t)=>{er.init(e,t),M.init(e,t)}),as=x(`ZodISODuration`,(e,t)=>{tr.init(e,t),M.init(e,t)}),os=x(`ZodEmail`,(e,t)=>{Rn.init(e,t),M.init(e,t)});function ss(e){return ji(os,e)}var cs=x(`ZodGUID`,(e,t)=>{In.init(e,t),M.init(e,t)}),ls=x(`ZodUUID`,(e,t)=>{Ln.init(e,t),M.init(e,t)});function us(e){return Ni(ls,e)}var ds=x(`ZodURL`,(e,t)=>{Wn.init(e,t),M.init(e,t)});function fs(e){return Li(ds,e)}var ps=x(`ZodEmoji`,(e,t)=>{Gn.init(e,t),M.init(e,t)}),ms=x(`ZodNanoID`,(e,t)=>{Kn.init(e,t),M.init(e,t)}),hs=x(`ZodCUID`,(e,t)=>{qn.init(e,t),M.init(e,t)}),gs=x(`ZodCUID2`,(e,t)=>{Jn.init(e,t),M.init(e,t)}),_s=x(`ZodULID`,(e,t)=>{Yn.init(e,t),M.init(e,t)}),vs=x(`ZodXID`,(e,t)=>{Xn.init(e,t),M.init(e,t)}),ys=x(`ZodKSUID`,(e,t)=>{Zn.init(e,t),M.init(e,t)}),bs=x(`ZodIPv4`,(e,t)=>{nr.init(e,t),M.init(e,t)}),xs=x(`ZodIPv6`,(e,t)=>{ar.init(e,t),M.init(e,t)}),Ss=x(`ZodCIDRv4`,(e,t)=>{or.init(e,t),M.init(e,t)}),Cs=x(`ZodCIDRv6`,(e,t)=>{cr.init(e,t),M.init(e,t)}),ws=x(`ZodBase64`,(e,t)=>{dr.init(e,t),M.init(e,t)}),Ts=x(`ZodBase64URL`,(e,t)=>{mr.init(e,t),M.init(e,t)}),Es=x(`ZodE164`,(e,t)=>{hr.init(e,t),M.init(e,t)}),Ds=x(`ZodJWT`,(e,t)=>{_r.init(e,t),M.init(e,t)}),Os=x(`ZodNumber`,(e,t)=>{vr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.isFinite=!0},Be({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=O(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=O(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=O(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>O(e).format??null},{gt(e,t){return this.check(pa(e,t))},gte(e,t){return this.check(ma(e,t))},min(e,t){return this.check(ma(e,t))},lt(e,t){return this.check(da(e,t))},lte(e,t){return this.check(fa(e,t))},max(e,t){return this.check(fa(e,t))},int(e){return this.check(As(e))},safe(e){return this.check(As(e))},positive(e){return this.check(pa(0,e))},nonnegative(e){return this.check(ma(0,e))},negative(e){return this.check(da(0,e))},nonpositive(e){return this.check(fa(0,e))},multipleOf(e,t){return this.check(ha(e,t))},step(e,t){return this.check(ha(e,t))},finite(){return this}}));function N(e){return ra(Os,e)}var ks=x(`ZodNumberFormat`,(e,t)=>{yr.init(e,t),Os.init(e,t)});function As(e){return aa(ks,e)}var js=x(`ZodBoolean`,(e,t)=>{br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r)});function P(e){return oa(js,e)}var Ms=x(`ZodNull`,(e,t)=>{xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r)});function Ns(e){return sa(Ms,e)}var Ps=x(`ZodAny`,(e,t)=>{Sr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fs(){return ca(Ps)}var Is=x(`ZodUnknown`,(e,t)=>{Cr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ls(){return la(Is)}var Rs=x(`ZodNever`,(e,t)=>{wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r)});function zs(e){return ua(Rs,e)}var Bs=x(`ZodArray`,(e,t)=>{$o(),Er.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(_a(e,t))},nonempty(e){return this.check(_a(1,e))},max(e,t){return this.check(ga(e,t))},length(e,t){return this.check(va(e,t))},unwrap(){return this.element}});function F(e,t){return ja(Bs,e,t)}var Vs=x(`ZodObject`,(e,t)=>{$o(),Mr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),Ke(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v(this._zod.def,{catchall:Ls()}))},loose(){return this.clone(v(this._zod.def,{catchall:Ls()}))},strict(){return this.clone(v(this._zod.def,{catchall:zs()}))},strip(){return this.clone(v(this._zod.def,{catchall:void 0}))},extend(e){return be(this,e)},safeExtend(e){return Se(this,e)},merge(e){return Ce(this,e)},pick(e){return _e(this,e)},omit(e){return ye(this,e)},partial(...e){return we(Qs,this,e[0])},exactPartial(...e){return we(ec,this,e[0],`exactPartial`)},required(...e){return Te(cc,this,e[0])}});function I(e,t){return new Vs({type:`object`,shape:e??{},...y(t)})}function Hs(e,t){return new Vs({type:`object`,shape:e,catchall:zs(),...y(t)})}function L(e,t){return new Vs({type:`object`,shape:e,catchall:Ls(),...y(t)})}var Us=x(`ZodUnion`,(e,t)=>{Pr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.options=t.options});function R(e,t){return new Us({type:`union`,options:e,...y(t)})}var Ws=x(`ZodDiscriminatedUnion`,(e,t)=>{Us.init(e,t),Ir.init(e,t)});function z(e,t,n){return new Ws({type:`union`,options:t,discriminator:e,...y(n)})}var Gs=x(`ZodIntersection`,(e,t)=>{Lr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function Ks(e,t){return new Gs({type:`intersection`,left:e,right:t})}var qs=x(`ZodRecord`,(e,t)=>{$o(),Br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,n){return!t||!t._zod?new qs({type:`record`,keyType:j(),valueType:e,...y(t)}):new qs({type:`record`,keyType:e,valueType:t,...y(n)})}var Js=x(`ZodEnum`,(e,t)=>{Vr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Js({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Js({...t,checks:[],...y(r),entries:i})}});function V(e,t){return new Js({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Ys=x(`ZodLiteral`,(e,t)=>{Hr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new Ys({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var Xs=x(`ZodTransform`,(e,t)=>{$o(),Ur.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ie(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ie(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Zs(e){return new Xs({type:`transform`,transform:e})}var Qs=x(`ZodOptional`,(e,t)=>{Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`optional`,innerType:e})}var ec=x(`ZodExactOptional`,(e,t)=>{Kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tc(e){return new ec({type:`optional`,innerType:e})}var nc=x(`ZodNullable`,(e,t)=>{qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rc(e){return new nc({type:`nullable`,innerType:e})}var ic=x(`ZodDefault`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ac(e,t){return new ic({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var oc=x(`ZodPrefault`,(e,t)=>{Xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e,t){return new oc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var cc=x(`ZodNonOptional`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e,t){return new cc({type:`nonoptional`,innerType:e,...y(t)})}var uc=x(`ZodCatch`,(e,t)=>{ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dc(e,t){return new uc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Je(t)})}var fc=x(`ZodPipe`,(e,t)=>{ti.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.in=t.in,e.out=t.out});function pc(e,t){return new fc({type:`pipe`,in:e,out:t})}var mc=x(`ZodReadonly`,(e,t)=>{ri.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e){return new mc({type:`readonly`,innerType:e})}var gc=x(`ZodCustom`,(e,t)=>{ai.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)});function _c(e,t={}){return Ma(gc,e,t)}function vc(e,t){return Na(e,t)}function yc(e){return $i(ns,e)}function U(e){return ia(Os,e)}L({seq:N(),ts:j(),stepId:j().optional(),type:j()});var bc=I({id:j().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),xc=j().min(1).max(2048);I({cursor:xc.optional()}),I({cursor:xc.optional(),afterSeq:U().int().nonnegative().optional()});var Sc=I({seq:N(),ts:j(),stepId:j().optional(),type:j()}).catchall(Fs()),Cc=I({events:F(Sc),itemCount:N().int().min(0).max(100),olderCursor:xc.optional(),newerCursor:xc.optional(),liveCursor:xc,asOfSeq:N().int().nonnegative(),hasOlder:P()}),wc=I({contextEvents:F(Sc),asOfSeq:N().int().nonnegative()});I({checkoutId:j().optional(),name:j(),phase:V([`cloning`,`done`,`error`]),line:j().optional(),error:j().optional()});var W=V([`claude`,`codex`,`opencode`,`cursor`,`pi`,`junie`,`copilot`]),Tc=I({root:j(),branch:j(),remote:j().optional()}),Ec=I({name:V([`claude`,`codex`,`opencode`,`cursor`,`pi`,`junie`,`copilot`,`gh`,`git`]),available:P(),version:j().optional(),hint:j().optional()}),Dc=I({kind:H(`github`),available:P().optional(),reason:j().optional()}),Oc=I({localHandoff:P(),terminal:P(),designMode:P(),followups:P(),singleProject:P(),automations:P(),dispatch:P(),tokenMetrics:P(),tokenUsageMetrics:P(),costMetrics:P()});I({version:j(),latestVersion:j().optional(),repoRoot:j(),repo:Tc.nullable(),checks:F(Ec),defaultRunner:W,forge:Dc.nullable(),capabilities:Oc,projects:F(I({id:j(),name:j()})),bootProject:j(),instanceId:j().optional()});var G=j().uuid(),kc=V([`setup`,`teardown`]),Ac=V([`create`,`recreate`,`remove-worktree`,`delete-task`,`reclaim`,`discard-variant`,`orphan`]),jc=V([`queued`,`running`,`needs_attention`,`interrupted`,`committing`,`completed`,`bypassed`,`cancelled`,`kept`]),Mc=V([`retry`,`start-anyway`,`cancel-task`,`keep-worktree`,`force-delete`,`stop`]),Nc=I({id:G,name:j().max(120).optional(),command:j().max(32*1024).refine(e=>e.trim().length>0,`Command must not be blank`),timeoutSeconds:N().int().min(1).max(86400).optional()}).strict(),Pc=I({afterCreate:F(Nc).max(32),beforeRemove:F(Nc).max(32)}).strict().superRefine((e,t)=>{let n=new Set;for(let r of[`afterCreate`,`beforeRemove`])e[r].forEach((e,i)=>{n.has(e.id)&&t.addIssue({code:`custom`,path:[r,i,`id`],message:`Entry IDs must be unique across both lists`}),n.add(e.id)})}),Fc=I({worktreeId:G,generation:N().int().positive(),activeOperationId:G.optional(),phase:kc.optional(),state:jc.optional(),needsAttention:P()});I({schemaVersion:H(1),worktreeId:G,runId:bc.shape.id,projectRoot:j().min(1),worktreePath:j().min(1),branch:j().optional(),generation:N().int().positive(),preparedBy:V([`completed`,`bypassed`]).optional(),autoCleanupSuppressed:P(),activeOperationId:G.optional(),createdAt:j(),updatedAt:j()}).passthrough();var Ic=I({pid:N().int().positive(),hostname:j(),startedAt:j(),startIdentity:j().optional(),quiescent:P().optional()}).passthrough(),Lc=I({id:G,operationId:G,entryId:G,fingerprint:j().min(1),ordinal:N().int().nonnegative(),label:j(),commandPreview:j(),attempt:N().int().positive(),state:V([`running`,`succeeded`,`failed`,`interrupted`,`skipped`]),startedAt:j(),finishedAt:j().optional(),exitCode:N().int().nullable().optional(),signal:j().nullable().optional(),reason:j().optional(),outputStartSeq:N().int().nonnegative().optional(),outputEndSeq:N().int().nonnegative().optional(),outputTruncated:P().optional(),process:Ic.optional()}).passthrough(),Rc=I({kind:V([`initial`,`continuation`]),runId:bc.shape.id,message:j().optional()}).passthrough(),zc=I({schemaVersion:H(1),id:G,worktreeId:G,generation:N().int().positive(),phase:kc,intent:Ac,state:jc,revision:N().int().nonnegative(),createdAt:j(),updatedAt:j(),finishedAt:j().optional(),pendingLaunch:Rc.optional(),agentQuiescencePending:P().optional(),failureStage:V([`config`,`context`,`storage`,`command`,`commit`,`process`]).optional(),error:j().optional(),decision:I({action:Mc,actor:j(),at:j(),skippedEntryIds:F(G).optional()}).optional(),configRevision:j().nullable().optional(),executions:F(Lc).max(100),successfulEntries:F(I({entryId:G,fingerprint:j()})).default([]),requests:F(I({requestId:G,bodyHash:j()})).default([])}).passthrough(),Bc=I({entryId:G,label:j(),commandPreview:j(),state:V([`pending`,`running`,`succeeded`,`failed`,`interrupted`,`already-completed`,`skipped`,`removed`]),attempt:N().int().nonnegative()}),Vc=Lc.omit({process:!0}).strip(),Hc=zc.omit({schemaVersion:!0,pendingLaunch:!0,agentQuiescencePending:!0,requests:!0,successfulEntries:!0,executions:!0}).strip().extend({history:F(Vc),entries:F(Bc),allowedActions:F(Mc)}),Uc=I({worktreeId:G,runId:bc.shape.id,task:I({id:bc.shape.id,title:j()}).nullable(),worktreePath:j(),generation:N().int().positive(),onDisk:P(),prepared:P(),needsAttention:P(),autoCleanupSuppressed:P(),operation:Hc.optional(),error:j().optional()}),Wc=Uc.extend({history:F(Hc)});R([I({requestId:G,runId:bc.shape.id,intent:V([`remove-worktree`,`delete-task`,`reclaim`])}).strict(),I({requestId:G,worktreeId:G,intent:H(`orphan`)}).strict()]),I({requestId:G,expectedRevision:N().int().nonnegative(),action:Mc}).strict(),I({worktreeId:G}),I({operationId:G}),I({attentionOnly:V([`true`,`false`]).transform(e=>e===`true`).optional(),cursor:j().max(128).optional(),limit:U().int().min(1).max(100).default(50)}),I({worktrees:F(Uc),nextCursor:j().optional()}),I({worktree:Wc}),I({operation:Hc});var Gc=I({seq:N().int().nonnegative(),time:j(),executionId:G,stream:V([`stdout`,`stderr`,`system`]),text:j().max(16*1024)});I({afterSeq:U().int().nonnegative().default(0),limit:U().int().min(1).max(200).default(100)}),I({items:F(Gc),nextSeq:N().int().nonnegative(),truncated:P()}),I({command:Nc.shape.command,worktreeId:G.optional()}).strict();var Kc=I({root_path:j(),worktree_path:j(),worktree_id:j(),task_id:j()});I({renderedCommand:j(),variables:Kc,cwd:j(),illustrative:P()});var qc=I({projectId:j(),worktreeId:G,operationId:G.optional(),revision:N().int().nonnegative()}),Jc=V([`passing`,`failing`,`pending`]).nullable(),Yc=I({kind:V([`issue`,`pr`]),number:N(),title:j(),author:j(),createdAt:j(),labels:F(j()),body:j().optional(),url:j(),comments:N(),isDraft:P().optional(),additions:N().optional(),deletions:N().optional(),checks:Jc.optional()});I({available:P(),reason:j().optional(),repo:j().optional(),syncedAt:j().optional(),issues:F(Yc),prs:F(Yc),labelColors:B(j(),j()).optional(),issuesTotal:N().int().nonnegative().optional(),prsTotal:N().int().nonnegative().optional(),issuesNextCursor:j().nullable().optional(),prsNextCursor:j().nullable().optional()}),I({limit:j().optional(),refresh:j().optional(),issuesCursor:j().max(2e3).optional(),prsCursor:j().max(2e3).optional()}),z(`available`,[I({available:H(!0),checks:B(N(),Jc)}),I({available:H(!1),reason:j()})]),I({available:P(),reason:j().optional(),items:F(Yc),truncated:P().optional(),labelColors:B(j(),j()).optional()});var Xc=V([`draft`,`review-required`,`changes-requested`,`checks-pending`,`checks-failing`,`ready`,`merged`,`closed`,`open`,`completed`,`not-planned`]),Zc=N().nullable();z(`available`,[I({available:H(!0),prs:B(N(),Xc),issues:B(N(),Xc),conflicts:F(N()).optional(),recheckAfterMs:Zc}),I({available:H(!1),reason:j(),recheckAfterMs:Zc})]);var Qc=I({id:N(),author:j(),avatarUrl:j().optional(),createdAt:j(),body:j(),kind:V([`comment`,`review`]),reviewState:V([`approved`,`changes_requested`,`commented`,`dismissed`]).optional(),url:j()}),$c=V([`committed`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`merged`,`closed`,`reopened`,`head_ref_force_pushed`,`cross-referenced`,`renamed`]),el=I({id:j(),kind:$c,actor:j(),avatarUrl:j().optional(),createdAt:j(),url:j().optional(),sha:j().optional(),message:j().optional(),checks:Jc.optional(),label:I({name:j(),color:j().optional()}).optional(),subject:j().optional(),refNumber:N().optional(),refTitle:j().optional(),refIsPr:P().optional()});I({available:P(),reason:j().optional(),comments:F(Qc),truncated:P().optional(),events:F(el).optional(),detail:I({body:j(),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional()}).optional()});var tl=V([`merge`,`squash`,`rebase`]),nl=I({name:j(),state:V([`passing`,`failing`,`pending`,`unknown`]),required:P().nullable(),url:j().optional()}),rl=I({number:N(),title:j(),url:j(),state:V([`open`,`closed`,`merged`]),isDraft:P(),headRef:j(),baseRef:j(),headSha:j(),mergeable:V([`mergeable`,`conflicting`,`unknown`]),reviewDecision:V([`approved`,`changes-requested`,`review-required`,`unknown`]),checks:F(nl),checksTier:V([`detailed`,`aggregate`,`none`]),checksReason:j().optional(),methods:F(tl),defaultMethod:tl.nullable(),eligibility:V([`ready`,`blocked`,`pending`,`unauthorized`,`terminal`,`unknown`]),blockers:F(I({code:j(),message:j()})),canMerge:P(),canOverride:P()});z(`available`,[I({available:H(!0),mergeState:rl}),I({available:H(!1),reason:j()})]),I({merged:H(!0),number:N(),url:j(),method:tl,mergeCommitSha:j().optional()});var il=I({path:j(),previousPath:j().optional(),status:V([`added`,`modified`,`removed`,`renamed`,`copied`,`changed`]),additions:N(),deletions:N(),patch:j().optional(),patchUnavailableReason:V([`binary`,`too-large`,`not-provided`]).optional(),truncated:P().optional()});z(`available`,[I({available:H(!0),number:N(),headSha:j(),files:F(il),additions:N(),deletions:N(),truncated:P(),reason:j().optional()}),I({available:H(!1),reason:j()})]);var al=16*1024,ol=[`checks`,`cezar`],sl=V(ol);V([`project`,`workspace`]);var cl=V([`keychain`,`file`]),ll=/^[A-Z_][A-Z0-9_]{0,127}$/,ul=new Set([`PATH`,`HOME`,`SHELL`,`USER`,`TMPDIR`,`TEMP`,`TMP`,`NODE_OPTIONS`,`LD_PRELOAD`,`LD_LIBRARY_PATH`,`BASH_ENV`,`ENV`]);function dl(e){return ll.test(e)?e.startsWith(`CEZ_`)?`CEZ_* names are reserved for cezar`:e.startsWith(`DYLD_`)?`DYLD_* names change how programs load and are refused`:ul.has(e)?`${e} changes how the check's shell runs and is refused`:null:`a name is 1–128 characters: uppercase letters, digits and underscores, not starting with a digit`}var fl=j().superRefine((e,t)=>{let n=dl(e);n&&t.addIssue({code:`custom`,message:n})});I({name:fl});function pl(e){let t=0;for(let n of e){let e=n.codePointAt(0)??0;t+=e<128?1:e<2048?2:e<65536?3:4}return t}function ml(e){return e===``?`a value is not empty; remove the name instead of storing nothing`:pl(e)>16384?`a value is at most ${al} bytes`:/[\r\n\0]/.test(e)?`a value is one line, without NUL`:null}I({value:j().superRefine((e,t)=>{let n=ml(e);n&&t.addIssue({code:`custom`,message:n})}),audiences:F(sl).min(1).optional()}),I({secrets:F(I({name:j(),audiences:F(sl),updatedAt:j()})),keyBackend:cl}),I({error:j()}).strict();var hl=F(R([fl,I({name:fl,as:fl.optional()}).strict()])).min(1),gl=I({id:j().min(1),name:j().optional(),prompt:j().optional(),skill:j().optional(),model:j().optional(),runner:W.optional(),allowedTools:F(j()).optional(),bashAllowlist:F(j()).optional(),command:j().optional(),onFail:I({retry:j().min(1),max:N().int().positive().default(2),retryOn:F(N().int().positive()).optional()}).optional(),secrets:hl.optional()}).refine(e=>!!e.command!=!!(e.prompt??e.skill),{message:`a step is either an agent step (prompt/skill) or a check step (command), not both`}).refine(e=>!e.secrets||!!e.command,{message:`secrets: is for check steps only — an agent step never receives a secret`}),_l=j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/,`node ids are letters, digits, "-" and "_" (no dots)`),K={id:_l,name:j().optional()},vl=N().int().min(6e4).max(10080*6e4),yl=j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/,`verdicts are letters, digits, "-" and "_"`).refine(e=>e!==`failed`&&e!==`done`,`verdicts cannot be named "done" or "failed"`),bl=V([`>`,`>=`,`<`,`<=`,`==`]),xl=z(`kind`,[I({kind:H(`diff-lines`),op:bl,value:N().nonnegative()}),I({kind:H(`diff-files`),op:bl,value:N().nonnegative()}),I({kind:H(`paths-changed`),glob:j().min(1)}),I({kind:H(`output`),ref:j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*\.[A-Za-z0-9_]+$/,`ref is <node>.<field>`),op:V([`equals`,`not-equals`,`contains`,`>`,`>=`,`<`,`<=`]),value:R([j(),N()])}),I({kind:H(`branch`),op:V([`equals`,`matches`]),value:j().min(1)})]),Sl=I({nodes:F(z(`type`,[I({...K,type:H(`start`)}),I({...K,type:H(`end`),status:V([`success`,`failed`]).default(`success`)}),I({...K,type:H(`loop`),max:N().int().positive()}),I({...K,type:H(`agent`),prompt:j().optional(),skill:j().optional(),model:j().optional(),runner:W.optional(),allowedTools:F(j()).optional(),bashAllowlist:F(j()).optional(),verdicts:F(yl).min(1).optional(),session:I({continue:_l}).optional(),review:P().optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`check`),command:j().min(1),retryOn:F(N().int().positive()).optional(),secrets:hl.optional()}),I({...K,type:H(`gate.human`),message:j().min(1),timeoutMs:vl.optional()}),I({...K,type:H(`ask-user`),question:j().min(1),options:F(j().min(1)).max(6).optional(),timeoutMs:vl.optional()}),I({...K,type:H(`dispatch`),prompt:j().min(1),runner:W.optional(),model:j().optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`git.commit`),message:j().min(1)}),I({...K,type:H(`github.draft-pr`),title:j().optional()}),I({...K,type:H(`github.wait-ci`),timeoutMs:vl.default(60*6e4),pollMs:N().int().min(1e4).max(30*6e4).default(6e4)}),I({...K,type:H(`github.pr-comment`),body:j().min(1)}),I({...K,type:H(`fork`),branches:N().int().min(2).max(4).default(3)}),I({...K,type:H(`join`),wait:V([`all`,`any`]).default(`all`)}),I({...K,type:H(`workflow`),workflow:j().min(1),prompt:j().optional(),runner:W.optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`if`),condition:xl}),I({...K,type:H(`git.push`)}),I({...K,type:H(`git.sync-base`)}),I({...K,type:H(`github.pr-update`),ready:P().optional(),addLabels:F(j().min(1)).optional(),reviewers:F(j().min(1)).optional()}),I({...K,type:H(`github.issue-comment`),issue:N().int().positive().optional(),body:j().min(1)}),I({...K,type:H(`notify.webhook`),url:j().url().regex(/^https?:\/\//,`http(s) URLs only`),body:j().optional()})])).min(1),edges:F(I({from:j().min(1),to:_l})),layout:B(j(),I({x:N(),y:N()})).optional()}),Cl=I({name:j(),description:j().optional(),steps:F(gl),graph:Sl.optional(),source:V([`built-in`,`file`]),path:j().optional()}),wl=I({path:j(),message:j()});I({workflows:F(Cl),issues:F(wl)}),I({name:j().trim().min(1).max(80),description:j().max(2e3,`must be at most 2000 characters`).optional(),steps:F(gl).min(1).max(8).optional(),skills:F(j().trim().min(1)).min(1).max(8).optional(),overwrite:P().optional()}).refine(e=>!!e.steps!=!!e.skills,{message:`provide either "steps" or "skills", not both`}),I({path:j(),name:j()}),I({name:j(),description:j().optional(),steps:F(gl),graph:Sl.optional()}),I({name:j().trim().min(1).max(80),description:j().max(2e3,`must be at most 2000 characters`).optional(),graph:Sl,overwrite:P().optional()}),I({graph:Sl}),I({issues:F(j())}),I({nodes:F(I({type:V([`start`,`end`,`loop`,`agent`,`check`,`gate.human`,`ask-user`,`dispatch`,`git.commit`,`github.draft-pr`,`github.wait-ci`,`github.pr-comment`,`fork`,`join`,`if`,`workflow`,`git.push`,`git.sync-base`,`github.pr-update`,`github.issue-comment`,`notify.webhook`]),category:V([`flow`,`agents`,`scripts`,`git`]),label:j(),description:j(),ports:F(j()),outputs:F(j())}))}),I({ok:H(!0),path:j()}),I({name:j().optional(),steps:F(gl),rationale:j(),fallback:P()});var Tl=V([`implement`,`review`]),El=I({status:V([`done`,`partial`,`failed`,`blocked`]),result:j().max(4e3),evidence:F(j().max(400)).max(12).default([]),confidence:N().min(0).max(1).optional(),side_effects:F(j().max(400)).max(12).default([]),errors:F(j().max(400)).max(12).default([]),recommended_next_action:j().max(1e3).optional(),verdict:V([`approve`,`changes`,`reject`]).optional(),suggestions:F(j().max(400)).max(8).default([])}),Dl=I({fromRunId:j(),title:j(),report:El,at:j()}),Ol=Hs({maxSubtasks:N().int().min(1).max(50).optional(),inFlight:N().int().min(1).max(4).optional(),runner:W.optional(),model:j().max(120).optional(),budgetUsd:N().positive().max(1e4).optional()}),kl=I({rootRunId:j(),intent:Ol.optional(),parentRunId:j().optional(),kind:Tl.optional(),reviewOf:F(j().max(120)).max(8).optional(),budgetUsd:N().nonnegative().optional(),report:El.optional(),pendingReports:F(Dl).optional(),inboxSeenAt:j().optional(),pendingAsk:I({requestId:j().optional(),questions:F(j().max(400)).max(4),omittedQuestions:N().int().positive().optional(),askedAt:j()}).optional(),overBudget:P().optional()});I({title:j().min(1).max(120).optional(),objective:j().min(1).max(4e3),kind:Tl.optional(),review_of:F(j().max(120)).max(8).optional(),scope:j().max(1e3).optional(),allowed_tools:F(j().max(80)).max(16).optional(),max_cost:N().positive().optional(),success_criteria:j().max(1e3).optional(),required_evidence:j().max(1e3).optional(),retry_limit:N().int().min(0).max(3).optional(),runner:W.optional(),model:j().max(200).optional()}).strict(),I({id:j(),branch:j().optional()});var Al=V([`jira`,`linear`]),jl=fs({protocol:/^https$/}),Ml=j().min(1),Nl=j().min(1).max(4096),Pl=I({id:Ml,webUrl:jl}).strict(),Fl=I({id:Ml,name:Ml}).strict(),Il=I({kind:Al,source:Pl,externalId:j(),externalName:j(),connectionId:us().optional()}).strict(),Ll=V([`issue.opened`,`issue.status_changed`,`issue.labeled`,`issue.unlabeled`]);function Rl(e){return JSON.stringify([e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null])}I({kind:Al,externalId:Ml,sourceId:Ml,connectionId:us().optional()}).strict();var zl=I({kind:H(`issue`),id:j(),title:j(),author:j(),createdAt:yc({offset:!0}),updatedAt:yc({offset:!0}),labels:F(j()),body:j(),bodyTruncated:P(),unsupportedContent:P(),url:jl,status:j()}).strict(),Bl=V([`not_configured`,`credentials_missing`,`unauthorized`,`rate_limited`,`unavailable`,`source_changed`,`invalid_response`]),Vl=I({available:H(!1),code:Bl,reason:j(),retryAfterSeconds:N().int().nonnegative().optional()}).strict(),Hl=I({available:H(!1),code:H(`invalid_cursor`),reason:j()}).strict(),Ul=I({available:H(!1),code:H(`not_found`),reason:j()}).strict();function Wl(e,t){e.truncated&&e.nextCursor===void 0&&t.addIssue({code:`custom`,path:[`nextCursor`],message:`nextCursor is required when truncated is true`}),!e.truncated&&e.nextCursor!==void 0&&t.addIssue({code:`custom`,path:[`nextCursor`],message:`nextCursor must be omitted when truncated is false`})}var Gl=I({available:H(!0),source:Pl,candidates:F(Fl),truncated:P(),nextCursor:Nl.optional()}).strict().superRefine(Wl),Kl=I({available:H(!0),items:F(zl),truncated:P(),nextCursor:Nl.optional()}).strict().superRefine(Wl),ql=I({available:H(!0),item:zl}).strict(),Jl=I({available:H(!0),association:Il}).strict(),Yl=z(`code`,[Vl,Hl]),Xl=z(`code`,[Vl,Ul]);z(`available`,[Gl,Yl]),z(`available`,[Kl,Yl]),z(`available`,[ql,Xl]),z(`available`,[Jl,Xl]),z(`available`,[Gl,Vl]);var Zl=z(`available`,[Kl,Vl]);z(`available`,[ql,Vl]),I({association:Il.nullable()}).strict(),I({cleared:H(!0)}).strict(),I({error:j()}).strict();var Ql=j().trim().min(1).max(256),$l=Nl.optional(),eu=U().int().min(1).max(100).default(50),tu=V([`0`,`1`]).optional(),nu=V([`active`,`all`]),ru=F(Ml).max(20),iu=j().transform((e,t)=>{let n;try{n=JSON.parse(e)}catch{return t.addIssue({code:`custom`,message:`labels must be a JSON array of strings`}),Xe}let r=ru.safeParse(n);return r.success?r.data:(t.addIssue({code:`custom`,message:`labels must be a JSON array of 0 to 20 nonempty strings`}),Xe)});I({kind:Al,q:Ql.optional(),cursor:$l,limit:eu});var au=j().max(4096).optional();I({expectedScope:au}),I({expectedScope:au,cursor:$l,limit:eu,refresh:tu,state:nu.default(`active`),labels:iu.optional()}),I({expectedScope:au,cursor:$l,limit:eu,refresh:tu,state:nu.default(`all`),labels:iu.optional(),q:Ql});var ou=[`association`,`candidates`,`search`,`connection`];I({id:j().min(1).max(256).regex(/^[^/]+$/,`id must be one path segment`).refine(e=>!ou.includes(e),`id is reserved by a static route`)});var su=I({project:j().min(1)}).strict();I({association:Il}).strict();var cu=j().trim().min(1).max(8192);z(`kind`,[I({kind:H(`jira`),origin:j().max(512).regex(/^https:\/\/[a-z0-9][a-z0-9-]*\.atlassian\.net\/?$/i,`Use an HTTPS Jira Cloud site origin`),email:ss().max(320),token:cu}).strict(),I({kind:H(`linear`),key:cu}).strict()]),I({connection:I({id:us(),kind:Al}).strict().nullable(),demo:P(),error:j().optional()}).strict(),I({association:Il,query:j().trim().max(256),state:nu,labels:F(j().trim().min(1).max(256)).max(20)}).strict(),I({watchId:us()}),I({after:U().int().nonnegative().optional()});var lu=I({id:us(),topic:j()}).strict(),uu=I({version:N().int().nonnegative()}).strict(),du=I({version:N().int().nonnegative(),checking:P(),checkedAt:yc().nullable(),result:Zl.nullable()}).strict(),fu=I({number:N().int().positive(),url:j().url().optional(),origin:V([`created`,`marker`,`legacy`,`derived`]),at:j()}),pu=V([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),mu=V([`monitoring`]),hu=V([`pending`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`,`skipped`]),q=N().finite().nonnegative(),gu=I({id:j(),name:j(),kind:V([`agent`,`check`]),status:hu,iterations:N(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),usageInvocationsStarted:q.optional(),usageInvocationsObserved:q.optional(),usageTurnsStarted:q.optional(),usageTurnsRecorded:q.optional(),usageInvocationEpoch:q.optional(),startedAt:j().optional(),finishedAt:j().optional(),error:j().optional(),sessionId:j().optional(),backend:W.optional(),profileId:j().optional(),modelIdentity:j().optional(),costUsd:N().optional()}),_u=I({adds:N(),dels:N(),files:N(),repointed:P().optional()}),vu=I({id:j(),text:j(),images:F(j()).optional(),createdAt:j()}),yu=I({cpuPct:N(),rssBytes:N(),procCount:N()}),bu=I({id:j(),title:j(),titleSummary:j().optional(),diffStat:_u.optional(),workflow:j(),task:j(),queuedMessages:F(vu).optional(),taskImages:F(j()).optional(),model:j().optional(),modelIdentity:j().optional(),runner:W.optional(),agentProfile:j().optional(),systemPrompt:j().optional(),generateFollowups:P().optional(),autonomous:P().optional(),automation:I({automationId:j(),automationRevision:N(),receiptId:j(),event:j(),githubUrl:j()}).optional(),automationTrigger:I({automationId:j(),automationRevision:N(),receiptId:j(),trigger:V([`schedule`,`catch-up`,`manual`]),occurrenceAt:j()}).optional(),automationTracker:I({automationId:j(),automationRevision:N(),receiptId:j(),provider:V([`jira`,`linear`]),association:Il.optional(),eventId:j().optional(),event:Ll.optional(),timestamp:j().optional(),change:I({fromId:j().optional(),toId:j().optional(),labelId:j().optional(),labelName:j().optional()}).optional(),key:j(),url:j()}).optional(),dispatch:kl.optional(),status:pu,activity:mu.optional(),monitoringWakeAt:j().optional(),monitoringWakeCapReached:P().optional(),autoResumeAt:j().optional(),autoResumeAttempts:N().optional(),awaitingAnswerSince:j().optional(),prHead:I({number:N(),repo:j(),headRepo:j(),headRef:j(),headSha:j(),baseRef:j(),ref:j()}).optional(),untrustedHead:P().optional(),createdAt:j(),startedAt:j().optional(),finishedAt:j().optional(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),costUsd:N().optional(),pullRequestUrl:j().optional(),referencedPullRequestUrl:j().optional(),prNumber:N().optional(),prRefs:F(fu).max(8).optional(),issueNumber:N().optional(),referencedIssueNumberSeeded:P().optional(),titleOrigin:V([`user`,`auto`,`marker`]).optional(),markerRefs:I({pr:N().optional(),issue:N().optional()}).optional(),referencedPrCandidates:F(j()).optional(),referencedIssueUrl:j().optional(),referencedIssueCandidates:F(j()).optional(),worktree:H(!1).optional(),worktreePath:j().optional(),worktreeLifecycle:Fc.optional(),branch:j().optional(),inPlaceBranch:H(!0).optional(),baseBranch:j().optional(),worktreeReclaimedAt:j().optional(),groupId:j().optional(),variant:j().optional(),peakRssBytes:N().optional(),peakProcCount:N().optional(),archived:P(),archivedAt:j().optional(),pinned:P().optional(),pinnedAt:j().optional(),seenAt:j().optional(),lastSeq:N().int().nonnegative().optional(),currentStepId:j().optional(),error:j().optional(),steps:F(gu),workflowDef:Cl.optional(),graphState:I({loops:B(j(),N()),taken:F(j()),cursor:j().optional(),outputs:B(j(),B(j(),R([j(),N()]))).optional()}).optional()});bu.extend({usage:yu.optional()});var xu=I({worktreeLifecycle:Fc.optional(),projectId:j(),id:j(),title:j(),titleSummary:j().optional(),titleOrigin:V([`user`,`auto`,`marker`]).optional(),status:pu,activity:mu.optional(),createdAt:j(),finishedAt:j().optional(),seenAt:j().optional(),archived:P(),autoResumeAt:j().optional(),awaitingAnswerSince:j().optional(),workflow:j(),branch:j().optional(),dispatch:kl.pick({rootRunId:!0,parentRunId:!0,kind:!0}).optional(),automationId:j().optional(),startedAt:j().optional(),lastActivityAt:j(),pullRequestUrl:j().optional(),referencedPullRequestUrl:j().optional(),referencedPrCandidates:F(j()).optional(),prNumber:N().optional(),prRefs:F(fu).max(8).optional(),issueNumber:N().optional(),referencedIssueUrl:j().optional(),referencedIssueCandidates:F(j()).optional(),markerRefs:I({pr:N().optional(),issue:N().optional()}).optional(),costUsd:N().optional(),peakRssBytes:N().optional(),peakProcCount:N().optional(),usage:yu.optional()}),Su=B(j(),I({prs:B(N(),Xc),issues:B(N(),Xc)}));I({runs:F(xu),referenceStatuses:Su,perProjectLimit:N(),truncated:F(j())}),R([bu,I({runs:F(bu)})]),I({cancelled:P()}),I({cancelled:H(!0)}),I({archived:N()}),I({read:N()}),I({deleted:H(!0)}),I({finished:H(!0)}),I({continued:H(!0)}),I({url:j(),dryRun:P()}),z(`found`,[I({found:H(!0),url:j()}),I({found:H(!1)})]),R([I({delivered:H(!0)}),I({queued:H(!0),message:vu}),I({deferred:H(!0)})]),I({message:vu}),I({removed:H(!0)}),I({opened:H(!0),command:j()}),I({removed:H(!0)}),I({committed:H(!0),sha:j()}),I({pushed:H(!0),branch:j(),remote:j(),upstreamSet:P()}),I({uncommitted:N(),unpushed:N().nullable(),behind:N().nullable(),ahead:N().nullable()}),I({commits:F(I({sha:j(),subject:j(),author:j(),when:j()}))});var Cu=I({id:j(),variant:j(),title:j(),status:pu,archived:P(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),costUsd:N().optional(),diffStat:j(),handoffExcerpt:j()});I({groupId:j(),runs:F(Cu)}),I({winner:bu.optional()});var wu=`application/octet-stream`,Tu=[`text/plain`,`text/markdown`,`text/x-markdown`,`application/pdf`,wu];function Eu(e){return/^image\//.test(e)}function Du(e){return Eu(e)||Tu.includes(e)}function Ou(e){return/png/.test(e)?`png`:/jpe?g/.test(e)?`jpg`:/webp/.test(e)?`webp`:/gif/.test(e)?`gif`:e===`application/pdf`?`pdf`:e===`text/plain`?`txt`:e===`text/markdown`||e===`text/x-markdown`?`md`:e===`application/octet-stream`?`bin`:`img`}var ku=new Set([`png`,`jpg`,`jpeg`,`webp`,`gif`,`img`]);function Au(e){let t=e.split(`.`).pop()?.toLowerCase();return t!==void 0&&ku.has(t)}var ju=I({mediaType:j().refine(Du,{message:`unsupported attachment type — send other files as application/octet-stream`}),data:j().min(1).max(7e6),name:j().max(255).optional()}),Mu=/^[a-f0-9]{24}$/,Nu=R([ju,I({uploadId:j().regex(Mu,`invalid upload id`),name:j().max(255).optional()}).strict()]),Pu=`attachment upload expired — attach the file again`,Fu=28e6,Iu=F(Nu).max(20).refine(e=>e.reduce((e,t)=>e+(`data`in t?t.data.length:0),0)<=Fu,{message:`attachments too large — 20 MB in total per message`});I({uploadId:j(),mediaType:j(),bytes:N()}),I({uploadId:j().regex(Mu,`invalid upload id`)}),I({deleted:H(!0)});var Lu=I({workflow:j().min(1).optional(),steps:F(gl).min(1).max(8).optional(),task:j().max(1e5,`must be at most 100000 characters`),model:j().optional(),runner:W.optional(),agentProfile:j().max(64).optional(),variants:N().int().min(1).max(3).optional(),worktree:P().optional(),newBranch:P().optional(),branch:j().trim().min(1).max(200).optional(),autonomous:P().optional(),generateFollowups:P().optional(),systemPrompt:j().trim().max(2e4,`must be at most 20000 characters`).optional().transform(e=>e||void 0),images:Iu.optional(),todoId:j().min(1).max(200,`must be at most 200 characters`).optional(),dispatch:Ol.optional()});function Ru(e){return e.task.trim()!==``||(e.images?.length??0)>0}Lu.refine(e=>!!e.workflow!=!!e.steps,{message:`provide either "workflow" or "steps", not both`}).refine(Ru,{message:`describe the task or attach a file`,path:[`task`]}),I({text:j().max(1e5).default(``),images:Iu.default([])}).refine(e=>e.text.trim().length>0||e.images.length>0,{message:`message needs text or at least one attachment`}),I({title:j().trim().min(1).max(300).optional(),task:j().trim().min(1).max(1e5).optional()});var zu=1e5,Bu=20,Vu=j().regex(/^(composer|review-notes|diff-comments|design-picks|task-prompt|title|message:[A-Za-z0-9_-]{1,64})$/,`unknown draft surface`),Hu=/^[A-Za-z0-9_-]{1,64}$/,Uu=I({id:j(),mediaType:j(),name:j(),bytes:N()}),Wu=I({text:j(),images:F(Uu),updatedAt:j()});I({surfaces:B(j(),Wu)}),I({text:j().max(zu,`must be at most ${zu} characters`).default(``),images:F(j().regex(Hu,`invalid image id`)).max(Bu).default([])}),ju.extend({name:j().trim().max(200).default(`image`)}),Uu.extend({data:j()}),I({id:j().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/),surface:Vu}).extend({imageId:j().regex(Hu,`invalid image id`)}),I({deleted:H(!0)});var Gu=I({status:j(),path:j()}),Ku=I({hash:j(),subject:j(),author:j(),when:j()});R([I({info:Ns(),status:F(zs()),log:F(zs()),branches:F(zs()),checkedOutElsewhere:B(j(),zs()),baseBranch:Ns()}),I({info:Tc,status:F(Gu),log:F(Ku),branches:F(j()),checkedOutElsewhere:B(j(),j()),baseBranch:j().nullable()})]),I({branch:j(),created:P()});var qu=I({name:j(),upstream:j().nullable(),ahead:N().nullable(),behind:N().nullable(),gone:P()}),Ju=I({branch:j().nullable(),upstream:j().nullable(),ahead:N().nullable(),behind:N().nullable(),outgoing:F(j()),incoming:F(Ku),pushRemote:j().nullable(),lastFetchedAt:j().nullable(),branches:F(qu)});I({message:j(),sync:Ju});var Yu=I({adds:N(),dels:N(),files:N()}),Xu=I({path:j(),oldPath:j().optional(),status:V([`added`,`modified`,`deleted`,`renamed`,`copied`]),adds:N(),dels:N(),binary:P(),image:P().optional(),patch:j()});I({files:F(Xu),stat:Yu,repointedHead:I({headBranch:j(),taskBranch:j()}).optional()}),I({sha:j(),subject:j(),author:j(),when:j(),files:F(Xu),stat:Yu});var Zu=I({name:j(),type:V([`dir`,`file`]),size:N().optional()});z(`type`,[I({type:H(`dir`),path:j(),entries:F(Zu)}),I({type:H(`file`),path:j(),size:N(),binary:P(),tooLarge:P(),content:j().optional()})]),I({paths:F(j()),truncated:P()}),I({path:j().min(1),raw:V([`0`,`1`]).optional()});var Qu=V([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]);I({worktrees:F(I({runId:j(),title:j(),status:Qu,branch:j().nullable(),sizeBytes:N().nullable(),finishedAt:j().nullable(),reclaimable:P()})),totalBytes:N().nullable(),keep:N()}),I({reclaimed:F(j())});var $u=I({id:j(),name:j(),root:j(),addedAt:j(),lastOpenedAt:j(),source:V([`local`,`checkout`]),status:V([`ok`,`missing`,`not-git`]),branch:j().optional(),forge:H(`github`).optional(),repoUrl:j().optional(),tracker:Al.optional(),maxParallel:N().optional(),unregistered:H(!0).optional(),tags:F(j()).optional()});I({projects:F($u),bootProject:j(),projectsDir:j()}),I({project:$u,error:j().optional()}),I({removed:H(!0),id:j()}),I({project:$u}),I({maxParallel:N().int().min(1).max(16).nullable().optional(),tags:F(j().trim().min(1).max(32)).max(20).nullable().optional()}).refine(e=>e.maxParallel!==void 0||e.tags!==void 0,`specify maxParallel or tags`),I({url:j().trim().min(1).max(512),name:j().trim().max(128).optional(),checkoutId:j().trim().max(128).optional()});var ed=/^(?!\.{1,2}$)[A-Za-z0-9._-]{1,100}$/;I({name:j().trim().regex(ed),github:I({owner:j().trim().min(1).max(64),template:j().trim().max(512).optional()}).optional(),checkoutId:j().trim().max(128).optional()});var td=I({login:j(),personal:P(),avatarUrl:j().optional(),description:j().optional()}),nd=z(`available`,[I({available:H(!0),owners:F(td)}),I({available:H(!1),reason:j()})]),rd=I({name:j(),path:j(),isRepo:P()});I({path:j(),parent:j().nullable(),dirs:F(rd),truncated:P()}),I({key:j()});var id=V([`session`,`changes`,`commits`,`files`,`browser`,`graph`,`terminal`]),ad=2048,od=I({tabs:F(j().max(ad)).max(12),active:N().int().min(0).max(11)}),sd=I({view:id,width:N().finite().min(0).max(100),browser:od.optional()});I({layouts:I({layouts:F(I({name:j().min(1).max(80),columns:F(sd).max(3)})).max(50),active:j().max(80)}).nullable()});var cd=I({name:j().trim().min(1).max(80),columns:F(I({view:id,width:N().finite().min(0).max(100)})).min(1).max(3)});I({branding:I({name:j(),logoUrl:j().nullable()}),browseRoot:j(),projectsDir:j(),skillsAutoUpdate:P().nullable(),effectiveSkillsAutoUpdate:P(),composerDefaults:I({autonomous:P().nullable(),worktree:P().nullable(),inheritedAutonomous:R([P(),H(`source-dependent`)]),inheritedWorktree:P()}),resources:I({maxParallel:N(),maxMonitoringSessions:N(),idleTimeoutMinutes:N().nullable(),monitoringWakeIntervalMinutes:N().nullable(),autoResumeOnUsageLimit:P(),memoryLimitMb:N().nullable(),worktreeRetentionDefault:N()}),agentDefaults:I({runner:W.optional(),models:I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),junie:j().optional(),copilot:j().optional()}).optional()})}),I({branding:I({name:j().trim().min(1).max(80).nullable().optional()}).optional(),browseRoot:j().trim().min(1).max(4096).optional(),projectsDir:j().trim().min(1).max(4096).optional(),skillsAutoUpdate:P().nullable().optional(),composerDefaults:I({autonomous:P().nullable().optional(),worktree:P().nullable().optional()}).optional(),agentDefaults:I({runner:W.nullable().optional(),models:I({claude:j().trim().min(1).max(200).nullable().optional(),codex:j().trim().min(1).max(200).nullable().optional(),opencode:j().trim().min(1).max(200).nullable().optional(),junie:j().trim().min(1).max(200).nullable().optional(),cursor:j().trim().min(1).max(200).nullable().optional(),pi:j().trim().min(1).max(200).nullable().optional(),copilot:j().trim().min(1).max(200).nullable().optional()}).optional()}).optional(),resources:I({maxParallel:N().int().min(1).max(16).optional(),maxMonitoringSessions:N().int().min(0).max(16).optional(),idleTimeoutMinutes:N().int().min(0).max(1440).nullable().optional(),monitoringWakeIntervalMinutes:N().int().min(1).max(60).nullable().optional(),autoResumeOnUsageLimit:P().optional(),memoryLimitMb:N().int().min(0).max(1048576).nullable().optional(),worktreeRetentionDefault:N().int().min(0).max(1e3).optional()}).optional()});var ld=I({logoUrl:j().nullable()}),ud=I({accent:V([`lime`,`violet`]).optional(),density:V([`comfortable`,`compact`,`ultra`]).optional(),width:V([`narrow`,`wide`]).optional()}),dd=L({expandedColumns:B(j(),P()).optional()});L({lastTask:I({source:V([`workflow`,`skill`]),ref:j()}).nullable().optional(),recentSources:F(I({source:V([`workflow`,`skill`]),ref:j()})).optional(),lastWorktree:P().optional(),lastAutonomous:P().optional(),lastGenerateFollowups:P().optional(),importedSkills:F(j().min(1).max(200)).max(200).optional(),skillUsage:B(j(),N()).optional(),runsView:V([`list`,`table`]).optional(),githubView:V([`issues`,`prs`]).optional(),githubSort:V([`newest`,`oldest`]).optional(),appearance:ud.optional(),promptTemplates:F(I({id:j(),label:j(),text:j(),skills:F(j()).optional()})).optional(),dismissedSkillsBanner:P().optional()});var fd=2e4,pd=Hs({projectId:j().min(1).max(64),pathname:j().min(1).max(2048).startsWith(`/p/`),search:j().max(4096).startsWith(`?`).optional(),hash:j().max(2048).startsWith(`#`).optional()}),md=new Set([`fleet`,`needsYou`,`recent`,`usage`,`trends`,`overview`,`portfolio`,`automations`]),hd=F(j().min(1).max(64)).max(200+md.size).refine(e=>e.filter(e=>!md.has(e)).length<=200,`Too many unknown dashboard tiles`).refine(e=>new Set(e).size===e.length,`Duplicate dashboard tile`),gd=L({order:hd.optional(),tiles:L({automations:P().optional(),fleet:P().optional(),needsYou:P().optional(),recent:P().optional(),usage:P().optional(),trends:P().optional()}).optional()}),_d=L({order:hd.catch([]).optional(),tiles:L({automations:P().catch(!0).optional(),fleet:P().catch(!0).optional(),needsYou:P().catch(!0).optional(),recent:P().catch(!0).optional(),usage:P().catch(!0).optional(),trends:P().catch(!0).optional()}).catch({}).optional()}).catch({}),vd=L({dashboard:_d.optional(),sidebar:L({collapsed:B(j(),P()).optional(),projectOrder:F(j()).optional()}).optional(),dismissedProviderAuthFailures:I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),junie:j().optional(),copilot:j().optional()}).optional(),appearance:ud.optional(),notifications:L({enabled:P().optional()}).optional(),taskTable:dd.optional(),keybindings:B(j(),j().nullable()).optional(),lastLocation:pd.optional(),importedSkills:F(j()).optional(),savedLayouts:F(cd).catch([]).optional()}),yd=200,bd=50;L({...vd.shape,dashboard:gd.optional(),sidebar:L({collapsed:B(j().min(1).max(64),P()).refine(e=>Object.keys(e).length<=yd,{message:`sidebar.collapsed must have at most ${yd} entries`}).optional(),projectOrder:F(j().min(1).max(64)).max(yd).optional()}).optional(),dismissedProviderAuthFailures:Hs({claude:j().min(1).max(128).optional(),codex:j().min(1).max(128).optional(),opencode:j().min(1).max(128).optional(),pi:j().min(1).max(128).optional(),junie:j().min(1).max(128).optional(),copilot:j().min(1).max(128).optional()}).optional(),importedSkills:F(j().min(1).max(200)).max(yd).optional(),savedLayouts:F(cd).max(50).optional(),keybindings:B(j().min(1).max(120),j().min(1).max(40).nullable()).refine(e=>Object.keys(e).length<=yd,{message:`keybindings must have at most ${yd} entries`}).optional(),taskTable:dd.extend({expandedColumns:B(j().min(1).max(64),P()).refine(e=>Object.keys(e).length<=bd,{message:`taskTable.expandedColumns must have at most ${bd} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>yd&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${yd})`})});var xd=I({claude:j().optional(),codex:j().optional(),junie:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),copilot:j().optional()});I({worktreeLifecycle:Pc.optional(),worktreeLifecycleRevision:j().optional(),baseBranch:j().nullable(),defaultRunner:W,systemPrompt:j().nullable(),branchNaming:j().nullable(),defaultModels:xd,modelsLocked:P(),maxParallel:N(),memoryLimitMb:N().nullable(),worktreeRetention:N(),liveTitleUpdates:P().nullable(),reviewGate:P().nullable()}),I({worktreeLifecycle:Pc.nullable().optional(),worktreeLifecycleRevision:j().nullable().optional(),baseBranch:j().trim().min(1).max(200).nullable().optional(),defaultRunner:W.optional(),systemPrompt:j().trim().max(2e4).nullable().optional(),branchNaming:j().trim().max(4e3).nullable().optional(),defaultModels:I({claude:j().trim().max(200).nullable().optional(),codex:j().trim().max(200).nullable().optional(),opencode:j().trim().max(200).nullable().optional(),cursor:j().trim().max(200).nullable().optional(),pi:j().trim().max(200).nullable().optional(),copilot:j().trim().max(200).nullable().optional()}).optional(),defaultModelsAuto:I({claude:P().nullable().optional(),codex:P().nullable().optional(),opencode:P().nullable().optional(),pi:P().nullable().optional()}).optional(),maxParallel:N().int().min(1).max(16).optional(),memoryLimitMb:N().int().min(0).max(1048576).nullable().optional(),worktreeRetention:N().int().min(0).max(1e3).nullable().optional(),liveTitleUpdates:P().nullable().optional(),reviewGate:P().nullable().optional()});var Sd=V([`idle`,`checking`,`available`,`updating`,`current`,`unavailable`,`error`]),Cd=I({scope:V([`project`,`global`]),status:Sd,available:P(),skills:F(j()),checkedAt:j().nullable(),updatedAt:j().nullable(),reason:j().optional()});I({status:Sd,available:P(),autoUpdateEnabled:P(),inherited:P(),checkedAt:j().nullable(),updatedAt:j().nullable(),scopes:F(Cd),needsUpgradeNotes:P()});var wd=W,Td=I({provider:wd,status:V([`connected`,`disconnected`,`not-installed`,`unknown`]),enabled:P().optional(),hint:j().optional(),authFailureId:j().optional(),profileId:j().optional()});I({providers:F(Td)}),z(`opened`,[I({opened:H(!0),command:j()}),I({opened:H(!1),connected:H(!0),command:j()})]),I({opened:H(!0),command:j()});var Ed=V([`claude`,`codex`,`opencode`,`cursor`,`junie`]).options;function Dd(e){return Ed.includes(e)}I({runner:W,models:F(I({id:j(),label:j(),description:j()})),source:V([`live`,`cache`,`unavailable`]),stale:P(),reason:j().optional()}),I({targets:F(I({id:j(),label:j(),icon:j().optional()}))}),I({target:j().trim().min(1,`target required`).max(200)}),I({opened:H(!0),path:j()}),I({name:j(),description:j().optional(),interactive:H(!0).optional(),body:j(),path:j(),source:V([`ai`,`cezar`,`agents`,`global`,`team`,`builtin`]),team:I({repo:j(),ref:j(),path:j(),dir:P(),commit:j().optional()}).optional()}),I({id:j(),ts:j().optional(),taskId:j().optional(),summary:j().min(1),action:j().optional(),prUrl:j().optional(),suggestedSkill:j().optional(),suggestedArgs:j().optional(),suggestedPrompt:j().optional(),runnable:P().optional(),startedTaskId:j().optional()}),I({removed:H(!0)}),I({run:bu});var Od=V([`json`,`jsonc`,`toml`,`markdown`]),kd=V([`user`,`project`,`local`]),Ad=V([`settings`,`memory`,`mcp`]),jd=V([`tracked`,`gitignored`,`outside-repo`]),Md=I({id:j(),runners:F(W),kind:Ad,scope:kd,label:j(),path:j(),format:Od,tracked:jd,seeded:P(),holdsMcp:P(),private:P(),precedence:j(),hotReload:j().optional(),docsUrl:j(),exists:P(),size:N(),version:j().nullable(),writable:P(),readOnlyReason:j().optional()}),Nd=I({path:j(),servers:F(j()),readable:P()});I({editable:P(),files:F(Md),userMcp:Nd.nullable()}),I({id:j(),path:j(),exists:P(),content:j(),version:j().nullable()}),I({content:j().max(2e6),version:j().nullable()});var Pd=`default`,Fd=I({id:j(),label:j(),path:j(),exists:P()}),Id=I({id:j(),provider:wd,label:j(),configDir:j(),path:j(),exists:P(),looksValid:P(),isDefault:P(),status:Td.optional(),files:F(Fd)});function Ld(e){return e.isDefault?`default:${e.provider}`:e.id}var Rd=I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),junie:j().optional(),cursor:j().optional(),pi:j().optional(),copilot:j().optional()});I({editable:P(),profiles:F(Id),profileCapableProviders:F(wd),selections:B(j(),Rd),defaults:Rd}),I({projectId:j().min(1).max(64).nullable(),provider:wd,profileId:j().max(64).nullable()}),I({selections:B(j(),Rd),defaults:Rd}),I({status:Td}),I({available:P(),reason:j().optional(),fields:F(I({label:j(),value:j()}))}),I({file:j().min(1).max(200),target:j().min(1).max(64).optional()}),I({opened:H(!0),path:j()}),I({provider:wd,label:j().trim().max(200).optional(),configDir:j().trim().min(1).max(4096)}),I({profile:Id}),I({label:j().trim().max(200).optional(),configDir:j().trim().min(1).max(4096).optional()}),I({removed:H(!0),id:j()});var zd=new Map;function Bd(e){let t=zd.get(e);return t||(t=new Intl.DateTimeFormat(`en-CA`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),zd.set(e,t)),t}function Vd(e,t){try{let n=Bd(t).formatToParts(new Date(e)),r=e=>Number(n.find(t=>t.type===e)?.value),i=r(`year`),a=r(`month`),o=r(`day`);return{year:i,month:a,day:o,hour:r(`hour`)%24,minute:r(`minute`),second:r(`second`),weekday:Hd(i,a,o)}}catch{return null}}function Hd(e,t,n){return(new Date(Date.UTC(e,t-1,n)).getUTCDay()+6)%7+1}function Ud(e,t){let n=Vd(t,e);return n?Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-t:null}function Wd(e,t,n,r,i,a){let o=Date.UTC(e,t-1,n,r,i,0,0),s=o;for(let e=0;e<3;e+=1){let e=Ud(a,s);if(e===null)return null;let t=o-e;if(Math.abs(t-s)<1e3)return t;s=t}return s}var Gd=[`daily`,`weekdays`,`weekly`,`hours`],Kd=[1,2,3,4,6,8,12],qd=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Jd=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Yd=I({type:V(Gd),hour:N().int().min(0).max(23).optional(),minute:N().int().min(0).max(59).optional(),day:N().int().min(1).max(7).optional(),every:R([H(1),H(2),H(3),H(4),H(6),H(8),H(12)]).optional()});function Xd(e){return{type:e.type,hour:e.hour??4,minute:e.minute??0,day:e.day??1,every:e.every??6}}var Zd=e=>String(e).padStart(2,`0`);function Qd(e,t=0){return`${Zd(e)}:${Zd(t)}`}function $d(e){let t=Xd(e);switch(t.type){case`daily`:return`every day at ${Qd(t.hour,t.minute)}`;case`weekdays`:return`weekdays at ${Qd(t.hour,t.minute)}`;case`hours`:return t.every===1?`every hour`:`every ${t.every} hours`;case`weekly`:return`${Jd[t.day-1]}s at ${Qd(t.hour,t.minute)}`}}function ef(e){let t=Xd(e);switch(t.type){case`daily`:return`${t.minute} ${t.hour} * * *`;case`weekdays`:return`${t.minute} ${t.hour} * * 1-5`;case`hours`:return`0 */${t.every} * * *`;case`weekly`:return`${t.minute} ${t.hour} * * ${t.day%7}`}}function tf(e,t){switch(e.type){case`daily`:return[[e.hour,e.minute]];case`weekdays`:return t<=5?[[e.hour,e.minute]]:[];case`weekly`:return t===e.day?[[e.hour,e.minute]]:[];case`hours`:{let t=[];for(let n=0;n<24;n+=e.every)t.push([n,0]);return t}}}function nf(e,t,n,r,i=1e3){let a=Xd(e),o=Vd(t,r);if(!o||n<=t)return[];let s=[],c=Math.ceil((n-t)/864e5)+2;for(let e=-1;e<=c;e+=1){let c=new Date(Date.UTC(o.year,o.month-1,o.day+e)),l=c.getUTCFullYear(),u=c.getUTCMonth()+1,d=c.getUTCDate();for(let[e,o]of tf(a,Hd(l,u,d))){let a=Wd(l,u,d,e,o,r);if(a===null||a>=t&&a<n&&(s.push(a),s.length>=i))return s}}return s}function rf(e,t,n){let[r]=nf(e,t+1,t+9*864e5,n,1);return r??null}var af=V([`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`]),of=I({events:F(Ll).min(1).max(4),targetStatusIds:F(j().min(1)).max(100).optional(),changedLabelIds:F(j().min(1)).max(100).optional(),requiredLabels:F(j().trim().min(1).max(200)).max(100).optional(),association:Il});I({search:j().max(200).optional(),cursor:j().max(4096).optional()}),z(`available`,[I({available:H(!0),association:Il,events:F(Ll),limitations:F(j()),statuses:F(I({id:j(),name:j()})),labels:F(I({id:j(),name:j()})),nextCursor:j().optional()}),Vl]);var sf=I({authors:F(j()).optional(),assignees:F(j()).optional(),allLabels:F(j()).optional(),anyLabels:F(j()).optional(),excludeLabels:F(j()).optional(),changedLabels:F(j()).optional(),reviewers:F(j()).optional(),status:j().optional(),lookbackDays:N(),maxRecords:N()}),cf=V([`github`,`schedule`,`tracker`]),lf=I({maxSubtasks:N().int().min(1).max(50).optional(),reviewChild:P().optional()}),uf=Lu.omit({task:!0,images:!0,todoId:!0,systemPrompt:!0}).extend({prompt:j(),variants:R([H(1),H(2),H(3)]).optional(),systemPrompt:j().optional(),dispatch:lf.optional(),checkout:V([`base`,`pr-head`]).optional(),allowForkHeads:P().optional()}),df=I({id:j(),revision:N(),name:j(),description:j().optional(),enabled:P(),kind:cf,events:F(af).optional(),intervalSeconds:N().optional(),filters:sf.optional(),trackerTrigger:of.optional(),schedule:Yd.optional(),task:uf,createdAt:j(),updatedAt:j()}),ff=I({timestamp:j(),tieBreaker:j().optional()}),pf=I({revision:N().optional(),baselineAt:j().optional(),cursor:ff.optional(),checkpoint:j().optional(),frozenHighWatermark:ff.extend({tieBreaker:j()}).optional(),backlogAfter:ff.extend({tieBreaker:j()}).optional(),pinnedCursor:ff.optional(),nextCheckAt:j().optional(),lastSuccessAt:j().optional(),nextRunAt:j().optional(),lastRunAt:j().optional(),etags:B(j(),j()).optional(),backoffUntil:j().optional(),consecutiveFailures:N().optional()}),mf=V([`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`,`manual`,`catch-up`,`skipped`,`failed`]),hf=I({seq:N(),ts:j(),automationId:j(),revision:N(),event:R([af,Ll]).optional(),result:mf,reason:j().optional(),durationMs:N().optional(),receiptId:j().optional(),runId:j().optional(),trackerKey:j().optional(),trackerTitle:j().optional(),trackerUrl:j().optional(),githubNumber:N().optional(),githubTitle:j().optional(),githubUrl:j().optional(),rateLimit:I({bucket:V([`core`,`search`]),remaining:N().optional(),resetAt:j().optional()}).optional()}),gf=I({matches:N(),launched:N(),duplicates:N(),errors:N()}),_f=I({runId:j(),status:pu,ts:j(),costUsd:N().optional()}),vf=df.extend({state:pf.optional(),latestLog:hf.optional(),counts:gf,nextRunAt:j().optional(),lastRun:_f.optional(),runs7d:N(),costUsd7d:N().optional()}),yf=I({runs:N(),failed:N(),agentSeconds:N(),costUsd:N().optional()});I({available:P(),reason:j().optional(),scheduler:I({state:V([`scheduled`,`idle`]),nextDue:j().optional()}),timeZone:j(),stats:yf,automations:F(vf)}),I({automation:df}),I({automation:df,state:pf.optional(),latestLog:hf.optional()}),I({id:j(),automationId:j(),mode:V([`preview`,`execute`]),status:V([`queued`,`running`,`complete`,`error`]),createdAt:j(),completedAt:j().optional(),matches:N().optional(),truncated:P().optional(),error:j().optional()}),I({checkId:j()});var bf=I({title:j(),status:pu,costUsd:N().optional(),children:F(I({runId:j(),kind:Tl.optional(),title:j(),status:pu,costUsd:N().optional()}))});I({records:F(hf),runs:B(j(),bf)}),I({receiptId:j(),runId:j()}),I({runId:j()}),I({templates:F(I({project:I({id:j(),name:j()}),id:j(),name:j(),kind:V([`github`,`schedule`]),trackerTrigger:of.optional(),schedule:Yd.optional(),events:F(af).optional(),intervalSeconds:N().optional(),filters:sf.optional(),task:I({prompt:j(),workflow:j().optional(),steps:uf.shape.steps,runner:j().optional(),model:j().optional(),autonomous:P().optional(),dispatch:lf.optional(),checkout:uf.shape.checkout,allowForkHeads:uf.shape.allowForkHeads})}))}),df.omit({id:!0,revision:!0,createdAt:!0,updatedAt:!0,enabled:!0,kind:!0}).extend({kind:cf.optional(),enable:P().optional()}).omit({enable:!0}).extend({enabled:P().optional(),expectedRevision:N()}),I({mode:V([`preview`,`execute`])}),I({projectId:j().min(1).max(200)});var xf=vf.pick({id:!0,name:!0,kind:!0,enabled:!0,nextRunAt:!0}).extend({state:pf.pick({backoffUntil:!0,consecutiveFailures:!0}).optional()}),Sf=I({timeZone:j(),automations:F(xf)}),J=N().int().nonnegative(),Y=yc(),Cf=xu.omit({usage:!0}),wf=I({projects:F(I({projectId:j(),state:V([`complete`,`partial`,`unavailable`]),omittedRuns:J,reason:j().optional()}))}),Tf=I({running:J,monitoring:J,questions:J,reviews:J,queued:J,scheduled:J}),Ef=I({rows:F(Cf).max(20),total:J,nextOffset:J.nullable()}),Df=I({snapshotId:j().min(1),asOf:Y,expiresAt:Y,coverage:wf,counts:Tf,questions:Ef,reviews:Ef}),Of=V([`running`,`queued`,`scheduled`,`questions`,`reviews`,`needs-you`]);I({snapshotId:j().min(1).max(128),group:Of,offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var kf=I({snapshotId:j(),asOf:Y,coverage:wf,page:Ef});I({error:H(`Dashboard changed; refresh the list`),code:H(`snapshot-expired`)});var Af=I({projectId:j(),runId:j(),sampledAt:Y,cpuPct:N().nonnegative().nullable(),rssBytes:J,procCount:J}),jf=I({asOf:Y,samples:F(Af)}),Mf=z(`kind`,[I({kind:H(`task-result`),key:j().min(1),at:Y,run:Cf}),I({kind:H(`github-created`),key:j().min(1),at:Y,repo:j(),projectIds:F(j()),itemKind:V([`issue`,`pr`]),number:N().int().positive(),title:j(),url:fs().refine(e=>/^https?:\/\//.test(e),`Expected an HTTP(S) URL`)})]),Nf=I({key:j().min(1),state:V([`ready`,`stale`,`unavailable`]),fetchedAt:Y.optional(),truncated:P(),reason:j().optional()}),Pf=V([`all`,`tasks`,`github`]);I({filter:Pf.default(`all`)});var Ff=I({asOf:Y,windowStart:Y,filter:Pf,rows:F(Mf).max(60),sources:F(Nf),coverage:wf,truncated:P()}),If=I({project:j(),usage:B(j(),yu),samples:F(Af).optional(),sentAt:Y.optional()}),Lf=N().int().nonnegative(),Rf=N().finite().nonnegative(),zf=V([`all`,`7d`,`30d`]),Bf=V([`cost`,`input`,`output`]),Vf=I({tokens:P(),cost:P()}),Hf=I({value:Rf.nullable(),reportedTasks:Lf}),Uf=I({tasks:Lf,inputTokens:Hf.optional(),outputTokens:Hf.optional(),costUsd:Hf.optional()}),Wf=I({projectId:j(),id:j(),title:j(),status:pu,awaitingAnswerSince:j().optional(),archived:P(),subtask:P(),createdAt:j(),startedAt:j().optional(),finishedAt:j().optional(),inputTokens:Rf.optional(),outputTokens:Rf.optional(),costUsd:Rf.optional()}),Gf=I({date:j(),tasks:Lf,inputTokens:Hf.optional(),outputTokens:Hf.optional(),costUsd:Hf.optional(),completed:Lf,cycleReportedTasks:Lf.optional(),avgCycleHours:N().finite().nonnegative().nullable(),medianCycleHours:N().finite().nonnegative().nullable()}),Kf=Uf.extend({projectId:j()});I({period:zf.default(`all`),sort:Bf.default(`cost`),projectId:j().min(1).max(128).optional(),snapshotId:j().min(1).max(128).optional(),tzOffsetMinutes:U().int().min(-840).max(720).optional(),offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var qf=I({snapshotId:j().min(1),asOf:yc(),expiresAt:yc(),scope:H(`retained-task-lifetime`),period:zf,windowStart:yc().nullable(),tzOffsetMinutes:N().int().min(-840).max(720).optional(),sort:Bf,visibility:Vf,coverage:wf,invalidDateTasks:Lf,totals:Uf,series:F(Gf).max(31),projects:F(Kf),tasks:I({rows:F(Wf).max(20),total:Lf,nextOffset:Lf.nullable()})}),Jf=N().int().nonnegative(),Yf=V([`running`,`needs-you`,`completed`,`failed`]);I({period:V([`7d`,`30d`]).default(`7d`),tzOffsetMinutes:U().int().min(-840).max(720).default(0),snapshotId:j().min(1).max(128).optional(),projectId:j().min(1).max(128).optional(),group:Yf.default(`completed`),offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var Xf=I({running:Jf,needsYou:Jf,completed:Jf,failed:Jf,timedTasks:Jf,medianCycleHours:N().finite().nonnegative().nullable()}),Zf=Cf.pick({projectId:!0,id:!0,title:!0,titleSummary:!0,status:!0,archived:!0,createdAt:!0,startedAt:!0,finishedAt:!0}),Qf=I({snapshotId:j(),asOf:yc(),windowStart:yc(),period:V([`7d`,`30d`]),coverage:wf,metrics:Xf,projects:F(Xf.extend({projectId:j()})),page:I({rows:F(Zf).max(20),total:Jf,nextOffset:Jf.nullable()})}),X=N().int().nonnegative(),$f=yc();I({period:V([`7d`,`30d`]).default(`7d`),tzOffsetMinutes:U().int().min(-840).max(720).default(0)});var ep=I({completedTasks:X,prsOpened:X,prsTouched:X,issues:X,additions:X,deletions:X,files:X,measuredTasks:X}),tp=I({category:V([`usage-limit`,`auth`,`agent-unavailable`,`timeout`,`check`,`git`,`other`]),label:j(),count:X,latest:I({projectId:j(),id:j(),title:j(),at:$f,step:j().optional(),message:j().max(240)})}),np=I({backend:j(),model:j().optional(),finished:X,done:X,failed:X,timedTasks:X,medianCycleHours:N().finite().nonnegative().nullable(),costUsd:Hf.optional()}),rp=I({projectId:j(),automationId:j(),tasks:X,done:X,failed:X,active:X,lastRunAt:$f.optional(),lastStatus:pu.optional(),costUsd:Hf.optional()}),ip=I({asOf:$f,windowStart:$f,period:V([`7d`,`30d`]),visibility:Vf,coverage:wf,delivered:ep,failures:I({total:X,reasons:F(tp).max(8)}),backends:F(np),automations:F(rp)}),ap=I({source:V([`cgroup-v2`,`cgroup-v1`]),cpuQuotaCores:N().positive().optional(),cpuAffinityCores:N().positive().optional(),memLimitBytes:N().positive().optional(),memUsedBytes:N().nonnegative().optional(),cpuPct:N().min(0).max(100).optional()}),op=I({sampledAt:j(),cpuPct:N().min(0).max(100).optional(),cpuCount:N().int().positive(),memTotalBytes:N().nonnegative(),memUsedBytes:N().nonnegative(),memAvailableBytes:N().nonnegative(),swapTotalBytes:N().nonnegative().optional(),swapUsedBytes:N().nonnegative().optional(),loadAvg:I({one:N(),five:N(),fifteen:N()}).optional(),container:ap.optional(),hostCpuCount:N().int().positive().optional(),cgroupProbe:V([`unavailable`,`unconstrained`]).optional()}),sp=V([`stable`,`nightly`,`development`]),cp=V([`managed`,`global-npm`,`npx`,`checkout`,`unknown`]),lp=I({id:j(),version:j(),source:V([`registry`,`local`,`link`]),installedAt:j(),active:P(),branch:j().optional(),checkout:j().optional()}),up=I({version:j(),channel:V([`stable`,`nightly`,`preview`]),publishedAt:j().nullable(),installed:P()}),dp=I({status:V([`running`,`failed`,`restarting`]),target:j(),startedAt:j(),finishedAt:j().nullable(),log:F(j()),error:j().optional()}),fp=I({target:j(),requestedAt:j()});I({version:j(),installKind:cp,entry:j(),canSelfUpdate:P(),reason:j().optional(),channel:sp,restartMode:V([`reexec`,`supervisor`]),latest:I({stable:j().nullable(),nightly:j().nullable()}),updateAvailable:j().nullable(),checkedAt:j().nullable(),installed:F(lp),available:F(up),job:dp.nullable(),scheduled:fp.nullable(),activeRuns:N().int().min(0)}),I({version:j().min(1).max(64).regex(/^[0-9A-Za-z.+-]+$/,`version must be a plain version string`),whenIdle:P().optional()}).strict(),I({channel:sp}).strict();var pp=I({id:j(),title:j(),status:j()}),mp=I({id:j(),branch:j(),version:j(),worktree:j(),built:P(),linked:P(),commit:I({sha:j(),subject:j(),at:j()}).nullable(),builtAt:j().nullable(),stale:P(),task:pp.nullable(),pr:N().int().nullable()}),hp=I({number:N().int(),title:j(),author:j().nullable(),branch:j(),draft:P(),updatedAt:j(),url:j(),version:j().nullable(),publishedAt:j().nullable(),installed:P()});I({refresh:H(`1`).optional()}).strict(),I({checkouts:F(mp),pulls:I({available:P(),reason:j().optional(),repo:j(),items:F(hp)})}),I({consent:V([`unknown`,`granted`,`denied`]),policyVersion:N().int(),blockedBy:V([`env`,`automation`]).nullable(),endpoint:j()}),I({consent:V([`granted`,`denied`])});var gp=`p.new.tasks.changes.files.commits.compare.git.branches.log.github.prs.issues.tracker.skills.inbox.workflows.automations.dashboard.settings.global.agents.agent-config.worktrees.bookmarklets.prompt-templates.appearance.notifications.resources.accounts.projects.keyboard.graph.integrations.secrets.workflows-new.workspace-secrets.privacy`.split(`.`);I({route:j().max(64).refine(e=>e.startsWith(`/`)&&e.split(`/`).slice(1).every((e,t,n)=>e===``?n.length===1:e===`:param`||gp.includes(e)),{message:`a route shape: known segments and :param only`})});var _p=R([j().max(1024),N(),P(),Ns()]);I({type:j().max(128),message:j().max(2048),stack:j().max(16384).optional(),handler:j().max(64).optional(),code:j().max(128).optional(),fingerprint:j().max(128).optional(),context:B(j().max(64),_p).refine(e=>Object.keys(e).length<=32,{message:`at most 32 context keys`}).optional()});var vp=V([`new_task`,`bookmarklet`,`existing_session`,`ask_answer`,`git_step`,`review`,`github`,`tracker`,`inbox`,`skills_import`,`cli`]),yp=V([`new`,`clone`,`folder`]),bp=V([`1`,`2-4`,`5-10`,`11-20`]);function xp(e){return e<=1?`1`:e<=4?`2-4`:e<=10?`5-10`:`11-20`}V([`sidebar`,`tasks_table`,`all_tasks`,`task_view`,`palette`,`shortcut`]);var Sp=`reply.toggle-read.pin.archive.rename.end-session.accept.stop.delete.git:commit.git:commit-push.git:push.git:create-pr.git:create-draft-pr.git:update-branch.git:resolve-conflicts.git:fix-checks.open-pr.view:session.view:graph.view:changes.view:commits.view:files.view:browser.view:terminal.view:notes.tab.layout.layout:new.full-view.split.terminal.terminal-column.open.open:terminal-resume.copy:link.copy:branch.copy:path.copy:resume.copy:pr.copy:id`.split(`.`),Cp=V(Sp);function wp(e){return e.startsWith(`tab:`)?`tab`:e.startsWith(`layout:`)&&e!==`layout:new`?`layout`:e.startsWith(`open:`)&&e!==`open:terminal-resume`?`open`:Sp.includes(e)?e:void 0}var Tp=[`command`,`task`,`task_switch`],Ep=[`enter`,`cycle`,`tab`,`cmdk`,`cmdk_tab`],Dp=[`tasks`,`commands`,`files`,`pr_number`,`automation`],Op=[`command`,`actions`,`tasks`,`files`],kp=N().int().min(1).max(1e3).optional(),Ap=V([`recovered`,`not_applied`,`unreachable`,`timed_out`]);z(`event`,[I({event:H(`message_sent`),label:vp.exclude([`cli`])}),I({event:H(`diff_comment_added`),label:V([`single_line`,`multi_line`])}),I({event:H(`add_project_opened`),label:yp}),I({event:H(`attachments_sent`),label:bp}),I({event:H(`attachments_restaged`),label:V([`recovered`,`failed`])}),I({event:H(`skills_update_apply_dropped`),label:Ap}),I({event:H(`palette_opened`),label:V(Tp)}),I({event:H(`task_command_run`),label:Cp,value:kp}),I({event:H(`task_shortcut_used`),label:Cp,value:kp}),I({event:H(`task_switched`),label:V(Ep)}),I({event:H(`palette_mode_used`),label:V(Dp)}),I({event:H(`palette_dismissed`),label:V(Op)}),I({event:H(`shortcut_rebound`),label:Cp})]),I({available:P(),count:N().int().nonnegative().optional(),url:j()}),I({target:j().min(1).max(2048),parentOrigin:j().min(1).max(512)}),I({origin:j()});var jp=I({services:F(j().trim().min(1).max(500)).min(1).max(5),url:j().trim().max(2048).regex(/^https?:\/\/\S+$/,`an http:// or https:// address`).optional()}),Mp=V([`project`,`personal`]);I({project:jp.nullable(),personal:jp.nullable(),personalAvailable:P()}),I({scope:Mp,recipe:jp.nullable()});var Np=jp.extend({scope:Mp}),Pp=`e2e-setup`,Fp=[`AI_GATEWAY_API_KEY`,`OPENAI_API_KEY`,`ANTHROPIC_API_KEY`,`OPENROUTER_API_KEY`],Ip=V(Fp);I({configFile:j().nullable(),workflow:P(),credentials:F(Ip),setup:I({runId:j(),status:pu}).nullable()}),I({credential:I({name:Ip,value:j().min(1)}).strict().optional()}),I({runId:j()}),I({error:j()}).strict();var Lp=I({id:j(),runId:j(),cwd:j(),shell:j(),cols:N().int(),rows:N().int(),startedAt:j(),exitCode:N().int().nullable(),label:j(),busy:P().nullable(),topic:j()});I({available:P(),reason:j().optional(),sessions:F(Lp),shells:F(j()).optional()}),I({cols:N().int().min(1).max(500).optional(),rows:N().int().min(1).max(500).optional(),shell:j().min(1).max(512).optional()}),I({data:j().max(65536)}),I({cols:N().int().min(1).max(500),rows:N().int().min(1).max(500)}),I({cursor:U().int().min(0).optional()}),I({data:j(),cursor:N().int(),truncated:P(),exitCode:N().int().nullable()}),I({urls:F(I({url:j(),lastSeenAt:j(),running:P().nullable()}))}),I({commands:F(I({command:j(),source:j(),detail:j().optional()})),install:j().optional(),recipe:Np.optional()}),I({id:j(),sessionId:j()});var Rp=`/api/v1`,zp=``;function Bp(e){zp=e.replace(/\/+$/,``)}function Vp(){return zp}var Hp=null;function Up(e){Hp=e===``?null:e}function Wp(){return Hp}function Gp(){return Hp??`default`}var Kp=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function qp(e){return`${zp}${Rp}${Jp(e)}`}function Jp(e){return Hp===null||Kp.test(e)?e:`/p/${encodeURIComponent(Hp)}${e}`}var Yp=/^\/api(?:\/v1)?(\/.*)$/;function Xp(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=Zp(e.slice(r));return a===null?e:`${i}${a}`}let n=Zp(zp&&e.startsWith(zp)?e.slice(zp.length):e);return n===null?e:`${zp}${n}`}function Zp(e){let t=Yp.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${Rp}${n}`:`${Rp}${Jp(n)}`}var Z=e(t(),1),Qp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),em=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),tm=e=>{let t=em(e);return t.charAt(0).toUpperCase()+t.slice(1)},nm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},rm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},im=(0,Z.createContext)({}),am=()=>(0,Z.useContext)(im),om=(0,Z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=am()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,Z.createElement)(`svg`,{ref:c,...nm,width:t??l??nm.width,height:t??l??nm.height,stroke:e??f,strokeWidth:m,className:Qp(`lucide`,p,i),...!a&&!rm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,Z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),sm=(e,t)=>{let n=(0,Z.forwardRef)(({className:n,...r},i)=>(0,Z.createElement)(om,{ref:i,iconNode:t,className:Qp(`lucide-${$p(tm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=tm(e),n},cm=e(n(),1),Q=r(),lm=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,um=i,dm=(e,t)=>n=>{if(t?.variants==null)return um(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=lm(t)||lm(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return um(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function fm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function pm(...e){return t=>{let n=!1,r=e.map(e=>{let r=fm(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():fm(e[t],null)}}}}function mm(...e){return Z.useCallback(pm(...e),e)}function hm(e){let t=Z.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wm(r)&&typeof Om==`function`&&(r=Om(r._payload)),Z.Children.forEach(r,e=>{if(Sm(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wm(n)&&typeof Om==`function`&&(n=Om(n._payload)),a=ym(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=Z.cloneElement(a,void 0,s):!o&&Z.Children.count(r)===1&&Z.isValidElement(r)&&(a=r);let c=a?xm(a):void 0,l=mm(n,c);if(!a){if(r||r===0)throw Error(o?Dm(e):Em(e));return r}let u=bm(i,a.props??{});return a.type!==Z.Fragment&&(u.ref=n?l:c),Z.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var gm=hm(`Slot`),_m=Symbol.for(`radix.slottable`);function vm(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=_m,t}var ym=(e,t)=>{if(`child`in e.props){let t=e.props.child;return Z.isValidElement(t)?Z.cloneElement(t,void 0,e.props.children(t.props.children)):null}return Z.isValidElement(t)?t:null};function bm(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function xm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Sm(e){return Z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_m}var Cm=Symbol.for(`react.lazy`);function wm(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cm&&`_payload`in e&&Tm(e._payload)}function Tm(e){return typeof e==`object`&&!!e&&`then`in e}var Em=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Dm=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Om=Z.use,km=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hm(`Primitive.${t}`),r=Z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Am(e,t){e&&cm.flushSync(()=>e.dispatchEvent(t))}function jm(e,t=[]){let n=[];function r(t,r){let i=Z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=Z.useMemo(()=>o,Object.values(o));return(0,Q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=Z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>Z.createContext(e));return function(n){let r=n?.[e]||t;return Z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Mm(i,...t)]}function Mm(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return Z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Nm(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var Pm=globalThis?.document?Z.useLayoutEffect:()=>{},Fm=Z.useInsertionEffect||Pm;function Im({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Lm({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=Z.useRef(e!==void 0);Z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,Z.useCallback(t=>{if(s){let n=Rm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Lm({defaultProp:e,onChange:t}){let[n,r]=Z.useState(e),i=Z.useRef(n),a=Z.useRef(t);return Fm(()=>{a.current=t},[t]),Z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Rm(e){return typeof e==`function`}function zm(e,t){return Z.useReducer((e,n)=>t[e][n]??e,e)}var Bm=e=>{let{present:t,children:n}=e,r=Vm(t),i=typeof n==`function`?n({present:r.isPresent}):Z.Children.only(n),a=Um(r.ref,Gm(i));return typeof n==`function`||r.isPresent?Z.cloneElement(i,{ref:a}):null};Bm.displayName=`Presence`;function Vm(e){let[t,n]=Z.useState(),r=Z.useRef(null),i=Z.useRef(e),a=Z.useRef(`none`),o=Z.useRef(void 0),[s,c]=zm(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return Z.useEffect(()=>{s===`mounted`?(a.current=o.current??Wm(r.current),o.current=void 0):a.current=`none`},[s]),Pm(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Wm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Pm(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Wm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Wm(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:Z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Wm(t)}else r.current=null;n(e)},[])}}function Hm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Um(...e){let t=Z.useRef(e);return t.current=e,Z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Hm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Hm(n[e],null)}}},[])}function Wm(e){return e?.animationName||`none`}function Gm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Km=Z.useId||(()=>void 0),qm=0;function Jm(e){let[t,n]=Z.useState(Km());return Pm(()=>{e||n(e=>e??String(qm++))},[e]),e||(t?`radix-${t}`:``)}function Ym(e){let t=Z.useRef(e);return Z.useEffect(()=>{t.current=e}),Z.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Xm=`DismissableLayer`,Zm=`dismissableLayer.update`,Qm=`dismissableLayer.pointerDownOutside`,$m=`dismissableLayer.focusOutside`,eh,th=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nh=Z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=Z.useContext(th),[d,f]=Z.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=Z.useState({}),h=mm(t,f),g=Array.from(u.layers),[ee]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),te=ee?g.indexOf(ee):-1,_=d?g.indexOf(d):-1,ne=u.layersWithOutsidePointerEventsDisabled.size>0,v=_>=te,re=Z.useRef(!1),ie=sh(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:re,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:Z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return v&&!t},[u.branches,v])}),ae=ch(e=>{if(r&&re.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),oe=d?_===g.length-1:!1,se=Ym(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return Z.useEffect(()=>{if(oe)return p.addEventListener(`keydown`,se,{capture:!0}),()=>p.removeEventListener(`keydown`,se,{capture:!0})},[p,oe,se]),Z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(eh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),lh(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=eh))}},[d,p,n,u]),Z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),lh())},[d,u]),Z.useEffect(()=>{let e=()=>m({});return document.addEventListener(Zm,e),()=>document.removeEventListener(Zm,e)},[]),(0,Q.jsx)(km.div,{...l,ref:h,style:{pointerEvents:ne?v?`auto`:`none`:void 0,...e.style},onFocusCapture:Nm(e.onFocusCapture,ae.onFocusCapture),onBlurCapture:Nm(e.onBlurCapture,ae.onBlurCapture),onPointerDownCapture:Nm(e.onPointerDownCapture,ie.onPointerDownCapture)})});nh.displayName=Xm;var rh=`DismissableLayerBranch`,ih=Z.forwardRef((e,t)=>{let n=Z.useContext(th),r=Z.useRef(null),i=mm(t,r);return Z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,Q.jsx)(km.div,{...e,ref:i})});ih.displayName=rh;function ah(){let e=Z.useContext(th),[t,n]=Z.useState(null);return Z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var oh=()=>!0;function sh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=oh}=t,s=Ym(e),c=Z.useRef(!1),l=Z.useRef(!1),u=Z.useRef(new Map),d=Z.useRef(()=>{});return Z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||uh(Qm,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ch(e,t=globalThis?.document){let n=Ym(e),r=Z.useRef(!1);return Z.useEffect(()=>{let e=e=>{e.target&&!r.current&&uh($m,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lh(){let e=new CustomEvent(Zm);document.dispatchEvent(e)}function uh(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Am(i,a):i.dispatchEvent(a)}var dh=`focusScope.autoFocusOnMount`,fh=`focusScope.autoFocusOnUnmount`,ph={bubbles:!1,cancelable:!0},mh=`FocusScope`,hh=Z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=Z.useState(null),l=Ym(i),u=Ym(a),d=Z.useRef(null),f=mm(t,c),p=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Sh(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Sh(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Sh(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),Z.useEffect(()=>{if(s){Ch.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dh,ph);s.addEventListener(dh,l),s.dispatchEvent(t),t.defaultPrevented||(gh(Eh(vh(s)),{select:!0}),document.activeElement===e&&Sh(s))}return()=>{s.removeEventListener(dh,l),setTimeout(()=>{let t=new CustomEvent(fh,ph);s.addEventListener(fh,u),s.dispatchEvent(t),t.defaultPrevented||Sh(e??document.body,{select:!0}),s.removeEventListener(fh,u),Ch.remove(p)},0)}}},[s,l,u,p]);let m=Z.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=_h(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Sh(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Sh(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,Q.jsx)(km.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});hh.displayName=mh;function gh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Sh(r,{select:t}),document.activeElement!==n)return}function _h(e){let t=vh(e);return[yh(t,e),yh(t.reverse(),e)]}function vh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yh(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):bh(r,{upTo:t})))return r}function bh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function xh(e){return e instanceof HTMLInputElement&&`select`in e}function Sh(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xh(e)&&t&&e.select()}}var Ch=wh();function wh(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Th(e,t),e.unshift(t)},remove(t){e=Th(e,t),e[0]?.resume()}}}function Th(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Eh(e){return e.filter(e=>e.tagName!==`A`)}var Dh=`Portal`,Oh=Z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=Z.useState(!1);Pm(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?cm.createPortal((0,Q.jsx)(km.div,{...r,ref:t}),o):null});Oh.displayName=Dh;var kh=0,Ah=null;function jh(){Z.useEffect(()=>{Ah||={start:Mh(),end:Mh()};let{start:e,end:t}=Ah;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),kh++,()=>{kh===1&&(Ah?.start.remove(),Ah?.end.remove(),Ah=null),kh=Math.max(0,kh-1)}},[])}function Mh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Nh=function(){return Nh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Nh.apply(this,arguments)};function Ph(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ih=`right-scroll-bar-position`,Lh=`width-before-scroll-bar`,Rh=`with-scroll-bars-hidden`,zh=`--removed-body-scroll-bar-size`;function Bh(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Vh(e,t){var n=(0,Z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Hh=typeof window<`u`?Z.useLayoutEffect:Z.useEffect,Uh=new WeakMap;function Wh(e,t){var n=Vh(t||null,function(t){return e.forEach(function(e){return Bh(e,t)})});return Hh(function(){var t=Uh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Bh(e,null)}),i.forEach(function(e){r.has(e)||Bh(e,a)})}Uh.set(n,e)},[e]),n}function Gh(e){return e}function Kh(e,t){t===void 0&&(t=Gh);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function qh(e){e===void 0&&(e={});var t=Kh(null);return t.options=Nh({async:!0,ssr:!1},e),t}var Jh=function(e){var t=e.sideCar,n=Ph(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return Z.createElement(r,Nh({},n))};Jh.isSideCarExport=!0;function Yh(e,t){return e.useMedium(t),Jh}var Xh=qh(),Zh=function(){},Qh=Z.forwardRef(function(e,t){var n=Z.useRef(null),r=Z.useState({onScrollCapture:Zh,onWheelCapture:Zh,onTouchMoveCapture:Zh}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,ee=e.as,te=ee===void 0?`div`:ee,_=e.gapMode,ne=Ph(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),v=f,re=Wh([n,t]),ie=Nh(Nh({},ne),i);return Z.createElement(Z.Fragment,null,u&&Z.createElement(v,{sideCar:Xh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:_}),o?Z.cloneElement(Z.Children.only(s),Nh(Nh({},ie),{ref:re})):Z.createElement(te,Nh({},ie,{className:c,ref:re}),s))});Qh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qh.classNames={fullWidth:Lh,zeroRight:Ih};var $h,eg=function(){if($h)return $h;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function tg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=eg();return t&&e.setAttribute(`nonce`,t),e}function ng(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rg(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ig=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tg())&&(ng(t,n),rg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ag=function(){var e=ig();return function(t,n){Z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},og=function(){var e=ag();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sg={left:0,top:0,right:0,gap:0},cg=function(e){return parseInt(e||``,10)||0},lg=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[cg(n),cg(r),cg(i)]},ug=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sg;var t=lg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dg=og(),fg=`data-scroll-locked`,pg=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
60
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ba(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ba(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Va=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ha=[`oneOf`,`anyOf`];function Ua(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Wa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ua(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}m(n,r,e.length===1?e[0]:Wa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ua(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ga(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Va)if(t in e)return;let n=t.filter(e=>Ha.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Wa(t);else{let e=n[0],i=Ha.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Wa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Fa(e,r))}function Ka(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Fa(i,s),Fa(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ba(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ga(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Fa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,m(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ja(t,`input`,e.processors),output:Ja(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function D(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return D(r.element,n);if(r.type===`set`)return D(r.valueType,n);if(r.type===`lazy`)return D(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return D(r.innerType,n);if(r.type===`intersection`)return D(r.left,n)||D(r.right,n);if(r.type===`record`||r.type===`map`)return D(r.keyType,n)||D(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:D(r.in,n)||D(r.out,n);if(r.type===`object`){for(let e in r.shape)if(D(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(D(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(D(e,n))return!0;return!!(r.rest&&D(r.rest,n))}return!1}var qa=(e,t={})=>n=>{let r=Ia({...n,processors:t});return E(e,r),za(r,e),Ka(r,e)},Ja=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ia({...i??{},target:a,io:t,processors:n});return E(e,o),za(o,e),Ka(o,e)},Ya=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Xa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Za=(e,t)=>{Ya(e,`minimum`,t),Xa(e,`maximum`,t)},Qa=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},$a=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},eo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},to=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},no=(e,t)=>Ya(e,`minimum`,t.minimum),ro=(e,t)=>Xa(e,`maximum`,t.maximum),io=e=>(t,n)=>{to(t,n.format);let[r,i]=e[n.format];Ya(t,`minimum`,r),Xa(t,`maximum`,i)},ao={greater_than:(e,t)=>Ya(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Xa(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Qa(e,t.value),number_format:io(he),bigint_format:io(ge),min_length:no,max_length:ro,length_equals:(e,t)=>Za(e,t.length),min_size:no,max_size:ro,size_equals:(e,t)=>Za(e,t.size),string_format:(e,t)=>{to(e,t.format),t.pattern&&$a(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>eo(e,t.mime)};function O(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ao[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Ya(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Ya(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Xa(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Xa(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Qa(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&eo(t,i.mime);for(let e of i.patterns??[])$a(t,e);return t}var oo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},so=new Map([[ur,Yt],[fr,Xt]]),co=e=>so.get(e)??e,lo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=O(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=oo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(co);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},uo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=O(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):La(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},fo=(e,t,n,r)=>{n.type=`boolean`},po=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mo=(e,t,n,r)=>{n.not={}},ho=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},go=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(La(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(La(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_o=(e,t,n,r)=>{La(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},vo=(e,t,n,r)=>{La(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},yo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=O(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=E(a.element,t,{...r,path:[...r.path,`items`]})};function bo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?bo(t.out):t.type===`catch`?bo(t.innerType):e._zod.optin}var xo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&La(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)m(i.properties,e,E(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?bo(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=E(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},So=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>E(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Co=(e,t,n,r)=>{let i=e._zod.def,a=E(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=E(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function wo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=wo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>wo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?cn:sn).source),p):p}var To=new WeakMap;function Eo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of To.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=wo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Do=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=O(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=E(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)m(i.patternProperties,co(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=E(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=To.get(t);n||(n=[],To.set(t,n),t.deferred.push(()=>Eo(t))),n.push(e)}i.additionalProperties=E(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&bo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Oo=(e,t,n,r)=>{let i=e._zod.def,a=E(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ko=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ao=Symbol();function jo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(La(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ao):JSON.parse(o)}var Mo=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=jo(i.defaultValue,e,t,n,r);o!==Ao&&(n.default=o)},No=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=jo(i.defaultValue,e,t,n,r);o!==Ao&&(n._prefault=o)},Po=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{La(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Fo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;E(o,t,r);let s=t.seen.get(e);s.ref=o},Io=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lo=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ro=new WeakSet([Object.prototype,Error.prototype]);function zo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var k=x(`ZodError`,(e,t)=>{lt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ro.has(n)||(Ro.add(n),zo(n,`format`,e=>t=>ft(e,t)),zo(n,`flatten`,e=>t=>dt(e,t)),zo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}),zo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Bo=mt(k),Vo=ht(k),Ho=gt(k),Uo=vt(k),Wo=wt(k),Go=Tt(k),Ko=Et(k),qo=Dt(k),Jo=Ot(k),Yo=kt(k),Xo=At(k),Zo=jt(k);function Qo(){S.localeError||nt(Ti())}function $o(){S.memoizer||nt({memoizer:Si()})}var A=x(`ZodType`,(e,t)=>(Qo(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(v(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return fe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_c(e,t))},superRefine(e,t){return this.check(vc(e,t))},overwrite(e){return this.check(Ta(e))},optional(){return $s(this)},exactOptional(){return tc(this)},nullable(){return rc(this)},nullish(){return $s(rc(this))},nonoptional(e){return lc(this,e)},array(){return F(this)},or(e){return R([this,e])},and(e){return Ks(this,e)},transform(e){return pc(this,Zs(e))},default(e){return ac(this,e)},prefault(e){return sc(this,e)},catch(e){return dc(this,e)},pipe(e){return pc(this,e)},readonly(){return hc(this)},describe(e){let t=this.clone();return ki.add(t,{description:e}),t},meta(...e){if(e.length===0)return ki.get(this);let t=this.clone();return ki.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ze(this,`~standard`,{...Pn(this),jsonSchema:{input:Ja(this,`input`),output:Ja(this,`output`)}})},set"~standard"(e){Re(this,`~standard`,e)},parse:function e(t,n){return Bo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Vo(this,t,n,{callee:e})},safeParse(e,t){return Ho(this,e,t)},async safeParseAsync(e,t){return Uo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Re(this,`spa`,e)},validate(e,t){return xt(this,e,t)},validateAsync(e,t){return Ct(this,e,t)},encode:function e(t,n){return Wo(this,t,n,{callee:e})},decode:function e(t,n){return Go(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ko(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await qo(this,t,n,{callee:e})},safeEncode(e,t){return Jo(this,e,t)},safeDecode(e,t){return Yo(this,e,t)},async safeEncodeAsync(e,t){return Xo(this,e,t)},async safeDecodeAsync(e,t){return Zo(this,e,t)},toJSONSchema(e){return qa(this,{})(e)},get description(){return ki.get(this)?.description},get _def(){return this._zod.def}}),es=x(`_ZodString`,(e,t)=>{Fn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r)},Be({format:e=>O(e).format??null,minLength:e=>O(e).minimum??null,maxLength:e=>O(e).maximum??null},{regex(...e){return this.check(ya(...e))},includes(...e){return this.check(Sa(...e))},startsWith(...e){return this.check(Ca(...e))},endsWith(...e){return this.check(wa(...e))},min(...e){return this.check(_a(...e))},max(...e){return this.check(ga(...e))},length(...e){return this.check(va(...e))},nonempty(...e){return this.check(_a(1,...e))},lowercase(e){return this.check(ba(e))},uppercase(e){return this.check(xa(e))},trim(){return this.check(Da())},normalize(...e){return this.check(Ea(...e))},toLowerCase(){return this.check(Oa())},toUpperCase(){return this.check(ka())},slugify(){return this.check(Aa())}})),ts=x(`ZodString`,(e,t)=>{Fn.init(e,t),es.init(e,t)},{email(e){return this.check(ji(os,e))},url(e){return this.check(Li(ds,e))},jwt(e){return this.check(Qi(Ds,e))},emoji(e){return this.check(Ri(ps,e))},guid(e){return this.check(Mi(cs,e))},uuid(e){return this.check(Ni(ls,e))},uuidv4(e){return this.check(Pi(ls,e))},uuidv6(e){return this.check(Fi(ls,e))},uuidv7(e){return this.check(Ii(ls,e))},nanoid(e){return this.check(zi(ms,e))},cuid(e){return this.check(Bi(hs,e))},cuid2(e){return this.check(Vi(gs,e))},ulid(e){return this.check(Hi(_s,e))},base64(e){return this.check(Yi(ws,e))},base64url(e){return this.check(Xi(Ts,e))},xid(e){return this.check(Ui(vs,e))},ksuid(e){return this.check(Wi(ys,e))},ipv4(e){return this.check(Gi(bs,e))},ipv6(e){return this.check(Ki(xs,e))},cidrv4(e){return this.check(qi(Ss,e))},cidrv6(e){return this.check(Ji(Cs,e))},e164(e){return this.check(Zi(Es,e))},datetime(e){return this.check($i(ns,e))},date(e){return this.check(ea(rs,e))},time(e){return this.check(ta(is,e))},duration(e){return this.check(na(as,e))}});function j(e){return Ai(ts,e)}var M=x(`ZodStringFormat`,(e,t)=>{T.init(e,t),es.init(e,t)}),ns=x(`ZodISODateTime`,(e,t)=>{Qn.init(e,t),M.init(e,t)}),rs=x(`ZodISODate`,(e,t)=>{$n.init(e,t),M.init(e,t)}),is=x(`ZodISOTime`,(e,t)=>{er.init(e,t),M.init(e,t)}),as=x(`ZodISODuration`,(e,t)=>{tr.init(e,t),M.init(e,t)}),os=x(`ZodEmail`,(e,t)=>{Rn.init(e,t),M.init(e,t)});function ss(e){return ji(os,e)}var cs=x(`ZodGUID`,(e,t)=>{In.init(e,t),M.init(e,t)}),ls=x(`ZodUUID`,(e,t)=>{Ln.init(e,t),M.init(e,t)});function us(e){return Ni(ls,e)}var ds=x(`ZodURL`,(e,t)=>{Wn.init(e,t),M.init(e,t)});function fs(e){return Li(ds,e)}var ps=x(`ZodEmoji`,(e,t)=>{Gn.init(e,t),M.init(e,t)}),ms=x(`ZodNanoID`,(e,t)=>{Kn.init(e,t),M.init(e,t)}),hs=x(`ZodCUID`,(e,t)=>{qn.init(e,t),M.init(e,t)}),gs=x(`ZodCUID2`,(e,t)=>{Jn.init(e,t),M.init(e,t)}),_s=x(`ZodULID`,(e,t)=>{Yn.init(e,t),M.init(e,t)}),vs=x(`ZodXID`,(e,t)=>{Xn.init(e,t),M.init(e,t)}),ys=x(`ZodKSUID`,(e,t)=>{Zn.init(e,t),M.init(e,t)}),bs=x(`ZodIPv4`,(e,t)=>{nr.init(e,t),M.init(e,t)}),xs=x(`ZodIPv6`,(e,t)=>{ar.init(e,t),M.init(e,t)}),Ss=x(`ZodCIDRv4`,(e,t)=>{or.init(e,t),M.init(e,t)}),Cs=x(`ZodCIDRv6`,(e,t)=>{cr.init(e,t),M.init(e,t)}),ws=x(`ZodBase64`,(e,t)=>{dr.init(e,t),M.init(e,t)}),Ts=x(`ZodBase64URL`,(e,t)=>{mr.init(e,t),M.init(e,t)}),Es=x(`ZodE164`,(e,t)=>{hr.init(e,t),M.init(e,t)}),Ds=x(`ZodJWT`,(e,t)=>{_r.init(e,t),M.init(e,t)}),Os=x(`ZodNumber`,(e,t)=>{vr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.isFinite=!0},Be({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=O(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=O(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=O(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>O(e).format??null},{gt(e,t){return this.check(pa(e,t))},gte(e,t){return this.check(ma(e,t))},min(e,t){return this.check(ma(e,t))},lt(e,t){return this.check(da(e,t))},lte(e,t){return this.check(fa(e,t))},max(e,t){return this.check(fa(e,t))},int(e){return this.check(As(e))},safe(e){return this.check(As(e))},positive(e){return this.check(pa(0,e))},nonnegative(e){return this.check(ma(0,e))},negative(e){return this.check(da(0,e))},nonpositive(e){return this.check(fa(0,e))},multipleOf(e,t){return this.check(ha(e,t))},step(e,t){return this.check(ha(e,t))},finite(){return this}}));function N(e){return ra(Os,e)}var ks=x(`ZodNumberFormat`,(e,t)=>{yr.init(e,t),Os.init(e,t)});function As(e){return aa(ks,e)}var js=x(`ZodBoolean`,(e,t)=>{br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r)});function P(e){return oa(js,e)}var Ms=x(`ZodNull`,(e,t)=>{xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r)});function Ns(e){return sa(Ms,e)}var Ps=x(`ZodAny`,(e,t)=>{Sr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fs(){return ca(Ps)}var Is=x(`ZodUnknown`,(e,t)=>{Cr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ls(){return la(Is)}var Rs=x(`ZodNever`,(e,t)=>{wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mo(e,t,n,r)});function zs(e){return ua(Rs,e)}var Bs=x(`ZodArray`,(e,t)=>{$o(),Er.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(_a(e,t))},nonempty(e){return this.check(_a(1,e))},max(e,t){return this.check(ga(e,t))},length(e,t){return this.check(va(e,t))},unwrap(){return this.element}});function F(e,t){return ja(Bs,e,t)}var Vs=x(`ZodObject`,(e,t)=>{$o(),Mr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),Ke(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v(this._zod.def,{catchall:Ls()}))},loose(){return this.clone(v(this._zod.def,{catchall:Ls()}))},strict(){return this.clone(v(this._zod.def,{catchall:zs()}))},strip(){return this.clone(v(this._zod.def,{catchall:void 0}))},extend(e){return be(this,e)},safeExtend(e){return Se(this,e)},merge(e){return Ce(this,e)},pick(e){return _e(this,e)},omit(e){return ye(this,e)},partial(...e){return we(Qs,this,e[0])},exactPartial(...e){return we(ec,this,e[0],`exactPartial`)},required(...e){return Te(cc,this,e[0])}});function I(e,t){return new Vs({type:`object`,shape:e??{},...y(t)})}function Hs(e,t){return new Vs({type:`object`,shape:e,catchall:zs(),...y(t)})}function L(e,t){return new Vs({type:`object`,shape:e,catchall:Ls(),...y(t)})}var Us=x(`ZodUnion`,(e,t)=>{Pr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.options=t.options});function R(e,t){return new Us({type:`union`,options:e,...y(t)})}var Ws=x(`ZodDiscriminatedUnion`,(e,t)=>{Us.init(e,t),Ir.init(e,t)});function z(e,t,n){return new Ws({type:`union`,options:t,discriminator:e,...y(n)})}var Gs=x(`ZodIntersection`,(e,t)=>{Lr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function Ks(e,t){return new Gs({type:`intersection`,left:e,right:t})}var qs=x(`ZodRecord`,(e,t)=>{$o(),Br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,n){return!t||!t._zod?new qs({type:`record`,keyType:j(),valueType:e,...y(t)}):new qs({type:`record`,keyType:e,valueType:t,...y(n)})}var Js=x(`ZodEnum`,(e,t)=>{Vr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ho(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Js({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Js({...t,checks:[],...y(r),entries:i})}});function V(e,t){return new Js({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Ys=x(`ZodLiteral`,(e,t)=>{Hr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>go(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new Ys({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var Xs=x(`ZodTransform`,(e,t)=>{$o(),Ur.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ie(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ie(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Zs(e){return new Xs({type:`transform`,transform:e})}var Qs=x(`ZodOptional`,(e,t)=>{Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`optional`,innerType:e})}var ec=x(`ZodExactOptional`,(e,t)=>{Kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tc(e){return new ec({type:`optional`,innerType:e})}var nc=x(`ZodNullable`,(e,t)=>{qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rc(e){return new nc({type:`nullable`,innerType:e})}var ic=x(`ZodDefault`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ac(e,t){return new ic({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var oc=x(`ZodPrefault`,(e,t)=>{Xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e,t){return new oc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var cc=x(`ZodNonOptional`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e,t){return new cc({type:`nonoptional`,innerType:e,...y(t)})}var uc=x(`ZodCatch`,(e,t)=>{ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dc(e,t){return new uc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Je(t)})}var fc=x(`ZodPipe`,(e,t)=>{ti.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.in=t.in,e.out=t.out});function pc(e,t){return new fc({type:`pipe`,in:e,out:t})}var mc=x(`ZodReadonly`,(e,t)=>{ri.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e){return new mc({type:`readonly`,innerType:e})}var gc=x(`ZodCustom`,(e,t)=>{ai.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)});function _c(e,t={}){return Ma(gc,e,t)}function vc(e,t){return Na(e,t)}function yc(e){return $i(ns,e)}function U(e){return ia(Os,e)}L({seq:N(),ts:j(),stepId:j().optional(),type:j()});var bc=I({id:j().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),xc=j().min(1).max(2048);I({cursor:xc.optional()}),I({cursor:xc.optional(),afterSeq:U().int().nonnegative().optional()});var Sc=I({seq:N(),ts:j(),stepId:j().optional(),type:j()}).catchall(Fs()),Cc=I({events:F(Sc),itemCount:N().int().min(0).max(100),olderCursor:xc.optional(),newerCursor:xc.optional(),liveCursor:xc,asOfSeq:N().int().nonnegative(),hasOlder:P()}),wc=I({contextEvents:F(Sc),asOfSeq:N().int().nonnegative()});I({checkoutId:j().optional(),name:j(),phase:V([`cloning`,`done`,`error`]),line:j().optional(),error:j().optional()});var W=V([`claude`,`codex`,`opencode`,`cursor`,`pi`,`junie`,`copilot`]),Tc=I({root:j(),branch:j(),remote:j().optional()}),Ec=I({name:V([`claude`,`codex`,`opencode`,`cursor`,`pi`,`junie`,`copilot`,`gh`,`git`]),available:P(),version:j().optional(),hint:j().optional()}),Dc=I({kind:H(`github`),available:P().optional(),reason:j().optional()}),Oc=I({localHandoff:P(),terminal:P(),designMode:P(),followups:P(),singleProject:P(),automations:P(),dispatch:P(),tokenMetrics:P(),tokenUsageMetrics:P(),costMetrics:P()});I({version:j(),latestVersion:j().optional(),repoRoot:j(),repo:Tc.nullable(),checks:F(Ec),defaultRunner:W,forge:Dc.nullable(),capabilities:Oc,projects:F(I({id:j(),name:j()})),bootProject:j(),instanceId:j().optional()});var G=j().uuid(),kc=V([`setup`,`teardown`]),Ac=V([`create`,`recreate`,`remove-worktree`,`delete-task`,`reclaim`,`discard-variant`,`orphan`]),jc=V([`queued`,`running`,`needs_attention`,`interrupted`,`committing`,`completed`,`bypassed`,`cancelled`,`kept`]),Mc=V([`retry`,`start-anyway`,`cancel-task`,`keep-worktree`,`force-delete`,`stop`]),Nc=I({id:G,name:j().max(120).optional(),command:j().max(32*1024).refine(e=>e.trim().length>0,`Command must not be blank`),timeoutSeconds:N().int().min(1).max(86400).optional()}).strict(),Pc=I({afterCreate:F(Nc).max(32),beforeRemove:F(Nc).max(32)}).strict().superRefine((e,t)=>{let n=new Set;for(let r of[`afterCreate`,`beforeRemove`])e[r].forEach((e,i)=>{n.has(e.id)&&t.addIssue({code:`custom`,path:[r,i,`id`],message:`Entry IDs must be unique across both lists`}),n.add(e.id)})}),Fc=I({worktreeId:G,generation:N().int().positive(),activeOperationId:G.optional(),phase:kc.optional(),state:jc.optional(),needsAttention:P()});I({schemaVersion:H(1),worktreeId:G,runId:bc.shape.id,projectRoot:j().min(1),worktreePath:j().min(1),branch:j().optional(),generation:N().int().positive(),preparedBy:V([`completed`,`bypassed`]).optional(),autoCleanupSuppressed:P(),activeOperationId:G.optional(),createdAt:j(),updatedAt:j()}).passthrough();var Ic=I({pid:N().int().positive(),hostname:j(),startedAt:j(),startIdentity:j().optional(),quiescent:P().optional()}).passthrough(),Lc=I({id:G,operationId:G,entryId:G,fingerprint:j().min(1),ordinal:N().int().nonnegative(),label:j(),commandPreview:j(),attempt:N().int().positive(),state:V([`running`,`succeeded`,`failed`,`interrupted`,`skipped`]),startedAt:j(),finishedAt:j().optional(),exitCode:N().int().nullable().optional(),signal:j().nullable().optional(),reason:j().optional(),outputStartSeq:N().int().nonnegative().optional(),outputEndSeq:N().int().nonnegative().optional(),outputTruncated:P().optional(),process:Ic.optional()}).passthrough(),Rc=I({kind:V([`initial`,`continuation`]),runId:bc.shape.id,message:j().optional()}).passthrough(),zc=I({schemaVersion:H(1),id:G,worktreeId:G,generation:N().int().positive(),phase:kc,intent:Ac,state:jc,revision:N().int().nonnegative(),createdAt:j(),updatedAt:j(),finishedAt:j().optional(),pendingLaunch:Rc.optional(),agentQuiescencePending:P().optional(),failureStage:V([`config`,`context`,`storage`,`command`,`commit`,`process`]).optional(),error:j().optional(),decision:I({action:Mc,actor:j(),at:j(),skippedEntryIds:F(G).optional()}).optional(),configRevision:j().nullable().optional(),executions:F(Lc).max(100),successfulEntries:F(I({entryId:G,fingerprint:j()})).default([]),requests:F(I({requestId:G,bodyHash:j()})).default([])}).passthrough(),Bc=I({entryId:G,label:j(),commandPreview:j(),state:V([`pending`,`running`,`succeeded`,`failed`,`interrupted`,`already-completed`,`skipped`,`removed`]),attempt:N().int().nonnegative()}),Vc=Lc.omit({process:!0}).strip(),Hc=zc.omit({schemaVersion:!0,pendingLaunch:!0,agentQuiescencePending:!0,requests:!0,successfulEntries:!0,executions:!0}).strip().extend({history:F(Vc),entries:F(Bc),allowedActions:F(Mc)}),Uc=I({worktreeId:G,runId:bc.shape.id,task:I({id:bc.shape.id,title:j()}).nullable(),worktreePath:j(),generation:N().int().positive(),onDisk:P(),prepared:P(),needsAttention:P(),autoCleanupSuppressed:P(),operation:Hc.optional(),error:j().optional()}),Wc=Uc.extend({history:F(Hc)});R([I({requestId:G,runId:bc.shape.id,intent:V([`remove-worktree`,`delete-task`,`reclaim`])}).strict(),I({requestId:G,worktreeId:G,intent:H(`orphan`)}).strict()]),I({requestId:G,expectedRevision:N().int().nonnegative(),action:Mc}).strict(),I({worktreeId:G}),I({operationId:G}),I({attentionOnly:V([`true`,`false`]).transform(e=>e===`true`).optional(),cursor:j().max(128).optional(),limit:U().int().min(1).max(100).default(50)}),I({worktrees:F(Uc),nextCursor:j().optional()}),I({worktree:Wc}),I({operation:Hc});var Gc=I({seq:N().int().nonnegative(),time:j(),executionId:G,stream:V([`stdout`,`stderr`,`system`]),text:j().max(16*1024)});I({afterSeq:U().int().nonnegative().default(0),limit:U().int().min(1).max(200).default(100)}),I({items:F(Gc),nextSeq:N().int().nonnegative(),truncated:P()}),I({command:Nc.shape.command,worktreeId:G.optional()}).strict();var Kc=I({root_path:j(),worktree_path:j(),worktree_id:j(),task_id:j()});I({renderedCommand:j(),variables:Kc,cwd:j(),illustrative:P()});var qc=I({projectId:j(),worktreeId:G,operationId:G.optional(),revision:N().int().nonnegative()}),Jc=V([`passing`,`failing`,`pending`]).nullable(),Yc=I({kind:V([`issue`,`pr`]),number:N(),title:j(),author:j(),createdAt:j(),labels:F(j()),body:j().optional(),url:j(),comments:N(),isDraft:P().optional(),additions:N().optional(),deletions:N().optional(),checks:Jc.optional()});I({available:P(),reason:j().optional(),repo:j().optional(),syncedAt:j().optional(),issues:F(Yc),prs:F(Yc),labelColors:B(j(),j()).optional(),issuesTotal:N().int().nonnegative().optional(),prsTotal:N().int().nonnegative().optional(),issuesNextCursor:j().nullable().optional(),prsNextCursor:j().nullable().optional()}),I({limit:j().optional(),refresh:j().optional(),issuesCursor:j().max(2e3).optional(),prsCursor:j().max(2e3).optional()}),z(`available`,[I({available:H(!0),checks:B(N(),Jc)}),I({available:H(!1),reason:j()})]),I({available:P(),reason:j().optional(),items:F(Yc),truncated:P().optional(),labelColors:B(j(),j()).optional()});var Xc=V([`draft`,`review-required`,`changes-requested`,`checks-pending`,`checks-failing`,`ready`,`merged`,`closed`,`open`,`completed`,`not-planned`]),Zc=N().nullable();z(`available`,[I({available:H(!0),prs:B(N(),Xc),issues:B(N(),Xc),conflicts:F(N()).optional(),recheckAfterMs:Zc}),I({available:H(!1),reason:j(),recheckAfterMs:Zc})]);var Qc=I({id:N(),author:j(),avatarUrl:j().optional(),createdAt:j(),body:j(),kind:V([`comment`,`review`]),reviewState:V([`approved`,`changes_requested`,`commented`,`dismissed`]).optional(),url:j()}),$c=V([`committed`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`merged`,`closed`,`reopened`,`head_ref_force_pushed`,`cross-referenced`,`renamed`]),el=I({id:j(),kind:$c,actor:j(),avatarUrl:j().optional(),createdAt:j(),url:j().optional(),sha:j().optional(),message:j().optional(),checks:Jc.optional(),label:I({name:j(),color:j().optional()}).optional(),subject:j().optional(),refNumber:N().optional(),refTitle:j().optional(),refIsPr:P().optional()});I({available:P(),reason:j().optional(),comments:F(Qc),truncated:P().optional(),events:F(el).optional(),detail:I({body:j(),additions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional()}).optional()});var tl=V([`merge`,`squash`,`rebase`]),nl=I({name:j(),state:V([`passing`,`failing`,`pending`,`unknown`]),required:P().nullable(),url:j().optional()}),rl=I({number:N(),title:j(),url:j(),state:V([`open`,`closed`,`merged`]),isDraft:P(),headRef:j(),baseRef:j(),headSha:j(),mergeable:V([`mergeable`,`conflicting`,`unknown`]),reviewDecision:V([`approved`,`changes-requested`,`review-required`,`unknown`]),checks:F(nl),checksTier:V([`detailed`,`aggregate`,`none`]),checksReason:j().optional(),methods:F(tl),defaultMethod:tl.nullable(),eligibility:V([`ready`,`blocked`,`pending`,`unauthorized`,`terminal`,`unknown`]),blockers:F(I({code:j(),message:j()})),canMerge:P(),canOverride:P()});z(`available`,[I({available:H(!0),mergeState:rl}),I({available:H(!1),reason:j()})]),I({merged:H(!0),number:N(),url:j(),method:tl,mergeCommitSha:j().optional()});var il=I({path:j(),previousPath:j().optional(),status:V([`added`,`modified`,`removed`,`renamed`,`copied`,`changed`]),additions:N(),deletions:N(),patch:j().optional(),patchUnavailableReason:V([`binary`,`too-large`,`not-provided`]).optional(),truncated:P().optional()});z(`available`,[I({available:H(!0),number:N(),headSha:j(),files:F(il),additions:N(),deletions:N(),truncated:P(),reason:j().optional()}),I({available:H(!1),reason:j()})]);var al=16*1024,ol=[`checks`,`cezar`],sl=V(ol);V([`project`,`workspace`]);var cl=V([`keychain`,`file`]),ll=/^[A-Z_][A-Z0-9_]{0,127}$/,ul=new Set([`PATH`,`HOME`,`SHELL`,`USER`,`TMPDIR`,`TEMP`,`TMP`,`NODE_OPTIONS`,`LD_PRELOAD`,`LD_LIBRARY_PATH`,`BASH_ENV`,`ENV`]);function dl(e){return ll.test(e)?e.startsWith(`CEZ_`)?`CEZ_* names are reserved for cezar`:e.startsWith(`DYLD_`)?`DYLD_* names change how programs load and are refused`:ul.has(e)?`${e} changes how the check's shell runs and is refused`:null:`a name is 1–128 characters: uppercase letters, digits and underscores, not starting with a digit`}var fl=j().superRefine((e,t)=>{let n=dl(e);n&&t.addIssue({code:`custom`,message:n})});I({name:fl});function pl(e){let t=0;for(let n of e){let e=n.codePointAt(0)??0;t+=e<128?1:e<2048?2:e<65536?3:4}return t}function ml(e){return e===``?`a value is not empty; remove the name instead of storing nothing`:pl(e)>16384?`a value is at most ${al} bytes`:/[\r\n\0]/.test(e)?`a value is one line, without NUL`:null}I({value:j().superRefine((e,t)=>{let n=ml(e);n&&t.addIssue({code:`custom`,message:n})}),audiences:F(sl).min(1).optional()}),I({secrets:F(I({name:j(),audiences:F(sl),updatedAt:j()})),keyBackend:cl}),I({error:j()}).strict();var hl=F(R([fl,I({name:fl,as:fl.optional()}).strict()])).min(1),gl=I({id:j().min(1),name:j().optional(),prompt:j().optional(),skill:j().optional(),model:j().optional(),runner:W.optional(),allowedTools:F(j()).optional(),bashAllowlist:F(j()).optional(),command:j().optional(),onFail:I({retry:j().min(1),max:N().int().positive().default(2),retryOn:F(N().int().positive()).optional()}).optional(),secrets:hl.optional()}).refine(e=>!!e.command!=!!(e.prompt??e.skill),{message:`a step is either an agent step (prompt/skill) or a check step (command), not both`}).refine(e=>!e.secrets||!!e.command,{message:`secrets: is for check steps only — an agent step never receives a secret`}),_l=j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/,`node ids are letters, digits, "-" and "_" (no dots)`),K={id:_l,name:j().optional()},vl=N().int().min(6e4).max(10080*6e4),yl=j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/,`verdicts are letters, digits, "-" and "_"`).refine(e=>e!==`failed`&&e!==`done`,`verdicts cannot be named "done" or "failed"`),bl=V([`>`,`>=`,`<`,`<=`,`==`]),xl=z(`kind`,[I({kind:H(`diff-lines`),op:bl,value:N().nonnegative()}),I({kind:H(`diff-files`),op:bl,value:N().nonnegative()}),I({kind:H(`paths-changed`),glob:j().min(1)}),I({kind:H(`output`),ref:j().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*\.[A-Za-z0-9_]+$/,`ref is <node>.<field>`),op:V([`equals`,`not-equals`,`contains`,`>`,`>=`,`<`,`<=`]),value:R([j(),N()])}),I({kind:H(`branch`),op:V([`equals`,`matches`]),value:j().min(1)})]),Sl=I({nodes:F(z(`type`,[I({...K,type:H(`start`)}),I({...K,type:H(`end`),status:V([`success`,`failed`]).default(`success`)}),I({...K,type:H(`loop`),max:N().int().positive()}),I({...K,type:H(`agent`),prompt:j().optional(),skill:j().optional(),model:j().optional(),runner:W.optional(),allowedTools:F(j()).optional(),bashAllowlist:F(j()).optional(),verdicts:F(yl).min(1).optional(),session:I({continue:_l}).optional(),review:P().optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`check`),command:j().min(1),retryOn:F(N().int().positive()).optional(),secrets:hl.optional()}),I({...K,type:H(`gate.human`),message:j().min(1),timeoutMs:vl.optional()}),I({...K,type:H(`ask-user`),question:j().min(1),options:F(j().min(1)).max(6).optional(),timeoutMs:vl.optional()}),I({...K,type:H(`dispatch`),prompt:j().min(1),runner:W.optional(),model:j().optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`git.commit`),message:j().min(1)}),I({...K,type:H(`github.draft-pr`),title:j().optional()}),I({...K,type:H(`github.wait-ci`),timeoutMs:vl.default(60*6e4),pollMs:N().int().min(1e4).max(30*6e4).default(6e4)}),I({...K,type:H(`github.pr-comment`),body:j().min(1)}),I({...K,type:H(`fork`),branches:N().int().min(2).max(4).default(3)}),I({...K,type:H(`join`),wait:V([`all`,`any`]).default(`all`)}),I({...K,type:H(`workflow`),workflow:j().min(1),prompt:j().optional(),runner:W.optional(),budgetUsd:N().positive().optional()}),I({...K,type:H(`if`),condition:xl}),I({...K,type:H(`git.push`)}),I({...K,type:H(`git.sync-base`)}),I({...K,type:H(`github.pr-update`),ready:P().optional(),addLabels:F(j().min(1)).optional(),reviewers:F(j().min(1)).optional()}),I({...K,type:H(`github.issue-comment`),issue:N().int().positive().optional(),body:j().min(1)}),I({...K,type:H(`notify.webhook`),url:j().url().regex(/^https?:\/\//,`http(s) URLs only`),body:j().optional()})])).min(1),edges:F(I({from:j().min(1),to:_l})),layout:B(j(),I({x:N(),y:N()})).optional()}),Cl=I({name:j(),description:j().optional(),steps:F(gl),graph:Sl.optional(),source:V([`built-in`,`file`]),path:j().optional()}),wl=I({path:j(),message:j()});I({workflows:F(Cl),issues:F(wl)}),I({name:j().trim().min(1).max(80),description:j().max(2e3,`must be at most 2000 characters`).optional(),steps:F(gl).min(1).max(8).optional(),skills:F(j().trim().min(1)).min(1).max(8).optional(),overwrite:P().optional()}).refine(e=>!!e.steps!=!!e.skills,{message:`provide either "steps" or "skills", not both`}),I({path:j(),name:j()}),I({name:j(),description:j().optional(),steps:F(gl),graph:Sl.optional()}),I({name:j().trim().min(1).max(80),description:j().max(2e3,`must be at most 2000 characters`).optional(),graph:Sl,overwrite:P().optional()}),I({graph:Sl}),I({issues:F(j())}),I({nodes:F(I({type:V([`start`,`end`,`loop`,`agent`,`check`,`gate.human`,`ask-user`,`dispatch`,`git.commit`,`github.draft-pr`,`github.wait-ci`,`github.pr-comment`,`fork`,`join`,`if`,`workflow`,`git.push`,`git.sync-base`,`github.pr-update`,`github.issue-comment`,`notify.webhook`]),category:V([`flow`,`agents`,`scripts`,`git`]),label:j(),description:j(),ports:F(j()),outputs:F(j())}))}),I({ok:H(!0),path:j()}),I({name:j().optional(),steps:F(gl),rationale:j(),fallback:P()});var Tl=V([`implement`,`review`]),El=I({status:V([`done`,`partial`,`failed`,`blocked`]),result:j().max(4e3),evidence:F(j().max(400)).max(12).default([]),confidence:N().min(0).max(1).optional(),side_effects:F(j().max(400)).max(12).default([]),errors:F(j().max(400)).max(12).default([]),recommended_next_action:j().max(1e3).optional(),verdict:V([`approve`,`changes`,`reject`]).optional(),suggestions:F(j().max(400)).max(8).default([])}),Dl=I({fromRunId:j(),title:j(),report:El,at:j()}),Ol=Hs({maxSubtasks:N().int().min(1).max(50).optional(),inFlight:N().int().min(1).max(4).optional(),runner:W.optional(),model:j().max(120).optional(),budgetUsd:N().positive().max(1e4).optional()}),kl=I({rootRunId:j(),intent:Ol.optional(),parentRunId:j().optional(),kind:Tl.optional(),reviewOf:F(j().max(120)).max(8).optional(),budgetUsd:N().nonnegative().optional(),report:El.optional(),pendingReports:F(Dl).optional(),inboxSeenAt:j().optional(),pendingAsk:I({requestId:j().optional(),questions:F(j().max(400)).max(4),omittedQuestions:N().int().positive().optional(),askedAt:j()}).optional(),overBudget:P().optional()});I({title:j().min(1).max(120).optional(),objective:j().min(1).max(4e3),kind:Tl.optional(),review_of:F(j().max(120)).max(8).optional(),scope:j().max(1e3).optional(),allowed_tools:F(j().max(80)).max(16).optional(),max_cost:N().positive().optional(),success_criteria:j().max(1e3).optional(),required_evidence:j().max(1e3).optional(),retry_limit:N().int().min(0).max(3).optional(),runner:W.optional(),model:j().max(200).optional()}).strict(),I({id:j(),branch:j().optional()});var Al=V([`jira`,`linear`]),jl=fs({protocol:/^https$/}),Ml=j().min(1),Nl=j().min(1).max(4096),Pl=I({id:Ml,webUrl:jl}).strict(),Fl=I({id:Ml,name:Ml}).strict(),Il=I({kind:Al,source:Pl,externalId:j(),externalName:j(),connectionId:us().optional()}).strict(),Ll=V([`issue.opened`,`issue.status_changed`,`issue.labeled`,`issue.unlabeled`]);function Rl(e){return JSON.stringify([e.kind,e.source.id,e.source.webUrl,e.externalId,e.connectionId??null])}I({kind:Al,externalId:Ml,sourceId:Ml,connectionId:us().optional()}).strict();var zl=I({kind:H(`issue`),id:j(),title:j(),author:j(),createdAt:yc({offset:!0}),updatedAt:yc({offset:!0}),labels:F(j()),body:j(),bodyTruncated:P(),unsupportedContent:P(),url:jl,status:j()}).strict(),Bl=V([`not_configured`,`credentials_missing`,`unauthorized`,`rate_limited`,`unavailable`,`source_changed`,`invalid_response`]),Vl=I({available:H(!1),code:Bl,reason:j(),retryAfterSeconds:N().int().nonnegative().optional()}).strict(),Hl=I({available:H(!1),code:H(`invalid_cursor`),reason:j()}).strict(),Ul=I({available:H(!1),code:H(`not_found`),reason:j()}).strict();function Wl(e,t){e.truncated&&e.nextCursor===void 0&&t.addIssue({code:`custom`,path:[`nextCursor`],message:`nextCursor is required when truncated is true`}),!e.truncated&&e.nextCursor!==void 0&&t.addIssue({code:`custom`,path:[`nextCursor`],message:`nextCursor must be omitted when truncated is false`})}var Gl=I({available:H(!0),source:Pl,candidates:F(Fl),truncated:P(),nextCursor:Nl.optional()}).strict().superRefine(Wl),Kl=I({available:H(!0),items:F(zl),truncated:P(),nextCursor:Nl.optional()}).strict().superRefine(Wl),ql=I({available:H(!0),item:zl}).strict(),Jl=I({available:H(!0),association:Il}).strict(),Yl=z(`code`,[Vl,Hl]),Xl=z(`code`,[Vl,Ul]);z(`available`,[Gl,Yl]),z(`available`,[Kl,Yl]),z(`available`,[ql,Xl]),z(`available`,[Jl,Xl]),z(`available`,[Gl,Vl]);var Zl=z(`available`,[Kl,Vl]);z(`available`,[ql,Vl]),I({association:Il.nullable()}).strict(),I({cleared:H(!0)}).strict(),I({error:j()}).strict();var Ql=j().trim().min(1).max(256),$l=Nl.optional(),eu=U().int().min(1).max(100).default(50),tu=V([`0`,`1`]).optional(),nu=V([`active`,`all`]),ru=F(Ml).max(20),iu=j().transform((e,t)=>{let n;try{n=JSON.parse(e)}catch{return t.addIssue({code:`custom`,message:`labels must be a JSON array of strings`}),Xe}let r=ru.safeParse(n);return r.success?r.data:(t.addIssue({code:`custom`,message:`labels must be a JSON array of 0 to 20 nonempty strings`}),Xe)});I({kind:Al,q:Ql.optional(),cursor:$l,limit:eu});var au=j().max(4096).optional();I({expectedScope:au}),I({expectedScope:au,cursor:$l,limit:eu,refresh:tu,state:nu.default(`active`),labels:iu.optional()}),I({expectedScope:au,cursor:$l,limit:eu,refresh:tu,state:nu.default(`all`),labels:iu.optional(),q:Ql});var ou=[`association`,`candidates`,`search`,`connection`];I({id:j().min(1).max(256).regex(/^[^/]+$/,`id must be one path segment`).refine(e=>!ou.includes(e),`id is reserved by a static route`)});var su=I({project:j().min(1)}).strict();I({association:Il}).strict();var cu=j().trim().min(1).max(8192);z(`kind`,[I({kind:H(`jira`),origin:j().max(512).regex(/^https:\/\/[a-z0-9][a-z0-9-]*\.atlassian\.net\/?$/i,`Use an HTTPS Jira Cloud site origin`),email:ss().max(320),token:cu}).strict(),I({kind:H(`linear`),key:cu}).strict()]),I({connection:I({id:us(),kind:Al}).strict().nullable(),demo:P(),error:j().optional()}).strict(),I({association:Il,query:j().trim().max(256),state:nu,labels:F(j().trim().min(1).max(256)).max(20)}).strict(),I({watchId:us()}),I({after:U().int().nonnegative().optional()});var lu=I({id:us(),topic:j()}).strict(),uu=I({version:N().int().nonnegative()}).strict(),du=I({version:N().int().nonnegative(),checking:P(),checkedAt:yc().nullable(),result:Zl.nullable()}).strict(),fu=I({number:N().int().positive(),url:j().url().optional(),origin:V([`created`,`marker`,`legacy`,`derived`]),at:j()}),pu=V([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),mu=V([`monitoring`]),hu=V([`pending`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`,`skipped`]),q=N().finite().nonnegative(),gu=I({id:j(),name:j(),kind:V([`agent`,`check`]),status:hu,iterations:N(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),usageInvocationsStarted:q.optional(),usageInvocationsObserved:q.optional(),usageTurnsStarted:q.optional(),usageTurnsRecorded:q.optional(),usageInvocationEpoch:q.optional(),startedAt:j().optional(),finishedAt:j().optional(),error:j().optional(),sessionId:j().optional(),backend:W.optional(),profileId:j().optional(),modelIdentity:j().optional(),costUsd:N().optional()}),_u=I({adds:N(),dels:N(),files:N(),repointed:P().optional()}),vu=I({id:j(),text:j(),images:F(j()).optional(),createdAt:j()}),yu=I({cpuPct:N(),rssBytes:N(),procCount:N()}),bu=I({id:j(),title:j(),titleSummary:j().optional(),diffStat:_u.optional(),workflow:j(),task:j(),queuedMessages:F(vu).optional(),taskImages:F(j()).optional(),model:j().optional(),modelIdentity:j().optional(),runner:W.optional(),agentProfile:j().optional(),systemPrompt:j().optional(),generateFollowups:P().optional(),autonomous:P().optional(),automation:I({automationId:j(),automationRevision:N(),receiptId:j(),event:j(),githubUrl:j()}).optional(),automationTrigger:I({automationId:j(),automationRevision:N(),receiptId:j(),trigger:V([`schedule`,`catch-up`,`manual`]),occurrenceAt:j()}).optional(),automationTracker:I({automationId:j(),automationRevision:N(),receiptId:j(),provider:V([`jira`,`linear`]),association:Il.optional(),eventId:j().optional(),event:Ll.optional(),timestamp:j().optional(),change:I({fromId:j().optional(),toId:j().optional(),labelId:j().optional(),labelName:j().optional()}).optional(),key:j(),url:j()}).optional(),dispatch:kl.optional(),status:pu,activity:mu.optional(),monitoringWakeAt:j().optional(),monitoringWakeCapReached:P().optional(),autoResumeAt:j().optional(),autoResumeAttempts:N().optional(),awaitingAnswerSince:j().optional(),prHead:I({number:N(),repo:j(),headRepo:j(),headRef:j(),headSha:j(),baseRef:j(),ref:j()}).optional(),untrustedHead:P().optional(),createdAt:j(),startedAt:j().optional(),finishedAt:j().optional(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),costUsd:N().optional(),pullRequestUrl:j().optional(),referencedPullRequestUrl:j().optional(),prNumber:N().optional(),prRefs:F(fu).max(8).optional(),issueNumber:N().optional(),referencedIssueNumberSeeded:P().optional(),titleOrigin:V([`user`,`auto`,`marker`]).optional(),markerRefs:I({pr:N().optional(),issue:N().optional()}).optional(),referencedPrCandidates:F(j()).optional(),referencedIssueUrl:j().optional(),referencedIssueCandidates:F(j()).optional(),worktree:H(!1).optional(),worktreePath:j().optional(),worktreeLifecycle:Fc.optional(),branch:j().optional(),inPlaceBranch:H(!0).optional(),baseBranch:j().optional(),worktreeReclaimedAt:j().optional(),groupId:j().optional(),variant:j().optional(),peakRssBytes:N().optional(),peakProcCount:N().optional(),archived:P(),archivedAt:j().optional(),pinned:P().optional(),pinnedAt:j().optional(),seenAt:j().optional(),lastSeq:N().int().nonnegative().optional(),currentStepId:j().optional(),error:j().optional(),steps:F(gu),workflowDef:Cl.optional(),graphState:I({loops:B(j(),N()),taken:F(j()),cursor:j().optional(),outputs:B(j(),B(j(),R([j(),N()]))).optional()}).optional()});bu.extend({usage:yu.optional()});var xu=I({worktreeLifecycle:Fc.optional(),projectId:j(),id:j(),title:j(),titleSummary:j().optional(),titleOrigin:V([`user`,`auto`,`marker`]).optional(),status:pu,activity:mu.optional(),createdAt:j(),finishedAt:j().optional(),seenAt:j().optional(),archived:P(),autoResumeAt:j().optional(),awaitingAnswerSince:j().optional(),workflow:j(),branch:j().optional(),dispatch:kl.pick({rootRunId:!0,parentRunId:!0,kind:!0}).optional(),automationId:j().optional(),startedAt:j().optional(),lastActivityAt:j(),pullRequestUrl:j().optional(),referencedPullRequestUrl:j().optional(),referencedPrCandidates:F(j()).optional(),prNumber:N().optional(),prRefs:F(fu).max(8).optional(),issueNumber:N().optional(),referencedIssueUrl:j().optional(),referencedIssueCandidates:F(j()).optional(),markerRefs:I({pr:N().optional(),issue:N().optional()}).optional(),costUsd:N().optional(),peakRssBytes:N().optional(),peakProcCount:N().optional(),usage:yu.optional()}),Su=B(j(),I({prs:B(N(),Xc),issues:B(N(),Xc)}));I({runs:F(xu),referenceStatuses:Su,perProjectLimit:N(),truncated:F(j())}),R([bu,I({runs:F(bu)})]),I({cancelled:P()}),I({cancelled:H(!0)}),I({archived:N()}),I({read:N()}),I({deleted:H(!0)}),I({finished:H(!0)}),I({continued:H(!0)}),I({url:j(),dryRun:P()}),z(`found`,[I({found:H(!0),url:j()}),I({found:H(!1)})]),R([I({delivered:H(!0)}),I({queued:H(!0),message:vu}),I({deferred:H(!0)})]),I({message:vu}),I({removed:H(!0)}),I({opened:H(!0),command:j()}),I({removed:H(!0)}),I({committed:H(!0),sha:j()}),I({pushed:H(!0),branch:j(),remote:j(),upstreamSet:P()}),I({uncommitted:N(),unpushed:N().nullable(),behind:N().nullable(),ahead:N().nullable()}),I({commits:F(I({sha:j(),subject:j(),author:j(),when:j()}))});var Cu=I({id:j(),variant:j(),title:j(),status:pu,archived:P(),tokensUsed:N(),inputTokens:q.optional(),outputTokens:q.optional(),costUsd:N().optional(),diffStat:j(),handoffExcerpt:j()});I({groupId:j(),runs:F(Cu)}),I({winner:bu.optional()});var wu=`application/octet-stream`,Tu=[`text/plain`,`text/markdown`,`text/x-markdown`,`application/pdf`,wu];function Eu(e){return/^image\//.test(e)}function Du(e){return Eu(e)||Tu.includes(e)}function Ou(e){return/png/.test(e)?`png`:/jpe?g/.test(e)?`jpg`:/webp/.test(e)?`webp`:/gif/.test(e)?`gif`:e===`application/pdf`?`pdf`:e===`text/plain`?`txt`:e===`text/markdown`||e===`text/x-markdown`?`md`:e===`application/octet-stream`?`bin`:`img`}var ku=new Set([`png`,`jpg`,`jpeg`,`webp`,`gif`,`img`]);function Au(e){let t=e.split(`.`).pop()?.toLowerCase();return t!==void 0&&ku.has(t)}var ju=I({mediaType:j().refine(Du,{message:`unsupported attachment type — send other files as application/octet-stream`}),data:j().min(1).max(7e6),name:j().max(255).optional()}),Mu=/^[a-f0-9]{24}$/,Nu=R([ju,I({uploadId:j().regex(Mu,`invalid upload id`),name:j().max(255).optional()}).strict()]),Pu=`attachment upload expired — attach the file again`,Fu=28e6,Iu=F(Nu).max(20).refine(e=>e.reduce((e,t)=>e+(`data`in t?t.data.length:0),0)<=Fu,{message:`attachments too large — 20 MB in total per message`});I({uploadId:j(),mediaType:j(),bytes:N()}),I({uploadId:j().regex(Mu,`invalid upload id`)}),I({deleted:H(!0)});var Lu=I({workflow:j().min(1).optional(),steps:F(gl).min(1).max(8).optional(),task:j().max(1e5,`must be at most 100000 characters`),model:j().optional(),runner:W.optional(),agentProfile:j().max(64).optional(),variants:N().int().min(1).max(3).optional(),worktree:P().optional(),newBranch:P().optional(),branch:j().trim().min(1).max(200).optional(),autonomous:P().optional(),generateFollowups:P().optional(),systemPrompt:j().trim().max(2e4,`must be at most 20000 characters`).optional().transform(e=>e||void 0),images:Iu.optional(),todoId:j().min(1).max(200,`must be at most 200 characters`).optional(),dispatch:Ol.optional()});function Ru(e){return e.task.trim()!==``||(e.images?.length??0)>0}Lu.refine(e=>!!e.workflow!=!!e.steps,{message:`provide either "workflow" or "steps", not both`}).refine(Ru,{message:`describe the task or attach a file`,path:[`task`]}),I({text:j().max(1e5).default(``),images:Iu.default([])}).refine(e=>e.text.trim().length>0||e.images.length>0,{message:`message needs text or at least one attachment`}),I({title:j().trim().min(1).max(300).optional(),task:j().trim().min(1).max(1e5).optional()});var zu=1e5,Bu=20,Vu=j().regex(/^(composer|review-notes|diff-comments|design-picks|task-prompt|title|message:[A-Za-z0-9_-]{1,64})$/,`unknown draft surface`),Hu=/^[A-Za-z0-9_-]{1,64}$/,Uu=I({id:j(),mediaType:j(),name:j(),bytes:N()}),Wu=I({text:j(),images:F(Uu),updatedAt:j()});I({surfaces:B(j(),Wu)}),I({text:j().max(zu,`must be at most ${zu} characters`).default(``),images:F(j().regex(Hu,`invalid image id`)).max(Bu).default([])}),ju.extend({name:j().trim().max(200).default(`image`)}),Uu.extend({data:j()}),I({id:j().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/),surface:Vu}).extend({imageId:j().regex(Hu,`invalid image id`)}),I({deleted:H(!0)});var Gu=I({status:j(),path:j()}),Ku=I({hash:j(),subject:j(),author:j(),when:j()});R([I({info:Ns(),status:F(zs()),log:F(zs()),branches:F(zs()),checkedOutElsewhere:B(j(),zs()),baseBranch:Ns()}),I({info:Tc,status:F(Gu),log:F(Ku),branches:F(j()),checkedOutElsewhere:B(j(),j()),baseBranch:j().nullable()})]),I({branch:j(),created:P()});var qu=I({name:j(),upstream:j().nullable(),ahead:N().nullable(),behind:N().nullable(),gone:P()}),Ju=I({branch:j().nullable(),upstream:j().nullable(),ahead:N().nullable(),behind:N().nullable(),outgoing:F(j()),incoming:F(Ku),pushRemote:j().nullable(),lastFetchedAt:j().nullable(),branches:F(qu)});I({message:j(),sync:Ju});var Yu=I({adds:N(),dels:N(),files:N()}),Xu=I({path:j(),oldPath:j().optional(),status:V([`added`,`modified`,`deleted`,`renamed`,`copied`]),adds:N(),dels:N(),binary:P(),image:P().optional(),patch:j()});I({files:F(Xu),stat:Yu,repointedHead:I({headBranch:j(),taskBranch:j()}).optional()}),I({sha:j(),subject:j(),author:j(),when:j(),files:F(Xu),stat:Yu});var Zu=I({name:j(),type:V([`dir`,`file`]),size:N().optional()});z(`type`,[I({type:H(`dir`),path:j(),entries:F(Zu)}),I({type:H(`file`),path:j(),size:N(),binary:P(),tooLarge:P(),content:j().optional()})]),I({paths:F(j()),truncated:P()}),I({path:j().min(1),raw:V([`0`,`1`]).optional()});var Qu=V([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]);I({worktrees:F(I({runId:j(),title:j(),status:Qu,branch:j().nullable(),sizeBytes:N().nullable(),finishedAt:j().nullable(),reclaimable:P()})),totalBytes:N().nullable(),keep:N()}),I({reclaimed:F(j())});var $u=I({id:j(),name:j(),root:j(),addedAt:j(),lastOpenedAt:j(),source:V([`local`,`checkout`]),status:V([`ok`,`missing`,`not-git`]),branch:j().optional(),forge:H(`github`).optional(),repoUrl:j().optional(),tracker:Al.optional(),maxParallel:N().optional(),unregistered:H(!0).optional(),notAddable:H(!0).optional(),tags:F(j()).optional()});I({projects:F($u),bootProject:j(),projectsDir:j()}),I({project:$u,error:j().optional()}),I({removed:H(!0),id:j()}),I({project:$u}),I({maxParallel:N().int().min(1).max(16).nullable().optional(),tags:F(j().trim().min(1).max(32)).max(20).nullable().optional()}).refine(e=>e.maxParallel!==void 0||e.tags!==void 0,`specify maxParallel or tags`),I({url:j().trim().min(1).max(512),name:j().trim().max(128).optional(),checkoutId:j().trim().max(128).optional()});var ed=/^(?!\.{1,2}$)[A-Za-z0-9._-]{1,100}$/;I({name:j().trim().regex(ed),github:I({owner:j().trim().min(1).max(64),template:j().trim().max(512).optional()}).optional(),checkoutId:j().trim().max(128).optional()});var td=I({login:j(),personal:P(),avatarUrl:j().optional(),description:j().optional()}),nd=z(`available`,[I({available:H(!0),owners:F(td)}),I({available:H(!1),reason:j()})]),rd=I({name:j(),path:j(),isRepo:P()});I({path:j(),parent:j().nullable(),dirs:F(rd),truncated:P()}),I({key:j()});var id=V([`session`,`changes`,`commits`,`files`,`browser`,`graph`,`terminal`]),ad=2048,od=I({tabs:F(j().max(ad)).max(12),active:N().int().min(0).max(11)}),sd=I({view:id,width:N().finite().min(0).max(100),browser:od.optional()});I({layouts:I({layouts:F(I({name:j().min(1).max(80),columns:F(sd).max(3)})).max(50),active:j().max(80)}).nullable()});var cd=I({name:j().trim().min(1).max(80),columns:F(I({view:id,width:N().finite().min(0).max(100)})).min(1).max(3)});I({branding:I({name:j(),logoUrl:j().nullable()}),browseRoot:j(),projectsDir:j(),skillsAutoUpdate:P().nullable(),effectiveSkillsAutoUpdate:P(),composerDefaults:I({autonomous:P().nullable(),worktree:P().nullable(),inheritedAutonomous:R([P(),H(`source-dependent`)]),inheritedWorktree:P()}),resources:I({maxParallel:N(),maxMonitoringSessions:N(),idleTimeoutMinutes:N().nullable(),monitoringWakeIntervalMinutes:N().nullable(),autoResumeOnUsageLimit:P(),memoryLimitMb:N().nullable(),worktreeRetentionDefault:N()}),agentDefaults:I({runner:W.optional(),models:I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),junie:j().optional(),copilot:j().optional()}).optional()})}),I({branding:I({name:j().trim().min(1).max(80).nullable().optional()}).optional(),browseRoot:j().trim().min(1).max(4096).optional(),projectsDir:j().trim().min(1).max(4096).optional(),skillsAutoUpdate:P().nullable().optional(),composerDefaults:I({autonomous:P().nullable().optional(),worktree:P().nullable().optional()}).optional(),agentDefaults:I({runner:W.nullable().optional(),models:I({claude:j().trim().min(1).max(200).nullable().optional(),codex:j().trim().min(1).max(200).nullable().optional(),opencode:j().trim().min(1).max(200).nullable().optional(),junie:j().trim().min(1).max(200).nullable().optional(),cursor:j().trim().min(1).max(200).nullable().optional(),pi:j().trim().min(1).max(200).nullable().optional(),copilot:j().trim().min(1).max(200).nullable().optional()}).optional()}).optional(),resources:I({maxParallel:N().int().min(1).max(16).optional(),maxMonitoringSessions:N().int().min(0).max(16).optional(),idleTimeoutMinutes:N().int().min(0).max(1440).nullable().optional(),monitoringWakeIntervalMinutes:N().int().min(1).max(60).nullable().optional(),autoResumeOnUsageLimit:P().optional(),memoryLimitMb:N().int().min(0).max(1048576).nullable().optional(),worktreeRetentionDefault:N().int().min(0).max(1e3).optional()}).optional()});var ld=I({logoUrl:j().nullable()}),ud=I({accent:V([`lime`,`violet`]).optional(),density:V([`comfortable`,`compact`,`ultra`]).optional(),width:V([`narrow`,`wide`]).optional()}),dd=L({expandedColumns:B(j(),P()).optional()});L({lastTask:I({source:V([`workflow`,`skill`]),ref:j()}).nullable().optional(),recentSources:F(I({source:V([`workflow`,`skill`]),ref:j()})).optional(),lastWorktree:P().optional(),lastAutonomous:P().optional(),lastGenerateFollowups:P().optional(),importedSkills:F(j().min(1).max(200)).max(200).optional(),skillUsage:B(j(),N()).optional(),runsView:V([`list`,`table`]).optional(),githubView:V([`issues`,`prs`]).optional(),githubSort:V([`newest`,`oldest`]).optional(),appearance:ud.optional(),promptTemplates:F(I({id:j(),label:j(),text:j(),skills:F(j()).optional()})).optional(),dismissedSkillsBanner:P().optional()});var fd=2e4,pd=Hs({projectId:j().min(1).max(64),pathname:j().min(1).max(2048).startsWith(`/p/`),search:j().max(4096).startsWith(`?`).optional(),hash:j().max(2048).startsWith(`#`).optional()}),md=new Set([`fleet`,`needsYou`,`recent`,`usage`,`trends`,`overview`,`portfolio`,`automations`]),hd=F(j().min(1).max(64)).max(200+md.size).refine(e=>e.filter(e=>!md.has(e)).length<=200,`Too many unknown dashboard tiles`).refine(e=>new Set(e).size===e.length,`Duplicate dashboard tile`),gd=L({order:hd.optional(),tiles:L({automations:P().optional(),fleet:P().optional(),needsYou:P().optional(),recent:P().optional(),usage:P().optional(),trends:P().optional()}).optional()}),_d=L({order:hd.catch([]).optional(),tiles:L({automations:P().catch(!0).optional(),fleet:P().catch(!0).optional(),needsYou:P().catch(!0).optional(),recent:P().catch(!0).optional(),usage:P().catch(!0).optional(),trends:P().catch(!0).optional()}).catch({}).optional()}).catch({}),vd=L({dashboard:_d.optional(),sidebar:L({collapsed:B(j(),P()).optional(),projectOrder:F(j()).optional()}).optional(),dismissedProviderAuthFailures:I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),junie:j().optional(),copilot:j().optional()}).optional(),appearance:ud.optional(),notifications:L({enabled:P().optional()}).optional(),taskTable:dd.optional(),keybindings:B(j(),j().nullable()).optional(),lastLocation:pd.optional(),importedSkills:F(j()).optional(),savedLayouts:F(cd).catch([]).optional()}),yd=200,bd=50;L({...vd.shape,dashboard:gd.optional(),sidebar:L({collapsed:B(j().min(1).max(64),P()).refine(e=>Object.keys(e).length<=yd,{message:`sidebar.collapsed must have at most ${yd} entries`}).optional(),projectOrder:F(j().min(1).max(64)).max(yd).optional()}).optional(),dismissedProviderAuthFailures:Hs({claude:j().min(1).max(128).optional(),codex:j().min(1).max(128).optional(),opencode:j().min(1).max(128).optional(),pi:j().min(1).max(128).optional(),junie:j().min(1).max(128).optional(),copilot:j().min(1).max(128).optional()}).optional(),importedSkills:F(j().min(1).max(200)).max(yd).optional(),savedLayouts:F(cd).max(50).optional(),keybindings:B(j().min(1).max(120),j().min(1).max(40).nullable()).refine(e=>Object.keys(e).length<=yd,{message:`keybindings must have at most ${yd} entries`}).optional(),taskTable:dd.extend({expandedColumns:B(j().min(1).max(64),P()).refine(e=>Object.keys(e).length<=bd,{message:`taskTable.expandedColumns must have at most ${bd} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>yd&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${yd})`})});var xd=I({claude:j().optional(),codex:j().optional(),junie:j().optional(),opencode:j().optional(),cursor:j().optional(),pi:j().optional(),copilot:j().optional()});I({worktreeLifecycle:Pc.optional(),worktreeLifecycleRevision:j().optional(),baseBranch:j().nullable(),defaultRunner:W,systemPrompt:j().nullable(),branchNaming:j().nullable(),defaultModels:xd,modelsLocked:P(),maxParallel:N(),memoryLimitMb:N().nullable(),worktreeRetention:N(),liveTitleUpdates:P().nullable(),reviewGate:P().nullable()}),I({worktreeLifecycle:Pc.nullable().optional(),worktreeLifecycleRevision:j().nullable().optional(),baseBranch:j().trim().min(1).max(200).nullable().optional(),defaultRunner:W.optional(),systemPrompt:j().trim().max(2e4).nullable().optional(),branchNaming:j().trim().max(4e3).nullable().optional(),defaultModels:I({claude:j().trim().max(200).nullable().optional(),codex:j().trim().max(200).nullable().optional(),opencode:j().trim().max(200).nullable().optional(),cursor:j().trim().max(200).nullable().optional(),pi:j().trim().max(200).nullable().optional(),copilot:j().trim().max(200).nullable().optional()}).optional(),defaultModelsAuto:I({claude:P().nullable().optional(),codex:P().nullable().optional(),opencode:P().nullable().optional(),pi:P().nullable().optional()}).optional(),maxParallel:N().int().min(1).max(16).optional(),memoryLimitMb:N().int().min(0).max(1048576).nullable().optional(),worktreeRetention:N().int().min(0).max(1e3).nullable().optional(),liveTitleUpdates:P().nullable().optional(),reviewGate:P().nullable().optional()});var Sd=V([`idle`,`checking`,`available`,`updating`,`current`,`unavailable`,`error`]),Cd=I({scope:V([`project`,`global`]),status:Sd,available:P(),skills:F(j()),checkedAt:j().nullable(),updatedAt:j().nullable(),reason:j().optional()});I({status:Sd,available:P(),autoUpdateEnabled:P(),inherited:P(),checkedAt:j().nullable(),updatedAt:j().nullable(),scopes:F(Cd),needsUpgradeNotes:P()});var wd=W,Td=I({provider:wd,status:V([`connected`,`disconnected`,`not-installed`,`unknown`]),enabled:P().optional(),hint:j().optional(),authFailureId:j().optional(),profileId:j().optional()});I({providers:F(Td)}),z(`opened`,[I({opened:H(!0),command:j()}),I({opened:H(!1),connected:H(!0),command:j()})]),I({opened:H(!0),command:j()});var Ed=V([`claude`,`codex`,`opencode`,`cursor`,`junie`]).options;function Dd(e){return Ed.includes(e)}I({runner:W,models:F(I({id:j(),label:j(),description:j()})),source:V([`live`,`cache`,`unavailable`]),stale:P(),reason:j().optional()}),I({targets:F(I({id:j(),label:j(),icon:j().optional()}))}),I({target:j().trim().min(1,`target required`).max(200)}),I({opened:H(!0),path:j()}),I({name:j(),description:j().optional(),interactive:H(!0).optional(),body:j(),path:j(),source:V([`ai`,`cezar`,`agents`,`global`,`team`,`builtin`]),team:I({repo:j(),ref:j(),path:j(),dir:P(),commit:j().optional()}).optional()}),I({id:j(),ts:j().optional(),taskId:j().optional(),summary:j().min(1),action:j().optional(),prUrl:j().optional(),suggestedSkill:j().optional(),suggestedArgs:j().optional(),suggestedPrompt:j().optional(),runnable:P().optional(),startedTaskId:j().optional()}),I({removed:H(!0)}),I({run:bu});var Od=V([`json`,`jsonc`,`toml`,`markdown`]),kd=V([`user`,`project`,`local`]),Ad=V([`settings`,`memory`,`mcp`]),jd=V([`tracked`,`gitignored`,`outside-repo`]),Md=I({id:j(),runners:F(W),kind:Ad,scope:kd,label:j(),path:j(),format:Od,tracked:jd,seeded:P(),holdsMcp:P(),private:P(),precedence:j(),hotReload:j().optional(),docsUrl:j(),exists:P(),size:N(),version:j().nullable(),writable:P(),readOnlyReason:j().optional()}),Nd=I({path:j(),servers:F(j()),readable:P()});I({editable:P(),files:F(Md),userMcp:Nd.nullable()}),I({id:j(),path:j(),exists:P(),content:j(),version:j().nullable()}),I({content:j().max(2e6),version:j().nullable()});var Pd=`default`,Fd=I({id:j(),label:j(),path:j(),exists:P()}),Id=I({id:j(),provider:wd,label:j(),configDir:j(),path:j(),exists:P(),looksValid:P(),isDefault:P(),status:Td.optional(),files:F(Fd)});function Ld(e){return e.isDefault?`default:${e.provider}`:e.id}var Rd=I({claude:j().optional(),codex:j().optional(),opencode:j().optional(),junie:j().optional(),cursor:j().optional(),pi:j().optional(),copilot:j().optional()});I({editable:P(),profiles:F(Id),profileCapableProviders:F(wd),selections:B(j(),Rd),defaults:Rd}),I({projectId:j().min(1).max(64).nullable(),provider:wd,profileId:j().max(64).nullable()}),I({selections:B(j(),Rd),defaults:Rd}),I({status:Td}),I({available:P(),reason:j().optional(),fields:F(I({label:j(),value:j()}))}),I({file:j().min(1).max(200),target:j().min(1).max(64).optional()}),I({opened:H(!0),path:j()}),I({provider:wd,label:j().trim().max(200).optional(),configDir:j().trim().min(1).max(4096)}),I({profile:Id}),I({label:j().trim().max(200).optional(),configDir:j().trim().min(1).max(4096).optional()}),I({removed:H(!0),id:j()});var zd=new Map;function Bd(e){let t=zd.get(e);return t||(t=new Intl.DateTimeFormat(`en-CA`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),zd.set(e,t)),t}function Vd(e,t){try{let n=Bd(t).formatToParts(new Date(e)),r=e=>Number(n.find(t=>t.type===e)?.value),i=r(`year`),a=r(`month`),o=r(`day`);return{year:i,month:a,day:o,hour:r(`hour`)%24,minute:r(`minute`),second:r(`second`),weekday:Hd(i,a,o)}}catch{return null}}function Hd(e,t,n){return(new Date(Date.UTC(e,t-1,n)).getUTCDay()+6)%7+1}function Ud(e,t){let n=Vd(t,e);return n?Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-t:null}function Wd(e,t,n,r,i,a){let o=Date.UTC(e,t-1,n,r,i,0,0),s=o;for(let e=0;e<3;e+=1){let e=Ud(a,s);if(e===null)return null;let t=o-e;if(Math.abs(t-s)<1e3)return t;s=t}return s}var Gd=[`daily`,`weekdays`,`weekly`,`hours`],Kd=[1,2,3,4,6,8,12],qd=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],Jd=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],Yd=I({type:V(Gd),hour:N().int().min(0).max(23).optional(),minute:N().int().min(0).max(59).optional(),day:N().int().min(1).max(7).optional(),every:R([H(1),H(2),H(3),H(4),H(6),H(8),H(12)]).optional()});function Xd(e){return{type:e.type,hour:e.hour??4,minute:e.minute??0,day:e.day??1,every:e.every??6}}var Zd=e=>String(e).padStart(2,`0`);function Qd(e,t=0){return`${Zd(e)}:${Zd(t)}`}function $d(e){let t=Xd(e);switch(t.type){case`daily`:return`every day at ${Qd(t.hour,t.minute)}`;case`weekdays`:return`weekdays at ${Qd(t.hour,t.minute)}`;case`hours`:return t.every===1?`every hour`:`every ${t.every} hours`;case`weekly`:return`${Jd[t.day-1]}s at ${Qd(t.hour,t.minute)}`}}function ef(e){let t=Xd(e);switch(t.type){case`daily`:return`${t.minute} ${t.hour} * * *`;case`weekdays`:return`${t.minute} ${t.hour} * * 1-5`;case`hours`:return`0 */${t.every} * * *`;case`weekly`:return`${t.minute} ${t.hour} * * ${t.day%7}`}}function tf(e,t){switch(e.type){case`daily`:return[[e.hour,e.minute]];case`weekdays`:return t<=5?[[e.hour,e.minute]]:[];case`weekly`:return t===e.day?[[e.hour,e.minute]]:[];case`hours`:{let t=[];for(let n=0;n<24;n+=e.every)t.push([n,0]);return t}}}function nf(e,t,n,r,i=1e3){let a=Xd(e),o=Vd(t,r);if(!o||n<=t)return[];let s=[],c=Math.ceil((n-t)/864e5)+2;for(let e=-1;e<=c;e+=1){let c=new Date(Date.UTC(o.year,o.month-1,o.day+e)),l=c.getUTCFullYear(),u=c.getUTCMonth()+1,d=c.getUTCDate();for(let[e,o]of tf(a,Hd(l,u,d))){let a=Wd(l,u,d,e,o,r);if(a===null||a>=t&&a<n&&(s.push(a),s.length>=i))return s}}return s}function rf(e,t,n){let[r]=nf(e,t+1,t+9*864e5,n,1);return r??null}var af=V([`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`]),of=I({events:F(Ll).min(1).max(4),targetStatusIds:F(j().min(1)).max(100).optional(),changedLabelIds:F(j().min(1)).max(100).optional(),requiredLabels:F(j().trim().min(1).max(200)).max(100).optional(),association:Il});I({search:j().max(200).optional(),cursor:j().max(4096).optional()}),z(`available`,[I({available:H(!0),association:Il,events:F(Ll),limitations:F(j()),statuses:F(I({id:j(),name:j()})),labels:F(I({id:j(),name:j()})),nextCursor:j().optional()}),Vl]);var sf=I({authors:F(j()).optional(),assignees:F(j()).optional(),allLabels:F(j()).optional(),anyLabels:F(j()).optional(),excludeLabels:F(j()).optional(),changedLabels:F(j()).optional(),reviewers:F(j()).optional(),status:j().optional(),lookbackDays:N(),maxRecords:N()}),cf=V([`github`,`schedule`,`tracker`]),lf=I({maxSubtasks:N().int().min(1).max(50).optional(),reviewChild:P().optional()}),uf=Lu.omit({task:!0,images:!0,todoId:!0,systemPrompt:!0}).extend({prompt:j(),variants:R([H(1),H(2),H(3)]).optional(),systemPrompt:j().optional(),dispatch:lf.optional(),checkout:V([`base`,`pr-head`]).optional(),allowForkHeads:P().optional()}),df=I({id:j(),revision:N(),name:j(),description:j().optional(),enabled:P(),kind:cf,events:F(af).optional(),intervalSeconds:N().optional(),filters:sf.optional(),trackerTrigger:of.optional(),schedule:Yd.optional(),task:uf,createdAt:j(),updatedAt:j()}),ff=I({timestamp:j(),tieBreaker:j().optional()}),pf=I({revision:N().optional(),baselineAt:j().optional(),cursor:ff.optional(),checkpoint:j().optional(),frozenHighWatermark:ff.extend({tieBreaker:j()}).optional(),backlogAfter:ff.extend({tieBreaker:j()}).optional(),pinnedCursor:ff.optional(),nextCheckAt:j().optional(),lastSuccessAt:j().optional(),nextRunAt:j().optional(),lastRunAt:j().optional(),etags:B(j(),j()).optional(),backoffUntil:j().optional(),consecutiveFailures:N().optional()}),mf=V([`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`,`manual`,`catch-up`,`skipped`,`failed`]),hf=I({seq:N(),ts:j(),automationId:j(),revision:N(),event:R([af,Ll]).optional(),result:mf,reason:j().optional(),durationMs:N().optional(),receiptId:j().optional(),runId:j().optional(),trackerKey:j().optional(),trackerTitle:j().optional(),trackerUrl:j().optional(),githubNumber:N().optional(),githubTitle:j().optional(),githubUrl:j().optional(),rateLimit:I({bucket:V([`core`,`search`]),remaining:N().optional(),resetAt:j().optional()}).optional()}),gf=I({matches:N(),launched:N(),duplicates:N(),errors:N()}),_f=I({runId:j(),status:pu,ts:j(),costUsd:N().optional()}),vf=df.extend({state:pf.optional(),latestLog:hf.optional(),counts:gf,nextRunAt:j().optional(),lastRun:_f.optional(),runs7d:N(),costUsd7d:N().optional()}),yf=I({runs:N(),failed:N(),agentSeconds:N(),costUsd:N().optional()});I({available:P(),reason:j().optional(),scheduler:I({state:V([`scheduled`,`idle`]),nextDue:j().optional()}),timeZone:j(),stats:yf,automations:F(vf)}),I({automation:df}),I({automation:df,state:pf.optional(),latestLog:hf.optional()}),I({id:j(),automationId:j(),mode:V([`preview`,`execute`]),status:V([`queued`,`running`,`complete`,`error`]),createdAt:j(),completedAt:j().optional(),matches:N().optional(),truncated:P().optional(),error:j().optional()}),I({checkId:j()});var bf=I({title:j(),status:pu,costUsd:N().optional(),children:F(I({runId:j(),kind:Tl.optional(),title:j(),status:pu,costUsd:N().optional()}))});I({records:F(hf),runs:B(j(),bf)}),I({receiptId:j(),runId:j()}),I({runId:j()}),I({templates:F(I({project:I({id:j(),name:j()}),id:j(),name:j(),kind:V([`github`,`schedule`]),trackerTrigger:of.optional(),schedule:Yd.optional(),events:F(af).optional(),intervalSeconds:N().optional(),filters:sf.optional(),task:I({prompt:j(),workflow:j().optional(),steps:uf.shape.steps,runner:j().optional(),model:j().optional(),autonomous:P().optional(),dispatch:lf.optional(),checkout:uf.shape.checkout,allowForkHeads:uf.shape.allowForkHeads})}))}),df.omit({id:!0,revision:!0,createdAt:!0,updatedAt:!0,enabled:!0,kind:!0}).extend({kind:cf.optional(),enable:P().optional()}).omit({enable:!0}).extend({enabled:P().optional(),expectedRevision:N()}),I({mode:V([`preview`,`execute`])}),I({projectId:j().min(1).max(200)});var xf=vf.pick({id:!0,name:!0,kind:!0,enabled:!0,nextRunAt:!0}).extend({state:pf.pick({backoffUntil:!0,consecutiveFailures:!0}).optional()}),Sf=I({timeZone:j(),automations:F(xf)}),J=N().int().nonnegative(),Y=yc(),Cf=xu.omit({usage:!0}),wf=I({projects:F(I({projectId:j(),state:V([`complete`,`partial`,`unavailable`]),omittedRuns:J,reason:j().optional()}))}),Tf=I({running:J,monitoring:J,questions:J,reviews:J,queued:J,scheduled:J}),Ef=I({rows:F(Cf).max(20),total:J,nextOffset:J.nullable()}),Df=I({snapshotId:j().min(1),asOf:Y,expiresAt:Y,coverage:wf,counts:Tf,questions:Ef,reviews:Ef}),Of=V([`running`,`queued`,`scheduled`,`questions`,`reviews`,`needs-you`]);I({snapshotId:j().min(1).max(128),group:Of,offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var kf=I({snapshotId:j(),asOf:Y,coverage:wf,page:Ef});I({error:H(`Dashboard changed; refresh the list`),code:H(`snapshot-expired`)});var Af=I({projectId:j(),runId:j(),sampledAt:Y,cpuPct:N().nonnegative().nullable(),rssBytes:J,procCount:J}),jf=I({asOf:Y,samples:F(Af)}),Mf=z(`kind`,[I({kind:H(`task-result`),key:j().min(1),at:Y,run:Cf}),I({kind:H(`github-created`),key:j().min(1),at:Y,repo:j(),projectIds:F(j()),itemKind:V([`issue`,`pr`]),number:N().int().positive(),title:j(),url:fs().refine(e=>/^https?:\/\//.test(e),`Expected an HTTP(S) URL`)})]),Nf=I({key:j().min(1),state:V([`ready`,`stale`,`unavailable`]),fetchedAt:Y.optional(),truncated:P(),reason:j().optional()}),Pf=V([`all`,`tasks`,`github`]);I({filter:Pf.default(`all`)});var Ff=I({asOf:Y,windowStart:Y,filter:Pf,rows:F(Mf).max(60),sources:F(Nf),coverage:wf,truncated:P()}),If=I({project:j(),usage:B(j(),yu),samples:F(Af).optional(),sentAt:Y.optional()}),Lf=N().int().nonnegative(),Rf=N().finite().nonnegative(),zf=V([`all`,`7d`,`30d`]),Bf=V([`cost`,`input`,`output`]),Vf=I({tokens:P(),cost:P()}),Hf=I({value:Rf.nullable(),reportedTasks:Lf}),Uf=I({tasks:Lf,inputTokens:Hf.optional(),outputTokens:Hf.optional(),costUsd:Hf.optional()}),Wf=I({projectId:j(),id:j(),title:j(),status:pu,awaitingAnswerSince:j().optional(),archived:P(),subtask:P(),createdAt:j(),startedAt:j().optional(),finishedAt:j().optional(),inputTokens:Rf.optional(),outputTokens:Rf.optional(),costUsd:Rf.optional()}),Gf=I({date:j(),tasks:Lf,inputTokens:Hf.optional(),outputTokens:Hf.optional(),costUsd:Hf.optional(),completed:Lf,cycleReportedTasks:Lf.optional(),avgCycleHours:N().finite().nonnegative().nullable(),medianCycleHours:N().finite().nonnegative().nullable()}),Kf=Uf.extend({projectId:j()});I({period:zf.default(`all`),sort:Bf.default(`cost`),projectId:j().min(1).max(128).optional(),snapshotId:j().min(1).max(128).optional(),tzOffsetMinutes:U().int().min(-840).max(720).optional(),offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var qf=I({snapshotId:j().min(1),asOf:yc(),expiresAt:yc(),scope:H(`retained-task-lifetime`),period:zf,windowStart:yc().nullable(),tzOffsetMinutes:N().int().min(-840).max(720).optional(),sort:Bf,visibility:Vf,coverage:wf,invalidDateTasks:Lf,totals:Uf,series:F(Gf).max(31),projects:F(Kf),tasks:I({rows:F(Wf).max(20),total:Lf,nextOffset:Lf.nullable()})}),Jf=N().int().nonnegative(),Yf=V([`running`,`needs-you`,`completed`,`failed`]);I({period:V([`7d`,`30d`]).default(`7d`),tzOffsetMinutes:U().int().min(-840).max(720).default(0),snapshotId:j().min(1).max(128).optional(),projectId:j().min(1).max(128).optional(),group:Yf.default(`completed`),offset:U().int().nonnegative().max(2**53-1).default(0),limit:U().int().min(1).max(20).default(20)});var Xf=I({running:Jf,needsYou:Jf,completed:Jf,failed:Jf,timedTasks:Jf,medianCycleHours:N().finite().nonnegative().nullable()}),Zf=Cf.pick({projectId:!0,id:!0,title:!0,titleSummary:!0,status:!0,archived:!0,createdAt:!0,startedAt:!0,finishedAt:!0}),Qf=I({snapshotId:j(),asOf:yc(),windowStart:yc(),period:V([`7d`,`30d`]),coverage:wf,metrics:Xf,projects:F(Xf.extend({projectId:j()})),page:I({rows:F(Zf).max(20),total:Jf,nextOffset:Jf.nullable()})}),X=N().int().nonnegative(),$f=yc();I({period:V([`7d`,`30d`]).default(`7d`),tzOffsetMinutes:U().int().min(-840).max(720).default(0)});var ep=I({completedTasks:X,prsOpened:X,prsTouched:X,issues:X,additions:X,deletions:X,files:X,measuredTasks:X}),tp=I({category:V([`usage-limit`,`auth`,`agent-unavailable`,`timeout`,`check`,`git`,`other`]),label:j(),count:X,latest:I({projectId:j(),id:j(),title:j(),at:$f,step:j().optional(),message:j().max(240)})}),np=I({backend:j(),model:j().optional(),finished:X,done:X,failed:X,timedTasks:X,medianCycleHours:N().finite().nonnegative().nullable(),costUsd:Hf.optional()}),rp=I({projectId:j(),automationId:j(),tasks:X,done:X,failed:X,active:X,lastRunAt:$f.optional(),lastStatus:pu.optional(),costUsd:Hf.optional()}),ip=I({asOf:$f,windowStart:$f,period:V([`7d`,`30d`]),visibility:Vf,coverage:wf,delivered:ep,failures:I({total:X,reasons:F(tp).max(8)}),backends:F(np),automations:F(rp)}),ap=I({source:V([`cgroup-v2`,`cgroup-v1`]),cpuQuotaCores:N().positive().optional(),cpuAffinityCores:N().positive().optional(),memLimitBytes:N().positive().optional(),memUsedBytes:N().nonnegative().optional(),cpuPct:N().min(0).max(100).optional()}),op=I({sampledAt:j(),cpuPct:N().min(0).max(100).optional(),cpuCount:N().int().positive(),memTotalBytes:N().nonnegative(),memUsedBytes:N().nonnegative(),memAvailableBytes:N().nonnegative(),swapTotalBytes:N().nonnegative().optional(),swapUsedBytes:N().nonnegative().optional(),loadAvg:I({one:N(),five:N(),fifteen:N()}).optional(),container:ap.optional(),hostCpuCount:N().int().positive().optional(),cgroupProbe:V([`unavailable`,`unconstrained`]).optional()}),sp=V([`stable`,`nightly`,`development`]),cp=V([`managed`,`global-npm`,`npx`,`checkout`,`unknown`]),lp=I({id:j(),version:j(),source:V([`registry`,`local`,`link`]),installedAt:j(),active:P(),branch:j().optional(),checkout:j().optional()}),up=I({version:j(),channel:V([`stable`,`nightly`,`preview`]),publishedAt:j().nullable(),installed:P()}),dp=I({status:V([`running`,`failed`,`restarting`]),target:j(),startedAt:j(),finishedAt:j().nullable(),log:F(j()),error:j().optional()}),fp=I({target:j(),requestedAt:j()});I({version:j(),installKind:cp,entry:j(),canSelfUpdate:P(),reason:j().optional(),channel:sp,restartMode:V([`reexec`,`supervisor`]),latest:I({stable:j().nullable(),nightly:j().nullable()}),updateAvailable:j().nullable(),checkedAt:j().nullable(),installed:F(lp),available:F(up),job:dp.nullable(),scheduled:fp.nullable(),activeRuns:N().int().min(0)}),I({version:j().min(1).max(64).regex(/^[0-9A-Za-z.+-]+$/,`version must be a plain version string`),whenIdle:P().optional()}).strict(),I({channel:sp}).strict();var pp=I({id:j(),title:j(),status:j()}),mp=I({id:j(),branch:j(),version:j(),worktree:j(),built:P(),linked:P(),commit:I({sha:j(),subject:j(),at:j()}).nullable(),builtAt:j().nullable(),stale:P(),task:pp.nullable(),pr:N().int().nullable()}),hp=I({number:N().int(),title:j(),author:j().nullable(),branch:j(),draft:P(),updatedAt:j(),url:j(),version:j().nullable(),publishedAt:j().nullable(),installed:P()});I({refresh:H(`1`).optional()}).strict(),I({checkouts:F(mp),pulls:I({available:P(),reason:j().optional(),repo:j(),items:F(hp)})}),I({consent:V([`unknown`,`granted`,`denied`]),policyVersion:N().int(),blockedBy:V([`env`,`automation`]).nullable(),endpoint:j()}),I({consent:V([`granted`,`denied`])});var gp=`p.new.tasks.changes.files.commits.compare.git.branches.log.github.prs.issues.tracker.skills.inbox.workflows.automations.dashboard.settings.global.agents.agent-config.worktrees.bookmarklets.prompt-templates.appearance.notifications.resources.accounts.projects.keyboard.graph.integrations.secrets.workflows-new.workspace-secrets.privacy`.split(`.`);I({route:j().max(64).refine(e=>e.startsWith(`/`)&&e.split(`/`).slice(1).every((e,t,n)=>e===``?n.length===1:e===`:param`||gp.includes(e)),{message:`a route shape: known segments and :param only`})});var _p=R([j().max(1024),N(),P(),Ns()]);I({type:j().max(128),message:j().max(2048),stack:j().max(16384).optional(),handler:j().max(64).optional(),code:j().max(128).optional(),fingerprint:j().max(128).optional(),context:B(j().max(64),_p).refine(e=>Object.keys(e).length<=32,{message:`at most 32 context keys`}).optional()});var vp=V([`new_task`,`bookmarklet`,`existing_session`,`ask_answer`,`git_step`,`review`,`github`,`tracker`,`inbox`,`skills_import`,`cli`]),yp=V([`new`,`clone`,`folder`]),bp=V([`1`,`2-4`,`5-10`,`11-20`]);function xp(e){return e<=1?`1`:e<=4?`2-4`:e<=10?`5-10`:`11-20`}V([`sidebar`,`tasks_table`,`all_tasks`,`task_view`,`palette`,`shortcut`]);var Sp=`reply.toggle-read.pin.archive.rename.end-session.accept.stop.delete.git:commit.git:commit-push.git:push.git:create-pr.git:create-draft-pr.git:update-branch.git:resolve-conflicts.git:fix-checks.open-pr.view:session.view:graph.view:changes.view:commits.view:files.view:browser.view:terminal.view:notes.tab.layout.layout:new.full-view.split.terminal.terminal-column.open.open:terminal-resume.copy:link.copy:branch.copy:path.copy:resume.copy:pr.copy:id`.split(`.`),Cp=V(Sp);function wp(e){return e.startsWith(`tab:`)?`tab`:e.startsWith(`layout:`)&&e!==`layout:new`?`layout`:e.startsWith(`open:`)&&e!==`open:terminal-resume`?`open`:Sp.includes(e)?e:void 0}var Tp=[`command`,`task`,`task_switch`],Ep=[`enter`,`cycle`,`tab`,`cmdk`,`cmdk_tab`],Dp=[`tasks`,`commands`,`files`,`pr_number`,`automation`],Op=[`command`,`actions`,`tasks`,`files`],kp=N().int().min(1).max(1e3).optional(),Ap=V([`recovered`,`not_applied`,`unreachable`,`timed_out`]);z(`event`,[I({event:H(`message_sent`),label:vp.exclude([`cli`])}),I({event:H(`diff_comment_added`),label:V([`single_line`,`multi_line`])}),I({event:H(`add_project_opened`),label:yp}),I({event:H(`attachments_sent`),label:bp}),I({event:H(`attachments_restaged`),label:V([`recovered`,`failed`])}),I({event:H(`skills_update_apply_dropped`),label:Ap}),I({event:H(`palette_opened`),label:V(Tp)}),I({event:H(`task_command_run`),label:Cp,value:kp}),I({event:H(`task_shortcut_used`),label:Cp,value:kp}),I({event:H(`task_switched`),label:V(Ep)}),I({event:H(`palette_mode_used`),label:V(Dp)}),I({event:H(`palette_dismissed`),label:V(Op)}),I({event:H(`shortcut_rebound`),label:Cp})]),I({available:P(),count:N().int().nonnegative().optional(),url:j()}),I({target:j().min(1).max(2048),parentOrigin:j().min(1).max(512)}),I({origin:j()});var jp=I({services:F(j().trim().min(1).max(500)).min(1).max(5),url:j().trim().max(2048).regex(/^https?:\/\/\S+$/,`an http:// or https:// address`).optional()}),Mp=V([`project`,`personal`]);I({project:jp.nullable(),personal:jp.nullable(),personalAvailable:P()}),I({scope:Mp,recipe:jp.nullable()});var Np=jp.extend({scope:Mp}),Pp=`e2e-setup`,Fp=[`AI_GATEWAY_API_KEY`,`OPENAI_API_KEY`,`ANTHROPIC_API_KEY`,`OPENROUTER_API_KEY`],Ip=V(Fp);I({configFile:j().nullable(),workflow:P(),credentials:F(Ip),setup:I({runId:j(),status:pu}).nullable()}),I({credential:I({name:Ip,value:j().min(1)}).strict().optional()}),I({runId:j()}),I({error:j()}).strict();var Lp=I({id:j(),runId:j(),cwd:j(),shell:j(),cols:N().int(),rows:N().int(),startedAt:j(),exitCode:N().int().nullable(),label:j(),busy:P().nullable(),topic:j()});I({available:P(),reason:j().optional(),sessions:F(Lp),shells:F(j()).optional()}),I({cols:N().int().min(1).max(500).optional(),rows:N().int().min(1).max(500).optional(),shell:j().min(1).max(512).optional()}),I({data:j().max(65536)}),I({cols:N().int().min(1).max(500),rows:N().int().min(1).max(500)}),I({cursor:U().int().min(0).optional()}),I({data:j(),cursor:N().int(),truncated:P(),exitCode:N().int().nullable()}),I({urls:F(I({url:j(),lastSeenAt:j(),running:P().nullable()}))}),I({commands:F(I({command:j(),source:j(),detail:j().optional()})),install:j().optional(),recipe:Np.optional()}),I({id:j(),sessionId:j()});var Rp=`/api/v1`,zp=``;function Bp(e){zp=e.replace(/\/+$/,``)}function Vp(){return zp}var Hp=null;function Up(e){Hp=e===``?null:e}function Wp(){return Hp}function Gp(){return Hp??`default`}var Kp=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function qp(e){return`${zp}${Rp}${Jp(e)}`}function Jp(e){return Hp===null||Kp.test(e)?e:`/p/${encodeURIComponent(Hp)}${e}`}var Yp=/^\/api(?:\/v1)?(\/.*)$/;function Xp(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=Zp(e.slice(r));return a===null?e:`${i}${a}`}let n=Zp(zp&&e.startsWith(zp)?e.slice(zp.length):e);return n===null?e:`${zp}${n}`}function Zp(e){let t=Yp.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${Rp}${n}`:`${Rp}${Jp(n)}`}var Z=e(t(),1),Qp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$p=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),em=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),tm=e=>{let t=em(e);return t.charAt(0).toUpperCase()+t.slice(1)},nm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},rm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},im=(0,Z.createContext)({}),am=()=>(0,Z.useContext)(im),om=(0,Z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=am()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,Z.createElement)(`svg`,{ref:c,...nm,width:t??l??nm.width,height:t??l??nm.height,stroke:e??f,strokeWidth:m,className:Qp(`lucide`,p,i),...!a&&!rm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,Z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),sm=(e,t)=>{let n=(0,Z.forwardRef)(({className:n,...r},i)=>(0,Z.createElement)(om,{ref:i,iconNode:t,className:Qp(`lucide-${$p(tm(e))}`,`lucide-${e}`,n),...r}));return n.displayName=tm(e),n},cm=e(n(),1),Q=r(),lm=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,um=i,dm=(e,t)=>n=>{if(t?.variants==null)return um(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=lm(t)||lm(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return um(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function fm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function pm(...e){return t=>{let n=!1,r=e.map(e=>{let r=fm(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():fm(e[t],null)}}}}function mm(...e){return Z.useCallback(pm(...e),e)}function hm(e){let t=Z.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wm(r)&&typeof Om==`function`&&(r=Om(r._payload)),Z.Children.forEach(r,e=>{if(Sm(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wm(n)&&typeof Om==`function`&&(n=Om(n._payload)),a=ym(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=Z.cloneElement(a,void 0,s):!o&&Z.Children.count(r)===1&&Z.isValidElement(r)&&(a=r);let c=a?xm(a):void 0,l=mm(n,c);if(!a){if(r||r===0)throw Error(o?Dm(e):Em(e));return r}let u=bm(i,a.props??{});return a.type!==Z.Fragment&&(u.ref=n?l:c),Z.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var gm=hm(`Slot`),_m=Symbol.for(`radix.slottable`);function vm(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=_m,t}var ym=(e,t)=>{if(`child`in e.props){let t=e.props.child;return Z.isValidElement(t)?Z.cloneElement(t,void 0,e.props.children(t.props.children)):null}return Z.isValidElement(t)?t:null};function bm(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function xm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Sm(e){return Z.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_m}var Cm=Symbol.for(`react.lazy`);function wm(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Cm&&`_payload`in e&&Tm(e._payload)}function Tm(e){return typeof e==`object`&&!!e&&`then`in e}var Em=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Dm=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Om=Z.use,km=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=hm(`Primitive.${t}`),r=Z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Am(e,t){e&&cm.flushSync(()=>e.dispatchEvent(t))}function jm(e,t=[]){let n=[];function r(t,r){let i=Z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=Z.useMemo(()=>o,Object.values(o));return(0,Q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=Z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>Z.createContext(e));return function(n){let r=n?.[e]||t;return Z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Mm(i,...t)]}function Mm(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return Z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Nm(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var Pm=globalThis?.document?Z.useLayoutEffect:()=>{},Fm=Z.useInsertionEffect||Pm;function Im({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Lm({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=Z.useRef(e!==void 0);Z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,Z.useCallback(t=>{if(s){let n=Rm(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Lm({defaultProp:e,onChange:t}){let[n,r]=Z.useState(e),i=Z.useRef(n),a=Z.useRef(t);return Fm(()=>{a.current=t},[t]),Z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Rm(e){return typeof e==`function`}function zm(e,t){return Z.useReducer((e,n)=>t[e][n]??e,e)}var Bm=e=>{let{present:t,children:n}=e,r=Vm(t),i=typeof n==`function`?n({present:r.isPresent}):Z.Children.only(n),a=Um(r.ref,Gm(i));return typeof n==`function`||r.isPresent?Z.cloneElement(i,{ref:a}):null};Bm.displayName=`Presence`;function Vm(e){let[t,n]=Z.useState(),r=Z.useRef(null),i=Z.useRef(e),a=Z.useRef(`none`),o=Z.useRef(void 0),[s,c]=zm(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return Z.useEffect(()=>{s===`mounted`?(a.current=o.current??Wm(r.current),o.current=void 0):a.current=`none`},[s]),Pm(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Wm(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Pm(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Wm(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Wm(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:Z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Wm(t)}else r.current=null;n(e)},[])}}function Hm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Um(...e){let t=Z.useRef(e);return t.current=e,Z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Hm(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Hm(n[e],null)}}},[])}function Wm(e){return e?.animationName||`none`}function Gm(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Km=Z.useId||(()=>void 0),qm=0;function Jm(e){let[t,n]=Z.useState(Km());return Pm(()=>{e||n(e=>e??String(qm++))},[e]),e||(t?`radix-${t}`:``)}function Ym(e){let t=Z.useRef(e);return Z.useEffect(()=>{t.current=e}),Z.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Xm=`DismissableLayer`,Zm=`dismissableLayer.update`,Qm=`dismissableLayer.pointerDownOutside`,$m=`dismissableLayer.focusOutside`,eh,th=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nh=Z.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=Z.useContext(th),[d,f]=Z.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=Z.useState({}),h=mm(t,f),g=Array.from(u.layers),[ee]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),te=ee?g.indexOf(ee):-1,_=d?g.indexOf(d):-1,ne=u.layersWithOutsidePointerEventsDisabled.size>0,v=_>=te,re=Z.useRef(!1),ie=sh(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:re,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:Z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return v&&!t},[u.branches,v])}),ae=ch(e=>{if(r&&re.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),oe=d?_===g.length-1:!1,se=Ym(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return Z.useEffect(()=>{if(oe)return p.addEventListener(`keydown`,se,{capture:!0}),()=>p.removeEventListener(`keydown`,se,{capture:!0})},[p,oe,se]),Z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(eh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),lh(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=eh))}},[d,p,n,u]),Z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),lh())},[d,u]),Z.useEffect(()=>{let e=()=>m({});return document.addEventListener(Zm,e),()=>document.removeEventListener(Zm,e)},[]),(0,Q.jsx)(km.div,{...l,ref:h,style:{pointerEvents:ne?v?`auto`:`none`:void 0,...e.style},onFocusCapture:Nm(e.onFocusCapture,ae.onFocusCapture),onBlurCapture:Nm(e.onBlurCapture,ae.onBlurCapture),onPointerDownCapture:Nm(e.onPointerDownCapture,ie.onPointerDownCapture)})});nh.displayName=Xm;var rh=`DismissableLayerBranch`,ih=Z.forwardRef((e,t)=>{let n=Z.useContext(th),r=Z.useRef(null),i=mm(t,r);return Z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,Q.jsx)(km.div,{...e,ref:i})});ih.displayName=rh;function ah(){let e=Z.useContext(th),[t,n]=Z.useState(null);return Z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var oh=()=>!0;function sh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=oh}=t,s=Ym(e),c=Z.useRef(!1),l=Z.useRef(!1),u=Z.useRef(new Map),d=Z.useRef(()=>{});return Z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||uh(Qm,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ch(e,t=globalThis?.document){let n=Ym(e),r=Z.useRef(!1);return Z.useEffect(()=>{let e=e=>{e.target&&!r.current&&uh($m,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lh(){let e=new CustomEvent(Zm);document.dispatchEvent(e)}function uh(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Am(i,a):i.dispatchEvent(a)}var dh=`focusScope.autoFocusOnMount`,fh=`focusScope.autoFocusOnUnmount`,ph={bubbles:!1,cancelable:!0},mh=`FocusScope`,hh=Z.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=Z.useState(null),l=Ym(i),u=Ym(a),d=Z.useRef(null),f=mm(t,c),p=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Sh(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Sh(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Sh(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),Z.useEffect(()=>{if(s){Ch.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dh,ph);s.addEventListener(dh,l),s.dispatchEvent(t),t.defaultPrevented||(gh(Eh(vh(s)),{select:!0}),document.activeElement===e&&Sh(s))}return()=>{s.removeEventListener(dh,l),setTimeout(()=>{let t=new CustomEvent(fh,ph);s.addEventListener(fh,u),s.dispatchEvent(t),t.defaultPrevented||Sh(e??document.body,{select:!0}),s.removeEventListener(fh,u),Ch.remove(p)},0)}}},[s,l,u,p]);let m=Z.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=_h(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Sh(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Sh(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,Q.jsx)(km.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});hh.displayName=mh;function gh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Sh(r,{select:t}),document.activeElement!==n)return}function _h(e){let t=vh(e);return[yh(t,e),yh(t.reverse(),e)]}function vh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yh(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):bh(r,{upTo:t})))return r}function bh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function xh(e){return e instanceof HTMLInputElement&&`select`in e}function Sh(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xh(e)&&t&&e.select()}}var Ch=wh();function wh(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Th(e,t),e.unshift(t)},remove(t){e=Th(e,t),e[0]?.resume()}}}function Th(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Eh(e){return e.filter(e=>e.tagName!==`A`)}var Dh=`Portal`,Oh=Z.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=Z.useState(!1);Pm(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?cm.createPortal((0,Q.jsx)(km.div,{...r,ref:t}),o):null});Oh.displayName=Dh;var kh=0,Ah=null;function jh(){Z.useEffect(()=>{Ah||={start:Mh(),end:Mh()};let{start:e,end:t}=Ah;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),kh++,()=>{kh===1&&(Ah?.start.remove(),Ah?.end.remove(),Ah=null),kh=Math.max(0,kh-1)}},[])}function Mh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Nh=function(){return Nh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Nh.apply(this,arguments)};function Ph(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ih=`right-scroll-bar-position`,Lh=`width-before-scroll-bar`,Rh=`with-scroll-bars-hidden`,zh=`--removed-body-scroll-bar-size`;function Bh(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Vh(e,t){var n=(0,Z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Hh=typeof window<`u`?Z.useLayoutEffect:Z.useEffect,Uh=new WeakMap;function Wh(e,t){var n=Vh(t||null,function(t){return e.forEach(function(e){return Bh(e,t)})});return Hh(function(){var t=Uh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Bh(e,null)}),i.forEach(function(e){r.has(e)||Bh(e,a)})}Uh.set(n,e)},[e]),n}function Gh(e){return e}function Kh(e,t){t===void 0&&(t=Gh);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function qh(e){e===void 0&&(e={});var t=Kh(null);return t.options=Nh({async:!0,ssr:!1},e),t}var Jh=function(e){var t=e.sideCar,n=Ph(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return Z.createElement(r,Nh({},n))};Jh.isSideCarExport=!0;function Yh(e,t){return e.useMedium(t),Jh}var Xh=qh(),Zh=function(){},Qh=Z.forwardRef(function(e,t){var n=Z.useRef(null),r=Z.useState({onScrollCapture:Zh,onWheelCapture:Zh,onTouchMoveCapture:Zh}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,ee=e.as,te=ee===void 0?`div`:ee,_=e.gapMode,ne=Ph(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),v=f,re=Wh([n,t]),ie=Nh(Nh({},ne),i);return Z.createElement(Z.Fragment,null,u&&Z.createElement(v,{sideCar:Xh,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:_}),o?Z.cloneElement(Z.Children.only(s),Nh(Nh({},ie),{ref:re})):Z.createElement(te,Nh({},ie,{className:c,ref:re}),s))});Qh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qh.classNames={fullWidth:Lh,zeroRight:Ih};var $h,eg=function(){if($h)return $h;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function tg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=eg();return t&&e.setAttribute(`nonce`,t),e}function ng(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rg(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ig=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tg())&&(ng(t,n),rg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ag=function(){var e=ig();return function(t,n){Z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},og=function(){var e=ag();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sg={left:0,top:0,right:0,gap:0},cg=function(e){return parseInt(e||``,10)||0},lg=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[cg(n),cg(r),cg(i)]},ug=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sg;var t=lg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dg=og(),fg=`data-scroll-locked`,pg=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
61
61
|
.${Rh} {
|
|
62
62
|
overflow: hidden ${r};
|
|
63
63
|
padding-right: ${s}px ${r};
|