github-issue-tower-defence-management 2.115.0 → 2.115.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/adapter/entry-points/console/ui-dist/assets/{index-C7tRgjUC.js → index-BJ4tFHfa.js}
RENAMED
|
@@ -86,6 +86,6 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
86
86
|
`)}),o+=1,i=null;continue}i.push(e);continue}if(Xs(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},$s=Object.defineProperty,ec=(e,t)=>$s(e,`name`,{value:t,configurable:!0});function tc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ec(tc,`setRef`);function nc(...e){return t=>{let n=!1,r=e.map(e=>{let r=tc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():tc(e[t],null)}}}}ec(nc,`composeRefs`);function rc(...e){return y.useCallback(nc(...e),e)}ec(rc,`useComposedRefs`);var ic=Object.defineProperty,ac=(e,t)=>ic(e,`name`,{value:t,configurable:!0});function oc(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];hc(r)&&typeof yc==`function`&&(r=yc(r._payload)),y.Children.forEach(r,e=>{if(pc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;hc(n)&&typeof yc==`function`&&(n=yc(n._payload)),a=uc(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=y.cloneElement(a,void 0,s):!o&&y.Children.count(r)===1&&y.isValidElement(r)&&(a=r);let c=a?fc(a):void 0,l=rc(n,c);if(!a){if(r||r===0)throw Error(o?vc(e):_c(e));return r}let u=dc(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ac(oc,`createSlot`);var sc=oc(`Slot`),cc=Symbol.for(`radix.slottable`);function lc(e){let t=ac(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=cc,t}ac(lc,`createSlottable`);var uc=ac((e,t)=>{if(`child`in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function dc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}ac(dc,`mergeProps`);function fc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ac(fc,`getElementRef`);function pc(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cc}ac(pc,`isSlottable`);var mc=Symbol.for(`react.lazy`);function hc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===mc&&`_payload`in e&&gc(e._payload)}ac(hc,`isLazyComponent`);function gc(e){return typeof e==`object`&&!!e&&`then`in e}ac(gc,`isPromiseLike`);var _c=ac(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),vc=ac(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),yc=y.use;function bc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function xc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bc(e))&&(r&&(r+=` `),r+=t);return r}var Sc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Cc=xc,wc=(e,t)=>n=>{if(t?.variants==null)return Cc(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Sc(t)||Sc(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Cc(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Tc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ec=(e,t)=>({classGroupId:e,validator:t}),Dc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Oc=`-`,kc=[],Ac=`arbitrary..`,jc=e=>{let t=Pc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Nc(e);let n=e.split(Oc);return Mc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Tc(i,t):t:i||kc}return n[e]||kc}}},Mc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Mc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Oc):e.slice(t).join(Oc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Nc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ac+r:void 0})(),Pc=e=>{let{theme:t,classGroups:n}=e;return Fc(n,t)},Fc=(e,t)=>{let n=Dc();for(let r in e){let i=e[r];Ic(i,n,r,t)}return n},Ic=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Lc(i,t,n,r)}},Lc=(e,t,n,r)=>{if(typeof e==`string`){Rc(e,t,n);return}if(typeof e==`function`){zc(e,t,n,r);return}Bc(e,t,n,r)},Rc=(e,t,n)=>{let r=e===``?t:Vc(t,e);r.classGroupId=n},zc=(e,t,n,r)=>{if(Hc(e)){Ic(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ec(n,e))},Bc=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ic(o,Vc(t,a),n,r)}},Vc=(e,t)=>{let n=e,r=t.split(Oc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Dc(),n.nextPart.set(t,i)),n=i}return n},Hc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Uc=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Wc=`!`,Gc=`:`,Kc=[],qc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Jc=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Gc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Wc)?(c=s.slice(0,-1),l=!0):s.startsWith(Wc)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return qc(t,l,c,u)};if(t){let e=t+Gc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):qc(Kc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Yc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Xc=e=>({cache:Uc(e.cacheSize),parseClassName:Jc(e),sortModifiers:Yc(e),postfixLookupClassGroupIds:Zc(e),...jc(e)}),Zc=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Qc=/\s+/,$c=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Qc),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Wc:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},el=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=tl(n))&&(i&&(i+=` `),i+=r);return i},tl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=tl(e[r]))&&(n&&(n+=` `),n+=t);return n},nl=(e,...t)=>{let n,r,i,a,o=o=>(n=Xc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=$c(e,n);return i(e,a),a};return a=o,(...e)=>a(el(...e))},rl=[],il=e=>{let t=t=>t[e]||rl;return t.isThemeGetter=!0,t},al=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ol=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ll=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ul=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pl=e=>sl.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),ml=e=>!!e&&Number.isInteger(Number(e)),hl=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),gl=e=>cl.test(e),_l=()=>!0,vl=e=>ll.test(e)&&!ul.test(e),yl=()=>!1,bl=e=>dl.test(e),xl=e=>fl.test(e),Sl=e=>!J(e)&&!Y(e),Cl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),wl=e=>Q(e,Bl,yl),J=e=>al.test(e),Tl=e=>Q(e,Vl,vl),El=e=>Q(e,Hl,q),Dl=e=>Q(e,Wl,_l),Ol=e=>Q(e,Ul,yl),kl=e=>Q(e,Rl,yl),Al=e=>Q(e,zl,xl),jl=e=>Q(e,Gl,bl),Y=e=>ol.test(e),Ml=e=>Ll(e,Vl),Nl=e=>Ll(e,Ul),Pl=e=>Ll(e,Rl),Fl=e=>Ll(e,Bl),Il=e=>Ll(e,zl),X=e=>Ll(e,Gl,!0),Z=e=>Ll(e,Wl,!0),Q=(e,t,n)=>{let r=al.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ll=(e,t,n=!1)=>{let r=ol.exec(e);return r?r[1]?t(r[1]):n:!1},Rl=e=>e===`position`||e===`percentage`,zl=e=>e===`image`||e===`url`,Bl=e=>e===`length`||e===`size`||e===`bg-size`,Vl=e=>e===`length`,Hl=e=>e===`number`,Ul=e=>e===`family-name`,Wl=e=>e===`number`||e===`weight`,Gl=e=>e===`shadow`,Kl=nl(()=>{let e=il(`color`),t=il(`font`),n=il(`text`),r=il(`font-weight`),i=il(`tracking`),a=il(`leading`),o=il(`breakpoint`),s=il(`container`),c=il(`spacing`),l=il(`radius`),u=il(`shadow`),d=il(`inset-shadow`),f=il(`text-shadow`),p=il(`drop-shadow`),m=il(`blur`),h=il(`perspective`),g=il(`aspect`),_=il(`ease`),v=il(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[pl,`full`,`auto`,...w()],ee=()=>[ml,`none`,`subgrid`,Y,J],te=()=>[`auto`,{span:[`full`,ml,Y,J]},ml,Y,J],E=()=>[ml,`auto`,Y,J],D=()=>[`auto`,`min`,`max`,`fr`,Y,J],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],O=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],k=()=>[`auto`,...w()],A=()=>[pl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[pl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[pl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,Y,J],M=()=>[...b(),Pl,kl,{position:[Y,J]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,Fl,wl,{size:[Y,J]}],N=()=>[hl,Ml,Tl],P=()=>[``,`none`,`full`,l,Y,J],F=()=>[``,q,Ml,Tl],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],L=()=>[q,hl,Pl,kl],ce=()=>[``,`none`,m,Y,J],R=()=>[`none`,q,Y,J],le=()=>[`none`,q,Y,J],ue=()=>[q,Y,J],z=()=>[pl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[gl],breakpoint:[gl],color:[_l],container:[gl],"drop-shadow":[gl],ease:[`in`,`out`,`in-out`],font:[Sl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[gl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[gl],shadow:[gl],spacing:[`px`,q],text:[gl],"text-shadow":[gl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,pl,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[Cl],columns:[{columns:[q,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ml,`auto`,Y,J]}],basis:[{basis:[pl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,pl,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[ml,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...O(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...O()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...O(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...O(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...O(),`baseline`]}],"place-self":[{"place-self":[`auto`,...O()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,...A()]}],"font-size":[{text:[`base`,n,Ml,Tl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Z,Dl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,hl,J]}],"font-family":[{font:[Nl,Ol,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,El]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Tl]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ml,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ml,Y,J],radial:[``,Y,J],conic:[ml,Y,J]},Il,Al]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,Ml,Tl]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,X,jl]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,X,jl]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[q,Tl]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,X,jl]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:ce()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,X,jl]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:R()}],"rotate-x":[{"rotate-x":R()}],"rotate-y":[{"rotate-y":R()}],"rotate-z":[{"rotate-z":R()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":[`translate-none`],zoom:[{zoom:[ml,Y,J]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[q,Ml,Tl,El]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),ql=(...e)=>Kl(xc(e)),Jl=wc(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`}},defaultVariants:{variant:`default`,size:`default`}}),Yl=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?sc:`button`,{className:ql(Jl({variant:t,size:n,className:e})),ref:a,...i}));Yl.displayName=`Button`;var Xl=`Copying to the clipboard is not available in this browser context.`,Zl=e=>{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand(`copy`);return t.remove(),n},Ql=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(Zl(e))return;throw Error(Xl)}if(!Zl(e))throw Error(Xl)},$l=1500,eu=`Copy failed`,tu=`Copying to the clipboard failed`,nu=({value:e,idleText:t,idleAriaLabel:n,copiedAriaLabel:r,className:i})=>{let[a,o]=(0,y.useState)(`idle`),s=(0,y.useRef)(null);return(0,y.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,x.jsx)(Yl,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?tu:n,onClick:async()=>{try{await Ql(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},$l)},children:a===`copied`?`Copied`:a===`failed`?eu:t})},ru=({code:e,label:t=`Copy code`})=>(0,x.jsx)(nu,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),iu=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,au=null,ou=0,su=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),cu=()=>au===null?window.mermaid===void 0?(au=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=iu,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(su(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),au):(au=Promise.resolve(su(window.mermaid)),au):au,lu=async e=>{let t=await cu();ou+=1;let n=`console-mermaid-${ou}`,{svg:r}=await t.render(n,e);return Za.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},uu=.5,du=e=>Number.isNaN(e)||e<1?1:e>6?6:e,fu=e=>du(du(e)+uu),pu=e=>du(du(e)-uu),mu=e=>du(e)<=1,hu=e=>du(e)>=6,gu=e=>`${Math.round(du(e)*100)}%`,_u=e=>`${du(e)*100}%`,vu=({svg:e,onClose:t})=>{let[n,r]=(0,y.useState)(1),i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;if(t===null)return;t.innerHTML=e;let n=t.querySelector(`svg`);n!==null&&(n.style.removeProperty(`max-width`),n.style.setProperty(`width`,`100%`),n.style.setProperty(`height`,`auto`))},[e]),(0,y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t]),(0,x.jsxs)(`div`,{className:`console-mermaid-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Enlarged diagram`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-modal-bar`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom out`,disabled:mu(n),onClick:()=>r(pu(n)),children:`−`}),(0,x.jsx)(`span`,{className:`console-mermaid-modal-scale`,children:gu(n)}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom in`,disabled:hu(n),onClick:()=>r(fu(n)),children:`+`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-close`,"aria-label":`Close enlarged diagram`,onClick:t,children:`✕`})]}),(0,x.jsx)(`div`,{className:`console-mermaid-modal-viewport`,children:(0,x.jsx)(`div`,{ref:i,className:`console-mermaid-modal-canvas`,style:{width:_u(n)}})})]})},yu=({code:e})=>{let[t,n]=(0,y.useState)({status:`loading`}),[r,i]=(0,y.useState)(!1),a=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=!1;return n({status:`loading`}),lu(e).then(e=>{t||n({status:`ready`,svg:e})}).catch(e=>{t||n({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]),(0,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=t.status===`ready`?t.svg:``)},[t]),t.status===`loading`?(0,x.jsx)(`div`,{className:`console-mermaid-loading`,children:`Rendering diagram...`}):t.status===`error`?(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-error`,children:[`Mermaid render error: `,t.message]}),(0,x.jsx)(`pre`,{className:`console-mermaid-source`,children:(0,x.jsx)(`code`,{children:e})})]}):(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsx)(`div`,{ref:a,className:`console-mermaid-rendered`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-enlarge`,onClick:()=>i(!0),children:`Enlarge diagram`}),r&&(0,x.jsx)(vu,{svg:t.svg,onClose:()=>i(!1)})]})},bu=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(yi(r)===null)return;let i=e.textContent??r,a=document.createElement(`span`);a.className=`console-markdown-reference-host`,e.replaceWith(a),n.push({key:`${t}:${r}`,host:a,href:r,fallbackText:i})}),n},xu=e=>{let t=e.querySelectorAll(`pre > code`),n=[];return t.forEach((e,t)=>{let r=e.parentElement;if(r===null)return;let i=e.textContent??``,a=document.createElement(`div`);a.className=`console-markdown-code-block`;let o=document.createElement(`div`);o.className=`console-markdown-code-copy-host`,r.replaceWith(a),a.append(o,r),n.push({key:`code:${t}`,host:o,code:i})}),n},Su=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>{let n=Js(e,r);return t===void 0?n:Ei(n,t)},[e,t,r]),a=(0,y.useRef)(null),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)([]);return(0,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(xu(e)),s(n===void 0?[]:bu(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,ee.createPortal)((0,x.jsx)(ru,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,ee.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Cu=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>Qs(e),[e]);return e.trim()===``?(0,x.jsx)(`p`,{className:`console-markdown-empty`,children:`No description provided.`}):(0,x.jsx)(`div`,{className:`console-markdown-view`,children:i.map(e=>e.kind===`mermaid`?(0,x.jsx)(yu,{code:e.code},e.key):(0,x.jsx)(Su,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},wu=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,y.useState)(n),s=t===null?e:`${e} (${t})`;return(0,x.jsxs)(`section`,{className:`console-panel`,children:[(0,x.jsxs)(`header`,{className:`console-panel-header`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-panel-toggle`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-panel-caret`,children:a?`▸`:`▾`}),(0,x.jsx)(`span`,{className:`console-panel-title`,children:s})]}),r!==void 0&&(0,x.jsx)(`div`,{className:`console-panel-action`,children:r})]}),!a&&(0,x.jsx)(`div`,{className:`console-panel-body`,children:i})]})},Tu=e=>{switch(e){case`added`:return{label:`A`,color:`#3fb950`};case`modified`:return{label:`M`,color:`#d29922`};case`removed`:return{label:`D`,color:`#f85149`};case`renamed`:return{label:`R`,color:`#a371f7`};case`changed`:return{label:`M`,color:`#d29922`};default:return{label:`?`,color:`#8b949e`}}},Eu=()=>({directories:new Map,files:[]}),Du=e=>e.split(`/`).filter(e=>e!==``),Ou=(e,t)=>e.name.localeCompare(t.name),ku=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:ku(e,i)})}),n.sort(Ou);let r=e.files.map(e=>({kind:`file`,name:Du(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(Ou),[...n,...r]},Au=e=>{let t=Eu();for(let n of e){let e=Du(n.path);if(e.length===0){t.files.push(n);continue}let r=e.slice(0,-1),i=t;for(let e of r){let t=i.directories.get(e);if(t===void 0){let t=Eu();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return ku(t,``)},ju=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Mu=e=>{let t=[],n=0,r=0;for(let i of e.split(`
|
|
87
87
|
`)){if(i.startsWith(`@@`)){let e=i.match(ju);e!==null&&(n=Number(e[1]),r=Number(e[2])),t.push({kind:`hunk`,oldLineNumber:null,newLineNumber:null,content:i});continue}if(i.startsWith(`+`)){t.push({kind:`add`,oldLineNumber:null,newLineNumber:r,content:i}),r+=1;continue}if(i.startsWith(`-`)){t.push({kind:`del`,oldLineNumber:n,newLineNumber:null,content:i}),n+=1;continue}t.push({kind:`ctx`,oldLineNumber:n,newLineNumber:r,content:i}),n+=1,r+=1}return t},Nu=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],Pu=e=>{let t=e.toLowerCase();return Nu.some(e=>t.endsWith(e))},Fu=e=>e.kind===`add`||e.kind===`ctx`?e.newLineNumber===null?null:{line:e.newLineNumber,side:`RIGHT`}:e.kind===`del`?e.oldLineNumber===null?null:{line:e.oldLineNumber,side:`LEFT`}:null,Iu=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Lu=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)({kind:`idle`}),s=async()=>{let n=r.trim();if(n.length!==0&&a.kind!==`posting`){o({kind:`posting`});try{await t(e.path,e.line,e.side,n),i(``),o({kind:`posted`})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}};return(0,x.jsxs)(`div`,{className:`console-diff-composer`,children:[(0,x.jsxs)(`div`,{className:`console-diff-composer-anchor`,children:[`commenting on line `,e.line,` (`,e.side,`)`]}),a.kind===`posted`?(0,x.jsx)(`p`,{className:`console-diff-composer-posted`,children:`Comment saved.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`textarea`,{className:`console-diff-composer-input`,rows:3,placeholder:`Leave a review comment on this line…`,value:r,onChange:e=>i(e.target.value)}),(0,x.jsxs)(`div`,{className:`console-diff-composer-controls`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-submit`,disabled:a.kind===`posting`,onClick:()=>{s()},children:`Comment`}),(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-cancel`,onClick:n,children:`Cancel`}),a.kind===`posting`&&(0,x.jsx)(`span`,{className:`console-diff-composer-status`,children:`Posting…`}),a.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-diff-composer-status console-diff-composer-error`,children:[`Failed: `,a.message]})]})]})]})},Ru=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(null);if(e===null||e===``){if(t!==void 0&&n!=null){if(n.startsWith(`data:image/`))return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:n,alt:t})});if(Pu(t)&&r!==void 0)return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:r(n),alt:t})})}return(0,x.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`})}let s=Mu(e),c=i!==void 0&&t!==void 0&&t.length>0,l=c?4:3;return(0,x.jsx)(`table`,{className:`console-file-diff`,children:(0,x.jsx)(`tbody`,{children:s.map(e=>{let n=Iu(e),r=c?Fu(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,x.jsxs)(y.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`console-diff-row console-diff-${e.kind}`,children:[c&&(0,x.jsx)(`td`,{className:`console-diff-comment-cell`,children:r!==null&&t!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-diff-comment-button`,"aria-label":`Comment on line ${r.line} (${r.side})`,"aria-expanded":s,onClick:()=>o(s?null:{path:t,line:r.line,side:r.side}),children:`+`})}),(0,x.jsx)(`td`,{className:`console-diff-ln`,children:e.oldLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-ln`,children:e.newLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-code`,children:e.content})]}),s&&i!==void 0&&a!==null&&(0,x.jsx)(`tr`,{className:`console-diff-composer-row`,children:(0,x.jsx)(`td`,{colSpan:l,children:(0,x.jsx)(Lu,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},zu=e=>({paddingLeft:`${e*16}px`}),Bu=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(!1),s=Tu(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:zu(t),"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-file-caret`,children:a?`▾`:`▸`}),(0,x.jsx)(`span`,{className:`console-file-badge`,style:{color:s.color,borderColor:s.color},children:s.label}),(0,x.jsx)(`span`,{className:`console-file-path`,children:n}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-add`,children:[`+`,e.additions]}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-del`,children:[`-`,e.deletions]})]}),a&&(0,x.jsx)(Ru,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},Vu=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(Bu,{file:e.file,depth:t,name:e.name,buildImageProxyUrl:n,onAddInlineComment:r}):(0,x.jsxs)(`li`,{className:`console-file-tree-dir`,children:[(0,x.jsxs)(`div`,{className:`console-file-tree-dir-name`,style:zu(t),children:[(0,x.jsx)(`span`,{className:`console-file-tree-dir-icon`,"aria-hidden":`true`,children:`📁`}),e.name]}),(0,x.jsx)(`ul`,{className:`console-file-tree-children`,children:e.children.map(e=>(0,x.jsx)(Vu,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),Hu=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{if(n!==null)return(0,x.jsx)(`p`,{className:`console-files-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`});let a=Au(e);return(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:a.map(e=>(0,x.jsx)(Vu,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))})},Uu=e=>e.split(`
|
|
88
88
|
`).find(e=>e.trim()!==``)??``,Wu=e=>`${e.author}:${e.createdAt}:${e.body}`,Gu=({comment:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>e.stopPropagation();return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[]),(0,x.jsx)(`div`,{ref:i,className:`console-comment-body-expanded`,children:(0,x.jsx)(Cu,{body:e.body,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})})},Ku=({comments:e,isLoading:t,error:n,now:r,workflowImprovementIssueUrl:i=null,buildImageProxyUrl:a,renderReferenceLink:o,repoContext:s,persistenceKey:c=null})=>{let[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(()=>c==null?new Set:bn(c)),p=e.length>0?Wu(e[e.length-1]):null;(0,y.useEffect)(()=>{p!==null&&f(e=>new Set([...e,p]))},[p]),(0,y.useEffect)(()=>{c!=null&&xn(c,d)},[c,d]);let m=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(n!==null)return(0,x.jsx)(`p`,{className:`console-comment-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-comment-loading`,children:`Loading comments...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-comment-empty`,children:`No comments.`});let h=!l&&e.length>1;return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[h&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>{u(!0),f(t=>new Set([...t,...e.map(Wu)]))},children:[`Show all `,e.length]}),e.map(e=>{let t=Wu(e),n=d.has(t);return(0,x.jsxs)(`article`,{className:`console-comment${n?` is-expanded`:h?` console-comment--expandable`:``}`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-toggle`,onClick:()=>m(t),"aria-expanded":n,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:O(e.createdAt,r)}),!n&&(0,x.jsx)(`span`,{className:`console-comment-body-preview`,children:Uu(e.body)})]}),i!==null&&e.url!==null&&(0,x.jsx)(`a`,{href:Si(i,e.url),target:`_blank`,rel:`noreferrer`,className:`console-comment-report-link`,"aria-label":`Create workflow incident report for this comment`,children:`⚡`}),n&&(0,x.jsx)(Gu,{comment:e,buildImageProxyUrl:a,renderReferenceLink:o,repoContext:s})]},t)})]})},qu=e=>e.slice(0,7),Ju=e=>e.split(`
|
|
89
|
-
`)[0],Yu=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:Ju(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:qu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:O(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),Xu=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(nu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Zu=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},Qu=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,$u=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Zu(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Qu(e.sections),`:`,` `,e.message]},e.message))}),ed={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},td=({mergeableStatus:e})=>{let t=ed[e],n=P(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},nd=e=>{let t=P(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},rd=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:nd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:nd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},id=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=yi(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(td,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(rd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(Xu,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(wu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Cu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(wu,{title:`Changed files`,count:g,children:(0,x.jsx)(Hu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(wu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(Yu,{commits:o,isLoading:s,error:c,now:l})})]})},ad=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D,workflowImprovementIssueUrl:ne=null})=>{let k=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&k===`closed`?`Closed`:null,j=bi(e.nameWithOwner)??void 0,M=P(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,oe=ae===null?null:P(ae.color),N=p||m!==null?null:f.length,F=u||d!==null?null:l.length,I=g||_!==null?null:h.length,se=!u&&d===null&&l.length>0,L=e=>{let t=yi(e);return t===null?e:`PR #${t.number}`},ce=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${L(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${L(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),R=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(be,{isPr:e.isPr,state:k,merged:re,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:oe.fg,borderColor:oe.border,backgroundColor:oe.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:M.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(rd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:L(e.pullRequest.url)}),(0,x.jsx)(rd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(td,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),R.map(e=>(0,x.jsx)(td,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,x.jsx)($u,{failures:ce}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:A(e.createdAt),children:[`opened `,O(e.createdAt,w)]}),(0,x.jsx)(Xu,{url:e.url}),ne!==null&&(0,x.jsx)(`a`,{href:Si(ne,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(wu,{title:`Description`,defaultCollapsed:se,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Cu,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},se?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(wu,{title:`Changed files`,count:N,children:(0,x.jsx)(Hu,{files:f,isLoading:p,error:m,onAddInlineComment:D})}),(0,x.jsx)(wu,{title:`Comments`,count:F,children:(0,x.jsx)(Ku,{comments:l,isLoading:u,error:d,now:w,workflowImprovementIssueUrl:ne,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j,persistenceKey:e.url})}),e.isPr&&(0,x.jsx)(wu,{title:`Commits`,count:I,defaultCollapsed:!0,children:(0,x.jsx)(Yu,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(id,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},od=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},sd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(od,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},cd=({onClose:e})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),ld=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async()=>{if(t){c(!0),u(null);try{await t()}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field? Open tasks assigned to this story will be closed.`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},ud=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),dd=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],fd=`Reject needs an inline comment on the diff.`,pd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:fd}),dd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),md=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},hd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},gd=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:hd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=P(r.color),a=e===pe;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},_d=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(od,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},vd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>{let[u,d]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(pd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(ud,{isManualTriage:ge(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(gd,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),u&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(_d,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(sd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>d(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(md,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(ld,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(cd,{onClose:c.onClose})]})]})},$=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},yd=[],bd=[],xd=[],Sd=[],Cd={state:`open`,merged:!1,isPullRequest:!1,title:``},wd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Td=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=$(e.body,r,i,``),s=$(e.state,r,i,Cd),c=$(e.comments,r,i,yd),l=$(e.files,a?r:null,a?i:null,bd),u=$(e.commits,a?r:null,a?i:null,xd),d=$(e.prStatus,a?r:null,a?i:null,wd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=$(e.relatedPrs,f?r:null,f?i:null,Sd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:bd,filesAreLoading:!0,filesError:null,commits:xd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Ed=e=>JSON.stringify([e.author,e.createdAt,e.body]),Dd=(e,t)=>{let n=new Set(e.map(Ed));return[...e,...t.filter(e=>!n.has(Ed(e)))]},Od=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=yi(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(be,{...xi(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},kd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Ad=({cache:e,href:t,fallbackText:n})=>{let r=kd(e,t);return(0,x.jsx)(Od,{href:t,fallbackText:n,state:r})},jd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Md=(e,t,n,r,i)=>({...jd(t),apiPath:sr,requestBody:ur(e,t,n,r,i)}),Nd=(e,t,n,r)=>({...jd(t),apiPath:cr,requestBody:dr(e,t,n,r)}),Pd=(e,t)=>({...jd(t),apiPath:lr,requestBody:fr(e,t)}),Fd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=Td(n,t,e),b=(0,y.useCallback)(e=>Ti(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Ad,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[te,E]=(0,y.useState)([]),D=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return E(e=>[...e,n]),n},[t,r]),ne={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Md(i,t,n,e,a)})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Nd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Nd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Nd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Nd(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Pd(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Nd(i,t,e)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),onAdvance:()=>r.patchItemOverlay(t,!0,{name:e.name,color:e.color}),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},O=a.find(e=>e.name===`Awaiting Workspace`)??null,k=O===null?void 0:async e=>(p?.(``),ne.onSetStatus(O),D(e)),A=l??(t.story.trim()===``?null:t.story),re=A===null?null:L(c,A);return(0,x.jsx)(ad,{item:t,storyName:A,storyColorEnum:re,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Dd(v.comments,te),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(_i,{initiallyOpen:!0,initialDraft:f,onSubmit:D,onDraftChange:p,onOkAndAwaitingWorkspace:O===null?void 0:()=>ne.onOkAndAwaitingWorkspace(O),onSubmitAndMoveToAwaitingWorkspace:k,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(vd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:A,agentOptions:s,currentAgentName:t.agent,handlers:ne,storyNameForDeletion:g})})},Id=()=>{let e={};for(let t of re)e[t.name]=0;return e},Ld=`console`,Rd=()=>{let e=xr(),t=Gn(),n=ht(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=ei(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=si(),{pjcodes:v,projectUrls:b,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,isLoading:ee}=Sr(),{isTimerExpired:te}=Er(e),E=yr(e??Ld),D=Tr(v),ne=(0,y.useMemo)(()=>{let e=Id();for(let t of re){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=nr(n.items,ir(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]),O=Qn(e,ne),{activeTab:k,selectedItemKey:A,openItem:ie,closeItem:j}=O,ae=ti(O.selectTab),N=Cr((0,y.useCallback)(e=>ci(`/projects/${e}`),[])),P=(0,y.useRef)(new Map),F=(0,y.useCallback)(e=>{A!==null&&(e?P.current.set(A,e):P.current.delete(A))},[A]),se=Ln(r),L=hr(e,k,E,se,(0,y.useCallback)(()=>s(`queued`),[s])),R=Nn(),[ue,z]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{z(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[de,fe]=(0,y.useState)(!1),[pe,me]=(0,y.useState)(``),[he,ge]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>ge(!0),t=()=>ge(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Map),[xe,Se]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!he||R.offlineActions.length===0))for(let e of R.offlineActions)_e.has(e.id)||xe.has(e.id)||(ve(t=>new Map(t).set(e.id,null)),se.client.fetchIssueState(e.itemUrl).then(t=>{ve(n=>new Map(n).set(e.id,t)),e.isPr&&(be(t=>new Map(t).set(e.id,null)),se.client.fetchPullRequestStatus(e.itemUrl).then(t=>{be(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Se(t=>new Set(t).add(e.id))}))},[he,R.offlineActions,se.client,_e,xe]);let[Te,Ee]=(0,y.useState)(!1),Oe=(0,y.useCallback)(async e=>{Ee(!0);try{await R.confirmOfflineAction(e)}finally{Ee(!1)}},[R]),ke=(0,y.useMemo)(()=>R.offlineActions.map(e=>{let t=_e.get(e.id)??null,n=ye.get(e.id)??null,r=xe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[R.offlineActions,_e,ye,xe]),Ae=i[k],je=(0,y.useMemo)(()=>Ae===null?[]:rr(Ae.items,ir(E.overlay,Ae.generatedAt),k),[Ae,E.overlay,k]),[Me,Ne]=(0,y.useState)(null),Pe=(0,y.useMemo)(()=>{if(k!==`prs`)return{};let e={};for(let t of je)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[je,k]);(0,y.useEffect)(()=>{k===`prs`&&Me!==null&&(Pe[Me]??0)===0&&Ne(null)},[Pe,Me,k]);let Fe=(0,y.useMemo)(()=>k!==`prs`||Me===null?je:je.filter(e=>e.agent===Me),[je,k,Me]),Re=(0,y.useMemo)(()=>Fe.map(e=>er(e)),[Fe]),ze=Ae?.storyOrder??[],Be=(0,y.useMemo)(()=>le(Fe,E.overlay,ze,Ae?.generatedAt??null),[Fe,E.overlay,ze,Ae]),Ve=Ae?.storyColors??{},Ge=Ae?.statusOptions??[],Ke=Ae?.agentOptions??[],qe=Ae?.storyOptions??[],Je=Ae?.generatedAt??null,Ye=Ae?.fromCache??!1,[Xe,Ze]=(0,y.useState)(null),Qe=(0,y.useMemo)(()=>A===null||Ae===null?null:Ae.items.find(e=>e.projectItemId===A)??null,[A,Ae]);Un(se,Qe,je),(0,y.useEffect)(()=>{A!==null&&window.scrollTo({top:0})},[A]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=oi(v,null,l);e!==null&&li(`/projects/${e}`)}},[e,c,v,l]);let $e=ne[k],et=(0,y.useRef)({tab:k,count:$e});(0,y.useEffect)(()=>{let e=et.current;if(et.current={tab:k,count:$e},e.tab===k&&e.count>0&&$e===0){let e=Kn(k,ne);e!==null&&(ae(e),j())}},[k,$e,ne,ae,j]);let tt=Qe===null?null:ar(E.overlay,Qe,i[k]?.generatedAt??null),nt=Qe===null?null:ce(Qe,E.overlay,i[k]?.generatedAt??null),rt=(0,y.useCallback)(e=>{let t=ui(Re,e);t===null?j():ie(t)},[Re,ie,j]),B=(0,y.useCallback)(t=>{if(n.status===`on`){R.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=er(t.item);R.enqueue({message:vn(t.kind,t.item,k),color:gn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&_n(t.kind,k)){if(c&&te(l[e??``]??0)){let t=oi(v,e,l);t!==null&&ci(`/projects/${t}`)}else rt(r)}}})},[R,k,rt,n.status,c,te,l,e,v]),it=Lr((0,y.useCallback)(e=>{if(A===null||e===null)return;let t=e===`next`?di(Re,A):fi(Re,A);t!==null&&ie(t)},[A,Re,ie])),[at,ot]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),st=(0,y.useCallback)(()=>{ot(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),ct=i.stories,lt=ct?.stories??[],ut=Xe!==null&&Xe.generatedAt===ct?.generatedAt?Xe.stories:lt,dt=ct?.defaultNameWithOwner??null,ft=(0,y.useMemo)(()=>Qe===null||!Qe.labels.includes(`story`)?null:ut.find(e=>e.storyName===Qe.story)??null,[Qe,ut]),pt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(dt===null)throw Error(`No repository configured for this project.`);await Kt({pjcode:e,title:n,storyName:t,nameWithOwner:dt})},[e,dt]),mt=(0,y.useCallback)(({storyOptionId:t,agentOptionId:n,title:r,referenceUrl:i,files:a})=>{if(e===null||dt===null)return Promise.resolve();let o=e,s=dt,c=ut.find(e=>e.storyOptionId===t)?.storyName??``;return R.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Kt({pjcode:o,title:r,storyName:c,nameWithOwner:s,agentOptionId:n??null,referenceUrl:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=Lt(new Uint8Array(await t.arrayBuffer()));return Rt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Ft({pjcode:o,url:e,body:t.join(`
|
|
89
|
+
`)[0],Yu=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:Ju(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:qu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:O(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),Xu=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(nu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Zu=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},Qu=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,$u=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Zu(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Qu(e.sections),`:`,` `,e.message]},e.message))}),ed={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},td=({mergeableStatus:e})=>{let t=ed[e],n=P(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},nd=e=>{let t=P(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},rd=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:nd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:nd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},id=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=yi(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(td,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(rd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(Xu,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(wu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Cu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(wu,{title:`Changed files`,count:g,children:(0,x.jsx)(Hu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(wu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(Yu,{commits:o,isLoading:s,error:c,now:l})})]})},ad=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D,workflowImprovementIssueUrl:ne=null})=>{let k=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&k===`closed`?`Closed`:null,j=bi(e.nameWithOwner)??void 0,M=P(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,oe=ae===null?null:P(ae.color),N=p||m!==null?null:f.length,F=u||d!==null?null:l.length,I=g||_!==null?null:h.length,se=!u&&d===null&&l.length>0,L=e=>{let t=yi(e);return t===null?e:`PR #${t.number}`},ce=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${L(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${L(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),R=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(be,{isPr:e.isPr,state:k,merged:re,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:oe.fg,borderColor:oe.border,backgroundColor:oe.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:M.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(rd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:L(e.pullRequest.url)}),(0,x.jsx)(rd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(td,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),R.map(e=>(0,x.jsx)(td,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,x.jsx)($u,{failures:ce}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:A(e.createdAt),children:[`opened `,O(e.createdAt,w)]}),(0,x.jsx)(Xu,{url:e.url}),ne!==null&&(0,x.jsx)(`a`,{href:Si(ne,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(wu,{title:`Description`,defaultCollapsed:se,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Cu,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},se?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(wu,{title:`Changed files`,count:N,children:(0,x.jsx)(Hu,{files:f,isLoading:p,error:m,onAddInlineComment:D})}),(0,x.jsx)(wu,{title:`Comments`,count:F,children:(0,x.jsx)(Ku,{comments:l,isLoading:u,error:d,now:w,workflowImprovementIssueUrl:ne,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j,persistenceKey:e.url})}),e.isPr&&(0,x.jsx)(wu,{title:`Commits`,count:I,defaultCollapsed:!0,children:(0,x.jsx)(Yu,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(id,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},od=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},sd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(od,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},cd=({onClose:e})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),ld=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async()=>{if(t){c(!0),u(null);try{await t()}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field? Open tasks assigned to this story will be closed.`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},ud=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),dd=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],fd=`Reject needs an inline comment on the diff.`,pd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:fd}),dd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),md=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},hd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},gd=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:hd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=P(r.color),a=e===pe;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},_d=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(od,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},vd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>{let[u,d]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(pd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(ud,{isManualTriage:ge(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(gd,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),u&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(_d,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(sd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>d(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(md,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(ld,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(cd,{onClose:c.onClose})]})]})},$=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},yd=[],bd=[],xd=[],Sd=[],Cd={state:`open`,merged:!1,isPullRequest:!1,title:``},wd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Td=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=$(e.body,r,i,``),s=$(e.state,r,i,Cd),c=$(e.comments,r,i,yd),l=$(e.files,a?r:null,a?i:null,bd),u=$(e.commits,a?r:null,a?i:null,xd),d=$(e.prStatus,a?r:null,a?i:null,wd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=$(e.relatedPrs,f?r:null,f?i:null,Sd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:bd,filesAreLoading:!0,filesError:null,commits:xd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Ed=e=>JSON.stringify([e.author,e.createdAt,e.body]),Dd=(e,t)=>{let n=new Set(e.map(Ed));return[...e,...t.filter(e=>!n.has(Ed(e)))]},Od=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=yi(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(be,{...xi(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},kd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Ad=({cache:e,href:t,fallbackText:n})=>{let r=kd(e,t);return(0,x.jsx)(Od,{href:t,fallbackText:n,state:r})},jd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Md=(e,t,n,r,i)=>({...jd(t),apiPath:sr,requestBody:ur(e,t,n,r,i)}),Nd=(e,t,n,r)=>({...jd(t),apiPath:cr,requestBody:dr(e,t,n,r)}),Pd=(e,t)=>({...jd(t),apiPath:lr,requestBody:fr(e,t)}),Fd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=Td(n,t,e),b=(0,y.useCallback)(e=>Ti(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Ad,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[te,E]=(0,y.useState)([]),D=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return E(e=>[...e,n]),n},[t,r]),ne={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Md(i,t,n,e,a),...e===`approve_and_merge`?{onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)}:{}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Nd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Nd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Nd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Nd(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Pd(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Nd(i,t,e),onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),onAdvance:()=>r.patchItemOverlay(t,!0,{name:e.name,color:e.color}),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},O=a.find(e=>e.name===`Awaiting Workspace`)??null,k=O===null?void 0:async e=>(p?.(``),ne.onSetStatus(O),D(e)),A=l??(t.story.trim()===``?null:t.story),re=A===null?null:L(c,A);return(0,x.jsx)(ad,{item:t,storyName:A,storyColorEnum:re,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Dd(v.comments,te),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(_i,{initiallyOpen:!0,initialDraft:f,onSubmit:D,onDraftChange:p,onOkAndAwaitingWorkspace:O===null?void 0:()=>ne.onOkAndAwaitingWorkspace(O),onSubmitAndMoveToAwaitingWorkspace:k,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(vd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:A,agentOptions:s,currentAgentName:t.agent,handlers:ne,storyNameForDeletion:g})})},Id=()=>{let e={};for(let t of re)e[t.name]=0;return e},Ld=`console`,Rd=()=>{let e=xr(),t=Gn(),n=ht(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=ei(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=si(),{pjcodes:v,projectUrls:b,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,isLoading:ee}=Sr(),{isTimerExpired:te}=Er(e),E=yr(e??Ld),D=Tr(v),ne=(0,y.useMemo)(()=>{let e=Id();for(let t of re){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=nr(n.items,ir(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]),O=Qn(e,ne),{activeTab:k,selectedItemKey:A,openItem:ie,closeItem:j}=O,ae=ti(O.selectTab),N=Cr((0,y.useCallback)(e=>ci(`/projects/${e}`),[])),P=(0,y.useRef)(new Map),F=(0,y.useCallback)(e=>{A!==null&&(e?P.current.set(A,e):P.current.delete(A))},[A]),se=Ln(r),L=hr(e,k,E,se,(0,y.useCallback)(()=>s(`queued`),[s])),R=Nn(),[ue,z]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{z(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[de,fe]=(0,y.useState)(!1),[pe,me]=(0,y.useState)(``),[he,ge]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>ge(!0),t=()=>ge(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Map),[xe,Se]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!he||R.offlineActions.length===0))for(let e of R.offlineActions)_e.has(e.id)||xe.has(e.id)||(ve(t=>new Map(t).set(e.id,null)),se.client.fetchIssueState(e.itemUrl).then(t=>{ve(n=>new Map(n).set(e.id,t)),e.isPr&&(be(t=>new Map(t).set(e.id,null)),se.client.fetchPullRequestStatus(e.itemUrl).then(t=>{be(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Se(t=>new Set(t).add(e.id))}))},[he,R.offlineActions,se.client,_e,xe]);let[Te,Ee]=(0,y.useState)(!1),Oe=(0,y.useCallback)(async e=>{Ee(!0);try{await R.confirmOfflineAction(e)}finally{Ee(!1)}},[R]),ke=(0,y.useMemo)(()=>R.offlineActions.map(e=>{let t=_e.get(e.id)??null,n=ye.get(e.id)??null,r=xe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[R.offlineActions,_e,ye,xe]),Ae=i[k],je=(0,y.useMemo)(()=>Ae===null?[]:rr(Ae.items,ir(E.overlay,Ae.generatedAt),k),[Ae,E.overlay,k]),[Me,Ne]=(0,y.useState)(null),Pe=(0,y.useMemo)(()=>{if(k!==`prs`)return{};let e={};for(let t of je)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[je,k]);(0,y.useEffect)(()=>{k===`prs`&&Me!==null&&(Pe[Me]??0)===0&&Ne(null)},[Pe,Me,k]);let Fe=(0,y.useMemo)(()=>k!==`prs`||Me===null?je:je.filter(e=>e.agent===Me),[je,k,Me]),Re=(0,y.useMemo)(()=>Fe.map(e=>er(e)),[Fe]),ze=Ae?.storyOrder??[],Be=(0,y.useMemo)(()=>le(Fe,E.overlay,ze,Ae?.generatedAt??null),[Fe,E.overlay,ze,Ae]),Ve=Ae?.storyColors??{},Ge=Ae?.statusOptions??[],Ke=Ae?.agentOptions??[],qe=Ae?.storyOptions??[],Je=Ae?.generatedAt??null,Ye=Ae?.fromCache??!1,[Xe,Ze]=(0,y.useState)(null),Qe=(0,y.useMemo)(()=>A===null||Ae===null?null:Ae.items.find(e=>e.projectItemId===A)??null,[A,Ae]);Un(se,Qe,je),(0,y.useEffect)(()=>{A!==null&&window.scrollTo({top:0})},[A]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=oi(v,null,l);e!==null&&li(`/projects/${e}`)}},[e,c,v,l]);let $e=ne[k],et=(0,y.useRef)({tab:k,count:$e});(0,y.useEffect)(()=>{let e=et.current;if(et.current={tab:k,count:$e},e.tab===k&&e.count>0&&$e===0){let e=Kn(k,ne);e!==null&&(ae(e),j())}},[k,$e,ne,ae,j]);let tt=Qe===null?null:ar(E.overlay,Qe,i[k]?.generatedAt??null),nt=Qe===null?null:ce(Qe,E.overlay,i[k]?.generatedAt??null),rt=(0,y.useCallback)(e=>{let t=ui(Re,e);t===null?j():ie(t)},[Re,ie,j]),B=(0,y.useCallback)(t=>{if(n.status===`on`){R.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=er(t.item);R.enqueue({message:vn(t.kind,t.item,k),color:gn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&_n(t.kind,k)){if(c&&te(l[e??``]??0)){let t=oi(v,e,l);t!==null&&ci(`/projects/${t}`)}else rt(r)}}})},[R,k,rt,n.status,c,te,l,e,v]),it=Lr((0,y.useCallback)(e=>{if(A===null||e===null)return;let t=e===`next`?di(Re,A):fi(Re,A);t!==null&&ie(t)},[A,Re,ie])),[at,ot]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),st=(0,y.useCallback)(()=>{ot(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),ct=i.stories,lt=ct?.stories??[],ut=Xe!==null&&Xe.generatedAt===ct?.generatedAt?Xe.stories:lt,dt=ct?.defaultNameWithOwner??null,ft=(0,y.useMemo)(()=>Qe===null||!Qe.labels.includes(`story`)?null:ut.find(e=>e.storyName===Qe.story)??null,[Qe,ut]),pt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(dt===null)throw Error(`No repository configured for this project.`);await Kt({pjcode:e,title:n,storyName:t,nameWithOwner:dt})},[e,dt]),mt=(0,y.useCallback)(({storyOptionId:t,agentOptionId:n,title:r,referenceUrl:i,files:a})=>{if(e===null||dt===null)return Promise.resolve();let o=e,s=dt,c=ut.find(e=>e.storyOptionId===t)?.storyName??``;return R.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Kt({pjcode:o,title:r,storyName:c,nameWithOwner:s,agentOptionId:n??null,referenceUrl:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=Lt(new Uint8Array(await t.arrayBuffer()));return Rt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Ft({pjcode:o,url:e,body:t.join(`
|
|
90
90
|
|
|
91
91
|
`)});if(!n.posted)throw Error(n.error)}},advance:()=>{}}),me(``),Promise.resolve()},[e,dt,ut,R]),gt=(0,y.useCallback)(async e=>{if(C===null)throw Error(`Workflow improvement repository is not configured.`);let t=/github\.com\/([A-Za-z0-9._-]+\/[A-Za-z0-9._-]+)\/issues\//.exec(C);if(t===null)throw Error(`Could not parse repository from workflowImprovementIssueUrl.`);let n=t[1];return Jt({nameWithOwner:n,title:e})},[C]),V=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Xt({pjcode:e,storyOptionId:t,direction:n});let r=ut.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<ut.length){let t=[...ut],n=t[r];t[r]=t[e],t[e]=n,Ze({generatedAt:ct?.generatedAt,stories:t})}}},[e,ut,ct?.generatedAt]),_t=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Bt({pjcode:e,storyName:t})},[e]),[vt,yt]=(0,y.useState)({}),[bt,xt]=(0,y.useState)(null),[St,Ct]=(0,y.useState)({}),wt=(0,y.useCallback)((t,n)=>{let r=ut.find(e=>e.storyOptionId===t)?.color;if(xt(t),yt(e=>({...e,[t]:n})),Ct(e=>{let n={...e};return delete n[t],n}),e===null||dt===null){yt(e=>r===void 0?e:{...e,[t]:r}),Ct(e=>({...e,[t]:`No project or repository configured.`})),xt(e=>e===t?null:e);return}Gt({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:dt}).catch(e=>{yt(e=>r===void 0?e:{...e,[t]:r}),Ct(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{xt(e=>e===t?null:e)})},[e,dt,ut]),Tt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await en({pjcode:e,storyOptionId:t}),Ze({generatedAt:ct?.generatedAt,stories:ut.filter(e=>e.storyOptionId!==t)})},[e,ut,ct?.generatedAt]),Et=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await nn({pjcode:e,storyOptionId:t,newName:n});let r=ut.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Ze({generatedAt:ct?.generatedAt,stories:r})},[e,ut,ct?.generatedAt]),Dt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await an({pjcode:e,storyOptionId:t,description:n});let r=ut.map(e=>e.storyOptionId===t?{...e,description:n}:e);Ze({generatedAt:ct?.generatedAt,stories:r})},[e,ut,ct?.generatedAt]),Ot=Nr(je,se.comments,k===`prs`),kt=(0,y.useCallback)((e,t)=>{B({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>L.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{E.patchOverlay(er(e),{done:!0,status:{name:t.name,color:t.color}},k)},revertAdvance:()=>{E.patchOverlay(er(e),{done:!1},k)}})},[B,L,E,k]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[R.pending!==null&&(0,x.jsx)(Ue,{message:R.pending.message,color:R.pending.color,remainingSeconds:R.pending.remainingSeconds,progress:R.pending.progress,onUndo:R.undo}),R.error!==null&&(0,x.jsx)(We,{title:R.error.message,message:`Operation failed: ${R.error.reason}`,onDismiss:R.dismissError,onRetry:R.error.retry===void 0?void 0:()=>{let e=R.error?.retry;R.dismissError(),e?.()}}),(0,x.jsx)(He,{actions:ke,isOnline:he,isConfirming:Te,onConfirm:Oe,onDiscard:R.discardOfflineAction}),D.isOpen&&(0,x.jsx)(S,{pjcodes:v,inputValues:D.inputValues,onChangeInput:D.changeInput,isLoading:D.isLoading,isSaving:D.isSaving,error:D.error,onSave:D.save,onClose:D.close}),(0,x.jsx)(M,{activeTab:k,counts:ne,pjcode:e,pjcodes:v,generatedAt:Je,fromCache:Ye,tabHref:O.tabHref,onSelectTab:ae,onSelectProject:N,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(oe,{isOpen:u,isTimerActive:c,timerMode:d,projectMinutes:f,pjcodes:v,isLoadingPjcodes:ee,onOpen:p,onToggleTimerMode:g,onChangeMinutes:_,onSave:h,onClose:m}),(0,x.jsx)(`button`,{type:`button`,className:`console-tab-settings-button`,"aria-label":`Open max settings`,onClick:D.open,children:`⚙`}),C!==null&&(0,x.jsx)(Le,{onCreateWorkflowTask:gt}),e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-task-create-button`,disabled:dt===null||ut.length===0,onClick:()=>fe(!0),"aria-label":`Create new task`,title:`Create new task`,children:`+`}),de&&(0,x.jsx)(I,{storyEntries:ut,agentOptions:Ke,onSubmit:mt,onClose:()=>fe(!1),initialTitle:pe,onTitleChange:me})]})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,projectUrl:e===null?null:b?.[e]??null,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,now:ue}),(0,x.jsx)(T,{timerEndsAt:Ae?.timerEndsAt??null,timerTotalSeconds:Ae?.timerTotalSeconds??null,now:ue}),k===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ie,{stories:ut,isLoading:a,error:o,showGray:at,onCreateIssue:pt,onAddStory:_t,onSelectColor:wt,onToggleGray:st,onReorderStory:V,onDeleteStory:Tt,onRenameStory:Et,onUpdateDescription:Dt,optimisticColors:vt,colorChangeInFlight:bt,colorErrors:St})}):Qe===null?k===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(De,{rows:Be,storyColors:Ve,statusOptions:Ge,agentOptions:Ke,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>O.openItem(e.projectItemId)})}):k===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(we,{agentOptions:Ke,agentCounts:Pe,selectedAgent:Me,onAgentChange:Ne}),(0,x.jsx)(Ce,{rows:Be,storyColors:Ve,statusOptions:Ge,activeItemId:null,now:ue,isLoading:a,error:o,onSelectItem:e=>O.openItem(e.projectItemId),executiveSummaries:Ot,onOkAndAwaitingWorkspace:kt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ce,{rows:Be,storyColors:Ve,statusOptions:Ge,activeItemId:null,now:ue,isLoading:a,error:o,onSelectItem:e=>O.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:it,children:(0,x.jsx)(Fd,{tab:k,item:Qe,caches:se,operations:L,pjcode:e,statusOptions:Ge,storyOptions:qe,agentOptions:Ke,storyColors:Ve,storyName:nt,overlayStatus:tt,now:ue,initialCommentDraft:P.current.get(Qe.projectItemId)??``,onCommentDraftChange:F,onQueueAction:B,onDeleteStory:ft===null?null:async()=>{await Tt(ft.storyOptionId),j()},storyNameForDeletion:ft?.storyName??null,workflowImprovementIssueUrl:C},Qe.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var zd=document.getElementById(`root`);if(zd===null)throw Error(`Root container #root not found`);(0,b.createRoot)(zd).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(Rd,{})}));
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>TDPM Console</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-BJ4tFHfa.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-NRRTvByy.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|