@zaip-ai/cli 1.0.2 → 1.0.6
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/README.md +4 -2
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/services/adapters.d.ts +1 -7
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +4 -9
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/agent-adapters.js +1 -1
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/global-codex-config.d.ts +6 -1
- package/dist/services/global-codex-config.d.ts.map +1 -1
- package/dist/services/global-codex-config.js +48 -2
- package/dist/services/global-codex-config.js.map +1 -1
- package/dist/services/global-codex-config.test.js +9 -0
- package/dist/services/global-codex-config.test.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +10 -2
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/logger.test.js +1 -0
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/runtime-template.test.js +5 -5
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/config/agents/catalog.yaml +4 -4
- package/templates/.agents/dashboard/.zaip-managed.json +4 -4
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-BOLwg8VW.js → index-ehU9Etwm.js} +214 -16
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +26 -6
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +2 -2
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +3 -3
- package/templates/.agents/rules/zaip/core.md +1 -1
- package/templates/.agents/rules/zaip/workflow.md +1 -1
- package/templates/.agents/skills/zaip-aios/SKILL.md +9 -0
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-task/SKILL.md +1 -1
- package/templates/.agents/zaip-aios/guides/06-execucao.md +1 -1
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +1 -1
- package/templates/.zaip-aios/bin/zaip.mjs +9 -8
- package/templates/.zaip-aios/checksums.sha256 +16 -15
- package/templates/.zaip-aios/dashboard/.zaip-managed.json +4 -4
- package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/{index-BOLwg8VW.js → index-ehU9Etwm.js} +214 -16
- package/templates/.zaip-aios/dashboard/apps/frontend/dist/index.html +1 -1
- package/templates/.zaip-aios/dashboard/packages/local-runtime/server.mjs +26 -6
- package/templates/.zaip-aios/manifest.json +2 -1
- package/templates/.zaip-aios/templates/config/agents/catalog.yaml +4 -4
- package/templates/.zaip-aios/templates/requirements/model-orchestration.md +1 -1
- package/templates/.zaip-aios/templates/requirements/work-lifecycle.md +2 -2
- package/templates/.zaip-aios/templates/rules/zaip/core.md +1 -1
- package/templates/.zaip-aios/templates/rules/zaip/workflow.md +1 -1
- package/templates/.zaip-aios/templates/skills/zaip-aios/SKILL.md +9 -0
- package/templates/.zaip-aios/templates/skills/zaip-skill-execution/SKILL.md +1 -1
- package/templates/.zaip-aios/templates/skills/zaip-skill-task/SKILL.md +1 -1
- package/templates/.zaip-aios/templates/zaip-aios/guides/06-execucao.md +1 -1
- package/templates/.zaip-aios/templates/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +1 -1
- package/templates/template-manifest.json +52 -43
|
@@ -7,7 +7,7 @@ var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function
|
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,R=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=R;return R<<=1,!(R&62914560)&&(R=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function it(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[ot])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tt={},Et={};function Dt(e){return xe.call(Et,e)?!0:xe.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(j(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(s(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&qt(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&qt(e,a,t[a])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[st]||null;if(!i)throw Error(s(90));zt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(bu(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(s(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mn=i.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=h({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=h({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(h({},Dn,{dataTransfer:0})),An=yn(h({},Sn,{relatedTarget:0})),jn=yn(h({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(h({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(h({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(h({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(h({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(h({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(h({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(h({},Dn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Wn=yn(h({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Ed(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){yd(e,0)}function lr(e){if(Ft(_t(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(ln){var fr;if(ln){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==It(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=Ed(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),St(t,[e])}var Xr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<du)throw du=0,fu=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function di(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fi(e,t,n,r,i,a){var o=0;if(r=e,typeof e==`function`)li(e)&&(o=1);else if(typeof e==`string`)o=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=ci(31,n,t,i),e.elementType=te,e.lanes=a,e;case y:return pi(n.children,i,a,t);case b:o=8,i|=24;break;case x:return e=ci(12,n,t,i|2),e.elementType=x,e.lanes=a,e;case T:return e=ci(13,n,t,i),e.elementType=T,e.lanes=a,e;case E:return e=ci(19,n,t,i),e.elementType=E,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:o=10;break a;case S:o=9;break a;case w:o=11;break a;case ee:o=14;break a;case D:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=ci(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function z(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function mi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,B=``;function Ei(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Di(e,t,n){Si[Ci++]=Ti,Si[Ci++]=B,Si[Ci++]=wi,wi=e;var r=Ti;e=B;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Re(t)+i|n<<i|r,B=a+e}else Ti=1<<a|n<<i|r,B=e}function Oi(e){e.return!==null&&(Ei(e,1),Di(e,1,0))}function ki(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,B=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function Ai(e,t){Si[Ci++]=Ti,Si[Ci++]=B,Si[Ci++]=wi,Ti=t.id,B=t.overflow,wi=e}var ji=null,Mi=null,V=!1,Ni=null,Pi=!1,Fi=Error(s(519));function Ii(e){throw Hi(_i(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(ji=e.return;ji;)switch(ji.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:ji=ji.return}}function zi(e){if(e!==ji)return!1;if(!V)return Ri(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Mi&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));Mi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));Mi=uf(e)}else t===27?(t=Mi,Zd(e.type)?(e=lf,lf=null,Mi=e):Mi=t):Mi=ji?cf(e.stateNode.nextSibling):null;return!0}function Bi(){Mi=ji=null,V=!1}function Vi(){var e=Ni;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=F(null),Wi=null,Gi=null;function Ki(e,t,n){L(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,I(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ji(a.return,n,e),r||(o=null);break a}a=c.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(s(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ji(o,n,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Xi(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(s(387));if(o=o.memoizedProps,o!==null){var c=i.type;Sr(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===le.current){if(o=i.alternate,o===null)throw Error(s(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(s(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=dd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=M.S;M.S=function(e,t){eu=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=F(null);function _a(){var e=ga.current;return e===null?Rl.pooledCache:e}function va(e,t){t===null?L(ga,ga.current):L(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(s(460)),xa=Error(s(474)),Sa=Error(s(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(s(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(s(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ui(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function o(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=z(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Ea(a)===t.type)?(t=i(t,n.props),Na(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=pi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=z(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=fi(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case D:return t=Ea(t),f(e,t,n)}if(j(t)||k(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=Ea(n),p(e,t,n,r)}if(j(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ea(r),m(e,t,n,r,i)}if(j(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),V&&Ei(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return V&&Ei(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),V&&Ei(i,h),l}function g(i,o,c,l){if(c==null)throw Error(s(151));for(var u=null,d=null,h=o,g=o=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),o=a(y,o,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),V&&Ei(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return V&&Ei(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),V&&Ei(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===y&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case _:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ea(l)===r.type){n(e,r.sibling),c=i(r,a.props),Na(c,a),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}a.type===y?(c=pi(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=fi(a.type,a.key,a.props,null,e.mode,c),Na(c,a),c.return=e,e=c)}return o(e);case v:a:{for(l=a.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(a,e.mode,c),c.return=e,e=c}return o(e);case D:return a=Ea(a),b(e,r,a,c)}if(j(a))return h(e,r,a,c);if(k(a)){if(l=k(a),typeof l!=`function`)throw Error(s(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,Ma(a),c);if(a.$$typeof===C)return b(e,r,ea(e,a),c);Pa(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=z(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=F(null),H=F(0);function Za(e,t){e=Ul,L(H,e),L(Xa,t),Ul=e|t.baseLanes}function Qa(){L(H,Ul),L(Xa,Xa.current)}function $a(){Ul=H.current,I(Xa),I(H)}var eo=F(null),to=null;function no(e){var t=e.alternate;L(U,U.current&1),L(eo,e),to===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){L(U,U.current),L(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(L(U,U.current),L(eo,e),to===null&&(to=e)):ao(e)}function ao(){L(U,U.current),L(eo,eo.current)}function oo(e){I(eo),to===e&&(to=null),I(U)}var U=F(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function K(){throw Error(s(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){M.H=Fs;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(s(300));e===null||ec||(e=e.dependencies,e!==null&&Zi(e)&&(ec=!0))}function xo(e,t,n,r){W=e;var i=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=i)throw Error(s(301));if(i+=1,lo=G=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}M.H=Rs,a=t(n,r)}while(fo);return a}function So(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function Co(){var e=mo!==0;return mo=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Do(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(s(467)):Error(s(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ta(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return $i(e)}throw Error(s(438,String(e)))}function jo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),G,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=o=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((co&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,o=a):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,o=a):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!Sr(a,e.memoizedState)&&(ec=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Sr(a,t.memoizedState)||(ec=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Io(e,t,n){var r=W,i=Do(),a=V;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!Sr((G||i).memoizedState,n);if(o&&(i.memoizedState=n,ec=!0),i=i.queue,ss(zo.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,i,n,t),null),Rl===null)throw Error(s(349));a||co&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Oo(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Vo(e){var t=ri(e,2);t!==null&&hu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),po){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,G,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,i){if(Ms(e))throw Error(s(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};M.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Go(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(V){var n=Rl.formState;if(n!==null){a:{var r=W;if(V){if(Mi){b:{for(var i=Mi,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Mi=cf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,W,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,W,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),G,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=G;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=Oo(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();W.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&vo(r,G.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(W.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=Oo(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(q&2)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function vs(e,t,n,r){return Sr(n,t)?n:Xa.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(ec=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=_s(e,n,r),Sr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,js(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ma(c,r),pu(e)):As(e,t,r,pu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=Ss(e).queue;ys(e,i,t,ie,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},pu())}function ws(){return $i(Qf)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Va(n);var r=Ha(t,e,n);r!==null&&(hu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=ni(e,t,n,r),n!==null&&(hu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,pu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return ti(e,t,i,0),Rl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return hu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(s(479))}else t=ni(e,n,r,2),t!==null&&hu(t,e,2)}function Ms(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Fs={readContext:$i,use:Ao,useCallback:K,useContext:K,useEffect:K,useImperativeHandle:K,useLayoutEffect:K,useInsertionEffect:K,useMemo:K,useReducer:K,useRef:K,useState:K,useDebugValue:K,useDeferredValue:K,useTransition:K,useSyncExternalStore:K,useId:K,useHostTransitionStatus:K,useFormState:K,useActionState:K,useOptimistic:K,useMemoCache:K,useCacheRefresh:K};Fs.useEffectEvent=K;var Is={readContext:$i,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(po){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,W,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,i=Eo();if(V){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Rl===null)throw Error(s(349));Y&127||Lo(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,os(zo.bind(null,r,a,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),n},useId:function(){var e=Eo(),t=Rl.identifierPrefix;if(V){var n=B,r=Ti;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,W)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:$i,use:Ao,useCallback:hs,useContext:$i,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),G.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),G,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:$i,use:Ao,useCallback:hs,useContext:$i,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return G===null?_s(n,e,t):vs(n,G.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,G,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(hu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(hu(t,e,n),Ua(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Xr(e)}function Gs(e){console.error(e)}function Ks(e){Xr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Va(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,i,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,i)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,i)),!1}throw Error(s(435,n.tag))}return Gu(e,r,i),Du(),!1}if(V)return t=eo.current,t===null?(r!==Fi&&(t=Error(s(423),{cause:r}),Hi(_i(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=_i(r,n),i=Ys(e.stateNode,r,i),Wa(e,i),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Fi&&(e=Error(s(422),{cause:r}),Hi(_i(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=_i(a,n),Xl===null?Xl=[a]:Xl.push(a),Wl!==4&&(Wl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ys(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(ru===null||!ru.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Xs(i),Zs(i,e,n,r),Wa(n,i),!1}n=n.return}while(n!==null);return!1}var $s=Error(s(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(V&&s&&Oi(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),Qa(),ao(t)):(va(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),Qa(),io(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ia(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(ro(t),(e=Mi)?(e=rf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:B},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return cc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(ro(t),i)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(ec||Xi(e,t,n,!1),i=(n&e.childLanes)!==0,ec||i){if(r=Rl,r!==null&&(o=et(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,ri(e,o),hu(r,e,o),$s;Du(),t=lc(e,t,n)}else e=a.treeContext,Mi=cf(o.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return Qi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(V&&r&&Oi(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(V&&r&&Oi(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Ra||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Ra||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Bi(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ya()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function yc(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!=0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(U.current&2)!=0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!=0,t.flags&=-33,e===null){if(V){if(i?no(t):ao(t),(e=Mi)?(e=rf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:B},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(ao(t),i=t.mode,c=xc({mode:`hidden`,children:c},i),r=pi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,o,n),t.memoizedState=gc,oc(null,r)):(no(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?(no(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,i=t.mode,r=xc({mode:`visible`,children:r.children},i),c=pi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,o,n),t.memoizedState=gc,t=oc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),of(c)){if(o=c.nextSibling&&c.nextSibling.dataset,o)var u=o.dgst;o=u,r=Error(s(419)),r.stack=``,r.digest=o,Hi({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Xi(e,t,n,!1),o=(n&e.childLanes)!==0,ec||o){if(o=Rl,o!==null&&(r=et(o,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),hu(o,e,r),$s;af(c)||Du(),t=Sc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Mi=cf(c.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=bc(t,r.children),t.flags|=4096);return t}return i?(ao(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,i,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(i=c.cachePool,i===null?i=ya():(l=aa._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=vc(e,o,n),t.memoizedState=gc,oc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ia(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function wc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=U.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(U,o),tc(e,t,r,n),r=V?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(U,U.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,V&&t.flags&1048576&&Di(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(i===ee){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=A(e)||e,Error(s(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Us(r,t.pendingProps),mc(e,t,r,i,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Ba(e,t),qa(t,r,null,n);var o=t.memoizedState;if(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0),Ka(),r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=hc(e,t,r,n);break a}else if(r!==i){i=_i(Error(s(424)),t),Hi(i),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Mi=cf(e.firstChild),ji=t,V=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===i){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Bd(ce.current).createElement(n),r[ot]=t,r[st]=e,Pd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&V&&(r=t.stateNode=ff(t.type,t.pendingProps,ce.current),ji=t,Pi=!0,i=Mi,Zd(t.type)?(lf=i,Mi=cf(r.firstChild)):Mi=i),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((i=r=Mi)&&(r=tf(r,t.type,t.pendingProps,Pi),r===null?i=!1:(t.stateNode=r,ji=t,Mi=cf(r.firstChild),Pi=!1,i=!0)),i||Ii(t)),fe(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,r=a.children,Ud(i,a)?r=null:o!==null&&Ud(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=yo(e,t,So,null,null,n),Qf._currentValue=i),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=Mi)&&(n=nf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,ji=t,Mi=null,e=!0)),e||Ii(t)),null;case 13:return yc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Qi(t),i=$i(i),r=r(i),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(i=_a(),i===null&&(i=Rl,a=oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},za(t),Ki(t,aa,i)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Ki(t,aa,r),r!==i.cache&&Yi(t,[aa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ki(t,aa,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Da=Ca,xa}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Yl|=t)}function Pc(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(ki(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Fc(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Ac(t),a===null?(Fc(t),jc(t,i,null,r,n)):(Fc(t),Mc(t,a))):a?a===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,a)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,i,e,r,n)),null;case 27:if(pe(t),n=ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return Fc(t),null}e=oe.current,zi(t)?Li(t,e):(e=ff(i,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return Fc(t),null}if(a=oe.current,zi(t))Li(t,a);else{var o=Bd(ce.current);switch(a){case 1:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=o.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?o.createElement(`select`,{is:r.is}):o.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?o.createElement(i,{is:r.is}):o.createElement(i)}}a[ot]=t,a[st]=r;a:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break a;for(;o.sibling===null;){if(o.return===null||o.return===t)break a;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;a:switch(Pd(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=ce.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ji,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ii(t,!0)}else e=Bd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(557));e[ot]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(s(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(s(317));i[ot]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),i=!1}else i=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return de(),e===null&&Sd(t.stateNode.containerInfo),Fc(t),null;case 10:return qi(t.type),Fc(t),null;case 19:if(I(U),r=t.memoizedState,r===null)return Fc(t),null;if(i=(t.flags&128)!=0,a=r.rendering,a===null)if(i)Pc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=so(e),a!==null){for(t.flags|=128,Pc(r,!1),e=a.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return L(U,U.current&1|2),V&&Ei(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>tu&&(t.flags|=128,i=!0,Pc(r,!1),t.lanes=4194304)}else{if(!i)if(e=so(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!V)return Fc(t),null}else 2*Ee()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,i=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=U.current,L(U,i?n&1|2:n&1),V&&Ei(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Fc(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Lc(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(s(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(U),null;case 4:return de(),null;case 10:return qi(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&I(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Rc(e,t){switch(ki(t),t.tag){case 3:qi(aa),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:I(U);break;case 10:qi(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&I(ga);break;case 24:qi(aa)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Z(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[st]=t}catch(t){Z(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ot]=e,t[st]=n}catch(t){Z(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Rd=sp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break a}var o=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=o+i),f!==a||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=o),p===a&&++d===r&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var h=Us(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;Zd(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),pf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(s(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,o=t,c=o;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(s(160));ll(a,o,i),ol=null,sl=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var a=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[pt]||a[ot]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Pd(a,r,n),a[ot]=e,yt(a),r=a;break a;case`link`:var o=Vf(`link`,`href`,i).get(r+(n.href||``));if(o){for(var c=0;c<o.length;c++)if(a=o[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(c,1);break b}}a=i.createElement(r),Pd(a,r,n),i.head.appendChild(a);break;case`meta`:if(o=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<o.length;c++)if(a=o[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(c,1);break b}}a=i.createElement(r),Pd(a,r,n),i.head.appendChild(a);break;default:throw Error(s(468,r))}a[ot]=e,yt(a),r=a}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else a===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){i=e.stateNode;try{Gt(i,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Kc(e,i,n===null?i:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(s(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,i=hl,hl=gf(t.containerInfo),ml(t,e),hl=i,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=gf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||i,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var i=n.stateNode;Xc(e,Jc(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Gt(a,``),n.flags&=-33),Xc(e,Jc(e),a);break;case 3:case 4:var o=n.stateNode.containerInfo;Yc(e,Jc(e),o);break;default:throw Error(s(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:pf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Gf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=gf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,q=0,Rl=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return q&2&&Y!==0?Y&-Y:M.T===null?rt():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||V){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Jl=e}else Jl=536870912;return e=eo.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Rl&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Xe(e,n),(!(q&2)||e!==Rl)&&(e===Rl&&(!(q&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(q&6)throw Error(s(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),i=r?Au(e,t):Ou(e,t,!0),a=r;do{if(i===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!vu(n)){i=Ou(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o===0?o&536870912?536870912:0:o;if(o!==0){t=o;a:{var c=e;i=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,o).flags|=256),o=Ou(c,o,!1),o!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=a,Kl|=a,i=4;break a}a=Zl,Zl=i,a!==null&&(Zl===null?Zl=a:Zl.push.apply(Zl,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=$l+300-Ee(),10<i)){if(yu(r,t,Jl,!Bl),Ge(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,a,`Throttled`,-0,0),i);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,a,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Al(t,a,d);var m=(a&62914560)===a?$l-Ee():(a&4194048)===a?eu-Ee():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function bu(){return q&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Gi=Wi=null,To(e),Aa=null,ja=0,e=J;for(;e!==null;)Rc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Rl=e,J=n=ui(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ke(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,ei(),n}function Cu(e,t){W=null,M.H=Fs,t===ba||t===Sa?(t=Oa(),X=3):t===xa?(t=Oa(),X=4):X=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,qs(e,_i(t,e.current)))}function wu(){var e=eo.current;return e===null?!0:(Y&4194048)===Y?to===null:(Y&62914560)===Y||Y&536870912?e===to:!1}function Tu(){var e=M.H;return M.H=Fs,e===null?Fs:e}function Eu(){var e=M.A;return M.A=Il,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&eo.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Rl===null||yu(Rl,Y,Jl,!1)}function Ou(e,t,n){var r=q;q|=2;var i=Tu(),a=Eu();(Rl!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,q=r,M.H=i,M.A=a,J===null&&(Rl=null,Y=0,ei()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=q;q|=2;var r=Tu(),i=Eu();Rl!==e||Y!==t?(nu=null,tu=Ee()+500,Su(e,t)):Vl=Ke(e,t);a:do try{if(X!==0&&J!==null){t=J;var a=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,a,1);break;case 2:case 9:if(wa(a)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||Rl!==e||(X=7),rd(e)},a.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:wa(a)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,a,7));break;case 5:var o=null;switch(J.tag){case 26:o=J.memoizedState;case 5:case 27:var c=J;if(o?Wf(o):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,a,5);break;case 6:X=0,zl=null,Pu(e,t,a,6);break;case 8:xu(),Wl=6;break a;default:throw Error(s(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Gi=Wi=null,M.H=r,M.A=i,q=n,J===null?(Rl=null,Y=0,ei(),Wl):0}function ju(){for(;J!==null&&!we();)Mu(J)}function Mu(e){var t=kc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:To(t);default:Rc(n,t),t=J=di(t,Ul),t=kc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Gi=Wi=null,To(t),Aa=null,ja=0;var i=t.return;try{if(Qs(e,i,t,n,Y)){Wl=1,qs(e,_i(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,qs(e,_i(n,e.current)),J=null;return}t.flags&32768?(V||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Ic(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,i,a,o,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(q&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(a=t.lanes|t.childLanes,a|=$r,Ze(e,n,a,o,c,l),e===Rl&&(J=Rl=null,Y=0),ou=t,au=e,su=n,cu=a,lu=i,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ae,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,o=q,q|=4;try{rl(e,t,n)}finally{q=o,N.p=i,M.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{gl(t,e);var a=zd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{q=i,N.p=r,M.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=q;q|=4;try{il(e,t.alternate,t)}finally{q=i,N.p=r,M.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Te();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),nt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=nt(su),r=M.T,i=N.p;try{N.p=32>n?32:n,M.T=null,n=lu,lu=null;var a=au,o=su;if(iu=0,ou=au=null,su=0,q&6)throw Error(s(331));var c=q;if(q|=4,Nl(a.current),Tl(a,a.current,o,n),q=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,a)}catch{}return!0}finally{N.p=i,M.T=r,Vu(e,t)}}function Wu(e,t,n){t=_i(n,t),t=Ys(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Xe(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=_i(n,e),n=Xs(2),r=Ha(t,n,2),r!==null&&(Zs(n,r,t,e),Xe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Ee()-$l?!(q&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Je()),e=ri(e,t),e!==null&&(Xe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Se(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Ge(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Ee(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Y,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),nt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=cd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Ge(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){q&6?Se(Oe,ad):od()})}function dd(){if(nd===0){var e=ua;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Jr.length;hd++){var gd=Jr[hd];Yr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=ht(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),o=[];a:{var s=qr.get(e);if(s!==void 0){var c=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:c=zn;break;case`focusin`:u=`focus`,c=An;break;case`focusout`:u=`blur`,c=An;break;case`beforeblur`:case`afterblur`:c=An;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Vn;break;case Br:case Vr:case Hr:c=jn;break;case Kr:c=Hn;break;case`scroll`:case`scrollend`:c=Cn;break;case`wheel`:c=Un;break;case`copy`:case`cut`:case`paste`:c=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Bn;break;case`toggle`:case`beforetoggle`:c=Wn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?ht(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:_t(c),h=u==null?s:_t(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Dd,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;c!==null&&Od(o,s,c,d,!1),u!==null&&f!==null&&Od(o,f,u,d,!0)}}a:{if(s=r?_t(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=ur;else if(ir(s))if(dr)v=br;else{v=vr;var y=_r}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Vt(s,`number`,s.value)}switch(y=r?_t(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(o,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(o,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=Ed(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),md(o,e,r,n,i)}yd(o,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=cn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
9
9
|
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,a);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function Nd(e,t,n,r,i,a){switch(n){case`style`:Jt(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[st]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,a,o,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:$(e,t,r,d,n,null)}}Bt(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(o in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:$(e,t,o,c,n,null)}Wt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,o=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:o=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}zt(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:o=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&$(e,t,o,i,r,a)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(s(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=N.d;N.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);yt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=ce.current)?gf(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var a=vt(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(jf(e)))&&!a._p&&(o.instance=a,o.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),a||Nf(i,e,n,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Af(e){return`href="`+Rt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),yt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Rt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var a=e.querySelector(jf(i));if(a)return t.state.loading|=4,t.instance=a,yt(a),a;r=Mf(n),(i=mf.get(i))&&Rf(r,i),a=(e.ownerDocument||e).createElement(`link`),yt(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),t.state.loading|=4,Lf(a,n.precedence,e),t.instance=a;case`script`:return a=Pf(n.src),(i=e.querySelector(Ff(a)))?(t.instance=i,yt(i),i):(r=n,(i=mf.get(a))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),yt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function tp(e){return e?(e=oi,e):oi}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(hu(n,e,t),Ua(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=tt(t);var n=ri(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,up(e,t,n,r)}finally{N.p=a,M.T=i}}function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,up(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}rd(a),!(q&6)&&(tu=Ee()+500,id(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=tn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ht(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ht(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,it(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[ct]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=r.version;if(Lp!==`19.2.7`)throw Error(s(527,Lp,`19.2.7`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=Ws,a=Gs,o=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,a,o,Pp),e[ct]=t.current,Sd(e),new Fp(t)}})),c=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n(),u=c(),d=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=e(((e,t)=>{t.exports=d()}))(),p=new URL(`/assets/logo_novo_azul-BBx5pA2B.png`,``+import.meta.url).href;function m({filters:e,filtersActive:t=!1,lastUpdatedAt:n,loading:r,locale:i,onLocaleChange:a,onRefresh:o,repositoryName:s,settings:c,title:u}){let[d,m]=(0,l.useState)(!1),[g,S]=(0,l.useState)(!1),[C,w]=(0,l.useState)(!1),T=i===`pt-BR`?{filters:`Filtros`,language:`Idioma`,refresh:`Atualizar`,refreshing:`Atualizando…`,settings:`Configurações`,updated:`Atualizado`,waiting:`Aguardando atualização`}:{filters:`Filters`,language:`Language`,refresh:`Refresh`,refreshing:`Refreshing…`,settings:`Settings`,updated:`Updated`,waiting:`Waiting for refresh`},E=n===null?T.waiting:`${T.updated} ${new Intl.DateTimeFormat(i,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(n))}`,ee=e=>{a(e),S(!1)},D=s?.includes(`/`)?`https://github.com/${s}`:null;return(0,f.jsxs)(`nav`,{"aria-label":`${s?`${u} ${s}`:u} menu`,className:`dashboard-header`,children:[(0,f.jsxs)(`div`,{className:`dashboard-header-brand`,children:[(0,f.jsxs)(`strong`,{children:[(0,f.jsx)(`span`,{children:u}),s?D?(0,f.jsxs)(`a`,{"aria-label":`Abrir ${s} no GitHub`,className:`dashboard-header-repository`,href:D,rel:`noreferrer`,target:`_blank`,children:[(0,f.jsx)(v,{}),(0,f.jsx)(`span`,{children:s})]}):(0,f.jsxs)(`span`,{className:`dashboard-header-repository`,children:[(0,f.jsx)(v,{}),(0,f.jsx)(`span`,{children:s})]}):null]}),(0,f.jsx)(`small`,{children:E})]}),(0,f.jsx)(`img`,{alt:`ZAIP`,className:`dashboard-header-logo`,src:p}),(0,f.jsxs)(`div`,{className:`dashboard-header-actions`,children:[(0,f.jsx)(`button`,{"aria-label":T.refresh,className:`dashboard-header-icon dashboard-header-refresh`,disabled:r,onClick:o,type:`button`,children:(0,f.jsx)(_,{})}),(0,f.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-filter-action`,children:[(0,f.jsxs)(`button`,{className:`dashboard-header-button${d||t?` is-active`:``}`,onClick:()=>{m(e=>!e),S(!1),w(!1)},type:`button`,children:[(0,f.jsx)(y,{}),` `,T.filters]}),d?(0,f.jsx)(`div`,{className:`dashboard-header-popup dashboard-header-filter-popup`,children:e}):null]}),(0,f.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-locale-action`,children:[(0,f.jsxs)(`button`,{className:`dashboard-header-button${g?` is-active`:``}`,onClick:()=>{S(e=>!e),m(!1),w(!1)},type:`button`,children:[(0,f.jsx)(h,{locale:i}),i===`pt-BR`?`PT-BR`:`EN-US`,(0,f.jsx)(b,{})]}),g?(0,f.jsxs)(`div`,{className:`dashboard-header-popup dashboard-header-locale-popup`,children:[(0,f.jsxs)(`button`,{onClick:()=>ee(`pt-BR`),type:`button`,children:[(0,f.jsx)(h,{locale:`pt-BR`}),` Português do Brasil`,i===`pt-BR`?(0,f.jsx)(`span`,{children:`✓`}):null]}),(0,f.jsxs)(`button`,{onClick:()=>ee(`en-US`),type:`button`,children:[(0,f.jsx)(h,{locale:`en-US`}),` English`,i===`en-US`?(0,f.jsx)(`span`,{children:`✓`}):null]})]}):null]}),c===void 0?null:(0,f.jsxs)(`div`,{className:`dashboard-header-anchor dashboard-header-settings-action`,children:[(0,f.jsx)(`button`,{"aria-label":T.settings,className:`dashboard-header-icon${C?` is-active`:``}`,onClick:()=>{w(e=>!e),m(!1),S(!1)},type:`button`,children:(0,f.jsx)(x,{})}),C?(0,f.jsxs)(`div`,{className:`dashboard-header-popup dashboard-header-settings-popup`,children:[(0,f.jsxs)(`div`,{className:`dashboard-header-mobile-settings`,children:[(0,f.jsx)(`small`,{children:E}),(0,f.jsxs)(`button`,{disabled:r,onClick:o,type:`button`,children:[(0,f.jsx)(_,{}),` `,r?T.refreshing:T.refresh]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:T.language}),(0,f.jsxs)(`select`,{onChange:e=>a(e.target.value),value:i,children:[(0,f.jsx)(`option`,{value:`pt-BR`,children:`Português do Brasil`}),(0,f.jsx)(`option`,{value:`en-US`,children:`English`})]})]}),(0,f.jsxs)(`div`,{className:`dashboard-header-mobile-filters`,children:[(0,f.jsx)(`strong`,{children:T.filters}),e]})]}),(0,f.jsx)(`div`,{className:`dashboard-header-settings-content`,children:c})]}):null]})]})]})}function h({locale:e}){return e===`pt-BR`?(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,f.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,f.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`})]})}function g({children:e,className:t=``}){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-svg ${t}`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:e})}function _(){return(0,f.jsxs)(g,{children:[(0,f.jsx)(`path`,{d:`M21 12a9 9 0 0 1-15.2 6.5L3 16`}),(0,f.jsx)(`path`,{d:`M3 21v-5h5`}),(0,f.jsx)(`path`,{d:`M3 12a9 9 0 0 1 15.2-6.5L21 8`}),(0,f.jsx)(`path`,{d:`M21 3v5h-5`})]})}function v(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`dashboard-header-github`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M12 2C6.48 2 2 6.58 2 12.23c0 4.52 2.87 8.35 6.84 9.71.5.1.68-.22.68-.49 0-.24-.01-1.05-.02-1.9-2.78.62-3.37-1.2-3.37-1.2-.45-1.18-1.11-1.49-1.11-1.49-.91-.64.07-.63.07-.63 1 .07 1.53 1.06 1.53 1.06.9 1.57 2.34 1.12 2.91.86.09-.66.35-1.12.64-1.37-2.22-.26-4.56-1.14-4.56-5.06 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.71 0 0 .84-.28 2.75 1.05A9.32 9.32 0 0 1 12 6.97c.85 0 1.7.12 2.5.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.41.2 2.45.1 2.71.64.72 1.03 1.63 1.03 2.75 0 3.93-2.34 4.79-4.57 5.05.36.32.68.94.68 1.9 0 1.38-.01 2.49-.01 2.83 0 .27.18.59.69.49A10.25 10.25 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z`,fill:`currentColor`})})}function y(){return(0,f.jsx)(g,{children:(0,f.jsx)(`path`,{d:`M3 6h18M7 12h10m-7 6h4`})})}function b(){return(0,f.jsx)(g,{className:`dashboard-header-chevron`,children:(0,f.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function x(){return(0,f.jsxs)(g,{children:[(0,f.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.09a2 2 0 0 1 1 1.74v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}var S=o();function C({rows:e,columns:t,rowKey:n,onRowClick:r,defaultSort:i=null,sortable:a=!1,showColumnInfo:o=!1,scrollLabel:s,locale:c=`pt-BR`,emptyMessage:u=c===`pt-BR`?`Nenhum dado disponível.`:`No data available.`}){let[d,p]=(0,l.useState)(i),[m,h]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(m===null)return;let e=()=>h(null);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[m]);let g=(0,l.useMemo)(()=>t.filter(e=>!e.hidden),[t]),_=(0,l.useMemo)(()=>{if(d===null)return e;let n=t.find(e=>e.key===d.key);return n?[...e].sort((e,t)=>{let r=E(n.sortValue?.(e)??T(n.render(e)),n.sortValue?.(t)??T(n.render(t)));return d.direction===`asc`?r:-r}):e},[t,e,d]);return e.length===0?(0,f.jsx)(`p`,{className:`ui-empty`,children:u}):(0,f.jsxs)(`div`,{"aria-label":s,className:`ui-table-wrap`,role:s?`region`:void 0,tabIndex:s?0:void 0,children:[(0,f.jsxs)(`table`,{className:`ui-table`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsx)(`tr`,{children:g.map(e=>(0,f.jsx)(`th`,{"aria-sort":d?.key===e.key?d.direction===`asc`?`ascending`:`descending`:`none`,className:e.align===`right`?`is-number`:void 0,children:e.label&&(a||o)?(0,f.jsxs)(`span`,{className:`ui-table-heading`,children:[(0,f.jsx)(`span`,{className:`ui-table-label`,children:e.label}),a?(0,f.jsx)(`button`,{"aria-label":c===`pt-BR`?`Ordenar por ${e.label}`:`Sort by ${e.label}`,className:`ui-table-sort`,onClick:()=>p(t=>({key:e.key,direction:t?.key===e.key&&t.direction===`asc`?`desc`:`asc`})),type:`button`,children:(0,f.jsx)(`span`,{"aria-hidden":`true`,className:`ui-table-sort-indicator`,children:d?.key===e.key?d.direction===`asc`?`↑`:`↓`:`↕`})}):null,o?(0,f.jsx)(`button`,{"aria-label":c===`pt-BR`?`Informação sobre ${e.label}`:`Information about ${e.label}`,className:`ui-table-info`,onBlur:()=>h(null),onFocus:t=>w(t.currentTarget,e.description??ee(e.label,c),h),onMouseEnter:t=>w(t.currentTarget,e.description??ee(e.label,c),h),onMouseLeave:()=>h(null),type:`button`,children:`i`}):null]}):e.label},e.key))})}),(0,f.jsx)(`tbody`,{children:_.map(e=>(0,f.jsx)(`tr`,{className:r===void 0?void 0:`ui-table-row-action`,onClick:r===void 0?void 0:()=>r(e),onKeyDown:r===void 0?void 0:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))},tabIndex:r===void 0?void 0:0,children:g.map(t=>(0,f.jsx)(`td`,{className:t.align===`right`?`is-number`:void 0,children:t.render(e)},t.key))},n(e)))}),g.some(e=>e.footer!==void 0)?(0,f.jsx)(`tfoot`,{children:(0,f.jsx)(`tr`,{children:g.map(e=>(0,f.jsx)(`td`,{className:e.align===`right`?`is-number`:void 0,children:e.footer},e.key))})}):null]}),m&&typeof document<`u`?(0,S.createPortal)((0,f.jsx)(`div`,{className:`ui-table-tooltip`,role:`tooltip`,style:{bottom:m.bottom,left:m.left,top:m.top},children:m.text}),document.body):null]})}function w(e,t,n){let r=e.getBoundingClientRect();n({text:t,left:Math.min(Math.max(r.left+r.width/2,176),window.innerWidth-176),...window.innerHeight-r.bottom<260?{bottom:window.innerHeight-r.top+9}:{top:r.bottom+9}})}function T(e){return typeof e==`number`||typeof e==`string`?e:Array.isArray(e)?e.map(T).filter(Boolean).join(` `):e&&typeof e==`object`&&`props`in e?T(e.props?.children??null):null}function E(e,t){return e===null?t===null?0:1:t===null?-1:typeof e==`number`&&typeof t==`number`?e-t:new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare(String(e),String(t))}function ee(e,t){let n=e.toLocaleLowerCase(t);return t===`pt-BR`?`Mostra ${n} para cada linha. Clique no título para ordenar em ordem crescente ou decrescente.`:`Shows ${n} for each row. Click the column title to sort in ascending or descending order.`}function D(e,t=`pt-BR`){return e===null?`0`:e>=36e5?`${new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(e/36e5)} h`:e>=6e4?`${Math.round(e/6e4)} min`:`${Math.round(e/1e3)} ${t===`pt-BR`?`seg`:`sec`}`}function te(e,t=`pt-BR`){return e===null?`0`:e<36e5?D(e,t):`${new Intl.NumberFormat(t,{maximumFractionDigits:1}).format(e/36e5)} h`}function O(e,t=`pt-BR`,n=1){if(e===null)return`0`;let r=[{threshold:0x38d7ea4c68000,suffix:`Q`},{threshold:0xe8d4a51000,suffix:`T`},{threshold:1e9,suffix:`B`},{threshold:1e6,suffix:`M`},{threshold:1e3,suffix:`mil`}].find(({threshold:t})=>Math.abs(e)>=t);return r?`${new Intl.NumberFormat(t,{maximumFractionDigits:n}).format(e/r.threshold)} ${r.suffix}`:new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:n}).format(e)}function ne(e,t=`pt-BR`,n){return e===null?`0`:new Intl.NumberFormat(t,{maximumFractionDigits:n}).format(e)}function k(e,t,n=`pt-BR`){return e===null?`0`:new Intl.NumberFormat(n,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function re(e,t=`pt-BR`){return e===null?t===`pt-BR`?`indisponível`:`unavailable`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(e))}function A(e,t=`pt-BR`){return new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1}).format(e)}function j({ariaLabel:e,metrics:t}){return(0,f.jsx)(`section`,{"aria-label":e,className:`period-average-summary`,children:(0,f.jsx)(`div`,{className:`period-average-grid`,children:t.map(e=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{children:e.label}),(0,f.jsx)(`strong`,{children:e.value})]},e.label))})})}function M({details:e,locale:t,onClose:n}){let r=se(t),i=e.kind===`change`||e.kind===`decision`?e.row.title:e.row.id;return(0,S.createPortal)((0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>e.currentTarget===e.target&&n(),open:!0,children:(0,f.jsxs)(`section`,{"aria-label":`${r.details} ${oe(e.kind,t)}`,"aria-modal":`true`,className:`operations-status-dialog operations-entity-details`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:oe(e.kind,t)}),(0,f.jsx)(`h2`,{children:i}),(0,f.jsx)(`p`,{children:e.row.id})]}),(0,f.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,onClick:n,type:`button`,children:`×`})]}),(0,f.jsxs)(`div`,{className:`operations-entity-details-scroll`,children:[e.kind===`change`?(0,f.jsx)(N,{locale:t,row:e.row}):null,e.kind===`decision`?(0,f.jsx)(ie,{locale:t,row:e.row}):null,e.kind===`execution`?(0,f.jsx)(P,{locale:t,row:e.row}):null,e.kind===`run`?(0,f.jsx)(ae,{locale:t,row:e.row}):null]})]})}),document.body)}function N({row:e,locale:t}){let n=se(t);return(0,f.jsx)(F,{items:[[n.status,e.status],[n.risk,e.risk],[n.origin,I(e.source)],[n.created,re(e.created_at,t)],[n.tasks,String(e.task_ids.length)],[n.requirements,L(e.requirement_ids)],[n.acceptanceCriteria,L(e.acceptance_ids)],[n.result,e.result??`—`],[n.file,e.artifact_path]]})}function ie({row:e,locale:t}){let n=se(t);return(0,f.jsx)(F,{items:[[n.origin,e.origin],[n.scopeType,e.scope_type],[n.scope,e.scope_id],[n.created,re(e.created_at,t)],[n.file,e.artifact_path]]})}function P({row:e,locale:t}){let n=se(t);return(0,f.jsx)(F,{items:[[n.status,e.status],[n.workStatus,e.work_status],[n.origin,I(e.origin)],[n.created,re(e.created_at,t)],[n.tasksInDag,String(e.dag.nodes.length)],[t===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`,String(e.orchestrator_run_count)],[t===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`,String(e.subagent_run_count)],[t===`pt-BR`?`Tasks finalizadas`:`Finalized Tasks`,`${e.finalized_task_count}/${e.task_count} (${e.finalizer_run_count} ${t===`pt-BR`?`chamadas finalizadoras`:`finalizer calls`})`],[n.topologicalOrder,L(e.dag.topological_order)],[n.dependencies,e.dag.nodes.map(e=>`${e.task_id}: ${L(e.depends_on)}`).join(`
|
|
10
|
-
`)||`—`],[n.result,e.result??`—`],[n.file,e.artifact_path]]})}function ae({row:e,locale:t}){let n=se(t);return(0,f.jsx)(F,{items:[[n.status,e.status],[n.phase,e.phase],[n.entrypoint,e.entrypoint],[n.type,e.work_type],[t===`pt-BR`?`Tipo da chamada`:`Call type`,e.run_kind===`run`?`Run`:`Sub-Run`],[t===`pt-BR`?`Propósito`:`Purpose`,e.run_purpose],[t===`pt-BR`?`Exige finalizador`:`Requires finalizer`,e.requires_finalizer?`sim`:`não`],[t===`pt-BR`?`Run pai`:`Parent Run`,e.parent_run_id??`—`],[n.client,e.client],[n.agent,e.agent_name],[n.provider,e.provider??`—`],[t===`pt-BR`?`Modelo planejado`:`Planned model`,e.model],[t===`pt-BR`?`Effort planejado`:`Planned effort`,e.reasoning_effort??`—`],[t===`pt-BR`?`Modelo efetivo`:`Effective model`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_model??`—`],[t===`pt-BR`?`Effort efetivo`:`Effective effort`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_reasoning_effort??`—`],[`Task`,e.task_id??`—`],[`SPEC`,e.spec_id??`—`],[`PRD`,e.prd_id??`—`],[`Change`,e.change_id??`—`],[`Execution`,e.execution_id??`—`],[n.start,re(e.started_at,t)],[n.end,re(e.finished_at,t)],[n.duration,D(e.duration_ms,t)],[`Tokens`,O(e.usage.total.tokens.total,t)],[n.costBrl,k(e.usage.total.cost.brl,`BRL`,t)],[n.costUsd,k(e.usage.total.cost.usd,`USD`,t)],[n.file,e.artifact_path]]})}function F({items:e}){return(0,f.jsx)(`dl`,{className:`operations-entity-detail-grid`,children:e.map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:t})]},e))})}function I(e){return e.type===`task`?`Task: ${e.task_id}`:e.type===`spec`?`SPEC: ${e.spec_id}`:e.type===`interaction`?`Conversation: ${e.conversation_id}`:`PRD: ${e.prd_id}${`spec_id`in e&&e.spec_id?` · SPEC: ${e.spec_id}`:``}`}function L(e){return e.length===0?`—`:e.join(`, `)}function oe(e,t){return(t===`pt-BR`?{change:`Mudança`,decision:`Decisão`,execution:`Execução`,run:`Run`}:{change:`Change`,decision:`Decision`,execution:`Execution`,run:`Run`})[e]}function se(e){return e===`pt-BR`?{details:`Detalhes de`,status:`Status`,risk:`Risco`,origin:`Origem`,created:`Criada`,tasks:`Tasks`,requirements:`Requisitos`,acceptanceCriteria:`Critérios de aceite`,result:`Resultado`,file:`Arquivo`,scopeType:`Tipo de escopo`,scope:`Escopo`,workStatus:`Status do trabalho`,tasksInDag:`Tasks na DAG`,topologicalOrder:`Ordem topológica`,dependencies:`Dependências`,phase:`Fase`,entrypoint:`Entrada`,type:`Tipo`,client:`Cliente`,agent:`Agente`,provider:`Provider`,model:`Modelo`,start:`Início`,end:`Fim`,duration:`Duração`,costBrl:`Custo BRL`,costUsd:`Custo USD`}:{details:`Details for`,status:`Status`,risk:`Risk`,origin:`Origin`,created:`Created`,tasks:`Tasks`,requirements:`Requirements`,acceptanceCriteria:`Acceptance criteria`,result:`Result`,file:`File`,scopeType:`Scope type`,scope:`Scope`,workStatus:`Work status`,tasksInDag:`Tasks in DAG`,topologicalOrder:`Topological order`,dependencies:`Dependencies`,phase:`Phase`,entrypoint:`Entrypoint`,type:`Type`,client:`Client`,agent:`Agent`,provider:`Provider`,model:`Model`,start:`Start`,end:`End`,duration:`Duration`,costBrl:`Cost BRL`,costUsd:`Cost USD`}}function ce(e){let t=new Map;for(let n of e)n.task_id===null&&t.set(n.conversation_id,[...t.get(n.conversation_id)??[],n]);return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.started_at.localeCompare(e.started_at))[0],r=t.map(e=>e.duration_ms).filter(e=>e!==null);return{id:e,latest_started_at:n.started_at,run_count:t.length,status:n.status,duration_ms:r.length===0?null:r.reduce((e,t)=>e+t,0),models:[...new Set(t.map(e=>e.effective_model??e.model).filter(le))].sort()}}).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function le(e){return e!==null&&e.trim()!==``&&e.toLowerCase()!==`unknown`}function ue(e,t){return e.map((e,n)=>({row:e,index:n,timestamp:Date.parse(t(e)??``)})).sort((e,t)=>{let n=Number.isFinite(e.timestamp)?e.timestamp:-1/0;return(Number.isFinite(t.timestamp)?t.timestamp:-1/0)-n||e.index-t.index}).map(({row:e})=>e)}function de({rows:e,locale:t}){let[n,r]=(0,l.useState)(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C,{columns:[{key:`created`,label:`Criada`,render:e=>re(e.created_at)},{key:`title`,label:`Change`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`risk`,label:`Risco`,render:e=>(0,f.jsx)(xe,{risk:e.risk})},{key:`tasks`,label:`Tasks`,render:e=>e.task_ids.length,align:`right`},{key:`path`,label:`Arquivo`,render:e=>e.artifact_path}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ue(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`change`,row:n},locale:t,onClose:()=>r(null)}):null]})}function fe({rows:e,locale:t}){let[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(`all`),o=ue(e.filter(e=>i===`all`||e.kind===i),e=>e.created_at);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`operations-execution-table`,children:[(0,f.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de execução`:`Execution type`,children:[`all`,`interaction`,`delivery`].map(e=>(0,f.jsx)(`button`,{className:i===e?`is-active`:void 0,onClick:()=>a(e),type:`button`,children:pe(e,t)},e))})}),(0,f.jsx)(C,{columns:[{key:`created`,label:`Data de criação`,render:e=>re(e.created_at)},{key:`id`,label:t===`pt-BR`?`Execução`:`Execution`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:pe(e.kind??`delivery`,t)}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`origin`,label:`Origem`,render:e=>(0,f.jsx)(Se,{entrypoint:e.origin.type===`interaction`?`conversation`:e.origin.type})},{key:`duration`,label:t===`pt-BR`?`Tempo de execução`:`Execution time`,render:e=>D(e.duration_ms),align:`right`},{key:`runs`,label:t===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`,render:e=>me(e.orchestrator_run_count),align:`right`},{key:`subruns`,label:t===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`,render:e=>me(e.subagent_run_count),align:`right`},{key:`finalizers`,label:t===`pt-BR`?`Finalizadores`:`Finalizers`,render:e=>`${me(e.finalized_task_count)}/${me(e.task_count)}`,align:`right`},{key:`tasks`,label:t===`pt-BR`?`Tarefas`:`Tasks`,render:e=>me(e.task_count),align:`right`},{key:`specs`,label:`SPEC`,render:e=>me(e.spec_count),align:`right`},{key:`prds`,label:`PRD`,render:e=>me(e.prd_count),align:`right`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:o,showColumnInfo:!0,sortable:!0})]}),n?(0,f.jsx)(M,{details:{kind:`execution`,row:n},locale:t,onClose:()=>r(null)}):null]})}function pe(e,t){return t===`pt-BR`?e===`all`?`Todas`:e===`interaction`?`Interações`:`Execuções de entrega`:e===`all`?`All`:e===`interaction`?`Interactions`:`Delivery executions`}function me(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function he(e){return e.agent.toLowerCase()===`codex`?`codex`:e.agent_name||e.agent}function ge({rows:e,locale:t}){let[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(`all`),o=ue(e.filter(e=>i===`all`||e.run_kind===i),e=>e.started_at);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de chamada de agente`:`Agent call type`,children:[`all`,`run`,`subrun`].map(e=>(0,f.jsx)(`button`,{className:i===e?`is-active`:void 0,onClick:()=>a(e),type:`button`,children:e===`all`?t===`pt-BR`?`Todas`:`All`:e===`run`?t===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`:t===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`},e))})}),(0,f.jsx)(C,{columns:[{key:`created`,label:`Data de criação`,render:e=>re(e.started_at)},{key:`id`,label:`Run`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.id}),(0,f.jsx)(`small`,{children:e.parent_run_id??e.task_id??e.conversation_id})]})},{key:`kind`,label:t===`pt-BR`?`Tipo`:`Type`,render:e=>e.run_kind===`run`?`Run`:`Sub-Run`},{key:`agent`,label:t===`pt-BR`?`Agente`:`Agent`,render:e=>(0,f.jsx)(`strong`,{children:he(e)})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`origin`,label:t===`pt-BR`?`Origem`:`Origin`,render:e=>(0,f.jsx)(Se,{entrypoint:e.entrypoint})},{key:`phase`,label:t===`pt-BR`?`Propósito`:`Purpose`,render:e=>_e(e.run_purpose,t)},{key:`duration`,label:`Duração`,render:e=>D(e.duration_ms)}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:o,showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`run`,row:n},locale:t,onClose:()=>r(null)}):null]})}function _e(e,t){return t===`pt-BR`?{intake:`Entrada`,orchestration:`Orquestração`,execution:`Execução`,review:`Revisão`,audit:`Auditoria`,finalization:`Finalização`}[e]:e}function ve({rows:e,locale:t}){let n=ce(e);return(0,f.jsx)(C,{columns:[{key:`created`,label:t===`pt-BR`?`Data e hora`:`Date and time`,render:e=>re(e.latest_started_at)},{key:`conversation`,label:t===`pt-BR`?`Conversa`:`Conversation`,render:e=>(0,f.jsx)(`strong`,{children:e.id})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`runs`,label:`Runs`,render:e=>e.run_count,align:`right`},{key:`duration`,label:t===`pt-BR`?`Duração`:`Duration`,render:e=>D(e.duration_ms)},{key:`models`,label:t===`pt-BR`?`Modelos`:`Models`,render:e=>e.models.length>0?e.models.join(`, `):`—`}],locale:t,rowKey:e=>e.id,rows:n,showColumnInfo:!0,sortable:!0})}function ye({rows:e,locale:t}){let[n,r]=(0,l.useState)(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C,{columns:[{key:`date`,label:`Data de criação`,render:e=>re(e.created_at)},{key:`title`,label:`Decisão`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`origin`,label:`Origem`,render:e=>(0,f.jsx)(Ce,{origin:e.origin})},{key:`stage`,label:`Fase`,render:e=>(0,f.jsx)(we,{scopeType:e.scope_type})},{key:`scope`,label:`Escopo`,render:e=>`${e.scope_type}: ${e.scope_id}`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ue(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`decision`,row:n},locale:t,onClose:()=>r(null)}):null]})}function be({status:e}){return(0,f.jsx)(`span`,{className:`operations-table-status is-${e}`,children:e})}function xe({risk:e}){return(0,f.jsx)(`span`,{className:`operations-table-risk is-${e}`,children:e})}function Se({entrypoint:e}){let t=e===`prd`?`PRD`:e===`spec`?`SPEC`:e===`task`?`Tarefa`:`Conversa`;return(0,f.jsx)(`span`,{className:`operations-table-entry is-${e}`,children:t})}function Ce({origin:e}){return(0,f.jsx)(`span`,{className:`operations-table-decision-origin is-${e}`,children:e})}function we({scopeType:e}){let t=e===`change`?`planning`:`execution`;return(0,f.jsx)(`span`,{className:`operations-table-stage is-${t}`,children:t===`planning`?`Planejamento`:`Execução`})}var Te=1e3,Ee=60*Te,De=60*Ee,Oe=24*De,ke=7*Oe,Ae=30*Oe,je=6*De,Me=new Set([`completed`,`blocked`,`failed`,`cancelled`]);function Ne(e,t,n,r=Date.now()){if(e===null||Me.has(t))return null;let i=Date.parse(e);if(!Number.isFinite(i))return null;let a=Math.max(0,r-i),o=t===`executing`||t===`verifying`;return{label:Pe(a,o,n),alert:o&&a>je}}function Pe(e,t,n){let r=n===`pt-BR`?`Há`:`Ago`,i=Fe(e,t,n);return n===`pt-BR`?`${r} ${i}`:`${i} ${r}`}function Fe(e,t,n){let r=Math.max(1,Math.round(e/Te));if(r<60)return`${r} seg`;let i=Math.round(e/Ee);if(i<60)return`${i} min`;let a=Math.round(e/De);if(a<24)return`${a} h`;let o=Math.round(e/Oe);if(t||o<7)return`${o} d`;let s=Math.round(e/ke);if(s<4)return n===`pt-BR`?`${s} sem`:`${s} w`;let c=Math.max(1,Math.round(e/Ae));return n===`pt-BR`?c===1?`1 mês`:`${c} meses`:`${c} mo`}function Ie(e,t){return Le(e,t,t===`pt-BR`?`Criada`:`Created`)}function Le(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?``:`${n} · ${new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(r)}`}function Re(e,t=`pt-BR`){return e>=36e5?`${Math.round(e/36e5)} h`:e>=6e4?`${Math.round(e/6e4)} min`:`${Math.round(e/1e3)} ${t===`pt-BR`?`seg`:`sec`}`}function ze(e){return`${Math.round(e/36e5)} h`}var Be=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ve=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),He={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ue=(0,l.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,l.createElement)(`svg`,{ref:c,...He,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ve(`lucide`,i),...s},[...o.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(a)?a:[a]])),R=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...r},i)=>(0,l.createElement)(Ue,{ref:i,iconNode:t,className:Ve(`lucide-${Be(e)}`,n),...r}));return n.displayName=`${e}`,n},We=R(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ge=R(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ke=R(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),qe=R(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Je=R(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Ye=R(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Xe=R(`CircleDot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ze=R(`CircleGauge`,[[`path`,{d:`M15.6 2.7a10 10 0 1 0 5.7 5.7`,key:`1e0p6d`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M13.4 10.6 19 5`,key:`1kr7tw`}]]),Qe=R(`ClipboardList`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),$e=R(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),et=R(`Coins`,[[`circle`,{cx:`8`,cy:`8`,r:`6`,key:`3yglwk`}],[`path`,{d:`M18.09 10.37A6 6 0 1 1 10.34 18`,key:`t5s6rm`}],[`path`,{d:`M7 6h1v4`,key:`1obek4`}],[`path`,{d:`m16.71 13.88.7.71-2.82 2.82`,key:`1rbuyh`}]]),tt=R(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),nt=R(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),rt=R(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),it=R(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),at=R(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ot=R(`Gavel`,[[`path`,{d:`m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8`,key:`15492f`}],[`path`,{d:`m16 16 6-6`,key:`vzrcl6`}],[`path`,{d:`m8 8 6-6`,key:`18bi4p`}],[`path`,{d:`m9 7 8 8`,key:`5jnvq1`}],[`path`,{d:`m21 11-8-8`,key:`z4y7zo`}]]),st=R(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),ct=R(`Layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),lt=R(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ut=R(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),dt=R(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),ft=R(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),pt=R(`Route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),mt=R(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ht=R(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),gt=R(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),_t=R(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),vt=R(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function yt(e,t){return e.filter(e=>e.kind===`spec`&&e.parent_id===t)}function bt(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return e.task_ids.map(e=>({id:e,task:r.get(e)??null,usage:n.get(e)}))}var xt={durationMs:null,tokens:null,costBrl:null};function St(e){return{durationMs:e.duration_ms,tokens:e.usage.total.coverage.tokens>0?e.usage.total.tokens.total:null,costBrl:e.usage.total.coverage.brl>0?e.usage.total.cost.brl:null}}function Ct({locale:e,usage:t}){return(0,f.jsx)(`dl`,{className:`operations-macro-usage-strip`,children:[{icon:(0,f.jsx)($e,{size:17}),label:e===`pt-BR`?`Tempo total`:`Total time`,value:t.durationMs===null?`—`:Re(t.durationMs,e)},{icon:(0,f.jsx)(vt,{size:17}),label:`Tokens`,value:O(t.tokens,e)},{icon:(0,f.jsx)(et,{size:17}),label:e===`pt-BR`?`Custo`:`Cost`,value:k(t.costBrl,`BRL`,e)}].map(e=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,f.jsx)(`dt`,{children:e.label}),(0,f.jsx)(`dd`,{children:e.value})]},e.label))})}function wt({locale:e,usage:t}){let n=[t.durationMs===null?`—`:Re(t.durationMs,e),O(t.tokens,e),k(t.costBrl,`BRL`,e)];return(0,f.jsx)(`dl`,{className:`operations-macro-mini-usage`,children:(e===`pt-BR`?[`Tempo`,`Tokens`,`Custo`]:[`Time`,`Tokens`,`Cost`]).map((e,t)=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:n[t]})]},e))})}var Tt={"en-US":{draft:`Definition (PRD + Requirements)`,planned:`Planned (SPEC + Changes)`,executing:`Executing (Tasks)`,verifying:`Verifying (Tests + Review)`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`},"pt-BR":{draft:`Definição (PRD + Requisitos)`,planned:`Planejamento (SPEC + Mudanças)`,executing:`Execução (Tarefas)`,verifying:`Verificação (Testes + Revisão)`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`}};function Et(e,t){return Tt[t][e]}function Dt(e,t){return t===`en-US`?e===`lite`?`Lite`:e===`standard`?`Standard`:`Critical`:e===`lite`?`Leve`:e===`standard`?`Padrão`:`Crítico`}var Ot=[`task`,`spec`,`prd`];function kt(e,t){return t.find(t=>t.id===e.change_id)?.source.type??(e.spec_id===null?`task`:`spec`)}function At(e){return e===`task`?`Task-first`:e===`spec`?`SPEC`:`PRD`}function jt(e,t,n){return t===``||kt(e,n)===t}function Mt(){let[e,t]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}function Nt(e){let[t,n]=(0,l.useState)(30),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let i=r.current;if(i===null||t>=e)return;let a=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&n(t=>Math.min(e,t+30))},{rootMargin:`320px 0px`});return a.observe(i),()=>a.disconnect()},[e,t]),{hasMore:t<e,sentinelRef:r,visibleCount:Math.min(t,e)}}function Pt(e){let t=new Map;for(let n of e){if(n.task_id===null||n.execution_id===null)continue;let e=t.get(n.task_id)??{durationMs:null,tokens:null,costBrl:null};t.set(n.task_id,{durationMs:Ft(e.durationMs,n.duration_ms),tokens:Ft(e.tokens,n.usage.total.tokens.total),costBrl:Ft(e.costBrl,n.usage.total.cost.brl)})}return t}function Ft(e,t){return e===null&&t===null?null:(e??0)+(t??0)}function It(e){return e.status===`planned`&&e.spec_id===null&&e.attempt_count===0&&e.started_at===null&&e.execution_started===!1}var Lt=[`definition`,`planning`,`ready`,`executing`,`verifying`,`completed`,`blocked`,`cancelled`,`failed`];function Rt(e,t){return t===`task`?e.kind===`task`:t===`standalone-task`?e.kind===`task`&&e.row.spec_id===null:t===`all`?e.kind===`prd`?!0:e.kind===`spec`?e.row.parent_id===null:e.row.spec_id===null:e.kind===t}function zt(e,t,n){let r=e.kind===`prd`?t.filter(t=>t.parent_id===e.id):[],i=new Set(r.map(e=>e.id)),a=new Set(e.task_ids);if(e.kind===`spec`)for(let t of n)t.spec_id===e.id&&a.add(t.id);else{for(let e of r)for(let t of e.task_ids)a.add(t);for(let e of n)e.spec_id!==null&&i.has(e.spec_id)&&a.add(e.id)}let o=n.filter(e=>a.has(e.id));return{completedSpecs:r.filter(Vt).length,totalSpecs:r.length,completedTasks:o.filter(e=>e.status===`completed`).length,totalTasks:o.length}}function Bt(e,t){let n=`Tasks ${t.completedTasks}/${t.totalTasks}`;return e===`prd`?`SPECs ${t.completedSpecs}/${t.totalSpecs} · ${n}`:n}function Vt(e){return e.lifecycle_status===`delivered`||e.work_status===`completed`}function Ht(e,t){return{"pt-BR":{definition:`Definição (PRD + Requisitos)`,planning:`Planejamento (SPEC + Change)`,ready:`Pronto para Executar`,executing:`Execução`,verifying:`Verificação`,completed:`Concluído`,blocked:`Bloqueado`,cancelled:`Cancelado`,failed:`Falhado`},"en-US":{definition:`Definition (PRDs)`,planning:`Planning`,ready:`Ready to Execute`,executing:`Executing`,verifying:`Verifying`,completed:`Completed`,blocked:`Blocked`,cancelled:`Cancelled`,failed:`Failed`}}[t][e]}function Ut(e){return e.status===`completed`?`completed`:e.status===`cancelled`?`cancelled`:e.status===`failed`?`failed`:e.status===`blocked`?`blocked`:e.is_active===!0||e.status===`executing`?`executing`:e.status===`verifying`?`verifying`:(e.attempt_count??0)>0||e.started_at!=null||e.execution_started===!0?`executing`:It(e)?`ready`:null}function Wt(e,t){if(e.lifecycle_status===`cancelled`||e.work_status===`cancelled`)return`cancelled`;if(e.work_status===`failed`)return`failed`;if(e.work_status===`blocked`)return`blocked`;if(e.lifecycle_status===`delivered`||e.work_status===`completed`)return`completed`;if(e.is_active||t.some(t=>e.task_ids.includes(t.id)&&t.is_active))return`executing`;if(e.lifecycle_status===`verifying`||e.work_status===`verifying`)return`verifying`;if(e.work_status===`executing`){let n=t.filter(t=>e.task_ids.includes(t.id));return n.some(e=>e.status===`verifying`)&&n.every(e=>e.status===`verifying`||e.status===`completed`)?`verifying`:`executing`}return e.lifecycle_status===`active`?`executing`:e.lifecycle_status===`ready`?`ready`:e.kind===`prd`&&e.lifecycle_status===`draft`?`definition`:`planning`}function Gt({label:e,locale:t,onClose:n,onOpenDocument:r,onOpenTrace:i,row:a,runs:o,specs:s,tasks:c}){let u=(0,l.useRef)(null),d=(0,l.useRef)(null),[p,m]=(0,l.useState)(e===`SPEC`?a:null),h=(0,l.useMemo)(()=>yt(s,a.id),[a.id,s]),g=(0,l.useMemo)(()=>Pt(o),[o]);(0,l.useEffect)(()=>{let e=u.current;if(e!==null)return e.open||e.showModal(),()=>{e.open&&e.close()}},[]);let _=e=>{d.current?.scrollTo({top:0}),m(e)},v=e===`PRD`&&p===null,y=p??a,b=bt(y,c,g);return(0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop operations-macro-dialog-backdrop`,onCancel:e=>{e.preventDefault(),n()},onMouseDown:e=>{e.currentTarget===e.target&&n()},ref:u,children:(0,f.jsxs)(`section`,{"aria-label":`${t===`pt-BR`?`Detalhes do`:`Details for`} ${e}`,"aria-modal":`true`,className:`operations-macro-planning-dialog`,"data-kind":v?`prd`:`spec`,role:`dialog`,children:[(0,f.jsxs)(`header`,{className:`operations-macro-dialog-header`,children:[(0,f.jsxs)(`div`,{className:`operations-macro-heading`,children:[(0,f.jsx)(`span`,{className:`operations-macro-heading-icon`,"aria-hidden":`true`,children:v?(0,f.jsx)(ct,{size:23}):(0,f.jsx)(rt,{size:23})}),(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`operations-macro-kicker`,children:[(0,f.jsx)(`span`,{children:v?`PRD`:`SPEC`}),(0,f.jsx)(`i`,{}),(0,f.jsx)(`span`,{children:Ht(Wt(y,c),t)})]}),(0,f.jsx)(`h2`,{children:y.title}),(0,f.jsx)(`p`,{title:y.id,children:y.id})]})]}),v&&r?(0,f.jsxs)(`button`,{className:`operations-macro-document-open`,onClick:()=>{n(),r(a.id)},type:`button`,children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:16}),t===`pt-BR`?`Ler PRD completo`:`Read full PRD`]}):null,(0,f.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,className:`operations-macro-close`,onClick:n,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20})})]}),(0,f.jsxs)(`div`,{className:`operations-macro-dialog-scroll`,ref:d,children:[e===`PRD`&&p!==null?(0,f.jsxs)(`button`,{className:`operations-macro-back`,onClick:()=>_(null),type:`button`,children:[(0,f.jsx)(We,{"aria-hidden":`true`,size:16}),(0,f.jsxs)(`span`,{children:[t===`pt-BR`?`Voltar ao PRD`:`Back to PRD`,(0,f.jsx)(`small`,{children:a.title})]})]}):null,(0,f.jsx)(Ct,{locale:t,usage:St(y)}),(0,f.jsx)(Kt,{locale:t,row:y}),v?(0,f.jsx)(Jt,{locale:t,onSelectSpec:_,specs:h,tasks:c}):(0,f.jsx)(Yt,{locale:t,onOpenTrace:i,row:y,tasks:b,...e===`PRD`?{parentPrd:a}:{}})]})]})})}function Kt({locale:e,row:t}){return(0,f.jsx)(`dl`,{className:`operations-macro-overview-cards`,children:[{icon:(0,f.jsx)(dt,{size:17}),label:`Tasks`,value:t.task_count},{icon:(0,f.jsx)(pt,{size:17}),label:`Runs`,value:t.run_count},{icon:(0,f.jsx)(st,{size:17}),label:e===`pt-BR`?`Execuções`:`Executions`,value:t.execution_count},{icon:(0,f.jsx)(Xe,{size:17}),label:e===`pt-BR`?`Estado`:`State`,value:qt(t.lifecycle_status,e)}].map(e=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,f.jsx)(`dt`,{children:e.label}),(0,f.jsx)(`dd`,{children:e.value})]},e.label))})}function qt(e,t){return{"pt-BR":{draft:`Rascunho`,planned:`Planejado`,ready:`Pronto`,active:`Ativo`,executing:`Em execução`,verifying:`Em verificação`,delivered:`Entregue`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`},"en-US":{draft:`Draft`,planned:`Planned`,ready:`Ready`,active:`Active`,executing:`Executing`,verifying:`Verifying`,delivered:`Delivered`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`}}[t][e]??e}function Jt({locale:e,onSelectSpec:t,specs:n,tasks:r}){return(0,f.jsxs)(`section`,{className:`operations-macro-section operations-prd-specs`,children:[(0,f.jsx)(Xt,{count:n.length,description:e===`pt-BR`?`Selecione uma SPEC para ver suas Tasks e abrir a rastreabilidade completa.`:`Select a SPEC to see its Tasks and open the complete trace.`,icon:(0,f.jsx)(qe,{size:19}),title:e===`pt-BR`?`SPECs deste PRD`:`SPECs in this PRD`}),n.length>0?(0,f.jsx)(`div`,{className:`operations-prd-spec-grid`,children:n.map((n,i)=>(0,f.jsxs)(`button`,{onClick:()=>t(n),type:`button`,children:[(0,f.jsx)(`span`,{className:`operations-prd-spec-index`,children:String(i+1).padStart(2,`0`)}),(0,f.jsxs)(`div`,{className:`operations-prd-spec-copy`,children:[(0,f.jsx)(`span`,{children:Ht(Wt(n,r),e)}),(0,f.jsx)(`strong`,{children:n.title}),(0,f.jsx)(`code`,{title:n.id,children:n.id})]}),(0,f.jsx)(wt,{locale:e,usage:St(n)}),(0,f.jsxs)(`span`,{className:`operations-prd-spec-action`,children:[(0,f.jsxs)(`small`,{children:[n.task_count,` Tasks`]}),(0,f.jsx)(Ge,{"aria-hidden":`true`,size:18})]})]},n.id))}):(0,f.jsx)(Zt,{text:e===`pt-BR`?`Este PRD ainda não possui SPEC vinculada.`:`This PRD does not have a linked SPEC yet.`})]})}function Yt({locale:e,onOpenTrace:t,parentPrd:n,row:r,tasks:i}){return(0,f.jsxs)(f.Fragment,{children:[n?(0,f.jsxs)(`div`,{className:`operations-spec-parent`,children:[(0,f.jsx)(ct,{"aria-hidden":`true`,size:16}),(0,f.jsx)(`span`,{children:e===`pt-BR`?`Parte do PRD`:`Part of PRD`}),(0,f.jsx)(`strong`,{children:n.title})]}):null,(0,f.jsxs)(`section`,{className:`operations-macro-section operations-spec-tasks`,children:[(0,f.jsx)(Xt,{count:i.length,description:e===`pt-BR`?`Cada Task mantém sua telemetria e leva ao Trace completo do ciclo.`:`Each Task preserves its telemetry and opens the full lifecycle trace.`,icon:(0,f.jsx)(pt,{size:19}),title:e===`pt-BR`?`Fluxo de Tasks`:`Task flow`}),i.length>0?(0,f.jsx)(`div`,{className:`operations-spec-task-list`,children:i.map(({id:n,task:r,usage:i},a)=>(0,f.jsxs)(`button`,{onClick:()=>t(n),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-spec-task-sequence`,children:[(0,f.jsx)(`i`,{}),String(a+1).padStart(2,`0`)]}),(0,f.jsxs)(`div`,{className:`operations-spec-task-copy`,children:[(0,f.jsx)(`span`,{children:r?Et(r.status,e):`Task`}),(0,f.jsx)(`strong`,{children:r?.title??n}),(0,f.jsx)(`code`,{title:n,children:n})]}),(0,f.jsx)(wt,{locale:e,usage:i??xt}),(0,f.jsxs)(`span`,{className:`operations-spec-task-action`,children:[e===`pt-BR`?`Abrir Trace`:`Open Trace`,(0,f.jsx)(Ge,{"aria-hidden":`true`,size:17})]})]},n))}):(0,f.jsx)(Zt,{text:e===`pt-BR`?`Esta SPEC ainda não possui Task materializada.`:`This SPEC does not have a materialized Task yet.`})]}),(0,f.jsxs)(`div`,{className:`operations-macro-document`,children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:17}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e===`pt-BR`?`Documento registrado`:`Registered document`}),(0,f.jsx)(`code`,{title:r.artifact_path,children:r.artifact_path})]})]})]})}function Xt({count:e,description:t,icon:n,title:r}){return(0,f.jsxs)(`header`,{className:`operations-macro-section-heading`,children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h3`,{children:r}),(0,f.jsx)(`p`,{children:t})]}),(0,f.jsx)(`strong`,{children:e})]})}function Zt({text:e}){return(0,f.jsxs)(`div`,{className:`operations-macro-empty`,children:[(0,f.jsx)(rt,{"aria-hidden":`true`,size:21}),(0,f.jsx)(`p`,{children:e})]})}function Qt(e,t=new Date){let n=e.reduce((e,t)=>Math.min(e,Date.parse(t.created_at)),1/0),r=Number.isFinite(n)?new Date(n):t;return r.setDate(r.getDate()-1),{start:cn(r),end:cn(t)}}function $t(e,t=new Date){let n=rn(t),r=rn(t);if(e===`yesterday`)return r=an(n,-1),nn(r,r);if(e===`this-week`)return nn(an(n,-sn(n)),n);if(e===`last-week`){let e=an(n,-sn(n));return nn(an(e,-7),an(e,-1))}return e===`this-month`?nn(new Date(n.getFullYear(),n.getMonth(),1,12),n):e===`last-month`?nn(new Date(n.getFullYear(),n.getMonth()-1,1,12),new Date(n.getFullYear(),n.getMonth(),0,12)):e===`last-3-months`?nn(on(n,-3),n):e===`last-6-months`?nn(on(n,-6),n):e===`this-year`?nn(new Date(n.getFullYear(),0,1,12),n):e===`last-year`?nn(new Date(n.getFullYear()-1,0,1,12),new Date(n.getFullYear()-1,11,31,12)):nn(n,n)}function en(e,t){return tn(e,t)}function tn(e,t){if(e==null)return!1;let n=new Date(e);if(Number.isNaN(n.getTime()))return!1;let r=cn(n);return r>=t.start&&r<=t.end}function nn(e,t){return{start:cn(e),end:cn(t)}}function rn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12)}function an(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function on(e,t){let n=e.getDate(),r=new Date(e.getFullYear(),e.getMonth()+t,1,12),i=new Date(r.getFullYear(),r.getMonth()+1,0,12).getDate();return r.setDate(Math.min(n,i)),r}function sn(e){return(e.getDay()+6)%7}function cn(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var ln={"pt-BR":{all:`Todo o Período`,custom:`Personalizado`,today:`Hoje`,yesterday:`Ontem`,"this-week":`Esta Semana`,"last-week":`Semana Passada`,"this-month":`Este Mês`,"last-month":`Mês Passado`,"last-3-months":`Últimos 3 meses`,"last-6-months":`Últimos 6 meses`,"this-year":`Este Ano`,"last-year":`Último ano`},"en-US":{all:`All Time`,custom:`Custom`,today:`Today`,yesterday:`Yesterday`,"this-week":`This Week`,"last-week":`Last Week`,"this-month":`This Month`,"last-month":`Last Month`,"last-3-months":`Last 3 months`,"last-6-months":`Last 6 months`,"this-year":`This Year`,"last-year":`Last year`}},un=Object.keys(ln[`pt-BR`]);function dn({ariaLabelSuffix:e=``,dateRange:t,defaultDateRange:n,locale:r,onDateRangeChange:i,onPresetChange:a,preset:o}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Data inicial`:`Start date`}),(0,f.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data inicial`:`Start date`}${e}`,onInput:e=>{let n=e.currentTarget.value;i({start:n,end:n>t.end?n:t.end})},type:`date`,value:t.start})]}),(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Data final`:`End date`}),(0,f.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data final`:`End date`}${e}`,onInput:e=>{let n=e.currentTarget.value;i({start:n<t.start?n:t.start,end:n})},type:`date`,value:t.end})]}),(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-period-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Período`:`Period`}),(0,f.jsx)(`select`,{"aria-label":`${r===`pt-BR`?`Período`:`Period`}${e}`,onChange:e=>{let r=e.target.value;if(r===`all`){a(r,n);return}if(r===`custom`){a(r,t);return}a(r,$t(r))},value:o,children:un.map(e=>(0,f.jsx)(`option`,{value:e,children:ln[r][e]},e))})]})]})}var fn={definition:`#a78bfa`,planning:`#3f6fbd`,ready:`#38bdf8`,executing:`#fbbf24`,verifying:`#f87171`,completed:`#34d399`,blocked:`#64748b`,cancelled:`#64748b`,failed:`#64748b`},pn={lite:`#60a5fa`,standard:`#fbbf24`,critical:`#f87171`},mn={empty:`#60a5fa`,structured:`#fbbf24`,rework:`#f87171`};function hn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function gn(e){let t=null;for(let n of e){if(n.created_at===null)continue;let e=Date.parse(n.created_at);Number.isNaN(e)||(t===null||e>t.timestamp)&&(t={value:n.created_at,timestamp:e})}return t?.value??null}function _n(e,t,n){let r=new Map(e.map(e=>[e.id,{id:e.id,title:e.title,durationMs:null,tokens:null,costBrl:null,runCount:0}]));for(let e of t){if(e.phase!==`execution`||e.parent_run_id!==null||e.task_id===null)continue;let t=r.get(e.task_id);if(t===void 0)continue;t.runCount+=1,e.duration_ms!==null&&(t.durationMs=(t.durationMs??0)+e.duration_ms),e.usage.total.tokens.total!==null&&(t.tokens=(t.tokens??0)+e.usage.total.tokens.total);let i=n?n(e.id):e.usage.total.cost.brl;i!==null&&(t.costBrl=(t.costBrl??0)+i)}return[...r.values()]}function vn(e,t,n){return e.map(e=>{let r=new Set(e.run_ids),i=t.filter(t=>t.phase===`execution`&&(r.has(t.id)||(e.kind===`spec`?t.spec_id===e.id:t.prd_id===e.id)));return{id:e.id,title:e.title,durationMs:xn(i.map(e=>e.duration_ms)),tokens:xn(i.map(e=>e.usage.total.tokens.total)),costBrl:xn(i.map(e=>n?n(e.id):e.usage.total.cost.brl)),runCount:i.length}})}function yn(e,t){let n=t===`pt-BR`;return[{key:`empty`,label:n?`Sem tarefas`:`Without tasks`,color:mn.empty,count:e.filter(e=>e.task_count===0).length},{key:`structured`,label:n?`Com tarefas`:`With tasks`,color:mn.structured,count:e.filter(e=>e.task_count>0&&e.rework_run_count===0).length},{key:`rework`,label:n?`Com retrabalho`:`With rework`,color:mn.rework,count:e.filter(e=>e.rework_run_count>0).length}]}function bn(e,t){let n=e.reduce((e,t)=>e+(t.durationMs??0),0),r=t.reduce((e,t)=>e+(t.durationMs??0),0);return{durationMs:n,durationShare:r===0?0:n/r,runCount:e.reduce((e,t)=>e+t.runCount,0),tokens:xn(e.map(e=>e.tokens)),costBrl:xn(e.map(e=>e.costBrl))}}function xn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function Sn({label:e,value:t,hint:n,featured:r=!1,onSelect:i}){let a=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:t}),(0,f.jsx)(`small`,{children:n})]});return i===void 0?(0,f.jsx)(`article`,{className:`operations-kpi${r?` is-featured`:``}`,children:a}):(0,f.jsx)(`button`,{"aria-pressed":r,className:`operations-kpi is-selectable${r?` is-featured`:``}`,onClick:i,type:`button`,children:a})}function Cn(e){let t=e===`pt-BR`;return{overview:t?`Visão geral`:`Overview`,tasks:t?`Tarefas`:`Tasks`,completedTasks:t?`concluídas`:`completed`,completedSpecs:t?`concluídas`:`completed`,completedPrds:t?`concluídos`:`completed`,totalExecutionTime:t?`Tempo total de execução`:`Total execution time`,totalRuns:t?`runs totais`:`total runs`,cost:t?`Custo`:`Cost`,showTerminal:t?`Mostrar canceladas, bloqueadas e falhadas`:`Show cancelled, blocked, and failed`,hideTerminal:t?`Esconder canceladas, bloqueadas e falhadas`:`Hide cancelled, blocked, and failed`,statusHint:t?`Distribuição atual do fluxo`:`Current workflow distribution`,averageTime:t?`Tempo médio`:`Average time`,averageTokens:t?`Tokens médios`:`Average tokens`,averageCost:t?`Custo médio`:`Average cost`,topHint:t?`Maiores durações acumuladas`:`Longest accumulated durations`,accumulatedTime:t?`Tempo acumulado`:`Accumulated time`,associatedRuns:t?`runs associadas`:`associated runs`,concentration:t?`Concentração`:`Concentration`,totalMeasuredTime:t?`do tempo total medido`:`of total measured time`,topFiveCost:t?`Custo do Top 5`:`Top 5 cost`,tokensUnavailable:t?`Tokens indisponíveis`:`Tokens unavailable`}}function wn(e){let t=new Set;for(let n of e){let e=new Date(n.started_at);Number.isNaN(e.getTime())||t.add(`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`)}return t.size}function Tn(e,t,n,r){if(e<=0||t<=0||n<=0)return r===`pt-BR`?`Médias de execução indisponíveis`:`Execution averages unavailable`;let i=Re(e/t,r),a=ze(e/n),o=r===`pt-BR`?`${n} dias`:`${n} ${n===1?`day`:`days`}`;return r===`pt-BR`?`${i} / tarefa (${a} / dia) (${o})`:`${i} / task (${a} / day) (${o})`}function En(e,t){let n=t===`pt-BR`;if(e===`tasks`)return{statusTitle:n?`Status das tarefas`:`Task status`,classificationTitle:n?`Classificação de Tarefa`:`Task classification`,classificationHint:n?`Mix por criticidade`:`Criticality mix`,averageTitle:n?`Média por tarefa`:`Average per task`,averageHint:n?`Runs agregadas`:`Runs aggregated per task`,latestLabel:n?`Última tarefa criada`:`Latest task created`,topTitle:n?`Top 5 tarefas`:`Top 5 tasks`,shortPlural:`tasks`,emptyTop:n?`Nenhuma tarefa com duração registrada.`:`No task has a recorded duration.`};let r=e===`specs`,i=r?`SPEC`:`PRD`,a=r?`SPECs`:`PRDs`;return{statusTitle:n?`Status das ${a}`:`${i} status`,classificationTitle:n?`Classificação de ${i}`:`${i} classification`,classificationHint:n?`Estrutura da entrega`:`Delivery structure`,averageTitle:n?`Média por ${i}`:`Average per ${i}`,averageHint:n?`Runs agregadas por ${i}`:`Runs aggregated per ${i}`,latestLabel:n?`Última ${i} criada`:`Latest ${i} created`,topTitle:`Top 5 ${a}`,shortPlural:a,emptyTop:n?`Nenhuma ${i} com duração registrada.`:`No ${i} has a recorded duration.`}}var Dn=new Set([`cancelled`,`failed`]);function On(e,t){return new Intl.NumberFormat(t,{style:`currency`,currency:`BRL`,maximumFractionDigits:0}).format(e)}function kn({data:e,locale:t,onOpenTask:n,prds:r=e.prds,runs:i=e.runs,specs:a=e.specs,tasks:o=e.tasks,resolveRunCostBrl:s}){let[c,u]=(0,l.useState)(`tasks`),[d,p]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),g=o.filter(e=>e.status===`completed`).length,_=a.filter(e=>e.work_status===`completed`).length,v=r.filter(e=>e.work_status===`completed`).length,y=o.length===0?0:g/o.length,b=a.length===0?0:_/a.length,x=r.length===0?0:v/r.length,S=En(c,t),C=Cn(t),w=c===`specs`?a:r,T=c===`tasks`?o.length:w.length,E=c===`tasks`?_n(o,i,s):vn(w,i,s),ee=hn(E.map(e=>e.durationMs)),te=Mn(o,t),ne=Nn(w,o,t),j=c===`tasks`?te:ne,M=j.reduce((e,t)=>e+t.count,0),N=Object.entries(pn).map(([e,n])=>({key:e,label:Dt(e,t),color:n,count:o.filter(t=>t.risk===e).length})),ie=c===`tasks`?N:yn(w,t),P=i.filter(e=>e.phase===`execution`),ae=P.reduce((e,t)=>e+(t.duration_ms??0),0),F=wn(P),I=i.reduce((e,t)=>e+(t.usage.total.tokens.total??0),0),L=i.reduce((e,t)=>e+(s?s(t.id)??0:t.usage.total.cost.brl??0),0),oe=ae>0?L*36e5/ae:null,se=o.length>0?L/o.length:null,ce=o.length>0?I/o.length:null,le=ae>0?I*36e5/ae:null,ue=hn(E.map(e=>e.tokens)),de=hn(E.map(e=>e.costBrl)),fe=gn(c===`tasks`?o:w),pe=[[C.averageTime,ee===null?`—`:D(ee,t)],[C.averageTokens,O(ue,t)],[C.averageCost,k(de,`BRL`,t)]],me=E.filter(e=>e.durationMs!==null).sort((e,t)=>(t.durationMs??0)-(e.durationMs??0)).slice(0,5),he=Math.max(1,...me.map(e=>e.durationMs??0)),ge=bn(me,E),_e=e=>{u(e),p(null),h(null)};return(0,f.jsxs)(`section`,{"aria-label":C.overview,className:`operations-overview`,children:[(0,f.jsxs)(`div`,{className:`operations-kpi-grid`,children:[(0,f.jsx)(Sn,{featured:c===`tasks`,hint:`${g} ${C.completedTasks} (${A(y,t)})`,label:C.tasks,onSelect:()=>_e(`tasks`),value:String(o.length)}),(0,f.jsx)(Sn,{featured:c===`specs`,hint:`${_} ${C.completedSpecs} (${A(b,t)})`,label:`SPECs`,onSelect:()=>_e(`specs`),value:String(a.length)}),(0,f.jsx)(Sn,{featured:c===`prds`,hint:`${v} ${C.completedPrds} (${A(x,t)})`,label:`PRDs`,onSelect:()=>_e(`prds`),value:String(r.length)}),(0,f.jsx)(Sn,{hint:Tn(ae,o.length,F,t),label:C.totalExecutionTime,value:ae===0?`—`:ze(ae)}),(0,f.jsx)(Sn,{hint:ce===null||le===null?t===`pt-BR`?`Tokens por tarefa e por hora indisponíveis`:`Tokens per task and hour unavailable`:t===`pt-BR`?`${O(ce,t)} / tarefa (${O(le,t,0)} / hora)`:`${O(ce,t)} / task (${O(le,t,0)} / hour)`,label:t===`pt-BR`?`Tokens gastos`:`Spent tokens`,value:O(I,t)}),(0,f.jsx)(Sn,{hint:oe===null||se===null?t===`pt-BR`?`Custo por tarefa e por hora indisponível`:`Cost per task and hour unavailable`:t===`pt-BR`?`${On(se,t)} / tarefa (${On(oe,t)} / hora)`:`${On(se,t)} / task (${On(oe,t)} / hour)`,label:t===`pt-BR`?`Custo Estimado`:`Estimated cost`,value:On(L,t)})]}),(0,f.jsxs)(`div`,{className:`operations-chart-grid`,children:[(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-wide`,children:[(0,f.jsx)(jn,{hint:C.statusHint,title:S.statusTitle}),(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-stacked-bar`,children:j.map(e=>(0,f.jsx)(`i`,{style:{background:e.color,flexGrow:e.count,display:e.count===0?`none`:void 0}},e.key))}),(0,f.jsx)(`div`,{className:`operations-legend-grid`,children:j.map(e=>{let n=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`i`,{style:{background:e.color}}),(0,f.jsx)(`span`,{children:e.label}),(0,f.jsxs)(`span`,{className:`operations-legend-value`,children:[(0,f.jsx)(`strong`,{children:e.count}),(0,f.jsx)(`small`,{children:A(M===0?0:e.count/M,t)})]})]});return c===`tasks`?(0,f.jsx)(`button`,{"aria-label":`${e.label}: ${e.count}, ${A(M===0?0:e.count/M,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>p(e.key),type:`button`,children:n},e.key):(0,f.jsx)(`div`,{className:`operations-legend-row`,children:n},e.key)})})]}),(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-risk`,children:[(0,f.jsx)(jn,{hint:S.classificationHint,title:S.classificationTitle}),(0,f.jsxs)(`div`,{className:`operations-donut-wrap`,children:[(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-donut`,style:{background:Pn(ie,Math.max(T,1))}}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:T}),(0,f.jsx)(`span`,{children:S.shortPlural})]})]}),(0,f.jsx)(`div`,{className:`operations-legend-grid`,children:ie.map(e=>{let n=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`i`,{style:{background:e.color}}),(0,f.jsx)(`span`,{children:e.label}),(0,f.jsxs)(`span`,{className:`operations-legend-value`,children:[(0,f.jsx)(`strong`,{children:e.count}),(0,f.jsx)(`small`,{children:A(T===0?0:e.count/T,t)})]})]});return c===`tasks`?(0,f.jsx)(`button`,{"aria-label":`${e.label}: ${e.count}, ${A(T===0?0:e.count/T,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>h(e.key),type:`button`,children:n},e.key):(0,f.jsx)(`div`,{className:`operations-legend-row`,children:n},e.key)})})]}),(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-type${t===`en-US`?` is-en-us`:``}`,children:[(0,f.jsx)(jn,{hint:S.averageHint,title:S.averageTitle}),(0,f.jsx)(`div`,{className:`operations-type-summary`,children:pe.map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:t})]},e))}),(0,f.jsxs)(`footer`,{className:`operations-latest-task-created`,children:[(0,f.jsx)(`span`,{children:S.latestLabel}),(0,f.jsx)(`strong`,{children:fe===null?`—`:re(fe,t)})]})]}),(0,f.jsxs)(`article`,{className:`operations-panel`,children:[(0,f.jsx)(jn,{hint:C.topHint,title:S.topTitle}),me.length>0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`operations-run-bars`,children:me.map((e,r)=>(0,f.jsxs)(`button`,{"aria-label":t===`pt-BR`?`Abrir detalhes da tarefa ${e.title}`:`Open details for task ${e.title}`,className:`operations-run-bar`,disabled:c!==`tasks`,onClick:()=>void n(e.id),title:`${e.title}: ${D(e.durationMs,t)}`,type:`button`,children:[(0,f.jsx)(`strong`,{children:e.durationMs==null?`—`:D(e.durationMs,t)}),(0,f.jsx)(`i`,{style:{height:`${Math.max(8,(e.durationMs??0)/he*100)}%`}}),(0,f.jsx)(`span`,{children:`#${r+1} ${e.id.slice(-4)}`})]},e.id))}),(0,f.jsxs)(`div`,{className:`operations-top-task-metrics`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.accumulatedTime}),(0,f.jsx)(`strong`,{children:D(ge.durationMs,t)}),(0,f.jsx)(`small`,{children:`${ge.runCount} ${C.associatedRuns}`})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.concentration}),(0,f.jsx)(`strong`,{children:A(ge.durationShare,t)}),(0,f.jsx)(`small`,{children:C.totalMeasuredTime})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.topFiveCost}),(0,f.jsx)(`strong`,{children:k(ge.costBrl,`BRL`,t)}),(0,f.jsx)(`small`,{children:ge.tokens===null?C.tokensUnavailable:`${O(ge.tokens,t)} tokens`})]})]})]}):(0,f.jsx)(`p`,{className:`operations-empty`,children:S.emptyTop})]})]}),d===null?null:(0,f.jsx)(An,{eyebrow:t===`pt-BR`?`Status das tarefas`:`Task status`,label:Ht(d,t),locale:t,onClose:()=>p(null),onOpenTask:e=>{p(null),n(e)},tasks:o.filter(e=>Ut(e)===d)}),m===null?null:(0,f.jsx)(An,{eyebrow:t===`pt-BR`?`Risco das tarefas`:`Task risk`,label:Dt(m,t),locale:t,onClose:()=>h(null),onOpenTask:e=>{h(null),n(e)},tasks:o.filter(e=>e.risk===m)})]})}function An({eyebrow:e,label:t,locale:n,onClose:r,onOpenTask:i,tasks:a}){let o=n===`pt-BR`?a.length===1?`tarefa`:`tarefas`:a.length===1?`task`:`tasks`;return(0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&r()},open:!0,children:(0,f.jsxs)(`section`,{"aria-label":`${t} — ${a.length} ${o}`,"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`h2`,{children:t}),(0,f.jsxs)(`p`,{children:[a.length,` `,o]})]}),(0,f.jsx)(`button`,{"aria-label":n===`pt-BR`?`Fechar`:`Close`,onClick:r,type:`button`,children:`×`})]}),(0,f.jsxs)(`div`,{className:`operations-status-task-list`,children:[a.map(e=>(0,f.jsxs)(`button`,{onClick:()=>i(e.id),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]}),(0,f.jsx)(`span`,{className:`operations-risk is-${e.risk}`,children:Dt(e.risk,n)}),(0,f.jsxs)(`span`,{className:`operations-status-task-action`,children:[n===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},e.id)),a.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Nenhuma tarefa neste status.`:`No tasks in this status.`}):null]})]})})}function jn({title:e,hint:t,action:n}){return(0,f.jsxs)(`header`,{className:`operations-panel-header`,children:[(0,f.jsxs)(`div`,{className:`operations-panel-header-title`,children:[(0,f.jsx)(`h2`,{children:e}),n]}),(0,f.jsx)(`small`,{children:t})]})}function Mn(e,t){return Lt.filter(e=>!Dn.has(e)).map(n=>({key:n,label:Ht(n,t),color:fn[n],count:e.filter(e=>Ut(e)===n).length}))}function Nn(e,t,n){return Lt.filter(e=>!Dn.has(e)).map(r=>({key:r,label:Ht(r,n),color:fn[r],count:e.filter(e=>Wt(e,t)===r).length}))}function Pn(e,t){let n=0,r=e.map(e=>{let r=n+e.count/t*100,i=`${e.color} ${n}% ${r}%`;return n=r,i});return n===0?`rgba(36, 52, 72, 0.86)`:`conic-gradient(${r.join(`, `)})`}function Fn(e,t,n){let r=new Map,i=new Map,a=In(e.runs,t),o=e=>{let t=r.get(e);if(t!==void 0)return t;let n={key:e,prds:0,specs:0,tasks:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};return r.set(e,n),i.set(e,new Set),n},s=e=>{let n=Hn(e,t);return n===null?null:o(n)};for(let t of e.prds){let e=s(t.created_at);e!==null&&(e.prds+=1)}for(let t of e.specs){let e=s(t.created_at);e!==null&&(e.specs+=1)}for(let t of e.tasks){let e=s(t.created_at);if(e===null)continue;e.tasks+=1,e.tests+=t.test_count??0;let n=i.get(e.key);for(let e of t.result?.evidence_ids??[])n?.add(e)}for(let t of e.runs){let e=s(t.started_at);e!==null&&(e.runs+=1,e.tokens=zn(e.tokens,t.usage.total.tokens.total),e.costBrl=zn(e.costBrl,n===void 0?t.usage.total.cost.brl:n(t.id)))}for(let[e,t]of i){let n=r.get(e);n!==void 0&&(n.evidences=t.size)}for(let[e,t]of a)o(e).durationMs=t;return[...r.values()].sort((e,t)=>t.key.localeCompare(e.key))}function In(e,t){let n=new Map;for(let r of e){if(r.phase!==void 0&&r.phase!==`execution`&&r.phase!==`conversation`||r.parent_run_id!==void 0&&r.parent_run_id!==null||r.duration_ms===null||r.duration_ms<=0)continue;let e=Hn(r.started_at,t);e!==null&&n.set(e,(n.get(e)??0)+r.duration_ms)}return n}function Ln(e){let t={prds:0,specs:0,tasks:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};for(let n of e)t.prds+=n.prds,t.specs+=n.specs,t.tasks+=n.tasks,t.runs+=n.runs,t.tests+=n.tests,t.evidences+=n.evidences,t.durationMs=zn(t.durationMs,n.durationMs),t.tokens=zn(t.tokens,n.tokens),t.costBrl=zn(t.costBrl,n.costBrl);return t}function Rn(e){let t=e.length;return{tasks:t===0?null:e.reduce((e,t)=>e+t.tasks,0)/t,specs:t===0?null:e.reduce((e,t)=>e+t.specs,0)/t,prds:t===0?null:e.reduce((e,t)=>e+t.prds,0)/t,durationMs:Vn(e.map(e=>e.durationMs),t),tokens:Bn(e.map(e=>e.tokens)),costBrl:Bn(e.map(e=>e.costBrl))}}function zn(e,t){return t===null?e:(e??0)+t}function Bn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function Vn(e,t){return t===0?null:e.reduce((e,t)=>e+(t??0),0)/t}function Hn(e,t){if(e===null)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;let r=String(n.getFullYear());if(t===`year`)return r;let i=String(n.getMonth()+1).padStart(2,`0`);return t===`month`?`${r}-${i}`:`${r}-${i}-${String(n.getDate()).padStart(2,`0`)}`}function Un({data:e,granularity:t,locale:n,resolveRunCostBrl:r}){let i=Fn(e,t,r),a=Ln(i),o=Rn(i),s=n===`pt-BR`?`Total geral`:`Grand total`;return(0,f.jsxs)(`div`,{className:`operations-period-summary`,children:[(0,f.jsx)(j,{ariaLabel:Wn(t,n),metrics:[{label:Gn(n===`pt-BR`?`Tarefas`:`Tasks`,t,n),value:ne(o.tasks,n,1)},{label:Gn(`SPECs`,t,n),value:ne(o.specs,n,1)},{label:Gn(`PRDs`,t,n),value:ne(o.prds,n,1)},{label:Gn(n===`pt-BR`?`Tempo`:`Time`,t,n),value:te(o.durationMs,n)},{label:Gn(`Tokens`,t,n),value:O(o.tokens,n)},{label:Gn(n===`pt-BR`?`Custo`:`Cost`,t,n),value:k(o.costBrl,`BRL`,n)}]}),(0,f.jsx)(C,{columns:[{key:`period`,label:qn(t,n),render:e=>(0,f.jsx)(`strong`,{children:Jn(e.key,t,n)}),footer:s,sortValue:e=>e.key},Kn(`prds`,`PRDs`,a.prds),Kn(`specs`,`SPECs`,a.specs),Kn(`tasks`,`Tasks`,a.tasks),Kn(`runs`,`Runs`,a.runs),Kn(`tests`,n===`pt-BR`?`Testes`:`Tests`,a.tests),Kn(`evidences`,n===`pt-BR`?`Evidências`:`Evidence`,a.evidences),{key:`duration`,label:n===`pt-BR`?`Tempo`:`Time`,align:`right`,render:e=>D(e.durationMs),footer:D(a.durationMs),sortValue:e=>e.durationMs},{key:`tokens`,label:`Tokens`,align:`right`,render:e=>O(e.tokens),footer:O(a.tokens),sortValue:e=>e.tokens},{key:`cost`,label:n===`pt-BR`?`Custos`:`Costs`,align:`right`,render:e=>k(e.costBrl,`BRL`),footer:k(a.costBrl,`BRL`),sortValue:e=>e.costBrl}],emptyMessage:n===`pt-BR`?`Nenhum dado disponível para o período selecionado.`:`No data available for the selected period.`,defaultSort:{key:`period`,direction:`desc`},locale:n,rowKey:e=>e.key,rows:i,sortable:!0,showColumnInfo:!0})]})}function Wn(e,t){return t===`en-US`?e===`day`?`Daily averages`:e===`month`?`Monthly averages`:`Annual averages`:e===`day`?`Médias por dia`:e===`month`?`Médias por mês`:`Médias por ano`}function Gn(e,t,n){return n===`en-US`?`${e} ${t===`day`?`Daily average`:t===`month`?`Monthly average`:`Annual average`}`:`${e} ${t===`day`?`Médio por dia`:t===`month`?`Médio por mês`:`Médio por ano`}`}function Kn(e,t,n){return{key:e,label:t,align:`right`,render:t=>t[e],footer:n,sortValue:t=>t[e]}}function qn(e,t){return t===`en-US`?e===`day`?`Day`:e===`month`?`Month`:`Year`:e===`day`?`Dia`:e===`month`?`Mês`:`Ano`}function Jn(e,t,n){if(t===`month`||t===`year`)return e;let r=new Date(`${e}T12:00:00`);return new Intl.DateTimeFormat(n,{...t===`day`?{day:`2-digit`}:{},month:t===`day`?`2-digit`:`long`,year:`numeric`}).format(r)}function Yn({allSpecs:e,allTasks:t,changes:n,locale:r,onOpenPrdDocument:i,onOpenTask:a,prds:o,runs:s,specs:c,tasks:u}){let d=Mt(),[p,m]=(0,l.useState)(`task`),[h,g]=(0,l.useState)(null),[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(``),x=(0,l.useMemo)(()=>Pt(s),[s]),S=(0,l.useMemo)(()=>nr([...o.map(e=>({kind:`prd`,row:e})),...c.map(e=>({kind:`spec`,row:e})),...u.map(e=>({kind:`task`,row:e}))].filter(e=>Rt(e,p))),[o,c,u,p]),C=(0,l.useMemo)(()=>new Map([...o,...c].map(n=>[n.id,zt(n,e,t)])),[e,t,o,c]),w=h===null?[]:S.filter(e=>tr(e,t)===h),T=e=>{g(null),e.kind===`task`?a(e.row.id):v(e.row)};return(0,f.jsxs)(`section`,{className:`operations-unified-work`,children:[(0,f.jsx)(Xn,{locale:r,onChange:m,value:p}),(0,f.jsx)(`section`,{"aria-label":r===`pt-BR`?`Kanban de trabalho`:`Work Kanban`,className:`operations-board operations-work-board`,children:Lt.map(e=>(0,f.jsx)(Zn,{changes:n,items:S.filter(n=>tr(n,t)===e),locale:r,nowMs:d,onOpenColumn:()=>{b(``),g(e)},onOpenItem:T,progressByMacro:C,stage:e,totalsByTask:x},e))}),h?(0,f.jsx)(er,{items:w,locale:r,onClose:()=>g(null),onOpenItem:T,onQueryChange:b,query:y,stage:h}):null,_?(0,f.jsx)(Gt,{label:_.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>v(null),onOpenDocument:i,onOpenTrace:e=>{v(null),a(e)},row:_,runs:s,specs:e,tasks:t}):null]})}function Xn({locale:e,onChange:t,value:n}){let r=e===`pt-BR`?{task:`Todas as Tarefas`,all:`Visão Unificada Geral`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Tarefas Avulsas`}:{task:`All Tasks`,all:`Unified Overview`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Standalone Tasks`};return(0,f.jsx)(`nav`,{"aria-label":e===`pt-BR`?`Filtrar tipo de trabalho`:`Filter work type`,className:`operations-work-type-filters`,children:[`task`,`all`,`prd`,`spec`,`standalone-task`].map(e=>(0,f.jsx)(`button`,{className:n===e?`is-active`:void 0,onClick:()=>t(e),type:`button`,children:r[e]},e))})}function Zn({changes:e,items:t,locale:n,nowMs:r,onOpenColumn:i,onOpenItem:a,progressByMacro:o,stage:s,totalsByTask:c}){let{hasMore:l,sentinelRef:u,visibleCount:d}=Nt(t.length);return(0,f.jsxs)(`article`,{className:`operations-column is-${s}`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsx)(`button`,{className:`operations-column-trigger`,onClick:i,type:`button`,children:Ht(s,n)}),(0,f.jsx)(`button`,{"aria-label":`${t.length} — ${Ht(s,n)}`,className:`operations-column-count`,onClick:i,type:`button`,children:t.length})]}),(0,f.jsxs)(`div`,{className:`operations-column-body`,children:[t.slice(0,d).map(t=>(0,f.jsx)(Qn,{changes:e,item:t,locale:n,nowMs:r,onOpen:()=>a(t),progress:o.get(t.row.id),stage:s,totalsByTask:c},t.row.id)),t.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Sem itens`:`No items`}):null,l?(0,f.jsxs)(`div`,{className:`operations-infinite-sentinel`,ref:u,children:[d,` de `,t.length,` · carregando mais…`]}):null]})]})}function Qn({changes:e,item:t,locale:n,nowMs:r,onOpen:i,progress:a,stage:o,totalsByTask:s}){let c=Ne(t.row.created_at,rr(o),n,r),l=t.kind===`task`?t.row:null,u=t.kind===`task`?null:t.row,d=l?kt(l,e):t.kind,p=d===`task`?`Tarefa Avulsa`:t.kind.toUpperCase(),m=l?s.get(l.id):null,h=u?[u.duration_ms,u.usage.total.tokens.total,u.usage.total.cost.brl]:[m?.durationMs??null,m?.tokens??null,m?.costBrl??null];return(0,f.jsxs)(`button`,{className:`operations-task-card operations-work-card is-kind-${d}`,onClick:i,type:`button`,children:[(0,f.jsx)(`span`,{className:`operations-work-kind is-${t.kind}`,children:p}),l?(0,f.jsx)(`span`,{className:`operations-risk is-${l.risk}`,children:Dt(l.risk,n)}):null,(0,f.jsx)(`strong`,{title:t.row.title,children:t.row.title}),(0,f.jsx)(`small`,{title:t.row.id,children:t.row.id}),t.row.created_at?(0,f.jsx)(`small`,{className:`operations-card-created`,children:Ie(t.row.created_at,n)}):null,c?(0,f.jsx)(`span`,{className:`operations-elapsed-badge${c.alert?` is-alert`:``}`,children:c.label}):null,l?(0,f.jsx)(`span`,{className:`operations-task-origin-badge is-${d}`,children:At(d)}):null,u?(0,f.jsx)(`span`,{className:`operations-work-card-counts`,children:Bt(u.kind,a??{completedSpecs:0,totalSpecs:0,completedTasks:0,totalTasks:0})}):null,(0,f.jsx)(`dl`,{className:`operations-task-usage operations-macro-usage`,children:[[n===`pt-BR`?`Tempo`:`Time`,h[0]==null?`—`:Re(h[0])],[`Tokens`,h[1]==null?`—`:O(h[1])],[n===`pt-BR`?`Custo`:`Cost`,h[2]==null?`—`:k(h[2],`BRL`)]].map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:t})]},e))})]})}function $n(e,t){let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>[e.row.id,e.row.title,e.kind].some(e=>e.toLocaleLowerCase().includes(n))):[...e]}function er({items:e,locale:t,onClose:n,onOpenItem:r,onQueryChange:i,query:a,stage:o}){let s=$n(e,a);return(0,S.createPortal)((0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>e.currentTarget===e.target&&n(),open:!0,children:(0,f.jsxs)(`section`,{"aria-label":Ht(o,t),"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Coluna de trabalho`:`Work column`}),(0,f.jsx)(`h2`,{children:Ht(o,t)}),(0,f.jsxs)(`p`,{children:[e.length,` itens`]})]}),(0,f.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,onClick:n,type:`button`,children:`×`})]}),(0,f.jsxs)(`label`,{className:`operations-status-dialog-search`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Buscar itens`:`Search items`}),(0,f.jsx)(`input`,{autoFocus:!0,onChange:e=>i(e.target.value),placeholder:t===`pt-BR`?`Título, ID ou tipo`:`Title, ID, or type`,type:`search`,value:a})]}),(0,f.jsxs)(`div`,{className:`operations-status-task-list`,children:[s.map(e=>(0,f.jsxs)(`button`,{onClick:()=>r(e),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,f.jsx)(`strong`,{children:e.row.title}),(0,f.jsx)(`small`,{children:e.row.id})]}),(0,f.jsx)(`span`,{className:`operations-work-kind is-${e.kind}`,children:e.kind===`task`?`TASK`:e.kind.toUpperCase()}),(0,f.jsxs)(`span`,{className:`operations-status-task-action`,children:[t===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},`${e.kind}:${e.row.id}`)),s.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:t===`pt-BR`?`Nenhum item encontrado nesta coluna.`:`No items found in this column.`}):null]})]})}),document.body)}function tr(e,t){return e.kind===`task`?Ut(e.row):Wt(e.row,t)}function nr(e){return e.sort((e,t)=>(t.row.created_at??``).localeCompare(e.row.created_at??``)||t.row.id.localeCompare(e.row.id))}function rr(e){return e===`definition`?`draft`:e===`planning`||e===`ready`?`planned`:e===`blocked`?`blocked`:e}function ir({allSpecs:e,allTasks:t,changes:n,locale:r,onOpenPrdDocument:i,onOpenTask:a,prds:o,runs:s,specs:c,tasks:u}){let[d,p]=(0,l.useState)(`task`),[m,h]=(0,l.useState)(null),g=(0,l.useMemo)(()=>ar({allSpecs:e,allTasks:t,changes:n,items:[...o.map(e=>({kind:`prd`,row:e})),...c.map(e=>({kind:`spec`,row:e})),...u.map(e=>({kind:`task`,row:e}))].filter(e=>Rt(e,d)),runs:s}),[e,t,n,o,s,c,u,d]);return(0,f.jsxs)(`section`,{className:`operations-unified-work operations-work-list`,children:[(0,f.jsx)(Xn,{locale:r,onChange:p,value:d}),(0,f.jsx)(`div`,{className:`operations-work-list-table`,children:(0,f.jsx)(C,{columns:[{key:`item`,label:r===`pt-BR`?`Item de trabalho`:`Work item`,render:({item:e,originLabel:t})=>(0,f.jsxs)(`span`,{className:`operations-work-list-identity`,children:[(0,f.jsx)(`span`,{className:`operations-work-kind is-${e.kind}`,children:t}),(0,f.jsx)(`strong`,{children:e.row.title}),(0,f.jsx)(`small`,{children:e.row.id})]}),sortValue:({item:e})=>e.row.title},{key:`status`,label:`Status`,render:({stage:e})=>(0,f.jsx)(`span`,{className:`operations-status is-${e}`,children:Ht(e,r)}),sortValue:({stage:e})=>e},{key:`risk`,label:r===`pt-BR`?`Risco`:`Risk`,render:({risk:e})=>e?(0,f.jsx)(`span`,{className:`operations-risk is-${e}`,children:Dt(e,r)}):`—`,sortValue:({risk:e})=>e},{key:`progress`,label:r===`pt-BR`?`Progresso`:`Progress`,render:({progress:e})=>e,sortValue:({item:e})=>e.kind===`task`?e.row.progress:e.row.quality.task_completion_rate},{key:`runs`,label:`Runs`,description:r===`pt-BR`?`Chamadas do agente orquestrador relacionadas ao item.`:`Orchestrator agent calls related to the item.`,render:({runCount:e})=>e,sortValue:({runCount:e})=>e,align:`right`},{key:`subruns`,label:`Sub-runs`,description:r===`pt-BR`?`Chamadas de subagentes relacionadas ao item.`:`Subagent calls related to the item.`,render:({subrunCount:e})=>e,sortValue:({subrunCount:e})=>e,align:`right`},{key:`executions`,label:r===`pt-BR`?`Execuções`:`Executions`,render:({executionCount:e})=>e,sortValue:({executionCount:e})=>e,align:`right`},{key:`tasks`,label:r===`pt-BR`?`Tarefas`:`Tasks`,render:({taskCount:e})=>e,sortValue:({taskCount:e})=>e,align:`right`},{key:`duration`,label:r===`pt-BR`?`Tempo`:`Time`,render:({durationMs:e})=>e===null?`—`:Re(e),sortValue:({durationMs:e})=>e,align:`right`},{key:`tokens`,label:`Tokens`,render:({tokens:e})=>e===null?`—`:O(e),sortValue:({tokens:e})=>e,align:`right`},{key:`cost`,label:r===`pt-BR`?`Custo`:`Cost`,render:({costBrl:e})=>e===null?`—`:k(e,`BRL`),sortValue:({costBrl:e})=>e,align:`right`}],defaultSort:{key:`item`,direction:`asc`},emptyMessage:r===`pt-BR`?`Nenhum item de trabalho encontrado.`:`No work items found.`,locale:r,onRowClick:({item:e})=>{e.kind===`task`?a(e.row.id):h(e.row)},rowKey:({item:e})=>`${e.kind}:${e.row.id}`,rows:g,scrollLabel:r===`pt-BR`?`Tabela de itens de trabalho com rolagem horizontal para acessar todas as colunas.`:`Work items table with horizontal scrolling to access all columns.`,showColumnInfo:!0,sortable:!0})}),m?(0,f.jsx)(Gt,{label:m.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>h(null),onOpenDocument:i,onOpenTrace:e=>{h(null),a(e)},row:m,runs:s,specs:e,tasks:t}):null]})}function ar({allSpecs:e,allTasks:t,changes:n,items:r,runs:i}){let a=Pt(i);return r.map(r=>{let o=r.kind===`task`?r.row:null,s=r.kind===`task`?null:r.row,c=i.filter(e=>o?e.task_id===o.id:s!==null&&(s.run_ids.includes(e.id)||e.prd_id===s.id||e.spec_id===s.id||e.task_id!==null&&s.task_ids.includes(e.task_id))),l=o?a.get(o.id):null,u=s?zt(s,e,t):null;return{item:r,stage:o?Ut(o)??`planning`:Wt(s,t),originLabel:o?At(kt(o,n)):r.kind.toUpperCase(),risk:o?.risk??null,progress:o?`${Math.round(o.progress)}%`:Bt(s.kind,u),runCount:c.filter(e=>e.run_kind===`run`).length,subrunCount:c.filter(e=>e.run_kind===`subrun`).length,executionCount:o?new Set(c.flatMap(e=>e.execution_id?[e.execution_id]:[])).size:s.execution_count,taskCount:o?1:u.totalTasks,durationMs:o?l?.durationMs??null:s.duration_ms,tokens:o?l?.tokens??null:s.usage.total.tokens.total,costBrl:o?l?.costBrl??null:s.usage.total.cost.brl}})}var or={"pt-BR":{"work-kanban":`Trabalho (Kanban)`,"work-list":`Trabalho (Lista)`,changes:`Mudanças`,executions:`Execuções`,runs:`Chamadas de agentes`,conversations:`Conversas`,decisions:`Decisões`,daily:`Diário`,monthly:`Mensal`,yearly:`Anual`},"en-US":{"work-kanban":`Work (Kanban)`,"work-list":`Work (List)`,changes:`Changes`,executions:`Executions`,runs:`Agent calls`,conversations:`Conversations`,decisions:`Decisions`,daily:`Daily`,monthly:`Monthly`,yearly:`Annual`}};function sr(e,t){let n=e.trim().toLocaleLowerCase();return n.length===0||t.some(e=>e?.toLocaleLowerCase().includes(n))}function cr({alternateContent:e,capabilityNavigation:t,data:n,dashboardTitle:r=`Dashboard Zaip AIOS`,loading:i,locale:a,onLocaleChange:o,onOpenPrdDocument:s,onOpenTask:c,onRefresh:u,repositoryName:d,settings:p,resolveRunCostBrl:h}){let[g,_]=(0,l.useState)(`work-kanban`),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[w,T]=(0,l.useState)(``),[E,ee]=(0,l.useState)(``),[D,te]=(0,l.useState)(``),[O,ne]=(0,l.useState)(!1),k=(0,l.useRef)(null),re=(0,l.useRef)(null),A=(0,l.useMemo)(()=>Qt(n.tasks),[n.tasks]),[j,M]=(0,l.useState)(A),[N,ie]=(0,l.useState)(`all`),P=(0,l.useCallback)(()=>{ne(!0),k.current!==null&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>ne(!1),220)},[]);(0,l.useEffect)(()=>()=>{k.current!==null&&window.clearTimeout(k.current)},[]);let ae=typeof e==`function`?e({query:v,dateRange:j}):e,F=()=>{P(),y(``),T(``),ee(``),te(``),M(A),ie(`all`)},I=e=>{P(),_(e),T(``),ee(``),te(``)},L=ur(n,g),oe=![`decisions`,`daily`,`monthly`,`yearly`].includes(g),se=g===`work-kanban`||g===`work-list`||g===`changes`,ce=g===`work-kanban`||g===`work-list`,le=n.tasks.filter(e=>(!w||Ut(e)===w)&&(!E||e.risk===E)&&jt(e,D,n.changes)&&en(e.created_at,j)&&sr(v,[e.id,e.title,e.short_name,e.objective,e.change_id,e.spec_id])),ue=n.prds.filter(e=>(!w||Wt(e,n.tasks)===w)&&!E&&!D&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.parent_id])),pe=n.specs.filter(e=>(!w||Wt(e,n.tasks)===w)&&!E&&!D&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.parent_id])),me=n.changes.filter(e=>(!w||e.status===w)&&(!E||e.risk===E)&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.source.type,e.artifact_path])),he=n.executions.filter(e=>(!w||e.status===w)&&tn(e.created_at,j)&&sr(v,[e.id,e.status,e.work_status,e.origin.type,e.artifact_path])),_e=n.runs.filter(e=>(!w||e.status===w)&&tn(e.started_at,j)&&sr(v,[e.id,e.task_id,e.spec_id,e.prd_id,e.change_id,e.execution_id,e.conversation_id,e.phase,e.agent,e.agent_name,e.model,e.effective_model])),be=_e.filter(e=>e.phase===`conversation`),xe=n.decisions.filter(e=>tn(e.created_at,j)&&sr(v,[e.id,e.title,e.scope_id,e.scope_type,e.artifact_path])),Se=new Set(le.map(e=>e.id)),Ce=n.runs.filter(e=>tn(e.started_at,j)&&(e.task_id===null||Se.has(e.task_id))&&sr(v,[e.id,e.task_id,e.agent,e.agent_name,e.model,e.effective_model])),we=i||O;return(0,f.jsxs)(`main`,{className:`operations-page`,children:[(0,f.jsx)(m,{filters:(0,f.jsxs)(`div`,{className:`operations-global-filters`,"data-loading":we||void 0,children:[(0,f.jsxs)(`div`,{className:`operations-filter-heading`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:a===`pt-BR`?`Filtrar dashboard`:`Filter dashboard`}),(0,f.jsx)(`small`,{children:a===`pt-BR`?`Os resultados são atualizados automaticamente`:`Results update automatically`})]}),we?(0,f.jsxs)(`span`,{className:`operations-filter-status`,role:`status`,children:[(0,f.jsx)(`i`,{}),` `,a===`pt-BR`?`Atualizando dados`:`Updating data`]}):null]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Tipo`:`Type`}),(0,f.jsx)(`select`,{onChange:e=>I(e.target.value),value:g,children:Object.keys(or[a]).map(e=>(0,f.jsx)(`option`,{value:e,children:or[a][e]},e))})]}),oe?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:`Status`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),T(e.target.value)},value:w,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),L.map(e=>(0,f.jsx)(`option`,{value:e,children:dr(e,a)},e))]})]}):null,se?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Risco`:`Risk`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),ee(e.target.value)},value:E,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),(0,f.jsx)(`option`,{value:`lite`,children:Dt(`lite`,a)}),(0,f.jsx)(`option`,{value:`standard`,children:Dt(`standard`,a)}),(0,f.jsx)(`option`,{value:`critical`,children:Dt(`critical`,a)})]})]}):null,ce?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Origem da tarefa`:`Task origin`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),te(e.target.value)},value:D,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todas`:`All`}),Ot.map(e=>(0,f.jsx)(`option`,{value:e,children:At(e)},e))]})]}):null,(0,f.jsx)(dn,{ariaLabelSuffix:a===`pt-BR`?` nos filtros`:` in filters`,dateRange:j,defaultDateRange:A,locale:a,onDateRangeChange:e=>{P(),M(e),ie(`custom`)},onPresetChange:(e,t)=>{P(),ie(e),M(t)},preset:N}),(0,f.jsxs)(`button`,{className:`operations-clear-filters`,onClick:F,type:`button`,children:[(0,f.jsx)(gr,{}),a===`pt-BR`?`Limpar filtros`:`Clear filters`]})]}),filtersActive:!!(v||w||E||D||j.start!==A.start||j.end!==A.end),lastUpdatedAt:n.summary.source_latest_at,loading:we,locale:a,onLocaleChange:o,onRefresh:u,...d===void 0?{}:{repositoryName:d},settings:p,title:r}),(0,f.jsx)(`h1`,{className:`operations-sr-only`,children:`Operações`}),(0,f.jsxs)(`header`,{className:`operations-hero`,children:[(0,f.jsx)(`div`,{children:(0,f.jsx)(`small`,{className:`operations-last-updated`,children:n.summary.source_latest_at===null?a===`pt-BR`?`Aguardando atualização`:`Waiting for refresh`:`${a===`pt-BR`?`Atualizado`:`Updated`} ${new Intl.DateTimeFormat(a,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(n.summary.source_latest_at))}`})}),(0,f.jsxs)(`div`,{className:`operations-actions`,children:[(0,f.jsx)(`button`,{"aria-label":a===`pt-BR`?`Atualizar`:`Refresh`,className:`operations-nav-icon`,disabled:i,onClick:u,type:`button`,children:(0,f.jsx)(pr,{})}),(0,f.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,f.jsxs)(`button`,{className:`operations-nav-button${b?` is-active`:``}`,onClick:()=>{x(e=>!e),C(!1)},type:`button`,children:[(0,f.jsx)(mr,{}),` `,a===`pt-BR`?`Filtros`:`Filters`]}),b?(0,f.jsxs)(`div`,{className:`operations-nav-popup operations-filter-popup`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Busca`:`Search`}),(0,f.jsx)(`input`,{onChange:e=>y(e.target.value),placeholder:a===`pt-BR`?`ID ou nome de ${or[a][g]}`:`${or[a][g]} ID or name`,value:v})]}),g===`work-kanban`||g===`work-list`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:`Status`}),(0,f.jsxs)(`select`,{onChange:e=>T(e.target.value),value:w,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),Lt.map(e=>(0,f.jsx)(`option`,{value:e,children:Ht(e,a)},e))]})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Risco`:`Risk`}),(0,f.jsxs)(`select`,{onChange:e=>ee(e.target.value),value:E,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),(0,f.jsx)(`option`,{value:`lite`,children:Dt(`lite`,a)}),(0,f.jsx)(`option`,{value:`standard`,children:Dt(`standard`,a)}),(0,f.jsx)(`option`,{value:`critical`,children:Dt(`critical`,a)})]})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Origem da tarefa`:`Task origin`}),(0,f.jsxs)(`select`,{onChange:e=>te(e.target.value),value:D,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todas`:`All`}),Ot.map(e=>(0,f.jsx)(`option`,{value:e,children:At(e)},e))]})]})]}):null,(0,f.jsx)(`button`,{onClick:F,type:`button`,children:a===`pt-BR`?`Limpar filtros`:`Clear filters`})]}):null]}),(0,f.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,f.jsxs)(`button`,{className:`operations-nav-button${S?` is-active`:``}`,onClick:()=>{C(e=>!e),x(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:a}),a===`pt-BR`?`PT-BR`:`EN-US`,(0,f.jsx)(hr,{})]}),S?(0,f.jsxs)(`div`,{className:`operations-nav-popup operations-locale-popup`,children:[(0,f.jsxs)(`button`,{onClick:()=>{o(`pt-BR`),C(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:`pt-BR`}),` Português do Brasil`,a===`pt-BR`?(0,f.jsx)(`span`,{children:`✓`}):null]}),(0,f.jsxs)(`button`,{onClick:()=>{o(`en-US`),C(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:`en-US`}),` English`,a===`en-US`?(0,f.jsx)(`span`,{children:`✓`}):null]})]}):null]})]})]}),we?(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-loading-line`}):null,(0,f.jsxs)(`div`,{"aria-busy":we,className:we?`operations-filtered is-loading`:`operations-filtered`,children:[(0,f.jsx)(kn,{data:n,locale:a,onOpenTask:c,prds:ue,runs:Ce,resolveRunCostBrl:h,specs:pe,tasks:le}),(0,f.jsxs)(`section`,{className:`dashboard-global-controls`,children:[t,(0,f.jsxs)(`div`,{className:`operations-toolbar-filters dashboard-global-filters`,children:[(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-search-field`,children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Busca`:`Search`}),(0,f.jsxs)(`div`,{className:`operations-search-control`,children:[(0,f.jsx)(`input`,{"aria-label":a===`pt-BR`?`Busca`:`Search`,onChange:e=>{P(),y(e.target.value)},placeholder:a===`pt-BR`?`Buscar por nome ou ID`:`Search by name or ID`,ref:re,value:v}),v?(0,f.jsx)(`button`,{"aria-label":a===`pt-BR`?`Limpar busca`:`Clear search`,className:`operations-search-clear`,onClick:()=>{P(),y(``),re.current?.focus()},type:`button`,children:(0,f.jsx)(_r,{})}):null]})]}),(0,f.jsx)(dn,{dateRange:j,defaultDateRange:A,locale:a,onDateRangeChange:e=>{P(),M(e),ie(`custom`)},onPresetChange:(e,t)=>{P(),ie(e),M(t)},preset:N})]})]}),ae??(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`section`,{className:`operations-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":`Entidades do ciclo de trabalho`,children:[`work-kanban`,`work-list`,`executions`,`runs`,`decisions`,`changes`,`conversations`,`daily`,`monthly`,`yearly`].map(e=>(0,f.jsx)(`button`,{className:g===e?`is-active`:void 0,onClick:()=>I(e),type:`button`,children:or[a][e]},e))})}),(0,f.jsxs)(`section`,{className:`operations-content`,children:[g===`work-kanban`?(0,f.jsx)(Yn,{allSpecs:n.specs,allTasks:n.tasks,changes:n.changes,locale:a,onOpenPrdDocument:s,onOpenTask:c,prds:ue,runs:n.runs,specs:pe,tasks:le}):null,g===`work-list`?(0,f.jsx)(ir,{allSpecs:n.specs,allTasks:n.tasks,changes:n.changes,locale:a,onOpenPrdDocument:s,onOpenTask:c,prds:ue,runs:n.runs,specs:pe,tasks:le}):null,g===`changes`?(0,f.jsx)(de,{locale:a,rows:me}):null,g===`executions`?(0,f.jsx)(fe,{locale:a,rows:he}):null,g===`runs`?(0,f.jsx)(ge,{locale:a,rows:_e}):null,g===`conversations`?(0,f.jsx)(ve,{locale:a,rows:be}):null,g===`decisions`?(0,f.jsx)(ye,{locale:a,rows:xe}):null,g===`daily`||g===`monthly`||g===`yearly`?(0,f.jsx)(Un,{data:{prds:ue,runs:_e,specs:pe,tasks:le},granularity:g===`daily`?`day`:g===`monthly`?`month`:`year`,locale:a,resolveRunCostBrl:h}):null]})]})]})]})}var lr=[`draft`,`planned`,`executing`,`verifying`,`completed`,`blocked`,`failed`,`cancelled`];function ur(e,t){if(t===`work-kanban`||t===`work-list`)return[...Lt];let n=t===`changes`?e.changes.map(e=>e.status):t===`executions`?e.executions.map(e=>e.status):t===`runs`?e.runs.map(e=>e.status):t===`conversations`?e.runs.filter(e=>e.phase===`conversation`).map(e=>e.status):[];return[...new Set(n)].sort()}function dr(e,t){if(Lt.includes(e))return Ht(e,t);let n=lr.find(t=>t===e);return n===void 0?e:Et(n,t)}function fr({locale:e}){return e===`pt-BR`?(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,f.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,f.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`})]})}function pr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M20 11a8.1 8.1 0 1 0 2 5.3M20 4v7h-7`})})}function mr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M4 6h16M7 12h10m-7 6h4`})})}function hr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg operations-locale-chevron`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function gr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-reset-icon`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7M3 4v6h6`})})}function _r(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 20 20`,children:(0,f.jsx)(`path`,{d:`m6 6 8 8M14 6l-8 8`})})}function vr({detail:e,locale:t,onClose:n}){let r=t===`pt-BR`;return(0,S.createPortal)((0,f.jsx)(`div`,{className:`operations-prd-document-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&n()},children:(0,f.jsxs)(`section`,{"aria-label":r?`PRD completo`:`Full PRD`,"aria-modal":`true`,className:`operations-prd-document-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`span`,{children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:16}),` PRD`]}),(0,f.jsx)(`h2`,{children:e.title}),(0,f.jsx)(`p`,{children:e.id})]}),(0,f.jsx)(`button`,{"aria-label":r?`Fechar`:`Close`,onClick:n,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20})})]}),(0,f.jsx)(`div`,{className:`operations-prd-document-scroll`,children:(0,f.jsx)(yr,{content:e.body})}),(0,f.jsx)(`footer`,{children:e.artifact_path})]})}),document.body)}function yr({content:e}){return(0,f.jsx)(`article`,{className:`operations-prd-markdown`,children:br(e).map((e,t)=>{let n=`${e.kind}-${t}`;return e.kind===`heading`?(0,f.jsx)(`h${e.level}`,{children:Cr(e.content)},n):e.kind===`paragraph`?(0,f.jsx)(`p`,{children:Cr(e.content)},n):e.kind===`list`?(0,f.jsx)(e.ordered?`ol`:`ul`,{children:e.items.map((e,t)=>(0,f.jsx)(`li`,{children:Cr(e)},t))},n):e.kind===`quote`?(0,f.jsx)(`blockquote`,{children:Cr(e.content)},n):e.kind===`code`?(0,f.jsx)(`pre`,{children:(0,f.jsx)(`code`,{"data-language":e.language??void 0,children:e.content})},n):e.kind===`table`?(0,f.jsx)(`div`,{className:`operations-prd-markdown-table`,children:(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsx)(`tr`,{children:e.headers.map((e,t)=>(0,f.jsx)(`th`,{children:Cr(e)},t))})}),(0,f.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,f.jsx)(`tr`,{children:e.map((e,t)=>(0,f.jsx)(`td`,{children:Cr(e)},t))},t))})]})},n):(0,f.jsx)(`hr`,{},n)})})}function br(e){let t=e.replace(/\r\n/g,`
|
|
10
|
+
`)||`—`],[n.result,e.result??`—`],[n.file,e.artifact_path]]})}function ae({row:e,locale:t}){let n=se(t);return(0,f.jsx)(F,{items:[[n.status,e.status],[n.phase,e.phase],[n.entrypoint,e.entrypoint],[n.type,e.work_type],[t===`pt-BR`?`Tipo da chamada`:`Call type`,e.run_kind===`run`?`Run`:`Sub-Run`],[t===`pt-BR`?`Propósito`:`Purpose`,e.run_purpose],[t===`pt-BR`?`Exige finalizador`:`Requires finalizer`,e.requires_finalizer?`sim`:`não`],[t===`pt-BR`?`Run pai`:`Parent Run`,e.parent_run_id??`—`],[n.client,e.client],[n.agent,e.agent_name],[n.provider,e.provider??`—`],[t===`pt-BR`?`Modelo planejado`:`Planned model`,e.model],[t===`pt-BR`?`Effort planejado`:`Planned effort`,e.reasoning_effort??`—`],[t===`pt-BR`?`Modelo efetivo`:`Effective model`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_model??`—`],[t===`pt-BR`?`Effort efetivo`:`Effective effort`,e.effective_config_mixed?t===`pt-BR`?`Misto`:`Mixed`:e.effective_reasoning_effort??`—`],[`Task`,e.task_id??`—`],[`SPEC`,e.spec_id??`—`],[`PRD`,e.prd_id??`—`],[`Change`,e.change_id??`—`],[`Execution`,e.execution_id??`—`],[n.start,re(e.started_at,t)],[n.end,re(e.finished_at,t)],[n.duration,D(e.duration_ms,t)],[`Tokens`,O(e.usage.total.tokens.total,t)],[n.costBrl,k(e.usage.total.cost.brl,`BRL`,t)],[n.costUsd,k(e.usage.total.cost.usd,`USD`,t)],[n.file,e.artifact_path]]})}function F({items:e}){return(0,f.jsx)(`dl`,{className:`operations-entity-detail-grid`,children:e.map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:t})]},e))})}function I(e){return e.type===`task`?`Task: ${e.task_id}`:e.type===`spec`?`SPEC: ${e.spec_id}`:e.type===`interaction`?`Conversation: ${e.conversation_id}`:`PRD: ${e.prd_id}${`spec_id`in e&&e.spec_id?` · SPEC: ${e.spec_id}`:``}`}function L(e){return e.length===0?`—`:e.join(`, `)}function oe(e,t){return(t===`pt-BR`?{change:`Mudança`,decision:`Decisão`,execution:`Execução`,run:`Run`}:{change:`Change`,decision:`Decision`,execution:`Execution`,run:`Run`})[e]}function se(e){return e===`pt-BR`?{details:`Detalhes de`,status:`Status`,risk:`Risco`,origin:`Origem`,created:`Criada`,tasks:`Tasks`,requirements:`Requisitos`,acceptanceCriteria:`Critérios de aceite`,result:`Resultado`,file:`Arquivo`,scopeType:`Tipo de escopo`,scope:`Escopo`,workStatus:`Status do trabalho`,tasksInDag:`Tasks na DAG`,topologicalOrder:`Ordem topológica`,dependencies:`Dependências`,phase:`Fase`,entrypoint:`Entrada`,type:`Tipo`,client:`Cliente`,agent:`Agente`,provider:`Provider`,model:`Modelo`,start:`Início`,end:`Fim`,duration:`Duração`,costBrl:`Custo BRL`,costUsd:`Custo USD`}:{details:`Details for`,status:`Status`,risk:`Risk`,origin:`Origin`,created:`Created`,tasks:`Tasks`,requirements:`Requirements`,acceptanceCriteria:`Acceptance criteria`,result:`Result`,file:`File`,scopeType:`Scope type`,scope:`Scope`,workStatus:`Work status`,tasksInDag:`Tasks in DAG`,topologicalOrder:`Topological order`,dependencies:`Dependencies`,phase:`Phase`,entrypoint:`Entrypoint`,type:`Type`,client:`Client`,agent:`Agent`,provider:`Provider`,model:`Model`,start:`Start`,end:`End`,duration:`Duration`,costBrl:`Cost BRL`,costUsd:`Cost USD`}}function ce(e){let t=new Map;for(let n of e)n.task_id===null&&t.set(n.conversation_id,[...t.get(n.conversation_id)??[],n]);return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.started_at.localeCompare(e.started_at))[0],r=t.map(e=>e.duration_ms).filter(e=>e!==null);return{id:e,latest_started_at:n.started_at,run_count:t.length,status:n.status,duration_ms:r.length===0?null:r.reduce((e,t)=>e+t,0),models:[...new Set(t.map(e=>e.effective_model??e.model).filter(le))].sort()}}).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function le(e){return e!==null&&e.trim()!==``&&e.toLowerCase()!==`unknown`}function ue(e,t){return e.map((e,n)=>({row:e,index:n,timestamp:Date.parse(t(e)??``)})).sort((e,t)=>{let n=Number.isFinite(e.timestamp)?e.timestamp:-1/0;return(Number.isFinite(t.timestamp)?t.timestamp:-1/0)-n||e.index-t.index}).map(({row:e})=>e)}function de({rows:e,locale:t}){let[n,r]=(0,l.useState)(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C,{columns:[{key:`created`,label:`Criada`,render:e=>re(e.created_at)},{key:`title`,label:`Change`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`risk`,label:`Risco`,render:e=>(0,f.jsx)(xe,{risk:e.risk})},{key:`tasks`,label:`Tasks`,render:e=>e.task_ids.length,align:`right`},{key:`path`,label:`Arquivo`,render:e=>e.artifact_path}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ue(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`change`,row:n},locale:t,onClose:()=>r(null)}):null]})}function fe({rows:e,locale:t}){let[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(`all`),o=ue(e.filter(e=>i===`all`||e.kind===i),e=>e.created_at);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`operations-execution-table`,children:[(0,f.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de execução`:`Execution type`,children:[`all`,`interaction`,`delivery`].map(e=>(0,f.jsx)(`button`,{className:i===e?`is-active`:void 0,onClick:()=>a(e),type:`button`,children:pe(e,t)},e))})}),(0,f.jsx)(C,{columns:[{key:`created`,label:`Data de criação`,render:e=>re(e.created_at)},{key:`id`,label:t===`pt-BR`?`Execução`:`Execution`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:pe(e.kind??`delivery`,t)}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`origin`,label:`Origem`,render:e=>(0,f.jsx)(Se,{entrypoint:e.origin.type===`interaction`?`conversation`:e.origin.type})},{key:`duration`,label:t===`pt-BR`?`Tempo de execução`:`Execution time`,render:e=>D(e.duration_ms),align:`right`},{key:`runs`,label:t===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`,render:e=>me(e.orchestrator_run_count),align:`right`},{key:`subruns`,label:t===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`,render:e=>me(e.subagent_run_count),align:`right`},{key:`finalizers`,label:t===`pt-BR`?`Finalizadores`:`Finalizers`,render:e=>`${me(e.finalized_task_count)}/${me(e.task_count)}`,align:`right`},{key:`tasks`,label:t===`pt-BR`?`Tarefas`:`Tasks`,render:e=>me(e.task_count),align:`right`},{key:`specs`,label:`SPEC`,render:e=>me(e.spec_count),align:`right`},{key:`prds`,label:`PRD`,render:e=>me(e.prd_count),align:`right`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:o,showColumnInfo:!0,sortable:!0})]}),n?(0,f.jsx)(M,{details:{kind:`execution`,row:n},locale:t,onClose:()=>r(null)}):null]})}function pe(e,t){return t===`pt-BR`?e===`all`?`Todas`:e===`interaction`?`Interações`:`Execuções de entrega`:e===`all`?`All`:e===`interaction`?`Interactions`:`Delivery executions`}function me(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function he(e){return e.agent.toLowerCase()===`codex`?`codex`:e.agent_name||e.agent}function ge({rows:e,locale:t}){let[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(`all`),o=ue(e.filter(e=>i===`all`||e.run_kind===i),e=>e.started_at);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`operations-toolbar operations-run-kind-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":t===`pt-BR`?`Tipo de chamada de agente`:`Agent call type`,children:[`all`,`run`,`subrun`].map(e=>(0,f.jsx)(`button`,{className:i===e?`is-active`:void 0,onClick:()=>a(e),type:`button`,children:e===`all`?t===`pt-BR`?`Todas`:`All`:e===`run`?t===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`:t===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`},e))})}),(0,f.jsx)(C,{columns:[{key:`created`,label:`Data de criação`,render:e=>re(e.started_at)},{key:`id`,label:`Run`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.id}),(0,f.jsx)(`small`,{children:e.parent_run_id??e.task_id??e.conversation_id})]})},{key:`kind`,label:t===`pt-BR`?`Tipo`:`Type`,render:e=>e.run_kind===`run`?`Run`:`Sub-Run`},{key:`agent`,label:t===`pt-BR`?`Agente`:`Agent`,render:e=>(0,f.jsx)(`strong`,{children:he(e)})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`origin`,label:t===`pt-BR`?`Origem`:`Origin`,render:e=>(0,f.jsx)(Se,{entrypoint:e.entrypoint})},{key:`phase`,label:t===`pt-BR`?`Propósito`:`Purpose`,render:e=>_e(e.run_purpose,t)},{key:`duration`,label:`Duração`,render:e=>D(e.duration_ms)}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:o,showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`run`,row:n},locale:t,onClose:()=>r(null)}):null]})}function _e(e,t){return t===`pt-BR`?{intake:`Entrada`,orchestration:`Orquestração`,execution:`Execução`,review:`Revisão`,audit:`Auditoria`,finalization:`Finalização`}[e]:e}function ve({rows:e,locale:t}){let n=ce(e);return(0,f.jsx)(C,{columns:[{key:`created`,label:t===`pt-BR`?`Data e hora`:`Date and time`,render:e=>re(e.latest_started_at)},{key:`conversation`,label:t===`pt-BR`?`Conversa`:`Conversation`,render:e=>(0,f.jsx)(`strong`,{children:e.id})},{key:`status`,label:`Status`,render:e=>(0,f.jsx)(be,{status:e.status})},{key:`runs`,label:`Runs`,render:e=>e.run_count,align:`right`},{key:`duration`,label:t===`pt-BR`?`Duração`:`Duration`,render:e=>D(e.duration_ms)},{key:`models`,label:t===`pt-BR`?`Modelos`:`Models`,render:e=>e.models.length>0?e.models.join(`, `):`—`}],locale:t,rowKey:e=>e.id,rows:n,showColumnInfo:!0,sortable:!0})}function ye({rows:e,locale:t}){let[n,r]=(0,l.useState)(null);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C,{columns:[{key:`date`,label:`Data de criação`,render:e=>re(e.created_at)},{key:`title`,label:`Decisão`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`origin`,label:`Origem`,render:e=>(0,f.jsx)(Ce,{origin:e.origin})},{key:`stage`,label:`Fase`,render:e=>(0,f.jsx)(we,{scopeType:e.scope_type})},{key:`scope`,label:`Escopo`,render:e=>`${e.scope_type}: ${e.scope_id}`}],locale:t,rowKey:e=>e.id,onRowClick:r,rows:ue(e,e=>e.created_at),showColumnInfo:!0,sortable:!0}),n?(0,f.jsx)(M,{details:{kind:`decision`,row:n},locale:t,onClose:()=>r(null)}):null]})}function be({status:e}){return(0,f.jsx)(`span`,{className:`operations-table-status is-${e}`,children:e})}function xe({risk:e}){return(0,f.jsx)(`span`,{className:`operations-table-risk is-${e}`,children:e})}function Se({entrypoint:e}){let t=e===`prd`?`PRD`:e===`spec`?`SPEC`:e===`task`?`Tarefa`:`Conversa`;return(0,f.jsx)(`span`,{className:`operations-table-entry is-${e}`,children:t})}function Ce({origin:e}){return(0,f.jsx)(`span`,{className:`operations-table-decision-origin is-${e}`,children:e})}function we({scopeType:e}){let t=e===`change`?`planning`:`execution`;return(0,f.jsx)(`span`,{className:`operations-table-stage is-${t}`,children:t===`planning`?`Planejamento`:`Execução`})}var Te=1e3,Ee=60*Te,De=60*Ee,Oe=24*De,ke=7*Oe,Ae=30*Oe,je=6*De,Me=new Set([`completed`,`blocked`,`failed`,`cancelled`]);function Ne(e,t,n,r=Date.now()){if(e===null||Me.has(t))return null;let i=Date.parse(e);if(!Number.isFinite(i))return null;let a=Math.max(0,r-i),o=t===`executing`||t===`verifying`;return{label:Pe(a,o,n),alert:o&&a>je}}function Pe(e,t,n){let r=n===`pt-BR`?`Há`:`Ago`,i=Fe(e,t,n);return n===`pt-BR`?`${r} ${i}`:`${i} ${r}`}function Fe(e,t,n){let r=Math.max(1,Math.round(e/Te));if(r<60)return`${r} seg`;let i=Math.round(e/Ee);if(i<60)return`${i} min`;let a=Math.round(e/De);if(a<24)return`${a} h`;let o=Math.round(e/Oe);if(t||o<7)return`${o} d`;let s=Math.round(e/ke);if(s<4)return n===`pt-BR`?`${s} sem`:`${s} w`;let c=Math.max(1,Math.round(e/Ae));return n===`pt-BR`?c===1?`1 mês`:`${c} meses`:`${c} mo`}function Ie(e,t){return Le(e,t,t===`pt-BR`?`Criada`:`Created`)}function Le(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?``:`${n} · ${new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(r)}`}function Re(e,t=`pt-BR`){return e>=36e5?`${Math.round(e/36e5)} h`:e>=6e4?`${Math.round(e/6e4)} min`:`${Math.round(e/1e3)} ${t===`pt-BR`?`seg`:`sec`}`}function ze(e){return`${Math.round(e/36e5)} h`}var Be=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ve=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),He={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ue=(0,l.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,l.createElement)(`svg`,{ref:c,...He,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ve(`lucide`,i),...s},[...o.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(a)?a:[a]])),R=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...r},i)=>(0,l.createElement)(Ue,{ref:i,iconNode:t,className:Ve(`lucide-${Be(e)}`,n),...r}));return n.displayName=`${e}`,n},We=R(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ge=R(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ke=R(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),qe=R(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Je=R(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Ye=R(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Xe=R(`CircleDot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ze=R(`CircleGauge`,[[`path`,{d:`M15.6 2.7a10 10 0 1 0 5.7 5.7`,key:`1e0p6d`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M13.4 10.6 19 5`,key:`1kr7tw`}]]),Qe=R(`ClipboardList`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),$e=R(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),et=R(`Coins`,[[`circle`,{cx:`8`,cy:`8`,r:`6`,key:`3yglwk`}],[`path`,{d:`M18.09 10.37A6 6 0 1 1 10.34 18`,key:`t5s6rm`}],[`path`,{d:`M7 6h1v4`,key:`1obek4`}],[`path`,{d:`m16.71 13.88.7.71-2.82 2.82`,key:`1rbuyh`}]]),tt=R(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),nt=R(`FileCheck2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m3 15 2 2 4-4`,key:`1lhrkk`}]]),rt=R(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),it=R(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),at=R(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ot=R(`Gavel`,[[`path`,{d:`m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8`,key:`15492f`}],[`path`,{d:`m16 16 6-6`,key:`vzrcl6`}],[`path`,{d:`m8 8 6-6`,key:`18bi4p`}],[`path`,{d:`m9 7 8 8`,key:`5jnvq1`}],[`path`,{d:`m21 11-8-8`,key:`z4y7zo`}]]),st=R(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),ct=R(`Layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),lt=R(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ut=R(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),dt=R(`ListChecks`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),ft=R(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),pt=R(`Route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),mt=R(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ht=R(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),gt=R(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),_t=R(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),vt=R(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function yt(e,t){return e.filter(e=>e.kind===`spec`&&e.parent_id===t)}function bt(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return e.task_ids.map(e=>({id:e,task:r.get(e)??null,usage:n.get(e)}))}var xt={durationMs:null,tokens:null,costBrl:null};function St(e){return{durationMs:e.duration_ms,tokens:e.usage.total.coverage.tokens>0?e.usage.total.tokens.total:null,costBrl:e.usage.total.coverage.brl>0?e.usage.total.cost.brl:null}}function Ct({locale:e,usage:t}){return(0,f.jsx)(`dl`,{className:`operations-macro-usage-strip`,children:[{icon:(0,f.jsx)($e,{size:17}),label:e===`pt-BR`?`Tempo total`:`Total time`,value:t.durationMs===null?`—`:Re(t.durationMs,e)},{icon:(0,f.jsx)(vt,{size:17}),label:`Tokens`,value:O(t.tokens,e)},{icon:(0,f.jsx)(et,{size:17}),label:e===`pt-BR`?`Custo`:`Cost`,value:k(t.costBrl,`BRL`,e)}].map(e=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,f.jsx)(`dt`,{children:e.label}),(0,f.jsx)(`dd`,{children:e.value})]},e.label))})}function wt({locale:e,usage:t}){let n=[t.durationMs===null?`—`:Re(t.durationMs,e),O(t.tokens,e),k(t.costBrl,`BRL`,e)];return(0,f.jsx)(`dl`,{className:`operations-macro-mini-usage`,children:(e===`pt-BR`?[`Tempo`,`Tokens`,`Custo`]:[`Time`,`Tokens`,`Cost`]).map((e,t)=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:n[t]})]},e))})}var Tt={"en-US":{draft:`Definition (PRD + Requirements)`,planned:`Planned (SPEC + Changes)`,executing:`Executing (Tasks)`,verifying:`Verifying (Tests + Review)`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`},"pt-BR":{draft:`Definição (PRD + Requisitos)`,planned:`Planejamento (SPEC + Mudanças)`,executing:`Execução (Tarefas)`,verifying:`Verificação (Testes + Revisão)`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`}};function Et(e,t){return Tt[t][e]}function Dt(e,t){return t===`en-US`?e===`lite`?`Lite`:e===`standard`?`Standard`:`Critical`:e===`lite`?`Leve`:e===`standard`?`Padrão`:`Crítico`}var Ot=[`task`,`spec`,`prd`];function kt(e,t){return t.find(t=>t.id===e.change_id)?.source.type??(e.spec_id===null?`task`:`spec`)}function At(e){return e===`task`?`Task-first`:e===`spec`?`SPEC`:`PRD`}function jt(e,t,n){return t===``||kt(e,n)===t}function Mt(){let[e,t]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let e=window.setInterval(()=>t(Date.now()),1e3);return()=>window.clearInterval(e)},[]),e}function Nt(e){let[t,n]=(0,l.useState)(30),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let i=r.current;if(i===null||t>=e)return;let a=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&n(t=>Math.min(e,t+30))},{rootMargin:`320px 0px`});return a.observe(i),()=>a.disconnect()},[e,t]),{hasMore:t<e,sentinelRef:r,visibleCount:Math.min(t,e)}}function Pt(e){let t=new Map;for(let n of e){if(n.task_id===null||n.execution_id===null)continue;let e=t.get(n.task_id)??{durationMs:null,tokens:null,costBrl:null};t.set(n.task_id,{durationMs:Ft(e.durationMs,n.duration_ms),tokens:Ft(e.tokens,n.usage.total.tokens.total),costBrl:Ft(e.costBrl,n.usage.total.cost.brl)})}return t}function Ft(e,t){return e===null&&t===null?null:(e??0)+(t??0)}function It(e){return e.status===`planned`&&e.spec_id===null&&e.attempt_count===0&&e.started_at===null&&e.execution_started===!1}var Lt=[`definition`,`planning`,`ready`,`executing`,`verifying`,`completed`,`blocked`,`cancelled`,`failed`];function Rt(e,t){return t===`task`?e.kind===`task`:t===`standalone-task`?e.kind===`task`&&e.row.spec_id===null:t===`all`?e.kind===`prd`?!0:e.kind===`spec`?e.row.parent_id===null:e.row.spec_id===null:e.kind===t}function zt(e,t,n){let r=e.kind===`prd`?t.filter(t=>t.parent_id===e.id):[],i=new Set(r.map(e=>e.id)),a=new Set(e.task_ids);if(e.kind===`spec`)for(let t of n)t.spec_id===e.id&&a.add(t.id);else{for(let e of r)for(let t of e.task_ids)a.add(t);for(let e of n)e.spec_id!==null&&i.has(e.spec_id)&&a.add(e.id)}let o=n.filter(e=>a.has(e.id));return{completedSpecs:r.filter(Vt).length,totalSpecs:r.length,completedTasks:o.filter(e=>e.status===`completed`).length,totalTasks:o.length}}function Bt(e,t){let n=`Tasks ${t.completedTasks}/${t.totalTasks}`;return e===`prd`?`SPECs ${t.completedSpecs}/${t.totalSpecs} · ${n}`:n}function Vt(e){return e.lifecycle_status===`delivered`||e.work_status===`completed`}function Ht(e,t){return{"pt-BR":{definition:`Definição (PRD + Requisitos)`,planning:`Planejamento (SPEC + Change)`,ready:`Pronto para Executar`,executing:`Execução`,verifying:`Verificação`,completed:`Concluído`,blocked:`Bloqueado`,cancelled:`Cancelado`,failed:`Falhado`},"en-US":{definition:`Definition (PRDs)`,planning:`Planning`,ready:`Ready to Execute`,executing:`Executing`,verifying:`Verifying`,completed:`Completed`,blocked:`Blocked`,cancelled:`Cancelled`,failed:`Failed`}}[t][e]}function Ut(e){return e.status===`completed`?`completed`:e.status===`cancelled`?`cancelled`:e.status===`failed`?`failed`:e.status===`blocked`?`blocked`:e.is_active===!0||e.status===`executing`?`executing`:e.status===`verifying`?`verifying`:(e.attempt_count??0)>0||e.started_at!=null||e.execution_started===!0?`executing`:It(e)?`ready`:null}function Wt(e,t){if(e.lifecycle_status===`cancelled`||e.work_status===`cancelled`)return`cancelled`;if(e.work_status===`failed`)return`failed`;if(e.work_status===`blocked`)return`blocked`;if(e.lifecycle_status===`delivered`||e.work_status===`completed`)return`completed`;if(e.is_active||t.some(t=>e.task_ids.includes(t.id)&&t.is_active))return`executing`;if(e.lifecycle_status===`verifying`||e.work_status===`verifying`)return`verifying`;if(e.work_status===`executing`){let n=t.filter(t=>e.task_ids.includes(t.id));return n.some(e=>e.status===`verifying`)&&n.every(e=>e.status===`verifying`||e.status===`completed`)?`verifying`:`executing`}return e.lifecycle_status===`active`?`executing`:e.lifecycle_status===`ready`?`ready`:e.kind===`prd`&&e.lifecycle_status===`draft`?`definition`:`planning`}function Gt({label:e,locale:t,onClose:n,onOpenDocument:r,onOpenTrace:i,row:a,runs:o,specs:s,tasks:c}){let u=(0,l.useRef)(null),d=(0,l.useRef)(null),[p,m]=(0,l.useState)(e===`SPEC`?a:null),h=(0,l.useMemo)(()=>yt(s,a.id),[a.id,s]),g=(0,l.useMemo)(()=>Pt(o),[o]);(0,l.useEffect)(()=>{let e=u.current;if(e!==null)return e.open||e.showModal(),()=>{e.open&&e.close()}},[]);let _=e=>{d.current?.scrollTo({top:0}),m(e)},v=e===`PRD`&&p===null,y=p??a,b=bt(y,c,g);return(0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop operations-macro-dialog-backdrop`,onCancel:e=>{e.preventDefault(),n()},onMouseDown:e=>{e.currentTarget===e.target&&n()},ref:u,children:(0,f.jsxs)(`section`,{"aria-label":`${t===`pt-BR`?`Detalhes do`:`Details for`} ${e}`,"aria-modal":`true`,className:`operations-macro-planning-dialog`,"data-kind":v?`prd`:`spec`,role:`dialog`,children:[(0,f.jsxs)(`header`,{className:`operations-macro-dialog-header`,children:[(0,f.jsxs)(`div`,{className:`operations-macro-heading`,children:[(0,f.jsx)(`span`,{className:`operations-macro-heading-icon`,"aria-hidden":`true`,children:v?(0,f.jsx)(ct,{size:23}):(0,f.jsx)(rt,{size:23})}),(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`operations-macro-kicker`,children:[(0,f.jsx)(`span`,{children:v?`PRD`:`SPEC`}),(0,f.jsx)(`i`,{}),(0,f.jsx)(`span`,{children:Ht(Wt(y,c),t)})]}),(0,f.jsx)(`h2`,{children:y.title}),(0,f.jsx)(`p`,{title:y.id,children:y.id})]})]}),r?(0,f.jsxs)(`button`,{className:`operations-macro-document-open`,onClick:()=>{n(),r(y.kind,y.id)},type:`button`,children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:16}),t===`pt-BR`?`Ler ${v?`PRD`:`SPEC`} completa`:`Read full ${v?`PRD`:`SPEC`}`]}):null,(0,f.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,className:`operations-macro-close`,onClick:n,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20})})]}),(0,f.jsxs)(`div`,{className:`operations-macro-dialog-scroll`,ref:d,children:[e===`PRD`&&p!==null?(0,f.jsxs)(`button`,{className:`operations-macro-back`,onClick:()=>_(null),type:`button`,children:[(0,f.jsx)(We,{"aria-hidden":`true`,size:16}),(0,f.jsxs)(`span`,{children:[t===`pt-BR`?`Voltar ao PRD`:`Back to PRD`,(0,f.jsx)(`small`,{children:a.title})]})]}):null,(0,f.jsx)(Ct,{locale:t,usage:St(y)}),(0,f.jsx)(Kt,{locale:t,row:y}),v?(0,f.jsx)(Jt,{locale:t,onSelectSpec:_,specs:h,tasks:c}):(0,f.jsx)(Yt,{locale:t,onOpenTrace:i,row:y,tasks:b,...e===`PRD`?{parentPrd:a}:{}})]})]})})}function Kt({locale:e,row:t}){return(0,f.jsx)(`dl`,{className:`operations-macro-overview-cards`,children:[{icon:(0,f.jsx)(dt,{size:17}),label:`Tasks`,value:t.task_count},{icon:(0,f.jsx)(pt,{size:17}),label:`Runs`,value:t.run_count},{icon:(0,f.jsx)(st,{size:17}),label:e===`pt-BR`?`Execuções`:`Executions`,value:t.execution_count},{icon:(0,f.jsx)(Xe,{size:17}),label:e===`pt-BR`?`Estado`:`State`,value:qt(t.lifecycle_status,e)}].map(e=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),(0,f.jsx)(`dt`,{children:e.label}),(0,f.jsx)(`dd`,{children:e.value})]},e.label))})}function qt(e,t){return{"pt-BR":{draft:`Rascunho`,planned:`Planejado`,ready:`Pronto`,active:`Ativo`,executing:`Em execução`,verifying:`Em verificação`,delivered:`Entregue`,completed:`Concluído`,blocked:`Bloqueado`,failed:`Falhado`,cancelled:`Cancelado`},"en-US":{draft:`Draft`,planned:`Planned`,ready:`Ready`,active:`Active`,executing:`Executing`,verifying:`Verifying`,delivered:`Delivered`,completed:`Completed`,blocked:`Blocked`,failed:`Failed`,cancelled:`Cancelled`}}[t][e]??e}function Jt({locale:e,onSelectSpec:t,specs:n,tasks:r}){return(0,f.jsxs)(`section`,{className:`operations-macro-section operations-prd-specs`,children:[(0,f.jsx)(Xt,{count:n.length,description:e===`pt-BR`?`Selecione uma SPEC para ver suas Tasks e abrir a rastreabilidade completa.`:`Select a SPEC to see its Tasks and open the complete trace.`,icon:(0,f.jsx)(qe,{size:19}),title:e===`pt-BR`?`SPECs deste PRD`:`SPECs in this PRD`}),n.length>0?(0,f.jsx)(`div`,{className:`operations-prd-spec-grid`,children:n.map((n,i)=>(0,f.jsxs)(`button`,{onClick:()=>t(n),type:`button`,children:[(0,f.jsx)(`span`,{className:`operations-prd-spec-index`,children:String(i+1).padStart(2,`0`)}),(0,f.jsxs)(`div`,{className:`operations-prd-spec-copy`,children:[(0,f.jsx)(`span`,{children:Ht(Wt(n,r),e)}),(0,f.jsx)(`strong`,{children:n.title}),(0,f.jsx)(`code`,{title:n.id,children:n.id})]}),(0,f.jsx)(wt,{locale:e,usage:St(n)}),(0,f.jsxs)(`span`,{className:`operations-prd-spec-action`,children:[(0,f.jsxs)(`small`,{children:[n.task_count,` Tasks`]}),(0,f.jsx)(Ge,{"aria-hidden":`true`,size:18})]})]},n.id))}):(0,f.jsx)(Zt,{text:e===`pt-BR`?`Este PRD ainda não possui SPEC vinculada.`:`This PRD does not have a linked SPEC yet.`})]})}function Yt({locale:e,onOpenTrace:t,parentPrd:n,row:r,tasks:i}){return(0,f.jsxs)(f.Fragment,{children:[n?(0,f.jsxs)(`div`,{className:`operations-spec-parent`,children:[(0,f.jsx)(ct,{"aria-hidden":`true`,size:16}),(0,f.jsx)(`span`,{children:e===`pt-BR`?`Parte do PRD`:`Part of PRD`}),(0,f.jsx)(`strong`,{children:n.title})]}):null,(0,f.jsxs)(`section`,{className:`operations-macro-section operations-spec-tasks`,children:[(0,f.jsx)(Xt,{count:i.length,description:e===`pt-BR`?`Cada Task mantém sua telemetria e leva ao Trace completo do ciclo.`:`Each Task preserves its telemetry and opens the full lifecycle trace.`,icon:(0,f.jsx)(pt,{size:19}),title:e===`pt-BR`?`Fluxo de Tasks`:`Task flow`}),i.length>0?(0,f.jsx)(`div`,{className:`operations-spec-task-list`,children:i.map(({id:n,task:r,usage:i},a)=>(0,f.jsxs)(`button`,{onClick:()=>t(n),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-spec-task-sequence`,children:[(0,f.jsx)(`i`,{}),String(a+1).padStart(2,`0`)]}),(0,f.jsxs)(`div`,{className:`operations-spec-task-copy`,children:[(0,f.jsx)(`span`,{children:r?Et(r.status,e):`Task`}),(0,f.jsx)(`strong`,{children:r?.title??n}),(0,f.jsx)(`code`,{title:n,children:n})]}),(0,f.jsx)(wt,{locale:e,usage:i??xt}),(0,f.jsxs)(`span`,{className:`operations-spec-task-action`,children:[e===`pt-BR`?`Abrir Trace`:`Open Trace`,(0,f.jsx)(Ge,{"aria-hidden":`true`,size:17})]})]},n))}):(0,f.jsx)(Zt,{text:e===`pt-BR`?`Esta SPEC ainda não possui Task materializada.`:`This SPEC does not have a materialized Task yet.`})]}),(0,f.jsxs)(`div`,{className:`operations-macro-document`,children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:17}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e===`pt-BR`?`Documento registrado`:`Registered document`}),(0,f.jsx)(`code`,{title:r.artifact_path,children:r.artifact_path})]})]})]})}function Xt({count:e,description:t,icon:n,title:r}){return(0,f.jsxs)(`header`,{className:`operations-macro-section-heading`,children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h3`,{children:r}),(0,f.jsx)(`p`,{children:t})]}),(0,f.jsx)(`strong`,{children:e})]})}function Zt({text:e}){return(0,f.jsxs)(`div`,{className:`operations-macro-empty`,children:[(0,f.jsx)(rt,{"aria-hidden":`true`,size:21}),(0,f.jsx)(`p`,{children:e})]})}function Qt(e,t=new Date){let n=e.reduce((e,t)=>Math.min(e,Date.parse(t.created_at)),1/0),r=Number.isFinite(n)?new Date(n):t;return r.setDate(r.getDate()-1),{start:cn(r),end:cn(t)}}function $t(e,t=new Date){let n=rn(t),r=rn(t);if(e===`yesterday`)return r=an(n,-1),nn(r,r);if(e===`this-week`)return nn(an(n,-sn(n)),n);if(e===`last-week`){let e=an(n,-sn(n));return nn(an(e,-7),an(e,-1))}return e===`this-month`?nn(new Date(n.getFullYear(),n.getMonth(),1,12),n):e===`last-month`?nn(new Date(n.getFullYear(),n.getMonth()-1,1,12),new Date(n.getFullYear(),n.getMonth(),0,12)):e===`last-3-months`?nn(on(n,-3),n):e===`last-6-months`?nn(on(n,-6),n):e===`this-year`?nn(new Date(n.getFullYear(),0,1,12),n):e===`last-year`?nn(new Date(n.getFullYear()-1,0,1,12),new Date(n.getFullYear()-1,11,31,12)):nn(n,n)}function en(e,t){return tn(e,t)}function tn(e,t){if(e==null)return!1;let n=new Date(e);if(Number.isNaN(n.getTime()))return!1;let r=cn(n);return r>=t.start&&r<=t.end}function nn(e,t){return{start:cn(e),end:cn(t)}}function rn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12)}function an(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function on(e,t){let n=e.getDate(),r=new Date(e.getFullYear(),e.getMonth()+t,1,12),i=new Date(r.getFullYear(),r.getMonth()+1,0,12).getDate();return r.setDate(Math.min(n,i)),r}function sn(e){return(e.getDay()+6)%7}function cn(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var ln={"pt-BR":{all:`Todo o Período`,custom:`Personalizado`,today:`Hoje`,yesterday:`Ontem`,"this-week":`Esta Semana`,"last-week":`Semana Passada`,"this-month":`Este Mês`,"last-month":`Mês Passado`,"last-3-months":`Últimos 3 meses`,"last-6-months":`Últimos 6 meses`,"this-year":`Este Ano`,"last-year":`Último ano`},"en-US":{all:`All Time`,custom:`Custom`,today:`Today`,yesterday:`Yesterday`,"this-week":`This Week`,"last-week":`Last Week`,"this-month":`This Month`,"last-month":`Last Month`,"last-3-months":`Last 3 months`,"last-6-months":`Last 6 months`,"this-year":`This Year`,"last-year":`Last year`}},un=Object.keys(ln[`pt-BR`]);function dn({ariaLabelSuffix:e=``,dateRange:t,defaultDateRange:n,locale:r,onDateRangeChange:i,onPresetChange:a,preset:o}){return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Data inicial`:`Start date`}),(0,f.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data inicial`:`Start date`}${e}`,onInput:e=>{let n=e.currentTarget.value;i({start:n,end:n>t.end?n:t.end})},type:`date`,value:t.start})]}),(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-date-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Data final`:`End date`}),(0,f.jsx)(`input`,{"aria-label":`${r===`pt-BR`?`Data final`:`End date`}${e}`,onInput:e=>{let n=e.currentTarget.value;i({start:n<t.start?n:t.start,end:n})},type:`date`,value:t.end})]}),(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-period-field`,children:[(0,f.jsx)(`span`,{children:r===`pt-BR`?`Período`:`Period`}),(0,f.jsx)(`select`,{"aria-label":`${r===`pt-BR`?`Período`:`Period`}${e}`,onChange:e=>{let r=e.target.value;if(r===`all`){a(r,n);return}if(r===`custom`){a(r,t);return}a(r,$t(r))},value:o,children:un.map(e=>(0,f.jsx)(`option`,{value:e,children:ln[r][e]},e))})]})]})}var fn={definition:`#a78bfa`,planning:`#3f6fbd`,ready:`#38bdf8`,executing:`#fbbf24`,verifying:`#f87171`,completed:`#34d399`,blocked:`#64748b`,cancelled:`#64748b`,failed:`#64748b`},pn={lite:`#60a5fa`,standard:`#fbbf24`,critical:`#f87171`},mn={empty:`#60a5fa`,structured:`#fbbf24`,rework:`#f87171`};function hn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function gn(e){let t=null;for(let n of e){if(n.created_at===null)continue;let e=Date.parse(n.created_at);Number.isNaN(e)||(t===null||e>t.timestamp)&&(t={value:n.created_at,timestamp:e})}return t?.value??null}function _n(e,t,n){let r=new Map(e.map(e=>[e.id,{id:e.id,title:e.title,durationMs:null,tokens:null,costBrl:null,runCount:0}]));for(let e of t){if(e.phase!==`execution`||e.parent_run_id!==null||e.task_id===null)continue;let t=r.get(e.task_id);if(t===void 0)continue;t.runCount+=1,e.duration_ms!==null&&(t.durationMs=(t.durationMs??0)+e.duration_ms),e.usage.total.tokens.total!==null&&(t.tokens=(t.tokens??0)+e.usage.total.tokens.total);let i=n?n(e.id):e.usage.total.cost.brl;i!==null&&(t.costBrl=(t.costBrl??0)+i)}return[...r.values()]}function vn(e,t,n){return e.map(e=>{let r=new Set(e.run_ids),i=t.filter(t=>t.phase===`execution`&&(r.has(t.id)||(e.kind===`spec`?t.spec_id===e.id:t.prd_id===e.id)));return{id:e.id,title:e.title,durationMs:xn(i.map(e=>e.duration_ms)),tokens:xn(i.map(e=>e.usage.total.tokens.total)),costBrl:xn(i.map(e=>n?n(e.id):e.usage.total.cost.brl)),runCount:i.length}})}function yn(e,t){let n=t===`pt-BR`;return[{key:`empty`,label:n?`Sem tarefas`:`Without tasks`,color:mn.empty,count:e.filter(e=>e.task_count===0).length},{key:`structured`,label:n?`Com tarefas`:`With tasks`,color:mn.structured,count:e.filter(e=>e.task_count>0&&e.rework_run_count===0).length},{key:`rework`,label:n?`Com retrabalho`:`With rework`,color:mn.rework,count:e.filter(e=>e.rework_run_count>0).length}]}function bn(e,t){let n=e.reduce((e,t)=>e+(t.durationMs??0),0),r=t.reduce((e,t)=>e+(t.durationMs??0),0);return{durationMs:n,durationShare:r===0?0:n/r,runCount:e.reduce((e,t)=>e+t.runCount,0),tokens:xn(e.map(e=>e.tokens)),costBrl:xn(e.map(e=>e.costBrl))}}function xn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function Sn({label:e,value:t,hint:n,featured:r=!1,onSelect:i}){let a=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:t}),(0,f.jsx)(`small`,{children:n})]});return i===void 0?(0,f.jsx)(`article`,{className:`operations-kpi${r?` is-featured`:``}`,children:a}):(0,f.jsx)(`button`,{"aria-pressed":r,className:`operations-kpi is-selectable${r?` is-featured`:``}`,onClick:i,type:`button`,children:a})}function Cn(e){let t=e===`pt-BR`;return{overview:t?`Visão geral`:`Overview`,tasks:t?`Tarefas`:`Tasks`,completedTasks:t?`concluídas`:`completed`,completedSpecs:t?`concluídas`:`completed`,completedPrds:t?`concluídos`:`completed`,totalExecutionTime:t?`Tempo total de execução`:`Total execution time`,totalRuns:t?`runs totais`:`total runs`,cost:t?`Custo`:`Cost`,showTerminal:t?`Mostrar canceladas, bloqueadas e falhadas`:`Show cancelled, blocked, and failed`,hideTerminal:t?`Esconder canceladas, bloqueadas e falhadas`:`Hide cancelled, blocked, and failed`,statusHint:t?`Distribuição atual do fluxo`:`Current workflow distribution`,averageTime:t?`Tempo médio`:`Average time`,averageTokens:t?`Tokens médios`:`Average tokens`,averageCost:t?`Custo médio`:`Average cost`,topHint:t?`Maiores durações acumuladas`:`Longest accumulated durations`,accumulatedTime:t?`Tempo acumulado`:`Accumulated time`,associatedRuns:t?`runs associadas`:`associated runs`,concentration:t?`Concentração`:`Concentration`,totalMeasuredTime:t?`do tempo total medido`:`of total measured time`,topFiveCost:t?`Custo do Top 5`:`Top 5 cost`,tokensUnavailable:t?`Tokens indisponíveis`:`Tokens unavailable`}}function wn(e){let t=new Set;for(let n of e){let e=new Date(n.started_at);Number.isNaN(e.getTime())||t.add(`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`)}return t.size}function Tn(e,t,n,r){if(e<=0||t<=0||n<=0)return r===`pt-BR`?`Médias de execução indisponíveis`:`Execution averages unavailable`;let i=Re(e/t,r),a=ze(e/n),o=r===`pt-BR`?`${n} dias`:`${n} ${n===1?`day`:`days`}`;return r===`pt-BR`?`${i} / tarefa (${a} / dia) (${o})`:`${i} / task (${a} / day) (${o})`}function En(e,t){let n=t===`pt-BR`;if(e===`tasks`)return{statusTitle:n?`Status das tarefas`:`Task status`,classificationTitle:n?`Classificação de Tarefa`:`Task classification`,classificationHint:n?`Mix por criticidade`:`Criticality mix`,averageTitle:n?`Média por tarefa`:`Average per task`,averageHint:n?`Runs agregadas`:`Runs aggregated per task`,latestLabel:n?`Última tarefa criada`:`Latest task created`,topTitle:n?`Top 5 tarefas`:`Top 5 tasks`,shortPlural:`tasks`,emptyTop:n?`Nenhuma tarefa com duração registrada.`:`No task has a recorded duration.`};let r=e===`specs`,i=r?`SPEC`:`PRD`,a=r?`SPECs`:`PRDs`;return{statusTitle:n?`Status das ${a}`:`${i} status`,classificationTitle:n?`Classificação de ${i}`:`${i} classification`,classificationHint:n?`Estrutura da entrega`:`Delivery structure`,averageTitle:n?`Média por ${i}`:`Average per ${i}`,averageHint:n?`Runs agregadas por ${i}`:`Runs aggregated per ${i}`,latestLabel:n?`Última ${i} criada`:`Latest ${i} created`,topTitle:`Top 5 ${a}`,shortPlural:a,emptyTop:n?`Nenhuma ${i} com duração registrada.`:`No ${i} has a recorded duration.`}}var Dn=new Set([`cancelled`,`failed`]);function On(e,t){return new Intl.NumberFormat(t,{style:`currency`,currency:`BRL`,maximumFractionDigits:0}).format(e)}function kn({data:e,locale:t,onOpenTask:n,prds:r=e.prds,runs:i=e.runs,specs:a=e.specs,tasks:o=e.tasks,resolveRunCostBrl:s}){let[c,u]=(0,l.useState)(`tasks`),[d,p]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),g=o.filter(e=>e.status===`completed`).length,_=a.filter(e=>e.work_status===`completed`).length,v=r.filter(e=>e.work_status===`completed`).length,y=o.length===0?0:g/o.length,b=a.length===0?0:_/a.length,x=r.length===0?0:v/r.length,S=En(c,t),C=Cn(t),w=c===`specs`?a:r,T=c===`tasks`?o.length:w.length,E=c===`tasks`?_n(o,i,s):vn(w,i,s),ee=hn(E.map(e=>e.durationMs)),te=Mn(o,t),ne=Nn(w,o,t),j=c===`tasks`?te:ne,M=j.reduce((e,t)=>e+t.count,0),N=Object.entries(pn).map(([e,n])=>({key:e,label:Dt(e,t),color:n,count:o.filter(t=>t.risk===e).length})),ie=c===`tasks`?N:yn(w,t),P=i.filter(e=>e.phase===`execution`),ae=P.reduce((e,t)=>e+(t.duration_ms??0),0),F=wn(P),I=i.reduce((e,t)=>e+(t.usage.total.tokens.total??0),0),L=i.reduce((e,t)=>e+(s?s(t.id)??0:t.usage.total.cost.brl??0),0),oe=ae>0?L*36e5/ae:null,se=o.length>0?L/o.length:null,ce=o.length>0?I/o.length:null,le=ae>0?I*36e5/ae:null,ue=hn(E.map(e=>e.tokens)),de=hn(E.map(e=>e.costBrl)),fe=gn(c===`tasks`?o:w),pe=[[C.averageTime,ee===null?`—`:D(ee,t)],[C.averageTokens,O(ue,t)],[C.averageCost,k(de,`BRL`,t)]],me=E.filter(e=>e.durationMs!==null).sort((e,t)=>(t.durationMs??0)-(e.durationMs??0)).slice(0,5),he=Math.max(1,...me.map(e=>e.durationMs??0)),ge=bn(me,E),_e=e=>{u(e),p(null),h(null)};return(0,f.jsxs)(`section`,{"aria-label":C.overview,className:`operations-overview`,children:[(0,f.jsxs)(`div`,{className:`operations-kpi-grid`,children:[(0,f.jsx)(Sn,{featured:c===`tasks`,hint:`${g} ${C.completedTasks} (${A(y,t)})`,label:C.tasks,onSelect:()=>_e(`tasks`),value:String(o.length)}),(0,f.jsx)(Sn,{featured:c===`specs`,hint:`${_} ${C.completedSpecs} (${A(b,t)})`,label:`SPECs`,onSelect:()=>_e(`specs`),value:String(a.length)}),(0,f.jsx)(Sn,{featured:c===`prds`,hint:`${v} ${C.completedPrds} (${A(x,t)})`,label:`PRDs`,onSelect:()=>_e(`prds`),value:String(r.length)}),(0,f.jsx)(Sn,{hint:Tn(ae,o.length,F,t),label:C.totalExecutionTime,value:ae===0?`—`:ze(ae)}),(0,f.jsx)(Sn,{hint:ce===null||le===null?t===`pt-BR`?`Tokens por tarefa e por hora indisponíveis`:`Tokens per task and hour unavailable`:t===`pt-BR`?`${O(ce,t)} / tarefa (${O(le,t,0)} / hora)`:`${O(ce,t)} / task (${O(le,t,0)} / hour)`,label:t===`pt-BR`?`Tokens gastos`:`Spent tokens`,value:O(I,t)}),(0,f.jsx)(Sn,{hint:oe===null||se===null?t===`pt-BR`?`Custo por tarefa e por hora indisponível`:`Cost per task and hour unavailable`:t===`pt-BR`?`${On(se,t)} / tarefa (${On(oe,t)} / hora)`:`${On(se,t)} / task (${On(oe,t)} / hour)`,label:t===`pt-BR`?`Custo Estimado`:`Estimated cost`,value:On(L,t)})]}),(0,f.jsxs)(`div`,{className:`operations-chart-grid`,children:[(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-wide`,children:[(0,f.jsx)(jn,{hint:C.statusHint,title:S.statusTitle}),(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-stacked-bar`,children:j.map(e=>(0,f.jsx)(`i`,{style:{background:e.color,flexGrow:e.count,display:e.count===0?`none`:void 0}},e.key))}),(0,f.jsx)(`div`,{className:`operations-legend-grid`,children:j.map(e=>{let n=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`i`,{style:{background:e.color}}),(0,f.jsx)(`span`,{children:e.label}),(0,f.jsxs)(`span`,{className:`operations-legend-value`,children:[(0,f.jsx)(`strong`,{children:e.count}),(0,f.jsx)(`small`,{children:A(M===0?0:e.count/M,t)})]})]});return c===`tasks`?(0,f.jsx)(`button`,{"aria-label":`${e.label}: ${e.count}, ${A(M===0?0:e.count/M,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>p(e.key),type:`button`,children:n},e.key):(0,f.jsx)(`div`,{className:`operations-legend-row`,children:n},e.key)})})]}),(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-risk`,children:[(0,f.jsx)(jn,{hint:S.classificationHint,title:S.classificationTitle}),(0,f.jsxs)(`div`,{className:`operations-donut-wrap`,children:[(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-donut`,style:{background:Pn(ie,Math.max(T,1))}}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:T}),(0,f.jsx)(`span`,{children:S.shortPlural})]})]}),(0,f.jsx)(`div`,{className:`operations-legend-grid`,children:ie.map(e=>{let n=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`i`,{style:{background:e.color}}),(0,f.jsx)(`span`,{children:e.label}),(0,f.jsxs)(`span`,{className:`operations-legend-value`,children:[(0,f.jsx)(`strong`,{children:e.count}),(0,f.jsx)(`small`,{children:A(T===0?0:e.count/T,t)})]})]});return c===`tasks`?(0,f.jsx)(`button`,{"aria-label":`${e.label}: ${e.count}, ${A(T===0?0:e.count/T,t)}`,className:`operations-legend-row operations-status-filter`,onClick:()=>h(e.key),type:`button`,children:n},e.key):(0,f.jsx)(`div`,{className:`operations-legend-row`,children:n},e.key)})})]}),(0,f.jsxs)(`article`,{className:`operations-panel operations-panel-type${t===`en-US`?` is-en-us`:``}`,children:[(0,f.jsx)(jn,{hint:S.averageHint,title:S.averageTitle}),(0,f.jsx)(`div`,{className:`operations-type-summary`,children:pe.map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:t})]},e))}),(0,f.jsxs)(`footer`,{className:`operations-latest-task-created`,children:[(0,f.jsx)(`span`,{children:S.latestLabel}),(0,f.jsx)(`strong`,{children:fe===null?`—`:re(fe,t)})]})]}),(0,f.jsxs)(`article`,{className:`operations-panel`,children:[(0,f.jsx)(jn,{hint:C.topHint,title:S.topTitle}),me.length>0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`div`,{className:`operations-run-bars`,children:me.map((e,r)=>(0,f.jsxs)(`button`,{"aria-label":t===`pt-BR`?`Abrir detalhes da tarefa ${e.title}`:`Open details for task ${e.title}`,className:`operations-run-bar`,disabled:c!==`tasks`,onClick:()=>void n(e.id),title:`${e.title}: ${D(e.durationMs,t)}`,type:`button`,children:[(0,f.jsx)(`strong`,{children:e.durationMs==null?`—`:D(e.durationMs,t)}),(0,f.jsx)(`i`,{style:{height:`${Math.max(8,(e.durationMs??0)/he*100)}%`}}),(0,f.jsx)(`span`,{children:`#${r+1} ${e.id.slice(-4)}`})]},e.id))}),(0,f.jsxs)(`div`,{className:`operations-top-task-metrics`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.accumulatedTime}),(0,f.jsx)(`strong`,{children:D(ge.durationMs,t)}),(0,f.jsx)(`small`,{children:`${ge.runCount} ${C.associatedRuns}`})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.concentration}),(0,f.jsx)(`strong`,{children:A(ge.durationShare,t)}),(0,f.jsx)(`small`,{children:C.totalMeasuredTime})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:C.topFiveCost}),(0,f.jsx)(`strong`,{children:k(ge.costBrl,`BRL`,t)}),(0,f.jsx)(`small`,{children:ge.tokens===null?C.tokensUnavailable:`${O(ge.tokens,t)} tokens`})]})]})]}):(0,f.jsx)(`p`,{className:`operations-empty`,children:S.emptyTop})]})]}),d===null?null:(0,f.jsx)(An,{eyebrow:t===`pt-BR`?`Status das tarefas`:`Task status`,label:Ht(d,t),locale:t,onClose:()=>p(null),onOpenTask:e=>{p(null),n(e)},tasks:o.filter(e=>Ut(e)===d)}),m===null?null:(0,f.jsx)(An,{eyebrow:t===`pt-BR`?`Risco das tarefas`:`Task risk`,label:Dt(m,t),locale:t,onClose:()=>h(null),onOpenTask:e=>{h(null),n(e)},tasks:o.filter(e=>e.risk===m)})]})}function An({eyebrow:e,label:t,locale:n,onClose:r,onOpenTask:i,tasks:a}){let o=n===`pt-BR`?a.length===1?`tarefa`:`tarefas`:a.length===1?`task`:`tasks`;return(0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&r()},open:!0,children:(0,f.jsxs)(`section`,{"aria-label":`${t} — ${a.length} ${o}`,"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`h2`,{children:t}),(0,f.jsxs)(`p`,{children:[a.length,` `,o]})]}),(0,f.jsx)(`button`,{"aria-label":n===`pt-BR`?`Fechar`:`Close`,onClick:r,type:`button`,children:`×`})]}),(0,f.jsxs)(`div`,{className:`operations-status-task-list`,children:[a.map(e=>(0,f.jsxs)(`button`,{onClick:()=>i(e.id),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]}),(0,f.jsx)(`span`,{className:`operations-risk is-${e.risk}`,children:Dt(e.risk,n)}),(0,f.jsxs)(`span`,{className:`operations-status-task-action`,children:[n===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},e.id)),a.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Nenhuma tarefa neste status.`:`No tasks in this status.`}):null]})]})})}function jn({title:e,hint:t,action:n}){return(0,f.jsxs)(`header`,{className:`operations-panel-header`,children:[(0,f.jsxs)(`div`,{className:`operations-panel-header-title`,children:[(0,f.jsx)(`h2`,{children:e}),n]}),(0,f.jsx)(`small`,{children:t})]})}function Mn(e,t){return Lt.filter(e=>!Dn.has(e)).map(n=>({key:n,label:Ht(n,t),color:fn[n],count:e.filter(e=>Ut(e)===n).length}))}function Nn(e,t,n){return Lt.filter(e=>!Dn.has(e)).map(r=>({key:r,label:Ht(r,n),color:fn[r],count:e.filter(e=>Wt(e,t)===r).length}))}function Pn(e,t){let n=0,r=e.map(e=>{let r=n+e.count/t*100,i=`${e.color} ${n}% ${r}%`;return n=r,i});return n===0?`rgba(36, 52, 72, 0.86)`:`conic-gradient(${r.join(`, `)})`}function Fn(e,t,n){let r=new Map,i=new Map,a=In(e.runs,t),o=e=>{let t=r.get(e);if(t!==void 0)return t;let n={key:e,prds:0,specs:0,tasks:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};return r.set(e,n),i.set(e,new Set),n},s=e=>{let n=Hn(e,t);return n===null?null:o(n)};for(let t of e.prds){let e=s(t.created_at);e!==null&&(e.prds+=1)}for(let t of e.specs){let e=s(t.created_at);e!==null&&(e.specs+=1)}for(let t of e.tasks){let e=s(t.created_at);if(e===null)continue;e.tasks+=1,e.tests+=t.test_count??0;let n=i.get(e.key);for(let e of t.result?.evidence_ids??[])n?.add(e)}for(let t of e.runs){let e=s(t.started_at);e!==null&&(e.runs+=1,e.tokens=zn(e.tokens,t.usage.total.tokens.total),e.costBrl=zn(e.costBrl,n===void 0?t.usage.total.cost.brl:n(t.id)))}for(let[e,t]of i){let n=r.get(e);n!==void 0&&(n.evidences=t.size)}for(let[e,t]of a)o(e).durationMs=t;return[...r.values()].sort((e,t)=>t.key.localeCompare(e.key))}function In(e,t){let n=new Map;for(let r of e){if(r.phase!==void 0&&r.phase!==`execution`&&r.phase!==`conversation`||r.parent_run_id!==void 0&&r.parent_run_id!==null||r.duration_ms===null||r.duration_ms<=0)continue;let e=Hn(r.started_at,t);e!==null&&n.set(e,(n.get(e)??0)+r.duration_ms)}return n}function Ln(e){let t={prds:0,specs:0,tasks:0,runs:0,tests:0,evidences:0,durationMs:null,tokens:null,costBrl:null};for(let n of e)t.prds+=n.prds,t.specs+=n.specs,t.tasks+=n.tasks,t.runs+=n.runs,t.tests+=n.tests,t.evidences+=n.evidences,t.durationMs=zn(t.durationMs,n.durationMs),t.tokens=zn(t.tokens,n.tokens),t.costBrl=zn(t.costBrl,n.costBrl);return t}function Rn(e){let t=e.length;return{tasks:t===0?null:e.reduce((e,t)=>e+t.tasks,0)/t,specs:t===0?null:e.reduce((e,t)=>e+t.specs,0)/t,prds:t===0?null:e.reduce((e,t)=>e+t.prds,0)/t,durationMs:Vn(e.map(e=>e.durationMs),t),tokens:Bn(e.map(e=>e.tokens)),costBrl:Bn(e.map(e=>e.costBrl))}}function zn(e,t){return t===null?e:(e??0)+t}function Bn(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function Vn(e,t){return t===0?null:e.reduce((e,t)=>e+(t??0),0)/t}function Hn(e,t){if(e===null)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;let r=String(n.getFullYear());if(t===`year`)return r;let i=String(n.getMonth()+1).padStart(2,`0`);return t===`month`?`${r}-${i}`:`${r}-${i}-${String(n.getDate()).padStart(2,`0`)}`}function Un({data:e,granularity:t,locale:n,resolveRunCostBrl:r}){let i=Fn(e,t,r),a=Ln(i),o=Rn(i),s=n===`pt-BR`?`Total geral`:`Grand total`;return(0,f.jsxs)(`div`,{className:`operations-period-summary`,children:[(0,f.jsx)(j,{ariaLabel:Wn(t,n),metrics:[{label:Gn(n===`pt-BR`?`Tarefas`:`Tasks`,t,n),value:ne(o.tasks,n,1)},{label:Gn(`SPECs`,t,n),value:ne(o.specs,n,1)},{label:Gn(`PRDs`,t,n),value:ne(o.prds,n,1)},{label:Gn(n===`pt-BR`?`Tempo`:`Time`,t,n),value:te(o.durationMs,n)},{label:Gn(`Tokens`,t,n),value:O(o.tokens,n)},{label:Gn(n===`pt-BR`?`Custo`:`Cost`,t,n),value:k(o.costBrl,`BRL`,n)}]}),(0,f.jsx)(C,{columns:[{key:`period`,label:qn(t,n),render:e=>(0,f.jsx)(`strong`,{children:Jn(e.key,t,n)}),footer:s,sortValue:e=>e.key},Kn(`prds`,`PRDs`,a.prds),Kn(`specs`,`SPECs`,a.specs),Kn(`tasks`,`Tasks`,a.tasks),Kn(`runs`,`Runs`,a.runs),Kn(`tests`,n===`pt-BR`?`Testes`:`Tests`,a.tests),Kn(`evidences`,n===`pt-BR`?`Evidências`:`Evidence`,a.evidences),{key:`duration`,label:n===`pt-BR`?`Tempo`:`Time`,align:`right`,render:e=>D(e.durationMs),footer:D(a.durationMs),sortValue:e=>e.durationMs},{key:`tokens`,label:`Tokens`,align:`right`,render:e=>O(e.tokens),footer:O(a.tokens),sortValue:e=>e.tokens},{key:`cost`,label:n===`pt-BR`?`Custos`:`Costs`,align:`right`,render:e=>k(e.costBrl,`BRL`),footer:k(a.costBrl,`BRL`),sortValue:e=>e.costBrl}],emptyMessage:n===`pt-BR`?`Nenhum dado disponível para o período selecionado.`:`No data available for the selected period.`,defaultSort:{key:`period`,direction:`desc`},locale:n,rowKey:e=>e.key,rows:i,sortable:!0,showColumnInfo:!0})]})}function Wn(e,t){return t===`en-US`?e===`day`?`Daily averages`:e===`month`?`Monthly averages`:`Annual averages`:e===`day`?`Médias por dia`:e===`month`?`Médias por mês`:`Médias por ano`}function Gn(e,t,n){return n===`en-US`?`${e} ${t===`day`?`Daily average`:t===`month`?`Monthly average`:`Annual average`}`:`${e} ${t===`day`?`Médio por dia`:t===`month`?`Médio por mês`:`Médio por ano`}`}function Kn(e,t,n){return{key:e,label:t,align:`right`,render:t=>t[e],footer:n,sortValue:t=>t[e]}}function qn(e,t){return t===`en-US`?e===`day`?`Day`:e===`month`?`Month`:`Year`:e===`day`?`Dia`:e===`month`?`Mês`:`Ano`}function Jn(e,t,n){if(t===`month`||t===`year`)return e;let r=new Date(`${e}T12:00:00`);return new Intl.DateTimeFormat(n,{...t===`day`?{day:`2-digit`}:{},month:t===`day`?`2-digit`:`long`,year:`numeric`}).format(r)}function Yn({allSpecs:e,allTasks:t,changes:n,locale:r,onOpenDocument:i,onOpenTask:a,prds:o,runs:s,specs:c,tasks:u}){let d=Mt(),[p,m]=(0,l.useState)(`task`),[h,g]=(0,l.useState)(null),[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(``),x=(0,l.useMemo)(()=>Pt(s),[s]),S=(0,l.useMemo)(()=>nr([...o.map(e=>({kind:`prd`,row:e})),...c.map(e=>({kind:`spec`,row:e})),...u.map(e=>({kind:`task`,row:e}))].filter(e=>Rt(e,p))),[o,c,u,p]),C=(0,l.useMemo)(()=>new Map([...o,...c].map(n=>[n.id,zt(n,e,t)])),[e,t,o,c]),w=h===null?[]:S.filter(e=>tr(e,t)===h),T=e=>{g(null),e.kind===`task`?a(e.row.id):v(e.row)};return(0,f.jsxs)(`section`,{className:`operations-unified-work`,children:[(0,f.jsx)(Xn,{locale:r,onChange:m,value:p}),(0,f.jsx)(`section`,{"aria-label":r===`pt-BR`?`Kanban de trabalho`:`Work Kanban`,className:`operations-board operations-work-board`,children:Lt.map(e=>(0,f.jsx)(Zn,{changes:n,items:S.filter(n=>tr(n,t)===e),locale:r,nowMs:d,onOpenColumn:()=>{b(``),g(e)},onOpenItem:T,progressByMacro:C,stage:e,totalsByTask:x},e))}),h?(0,f.jsx)(er,{items:w,locale:r,onClose:()=>g(null),onOpenItem:T,onQueryChange:b,query:y,stage:h}):null,_?(0,f.jsx)(Gt,{label:_.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>v(null),onOpenDocument:i,onOpenTrace:e=>{v(null),a(e)},row:_,runs:s,specs:e,tasks:t}):null]})}function Xn({locale:e,onChange:t,value:n}){let r=e===`pt-BR`?{task:`Todas as Tarefas`,all:`Visão Unificada Geral`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Tarefas Avulsas`}:{task:`All Tasks`,all:`Unified Overview`,prd:`PRDs`,spec:`SPECs`,"standalone-task":`Standalone Tasks`};return(0,f.jsx)(`nav`,{"aria-label":e===`pt-BR`?`Filtrar tipo de trabalho`:`Filter work type`,className:`operations-work-type-filters`,children:[`task`,`all`,`prd`,`spec`,`standalone-task`].map(e=>(0,f.jsx)(`button`,{className:n===e?`is-active`:void 0,onClick:()=>t(e),type:`button`,children:r[e]},e))})}function Zn({changes:e,items:t,locale:n,nowMs:r,onOpenColumn:i,onOpenItem:a,progressByMacro:o,stage:s,totalsByTask:c}){let{hasMore:l,sentinelRef:u,visibleCount:d}=Nt(t.length);return(0,f.jsxs)(`article`,{className:`operations-column is-${s}`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsx)(`button`,{className:`operations-column-trigger`,onClick:i,type:`button`,children:Ht(s,n)}),(0,f.jsx)(`button`,{"aria-label":`${t.length} — ${Ht(s,n)}`,className:`operations-column-count`,onClick:i,type:`button`,children:t.length})]}),(0,f.jsxs)(`div`,{className:`operations-column-body`,children:[t.slice(0,d).map(t=>(0,f.jsx)(Qn,{changes:e,item:t,locale:n,nowMs:r,onOpen:()=>a(t),progress:o.get(t.row.id),stage:s,totalsByTask:c},t.row.id)),t.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:n===`pt-BR`?`Sem itens`:`No items`}):null,l?(0,f.jsxs)(`div`,{className:`operations-infinite-sentinel`,ref:u,children:[d,` de `,t.length,` · carregando mais…`]}):null]})]})}function Qn({changes:e,item:t,locale:n,nowMs:r,onOpen:i,progress:a,stage:o,totalsByTask:s}){let c=Ne(t.row.created_at,rr(o),n,r),l=t.kind===`task`?t.row:null,u=t.kind===`task`?null:t.row,d=l?kt(l,e):t.kind,p=d===`task`?`Tarefa Avulsa`:t.kind.toUpperCase(),m=l?s.get(l.id):null,h=u?[u.duration_ms,u.usage.total.tokens.total,u.usage.total.cost.brl]:[m?.durationMs??null,m?.tokens??null,m?.costBrl??null];return(0,f.jsxs)(`button`,{className:`operations-task-card operations-work-card is-kind-${d}`,onClick:i,type:`button`,children:[(0,f.jsx)(`span`,{className:`operations-work-kind is-${t.kind}`,children:p}),l?(0,f.jsx)(`span`,{className:`operations-risk is-${l.risk}`,children:Dt(l.risk,n)}):null,(0,f.jsx)(`strong`,{title:t.row.title,children:t.row.title}),(0,f.jsx)(`small`,{title:t.row.id,children:t.row.id}),t.row.created_at?(0,f.jsx)(`small`,{className:`operations-card-created`,children:Ie(t.row.created_at,n)}):null,c?(0,f.jsx)(`span`,{className:`operations-elapsed-badge${c.alert?` is-alert`:``}`,children:c.label}):null,l?(0,f.jsx)(`span`,{className:`operations-task-origin-badge is-${d}`,children:At(d)}):null,u?(0,f.jsx)(`span`,{className:`operations-work-card-counts`,children:Bt(u.kind,a??{completedSpecs:0,totalSpecs:0,completedTasks:0,totalTasks:0})}):null,(0,f.jsx)(`dl`,{className:`operations-task-usage operations-macro-usage`,children:[[n===`pt-BR`?`Tempo`:`Time`,h[0]==null?`—`:Re(h[0])],[`Tokens`,h[1]==null?`—`:O(h[1])],[n===`pt-BR`?`Custo`:`Cost`,h[2]==null?`—`:k(h[2],`BRL`)]].map(([e,t])=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:e}),(0,f.jsx)(`dd`,{children:t})]},e))})]})}function $n(e,t){let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>[e.row.id,e.row.title,e.kind].some(e=>e.toLocaleLowerCase().includes(n))):[...e]}function er({items:e,locale:t,onClose:n,onOpenItem:r,onQueryChange:i,query:a,stage:o}){let s=$n(e,a);return(0,S.createPortal)((0,f.jsx)(`dialog`,{className:`operations-status-dialog-backdrop`,onMouseDown:e=>e.currentTarget===e.target&&n(),open:!0,children:(0,f.jsxs)(`section`,{"aria-label":Ht(o,t),"aria-modal":`true`,className:`operations-status-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Coluna de trabalho`:`Work column`}),(0,f.jsx)(`h2`,{children:Ht(o,t)}),(0,f.jsxs)(`p`,{children:[e.length,` itens`]})]}),(0,f.jsx)(`button`,{"aria-label":t===`pt-BR`?`Fechar`:`Close`,onClick:n,type:`button`,children:`×`})]}),(0,f.jsxs)(`label`,{className:`operations-status-dialog-search`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Buscar itens`:`Search items`}),(0,f.jsx)(`input`,{autoFocus:!0,onChange:e=>i(e.target.value),placeholder:t===`pt-BR`?`Título, ID ou tipo`:`Title, ID, or type`,type:`search`,value:a})]}),(0,f.jsxs)(`div`,{className:`operations-status-task-list`,children:[s.map(e=>(0,f.jsxs)(`button`,{onClick:()=>r(e),type:`button`,children:[(0,f.jsxs)(`span`,{className:`operations-status-task-main`,children:[(0,f.jsx)(`strong`,{children:e.row.title}),(0,f.jsx)(`small`,{children:e.row.id})]}),(0,f.jsx)(`span`,{className:`operations-work-kind is-${e.kind}`,children:e.kind===`task`?`TASK`:e.kind.toUpperCase()}),(0,f.jsxs)(`span`,{className:`operations-status-task-action`,children:[t===`pt-BR`?`Ver detalhes`:`View details`,` →`]})]},`${e.kind}:${e.row.id}`)),s.length===0?(0,f.jsx)(`p`,{className:`operations-empty`,children:t===`pt-BR`?`Nenhum item encontrado nesta coluna.`:`No items found in this column.`}):null]})]})}),document.body)}function tr(e,t){return e.kind===`task`?Ut(e.row):Wt(e.row,t)}function nr(e){return e.sort((e,t)=>(t.row.created_at??``).localeCompare(e.row.created_at??``)||t.row.id.localeCompare(e.row.id))}function rr(e){return e===`definition`?`draft`:e===`planning`||e===`ready`?`planned`:e===`blocked`?`blocked`:e}function ir({allSpecs:e,allTasks:t,changes:n,locale:r,onOpenDocument:i,onOpenTask:a,prds:o,runs:s,specs:c,tasks:u}){let[d,p]=(0,l.useState)(`task`),[m,h]=(0,l.useState)(null),g=(0,l.useMemo)(()=>ar({allSpecs:e,allTasks:t,changes:n,items:[...o.map(e=>({kind:`prd`,row:e})),...c.map(e=>({kind:`spec`,row:e})),...u.map(e=>({kind:`task`,row:e}))].filter(e=>Rt(e,d)),runs:s}),[e,t,n,o,s,c,u,d]);return(0,f.jsxs)(`section`,{className:`operations-unified-work operations-work-list`,children:[(0,f.jsx)(Xn,{locale:r,onChange:p,value:d}),(0,f.jsx)(`div`,{className:`operations-work-list-table`,children:(0,f.jsx)(C,{columns:[{key:`item`,label:r===`pt-BR`?`Item de trabalho`:`Work item`,render:({item:e,originLabel:t})=>(0,f.jsxs)(`span`,{className:`operations-work-list-identity`,children:[(0,f.jsx)(`span`,{className:`operations-work-kind is-${e.kind}`,children:t}),(0,f.jsx)(`strong`,{children:e.row.title}),(0,f.jsx)(`small`,{children:e.row.id})]}),sortValue:({item:e})=>e.row.title},{key:`status`,label:`Status`,render:({stage:e})=>(0,f.jsx)(`span`,{className:`operations-status is-${e}`,children:Ht(e,r)}),sortValue:({stage:e})=>e},{key:`risk`,label:r===`pt-BR`?`Risco`:`Risk`,render:({risk:e})=>e?(0,f.jsx)(`span`,{className:`operations-risk is-${e}`,children:Dt(e,r)}):`—`,sortValue:({risk:e})=>e},{key:`progress`,label:r===`pt-BR`?`Progresso`:`Progress`,render:({progress:e})=>e,sortValue:({item:e})=>e.kind===`task`?e.row.progress:e.row.quality.task_completion_rate},{key:`runs`,label:`Runs`,description:r===`pt-BR`?`Chamadas do agente orquestrador relacionadas ao item.`:`Orchestrator agent calls related to the item.`,render:({runCount:e})=>e,sortValue:({runCount:e})=>e,align:`right`},{key:`subruns`,label:`Sub-runs`,description:r===`pt-BR`?`Chamadas de subagentes relacionadas ao item.`:`Subagent calls related to the item.`,render:({subrunCount:e})=>e,sortValue:({subrunCount:e})=>e,align:`right`},{key:`executions`,label:r===`pt-BR`?`Execuções`:`Executions`,render:({executionCount:e})=>e,sortValue:({executionCount:e})=>e,align:`right`},{key:`tasks`,label:r===`pt-BR`?`Tarefas`:`Tasks`,render:({taskCount:e})=>e,sortValue:({taskCount:e})=>e,align:`right`},{key:`duration`,label:r===`pt-BR`?`Tempo`:`Time`,render:({durationMs:e})=>e===null?`—`:Re(e),sortValue:({durationMs:e})=>e,align:`right`},{key:`tokens`,label:`Tokens`,render:({tokens:e})=>e===null?`—`:O(e),sortValue:({tokens:e})=>e,align:`right`},{key:`cost`,label:r===`pt-BR`?`Custo`:`Cost`,render:({costBrl:e})=>e===null?`—`:k(e,`BRL`),sortValue:({costBrl:e})=>e,align:`right`}],defaultSort:{key:`item`,direction:`asc`},emptyMessage:r===`pt-BR`?`Nenhum item de trabalho encontrado.`:`No work items found.`,locale:r,onRowClick:({item:e})=>{e.kind===`task`?a(e.row.id):h(e.row)},rowKey:({item:e})=>`${e.kind}:${e.row.id}`,rows:g,scrollLabel:r===`pt-BR`?`Tabela de itens de trabalho com rolagem horizontal para acessar todas as colunas.`:`Work items table with horizontal scrolling to access all columns.`,showColumnInfo:!0,sortable:!0})}),m?(0,f.jsx)(Gt,{label:m.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>h(null),onOpenDocument:i,onOpenTrace:e=>{h(null),a(e)},row:m,runs:s,specs:e,tasks:t}):null]})}function ar({allSpecs:e,allTasks:t,changes:n,items:r,runs:i}){let a=Pt(i);return r.map(r=>{let o=r.kind===`task`?r.row:null,s=r.kind===`task`?null:r.row,c=i.filter(e=>o?e.task_id===o.id:s!==null&&(s.run_ids.includes(e.id)||e.prd_id===s.id||e.spec_id===s.id||e.task_id!==null&&s.task_ids.includes(e.task_id))),l=o?a.get(o.id):null,u=s?zt(s,e,t):null;return{item:r,stage:o?Ut(o)??`planning`:Wt(s,t),originLabel:o?At(kt(o,n)):r.kind.toUpperCase(),risk:o?.risk??null,progress:o?`${Math.round(o.progress)}%`:Bt(s.kind,u),runCount:c.filter(e=>e.run_kind===`run`).length,subrunCount:c.filter(e=>e.run_kind===`subrun`).length,executionCount:o?new Set(c.flatMap(e=>e.execution_id?[e.execution_id]:[])).size:s.execution_count,taskCount:o?1:u.totalTasks,durationMs:o?l?.durationMs??null:s.duration_ms,tokens:o?l?.tokens??null:s.usage.total.tokens.total,costBrl:o?l?.costBrl??null:s.usage.total.cost.brl}})}var or={"pt-BR":{"work-kanban":`Trabalho (Kanban)`,"work-list":`Trabalho (Lista)`,changes:`Mudanças`,executions:`Execuções`,runs:`Chamadas de agentes`,conversations:`Conversas`,decisions:`Decisões`,daily:`Diário`,monthly:`Mensal`,yearly:`Anual`},"en-US":{"work-kanban":`Work (Kanban)`,"work-list":`Work (List)`,changes:`Changes`,executions:`Executions`,runs:`Agent calls`,conversations:`Conversations`,decisions:`Decisions`,daily:`Daily`,monthly:`Monthly`,yearly:`Annual`}};function sr(e,t){let n=e.trim().toLocaleLowerCase();return n.length===0||t.some(e=>e?.toLocaleLowerCase().includes(n))}function cr({alternateContent:e,capabilityNavigation:t,data:n,dashboardTitle:r=`Dashboard Zaip AIOS`,loading:i,locale:a,onLocaleChange:o,onOpenDocument:s,onOpenTask:c,onRefresh:u,repositoryName:d,settings:p,resolveRunCostBrl:h}){let[g,_]=(0,l.useState)(`work-kanban`),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[w,T]=(0,l.useState)(``),[E,ee]=(0,l.useState)(``),[D,te]=(0,l.useState)(``),[O,ne]=(0,l.useState)(!1),k=(0,l.useRef)(null),re=(0,l.useRef)(null),A=(0,l.useMemo)(()=>Qt(n.tasks),[n.tasks]),[j,M]=(0,l.useState)(A),[N,ie]=(0,l.useState)(`all`),P=(0,l.useCallback)(()=>{ne(!0),k.current!==null&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>ne(!1),220)},[]);(0,l.useEffect)(()=>()=>{k.current!==null&&window.clearTimeout(k.current)},[]);let ae=typeof e==`function`?e({query:v,dateRange:j}):e,F=()=>{P(),y(``),T(``),ee(``),te(``),M(A),ie(`all`)},I=e=>{P(),_(e),T(``),ee(``),te(``)},L=ur(n,g),oe=![`decisions`,`daily`,`monthly`,`yearly`].includes(g),se=g===`work-kanban`||g===`work-list`||g===`changes`,ce=g===`work-kanban`||g===`work-list`,le=n.tasks.filter(e=>(!w||Ut(e)===w)&&(!E||e.risk===E)&&jt(e,D,n.changes)&&en(e.created_at,j)&&sr(v,[e.id,e.title,e.short_name,e.objective,e.change_id,e.spec_id])),ue=n.prds.filter(e=>(!w||Wt(e,n.tasks)===w)&&!E&&!D&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.parent_id])),pe=n.specs.filter(e=>(!w||Wt(e,n.tasks)===w)&&!E&&!D&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.parent_id])),me=n.changes.filter(e=>(!w||e.status===w)&&(!E||e.risk===E)&&tn(e.created_at,j)&&sr(v,[e.id,e.title,e.source.type,e.artifact_path])),he=n.executions.filter(e=>(!w||e.status===w)&&tn(e.created_at,j)&&sr(v,[e.id,e.status,e.work_status,e.origin.type,e.artifact_path])),_e=n.runs.filter(e=>(!w||e.status===w)&&tn(e.started_at,j)&&sr(v,[e.id,e.task_id,e.spec_id,e.prd_id,e.change_id,e.execution_id,e.conversation_id,e.phase,e.agent,e.agent_name,e.model,e.effective_model])),be=_e.filter(e=>e.phase===`conversation`),xe=n.decisions.filter(e=>tn(e.created_at,j)&&sr(v,[e.id,e.title,e.scope_id,e.scope_type,e.artifact_path])),Se=new Set(le.map(e=>e.id)),Ce=n.runs.filter(e=>tn(e.started_at,j)&&(e.task_id===null||Se.has(e.task_id))&&sr(v,[e.id,e.task_id,e.agent,e.agent_name,e.model,e.effective_model])),we=i||O;return(0,f.jsxs)(`main`,{className:`operations-page`,children:[(0,f.jsx)(m,{filters:(0,f.jsxs)(`div`,{className:`operations-global-filters`,"data-loading":we||void 0,children:[(0,f.jsxs)(`div`,{className:`operations-filter-heading`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:a===`pt-BR`?`Filtrar dashboard`:`Filter dashboard`}),(0,f.jsx)(`small`,{children:a===`pt-BR`?`Os resultados são atualizados automaticamente`:`Results update automatically`})]}),we?(0,f.jsxs)(`span`,{className:`operations-filter-status`,role:`status`,children:[(0,f.jsx)(`i`,{}),` `,a===`pt-BR`?`Atualizando dados`:`Updating data`]}):null]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Tipo`:`Type`}),(0,f.jsx)(`select`,{onChange:e=>I(e.target.value),value:g,children:Object.keys(or[a]).map(e=>(0,f.jsx)(`option`,{value:e,children:or[a][e]},e))})]}),oe?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:`Status`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),T(e.target.value)},value:w,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),L.map(e=>(0,f.jsx)(`option`,{value:e,children:dr(e,a)},e))]})]}):null,se?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Risco`:`Risk`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),ee(e.target.value)},value:E,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),(0,f.jsx)(`option`,{value:`lite`,children:Dt(`lite`,a)}),(0,f.jsx)(`option`,{value:`standard`,children:Dt(`standard`,a)}),(0,f.jsx)(`option`,{value:`critical`,children:Dt(`critical`,a)})]})]}):null,ce?(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Origem da tarefa`:`Task origin`}),(0,f.jsxs)(`select`,{onChange:e=>{P(),te(e.target.value)},value:D,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todas`:`All`}),Ot.map(e=>(0,f.jsx)(`option`,{value:e,children:At(e)},e))]})]}):null,(0,f.jsx)(dn,{ariaLabelSuffix:a===`pt-BR`?` nos filtros`:` in filters`,dateRange:j,defaultDateRange:A,locale:a,onDateRangeChange:e=>{P(),M(e),ie(`custom`)},onPresetChange:(e,t)=>{P(),ie(e),M(t)},preset:N}),(0,f.jsxs)(`button`,{className:`operations-clear-filters`,onClick:F,type:`button`,children:[(0,f.jsx)(gr,{}),a===`pt-BR`?`Limpar filtros`:`Clear filters`]})]}),filtersActive:!!(v||w||E||D||j.start!==A.start||j.end!==A.end),lastUpdatedAt:n.summary.source_latest_at,loading:we,locale:a,onLocaleChange:o,onRefresh:u,...d===void 0?{}:{repositoryName:d},settings:p,title:r}),(0,f.jsx)(`h1`,{className:`operations-sr-only`,children:`Operações`}),(0,f.jsxs)(`header`,{className:`operations-hero`,children:[(0,f.jsx)(`div`,{children:(0,f.jsx)(`small`,{className:`operations-last-updated`,children:n.summary.source_latest_at===null?a===`pt-BR`?`Aguardando atualização`:`Waiting for refresh`:`${a===`pt-BR`?`Atualizado`:`Updated`} ${new Intl.DateTimeFormat(a,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(n.summary.source_latest_at))}`})}),(0,f.jsxs)(`div`,{className:`operations-actions`,children:[(0,f.jsx)(`button`,{"aria-label":a===`pt-BR`?`Atualizar`:`Refresh`,className:`operations-nav-icon`,disabled:i,onClick:u,type:`button`,children:(0,f.jsx)(pr,{})}),(0,f.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,f.jsxs)(`button`,{className:`operations-nav-button${b?` is-active`:``}`,onClick:()=>{x(e=>!e),C(!1)},type:`button`,children:[(0,f.jsx)(mr,{}),` `,a===`pt-BR`?`Filtros`:`Filters`]}),b?(0,f.jsxs)(`div`,{className:`operations-nav-popup operations-filter-popup`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Busca`:`Search`}),(0,f.jsx)(`input`,{onChange:e=>y(e.target.value),placeholder:a===`pt-BR`?`ID ou nome de ${or[a][g]}`:`${or[a][g]} ID or name`,value:v})]}),g===`work-kanban`||g===`work-list`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:`Status`}),(0,f.jsxs)(`select`,{onChange:e=>T(e.target.value),value:w,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),Lt.map(e=>(0,f.jsx)(`option`,{value:e,children:Ht(e,a)},e))]})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Risco`:`Risk`}),(0,f.jsxs)(`select`,{onChange:e=>ee(e.target.value),value:E,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todos`:`All`}),(0,f.jsx)(`option`,{value:`lite`,children:Dt(`lite`,a)}),(0,f.jsx)(`option`,{value:`standard`,children:Dt(`standard`,a)}),(0,f.jsx)(`option`,{value:`critical`,children:Dt(`critical`,a)})]})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Origem da tarefa`:`Task origin`}),(0,f.jsxs)(`select`,{onChange:e=>te(e.target.value),value:D,children:[(0,f.jsx)(`option`,{value:``,children:a===`pt-BR`?`Todas`:`All`}),Ot.map(e=>(0,f.jsx)(`option`,{value:e,children:At(e)},e))]})]})]}):null,(0,f.jsx)(`button`,{onClick:F,type:`button`,children:a===`pt-BR`?`Limpar filtros`:`Clear filters`})]}):null]}),(0,f.jsxs)(`div`,{className:`operations-nav-popup-anchor`,children:[(0,f.jsxs)(`button`,{className:`operations-nav-button${S?` is-active`:``}`,onClick:()=>{C(e=>!e),x(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:a}),a===`pt-BR`?`PT-BR`:`EN-US`,(0,f.jsx)(hr,{})]}),S?(0,f.jsxs)(`div`,{className:`operations-nav-popup operations-locale-popup`,children:[(0,f.jsxs)(`button`,{onClick:()=>{o(`pt-BR`),C(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:`pt-BR`}),` Português do Brasil`,a===`pt-BR`?(0,f.jsx)(`span`,{children:`✓`}):null]}),(0,f.jsxs)(`button`,{onClick:()=>{o(`en-US`),C(!1)},type:`button`,children:[(0,f.jsx)(fr,{locale:`en-US`}),` English`,a===`en-US`?(0,f.jsx)(`span`,{children:`✓`}):null]})]}):null]})]})]}),we?(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`operations-loading-line`}):null,(0,f.jsxs)(`div`,{"aria-busy":we,className:we?`operations-filtered is-loading`:`operations-filtered`,children:[(0,f.jsx)(kn,{data:n,locale:a,onOpenTask:c,prds:ue,runs:Ce,resolveRunCostBrl:h,specs:pe,tasks:le}),(0,f.jsxs)(`section`,{className:`dashboard-global-controls`,children:[t,(0,f.jsxs)(`div`,{className:`operations-toolbar-filters dashboard-global-filters`,children:[(0,f.jsxs)(`label`,{className:`operations-toolbar-field operations-search-field`,children:[(0,f.jsx)(`span`,{children:a===`pt-BR`?`Busca`:`Search`}),(0,f.jsxs)(`div`,{className:`operations-search-control`,children:[(0,f.jsx)(`input`,{"aria-label":a===`pt-BR`?`Busca`:`Search`,onChange:e=>{P(),y(e.target.value)},placeholder:a===`pt-BR`?`Buscar por nome ou ID`:`Search by name or ID`,ref:re,value:v}),v?(0,f.jsx)(`button`,{"aria-label":a===`pt-BR`?`Limpar busca`:`Clear search`,className:`operations-search-clear`,onClick:()=>{P(),y(``),re.current?.focus()},type:`button`,children:(0,f.jsx)(_r,{})}):null]})]}),(0,f.jsx)(dn,{dateRange:j,defaultDateRange:A,locale:a,onDateRangeChange:e=>{P(),M(e),ie(`custom`)},onPresetChange:(e,t)=>{P(),ie(e),M(t)},preset:N})]})]}),ae??(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`section`,{className:`operations-toolbar`,children:(0,f.jsx)(`nav`,{"aria-label":`Entidades do ciclo de trabalho`,children:[`work-kanban`,`work-list`,`executions`,`runs`,`decisions`,`changes`,`conversations`,`daily`,`monthly`,`yearly`].map(e=>(0,f.jsx)(`button`,{className:g===e?`is-active`:void 0,onClick:()=>I(e),type:`button`,children:or[a][e]},e))})}),(0,f.jsxs)(`section`,{className:`operations-content`,children:[g===`work-kanban`?(0,f.jsx)(Yn,{allSpecs:n.specs,allTasks:n.tasks,changes:n.changes,locale:a,onOpenDocument:s,onOpenTask:c,prds:ue,runs:n.runs,specs:pe,tasks:le}):null,g===`work-list`?(0,f.jsx)(ir,{allSpecs:n.specs,allTasks:n.tasks,changes:n.changes,locale:a,onOpenDocument:s,onOpenTask:c,prds:ue,runs:n.runs,specs:pe,tasks:le}):null,g===`changes`?(0,f.jsx)(de,{locale:a,rows:me}):null,g===`executions`?(0,f.jsx)(fe,{locale:a,rows:he}):null,g===`runs`?(0,f.jsx)(ge,{locale:a,rows:_e}):null,g===`conversations`?(0,f.jsx)(ve,{locale:a,rows:be}):null,g===`decisions`?(0,f.jsx)(ye,{locale:a,rows:xe}):null,g===`daily`||g===`monthly`||g===`yearly`?(0,f.jsx)(Un,{data:{prds:ue,runs:_e,specs:pe,tasks:le},granularity:g===`daily`?`day`:g===`monthly`?`month`:`year`,locale:a,resolveRunCostBrl:h}):null]})]})]})]})}var lr=[`draft`,`planned`,`executing`,`verifying`,`completed`,`blocked`,`failed`,`cancelled`];function ur(e,t){if(t===`work-kanban`||t===`work-list`)return[...Lt];let n=t===`changes`?e.changes.map(e=>e.status):t===`executions`?e.executions.map(e=>e.status):t===`runs`?e.runs.map(e=>e.status):t===`conversations`?e.runs.filter(e=>e.phase===`conversation`).map(e=>e.status):[];return[...new Set(n)].sort()}function dr(e,t){if(Lt.includes(e))return Ht(e,t);let n=lr.find(t=>t===e);return n===void 0?e:Et(n,t)}function fr({locale:e}){return e===`pt-BR`?(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,f.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`operations-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,f.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`})]})}function pr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M20 11a8.1 8.1 0 1 0 2 5.3M20 4v7h-7`})})}function mr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M4 6h16M7 12h10m-7 6h4`})})}function hr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-nav-svg operations-locale-chevron`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}function gr(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`operations-reset-icon`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7M3 4v6h6`})})}function _r(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,viewBox:`0 0 20 20`,children:(0,f.jsx)(`path`,{d:`m6 6 8 8M14 6l-8 8`})})}function vr({detail:e,label:t,locale:n,onClose:r}){let i=n===`pt-BR`;return(0,S.createPortal)((0,f.jsx)(`div`,{className:`operations-prd-document-backdrop`,onMouseDown:e=>{e.currentTarget===e.target&&r()},children:(0,f.jsxs)(`section`,{"aria-label":i?`${t} completa`:`Full ${t}`,"aria-modal":`true`,className:`operations-prd-document-dialog`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`span`,{children:[(0,f.jsx)(at,{"aria-hidden":`true`,size:16}),` `,t]}),(0,f.jsx)(`h2`,{children:e.title}),(0,f.jsx)(`p`,{children:e.id})]}),(0,f.jsx)(`button`,{"aria-label":i?`Fechar`:`Close`,onClick:r,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20})})]}),(0,f.jsx)(`div`,{className:`operations-prd-document-scroll`,children:(0,f.jsx)(yr,{content:e.body})}),(0,f.jsx)(`footer`,{children:e.artifact_path})]})}),document.body)}function yr({content:e}){return(0,f.jsx)(`article`,{className:`operations-prd-markdown`,children:br(e).map((e,t)=>{let n=`${e.kind}-${t}`;return e.kind===`heading`?(0,f.jsx)(`h${e.level}`,{children:Cr(e.content)},n):e.kind===`paragraph`?(0,f.jsx)(`p`,{children:Cr(e.content)},n):e.kind===`list`?(0,f.jsx)(e.ordered?`ol`:`ul`,{children:e.items.map((e,t)=>(0,f.jsx)(`li`,{children:Cr(e)},t))},n):e.kind===`quote`?(0,f.jsx)(`blockquote`,{children:Cr(e.content)},n):e.kind===`code`?(0,f.jsx)(`pre`,{children:(0,f.jsx)(`code`,{"data-language":e.language??void 0,children:e.content})},n):e.kind===`table`?(0,f.jsx)(`div`,{className:`operations-prd-markdown-table`,children:(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsx)(`tr`,{children:e.headers.map((e,t)=>(0,f.jsx)(`th`,{children:Cr(e)},t))})}),(0,f.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,f.jsx)(`tr`,{children:e.map((e,t)=>(0,f.jsx)(`td`,{children:Cr(e)},t))},t))})]})},n):(0,f.jsx)(`hr`,{},n)})})}function br(e){let t=e.replace(/\r\n/g,`
|
|
11
11
|
`).split(`
|
|
12
12
|
`),n=[],r=[],i=()=>{let e=r.join(` `).trim();e&&n.push({kind:`paragraph`,content:e}),r=[]};for(let e=0;e<t.length;e+=1){let a=t[e]??``,o=a.match(/^(#{1,3})\s+(.+)$/);if(o){i(),n.push({kind:`heading`,level:(o[1]??`#`).length,content:o[2]??``});continue}if(/^\s*(```|~~~)/.test(a)){i();let r=a.trim().slice(0,3),o=[],s=a.trim().slice(3).trim()||null;for(;++e<t.length&&!(t[e]??``).trim().startsWith(r);)o.push(t[e]??``);n.push({kind:`code`,content:o.join(`
|
|
13
13
|
`),language:s});continue}if(a.includes(`|`)&&e+1<t.length&&xr(t[e+1]??``)){i();let r=Sr(a),o=[];for(e+=2;e<t.length&&(t[e]??``).includes(`|`);)o.push(Sr(t[e]??``)),e+=1;--e,n.push({kind:`table`,headers:r,rows:o});continue}let s=a.match(/^\s*(?:([-*+])|(\d+)\.)\s+(.+)$/);if(s){i();let r=!!s[2],a=[s[3]??``];for(;e+1<t.length;){let n=(t[e+1]??``).match(/^\s*(?:([-*+])|(\d+)\.)\s+(.+)$/);if(!n||!!n[2]!==r)break;a.push(n[3]??``),e+=1}n.push({kind:`list`,ordered:r,items:a});continue}if(/^\s*>\s?/.test(a)){i(),n.push({kind:`quote`,content:a.replace(/^\s*>\s?/,``)});continue}if(/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/.test(a)){i(),n.push({kind:`rule`});continue}if(!a.trim()){i();continue}r.push(a.trim())}return i(),n}function xr(e){return Sr(e).every(e=>/^:?-{3,}:?$/.test(e.replace(/\s/g,``)))}function Sr(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function Cr(e){return e.split(/(\*\*[^*]+\*\*|`[^`]+`|\*[^*]+\*|\[[^\]]+\]\([^\s)]+\))/g).map((e,t)=>{if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,f.jsx)(`strong`,{children:e.slice(2,-2)},t);if(e.startsWith("`")&&e.endsWith("`"))return(0,f.jsx)(`code`,{children:e.slice(1,-1)},t);if(e.startsWith(`*`)&&e.endsWith(`*`))return(0,f.jsx)(`em`,{children:e.slice(1,-1)},t);let n=e.match(/^\[([^\]]+)\]\(([^\s)]+)\)$/);return n?(0,f.jsx)(`a`,{href:n[2],rel:`noreferrer`,target:`_blank`,children:n[1]},t):(0,f.jsx)(l.Fragment,{children:e},t)})}function wr(e,t){let n=new Map(e.map(e=>[e.key,e]));for(let e of t??[])n.has(e)||n.set(e,Tr(e));return[...n.values()].sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at)||e.label.localeCompare(t.label))}function Tr(e){return{key:e,label:e,latest_started_at:``,run_count:0,task_count:0,prd_count:0,spec_count:0,evidence_count:0,test_count:0,event_count:0,total_tokens:null,estimated_usd:null,estimated_brl:null,duration_ms:null,coverage:{events:0,tokens:0,usd:0,brl:0}}}function Er(e){let t=e?.trim().toLowerCase();return!t||t===`unknown`||t===`codex`?`openai`:t}var Dr={events:0,tokens:0,usd:0,brl:0};function Or(e,t){let n=new Map;for(let e of t)e.task_id!==null&&n.set(e.task_id,[...n.get(e.task_id)??[],e]);return e.filter(e=>n.has(e.id)).map(e=>kr(e,n.get(e.id)??[])).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function kr(e,t){return{key:e.id,label:e.title,latest_started_at:e.created_at,run_count:t.length,task_count:1,prd_count:0,spec_count:0,evidence_count:0,test_count:e.test_count??0,event_count:t.reduce((e,t)=>e+t.event_count,0),total_tokens:Ar(t.map(e=>e.total_tokens)),estimated_usd:Ar(t.map(e=>e.estimated_usd)),estimated_brl:Ar(t.map(e=>e.estimated_brl)),duration_ms:Ar(t.map(e=>e.duration_ms)),coverage:t.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),Dr)}}function Ar(e){return e.length===0||e.some(e=>e===null)?null:e.reduce((e,t)=>e+t,0)}var jr=[`#00b0f0`,`#5ea7ff`,`#a78bfa`,`#f5c451`,`#fb7185`,`#94a3b8`];function Mr({rows:e,daily:t,models:n,currency:r,locale:i}){let a=Nr(i),o=[[a.input,Br(e.map(e=>e.input_tokens))],[a.cache,Br(e.map(e=>e.cached_input_tokens))],[a.output,Br(e.map(e=>e.output_tokens))],[a.reasoning,Br(e.map(e=>e.reasoning_tokens))]],s=Ir(n,r),c=Math.max(1,...s.map(e=>Fr(e,r)??0)),l=Lr(t,r),u=Math.max(1,...l.map(e=>e.value)),d=l.map((e,t)=>({...e,x:t/(l.length-1)*100,y:82-e.value/u*58})),p=d.map(e=>`${e.x},${e.y}`).join(` `);return(0,f.jsxs)(`section`,{className:`cost-chart-grid`,"aria-label":a.analyticsView,children:[(0,f.jsxs)(`article`,{className:`cost-chart cost-chart-trend`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:a.trend}),(0,f.jsx)(`h2`,{children:a.dailyCost})]}),(0,f.jsx)(`strong`,{children:a.sevenDays})]}),(0,f.jsxs)(`div`,{className:`cost-trend-plot`,children:[(0,f.jsxs)(`svg`,{className:`cost-line-chart`,role:`img`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,children:[(0,f.jsx)(`title`,{children:a.dailyCostChart}),(0,f.jsx)(`defs`,{children:(0,f.jsxs)(`linearGradient`,{id:`cost-area`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,f.jsx)(`stop`,{stopColor:`#00b0f0`,stopOpacity:`.34`}),(0,f.jsx)(`stop`,{offset:`1`,stopColor:`#00b0f0`,stopOpacity:`0`})]})}),(0,f.jsx)(`polygon`,{fill:`url(#cost-area)`,points:`0,100 ${p} 100,100`}),(0,f.jsx)(`polyline`,{fill:`none`,points:p,stroke:`#00b0f0`,strokeWidth:`2`,vectorEffect:`non-scaling-stroke`})]}),d.map((e,t)=>(0,f.jsx)(`span`,{className:`cost-trend-value${t===0?` is-first`:t===d.length-1?` is-last`:``}`,style:{left:`${e.x}%`,top:`${e.y}%`},children:k(e.value,r,i)},e.key))]}),(0,f.jsx)(`div`,{className:`cost-trend-days`,children:d.map(e=>(0,f.jsx)(`span`,{children:zr(e.date,i)},e.key))})]}),(0,f.jsxs)(`article`,{className:`cost-chart cost-chart-model`,children:[(0,f.jsx)(`header`,{children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:a.distribution}),(0,f.jsx)(`h2`,{children:a.costByModel})]})}),(0,f.jsx)(`div`,{className:`cost-bar-list`,children:s.slice(0,6).map((e,t)=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e.label}),(0,f.jsx)(`i`,{children:(0,f.jsx)(`b`,{style:{width:`${(Fr(e,r)??0)/c*100}%`,background:jr[t]}})}),(0,f.jsx)(`strong`,{children:k(Fr(e,r),r,i)})]},e.key))})]}),(0,f.jsxs)(`article`,{className:`cost-chart`,children:[(0,f.jsx)(`header`,{children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:a.composition}),(0,f.jsx)(`h2`,{children:a.tokenMix})]})}),(0,f.jsx)(`div`,{className:`token-mix`,children:o.map(([e,t],n)=>(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`i`,{style:{background:jr[n]}}),(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:O(t,i)})]},e))})]}),(0,f.jsxs)(`article`,{className:`cost-chart cost-chart-phases`,children:[(0,f.jsx)(`header`,{children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:a.phases}),(0,f.jsx)(`h2`,{children:a.totalsByPhase})]})}),(0,f.jsx)(`div`,{className:`phase-strip`,children:[`conversation`,`planning`,`execution`].map((t,n)=>{let a=e.filter(e=>e.phase===t),o=Br(a.map(e=>e.duration_ms)),s=Br(a.map(e=>e.total_tokens)),c=Br(a.map(e=>r===`BRL`?e.estimated_brl:e.estimated_usd));return(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`phase-name`,children:[(0,f.jsx)(`i`,{style:{background:jr[n]}}),(0,f.jsx)(`span`,{children:Pr(t,i)})]}),(0,f.jsxs)(`dl`,{className:`phase-metrics`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:i===`pt-BR`?`Tempo`:`Time`}),(0,f.jsx)(`dd`,{children:D(o,i)})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:`Tokens`}),(0,f.jsx)(`dd`,{children:O(s,i)})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`dt`,{children:i===`pt-BR`?`Custo`:`Cost`}),(0,f.jsx)(`dd`,{children:k(c,r,i)})]})]})]},t)})})]})]})}function Nr(e){return e===`pt-BR`?{analyticsView:`Visão analítica`,trend:`TENDÊNCIA`,dailyCost:`Custo diário`,sevenDays:`7 dias`,dailyCostChart:`Custo diário dos últimos 7 dias`,distribution:`DISTRIBUIÇÃO`,costByModel:`Custo por modelo`,composition:`COMPOSIÇÃO`,tokenMix:`Mix de tokens`,phases:`FASES`,totalsByPhase:`Totais por fase`,input:`Entrada`,cache:`Cache`,output:`Saída`,reasoning:`Raciocínio`}:{analyticsView:`Analytics overview`,trend:`TREND`,dailyCost:`Daily cost`,sevenDays:`7 days`,dailyCostChart:`Daily cost for the last 7 days`,distribution:`DISTRIBUTION`,costByModel:`Cost by model`,composition:`COMPOSITION`,tokenMix:`Token mix`,phases:`PHASES`,totalsByPhase:`Totals by phase`,input:`Input`,cache:`Cache`,output:`Output`,reasoning:`Reasoning`}}function Pr(e,t){return t===`en-US`?e===`conversation`?`Conversation`:e===`planning`?`Planning`:`Execution`:e===`conversation`?`Conversa`:e===`planning`?`Planejamento`:`Execução`}function Fr(e,t){return t===`BRL`?e.estimated_brl:e.estimated_usd}function Ir(e,t){return e.filter(e=>Fr(e,t)!==null)}function Lr(e,t,n=new Date){let r=new Map(e.map(e=>[e.key,Fr(e,t)??0]));return Array.from({length:7},(e,t)=>{let i=new Date(n.getFullYear(),n.getMonth(),n.getDate()-(6-t)),a=Rr(i);return{date:i,key:a,value:r.get(a)??0}})}function Rr(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function zr(e,t){return new Intl.DateTimeFormat(t,{weekday:`short`,day:`2-digit`,month:`2-digit`}).format(e).replace(`.`,``)}function Br(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0):null}var Vr={query:``,provider:``,phase:``,origin:``,workType:``,agent:``,model:``,status:``,priority:``,risk:``};function Hr({available:e,hideQuery:t=!1,locale:n,value:r,onChange:i}){let a=(e,t)=>i({...r,[e]:t}),o=n===`en-US`?{search:`Search costs`,placeholder:`Run, task, model…`,agent:`Agent`,model:`Model`,priority:`Priority`,risk:`Risk`,phase:`Phase`,origin:`Origin`,work:`Work`,all:`All`,clear:`Clear`}:{search:`Buscar custos`,placeholder:`Run, task, modelo…`,agent:`Agente`,model:`Modelo`,priority:`Prioridade`,risk:`Risco`,phase:`Fase`,origin:`Entrada`,work:`Trabalho`,all:`Todos`,clear:`Limpar`};return(0,f.jsxs)(`section`,{className:`cost-filters`,children:[t?null:(0,f.jsx)(`input`,{"aria-label":o.search,onChange:e=>a(`query`,e.target.value),placeholder:o.placeholder,value:r.query}),(0,f.jsx)(Ur,{allLabel:o.all,label:`Provider`,onChange:e=>a(`provider`,e),options:e.providers,value:r.provider}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.agent,onChange:e=>a(`agent`,e),options:e.agents,value:r.agent}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.model,onChange:e=>a(`model`,e),options:e.models,value:r.model}),(0,f.jsx)(Ur,{label:`Status`,allLabel:o.all,onChange:e=>a(`status`,e),options:e.statuses,value:r.status}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.priority,onChange:e=>a(`priority`,e),options:e.priorities,value:r.priority}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.risk,onChange:e=>a(`risk`,e),options:e.risks,value:r.risk}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.phase,onChange:e=>a(`phase`,e),options:e.phases,value:r.phase}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.origin,onChange:e=>a(`origin`,e),options:e.origins,value:r.origin}),(0,f.jsx)(Ur,{allLabel:o.all,label:o.work,onChange:e=>a(`workType`,e),options:e.work_types,value:r.workType}),(0,f.jsx)(`button`,{onClick:()=>i(Vr),type:`button`,children:o.clear})]})}function Ur({allLabel:e=`Todos`,label:t,value:n,options:r,onChange:i}){return(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:t}),(0,f.jsxs)(`select`,{onChange:e=>i(e.target.value),value:n,children:[(0,f.jsx)(`option`,{value:``,children:e}),r.map(e=>(0,f.jsx)(`option`,{value:e,children:e},e))]})]})}function Wr(e,t,n){let r=new Map(e.map(e=>[e.key,{...e}])),i=new Map,a=e=>{let t=Jr(e,n);if(t===null)return null;let i=r.get(t);if(i!==void 0)return i;let a={key:t,label:t,latest_started_at:Yr(t,n),run_count:0,task_count:0,event_count:0,total_tokens:null,estimated_usd:null,estimated_brl:null,duration_ms:null,coverage:{events:0,tokens:0,usd:0,brl:0},prd_count:0,spec_count:0,evidence_count:0,test_count:0};return r.set(t,a),a};for(let e of t.prds){let t=a(e.created_at);t!==null&&(t.prd_count+=1)}for(let e of t.specs){let t=a(e.created_at);t!==null&&(t.spec_count+=1)}for(let e of t.tasks){let t=a(e.created_at);if(t===null)continue;t.test_count+=e.test_count??0;let n=i.get(t.key)??new Set;for(let t of e.result?.evidence_ids??[])n.add(t);i.set(t.key,n)}for(let[e,t]of i){let n=r.get(e);n!==void 0&&(n.evidence_count=t.size)}return[...r.values()].sort((e,t)=>t.key.localeCompare(e.key))}function Gr(e,t){let n=e.length;return{tasks:n===0?null:e.reduce((e,t)=>e+t.task_count,0)/n,specs:n===0?null:e.reduce((e,t)=>e+t.spec_count,0)/n,prds:n===0?null:e.reduce((e,t)=>e+t.prd_count,0)/n,durationMs:qr(e.map(e=>e.duration_ms),n),tokens:Kr(e.map(e=>e.total_tokens)),cost:Kr(e.map(e=>t===`BRL`?e.estimated_brl:e.estimated_usd))}}function Kr(e){let t=e.filter(e=>e!==null);return t.length===0?null:t.reduce((e,t)=>e+t,0)/t.length}function qr(e,t){return t===0?null:e.reduce((e,t)=>e+(t??0),0)/t}function Jr(e,t){return e===null||!/^\d{4}-\d{2}-\d{2}/.test(e)?null:t===`annual`?e.slice(0,4):t===`monthly`?e.slice(0,7):e.slice(0,10)}function Yr(e,t){return t===`annual`?`${e}-01-01T00:00:00.000Z`:t===`monthly`?`${e}-01T00:00:00.000Z`:`${e}T00:00:00.000Z`}function Xr({currency:e,locale:t,period:n,rows:r}){let i=Gr(r,e);return(0,f.jsx)(j,{ariaLabel:Zr(n,t),metrics:[{label:Qr(t===`pt-BR`?`Tarefas`:`Tasks`,n,t),value:ne(i.tasks,t,1)},{label:Qr(`SPECs`,n,t),value:ne(i.specs,t,1)},{label:Qr(`PRDs`,n,t),value:ne(i.prds,t,1)},{label:Qr(t===`pt-BR`?`Tempo`:`Time`,n,t),value:te(i.durationMs,t)},{label:Qr(`Tokens`,n,t),value:O(i.tokens,t)},{label:Qr(t===`pt-BR`?`Custo`:`Cost`,n,t),value:k(i.cost,e,t)}]})}function Zr(e,t){return t===`en-US`?e===`daily`?`Daily averages`:e===`monthly`?`Monthly averages`:`Annual averages`:e===`daily`?`Médias por dia`:e===`monthly`?`Médias por mês`:`Médias por ano`}function Qr(e,t,n){return n===`en-US`?`${e} ${t===`daily`?`Daily average`:t===`monthly`?`Monthly average`:`Annual average`}`:`${e} ${t===`daily`?`Médio por dia`:t===`monthly`?`Médio por mês`:`Médio por ano`}`}function $r({overview:e,currency:t,locale:n}){let r=n===`pt-BR`,i=t===`BRL`?e.estimated_brl:e.estimated_usd;return(0,f.jsx)(`section`,{"aria-label":`Resumo de custos`,className:`cost-summary`,children:[[r?`Custo estimado`:`Estimated cost`,k(i,t,n),r?`Período atual · custo observado`:`Current period · observed cost`],[`Tokens`,O(e.total_tokens,n),r?`${e.coverage.tokens}/${e.event_count} eventos · ${O(e.known_tokens_per_cycle,n)} tokens/ciclo`:`${e.coverage.tokens}/${e.event_count} events · ${O(e.known_tokens_per_cycle,n)} tokens/cycle`],[r?`BRL registrado`:`Recorded BRL`,k(e.recorded_brl,`BRL`,n),r?`Histórico fixado no registro`:`Historical value fixed when recorded`],[r?`Tarefas`:`Tasks`,String(e.task_count),r?`${e.task_count} no período`:`${e.task_count} in period`],[r?`Chamadas de Agentes`:`Agent Calls`,String(e.run_count),r?`${e.event_count} segmentos de uso · top 10 = ${ei(e.top_10_token_share,n)}`:`${e.event_count} usage segments · top 10 = ${ei(e.top_10_token_share,n)}`]].map(([e,t,n])=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{children:e}),(0,f.jsx)(`strong`,{children:t}),(0,f.jsx)(`small`,{children:n})]},e))})}function ei(e,t){return e===null?`—`:new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1}).format(e)}function ti({rows:e,locale:t}){let n=new Map;for(let r of e){let e=ri(r.model,t);e===null||!ii(r)||n.set(e,[...n.get(e)??[],r])}let r=[...n].map(([e,n])=>{let r=e=>n.reduce((t,n)=>{let r=n[e];return typeof r==`number`?(t??0)+r:t},null),i=r(`input_tokens`),a=r(`cached_input_tokens`),o=r(`output_tokens`),s=r(`input_cost_usd`),c=r(`cached_input_cost_usd`),l=r(`output_cost_usd`),u=r(`reasoning_cost_usd`),d=r(`estimated_usd`),f=r(`estimated_brl`),p=B(n.map(wi));return{model:e,runs:n.length,durationMs:ni(n),input:i,cached:a,output:o,reasoning:r(`reasoning_tokens`),total:r(`total_tokens`),inputUsd:s,cacheUsd:c,outputUsd:l,reasoningUsd:u,contextUpliftUsd:p,speedUpliftUsd:r(`speed_uplift_usd`),estimatedUsd:d,estimatedBrl:f,scenario:Ei(n,t)}}).sort((e,t)=>e.model.localeCompare(t.model));return(0,f.jsx)(C,{columns:[{key:`model`,label:`Modelo`,render:e=>e.model,sortValue:e=>e.model,footer:`Total`,description:Ti(t,`Modelo efetivamente identificado nas chamadas de agentes agregadas nesta linha. Runs sem modelo identificável são agrupadas como Indefinido.`,`Model identified in the agent calls aggregated in this row. Runs without an identifiable model are grouped as Undefined.`)},{key:`scenario`,hidden:!0,label:t===`pt-BR`?`Velocidade`:`Speed`,render:e=>e.scenario,sortValue:e=>e.scenario,description:Ti(t,`Velocidade observada nas chamadas de agentes. Misto indica que o grupo contém mais de um cenário de velocidade.`,`Speed observed in agent calls. Mixed indicates that the group contains more than one speed scenario.`)},{key:`runs`,label:t===`pt-BR`?`Chamadas de Agentes`:`Agent Calls`,render:e=>e.runs,sortValue:e=>e.runs,align:`right`,footer:r.reduce((e,t)=>e+t.runs,0)},{key:`durationMs`,label:t===`pt-BR`?`Tempo de processamento`:`Processing time`,render:e=>D(e.durationMs),sortValue:e=>e.durationMs,description:Ti(t,`Soma do tempo observado nas Runs raiz de orquestração atribuídas a este modelo. Intake e Sub-Runs são excluídos para evitar sobreposição.`,`Sum of the observed time for root orchestration Runs attributed to this model. Intake and Sub-Runs are excluded to avoid overlap.`),align:`right`,footer:D(B(r.map(e=>e.durationMs)))},{key:`input`,label:t===`pt-BR`?`Tokens de entrada`:`Input tokens`,render:e=>si(e.input,t),sortValue:e=>e.input,align:`right`,footer:si(B(r.map(e=>e.input)),t)},{key:`cache`,label:t===`pt-BR`?`Tokens em cache`:`Cached tokens`,render:e=>si(e.cached,t),sortValue:e=>e.cached,description:Ti(t,`Parcela dos tokens de entrada atendida pelo cache. Ela está contida em Tokens de entrada e não deve ser somada novamente ao total de tokens.`,`Share of input tokens served from cache. It is included in Input tokens and must not be added to the token total again.`),align:`right`,footer:si(B(r.map(e=>e.cached)),t)},{key:`output`,label:t===`pt-BR`?`Tokens de saída`:`Output tokens`,render:e=>si(e.output,t),sortValue:e=>e.output,align:`right`,footer:si(B(r.map(e=>e.output)),t)},{key:`reasoning`,label:t===`pt-BR`?`Tokens de raciocínio`:`Reasoning tokens`,render:e=>si(e.reasoning,t),sortValue:e=>e.reasoning,description:Ti(t,`Tokens internos de raciocínio reportados pelo provedor. São parte da saída e aparecem separados para auditoria, sem duplicar o total de tokens.`,`Internal reasoning tokens reported by the provider. They are part of the output and are shown separately for auditing without duplicating the token total.`),align:`right`,footer:si(B(r.map(e=>e.reasoning)),t)},{key:`total`,label:t===`pt-BR`?`Total de tokens`:`Total tokens`,render:e=>si(e.total,t),sortValue:e=>e.total,description:Ti(t,`Total auditável calculado como tokens de entrada mais tokens de saída. Cache e raciocínio são subconjuntos e não são adicionados novamente.`,`Auditable total calculated as input tokens plus output tokens. Cache and reasoning are subsets and are not added again.`),align:`right`,footer:si(B(r.map(e=>e.total)),t)},{key:`inputUsd`,label:t===`pt-BR`?`Custo entrada (USD)`:`Input cost (USD)`,render:e=>z(e.inputUsd,t),sortValue:e=>e.inputUsd,align:`right`,footer:z(B(r.map(e=>e.inputUsd)),t)},{key:`cacheUsd`,label:t===`pt-BR`?`Custo cache (USD)`:`Cache cost (USD)`,render:e=>z(e.cacheUsd,t),sortValue:e=>e.cacheUsd,align:`right`,footer:z(B(r.map(e=>e.cacheUsd)),t)},{key:`outputUsd`,label:t===`pt-BR`?`Custo saída (USD)`:`Output cost (USD)`,render:e=>z(e.outputUsd,t),sortValue:e=>e.outputUsd,align:`right`,footer:z(B(r.map(e=>e.outputUsd)),t)},{key:`reasoningUsd`,label:t===`pt-BR`?`Custo raciocínio (USD)`:`Reasoning cost (USD)`,render:e=>z(e.reasoningUsd,t),sortValue:e=>e.reasoningUsd,align:`right`,footer:z(B(r.map(e=>e.reasoningUsd)),t)},{key:`contextUpliftUsd`,label:t===`pt-BR`?`Acréscimo contexto incluído (USD)`:`Included context uplift (USD)`,render:e=>z(e.contextUpliftUsd,t),sortValue:e=>e.contextUpliftUsd,description:Ti(t,`Parcela adicional causada pelos multiplicadores de contexto. Ela já está incluída nos custos e no Total (USD); não deve ser somada novamente. O cálculo usa os segmentos de uso internos de cada Agent Run, sem criar uma visão separada de Calls; multiplicadores 1× / 1× resultam em US$ 0,00.`,`Additional amount caused by context multipliers. It is already included in costs and Total (USD) and must not be added again. The calculation uses each Agent Run's internal usage segments without creating a separate Calls view; 1× / 1× multipliers result in US$0.00.`),align:`right`,footer:z(B(r.map(e=>e.contextUpliftUsd)),t)},{key:`speedUpliftUsd`,label:t===`pt-BR`?`Acréscimo velocidade incluído (USD)`:`Included speed uplift (USD)`,render:e=>z(e.speedUpliftUsd,t),sortValue:e=>e.speedUpliftUsd,description:Ti(t,`Diferença entre o custo efetivo Priority/Fast e o custo Standard equivalente. Já está incluída nos custos efetivos e no Total (USD); é separada apenas como referência.`,`Difference between the effective Priority/Fast cost and the equivalent Standard cost. It is already included in effective costs and Total (USD) and is separated only for reference.`),align:`right`,footer:z(B(r.map(e=>e.speedUpliftUsd)),t)},{key:`estimatedUsd`,label:t===`pt-BR`?`Custo Final no Período`:`Period final cost`,render:e=>z(e.estimatedUsd,t),sortValue:e=>e.estimatedUsd,description:Ti(t,`Custo efetivo total em USD, incluindo tarifas de contexto e velocidade quando aplicáveis.`,`Total effective cost in USD, including context and speed rates when applicable.`),align:`right`,footer:z(B(r.map(e=>e.estimatedUsd)),t)},{key:`estimatedBrl`,label:t===`pt-BR`?`Custo Final atual`:`Current final cost`,render:e=>k(e.estimatedBrl,`BRL`,t),sortValue:e=>e.estimatedBrl,description:Ti(t,`Conversão do Total (USD) pela cotação atual configurada no projeto.`,`Conversion of Total (USD) using the current exchange rate configured for the project.`),align:`right`,footer:k(B(r.map(e=>e.estimatedBrl)),`BRL`,t)}],locale:t,rowKey:e=>e.model,rows:r,showColumnInfo:!0,sortable:!0})}function ni(e){return B(e.filter(ai).map(e=>e.duration_ms))}function ri(e,t){if(Si(e))return e;let n=e.trim().toLowerCase();return n.length===0||n===`unknown`?t===`pt-BR`?`Indefinido`:`Undefined`:null}function ii(e){return Ci(e)||ai(e)&&e.duration_ms!==null}function ai(e){return e.run_kind===`run`&&e.run_purpose===`orchestration`}function oi(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.5`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.5`})]})}function si(e,t){return e===null||e<=0?`-`:new Intl.NumberFormat(t,{maximumFractionDigits:0}).format(e)}function ci(e,t,n){return e===`BRL`?t:n}function li(e){return e.prd_id===null?e.spec_id===null?{label:`Tarefa avulsa`,tone:`task`}:{label:`SPEC`,tone:`spec`}:{label:`PRD`,tone:`prd`}}function ui({rows:e,onOpenRun:t,currency:n,locale:r,compact:i=!1}){let a=t=>B(e.map(e=>e[t])),o=t=>!i||di(e,t);return(0,f.jsx)(C,{columns:[{key:`startedAt`,label:r===`pt-BR`?`Data e hora`:`Date and time`,render:e=>vi(e.started_at,r),footer:`Total`},{key:`run`,label:`Run`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.run_id}),(0,f.jsx)(`small`,{children:e.task_title})]})},{key:`origin`,label:r===`pt-BR`?`Origem`:`Origin`,render:e=>{let t=li(e);return(0,f.jsx)(`span`,{className:`cost-run-origin cost-run-origin-${t.tone}`,children:t.label})}},{key:`duration`,label:r===`pt-BR`?`Tempo de execução`:`Execution time`,render:e=>e.duration_ms===null||e.duration_ms<=0?`-`:D(e.duration_ms),align:`right`,footer:D(a(`duration_ms`)),hidden:!o(e=>e.duration_ms)},{key:`agent`,label:r===`pt-BR`?`Agente`:`Agent`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.agent_name}),(0,f.jsx)(`small`,{children:`${e.run_kind===`run`?`Run`:`Sub-Run`} · ${e.run_purpose}`})]})},{key:`model`,label:`Modelo`,render:e=>{let t=xi(e);return t.detail===`-`?(0,f.jsx)(`strong`,{children:t.primary}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:t.primary}),(0,f.jsx)(`small`,{children:t.detail})]})}},{key:`effort`,label:r===`pt-BR`?`Esforço`:`Effort`,render:e=>_i(e.effective_reasoning_effort,`effort`,r),hidden:!o(e=>e.effective_reasoning_effort)},{key:`speed`,label:r===`pt-BR`?`Velocidade`:`Speed`,render:e=>_i(e.service_tier,`speed`,r),hidden:!o(e=>e.service_tier)},{key:`inputTokens`,label:r===`pt-BR`?`Tokens entrada`:`Input tokens`,render:e=>si(e.input_tokens,r),align:`right`,footer:si(a(`input_tokens`),r),hidden:!o(e=>e.input_tokens)},{key:`cachedInputTokens`,label:r===`pt-BR`?`Tokens cache`:`Cached tokens`,render:e=>si(e.cached_input_tokens,r),align:`right`,footer:si(a(`cached_input_tokens`),r),hidden:!o(e=>e.cached_input_tokens)},{key:`uncachedInputTokens`,label:r===`pt-BR`?`Entrada sem cache`:`Uncached input`,render:e=>si(e.uncached_input_tokens,r),align:`right`,footer:si(a(`uncached_input_tokens`),r),hidden:!o(e=>e.uncached_input_tokens)},{key:`outputTokens`,label:r===`pt-BR`?`Tokens saída`:`Output tokens`,render:e=>si(e.output_tokens,r),align:`right`,footer:si(a(`output_tokens`),r),hidden:!o(e=>e.output_tokens)},{key:`reasoningTokens`,label:r===`pt-BR`?`Tokens raciocínio`:`Reasoning tokens`,render:e=>si(e.reasoning_tokens,r),align:`right`,footer:si(a(`reasoning_tokens`),r),hidden:!o(e=>e.reasoning_tokens)},{key:`visibleOutputTokens`,label:r===`pt-BR`?`Saída visível`:`Visible output`,render:e=>si(e.visible_output_tokens,r),align:`right`,footer:si(a(`visible_output_tokens`),r),hidden:!o(e=>e.visible_output_tokens)},{key:`totalTokens`,label:`Total tokens`,render:e=>si(e.input_tokens!==null&&e.output_tokens!==null?e.input_tokens+e.output_tokens:e.total_tokens,r),align:`right`,footer:si(a(`total_tokens`),r),hidden:!o(e=>e.total_tokens)},{key:`inputRate`,label:`USD/M entrada`,render:e=>fi(e.input_rate_usd_per_million,r),align:`right`,hidden:!o(e=>e.input_rate_usd_per_million)},{key:`cacheRate`,label:`USD/M cache`,render:e=>fi(e.cached_input_rate_usd_per_million,r),align:`right`,hidden:!o(e=>e.cached_input_rate_usd_per_million)},{key:`outputRate`,label:`USD/M saída`,render:e=>fi(e.output_rate_usd_per_million,r),align:`right`,hidden:!o(e=>e.output_rate_usd_per_million)},{key:`reasoningRate`,label:`USD/M raciocínio`,render:e=>fi(e.reasoning_rate_usd_per_million,r),align:`right`,hidden:!o(e=>e.reasoning_rate_usd_per_million)},{key:`contextMultiplier`,label:`Mult. contexto E/S`,description:Ti(r,`Multiplicadores aplicados aos segmentos de uso desta Agent Run quando o limite de contexto do modelo é ultrapassado. O total da Run agrega os segmentos sem expor cada Call.`,`Multipliers applied to this Agent Run's usage segments when the model context limit is exceeded. The Run total aggregates those segments without exposing each Call.`),render:e=>gi(e.context_input_multiplier,e.context_output_multiplier),align:`right`,hidden:!o(e=>e.context_input_multiplier)},{key:`speedMultiplier`,label:r===`pt-BR`?`Cenário velocidade API`:`API speed scenario`,description:Ti(r,`Cenário de preço efetivo observado nesta Agent Run. Priority/Fast pode elevar as tarifas em relação ao cenário Standard.`,`Effective pricing scenario observed in this Agent Run. Priority/Fast may increase rates compared with the Standard scenario.`),render:e=>hi(e.service_tier,r),align:`right`,hidden:!o(e=>e.service_tier)},{key:`inputCost`,label:`USD entrada`,render:e=>z(e.input_cost_usd,r),align:`right`,footer:z(a(`input_cost_usd`),r),hidden:!o(e=>e.input_cost_usd)},{key:`cacheCost`,label:`USD cache`,render:e=>z(e.cached_input_cost_usd,r),align:`right`,footer:z(a(`cached_input_cost_usd`),r),hidden:!o(e=>e.cached_input_cost_usd)},{key:`outputCost`,label:`USD saída`,render:e=>z(e.output_cost_usd,r),align:`right`,footer:z(a(`output_cost_usd`),r),hidden:!o(e=>e.output_cost_usd)},{key:`reasoningCost`,label:`USD raciocínio`,render:e=>z(e.reasoning_cost_usd,r),align:`right`,footer:z(a(`reasoning_cost_usd`),r),hidden:!o(e=>e.reasoning_cost_usd)},{key:`standardCost`,label:`USD padrão`,render:e=>z(e.standard_cost_usd,r),align:`right`,footer:z(a(`standard_cost_usd`),r),hidden:!o(e=>e.standard_cost_usd)},{key:`speedUplift`,label:`USD acréscimo rápido`,description:Ti(r,`Parcela adicional causada pela velocidade Priority/Fast. Este valor já está incluído no custo efetivo e no total; é exibido separadamente apenas para auditoria.`,`Additional amount caused by Priority/Fast speed. This value is already included in the effective cost and total; it is shown separately for auditing only.`),render:e=>z(e.speed_uplift_usd,r),align:`right`,footer:z(a(`speed_uplift_usd`),r),hidden:!o(e=>e.speed_uplift_usd)},{key:`finalUsd`,label:r===`pt-BR`?`USD estimado API`:`Estimated API USD`,render:e=>z(e.estimated_usd,r),align:`right`,footer:z(a(`estimated_usd`),r),hidden:!o(e=>e.estimated_usd)},{key:`fxRate`,label:r===`pt-BR`?`Cotação atual`:`Current exchange rate`,render:e=>pi(e.fx_rate,r),align:`right`,hidden:!o(e=>e.fx_rate)},{key:`recordedFxRate`,label:r===`pt-BR`?`Cotação no período`:`Period exchange rate`,render:e=>pi(e.recorded_fx_rate,r),align:`right`,hidden:!o(e=>e.recorded_fx_rate)},{key:`recordedBrl`,label:r===`pt-BR`?`Custo Final no Período`:`Period final cost`,render:e=>k(e.recorded_brl,`BRL`,r),align:`right`,footer:k(a(`recorded_brl`),`BRL`,r),hidden:!o(e=>e.recorded_brl)},{key:`cost`,label:r===`pt-BR`?`Custo Final atual`:`Current final cost`,render:e=>{let t=n===`BRL`?e.estimated_brl:e.estimated_usd;return t===null||t<=0?`-`:k(t,n,r)},sortValue:e=>ci(n,e.estimated_brl,e.estimated_usd),align:`right`,footer:k(a(n===`BRL`?`estimated_brl`:`estimated_usd`),n,r),hidden:!o(e=>n===`BRL`?e.estimated_brl:e.estimated_usd)},{key:`trace`,label:``,render:e=>(0,f.jsx)(`button`,{"aria-label":`Abrir detalhes da Run`,className:`cost-row-action`,onClick:n=>{n.stopPropagation(),t(e.run_id)},type:`button`,children:(0,f.jsx)(oi,{})})}],locale:r,rowKey:e=>e.run_id,onRowClick:e=>t(e.run_id),rows:e,showColumnInfo:!0,sortable:!0})}function di(e,t){return e.some(e=>{let n=t(e);return n!==null&&n!==0&&n!==``})}function fi(e,t){return e===null?`-`:new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function pi(e,t){return e===null?`-`:`R$ ${fi(e,t)}`}function z(e,t){return e===null?`-`:new Intl.NumberFormat(t,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function mi(e){return e===null?`-`:`${e.toLocaleString(`en-US`,{maximumFractionDigits:3})}×`}function hi(e,t){return e===`fast`?t===`pt-BR`?`Priority (derivado de Fast)`:`Priority (derived from Fast)`:e===`priority`?`Priority (API)`:e==="default"?`Standard (API)`:`-`}function gi(e,t){return e===null||t===null?`-`:`${mi(e)} / ${mi(t)}`}function _i(e,t,n){return e===null?`-`:n===`pt-BR`?{low:`Leve`,medium:`Médio`,high:`Alto`,xhigh:`Extra alto`,max:`Ultra`,default:`Padrão`,priority:`Rápido`}[e]??e:e}function vi(e,t){return!e||Number.isNaN(Date.parse(e))?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(e))}function yi(e,t,n){if(t===`annual`)return e.slice(0,4);if(t===`monthly`)return e.slice(0,7);let r=new Date(`${e}T12:00:00.000Z`);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(n,{dateStyle:`short`,timeZone:`UTC`}).format(r)}function bi({rows:e,currency:t,locale:n,onOpenTrace:r,period:i,showDateTime:a=!0,dateHeading:o,labelHeading:s}){let c={runs:e.reduce((e,t)=>e+t.run_count,0),tasks:e.reduce((e,t)=>e+t.task_count,0),prds:e.reduce((e,t)=>e+t.prd_count,0),specs:e.reduce((e,t)=>e+t.spec_count,0),evidences:e.reduce((e,t)=>e+t.evidence_count,0),tests:e.reduce((e,t)=>e+t.test_count,0),duration:B(e.map(e=>e.duration_ms)),tokens:B(e.map(e=>e.total_tokens)),usd:B(e.map(e=>e.estimated_usd)),brl:B(e.map(e=>e.estimated_brl))};return(0,f.jsx)(C,{columns:[{key:`latestStartedAt`,label:o??(n===`pt-BR`?`Data e hora`:`Date and time`),render:e=>vi(e.latest_started_at,n),hidden:!a,footer:a?`Total`:void 0},{key:`label`,label:i===void 0?s??(n===`pt-BR`?`Grupo`:`Group`):n===`pt-BR`?`Período`:`Period`,render:e=>i===void 0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.label}),e.key===e.label?null:(0,f.jsx)(`small`,{children:e.key})]}):(0,f.jsx)(`strong`,{children:yi(e.key,i,n)}),sortValue:e=>e.key,footer:a?void 0:`Total`},{key:`runs`,label:`Runs`,render:e=>e.run_count,align:`right`,footer:c.runs},{key:`tasks`,label:`Tasks`,render:e=>e.task_count,align:`right`,footer:c.tasks},...i===void 0?[]:[{key:`prds`,label:`PRDs`,render:e=>e.prd_count,align:`right`,footer:c.prds},{key:`specs`,label:`SPECs`,render:e=>e.spec_count,align:`right`,footer:c.specs},{key:`evidences`,label:n===`pt-BR`?`Evidências`:`Evidence`,render:e=>e.evidence_count,align:`right`,footer:c.evidences},{key:`tests`,label:`Tests`,render:e=>e.test_count,align:`right`,footer:c.tests}],{key:`duration`,label:`Tempo`,render:e=>D(e.duration_ms),align:`right`,footer:D(c.duration)},{key:`tokens`,label:`Tokens`,render:e=>O(e.total_tokens,n),align:`right`,footer:O(c.tokens,n)},{key:`cost`,label:n===`pt-BR`?`Custo`:`Cost`,render:e=>k(t===`BRL`?e.estimated_brl:e.estimated_usd,t,n),sortValue:e=>ci(t,e.estimated_brl,e.estimated_usd),align:`right`,footer:k(t===`BRL`?c.brl:c.usd,t,n)},...r?[{key:`trace`,label:``,render:e=>(0,f.jsx)(`button`,{"aria-label":`Abrir detalhes`,className:`cost-row-action`,onClick:t=>{t.stopPropagation(),r(e.key)},type:`button`,children:(0,f.jsx)(oi,{})})}]:[]],defaultSort:i===void 0?null:{key:`label`,direction:`desc`},locale:n,rowKey:e=>e.key,onRowClick:r===void 0?void 0:e=>r(e.key),rows:e,showColumnInfo:!0,sortable:!0})}function xi(e){return{primary:e.model,detail:e.provider===null||e.provider===`unknown`?`-`:e.provider}}function Si(e){let t=e.trim().toLowerCase();return t.length>0&&![`unknown`,`manual`,`gpt-5`].includes(t)}function Ci(e){return[e.input_tokens,e.cached_input_tokens,e.output_tokens,e.reasoning_tokens,e.total_tokens,e.estimated_usd,e.estimated_brl].some(e=>e!==null&&e>0)}function wi(e){let t=e.context_input_multiplier,n=e.context_output_multiplier;if(t===null||n===null)return null;if(t===1&&n===1)return 0;let r=(e,t)=>{if(t===1)return 0;if(t<=0||e.some(e=>e===null))return null;let n=e.reduce((e,t)=>e+(t??0),0);return n-n/t},i=r([e.input_cost_usd,e.cached_input_cost_usd],t),a=r([e.output_cost_usd,e.reasoning_cost_usd],n);return i===null||a===null?null:i+a}function Ti(e,t,n){return e===`pt-BR`?t:n}function B(e){let t=e.filter(e=>typeof e==`number`);return t.length===0?null:t.reduce((e,t)=>e+t,0)}function Ei(e,t){return new Set(e.map(e=>e.service_tier??`unknown`)).size===1?hi(e[0]?.service_tier??null,t):t===`pt-BR`?`Misto`:`Mixed`}var Di={"pt-BR":{back:`Voltar - Dashboard`,title:`ZAIP Cost Monitor`,subtitle:`Visão Git-native de Custos, Tokens e Tempo de cada Tarefa, SPEC ou PRD.`,refresh:`Atualizar`,refreshing:`Atualizando…`,filters:`Filtros`,settings:`Configurações`,language:`Idioma`,currency:`Moeda`,kicker:`ZAIP-AIOS • COST MONITOR`,heading:`Custos e tokens`,intro:`Telemetria derivada localmente, atribuída por run, tarefa, fase e origem.`,period:`Período`,allTime:`Todo o período`,last7:`Últimos 7 dias`,last30:`Últimos 30 dias`,last90:`Últimos 90 dias`,thisMonth:`Este mês`,observed:`cobertura observada`,noData:`Sem dados no filtro atual.`,tabs:{overview:`Visão geral`,models:`Modelos LLM`,agentCalls:`Chamadas de agentes`,executions:`Execuções`,conversations:`Conversas`,tasks:`Tarefas`,prds:`PRD`,specs:`SPEC`,providers:`Providers`,agents:`Zaip Agentes`,daily:`Diário`,monthly:`Mensal`,annual:`Anual`}},"en-US":{back:`Back - Dashboard`,title:`ZAIP Cost Monitor`,subtitle:`Git-native view of Costs, Tokens and Time for each Task, SPEC, or PRD.`,refresh:`Refresh`,refreshing:`Refreshing…`,filters:`Filters`,settings:`Settings`,language:`Language`,currency:`Currency`,kicker:`ZAIP-AIOS • COST MONITOR`,heading:`Costs and tokens`,intro:`Locally derived telemetry attributed by run, task, phase, and origin.`,period:`Period`,allTime:`All time`,last7:`Last 7 days`,last30:`Last 30 days`,last90:`Last 90 days`,thisMonth:`This month`,observed:`observed coverage`,noData:`No data for the current filter.`,tabs:{overview:`Overview`,models:`Models`,agentCalls:`Agent Calls`,executions:`Executions`,conversations:`Conversations`,tasks:`Tasks`,prds:`PRDs`,specs:`SPECs`,providers:`Providers`,agents:`Agents`,daily:`Daily`,monthly:`Monthly`,annual:`Annual`}}};function Oi(e){return e===`pt-BR`?`BRL`:`USD`}function ki({rows:e,currency:t,details:n,locale:r,onOpenTrace:i}){let[a,o]=(0,l.useState)(null),s=e=>o(e),c=e.reduce((e,t)=>e+t.task_count,0),u=e.reduce((e,t)=>e+t.run_count,0),d=e.reduce((e,t)=>e+(t.usage.total.tokens.total??0),0),p=e.reduce((e,n)=>e+(t===`BRL`?n.usage.total.cost.brl??0:n.usage.total.cost.usd??0),0);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C,{columns:[{key:`createdAt`,label:r===`pt-BR`?`Data e hora`:`Date and time`,render:e=>e.created_at?vi(e.created_at,r):`—`,footer:`Total`},{key:`entity`,label:`Entidade`,render:e=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.id})]})},{key:`status`,label:`Status`,render:e=>e.work_status},{key:`tasks`,label:`Tasks`,render:e=>e.task_count,align:`right`,footer:c},{key:`runs`,label:`Runs`,render:e=>e.run_count,align:`right`,footer:u},{key:`tokens`,label:`Tokens`,render:e=>O(e.usage.total.tokens.total,r),align:`right`,footer:O(d,r)},{key:`cost`,label:`Custo`,render:e=>k(t===`BRL`?e.usage.total.cost.brl:e.usage.total.cost.usd,t,r),sortValue:e=>ci(t,e.usage.total.cost.brl,e.usage.total.cost.usd),align:`right`,footer:k(p,t,r)},{key:`rework`,label:`Retrabalho`,render:e=>A(e.quality.rework_rate),align:`right`},{key:`actions`,label:``,render:e=>(0,f.jsx)(`button`,{"aria-label":`${r===`pt-BR`?`Abrir detalhes do`:`Open details for`} ${e.kind.toUpperCase()}`,className:`cost-row-action`,onClick:t=>{t.stopPropagation(),s(e)},type:`button`,children:(0,f.jsx)(Ai,{})})}],locale:r,rowKey:e=>e.id,onRowClick:s,rows:e,showColumnInfo:!0,sortable:!0}),a?(0,f.jsx)(Gt,{label:a.kind===`prd`?`PRD`:`SPEC`,locale:r,onClose:()=>o(null),onOpenTrace:e=>{o(null),i(e)},row:a,runs:n?.runs??[],specs:n?.specs??e.filter(e=>e.kind===`spec`),tasks:n?.tasks??[]}):null]})}function Ai(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1.5`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.5`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1.5`})]})}var ji=new URL(`/assets/logo_novo_azul-BBx5pA2B.png`,``+import.meta.url).href,Mi=`executions`,V=[`overview`,`executions`,`agentCalls`,`agents`,`models`,`providers`,`tasks`,`specs`,`prds`,`conversations`,`daily`,`monthly`,`annual`];function Ni(e,t){return e.find(e=>e.id===t)??null}function Pi({locale:e}){return e===`pt-BR`?(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#18864b`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`m12 3.8 8.2 8.2L12 20.2 3.8 12 12 3.8Z`,fill:`#f6d64a`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`#1b4f9c`,r:`4.2`}),(0,f.jsx)(`path`,{d:`M8.8 11.2c1.9-1 4.5-1 6.4 0`,fill:`none`,stroke:`#fff`,strokeWidth:`.8`})]}):(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-locale-flag`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{fill:`#fff`,height:`24`,rx:`5`,width:`24`}),(0,f.jsx)(`path`,{d:`M0 3h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Zm0 6h24v3H0Z`,fill:`#bd3d44`}),(0,f.jsx)(`path`,{d:`M0 0h11v11H0Z`,fill:`#192f6b`}),(0,f.jsx)(`path`,{d:`m2.3 2.1.5 1 .9.1-.7.7.2 1-.9-.5-.9.5.2-1-.7-.7.9-.1.5-1Zm4 0 .5 1 .9.1-.7.7.2 1-.9-.5-.9.5.2-1-.7-.7.9-.1.5-1Z`,fill:`#fff`})]})}function Fi(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`cost-locale-chevron`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`m6 9 6 6 6-6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`})})}function Ii(){return(0,f.jsx)(`svg`,{"aria-hidden":`true`,className:`cost-filter-icon`,fill:`none`,viewBox:`0 0 24 24`,children:(0,f.jsx)(`path`,{d:`M3 6h18M7 12h10m-7 6h4`})})}function Li(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`cost-settings-icon`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.09a2 2 0 0 1 1 1.74v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z`}),(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function Ri({capabilityNavigation:e,data:t,dashboardTitle:n=`Dashboard Zaip AIOS`,embedded:r=!1,globalFilters:i,lastUpdatedAt:a,locale:o,loading:s,onLocaleChange:c,onOpenTrace:u,onRefresh:d,operations:p,repositoryName:h,currency:g,onCurrencyChange:_}){let[v,y]=(0,l.useState)(Mi),[b,x]=(0,l.useState)(`all`),[S,C]=(0,l.useState)(Vr),[w,T]=(0,l.useState)(`BRL`),E=g??w,ee=e=>{T(e),_?.(e)},[D,te]=(0,l.useState)(`month`),[O,ne]=(0,l.useState)(!1),[k,re]=(0,l.useState)(!1),[A,j]=(0,l.useState)(!1),[N,ie]=(0,l.useState)(null),P=Di[o],ae=a===null?o===`pt-BR`?`Aguardando atualização`:`Waiting for refresh`:`${o===`pt-BR`?`Atualizado`:`Updated`} ${new Intl.DateTimeFormat(o,{dateStyle:`short`,timeStyle:`medium`}).format(new Date(a))}`,F=(0,l.useMemo)(()=>{let e=r?null:Vi(t.runs,D);return t.runs.filter(t=>zi(t,S)&&Bi(t,i)&&(!e||Date.parse(t.started_at)>=e)).sort((e,t)=>t.started_at.localeCompare(e.started_at))},[t.runs,r,S,i,D]),I=(0,l.useMemo)(()=>{let e={prds:t.prds.filter(e=>Wi(e,i)),specs:t.specs.filter(e=>Wi(e,i)),tasks:(p?.tasks??[]).filter(e=>Wi(e,i))};return{conversations:Ui(F.filter(e=>e.phase===`conversation`),e=>e.conversation_id??e.task_title??e.run_id),tasks:Or(e.tasks,F),providers:Ui(F,e=>Er(e.provider)),agents:wr(Ui(F,e=>e.agent_name),t.configured_agents),models:Ui(F,e=>e.model),daily:Wr(Ui(F,e=>e.started_at.slice(0,10)),e,`daily`),monthly:Wr(Ui(F,e=>e.started_at.slice(0,7)),e,`monthly`),annual:Wr(Ui(F,e=>e.started_at.slice(0,4)),e,`annual`)}},[t.configured_agents,t.prds,t.specs,i,p?.tasks,F]),L=Hi(F,t.overview),oe=e=>{c(e),ee(Oi(e))},se=e=>{let t=Ni(p?.runs??[],e);t&&ie(t)};return(0,f.jsxs)(r?`section`:`main`,{className:r?`cost-page cost-page-embedded`:`cost-page`,children:[r?null:(0,f.jsx)(m,{filters:(0,f.jsx)(Hr,{available:t.filters_available,hideQuery:r,locale:o,onChange:C,value:S}),filtersActive:Object.values(S).some(Boolean),lastUpdatedAt:a,loading:s,locale:o,onLocaleChange:oe,onRefresh:d,settings:(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:P.currency}),(0,f.jsxs)(`select`,{onChange:e=>ee(e.target.value),value:E,children:[(0,f.jsx)(`option`,{value:`BRL`,children:`BRL · R$`}),(0,f.jsx)(`option`,{value:`USD`,children:`USD · $`})]})]}),...h===void 0?{}:{repositoryName:h},title:n}),r?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`nav`,{"aria-label":`Navegação do Cost Monitor`,className:`cost-monitor-nav`,children:[(0,f.jsxs)(`div`,{className:`cost-monitor-brand`,children:[(0,f.jsx)(`strong`,{className:`cost-monitor-title`,children:P.title}),(0,f.jsx)(`small`,{className:`cost-last-updated`,children:ae})]}),(0,f.jsx)(`img`,{alt:`ZAIP`,className:`cost-monitor-logo`,src:ji}),(0,f.jsxs)(`div`,{className:`cost-nav-actions`,children:[(0,f.jsx)(`button`,{"aria-label":P.refresh,className:`cost-nav-icon cost-refresh-action`,disabled:s,onClick:d,type:`button`,children:`↻`}),(0,f.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-filter-action`,children:[(0,f.jsxs)(`button`,{className:O?`cost-nav-button is-active`:`cost-nav-button`,onClick:()=>{ne(e=>!e),re(!1),j(!1)},type:`button`,children:[(0,f.jsx)(Ii,{}),` `,P.filters]}),O?(0,f.jsx)(`div`,{className:`cost-nav-popup cost-nav-filter-popup`,children:(0,f.jsx)(Hr,{available:t.filters_available,hideQuery:r,locale:o,onChange:C,value:S})}):null]}),(0,f.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-locale-action`,children:[(0,f.jsxs)(`button`,{className:k?`cost-nav-button is-active`:`cost-nav-button`,onClick:()=>{re(e=>!e),ne(!1),j(!1)},type:`button`,children:[(0,f.jsx)(Pi,{locale:o}),o===`pt-BR`?`PT-BR`:`EN-US`,(0,f.jsx)(Fi,{})]}),k?(0,f.jsxs)(`div`,{className:`cost-nav-popup cost-nav-locale-popup`,children:[(0,f.jsxs)(`button`,{onClick:()=>oe(`pt-BR`),type:`button`,children:[(0,f.jsx)(Pi,{locale:`pt-BR`}),` Português do Brasil`,` `,o===`pt-BR`?`✓`:``]}),(0,f.jsxs)(`button`,{onClick:()=>oe(`en-US`),type:`button`,children:[(0,f.jsx)(Pi,{locale:`en-US`}),` English `,o===`en-US`?`✓`:``]})]}):null]}),(0,f.jsxs)(`div`,{className:`cost-nav-popup-anchor cost-settings-action`,children:[(0,f.jsx)(`button`,{"aria-label":P.settings,className:A?`cost-nav-icon is-active`:`cost-nav-icon`,onClick:()=>{j(e=>!e),ne(!1),re(!1)},type:`button`,children:(0,f.jsx)(Li,{})}),A?(0,f.jsxs)(`div`,{className:`cost-nav-popup cost-nav-settings-popup`,children:[(0,f.jsxs)(`div`,{className:`cost-mobile-settings`,children:[(0,f.jsx)(`small`,{className:`cost-mobile-updated`,children:ae}),(0,f.jsxs)(`button`,{disabled:s,onClick:d,type:`button`,children:[`↻`,` `,s?o===`pt-BR`?`Atualizando…`:`Refreshing…`:P.refresh]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:o===`pt-BR`?`Idioma`:`Language`}),(0,f.jsxs)(`select`,{onChange:e=>oe(e.target.value),value:o,children:[(0,f.jsx)(`option`,{value:`pt-BR`,children:`Português do Brasil`}),(0,f.jsx)(`option`,{value:`en-US`,children:`English`})]})]}),(0,f.jsxs)(`div`,{className:`cost-mobile-filters`,children:[(0,f.jsx)(`strong`,{children:P.filters}),(0,f.jsx)(Hr,{available:t.filters_available,hideQuery:r,locale:o,onChange:C,value:S})]})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:P.currency}),(0,f.jsxs)(`select`,{onChange:e=>ee(e.target.value),value:E,children:[(0,f.jsx)(`option`,{value:`BRL`,children:`BRL · R$`}),(0,f.jsx)(`option`,{value:`USD`,children:`USD · $`})]})]})]}):null]})]})]}),(0,f.jsxs)(`header`,{className:`cost-hero`,children:[(0,f.jsx)(`p`,{className:`cost-hero-description`,children:P.subtitle}),(0,f.jsxs)(`label`,{className:`cost-period`,children:[(0,f.jsx)(`span`,{children:P.period}),(0,f.jsxs)(`select`,{onChange:e=>te(e.target.value),value:D,children:[(0,f.jsx)(`option`,{value:`all`,children:P.allTime}),(0,f.jsx)(`option`,{value:`7`,children:P.last7}),(0,f.jsx)(`option`,{value:`30`,children:P.last30}),(0,f.jsx)(`option`,{value:`90`,children:P.last90}),(0,f.jsx)(`option`,{value:`month`,children:P.thisMonth})]})]})]})]}),r?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)($r,{currency:E,locale:o,overview:L}),(0,f.jsxs)(`div`,{className:`cost-coverage-note`,children:[(0,f.jsx)(`span`,{children:`.agents/projections/runtime`}),(0,f.jsxs)(`strong`,{children:[L.coverage.tokens,`/`,L.event_count,` eventos com tokens ·`,` `,L.coverage.brl,`/`,L.event_count,` com custo`]})]}),e]}),(0,f.jsx)(`nav`,{"aria-label":`Visões de custo`,className:`cost-tabs`,children:V.map(e=>(0,f.jsx)(`button`,{className:v===e?`is-active`:void 0,onClick:()=>y(e),type:`button`,children:P.tabs[e]},e))}),(0,f.jsxs)(`section`,{className:`cost-content cost-content-${v} ${v===`overview`?`cost-content-overview`:``}`,children:[v===`overview`?(0,f.jsx)(Mr,{currency:E,daily:I.daily,locale:o,models:I.models,rows:F}):null,v===`agentCalls`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`nav`,{"aria-label":o===`pt-BR`?`Tipo de chamada de agente`:`Agent call type`,className:`cost-run-kind-toolbar`,children:[`all`,`run`,`subrun`].map(e=>(0,f.jsx)(`button`,{"aria-pressed":b===e,className:b===e?`is-active`:void 0,onClick:()=>x(e),type:`button`,children:e===`all`?o===`pt-BR`?`Todos`:`All`:e===`run`?o===`pt-BR`?`Chamadas do agente orquestrador`:`Orchestrator agent calls`:o===`pt-BR`?`Chamadas de subagentes`:`Subagent calls`},e))}),(0,f.jsx)(ui,{currency:E,locale:o,onOpenRun:se,rows:b===`all`?F:F.filter(e=>e.run_kind===b)})]}):null,v===`executions`?(0,f.jsx)(fe,{locale:o,rows:p?.executions??[]}):null,v===`conversations`?(0,f.jsx)(bi,{currency:E,labelHeading:o===`pt-BR`?`Conversa`:`Conversation`,locale:o,rows:I.conversations}):null,v===`tasks`?(0,f.jsx)(bi,{currency:E,dateHeading:o===`pt-BR`?`Criada em`:`Created at`,labelHeading:o===`pt-BR`?`Tarefa`:`Task`,locale:o,onOpenTrace:u,rows:I.tasks}):null,v===`prds`?(0,f.jsx)(ki,{currency:E,locale:o,onOpenTrace:u,rows:t.prds,...p?{details:p}:{}}):null,v===`specs`?(0,f.jsx)(ki,{currency:E,locale:o,onOpenTrace:u,rows:t.specs,...p?{details:p}:{}}):null,v===`models`?(0,f.jsx)(ti,{locale:o,rows:F}):null,[`providers`,`agents`].map(e=>v===e?(0,f.jsx)(bi,{currency:E,labelHeading:e===`agents`?o===`pt-BR`?`Modelo LLM`:`LLM model`:`Provider`,locale:o,rows:I[e]},e):null),v===`daily`||v===`monthly`||v===`annual`?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Xr,{currency:E,locale:o,period:v,rows:I[v]}),(0,f.jsx)(bi,{currency:E,locale:o,period:v,rows:I[v],showDateTime:!1})]}):null]}),N?(0,f.jsx)(M,{details:{kind:`run`,row:N},locale:o,onClose:()=>ie(null)}):null]})}function zi(e,t){let n=t.query.trim().toLowerCase();return(!n||[e.run_id,e.task_title,e.model,e.requested_model,e.agent,e.agent_name].some(e=>e.toLowerCase().includes(n)))&&(!t.provider||Er(e.provider)===t.provider)&&(!t.agent||e.agent_name===t.agent)&&(!t.model||e.model===t.model)&&(!t.status||e.task_status===t.status)&&(!t.priority||e.priority===t.priority)&&(!t.risk||e.risk===t.risk)&&(!t.phase||e.phase===t.phase)&&(!t.origin||e.origin===t.origin)&&(!t.workType||e.work_type===t.workType)}function Bi(e,t){if(!t)return!0;let n=t.query.trim().toLocaleLowerCase(),r=e.started_at.slice(0,10);return r>=t.dateRange.start&&r<=t.dateRange.end&&(!n||[e.run_id,e.task_id,e.task_title,e.provider,e.agent,e.agent_name,e.model,e.requested_model,e.phase].some(e=>e?.toLocaleLowerCase().includes(n)))}function Vi(e,t){if(t===`all`||e.length===0)return null;let n=Math.max(...e.map(e=>Date.parse(e.started_at)));if(t===`month`){let e=new Date(n);return new Date(e.getFullYear(),e.getMonth(),1).getTime()}return n-Number(t)*864e5}function Hi(e,t){if(e.length===0)return{...t,run_count:0,task_count:0,event_count:0,total_tokens:null,estimated_usd:null,estimated_brl:null,recorded_usd:null,recorded_brl:null,average_run_cost_usd:null,average_run_cost_brl:null,average_run_duration_ms:null,known_tokens_per_cycle:null,top_10_token_share:null,coverage:{events:0,tokens:0,usd:0,brl:0}};let n=e.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),{events:0,tokens:0,usd:0,brl:0}),r=e.filter(e=>e.total_tokens!==null),i=r.reduce((e,t)=>e+(t.total_tokens??0),0),a=r.reduce((e,t)=>e+t.event_count,0),o=[...r].sort((e,t)=>(t.total_tokens??0)-(e.total_tokens??0)).slice(0,10).reduce((e,t)=>e+(t.total_tokens??0),0);return{task_count:new Set(e.flatMap(e=>e.task_id?[e.task_id]:[])).size,run_count:e.length,event_count:e.reduce((e,t)=>e+t.event_count,0),total_tokens:Gi(e.map(e=>e.total_tokens)),estimated_usd:Gi(e.map(e=>e.estimated_usd)),estimated_brl:Gi(e.map(e=>e.estimated_brl)),recorded_usd:Gi(e.map(e=>e.recorded_usd)),recorded_brl:Gi(e.map(e=>e.recorded_brl)),average_run_cost_usd:Ki(e.map(e=>e.estimated_usd)),average_run_cost_brl:Ki(e.map(e=>e.estimated_brl)),average_run_duration_ms:Ki(e.map(e=>e.duration_ms)),known_tokens_per_cycle:a===0?null:i/a,top_10_token_share:i===0?null:o/i,coverage:n}}function Ui(e,t,n=t){let r=new Map;for(let n of e)r.set(t(n),[...r.get(t(n))??[],n]);return[...r].map(([e,t])=>({key:e,label:n(t[0]),latest_started_at:t.reduce((e,t)=>t.started_at>e?t.started_at:e,t[0]?.started_at??``),run_count:t.length,task_count:new Set(t.flatMap(e=>e.task_id?[e.task_id]:[])).size,prd_count:0,spec_count:0,evidence_count:0,test_count:0,event_count:t.reduce((e,t)=>e+t.event_count,0),total_tokens:Gi(t.map(e=>e.total_tokens)),estimated_usd:Gi(t.map(e=>e.estimated_usd)),estimated_brl:Gi(t.map(e=>e.estimated_brl)),duration_ms:Gi(t.filter(e=>e.phase===`execution`&&(e.parent_run_id===void 0||e.parent_run_id===null)).map(e=>e.duration_ms)),coverage:t.reduce((e,t)=>({events:e.events+t.coverage.events,tokens:e.tokens+t.coverage.tokens,usd:e.usd+t.coverage.usd,brl:e.brl+t.coverage.brl}),{events:0,tokens:0,usd:0,brl:0})})).sort((e,t)=>t.latest_started_at.localeCompare(e.latest_started_at))}function Wi(e,t){if(t===void 0)return!0;let n=t.query.trim().toLowerCase();if(n&&![e.id??``,e.title??``].some(e=>e.toLowerCase().includes(n))||e.created_at===null)return!1;let r=e.created_at.slice(0,10);return r>=t.dateRange.start&&r<=t.dateRange.end}function Gi(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0):null}function Ki(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0)/t.length:null}function qi({ariaLabel:e,closeLabel:t,document:n,onClose:r}){return(0,f.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-document`,role:`dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:n.path}),(0,f.jsx)(`h2`,{children:n.title})]}),(0,f.jsx)(`button`,{"aria-label":t,className:`trace-close-button`,onClick:r,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20,strokeWidth:2})})]}),(0,f.jsx)(`pre`,{children:n.content})]})}function Ji({stage:e,stageRecord:t,documents:n,stageCopy:r,stageArtifacts:i,copy:a,onBack:o,onOpenDocument:s,onStageChange:c}){let l=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],u=l.indexOf(e),d=l[u-1],p=l[u+1],m=n.filter(e=>e.kind===`evidence`).length,h=new Set(n.map(e=>e.kind)).size,g=new Map;for(let e of n)g.set(e.kind,[...g.get(e.kind)??[],e]);let _=t?.last_recorded_at??a.pending;return(0,f.jsxs)(`section`,{className:`trace-stage-detail`,children:[(0,f.jsx)(`header`,{children:(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`p`,{children:r[e].label}),(0,f.jsx)(`h3`,{children:i[e]}),(0,f.jsx)(`small`,{children:_})]})}),(0,f.jsxs)(`div`,{className:`trace-stage-metrics`,children:[(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{children:a.documents}),(0,f.jsx)(`strong`,{children:n.length})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{children:a.types}),(0,f.jsx)(`strong`,{children:h})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{children:a.evidenceMetric}),(0,f.jsx)(`strong`,{children:m})]})]}),(0,f.jsx)(`div`,{className:`trace-stage-documents`,children:n.length===0?(0,f.jsx)(`p`,{className:`trace-stage-empty`,children:a.empty}):[...g].map(([e,t])=>(0,f.jsxs)(`section`,{className:`trace-document-group`,children:[(0,f.jsxs)(`h4`,{children:[e,` `,(0,f.jsx)(`small`,{children:t.length})]}),t.map(e=>(0,f.jsxs)(`button`,{onClick:()=>s(e),type:`button`,children:[(0,f.jsx)(`strong`,{children:e.title}),(0,f.jsx)(`small`,{children:e.path})]},e.id))]},e))}),(0,f.jsxs)(`nav`,{"aria-label":a.navigation,className:`trace-stage-navigation`,children:[(0,f.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-previous`,disabled:u===0,onClick:()=>c(l[u-1]),type:`button`,children:[(0,f.jsx)(We,{"aria-hidden":`true`,size:18,strokeWidth:1.9}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`small`,{children:a.previous}),(0,f.jsx)(`strong`,{children:d?r[d].label.split(` (`)[0]:`—`})]})]}),(0,f.jsxs)(`div`,{className:`trace-navigation-center`,children:[(0,f.jsx)(`div`,{"aria-hidden":`true`,className:`trace-navigation-progress`,children:l.map((t,n)=>(0,f.jsx)(`span`,{"data-active":t===e,"data-passed":n<u},t))}),(0,f.jsxs)(`small`,{children:[u+1,` `,a.of,` `,l.length]}),(0,f.jsxs)(`button`,{className:`trace-all-stages-button`,onClick:o,type:`button`,children:[(0,f.jsx)(lt,{"aria-hidden":`true`,size:15,strokeWidth:1.9}),a.back]})]}),(0,f.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-next`,disabled:u===l.length-1,onClick:()=>c(l[u+1]),type:`button`,children:[(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`small`,{children:a.next}),(0,f.jsx)(`strong`,{children:p?r[p].label.split(` (`)[0]:`—`})]}),(0,f.jsx)(Ge,{"aria-hidden":`true`,size:18,strokeWidth:1.9})]})]})]})}function Yi({ariaLabel:e,children:t,closeLabel:n,onClose:r}){return(0,l.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,f.jsxs)(`div`,{className:`trace-stage-dialog-backdrop`,role:`presentation`,children:[(0,f.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-backdrop-dismiss`,onClick:r,type:`button`}),(0,f.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-stage-dialog`,role:`dialog`,children:[(0,f.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-close`,onClick:r,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:22})}),t]})]})}var Xi=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],Zi=[`task`,`change`,`spec`,`prd`],Qi=[`coverage`,`documents`,`evidence`,`links`],$i={"pt-BR":{lite:`Leve`,standard:`Padrão`,critical:`Crítico`},"en-US":{lite:`Lite`,standard:`Standard`,critical:`Critical`}},ea={definition:Qe,planning:st,execution:mt,decisions:ot,verification:ht,evidence:nt},ta={definition:`PRD · Requisitos`,planning:`SPEC · Change`,execution:`Tarefas · DAG · Runs · arquivos`,decisions:`Decisões do planejamento e da execução`,verification:`Testes · revisões · evals · checks`,evidence:`Evidências · resultados · rastreabilidade`},na={definition:`PRD · Requirements`,planning:`SPEC · Change`,execution:`Tasks · DAG · Runs · files`,decisions:`Planning and execution decisions`,verification:`Tests · reviews · evals · checks`,evidence:`Evidence · results · traceability`};function ra(e,t){return[{label:`Task`,value:e.task_id,onOpen:void 0},{label:`Change`,value:e.change_id,onOpen:t.onOpenChange},{label:`SPEC`,value:e.spec_id,onOpen:t.onOpenSpec},{label:`PRD`,value:e.prd_id,onOpen:t.onOpenPrd}]}var ia={definition:{label:`Definição (PRD + Requisitos)`,description:`Objetivo, contexto e critérios que definem o trabalho.`},planning:{label:`Planejamento (SPEC + Change)`,description:`Escopo, solução e mudanças previstas antes da execução.`},execution:{label:`Execução (Tarefas ou DAG)`,description:`Tarefas, dependências da DAG, Runs e arquivos produzidos.`},decisions:{label:`Decisões (Plano e Execução)`,description:`Decisões humanas e da IA tomadas no planejamento e na execução.`},verification:{label:`Verificação (Testes + Revisões)`,description:`Testes, revisões, evals e checks comparam o resultado aos Critérios de Aceite.`},evidence:{label:`Evidências (Resultados + Rastreabilidade)`,description:`Provas reproduzíveis vinculadas às Tasks, Changes, Runs e Critérios de Aceite.`}},aa={definition:{label:`Definition (PRD + Requirements)`,description:`Objective, context, and criteria that define the work.`},planning:{label:`Planning (SPEC + Change)`,description:`Scope, solution, and changes planned before execution.`},execution:{label:`Execution (Tasks or DAG)`,description:`Tasks, DAG dependencies, Runs, and produced files.`},decisions:{label:`Decisions (Plan and Execution)`,description:`Human and AI decisions made during planning and execution.`},verification:{label:`Verification (Tests + Reviews)`,description:`Tests, reviews, evals, and checks compare results with acceptance criteria.`},evidence:{label:`Evidence (Results + Traceability)`,description:`Reproducible proof linked to Tasks, Changes, Runs, and acceptance criteria.`}},oa={"pt-BR":{aria:`Rastreabilidade da task`,coverage:`etapas rastreadas`,evidence:`evidências`,close:`Fechar`,empty:`Nenhum documento relacionado.`,closeDocument:`Fechar documento`,back:`Voltar às etapas`,previous:`Anterior`,next:`Próxima`,documents:`Documentos`,types:`Tipos`,evidenceMetric:`Evidências`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copiar ID`,copied:`ID copiado`,unlinked:`Não vinculado`,recorded:`Registrada em`,pending:`Pendente`,missingTimestamp:`Sem data/hora`,tests:`testes registrados`,time:`Tempo`,tokens:`Tokens`,cost:`Custo`,measuredRuns:`Runs medidas`,items:`itens`,navigation:`Navegação entre etapas`,of:`de`,stageDetails:`Detalhes da etapa`,document:`Documento`},"en-US":{aria:`Task traceability`,coverage:`tracked stages`,evidence:`evidence items`,close:`Close`,empty:`No related document.`,closeDocument:`Close document`,back:`Back to stages`,previous:`Previous`,next:`Next`,documents:`Documents`,types:`Types`,evidenceMetric:`Evidence`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copy ID`,copied:`ID copied`,unlinked:`Not linked`,recorded:`Recorded at`,pending:`Pending`,missingTimestamp:`Missing date/time`,tests:`recorded tests`,time:`Time`,tokens:`Tokens`,cost:`Cost`,measuredRuns:`measured Runs`,items:`items`,navigation:`Stage navigation`,of:`of`,stageDetails:`Stage details`,document:`Document`}};function sa({taskId:e,locale:t=`pt-BR`}){let n=t===`pt-BR`;return(0,f.jsx)(`div`,{className:`trace-backdrop`,children:(0,f.jsxs)(`section`,{"aria-busy":`true`,"aria-label":n?`Carregando rastreabilidade`:`Loading traceability`,"aria-live":`polite`,className:`trace-panel trace-loading-panel`,role:`dialog`,children:[(0,f.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,f.jsxs)(`div`,{className:`trace-heading`,children:[(0,f.jsx)(`span`,{className:`trace-heading-icon trace-loading-icon`,"aria-hidden":`true`,children:(0,f.jsx)(ft,{size:22,strokeWidth:1.8})}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,f.jsx)(`h2`,{children:n?`Carregando rastreabilidade`:`Loading traceability`}),(0,f.jsx)(`p`,{children:e})]})]}),(0,f.jsxs)(`span`,{className:`trace-loading-status`,children:[(0,f.jsx)(ft,{"aria-hidden":`true`,size:15,strokeWidth:2}),n?`Preparando trace`:`Preparing trace`]})]}),(0,f.jsx)(`div`,{className:`trace-loading-identifiers`,"aria-hidden":`true`,children:Zi.map(e=>(0,f.jsx)(`span`,{},e))}),(0,f.jsx)(`div`,{className:`trace-loading-metrics`,"aria-hidden":`true`,children:Qi.map(e=>(0,f.jsx)(`span`,{},e))}),(0,f.jsx)(`div`,{className:`trace-loading-stages`,"aria-hidden":`true`,children:Xi.map(e=>(0,f.jsx)(`span`,{},e))})]})})}function ca({trace:e,locale:t=`pt-BR`,onClose:n,onOpenChange:r,onOpenPrd:i,onOpenSpec:a,embedded:o=!1}){let[s,c]=(0,l.useState)(null),[u,d]=(0,l.useState)(null),[p,m]=(0,l.useState)(!1),h=oa[t],g=t===`en-US`?aa:ia,_=t===`en-US`?na:ta,v=(0,l.useMemo)(()=>new Map(Xi.map(t=>[t,e.documents.filter(e=>e.stage===t)])),[e.documents]),y=(0,l.useMemo)(()=>new Map(e.stages.map(e=>[e.stage,e])),[e.stages]),b=Math.round(e.coverage.stages_with_timestamps/e.coverage.total_stages*100),x=[e.task_id,e.change_id,e.spec_id,e.prd_id].filter(Boolean).length,S=ra(e,{onOpenChange:r,onOpenPrd:i,onOpenSpec:a}),C=da(e.task_created_at,t),w=fa(e.task_created_at,t),T=async()=>{try{await navigator.clipboard.writeText(e.task_id),m(!0),window.setTimeout(()=>m(!1),2e3)}catch{m(!1)}};return(0,f.jsxs)(`div`,{className:o?`trace-embedded`:`trace-backdrop`,children:[(0,f.jsxs)(`section`,{"aria-label":h.aria,"aria-modal":o?void 0:`true`,className:`trace-panel`,role:`dialog`,children:[(0,f.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,f.jsxs)(`div`,{className:`trace-heading`,children:[(0,f.jsx)(`span`,{className:`trace-heading-icon`,"aria-hidden":`true`,children:(0,f.jsx)(pt,{size:22,strokeWidth:1.8})}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,f.jsx)(`div`,{className:`trace-heading-title`,children:(0,f.jsxs)(`h2`,{children:[(0,f.jsx)(`span`,{className:`trace-title-prefix`,children:`Trace:`}),` `,e.task_title||e.task_id]})}),(0,f.jsx)(`p`,{children:t===`pt-BR`?`Visão completa do ciclo de desenvolvimento`:`Complete development lifecycle view`})]})]}),(0,f.jsxs)(`div`,{className:`trace-header-actions`,children:[(0,f.jsx)(la,{copy:h,locale:t,usage:e.usage}),o?null:(0,f.jsx)(`button`,{className:`trace-close-button`,"aria-label":h.close,onClick:n,type:`button`,children:(0,f.jsx)(_t,{"aria-hidden":`true`,size:20,strokeWidth:2})})]})]}),(0,f.jsxs)(`section`,{className:`trace-task-summary`,"aria-label":t===`pt-BR`?`Resumo da tarefa`:`Task summary`,children:[(0,f.jsxs)(`article`,{children:[(0,f.jsx)(Je,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Criada em`:`Created at`}),(0,f.jsx)(`strong`,{children:C})]})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)($e,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Desde a criação`:`Since creation`}),(0,f.jsx)(`strong`,{children:w})]})]}),(0,f.jsxs)(`article`,{className:`trace-task-progress`,children:[(0,f.jsx)(Ze,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content trace-task-progress-content`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Progresso`:`Progress`}),(0,f.jsxs)(`strong`,{children:[e.task_progress,`%`]}),(0,f.jsx)(`progress`,{max:100,value:e.task_progress})]})]}),(0,f.jsxs)(`article`,{className:`trace-task-classification`,children:[(0,f.jsx)(Ke,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,f.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,f.jsx)(`span`,{children:t===`pt-BR`?`Classificação`:`Classification`}),(0,f.jsxs)(`div`,{className:`trace-task-badges`,children:[(0,f.jsxs)(`span`,{className:`trace-mode-badge`,children:[(0,f.jsx)(gt,{"aria-hidden":`true`,size:12,strokeWidth:2}),e.spec_id===null?h.taskFirst:h.specDriven]}),e.task_risk?(0,f.jsxs)(`span`,{className:`trace-risk-badge`,"data-risk":e.task_risk,children:[(0,f.jsx)(ht,{"aria-hidden":`true`,size:12,strokeWidth:2}),$i[t][e.task_risk]]}):null]})]})]})]}),(0,f.jsx)(`section`,{className:`trace-overview trace-lineage`,"aria-label":t===`pt-BR`?`Identificadores vinculados`:`Linked identifiers`,children:S.map(({label:e,value:n,onOpen:r})=>{let i=n!==null&&r!==void 0,a=e===`Task`&&n!==null,o=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:`trace-identifier-content`,children:[(0,f.jsxs)(`span`,{children:[(0,f.jsx)(ut,{"aria-hidden":`true`,size:11,strokeWidth:2}),e]}),(0,f.jsx)(`strong`,{title:n??h.unlinked,children:n??h.unlinked})]}),a?(0,f.jsx)(`button`,{"aria-label":p?t===`pt-BR`?`ID da tarefa copiado`:`Task ID copied`:t===`pt-BR`?`Copiar ID da tarefa`:`Copy task ID`,className:`trace-identifier-copy`,onClick:()=>void T(),title:p?t===`pt-BR`?`Copiado`:`Copied`:void 0,type:`button`,children:p?(0,f.jsx)(Ye,{"aria-hidden":`true`,size:15}):(0,f.jsx)(tt,{"aria-hidden":`true`,size:15})}):null,i?(0,f.jsx)(Ge,{"aria-hidden":`true`,size:15,strokeWidth:1.9}):null]});return(0,f.jsx)(`article`,{"data-empty":n===null,"data-linked":n!==null,"data-navigable":i,children:i?(0,f.jsx)(`button`,{"aria-label":`${t===`pt-BR`?`Abrir`:`Open`} ${e}: ${n}`,className:`trace-identifier-navigation`,onClick:()=>r(n),type:`button`,children:o}):(0,f.jsx)(`div`,{className:`trace-identifier-static`,children:o})},e)})}),(0,f.jsxs)(`section`,{className:`trace-metrics`,"aria-label":t===`pt-BR`?`Resumo da rastreabilidade`:`Traceability summary`,children:[(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`trace-metric-icon`,children:(0,f.jsx)(pt,{"aria-hidden":`true`,size:18})}),(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`strong`,{children:[b,`%`]}),(0,f.jsx)(`span`,{children:h.coverage})]}),(0,f.jsxs)(`small`,{children:[e.coverage.stages_with_timestamps,` `,h.of,` `,e.coverage.total_stages]})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`trace-metric-icon`,children:(0,f.jsx)(it,{"aria-hidden":`true`,size:18})}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:e.documents.length}),(0,f.jsx)(`span`,{children:h.documents})]}),(0,f.jsx)(`small`,{children:t===`pt-BR`?`no ciclo completo`:`in the full lifecycle`})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`trace-metric-icon`,children:(0,f.jsx)(Ke,{"aria-hidden":`true`,size:18})}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:e.coverage.evidence_count}),(0,f.jsx)(`span`,{children:h.evidenceMetric})]}),(0,f.jsxs)(`small`,{children:[e.coverage.test_count,` `,h.tests]})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`trace-metric-icon`,children:(0,f.jsx)(ut,{"aria-hidden":`true`,size:18})}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:x}),(0,f.jsx)(`span`,{children:t===`pt-BR`?`Vínculos`:`Links`})]}),(0,f.jsx)(`small`,{children:`Task · Change · SPEC · PRD`})]})]}),(0,f.jsx)(`div`,{className:`trace-stage-menu`,children:Xi.map((e,n)=>{let r=ea[e],i=(v.get(e)??[]).length;return(0,f.jsxs)(`button`,{className:`trace-stage-menu-button`,"data-stage":e,onClick:()=>d(e),type:`button`,children:[(0,f.jsx)(`span`,{className:`trace-stage-number`,children:String(n+1).padStart(2,`0`)}),(0,f.jsx)(r,{className:`trace-stage-icon`,"aria-hidden":`true`,size:22,strokeWidth:1.8}),(0,f.jsx)(`strong`,{children:g[e].label}),(0,f.jsx)(`em`,{children:g[e].description}),(0,f.jsxs)(`span`,{className:`trace-stage-action`,children:[(0,f.jsxs)(`small`,{children:[(0,f.jsx)(qe,{"aria-hidden":`true`,size:13}),` `,i,` `,h.items]}),(0,f.jsxs)(`span`,{children:[t===`pt-BR`?`Ver etapa`:`View stage`,(0,f.jsx)(Ge,{"aria-hidden":`true`,size:13,strokeWidth:2})]})]})]},e)})})]}),u?(0,f.jsx)(Yi,{ariaLabel:h.stageDetails,closeLabel:t===`pt-BR`?`Fechar detalhes da etapa`:`Close stage details`,onClose:()=>d(null),children:(0,f.jsx)(Ji,{copy:h,documents:v.get(u)??[],locale:t,onBack:()=>d(null),onOpenDocument:c,onStageChange:d,stage:u,stageArtifacts:_,stageRecord:y.get(u),stageCopy:g})}):null,s?(0,f.jsx)(qi,{ariaLabel:`${h.document} ${s.title}`,closeLabel:h.closeDocument,document:s,onClose:()=>c(null)}):null]})}function la({usage:e,locale:t,copy:n}){let r=[{label:n.time,metric:e.duration_ms,value:ua(e.duration_ms.value,t)},{label:n.tokens,metric:e.total_tokens,value:e.total_tokens.value===null?`—`:O(e.total_tokens.value,t)},{label:n.cost,metric:e.cost,value:e.cost.value===null||e.cost.currency===null?`—`:k(e.cost.value,e.cost.currency,t)}];return(0,f.jsx)(`section`,{"aria-label":t===`pt-BR`?`Uso agregado da Task`:`Aggregated Task usage`,children:(0,f.jsx)(`dl`,{className:`trace-usage-strip`,children:r.map(({label:t,metric:r,value:i})=>{let a=Math.round(r.coverage_ratio*100),o=`${r.known_runs}/${e.run_count} ${n.measuredRuns} · ${a}%`;return(0,f.jsxs)(`div`,{title:o,children:[(0,f.jsxs)(`dt`,{children:[t,(0,f.jsx)(`span`,{"aria-hidden":`true`,className:`trace-usage-coverage`,"data-complete":r.unknown_runs===0}),(0,f.jsx)(`span`,{className:`trace-usage-sr-only`,children:o})]}),(0,f.jsx)(`dd`,{children:i})]},t)})})})}function ua(e,t){return e===null?`—`:D(e,t)}function da(e,t){if(e===null)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`short`}).format(n)}function fa(e,t){if(e===null)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Date.now()-n),i=Math.max(1,Math.round(r/6e4)),a;if(i<60)a=`${i}m`;else{let e=Math.round(i/60);if(e<24)a=`${e}h`;else{let n=Math.round(e/24);if(n<7)a=`${n}d`;else{let e=Math.round(n/7);a=t===`pt-BR`?`${e}sem`:`${e}w`}}}return t===`pt-BR`?`Há ${a}`:`${a} ago`}var pa={"pt-BR":{label:`Áreas do dashboard`,operations:`Operação`,operationsHint:`Lifecycle e trabalho em andamento`,costs:`Monitor de Custos`,costsHint:`Tempo, tokens e custo`,traceability:`Rastreabilidade`,traceabilityHint:`Ciclo completo em 6 etapas`},"en-US":{label:`Dashboard areas`,operations:`Operations`,operationsHint:`Lifecycle and work in progress`,costs:`Cost Monitor`,costsHint:`Time, tokens, and cost`,traceability:`Traceability`,traceabilityHint:`Complete 6-stage lifecycle`}};function ma({activeView:e,locale:t,onChange:n}){let r=pa[t],i=e=>{n(e),window.requestAnimationFrame(()=>{document.querySelector(`.dashboard-global-controls`)?.scrollIntoView({behavior:`smooth`,block:`start`})})};return(0,f.jsxs)(`nav`,{"aria-label":r.label,className:`dashboard-capability-nav`,children:[(0,f.jsxs)(`button`,{"aria-current":e===`operations`?`page`:void 0,className:e===`operations`?`is-active`:void 0,onClick:()=>i(`operations`),type:`button`,children:[(0,f.jsx)(ha,{}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`strong`,{children:r.operations}),(0,f.jsx)(`small`,{children:r.operationsHint})]})]}),(0,f.jsxs)(`button`,{"aria-current":e===`cost-monitor`?`page`:void 0,className:e===`cost-monitor`?`is-active`:void 0,onClick:()=>i(`cost-monitor`),type:`button`,children:[(0,f.jsx)(ga,{}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`strong`,{children:r.costs}),(0,f.jsx)(`small`,{children:r.costsHint})]})]}),(0,f.jsxs)(`button`,{"aria-current":e===`traceability`?`page`:void 0,className:e===`traceability`?`is-active`:void 0,onClick:()=>i(`traceability`),type:`button`,children:[(0,f.jsx)(_a,{}),(0,f.jsxs)(`span`,{children:[(0,f.jsx)(`strong`,{children:r.traceability}),(0,f.jsx)(`small`,{children:r.traceabilityHint})]})]})]})}function ha(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-square-kanban`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`rect`,{height:`18`,rx:`2`,width:`18`,x:`3`,y:`3`}),(0,f.jsx)(`path`,{d:`M8 7v7`}),(0,f.jsx)(`path`,{d:`M12 7v4`}),(0,f.jsx)(`path`,{d:`M16 7v9`})]})}function ga(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-circle-dollar-sign`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,f.jsx)(`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`}),(0,f.jsx)(`path`,{d:`M12 18V6`})]})}function _a(){return(0,f.jsxs)(`svg`,{"aria-hidden":`true`,className:`lucide lucide-route`,viewBox:`0 0 24 24`,children:[(0,f.jsx)(`circle`,{cx:`6`,cy:`19`,r:`3`}),(0,f.jsx)(`path`,{d:`M9 19h6.5a3.5 3.5 0 0 0 0-7h-7a3.5 3.5 0 0 1 0-7H18`}),(0,f.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`})]})}var va=`# Primeiros passos
|
|
@@ -81,7 +81,7 @@ Use PRD para uma iniciativa de produto com multiplas capacidades ou SPECs.
|
|
|
81
81
|
4. Use Sub-Runs para cada subagente; a Run raiz aguarda todos os descendentes ativos.
|
|
82
82
|
5. Implemente o menor incremento coerente e rode verificacoes focadas.
|
|
83
83
|
6. Registre decisoes consequenciais, evidencias e desvios.
|
|
84
|
-
7. Depois dos demais descendentes, execute \`zaip-agent-
|
|
84
|
+
7. Depois dos demais descendentes, execute \`zaip-agent-finalizer\` como ultimo Sub-Run da Execution. Nenhum filho novo pode iniciar depois dele.
|
|
85
85
|
8. Finalize a Run raiz com status tecnico e resultado terminal da Task separados.
|
|
86
86
|
9. Execute os gates finais e documente rollback.
|
|
87
87
|
|
|
@@ -382,7 +382,7 @@ Se o problema for de instalacao ou integridade, consulte \`framework.lock.yaml\`
|
|
|
382
382
|
- cada Run/Sub-Run fixa agente, modelo e effort; mudanca deliberada abre outra chamada de agente.
|
|
383
383
|
- Calls e ferramentas sao eventos internos; quantidade, tokens e custo ficam agregados na Run/Sub-Run, sem tela propria.
|
|
384
384
|
|
|
385
|
-
O ultimo filho de qualquer Execution e sempre o \`zaip-agent-
|
|
385
|
+
O ultimo filho de qualquer Execution e sempre o \`zaip-agent-finalizer\`. Ele aguarda todos os outros descendentes, cria uma barreira contra filhos posteriores e retorna uma decisao terminal restrita para a CLI aplicar. Toda Execution exige antes ao menos um executor elegivel pelas capacidades do catalogo. Status tecnico da chamada de agente e resultado do trabalho sao independentes.
|
|
386
386
|
|
|
387
387
|
\`blocked\` e retomavel com \`task resume\`; \`failed\` exige \`task rework\` na mesma Task e nova tentativa. \`completed\` e \`cancelled\` sao imutaveis. Interromper geracao bloqueia; cancelar a Task explicitamente cancela.
|
|
388
388
|
|
|
@@ -409,6 +409,41 @@ O ZAIP-AIOS não exige serviço em VPS, runtime concorrente ou roteamento obriga
|
|
|
409
409
|
|
|
410
410
|
O desenvolvimento pode utilizar os tokens incluídos na conta ChatGPT/Codex, sem exigir consumo direto de API. O dashboard acompanha tokens, tempo e custo por tarefa e calcula o custo equivalente estimado de quanto o mesmo consumo representaria se fosse cobrado pelos preços de API. Essa comparação ajuda a prever custos antes de adotar uma execução via API e a dimensionar o benefício econômico aparente do plano em relação ao preço público da API — uma estimativa comparativa, não uma medição oficial de subsídio ou cobrança da OpenAI.
|
|
411
411
|
|
|
412
|
+
## Economia por tarefa: custo para concluir, não custo por chamada
|
|
413
|
+
|
|
414
|
+
O preço de uma chamada, ou mesmo o preço de um modelo, não mede o custo real de desenvolvimento com IA. Uma Task costuma exigir várias chamadas: entendimento do pedido, leitura de contexto, implementação, execução de testes, correção, review, validação e registro da evidência. Por isso, o ZAIP-AIOS mede e compara **Runs, fases e rework por Task, SPEC e PRD**, em vez de celebrar uma chamada isolada barata.
|
|
415
|
+
|
|
416
|
+
Uma forma prática de analisar o custo total é:
|
|
417
|
+
|
|
418
|
+
\`\`\`text
|
|
419
|
+
custo da tarefa concluída = modelo + ferramentas + tempo humano + rework + custo de defeitos
|
|
420
|
+
\`\`\`
|
|
421
|
+
|
|
422
|
+
O último termo é o mais fácil de ignorar. Sem uma metodologia, uma resposta pode parecer pronta sem testes, revisão ou prova de que os Critérios de Aceite foram atendidos. O custo reaparece depois como bug, investigação, nova rodada de contexto, correção, regressão ou tempo adicional do desenvolvedor. Tests, reviews, checks e Evidence adicionam algum custo inicial; o objetivo é reduzir a probabilidade e a duração desse retrabalho, mantendo-o rastreável quando ocorrer.
|
|
423
|
+
|
|
424
|
+
### Economia medida e meta central por tarefa
|
|
425
|
+
|
|
426
|
+
Cada linha abaixo mede uma superfície diferente. As três últimas são medições reproduzíveis de contexto/payload; a primeira é a **meta central de economia por Task completa**, ainda a validar. Não some as linhas: elas se sobrepõem dentro do mesmo fluxo.
|
|
427
|
+
|
|
428
|
+
| O que é reduzido | O que representa | Baseline sem a otimização | Com ZAIP-AIOS | Economia | Situação da métrica |
|
|
429
|
+
| --- | --- | ---: | ---: | ---: | --- |
|
|
430
|
+
| **Task completa — todos os ciclos de modelo** | Entendimento, contexto, implementação, testes, correções, review e evidências até concluir uma Task. | 100 tokens brutos de referência | **60–75 tokens** | **25%–40%** | **Meta estimada**; requer coorte de pelo menos 30 Runs com telemetria coberta. |
|
|
431
|
+
| **Contexto entregue ao agente para uma Task** | O pack de Rules, Requirements e artefatos relevantes que entra no prompt de trabalho. | 7.980 tokens | **1.593 tokens** | **80,0%** | Medição reproduzível. |
|
|
432
|
+
| **Navegação operacional recorrente** | Uma rodada de quatro consultas para localizar Changes, Tasks, Executions e Runs ativos. | 101.924 tokens | **10.199 tokens** | **90,0%** | Medição reproduzível; também reduz o limite de paginação. |
|
|
433
|
+
| **Instruções disponíveis para o agente** | O catálogo de 26 skills consultável pelo agente. | 1.091 tokens | **599 tokens** | **45,1%** | Medição reproduzível. |
|
|
434
|
+
|
|
435
|
+
A meta de **25%–40%** aplica-se aos tokens brutos de todos os ciclos necessários para entregar uma Task, e não ao preço de uma única chamada. Ela é uma hipótese operacional útil para planejamento — não uma economia financeira comprovada por tarefa nem uma comparação já demonstrada contra um baseline pareado.
|
|
436
|
+
|
|
437
|
+
Para uma comparação válida, execute a mesma classe de Task em dois braços — por exemplo, Codex normal e Codex + ZAIP-AIOS — com o mesmo modelo, repositório, Critérios de Aceite e janela de observação. Compare:
|
|
438
|
+
|
|
439
|
+
- tokens e custo equivalente de API de todas as chamadas até a conclusão;
|
|
440
|
+
- duração e número de ciclos/retries;
|
|
441
|
+
- tempo humano de revisão e correção;
|
|
442
|
+
- taxa de rework e defeitos encontrados após a entrega;
|
|
443
|
+
- cobertura de testes, reviews e evidências dos Critérios de Aceite.
|
|
444
|
+
|
|
445
|
+
O Cost Monitor preserva valores desconhecidos como \`unknown\`/\`null\`; ele não converte ausência de telemetria em custo zero. Isso evita que uma estimativa de economia esconda custo de provider, rework ou qualidade não observados. Consulte também [a auditoria de tokens e performance](analysis/verificacao-auditoria-tokens-performance-zaip-aios-2026-07-13.md).
|
|
446
|
+
|
|
412
447
|
## Tese central
|
|
413
448
|
|
|
414
449
|
| Tipo | Nome | Responsabilidade |
|
|
@@ -461,7 +496,7 @@ O método mantém intenção e execução separadas. PRD e SPEC explicam o que s
|
|
|
461
496
|
2. **SPEC:** executa um conjunto de Tasks relacionadas, coordenadas por uma DAG e governadas pela mesma especificação técnica.
|
|
462
497
|
3. **PRD:** executa uma iniciativa completa, selecionando uma ou mais SPECs, cada uma com suas Changes, Tasks e dependências.
|
|
463
498
|
|
|
464
|
-
Em todos os casos, cada turno observável resolve para uma Execution. \`prepare\` valida e congela o plano antes da mutação; \`execute\` reutiliza a Execution \`delivery\` para materializar Change e Task; cada Execution usa uma Run raiz do orquestrador, ao menos um Sub-Run executor elegível e o \`zaip-agent-
|
|
499
|
+
Em todos os casos, cada turno observável resolve para uma Execution. \`prepare\` valida e congela o plano antes da mutação; \`execute\` reutiliza a Execution \`delivery\` para materializar Change e Task; cada Execution usa uma Run raiz do orquestrador, ao menos um Sub-Run executor elegível e o \`zaip-agent-finalizer\` obrigatório por último. SPEC/PRD permanecem ativos entre Runs filhas e só são entregues por gates parentais.
|
|
465
500
|
|
|
466
501
|
A profundidade de prova é adaptativa: Task standalone \`lite\` usa exatamente uma validação e uma Evidence; \`standard\` usa duas ou três de cada; \`critical\` usa três ou mais e controles independentes. Entregas de SPEC e PRD acrescentam matriz parental, pelo menos três validações e três Evidences, integração real e revisão independente. O runtime manual continua padrão; a autonomia por Codex ou Claude é opt-in, isolada em worktrees e limitada por write scopes, commits, budgets e gates tipados. Consulte [Assurance adaptativa e autonomia opt-in](docs/ASSURANCE-E-AUTONOMIA.md).
|
|
467
502
|
|
|
@@ -604,23 +639,186 @@ Arquivos-fonte com 401–800 linhas geram warning e arquivos com 801 ou mais lin
|
|
|
604
639
|
|
|
605
640
|
## Fluxos
|
|
606
641
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
642
|
+
### Seis etapas principais e três saídas alternativas
|
|
643
|
+
|
|
644
|
+
O lifecycle possui seis etapas no caminho de sucesso. \`Bloqueado\`, \`Falhado\` e \`Cancelado\` são saídas alternativas: elas podem interromper o fluxo, mas não são etapas pelas quais todo trabalho precisa passar.
|
|
645
|
+
|
|
646
|
+
| Etapa | O que acontece | Estados Git-native mais comuns |
|
|
647
|
+
| --- | --- | --- |
|
|
648
|
+
| **1. Definição** | Registra problema, objetivo, escopo e Critérios de Aceite. PRD e SPEC ainda podem ser refinados sem iniciar implementação. | PRD/SPEC \`draft\`; Task capturada |
|
|
649
|
+
| **2. Planejamento** | Decompõe o trabalho, define dependências, Changes, Tasks, DAG e estratégia de verificação. | Task/Change \`draft\`; PreparedPlan em construção |
|
|
650
|
+
| **3. Pronto para Executar** | O plano foi validado, materializado e está apto a iniciar. | PRD/SPEC \`ready\`; Task/Change \`planned\`; Execution \`planned\` |
|
|
651
|
+
| **4. Execução** | Cada Task recebe sua própria orquestração, agentes elegíveis e ciclos de implementação ou correção. | PRD/SPEC \`active\`; Task/Change \`executing\`; Execution/Run \`running\` |
|
|
652
|
+
| **5. Verificação** | Tests, reviews, evals, checks, Decisions e Evidence comprovam os Critérios de Aceite. SPEC e PRD fazem também sua verificação parental. | Change/Execution \`verifying\` |
|
|
653
|
+
| **6. Concluído** | O resultado foi verificado e o nível correspondente foi encerrado. | Task/Change/Execution \`completed\`; PRD/SPEC \`delivered\` |
|
|
654
|
+
| **Bloqueado** | Existe uma dependência ou impedimento recuperável. O trabalho pode continuar depois com \`resume\` ou \`rework\`. | \`blocked\` |
|
|
655
|
+
| **Falhado** | Um impedimento técnico ou externo impede continuar com segurança após os retries permitidos — por exemplo, permissão negada, Codex/provider indisponível, falha de internet/rede ou erro em uma ferramenta obrigatória. | \`failed\` |
|
|
656
|
+
| **Cancelado** | Uma pessoa encerra pontualmente o trabalho por decisão explícita; nunca é uma saída automática do agente. | \`cancelled\` |
|
|
657
|
+
|
|
658
|
+
### Visão macro: cada tipo mantém seu próprio fluxo
|
|
659
|
+
|
|
660
|
+
Task, SPEC e PRD não se misturam em uma única linha de execução. Uma SPEC coordena suas Tasks; um PRD coordena suas SPECs; e cada Task continua sendo executada e verificada de forma independente.
|
|
661
|
+
|
|
662
|
+
\`\`\`mermaid
|
|
663
|
+
flowchart TD
|
|
664
|
+
START["Entrada de trabalho"] --> TYPE{"Qual tipo será executado?"}
|
|
665
|
+
|
|
666
|
+
TYPE --> TASK["Task"]
|
|
667
|
+
TYPE --> SPEC["SPEC"]
|
|
668
|
+
TYPE --> PRD["PRD"]
|
|
669
|
+
|
|
670
|
+
TASK --> TASK_DEFINE["1. Definição<br/>objetivo + critérios"]
|
|
671
|
+
TASK_DEFINE --> TASK_PLAN["2. Planejamento<br/>Task + Change + Execution"]
|
|
672
|
+
TASK_PLAN -->|Task preparada| TASK_READY["3. Pronto para Executar<br/>plano materializado"]
|
|
673
|
+
TASK_PLAN -->|Task direta| TASK_EXEC["4. Execução<br/>Zaip Agent Orchestrator"]
|
|
674
|
+
TASK_READY --> TASK_EXEC
|
|
675
|
+
TASK_EXEC --> TASK_VERIFY["5. Verificação<br/>Zaip Agent Reviewer + Evidence"]
|
|
676
|
+
TASK_VERIFY --> TASK_DONE["6. Concluído<br/>Task completed"]
|
|
677
|
+
|
|
678
|
+
SPEC --> SPEC_DEFINE["1. Definição<br/>SPEC draft"]
|
|
679
|
+
SPEC_DEFINE --> SPEC_PLAN["2. Planejamento<br/>DAG de Tasks"]
|
|
680
|
+
SPEC_PLAN --> SPEC_READY["3. Pronto para Executar<br/>SPEC ready"]
|
|
681
|
+
SPEC_READY --> SPEC_EXEC["4. Execução<br/>Tasks independentes"]
|
|
682
|
+
SPEC_EXEC --> SPEC_VERIFY["5. Verificação<br/>Zaip Agent Reviewer + Evidence parental"]
|
|
683
|
+
SPEC_VERIFY --> SPEC_DONE["6. Concluído<br/>SPEC delivered"]
|
|
684
|
+
|
|
685
|
+
PRD --> PRD_DEFINE["1. Definição<br/>PRD draft"]
|
|
686
|
+
PRD_DEFINE --> PRD_PLAN["2. Planejamento<br/>SPECs selecionadas"]
|
|
687
|
+
PRD_PLAN --> PRD_READY["3. Pronto para Executar<br/>PRD ready"]
|
|
688
|
+
PRD_READY --> PRD_EXEC["4. Execução<br/>SPECs independentes"]
|
|
689
|
+
PRD_EXEC --> PRD_VERIFY["5. Verificação<br/>Zaip Agent Reviewer + outcomes do PRD"]
|
|
690
|
+
PRD_VERIFY --> PRD_DONE["6. Concluído<br/>PRD delivered"]
|
|
691
|
+
|
|
692
|
+
classDef entry fill:#2563eb,color:#fff,stroke:#1d4ed8,stroke-width:2px;
|
|
693
|
+
classDef agent fill:#6d28d9,color:#fff,stroke:#a78bfa;
|
|
694
|
+
classDef verify fill:#b45309,color:#fff,stroke:#fbbf24;
|
|
695
|
+
classDef success fill:#15803d,color:#fff,stroke:#4ade80,stroke-width:2px;
|
|
696
|
+
classDef neutral fill:#3f3f46,color:#fff,stroke:#a1a1aa;
|
|
697
|
+
|
|
698
|
+
class START,TYPE,TASK,SPEC,PRD entry;
|
|
699
|
+
class TASK_EXEC,SPEC_EXEC,PRD_EXEC agent;
|
|
700
|
+
class TASK_VERIFY,SPEC_VERIFY,PRD_VERIFY verify;
|
|
701
|
+
class TASK_DONE,SPEC_DONE,PRD_DONE success;
|
|
702
|
+
class TASK_DEFINE,TASK_PLAN,TASK_READY,SPEC_DEFINE,SPEC_PLAN,SPEC_READY,PRD_DEFINE,PRD_PLAN,PRD_READY neutral;
|
|
703
|
+
\`\`\`
|
|
704
|
+
|
|
705
|
+
Conversation permanece fora dessas três linhas: ela usa uma Execution \`interaction\`, pode consultar agentes e termina em uma resposta sem criar Task artificial.
|
|
706
|
+
|
|
707
|
+
### Orquestração de uma Task
|
|
708
|
+
|
|
709
|
+
A unidade de execução é a Task. Uma Task pode precisar de mais de um ciclo de orquestração para ser concluída, mas cada ciclo possui início, limite e resultado explícitos. Evidence e Decisions são coletadas durante a execução; Tests, Checks e Evals formam camadas de validação antes do review. O \`Zaip Agent Reviewer\` realiza a verificação antes do fechamento. O \`Zaip Agent Finalizer\` recebe o resultado já verificado, consolida a evidência e encerra a Run raiz como seu último Sub-Run; depois dele, nenhuma nova chamada pode ser anexada ao ciclo.
|
|
710
|
+
|
|
711
|
+
\`\`\`mermaid
|
|
712
|
+
flowchart TD
|
|
713
|
+
TASK["Task em Execução"] --> ORCH["Zaip Agent Orchestrator<br/>Run raiz do ciclo N"]
|
|
714
|
+
ORCH --> EXECUTOR["Zaip Agent Executor<br/>implementação ou correção"]
|
|
715
|
+
EXECUTOR --> EVIDENCE["Coleta contínua durante a execução<br/>Evidence + Decisions registradas"]
|
|
716
|
+
EVIDENCE --> QUALITY["Camadas de validação<br/>Tests + Checks + Evals"]
|
|
717
|
+
QUALITY --> REVIEWER["Zaip Agent Reviewer<br/>verifica Critérios de Aceite"]
|
|
718
|
+
REVIEWER -->|review suficiente| VERIFIED["Resultado verificado<br/>antes do fechamento"]
|
|
719
|
+
REVIEWER -->|auditoria necessária| AUDITOR["Zaip Agent Auditor<br/>verificação adicional"]
|
|
720
|
+
AUDITOR --> VERIFIED
|
|
721
|
+
VERIFIED --> FINALIZER["Zaip Agent Finalizer<br/>consolida e encerra o ciclo"]
|
|
722
|
+
FINALIZER --> OUTCOME{"Resultado já verificado"}
|
|
723
|
+
|
|
724
|
+
OUTCOME -->|impedimento técnico, externo ou retries esgotados| FAILED["Falhado<br/>permissão, Codex/provider, internet/rede<br/>ou ferramenta impedem continuar"]
|
|
725
|
+
OUTCOME -->|critérios atendidos| DONE["Concluído"]
|
|
726
|
+
OUTCOME -->|condição recuperável| BLOCKED["Bloqueado<br/>aguarda condição"]
|
|
727
|
+
OUTCOME -->|correção necessária| REWORK["Rework necessário<br/>novo ciclo N + 1"]
|
|
728
|
+
OUTCOME -.-> HUMAN["Ação humana pontual<br/>solicitação explícita de uma pessoa"]
|
|
729
|
+
HUMAN --> CANCELLED["Cancelado"]
|
|
730
|
+
|
|
731
|
+
BLOCKED -->|resume dentro da política| ORCH
|
|
732
|
+
REWORK -->|novo ciclo dentro da política| ORCH
|
|
733
|
+
|
|
734
|
+
classDef entry fill:#2563eb,color:#fff,stroke:#1d4ed8,stroke-width:2px;
|
|
735
|
+
classDef agent fill:#6d28d9,color:#fff,stroke:#a78bfa;
|
|
736
|
+
classDef executor fill:#1e3a8a,color:#fff,stroke:#60a5fa,stroke-width:2px;
|
|
737
|
+
classDef reviewer fill:#c2410c,color:#fff,stroke:#fb923c,stroke-width:2px;
|
|
738
|
+
classDef finalizer fill:#991b1b,color:#fff,stroke:#ef4444,stroke-width:2px;
|
|
739
|
+
classDef evidence fill:#0f766e,color:#fff,stroke:#2dd4bf;
|
|
740
|
+
classDef quality fill:#334155,color:#fff,stroke:#94a3b8;
|
|
741
|
+
classDef verify fill:#b45309,color:#fff,stroke:#fbbf24;
|
|
742
|
+
classDef success fill:#15803d,color:#fff,stroke:#4ade80,stroke-width:2px;
|
|
743
|
+
classDef warning fill:#a16207,color:#fff,stroke:#facc15;
|
|
744
|
+
classDef failure fill:#b91c1c,color:#fff,stroke:#f87171;
|
|
745
|
+
classDef neutral fill:#3f3f46,color:#fff,stroke:#a1a1aa;
|
|
746
|
+
classDef human fill:#172554,color:#fff,stroke:#60a5fa,stroke-dasharray:6 4;
|
|
747
|
+
|
|
748
|
+
class TASK entry;
|
|
749
|
+
class ORCH agent;
|
|
750
|
+
class EXECUTOR executor;
|
|
751
|
+
class REVIEWER reviewer;
|
|
752
|
+
class FINALIZER finalizer;
|
|
753
|
+
class EVIDENCE evidence;
|
|
754
|
+
class QUALITY quality;
|
|
755
|
+
class AUDITOR,VERIFIED,OUTCOME verify;
|
|
756
|
+
class DONE success;
|
|
757
|
+
class BLOCKED,REWORK warning;
|
|
758
|
+
class FAILED failure;
|
|
759
|
+
class CANCELLED neutral;
|
|
760
|
+
class HUMAN human;
|
|
761
|
+
\`\`\`
|
|
762
|
+
|
|
763
|
+
\`Falhado\` é reservado para impedimentos técnicos ou externos que tornam impossível continuar dentro da política configurada. Quando a condição é recuperável e apenas exige espera, use \`Bloqueado\`. \`Cancelado\` fica fora das decisões automáticas: ele registra somente uma ação humana explícita.
|
|
764
|
+
|
|
765
|
+
### Regras práticas de operação
|
|
766
|
+
|
|
767
|
+
#### Entrada e preparação
|
|
768
|
+
|
|
769
|
+
- **Conversation:** usa uma Execution \`interaction\` e termina em resposta, sem criar Task artificial.
|
|
770
|
+
- **Task direta:** a captura cria Task, Change e Execution e inicia a execução imediatamente.
|
|
771
|
+
- **Task preparada:** permanece em Pronto para Executar até o comando \`execute\`.
|
|
772
|
+
- **SPEC:** coordena a DAG de suas Tasks, mas cada Task mantém execução, Run e evidências próprias.
|
|
773
|
+
- **PRD:** coordena as SPECs selecionadas no PreparedPlan, sem fundir os seus lifecycles.
|
|
774
|
+
|
|
775
|
+
Task direta e Task preparada seguem a mesma trilha controlada, mas refinamentos e reworks podem criar novos ciclos de orquestração. Cada novo ciclo começa explicitamente por \`execute\`, \`resume\` ou \`rework\` e respeita os limites de retries e reparos da Execution.
|
|
776
|
+
|
|
777
|
+
O prepare automático atende somente uma Task sem dependências. Para uma DAG manual, construa e valide o plano antes de preparar a Task:
|
|
778
|
+
|
|
779
|
+
\`\`\`bash
|
|
780
|
+
zaip plan build --draft DRAFT.json --output PLAN.json
|
|
781
|
+
zaip plan validate --plan PLAN.json
|
|
782
|
+
zaip task prepare TASK-ID --plan PLAN.json
|
|
613
783
|
\`\`\`
|
|
614
784
|
|
|
615
|
-
|
|
785
|
+
Um PRD precisa ter pelo menos uma SPEC para chegar a \`ready\`, \`active\` ou \`delivered\`. A entrega considera apenas as SPECs selecionadas no seu PreparedPlan; SPECs fora desse plano não são encerradas implicitamente.
|
|
786
|
+
|
|
787
|
+
#### Refinamento Git-native
|
|
788
|
+
|
|
789
|
+
Enquanto PRD ou SPEC estiverem em \`draft\`, refine diretamente o Markdown versionado, incrementando \`revision\` e \`updated_at\`. Depois de \`prepare\`, não altere silenciosamente o plano materializado: uma mudança semântica exige a transição explícita suportada de volta para draft ou a criação de um novo draft.
|
|
790
|
+
|
|
791
|
+
#### Verificação e encerramento
|
|
792
|
+
|
|
793
|
+
Os Sub-Runs executores produzem a implementação enquanto Evidence e Decisions registram continuamente provas e escolhas relevantes. Tests, Checks e Evals formam camadas de validação antes de o \`Zaip Agent Reviewer\` verificar os Critérios de Aceite; o \`Zaip Agent Auditor\` pode executar uma checagem adicional. Somente depois dessas etapas o \`Zaip Agent Finalizer\` — papel canônico \`zaip-agent-finalizer\` — consolida o resultado já verificado e encerra a sequência de Sub-Runs como barreira final do ciclo.
|
|
794
|
+
|
|
795
|
+
Depois do Finalizer, encerre a Run raiz mantendo separados o status técnico da Run e o resultado funcional da Task:
|
|
796
|
+
|
|
797
|
+
\`\`\`bash
|
|
798
|
+
zaip run finish RUN-ID \\
|
|
799
|
+
--status completed \\
|
|
800
|
+
--task-outcome completed
|
|
801
|
+
zaip run closure RUN-ID
|
|
802
|
+
\`\`\`
|
|
803
|
+
|
|
804
|
+
Substitua \`completed\` em \`--task-outcome\` por \`blocked\`, \`failed\` ou \`cancelled\` quando esse for o resultado funcional verificado da Task.
|
|
805
|
+
|
|
806
|
+
Gates estruturais disponíveis incluem:
|
|
807
|
+
|
|
808
|
+
\`\`\`bash
|
|
809
|
+
zaip architecture validate
|
|
810
|
+
zaip modules validate
|
|
811
|
+
zaip profile validate
|
|
812
|
+
zaip cqrs validate # quando aplicável
|
|
813
|
+
\`\`\`
|
|
616
814
|
|
|
617
|
-
|
|
815
|
+
\`zaip run reconcile --open\` é um reparo global manual. No dashboard, ele só é executado depois de confirmação explícita no popup.
|
|
618
816
|
|
|
619
|
-
|
|
817
|
+
#### Observabilidade e projeções
|
|
620
818
|
|
|
621
|
-
|
|
819
|
+
Use \`zaip run list\` para navegar pelas Runs e \`zaip run aggregate\` para agregar tokens e custos no escopo desejado. O dashboard, o Kanban e o Cost Monitor são projeções do estado Git-native; eles não substituem os records canônicos.
|
|
622
820
|
|
|
623
|
-
|
|
821
|
+
Conversation, Planning e Execution permanecem separados. Tokens, custos, tempo, performance e rework podem ser analisados por Task, SPEC e PRD. Valores indisponíveis continuam como \`unknown\` ou \`null\`: totais, estimativas e cobertura nunca transformam ausência de telemetria em zero.
|
|
624
822
|
|
|
625
823
|
## Desenvolvimento do framework
|
|
626
824
|
|
|
@@ -1006,4 +1204,4 @@ The default profile enables official OpenAI developer documentation without cred
|
|
|
1006
1204
|
|
|
1007
1205
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=uo,s=!$a.jitless,c=s&&fo.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xc([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wc(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Eo(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ao(e,r,eo())))}),t)}var Tc=H(`$ZodUnion`,(e,t)=>{Bs.init(e,t),U(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),U(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),U(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),U(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ao(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>wc(t,r,e,i)):wc(o,r,e,i)}}),Ec=H(`$ZodIntersection`,(e,t)=>{Bs.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Oc(e,t,n)):Oc(e,i,a)}});function Dc(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(po(e)&&po(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dc(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dc(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Oc(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Eo(e))return e;let o=Dc(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var kc=H(`$ZodEnum`,(e,t)=>{Bs.init(e,t);let n=to(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ho.has(typeof e)).map(e=>typeof e==`string`?go(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ac=H(`$ZodTransform`,(e,t)=>{Bs.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qa(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Za;return n.value=i,n.fallback=!0,n}});function jc(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Mc=H(`$ZodOptional`,(e,t)=>{Bs.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,U(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ao(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>jc(e,r)):jc(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Nc=H(`$ZodExactOptional`,(e,t)=>{Mc.init(e,t),U(e._zod,`values`,()=>t.innerType._zod.values),U(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Pc=H(`$ZodNullable`,(e,t)=>{Bs.init(e,t),U(e._zod,`optin`,()=>t.innerType._zod.optin),U(e._zod,`optout`,()=>t.innerType._zod.optout),U(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ao(e.source)}|null)$`):void 0}),U(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Fc=H(`$ZodDefault`,(e,t)=>{Bs.init(e,t),e._zod.optin=`optional`,U(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ic(e,t)):Ic(r,t)}});function Ic(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Lc=H(`$ZodPrefault`,(e,t)=>{Bs.init(e,t),e._zod.optin=`optional`,U(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Rc=H(`$ZodNonOptional`,(e,t)=>{Bs.init(e,t),U(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>zc(t,e)):zc(i,e)}});function zc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Bc=H(`$ZodCatch`,(e,t)=>{Bs.init(e,t),e._zod.optin=`optional`,U(e._zod,`optout`,()=>t.innerType._zod.optout),U(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ao(e,n,eo()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ao(e,n,eo()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Vc=H(`$ZodPipe`,(e,t)=>{Bs.init(e,t),U(e._zod,`values`,()=>t.in._zod.values),U(e._zod,`optin`,()=>t.in._zod.optin),U(e._zod,`optout`,()=>t.out._zod.optout),U(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hc(e,t.in,n)):Hc(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hc(e,t.out,n)):Hc(r,t.out,n)}});function Hc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Uc=H(`$ZodReadonly`,(e,t)=>{Bs.init(e,t),U(e._zod,`propValues`,()=>t.innerType._zod.propValues),U(e._zod,`values`,()=>t.innerType._zod.values),U(e._zod,`optin`,()=>t.innerType?._zod?.optin),U(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wc):Wc(r)}});function Wc(e){return e.value=Object.freeze(e.value),e}var Gc=H(`$ZodCustom`,(e,t)=>{Es.init(e,t),Bs.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Kc(t,n,r,e));Kc(i,n,r,e)}});function Kc(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Mo(e))}}var qc,Jc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Yc(){return new Jc}(qc=globalThis).__zod_globalRegistry??(qc.__zod_globalRegistry=Yc());var Xc=globalThis.__zod_globalRegistry;function Zc(e,t){return new e({type:`string`,...K(t)})}function Qc(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...K(t)})}function $c(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...K(t)})}function el(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...K(t)})}function tl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...K(t)})}function nl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...K(t)})}function rl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...K(t)})}function il(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...K(t)})}function al(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...K(t)})}function ol(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...K(t)})}function sl(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...K(t)})}function cl(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...K(t)})}function ll(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...K(t)})}function ul(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...K(t)})}function dl(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...K(t)})}function fl(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...K(t)})}function pl(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...K(t)})}function ml(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...K(t)})}function hl(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...K(t)})}function gl(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...K(t)})}function _l(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...K(t)})}function vl(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...K(t)})}function yl(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...K(t)})}function bl(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...K(t)})}function xl(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...K(t)})}function Sl(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...K(t)})}function Cl(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...K(t)})}function wl(e){return new e({type:`unknown`})}function Tl(e,t){return new e({type:`never`,...K(t)})}function El(e,t){return new Ds({check:`max_length`,...K(t),maximum:e})}function Dl(e,t){return new Os({check:`min_length`,...K(t),minimum:e})}function Ol(e,t){return new ks({check:`length_equals`,...K(t),length:e})}function kl(e,t){return new js({check:`string_format`,format:`regex`,...K(t),pattern:e})}function Al(e){return new Ms({check:`string_format`,format:`lowercase`,...K(e)})}function jl(e){return new Ns({check:`string_format`,format:`uppercase`,...K(e)})}function Ml(e,t){return new Ps({check:`string_format`,format:`includes`,...K(t),includes:e})}function Nl(e,t){return new Fs({check:`string_format`,format:`starts_with`,...K(t),prefix:e})}function Pl(e,t){return new Is({check:`string_format`,format:`ends_with`,...K(t),suffix:e})}function Fl(e){return new Ls({check:`overwrite`,tx:e})}function Il(e){return Fl(t=>t.normalize(e))}function Ll(){return Fl(e=>e.trim())}function q(){return Fl(e=>e.toLowerCase())}function Rl(){return Fl(e=>e.toUpperCase())}function J(){return Fl(e=>G(e))}function Y(e,t,n){return new e({type:`array`,element:t,...K(n)})}function X(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...K(n)})}function zl(e,t){let n=Bl(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Mo(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Mo(r))}},e(t.value,t)),t);return n}function Bl(e,t){let n=new Es({check:`custom`,...K(t)});return n._zod.check=e,n}function Vl(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Xc,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Hl(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Hl(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Gl(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ul(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
1008
1206
|
|
|
1009
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Wl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ql(t,`input`,e.processors),output:ql(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Gl(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Gl(r.element,n);if(r.type===`set`)return Gl(r.valueType,n);if(r.type===`lazy`)return Gl(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Gl(r.innerType,n);if(r.type===`intersection`)return Gl(r.left,n)||Gl(r.right,n);if(r.type===`record`||r.type===`map`)return Gl(r.keyType,n)||Gl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Gl(r.in,n)||Gl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Gl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Gl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Gl(e,n))return!0;return!!(r.rest&&Gl(r.rest,n))}return!1}var Kl=(e,t={})=>n=>{let r=Vl({...n,processors:t});return Hl(e,r),Ul(r,e),Wl(r,e)},ql=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Vl({...i??{},target:a,io:t,processors:n});return Hl(e,o),Ul(o,e),Wl(o,e)},Jl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Yl=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Jl[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Xl=(e,t,n,r)=>{n.not={}},Zl=(e,t,n,r)=>{let i=e._zod.def,a=to(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ql=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},$l=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},eu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Hl(a.element,t,{...r,path:[...r.path,`items`]})},tu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Hl(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Hl(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},nu=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Hl(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ru=(e,t,n,r)=>{let i=e._zod.def,a=Hl(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Hl(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},iu=(e,t,n,r)=>{let i=e._zod.def,a=Hl(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},au=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ou=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},su=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},cu=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},lu=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Hl(o,t,r);let s=t.seen.get(e);s.ref=o},uu=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},du=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fu=H(`ZodISODateTime`,(e,t)=>{ec.init(e,t),zu.init(e,t)});function pu(e){return bl(fu,e)}var mu=H(`ZodISODate`,(e,t)=>{tc.init(e,t),zu.init(e,t)});function hu(e){return xl(mu,e)}var gu=H(`ZodISOTime`,(e,t)=>{nc.init(e,t),zu.init(e,t)});function _u(e){return Sl(gu,e)}var vu=H(`ZodISODuration`,(e,t)=>{rc.init(e,t),zu.init(e,t)});function yu(e){return Cl(vu,e)}var bu=H(`ZodError`,(e,t)=>{Po.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Lo(e,t)},flatten:{value:t=>Io(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,no,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,no,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),xu=Ro(bu),Su=zo(bu),Cu=Bo(bu),wu=Ho(bu),Tu=Wo(bu),Eu=Go(bu),Du=Ko(bu),Ou=qo(bu),ku=Jo(bu),Au=Yo(bu),ju=Xo(bu),Mu=Zo(bu),Nu=new WeakMap;function Pu(e,t,n){let r=Object.getPrototypeOf(e),i=Nu.get(r);if(i||(i=new Set,Nu.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Fu=H(`ZodType`,(e,t)=>(Bs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ql(e,`input`),output:ql(e,`output`)}}),e.toJSONSchema=Kl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>xu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Cu(e,t,n),e.parseAsync=async(t,n)=>Su(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>wu(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Tu(e,t,n),e.decode=(t,n)=>Eu(e,t,n),e.encodeAsync=async(t,n)=>Du(e,t,n),e.decodeAsync=async(t,n)=>Ou(e,t,n),e.safeEncode=(t,n)=>ku(e,t,n),e.safeDecode=(t,n)=>Au(e,t,n),e.safeEncodeAsync=async(t,n)=>ju(e,t,n),e.safeDecodeAsync=async(t,n)=>Mu(e,t,n),Pu(e,`ZodType`,{check(...e){let t=this.def;return this.clone(co(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _o(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ld(e,t))},superRefine(e,t){return this.check(Rd(e,t))},overwrite(e){return this.check(Fl(e))},optional(){return bd(this)},exactOptional(){return Sd(this)},nullable(){return wd(this)},nullish(){return bd(wd(this))},nonoptional(e){return Ad(this,e)},array(){return ld(this)},or(e){return pd([this,e])},and(e){return hd(this,e)},transform(e){return Nd(this,yd(e))},default(e){return Ed(this,e)},prefault(e){return Od(this,e)},catch(e){return Md(this,e)},pipe(e){return Nd(this,e)},readonly(){return Fd(this)},describe(e){let t=this.clone();return Xc.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xc.get(this);let t=this.clone();return Xc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Xc.get(e)?.description},configurable:!0}),e)),Iu=H(`_ZodString`,(e,t)=>{Vs.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Pu(e,`_ZodString`,{regex(...e){return this.check(kl(...e))},includes(...e){return this.check(Ml(...e))},startsWith(...e){return this.check(Nl(...e))},endsWith(...e){return this.check(Pl(...e))},min(...e){return this.check(Dl(...e))},max(...e){return this.check(El(...e))},length(...e){return this.check(Ol(...e))},nonempty(...e){return this.check(Dl(1,...e))},lowercase(e){return this.check(Al(e))},uppercase(e){return this.check(jl(e))},trim(){return this.check(Ll())},normalize(...e){return this.check(Il(...e))},toLowerCase(){return this.check(q())},toUpperCase(){return this.check(Rl())},slugify(){return this.check(J())}})}),Lu=H(`ZodString`,(e,t)=>{Vs.init(e,t),Iu.init(e,t),e.email=t=>e.check(Qc(Bu,t)),e.url=t=>e.check(il(Uu,t)),e.jwt=t=>e.check(yl(rd,t)),e.emoji=t=>e.check(al(Wu,t)),e.guid=t=>e.check($c(Vu,t)),e.uuid=t=>e.check(el(Hu,t)),e.uuidv4=t=>e.check(tl(Hu,t)),e.uuidv6=t=>e.check(nl(Hu,t)),e.uuidv7=t=>e.check(rl(Hu,t)),e.nanoid=t=>e.check(ol(Z,t)),e.guid=t=>e.check($c(Vu,t)),e.cuid=t=>e.check(sl(Gu,t)),e.cuid2=t=>e.check(cl(Ku,t)),e.ulid=t=>e.check(ll(qu,t)),e.base64=t=>e.check(gl(ed,t)),e.base64url=t=>e.check(_l(td,t)),e.xid=t=>e.check(ul(Ju,t)),e.ksuid=t=>e.check(dl(Yu,t)),e.ipv4=t=>e.check(fl(Xu,t)),e.ipv6=t=>e.check(pl(Zu,t)),e.cidrv4=t=>e.check(ml(Qu,t)),e.cidrv6=t=>e.check(hl($u,t)),e.e164=t=>e.check(vl(nd,t)),e.datetime=t=>e.check(pu(t)),e.date=t=>e.check(hu(t)),e.time=t=>e.check(_u(t)),e.duration=t=>e.check(yu(t))});function Ru(e){return Zc(Lu,e)}var zu=H(`ZodStringFormat`,(e,t)=>{Hs.init(e,t),Iu.init(e,t)}),Bu=H(`ZodEmail`,(e,t)=>{Gs.init(e,t),zu.init(e,t)}),Vu=H(`ZodGUID`,(e,t)=>{Us.init(e,t),zu.init(e,t)}),Hu=H(`ZodUUID`,(e,t)=>{Ws.init(e,t),zu.init(e,t)}),Uu=H(`ZodURL`,(e,t)=>{Ks.init(e,t),zu.init(e,t)}),Wu=H(`ZodEmoji`,(e,t)=>{qs.init(e,t),zu.init(e,t)}),Z=H(`ZodNanoID`,(e,t)=>{Js.init(e,t),zu.init(e,t)}),Gu=H(`ZodCUID`,(e,t)=>{Ys.init(e,t),zu.init(e,t)}),Ku=H(`ZodCUID2`,(e,t)=>{Xs.init(e,t),zu.init(e,t)}),qu=H(`ZodULID`,(e,t)=>{Zs.init(e,t),zu.init(e,t)}),Ju=H(`ZodXID`,(e,t)=>{Qs.init(e,t),zu.init(e,t)}),Yu=H(`ZodKSUID`,(e,t)=>{$s.init(e,t),zu.init(e,t)}),Xu=H(`ZodIPv4`,(e,t)=>{ic.init(e,t),zu.init(e,t)}),Zu=H(`ZodIPv6`,(e,t)=>{ac.init(e,t),zu.init(e,t)}),Qu=H(`ZodCIDRv4`,(e,t)=>{oc.init(e,t),zu.init(e,t)}),$u=H(`ZodCIDRv6`,(e,t)=>{sc.init(e,t),zu.init(e,t)}),ed=H(`ZodBase64`,(e,t)=>{lc.init(e,t),zu.init(e,t)}),td=H(`ZodBase64URL`,(e,t)=>{dc.init(e,t),zu.init(e,t)}),nd=H(`ZodE164`,(e,t)=>{fc.init(e,t),zu.init(e,t)}),rd=H(`ZodJWT`,(e,t)=>{mc.init(e,t),zu.init(e,t)}),id=H(`ZodUnknown`,(e,t)=>{hc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ad(){return wl(id)}var od=H(`ZodNever`,(e,t)=>{gc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xl(e,t,n,r)});function sd(e){return Tl(od,e)}var cd=H(`ZodArray`,(e,t)=>{vc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r),e.element=t.element,Pu(e,`ZodArray`,{min(e,t){return this.check(Dl(e,t))},nonempty(e){return this.check(Dl(1,e))},max(e,t){return this.check(El(e,t))},length(e,t){return this.check(Ol(e,t))},unwrap(){return this.element}})});function ld(e,t){return Y(cd,e,t)}var ud=H(`ZodObject`,(e,t)=>{Cc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tu(e,t,n,r),U(e,`shape`,()=>t.shape),Pu(e,`ZodObject`,{keyof(){return _d(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ad()})},loose(){return this.clone({...this._zod.def,catchall:ad()})},strict(){return this.clone({...this._zod.def,catchall:sd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xo(this,e)},safeExtend(e){return So(this,e)},merge(e){return Co(this,e)},pick(e){return yo(this,e)},omit(e){return bo(this,e)},partial(...e){return wo(Q,this,e[0])},required(...e){return To(kd,this,e[0])}})});function dd(e,t){return new ud({type:`object`,shape:e??{},...K(t)})}var fd=H(`ZodUnion`,(e,t)=>{Tc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nu(e,t,n,r),e.options=t.options});function pd(e,t){return new fd({type:`union`,options:e,...K(t)})}var md=H(`ZodIntersection`,(e,t)=>{Ec.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ru(e,t,n,r)});function hd(e,t){return new md({type:`intersection`,left:e,right:t})}var gd=H(`ZodEnum`,(e,t)=>{kc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zl(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new gd({...t,checks:[],...K(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new gd({...t,checks:[],...K(r),entries:i})}});function _d(e,t){return new gd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var vd=H(`ZodTransform`,(e,t)=>{Ac.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qa(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Mo(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Mo(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yd(e){return new vd({type:`transform`,transform:e})}var Q=H(`ZodOptional`,(e,t)=>{Mc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bd(e){return new Q({type:`optional`,innerType:e})}var xd=H(`ZodExactOptional`,(e,t)=>{Nc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sd(e){return new xd({type:`optional`,innerType:e})}var Cd=H(`ZodNullable`,(e,t)=>{Pc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wd(e){return new Cd({type:`nullable`,innerType:e})}var Td=H(`ZodDefault`,(e,t)=>{Fc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ou(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ed(e,t){return new Td({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():mo(t)}})}var Dd=H(`ZodPrefault`,(e,t)=>{Lc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>su(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Od(e,t){return new Dd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():mo(t)}})}var kd=H(`ZodNonOptional`,(e,t)=>{Rc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>au(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ad(e,t){return new kd({type:`nonoptional`,innerType:e,...K(t)})}var jd=H(`ZodCatch`,(e,t)=>{Bc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Md(e,t){return new jd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var $=H(`ZodPipe`,(e,t)=>{Vc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lu(e,t,n,r),e.in=t.in,e.out=t.out});function Nd(e,t){return new $({type:`pipe`,in:e,out:t})}var Pd=H(`ZodReadonly`,(e,t)=>{Uc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Pd({type:`readonly`,innerType:e})}var Id=H(`ZodCustom`,(e,t)=>{Gc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r)});function Ld(e,t={}){return X(Id,e,t)}function Rd(e,t){return zl(e,t)}var zd={health:`/api/v2/health`,snapshot:`/api/v2/snapshot`,reconcileOpenWork:`/api/v2/reconcile-open-work`,operations:`/api/v2/operations`,costMonitor:`/api/v2/cost-monitor`,prd:e=>`/api/v2/prds/${encodeURIComponent(e)}`,task:e=>`/api/v2/tasks/${encodeURIComponent(e)}`,taskTrace:e=>`/api/v2/tasks/${encodeURIComponent(e)}/trace`};dd({from:Ru().datetime({offset:!0}).nullable(),to:Ru().datetime({offset:!0}).nullable()}).strict();var Bd=class{token;constructor(e){this.token=e}operations(){return this.get(zd.operations)}costMonitor(e=`BRL`){return this.get(`${zd.costMonitor}?currency=${e}`)}snapshot(e=`BRL`){return this.get(`${zd.snapshot}?currency=${e}`)}reconcileOpenWork(e=`BRL`){return this.post(`${zd.reconcileOpenWork}?currency=${e}`)}task(e){return this.get(zd.task(e))}prd(e){return this.get(zd.prd(e))}taskTrace(e){return this.get(zd.taskTrace(e))}pricing(){return this.get(`/api/v2/pricing`)}async savePricing(e){let t=await fetch(`/api/v2/pricing`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify(e)});if(!t.ok)throw Error(`Pricing update failed with HTTP ${t.status}`);return await t.json()}fxRate(){return this.get(`/api/v2/fx-rate`)}async saveFxRate(e){let t=await fetch(`/api/v2/fx-rate`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify({rate:e})});if(!t.ok)throw Error(`FX update failed with HTTP ${t.status}`);return await t.json()}async get(e){let t=await fetch(e,{cache:`no-store`,headers:{"x-zaip-session":this.token}});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${t.status}`)}return await t.json()}async post(e){let t=await fetch(e,{method:`POST`,headers:{"x-zaip-session":this.token}});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${t.status}`)}return await t.json()}};function Vd({catalog:e,fxRate:t,locale:n,onClose:r,onSave:i,onSaveFxRate:a}){let o=za[n],[s,c]=(0,l.useState)(e),[u,d]=(0,l.useState)(t?.rate??0),[p,m]=(0,l.useState)(!1),h=(e,t)=>c(n=>({...n,models:n.models.map((n,r)=>r===e?{...n,...t}:n)})),g=e=>Math.max(0,Number(e)||0);return(0,f.jsx)(`main`,{className:`pricing-backdrop`,children:(0,f.jsxs)(`section`,{"aria-labelledby":`pricing-page-title`,className:`pricing-dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:o.eyebrow}),(0,f.jsx)(`h1`,{id:`pricing-page-title`,children:o.title}),(0,f.jsx)(`p`,{children:o.description})]}),(0,f.jsxs)(`button`,{className:`pricing-back-button`,onClick:r,type:`button`,children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` `,o.back]})]}),(0,f.jsxs)(`div`,{className:`pricing-fx-settings`,children:[(0,f.jsxs)(`div`,{className:`pricing-fx-copy`,children:[(0,f.jsx)(`strong`,{children:o.fxTitle}),(0,f.jsx)(`p`,{children:o.fxDescription})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:o.fxLabel}),(0,f.jsxs)(`div`,{className:`pricing-fx-input`,children:[(0,f.jsx)(`span`,{children:`R$`}),(0,f.jsx)(`input`,{"aria-label":o.fxAriaLabel,min:`0.0001`,onChange:e=>d(Math.max(1e-4,Number(e.target.value)||0)),step:`0.0001`,type:`number`,value:u})]})]})]}),(0,f.jsxs)(`div`,{className:`pricing-table-heading`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:o.catalog}),(0,f.jsx)(`p`,{children:o.pricesPerMillion})]}),(0,f.jsxs)(`span`,{children:[s.models.length,` `,o.models]})]}),(0,f.jsx)(`div`,{className:`pricing-table-wrap`,children:(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:o.model}),(0,f.jsx)(`th`,{children:o.provider}),(0,f.jsx)(`th`,{children:o.input}),(0,f.jsx)(`th`,{children:o.cache}),(0,f.jsx)(`th`,{children:o.output}),(0,f.jsx)(`th`,{children:o.reasoning}),(0,f.jsx)(`th`,{children:o.priorityInput}),(0,f.jsx)(`th`,{children:o.priorityCache}),(0,f.jsx)(`th`,{children:o.priorityOutput}),(0,f.jsx)(`th`,{children:o.priorityReasoning}),(0,f.jsx)(`th`,{children:o.contextLimit}),(0,f.jsx)(`th`,{children:o.inputMultiplier}),(0,f.jsx)(`th`,{children:o.outputMultiplier}),(0,f.jsx)(`th`,{})]})}),(0,f.jsx)(`tbody`,{children:s.models.map((e,t)=>(0,f.jsxs)(`tr`,{children:[(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`input`,{"aria-label":o.model,onChange:e=>h(t,{id:e.target.value}),value:e.id}),(0,f.jsx)(`small`,{children:e.aliases.join(`, `)||o.noAliases})]}),(0,f.jsx)(`td`,{children:(0,f.jsxs)(`select`,{onChange:e=>h(t,{provider:e.target.value}),value:e.provider,children:[(0,f.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,f.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{input_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.input_per_million_usd})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{cached_input_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.cached_input_per_million_usd??0})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{output_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.output_per_million_usd})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{reasoning_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.reasoning_per_million_usd??0})}),[`priority_input_per_million_usd`,`priority_cached_input_per_million_usd`,`priority_output_per_million_usd`,`priority_reasoning_per_million_usd`].map(n=>(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{[n]:g(e.target.value)}),step:`0.001`,type:`number`,value:e[n]??0})},n)),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{long_context_threshold_tokens:g(e.target.value)||null}),step:`1`,type:`number`,value:e.long_context_threshold_tokens??0})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0.001`,onChange:e=>h(t,{long_context_input_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_input_multiplier})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0.001`,onChange:e=>h(t,{long_context_output_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_output_multiplier})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`button`,{"aria-label":o.removeModel,onClick:()=>c(e=>({...e,models:e.models.filter((e,n)=>n!==t)})),type:`button`,children:`×`})})]},e.id))})]})}),(0,f.jsxs)(`footer`,{children:[(0,f.jsxs)(`button`,{onClick:()=>c(e=>({...e,models:[...e.models,Hd(n)]})),type:`button`,children:[`+ `,o.addModel]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`button`,{onClick:r,type:`button`,children:o.cancel}),(0,f.jsx)(`button`,{disabled:p,onClick:async()=>{m(!0);try{await i(s),await a(u),r()}finally{m(!1)}},type:`button`,children:p?o.saving:o.save})]})]})]})})}function Hd(e=`pt-BR`){let t=za[e];return{id:t.newModel,provider:`openai`,aliases:[],input_per_million_usd:0,cached_input_per_million_usd:0,output_per_million_usd:0,reasoning_per_million_usd:0,priority_input_per_million_usd:null,priority_cached_input_per_million_usd:null,priority_output_per_million_usd:null,priority_reasoning_per_million_usd:null,reasoning_billed_separately:!1,long_context_threshold_tokens:null,long_context_input_multiplier:1,long_context_output_multiplier:1,source_label:t.manualOverride,source_url:`https://developers.openai.com/api/docs/pricing`,notes:[t.editedNote]}}function Ud({locale:e,loadingTaskId:t,onSelectTask:n,onOpenChange:r,onOpenPrd:i,onOpenSpec:a,selectedTaskId:o,tasks:s,trace:c}){let l=[...s].sort((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at));return(0,f.jsxs)(`section`,{className:`traceability-workspace`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e===`pt-BR`?`Task selecionada`:`Selected task`}),(0,f.jsx)(`select`,{"aria-label":e===`pt-BR`?`Selecionar task por nome`:`Select task by name`,onChange:e=>n(e.target.value),value:o,children:l.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,f.jsx)(`small`,{children:e===`pt-BR`?`Selecione pelo nome para visualizar o ciclo completo sem precisar do ID.`:`Select by name to inspect the complete lifecycle without knowing the ID.`})]}),t?(0,f.jsx)(`div`,{"aria-live":`polite`,className:`traceability-workspace-loading`,children:e===`pt-BR`?`Carregando as 6 etapas…`:`Loading all 6 stages…`}):c?(0,f.jsx)(ca,{embedded:!0,locale:e,onClose:()=>void 0,onOpenChange:r,onOpenPrd:i,onOpenSpec:a,trace:c}):(0,f.jsx)(`p`,{children:e===`pt-BR`?`Nenhuma task disponível.`:`No task available.`})]})}var Wd=`/zaip-cost-monitor`,Gd=`/setup-pricing`,Kd=`zaip-dashboard-session-token`,qd=`zaip-dashboard-locale`,Jd=`zaip-dashboard-currency`;function Yd(){return window.localStorage.getItem(qd)===`en-US`?`en-US`:`pt-BR`}function Xd(e){return e.replace(/\/+$/,``)===Wd?`cost-monitor`:`operations`}function Zd({locale:e}){let t=e===`pt-BR`?[`Definição`,`Planejamento`,`Pronto para Executar`,`Execução`,`Verificação`]:[`Definition`,`Planning`,`Ready to Execute`,`Execution`,`Verification`];return(0,f.jsxs)(`main`,{"aria-busy":`true`,"aria-label":e===`pt-BR`?`Preparando dashboard`:`Preparing dashboard`,className:`app-skeleton`,children:[(0,f.jsxs)(`header`,{className:`app-skeleton-header`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,f.jsx)(`h1`,{children:`Dashboard Zaip AIOS`})]}),(0,f.jsxs)(`div`,{className:`app-skeleton-actions`,children:[(0,f.jsx)(`span`,{}),(0,f.jsx)(`span`,{}),(0,f.jsx)(`span`,{})]})]}),(0,f.jsx)(`section`,{className:`app-skeleton-kpis`,"aria-hidden":`true`,children:Array.from({length:4},(e,t)=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,f.jsx)(`span`,{className:`app-skeleton-value`}),(0,f.jsx)(`span`,{className:`app-skeleton-line`})]},t))}),(0,f.jsxs)(`section`,{className:`app-skeleton-panels`,"aria-hidden":`true`,children:[(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`div`,{className:`app-skeleton-chart`})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`div`,{className:`app-skeleton-chart app-skeleton-chart-small`})]})]}),(0,f.jsx)(`section`,{className:`app-skeleton-board`,"aria-hidden":`true`,children:t.map((e,t)=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`h2`,{children:e}),Array.from({length:t%2==0?2:1},(e,t)=>(0,f.jsxs)(`div`,{className:`app-skeleton-card`,children:[(0,f.jsx)(`span`,{className:`app-skeleton-line`}),(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`span`,{className:`app-skeleton-pill`})]},t))]},e))})]})}function Qd(){let e=(0,l.useMemo)(()=>{let e=new URL(window.location.href),t=e.searchParams.get(`token`)??window.localStorage.getItem(Kd)??window.sessionStorage.getItem(Kd)??``;return t&&(window.localStorage.setItem(Kd,t),window.sessionStorage.setItem(Kd,t)),e.searchParams.has(`token`)&&(e.searchParams.delete(`token`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`)),t},[]),t=(0,l.useMemo)(()=>new Bd(e),[e]),[n,r]=(0,l.useState)(()=>Xd(window.location.pathname)),[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(null),[c,u]=(0,l.useState)(null),[d,p]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),[g,_]=(0,l.useState)(null),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(Yd),[S,C]=(0,l.useState)(()=>window.localStorage.getItem(Jd)===`USD`?`USD`:`BRL`),[w,T]=(0,l.useState)(!1),[E,ee]=(0,l.useState)(null),[D,te]=(0,l.useState)(null),[O,ne]=(0,l.useState)(window.location.pathname),[k,re]=(0,l.useState)(!0),[A,j]=(0,l.useState)(null),[N,ie]=(0,l.useState)(null),[P,ae]=(0,l.useState)(null),[F,I]=(0,l.useState)({title:`Dashboard Zaip AIOS`,repositoryName:``}),L=(0,l.useCallback)(async(e=!0,n=!1)=>{e&&re(!0),ie(null);try{let e=n?await t.reconcileOpenWork(S):await t.snapshot(S);a(e.operations),s(e.costs),e.dashboard&&I({title:e.dashboard.title,repositoryName:e.dashboard.repository_name}),ae(e.projection.source_latest_at)}catch(e){ie(e instanceof Error?e.message:String(e))}finally{e&&re(!1)}},[t,S]),oe=async e=>{j(e?`reconciling`:`refreshing`),await L(!1,e),j(null)};(0,l.useEffect)(()=>{L();let e=window.setInterval(()=>void L(!1),5e3);return()=>window.clearInterval(e)},[L]),(0,l.useEffect)(()=>{window.localStorage.setItem(qd,b)},[b]),(0,l.useEffect)(()=>{window.localStorage.setItem(Jd,S)},[S]),(0,l.useEffect)(()=>{[`/`,Gd].includes(window.location.pathname)||(window.history.replaceState(null,``,`/${window.location.search}${window.location.hash}`),ne(`/`))},[]),(0,l.useEffect)(()=>{let e=()=>ne(window.location.pathname);return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,l.useEffect)(()=>{O!==Gd||E!==null||Promise.all([t.pricing(),t.fxRate()]).then(([e,t])=>{ee(e),te(t)}).catch(e=>ie(String(e)))},[t,O,E]);let se=e=>{window.history.pushState(null,``,e),ne(e),window.scrollTo({left:0,top:0})};async function ce(e){ie(null),u(null),_(e),await new Promise(e=>window.requestAnimationFrame(()=>e()));try{let n=await t.taskTrace(e),r=i?.tasks.find(t=>t.id===e);return u({...n,task_title:r?.title||n.task_title||e,task_risk:r?.risk||n.task_risk||null,task_created_at:r?.created_at||n.task_created_at||null,task_progress:r?.progress??n.task_progress??0}),!0}catch(e){return ie(e instanceof Error?e.message:String(e)),!1}finally{_(t=>t===e?null:t)}}function le(e){let t=i?.changes.find(t=>t.id===e);t!==void 0&&(u(null),h({kind:`change`,row:t}))}function ue(e,t){let n=(e===`PRD`?i?.prds:i?.specs)?.find(e=>e.id===t);n!==void 0&&(u(null),h({kind:`macro`,label:e,row:n}))}async function de(e){ie(null);try{p(await t.prd(e))}catch(e){ie(e instanceof Error?e.message:String(e))}}let fe=(0,f.jsx)(ma,{activeView:n,locale:b,onChange:e=>{if(r(e),window.scrollTo({left:0,top:0}),e===`traceability`){let e=i?.tasks.filter(e=>e.status===`completed`).toSorted((e,t)=>Date.parse(t.finished_at??t.updated_at)-Date.parse(e.finished_at??e.updated_at))[0];e&&(y(e.id),ce(e.id));return}u(null),_(null)}}),pe=(0,l.useMemo)(()=>new Map((o?.runs??[]).map(e=>[e.run_id,e.estimated_brl])),[o]);return O===Gd?E===null?(0,f.jsxs)(`main`,{className:`app-state`,children:[(0,f.jsx)(`p`,{children:b===`pt-BR`?`Configuração do projeto`:`Project settings`}),(0,f.jsx)(`h1`,{children:b===`pt-BR`?`Carregando catálogo de preços…`:`Loading pricing catalog…`}),(0,f.jsx)(`button`,{onClick:()=>se(`/`),type:`button`,children:b===`pt-BR`?`Voltar ao dashboard`:`Back to dashboard`})]}):(0,f.jsx)(Vd,{catalog:E,fxRate:D,locale:b,onClose:()=>se(`/`),onSave:async e=>{ee(await t.savePricing(e)),await L()},onSaveFxRate:async e=>{te(await t.saveFxRate(e)),await L()}}):N&&i===null?(0,f.jsxs)(`main`,{className:`app-state`,children:[(0,f.jsx)(`p`,{children:`Dashboard local indisponível`}),(0,f.jsx)(`h1`,{children:`Não foi possível ler o workspace V2.`}),(0,f.jsx)(`pre`,{children:N}),(0,f.jsx)(`button`,{onClick:()=>void L(),type:`button`,children:`Tentar novamente`})]}):i===null||o===null?(0,f.jsx)(Zd,{locale:b}):(0,f.jsxs)(f.Fragment,{children:[N?(0,f.jsxs)(`div`,{className:`app-warning`,role:`status`,children:[N,(0,f.jsx)(`button`,{onClick:()=>ie(null),type:`button`,children:`×`})]}):null,(0,f.jsx)(cr,{alternateContent:n===`cost-monitor`?e=>(0,f.jsx)(Ri,{currency:S,data:o,embedded:!0,globalFilters:e,lastUpdatedAt:P,locale:b,loading:k,onLocaleChange:x,onCurrencyChange:C,onOpenTrace:e=>void ce(e),onRefresh:()=>j(`choose`),operations:i}):n===`traceability`?()=>(0,f.jsx)(Ud,{loadingTaskId:g,locale:b,onSelectTask:e=>{y(e),ce(e)},onOpenChange:le,onOpenPrd:e=>ue(`PRD`,e),onOpenSpec:e=>ue(`SPEC`,e),selectedTaskId:v,tasks:i.tasks,trace:c}):void 0,capabilityNavigation:fe,data:i,dashboardTitle:F.title,repositoryName:F.repositoryName,loading:k,locale:b,resolveRunCostBrl:e=>pe.get(e)??null,onLocaleChange:x,onOpenPrdDocument:e=>void de(e),onOpenTask:ce,onRefresh:()=>j(`choose`),settings:(0,f.jsxs)(`div`,{className:`dashboard-global-settings`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:b===`pt-BR`?`Moeda`:`Currency`}),(0,f.jsxs)(`select`,{"aria-label":b===`pt-BR`?`Moeda`:`Currency`,onChange:e=>C(e.target.value),value:S,children:[(0,f.jsx)(`option`,{value:`BRL`,children:`BRL · Real brasileiro`}),(0,f.jsx)(`option`,{value:`USD`,children:`USD · US Dollar`})]})]}),(0,f.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>T(!0),type:`button`,children:b===`pt-BR`?`Abrir ajuda e guides`:`Open help and guides`}),(0,f.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>se(Gd),type:`button`,children:b===`pt-BR`?`Configurar preços e câmbio`:`Configure pricing and FX`})]})}),n===`traceability`?null:g?(0,f.jsx)(sa,{locale:b,taskId:g}):c?(0,f.jsx)(ca,{locale:b,onClose:()=>u(null),onOpenChange:le,onOpenPrd:e=>ue(`PRD`,e),onOpenSpec:e=>ue(`SPEC`,e),trace:c}):null,m?.kind===`change`?(0,f.jsx)(M,{details:{kind:`change`,row:m.row},locale:b,onClose:()=>h(null)}):null,m?.kind===`macro`?(0,f.jsx)(Gt,{label:m.label,locale:b,onClose:()=>h(null),onOpenDocument:e=>void de(e),onOpenTrace:e=>{h(null),ce(e)},row:m.row,runs:i.runs,specs:i.specs,tasks:i.tasks}):null,d?(0,f.jsx)(vr,{detail:d,locale:b,onClose:()=>p(null)}):null,w?(0,f.jsx)(Va,{locale:b,onClose:()=>T(!1)}):null,A===`choose`?(0,f.jsx)(`div`,{className:`app-refresh-dialog-backdrop`,children:(0,f.jsxs)(`section`,{"aria-label":`Atualizar dashboard`,"aria-modal":`true`,className:`app-refresh-dialog`,role:`dialog`,children:[(0,f.jsx)(`h2`,{children:b===`pt-BR`?`Atualizar dashboard`:`Refresh dashboard`}),(0,f.jsx)(`p`,{children:b===`pt-BR`?`Escolha uma atualização rápida ou reconcilie os itens que ainda estão em aberto.`:`Choose a quick refresh or reconcile work items that are still open.`}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`button`,{onClick:()=>void oe(!1),type:`button`,children:b===`pt-BR`?`Apenas atualizar dados`:`Refresh data only`}),(0,f.jsx)(`button`,{onClick:()=>void oe(!0),type:`button`,children:b===`pt-BR`?`Reconciliar itens abertos`:`Reconcile open work`})]}),(0,f.jsx)(`button`,{className:`app-refresh-cancel`,onClick:()=>j(null),type:`button`,children:b===`pt-BR`?`Cancelar`:`Cancel`})]})}):null,A===`refreshing`||A===`reconciling`?(0,f.jsxs)(`section`,{"aria-live":`polite`,className:`app-refresh-status`,role:`status`,children:[(0,f.jsx)(`i`,{}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:A===`reconciling`?b===`pt-BR`?`Reconciliando itens em aberto…`:`Reconciling open work…`:b===`pt-BR`?`Atualizando dados…`:`Refreshing data…`}),(0,f.jsx)(`span`,{children:b===`pt-BR`?`Você pode continuar usando o dashboard.`:`You can keep using the dashboard.`})]})]}):null]})}var $d=document.getElementById(`root`);if(!$d)throw Error(`Elemento #root não encontrado`);(0,u.createRoot)($d).render((0,f.jsx)(l.StrictMode,{children:(0,f.jsx)(Qd,{})}));
|
|
1207
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Wl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ql(t,`input`,e.processors),output:ql(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Gl(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Gl(r.element,n);if(r.type===`set`)return Gl(r.valueType,n);if(r.type===`lazy`)return Gl(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Gl(r.innerType,n);if(r.type===`intersection`)return Gl(r.left,n)||Gl(r.right,n);if(r.type===`record`||r.type===`map`)return Gl(r.keyType,n)||Gl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Gl(r.in,n)||Gl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Gl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Gl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Gl(e,n))return!0;return!!(r.rest&&Gl(r.rest,n))}return!1}var Kl=(e,t={})=>n=>{let r=Vl({...n,processors:t});return Hl(e,r),Ul(r,e),Wl(r,e)},ql=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Vl({...i??{},target:a,io:t,processors:n});return Hl(e,o),Ul(o,e),Wl(o,e)},Jl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Yl=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Jl[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Xl=(e,t,n,r)=>{n.not={}},Zl=(e,t,n,r)=>{let i=e._zod.def,a=to(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ql=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},$l=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},eu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Hl(a.element,t,{...r,path:[...r.path,`items`]})},tu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Hl(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Hl(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},nu=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Hl(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ru=(e,t,n,r)=>{let i=e._zod.def,a=Hl(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Hl(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},iu=(e,t,n,r)=>{let i=e._zod.def,a=Hl(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},au=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ou=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},su=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},cu=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},lu=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Hl(o,t,r);let s=t.seen.get(e);s.ref=o},uu=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},du=(e,t,n,r)=>{let i=e._zod.def;Hl(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fu=H(`ZodISODateTime`,(e,t)=>{ec.init(e,t),zu.init(e,t)});function pu(e){return bl(fu,e)}var mu=H(`ZodISODate`,(e,t)=>{tc.init(e,t),zu.init(e,t)});function hu(e){return xl(mu,e)}var gu=H(`ZodISOTime`,(e,t)=>{nc.init(e,t),zu.init(e,t)});function _u(e){return Sl(gu,e)}var vu=H(`ZodISODuration`,(e,t)=>{rc.init(e,t),zu.init(e,t)});function yu(e){return Cl(vu,e)}var bu=H(`ZodError`,(e,t)=>{Po.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Lo(e,t)},flatten:{value:t=>Io(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,no,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,no,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),xu=Ro(bu),Su=zo(bu),Cu=Bo(bu),wu=Ho(bu),Tu=Wo(bu),Eu=Go(bu),Du=Ko(bu),Ou=qo(bu),ku=Jo(bu),Au=Yo(bu),ju=Xo(bu),Mu=Zo(bu),Nu=new WeakMap;function Pu(e,t,n){let r=Object.getPrototypeOf(e),i=Nu.get(r);if(i||(i=new Set,Nu.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Fu=H(`ZodType`,(e,t)=>(Bs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ql(e,`input`),output:ql(e,`output`)}}),e.toJSONSchema=Kl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>xu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Cu(e,t,n),e.parseAsync=async(t,n)=>Su(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>wu(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Tu(e,t,n),e.decode=(t,n)=>Eu(e,t,n),e.encodeAsync=async(t,n)=>Du(e,t,n),e.decodeAsync=async(t,n)=>Ou(e,t,n),e.safeEncode=(t,n)=>ku(e,t,n),e.safeDecode=(t,n)=>Au(e,t,n),e.safeEncodeAsync=async(t,n)=>ju(e,t,n),e.safeDecodeAsync=async(t,n)=>Mu(e,t,n),Pu(e,`ZodType`,{check(...e){let t=this.def;return this.clone(co(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _o(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ld(e,t))},superRefine(e,t){return this.check(Rd(e,t))},overwrite(e){return this.check(Fl(e))},optional(){return bd(this)},exactOptional(){return Sd(this)},nullable(){return wd(this)},nullish(){return bd(wd(this))},nonoptional(e){return Ad(this,e)},array(){return ld(this)},or(e){return pd([this,e])},and(e){return hd(this,e)},transform(e){return Nd(this,yd(e))},default(e){return Ed(this,e)},prefault(e){return Od(this,e)},catch(e){return Md(this,e)},pipe(e){return Nd(this,e)},readonly(){return Fd(this)},describe(e){let t=this.clone();return Xc.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xc.get(this);let t=this.clone();return Xc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Xc.get(e)?.description},configurable:!0}),e)),Iu=H(`_ZodString`,(e,t)=>{Vs.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Pu(e,`_ZodString`,{regex(...e){return this.check(kl(...e))},includes(...e){return this.check(Ml(...e))},startsWith(...e){return this.check(Nl(...e))},endsWith(...e){return this.check(Pl(...e))},min(...e){return this.check(Dl(...e))},max(...e){return this.check(El(...e))},length(...e){return this.check(Ol(...e))},nonempty(...e){return this.check(Dl(1,...e))},lowercase(e){return this.check(Al(e))},uppercase(e){return this.check(jl(e))},trim(){return this.check(Ll())},normalize(...e){return this.check(Il(...e))},toLowerCase(){return this.check(q())},toUpperCase(){return this.check(Rl())},slugify(){return this.check(J())}})}),Lu=H(`ZodString`,(e,t)=>{Vs.init(e,t),Iu.init(e,t),e.email=t=>e.check(Qc(Bu,t)),e.url=t=>e.check(il(Uu,t)),e.jwt=t=>e.check(yl(rd,t)),e.emoji=t=>e.check(al(Wu,t)),e.guid=t=>e.check($c(Vu,t)),e.uuid=t=>e.check(el(Hu,t)),e.uuidv4=t=>e.check(tl(Hu,t)),e.uuidv6=t=>e.check(nl(Hu,t)),e.uuidv7=t=>e.check(rl(Hu,t)),e.nanoid=t=>e.check(ol(Z,t)),e.guid=t=>e.check($c(Vu,t)),e.cuid=t=>e.check(sl(Gu,t)),e.cuid2=t=>e.check(cl(Ku,t)),e.ulid=t=>e.check(ll(qu,t)),e.base64=t=>e.check(gl(ed,t)),e.base64url=t=>e.check(_l(td,t)),e.xid=t=>e.check(ul(Ju,t)),e.ksuid=t=>e.check(dl(Yu,t)),e.ipv4=t=>e.check(fl(Xu,t)),e.ipv6=t=>e.check(pl(Zu,t)),e.cidrv4=t=>e.check(ml(Qu,t)),e.cidrv6=t=>e.check(hl($u,t)),e.e164=t=>e.check(vl(nd,t)),e.datetime=t=>e.check(pu(t)),e.date=t=>e.check(hu(t)),e.time=t=>e.check(_u(t)),e.duration=t=>e.check(yu(t))});function Ru(e){return Zc(Lu,e)}var zu=H(`ZodStringFormat`,(e,t)=>{Hs.init(e,t),Iu.init(e,t)}),Bu=H(`ZodEmail`,(e,t)=>{Gs.init(e,t),zu.init(e,t)}),Vu=H(`ZodGUID`,(e,t)=>{Us.init(e,t),zu.init(e,t)}),Hu=H(`ZodUUID`,(e,t)=>{Ws.init(e,t),zu.init(e,t)}),Uu=H(`ZodURL`,(e,t)=>{Ks.init(e,t),zu.init(e,t)}),Wu=H(`ZodEmoji`,(e,t)=>{qs.init(e,t),zu.init(e,t)}),Z=H(`ZodNanoID`,(e,t)=>{Js.init(e,t),zu.init(e,t)}),Gu=H(`ZodCUID`,(e,t)=>{Ys.init(e,t),zu.init(e,t)}),Ku=H(`ZodCUID2`,(e,t)=>{Xs.init(e,t),zu.init(e,t)}),qu=H(`ZodULID`,(e,t)=>{Zs.init(e,t),zu.init(e,t)}),Ju=H(`ZodXID`,(e,t)=>{Qs.init(e,t),zu.init(e,t)}),Yu=H(`ZodKSUID`,(e,t)=>{$s.init(e,t),zu.init(e,t)}),Xu=H(`ZodIPv4`,(e,t)=>{ic.init(e,t),zu.init(e,t)}),Zu=H(`ZodIPv6`,(e,t)=>{ac.init(e,t),zu.init(e,t)}),Qu=H(`ZodCIDRv4`,(e,t)=>{oc.init(e,t),zu.init(e,t)}),$u=H(`ZodCIDRv6`,(e,t)=>{sc.init(e,t),zu.init(e,t)}),ed=H(`ZodBase64`,(e,t)=>{lc.init(e,t),zu.init(e,t)}),td=H(`ZodBase64URL`,(e,t)=>{dc.init(e,t),zu.init(e,t)}),nd=H(`ZodE164`,(e,t)=>{fc.init(e,t),zu.init(e,t)}),rd=H(`ZodJWT`,(e,t)=>{mc.init(e,t),zu.init(e,t)}),id=H(`ZodUnknown`,(e,t)=>{hc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ad(){return wl(id)}var od=H(`ZodNever`,(e,t)=>{gc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xl(e,t,n,r)});function sd(e){return Tl(od,e)}var cd=H(`ZodArray`,(e,t)=>{vc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r),e.element=t.element,Pu(e,`ZodArray`,{min(e,t){return this.check(Dl(e,t))},nonempty(e){return this.check(Dl(1,e))},max(e,t){return this.check(El(e,t))},length(e,t){return this.check(Ol(e,t))},unwrap(){return this.element}})});function ld(e,t){return Y(cd,e,t)}var ud=H(`ZodObject`,(e,t)=>{Cc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tu(e,t,n,r),U(e,`shape`,()=>t.shape),Pu(e,`ZodObject`,{keyof(){return _d(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ad()})},loose(){return this.clone({...this._zod.def,catchall:ad()})},strict(){return this.clone({...this._zod.def,catchall:sd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xo(this,e)},safeExtend(e){return So(this,e)},merge(e){return Co(this,e)},pick(e){return yo(this,e)},omit(e){return bo(this,e)},partial(...e){return wo(Q,this,e[0])},required(...e){return To(kd,this,e[0])}})});function dd(e,t){return new ud({type:`object`,shape:e??{},...K(t)})}var fd=H(`ZodUnion`,(e,t)=>{Tc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nu(e,t,n,r),e.options=t.options});function pd(e,t){return new fd({type:`union`,options:e,...K(t)})}var md=H(`ZodIntersection`,(e,t)=>{Ec.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ru(e,t,n,r)});function hd(e,t){return new md({type:`intersection`,left:e,right:t})}var gd=H(`ZodEnum`,(e,t)=>{kc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zl(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new gd({...t,checks:[],...K(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new gd({...t,checks:[],...K(r),entries:i})}});function _d(e,t){return new gd({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...K(t)})}var vd=H(`ZodTransform`,(e,t)=>{Ac.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qa(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Mo(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Mo(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yd(e){return new vd({type:`transform`,transform:e})}var Q=H(`ZodOptional`,(e,t)=>{Mc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bd(e){return new Q({type:`optional`,innerType:e})}var xd=H(`ZodExactOptional`,(e,t)=>{Nc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sd(e){return new xd({type:`optional`,innerType:e})}var Cd=H(`ZodNullable`,(e,t)=>{Pc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wd(e){return new Cd({type:`nullable`,innerType:e})}var Td=H(`ZodDefault`,(e,t)=>{Fc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ou(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ed(e,t){return new Td({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():mo(t)}})}var Dd=H(`ZodPrefault`,(e,t)=>{Lc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>su(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Od(e,t){return new Dd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():mo(t)}})}var kd=H(`ZodNonOptional`,(e,t)=>{Rc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>au(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ad(e,t){return new kd({type:`nonoptional`,innerType:e,...K(t)})}var jd=H(`ZodCatch`,(e,t)=>{Bc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Md(e,t){return new jd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var $=H(`ZodPipe`,(e,t)=>{Vc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lu(e,t,n,r),e.in=t.in,e.out=t.out});function Nd(e,t){return new $({type:`pipe`,in:e,out:t})}var Pd=H(`ZodReadonly`,(e,t)=>{Uc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Pd({type:`readonly`,innerType:e})}var Id=H(`ZodCustom`,(e,t)=>{Gc.init(e,t),Fu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r)});function Ld(e,t={}){return X(Id,e,t)}function Rd(e,t){return zl(e,t)}var zd={health:`/api/v2/health`,snapshot:`/api/v2/snapshot`,reconcileOpenWork:`/api/v2/reconcile-open-work`,operations:`/api/v2/operations`,costMonitor:`/api/v2/cost-monitor`,prd:e=>`/api/v2/prds/${encodeURIComponent(e)}`,spec:e=>`/api/v2/specs/${encodeURIComponent(e)}`,task:e=>`/api/v2/tasks/${encodeURIComponent(e)}`,taskTrace:e=>`/api/v2/tasks/${encodeURIComponent(e)}/trace`};dd({from:Ru().datetime({offset:!0}).nullable(),to:Ru().datetime({offset:!0}).nullable()}).strict();var Bd=class{token;constructor(e){this.token=e}operations(){return this.get(zd.operations)}costMonitor(e=`BRL`){return this.get(`${zd.costMonitor}?currency=${e}`)}snapshot(e=`BRL`){return this.get(`${zd.snapshot}?currency=${e}`)}reconcileOpenWork(e=`BRL`){return this.post(`${zd.reconcileOpenWork}?currency=${e}`)}task(e){return this.get(zd.task(e))}prd(e){return this.get(zd.prd(e))}spec(e){return this.get(zd.spec(e))}taskTrace(e){return this.get(zd.taskTrace(e))}pricing(){return this.get(`/api/v2/pricing`)}async savePricing(e){let t=await fetch(`/api/v2/pricing`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify(e)});if(!t.ok)throw Error(`Pricing update failed with HTTP ${t.status}`);return await t.json()}fxRate(){return this.get(`/api/v2/fx-rate`)}async saveFxRate(e){let t=await fetch(`/api/v2/fx-rate`,{method:`PUT`,headers:{"content-type":`application/json`,"x-zaip-session":this.token},body:JSON.stringify({rate:e})});if(!t.ok)throw Error(`FX update failed with HTTP ${t.status}`);return await t.json()}async get(e){let t=await fetch(e,{cache:`no-store`,headers:{"x-zaip-session":this.token}});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${t.status}`)}return await t.json()}async post(e){let t=await fetch(e,{method:`POST`,headers:{"x-zaip-session":this.token}});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Dashboard API failed with HTTP ${t.status}`)}return await t.json()}};function Vd({catalog:e,fxRate:t,locale:n,onClose:r,onSave:i,onSaveFxRate:a}){let o=za[n],[s,c]=(0,l.useState)(e),[u,d]=(0,l.useState)(t?.rate??0),[p,m]=(0,l.useState)(!1),h=(e,t)=>c(n=>({...n,models:n.models.map((n,r)=>r===e?{...n,...t}:n)})),g=e=>Math.max(0,Number(e)||0);return(0,f.jsx)(`main`,{className:`pricing-backdrop`,children:(0,f.jsxs)(`section`,{"aria-labelledby":`pricing-page-title`,className:`pricing-dialog`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`small`,{children:o.eyebrow}),(0,f.jsx)(`h1`,{id:`pricing-page-title`,children:o.title}),(0,f.jsx)(`p`,{children:o.description})]}),(0,f.jsxs)(`button`,{className:`pricing-back-button`,onClick:r,type:`button`,children:[(0,f.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` `,o.back]})]}),(0,f.jsxs)(`div`,{className:`pricing-fx-settings`,children:[(0,f.jsxs)(`div`,{className:`pricing-fx-copy`,children:[(0,f.jsx)(`strong`,{children:o.fxTitle}),(0,f.jsx)(`p`,{children:o.fxDescription})]}),(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:o.fxLabel}),(0,f.jsxs)(`div`,{className:`pricing-fx-input`,children:[(0,f.jsx)(`span`,{children:`R$`}),(0,f.jsx)(`input`,{"aria-label":o.fxAriaLabel,min:`0.0001`,onChange:e=>d(Math.max(1e-4,Number(e.target.value)||0)),step:`0.0001`,type:`number`,value:u})]})]})]}),(0,f.jsxs)(`div`,{className:`pricing-table-heading`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:o.catalog}),(0,f.jsx)(`p`,{children:o.pricesPerMillion})]}),(0,f.jsxs)(`span`,{children:[s.models.length,` `,o.models]})]}),(0,f.jsx)(`div`,{className:`pricing-table-wrap`,children:(0,f.jsxs)(`table`,{children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:o.model}),(0,f.jsx)(`th`,{children:o.provider}),(0,f.jsx)(`th`,{children:o.input}),(0,f.jsx)(`th`,{children:o.cache}),(0,f.jsx)(`th`,{children:o.output}),(0,f.jsx)(`th`,{children:o.reasoning}),(0,f.jsx)(`th`,{children:o.priorityInput}),(0,f.jsx)(`th`,{children:o.priorityCache}),(0,f.jsx)(`th`,{children:o.priorityOutput}),(0,f.jsx)(`th`,{children:o.priorityReasoning}),(0,f.jsx)(`th`,{children:o.contextLimit}),(0,f.jsx)(`th`,{children:o.inputMultiplier}),(0,f.jsx)(`th`,{children:o.outputMultiplier}),(0,f.jsx)(`th`,{})]})}),(0,f.jsx)(`tbody`,{children:s.models.map((e,t)=>(0,f.jsxs)(`tr`,{children:[(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`input`,{"aria-label":o.model,onChange:e=>h(t,{id:e.target.value}),value:e.id}),(0,f.jsx)(`small`,{children:e.aliases.join(`, `)||o.noAliases})]}),(0,f.jsx)(`td`,{children:(0,f.jsxs)(`select`,{onChange:e=>h(t,{provider:e.target.value}),value:e.provider,children:[(0,f.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,f.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{input_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.input_per_million_usd})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{cached_input_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.cached_input_per_million_usd??0})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{output_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.output_per_million_usd})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{reasoning_per_million_usd:g(e.target.value)}),step:`0.001`,type:`number`,value:e.reasoning_per_million_usd??0})}),[`priority_input_per_million_usd`,`priority_cached_input_per_million_usd`,`priority_output_per_million_usd`,`priority_reasoning_per_million_usd`].map(n=>(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{[n]:g(e.target.value)}),step:`0.001`,type:`number`,value:e[n]??0})},n)),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0`,onChange:e=>h(t,{long_context_threshold_tokens:g(e.target.value)||null}),step:`1`,type:`number`,value:e.long_context_threshold_tokens??0})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0.001`,onChange:e=>h(t,{long_context_input_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_input_multiplier})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`input`,{min:`0.001`,onChange:e=>h(t,{long_context_output_multiplier:Math.max(.001,Number(e.target.value)||1)}),step:`0.1`,type:`number`,value:e.long_context_output_multiplier})}),(0,f.jsx)(`td`,{children:(0,f.jsx)(`button`,{"aria-label":o.removeModel,onClick:()=>c(e=>({...e,models:e.models.filter((e,n)=>n!==t)})),type:`button`,children:`×`})})]},e.id))})]})}),(0,f.jsxs)(`footer`,{children:[(0,f.jsxs)(`button`,{onClick:()=>c(e=>({...e,models:[...e.models,Hd(n)]})),type:`button`,children:[`+ `,o.addModel]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`button`,{onClick:r,type:`button`,children:o.cancel}),(0,f.jsx)(`button`,{disabled:p,onClick:async()=>{m(!0);try{await i(s),await a(u),r()}finally{m(!1)}},type:`button`,children:p?o.saving:o.save})]})]})]})})}function Hd(e=`pt-BR`){let t=za[e];return{id:t.newModel,provider:`openai`,aliases:[],input_per_million_usd:0,cached_input_per_million_usd:0,output_per_million_usd:0,reasoning_per_million_usd:0,priority_input_per_million_usd:null,priority_cached_input_per_million_usd:null,priority_output_per_million_usd:null,priority_reasoning_per_million_usd:null,reasoning_billed_separately:!1,long_context_threshold_tokens:null,long_context_input_multiplier:1,long_context_output_multiplier:1,source_label:t.manualOverride,source_url:`https://developers.openai.com/api/docs/pricing`,notes:[t.editedNote]}}function Ud({locale:e,loadingTaskId:t,onSelectTask:n,onOpenChange:r,onOpenPrd:i,onOpenSpec:a,selectedTaskId:o,tasks:s,trace:c}){let l=[...s].sort((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at));return(0,f.jsxs)(`section`,{className:`traceability-workspace`,children:[(0,f.jsxs)(`header`,{children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{children:e===`pt-BR`?`Task selecionada`:`Selected task`}),(0,f.jsx)(`select`,{"aria-label":e===`pt-BR`?`Selecionar task por nome`:`Select task by name`,onChange:e=>n(e.target.value),value:o,children:l.map(e=>(0,f.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,f.jsx)(`small`,{children:e===`pt-BR`?`Selecione pelo nome para visualizar o ciclo completo sem precisar do ID.`:`Select by name to inspect the complete lifecycle without knowing the ID.`})]}),t?(0,f.jsx)(`div`,{"aria-live":`polite`,className:`traceability-workspace-loading`,children:e===`pt-BR`?`Carregando as 6 etapas…`:`Loading all 6 stages…`}):c?(0,f.jsx)(ca,{embedded:!0,locale:e,onClose:()=>void 0,onOpenChange:r,onOpenPrd:i,onOpenSpec:a,trace:c}):(0,f.jsx)(`p`,{children:e===`pt-BR`?`Nenhuma task disponível.`:`No task available.`})]})}var Wd=`/zaip-cost-monitor`,Gd=`/setup-pricing`,Kd=`zaip-dashboard-session-token`,qd=`zaip-dashboard-locale`,Jd=`zaip-dashboard-currency`;function Yd(){return window.localStorage.getItem(qd)===`en-US`?`en-US`:`pt-BR`}function Xd(e){return e.replace(/\/+$/,``)===Wd?`cost-monitor`:`operations`}function Zd({locale:e}){let t=e===`pt-BR`?[`Definição`,`Planejamento`,`Pronto para Executar`,`Execução`,`Verificação`]:[`Definition`,`Planning`,`Ready to Execute`,`Execution`,`Verification`];return(0,f.jsxs)(`main`,{"aria-busy":`true`,"aria-label":e===`pt-BR`?`Preparando dashboard`:`Preparing dashboard`,className:`app-skeleton`,children:[(0,f.jsxs)(`header`,{className:`app-skeleton-header`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,f.jsx)(`h1`,{children:`Dashboard Zaip AIOS`})]}),(0,f.jsxs)(`div`,{className:`app-skeleton-actions`,children:[(0,f.jsx)(`span`,{}),(0,f.jsx)(`span`,{}),(0,f.jsx)(`span`,{})]})]}),(0,f.jsx)(`section`,{className:`app-skeleton-kpis`,"aria-hidden":`true`,children:Array.from({length:4},(e,t)=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-short`}),(0,f.jsx)(`span`,{className:`app-skeleton-value`}),(0,f.jsx)(`span`,{className:`app-skeleton-line`})]},t))}),(0,f.jsxs)(`section`,{className:`app-skeleton-panels`,"aria-hidden":`true`,children:[(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`div`,{className:`app-skeleton-chart`})]}),(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`div`,{className:`app-skeleton-chart app-skeleton-chart-small`})]})]}),(0,f.jsx)(`section`,{className:`app-skeleton-board`,"aria-hidden":`true`,children:t.map((e,t)=>(0,f.jsxs)(`article`,{children:[(0,f.jsx)(`h2`,{children:e}),Array.from({length:t%2==0?2:1},(e,t)=>(0,f.jsxs)(`div`,{className:`app-skeleton-card`,children:[(0,f.jsx)(`span`,{className:`app-skeleton-line`}),(0,f.jsx)(`span`,{className:`app-skeleton-line app-skeleton-line-medium`}),(0,f.jsx)(`span`,{className:`app-skeleton-pill`})]},t))]},e))})]})}function Qd(){let e=(0,l.useMemo)(()=>{let e=new URL(window.location.href),t=e.searchParams.get(`token`)??window.localStorage.getItem(Kd)??window.sessionStorage.getItem(Kd)??``;return t&&(window.localStorage.setItem(Kd,t),window.sessionStorage.setItem(Kd,t)),e.searchParams.has(`token`)&&(e.searchParams.delete(`token`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`)),t},[]),t=(0,l.useMemo)(()=>new Bd(e),[e]),[n,r]=(0,l.useState)(()=>Xd(window.location.pathname)),[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(null),[c,u]=(0,l.useState)(null),[d,p]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),[g,_]=(0,l.useState)(null),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(Yd),[S,C]=(0,l.useState)(()=>window.localStorage.getItem(Jd)===`USD`?`USD`:`BRL`),[w,T]=(0,l.useState)(!1),[E,ee]=(0,l.useState)(null),[D,te]=(0,l.useState)(null),[O,ne]=(0,l.useState)(window.location.pathname),[k,re]=(0,l.useState)(!0),[A,j]=(0,l.useState)(null),[N,ie]=(0,l.useState)(null),[P,ae]=(0,l.useState)(null),[F,I]=(0,l.useState)({title:`Dashboard Zaip AIOS`,repositoryName:``}),L=(0,l.useCallback)(async(e=!0,n=!1)=>{e&&re(!0),ie(null);try{let e=n?await t.reconcileOpenWork(S):await t.snapshot(S);a(e.operations),s(e.costs),e.dashboard&&I({title:e.dashboard.title,repositoryName:e.dashboard.repository_name}),ae(e.projection.source_latest_at)}catch(e){ie(e instanceof Error?e.message:String(e))}finally{e&&re(!1)}},[t,S]),oe=async e=>{j(e?`reconciling`:`refreshing`),await L(!1,e),j(null)};(0,l.useEffect)(()=>{L();let e=window.setInterval(()=>void L(!1),5e3);return()=>window.clearInterval(e)},[L]),(0,l.useEffect)(()=>{window.localStorage.setItem(qd,b)},[b]),(0,l.useEffect)(()=>{window.localStorage.setItem(Jd,S)},[S]),(0,l.useEffect)(()=>{[`/`,Gd].includes(window.location.pathname)||(window.history.replaceState(null,``,`/${window.location.search}${window.location.hash}`),ne(`/`))},[]),(0,l.useEffect)(()=>{let e=()=>ne(window.location.pathname);return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,l.useEffect)(()=>{O!==Gd||E!==null||Promise.all([t.pricing(),t.fxRate()]).then(([e,t])=>{ee(e),te(t)}).catch(e=>ie(String(e)))},[t,O,E]);let se=e=>{window.history.pushState(null,``,e),ne(e),window.scrollTo({left:0,top:0})};async function ce(e){ie(null),u(null),_(e),await new Promise(e=>window.requestAnimationFrame(()=>e()));try{let n=await t.taskTrace(e),r=i?.tasks.find(t=>t.id===e);return u({...n,task_title:r?.title||n.task_title||e,task_risk:r?.risk||n.task_risk||null,task_created_at:r?.created_at||n.task_created_at||null,task_progress:r?.progress??n.task_progress??0}),!0}catch(e){return ie(e instanceof Error?e.message:String(e)),!1}finally{_(t=>t===e?null:t)}}function le(e){let t=i?.changes.find(t=>t.id===e);t!==void 0&&(u(null),h({kind:`change`,row:t}))}function ue(e,t){let n=(e===`PRD`?i?.prds:i?.specs)?.find(e=>e.id===t);n!==void 0&&(u(null),h({kind:`macro`,label:e,row:n}))}async function de(e,n){ie(null);try{p(e===`prd`?{label:`PRD`,detail:await t.prd(n)}:{label:`SPEC`,detail:await t.spec(n)})}catch(e){ie(e instanceof Error?e.message:String(e))}}let fe=(0,f.jsx)(ma,{activeView:n,locale:b,onChange:e=>{if(r(e),window.scrollTo({left:0,top:0}),e===`traceability`){let e=i?.tasks.filter(e=>e.status===`completed`).toSorted((e,t)=>Date.parse(t.finished_at??t.updated_at)-Date.parse(e.finished_at??e.updated_at))[0];e&&(y(e.id),ce(e.id));return}u(null),_(null)}}),pe=(0,l.useMemo)(()=>new Map((o?.runs??[]).map(e=>[e.run_id,e.estimated_brl])),[o]);return O===Gd?E===null?(0,f.jsxs)(`main`,{className:`app-state`,children:[(0,f.jsx)(`p`,{children:b===`pt-BR`?`Configuração do projeto`:`Project settings`}),(0,f.jsx)(`h1`,{children:b===`pt-BR`?`Carregando catálogo de preços…`:`Loading pricing catalog…`}),(0,f.jsx)(`button`,{onClick:()=>se(`/`),type:`button`,children:b===`pt-BR`?`Voltar ao dashboard`:`Back to dashboard`})]}):(0,f.jsx)(Vd,{catalog:E,fxRate:D,locale:b,onClose:()=>se(`/`),onSave:async e=>{ee(await t.savePricing(e)),await L()},onSaveFxRate:async e=>{te(await t.saveFxRate(e)),await L()}}):N&&i===null?(0,f.jsxs)(`main`,{className:`app-state`,children:[(0,f.jsx)(`p`,{children:`Dashboard local indisponível`}),(0,f.jsx)(`h1`,{children:`Não foi possível ler o workspace V2.`}),(0,f.jsx)(`pre`,{children:N}),(0,f.jsx)(`button`,{onClick:()=>void L(),type:`button`,children:`Tentar novamente`})]}):i===null||o===null?(0,f.jsx)(Zd,{locale:b}):(0,f.jsxs)(f.Fragment,{children:[N?(0,f.jsxs)(`div`,{className:`app-warning`,role:`status`,children:[N,(0,f.jsx)(`button`,{onClick:()=>ie(null),type:`button`,children:`×`})]}):null,(0,f.jsx)(cr,{alternateContent:n===`cost-monitor`?e=>(0,f.jsx)(Ri,{currency:S,data:o,embedded:!0,globalFilters:e,lastUpdatedAt:P,locale:b,loading:k,onLocaleChange:x,onCurrencyChange:C,onOpenTrace:e=>void ce(e),onRefresh:()=>j(`choose`),operations:i}):n===`traceability`?()=>(0,f.jsx)(Ud,{loadingTaskId:g,locale:b,onSelectTask:e=>{y(e),ce(e)},onOpenChange:le,onOpenPrd:e=>ue(`PRD`,e),onOpenSpec:e=>ue(`SPEC`,e),selectedTaskId:v,tasks:i.tasks,trace:c}):void 0,capabilityNavigation:fe,data:i,dashboardTitle:F.title,repositoryName:F.repositoryName,loading:k,locale:b,resolveRunCostBrl:e=>pe.get(e)??null,onLocaleChange:x,onOpenDocument:(e,t)=>void de(e,t),onOpenTask:ce,onRefresh:()=>j(`choose`),settings:(0,f.jsxs)(`div`,{className:`dashboard-global-settings`,children:[(0,f.jsxs)(`label`,{children:[(0,f.jsx)(`span`,{children:b===`pt-BR`?`Moeda`:`Currency`}),(0,f.jsxs)(`select`,{"aria-label":b===`pt-BR`?`Moeda`:`Currency`,onChange:e=>C(e.target.value),value:S,children:[(0,f.jsx)(`option`,{value:`BRL`,children:`BRL · Real brasileiro`}),(0,f.jsx)(`option`,{value:`USD`,children:`USD · US Dollar`})]})]}),(0,f.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>T(!0),type:`button`,children:b===`pt-BR`?`Abrir ajuda e guides`:`Open help and guides`}),(0,f.jsx)(`button`,{className:`dashboard-help-open`,onClick:()=>se(Gd),type:`button`,children:b===`pt-BR`?`Configurar preços e câmbio`:`Configure pricing and FX`})]})}),n===`traceability`?null:g?(0,f.jsx)(sa,{locale:b,taskId:g}):c?(0,f.jsx)(ca,{locale:b,onClose:()=>u(null),onOpenChange:le,onOpenPrd:e=>ue(`PRD`,e),onOpenSpec:e=>ue(`SPEC`,e),trace:c}):null,m?.kind===`change`?(0,f.jsx)(M,{details:{kind:`change`,row:m.row},locale:b,onClose:()=>h(null)}):null,m?.kind===`macro`?(0,f.jsx)(Gt,{label:m.label,locale:b,onClose:()=>h(null),onOpenDocument:(e,t)=>void de(e,t),onOpenTrace:e=>{h(null),ce(e)},row:m.row,runs:i.runs,specs:i.specs,tasks:i.tasks}):null,d?(0,f.jsx)(vr,{detail:d.detail,label:d.label,locale:b,onClose:()=>p(null)}):null,w?(0,f.jsx)(Va,{locale:b,onClose:()=>T(!1)}):null,A===`choose`?(0,f.jsx)(`div`,{className:`app-refresh-dialog-backdrop`,children:(0,f.jsxs)(`section`,{"aria-label":`Atualizar dashboard`,"aria-modal":`true`,className:`app-refresh-dialog`,role:`dialog`,children:[(0,f.jsx)(`h2`,{children:b===`pt-BR`?`Atualizar dashboard`:`Refresh dashboard`}),(0,f.jsx)(`p`,{children:b===`pt-BR`?`Escolha uma atualização rápida ou reconcilie os itens que ainda estão em aberto.`:`Choose a quick refresh or reconcile work items that are still open.`}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`button`,{onClick:()=>void oe(!1),type:`button`,children:b===`pt-BR`?`Apenas atualizar dados`:`Refresh data only`}),(0,f.jsx)(`button`,{onClick:()=>void oe(!0),type:`button`,children:b===`pt-BR`?`Reconciliar itens abertos`:`Reconcile open work`})]}),(0,f.jsx)(`button`,{className:`app-refresh-cancel`,onClick:()=>j(null),type:`button`,children:b===`pt-BR`?`Cancelar`:`Cancel`})]})}):null,A===`refreshing`||A===`reconciling`?(0,f.jsxs)(`section`,{"aria-live":`polite`,className:`app-refresh-status`,role:`status`,children:[(0,f.jsx)(`i`,{}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`strong`,{children:A===`reconciling`?b===`pt-BR`?`Reconciliando itens em aberto…`:`Reconciling open work…`:b===`pt-BR`?`Atualizando dados…`:`Refreshing data…`}),(0,f.jsx)(`span`,{children:b===`pt-BR`?`Você pode continuar usando o dashboard.`:`You can keep using the dashboard.`})]})]}):null]})}var $d=document.getElementById(`root`);if(!$d)throw Error(`Elemento #root não encontrado`);(0,u.createRoot)($d).render((0,f.jsx)(l.StrictMode,{children:(0,f.jsx)(Qd,{})}));
|