@atolis-hq/wake 0.4.115 → 0.4.116
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/src/activities/contracts/activity.d.ts +2 -0
- package/dist/src/activities/contracts/event-schema.d.ts +77 -0
- package/dist/src/activities/contracts/event-schema.js +2 -0
- package/dist/src/activities/contracts/observed-streams.d.ts +9 -0
- package/dist/src/activities/contracts/observed-streams.js +9 -0
- package/dist/src/activities/index.d.ts +1 -0
- package/dist/src/activities/index.js +1 -0
- package/dist/src/activities/pr/activity-support.js +2 -0
- package/dist/src/activities/pr/application.js +21 -6
- package/dist/src/activities/pr/contracts.d.ts +3 -0
- package/dist/src/activities/pr/merge.js +5 -1
- package/dist/src/bootstrap/board-projection.d.ts +1 -0
- package/dist/src/bootstrap/board-projection.js +17 -2
- package/dist/src/bootstrap/integration-runtime.js +3 -1
- package/dist/src/bootstrap/surface-api-merge-policy.d.ts +1 -0
- package/dist/src/bootstrap/surface-cli-applications.js +13 -10
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/execution/contracts/events.js +15 -3
- package/dist/src/orchestration/application/observed-state-reactor.d.ts +4 -0
- package/dist/src/orchestration/application/observed-state-reactor.js +23 -0
- package/dist/src/orchestration/application/observed-state-retry.d.ts +5 -0
- package/dist/src/orchestration/application/observed-state-retry.js +102 -0
- package/dist/src/orchestration/application/orchestration-service.d.ts +2 -0
- package/dist/src/orchestration/application/orchestration-service.js +4 -0
- package/dist/src/orchestration/contracts/activity-outcome.js +6 -1
- package/dist/src/orchestration/contracts/event-decoder.d.ts +14 -0
- package/dist/src/orchestration/contracts/event-decoder.js +17 -1
- package/dist/src/orchestration/contracts/event-factory.js +2 -0
- package/dist/src/orchestration/contracts/events.d.ts +11 -1
- package/dist/src/orchestration/contracts/events.js +1 -0
- package/dist/src/orchestration/contracts/observed-retry-description.d.ts +2 -0
- package/dist/src/orchestration/contracts/observed-retry-description.js +7 -0
- package/dist/src/orchestration/contracts/views.d.ts +9 -1
- package/dist/src/orchestration/domain/interpreter.js +16 -1
- package/dist/src/orchestration/domain/transition.d.ts +1 -0
- package/dist/src/orchestration/domain/transition.js +8 -1
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +1 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +7 -0
- package/dist/src/orchestration/index.d.ts +2 -0
- package/dist/src/orchestration/index.js +2 -0
- package/dist/src/surfaces/api/contracts/board.d.ts +1 -0
- package/dist/src/surfaces/api/contracts/orchestration.d.ts +1 -0
- package/dist/src/surfaces/api/presenters/orchestration.js +10 -1
- package/dist/src/surfaces/cli/commands/audit.d.ts +2 -0
- package/dist/src/surfaces/cli/commands/audit.js +27 -2
- package/dist/src/surfaces/cli/main.d.ts +2 -0
- package/dist/src/surfaces/web-assets/assets/{index-BsP1QXQ3.js → index-KZEn2twL.js} +2 -2
- package/dist/src/surfaces/web-assets/index.html +1 -1
- package/package.json +1 -1
|
@@ -71,7 +71,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
71
71
|
|
|
72
72
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=$i,s=!Ri.jitless,c=s&&ea.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?ys([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Ss(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=>!ma(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=>va(e,r,zi())))}),t)}var Cs=Fi(`$ZodUnion`,(e,t)=>{Io.init(e,t),qi(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),qi(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),qi(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),qi(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Wi(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=>Ss(t,r,e,i)):Ss(o,r,e,i)}}),ws=Fi(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Cs.init(e,t);let n=e._zod.parse;qi(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Hi(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!$i(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._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()),input:o,path:[t.discriminator],inst:e}),i)}}),Ts=Fi(`$ZodIntersection`,(e,t)=>{Io.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])=>Ds(e,t,n)):Ds(e,i,a)}});function Es(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ta(e)&&ta(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Es(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=Es(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 Ds(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ma(e))return e;let o=Es(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Os=Fi(`$ZodEnum`,(e,t)=>{Io.init(e,t);let n=Bi(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ra.has(typeof e)).map(e=>typeof e==`string`?ia(e):e.toString()).join(`|`)})$`),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}}),ks=Fi(`$ZodLiteral`,(e,t)=>{if(Io.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ia(e):e?ia(e.toString()):String(e)).join(`|`)})$`),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}}),As=Fi(`$ZodTransform`,(e,t)=>{Io.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Li(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.fallback=!0,n));if(i instanceof Promise)throw new Ii;return n.value=i,n.fallback=!0,n}});function js(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ms=Fi(`$ZodOptional`,(e,t)=>{Io.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,qi(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),qi(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Wi(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>js(e,r)):js(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ns=Fi(`$ZodExactOptional`,(e,t)=>{Ms.init(e,t),qi(e._zod,`values`,()=>t.innerType._zod.values),qi(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ps=Fi(`$ZodNullable`,(e,t)=>{Io.init(e,t),qi(e._zod,`optin`,()=>t.innerType._zod.optin),qi(e._zod,`optout`,()=>t.innerType._zod.optout),qi(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Wi(e.source)}|null)$`):void 0}),qi(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Fs=Fi(`$ZodDefault`,(e,t)=>{Io.init(e,t),e._zod.optin=`optional`,qi(e._zod,`values`,()=>t.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=>Is(e,t)):Is(r,t)}});function Is(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ls=Fi(`$ZodPrefault`,(e,t)=>{Io.init(e,t),e._zod.optin=`optional`,qi(e._zod,`values`,()=>t.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))}),Rs=Fi(`$ZodNonOptional`,(e,t)=>{Io.init(e,t),qi(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>zs(t,e)):zs(i,e)}});function zs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Bs=Fi(`$ZodCatch`,(e,t)=>{Io.init(e,t),e._zod.optin=`optional`,qi(e._zod,`optout`,()=>t.innerType._zod.optout),qi(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>va(e,n,zi()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>va(e,n,zi()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Vs=Fi(`$ZodPipe`,(e,t)=>{Io.init(e,t),qi(e._zod,`values`,()=>t.in._zod.values),qi(e._zod,`optin`,()=>t.in._zod.optin),qi(e._zod,`optout`,()=>t.out._zod.optout),qi(e._zod,`propValues`,()=>t.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=>Hs(e,t.in,n)):Hs(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hs(e,t.out,n)):Hs(r,t.out,n)}});function Hs(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Us=Fi(`$ZodReadonly`,(e,t)=>{Io.init(e,t),qi(e._zod,`propValues`,()=>t.innerType._zod.propValues),qi(e._zod,`values`,()=>t.innerType._zod.values),qi(e._zod,`optin`,()=>t.innerType?._zod?.optin),qi(e._zod,`optout`,()=>t.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(Ws):Ws(r)}});function Ws(e){return e.value=Object.freeze(e.value),e}var Gs=Fi(`$ZodCustom`,(e,t)=>{vo.init(e,t),Io.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=>Ks(t,n,r,e));Ks(i,n,r,e)}});function Ks(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(ba(e))}}var qs,Js=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 Ys(){return new Js}(qs=globalThis).__zod_globalRegistry??(qs.__zod_globalRegistry=Ys());var Xs=globalThis.__zod_globalRegistry;function Zs(e,t){return new e({type:`string`,...oa(t)})}function Qs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...oa(t)})}function $s(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...oa(t)})}function ec(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...oa(t)})}function tc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...oa(t)})}function nc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...oa(t)})}function rc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...oa(t)})}function ic(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...oa(t)})}function ac(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...oa(t)})}function oc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...oa(t)})}function sc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...oa(t)})}function cc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...oa(t)})}function lc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...oa(t)})}function uc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...oa(t)})}function dc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...oa(t)})}function fc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...oa(t)})}function pc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...oa(t)})}function mc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...oa(t)})}function hc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...oa(t)})}function gc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...oa(t)})}function _c(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...oa(t)})}function vc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...oa(t)})}function yc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...oa(t)})}function bc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...oa(t)})}function lee(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...oa(t)})}function xc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...oa(t)})}function Sc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...oa(t)})}function Cc(e,t){return new e({type:`number`,checks:[],...oa(t)})}function wc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...oa(t)})}function Tc(e,t){return new e({type:`boolean`,...oa(t)})}function Ec(e){return new e({type:`unknown`})}function Dc(e,t){return new e({type:`never`,...oa(t)})}function Oc(e,t){return new bo({check:`less_than`,...oa(t),value:e,inclusive:!1})}function kc(e,t){return new bo({check:`less_than`,...oa(t),value:e,inclusive:!0})}function Ac(e,t){return new xo({check:`greater_than`,...oa(t),value:e,inclusive:!1})}function jc(e,t){return new xo({check:`greater_than`,...oa(t),value:e,inclusive:!0})}function Mc(e,t){return new So({check:`multiple_of`,...oa(t),value:e})}function Nc(e,t){return new wo({check:`max_length`,...oa(t),maximum:e})}function Pc(e,t){return new To({check:`min_length`,...oa(t),minimum:e})}function Fc(e,t){return new Eo({check:`length_equals`,...oa(t),length:e})}function Ic(e,t){return new Oo({check:`string_format`,format:`regex`,...oa(t),pattern:e})}function Lc(e){return new ko({check:`string_format`,format:`lowercase`,...oa(e)})}function Rc(e){return new Ao({check:`string_format`,format:`uppercase`,...oa(e)})}function zc(e,t){return new jo({check:`string_format`,format:`includes`,...oa(t),includes:e})}function Bc(e,t){return new Mo({check:`string_format`,format:`starts_with`,...oa(t),prefix:e})}function Vc(e,t){return new No({check:`string_format`,format:`ends_with`,...oa(t),suffix:e})}function Hc(e){return new Po({check:`overwrite`,tx:e})}function Uc(e){return Hc(t=>t.normalize(e))}function Wc(){return Hc(e=>e.trim())}function Gc(){return Hc(e=>e.toLowerCase())}function Kc(){return Hc(e=>e.toUpperCase())}function qc(){return Hc(e=>Zi(e))}function Jc(e,t,n){return new e({type:`array`,element:t,...oa(n)})}function Yc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...oa(n)})}function Xc(e,t){let n=Zc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ba(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ba(r))}},e(t.value,t)),t);return n}function Zc(e,t){let n=new vo({check:`custom`,...oa(t)});return n._zod.check=e,n}function Qc(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??Xs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function $c(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);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,$c(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&nl(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 el(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
|
|
73
73
|
|
|
74
|
-
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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function tl(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:il(t,`input`,e.processors),output:il(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function nl(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 nl(r.element,n);if(r.type===`set`)return nl(r.valueType,n);if(r.type===`lazy`)return nl(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`)return nl(r.innerType,n);if(r.type===`intersection`)return nl(r.left,n)||nl(r.right,n);if(r.type===`record`||r.type===`map`)return nl(r.keyType,n)||nl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:nl(r.in,n)||nl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(nl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(nl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(nl(e,n))return!0;return!!(r.rest&&nl(r.rest,n))}return!1}var rl=(e,t={})=>n=>{let r=Qc({...n,processors:t});return $c(e,r),el(r,e),tl(r,e)},il=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Qc({...i??{},target:a,io:t,processors:n});return $c(e,o),el(o,e),tl(o,e)},al={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ol=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=al[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},sl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},cl=(e,t,n,r)=>{n.type=`boolean`},ll=(e,t,n,r)=>{n.not={}},ul=(e,t,n,r)=>{let i=e._zod.def,a=Bi(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},dl=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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},fl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},pl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ml=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=$c(a.element,t,{...r,path:[...r.path,`items`]})},hl=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=$c(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]._zod;return t.io===`input`?n.optin===void 0:n.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=$c(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},gl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>$c(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},_l=(e,t,n,r)=>{let i=e._zod.def,a=$c(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=$c(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},vl=(e,t,n,r)=>{let i=e._zod.def,a=$c(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`}]},yl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Sl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Cl=(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;$c(o,t,r);let s=t.seen.get(e);s.ref=o},wl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Tl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},El=Fi(`ZodISODateTime`,(e,t)=>{Xo.init(e,t),Ql.init(e,t)});function Dl(e){return bc(El,e)}var Ol=Fi(`ZodISODate`,(e,t)=>{Zo.init(e,t),Ql.init(e,t)});function kl(e){return lee(Ol,e)}var Al=Fi(`ZodISOTime`,(e,t)=>{Qo.init(e,t),Ql.init(e,t)});function jl(e){return xc(Al,e)}var Ml=Fi(`ZodISODuration`,(e,t)=>{$o.init(e,t),Ql.init(e,t)});function Nl(e){return Sc(Ml,e)}var Pl=Fi(`ZodError`,(e,t)=>{Sa.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ta(e,t)},flatten:{value:t=>wa(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Vi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Vi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fl=Ea(Pl),Il=Da(Pl),Ll=Oa(Pl),Rl=Aa(Pl),zl=Ma(Pl),Bl=Na(Pl),Vl=Pa(Pl),Hl=Fa(Pl),Ul=Ia(Pl),Wl=La(Pl),Gl=Ra(Pl),uee=za(Pl),Kl=new WeakMap;function ql(e,t,n){let r=Object.getPrototypeOf(e),i=Kl.get(r);if(i||(i=new Set,Kl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Jl=Fi(`ZodType`,(e,t)=>(Io.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:il(e,`input`),output:il(e,`output`)}}),e.toJSONSchema=rl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Fl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ll(e,t,n),e.parseAsync=async(t,n)=>Il(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Rl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zl(e,t,n),e.decode=(t,n)=>Bl(e,t,n),e.encodeAsync=async(t,n)=>Vl(e,t,n),e.decodeAsync=async(t,n)=>Hl(e,t,n),e.safeEncode=(t,n)=>Ul(e,t,n),e.safeDecode=(t,n)=>Wl(e,t,n),e.safeEncodeAsync=async(t,n)=>Gl(e,t,n),e.safeDecodeAsync=async(t,n)=>uee(e,t,n),ql(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Yi(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 aa(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ld(e,t))},superRefine(e,t){return this.check(ud(e,t))},overwrite(e){return this.check(Hc(e))},optional(){return Gu(this)},exactOptional(){return qu(this)},nullable(){return Yu(this)},nullish(){return Gu(Yu(this))},nonoptional(e){return td(this,e)},array(){return ku(this)},or(e){return Nu([this,e])},and(e){return Lu(this,e)},transform(e){return ad(this,Uu(e))},default(e){return Zu(this,e)},prefault(e){return $u(this,e)},catch(e){return rd(this,e)},pipe(e){return ad(this,e)},readonly(){return sd(this)},describe(e){let t=this.clone();return Xs.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xs.get(this);let t=this.clone();return Xs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Xs.get(e)?.description},configurable:!0}),e)),Yl=Fi(`_ZodString`,(e,t)=>{Lo.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ql(e,`_ZodString`,{regex(...e){return this.check(Ic(...e))},includes(...e){return this.check(zc(...e))},startsWith(...e){return this.check(Bc(...e))},endsWith(...e){return this.check(Vc(...e))},min(...e){return this.check(Pc(...e))},max(...e){return this.check(Nc(...e))},length(...e){return this.check(Fc(...e))},nonempty(...e){return this.check(Pc(1,...e))},lowercase(e){return this.check(Lc(e))},uppercase(e){return this.check(Rc(e))},trim(){return this.check(Wc())},normalize(...e){return this.check(Uc(...e))},toLowerCase(){return this.check(Gc())},toUpperCase(){return this.check(Kc())},slugify(){return this.check(qc())}})}),Xl=Fi(`ZodString`,(e,t)=>{Lo.init(e,t),Yl.init(e,t),e.email=t=>e.check(Qs($l,t)),e.url=t=>e.check(ic(nu,t)),e.jwt=t=>e.check(yc(_u,t)),e.emoji=t=>e.check(ac(ru,t)),e.guid=t=>e.check($s(eu,t)),e.uuid=t=>e.check(ec(tu,t)),e.uuidv4=t=>e.check(tc(tu,t)),e.uuidv6=t=>e.check(nc(tu,t)),e.uuidv7=t=>e.check(rc(tu,t)),e.nanoid=t=>e.check(oc(iu,t)),e.guid=t=>e.check($s(eu,t)),e.cuid=t=>e.check(sc(au,t)),e.cuid2=t=>e.check(cc(ou,t)),e.ulid=t=>e.check(lc(su,t)),e.base64=t=>e.check(gc(mu,t)),e.base64url=t=>e.check(_c(hu,t)),e.xid=t=>e.check(uc(cu,t)),e.ksuid=t=>e.check(dc(lu,t)),e.ipv4=t=>e.check(fc(uu,t)),e.ipv6=t=>e.check(pc(du,t)),e.cidrv4=t=>e.check(mc(fu,t)),e.cidrv6=t=>e.check(hc(pu,t)),e.e164=t=>e.check(vc(gu,t)),e.datetime=t=>e.check(Dl(t)),e.date=t=>e.check(kl(t)),e.time=t=>e.check(jl(t)),e.duration=t=>e.check(Nl(t))});function Zl(e){return Zs(Xl,e)}var Ql=Fi(`ZodStringFormat`,(e,t)=>{Ro.init(e,t),Yl.init(e,t)}),$l=Fi(`ZodEmail`,(e,t)=>{Vo.init(e,t),Ql.init(e,t)}),eu=Fi(`ZodGUID`,(e,t)=>{zo.init(e,t),Ql.init(e,t)}),tu=Fi(`ZodUUID`,(e,t)=>{Bo.init(e,t),Ql.init(e,t)}),nu=Fi(`ZodURL`,(e,t)=>{Ho.init(e,t),Ql.init(e,t)}),ru=Fi(`ZodEmoji`,(e,t)=>{Uo.init(e,t),Ql.init(e,t)}),iu=Fi(`ZodNanoID`,(e,t)=>{Wo.init(e,t),Ql.init(e,t)}),au=Fi(`ZodCUID`,(e,t)=>{Go.init(e,t),Ql.init(e,t)}),ou=Fi(`ZodCUID2`,(e,t)=>{Ko.init(e,t),Ql.init(e,t)}),su=Fi(`ZodULID`,(e,t)=>{qo.init(e,t),Ql.init(e,t)}),cu=Fi(`ZodXID`,(e,t)=>{Jo.init(e,t),Ql.init(e,t)}),lu=Fi(`ZodKSUID`,(e,t)=>{Yo.init(e,t),Ql.init(e,t)}),uu=Fi(`ZodIPv4`,(e,t)=>{es.init(e,t),Ql.init(e,t)}),du=Fi(`ZodIPv6`,(e,t)=>{ts.init(e,t),Ql.init(e,t)}),fu=Fi(`ZodCIDRv4`,(e,t)=>{ns.init(e,t),Ql.init(e,t)}),pu=Fi(`ZodCIDRv6`,(e,t)=>{rs.init(e,t),Ql.init(e,t)}),mu=Fi(`ZodBase64`,(e,t)=>{as.init(e,t),Ql.init(e,t)}),hu=Fi(`ZodBase64URL`,(e,t)=>{ss.init(e,t),Ql.init(e,t)}),gu=Fi(`ZodE164`,(e,t)=>{cs.init(e,t),Ql.init(e,t)}),_u=Fi(`ZodJWT`,(e,t)=>{us.init(e,t),Ql.init(e,t)}),vu=Fi(`ZodNumber`,(e,t)=>{ds.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r),ql(e,`ZodNumber`,{gt(e,t){return this.check(Ac(e,t))},gte(e,t){return this.check(jc(e,t))},min(e,t){return this.check(jc(e,t))},lt(e,t){return this.check(Oc(e,t))},lte(e,t){return this.check(kc(e,t))},max(e,t){return this.check(kc(e,t))},int(e){return this.check(xu(e))},safe(e){return this.check(xu(e))},positive(e){return this.check(Ac(0,e))},nonnegative(e){return this.check(jc(0,e))},negative(e){return this.check(Oc(0,e))},nonpositive(e){return this.check(kc(0,e))},multipleOf(e,t){return this.check(Mc(e,t))},step(e,t){return this.check(Mc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function yu(e){return Cc(vu,e)}var bu=Fi(`ZodNumberFormat`,(e,t)=>{cee.init(e,t),vu.init(e,t)});function xu(e){return wc(bu,e)}var Su=Fi(`ZodBoolean`,(e,t)=>{fs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r)});function Cu(e){return Tc(Su,e)}var wu=Fi(`ZodUnknown`,(e,t)=>{ps.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Tu(){return Ec(wu)}var Eu=Fi(`ZodNever`,(e,t)=>{ms.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r)});function Du(e){return Dc(Eu,e)}var Ou=Fi(`ZodArray`,(e,t)=>{gs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ml(e,t,n,r),e.element=t.element,ql(e,`ZodArray`,{min(e,t){return this.check(Pc(e,t))},nonempty(e){return this.check(Pc(1,e))},max(e,t){return this.check(Nc(e,t))},length(e,t){return this.check(Fc(e,t))},unwrap(){return this.element}})});function ku(e,t){return Jc(Ou,e,t)}var Au=Fi(`ZodObject`,(e,t)=>{xs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hl(e,t,n,r),qi(e,`shape`,()=>t.shape),ql(e,`ZodObject`,{keyof(){return zu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Tu()})},loose(){return this.clone({...this._zod.def,catchall:Tu()})},strict(){return this.clone({...this._zod.def,catchall:Du()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return da(this,e)},safeExtend(e){return aee(this,e)},merge(e){return oee(this,e)},pick(e){return la(this,e)},omit(e){return ua(this,e)},partial(...e){return fa(Wu,this,e[0])},required(...e){return pa(ed,this,e[0])}})});function ju(e,t){return new Au({type:`object`,shape:e??{},...oa(t)})}var Mu=Fi(`ZodUnion`,(e,t)=>{Cs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r),e.options=t.options});function Nu(e,t){return new Mu({type:`union`,options:e,...oa(t)})}var Pu=Fi(`ZodDiscriminatedUnion`,(e,t)=>{Mu.init(e,t),ws.init(e,t)});function Fu(e,t,n){return new Pu({type:`union`,options:t,discriminator:e,...oa(n)})}var Iu=Fi(`ZodIntersection`,(e,t)=>{Ts.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r)});function Lu(e,t){return new Iu({type:`intersection`,left:e,right:t})}var Ru=Fi(`ZodEnum`,(e,t)=>{Os.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ul(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);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 Ru({...t,checks:[],...oa(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 Ru({...t,checks:[],...oa(r),entries:i})}});function zu(e,t){return new Ru({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...oa(t)})}var Bu=Fi(`ZodLiteral`,(e,t)=>{ks.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dl(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 Vu(e,t){return new Bu({type:`literal`,values:Array.isArray(e)?e:[e],...oa(t)})}var Hu=Fi(`ZodTransform`,(e,t)=>{As.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Li(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ba(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(ba(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Uu(e){return new Hu({type:`transform`,transform:e})}var Wu=Fi(`ZodOptional`,(e,t)=>{Ms.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gu(e){return new Wu({type:`optional`,innerType:e})}var Ku=Fi(`ZodExactOptional`,(e,t)=>{Ns.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qu(e){return new Ku({type:`optional`,innerType:e})}var Ju=Fi(`ZodNullable`,(e,t)=>{Ps.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Ju({type:`nullable`,innerType:e})}var Xu=Fi(`ZodDefault`,(e,t)=>{Fs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Zu(e,t){return new Xu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():na(t)}})}var Qu=Fi(`ZodPrefault`,(e,t)=>{Ls.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $u(e,t){return new Qu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():na(t)}})}var ed=Fi(`ZodNonOptional`,(e,t)=>{Rs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e,t){return new ed({type:`nonoptional`,innerType:e,...oa(t)})}var nd=Fi(`ZodCatch`,(e,t)=>{Bs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rd(e,t){return new nd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var id=Fi(`ZodPipe`,(e,t)=>{Vs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e.in=t.in,e.out=t.out});function ad(e,t){return new id({type:`pipe`,in:e,out:t})}var od=Fi(`ZodReadonly`,(e,t)=>{Us.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sd(e){return new od({type:`readonly`,innerType:e})}var cd=Fi(`ZodCustom`,(e,t)=>{Gs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fl(e,t,n,r)});function ld(e,t={}){return Yc(cd,e,t)}function ud(e,t){return Xc(e,t)}var dd=e=>e,fd=dd({Day:`1d`,ThreeDays:`3d`,FiveDays:`5d`,Week:`7d`}),pd=Object.keys({accepted:!0,completed:!0}),md={Accepted:pd[0],Completed:pd[1]},hd={Active:Object.keys({active:!0})[0]},gd={Adapter:Object.keys({adapter:!0})[0]},_d=Object.keys({failed:!0,succeeded:!0}),vd={Failed:_d[0],Succeeded:_d[1]},yd=Object.keys({starting:!0,started:!0}),bd={Starting:yd[0],Started:yd[1]},xd=dd({Waiting:`waiting`,Done:`done`,Rejected:`rejected`,Blocked:`blocked`,Failed:`failed`,Integrated:`integrated`}),Sd=Object.keys({ready:!0,active:!0,"needs-input":!0,error:!0,finished:!0}),Cd={Ready:Sd[0],Active:Sd[1],NeedsInput:Sd[2],Error:Sd[3],Finished:Sd[4]};Object.keys({stage:!0})[0];var wd=Object.keys({input:!0,agent:!0}),Td={Input:wd[0],Agent:wd[1]},Ed=Object.keys({session:!0,run:!0}),Dd={Session:Ed[0],Run:Ed[1]},Od={Event:`event`,Cron:`cron`,Manual:`manual`},kd={started:!0},Ad={Started:Object.keys(kd)[0],Coalesced:`coalesced`,Skipped:`skipped`},jd={OwnScope:`own-scope`,Paused:`paused`,Removed:`removed`,DispatchPaused:`dispatch-paused`,Capacity:`capacity-unavailable`,PendingLimit:`pending-source-limit`},Md=Object.keys({completed:!0,superseded:!0}),Nd={Completed:Md[0],Superseded:Md[1]},Pd={Started:Object.keys(kd)[0],Coalesced:Ad.Coalesced,Skipped:Ad.Skipped},Fd=Object.keys({pause:!0,resume:!0,run:!0}),Id={Pause:Fd[0],Resume:Fd[1],Run:Fd[2]},Ld=dd({Active:`active`,Waiting:`waiting`,Completed:`completed`,Blocked:`blocked`,Superseded:`superseded`}),Rd=Object.keys({"execution-recovery-ambiguous:":!0})[0];function zd(e){return e?.startsWith(Rd)===!0||e!==void 0&&/^run-ambiguous-after-\d+-attempts$/.test(e)}var Bd=Cd,Vd=dd({Unknown:`unknown`}),Hd=Object.keys({enabled:!0,paused:!0,running:!0,removed:!0}),Ud={Enabled:Hd[0],Paused:Hd[1],Running:Hd[2],Removed:Hd[3]},Wd=Object.keys({pause:!0,resume:!0,run:!0});Wd[0],Wd[1],Wd[2];var Gd=Object.keys({activity:!0,watch:!0,"watch-gate":!0,reactor:!0}),Kd={Activity:Gd[0],Watch:Gd[1],WatchGate:Gd[2],Reactor:Gd[3]},[qd,Jd,Yd]=Object.keys({complete:!0,maintenance:!0,integration:!0});function Xd(e,t,n){if(e===void 0)return;let r=Si(e,t);return{rootWorkItemKey:wi(r.rootWorkItemKey,E(t,`rootWorkItemKey`)),...Oi(r,`parentWorkItemKey`,t),...r.qa===void 0?{}:{qa:ef(r.qa,E(t,`qa`))},...r.attention===void 0?{}:{attention:Zd(r.attention,E(t,`attention`))},...r.cohorts===void 0?{}:{cohorts:Ci(r.cohorts,E(t,`cohorts`),(e,t=``)=>{let n=Si(e,t);return{cohortId:wi(n.cohortId,E(t,`cohortId`)),settled:Ei(n.settled,E(t,`settled`)),...Oi(n,`failureReason`,t)}})},children:Ci(r.children,E(t,`children`),(e,t=``)=>{let r=Si(e,t);return{workItemKey:wi(r.workItemKey,E(t,`workItemKey`)),workItemId:wi(r.workItemId,E(t,`workItemId`)),...Oi(r,`externalRef`,t),parentWorkItemKey:wi(r.parentWorkItemKey,E(t,`parentWorkItemKey`)),objective:wi(r.objective,E(t,`objective`)),workflowName:wi(r.workflowName,E(t,`workflowName`)),status:wi(r.status,E(t,`status`)),...Oi(r,`currentStage`,t),cohortId:wi(r.cohortId,E(t,`cohortId`)),...r.repository===void 0?{}:{repository:Qd(r.repository,E(t,`repository`))},...Oi(r,`prerequisiteBlocker`,t),...r.prerequisites===void 0?{}:{prerequisites:Ci(r.prerequisites,E(t,`prerequisites`),wi)},...r.replaces===void 0?{}:{replaces:{cohortId:wi(Si(r.replaces,E(t,`replaces`)).cohortId,E(t,`replaces.cohortId`)),assignmentId:wi(Si(r.replaces,E(t,`replaces`)).assignmentId,E(t,`replaces.assignmentId`))}},...r.outputs===void 0?{}:{outputs:Ci(r.outputs,E(t,`outputs`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,E(t,`name`)),kind:wi(n.kind,E(t,`kind`)),required:Ei(n.required,E(t,`required`)),selected:Ei(n.selected,E(t,`selected`)),stale:Ei(n.stale,E(t,`stale`)),...n.repository===void 0?{}:{repository:Qd(n.repository,E(t,`repository`))}}})},...Oi(r,`blockReason`,t),resources:Ci(r.resources,E(t,`resources`),n)}})}}function Zd(e,t){let n=Si(e,t);return{cohortId:wi(n.cohortId,E(t,`cohortId`)),revision:Di(n.revision,E(t,`revision`)),blockers:Ci(n.blockers,E(t,`blockers`),(e,t=``)=>{let n=Si(e,t);return{blockerId:wi(n.blockerId,E(t,`blockerId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),kind:wi(n.kind,E(t,`kind`)),reason:wi(n.reason,E(t,`reason`)),answered:Ei(n.answered,E(t,`answered`))}})}}function Qd(e,t){let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),pullRequestBase:wi(n.pullRequestBase,E(t,`pullRequestBase`))}}function $d(e,t){let n=Si(e,t);return{complete:Ei(n.complete,E(t,qd)),summary:wi(n.summary,E(t,`summary`)),targets:Ci(n.targets,E(t,`targets`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),state:wi(n.state,E(t,`state`)),layer:Di(n.layer,E(t,`layer`)),baseMovement:wi(n.baseMovement,E(t,`baseMovement`)),evidenceAffected:Ei(n.evidenceAffected,E(t,`evidenceAffected`)),...Oi(n,Jd,t),...Oi(n,`detail`,t)}}),maintenance:Ci(n.maintenance,E(t,Jd),(e,t=``)=>{let n=Si(e,t);return{maintenanceId:wi(n.maintenanceId,E(t,`maintenanceId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),kind:wi(n.kind,E(t,`kind`)),previousRevision:wi(n.previousRevision,E(t,`previousRevision`)),currentRevision:wi(n.currentRevision,E(t,`currentRevision`)),producerRunId:wi(n.producerRunId,E(t,`producerRunId`))}})}}function ef(e,t){let n=Si(e,t);return{...n.integration===void 0?{}:{integration:$d(n.integration,E(t,Yd))},selectionRevision:Di(n.selectionRevision,E(t,`selectionRevision`)),...Oi(n,`candidateId`,t),repositories:Ci(n.repositories,E(t,`repositories`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),revision:wi(n.revision,E(t,`revision`))}}),stale:Ci(n.stale,E(t,`stale`),wi),...n.staleOutputs===void 0?{}:{staleOutputs:Ci(n.staleOutputs,E(t,`staleOutputs`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),reason:wi(n.reason,E(t,`reason`))}})},...Oi(n,`verdict`,t),effective:Ei(n.effective,E(t,`effective`)),canComplete:Ei(n.canComplete,E(t,`canComplete`)),...Oi(n,`reason`,t),exhausted:Ei(n.exhausted,E(t,`exhausted`)),findings:Ci(n.findings,E(t,`findings`),wi)}}var tf=Fu(`kind`,[ju({kind:Vu(Od.Manual),commandId:Zl(),operator:Zl()}),ju({kind:Vu(Od.Cron),slot:Zl()}),ju({kind:Vu(Od.Event),eventId:Zl(),eventType:Zl()})]),nf=ju({triggerId:Zl(),source:tf,occurredAt:Zl(),reason:zu(jd)}),rf=ju({id:Zl(),workflow:Zl(),contextScope:Zl().optional(),on:ju({cron:Zl().optional(),events:ku(Zl()).optional()}),when:ju({capacityAvailable:Vu(!0)}).optional()}),af=Fu(`disposition`,[ju({disposition:Vu(Pd.Started),workItemId:Zl().optional()}),ju({disposition:Vu(Pd.Coalesced),activeWorkItemId:Zl().optional()}),ju({disposition:Vu(Pd.Skipped),reason:zu(jd)})]),of=Object.keys({stage:!0})[0];function sf(e){return(t,n=``)=>{let r=Si(t,n);return{data:e(r.data,E(n,`data`)),meta:xi(r.meta,E(n,`meta`))}}}function cf(e){return(t,n=``)=>{let r=Si(t,n),i=Si(r.page,E(n,`page`));return{items:Ci(r.items,E(n,`items`),e),page:{nextCursor:Ti(i.nextCursor,E(n,`page.nextCursor`)),hasMore:Ei(i.hasMore,E(n,`page.hasMore`)),...ki(i,`total`,E(n,`page`))},meta:xi(r.meta,E(n,`meta`))}}}var lf=(e,t=``)=>{let n=Si(e,t);return{dispatchPaused:Ei(n.dispatchPaused,E(t,`dispatchPaused`)),...Oi(n,`dispatchPausedUntil`,t),...Oi(n,`dispatchPauseReason`,t),updatedAt:wi(n.updatedAt,E(t,`updatedAt`)),...n.maintenanceLease===void 0?{}:{maintenanceLease:dee(n.maintenanceLease,E(t,`maintenanceLease`))}}};function dee(e,t){let n=Si(e,t);return{attemptId:wi(n.attemptId,E(t,`attemptId`)),phase:wi(n.phase,E(t,`phase`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`failure`,t)}}var uf=(e,t=``)=>{let n=Si(e,t),r=wi(n.status,E(t,`status`));return r!==md.Accepted&&r!==md.Completed&&Mi(E(t,`status`)),{...n.triggerOutcome===void 0?{}:{triggerOutcome:af.parse(n.triggerOutcome)},commandId:wi(n.commandId,E(t,`commandId`)),idempotencyKey:wi(n.idempotencyKey,E(t,`idempotencyKey`)),acceptedAt:wi(n.acceptedAt,E(t,`acceptedAt`)),status:r}},df=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workItemId:wi(n.workItemId,E(t,`workItemId`)),objective:wi(n.objective,E(t,`objective`)),state:wi(n.state,E(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),...Oi(n,`externalRef`,t),...Oi(n,`lastRunOutcome`,t),relatedWorkItems:Ci(n.relatedWorkItems,E(t,`relatedWorkItems`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t??``,`workItemKey`)),relation:wi(n.relation,E(t??``,`relation`))}})}},fee=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workItemId:wi(n.workItemId,E(t,`workItemId`)),objective:wi(n.objective,E(t,`objective`)),condition:wi(n.condition,E(t,`condition`)),...Ai(n,`frozen`,t),...Ai(n,`awaitingApproval`,t),...Ai(n,`extendEligible`,t),...Oi(n,`workflowName`,t),...Oi(n,of,t),...Oi(n,`blockReason`,t),dwellSince:wi(n.dwellSince,E(t,`dwellSince`)),runCount:Di(n.runCount,E(t,`runCount`)),...Oi(n,`lastRunAt`,t),...Oi(n,`lastRunOutcome`,t),...ki(n,`lastRunAgeMs`,t),totalTokens:Di(n.totalTokens,E(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,E(t,`totalCostUsd`)),totalDurationMs:Di(n.totalDurationMs,E(t,`totalDurationMs`)),activeRuns:pf(n.activeRuns,E(t,`activeRuns`)),...Oi(n,`externalRef`,t),...Oi(n,`repository`,t),...Oi(n,`parentWorkItemKey`,t),...ki(n,`childCount`,t)}};function ff(e,t){let n=Si(e,t),r=wi(n.relation,E(t,`relation`)),i=wi(n.workItemKey,E(t,`workItemKey`));if(r===`granted`||r===`shared`)return{workItemKey:i,relation:r};throw Error(`${E(t,`relation`)} must be granted or shared`)}function pf(e,t){return e===void 0?{}:Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,mf(n,E(t,e))]))}function mf(e,t){let n=Si(e,t),r=wi(n.phase,E(t,`phase`));return Object.values(bd).includes(r)||Mi(E(t,`phase`)),{action:wi(n.action,E(t,`action`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),elapsedMs:Di(n.elapsedMs,E(t,`elapsedMs`)),phase:r,...Oi(n,`runnerName`,t)}}var hf=(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),adapter:wi(n[gd.Adapter],E(t,gd.Adapter)),kind:wi(n.kind,E(t,`kind`)),locatorLabel:wi(n.locatorLabel,E(t,`locatorLabel`)),capabilities:Ci(n.capabilities,E(t,`capabilities`),wi),...Oi(n,`title`,t),...Oi(n,`externalUrl`,t),...Oi(n,`revision`,t)}},gf=(e,t=``)=>{let n=Si(e,t),r=n.waitingFor;return{workflowInstanceId:wi(n.workflowInstanceId,E(t,`workflowInstanceId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workflowName:wi(n.workflowName,E(t,`workflowName`)),orchestrationGroupId:wi(n.orchestrationGroupId,E(t,`orchestrationGroupId`)),...Oi(n,`parentWorkflowInstanceId`,t),status:wi(n.status,E(t,`status`)),currentStage:wi(n.currentStage,E(t,`currentStage`)),...Oi(n,`blockReason`,t),...Ai(n,`retryEligible`,t),...Ai(n,`extendEligible`,t),...n.mergePolicyBlock===void 0?{}:{mergePolicyBlock:Nf(n.mergePolicyBlock,E(t,`mergePolicyBlock`))},...r===void 0?{}:{waitingFor:{signalKind:wi(Si(r,E(t,`waitingFor`)).signalKind,E(t,`waitingFor.signalKind`))}}}},pee=(e,t=``)=>({diagrams:Ci(Si(e,t).diagrams,E(t,`diagrams`),_f)});function _f(e,t=``){let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),direction:`left-to-right`,stages:Ci(n.stages,E(t,`stages`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),children:Ci(n.children,E(t,`children`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),kind:vf(n.kind,E(t,`kind`)),...yf(n,t)}}),...yf(n,t)}}),transitions:Ci(n.transitions,E(t,`transitions`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),label:wi(n.label,E(t,`label`)),...Oi(n,`fromChildId`,t)}})}}function vf(e,t){let n=wi(e,t);return Object.values(Kd).includes(n)||Mi(t),n}function yf(e,t){let n=e.activeRuns;return{...Oi(e,`status`,t),...Oi(e,`lastOutcome`,t),...ki(e,`runCount`,t),...ki(e,`totalDurationMs`,t),...ki(e,`totalTokens`,t),...ki(e,`inputTokens`,t),...ki(e,`outputTokens`,t),...ki(e,`cacheReadTokens`,t),...ki(e,`cacheWriteTokens`,t),...ki(e,`totalCostUsd`,t),...n===void 0?{}:{activeRuns:Ci(n,E(t,`activeRuns`),(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,E(t,`runId`)),activity:wi(n.activity,E(t,`activity`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`runnerName`,t)}})}}}var bf=[`DONE`,`FAILED`,`AMBIGUOUS`];function xf(e,t){let n=E(t,`resolution`),r=Si(e,n),i=wi(r.sentinel,E(n,`sentinel`));return bf.includes(i)||Mi(E(n,`sentinel`)),{sentinel:i,resolvedAt:wi(r.resolvedAt,E(n,`resolvedAt`))}}var Sf=(e,t=``)=>{let n=Si(e,t),r=n.failure,i=n.resolution;return{...n.operatorInstructions===void 0?{}:{operatorInstructions:Pf(n.operatorInstructions)},runId:wi(n.runId,E(t,`runId`)),activationId:wi(n.activationId,E(t,`activationId`)),activity:wi(n.activity,E(t,`activity`)),workflowInstanceId:wi(n.workflowInstanceId,E(t,`workflowInstanceId`)),orchestrationGroupId:wi(n.orchestrationGroupId,E(t,`orchestrationGroupId`)),attempt:Di(n.attempt,E(t,`attempt`)),status:wi(n.status,E(t,`status`)),active:Ei(n.active,E(t,hd.Active)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`executionStartedAt`,t),...Oi(n,`finishedAt`,t),sentinel:wi(n.sentinel,E(t,`sentinel`)),...Oi(n,`runnerName`,t),...Oi(n,`runnerModel`,t),...Oi(n,`workflowName`,t),...Oi(n,of,t),totalTokens:Di(n.totalTokens,E(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,E(t,`totalCostUsd`)),...n.outcome===void 0?{}:{outcome:ji(n.outcome,E(t,`outcome`))},...r===void 0?{}:{failure:{kind:wi(Si(r,E(t,`failure`)).kind,E(t,`failure.kind`))}},...i===void 0?{}:{resolution:xf(i,t)}}},Cf=(e,t=``)=>{let n=Object.keys({conversation:!0})[0],r=Object.keys({stage:!0})[0],i=Si(e,t),a=Si(i.orchestration,E(t,`orchestration`)),o=Si(i.execution,E(t,`execution`)),s=Si(i.activities,E(t,`activities`)),c=i.artifacts===void 0?[]:Ci(i.artifacts,E(t,`artifacts`),(e,t=``)=>{let n=Si(e,t);return{revisionId:wi(n.revisionId,E(t,`revisionId`)),producer:wi(n.producer,E(t,`producer`)),path:wi(n.path,E(t,`path`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),...Oi(n,`mediaType`,t),...ki(n,`byteLength`,t),...Oi(n,`digest`,t),href:wi(n.href,E(t,`href`)),...n.source===void 0?{}:{source:ff(n.source,E(t,`source`))}}}),l=i.conversation===void 0?void 0:Si(i.conversation,E(t,n));return{...i.delegation===void 0?{}:{delegation:Xd(i.delegation,E(t,`delegation`),hf)},...Oi(i,`triggerOrigin`,t),work:df(i.work,E(t,`work`)),resources:Ci(i.resources,E(t,`resources`),hf),orchestration:{primary:a.primary===null?null:gf(a.primary,E(t,`orchestration.primary`)),children:Ci(a.children,E(t,`orchestration.children`),gf),diagram:kf(a.diagram,E(t,`orchestration.diagram`))},execution:{runs:Ci(o.runs,E(t,`execution.runs`),Sf),transcriptGroups:Ci(o.transcriptGroups,E(t,`execution.transcriptGroups`),(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,E(t,`groupId`)),kind:jf(n.kind,E(t,`kind`)),...Oi(n,`cli`,t),latestAt:wi(n.latestAt,E(t,`latestAt`)),runIds:Ci(n.runIds,E(t,`runIds`),wi)}})},activities:s.pullRequest===void 0?{}:{pullRequest:Mf(s.pullRequest,E(t,`activities.pullRequest`))},artifacts:c,conversation:{canCreateEntries:l?.canCreateEntries===!0,canContinue:l?.canContinue===!0,entries:l===void 0?[]:Ci(l.entries,E(t,`${n}.entries`),(e,t=``)=>{let n=Si(e,t);return{entryId:wi(n.entryId,E(t,`entryId`)),body:wi(n.body,E(t,`body`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),origin:wi(n.origin,E(t,`origin`)),actorId:wi(n.actorId,E(t,`actorId`)),...Oi(n,`runId`,t),...Oi(n,r,t),...Oi(n,`sourceAdapter`,t),...Oi(n,`sourceResourceId`,t),...Oi(n,`sourceThreadId`,t),deleted:Ei(n.deleted,E(t,`deleted`)),representations:Ci(n.representations,E(t,`representations`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),externalId:wi(n.externalId,E(t,`externalId`))}})}})}}},wf=(e,t=``)=>{let n=Si(e,t),r=n.stream;return{id:wi(n.id,E(t,`id`)),type:wi(n.type,E(t,`type`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),position:Di(n.position,E(t,`position`)),...r===void 0?{}:{stream:{kind:wi(Si(r,E(t,`stream`)).kind,E(t,`stream.kind`)),id:wi(Si(r,E(t,`stream`)).id,E(t,`stream.id`))}},...Oi(n,`causationId`,t),...Oi(n,`correlationId`,t),payload:n.payload}},Tf=(e,t=``)=>{let n=Si(e,t);return{runnerId:wi(n.runnerId,E(t,`runnerId`)),status:wi(n.status,E(t,`status`)),available:Ei(n.available,E(t,`available`)),...Oi(n,`detail`,t),updatedAt:wi(n.updatedAt,E(t,`updatedAt`))}},Ef=(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,E(t,`runId`)),...Oi(n,`groupId`,t),available:Ei(n.available,E(t,`available`)),entries:Ci(n.entries,E(t,`entries`),(e,t=``)=>{let n=Si(e,t);return{occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),channel:Af(n.channel,E(t,`channel`)),text:wi(n.text,E(t,`text`)),runId:wi(n.runId,E(t,`runId`)),groupId:wi(n.groupId,E(t,`groupId`)),...ki(n,`durationMs`,t)}})}},Df=(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,E(t,`groupId`)),available:Ei(n.available,E(t,`available`)),entries:Ci(n.entries,E(t,`entries`),Of)}};function Of(e,t=``){let n=Si(e,t);return{occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),channel:Af(n.channel,E(t,`channel`)),text:wi(n.text,E(t,`text`)),runId:wi(n.runId,E(t,`runId`)),groupId:wi(n.groupId,E(t,`groupId`)),...ki(n,`durationMs`,t)}}function kf(e,t){return{href:wi(Si(e,t).href,E(t,`href`))}}function Af(e,t){let n=wi(e,t);return n!==Td.Input&&n!==Td.Agent&&Mi(t),n}function jf(e,t){let n=wi(e,t);return n!==Dd.Session&&n!==Dd.Run&&Mi(t),n}function Mf(e,t=``){let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),state:wi(n.state,E(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),headRevision:wi(n.headRevision,E(t,`headRevision`)),baseRevision:wi(n.baseRevision,E(t,`baseRevision`)),checks:wi(n.checks,E(t,`checks`))}}function Nf(e,t){let n=Si(e,t),r=wi(n.status,E(t,`status`));if(r!==`awaiting-human-merge`&&r!==`recovering`)throw Error(`${t}.status: invalid merge policy status`);let i=n.policy===void 0?void 0:Si(n.policy,E(t,`policy`));return{status:r,explanation:wi(n.explanation,E(t,`explanation`)),nextAction:wi(n.nextAction,E(t,`nextAction`)),...Oi(n,`href`,t),...i===void 0?{}:{policy:{...i.blockedPaths===void 0?{}:{blockedPaths:Ci(i.blockedPaths,E(t,`policy.blockedPaths`),wi)},...i.matchedPaths===void 0?{}:{matchedPaths:Ci(i.matchedPaths,E(t,`policy.matchedPaths`),wi)},...ki(i,`maxFilesChanged`,E(t,`policy`)),...ki(i,`filesChanged`,E(t,`policy`))}}}}function Pf(e){let t=Si(e,`operatorInstructions`);return{...Oi(t,`content`,`operatorInstructions`),...Oi(t,`author`,`operatorInstructions`),...Oi(t,`occurredAt`,`operatorInstructions`),contextScope:wi(t.contextScope,`operatorInstructions.contextScope`),revisionId:t.revisionId===null?null:wi(t.revisionId,`operatorInstructions.revisionId`)}}var Ff=(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),title:wi(n.title,E(t,`title`))}},If=(e,t=``)=>Ci(e,t,Ff);function Lf(e,t){let n=Si(e,t),r=Object.values(fd).find(e=>e===n.id);return r===void 0&&Mi(E(t,`id`)),{id:r,from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),bucketMs:Di(n.bucketMs,E(t,`bucketMs`))}}function Rf(e,t){return Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,Di(n,E(t,e))]))}var zf=(e,t=``)=>{let n=Si(e,t);if(`statistics`in n){let e=(e,t=``)=>{let n=Si(e,t),r=e=>n[e]===null?null:Di(n[e],E(t,e));return{count:Di(n.count,E(t,`count`)),medianMs:r(`medianMs`),averageMs:r(`averageMs`)}};return{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),statistics:e(n.statistics,E(t,`statistics`)),groups:Ci(n.groups,E(t,`groups`),(t,n=``)=>{let r=Si(t,n);return{...Ff(t,n),rows:Ci(r.rows,E(n,`rows`),(t,n=``)=>({value:wi(Si(t,n).value,E(n,`value`)),...e(t,n)}))}}),buckets:Ci(n.buckets,E(t,`buckets`),(t,n=``)=>{let r=Si(t,n);return{from:wi(r.from,E(n,`from`)),to:wi(r.to,E(n,`to`)),...e(t,n)}})}}return`dimensions`in n?{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),total:Di(n.total,E(t,`total`)),dimensions:Ci(n.dimensions,E(t,`dimensions`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),rows:Ci(n.rows,E(t,`rows`),(e,t=``)=>{let n=Si(e,t);return{value:wi(n.value,E(t,`value`)),count:Di(n.count,E(t,`count`)),share:Di(n.share,E(t,`share`)),tokens:Di(n.tokens,E(t,`tokens`)),costUsd:Di(n.costUsd,E(t,`costUsd`)),durationMs:Di(n.durationMs,E(t,`durationMs`)),tokenRuns:Di(n.tokenRuns,E(t,`tokenRuns`)),costRuns:Di(n.costRuns,E(t,`costRuns`)),durationRuns:Di(n.durationRuns,E(t,`durationRuns`))}})}})}:{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),series:Ci(n.series,E(t,`series`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),...n.unit===void 0?{}:{unit:wi(n.unit,E(t,`unit`))}}}),...n.durationRows===void 0?{}:{durationRows:Ci(n.durationRows,E(t,`durationRows`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),createdAt:wi(n.createdAt,E(t,`createdAt`)),completedAt:wi(n.completedAt,E(t,`completedAt`)),durationMs:Di(n.durationMs,E(t,`durationMs`))}}),excludedDurationCount:Di(n.excludedDurationCount,E(t,`excludedDurationCount`))},totals:Rf(n.totals,E(t,`totals`)),buckets:Ci(n.buckets,E(t,`buckets`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),values:Rf(n.values,E(t,`values`))}})}},Bf=Object.keys({completed:!0,failed:!0}),Vf={Completed:Bf[0],Failed:Bf[1]},Hf=(e,t=``)=>{let n=Si(e,t),r=e=>Di(n[e],E(t,e)),i=e=>n[e]===null?null:r(e);return{window:Lf(n.window,E(t,`window`)),runs:r(`runs`),completed:r(Vf.Completed),blockedOrAwaitingApproval:r(`blockedOrAwaitingApproval`),failed:r(Vf.Failed),totalTokens:r(`totalTokens`),totalCostUsd:r(`totalCostUsd`),medianRunDurationMs:i(`medianRunDurationMs`),workItemsDone:r(`workItemsDone`),acceptedChildResults:r(`acceptedChildResults`),correctiveActivations:r(`correctiveActivations`),medianEndToEndDurationMs:i(`medianEndToEndDurationMs`)}},Uf=(e,t=``)=>{let n=Si(e,t),r=Si(n.values,E(t,`values`));return{collectedAt:wi(n.collectedAt,E(t,`collectedAt`)),window:Wf(n.window,E(t,`window`)),values:Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Di(n,E(t,`values.${e}`))]))}};function Wf(e,t){let n=Si(e,t);return{days:Di(n.days,E(t,`days`)),from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`))}}var Gf=(e,t=``)=>{let n=Si(e,t);return{status:Xf(n.status,E(t,`status`)),version:wi(n.version,E(t,`version`)),checkedAt:wi(n.checkedAt,E(t,`checkedAt`)),...n.checks===void 0?{}:{checks:Ci(n.checks,E(t,`checks`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,E(t,`name`)),status:Xf(n.status,E(t,`status`)),...Oi(n,`detail`,t)}})},...n.adapters===void 0?{}:{adapters:Ci(n.adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapterId`)),provider:wi(n.provider,E(t,`provider`)),scope:wi(n.scope,E(t,`scope`)),channel:wi(n.channel,E(t,`channel`)),status:Zf(n.status,E(t,`status`)),successCount:Di(n.successCount,E(t,`successCount`)),failureCount:Di(n.failureCount,E(t,`failureCount`)),...Oi(n,`detail`,t)}})}}},Kf=(e,t=``)=>{let n=Si(e,t),r=E(t,`configuration`);return{configuration:Si(ji(n.configuration,r),r)}},qf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapterId`)),provider:wi(n.provider,E(t,`provider`)),commands:Ci(n.commands,E(t,`commands`),(e,t=``)=>({syntax:wi(Si(e,t).syntax,E(t,`syntax`))}))}})}),Jf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapter`)),provider:wi(n.provider,E(t,`provider`)),hooks:Ci(n.hooks,E(t,`hooks`),(e,t=``)=>{let n=Si(e,t);return{scope:wi(n.scope,E(t,`scope`)),endpoint:wi(n.endpoint,E(t,`endpoint`)),events:Ci(n.events,E(t,`events`),wi),secret:wi(n.secret,E(t,`secret`))}})}})});function Yf(e,t){try{let t=Si(e,`problem`);return{type:wi(t.type,`problem.type`),title:wi(t.title,`problem.title`),status:Di(t.status,`problem.status`),...Oi(t,`detail`,`problem`),...Oi(t,`instance`,`problem`),...Oi(t,`code`,`problem`),...t.retryable===void 0?{}:{retryable:Ei(t.retryable,`problem.retryable`)},...t.current===void 0?{}:{current:ji(t.current,`problem.current`)},...t.violations===void 0?{}:{violations:Ci(t.violations,`problem.violations`,(e,t=``)=>{let n=Si(e,t);return{path:wi(n.path,E(t,`path`)),message:wi(n.message,E(t,`message`))}})}}}catch{return{type:`about:blank`,title:`Request failed`,status:t}}}function Xf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&Mi(t),n}function Zf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&n!==Vd.Unknown&&Mi(t),n}var Qf=ju({triggerId:Zl(),coordinationKey:Zl(),source:tf,disposition:zu(Ad),sources:ku(tf),manualOutcome:af.optional(),activeWorkItemId:Zl().nullable()}),$f=ju({claim:ju({triggerId:Zl(),coordinationKey:Zl(),source:tf,sources:ku(tf),workItemId:Zl(),workflowInstanceId:Zl(),workflowName:Zl()}),claimedAt:Zl(),startedAt:Zl().optional(),finishedAt:Zl().optional(),failureOutcomeCount:yu().optional(),result:ju({triggerId:Zl(),coordinationKey:Zl(),workItemId:Zl(),workflowInstanceId:Zl(),status:zu([Nd.Completed,Nd.Superseded]),reason:Zl().optional()}).optional(),workItemKey:Zl()}),ep=ju({operatorInstructions:ju({contextScope:Zl(),revisionId:Zl(),content:Zl(),author:Zl(),occurredAt:Zl()}).nullable().optional(),activeInvocation:ju({activeWorkItemId:Zl(),workItemKey:Zl(),triggerId:Zl(),workflowInstanceId:Zl(),workflowStatus:zu(Ld).nullable(),blockReason:Zl().nullable(),retryEligible:Cu()}).nullable(),triggerId:Zl(),status:zu(Ud),definition:rf.nullable(),paused:Cu(),pauseReason:Zl().nullable(),nextOccurrence:Zl().nullable(),pending:ku(Qf),latestSkip:nf.nullable(),invocations:ku($f)});function tp(e){return ep.parse(e)}function mee(e){return ku(ep).parse(e)}function np(e){return ku(ju({contextScope:Zl(),revisionId:Zl(),content:Zl().nullable(),author:Zl(),occurredAt:Zl()})).parse(e)}var hee=class extends Error{constructor(e){super(e.detail??e.title),this.problem=e,this.name=`ApiProblem`}},rp=class{constructor(e=fetch,t=`/api/v1`){this.fetchImplementation=e,this.baseUrl=t,this.auth={session:async()=>{let e=this.fetchImplementation;return(await e(`${this.baseUrl}/auth/session`)).ok},login:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({accessKey:e})})).ok},redeem:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/redeem`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({grant:e})})).ok}},this.triggers={list:e=>this.get(`/triggers`,e=>{let t=sf(mee)(e),n=Si(e,`triggers`);return{...t,orphanedInstructions:np(n.orphanedInstructions??[])}},e),detail:(e,t)=>this.get(`/triggers/`+encodeURIComponent(e),sf(tp),t),saveInstructions:(e,t,n,r)=>this.request(`/triggers/`+encodeURIComponent(e)+`/commands/instructions`,sf(uf),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({content:t,expectedRevisionId:n,idempotencyKey:r})}),command:(e,t,n,r)=>this.command(`/triggers/`+encodeURIComponent(e)+`/commands/`+t,n,uf,r)},this.board={list:(e,t)=>this.get(`/board${ip({cursor:e})}`,cf(fee),t)},this.status={get:e=>this.get(`/status`,sf(e=>e),e)},this.controlPlane={status:e=>this.get(`/control-plane/status`,sf(lf),e),pauseDispatch:(e,t)=>this.command(`/control-plane/commands/pause-dispatch`,e,uf,t),resumeDispatch:(e,t)=>this.command(`/control-plane/commands/resume-dispatch`,e,uf,t),clearMaintenance:(e,t,n)=>this.request(`/control-plane/commands/clear-maintenance`,sf(uf),{method:`POST`,body:JSON.stringify({attemptId:e,idempotencyKey:t}),headers:{"content-type":`application/json`},...n===void 0?{}:{signal:n}})},this.work={list:(e={},t)=>this.get(`/work-items${ip(e)}`,cf(df),t),detail:(e,t)=>this.get(`/work-items/${encodeURIComponent(e)}`,sf(Cf),t),artifactText:async(e,t,n)=>{let r=this.fetchImplementation,i=await r(`${this.baseUrl}/work-items/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{...n===void 0?{}:{signal:n}});if(!i.ok)throw Error(`Unable to load this artifact. Please try again.`);return i.text()},transcript:(e,t,n)=>this.get(`/work-items/${encodeURIComponent(e)}/transcripts/${encodeURIComponent(t)}`,sf(Df),n),message:(e,t,n,r,i)=>this.request(`/work-items/${encodeURIComponent(e)}/commands/message`,sf(uf),{method:`POST`,body:JSON.stringify({idempotencyKey:n,body:t,...i===void 0?{}:{continuation:i}}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),command:(e,t,n,r)=>this.command(`/work-items/${encodeURIComponent(e)}/commands/${t}`,n,uf,r)},this.resources={list:(e,t)=>this.get(`/resources${ip({cursor:e})}`,cf(hf),t)},this.orchestration={list:(e,t)=>this.get(`/workflow-instances${ip({cursor:e})}`,cf(gf),t)},this.workflowDiagrams={get:(e,t)=>this.get(`/workflow-diagrams${ip({workItemKey:e})}`,sf(pee),t)},this.execution={runs:(e,t)=>this.get(`/runs${ip({cursor:e})}`,cf(Sf),t),run:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}`,sf(Sf),t),transcript:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}/transcript`,sf(Ef),t),resolveAmbiguousRun:(e,t,n,r)=>this.request(`/runs/${encodeURIComponent(e)}/commands/resolve`,sf(uf),{method:`POST`,body:JSON.stringify({idempotencyKey:n,...t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),runners:e=>this.get(`/runners`,cf(Tf),e),pauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/pause`,t,uf,n),unpauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/unpause`,t,uf,n)},this.events={list:(e,t,n)=>{let r=typeof t==`string`?t:void 0,i=typeof t==`string`?n:t;return this.get(`/events${ip({cursor:e,workItemKey:r})}`,cf(wf),i)}},this.observability={reports:e=>this.get(`/observability/reports`,sf(If),e),report:(e,t,n)=>this.get(`/observability/reports`+ip({window:e,report:t}),sf(zf),n),summary:(e,t)=>this.get(`/observability/summary`+ip({window:e}),sf(Hf),t),metrics:(e=7,t)=>this.get(`/observability/metrics${ip({days:String(e)})}`,sf(Uf),t)},this.system={health:e=>this.get(`/system/health`,sf(Gf),e),configuration:e=>this.get(`/system/configuration`,sf(Kf),e),commands:e=>this.get(`/system/commands`,sf(qf),e),webhooks:e=>this.get(`/system/webhooks`,sf(Jf),e)}}async command(e,t,n,r){return this.request(e,sf(n),{method:`POST`,body:JSON.stringify({idempotencyKey:t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}})}get(e,t,n){return this.request(e,t,n===void 0?{}:{signal:n})}async request(e,t,n){let r=this.fetchImplementation,i=await r(`${this.baseUrl}${e}`,{...n,headers:{accept:`application/json, application/problem+json`,...n.headers}}),a=await i.json();if(!i.ok)throw new hee(Yf(a,i.status));return t(a)}};function ip(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&t.set(n,r);let n=t.toString();return n===``?``:`?${n}`}var ap=(0,C.createContext)(null);function op(){let e=(0,C.useContext)(ap);if(e===null)throw Error(`WakeApiClient is not configured`);return e}var sp={prefix:`fas`,iconName:`filter`,icon:[512,512,[],`f0b0`,`M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z`]},gee={prefix:`fas`,iconName:`table-columns`,icon:[448,512,[`columns`],`f0db`,`M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z`]},cp={prefix:`fas`,iconName:`paper-plane`,icon:[576,512,[61913],`f1d8`,`M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z`]},lp={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},_ee={prefix:`fas`,iconName:`heart-pulse`,icon:[512,512,[`heartbeat`],`f21e`,`M256 107.9L241 87.1C216 52.5 175.9 32 133.1 32 59.6 32 0 91.6 0 165.1l0 2.6c0 23.6 6.2 48 16.6 72.3l106 0c3.2 0 6.1-1.9 7.4-4.9l31.8-76.3c3.7-8.8 12.3-14.6 21.8-14.8s18.3 5.4 22.2 14.1l51.3 113.9 41.4-82.8c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3l23.2 46.3c1.4 2.7 4.1 4.4 7.2 4.4l123.6 0c10.5-24.3 16.6-48.7 16.6-72.3l0-2.6C512 91.6 452.4 32 378.9 32 336.2 32 296 52.5 271 87.1l-15 20.7zM469.6 288l-97.8 0c-21.2 0-40.6-12-50.1-31l-1.7-3.4-42.5 85.1c-4.1 8.3-12.7 13.5-22 13.3s-17.6-5.7-21.4-14.1l-49.3-109.5-10.5 25.2c-8.7 20.9-29.1 34.5-51.7 34.5l-80.2 0c47.2 73.8 123 141.7 170.4 177.9 12.4 9.4 27.6 14.1 43.1 14.1s30.8-4.6 43.1-14.1C346.6 429.7 422.4 361.8 469.6 288z`]},vee={prefix:`fas`,iconName:`chart-line`,icon:[512,512,[`line-chart`],`f201`,`M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z`]},up={prefix:`fas`,iconName:`play`,icon:[448,512,[9654],`f04b`,`M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z`]},dp={prefix:`fas`,iconName:`sliders`,icon:[512,512,[`sliders-h`],`f1de`,`M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z`]},fp={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]},pp={prefix:`fas`,iconName:`clock-rotate-left`,icon:[576,512,[`history`],`f1da`,`M288 64c106 0 192 86 192 192S394 448 288 448c-65.2 0-122.9-32.5-157.6-82.3-10.1-14.5-30.1-18-44.6-7.9s-18 30.1-7.9 44.6C124.1 468.6 201 512 288 512 429.4 512 544 397.4 544 256S429.4 0 288 0C202.3 0 126.5 42.1 80 106.7L80 80c0-17.7-14.3-32-32-32S16 62.3 16 80l0 112c0 17.7 14.3 32 32 32l24.6 0c.5 0 1 0 1.5 0l86 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-38.3 0C154.9 102.6 217 64 288 64zm24 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1z`]},mp={prefix:`fas`,iconName:`hourglass-half`,icon:[384,512,[`hourglass-2`],`f252`,`M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z`]},hp={prefix:`fas`,iconName:`chevron-left`,icon:[320,512,[9001],`f053`,`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z`]},gp={prefix:`fas`,iconName:`arrow-down-wide-short`,icon:[576,512,[`sort-amount-asc`,`sort-amount-down`],`f160`,`M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z`]},_p={prefix:`fas`,iconName:`bars`,icon:[448,512,[`navicon`],`f0c9`,`M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z`]},vp={prefix:`fas`,iconName:`list-check`,icon:[512,512,[`tasks`],`f0ae`,`M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z`]};function yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bp(e){if(Array.isArray(e))return e}function xp(e){if(Array.isArray(e))return yp(e)}function Sp(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Cp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Fp(r.key),r)}}function wp(e,t,n){return t&&Cp(e.prototype,t),n&&Cp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tp(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Lp(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
74
|
+
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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function tl(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:il(t,`input`,e.processors),output:il(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function nl(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 nl(r.element,n);if(r.type===`set`)return nl(r.valueType,n);if(r.type===`lazy`)return nl(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`)return nl(r.innerType,n);if(r.type===`intersection`)return nl(r.left,n)||nl(r.right,n);if(r.type===`record`||r.type===`map`)return nl(r.keyType,n)||nl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:nl(r.in,n)||nl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(nl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(nl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(nl(e,n))return!0;return!!(r.rest&&nl(r.rest,n))}return!1}var rl=(e,t={})=>n=>{let r=Qc({...n,processors:t});return $c(e,r),el(r,e),tl(r,e)},il=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Qc({...i??{},target:a,io:t,processors:n});return $c(e,o),el(o,e),tl(o,e)},al={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ol=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=al[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},sl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},cl=(e,t,n,r)=>{n.type=`boolean`},ll=(e,t,n,r)=>{n.not={}},ul=(e,t,n,r)=>{let i=e._zod.def,a=Bi(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},dl=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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},fl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},pl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ml=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=$c(a.element,t,{...r,path:[...r.path,`items`]})},hl=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=$c(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]._zod;return t.io===`input`?n.optin===void 0:n.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=$c(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},gl=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>$c(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},_l=(e,t,n,r)=>{let i=e._zod.def,a=$c(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=$c(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},vl=(e,t,n,r)=>{let i=e._zod.def,a=$c(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`}]},yl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Sl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Cl=(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;$c(o,t,r);let s=t.seen.get(e);s.ref=o},wl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Tl=(e,t,n,r)=>{let i=e._zod.def;$c(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},El=Fi(`ZodISODateTime`,(e,t)=>{Xo.init(e,t),Ql.init(e,t)});function Dl(e){return bc(El,e)}var Ol=Fi(`ZodISODate`,(e,t)=>{Zo.init(e,t),Ql.init(e,t)});function kl(e){return lee(Ol,e)}var Al=Fi(`ZodISOTime`,(e,t)=>{Qo.init(e,t),Ql.init(e,t)});function jl(e){return xc(Al,e)}var Ml=Fi(`ZodISODuration`,(e,t)=>{$o.init(e,t),Ql.init(e,t)});function Nl(e){return Sc(Ml,e)}var Pl=Fi(`ZodError`,(e,t)=>{Sa.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ta(e,t)},flatten:{value:t=>wa(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Vi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Vi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fl=Ea(Pl),Il=Da(Pl),Ll=Oa(Pl),Rl=Aa(Pl),zl=Ma(Pl),Bl=Na(Pl),Vl=Pa(Pl),Hl=Fa(Pl),Ul=Ia(Pl),Wl=La(Pl),Gl=Ra(Pl),uee=za(Pl),Kl=new WeakMap;function ql(e,t,n){let r=Object.getPrototypeOf(e),i=Kl.get(r);if(i||(i=new Set,Kl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Jl=Fi(`ZodType`,(e,t)=>(Io.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:il(e,`input`),output:il(e,`output`)}}),e.toJSONSchema=rl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Fl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ll(e,t,n),e.parseAsync=async(t,n)=>Il(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Rl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zl(e,t,n),e.decode=(t,n)=>Bl(e,t,n),e.encodeAsync=async(t,n)=>Vl(e,t,n),e.decodeAsync=async(t,n)=>Hl(e,t,n),e.safeEncode=(t,n)=>Ul(e,t,n),e.safeDecode=(t,n)=>Wl(e,t,n),e.safeEncodeAsync=async(t,n)=>Gl(e,t,n),e.safeDecodeAsync=async(t,n)=>uee(e,t,n),ql(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Yi(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 aa(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ld(e,t))},superRefine(e,t){return this.check(ud(e,t))},overwrite(e){return this.check(Hc(e))},optional(){return Gu(this)},exactOptional(){return qu(this)},nullable(){return Yu(this)},nullish(){return Gu(Yu(this))},nonoptional(e){return td(this,e)},array(){return ku(this)},or(e){return Nu([this,e])},and(e){return Lu(this,e)},transform(e){return ad(this,Uu(e))},default(e){return Zu(this,e)},prefault(e){return $u(this,e)},catch(e){return rd(this,e)},pipe(e){return ad(this,e)},readonly(){return sd(this)},describe(e){let t=this.clone();return Xs.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xs.get(this);let t=this.clone();return Xs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Xs.get(e)?.description},configurable:!0}),e)),Yl=Fi(`_ZodString`,(e,t)=>{Lo.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ql(e,`_ZodString`,{regex(...e){return this.check(Ic(...e))},includes(...e){return this.check(zc(...e))},startsWith(...e){return this.check(Bc(...e))},endsWith(...e){return this.check(Vc(...e))},min(...e){return this.check(Pc(...e))},max(...e){return this.check(Nc(...e))},length(...e){return this.check(Fc(...e))},nonempty(...e){return this.check(Pc(1,...e))},lowercase(e){return this.check(Lc(e))},uppercase(e){return this.check(Rc(e))},trim(){return this.check(Wc())},normalize(...e){return this.check(Uc(...e))},toLowerCase(){return this.check(Gc())},toUpperCase(){return this.check(Kc())},slugify(){return this.check(qc())}})}),Xl=Fi(`ZodString`,(e,t)=>{Lo.init(e,t),Yl.init(e,t),e.email=t=>e.check(Qs($l,t)),e.url=t=>e.check(ic(nu,t)),e.jwt=t=>e.check(yc(_u,t)),e.emoji=t=>e.check(ac(ru,t)),e.guid=t=>e.check($s(eu,t)),e.uuid=t=>e.check(ec(tu,t)),e.uuidv4=t=>e.check(tc(tu,t)),e.uuidv6=t=>e.check(nc(tu,t)),e.uuidv7=t=>e.check(rc(tu,t)),e.nanoid=t=>e.check(oc(iu,t)),e.guid=t=>e.check($s(eu,t)),e.cuid=t=>e.check(sc(au,t)),e.cuid2=t=>e.check(cc(ou,t)),e.ulid=t=>e.check(lc(su,t)),e.base64=t=>e.check(gc(mu,t)),e.base64url=t=>e.check(_c(hu,t)),e.xid=t=>e.check(uc(cu,t)),e.ksuid=t=>e.check(dc(lu,t)),e.ipv4=t=>e.check(fc(uu,t)),e.ipv6=t=>e.check(pc(du,t)),e.cidrv4=t=>e.check(mc(fu,t)),e.cidrv6=t=>e.check(hc(pu,t)),e.e164=t=>e.check(vc(gu,t)),e.datetime=t=>e.check(Dl(t)),e.date=t=>e.check(kl(t)),e.time=t=>e.check(jl(t)),e.duration=t=>e.check(Nl(t))});function Zl(e){return Zs(Xl,e)}var Ql=Fi(`ZodStringFormat`,(e,t)=>{Ro.init(e,t),Yl.init(e,t)}),$l=Fi(`ZodEmail`,(e,t)=>{Vo.init(e,t),Ql.init(e,t)}),eu=Fi(`ZodGUID`,(e,t)=>{zo.init(e,t),Ql.init(e,t)}),tu=Fi(`ZodUUID`,(e,t)=>{Bo.init(e,t),Ql.init(e,t)}),nu=Fi(`ZodURL`,(e,t)=>{Ho.init(e,t),Ql.init(e,t)}),ru=Fi(`ZodEmoji`,(e,t)=>{Uo.init(e,t),Ql.init(e,t)}),iu=Fi(`ZodNanoID`,(e,t)=>{Wo.init(e,t),Ql.init(e,t)}),au=Fi(`ZodCUID`,(e,t)=>{Go.init(e,t),Ql.init(e,t)}),ou=Fi(`ZodCUID2`,(e,t)=>{Ko.init(e,t),Ql.init(e,t)}),su=Fi(`ZodULID`,(e,t)=>{qo.init(e,t),Ql.init(e,t)}),cu=Fi(`ZodXID`,(e,t)=>{Jo.init(e,t),Ql.init(e,t)}),lu=Fi(`ZodKSUID`,(e,t)=>{Yo.init(e,t),Ql.init(e,t)}),uu=Fi(`ZodIPv4`,(e,t)=>{es.init(e,t),Ql.init(e,t)}),du=Fi(`ZodIPv6`,(e,t)=>{ts.init(e,t),Ql.init(e,t)}),fu=Fi(`ZodCIDRv4`,(e,t)=>{ns.init(e,t),Ql.init(e,t)}),pu=Fi(`ZodCIDRv6`,(e,t)=>{rs.init(e,t),Ql.init(e,t)}),mu=Fi(`ZodBase64`,(e,t)=>{as.init(e,t),Ql.init(e,t)}),hu=Fi(`ZodBase64URL`,(e,t)=>{ss.init(e,t),Ql.init(e,t)}),gu=Fi(`ZodE164`,(e,t)=>{cs.init(e,t),Ql.init(e,t)}),_u=Fi(`ZodJWT`,(e,t)=>{us.init(e,t),Ql.init(e,t)}),vu=Fi(`ZodNumber`,(e,t)=>{ds.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r),ql(e,`ZodNumber`,{gt(e,t){return this.check(Ac(e,t))},gte(e,t){return this.check(jc(e,t))},min(e,t){return this.check(jc(e,t))},lt(e,t){return this.check(Oc(e,t))},lte(e,t){return this.check(kc(e,t))},max(e,t){return this.check(kc(e,t))},int(e){return this.check(xu(e))},safe(e){return this.check(xu(e))},positive(e){return this.check(Ac(0,e))},nonnegative(e){return this.check(jc(0,e))},negative(e){return this.check(Oc(0,e))},nonpositive(e){return this.check(kc(0,e))},multipleOf(e,t){return this.check(Mc(e,t))},step(e,t){return this.check(Mc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function yu(e){return Cc(vu,e)}var bu=Fi(`ZodNumberFormat`,(e,t)=>{cee.init(e,t),vu.init(e,t)});function xu(e){return wc(bu,e)}var Su=Fi(`ZodBoolean`,(e,t)=>{fs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r)});function Cu(e){return Tc(Su,e)}var wu=Fi(`ZodUnknown`,(e,t)=>{ps.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Tu(){return Ec(wu)}var Eu=Fi(`ZodNever`,(e,t)=>{ms.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r)});function Du(e){return Dc(Eu,e)}var Ou=Fi(`ZodArray`,(e,t)=>{gs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ml(e,t,n,r),e.element=t.element,ql(e,`ZodArray`,{min(e,t){return this.check(Pc(e,t))},nonempty(e){return this.check(Pc(1,e))},max(e,t){return this.check(Nc(e,t))},length(e,t){return this.check(Fc(e,t))},unwrap(){return this.element}})});function ku(e,t){return Jc(Ou,e,t)}var Au=Fi(`ZodObject`,(e,t)=>{xs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hl(e,t,n,r),qi(e,`shape`,()=>t.shape),ql(e,`ZodObject`,{keyof(){return zu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Tu()})},loose(){return this.clone({...this._zod.def,catchall:Tu()})},strict(){return this.clone({...this._zod.def,catchall:Du()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return da(this,e)},safeExtend(e){return aee(this,e)},merge(e){return oee(this,e)},pick(e){return la(this,e)},omit(e){return ua(this,e)},partial(...e){return fa(Wu,this,e[0])},required(...e){return pa(ed,this,e[0])}})});function ju(e,t){return new Au({type:`object`,shape:e??{},...oa(t)})}var Mu=Fi(`ZodUnion`,(e,t)=>{Cs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r),e.options=t.options});function Nu(e,t){return new Mu({type:`union`,options:e,...oa(t)})}var Pu=Fi(`ZodDiscriminatedUnion`,(e,t)=>{Mu.init(e,t),ws.init(e,t)});function Fu(e,t,n){return new Pu({type:`union`,options:t,discriminator:e,...oa(n)})}var Iu=Fi(`ZodIntersection`,(e,t)=>{Ts.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r)});function Lu(e,t){return new Iu({type:`intersection`,left:e,right:t})}var Ru=Fi(`ZodEnum`,(e,t)=>{Os.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ul(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);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 Ru({...t,checks:[],...oa(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 Ru({...t,checks:[],...oa(r),entries:i})}});function zu(e,t){return new Ru({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...oa(t)})}var Bu=Fi(`ZodLiteral`,(e,t)=>{ks.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dl(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 Vu(e,t){return new Bu({type:`literal`,values:Array.isArray(e)?e:[e],...oa(t)})}var Hu=Fi(`ZodTransform`,(e,t)=>{As.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Li(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ba(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(ba(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Uu(e){return new Hu({type:`transform`,transform:e})}var Wu=Fi(`ZodOptional`,(e,t)=>{Ms.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gu(e){return new Wu({type:`optional`,innerType:e})}var Ku=Fi(`ZodExactOptional`,(e,t)=>{Ns.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qu(e){return new Ku({type:`optional`,innerType:e})}var Ju=Fi(`ZodNullable`,(e,t)=>{Ps.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Ju({type:`nullable`,innerType:e})}var Xu=Fi(`ZodDefault`,(e,t)=>{Fs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Zu(e,t){return new Xu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():na(t)}})}var Qu=Fi(`ZodPrefault`,(e,t)=>{Ls.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $u(e,t){return new Qu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():na(t)}})}var ed=Fi(`ZodNonOptional`,(e,t)=>{Rs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e,t){return new ed({type:`nonoptional`,innerType:e,...oa(t)})}var nd=Fi(`ZodCatch`,(e,t)=>{Bs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rd(e,t){return new nd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var id=Fi(`ZodPipe`,(e,t)=>{Vs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e.in=t.in,e.out=t.out});function ad(e,t){return new id({type:`pipe`,in:e,out:t})}var od=Fi(`ZodReadonly`,(e,t)=>{Us.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sd(e){return new od({type:`readonly`,innerType:e})}var cd=Fi(`ZodCustom`,(e,t)=>{Gs.init(e,t),Jl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fl(e,t,n,r)});function ld(e,t={}){return Yc(cd,e,t)}function ud(e,t){return Xc(e,t)}var dd=e=>e,fd=dd({Day:`1d`,ThreeDays:`3d`,FiveDays:`5d`,Week:`7d`}),pd=Object.keys({accepted:!0,completed:!0}),md={Accepted:pd[0],Completed:pd[1]},hd={Active:Object.keys({active:!0})[0]},gd={Adapter:Object.keys({adapter:!0})[0]},_d=Object.keys({failed:!0,succeeded:!0}),vd={Failed:_d[0],Succeeded:_d[1]},yd=Object.keys({starting:!0,started:!0}),bd={Starting:yd[0],Started:yd[1]},xd=dd({Waiting:`waiting`,Done:`done`,Rejected:`rejected`,Blocked:`blocked`,Failed:`failed`,Integrated:`integrated`}),Sd=Object.keys({ready:!0,active:!0,"needs-input":!0,error:!0,finished:!0}),Cd={Ready:Sd[0],Active:Sd[1],NeedsInput:Sd[2],Error:Sd[3],Finished:Sd[4]};Object.keys({stage:!0})[0];var wd=Object.keys({input:!0,agent:!0}),Td={Input:wd[0],Agent:wd[1]},Ed=Object.keys({session:!0,run:!0}),Dd={Session:Ed[0],Run:Ed[1]},Od={Event:`event`,Cron:`cron`,Manual:`manual`},kd={started:!0},Ad={Started:Object.keys(kd)[0],Coalesced:`coalesced`,Skipped:`skipped`},jd={OwnScope:`own-scope`,Paused:`paused`,Removed:`removed`,DispatchPaused:`dispatch-paused`,Capacity:`capacity-unavailable`,PendingLimit:`pending-source-limit`},Md=Object.keys({completed:!0,superseded:!0}),Nd={Completed:Md[0],Superseded:Md[1]},Pd={Started:Object.keys(kd)[0],Coalesced:Ad.Coalesced,Skipped:Ad.Skipped},Fd=Object.keys({pause:!0,resume:!0,run:!0}),Id={Pause:Fd[0],Resume:Fd[1],Run:Fd[2]},Ld=dd({Active:`active`,Waiting:`waiting`,Completed:`completed`,Blocked:`blocked`,Superseded:`superseded`}),Rd=Object.keys({"execution-recovery-ambiguous:":!0})[0];function zd(e){return e?.startsWith(Rd)===!0||e!==void 0&&/^run-ambiguous-after-\d+-attempts$/.test(e)}var Bd=Cd,Vd=dd({Unknown:`unknown`}),Hd=Object.keys({enabled:!0,paused:!0,running:!0,removed:!0}),Ud={Enabled:Hd[0],Paused:Hd[1],Running:Hd[2],Removed:Hd[3]},Wd=Object.keys({pause:!0,resume:!0,run:!0});Wd[0],Wd[1],Wd[2];var Gd=Object.keys({activity:!0,watch:!0,"watch-gate":!0,reactor:!0}),Kd={Activity:Gd[0],Watch:Gd[1],WatchGate:Gd[2],Reactor:Gd[3]},[qd,Jd,Yd]=Object.keys({complete:!0,maintenance:!0,integration:!0});function Xd(e,t,n){if(e===void 0)return;let r=Si(e,t);return{rootWorkItemKey:wi(r.rootWorkItemKey,E(t,`rootWorkItemKey`)),...Oi(r,`parentWorkItemKey`,t),...r.qa===void 0?{}:{qa:ef(r.qa,E(t,`qa`))},...r.attention===void 0?{}:{attention:Zd(r.attention,E(t,`attention`))},...r.cohorts===void 0?{}:{cohorts:Ci(r.cohorts,E(t,`cohorts`),(e,t=``)=>{let n=Si(e,t);return{cohortId:wi(n.cohortId,E(t,`cohortId`)),settled:Ei(n.settled,E(t,`settled`)),...Oi(n,`failureReason`,t)}})},children:Ci(r.children,E(t,`children`),(e,t=``)=>{let r=Si(e,t);return{workItemKey:wi(r.workItemKey,E(t,`workItemKey`)),workItemId:wi(r.workItemId,E(t,`workItemId`)),...Oi(r,`externalRef`,t),parentWorkItemKey:wi(r.parentWorkItemKey,E(t,`parentWorkItemKey`)),objective:wi(r.objective,E(t,`objective`)),workflowName:wi(r.workflowName,E(t,`workflowName`)),status:wi(r.status,E(t,`status`)),...Oi(r,`currentStage`,t),cohortId:wi(r.cohortId,E(t,`cohortId`)),...r.repository===void 0?{}:{repository:Qd(r.repository,E(t,`repository`))},...Oi(r,`prerequisiteBlocker`,t),...r.prerequisites===void 0?{}:{prerequisites:Ci(r.prerequisites,E(t,`prerequisites`),wi)},...r.replaces===void 0?{}:{replaces:{cohortId:wi(Si(r.replaces,E(t,`replaces`)).cohortId,E(t,`replaces.cohortId`)),assignmentId:wi(Si(r.replaces,E(t,`replaces`)).assignmentId,E(t,`replaces.assignmentId`))}},...r.outputs===void 0?{}:{outputs:Ci(r.outputs,E(t,`outputs`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,E(t,`name`)),kind:wi(n.kind,E(t,`kind`)),required:Ei(n.required,E(t,`required`)),selected:Ei(n.selected,E(t,`selected`)),stale:Ei(n.stale,E(t,`stale`)),...n.repository===void 0?{}:{repository:Qd(n.repository,E(t,`repository`))}}})},...Oi(r,`blockReason`,t),resources:Ci(r.resources,E(t,`resources`),n)}})}}function Zd(e,t){let n=Si(e,t);return{cohortId:wi(n.cohortId,E(t,`cohortId`)),revision:Di(n.revision,E(t,`revision`)),blockers:Ci(n.blockers,E(t,`blockers`),(e,t=``)=>{let n=Si(e,t);return{blockerId:wi(n.blockerId,E(t,`blockerId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),kind:wi(n.kind,E(t,`kind`)),reason:wi(n.reason,E(t,`reason`)),answered:Ei(n.answered,E(t,`answered`))}})}}function Qd(e,t){let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),pullRequestBase:wi(n.pullRequestBase,E(t,`pullRequestBase`))}}function $d(e,t){let n=Si(e,t);return{complete:Ei(n.complete,E(t,qd)),summary:wi(n.summary,E(t,`summary`)),targets:Ci(n.targets,E(t,`targets`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),state:wi(n.state,E(t,`state`)),layer:Di(n.layer,E(t,`layer`)),baseMovement:wi(n.baseMovement,E(t,`baseMovement`)),evidenceAffected:Ei(n.evidenceAffected,E(t,`evidenceAffected`)),...Oi(n,Jd,t),...Oi(n,`detail`,t)}}),maintenance:Ci(n.maintenance,E(t,Jd),(e,t=``)=>{let n=Si(e,t);return{maintenanceId:wi(n.maintenanceId,E(t,`maintenanceId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),kind:wi(n.kind,E(t,`kind`)),previousRevision:wi(n.previousRevision,E(t,`previousRevision`)),currentRevision:wi(n.currentRevision,E(t,`currentRevision`)),producerRunId:wi(n.producerRunId,E(t,`producerRunId`))}})}}function ef(e,t){let n=Si(e,t);return{...n.integration===void 0?{}:{integration:$d(n.integration,E(t,Yd))},selectionRevision:Di(n.selectionRevision,E(t,`selectionRevision`)),...Oi(n,`candidateId`,t),repositories:Ci(n.repositories,E(t,`repositories`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),revision:wi(n.revision,E(t,`revision`))}}),stale:Ci(n.stale,E(t,`stale`),wi),...n.staleOutputs===void 0?{}:{staleOutputs:Ci(n.staleOutputs,E(t,`staleOutputs`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),outputName:wi(n.outputName,E(t,`outputName`)),reason:wi(n.reason,E(t,`reason`))}})},...Oi(n,`verdict`,t),effective:Ei(n.effective,E(t,`effective`)),canComplete:Ei(n.canComplete,E(t,`canComplete`)),...Oi(n,`reason`,t),exhausted:Ei(n.exhausted,E(t,`exhausted`)),findings:Ci(n.findings,E(t,`findings`),wi)}}var tf=Fu(`kind`,[ju({kind:Vu(Od.Manual),commandId:Zl(),operator:Zl()}),ju({kind:Vu(Od.Cron),slot:Zl()}),ju({kind:Vu(Od.Event),eventId:Zl(),eventType:Zl()})]),nf=ju({triggerId:Zl(),source:tf,occurredAt:Zl(),reason:zu(jd)}),rf=ju({id:Zl(),workflow:Zl(),contextScope:Zl().optional(),on:ju({cron:Zl().optional(),events:ku(Zl()).optional()}),when:ju({capacityAvailable:Vu(!0)}).optional()}),af=Fu(`disposition`,[ju({disposition:Vu(Pd.Started),workItemId:Zl().optional()}),ju({disposition:Vu(Pd.Coalesced),activeWorkItemId:Zl().optional()}),ju({disposition:Vu(Pd.Skipped),reason:zu(jd)})]),of=Object.keys({stage:!0})[0];function sf(e){return(t,n=``)=>{let r=Si(t,n);return{data:e(r.data,E(n,`data`)),meta:xi(r.meta,E(n,`meta`))}}}function cf(e){return(t,n=``)=>{let r=Si(t,n),i=Si(r.page,E(n,`page`));return{items:Ci(r.items,E(n,`items`),e),page:{nextCursor:Ti(i.nextCursor,E(n,`page.nextCursor`)),hasMore:Ei(i.hasMore,E(n,`page.hasMore`)),...ki(i,`total`,E(n,`page`))},meta:xi(r.meta,E(n,`meta`))}}}var lf=(e,t=``)=>{let n=Si(e,t);return{dispatchPaused:Ei(n.dispatchPaused,E(t,`dispatchPaused`)),...Oi(n,`dispatchPausedUntil`,t),...Oi(n,`dispatchPauseReason`,t),updatedAt:wi(n.updatedAt,E(t,`updatedAt`)),...n.maintenanceLease===void 0?{}:{maintenanceLease:dee(n.maintenanceLease,E(t,`maintenanceLease`))}}};function dee(e,t){let n=Si(e,t);return{attemptId:wi(n.attemptId,E(t,`attemptId`)),phase:wi(n.phase,E(t,`phase`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`failure`,t)}}var uf=(e,t=``)=>{let n=Si(e,t),r=wi(n.status,E(t,`status`));return r!==md.Accepted&&r!==md.Completed&&Mi(E(t,`status`)),{...n.triggerOutcome===void 0?{}:{triggerOutcome:af.parse(n.triggerOutcome)},commandId:wi(n.commandId,E(t,`commandId`)),idempotencyKey:wi(n.idempotencyKey,E(t,`idempotencyKey`)),acceptedAt:wi(n.acceptedAt,E(t,`acceptedAt`)),status:r}},df=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workItemId:wi(n.workItemId,E(t,`workItemId`)),objective:wi(n.objective,E(t,`objective`)),state:wi(n.state,E(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),...Oi(n,`externalRef`,t),...Oi(n,`lastRunOutcome`,t),relatedWorkItems:Ci(n.relatedWorkItems,E(t,`relatedWorkItems`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t??``,`workItemKey`)),relation:wi(n.relation,E(t??``,`relation`))}})}},fee=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workItemId:wi(n.workItemId,E(t,`workItemId`)),objective:wi(n.objective,E(t,`objective`)),condition:wi(n.condition,E(t,`condition`)),...Ai(n,`frozen`,t),...Ai(n,`awaitingApproval`,t),...Ai(n,`extendEligible`,t),...Oi(n,`workflowName`,t),...Oi(n,of,t),...Oi(n,`blockReason`,t),...Oi(n,`retryCondition`,t),dwellSince:wi(n.dwellSince,E(t,`dwellSince`)),runCount:Di(n.runCount,E(t,`runCount`)),...Oi(n,`lastRunAt`,t),...Oi(n,`lastRunOutcome`,t),...ki(n,`lastRunAgeMs`,t),totalTokens:Di(n.totalTokens,E(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,E(t,`totalCostUsd`)),totalDurationMs:Di(n.totalDurationMs,E(t,`totalDurationMs`)),activeRuns:pf(n.activeRuns,E(t,`activeRuns`)),...Oi(n,`externalRef`,t),...Oi(n,`repository`,t),...Oi(n,`parentWorkItemKey`,t),...ki(n,`childCount`,t)}};function ff(e,t){let n=Si(e,t),r=wi(n.relation,E(t,`relation`)),i=wi(n.workItemKey,E(t,`workItemKey`));if(r===`granted`||r===`shared`)return{workItemKey:i,relation:r};throw Error(`${E(t,`relation`)} must be granted or shared`)}function pf(e,t){return e===void 0?{}:Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,mf(n,E(t,e))]))}function mf(e,t){let n=Si(e,t),r=wi(n.phase,E(t,`phase`));return Object.values(bd).includes(r)||Mi(E(t,`phase`)),{action:wi(n.action,E(t,`action`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),elapsedMs:Di(n.elapsedMs,E(t,`elapsedMs`)),phase:r,...Oi(n,`runnerName`,t)}}var hf=(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),adapter:wi(n[gd.Adapter],E(t,gd.Adapter)),kind:wi(n.kind,E(t,`kind`)),locatorLabel:wi(n.locatorLabel,E(t,`locatorLabel`)),capabilities:Ci(n.capabilities,E(t,`capabilities`),wi),...Oi(n,`title`,t),...Oi(n,`externalUrl`,t),...Oi(n,`revision`,t)}},gf=(e,t=``)=>{let n=Si(e,t),r=n.waitingFor;return{workflowInstanceId:wi(n.workflowInstanceId,E(t,`workflowInstanceId`)),workItemKey:wi(n.workItemKey,E(t,`workItemKey`)),workflowName:wi(n.workflowName,E(t,`workflowName`)),orchestrationGroupId:wi(n.orchestrationGroupId,E(t,`orchestrationGroupId`)),...Oi(n,`parentWorkflowInstanceId`,t),status:wi(n.status,E(t,`status`)),currentStage:wi(n.currentStage,E(t,`currentStage`)),...Oi(n,`blockReason`,t),...Oi(n,`retryCondition`,t),...Ai(n,`retryEligible`,t),...Ai(n,`extendEligible`,t),...n.mergePolicyBlock===void 0?{}:{mergePolicyBlock:Nf(n.mergePolicyBlock,E(t,`mergePolicyBlock`))},...r===void 0?{}:{waitingFor:{signalKind:wi(Si(r,E(t,`waitingFor`)).signalKind,E(t,`waitingFor.signalKind`))}}}},pee=(e,t=``)=>({diagrams:Ci(Si(e,t).diagrams,E(t,`diagrams`),_f)});function _f(e,t=``){let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),direction:`left-to-right`,stages:Ci(n.stages,E(t,`stages`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),children:Ci(n.children,E(t,`children`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),label:wi(n.label,E(t,`label`)),kind:vf(n.kind,E(t,`kind`)),...yf(n,t)}}),...yf(n,t)}}),transitions:Ci(n.transitions,E(t,`transitions`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),label:wi(n.label,E(t,`label`)),...Oi(n,`fromChildId`,t)}})}}function vf(e,t){let n=wi(e,t);return Object.values(Kd).includes(n)||Mi(t),n}function yf(e,t){let n=e.activeRuns;return{...Oi(e,`status`,t),...Oi(e,`lastOutcome`,t),...ki(e,`runCount`,t),...ki(e,`totalDurationMs`,t),...ki(e,`totalTokens`,t),...ki(e,`inputTokens`,t),...ki(e,`outputTokens`,t),...ki(e,`cacheReadTokens`,t),...ki(e,`cacheWriteTokens`,t),...ki(e,`totalCostUsd`,t),...n===void 0?{}:{activeRuns:Ci(n,E(t,`activeRuns`),(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,E(t,`runId`)),activity:wi(n.activity,E(t,`activity`)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`runnerName`,t)}})}}}var bf=[`DONE`,`FAILED`,`AMBIGUOUS`];function xf(e,t){let n=E(t,`resolution`),r=Si(e,n),i=wi(r.sentinel,E(n,`sentinel`));return bf.includes(i)||Mi(E(n,`sentinel`)),{sentinel:i,resolvedAt:wi(r.resolvedAt,E(n,`resolvedAt`))}}var Sf=(e,t=``)=>{let n=Si(e,t),r=n.failure,i=n.resolution;return{...n.operatorInstructions===void 0?{}:{operatorInstructions:Pf(n.operatorInstructions)},runId:wi(n.runId,E(t,`runId`)),activationId:wi(n.activationId,E(t,`activationId`)),activity:wi(n.activity,E(t,`activity`)),workflowInstanceId:wi(n.workflowInstanceId,E(t,`workflowInstanceId`)),orchestrationGroupId:wi(n.orchestrationGroupId,E(t,`orchestrationGroupId`)),attempt:Di(n.attempt,E(t,`attempt`)),status:wi(n.status,E(t,`status`)),active:Ei(n.active,E(t,hd.Active)),startedAt:wi(n.startedAt,E(t,`startedAt`)),...Oi(n,`executionStartedAt`,t),...Oi(n,`finishedAt`,t),sentinel:wi(n.sentinel,E(t,`sentinel`)),...Oi(n,`runnerName`,t),...Oi(n,`runnerModel`,t),...Oi(n,`workflowName`,t),...Oi(n,of,t),totalTokens:Di(n.totalTokens,E(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,E(t,`totalCostUsd`)),...n.outcome===void 0?{}:{outcome:ji(n.outcome,E(t,`outcome`))},...r===void 0?{}:{failure:{kind:wi(Si(r,E(t,`failure`)).kind,E(t,`failure.kind`))}},...i===void 0?{}:{resolution:xf(i,t)}}},Cf=(e,t=``)=>{let n=Object.keys({conversation:!0})[0],r=Object.keys({stage:!0})[0],i=Si(e,t),a=Si(i.orchestration,E(t,`orchestration`)),o=Si(i.execution,E(t,`execution`)),s=Si(i.activities,E(t,`activities`)),c=i.artifacts===void 0?[]:Ci(i.artifacts,E(t,`artifacts`),(e,t=``)=>{let n=Si(e,t);return{revisionId:wi(n.revisionId,E(t,`revisionId`)),producer:wi(n.producer,E(t,`producer`)),path:wi(n.path,E(t,`path`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),...Oi(n,`mediaType`,t),...ki(n,`byteLength`,t),...Oi(n,`digest`,t),href:wi(n.href,E(t,`href`)),...n.source===void 0?{}:{source:ff(n.source,E(t,`source`))}}}),l=i.conversation===void 0?void 0:Si(i.conversation,E(t,n));return{...i.delegation===void 0?{}:{delegation:Xd(i.delegation,E(t,`delegation`),hf)},...Oi(i,`triggerOrigin`,t),work:df(i.work,E(t,`work`)),resources:Ci(i.resources,E(t,`resources`),hf),orchestration:{primary:a.primary===null?null:gf(a.primary,E(t,`orchestration.primary`)),children:Ci(a.children,E(t,`orchestration.children`),gf),diagram:kf(a.diagram,E(t,`orchestration.diagram`))},execution:{runs:Ci(o.runs,E(t,`execution.runs`),Sf),transcriptGroups:Ci(o.transcriptGroups,E(t,`execution.transcriptGroups`),(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,E(t,`groupId`)),kind:jf(n.kind,E(t,`kind`)),...Oi(n,`cli`,t),latestAt:wi(n.latestAt,E(t,`latestAt`)),runIds:Ci(n.runIds,E(t,`runIds`),wi)}})},activities:s.pullRequest===void 0?{}:{pullRequest:Mf(s.pullRequest,E(t,`activities.pullRequest`))},artifacts:c,conversation:{canCreateEntries:l?.canCreateEntries===!0,canContinue:l?.canContinue===!0,entries:l===void 0?[]:Ci(l.entries,E(t,`${n}.entries`),(e,t=``)=>{let n=Si(e,t);return{entryId:wi(n.entryId,E(t,`entryId`)),body:wi(n.body,E(t,`body`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),origin:wi(n.origin,E(t,`origin`)),actorId:wi(n.actorId,E(t,`actorId`)),...Oi(n,`runId`,t),...Oi(n,r,t),...Oi(n,`sourceAdapter`,t),...Oi(n,`sourceResourceId`,t),...Oi(n,`sourceThreadId`,t),deleted:Ei(n.deleted,E(t,`deleted`)),representations:Ci(n.representations,E(t,`representations`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),externalId:wi(n.externalId,E(t,`externalId`))}})}})}}},wf=(e,t=``)=>{let n=Si(e,t),r=n.stream;return{id:wi(n.id,E(t,`id`)),type:wi(n.type,E(t,`type`)),occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),position:Di(n.position,E(t,`position`)),...r===void 0?{}:{stream:{kind:wi(Si(r,E(t,`stream`)).kind,E(t,`stream.kind`)),id:wi(Si(r,E(t,`stream`)).id,E(t,`stream.id`))}},...Oi(n,`causationId`,t),...Oi(n,`correlationId`,t),payload:n.payload}},Tf=(e,t=``)=>{let n=Si(e,t);return{runnerId:wi(n.runnerId,E(t,`runnerId`)),status:wi(n.status,E(t,`status`)),available:Ei(n.available,E(t,`available`)),...Oi(n,`detail`,t),updatedAt:wi(n.updatedAt,E(t,`updatedAt`))}},Ef=(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,E(t,`runId`)),...Oi(n,`groupId`,t),available:Ei(n.available,E(t,`available`)),entries:Ci(n.entries,E(t,`entries`),(e,t=``)=>{let n=Si(e,t);return{occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),channel:Af(n.channel,E(t,`channel`)),text:wi(n.text,E(t,`text`)),runId:wi(n.runId,E(t,`runId`)),groupId:wi(n.groupId,E(t,`groupId`)),...ki(n,`durationMs`,t)}})}},Df=(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,E(t,`groupId`)),available:Ei(n.available,E(t,`available`)),entries:Ci(n.entries,E(t,`entries`),Of)}};function Of(e,t=``){let n=Si(e,t);return{occurredAt:wi(n.occurredAt,E(t,`occurredAt`)),channel:Af(n.channel,E(t,`channel`)),text:wi(n.text,E(t,`text`)),runId:wi(n.runId,E(t,`runId`)),groupId:wi(n.groupId,E(t,`groupId`)),...ki(n,`durationMs`,t)}}function kf(e,t){return{href:wi(Si(e,t).href,E(t,`href`))}}function Af(e,t){let n=wi(e,t);return n!==Td.Input&&n!==Td.Agent&&Mi(t),n}function jf(e,t){let n=wi(e,t);return n!==Dd.Session&&n!==Dd.Run&&Mi(t),n}function Mf(e,t=``){let n=Si(e,t);return{resourceId:wi(n.resourceId,E(t,`resourceId`)),state:wi(n.state,E(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),headRevision:wi(n.headRevision,E(t,`headRevision`)),baseRevision:wi(n.baseRevision,E(t,`baseRevision`)),checks:wi(n.checks,E(t,`checks`))}}function Nf(e,t){let n=Si(e,t),r=wi(n.status,E(t,`status`));if(r!==`awaiting-human-merge`&&r!==`recovering`)throw Error(`${t}.status: invalid merge policy status`);let i=n.policy===void 0?void 0:Si(n.policy,E(t,`policy`));return{status:r,explanation:wi(n.explanation,E(t,`explanation`)),nextAction:wi(n.nextAction,E(t,`nextAction`)),...Oi(n,`href`,t),...i===void 0?{}:{policy:{...i.blockedPaths===void 0?{}:{blockedPaths:Ci(i.blockedPaths,E(t,`policy.blockedPaths`),wi)},...i.matchedPaths===void 0?{}:{matchedPaths:Ci(i.matchedPaths,E(t,`policy.matchedPaths`),wi)},...ki(i,`maxFilesChanged`,E(t,`policy`)),...ki(i,`filesChanged`,E(t,`policy`))}}}}function Pf(e){let t=Si(e,`operatorInstructions`);return{...Oi(t,`content`,`operatorInstructions`),...Oi(t,`author`,`operatorInstructions`),...Oi(t,`occurredAt`,`operatorInstructions`),contextScope:wi(t.contextScope,`operatorInstructions.contextScope`),revisionId:t.revisionId===null?null:wi(t.revisionId,`operatorInstructions.revisionId`)}}var Ff=(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,E(t,`id`)),title:wi(n.title,E(t,`title`))}},If=(e,t=``)=>Ci(e,t,Ff);function Lf(e,t){let n=Si(e,t),r=Object.values(fd).find(e=>e===n.id);return r===void 0&&Mi(E(t,`id`)),{id:r,from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),bucketMs:Di(n.bucketMs,E(t,`bucketMs`))}}function Rf(e,t){return Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,Di(n,E(t,e))]))}var zf=(e,t=``)=>{let n=Si(e,t);if(`statistics`in n){let e=(e,t=``)=>{let n=Si(e,t),r=e=>n[e]===null?null:Di(n[e],E(t,e));return{count:Di(n.count,E(t,`count`)),medianMs:r(`medianMs`),averageMs:r(`averageMs`)}};return{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),statistics:e(n.statistics,E(t,`statistics`)),groups:Ci(n.groups,E(t,`groups`),(t,n=``)=>{let r=Si(t,n);return{...Ff(t,n),rows:Ci(r.rows,E(n,`rows`),(t,n=``)=>({value:wi(Si(t,n).value,E(n,`value`)),...e(t,n)}))}}),buckets:Ci(n.buckets,E(t,`buckets`),(t,n=``)=>{let r=Si(t,n);return{from:wi(r.from,E(n,`from`)),to:wi(r.to,E(n,`to`)),...e(t,n)}})}}return`dimensions`in n?{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),total:Di(n.total,E(t,`total`)),dimensions:Ci(n.dimensions,E(t,`dimensions`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),rows:Ci(n.rows,E(t,`rows`),(e,t=``)=>{let n=Si(e,t);return{value:wi(n.value,E(t,`value`)),count:Di(n.count,E(t,`count`)),share:Di(n.share,E(t,`share`)),tokens:Di(n.tokens,E(t,`tokens`)),costUsd:Di(n.costUsd,E(t,`costUsd`)),durationMs:Di(n.durationMs,E(t,`durationMs`)),tokenRuns:Di(n.tokenRuns,E(t,`tokenRuns`)),costRuns:Di(n.costRuns,E(t,`costRuns`)),durationRuns:Di(n.durationRuns,E(t,`durationRuns`))}})}})}:{report:Ff(n.report,E(t,`report`)),window:Lf(n.window,E(t,`window`)),series:Ci(n.series,E(t,`series`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),...n.unit===void 0?{}:{unit:wi(n.unit,E(t,`unit`))}}}),...n.durationRows===void 0?{}:{durationRows:Ci(n.durationRows,E(t,`durationRows`),(e,t=``)=>{let n=Si(e,t);return{...Ff(e,t),createdAt:wi(n.createdAt,E(t,`createdAt`)),completedAt:wi(n.completedAt,E(t,`completedAt`)),durationMs:Di(n.durationMs,E(t,`durationMs`))}}),excludedDurationCount:Di(n.excludedDurationCount,E(t,`excludedDurationCount`))},totals:Rf(n.totals,E(t,`totals`)),buckets:Ci(n.buckets,E(t,`buckets`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`)),values:Rf(n.values,E(t,`values`))}})}},Bf=Object.keys({completed:!0,failed:!0}),Vf={Completed:Bf[0],Failed:Bf[1]},Hf=(e,t=``)=>{let n=Si(e,t),r=e=>Di(n[e],E(t,e)),i=e=>n[e]===null?null:r(e);return{window:Lf(n.window,E(t,`window`)),runs:r(`runs`),completed:r(Vf.Completed),blockedOrAwaitingApproval:r(`blockedOrAwaitingApproval`),failed:r(Vf.Failed),totalTokens:r(`totalTokens`),totalCostUsd:r(`totalCostUsd`),medianRunDurationMs:i(`medianRunDurationMs`),workItemsDone:r(`workItemsDone`),acceptedChildResults:r(`acceptedChildResults`),correctiveActivations:r(`correctiveActivations`),medianEndToEndDurationMs:i(`medianEndToEndDurationMs`)}},Uf=(e,t=``)=>{let n=Si(e,t),r=Si(n.values,E(t,`values`));return{collectedAt:wi(n.collectedAt,E(t,`collectedAt`)),window:Wf(n.window,E(t,`window`)),values:Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Di(n,E(t,`values.${e}`))]))}};function Wf(e,t){let n=Si(e,t);return{days:Di(n.days,E(t,`days`)),from:wi(n.from,E(t,`from`)),to:wi(n.to,E(t,`to`))}}var Gf=(e,t=``)=>{let n=Si(e,t);return{status:Xf(n.status,E(t,`status`)),version:wi(n.version,E(t,`version`)),checkedAt:wi(n.checkedAt,E(t,`checkedAt`)),...n.checks===void 0?{}:{checks:Ci(n.checks,E(t,`checks`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,E(t,`name`)),status:Xf(n.status,E(t,`status`)),...Oi(n,`detail`,t)}})},...n.adapters===void 0?{}:{adapters:Ci(n.adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapterId`)),provider:wi(n.provider,E(t,`provider`)),scope:wi(n.scope,E(t,`scope`)),channel:wi(n.channel,E(t,`channel`)),status:Zf(n.status,E(t,`status`)),successCount:Di(n.successCount,E(t,`successCount`)),failureCount:Di(n.failureCount,E(t,`failureCount`)),...Oi(n,`detail`,t)}})}}},Kf=(e,t=``)=>{let n=Si(e,t),r=E(t,`configuration`);return{configuration:Si(ji(n.configuration,r),r)}},qf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapterId`)),provider:wi(n.provider,E(t,`provider`)),commands:Ci(n.commands,E(t,`commands`),(e,t=``)=>({syntax:wi(Si(e,t).syntax,E(t,`syntax`))}))}})}),Jf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,E(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,E(t,`adapter`)),provider:wi(n.provider,E(t,`provider`)),hooks:Ci(n.hooks,E(t,`hooks`),(e,t=``)=>{let n=Si(e,t);return{scope:wi(n.scope,E(t,`scope`)),endpoint:wi(n.endpoint,E(t,`endpoint`)),events:Ci(n.events,E(t,`events`),wi),secret:wi(n.secret,E(t,`secret`))}})}})});function Yf(e,t){try{let t=Si(e,`problem`);return{type:wi(t.type,`problem.type`),title:wi(t.title,`problem.title`),status:Di(t.status,`problem.status`),...Oi(t,`detail`,`problem`),...Oi(t,`instance`,`problem`),...Oi(t,`code`,`problem`),...t.retryable===void 0?{}:{retryable:Ei(t.retryable,`problem.retryable`)},...t.current===void 0?{}:{current:ji(t.current,`problem.current`)},...t.violations===void 0?{}:{violations:Ci(t.violations,`problem.violations`,(e,t=``)=>{let n=Si(e,t);return{path:wi(n.path,E(t,`path`)),message:wi(n.message,E(t,`message`))}})}}}catch{return{type:`about:blank`,title:`Request failed`,status:t}}}function Xf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&Mi(t),n}function Zf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&n!==Vd.Unknown&&Mi(t),n}var Qf=ju({triggerId:Zl(),coordinationKey:Zl(),source:tf,disposition:zu(Ad),sources:ku(tf),manualOutcome:af.optional(),activeWorkItemId:Zl().nullable()}),$f=ju({claim:ju({triggerId:Zl(),coordinationKey:Zl(),source:tf,sources:ku(tf),workItemId:Zl(),workflowInstanceId:Zl(),workflowName:Zl()}),claimedAt:Zl(),startedAt:Zl().optional(),finishedAt:Zl().optional(),failureOutcomeCount:yu().optional(),result:ju({triggerId:Zl(),coordinationKey:Zl(),workItemId:Zl(),workflowInstanceId:Zl(),status:zu([Nd.Completed,Nd.Superseded]),reason:Zl().optional()}).optional(),workItemKey:Zl()}),ep=ju({operatorInstructions:ju({contextScope:Zl(),revisionId:Zl(),content:Zl(),author:Zl(),occurredAt:Zl()}).nullable().optional(),activeInvocation:ju({activeWorkItemId:Zl(),workItemKey:Zl(),triggerId:Zl(),workflowInstanceId:Zl(),workflowStatus:zu(Ld).nullable(),blockReason:Zl().nullable(),retryEligible:Cu()}).nullable(),triggerId:Zl(),status:zu(Ud),definition:rf.nullable(),paused:Cu(),pauseReason:Zl().nullable(),nextOccurrence:Zl().nullable(),pending:ku(Qf),latestSkip:nf.nullable(),invocations:ku($f)});function tp(e){return ep.parse(e)}function mee(e){return ku(ep).parse(e)}function np(e){return ku(ju({contextScope:Zl(),revisionId:Zl(),content:Zl().nullable(),author:Zl(),occurredAt:Zl()})).parse(e)}var hee=class extends Error{constructor(e){super(e.detail??e.title),this.problem=e,this.name=`ApiProblem`}},rp=class{constructor(e=fetch,t=`/api/v1`){this.fetchImplementation=e,this.baseUrl=t,this.auth={session:async()=>{let e=this.fetchImplementation;return(await e(`${this.baseUrl}/auth/session`)).ok},login:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({accessKey:e})})).ok},redeem:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/redeem`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({grant:e})})).ok}},this.triggers={list:e=>this.get(`/triggers`,e=>{let t=sf(mee)(e),n=Si(e,`triggers`);return{...t,orphanedInstructions:np(n.orphanedInstructions??[])}},e),detail:(e,t)=>this.get(`/triggers/`+encodeURIComponent(e),sf(tp),t),saveInstructions:(e,t,n,r)=>this.request(`/triggers/`+encodeURIComponent(e)+`/commands/instructions`,sf(uf),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({content:t,expectedRevisionId:n,idempotencyKey:r})}),command:(e,t,n,r)=>this.command(`/triggers/`+encodeURIComponent(e)+`/commands/`+t,n,uf,r)},this.board={list:(e,t)=>this.get(`/board${ip({cursor:e})}`,cf(fee),t)},this.status={get:e=>this.get(`/status`,sf(e=>e),e)},this.controlPlane={status:e=>this.get(`/control-plane/status`,sf(lf),e),pauseDispatch:(e,t)=>this.command(`/control-plane/commands/pause-dispatch`,e,uf,t),resumeDispatch:(e,t)=>this.command(`/control-plane/commands/resume-dispatch`,e,uf,t),clearMaintenance:(e,t,n)=>this.request(`/control-plane/commands/clear-maintenance`,sf(uf),{method:`POST`,body:JSON.stringify({attemptId:e,idempotencyKey:t}),headers:{"content-type":`application/json`},...n===void 0?{}:{signal:n}})},this.work={list:(e={},t)=>this.get(`/work-items${ip(e)}`,cf(df),t),detail:(e,t)=>this.get(`/work-items/${encodeURIComponent(e)}`,sf(Cf),t),artifactText:async(e,t,n)=>{let r=this.fetchImplementation,i=await r(`${this.baseUrl}/work-items/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{...n===void 0?{}:{signal:n}});if(!i.ok)throw Error(`Unable to load this artifact. Please try again.`);return i.text()},transcript:(e,t,n)=>this.get(`/work-items/${encodeURIComponent(e)}/transcripts/${encodeURIComponent(t)}`,sf(Df),n),message:(e,t,n,r,i)=>this.request(`/work-items/${encodeURIComponent(e)}/commands/message`,sf(uf),{method:`POST`,body:JSON.stringify({idempotencyKey:n,body:t,...i===void 0?{}:{continuation:i}}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),command:(e,t,n,r)=>this.command(`/work-items/${encodeURIComponent(e)}/commands/${t}`,n,uf,r)},this.resources={list:(e,t)=>this.get(`/resources${ip({cursor:e})}`,cf(hf),t)},this.orchestration={list:(e,t)=>this.get(`/workflow-instances${ip({cursor:e})}`,cf(gf),t)},this.workflowDiagrams={get:(e,t)=>this.get(`/workflow-diagrams${ip({workItemKey:e})}`,sf(pee),t)},this.execution={runs:(e,t)=>this.get(`/runs${ip({cursor:e})}`,cf(Sf),t),run:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}`,sf(Sf),t),transcript:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}/transcript`,sf(Ef),t),resolveAmbiguousRun:(e,t,n,r)=>this.request(`/runs/${encodeURIComponent(e)}/commands/resolve`,sf(uf),{method:`POST`,body:JSON.stringify({idempotencyKey:n,...t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),runners:e=>this.get(`/runners`,cf(Tf),e),pauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/pause`,t,uf,n),unpauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/unpause`,t,uf,n)},this.events={list:(e,t,n)=>{let r=typeof t==`string`?t:void 0,i=typeof t==`string`?n:t;return this.get(`/events${ip({cursor:e,workItemKey:r})}`,cf(wf),i)}},this.observability={reports:e=>this.get(`/observability/reports`,sf(If),e),report:(e,t,n)=>this.get(`/observability/reports`+ip({window:e,report:t}),sf(zf),n),summary:(e,t)=>this.get(`/observability/summary`+ip({window:e}),sf(Hf),t),metrics:(e=7,t)=>this.get(`/observability/metrics${ip({days:String(e)})}`,sf(Uf),t)},this.system={health:e=>this.get(`/system/health`,sf(Gf),e),configuration:e=>this.get(`/system/configuration`,sf(Kf),e),commands:e=>this.get(`/system/commands`,sf(qf),e),webhooks:e=>this.get(`/system/webhooks`,sf(Jf),e)}}async command(e,t,n,r){return this.request(e,sf(n),{method:`POST`,body:JSON.stringify({idempotencyKey:t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}})}get(e,t,n){return this.request(e,t,n===void 0?{}:{signal:n})}async request(e,t,n){let r=this.fetchImplementation,i=await r(`${this.baseUrl}${e}`,{...n,headers:{accept:`application/json, application/problem+json`,...n.headers}}),a=await i.json();if(!i.ok)throw new hee(Yf(a,i.status));return t(a)}};function ip(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&t.set(n,r);let n=t.toString();return n===``?``:`?${n}`}var ap=(0,C.createContext)(null);function op(){let e=(0,C.useContext)(ap);if(e===null)throw Error(`WakeApiClient is not configured`);return e}var sp={prefix:`fas`,iconName:`filter`,icon:[512,512,[],`f0b0`,`M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z`]},gee={prefix:`fas`,iconName:`table-columns`,icon:[448,512,[`columns`],`f0db`,`M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z`]},cp={prefix:`fas`,iconName:`paper-plane`,icon:[576,512,[61913],`f1d8`,`M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z`]},lp={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},_ee={prefix:`fas`,iconName:`heart-pulse`,icon:[512,512,[`heartbeat`],`f21e`,`M256 107.9L241 87.1C216 52.5 175.9 32 133.1 32 59.6 32 0 91.6 0 165.1l0 2.6c0 23.6 6.2 48 16.6 72.3l106 0c3.2 0 6.1-1.9 7.4-4.9l31.8-76.3c3.7-8.8 12.3-14.6 21.8-14.8s18.3 5.4 22.2 14.1l51.3 113.9 41.4-82.8c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3l23.2 46.3c1.4 2.7 4.1 4.4 7.2 4.4l123.6 0c10.5-24.3 16.6-48.7 16.6-72.3l0-2.6C512 91.6 452.4 32 378.9 32 336.2 32 296 52.5 271 87.1l-15 20.7zM469.6 288l-97.8 0c-21.2 0-40.6-12-50.1-31l-1.7-3.4-42.5 85.1c-4.1 8.3-12.7 13.5-22 13.3s-17.6-5.7-21.4-14.1l-49.3-109.5-10.5 25.2c-8.7 20.9-29.1 34.5-51.7 34.5l-80.2 0c47.2 73.8 123 141.7 170.4 177.9 12.4 9.4 27.6 14.1 43.1 14.1s30.8-4.6 43.1-14.1C346.6 429.7 422.4 361.8 469.6 288z`]},vee={prefix:`fas`,iconName:`chart-line`,icon:[512,512,[`line-chart`],`f201`,`M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z`]},up={prefix:`fas`,iconName:`play`,icon:[448,512,[9654],`f04b`,`M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z`]},dp={prefix:`fas`,iconName:`sliders`,icon:[512,512,[`sliders-h`],`f1de`,`M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z`]},fp={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]},pp={prefix:`fas`,iconName:`clock-rotate-left`,icon:[576,512,[`history`],`f1da`,`M288 64c106 0 192 86 192 192S394 448 288 448c-65.2 0-122.9-32.5-157.6-82.3-10.1-14.5-30.1-18-44.6-7.9s-18 30.1-7.9 44.6C124.1 468.6 201 512 288 512 429.4 512 544 397.4 544 256S429.4 0 288 0C202.3 0 126.5 42.1 80 106.7L80 80c0-17.7-14.3-32-32-32S16 62.3 16 80l0 112c0 17.7 14.3 32 32 32l24.6 0c.5 0 1 0 1.5 0l86 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-38.3 0C154.9 102.6 217 64 288 64zm24 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1z`]},mp={prefix:`fas`,iconName:`hourglass-half`,icon:[384,512,[`hourglass-2`],`f252`,`M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z`]},hp={prefix:`fas`,iconName:`chevron-left`,icon:[320,512,[9001],`f053`,`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z`]},gp={prefix:`fas`,iconName:`arrow-down-wide-short`,icon:[576,512,[`sort-amount-asc`,`sort-amount-down`],`f160`,`M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z`]},_p={prefix:`fas`,iconName:`bars`,icon:[448,512,[`navicon`],`f0c9`,`M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z`]},vp={prefix:`fas`,iconName:`list-check`,icon:[512,512,[`tasks`],`f0ae`,`M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z`]};function yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bp(e){if(Array.isArray(e))return e}function xp(e){if(Array.isArray(e))return yp(e)}function Sp(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Cp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Fp(r.key),r)}}function wp(e,t,n){return t&&Cp(e.prototype,t),n&&Cp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tp(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Lp(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
75
75
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Ep(e,t,n){return(t=Fp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dp(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Op(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function kp(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
76
76
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yee(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
77
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ap(Object(n),!0).forEach(function(t){Ep(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ap(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mp(e,t){return bp(e)||Op(e,t)||Lp(e,t)||kp()}function Np(e){return xp(e)||Dp(e)||Lp(e)||yee()}function Pp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fp(e){var t=Pp(e,`string`);return typeof t==`symbol`?t:t+``}function Ip(e){"@babel/helpers - typeof";return Ip=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ip(e)}function Lp(e,t){if(e){if(typeof e==`string`)return yp(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yp(e,t):void 0}}var Rp=function(){},zp={},Bp={},Vp=null,Hp={mark:Rp,measure:Rp};try{typeof window<`u`&&(zp=window),typeof document<`u`&&(Bp=document),typeof MutationObserver<`u`&&(Vp=MutationObserver),typeof performance<`u`&&(Hp=performance)}catch{}var Up=(zp.navigator||{}).userAgent,Wp=Up===void 0?``:Up,Gp=zp,Kp=Bp,bee=Vp,qp=Hp;Gp.document;var Jp=!!Kp.documentElement&&!!Kp.head&&typeof Kp.addEventListener==`function`&&typeof Kp.createElement==`function`,xee=~Wp.indexOf(`MSIE`)||~Wp.indexOf(`Trident/`),Yp,See=/fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|gt|jr|jfr|jdr|usb|ufsb|udsb|cr|ss|sr|sl|st|sds|sdr|sdl|sdt|sldr|slpdr|pr|ms|vs)?[\-\ ]/,Cee=/Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Graphite|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Utility|Utility Fill|Utility Duo|Slab Press|Slab|Slab Duo|Slab Press Duo|Pixel|Mosaic|Vellum|Whiteboard)?.*/i,wee={classic:{fa:`solid`,fas:`solid`,"fa-solid":`solid`,far:`regular`,"fa-regular":`regular`,fal:`light`,"fa-light":`light`,fat:`thin`,"fa-thin":`thin`,fab:`brands`,"fa-brands":`brands`},duotone:{fa:`solid`,fad:`solid`,"fa-solid":`solid`,"fa-duotone":`solid`,fadr:`regular`,"fa-regular":`regular`,fadl:`light`,"fa-light":`light`,fadt:`thin`,"fa-thin":`thin`},sharp:{fa:`solid`,fass:`solid`,"fa-solid":`solid`,fasr:`regular`,"fa-regular":`regular`,fasl:`light`,"fa-light":`light`,fast:`thin`,"fa-thin":`thin`},"sharp-duotone":{fa:`solid`,fasds:`solid`,"fa-solid":`solid`,fasdr:`regular`,"fa-regular":`regular`,fasdl:`light`,"fa-light":`light`,fasdt:`thin`,"fa-thin":`thin`},slab:{"fa-regular":`regular`,faslr:`regular`},"slab-press":{"fa-regular":`regular`,faslpr:`regular`},"slab-duo":{"fa-regular":`regular`,fasldr:`regular`},"slab-press-duo":{"fa-regular":`regular`,faslpdr:`regular`},thumbprint:{"fa-light":`light`,fatl:`light`},vellum:{"fa-solid":`solid`,favs:`solid`},pixel:{"fa-regular":`regular`,fapr:`regular`},mosaic:{"fa-solid":`solid`,fams:`solid`},whiteboard:{"fa-semibold":`semibold`,fawsb:`semibold`},notdog:{"fa-solid":`solid`,fans:`solid`},"notdog-duo":{"fa-solid":`solid`,fands:`solid`},etch:{"fa-solid":`solid`,faes:`solid`},graphite:{"fa-thin":`thin`,fagt:`thin`},jelly:{"fa-regular":`regular`,fajr:`regular`},"jelly-fill":{"fa-regular":`regular`,fajfr:`regular`},"jelly-duo":{"fa-regular":`regular`,fajdr:`regular`},chisel:{"fa-regular":`regular`,facr:`regular`},utility:{"fa-semibold":`semibold`,fausb:`semibold`},"utility-duo":{"fa-semibold":`semibold`,faudsb:`semibold`},"utility-fill":{"fa-semibold":`semibold`,faufsb:`semibold`}},Tee={GROUP:`duotone-group`,SWAP_OPACITY:`swap-opacity`,PRIMARY:`primary`,SECONDARY:`secondary`},Eee=[`fa-classic`,`fa-duotone`,`fa-sharp`,`fa-sharp-duotone`,`fa-thumbprint`,`fa-whiteboard`,`fa-notdog`,`fa-notdog-duo`,`fa-chisel`,`fa-etch`,`fa-graphite`,`fa-jelly`,`fa-jelly-fill`,`fa-jelly-duo`,`fa-slab`,`fa-slab-press`,`fa-slab-press-duo`,`fa-slab-duo`,`fa-mosaic`,`fa-pixel`,`fa-vellum`,`fa-utility`,`fa-utility-duo`,`fa-utility-fill`],Xp=`classic`,Zp=`duotone`,Dee=`sharp`,Oee=`sharp-duotone`,kee=`chisel`,Aee=`etch`,Qp=`graphite`,$p=`jelly`,em=`jelly-duo`,tm=`jelly-fill`,nm=`mosaic`,rm=`notdog`,im=`notdog-duo`,am=`pixel`,om=`slab`,sm=`slab-duo`,cm=`slab-press`,lm=`slab-press-duo`,um=`thumbprint`,dm=`utility`,fm=`utility-duo`,pm=`utility-fill`,mm=`vellum`,hm=`whiteboard`,gm=`Classic`,_m=`Duotone`,jee=`Sharp`,Mee=`Sharp Duotone`,Nee=`Chisel`,Pee=`Etch`,Fee=`Graphite`,Iee=`Jelly`,Lee=`Jelly Duo`,vm=`Jelly Fill`,D=`Mosaic`,Ree=`Notdog`,zee=`Notdog Duo`,Bee=`Pixel`,Vee=`Slab`,Hee=`Slab Duo`,ym=`Slab Press`,Uee=`Slab Press Duo`,Wee=`Thumbprint`,bm=`Utility`,Gee=`Utility Duo`,Kee=`Utility Fill`,qee=`Vellum`,Jee=`Whiteboard`,Yee=[Xp,Zp,Dee,Oee,kee,Aee,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm];Yp={},Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Yp,Xp,gm),Zp,_m),Dee,jee),Oee,Mee),kee,Nee),Aee,Pee),Qp,Fee),$p,Iee),em,Lee),tm,vm),Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Yp,nm,D),rm,Ree),im,zee),am,Bee),om,Vee),sm,Hee),cm,ym),lm,Uee),um,Wee),dm,bm),Ep(Ep(Ep(Ep(Yp,fm,Gee),pm,Kee),mm,qee),hm,Jee);var Xee={classic:{900:`fas`,400:`far`,normal:`far`,300:`fal`,100:`fat`},duotone:{900:`fad`,400:`fadr`,300:`fadl`,100:`fadt`},sharp:{900:`fass`,400:`fasr`,300:`fasl`,100:`fast`},"sharp-duotone":{900:`fasds`,400:`fasdr`,300:`fasdl`,100:`fasdt`},slab:{400:`faslr`},"slab-press":{400:`faslpr`},"slab-duo":{400:`fasldr`},"slab-press-duo":{400:`faslpdr`},vellum:{900:`favs`},mosaic:{900:`fams`},pixel:{400:`fapr`},whiteboard:{600:`fawsb`},thumbprint:{300:`fatl`},notdog:{900:`fans`},"notdog-duo":{900:`fands`},etch:{900:`faes`},graphite:{100:`fagt`},chisel:{400:`facr`},jelly:{400:`fajr`},"jelly-fill":{400:`fajfr`},"jelly-duo":{400:`fajdr`},utility:{600:`fausb`},"utility-duo":{600:`faudsb`},"utility-fill":{600:`faufsb`}},Zee={"Font Awesome 7 Free":{900:`fas`,400:`far`},"Font Awesome 7 Pro":{900:`fas`,400:`far`,normal:`far`,300:`fal`,100:`fat`},"Font Awesome 7 Brands":{400:`fab`,normal:`fab`},"Font Awesome 7 Duotone":{900:`fad`,400:`fadr`,normal:`fadr`,300:`fadl`,100:`fadt`},"Font Awesome 7 Sharp":{900:`fass`,400:`fasr`,normal:`fasr`,300:`fasl`,100:`fast`},"Font Awesome 7 Sharp Duotone":{900:`fasds`,400:`fasdr`,normal:`fasdr`,300:`fasdl`,100:`fasdt`},"Font Awesome 7 Jelly":{400:`fajr`,normal:`fajr`},"Font Awesome 7 Jelly Fill":{400:`fajfr`,normal:`fajfr`},"Font Awesome 7 Jelly Duo":{400:`fajdr`,normal:`fajdr`},"Font Awesome 7 Slab":{400:`faslr`,normal:`faslr`},"Font Awesome 7 Slab Press":{400:`faslpr`,normal:`faslpr`},"Font Awesome 7 Slab Duo":{400:`fasldr`,normal:`fasldr`},"Font Awesome 7 Slab Press Duo":{400:`faslpdr`,normal:`faslpdr`},"Font Awesome 7 Pixel":{400:`fapr`,normal:`fapr`},"Font Awesome 7 Mosaic":{900:`fams`,normal:`fams`},"Font Awesome 7 Vellum":{900:`favs`,normal:`favs`},"Font Awesome 7 Thumbprint":{300:`fatl`,normal:`fatl`},"Font Awesome 7 Notdog":{900:`fans`,normal:`fans`},"Font Awesome 7 Notdog Duo":{900:`fands`,normal:`fands`},"Font Awesome 7 Etch":{900:`faes`,normal:`faes`},"Font Awesome 7 Graphite":{100:`fagt`,normal:`fagt`},"Font Awesome 7 Chisel":{400:`facr`,normal:`facr`},"Font Awesome 7 Whiteboard":{600:`fawsb`,normal:`fawsb`},"Font Awesome 7 Utility":{600:`fausb`,normal:`fausb`},"Font Awesome 7 Utility Duo":{600:`faudsb`,normal:`faudsb`},"Font Awesome 7 Utility Fill":{600:`faufsb`,normal:`faufsb`}},Qee=new Map([[`classic`,{defaultShortPrefixId:`fas`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`,`brands`],futureStyleIds:[],defaultFontWeight:900}],[`duotone`,{defaultShortPrefixId:`fad`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`sharp`,{defaultShortPrefixId:`fass`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`sharp-duotone`,{defaultShortPrefixId:`fasds`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`chisel`,{defaultShortPrefixId:`facr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`etch`,{defaultShortPrefixId:`faes`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`graphite`,{defaultShortPrefixId:`fagt`,defaultStyleId:`thin`,styleIds:[`thin`],futureStyleIds:[],defaultFontWeight:100}],[`jelly`,{defaultShortPrefixId:`fajr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`jelly-duo`,{defaultShortPrefixId:`fajdr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`jelly-fill`,{defaultShortPrefixId:`fajfr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`mosaic`,{defaultShortPrefixId:`fams`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`notdog`,{defaultShortPrefixId:`fans`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`notdog-duo`,{defaultShortPrefixId:`fands`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`pixel`,{defaultShortPrefixId:`fapr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab`,{defaultShortPrefixId:`faslr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-duo`,{defaultShortPrefixId:`fasldr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-press`,{defaultShortPrefixId:`faslpr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-press-duo`,{defaultShortPrefixId:`faslpdr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`thumbprint`,{defaultShortPrefixId:`fatl`,defaultStyleId:`light`,styleIds:[`light`],futureStyleIds:[],defaultFontWeight:300}],[`utility`,{defaultShortPrefixId:`fausb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`utility-duo`,{defaultShortPrefixId:`faudsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`utility-fill`,{defaultShortPrefixId:`faufsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`vellum`,{defaultShortPrefixId:`favs`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`whiteboard`,{defaultShortPrefixId:`fawsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}]]),$ee={chisel:{regular:`facr`},classic:{brands:`fab`,light:`fal`,regular:`far`,solid:`fas`,thin:`fat`},duotone:{light:`fadl`,regular:`fadr`,solid:`fad`,thin:`fadt`},etch:{solid:`faes`},graphite:{thin:`fagt`},jelly:{regular:`fajr`},"jelly-duo":{regular:`fajdr`},"jelly-fill":{regular:`fajfr`},mosaic:{solid:`fams`},notdog:{solid:`fans`},"notdog-duo":{solid:`fands`},pixel:{regular:`fapr`},sharp:{light:`fasl`,regular:`fasr`,solid:`fass`,thin:`fast`},"sharp-duotone":{light:`fasdl`,regular:`fasdr`,solid:`fasds`,thin:`fasdt`},slab:{regular:`faslr`},"slab-duo":{regular:`fasldr`},"slab-press":{regular:`faslpr`},"slab-press-duo":{regular:`faslpdr`},thumbprint:{light:`fatl`},utility:{semibold:`fausb`},"utility-duo":{semibold:`faudsb`},"utility-fill":{semibold:`faufsb`},vellum:{solid:`favs`},whiteboard:{semibold:`fawsb`}},ete=[`fak`,`fa-kit`,`fakd`,`fa-kit-duotone`],tte={kit:{fak:`kit`,"fa-kit":`kit`},"kit-duotone":{fakd:`kit-duotone`,"fa-kit-duotone":`kit-duotone`}},xm=[`kit`];Ep(Ep({},`kit`,`Kit`),`kit-duotone`,`Kit Duotone`);var nte={kit:{"fa-kit":`fak`},"kit-duotone":{"fa-kit-duotone":`fakd`}},rte={"Font Awesome Kit":{400:`fak`,normal:`fak`},"Font Awesome Kit Duotone":{400:`fakd`,normal:`fakd`}},Sm={kit:{fak:`fa-kit`},"kit-duotone":{fakd:`fa-kit-duotone`}},Cm={kit:{kit:`fak`},"kit-duotone":{"kit-duotone":`fakd`}},wm,Tm={GROUP:`duotone-group`,SWAP_OPACITY:`swap-opacity`,PRIMARY:`primary`,SECONDARY:`secondary`},ite=[`fa-classic`,`fa-duotone`,`fa-sharp`,`fa-sharp-duotone`,`fa-thumbprint`,`fa-whiteboard`,`fa-notdog`,`fa-notdog-duo`,`fa-chisel`,`fa-etch`,`fa-graphite`,`fa-jelly`,`fa-jelly-fill`,`fa-jelly-duo`,`fa-slab`,`fa-slab-press`,`fa-slab-press-duo`,`fa-slab-duo`,`fa-mosaic`,`fa-pixel`,`fa-vellum`,`fa-utility`,`fa-utility-duo`,`fa-utility-fill`];wm={},Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(wm,`classic`,`Classic`),`duotone`,`Duotone`),`sharp`,`Sharp`),`sharp-duotone`,`Sharp Duotone`),`chisel`,`Chisel`),`etch`,`Etch`),`graphite`,`Graphite`),`jelly`,`Jelly`),`jelly-duo`,`Jelly Duo`),`jelly-fill`,`Jelly Fill`),Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(Ep(wm,`mosaic`,`Mosaic`),`notdog`,`Notdog`),`notdog-duo`,`Notdog Duo`),`pixel`,`Pixel`),`slab`,`Slab`),`slab-duo`,`Slab Duo`),`slab-press`,`Slab Press`),`slab-press-duo`,`Slab Press Duo`),`thumbprint`,`Thumbprint`),`utility`,`Utility`),Ep(Ep(Ep(Ep(wm,`utility-duo`,`Utility Duo`),`utility-fill`,`Utility Fill`),`vellum`,`Vellum`),`whiteboard`,`Whiteboard`),Ep(Ep({},`kit`,`Kit`),`kit-duotone`,`Kit Duotone`);var ate={classic:{"fa-brands":`fab`,"fa-duotone":`fad`,"fa-light":`fal`,"fa-regular":`far`,"fa-solid":`fas`,"fa-thin":`fat`},duotone:{"fa-regular":`fadr`,"fa-light":`fadl`,"fa-thin":`fadt`},sharp:{"fa-solid":`fass`,"fa-regular":`fasr`,"fa-light":`fasl`,"fa-thin":`fast`},"sharp-duotone":{"fa-solid":`fasds`,"fa-regular":`fasdr`,"fa-light":`fasdl`,"fa-thin":`fasdt`},slab:{"fa-regular":`faslr`},"slab-press":{"fa-regular":`faslpr`},"slab-duo":{"fa-regular":`fasldr`},"slab-press-duo":{"fa-regular":`faslpdr`},pixel:{"fa-regular":`fapr`},mosaic:{"fa-solid":`fams`},vellum:{"fa-solid":`favs`},whiteboard:{"fa-semibold":`fawsb`},thumbprint:{"fa-light":`fatl`},notdog:{"fa-solid":`fans`},"notdog-duo":{"fa-solid":`fands`},etch:{"fa-solid":`faes`},graphite:{"fa-thin":`fagt`},jelly:{"fa-regular":`fajr`},"jelly-fill":{"fa-regular":`fajfr`},"jelly-duo":{"fa-regular":`fajdr`},chisel:{"fa-regular":`facr`},utility:{"fa-semibold":`fausb`},"utility-duo":{"fa-semibold":`faudsb`},"utility-fill":{"fa-semibold":`faufsb`}},ote={classic:[`fas`,`far`,`fal`,`fat`,`fad`],duotone:[`fadr`,`fadl`,`fadt`],sharp:[`fass`,`fasr`,`fasl`,`fast`],"sharp-duotone":[`fasds`,`fasdr`,`fasdl`,`fasdt`],slab:[`faslr`],"slab-press":[`faslpr`],"slab-duo":[`fasldr`],"slab-press-duo":[`faslpdr`],pixel:[`fapr`],mosaic:[`fams`],vellum:[`favs`],whiteboard:[`fawsb`],thumbprint:[`fatl`],notdog:[`fans`],"notdog-duo":[`fands`],etch:[`faes`],graphite:[`fagt`],jelly:[`fajr`],"jelly-fill":[`fajfr`],"jelly-duo":[`fajdr`],chisel:[`facr`],utility:[`fausb`],"utility-duo":[`faudsb`],"utility-fill":[`faufsb`]},Em={classic:{fab:`fa-brands`,fad:`fa-duotone`,fal:`fa-light`,far:`fa-regular`,fas:`fa-solid`,fat:`fa-thin`},duotone:{fadr:`fa-regular`,fadl:`fa-light`,fadt:`fa-thin`},sharp:{fass:`fa-solid`,fasr:`fa-regular`,fasl:`fa-light`,fast:`fa-thin`},"sharp-duotone":{fasds:`fa-solid`,fasdr:`fa-regular`,fasdl:`fa-light`,fasdt:`fa-thin`},slab:{faslr:`fa-regular`},"slab-press":{faslpr:`fa-regular`},"slab-duo":{fasldr:`fa-regular`},"slab-press-duo":{faslpdr:`fa-regular`},pixel:{fapr:`fa-regular`},mosaic:{fams:`fa-solid`},vellum:{favs:`fa-solid`},whiteboard:{fawsb:`fa-semibold`},thumbprint:{fatl:`fa-light`},notdog:{fans:`fa-solid`},"notdog-duo":{fands:`fa-solid`},etch:{faes:`fa-solid`},graphite:{fagt:`fa-thin`},jelly:{fajr:`fa-regular`},"jelly-fill":{fajfr:`fa-regular`},"jelly-duo":{fajdr:`fa-regular`},chisel:{facr:`fa-regular`},utility:{fausb:`fa-semibold`},"utility-duo":{faudsb:`fa-semibold`},"utility-fill":{faufsb:`fa-semibold`}},Dm=`fa.fas.far.fal.fat.fad.fadr.fadl.fadt.fab.fass.fasr.fasl.fast.fasds.fasdr.fasdl.fasdt.faslr.faslpr.fasldr.faslpdr.fapr.fams.favs.fawsb.fatl.fans.fands.faes.fagt.fajr.fajfr.fajdr.facr.fausb.faudsb.faufsb`.split(`.`).concat(ite,[`fa-solid`,`fa-regular`,`fa-light`,`fa-thin`,`fa-duotone`,`fa-brands`,`fa-semibold`]),Om=[`solid`,`regular`,`light`,`thin`,`duotone`,`brands`,`semibold`],km=[1,2,3,4,5,6,7,8,9,10],Am=km.concat([11,12,13,14,15,16,17,18,19,20]),ste=[].concat(Np(Object.keys(ote)),Om,[`aw`,`fw`,`pull-left`,`pull-right`],[`2xs`,`xs`,`sm`,`lg`,`xl`,`2xl`,`beat`,`beat-fade`,`border`,`bounce`,`buzz`,`canvas-square`,`canvas-roomy`,`fade`,`flip-360`,`flip-both`,`flip-horizontal`,`flip-vertical`,`flip`,`float`,`inverse`,`jello`,`layers`,`layers-bottom-left`,`layers-bottom-right`,`layers-counter`,`layers-text`,`layers-top-left`,`layers-top-right`,`li`,`pull-end`,`pull-start`,`pulse`,`rotate-180`,`rotate-270`,`rotate-90`,`rotate-by`,`shake`,`spin-pulse`,`spin-reverse`,`spin`,`spin-snap`,`spin-snap-4`,`spin-snap-8`,`stack-1x`,`stack-2x`,`stack`,`swing`,`ul`,`wag`,`width-auto`,`width-fixed`,Tm.GROUP,Tm.SWAP_OPACITY,Tm.PRIMARY,Tm.SECONDARY],km.map(function(e){return`${e}x`}),Am.map(function(e){return`w-${e}`})),jm={"Font Awesome 5 Free":{900:`fas`,400:`far`},"Font Awesome 5 Pro":{900:`fas`,400:`far`,normal:`far`,300:`fal`},"Font Awesome 5 Brands":{400:`fab`,normal:`fab`},"Font Awesome 5 Duotone":{900:`fad`}},Mm=`___FONT_AWESOME___`,Nm=16,Pm=`fa`,Fm=`svg-inline--fa`,Im=`data-fa-i2svg`,Lm=`data-fa-pseudo-element`,cte=`data-fa-pseudo-element-pending`,Rm=`data-prefix`,zm=`data-icon`,Bm=`fontawesome-i2svg`,lte=`async`,ute=[`HTML`,`HEAD`,`STYLE`,`SCRIPT`],Vm=[`::before`,`::after`,`:before`,`:after`],Hm=function(){try{return!0}catch{return!1}}();function Um(e){return new Proxy(e,{get:function(e,t){return t in e?e[t]:e[Xp]}})}var Wm=jp({},wee);Wm[Xp]=jp(jp(jp(jp({},{"fa-duotone":`duotone`}),wee[Xp]),tte.kit),tte[`kit-duotone`]);var dte=Um(Wm),Gm=jp({},$ee);Gm[Xp]=jp(jp(jp(jp({},{duotone:`fad`}),Gm[Xp]),Cm.kit),Cm[`kit-duotone`]);var Km=Um(Gm),qm=jp({},Em);qm[Xp]=jp(jp({},qm[Xp]),Sm.kit);var Jm=Um(qm),Ym=jp({},ate);Ym[Xp]=jp(jp({},Ym[Xp]),nte.kit),Um(Ym);var Xm=See,Zm=`fa-layers-text`,fte=Cee;Um(jp({},Xee));var pte=[`class`,`data-prefix`,`data-icon`,`data-fa-transform`,`data-fa-mask`],Qm=Tee,mte=[].concat(Np(xm),Np(ste)),$m=Gp.FontAwesomeConfig||{};function hte(e){var t=Kp.querySelector(`script[`+e+`]`);if(t)return t.getAttribute(e)}function gte(e){return e===``?!0:e===`false`?!1:e===`true`||e}Kp&&typeof Kp.querySelector==`function`&&[[`data-family-prefix`,`familyPrefix`],[`data-css-prefix`,`cssPrefix`],[`data-family-default`,`familyDefault`],[`data-style-default`,`styleDefault`],[`data-replacement-class`,`replacementClass`],[`data-auto-replace-svg`,`autoReplaceSvg`],[`data-auto-add-css`,`autoAddCss`],[`data-search-pseudo-elements`,`searchPseudoElements`],[`data-search-pseudo-elements-warnings`,`searchPseudoElementsWarnings`],[`data-search-pseudo-elements-full-scan`,`searchPseudoElementsFullScan`],[`data-observe-mutations`,`observeMutations`],[`data-mutate-approach`,`mutateApproach`],[`data-keep-original-source`,`keepOriginalSource`],[`data-measure-performance`,`measurePerformance`],[`data-show-missing-icons`,`showMissingIcons`]].forEach(function(e){var t=Mp(e,2),n=t[0],r=t[1],i=gte(hte(n));i!=null&&($m[r]=i)});var eh={styleDefault:`solid`,familyDefault:Xp,cssPrefix:Pm,replacementClass:Fm,autoReplaceSvg:!0,autoAddCss:!0,searchPseudoElements:!1,searchPseudoElementsWarnings:!0,searchPseudoElementsFullScan:!1,observeMutations:!0,mutateApproach:`async`,keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};$m.familyPrefix&&($m.cssPrefix=$m.familyPrefix);var th=jp(jp({},eh),$m);th.autoReplaceSvg||(th.observeMutations=!1);var nh={};Object.keys(eh).forEach(function(e){Object.defineProperty(nh,e,{enumerable:!0,set:function(t){th[e]=t,rh.forEach(function(e){return e(nh)})},get:function(){return th[e]}})}),Object.defineProperty(nh,"familyPrefix",{enumerable:!0,set:function(e){th.cssPrefix=e,rh.forEach(function(e){return e(nh)})},get:function(){return th.cssPrefix}}),Gp.FontAwesomeConfig=nh;var rh=[];function _te(e){return rh.push(e),function(){rh.splice(rh.indexOf(e),1)}}var ih=Nm,ah={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function vte(e){if(!(!e||!Jp)){var t=Kp.createElement(`style`);t.setAttribute(`type`,`text/css`),t.innerHTML=e;for(var n=Kp.head.childNodes,r=null,i=n.length-1;i>-1;i--){var a=n[i],o=(a.tagName||``).toUpperCase();[`STYLE`,`LINK`].indexOf(o)>-1&&(r=a)}return Kp.head.insertBefore(t,r),e}}var yte=`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`;function oh(){for(var e=12,t=``;e-->0;)t+=yte[Math.random()*62|0];return t}function sh(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function ch(e){return e.classList?sh(e.classList):(e.getAttribute(`class`)||``).split(` `).filter(function(e){return e})}function lh(e){return`${e}`.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function bte(e){return Object.keys(e||{}).reduce(function(t,n){return t+`${n}="${lh(e[n])}" `},``).trim()}function uh(e){return Object.keys(e||{}).reduce(function(t,n){return t+`${n}: ${e[n].trim()};`},``)}function dh(e){return e.size!==ah.size||e.x!==ah.x||e.y!==ah.y||e.rotate!==ah.rotate||e.flipX||e.flipY}function xte(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth;return{outer:{transform:`translate(${n/2} 256)`},inner:{transform:`${`translate(${t.x*32}, ${t.y*32}) `} ${`scale(${t.size/16*(t.flipX?-1:1)}, ${t.size/16*(t.flipY?-1:1)}) `} ${`rotate(${t.rotate} 0 0)`}`},path:{transform:`translate(${r/2*-1} -256)`}}}function Ste(e){var t=e.transform,n=e.width,r=n===void 0?Nm:n,i=e.height,a=i===void 0?Nm:i,o=e.startCentered,s=o!==void 0&&o,c=``;return c+=s&&xee?`translate(${t.x/ih-r/2}em, ${t.y/ih-a/2}em) `:s?`translate(calc(-50% + ${t.x/ih}em), calc(-50% + ${t.y/ih}em)) `:`translate(${t.x/ih}em, ${t.y/ih}em) `,c+=`scale(${t.size/ih*(t.flipX?-1:1)}, ${t.size/ih*(t.flipY?-1:1)}) `,c+=`rotate(${t.rotate}deg) `,c}var Cte=`:root, :host {
|
|
@@ -1189,4 +1189,4 @@ Consider installing the package or pass your own 'workerFactory' to ELK's constr
|
|
|
1189
1189
|
`},i)),a}function Lx(e,t){return e&&`run`in e?async function(n,r){let i=Ix(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ix(n,{file:r,...e||t})}}function Rx(e){if(e)throw e}var zx=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Bx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function coe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Vx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Vx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Hx={basename:Ux,dirname:Wx,extname:Gx,join:Kx,sep:`/`};function Ux(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Yx(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Wx(e){if(Yx(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Gx(e){Yx(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Kx(...e){let t=-1,n;for(;++t<e.length;)Yx(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:qx(n)}function qx(e){Yx(e);let t=e.codePointAt(0)===47,n=Jx(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Jx(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1)if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Yx(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var loe={cwd:Xx};function Xx(){return`/`}function Zx(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Qx(e){if(typeof e==`string`)e=new URL(e);else if(!Zx(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return $x(e)}function $x(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var eS=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],tS=class{constructor(e){let t;t=e?Zx(e)?{path:e}:typeof e==`string`||doe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:loe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<eS.length;){let e=eS[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)eS.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Hx.basename(this.path):void 0}set basename(e){rS(e,`basename`),nS(e,`basename`),this.path=Hx.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Hx.dirname(this.path):void 0}set dirname(e){uoe(this.basename,`dirname`),this.path=Hx.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Hx.extname(this.path):void 0}set extname(e){if(nS(e,`extname`),uoe(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Hx.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Zx(e)&&(e=Qx(e)),rS(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Hx.basename(this.path,this.extname):void 0}set stem(e){rS(e,`stem`),nS(e,`stem`),this.path=Hx.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new A(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function nS(e,t){if(e&&e.includes(Hx.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Hx.sep+"`")}function rS(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function uoe(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function doe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var foe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),iS=l(zx(),1),poe={}.hasOwnProperty,moe=new class e extends foe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=coe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,iS.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(sS(`data`,this.frozen),this.namespace[e]=t,this):poe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sS(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=uS(e),n=this.parser||this.Parser;return aS(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),aS(`process`,this.parser||this.Parser),oS(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=uS(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);goe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),aS(`processSync`,this.parser||this.Parser),oS(`processSync`,this.compiler||this.Compiler),this.process(e,r),lS(`processSync`,`process`,t),n;function r(e,r){t=!0,Rx(e),n=r}}run(e,t,n){cS(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=uS(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),lS(`runSync`,`run`,n),r;function i(e,t){Rx(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=uS(t),r=this.compiler||this.Compiler;return oS(`stringify`,r),cS(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(sS(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,iS.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Bx(o)&&Bx(r)&&(r=(0,iS.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function aS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function oS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function sS(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cS(e){if(!Bx(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function lS(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function uS(e){return hoe(e)?e:new tS(e)}function hoe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function goe(e){return typeof e==`string`||_oe(e)}function _oe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var dS=[],fS={allowDangerousHtml:!0},pS=/^(https?|ircs?|mailto|xmpp)$/i,mS=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function hS(e){let t=gS(e),n=_S(e);return vS(t.runSync(t.parse(n),n),e)}function gS(e){let t=e.rehypePlugins||dS,n=e.remarkPlugins||dS,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fS}:fS;return moe().use(kae).use(n).use(Lx,r).use(t)}function _S(e){let t=e.children||``,n=new tS;return typeof t==`string`?n.value=t:``+t,n}function vS(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||yS;for(let e of mS)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return jx(e,l),Wre(e,{Fragment:T.Fragment,components:i,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Cy)if(Object.hasOwn(Cy,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Cy[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function yS(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||pS.test(e.slice(0,t))?e:``}var bS={markdown:`_markdown_i5wt4_1`};function xS(){let e=op(),t=ov(),n=_i({queryKey:Yg.execution.runList(t.cursor),queryFn:({signal:n})=>e.execution.runs(t.cursor,n),refetchInterval:e=>Gne.runs(e.state.data?.items)});return(0,T.jsxs)(T.Fragment,{children:[n.isPending?(0,T.jsx)(r_,{label:`Loading runs`}):n.error&&!n.data?(0,T.jsx)(a_,{error:n.error,retry:()=>void n.refetch()}):(n.data?.items.length??0)===0?(0,T.jsx)(i_,{children:`No runs`}):(0,T.jsx)(fv,{caption:`Execution runs`,rows:n.data.items,rowKey:e=>e.runId,columns:SS}),n.data&&(0,T.jsx)(sv,{navigation:t,nextCursor:n.data.page.nextCursor,hasMore:n.data.page.hasMore})]})}var SS=[{label:`Run`,render:e=>(0,T.jsx)(Rn,{to:`/runs/${encodeURIComponent(e.runId)}`,children:e.runId})},{label:`Activity`,render:e=>e.activity},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runner`,render:e=>CS(e)},{label:`Status`,render:e=>TS(e)},{label:`Started`,render:e=>(0,T.jsx)(lv,{value:e.startedAt})},{label:`Duration`,render:e=>wS(e)},{label:`Usage`,render:e=>(0,T.jsx)(O_,{usage:e})},{label:`Cost`,render:e=>y_(e.totalCostUsd)}];function CS(e){return e.runnerName===void 0?`?`:e.runnerModel===void 0?e.runnerName:`${e.runnerName} (${e.runnerModel})`}function wS(e){let t=e.active?Date.now():e.finishedAt===void 0?void 0:Date.parse(e.finishedAt);return t===void 0?``:x_(t-Date.parse(e.startedAt))}function TS(e){return e.status===`starting`?`Starting`:e.status===`started`?`Running`:e.resolution?.sentinel??e.sentinel}function ES(){let{runId:e=``}=Tt(),t=op(),n=_i({queryKey:Yg.execution.run(e),queryFn:({signal:n})=>t.execution.run(e,n),refetchInterval:e=>Gne.runs(e.state.data===void 0?void 0:[e.state.data.data])}),r=_i({queryKey:Yg.execution.transcript(e),queryFn:({signal:n})=>t.execution.transcript(e,n),refetchInterval:Xg.historicalRuns,enabled:e!==``});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Run ${e}`}),n.isPending?(0,T.jsx)(r_,{label:`Loading run`}):n.error?(0,T.jsx)(a_,{error:n.error,retry:()=>void n.refetch()}):n.data&&(0,T.jsxs)(e_,{children:[(0,T.jsx)(n_,{children:TS(n.data.data)}),(0,T.jsxs)(`dl`,{className:h_.summary,children:[(0,T.jsx)(`dt`,{children:`Activity`}),(0,T.jsx)(`dd`,{children:n.data.data.activity}),n.data.data.operatorInstructions&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Operator instructions scope`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.contextScope}),(0,T.jsx)(`dt`,{children:`Operator instructions revision`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.revisionId??`No instructions at run start`})]}),(0,T.jsx)(`dt`,{children:`Attempt`}),(0,T.jsx)(`dd`,{children:n.data.data.attempt}),(0,T.jsx)(`dt`,{children:`Started`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(lv,{value:n.data.data.startedAt})}),n.data.data.finishedAt!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Finished`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(lv,{value:n.data.data.finishedAt})})]})]}),(n.data.data.outcome??n.data.data.failure)!==void 0&&(0,T.jsx)(s_,{value:n.data.data.outcome??n.data.data.failure}),n.data.data.operatorInstructions?.content!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions received`}),(0,T.jsx)(`article`,{className:bS.markdown,children:(0,T.jsx)(hS,{skipHtml:!0,children:n.data.data.operatorInstructions.content})})]}),(0,T.jsx)(`h2`,{children:`Transcript`}),r.data?.data.available?(0,T.jsx)(`ol`,{className:h_.transcript,"aria-label":`Transcript`,children:r.data.data.entries.map((e,t)=>(0,T.jsxs)(`li`,{className:h_.transcriptEntry,children:[(0,T.jsxs)(`div`,{className:h_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel}),(0,T.jsx)(lv,{value:e.occurredAt})]}),(0,T.jsx)(`pre`,{className:h_.transcriptText,children:e.text})]},`${e.occurredAt}-${t}`))}):(0,T.jsx)(i_,{children:`Transcript unavailable`})]})]})}function DS(){let e=op(),t=_i({queryKey:[`triggers`],queryFn:({signal:t})=>e.triggers.list(t),refetchInterval:Xg.status});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)($g,{title:`Triggers`}),t.data&&t.data.orphanedInstructions.length>0&&(0,T.jsxs)(e_,{children:[(0,T.jsx)(`h2`,{children:`Orphaned operator instructions`}),(0,T.jsx)(`p`,{children:`These documents are retained but have no configured trigger using their scope. Configure a trigger with the same contextScope to use and edit them again.`}),t.data.orphanedInstructions.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{children:e.contextScope}),(0,T.jsxs)(`p`,{children:[`Document: instructions.md. Saved by `,e.author,` at`,` `,(0,T.jsx)(lv,{value:e.occurredAt}),`. Revision: `,e.revisionId]}),(0,T.jsx)(`article`,{className:bS.markdown,"aria-label":`Orphaned instructions for `+e.contextScope,children:e.content===null?(0,T.jsx)(`p`,{children:`Instructions content is unavailable. The saved revision is retained.`}):(0,T.jsx)(hS,{skipHtml:!0,children:e.content})})]},e.contextScope))]}),t.isPending?(0,T.jsx)(r_,{label:`Loading triggers`}):t.error?(0,T.jsx)(a_,{error:t.error,retry:()=>void t.refetch()}):t.data.data.length===0?(0,T.jsx)(i_,{children:`No triggers configured or recorded`}):(0,T.jsx)(fv,{caption:`Triggers`,rows:t.data.data,rowKey:e=>e.triggerId,columns:[{label:`Trigger`,render:e=>(0,T.jsx)(Rn,{to:`/triggers/`+encodeURIComponent(e.triggerId),children:e.triggerId})},{label:`Status`,render:e=>e.status},{label:`Slot holder`,render:e=>(0,T.jsx)(kS,{trigger:e})},{label:`Workflow`,render:e=>e.definition?.workflow??e.invocations[0]?.claim.workflowName??`—`},{label:`Next cron occurrence (UTC)`,render:e=>e.nextOccurrence?(0,T.jsx)(lv,{value:e.nextOccurrence,timeZone:`UTC`}):`—`},{label:`Latest invocation`,render:e=>(0,T.jsx)(AS,{entry:e.invocations[0]})},{label:`Pause/failure reason`,render:e=>e.pauseReason??`—`},{label:`Latest skip`,render:e=>e.latestSkip?.reason??`—`},{label:`Control`,render:e=>(0,T.jsx)(jS,{trigger:e})}]})]})}function OS(){let{triggerId:e=``}=Tt(),t=op(),n=_i({queryKey:[`triggers`,e],queryFn:({signal:n})=>t.triggers.detail(e,n),refetchInterval:Xg.status});if(n.isPending)return(0,T.jsx)(r_,{label:`Loading trigger`});if(n.error)return(0,T.jsx)(a_,{error:n.error,retry:()=>void n.refetch()});let r=n.data.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)($g,{title:r.triggerId}),(0,T.jsx)(Rn,{to:`/triggers`,children:`All triggers`}),(0,T.jsxs)(e_,{children:[(0,T.jsxs)(`p`,{children:[`Status: `,r.status]}),(0,T.jsx)(kS,{trigger:r}),(0,T.jsx)(jS,{trigger:r}),(0,T.jsx)(`p`,{children:`Pause leaves active invocations running. Operator cancellation is not available yet. Retry resumes the same invocation; its slot remains occupied until it finishes.`}),r.pauseReason&&(0,T.jsxs)(`p`,{children:[`Pause reason: `,r.pauseReason]}),r.definition===null?(0,T.jsx)(`p`,{children:`Definition removed. Recorded invocations remain available.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Configuration`}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.definition,null,2)})]}),r.nextOccurrence&&(0,T.jsxs)(`p`,{children:[`Next cron occurrence (UTC): `,(0,T.jsx)(lv,{value:r.nextOccurrence,timeZone:`UTC`})]})]}),(0,T.jsx)(MS,{trigger:r},r.triggerId),(0,T.jsxs)(e_,{children:[(0,T.jsx)(`h2`,{children:`Pending requests`}),r.pending.length===0?(0,T.jsx)(`p`,{children:`No pending request`}):(0,T.jsx)(T.Fragment,{children:r.pending.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsxs)(`p`,{children:[e.triggerId,`:`,` `,e.activeWorkItemId?`Waiting on `+e.activeWorkItemId:`Awaiting reconsideration`]}),(0,T.jsx)(`pre`,{children:JSON.stringify(e.sources,null,2)})]},e.coordinationKey))})]}),(0,T.jsxs)(e_,{children:[(0,T.jsx)(`h2`,{children:`Latest skipped occurrence`}),r.latestSkip===null?(0,T.jsx)(`p`,{children:`No recorded skip diagnostic`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[r.latestSkip.reason,` at `,(0,T.jsx)(lv,{value:r.latestSkip.occurredAt})]}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.latestSkip.source,null,2)})]})]}),(0,T.jsxs)(e_,{children:[(0,T.jsx)(`h2`,{children:`Invocation history`}),r.invocations.length===0?(0,T.jsx)(i_,{children:`No invocations recorded`}):(0,T.jsx)(fv,{caption:`Invocation history`,rows:r.invocations,rowKey:e=>e.claim.workItemId,columns:[{label:`WorkItem`,render:e=>(0,T.jsx)(AS,{entry:e})},{label:`Claimed`,render:e=>(0,T.jsx)(lv,{value:e.claimedAt})},{label:`Started`,render:e=>e.startedAt?(0,T.jsx)(lv,{value:e.startedAt}):`Pending recovery`},{label:`Finished`,render:e=>e.finishedAt?(0,T.jsx)(lv,{value:e.finishedAt}):`—`},{label:`Reason`,render:e=>e.result?.reason??`—`},{label:`Sources`,render:e=>(0,T.jsx)(`pre`,{children:JSON.stringify(e.claim.sources,null,2)})}]})]})]})}function kS({trigger:e}){let t=op(),n=ni(),r=e.activeInvocation,i=vi({mutationFn:e=>t.work.command(e.workItemKey,`retry`,e.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return r===null?(0,T.jsx)(`span`,{children:`No active invocation`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Slot held by`,` `,(0,T.jsx)(Rn,{to:`/work/`+encodeURIComponent(r.workItemKey),children:r.activeWorkItemId}),` `,`(`,r.workflowStatus??`Pending recovery`,`), trigger `,r.triggerId]}),r.blockReason&&(0,T.jsxs)(`p`,{children:[`Block reason: `,r.blockReason]}),r.retryEligible&&(0,T.jsx)(t_,{disabled:i.isPending,onClick:()=>i.mutate({workItemKey:r.workItemKey,idempotencyKey:`web:retry:`+crypto.randomUUID()}),children:`Retry invocation`}),i.isSuccess&&(0,T.jsx)(`p`,{role:`status`,children:`Retry accepted. The slot remains held until this invocation finishes.`}),i.error&&(0,T.jsx)(a_,{error:i.error,retry:()=>{i.variables&&i.mutate(i.variables)}})]})}function AS({entry:e}){return e===void 0?(0,T.jsx)(T.Fragment,{children:`—`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Rn,{to:`/work/`+encodeURIComponent(e.workItemKey),children:e.claim.workItemId}),` (`,e.result?.status??(e.startedAt?`running`:`claimed`),`)`]})}function jS({trigger:e}){let t=op(),n=ni(),r=vi({mutationFn:n=>t.triggers.command(e.triggerId,n.name,n.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(t_,{type:`button`,disabled:r.isPending,onClick:()=>r.mutate({name:e.paused?Id.Resume:Id.Pause,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:e.paused?`Resume`:`Pause`}),e.definition!==null&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(t_,{type:`button`,disabled:r.isPending,onClick:()=>r.mutate({name:Id.Run,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:`Run now`}),e.paused&&(0,T.jsx)(`p`,{children:`Automatic runs paused; Run now still works.`}),e.status===Ud.Running&&(0,T.jsx)(`p`,{children:`A request will coalesce while this invocation is active.`})]}),r.data?.data.triggerOutcome&&(0,T.jsxs)(`p`,{role:`status`,children:[r.data.data.triggerOutcome.disposition===Pd.Coalesced?`queued`:r.data.data.triggerOutcome.disposition,`workItemId`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.workItemId:``,`activeWorkItemId`in r.data.data.triggerOutcome?` behind `+r.data.data.triggerOutcome.activeWorkItemId:``,`reason`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.reason:``]}),r.error&&(0,T.jsx)(a_,{error:r.error,retry:()=>{r.variables!==void 0&&r.mutate(r.variables)}})]})}function MS({trigger:e}){let t=op(),n=ni(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),s=vi({mutationFn:()=>t.triggers.saveInstructions(e.triggerId,r??``,a,`web:instructions:`+crypto.randomUUID()),onSuccess:async()=>{await n.invalidateQueries({queryKey:[`triggers`]}),i(null)}}),c=vi({mutationFn:async()=>{let r=await t.triggers.detail(e.triggerId);n.setQueryData([`triggers`,e.triggerId],r),i(r.data.operatorInstructions?.content??``),o(r.data.operatorInstructions?.revisionId??null),s.reset()}}),l=e.definition?.contextScope;return(0,T.jsxs)(e_,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions`}),(0,T.jsx)(`p`,{children:`Document: instructions.md`}),l===void 0?(0,T.jsx)(`p`,{children:`This trigger has no explicit contextScope. Configure a named scope before editing instructions.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Scope: `,l,`. Shared by all triggers in this scope. Saves apply to later runs; active runs keep their snapshot.`]}),e.operatorInstructions&&(0,T.jsxs)(`p`,{children:[`Last saved by `,e.operatorInstructions.author,` at`,` `,(0,T.jsx)(lv,{value:e.operatorInstructions.occurredAt}),`. Revision:`,` `,e.operatorInstructions.revisionId]}),r===null?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`article`,{className:bS.markdown,"aria-label":`Operator standing instructions`,children:e.operatorInstructions===null||e.operatorInstructions===void 0?(0,T.jsx)(`p`,{children:`No instructions document exists yet. The first operator save creates it; no scope membership or prior invocation is required.`}):(0,T.jsx)(hS,{skipHtml:!0,children:e.operatorInstructions.content})}),(0,T.jsx)(t_,{onClick:()=>{i(e.operatorInstructions?.content??``),o(e.operatorInstructions?.revisionId??null),s.reset()},children:`Edit instructions`})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`label`,{children:[`Instructions (Markdown)`,(0,T.jsx)(`textarea`,{"aria-label":`Instructions (Markdown)`,placeholder:`Describe what agents should do on future invocations. These instructions apply to every trigger sharing this context scope, within fixed safety constraints.`,rows:14,value:r,disabled:s.isPending,onChange:e=>i(e.target.value)})]}),(0,T.jsx)(t_,{disabled:s.isPending,onClick:()=>s.mutate(),children:`Save instructions`}),(0,T.jsx)(t_,{disabled:s.isPending,onClick:()=>{i(null),s.reset()},children:`Cancel`}),s.error&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{role:`alert`,children:s.error.message}),(0,T.jsx)(t_,{disabled:c.isPending,onClick:()=>c.mutate(),children:`Reload current instructions`})]})]})]}),c.error&&(0,T.jsx)(`p`,{role:`alert`,children:c.error.message})]})}var NS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fab`,n=`github`,r=512,i=512,a=[],o=`f09b`,s=`M216.5 362.5c-66-8-112.5-55.5-112.5-117 0-25 9-52 24-70-6.5-16.5-5.5-51.5 2-66 20-2.5 47 8 63 22.5 19-6 39-9 63.5-9s44.5 3 62.5 8.5c15.5-14 43-24.5 63-22 7 13.5 8 48.5 1.5 65.5 16 19 24.5 44.5 24.5 70.5 0 61.5-46.5 108-113.5 116.5 17 11 28.5 35 28.5 62.5l0 52C323 491.5 335.5 500 350.5 494 441 459.5 512 369 512 257 512 115.5 397 0 255.5 0S0 115.5 0 257c0 111 70.5 203 165.5 237.5 13.5 5 26.5-4 26.5-17.5l0-40c-7 3-16 5-24 5-33 0-52.5-18-66.5-51.5-5.5-13.5-11.5-21.5-23-23-6-.5-8-3-8-6 0-6 10-10.5 20-10.5 14.5 0 27 9 40 27.5 10 14.5 20.5 21 33 21s20.5-4.5 32-16c8.5-8.5 15-16 21-21z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faGithub=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),PS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`arrow-up-right-from-square`,r=512,i=512,a=[`external-link`],o=`f08e`,s=`M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faArrowUpRightFromSquare=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),FS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`file-lines`,r=384,i=512,a=[128441,128462,61686,`file-alt`,`file-text`],o=`f15c`,s=`M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM120 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faFileLines=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),IS=NS(),LS=PS(),RS=FS();function zS({className:e}){return(0,T.jsx)(Jg,{icon:IS.faGithub,className:e,"aria-hidden":`true`})}function BS({className:e}){return(0,T.jsx)(Jg,{icon:RS.faFileLines,className:e,"aria-hidden":`true`})}function VS({className:e}){return(0,T.jsx)(Jg,{icon:LS.faArrowUpRightFromSquare,className:e,"aria-hidden":`true`})}var HS={granted:`Granted`,shared:`Shared context`};function US({caption:e,rows:t,showSource:n=!1,onView:r}){return(0,T.jsx)(fv,{caption:e,rows:t,rowKey:e=>`${e.source?.workItemKey??``}/${e.revisionId}`,columns:[...n?[{label:`From`,render:e=>e.source===void 0?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Rn,{to:`/work/${encodeURIComponent(e.source.workItemKey)}`,children:e.producer}),` `,`(`,HS[e.source.relation],`)`]})}]:[{label:`Producer`,render:e=>e.producer}],{label:`Path`,render:e=>(0,T.jsx)(`a`,{href:e.href,children:e.path})},{label:`View`,render:e=>/\.md$/i.test(e.path)?(0,T.jsx)(t_,{variant:`secondary`,onClick:()=>r(e),"aria-label":`View ${e.path}`,children:`View`}):null},{label:`Type`,render:e=>e.mediaType??`binary`},{label:`Bytes`,render:e=>e.byteLength?.toLocaleString()??`?`}]})}var WS=e=>`/work/`+encodeURIComponent(e);function GS(e){return e===`completed`?`good`:e===`blocked`||e===`failed`||e===`cancelled`?`bad`:e===`waiting`||e===`registration-pending`?`warning`:`neutral`}function KS({delegation:e,workItemKey:t}){let n=e.parentWorkItemKey,r=e.rootWorkItemKey!==t&&e.rootWorkItemKey!==n?e.rootWorkItemKey:void 0;return(0,T.jsxs)(`section`,{"aria-labelledby":`work-related`,children:[(0,T.jsx)(`h2`,{id:`work-related`,className:h_.sidebarSectionTitle,children:`Related work`}),(n!==void 0||r!==void 0)&&(0,T.jsxs)(`p`,{className:h_.relatedLinks,children:[n!==void 0&&(0,T.jsx)(Rn,{to:WS(n),children:`View parent`}),r!==void 0&&(0,T.jsx)(Rn,{to:WS(r),children:`View delivery root`})]}),(0,T.jsx)(`ul`,{className:h_.cards,"aria-label":`Child work`,children:e.children.map(e=>(0,T.jsx)(`li`,{className:h_.card,children:(0,T.jsxs)(Rn,{className:h_.cardLink,to:WS(e.workItemKey),children:[(0,T.jsx)(`span`,{className:h_.cardRef,children:e.externalRef??e.workItemId}),(0,T.jsx)(`span`,{className:h_.cardTitle,children:e.objective}),(0,T.jsxs)(`span`,{className:h_.cardMeta,children:[(0,T.jsx)(v_,{variant:`outline`,tone:GS(e.status),title:`Child status`,children:e.status}),(0,T.jsxs)(v_,{variant:`outline`,title:`Workflow driving this item`,children:[(0,T.jsx)(g_,{}),e.workflowName]}),e.currentStage!==void 0&&(0,T.jsxs)(v_,{variant:`outline`,title:`Current lifecycle stage`,children:[(0,T.jsx)(__,{}),e.currentStage]})]}),e.blockReason&&(0,T.jsx)(`span`,{className:h_.cardStats,children:e.blockReason})]})},e.workItemKey))})]})}function voe({workItemKey:e,artifact:t,onClose:n}){let r=op(),i=_i({queryKey:[`artifact-text`,e,t.revisionId],queryFn:({signal:n})=>r.work.artifactText(e,t.revisionId,n),retry:!1});return(0,T.jsxs)(`div`,{children:[(0,T.jsx)(t_,{variant:`secondary`,onClick:n,children:`Back to artifacts`}),(0,T.jsx)(`h2`,{children:t.path}),(0,T.jsxs)(`a`,{href:t.href,children:[`Download `,t.path]}),i.isPending?(0,T.jsx)(r_,{label:`Loading artifact`}):i.isError?(0,T.jsx)(a_,{error:i.error,retry:()=>void i.refetch()}):(0,T.jsx)(`article`,{className:bS.markdown,"aria-label":t.path,children:(0,T.jsx)(hS,{skipHtml:!0,children:i.data})})]})}var qS={github:zS};function yoe(){let e=op(),t=_i({queryKey:Yg.board.list(),queryFn:({signal:t})=>e.board.list(void 0,t),refetchInterval:Xg.board}),n=t.data?.items??[];return(0,T.jsx)(T.Fragment,{children:t.isPending?(0,T.jsx)(r_,{label:`Loading work`}):t.error&&!t.data?(0,T.jsx)(a_,{error:t.error,retry:()=>void t.refetch()}):n.length===0?(0,T.jsx)(i_,{children:`No matching work items`}):(0,T.jsx)(fv,{caption:`Work items`,rows:n,rowKey:e=>e.workItemKey,columns:boe})})}var boe=[{label:`Ref`,render:e=>e.externalRef??`?`},{label:`Work item`,render:e=>(0,T.jsx)(Rn,{to:`/work/${encodeURIComponent(e.workItemKey)}`,children:e.objective})},{label:`Condition`,render:e=>(0,T.jsx)(v_,{variant:`outline`,children:e.condition})},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runs`,render:e=>e.runCount},{label:`Last run`,render:e=>e.lastRunAt===void 0?`?`:(0,T.jsx)(lv,{value:e.lastRunAt})},{label:`Outcome`,render:e=>e.lastRunOutcome===void 0?`?`:(0,T.jsx)(D_,{outcome:e.lastRunOutcome})},{label:`Cost`,render:e=>y_(e.totalCostUsd)},{label:`Usage`,render:e=>(0,T.jsx)(O_,{usage:e})}];function xoe(){let{workItemKey:e=``}=Tt();return(0,T.jsx)(JS,{workItemKey:e},e)}function JS({workItemKey:e}){let t=op(),n=Ct(),r=ni(),i=async()=>{await Promise.all([r.invalidateQueries({queryKey:Yg.work.all}),r.invalidateQueries({queryKey:Yg.board.list()})])},a=vi({mutationFn:n=>t.work.command(e,n,`web:${n}:${globalThis.crypto.randomUUID()}`),onSuccess:async(e,t)=>{await i(),t===`delete`&&n(`/work`)}}),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),f=(0,C.useRef)(0),p=(0,C.useRef)(null);(0,C.useEffect)(()=>{c&&p.current?.focus()},[c]);let m=vi({mutationFn:n=>t.work.message(e,n,`web:conversation-message:${globalThis.crypto.randomUUID()}`,void 0,c),onSuccess:async()=>{f.current=le.filter(e=>e.origin===`agent`).length,d(!0),oe.current=!0,ce(!1),s(``),l(!1),p.current&&(p.current.style.height=``),await i()}}),h=()=>{let e=o.trim();e!==``&&!m.isPending&&m.mutate(c?`/changes\n${e}`:e)},g=_i({queryKey:Yg.work.detail(e),queryFn:({signal:n})=>t.work.detail(e,n),refetchInterval:Xg.openWork,enabled:e!==``}),_=_i({queryKey:Yg.workflowDiagrams.get(e),queryFn:({signal:n})=>t.workflowDiagrams.get(e,n),refetchInterval:Xg.workflowDiagrams,enabled:e!==``&&g.data?.data.orchestration.primary!==null}),[v,y]=(0,C.useState)(vd.Failed),[b,x]=(0,C.useState)(`Operator determined this run failed.`),[S,ee]=(0,C.useState)(`{
|
|
1190
1190
|
"kind": "done",
|
|
1191
1191
|
"data": { "status": "DONE" }
|
|
1192
|
-
}`),te=vi({mutationFn:async({runId:n,outcome:r,status:i})=>{let a=globalThis.crypto.randomUUID();if(await t.execution.resolveAmbiguousRun(n,i===vd.Failed?{status:vd.Failed,reason:b}:{status:vd.Succeeded,outcome:r},`web:resolve-ambiguous-run:${a}`),i!==vd.Succeeded)return t.work.command(e,`retry`,`web:retry-after-ambiguous-resolution:${globalThis.crypto.randomUUID()}`)},onSuccess:i}),[w,ne]=(0,C.useState)(`overview`),[re,ie]=(0,C.useState)(null),ae=(0,C.useRef)(null),oe=(0,C.useRef)(!0),[se,ce]=(0,C.useState)(!1),le=[...g.data?.data.conversation.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)),ue=le.at(-1),de=g.data?.data.execution.runs.find(e=>e.active);(0,C.useEffect)(()=>{let e=le.filter(e=>e.origin===`agent`).length;u&&e>f.current&&d(!1)},[u,le]),(0,C.useLayoutEffect)(()=>{oe.current=!0,ce(!1)},[w]),(0,C.useLayoutEffect)(()=>{w===`conversation`&&oe.current&&ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},[w,ue?.entryId,ue?.body]);let[fe,pe]=(0,C.useState)(),[me,he]=(0,C.useState)(!1),[ge,_e]=(0,C.useState)(),ve=_i({queryKey:Yg.events.list(``,e),queryFn:({signal:n})=>t.events.list(void 0,e,n),refetchInterval:Xg.events,enabled:e!==``}),ye=[...g.data?.data.execution.transcriptGroups??[]].sort((e,t)=>Number(e.kind===`run`)-Number(t.kind===`run`)||t.latestAt.localeCompare(e.latestAt)),be=g.data?.data.orchestration.primary,xe=[...g.data?.data.execution.runs??[]].filter(e=>e.workflowInstanceId===be?.workflowInstanceId&&e.status===`ambiguous`).sort((e,t)=>t.startedAt.localeCompare(e.startedAt))[0],Se=be!=null&&be.status===`blocked`&&ZS(be.blockReason),Ce=ye.find(e=>e.groupId===fe)??ye[0],we=_i({queryKey:Yg.work.transcript(e,Ce?.groupId??``),queryFn:({signal:n})=>t.work.transcript(e,Ce.groupId,n),refetchInterval:Xg.historicalRuns,enabled:w===`transcripts`&&e!==``&&Ce!==void 0}),Te=ge!==void 0&&Ce?.runIds.includes(ge)?ge:Ce?.runIds.at(-1),Ee=[...we.data?.data.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)).filter(e=>!me||e.runId===Te),De=e=>{let t=ye.find(t=>t.groupId===e);pe(e),_e(t?.runIds.at(-1)),he(!1)},Oe=e=>{let t=Array.from(e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)??[]),n=t.indexOf(e.currentTarget);if(n<0)return;let r=e.key===`ArrowRight`?(n+1)%t.length:e.key===`ArrowLeft`?(n-1+t.length)%t.length:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;if(r===void 0)return;e.preventDefault();let i=t[r];if(i===void 0)return;let a=i.dataset.tab;ne(a),i.focus()};return(0,T.jsx)(`div`,{className:`${h_.detail} ${w===`conversation`?h_.detailChat:``}`,children:g.isPending?(0,T.jsx)(r_,{label:`Loading work detail`}):g.error&&!g.data?(0,T.jsx)(a_,{error:g.error,retry:()=>void g.refetch()}):g.data?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:h_.tabs,role:`tablist`,"aria-label":`Work detail sections`,children:[`overview`,`runs`,`artifacts`,`events`,`transcripts`,`conversation`].map(e=>(0,T.jsx)(`button`,{type:`button`,role:`tab`,"data-tab":e,id:`work-detail-${e}-tab`,"aria-controls":`work-detail-${e}-panel`,"aria-selected":w===e,tabIndex:w===e?0:-1,onKeyDown:Oe,onClick:()=>ne(e),children:e===`overview`?`Overview`:e[0].toUpperCase()+e.slice(1)},e))}),(0,T.jsxs)(`h1`,{className:h_.workTitle,children:[g.data.data.work.externalRef&&(0,T.jsx)(`span`,{children:g.data.data.work.externalRef}),g.data.data.work.objective]}),g.data.data.triggerOrigin&&(0,T.jsxs)(`p`,{children:[`Trigger origin:`,` `,(0,T.jsx)(Rn,{to:`/triggers/`+encodeURIComponent(g.data.data.triggerOrigin),children:g.data.data.triggerOrigin})]}),w!==`conversation`&&w!==`transcripts`&&(0,T.jsxs)(`div`,{className:h_.workSummary,children:[(0,T.jsx)(e_,{children:(0,T.jsxs)(`dl`,{className:h_.summary,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Work identity`}),(0,T.jsx)(`dd`,{children:g.data.data.work.workItemId})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`State`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(v_,{variant:`outline`,children:g.data.data.work.state})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Workflow`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.workflowName??`?`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Stage`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.currentStage??`Not started`})]}),be?.mergePolicyBlock&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge status`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.status===`recovering`?`PR merged; recovery pending`:`Waiting for human merge`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge policy`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.explanation})]}),be.mergePolicyBlock.policy?.blockedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Protected paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.blockedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.matchedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Matching changed paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.matchedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.maxFilesChanged!==void 0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`File-count limit`}),(0,T.jsxs)(`dd`,{children:[be.mergePolicyBlock.policy.maxFilesChanged,` (changed:`,` `,be.mergePolicyBlock.policy.filesChanged??`unknown`,`)`]})]}),be.mergePolicyBlock.href&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`a`,{href:be.mergePolicyBlock.href,target:`_blank`,rel:`noreferrer`,children:`View correlated PR`})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Next action`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.nextAction})]})]}),Se&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Blocked because`}),(0,T.jsx)(`dd`,{children:`Ambiguous run requires an operator decision`})]})}),g.data.data.work.lastRunOutcome!==void 0&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Last run`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(D_,{outcome:g.data.data.work.lastRunOutcome,title:`Outcome of the most recent run`})})]})})]})}),(0,T.jsxs)(`div`,{className:h_.actionBar,children:[g.data.data.conversation.canContinue===!0&&(0,T.jsx)(t_,{type:`button`,disabled:m.isPending,onClick:()=>{l(!0),ne(`conversation`)},children:`Continue with instructions`}),g.data.data.orchestration.primary?.retryEligible===!0&&(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`retry`),children:`Retry`}),g.data.data.orchestration.primary?.extendEligible===!0&&(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`extend`),children:`Extend`}),(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(g.data.data.work.frozen?`unfreeze`:`freeze`),children:g.data.data.work.frozen?`Unfreeze`:`Freeze`}),(0,T.jsx)(t_,{type:`button`,className:h_.dangerButton,disabled:a.isPending,onClick:()=>{window.confirm(`Delete this work item from the board and remove its resource correlations?`)&&a.mutate(`delete`)},children:`Delete`}),(0,T.jsx)(o_,{pending:a.isPending,...a.error===null?{}:{message:a.error?.message}})]})]}),w===`runs`?(0,T.jsx)(`section`,{id:`work-detail-runs-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-runs-tab`,children:g.data.data.execution.runs.length===0?(0,T.jsx)(i_,{children:`No runs`}):(0,T.jsx)(fv,{caption:`Runs`,rows:g.data.data.execution.runs,rowKey:e=>e.runId,columns:SS})}):w===`artifacts`?(0,T.jsx)(`section`,{id:`work-detail-artifacts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-artifacts-tab`,children:re?(0,T.jsx)(voe,{workItemKey:re.source?.workItemKey??e,artifact:re,onClose:()=>ie(null)},`${e}:${re.revisionId}`):g.data.data.artifacts.length===0?(0,T.jsx)(i_,{children:`No published artifacts`}):(0,T.jsx)($S,{artifacts:g.data.data.artifacts,onView:ie})}):w===`conversation`?(0,T.jsxs)(`section`,{id:`work-detail-conversation-panel`,className:h_.conversationPanel,role:`tabpanel`,"aria-labelledby":`work-detail-conversation-tab`,children:[(0,T.jsx)(`div`,{ref:ae,className:h_.conversationViewport,role:`region`,"aria-label":`Message history`,tabIndex:0,onScroll:e=>{let t=e.currentTarget;oe.current=t.scrollHeight-t.scrollTop-t.clientHeight<64,ce(!oe.current)},children:le.length===0?(0,T.jsx)(i_,{children:`No conversation messages`}):(0,T.jsx)(`ol`,{className:h_.conversationTimeline,"aria-label":`Conversation`,children:le.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.sourceResourceId);return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`article`,{className:h_.conversationEntry,"data-origin":e.origin,children:[(0,T.jsx)(YS,{actorId:e.actorId,sourceAdapter:e.sourceAdapter}),(0,T.jsxs)(`header`,{className:h_.conversationEntryHead,children:[(0,T.jsx)(`strong`,{children:e.actorId}),(0,T.jsxs)(`span`,{className:h_.conversationSource,children:[`via `,e.sourceAdapter??e.origin]}),(0,T.jsx)(lv,{value:e.occurredAt}),e.runId!==void 0&&(0,T.jsxs)(`span`,{children:[(0,T.jsxs)(Rn,{to:`/runs/${encodeURIComponent(e.runId)}`,children:[`run `,e.runId]}),e.stage===void 0?``:` (${e.stage})`]}),t!==void 0&&(0,T.jsx)(`span`,{children:t.externalUrl===void 0?t.locatorLabel:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:t.locatorLabel})})]}),e.deleted?(0,T.jsx)(`em`,{children:`Message deleted`}):(0,T.jsx)(`div`,{className:h_.conversationBody,children:(0,T.jsx)(hS,{skipHtml:!0,children:e.body})}),e.representations.length>0&&(0,T.jsx)(`footer`,{className:h_.conversationRepresentations,children:e.representations.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.resourceId),n=t?.locatorLabel??e.resourceId;return(0,T.jsxs)(`span`,{children:[`Published to`,` `,t?.externalUrl===void 0?n:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:n})]},`${e.resourceId}:${e.externalId}`)})})]})},e.entryId)})})}),(0,T.jsxs)(`div`,{className:h_.conversationFooter,children:[u&&(0,T.jsxs)(`div`,{className:h_.conversationProgress,role:`status`,"aria-live":`polite`,children:[de===void 0?(0,T.jsx)(Jg,{icon:mp,className:h_.conversationWaitingIcon,"aria-hidden":`true`}):(0,T.jsx)(`span`,{className:h_.conversationProgressDot,"data-active-run":`true`}),(0,T.jsx)(`span`,{className:h_.conversationProgressTitle,children:de===void 0?`Queued for Wake`:de.activity}),de!==void 0&&(0,T.jsxs)(`span`,{className:h_.conversationProgressMeta,children:[de.stage!==void 0&&`Stage: ${de.stage}`,de.stage!==void 0&&(de.runnerName!==void 0||de.runnerModel!==void 0)&&` · `,(de.runnerName!==void 0||de.runnerModel!==void 0)&&`Runner: ${de.runnerName??de.runnerModel}`]})]}),se&&(0,T.jsx)(t_,{className:h_.conversationLatest,onClick:()=>{oe.current=!0,ce(!1),ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},children:`Jump to latest`}),g.data.data.conversation.canCreateEntries&&(0,T.jsxs)(`form`,{className:h_.conversationComposer,onSubmit:e=>{e.preventDefault(),h()},children:[c&&(0,T.jsx)(`p`,{children:`Supply the instructions needed to continue this blocked stage.`}),(0,T.jsx)(`textarea`,{ref:p,id:`work-conversation-message`,"aria-label":c?`Continuation instructions`:`Message`,value:o,disabled:m.isPending,onChange:e=>{s(e.target.value),e.currentTarget.style.height=`auto`,e.currentTarget.style.height=`${Math.min(e.currentTarget.scrollHeight,192)}px`},placeholder:`Add context, answer a question, or direct the current work.`,rows:1}),(0,T.jsxs)(`div`,{className:h_.conversationComposerActions,children:[(0,T.jsx)(t_,{type:`submit`,className:h_.conversationSend,"aria-label":c?`Continue`:`Send message`,disabled:m.isPending||o.trim()===``,children:(0,T.jsx)(Jg,{icon:cp,"aria-hidden":`true`})}),c&&(0,T.jsx)(t_,{type:`button`,onClick:()=>l(!1),children:`Cancel continuation`}),(0,T.jsx)(o_,{pending:m.isPending,...m.error===null?{}:{message:m.error?.message}})]})]})]})]}):w===`transcripts`?(0,T.jsxs)(`section`,{id:`work-detail-transcripts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-transcripts-tab`,children:[(0,T.jsx)(`h2`,{id:`work-transcripts`,children:`Transcript conversations`}),ye.length===0?(0,T.jsx)(i_,{children:`No transcript conversations`}):(0,T.jsxs)(`div`,{className:h_.transcriptLayout,children:[(0,T.jsx)(`ol`,{className:h_.transcriptGroups,"aria-label":`Transcript groups`,children:ye.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:h_.transcriptGroup,"aria-pressed":Ce?.groupId===e.groupId,onClick:()=>De(e.groupId),children:[(0,T.jsx)(`span`,{children:e.groupId}),(0,T.jsx)(`span`,{children:e.kind===`session`?`Session`:`Run fallback`}),e.cli!==void 0&&(0,T.jsx)(`span`,{children:e.cli}),(0,T.jsx)(lv,{value:e.latestAt}),(0,T.jsx)(`span`,{children:e.runIds.join(`, `)})]})},e.groupId))}),(0,T.jsxs)(`div`,{className:h_.transcriptConversation,children:[Ce!==void 0&&Ce.runIds.length>1&&(0,T.jsxs)(`div`,{className:h_.transcriptFilters,children:[(0,T.jsxs)(`label`,{children:[`Run`,(0,T.jsx)(`select`,{value:Te??``,onChange:e=>_e(e.target.value),children:Ce.runIds.map(e=>(0,T.jsx)(`option`,{value:e,children:e},e))})]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked)}),`This run only`]})]}),we.isPending?(0,T.jsx)(r_,{label:`Loading transcript`}):we.error?(0,T.jsx)(a_,{error:we.error,retry:()=>void we.refetch()}):we.data?.data.available===!1?(0,T.jsx)(i_,{children:`Transcript unavailable`}):Ee.length===0?(0,T.jsx)(i_,{children:`No transcript messages`}):(0,T.jsx)(`ol`,{className:h_.transcript,"aria-label":`Transcript conversation`,children:Ee.map((e,t)=>(0,T.jsxs)(`li`,{children:[t>0&&Ee[t-1]?.runId!==e.runId&&(0,T.jsxs)(`div`,{className:h_.transcriptRunSeparator,role:`separator`,"aria-label":`Run ${e.runId}`,children:[`Run `,e.runId]}),(0,T.jsxs)(`article`,{className:e.channel===`input`?h_.transcriptInput:h_.transcriptAgent,"aria-label":`${e.channel===`input`?`Input`:`Agent`} message from ${e.runId}`,children:[(0,T.jsxs)(`div`,{className:h_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel===`input`?`Input`:`Agent`}),(0,T.jsx)(lv,{value:e.occurredAt}),(0,T.jsxs)(`span`,{children:[`Run `,e.runId]}),e.channel===`agent`&&e.durationMs!==void 0&&(0,T.jsx)(`span`,{children:x_(e.durationMs)})]}),(0,T.jsx)(`pre`,{className:h_.transcriptText,style:{whiteSpace:`pre-wrap`},children:e.text})]})]},`${e.occurredAt}-${t}`))})]})]})]}):w===`events`?(0,T.jsxs)(`section`,{id:`work-detail-events-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-events-tab`,children:[(0,T.jsx)(`h2`,{id:`work-events`,children:`Events`}),ve.isPending?(0,T.jsx)(r_,{label:`Loading events`}):ve.error?(0,T.jsx)(a_,{error:ve.error,retry:()=>void ve.refetch()}):ve.data?.items.length?(0,T.jsx)(`ol`,{className:h_.eventList,children:[...ve.data.items].sort((e,t)=>t.position-e.position).map(e=>(0,T.jsx)(Cre,{record:e},e.id))}):(0,T.jsx)(i_,{children:`No events`})]}):(0,T.jsxs)(`div`,{id:`work-detail-overview-panel`,className:h_.overviewLayout,role:`tabpanel`,"aria-labelledby":`work-detail-overview-tab`,children:[(0,T.jsx)(`div`,{className:h_.overviewWorkflow,children:_.data?.data.diagrams[0]===void 0?null:(0,T.jsx)(av,{diagram:_.data.data.diagrams[0]})}),(0,T.jsxs)(`aside`,{className:h_.overviewSidebar,children:[Se&&xe!==void 0&&(0,T.jsxs)(e_,{labelledBy:`ambiguous-run-resolution`,children:[(0,T.jsx)(`h2`,{id:`ambiguous-run-resolution`,className:h_.sidebarSectionTitle,children:`Resolve ambiguous run`}),(0,T.jsx)(`p`,{children:`Decide what happened before retrying this work. Wake will record your decision, then retry the work item.`}),(0,T.jsxs)(`dl`,{className:h_.summary,children:[(0,T.jsx)(`dt`,{children:`Run`}),(0,T.jsx)(`dd`,{children:xe.runId}),(0,T.jsx)(`dt`,{children:`Token usage`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(O_,{usage:xe})}),(0,T.jsx)(`dt`,{children:`Cost`}),(0,T.jsx)(`dd`,{children:y_(xe.totalCostUsd)}),(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:g.data.data.activities.pullRequest===void 0?`None recorded`:`Recorded for this work item`})]}),(0,T.jsxs)(`fieldset`,{disabled:te.isPending,children:[(0,T.jsx)(`legend`,{children:`Actual outcome`}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===vd.Failed,onChange:()=>y(vd.Failed)}),`Failed`]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===vd.Succeeded,onChange:()=>y(vd.Succeeded)}),`Succeeded`]}),v===vd.Failed?(0,T.jsxs)(`label`,{children:[`Reason`,(0,T.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value)})]}):(0,T.jsxs)(`label`,{children:[`Actual activity outcome (JSON)`,(0,T.jsx)(`textarea`,{value:S,onChange:e=>ee(e.target.value)})]})]}),(0,T.jsx)(t_,{type:`button`,disabled:te.isPending||v===vd.Failed&&b.trim()===``||v===vd.Succeeded&&QS(S)===void 0,onClick:()=>{let e=v===vd.Succeeded?QS(S):void 0;(v!==vd.Succeeded||e!==void 0)&&te.mutate({runId:xe.runId,outcome:e,status:v})},children:v===vd.Failed?`Resolve and retry`:`Resolve run`}),v===vd.Succeeded&&QS(S)===void 0&&(0,T.jsx)(`p`,{role:`alert`,children:`The actual activity outcome must be an object with a supported outcome kind.`}),(0,T.jsx)(o_,{pending:te.isPending,...te.error===null?{}:{message:te.error.message}})]}),(0,T.jsxs)(`section`,{"aria-labelledby":`work-resources`,children:[(0,T.jsx)(`h2`,{id:`work-resources`,className:h_.sidebarSectionTitle,children:`Resources`}),g.data.data.resources.length===0?(0,T.jsx)(i_,{children:`No correlated resources`}):(0,T.jsx)(`ul`,{className:h_.resourceList,"aria-label":`Resources`,children:g.data.data.resources.map(e=>{let t=qS[e.adapter]??BS,n=e.title??e.locatorLabel,r=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:h_.resourceCardTop,children:[(0,T.jsx)(t,{className:h_.resourceCardIcon}),(0,T.jsx)(`span`,{className:h_.resourceCardTitle,children:n}),e.externalUrl!==void 0&&(0,T.jsx)(VS,{className:h_.resourceCardExt})]}),(0,T.jsxs)(`div`,{className:h_.resourceCardMeta,children:[e.title!==void 0&&(0,T.jsx)(`span`,{className:h_.resourceId,children:e.locatorLabel}),e.capabilities.map(e=>(0,T.jsx)(v_,{variant:`outline`,children:e},e))]})]});return(0,T.jsx)(`li`,{children:e.externalUrl===void 0?(0,T.jsx)(`div`,{className:h_.resourceCard,children:r}):(0,T.jsx)(`a`,{className:h_.resourceCard,href:e.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:r})},e.resourceId)})})]}),g.data.data.delegation&&(0,T.jsx)(KS,{delegation:g.data.data.delegation,workItemKey:g.data.data.work.workItemKey})]}),(0,T.jsxs)(`section`,{className:h_.overviewMain,"aria-labelledby":`work-activity`,children:[(0,T.jsx)(`h2`,{id:`work-activity`,className:h_.sidebarSectionTitle,children:`Activity timeline`}),ve.isPending?(0,T.jsx)(r_,{label:`Loading activity`}):ve.error?(0,T.jsx)(a_,{error:ve.error,retry:()=>void ve.refetch()}):XS(g.data.data.execution.runs,ve.data?.items??[]).length?(0,T.jsx)(`ol`,{className:h_.activityTimeline,"aria-label":`Activity timeline`,children:XS(g.data.data.execution.runs,ve.data?.items??[]).map(e=>(0,T.jsxs)(`li`,{className:h_.activityTimelineItem,children:[(0,T.jsx)(`span`,{className:h_.activityTimelineMarker,"data-kind":e.kind}),(0,T.jsx)(lv,{value:e.occurredAt}),e.kind===`run`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:h_.activityTimelineKind,"data-kind":`run`,children:`Run`}),(0,T.jsx)(Rn,{to:`/runs/${encodeURIComponent(e.run.runId)}`,children:e.run.activity}),(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Stage: `,e.run.stage??`Not assigned`]}),(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Runner:`,` `,e.run.runnerName??e.run.runnerModel??`Unassigned`]}),(0,T.jsxs)(`span`,{className:h_.activityTimelineOutcome,children:[`Outcome: `,Soe(e.run)]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:h_.activityTimelineKind,"data-kind":`event`,children:`Event`}),(0,T.jsx)(`span`,{children:e.event.type}),e.event.stream!==void 0&&(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Stream: `,e.event.stream.kind]})]})]},e.id))}):(0,T.jsx)(i_,{children:`No activity yet`})]})]})]}):null})}function YS({actorId:e,sourceAdapter:t}){let[n,r]=(0,C.useState)(!1),i=t===`github`&&e.trim()!==``;return(0,T.jsx)(`span`,{className:h_.conversationAvatar,"aria-label":i?`${e} GitHub avatar`:e,children:i&&!n?(0,T.jsx)(`img`,{src:`https://github.com/${encodeURIComponent(e)}.png?size=64`,alt:``,onError:()=>r(!0)}):e.slice(0,2).toUpperCase()})}function XS(e,t){return[...e.map(e=>({id:`run:${e.runId}`,kind:`run`,occurredAt:e.finishedAt??e.startedAt,run:e})),...t.map(e=>({id:`event:${e.id}`,kind:`event`,occurredAt:e.occurredAt,event:e}))].sort((e,t)=>t.occurredAt.localeCompare(e.occurredAt))}function Soe(e){return e.resolution?.sentinel??e.sentinel??e.status}function ZS(e){return zd(e)}function QS(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return;let n=t.kind;return typeof n==`string`&&Object.values(xd).includes(n)?t:void 0}catch{return}}function $S({artifacts:e,onView:t}){let n=e.filter(e=>e.source===void 0),r=e.filter(e=>e.source!==void 0);return(0,T.jsxs)(T.Fragment,{children:[n.length>0&&(0,T.jsx)(US,{caption:`Published artifacts`,rows:n,onView:t}),r.length>0&&(0,T.jsx)(US,{caption:`Available from related work`,rows:r,showSource:!0,onView:t})]})}function eC({client:e=new rp}){let[t]=(0,C.useState)(()=>new iee({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchIntervalInBackground:!1}}})),[n,r]=(0,C.useState)();return(0,C.useEffect)(()=>{let t=new URLSearchParams(globalThis.location.search).get(`grant`);(async()=>{if(t!==null){let n=await e.auth.redeem(t);if(globalThis.history.replaceState({},``,`${globalThis.location.pathname}${globalThis.location.hash}`),n)return r(!0)}return e.auth.session().then(r).catch(()=>r(!1))})()},[e]),n===void 0?null:n?(0,T.jsx)(ri,{client:t,children:(0,T.jsx)(ap.Provider,{value:e,children:(0,T.jsx)(woe,{})})}):(0,T.jsx)(Coe,{client:e,onAuthenticated:()=>r(!0)})}function Coe({client:e,onAuthenticated:t}){let[n,r]=(0,C.useState)(``),[i,a]=(0,C.useState)(!1);async function o(r){r.preventDefault(),await e.auth.redeem(n)?t():a(!0)}return(0,T.jsx)(`main`,{className:`wake-login`,children:(0,T.jsxs)(`div`,{className:`wake-login-panel`,children:[(0,T.jsx)(`section`,{className:`wake-login-brand`,children:(0,T.jsx)(`img`,{className:`wake-login-logo`,src:bi,alt:`Wake logo`})}),(0,T.jsxs)(`section`,{className:`wake-login-card`,children:[(0,T.jsx)(`h1`,{children:`Login`}),(0,T.jsx)(`p`,{children:`Enter a temporary login code, or scan the code from your operator terminal.`}),(0,T.jsxs)(`form`,{onSubmit:o,children:[(0,T.jsx)(`label`,{htmlFor:`access-key`,children:`Temporary login code`}),(0,T.jsx)(`input`,{id:`access-key`,type:`password`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,required:!0}),(0,T.jsx)(`button`,{className:`wake-login-submit`,type:`submit`,children:`Sign in`}),i&&(0,T.jsx)(`p`,{role:`alert`,children:`Unable to sign in.`})]})]})]})})}function woe(){return(0,T.jsx)(Kne,{children:(0,T.jsxs)(Xt,{children:[(0,T.jsx)(Jt,{path:`/`,element:(0,T.jsx)(qt,{to:`/board`,replace:!0})}),(0,T.jsx)(Jt,{path:`/board`,element:(0,T.jsx)(ore,{})}),(0,T.jsx)(Jt,{path:`/work`,element:(0,T.jsx)(yoe,{})}),(0,T.jsx)(Jt,{path:`/work/:workItemKey`,element:(0,T.jsx)(xoe,{})}),(0,T.jsx)(Jt,{path:`/triggers`,element:(0,T.jsx)(DS,{})}),(0,T.jsx)(Jt,{path:`/triggers/:triggerId`,element:(0,T.jsx)(OS,{})}),(0,T.jsx)(Jt,{path:`/events`,element:(0,T.jsx)(xre,{})}),(0,T.jsx)(Jt,{path:`/runs`,element:(0,T.jsx)(xS,{})}),(0,T.jsx)(Jt,{path:`/runs/:runId`,element:(0,T.jsx)(ES,{})}),(0,T.jsx)(Jt,{path:`/observability`,element:(0,T.jsx)(Ere,{})}),(0,T.jsx)(Jt,{path:`/health`,element:(0,T.jsx)(wre,{})}),(0,T.jsx)(Jt,{path:`/configuration`,element:(0,T.jsx)(bre,{})}),(0,T.jsx)(Jt,{path:`*`,element:(0,T.jsx)(qt,{to:`/board`,replace:!0})})]})})}(0,yi.createRoot)(document.getElementById(`root`)).render((0,T.jsx)(C.StrictMode,{children:(0,T.jsx)(Ln,{children:(0,T.jsx)(eC,{})})}));
|
|
1192
|
+
}`),te=vi({mutationFn:async({runId:n,outcome:r,status:i})=>{let a=globalThis.crypto.randomUUID();if(await t.execution.resolveAmbiguousRun(n,i===vd.Failed?{status:vd.Failed,reason:b}:{status:vd.Succeeded,outcome:r},`web:resolve-ambiguous-run:${a}`),i!==vd.Succeeded)return t.work.command(e,`retry`,`web:retry-after-ambiguous-resolution:${globalThis.crypto.randomUUID()}`)},onSuccess:i}),[w,ne]=(0,C.useState)(`overview`),[re,ie]=(0,C.useState)(null),ae=(0,C.useRef)(null),oe=(0,C.useRef)(!0),[se,ce]=(0,C.useState)(!1),le=[...g.data?.data.conversation.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)),ue=le.at(-1),de=g.data?.data.execution.runs.find(e=>e.active);(0,C.useEffect)(()=>{let e=le.filter(e=>e.origin===`agent`).length;u&&e>f.current&&d(!1)},[u,le]),(0,C.useLayoutEffect)(()=>{oe.current=!0,ce(!1)},[w]),(0,C.useLayoutEffect)(()=>{w===`conversation`&&oe.current&&ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},[w,ue?.entryId,ue?.body]);let[fe,pe]=(0,C.useState)(),[me,he]=(0,C.useState)(!1),[ge,_e]=(0,C.useState)(),ve=_i({queryKey:Yg.events.list(``,e),queryFn:({signal:n})=>t.events.list(void 0,e,n),refetchInterval:Xg.events,enabled:e!==``}),ye=[...g.data?.data.execution.transcriptGroups??[]].sort((e,t)=>Number(e.kind===`run`)-Number(t.kind===`run`)||t.latestAt.localeCompare(e.latestAt)),be=g.data?.data.orchestration.primary,xe=[...g.data?.data.execution.runs??[]].filter(e=>e.workflowInstanceId===be?.workflowInstanceId&&e.status===`ambiguous`).sort((e,t)=>t.startedAt.localeCompare(e.startedAt))[0],Se=be!=null&&be.status===`blocked`&&ZS(be.blockReason),Ce=ye.find(e=>e.groupId===fe)??ye[0],we=_i({queryKey:Yg.work.transcript(e,Ce?.groupId??``),queryFn:({signal:n})=>t.work.transcript(e,Ce.groupId,n),refetchInterval:Xg.historicalRuns,enabled:w===`transcripts`&&e!==``&&Ce!==void 0}),Te=ge!==void 0&&Ce?.runIds.includes(ge)?ge:Ce?.runIds.at(-1),Ee=[...we.data?.data.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)).filter(e=>!me||e.runId===Te),De=e=>{let t=ye.find(t=>t.groupId===e);pe(e),_e(t?.runIds.at(-1)),he(!1)},Oe=e=>{let t=Array.from(e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)??[]),n=t.indexOf(e.currentTarget);if(n<0)return;let r=e.key===`ArrowRight`?(n+1)%t.length:e.key===`ArrowLeft`?(n-1+t.length)%t.length:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;if(r===void 0)return;e.preventDefault();let i=t[r];if(i===void 0)return;let a=i.dataset.tab;ne(a),i.focus()};return(0,T.jsx)(`div`,{className:`${h_.detail} ${w===`conversation`?h_.detailChat:``}`,children:g.isPending?(0,T.jsx)(r_,{label:`Loading work detail`}):g.error&&!g.data?(0,T.jsx)(a_,{error:g.error,retry:()=>void g.refetch()}):g.data?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:h_.tabs,role:`tablist`,"aria-label":`Work detail sections`,children:[`overview`,`runs`,`artifacts`,`events`,`transcripts`,`conversation`].map(e=>(0,T.jsx)(`button`,{type:`button`,role:`tab`,"data-tab":e,id:`work-detail-${e}-tab`,"aria-controls":`work-detail-${e}-panel`,"aria-selected":w===e,tabIndex:w===e?0:-1,onKeyDown:Oe,onClick:()=>ne(e),children:e===`overview`?`Overview`:e[0].toUpperCase()+e.slice(1)},e))}),(0,T.jsxs)(`h1`,{className:h_.workTitle,children:[g.data.data.work.externalRef&&(0,T.jsx)(`span`,{children:g.data.data.work.externalRef}),g.data.data.work.objective]}),g.data.data.triggerOrigin&&(0,T.jsxs)(`p`,{children:[`Trigger origin:`,` `,(0,T.jsx)(Rn,{to:`/triggers/`+encodeURIComponent(g.data.data.triggerOrigin),children:g.data.data.triggerOrigin})]}),w!==`conversation`&&w!==`transcripts`&&(0,T.jsxs)(`div`,{className:h_.workSummary,children:[(0,T.jsx)(e_,{children:(0,T.jsxs)(`dl`,{className:h_.summary,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Work identity`}),(0,T.jsx)(`dd`,{children:g.data.data.work.workItemId})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`State`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(v_,{variant:`outline`,children:g.data.data.work.state})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Workflow`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.workflowName??`?`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Stage`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.currentStage??`Not started`})]}),be?.retryCondition&&(0,T.jsx)(`p`,{children:be.retryCondition}),be?.mergePolicyBlock&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge status`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.status===`recovering`?`PR merged; recovery pending`:`Waiting for human merge`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge policy`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.explanation})]}),be.mergePolicyBlock.policy?.blockedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Protected paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.blockedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.matchedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Matching changed paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.matchedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.maxFilesChanged!==void 0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`File-count limit`}),(0,T.jsxs)(`dd`,{children:[be.mergePolicyBlock.policy.maxFilesChanged,` (changed:`,` `,be.mergePolicyBlock.policy.filesChanged??`unknown`,`)`]})]}),be.mergePolicyBlock.href&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`a`,{href:be.mergePolicyBlock.href,target:`_blank`,rel:`noreferrer`,children:`View correlated PR`})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Next action`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.nextAction})]})]}),Se&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Blocked because`}),(0,T.jsx)(`dd`,{children:`Ambiguous run requires an operator decision`})]})}),g.data.data.work.lastRunOutcome!==void 0&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Last run`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(D_,{outcome:g.data.data.work.lastRunOutcome,title:`Outcome of the most recent run`})})]})})]})}),(0,T.jsxs)(`div`,{className:h_.actionBar,children:[g.data.data.conversation.canContinue===!0&&(0,T.jsx)(t_,{type:`button`,disabled:m.isPending,onClick:()=>{l(!0),ne(`conversation`)},children:`Continue with instructions`}),g.data.data.orchestration.primary?.retryEligible===!0&&(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`retry`),children:`Retry`}),g.data.data.orchestration.primary?.extendEligible===!0&&(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`extend`),children:`Extend`}),(0,T.jsx)(t_,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(g.data.data.work.frozen?`unfreeze`:`freeze`),children:g.data.data.work.frozen?`Unfreeze`:`Freeze`}),(0,T.jsx)(t_,{type:`button`,className:h_.dangerButton,disabled:a.isPending,onClick:()=>{window.confirm(`Delete this work item from the board and remove its resource correlations?`)&&a.mutate(`delete`)},children:`Delete`}),(0,T.jsx)(o_,{pending:a.isPending,...a.error===null?{}:{message:a.error?.message}})]})]}),w===`runs`?(0,T.jsx)(`section`,{id:`work-detail-runs-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-runs-tab`,children:g.data.data.execution.runs.length===0?(0,T.jsx)(i_,{children:`No runs`}):(0,T.jsx)(fv,{caption:`Runs`,rows:g.data.data.execution.runs,rowKey:e=>e.runId,columns:SS})}):w===`artifacts`?(0,T.jsx)(`section`,{id:`work-detail-artifacts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-artifacts-tab`,children:re?(0,T.jsx)(voe,{workItemKey:re.source?.workItemKey??e,artifact:re,onClose:()=>ie(null)},`${e}:${re.revisionId}`):g.data.data.artifacts.length===0?(0,T.jsx)(i_,{children:`No published artifacts`}):(0,T.jsx)($S,{artifacts:g.data.data.artifacts,onView:ie})}):w===`conversation`?(0,T.jsxs)(`section`,{id:`work-detail-conversation-panel`,className:h_.conversationPanel,role:`tabpanel`,"aria-labelledby":`work-detail-conversation-tab`,children:[(0,T.jsx)(`div`,{ref:ae,className:h_.conversationViewport,role:`region`,"aria-label":`Message history`,tabIndex:0,onScroll:e=>{let t=e.currentTarget;oe.current=t.scrollHeight-t.scrollTop-t.clientHeight<64,ce(!oe.current)},children:le.length===0?(0,T.jsx)(i_,{children:`No conversation messages`}):(0,T.jsx)(`ol`,{className:h_.conversationTimeline,"aria-label":`Conversation`,children:le.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.sourceResourceId);return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`article`,{className:h_.conversationEntry,"data-origin":e.origin,children:[(0,T.jsx)(YS,{actorId:e.actorId,sourceAdapter:e.sourceAdapter}),(0,T.jsxs)(`header`,{className:h_.conversationEntryHead,children:[(0,T.jsx)(`strong`,{children:e.actorId}),(0,T.jsxs)(`span`,{className:h_.conversationSource,children:[`via `,e.sourceAdapter??e.origin]}),(0,T.jsx)(lv,{value:e.occurredAt}),e.runId!==void 0&&(0,T.jsxs)(`span`,{children:[(0,T.jsxs)(Rn,{to:`/runs/${encodeURIComponent(e.runId)}`,children:[`run `,e.runId]}),e.stage===void 0?``:` (${e.stage})`]}),t!==void 0&&(0,T.jsx)(`span`,{children:t.externalUrl===void 0?t.locatorLabel:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:t.locatorLabel})})]}),e.deleted?(0,T.jsx)(`em`,{children:`Message deleted`}):(0,T.jsx)(`div`,{className:h_.conversationBody,children:(0,T.jsx)(hS,{skipHtml:!0,children:e.body})}),e.representations.length>0&&(0,T.jsx)(`footer`,{className:h_.conversationRepresentations,children:e.representations.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.resourceId),n=t?.locatorLabel??e.resourceId;return(0,T.jsxs)(`span`,{children:[`Published to`,` `,t?.externalUrl===void 0?n:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:n})]},`${e.resourceId}:${e.externalId}`)})})]})},e.entryId)})})}),(0,T.jsxs)(`div`,{className:h_.conversationFooter,children:[u&&(0,T.jsxs)(`div`,{className:h_.conversationProgress,role:`status`,"aria-live":`polite`,children:[de===void 0?(0,T.jsx)(Jg,{icon:mp,className:h_.conversationWaitingIcon,"aria-hidden":`true`}):(0,T.jsx)(`span`,{className:h_.conversationProgressDot,"data-active-run":`true`}),(0,T.jsx)(`span`,{className:h_.conversationProgressTitle,children:de===void 0?`Queued for Wake`:de.activity}),de!==void 0&&(0,T.jsxs)(`span`,{className:h_.conversationProgressMeta,children:[de.stage!==void 0&&`Stage: ${de.stage}`,de.stage!==void 0&&(de.runnerName!==void 0||de.runnerModel!==void 0)&&` · `,(de.runnerName!==void 0||de.runnerModel!==void 0)&&`Runner: ${de.runnerName??de.runnerModel}`]})]}),se&&(0,T.jsx)(t_,{className:h_.conversationLatest,onClick:()=>{oe.current=!0,ce(!1),ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},children:`Jump to latest`}),g.data.data.conversation.canCreateEntries&&(0,T.jsxs)(`form`,{className:h_.conversationComposer,onSubmit:e=>{e.preventDefault(),h()},children:[c&&(0,T.jsx)(`p`,{children:`Supply the instructions needed to continue this blocked stage.`}),(0,T.jsx)(`textarea`,{ref:p,id:`work-conversation-message`,"aria-label":c?`Continuation instructions`:`Message`,value:o,disabled:m.isPending,onChange:e=>{s(e.target.value),e.currentTarget.style.height=`auto`,e.currentTarget.style.height=`${Math.min(e.currentTarget.scrollHeight,192)}px`},placeholder:`Add context, answer a question, or direct the current work.`,rows:1}),(0,T.jsxs)(`div`,{className:h_.conversationComposerActions,children:[(0,T.jsx)(t_,{type:`submit`,className:h_.conversationSend,"aria-label":c?`Continue`:`Send message`,disabled:m.isPending||o.trim()===``,children:(0,T.jsx)(Jg,{icon:cp,"aria-hidden":`true`})}),c&&(0,T.jsx)(t_,{type:`button`,onClick:()=>l(!1),children:`Cancel continuation`}),(0,T.jsx)(o_,{pending:m.isPending,...m.error===null?{}:{message:m.error?.message}})]})]})]})]}):w===`transcripts`?(0,T.jsxs)(`section`,{id:`work-detail-transcripts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-transcripts-tab`,children:[(0,T.jsx)(`h2`,{id:`work-transcripts`,children:`Transcript conversations`}),ye.length===0?(0,T.jsx)(i_,{children:`No transcript conversations`}):(0,T.jsxs)(`div`,{className:h_.transcriptLayout,children:[(0,T.jsx)(`ol`,{className:h_.transcriptGroups,"aria-label":`Transcript groups`,children:ye.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:h_.transcriptGroup,"aria-pressed":Ce?.groupId===e.groupId,onClick:()=>De(e.groupId),children:[(0,T.jsx)(`span`,{children:e.groupId}),(0,T.jsx)(`span`,{children:e.kind===`session`?`Session`:`Run fallback`}),e.cli!==void 0&&(0,T.jsx)(`span`,{children:e.cli}),(0,T.jsx)(lv,{value:e.latestAt}),(0,T.jsx)(`span`,{children:e.runIds.join(`, `)})]})},e.groupId))}),(0,T.jsxs)(`div`,{className:h_.transcriptConversation,children:[Ce!==void 0&&Ce.runIds.length>1&&(0,T.jsxs)(`div`,{className:h_.transcriptFilters,children:[(0,T.jsxs)(`label`,{children:[`Run`,(0,T.jsx)(`select`,{value:Te??``,onChange:e=>_e(e.target.value),children:Ce.runIds.map(e=>(0,T.jsx)(`option`,{value:e,children:e},e))})]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked)}),`This run only`]})]}),we.isPending?(0,T.jsx)(r_,{label:`Loading transcript`}):we.error?(0,T.jsx)(a_,{error:we.error,retry:()=>void we.refetch()}):we.data?.data.available===!1?(0,T.jsx)(i_,{children:`Transcript unavailable`}):Ee.length===0?(0,T.jsx)(i_,{children:`No transcript messages`}):(0,T.jsx)(`ol`,{className:h_.transcript,"aria-label":`Transcript conversation`,children:Ee.map((e,t)=>(0,T.jsxs)(`li`,{children:[t>0&&Ee[t-1]?.runId!==e.runId&&(0,T.jsxs)(`div`,{className:h_.transcriptRunSeparator,role:`separator`,"aria-label":`Run ${e.runId}`,children:[`Run `,e.runId]}),(0,T.jsxs)(`article`,{className:e.channel===`input`?h_.transcriptInput:h_.transcriptAgent,"aria-label":`${e.channel===`input`?`Input`:`Agent`} message from ${e.runId}`,children:[(0,T.jsxs)(`div`,{className:h_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel===`input`?`Input`:`Agent`}),(0,T.jsx)(lv,{value:e.occurredAt}),(0,T.jsxs)(`span`,{children:[`Run `,e.runId]}),e.channel===`agent`&&e.durationMs!==void 0&&(0,T.jsx)(`span`,{children:x_(e.durationMs)})]}),(0,T.jsx)(`pre`,{className:h_.transcriptText,style:{whiteSpace:`pre-wrap`},children:e.text})]})]},`${e.occurredAt}-${t}`))})]})]})]}):w===`events`?(0,T.jsxs)(`section`,{id:`work-detail-events-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-events-tab`,children:[(0,T.jsx)(`h2`,{id:`work-events`,children:`Events`}),ve.isPending?(0,T.jsx)(r_,{label:`Loading events`}):ve.error?(0,T.jsx)(a_,{error:ve.error,retry:()=>void ve.refetch()}):ve.data?.items.length?(0,T.jsx)(`ol`,{className:h_.eventList,children:[...ve.data.items].sort((e,t)=>t.position-e.position).map(e=>(0,T.jsx)(Cre,{record:e},e.id))}):(0,T.jsx)(i_,{children:`No events`})]}):(0,T.jsxs)(`div`,{id:`work-detail-overview-panel`,className:h_.overviewLayout,role:`tabpanel`,"aria-labelledby":`work-detail-overview-tab`,children:[(0,T.jsx)(`div`,{className:h_.overviewWorkflow,children:_.data?.data.diagrams[0]===void 0?null:(0,T.jsx)(av,{diagram:_.data.data.diagrams[0]})}),(0,T.jsxs)(`aside`,{className:h_.overviewSidebar,children:[Se&&xe!==void 0&&(0,T.jsxs)(e_,{labelledBy:`ambiguous-run-resolution`,children:[(0,T.jsx)(`h2`,{id:`ambiguous-run-resolution`,className:h_.sidebarSectionTitle,children:`Resolve ambiguous run`}),(0,T.jsx)(`p`,{children:`Decide what happened before retrying this work. Wake will record your decision, then retry the work item.`}),(0,T.jsxs)(`dl`,{className:h_.summary,children:[(0,T.jsx)(`dt`,{children:`Run`}),(0,T.jsx)(`dd`,{children:xe.runId}),(0,T.jsx)(`dt`,{children:`Token usage`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(O_,{usage:xe})}),(0,T.jsx)(`dt`,{children:`Cost`}),(0,T.jsx)(`dd`,{children:y_(xe.totalCostUsd)}),(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:g.data.data.activities.pullRequest===void 0?`None recorded`:`Recorded for this work item`})]}),(0,T.jsxs)(`fieldset`,{disabled:te.isPending,children:[(0,T.jsx)(`legend`,{children:`Actual outcome`}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===vd.Failed,onChange:()=>y(vd.Failed)}),`Failed`]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===vd.Succeeded,onChange:()=>y(vd.Succeeded)}),`Succeeded`]}),v===vd.Failed?(0,T.jsxs)(`label`,{children:[`Reason`,(0,T.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value)})]}):(0,T.jsxs)(`label`,{children:[`Actual activity outcome (JSON)`,(0,T.jsx)(`textarea`,{value:S,onChange:e=>ee(e.target.value)})]})]}),(0,T.jsx)(t_,{type:`button`,disabled:te.isPending||v===vd.Failed&&b.trim()===``||v===vd.Succeeded&&QS(S)===void 0,onClick:()=>{let e=v===vd.Succeeded?QS(S):void 0;(v!==vd.Succeeded||e!==void 0)&&te.mutate({runId:xe.runId,outcome:e,status:v})},children:v===vd.Failed?`Resolve and retry`:`Resolve run`}),v===vd.Succeeded&&QS(S)===void 0&&(0,T.jsx)(`p`,{role:`alert`,children:`The actual activity outcome must be an object with a supported outcome kind.`}),(0,T.jsx)(o_,{pending:te.isPending,...te.error===null?{}:{message:te.error.message}})]}),(0,T.jsxs)(`section`,{"aria-labelledby":`work-resources`,children:[(0,T.jsx)(`h2`,{id:`work-resources`,className:h_.sidebarSectionTitle,children:`Resources`}),g.data.data.resources.length===0?(0,T.jsx)(i_,{children:`No correlated resources`}):(0,T.jsx)(`ul`,{className:h_.resourceList,"aria-label":`Resources`,children:g.data.data.resources.map(e=>{let t=qS[e.adapter]??BS,n=e.title??e.locatorLabel,r=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:h_.resourceCardTop,children:[(0,T.jsx)(t,{className:h_.resourceCardIcon}),(0,T.jsx)(`span`,{className:h_.resourceCardTitle,children:n}),e.externalUrl!==void 0&&(0,T.jsx)(VS,{className:h_.resourceCardExt})]}),(0,T.jsxs)(`div`,{className:h_.resourceCardMeta,children:[e.title!==void 0&&(0,T.jsx)(`span`,{className:h_.resourceId,children:e.locatorLabel}),e.capabilities.map(e=>(0,T.jsx)(v_,{variant:`outline`,children:e},e))]})]});return(0,T.jsx)(`li`,{children:e.externalUrl===void 0?(0,T.jsx)(`div`,{className:h_.resourceCard,children:r}):(0,T.jsx)(`a`,{className:h_.resourceCard,href:e.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:r})},e.resourceId)})})]}),g.data.data.delegation&&(0,T.jsx)(KS,{delegation:g.data.data.delegation,workItemKey:g.data.data.work.workItemKey})]}),(0,T.jsxs)(`section`,{className:h_.overviewMain,"aria-labelledby":`work-activity`,children:[(0,T.jsx)(`h2`,{id:`work-activity`,className:h_.sidebarSectionTitle,children:`Activity timeline`}),ve.isPending?(0,T.jsx)(r_,{label:`Loading activity`}):ve.error?(0,T.jsx)(a_,{error:ve.error,retry:()=>void ve.refetch()}):XS(g.data.data.execution.runs,ve.data?.items??[]).length?(0,T.jsx)(`ol`,{className:h_.activityTimeline,"aria-label":`Activity timeline`,children:XS(g.data.data.execution.runs,ve.data?.items??[]).map(e=>(0,T.jsxs)(`li`,{className:h_.activityTimelineItem,children:[(0,T.jsx)(`span`,{className:h_.activityTimelineMarker,"data-kind":e.kind}),(0,T.jsx)(lv,{value:e.occurredAt}),e.kind===`run`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:h_.activityTimelineKind,"data-kind":`run`,children:`Run`}),(0,T.jsx)(Rn,{to:`/runs/${encodeURIComponent(e.run.runId)}`,children:e.run.activity}),(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Stage: `,e.run.stage??`Not assigned`]}),(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Runner:`,` `,e.run.runnerName??e.run.runnerModel??`Unassigned`]}),(0,T.jsxs)(`span`,{className:h_.activityTimelineOutcome,children:[`Outcome: `,Soe(e.run)]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:h_.activityTimelineKind,"data-kind":`event`,children:`Event`}),(0,T.jsx)(`span`,{children:e.event.type}),e.event.stream!==void 0&&(0,T.jsxs)(`span`,{className:h_.activityTimelineDetail,children:[`Stream: `,e.event.stream.kind]})]})]},e.id))}):(0,T.jsx)(i_,{children:`No activity yet`})]})]})]}):null})}function YS({actorId:e,sourceAdapter:t}){let[n,r]=(0,C.useState)(!1),i=t===`github`&&e.trim()!==``;return(0,T.jsx)(`span`,{className:h_.conversationAvatar,"aria-label":i?`${e} GitHub avatar`:e,children:i&&!n?(0,T.jsx)(`img`,{src:`https://github.com/${encodeURIComponent(e)}.png?size=64`,alt:``,onError:()=>r(!0)}):e.slice(0,2).toUpperCase()})}function XS(e,t){return[...e.map(e=>({id:`run:${e.runId}`,kind:`run`,occurredAt:e.finishedAt??e.startedAt,run:e})),...t.map(e=>({id:`event:${e.id}`,kind:`event`,occurredAt:e.occurredAt,event:e}))].sort((e,t)=>t.occurredAt.localeCompare(e.occurredAt))}function Soe(e){return e.resolution?.sentinel??e.sentinel??e.status}function ZS(e){return zd(e)}function QS(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return;let n=t.kind;return typeof n==`string`&&Object.values(xd).includes(n)?t:void 0}catch{return}}function $S({artifacts:e,onView:t}){let n=e.filter(e=>e.source===void 0),r=e.filter(e=>e.source!==void 0);return(0,T.jsxs)(T.Fragment,{children:[n.length>0&&(0,T.jsx)(US,{caption:`Published artifacts`,rows:n,onView:t}),r.length>0&&(0,T.jsx)(US,{caption:`Available from related work`,rows:r,showSource:!0,onView:t})]})}function eC({client:e=new rp}){let[t]=(0,C.useState)(()=>new iee({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchIntervalInBackground:!1}}})),[n,r]=(0,C.useState)();return(0,C.useEffect)(()=>{let t=new URLSearchParams(globalThis.location.search).get(`grant`);(async()=>{if(t!==null){let n=await e.auth.redeem(t);if(globalThis.history.replaceState({},``,`${globalThis.location.pathname}${globalThis.location.hash}`),n)return r(!0)}return e.auth.session().then(r).catch(()=>r(!1))})()},[e]),n===void 0?null:n?(0,T.jsx)(ri,{client:t,children:(0,T.jsx)(ap.Provider,{value:e,children:(0,T.jsx)(woe,{})})}):(0,T.jsx)(Coe,{client:e,onAuthenticated:()=>r(!0)})}function Coe({client:e,onAuthenticated:t}){let[n,r]=(0,C.useState)(``),[i,a]=(0,C.useState)(!1);async function o(r){r.preventDefault(),await e.auth.redeem(n)?t():a(!0)}return(0,T.jsx)(`main`,{className:`wake-login`,children:(0,T.jsxs)(`div`,{className:`wake-login-panel`,children:[(0,T.jsx)(`section`,{className:`wake-login-brand`,children:(0,T.jsx)(`img`,{className:`wake-login-logo`,src:bi,alt:`Wake logo`})}),(0,T.jsxs)(`section`,{className:`wake-login-card`,children:[(0,T.jsx)(`h1`,{children:`Login`}),(0,T.jsx)(`p`,{children:`Enter a temporary login code, or scan the code from your operator terminal.`}),(0,T.jsxs)(`form`,{onSubmit:o,children:[(0,T.jsx)(`label`,{htmlFor:`access-key`,children:`Temporary login code`}),(0,T.jsx)(`input`,{id:`access-key`,type:`password`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,required:!0}),(0,T.jsx)(`button`,{className:`wake-login-submit`,type:`submit`,children:`Sign in`}),i&&(0,T.jsx)(`p`,{role:`alert`,children:`Unable to sign in.`})]})]})]})})}function woe(){return(0,T.jsx)(Kne,{children:(0,T.jsxs)(Xt,{children:[(0,T.jsx)(Jt,{path:`/`,element:(0,T.jsx)(qt,{to:`/board`,replace:!0})}),(0,T.jsx)(Jt,{path:`/board`,element:(0,T.jsx)(ore,{})}),(0,T.jsx)(Jt,{path:`/work`,element:(0,T.jsx)(yoe,{})}),(0,T.jsx)(Jt,{path:`/work/:workItemKey`,element:(0,T.jsx)(xoe,{})}),(0,T.jsx)(Jt,{path:`/triggers`,element:(0,T.jsx)(DS,{})}),(0,T.jsx)(Jt,{path:`/triggers/:triggerId`,element:(0,T.jsx)(OS,{})}),(0,T.jsx)(Jt,{path:`/events`,element:(0,T.jsx)(xre,{})}),(0,T.jsx)(Jt,{path:`/runs`,element:(0,T.jsx)(xS,{})}),(0,T.jsx)(Jt,{path:`/runs/:runId`,element:(0,T.jsx)(ES,{})}),(0,T.jsx)(Jt,{path:`/observability`,element:(0,T.jsx)(Ere,{})}),(0,T.jsx)(Jt,{path:`/health`,element:(0,T.jsx)(wre,{})}),(0,T.jsx)(Jt,{path:`/configuration`,element:(0,T.jsx)(bre,{})}),(0,T.jsx)(Jt,{path:`*`,element:(0,T.jsx)(qt,{to:`/board`,replace:!0})})]})})}(0,yi.createRoot)(document.getElementById(`root`)).render((0,T.jsx)(C.StrictMode,{children:(0,T.jsx)(Ln,{children:(0,T.jsx)(eC,{})})}));
|